andoncloud-dashboard-toolkit 1.5.33 → 1.5.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/src/version.d.ts +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -12,5 +12,5 @@ return N.createElement("div",null,u)}var c=a[0]?this.getOptionValue(a[0]):"";/*#
|
|
|
12
12
|
return N.createElement("input",{name:o,type:"hidden",value:c})}}},{key:"renderLiveRegion",value:function(){var e=this.commonProps,n=this.state,t=n.ariaSelection,r=n.focusedOption,i=n.focusedValue,o=n.isFocused,a=n.selectValue,s=this.getFocusableOptions();/*#__PURE__*/
|
|
13
13
|
return N.createElement(Da,to({},e,{id:this.getElementId("live-region"),ariaSelection:t,focusedOption:r,focusedValue:i,isFocused:o,selectValue:a,focusableOptions:s,isAppleDevice:this.state.isAppleDevice}))}},{key:"render",value:function(){var e=this.getComponents(),n=e.Control,t=e.IndicatorsContainer,r=e.SelectContainer,i=e.ValueContainer,o=this.props,a=o.className,s=o.id,u=o.isDisabled,c=o.menuIsOpen,l=this.state.isFocused,d=this.commonProps=this.getCommonProps();/*#__PURE__*/
|
|
14
14
|
return N.createElement(r,to({},d,{className:a,innerProps:{id:s,onKeyDown:this.onKeyDown},isDisabled:u,isFocused:l}),this.renderLiveRegion(),/*#__PURE__*/N.createElement(n,to({},d,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:u,isFocused:l,menuIsOpen:c}),/*#__PURE__*/N.createElement(i,to({},d,{isDisabled:u}),this.renderPlaceholderOrValue(),this.renderInput()),/*#__PURE__*/N.createElement(t,to({},d,{isDisabled:u}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(e,n){var t=n.prevProps,r=n.clearFocusValueOnUpdate,i=n.inputIsHiddenAfterUpdate,o=n.ariaSelection,a=n.isFocused,s=n.prevWasFocused,u=n.instancePrefix,c=e.options,l=e.value,d=e.menuIsOpen,p=e.inputValue,f=e.isMulti,m=Wo(l),g={};if(t&&(l!==t.value||c!==t.options||d!==t.menuIsOpen||p!==t.inputValue)){var b=d?function(e,n){return ds(ls(e,n))}(e,m):[],h=d?ps(ls(e,m),"".concat(u,"-option")):[],v=r?function(e,n){var t=e.focusedValue,r=e.selectValue.indexOf(t);if(r>-1){if(n.indexOf(t)>-1)return t;if(r<n.length)return n[r]}return null}(n,m):null,I=function(e,n){var t=e.focusedOption;return t&&n.indexOf(t)>-1?t:n[0]}(n,b);g={selectValue:m,focusedOption:I,focusedOptionId:ms(h,I),focusableOptionsWithIds:h,focusedValue:v,clearFocusValueOnUpdate:!1}}var y=null!=i&&e!==t?{inputIsHidden:i,inputIsHiddenAfterUpdate:void 0}:{},C=o,x=a&&s;return a&&!x&&(C={value:Qo(f,m,m[0]||null),options:m,action:"initial-input-focus"},x=!s),"initial-input-focus"===(null==o?void 0:o.action)&&(C=null),qi(qi(qi({},g),y),{},{prevProps:e,ariaSelection:C,prevWasFocused:x})}}]),i}();xs.defaultProps=us;var As=/*#__PURE__*/e.forwardRef(function(n,t){var r=function(n){var t=n.defaultInputValue,r=void 0===t?"":t,i=n.defaultMenuIsOpen,o=void 0!==i&&i,a=n.defaultValue,s=void 0===a?null:a,u=n.inputValue,c=n.menuIsOpen,l=n.onChange,d=n.onInputChange,p=n.onMenuClose,f=n.onMenuOpen,m=n.value,g=eo(n,no),b=Ki(e.useState(void 0!==u?u:r),2),h=b[0],v=b[1],I=Ki(e.useState(void 0!==c?c:o),2),y=I[0],C=I[1],x=Ki(e.useState(void 0!==m?m:s),2),A=x[0],E=x[1],w=e.useCallback(function(e,n){"function"==typeof l&&l(e,n),E(e)},[l]),R=e.useCallback(function(e,n){var t;"function"==typeof d&&(t=d(e,n)),v(void 0!==t?t:e)},[d]),T=e.useCallback(function(){"function"==typeof f&&f(),C(!0)},[f]),S=e.useCallback(function(){"function"==typeof p&&p(),C(!1)},[p]),N=void 0!==u?u:h,O=void 0!==c?c:y,D=void 0!==m?m:A;return qi(qi({},g),{},{inputValue:N,menuIsOpen:O,onChange:w,onInputChange:R,onMenuClose:S,onMenuOpen:T,value:D})}(n);/*#__PURE__*/
|
|
15
|
-
return N.createElement(xs,to({ref:t},r))}),Es=As;const ws="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function Rs(e){const n=Object.prototype.toString.call(e);return"[object Window]"===n||"[object global]"===n}function Ts(e){return"nodeType"in e}function Ss(e){var n,t;return e?Rs(e)?e:Ts(e)&&null!=(n=null==(t=e.ownerDocument)?void 0:t.defaultView)?n:window:window}function Ns(e){const{Document:n}=Ss(e);return e instanceof n}function Os(e){return!Rs(e)&&e instanceof Ss(e).HTMLElement}function Ds(e){return e instanceof Ss(e).SVGElement}function Gs(e){return e?Rs(e)?e.document:Ts(e)?Ns(e)?e:Os(e)||Ds(e)?e.ownerDocument:document:document:document}const ks=ws?e.useLayoutEffect:e.useEffect;function Bs(n){const t=e.useRef(n);return ks(()=>{t.current=n}),e.useCallback(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)},[])}function Ps(n,t){void 0===t&&(t=[n]);const r=e.useRef(n);return ks(()=>{r.current!==n&&(r.current=n)},t),r}function Ms(n,t){const r=e.useRef();return e.useMemo(()=>{const e=n(r.current);return r.current=e,e},[...t])}function Vs(n){const t=Bs(n),r=e.useRef(null),i=e.useCallback(e=>{e!==r.current&&(null==t||t(e,r.current)),r.current=e},[]);return[r,i]}function Ws(n){const t=e.useRef();return e.useEffect(()=>{t.current=n},[n]),t.current}let Hs={};function Fs(n,t){return e.useMemo(()=>{if(t)return t;const e=null==Hs[n]?0:Hs[n]+1;return Hs[n]=e,n+"-"+e},[n,t])}function Xs(e){return function(n){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return r.reduce((n,t)=>{const r=Object.entries(t);for(const[t,i]of r){const r=n[t];null!=r&&(n[t]=r+e*i)}return n},{...n})}}const Ls=/*#__PURE__*/Xs(1),Zs=/*#__PURE__*/Xs(-1);function Ys(e){if(!e)return!1;const{KeyboardEvent:n}=Ss(e.target);return n&&e instanceof n}function js(e){if(function(e){if(!e)return!1;const{TouchEvent:n}=Ss(e.target);return n&&e instanceof n}(e)){if(e.touches&&e.touches.length){const{clientX:n,clientY:t}=e.touches[0];return{x:n,y:t}}if(e.changedTouches&&e.changedTouches.length){const{clientX:n,clientY:t}=e.changedTouches[0];return{x:n,y:t}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const Js=/*#__PURE__*/Object.freeze({Translate:{toString(e){if(!e)return;const{x:n,y:t}=e;return"translate3d("+(n?Math.round(n):0)+"px, "+(t?Math.round(t):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:n,scaleY:t}=e;return"scaleX("+n+") scaleY("+t+")"}},Transform:{toString(e){if(e)return[Js.Translate.toString(e),Js.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:n,duration:t,easing:r}=e;return n+" "+t+"ms "+r}}}),zs="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function _s(e){return e.matches(zs)?e:e.querySelector(zs)}const Us={display:"none"};function qs(e){let{id:n,value:t}=e;return S.default.createElement("div",{id:n,style:Us},t)}function Qs(e){let{id:n,announcement:t,ariaLiveType:r="assertive"}=e;return S.default.createElement("div",{id:n,style:{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"},role:"status","aria-live":r,"aria-atomic":!0},t)}const $s=/*#__PURE__*/e.createContext(null),Ks={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},eu={onDragStart(e){let{active:n}=e;return"Picked up draggable item "+n.id+"."},onDragOver(e){let{active:n,over:t}=e;return t?"Draggable item "+n.id+" was moved over droppable area "+t.id+".":"Draggable item "+n.id+" is no longer over a droppable area."},onDragEnd(e){let{active:n,over:t}=e;return t?"Draggable item "+n.id+" was dropped over droppable area "+t.id:"Draggable item "+n.id+" was dropped."},onDragCancel(e){let{active:n}=e;return"Dragging was cancelled. Draggable item "+n.id+" was dropped."}};function nu(n){let{announcements:t=eu,container:r,hiddenTextDescribedById:i,screenReaderInstructions:o=Ks}=n;const{announce:a,announcement:s}=function(){const[n,t]=e.useState("");return{announce:e.useCallback(e=>{null!=e&&t(e)},[]),announcement:n}}(),u=Fs("DndLiveRegion"),[c,l]=e.useState(!1);if(e.useEffect(()=>{l(!0)},[]),function(n){const t=e.useContext($s);e.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(n)},[n,t])}(e.useMemo(()=>({onDragStart(e){let{active:n}=e;a(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&a(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;a(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;a(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;a(t.onDragCancel({active:n,over:r}))}}),[a,t])),!c)return null;const d=S.default.createElement(S.default.Fragment,null,S.default.createElement(qs,{id:i,value:o.draggable}),S.default.createElement(Qs,{id:u,announcement:s}));return r?I.createPortal(d,r):d}var tu;function ru(){}!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"}(tu||(tu={}));const iu=/*#__PURE__*/Object.freeze({x:0,y:0});function ou(e,n){let{data:{value:t}}=e,{data:{value:r}}=n;return r-t}function au(e,n){const t=Math.max(n.top,e.top),r=Math.max(n.left,e.left),i=Math.min(n.left+n.width,e.left+e.width),o=Math.min(n.top+n.height,e.top+e.height);if(r<i&&t<o){const a=(i-r)*(o-t);return Number((a/(n.width*n.height+e.width*e.height-a)).toFixed(4))}return 0}const su=e=>{let{collisionRect:n,droppableRects:t,droppableContainers:r}=e;const i=[];for(const e of r){const{id:r}=e,o=t.get(r);if(o){const t=au(o,n);t>0&&i.push({id:r,data:{droppableContainer:e,value:t}})}}return i.sort(ou)};function uu(e,n){return e&&n?{x:e.left-n.left,y:e.top-n.top}:iu}function cu(e){return function(n){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return r.reduce((n,t)=>({...n,top:n.top+e*t.y,bottom:n.bottom+e*t.y,left:n.left+e*t.x,right:n.right+e*t.x}),{...n})}}const lu=/*#__PURE__*/cu(1),du={ignoreTransform:!1};function pu(e,n){void 0===n&&(n=du);let t=e.getBoundingClientRect();if(n.ignoreTransform){const{transform:n,transformOrigin:r}=Ss(e).getComputedStyle(e);n&&(t=function(e,n,t){const r=function(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]}}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}(n);if(!r)return e;const{scaleX:i,scaleY:o,x:a,y:s}=r,u=e.left-a-(1-i)*parseFloat(t),c=e.top-s-(1-o)*parseFloat(t.slice(t.indexOf(" ")+1)),l=i?e.width/i:e.width,d=o?e.height/o:e.height;return{width:l,height:d,top:c,right:u+l,bottom:c+d,left:u}}(t,n,r))}const{top:r,left:i,width:o,height:a,bottom:s,right:u}=t;return{top:r,left:i,width:o,height:a,bottom:s,right:u}}function fu(e){return pu(e,{ignoreTransform:!0})}function mu(e,n){const t=[];return e?function r(i){if(null!=n&&t.length>=n)return t;if(!i)return t;if(Ns(i)&&null!=i.scrollingElement&&!t.includes(i.scrollingElement))return t.push(i.scrollingElement),t;if(!Os(i)||Ds(i))return t;if(t.includes(i))return t;const o=Ss(e).getComputedStyle(i);return i!==e&&function(e,n){void 0===n&&(n=Ss(e).getComputedStyle(e));const t=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(e=>{const r=n[e];return"string"==typeof r&&t.test(r)})}(i,o)&&t.push(i),function(e,n){return void 0===n&&(n=Ss(e).getComputedStyle(e)),"fixed"===n.position}(i,o)?t:r(i.parentNode)}(e):t}function gu(e){const[n]=mu(e,1);return null!=n?n:null}function bu(e){return ws&&e?Rs(e)?e:Ts(e)?Ns(e)||e===Gs(e).scrollingElement?window:Os(e)?e:null:null:null}function hu(e){return Rs(e)?e.scrollX:e.scrollLeft}function vu(e){return Rs(e)?e.scrollY:e.scrollTop}function Iu(e){return{x:hu(e),y:vu(e)}}var yu;function Cu(e){return!(!ws||!e)&&e===document.scrollingElement}function xu(e){const n={x:0,y:0},t=Cu(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-t.width,y:e.scrollHeight-t.height};return{isTop:e.scrollTop<=n.y,isLeft:e.scrollLeft<=n.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:n}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(yu||(yu={}));const Au={x:.2,y:.2};function Eu(e,n,t,r,i){let{top:o,left:a,right:s,bottom:u}=t;void 0===r&&(r=10),void 0===i&&(i=Au);const{isTop:c,isBottom:l,isLeft:d,isRight:p}=xu(e),f={x:0,y:0},m={x:0,y:0},g=n.height*i.y,b=n.width*i.x;return!c&&o<=n.top+g?(f.y=yu.Backward,m.y=r*Math.abs((n.top+g-o)/g)):!l&&u>=n.bottom-g&&(f.y=yu.Forward,m.y=r*Math.abs((n.bottom-g-u)/g)),!p&&s>=n.right-b?(f.x=yu.Forward,m.x=r*Math.abs((n.right-b-s)/b)):!d&&a<=n.left+b&&(f.x=yu.Backward,m.x=r*Math.abs((n.left+b-a)/b)),{direction:f,speed:m}}function wu(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:n}=window;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}const{top:n,left:t,right:r,bottom:i}=e.getBoundingClientRect();return{top:n,left:t,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function Ru(e){return e.reduce((e,n)=>Ls(e,Iu(n)),iu)}const Tu=[["x",["left","right"],function(e){return e.reduce((e,n)=>e+hu(n),0)}],["y",["top","bottom"],function(e){return e.reduce((e,n)=>e+vu(n),0)}]];class Su{constructor(e,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const t=mu(n),r=Ru(t);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,n,i]of Tu)for(const o of n)Object.defineProperty(this,o,{get:()=>{const n=i(t);return this.rect[o]+(r[e]-n)},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Nu{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var n;return null==(n=this.target)?void 0:n.removeEventListener(...e)})},this.target=e}add(e,n,t){var r;null==(r=this.target)||r.addEventListener(e,n,t),this.listeners.push([e,n,t])}}function Ou(e,n){const t=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof n?Math.sqrt(t**2+r**2)>n:"x"in n&&"y"in n?t>n.x&&r>n.y:"x"in n?t>n.x:"y"in n&&r>n.y}var Du,Gu;function ku(e){e.preventDefault()}function Bu(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(Du||(Du={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"}(Gu||(Gu={}));const Pu={start:[Gu.Space,Gu.Enter],cancel:[Gu.Esc],end:[Gu.Space,Gu.Enter,Gu.Tab]},Mu=(e,n)=>{let{currentCoordinates:t}=n;switch(e.code){case Gu.Right:return{...t,x:t.x+25};case Gu.Left:return{...t,x:t.x-25};case Gu.Down:return{...t,y:t.y+25};case Gu.Up:return{...t,y:t.y-25}}};class Vu{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:n}}=e;this.props=e,this.listeners=new Nu(Gs(n)),this.windowListeners=new Nu(Ss(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Du.Resize,this.handleCancel),this.windowListeners.add(Du.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Du.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,t=e.node.current;t&&function(e,n){if(void 0===n&&(n=pu),!e)return;const{top:t,left:r,bottom:i,right:o}=n(e);gu(e)&&(i<=0||o<=0||t>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(t),n(iu)}handleKeyDown(e){if(Ys(e)){const{active:n,context:t,options:r}=this.props,{keyboardCodes:i=Pu,coordinateGetter:o=Mu,scrollBehavior:a="smooth"}=r,{code:s}=e;if(i.end.includes(s))return void this.handleEnd(e);if(i.cancel.includes(s))return void this.handleCancel(e);const{collisionRect:u}=t.current,c=u?{x:u.left,y:u.top}:iu;this.referenceCoordinates||(this.referenceCoordinates=c);const l=o(e,{active:n,context:t.current,currentCoordinates:c});if(l){const n=Zs(l,c),r={x:0,y:0},{scrollableAncestors:i}=t.current;for(const t of i){const i=e.code,{isTop:o,isRight:s,isLeft:u,isBottom:c,maxScroll:d,minScroll:p}=xu(t),f=wu(t),m={x:Math.min(i===Gu.Right?f.right-f.width/2:f.right,Math.max(i===Gu.Right?f.left:f.left+f.width/2,l.x)),y:Math.min(i===Gu.Down?f.bottom-f.height/2:f.bottom,Math.max(i===Gu.Down?f.top:f.top+f.height/2,l.y))},g=i===Gu.Down&&!c||i===Gu.Up&&!o;if((i===Gu.Right&&!s||i===Gu.Left&&!u)&&m.x!==l.x){const e=t.scrollLeft+n.x,o=i===Gu.Right&&e<=d.x||i===Gu.Left&&e>=p.x;if(o&&!n.y)return void t.scrollTo({left:e,behavior:a});r.x=o?t.scrollLeft-e:i===Gu.Right?t.scrollLeft-d.x:t.scrollLeft-p.x,r.x&&t.scrollBy({left:-r.x,behavior:a});break}if(g&&m.y!==l.y){const e=t.scrollTop+n.y,o=i===Gu.Down&&e<=d.y||i===Gu.Up&&e>=p.y;if(o&&!n.x)return void t.scrollTo({top:e,behavior:a});r.y=o?t.scrollTop-e:i===Gu.Down?t.scrollTop-d.y:t.scrollTop-p.y,r.y&&t.scrollBy({top:-r.y,behavior:a});break}}this.handleMove(e,Ls(Zs(l,this.referenceCoordinates),r))}}}handleMove(e,n){const{onMove:t}=this.props;e.preventDefault(),t(n)}handleEnd(e){const{onEnd:n}=this.props;e.preventDefault(),this.detach(),n()}handleCancel(e){const{onCancel:n}=this.props;e.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function Wu(e){return Boolean(e&&"distance"in e)}function Hu(e){return Boolean(e&&"delay"in e)}Vu.activators=[{eventName:"onKeyDown",handler:(e,n,t)=>{let{keyboardCodes:r=Pu,onActivation:i}=n,{active:o}=t;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const n=o.activatorNode.current;return!(n&&e.target!==n||(e.preventDefault(),null==i||i({event:e.nativeEvent}),0))}return!1}}];class Fu{constructor(e,n,t){var r;void 0===t&&(t=function(e){const{EventTarget:n}=Ss(e);return e instanceof n?e:Gs(e)}(e.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=e,this.events=n;const{event:i}=e,{target:o}=i;this.props=e,this.events=n,this.document=Gs(o),this.documentListeners=new Nu(this.document),this.listeners=new Nu(t),this.windowListeners=new Nu(Ss(o)),this.initialCoordinates=null!=(r=js(i))?r:iu,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:e,props:{options:{activationConstraint:n,bypassActivationConstraint:t}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(Du.Resize,this.handleCancel),this.windowListeners.add(Du.DragStart,ku),this.windowListeners.add(Du.VisibilityChange,this.handleCancel),this.windowListeners.add(Du.ContextMenu,ku),this.documentListeners.add(Du.Keydown,this.handleKeydown),n){if(null!=t&&t({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Hu(n))return this.timeoutId=setTimeout(this.handleStart,n.delay),void this.handlePending(n);if(Wu(n))return void this.handlePending(n)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,n){const{active:t,onPending:r}=this.props;r(t,e,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:e}=this,{onStart:n}=this.props;e&&(this.activated=!0,this.documentListeners.add(Du.Click,Bu,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Du.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:t,initialCoordinates:r,props:i}=this,{onMove:o,options:{activationConstraint:a}}=i;if(!r)return;const s=null!=(n=js(e))?n:iu,u=Zs(r,s);if(!t&&a){if(Wu(a)){if(null!=a.tolerance&&Ou(u,a.tolerance))return this.handleCancel();if(Ou(u,a.distance))return this.handleStart()}return Hu(a)&&Ou(u,a.tolerance)?this.handleCancel():void this.handlePending(a,u)}e.cancelable&&e.preventDefault(),o(s)}handleEnd(){const{onAbort:e,onEnd:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleCancel(){const{onAbort:e,onCancel:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleKeydown(e){e.code===Gu.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const Xu={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Lu extends Fu{constructor(e){const{event:n}=e,t=Gs(n.target);super(e,Xu,t)}}Lu.activators=[{eventName:"onPointerDown",handler:(e,n)=>{let{nativeEvent:t}=e,{onActivation:r}=n;return!(!t.isPrimary||0!==t.button||(null==r||r({event:t}),0))}}];const Zu={move:{name:"mousemove"},end:{name:"mouseup"}};var Yu;!function(e){e[e.RightClick=2]="RightClick"}(Yu||(Yu={})),class extends Fu{constructor(e){super(e,Zu,Gs(e.event.target))}}.activators=[{eventName:"onMouseDown",handler:(e,n)=>{let{nativeEvent:t}=e,{onActivation:r}=n;return t.button!==Yu.RightClick&&(null==r||r({event:t}),!0)}}];const ju={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var Ju,zu;(class extends Fu{constructor(e){super(e,ju)}static setup(){return window.addEventListener(ju.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(ju.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,n)=>{let{nativeEvent:t}=e,{onActivation:r}=n;const{touches:i}=t;return!(i.length>1||(null==r||r({event:t}),0))}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(Ju||(Ju={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(zu||(zu={}));const _u={x:{[yu.Backward]:!1,[yu.Forward]:!1},y:{[yu.Backward]:!1,[yu.Forward]:!1}};var Uu,qu;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(Uu||(Uu={})),function(e){e.Optimized="optimized"}(qu||(qu={}));const Qu=/*#__PURE__*/new Map;function $u(e,n){return Ms(t=>e?t||("function"==typeof n?n(e):e):null,[n,e])}function Ku(n){let{callback:t,disabled:r}=n;const i=Bs(t),o=e.useMemo(()=>{if(r||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(i)},[r]);return e.useEffect(()=>()=>null==o?void 0:o.disconnect(),[o]),o}function ec(e){return new Su(pu(e),e)}function nc(n,t,r){void 0===t&&(t=ec);const[i,o]=e.useState(null);function a(){o(e=>{if(!n)return null;var i;if(!1===n.isConnected)return null!=(i=null!=e?e:r)?i:null;const o=t(n);return JSON.stringify(e)===JSON.stringify(o)?e:o})}const s=function(n){let{callback:t,disabled:r}=n;const i=Bs(t),o=e.useMemo(()=>{if(r||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(i)},[i,r]);return e.useEffect(()=>()=>null==o?void 0:o.disconnect(),[o]),o}({callback(e){if(n)for(const t of e){const{type:e,target:r}=t;if("childList"===e&&r instanceof HTMLElement&&r.contains(n)){a();break}}}}),u=Ku({callback:a});return ks(()=>{a(),n?(null==u||u.observe(n),null==s||s.observe(document.body,{childList:!0,subtree:!0})):(null==u||u.disconnect(),null==s||s.disconnect())},[n]),i}const tc=[];function rc(n,t){void 0===t&&(t=[]);const r=e.useRef(null);return e.useEffect(()=>{r.current=null},t),e.useEffect(()=>{const e=n!==iu;e&&!r.current&&(r.current=n),!e&&r.current&&(r.current=null)},[n]),r.current?Zs(n,r.current):iu}function ic(n){return e.useMemo(()=>n?function(e){const n=e.innerWidth,t=e.innerHeight;return{top:0,left:0,right:n,bottom:t,width:n,height:t}}(n):null,[n])}const oc=[],ac=[{sensor:Lu,options:{}},{sensor:Vu,options:{}}],sc={current:{}},uc={draggable:{measure:fu},droppable:{measure:fu,strategy:Uu.WhileDragging,frequency:qu.Optimized},dragOverlay:{measure:pu}};class cc extends Map{get(e){var n;return null!=e&&null!=(n=super.get(e))?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:n}=e;return!n})}getNodeFor(e){var n,t;return null!=(n=null==(t=this.get(e))?void 0:t.node.current)?n:void 0}}const lc={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:/*#__PURE__*/new Map,droppableRects:/*#__PURE__*/new Map,droppableContainers:/*#__PURE__*/new cc,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:ru},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:uc,measureDroppableContainers:ru,windowRect:null,measuringScheduled:!1},dc=/*#__PURE__*/e.createContext({activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:ru,draggableNodes:/*#__PURE__*/new Map,over:null,measureDroppableContainers:ru}),pc=/*#__PURE__*/e.createContext(lc);function fc(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new cc}}}function mc(e,n){switch(n.type){case tu.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:n.initialCoordinates,active:n.active}};case tu.DragMove:return null==e.draggable.active?e:{...e,draggable:{...e.draggable,translate:{x:n.coordinates.x-e.draggable.initialCoordinates.x,y:n.coordinates.y-e.draggable.initialCoordinates.y}}};case tu.DragEnd:case tu.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case tu.RegisterDroppable:{const{element:t}=n,{id:r}=t,i=new cc(e.droppable.containers);return i.set(r,t),{...e,droppable:{...e.droppable,containers:i}}}case tu.SetDroppableDisabled:{const{id:t,key:r,disabled:i}=n,o=e.droppable.containers.get(t);if(!o||r!==o.key)return e;const a=new cc(e.droppable.containers);return a.set(t,{...o,disabled:i}),{...e,droppable:{...e.droppable,containers:a}}}case tu.UnregisterDroppable:{const{id:t,key:r}=n,i=e.droppable.containers.get(t);if(!i||r!==i.key)return e;const o=new cc(e.droppable.containers);return o.delete(t),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function gc(n){let{disabled:t}=n;const{active:r,activatorEvent:i,draggableNodes:o}=e.useContext(dc),a=Ws(i),s=Ws(null==r?void 0:r.id);return e.useEffect(()=>{if(!t&&!i&&a&&null!=s){if(!Ys(a))return;if(document.activeElement===a.target)return;const e=o.get(s);if(!e)return;const{activatorNode:n,node:t}=e;if(!n.current&&!t.current)return;requestAnimationFrame(()=>{for(const e of[n.current,t.current]){if(!e)continue;const n=_s(e);if(n){n.focus();break}}})}},[i,t,o,s,a]),null}const bc=/*#__PURE__*/e.createContext({...iu,scaleX:1,scaleY:1});var hc;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(hc||(hc={}));const vc=/*#__PURE__*/e.memo(function(n){var t,r,i,o;let{id:a,accessibility:s,autoScroll:u=!0,children:c,sensors:l=ac,collisionDetection:d=su,measuring:p,modifiers:f,...m}=n;const g=e.useReducer(mc,void 0,fc),[b,h]=g,[v,y]=function(){const[n]=e.useState(()=>new Set),t=e.useCallback(e=>(n.add(e),()=>n.delete(e)),[n]),r=e.useCallback(e=>{let{type:t,event:r}=e;n.forEach(e=>{var n;return null==(n=e[t])?void 0:n.call(e,r)})},[n]);return[r,t]}(),[C,x]=e.useState(hc.Uninitialized),A=C===hc.Initialized,{draggable:{active:E,nodes:w,translate:R},droppable:{containers:T}}=b,N=null!=E?w.get(E):null,O=e.useRef({initial:null,translated:null}),D=e.useMemo(()=>{var e;return null!=E?{id:E,data:null!=(e=null==N?void 0:N.data)?e:sc,rect:O}:null},[E,N]),G=e.useRef(null),[k,B]=e.useState(null),[P,M]=e.useState(null),V=Ps(m,Object.values(m)),W=Fs("DndDescribedBy",a),H=e.useMemo(()=>T.getEnabled(),[T]),F=function(n){return e.useMemo(()=>({draggable:{...uc.draggable,...null==n?void 0:n.draggable},droppable:{...uc.droppable,...null==n?void 0:n.droppable},dragOverlay:{...uc.dragOverlay,...null==n?void 0:n.dragOverlay}}),[null==n?void 0:n.draggable,null==n?void 0:n.droppable,null==n?void 0:n.dragOverlay])}(p),{droppableRects:X,measureDroppableContainers:L,measuringScheduled:Z}=function(n,t){let{dragging:r,dependencies:i,config:o}=t;const[a,s]=e.useState(null),{frequency:u,measure:c,strategy:l}=o,d=e.useRef(n),p=function(){switch(l){case Uu.Always:return!1;case Uu.BeforeDragging:return r;default:return!r}}(),f=Ps(p),m=e.useCallback(function(e){void 0===e&&(e=[]),f.current||s(n=>null===n?e:n.concat(e.filter(e=>!n.includes(e))))},[f]),g=e.useRef(null),b=Ms(e=>{if(p&&!r)return Qu;if(!e||e===Qu||d.current!==n||null!=a){const e=new Map;for(let t of n){if(!t)continue;if(a&&a.length>0&&!a.includes(t.id)&&t.rect.current){e.set(t.id,t.rect.current);continue}const n=t.node.current,r=n?new Su(c(n),n):null;t.rect.current=r,r&&e.set(t.id,r)}return e}return e},[n,a,r,p,c]);return e.useEffect(()=>{d.current=n},[n]),e.useEffect(()=>{p||m()},[r,p]),e.useEffect(()=>{a&&a.length>0&&s(null)},[JSON.stringify(a)]),e.useEffect(()=>{p||"number"!=typeof u||null!==g.current||(g.current=setTimeout(()=>{m(),g.current=null},u))},[u,p,m,...i]),{droppableRects:b,measureDroppableContainers:m,measuringScheduled:null!=a}}(H,{dragging:A,dependencies:[R.x,R.y],config:F.droppable}),Y=function(e,n){const t=null!=n?e.get(n):void 0,r=t?t.node.current:null;return Ms(e=>{var t;return null==n?null:null!=(t=null!=r?r:e)?t:null},[r,n])}(w,E),j=e.useMemo(()=>P?js(P):null,[P]),J=function(){const e=A&&!(!1===(null==k?void 0:k.autoScrollEnabled))&&!("object"==typeof u?!1===u.enabled:!1===u);return"object"==typeof u?{...u,enabled:e}:{enabled:e}}(),z=function(e,n){return $u(e,n)}(Y,F.draggable.measure);!function(n){let{activeNode:t,measure:r,initialRect:i,config:o=!0}=n;const a=e.useRef(!1),{x:s,y:u}="boolean"==typeof o?{x:o,y:o}:o;ks(()=>{if(!s&&!u||!t)return void(a.current=!1);if(a.current||!i)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const n=uu(r(e),i);if(s||(n.x=0),u||(n.y=0),a.current=!0,Math.abs(n.x)>0||Math.abs(n.y)>0){const t=gu(e);t&&t.scrollBy({top:n.y,left:n.x})}},[t,s,u,i,r])}({activeNode:null!=E?w.get(E):null,config:J.layoutShiftCompensation,initialRect:z,measure:F.draggable.measure});const _=nc(Y,F.draggable.measure,z),U=nc(Y?Y.parentElement:null),q=e.useRef({activatorEvent:null,active:null,activeNode:Y,collisionRect:null,collisions:null,droppableRects:X,draggableNodes:w,draggingNode:null,draggingNodeRect:null,droppableContainers:T,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Q=T.getNodeFor(null==(t=q.current.over)?void 0:t.id),$=function(n){let{measure:t}=n;const[r,i]=e.useState(null),o=e.useCallback(e=>{for(const{target:n}of e)if(Os(n)){i(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t]),a=Ku({callback:o}),s=e.useCallback(e=>{const n=function(e){if(!e)return null;if(e.children.length>1)return e;const n=e.children[0];return Os(n)?n:e}(e);null==a||a.disconnect(),n&&(null==a||a.observe(n)),i(n?t(n):null)},[t,a]),[u,c]=Vs(s);return e.useMemo(()=>({nodeRef:u,rect:r,setRef:c}),[r,u,c])}({measure:F.dragOverlay.measure}),K=null!=(r=$.nodeRef.current)?r:Y,ee=A?null!=(i=$.rect)?i:_:null,ne=Boolean($.nodeRef.current&&$.rect),te=uu(re=ne?null:_,$u(re));var re;const ie=ic(K?Ss(K):null),oe=function(n){const t=e.useRef(n),r=Ms(e=>n?e&&e!==tc&&n&&t.current&&n.parentNode===t.current.parentNode?e:mu(n):tc,[n]);return e.useEffect(()=>{t.current=n},[n]),r}(A?null!=Q?Q:Y:null),ae=function(n,t){void 0===t&&(t=pu);const[r]=n,i=ic(r?Ss(r):null),[o,a]=e.useState(oc);function s(){a(()=>n.length?n.map(e=>Cu(e)?i:new Su(t(e),e)):oc)}const u=Ku({callback:s});return ks(()=>{null==u||u.disconnect(),s(),n.forEach(e=>null==u?void 0:u.observe(e))},[n]),o}(oe),se=function(e,n){let{transform:t,...r}=n;return null!=e&&e.length?e.reduce((e,n)=>n({transform:e,...r}),t):t}(f,{transform:{x:R.x-te.x,y:R.y-te.y,scaleX:1,scaleY:1},activatorEvent:P,active:D,activeNodeRect:_,containerNodeRect:U,draggingNodeRect:ee,over:q.current.over,overlayNodeRect:$.rect,scrollableAncestors:oe,scrollableAncestorRects:ae,windowRect:ie}),ue=j?Ls(j,R):null,ce=function(n){const[t,r]=e.useState(null),i=e.useRef(n),o=e.useCallback(e=>{const n=bu(e.target);n&&r(e=>e?(e.set(n,Iu(n)),new Map(e)):null)},[]);return e.useEffect(()=>{const e=i.current;if(n!==e){t(e);const a=n.map(e=>{const n=bu(e);return n?(n.addEventListener("scroll",o,{passive:!0}),[n,Iu(n)]):null}).filter(e=>null!=e);r(a.length?new Map(a):null),i.current=n}return()=>{t(n),t(e)};function t(e){e.forEach(e=>{const n=bu(e);null==n||n.removeEventListener("scroll",o)})}},[o,n]),e.useMemo(()=>n.length?t?Array.from(t.values()).reduce((e,n)=>Ls(e,n),iu):Ru(n):iu,[n,t])}(oe),le=rc(ce),de=rc(ce,[_]),pe=Ls(se,le),fe=ee?lu(ee,se):null,me=D&&fe?d({active:D,collisionRect:fe,droppableRects:X,droppableContainers:H,pointerCoordinates:ue}):null,ge=function(e){if(!e||0===e.length)return null;const[n]=e;return n.id}(me),[be,he]=e.useState(null),ve=function(e,n,t){return{...e,scaleX:n&&t?n.width/t.width:1,scaleY:n&&t?n.height/t.height:1}}(ne?se:Ls(se,de),null!=(o=null==be?void 0:be.rect)?o:null,_),Ie=e.useRef(null),ye=e.useCallback((e,n)=>{let{sensor:t,options:r}=n;if(null==G.current)return;const i=w.get(G.current);if(!i)return;const o=e.nativeEvent,a=new t({active:G.current,activeNode:i,event:o,options:r,context:q,onAbort(e){if(!w.get(e))return;const{onDragAbort:n}=V.current,t={id:e};null==n||n(t),v({type:"onDragAbort",event:t})},onPending(e,n,t,r){if(!w.get(e))return;const{onDragPending:i}=V.current,o={id:e,constraint:n,initialCoordinates:t,offset:r};null==i||i(o),v({type:"onDragPending",event:o})},onStart(e){const n=G.current;if(null==n)return;const t=w.get(n);if(!t)return;const{onDragStart:r}=V.current,i={activatorEvent:o,active:{id:n,data:t.data,rect:O}};I.unstable_batchedUpdates(()=>{null==r||r(i),x(hc.Initializing),h({type:tu.DragStart,initialCoordinates:e,active:n}),v({type:"onDragStart",event:i}),B(Ie.current),M(o)})},onMove(e){h({type:tu.DragMove,coordinates:e})},onEnd:s(tu.DragEnd),onCancel:s(tu.DragCancel)});function s(e){return async function(){const{active:n,collisions:t,over:r,scrollAdjustedTranslate:i}=q.current;let a=null;if(n&&i){const{cancelDrop:s}=V.current;a={activatorEvent:o,active:n,collisions:t,delta:i,over:r},e===tu.DragEnd&&"function"==typeof s&&await Promise.resolve(s(a))&&(e=tu.DragCancel)}G.current=null,I.unstable_batchedUpdates(()=>{h({type:e}),x(hc.Uninitialized),he(null),B(null),M(null),Ie.current=null;const n=e===tu.DragEnd?"onDragEnd":"onDragCancel";if(a){const e=V.current[n];null==e||e(a),v({type:n,event:a})}})}}Ie.current=a},[w]),Ce=e.useCallback((e,n)=>(t,r)=>{const i=t.nativeEvent,o=w.get(r);null!==G.current||!o||i.dndKit||i.defaultPrevented||!0===e(t,n.options,{active:o})&&(i.dndKit={capturedBy:n.sensor},G.current=r,ye(t,n))},[w,ye]),xe=function(n,t){return e.useMemo(()=>n.reduce((e,n)=>{const{sensor:r}=n;return[...e,...r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}))]},[]),[n,t])}(l,Ce);!function(n){e.useEffect(()=>{if(!ws)return;const e=n.map(e=>{let{sensor:n}=e;return null==n.setup?void 0:n.setup()});return()=>{for(const n of e)null==n||n()}},n.map(e=>{let{sensor:n}=e;return n}))}(l),ks(()=>{_&&C===hc.Initializing&&x(hc.Initialized)},[_,C]),e.useEffect(()=>{const{onDragMove:e}=V.current,{active:n,activatorEvent:t,collisions:r,over:i}=q.current;if(!n||!t)return;const o={active:n,activatorEvent:t,collisions:r,delta:{x:pe.x,y:pe.y},over:i};I.unstable_batchedUpdates(()=>{null==e||e(o),v({type:"onDragMove",event:o})})},[pe.x,pe.y]),e.useEffect(()=>{const{active:e,activatorEvent:n,collisions:t,droppableContainers:r,scrollAdjustedTranslate:i}=q.current;if(!e||null==G.current||!n||!i)return;const{onDragOver:o}=V.current,a=r.get(ge),s=a&&a.rect.current?{id:a.id,rect:a.rect.current,data:a.data,disabled:a.disabled}:null,u={active:e,activatorEvent:n,collisions:t,delta:{x:i.x,y:i.y},over:s};I.unstable_batchedUpdates(()=>{he(s),null==o||o(u),v({type:"onDragOver",event:u})})},[ge]),ks(()=>{q.current={activatorEvent:P,active:D,activeNode:Y,collisionRect:fe,collisions:me,droppableRects:X,draggableNodes:w,draggingNode:K,draggingNodeRect:ee,droppableContainers:T,over:be,scrollableAncestors:oe,scrollAdjustedTranslate:pe},O.current={initial:ee,translated:fe}},[D,Y,me,fe,w,K,ee,X,T,be,oe,pe]),function(n){let{acceleration:t,activator:r=Ju.Pointer,canScroll:i,draggingRect:o,enabled:a,interval:s=5,order:u=zu.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:d,delta:p,threshold:f}=n;const m=function(e){let{delta:n,disabled:t}=e;const r=Ws(n);return Ms(e=>{if(t||!r||!e)return _u;const i=Math.sign(n.x-r.x),o=Math.sign(n.y-r.y);return{x:{[yu.Backward]:e.x[yu.Backward]||-1===i,[yu.Forward]:e.x[yu.Forward]||1===i},y:{[yu.Backward]:e.y[yu.Backward]||-1===o,[yu.Forward]:e.y[yu.Forward]||1===o}}},[t,n,r])}({delta:p,disabled:!a}),[g,b]=function(){const n=e.useRef(null);return[e.useCallback((e,t)=>{n.current=setInterval(e,t)},[]),e.useCallback(()=>{null!==n.current&&(clearInterval(n.current),n.current=null)},[])]}(),h=e.useRef({x:0,y:0}),v=e.useRef({x:0,y:0}),I=e.useMemo(()=>{switch(r){case Ju.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Ju.DraggableRect:return o}},[r,o,c]),y=e.useRef(null),C=e.useCallback(()=>{const e=y.current;e&&e.scrollBy(h.current.x*v.current.x,h.current.y*v.current.y)},[]),x=e.useMemo(()=>u===zu.TreeOrder?[...l].reverse():l,[u,l]);e.useEffect(()=>{if(a&&l.length&&I){for(const e of x){if(!1===(null==i?void 0:i(e)))continue;const n=l.indexOf(e),r=d[n];if(!r)continue;const{direction:o,speed:a}=Eu(e,r,I,t,f);for(const e of["x","y"])m[e][o[e]]||(a[e]=0,o[e]=0);if(a.x>0||a.y>0)return b(),y.current=e,g(C,s),h.current=a,void(v.current=o)}h.current={x:0,y:0},v.current={x:0,y:0},b()}else b()},[t,C,i,b,a,s,JSON.stringify(I),JSON.stringify(m),g,l,x,d,JSON.stringify(f)])}({...J,delta:R,draggingRect:fe,pointerCoordinates:ue,scrollableAncestors:oe,scrollableAncestorRects:ae});const Ae=e.useMemo(()=>({active:D,activeNode:Y,activeNodeRect:_,activatorEvent:P,collisions:me,containerNodeRect:U,dragOverlay:$,draggableNodes:w,droppableContainers:T,droppableRects:X,over:be,measureDroppableContainers:L,scrollableAncestors:oe,scrollableAncestorRects:ae,measuringConfiguration:F,measuringScheduled:Z,windowRect:ie}),[D,Y,_,P,me,U,$,w,T,X,be,L,oe,ae,F,Z,ie]),Ee=e.useMemo(()=>({activatorEvent:P,activators:xe,active:D,activeNodeRect:_,ariaDescribedById:{draggable:W},dispatch:h,draggableNodes:w,over:be,measureDroppableContainers:L}),[P,xe,D,_,h,W,w,be,L]);return S.default.createElement($s.Provider,{value:y},S.default.createElement(dc.Provider,{value:Ee},S.default.createElement(pc.Provider,{value:Ae},S.default.createElement(bc.Provider,{value:ve},c)),S.default.createElement(gc,{disabled:!1===(null==s?void 0:s.restoreFocus)})),S.default.createElement(nu,{...s,hiddenTextDescribedById:W}))}),Ic=/*#__PURE__*/e.createContext(null),yc="button",Cc={timeout:25};function xc(e,n,t){const r=e.slice();return r.splice(t<0?r.length+t:t,0,r.splice(n,1)[0]),r}function Ac(e,n){return e.reduce((e,t,r)=>{const i=n.get(t);return i&&(e[r]=i),e},Array(e.length))}function Ec(e){return null!==e&&e>=0}const wc=e=>{let{rects:n,activeIndex:t,overIndex:r,index:i}=e;const o=xc(n,r,t),a=n[i],s=o[i];return s&&a?{x:s.left-a.left,y:s.top-a.top,scaleX:s.width/a.width,scaleY:s.height/a.height}:null},Rc="Sortable",Tc=/*#__PURE__*/S.default.createContext({activeIndex:-1,containerId:Rc,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:wc,disabled:{draggable:!1,droppable:!1}});function Sc(n){let{children:t,id:r,items:i,strategy:o=wc,disabled:a=!1}=n;const{active:s,dragOverlay:u,droppableRects:c,over:l,measureDroppableContainers:d}=e.useContext(pc),p=Fs(Rc,r),f=Boolean(null!==u.rect),m=e.useMemo(()=>i.map(e=>"object"==typeof e&&"id"in e?e.id:e),[i]),g=null!=s,b=s?m.indexOf(s.id):-1,h=l?m.indexOf(l.id):-1,v=e.useRef(m),I=!function(e,n){if(e===n)return!0;if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t]!==n[t])return!1;return!0}(m,v.current),y=-1!==h&&-1===b||I,C=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(a);ks(()=>{I&&g&&d(m)},[I,m,g,d]),e.useEffect(()=>{v.current=m},[m]);const x=e.useMemo(()=>({activeIndex:b,containerId:p,disabled:C,disableTransforms:y,items:m,overIndex:h,useDragOverlay:f,sortedRects:Ac(m,c),strategy:o}),[b,p,C.draggable,C.droppable,y,m,h,c,f,o]);return S.default.createElement(Tc.Provider,{value:x},t)}const Nc=e=>{let{id:n,items:t,activeIndex:r,overIndex:i}=e;return xc(t,r,i).indexOf(n)},Oc=e=>{let{containerId:n,isSorting:t,wasDragging:r,index:i,items:o,newIndex:a,previousItems:s,previousContainerId:u,transition:c}=e;return!(!c||!r||s!==o&&i===a||!t&&(a===i||n!==u))},Dc={duration:200,easing:"ease"},Gc="transform",kc=/*#__PURE__*/Js.Transition.toString({property:Gc,duration:0,easing:"linear"}),Bc={roleDescription:"sortable"};var Pc=function(n){var t=function(n){let{animateLayoutChanges:t=Oc,attributes:r,disabled:i,data:o,getNewIndex:a=Nc,id:s,strategy:u,resizeObserverConfig:c,transition:l=Dc}=n;const{items:d,containerId:p,activeIndex:f,disabled:m,disableTransforms:g,sortedRects:b,overIndex:h,useDragOverlay:v,strategy:I}=e.useContext(Tc),y=function(e,n){var t,r;return"boolean"==typeof e?{draggable:e,droppable:!1}:{draggable:null!=(t=null==e?void 0:e.draggable)?t:n.draggable,droppable:null!=(r=null==e?void 0:e.droppable)?r:n.droppable}}(i,m),C=d.indexOf(s),x=e.useMemo(()=>({sortable:{containerId:p,index:C,items:d},...o}),[p,o,C,d]),A=e.useMemo(()=>d.slice(d.indexOf(s)),[d,s]),{rect:E,node:w,isOver:R,setNodeRef:T}=function(n){let{data:t,disabled:r=!1,id:i,resizeObserverConfig:o}=n;const a=Fs("Droppable"),{active:s,dispatch:u,over:c,measureDroppableContainers:l}=e.useContext(dc),d=e.useRef({disabled:r}),p=e.useRef(!1),f=e.useRef(null),m=e.useRef(null),{disabled:g,updateMeasurementsFor:b,timeout:h}={...Cc,...o},v=Ps(null!=b?b:i),I=Ku({callback:e.useCallback(()=>{p.current?(null!=m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{l(Array.isArray(v.current)?v.current:[v.current]),m.current=null},h)):p.current=!0},[h]),disabled:g||!s}),y=e.useCallback((e,n)=>{I&&(n&&(I.unobserve(n),p.current=!1),e&&I.observe(e))},[I]),[C,x]=Vs(y),A=Ps(t);return e.useEffect(()=>{I&&C.current&&(I.disconnect(),p.current=!1,I.observe(C.current))},[C,I]),e.useEffect(()=>(u({type:tu.RegisterDroppable,element:{id:i,key:a,disabled:r,node:C,rect:f,data:A}}),()=>u({type:tu.UnregisterDroppable,key:a,id:i})),[i]),e.useEffect(()=>{r!==d.current.disabled&&(u({type:tu.SetDroppableDisabled,id:i,key:a,disabled:r}),d.current.disabled=r)},[i,a,r,u]),{active:s,rect:f,isOver:(null==c?void 0:c.id)===i,node:C,over:c,setNodeRef:x}}({id:s,data:x,disabled:y.droppable,resizeObserverConfig:{updateMeasurementsFor:A,...c}}),{active:S,activatorEvent:N,activeNodeRect:O,attributes:D,setNodeRef:G,listeners:k,isDragging:B,over:P,setActivatorNodeRef:M,transform:V}=function(n){let{id:t,data:r,disabled:i=!1,attributes:o}=n;const a=Fs("Draggable"),{activators:s,activatorEvent:u,active:c,activeNodeRect:l,ariaDescribedById:d,draggableNodes:p,over:f}=e.useContext(dc),{role:m=yc,roleDescription:g="draggable",tabIndex:b=0}=null!=o?o:{},h=(null==c?void 0:c.id)===t,v=e.useContext(h?bc:Ic),[I,y]=Vs(),[C,x]=Vs(),A=function(n,t){return e.useMemo(()=>n.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[n,t])}(s,t),E=Ps(r);return ks(()=>(p.set(t,{id:t,key:a,node:I,activatorNode:C,data:E}),()=>{const e=p.get(t);e&&e.key===a&&p.delete(t)}),[p,t]),{active:c,activatorEvent:u,activeNodeRect:l,attributes:e.useMemo(()=>({role:m,tabIndex:b,"aria-disabled":i,"aria-pressed":!(!h||m!==yc)||void 0,"aria-roledescription":g,"aria-describedby":d.draggable}),[i,m,b,h,g,d.draggable]),isDragging:h,listeners:i?void 0:A,node:I,over:f,setNodeRef:y,setActivatorNodeRef:x,transform:v}}({id:s,data:x,attributes:{...Bc,...r},disabled:y.draggable}),W=function(){for(var n=arguments.length,t=new Array(n),r=0;r<n;r++)t[r]=arguments[r];return e.useMemo(()=>e=>{t.forEach(n=>n(e))},t)}(T,G),H=Boolean(S),F=H&&!g&&Ec(f)&&Ec(h),X=!v&&B,L=X&&F?V:null,Z=F?null!=L?L:(null!=u?u:I)({rects:b,activeNodeRect:O,activeIndex:f,overIndex:h,index:C}):null,Y=Ec(f)&&Ec(h)?a({id:s,items:d,activeIndex:f,overIndex:h}):C,j=null==S?void 0:S.id,J=e.useRef({activeId:j,items:d,newIndex:Y,containerId:p}),z=d!==J.current.items,_=t({active:S,containerId:p,isDragging:B,isSorting:H,id:s,index:C,items:d,newIndex:J.current.newIndex,previousItems:J.current.items,previousContainerId:J.current.containerId,transition:l,wasDragging:null!=J.current.activeId}),U=function(n){let{disabled:t,index:r,node:i,rect:o}=n;const[a,s]=e.useState(null),u=e.useRef(r);return ks(()=>{if(!t&&r!==u.current&&i.current){const e=o.current;if(e){const n=pu(i.current,{ignoreTransform:!0}),t={x:e.left-n.left,y:e.top-n.top,scaleX:e.width/n.width,scaleY:e.height/n.height};(t.x||t.y)&&s(t)}}r!==u.current&&(u.current=r)},[t,r,i,o]),e.useEffect(()=>{a&&s(null)},[a]),a}({disabled:!_,index:C,node:w,rect:E});return e.useEffect(()=>{H&&J.current.newIndex!==Y&&(J.current.newIndex=Y),p!==J.current.containerId&&(J.current.containerId=p),d!==J.current.items&&(J.current.items=d)},[H,Y,p,d]),e.useEffect(()=>{if(j===J.current.activeId)return;if(null!=j&&null==J.current.activeId)return void(J.current.activeId=j);const e=setTimeout(()=>{J.current.activeId=j},50);return()=>clearTimeout(e)},[j]),{active:S,activeIndex:f,attributes:D,data:x,rect:E,index:C,newIndex:Y,items:d,isOver:R,isSorting:H,isDragging:B,listeners:k,node:w,overIndex:h,over:P,setNodeRef:W,setActivatorNodeRef:M,setDroppableNodeRef:T,setDraggableNodeRef:G,transform:null!=U?U:Z,transition:U||z&&J.current.newIndex===C?kc:X&&!Ys(N)||!l?void 0:H||_?Js.Transition.toString({...l,property:Gc}):void 0}}({id:n.data.value}),r=t.attributes,i=t.listeners,o=t.setNodeRef,a=t.transition,s={display:"flex",transform:Js.Transform.toString(t.transform),transition:a};/*#__PURE__*/return S.default.createElement("div",L({ref:o,style:s},r,i,{onPointerDown:function(e){e.target instanceof HTMLElement&&(["svg","path"].includes(e.target.nodeName)&&(e.preventDefault(),e.stopPropagation()),null==i||i.onPointerDown(e))}}),/*#__PURE__*/S.default.createElement(Ea.MultiValueContainer,n))},Mc=function(e){var n=L({},e.innerProps,{style:{cursor:"grab"},onMouseDown:function(e){e.preventDefault(),e.stopPropagation()}});/*#__PURE__*/return S.default.createElement(Ea.MultiValueLabel,L({},e,{innerProps:n}))},Vc=Hi(function(e,n){var t,r,i,o="[object Map]",a="[object Promise]",s="[object Set]",u="[object WeakMap]",c="[object DataView]",l=/^\[object .+?Constructor\]$/,d="object"==typeof self&&self&&self.Object===Object&&self,p="object"==typeof Vi&&Vi&&Vi.Object===Object&&Vi||d||Function("return this")(),f=n&&!n.nodeType&&n,m=f&&e&&!e.nodeType&&e,g=m&&m.exports===f,b=Function.prototype,h=Object.prototype,v=p["__core-js_shared__"],I=(t=/[^.]+$/.exec(v&&v.keys&&v.keys.IE_PROTO||""))?"Symbol(src)_1."+t:"",y=b.toString,C=h.hasOwnProperty,x=h.toString,A=RegExp("^"+y.call(C).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),E=g?p.Buffer:void 0,w=h.propertyIsEnumerable,R=E?E.isBuffer:void 0,T=(r=Object.keys,i=Object,function(e){return r(i(e))}),S=H(p,"DataView"),N=H(p,"Map"),O=H(p,"Promise"),D=H(p,"Set"),G=H(p,"WeakMap"),k=!w.call({valueOf:1},"valueOf"),B=X(S),P=X(N),M=X(O),V=X(D),W=X(G);function H(e,n){var t=function(e,n){return null==e?void 0:e[n]}(e,n);return function(e){if(!J(e)||function(e){return!!I&&I in e}(e))return!1;var n=j(e)||function(e){var n=!1;if(null!=e&&"function"!=typeof e.toString)try{n=!!(e+"")}catch(e){}return n}(e)?A:l;return n.test(X(e))}(t)?t:void 0}var F=function(e){return x.call(e)};function X(e){if(null!=e){try{return y.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(S&&F(new S(new ArrayBuffer(1)))!=c||N&&F(new N)!=o||O&&F(O.resolve())!=a||D&&F(new D)!=s||G&&F(new G)!=u)&&(F=function(e){var n=x.call(e),t="[object Object]"==n?e.constructor:void 0,r=t?X(t):void 0;if(r)switch(r){case B:return c;case P:return o;case M:return a;case V:return s;case W:return u}return n});var L=Array.isArray;function Z(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}(e.length)&&!j(e)}var Y=R||function(){return!1};function j(e){var n=J(e)?x.call(e):"";return"[object Function]"==n||"[object GeneratorFunction]"==n}function J(e){var n=typeof e;return!!e&&("object"==n||"function"==n)}e.exports=function(e){if(Z(e)&&(L(e)||"string"==typeof e||"function"==typeof e.splice||Y(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Z(e)}(e)&&C.call(e,"callee")&&(!w.call(e,"callee")||"[object Arguments]"==x.call(e))}(e)))return!e.length;var n=F(e);if(n==o||n==s)return!e.size;if(k||function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||h)}(e))return!T(e).length;for(var t in e)if(C.call(e,t))return!1;return!0}}),Wc=function(e,n){return Wc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)n.hasOwnProperty(t)&&(e[t]=n[t])},Wc(e,n)};function Hc(e,n){function t(){this.constructor=e}Wc(e,n),e.prototype=null===n?Object.create(n):(t.prototype=n.prototype,new t)}function Fc(e){return"function"==typeof e}var Xc=!1,Lc={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){Xc=e},get useDeprecatedSynchronousErrorHandling(){return Xc}};function Zc(e){setTimeout(function(){throw e},0)}var Yc={closed:!0,next:function(e){},error:function(e){if(Lc.useDeprecatedSynchronousErrorHandling)throw e;Zc(e)},complete:function(){}},jc=/*@__PURE__*/function(){return Array.isArray||function(e){return e&&"number"==typeof e.length}}();function Jc(e){return null!==e&&"object"==typeof e}var zc=/*@__PURE__*/function(){function e(e){return Error.call(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map(function(e,n){return n+1+") "+e.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=e,this}return e.prototype=/*@__PURE__*/Object.create(Error.prototype),e}(),_c=zc,Uc=/*@__PURE__*/function(){function e(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}return e.prototype.unsubscribe=function(){var n;if(!this.closed){var t=this,r=t._parentOrParents,i=t._ctorUnsubscribe,o=t._unsubscribe,a=t._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,r instanceof e)r.remove(this);else if(null!==r)for(var s=0;s<r.length;++s)r[s].remove(this);if(Fc(o)){i&&(this._unsubscribe=void 0);try{o.call(this)}catch(e){n=e instanceof _c?qc(e.errors):[e]}}if(jc(a)){s=-1;for(var u=a.length;++s<u;){var c=a[s];if(Jc(c))try{c.unsubscribe()}catch(e){n=n||[],e instanceof _c?n=n.concat(qc(e.errors)):n.push(e)}}}if(n)throw new _c(n)}},e.prototype.add=function(n){var t=n;if(!n)return e.EMPTY;switch(typeof n){case"function":t=new e(n);case"object":if(t===this||t.closed||"function"!=typeof t.unsubscribe)return t;if(this.closed)return t.unsubscribe(),t;if(!(t instanceof e)){var r=t;(t=new e)._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+n+" added to Subscription.")}var i=t._parentOrParents;if(null===i)t._parentOrParents=this;else if(i instanceof e){if(i===this)return t;t._parentOrParents=[i,this]}else{if(-1!==i.indexOf(this))return t;i.push(this)}var o=this._subscriptions;return null===o?this._subscriptions=[t]:o.push(t),t},e.prototype.remove=function(e){var n=this._subscriptions;if(n){var t=n.indexOf(e);-1!==t&&n.splice(t,1)}},e.EMPTY=function(e){return e.closed=!0,e}(new e),e}();function qc(e){return e.reduce(function(e,n){return e.concat(n instanceof _c?n.errors:n)},[])}var Qc=/*@__PURE__*/function(){return"function"==typeof Symbol?/*@__PURE__*/Symbol("rxSubscriber"):"@@rxSubscriber_"+/*@__PURE__*/Math.random()}(),$c=/*@__PURE__*/function(e){function n(t,r,i){var o=e.call(this)||this;switch(o.syncErrorValue=null,o.syncErrorThrown=!1,o.syncErrorThrowable=!1,o.isStopped=!1,arguments.length){case 0:o.destination=Yc;break;case 1:if(!t){o.destination=Yc;break}if("object"==typeof t){t instanceof n?(o.syncErrorThrowable=t.syncErrorThrowable,o.destination=t,t.add(o)):(o.syncErrorThrowable=!0,o.destination=new Kc(o,t));break}default:o.syncErrorThrowable=!0,o.destination=new Kc(o,t,r,i)}return o}return Hc(n,e),n.prototype[Qc]=function(){return this},n.create=function(e,t,r){var i=new n(e,t,r);return i.syncErrorThrowable=!1,i},n.prototype.next=function(e){this.isStopped||this._next(e)},n.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},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))},n.prototype._next=function(e){this.destination.next(e)},n.prototype._error=function(e){this.destination.error(e),this.unsubscribe()},n.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},n.prototype._unsubscribeAndRecycle=function(){var e=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this},n}(Uc),Kc=/*@__PURE__*/function(e){function n(n,t,r,i){var o,a=e.call(this)||this;a._parentSubscriber=n;var s=a;return Fc(t)?o=t:t&&(o=t.next,r=t.error,i=t.complete,t!==Yc&&(Fc((s=Object.create(t)).unsubscribe)&&a.add(s.unsubscribe.bind(s)),s.unsubscribe=a.unsubscribe.bind(a))),a._context=s,a._next=o,a._error=r,a._complete=i,a}return Hc(n,e),n.prototype.next=function(e){if(!this.isStopped&&this._next){var n=this._parentSubscriber;Lc.useDeprecatedSynchronousErrorHandling&&n.syncErrorThrowable?this.__tryOrSetError(n,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}},n.prototype.error=function(e){if(!this.isStopped){var n=this._parentSubscriber,t=Lc.useDeprecatedSynchronousErrorHandling;if(this._error)t&&n.syncErrorThrowable?(this.__tryOrSetError(n,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(n.syncErrorThrowable)t?(n.syncErrorValue=e,n.syncErrorThrown=!0):Zc(e),this.unsubscribe();else{if(this.unsubscribe(),t)throw e;Zc(e)}}},n.prototype.complete=function(){var e=this;if(!this.isStopped){var n=this._parentSubscriber;if(this._complete){var t=function(){return e._complete.call(e._context)};Lc.useDeprecatedSynchronousErrorHandling&&n.syncErrorThrowable?(this.__tryOrSetError(n,t),this.unsubscribe()):(this.__tryOrUnsub(t),this.unsubscribe())}else this.unsubscribe()}},n.prototype.__tryOrUnsub=function(e,n){try{e.call(this._context,n)}catch(e){if(this.unsubscribe(),Lc.useDeprecatedSynchronousErrorHandling)throw e;Zc(e)}},n.prototype.__tryOrSetError=function(e,n,t){if(!Lc.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{n.call(this._context,t)}catch(n){return Lc.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=n,e.syncErrorThrown=!0,!0):(Zc(n),!0)}return!1},n.prototype._unsubscribe=function(){var e=this._parentSubscriber;this._context=null,this._parentSubscriber=null,e.unsubscribe()},n}($c),el=/*@__PURE__*/function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();function nl(e){return e}var tl=/*@__PURE__*/function(){function e(e){this._isScalar=!1,e&&(this._subscribe=e)}return e.prototype.lift=function(n){var t=new e;return t.source=this,t.operator=n,t},e.prototype.subscribe=function(e,n,t){var r=this.operator,i=function(e,n,t){if(e){if(e instanceof $c)return e;if(e[Qc])return e[Qc]()}return e||n||t?new $c(e,n,t):new $c(Yc)}(e,n,t);if(i.add(r?r.call(i,this.source):this.source||Lc.useDeprecatedSynchronousErrorHandling&&!i.syncErrorThrowable?this._subscribe(i):this._trySubscribe(i)),Lc.useDeprecatedSynchronousErrorHandling&&i.syncErrorThrowable&&(i.syncErrorThrowable=!1,i.syncErrorThrown))throw i.syncErrorValue;return i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(n){Lc.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=n),function(e){for(;e;){var n=e.destination;if(e.closed||e.isStopped)return!1;e=n&&n instanceof $c?n:null}return!0}(e)?e.error(n):console.warn(n)}},e.prototype.forEach=function(e,n){var t=this;return new(n=rl(n))(function(n,r){var i;i=t.subscribe(function(n){try{e(n)}catch(e){r(e),i&&i.unsubscribe()}},r,n)})},e.prototype._subscribe=function(e){var n=this.source;return n&&n.subscribe(e)},e.prototype[el]=function(){return this},e.prototype.pipe=function(){for(var e,n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return 0===n.length?this:(0===(e=n).length?nl:1===e.length?e[0]:function(n){return e.reduce(function(e,n){return n(e)},n)})(this)},e.prototype.toPromise=function(e){var n=this;return new(e=rl(e))(function(e,t){var r;n.subscribe(function(e){return r=e},function(e){return t(e)},function(){return e(r)})})},e.create=function(n){return new e(n)},e}();function rl(e){if(e||(e=Lc.Promise||Promise),!e)throw new Error("no Promise impl found");return e}var il=/*#__PURE__*/function(){function e(e){var n=this;this.wsURL=void 0,this.cable=null,this.subscriptions=new Map,this.addSubscription=function(e,t){n.subscriptions.set(e,t)},this.wsURL=e}var n=e.prototype;return n.connect=function(e,n){this.cable=F.default.createConsumer(this.wsURL+"?token="+e+"&lang="+n)},n.request=function(e){var n,t=this.cable,r=this.subscriptions,i=this.addSubscription;return new tl(function(o){if(t){var a,s=(null==(a=e.variables)?void 0:a.id)||"company";r.has(s)||(n=t.subscriptions.create({channel:"GraphqlChannel",channelId:Math.round(Date.now()+1e5*Math.random()).toString(16)},{connected:function(){this.perform("execute",e)},received:function(e){e.more?e.result.errors?o.error&&o.error(e.result.errors[0]):e.result.data&&o.next&&(Vc(e.result.data)||o.next(e.result)):o.complete&&o.complete()}}),i(s,n))}})},n.hasSubscription=function(e){return this.subscriptions.has(e)},e}(),ol=/*#__PURE__*/function(){function e(e,n,t){this.actionCableClient=null,this.actionCableClient=new il(e),this.actionCableClient.connect(n,t)}return e.prototype.subscribe=function(e,n,t,r){if(void 0===r&&(r=function(e){throw e}),!this.actionCableClient)throw new Error("No WS client available");var i=this.actionCableClient.request({query:e,variables:n}).subscribe({next:function(e){var n=e.data,i=e.errors;if(i)return r(new Error(JSON.stringify(i)));n&&t&&t(function(e){var n=Object.keys(e);if(1!==n.length)throw new Error("Expected exactly one response key, got: "+n.join(", "));return e[n[0]]}(n))}});return function(){return i.unsubscribe()}},e}(),al=function(e,n,t){return new ol(e,n,t)},sl=function(e,n){return ii(new E.GraphQLClient(e,{fetch:n}))},ul=function(n){var t,r=n.url,o=n.wsUrl,a=n.lang,s=i.useStore().sessionStore,u=e.useState(),c=u[0],l=u[1],d=e.useState(),p=d[0],f=d[1],m=o||r.replace("graphql","cable"),g=(null==(t=s.loginStatus.authResponse)?void 0:t.accessToken)||"";return e.useEffect(function(){r&&l(sl(r,i.fetch))},[r]),e.useEffect(function(){r&&g&&f(al(m||r.replace("graphql","cable"),g,a))},[r,m,g,a]),{graphqlSdk:c,gqlWsClient:p}},cl={root:{boxShadow:"none","& .react-resizable-handle":{width:"24px",height:"24px",borderRadius:"4px",background:function(e){return e.palette.primary.main+" url("+X.default+")"},backgroundRepeat:"no-repeat",backgroundSize:"50%",backgroundPosition:"50%","&:hover":{backgroundColor:function(e){return e.palette.primary.dark}}},"& .react-resizable-handle:after":{display:"none"}},header:{height:"40px"},dragIcon:{width:"30px",height:"30px",marginLeft:function(e){return"-"+e.spacing(1)},padding:"8px",borderRadius:"4px",background:function(e){return e.palette.primary.main},"&:hover":{cursor:"move",background:function(e){return e.palette.primary.dark}}},actionButtons:{height:"30px",marginTop:"-7px"},settingsButton:{color:"rgba(255, 255, 255, 0.45)",borderRadius:"4px",borderTopRightRadius:0,borderBottomRightRadius:0,borderColor:"rgba(255,255,255,0.1)",background:"rgba(255,255,255,0.1)","&:focus":{boxShadow:"0 0 0 1px rgba(255, 255, 255, 0.1)"},"&:hover":{opacity:.8}},infoButton:{marginLeft:"1px",color:"rgba(255, 255, 255, 0.45)",borderRadius:0,borderColor:"rgba(255,255,255,0.1)",background:"rgba(255,255,255,0.1)","&:focus":{boxShadow:"0 0 0 1px rgba(255, 255, 255, 0.1)"},"&:hover":{opacity:.8}},deleteButton:{marginLeft:"1px",color:"rgba(255, 255, 255, 0.45)",borderRadius:"4px",borderTopLeftRadius:0,borderBottomLeftRadius:0,borderColor:"rgba(255,255,255,0.1)",background:"rgba(255,255,255,0.1)","&:focus":{boxShadow:"0 0 0 1px rgba(255, 255, 255, 0.1)"},"&:hover":{opacity:.8}},content:{height:"calc(100% - 40px)",padding:0,background:"transparent",border:"1px solid rgba(255, 255, 255, 0.2)",borderTop:"none",borderRadius:"4px",boxShadow:"0px 4px 8px rgba(0, 0, 0, 0.25)","&:last-child":{paddingBottom:0}}},ll=["children","title","Widget","id","url","wsUrl","lang","data","filters","settings","openSettingsModal","onSettingsModalOpened","onSettingsModalClosed","sidePanelOpened","updateSidePanelProps","onDelete","editMode","version","requiredFeatures","extraPermissions"];function dl(e,n){try{var t=e()}catch(e){return n(e)}return t&&t.then?t.then(void 0,n):t}var pl=S.default.forwardRef(function(r,o){var a=r.children,s=r.title,u=r.Widget,c=r.id,l=r.url,d=r.wsUrl,p=r.lang,f=r.data,m=r.filters,g=r.settings,b=r.openSettingsModal,h=r.onSettingsModalOpened,v=r.onSettingsModalClosed,I=r.sidePanelOpened,A=r.updateSidePanelProps,E=r.onDelete,w=r.editMode,R=r.version,T=r.requiredFeatures,N=r.extraPermissions,O=Z(r,ll),D=ul({url:l,wsUrl:d,lang:p}).graphqlSdk,G=i.useAccess(T,{extraPermissions:N}).hasAccess,k=e.useState(!1),B=k[0],P=k[1],M=e.useState(!1),V=M[0],W=M[1],H=t.useTranslation(),F=H.i18n,X=H.t;return e.useEffect(function(){if(null!=F&&F.store)for(var e="translation",n=0,t=Object.entries(_);n<t.length;n++){var r=t[n],i=r[1];i[e]&&F.addResources(r[0],e,i[e])}},[F]),/*#__PURE__*/S.default.createElement(n.Card,L({ref:o,sx:cl.root},O),/*#__PURE__*/S.default.createElement(n.CardHeader,{avatar:w&&/*#__PURE__*/S.default.createElement(n.SvgIcon,{component:x.ReactComponent,className:"draggable-handle",sx:cl.dragIcon,inheritViewBox:!0}),title:s,titleTypographyProps:{variant:"subtitle1"},action:w&&/*#__PURE__*/S.default.createElement(n.Stack,{direction:"row",sx:cl.actionButtons},/*#__PURE__*/S.default.createElement(n.Button,{color:"secondary",sx:cl.settingsButton,onClick:function(){h&&h()},disabled:!G,"data-testid":"widget-card.settings-button"},/*#__PURE__*/S.default.createElement(y.Settings,null)),R&&/*#__PURE__*/S.default.createElement(S.default.Fragment,null,/*#__PURE__*/S.default.createElement(n.Tooltip,{title:R},/*#__PURE__*/S.default.createElement(n.Button,{color:"secondary",sx:cl.infoButton,"data-testid":"widget-card.info-button"},/*#__PURE__*/S.default.createElement(y.Info,null)))),/*#__PURE__*/S.default.createElement(z,{open:V,confirmMessage:X("Are you sure you want to delete this widget?"),confirmButtonText:X("Delete"),cancelButtonText:X("Cancel"),onCancel:function(){return W(!1)},onConfirm:function(){try{var e=function(){P(!1)};P(!0),W(!1);var n=function(){if(E)return Promise.resolve(E()).then(function(){})}();return Promise.resolve(n&&n.then?n.then(e):e())}catch(e){return Promise.reject(e)}},confirmButtonTestId:"widget-card.delete-confirm",cancelButtonTestId:"widget-card.delete-cancel"},/*#__PURE__*/S.default.createElement(C.LoadingButton,{color:"secondary",sx:cl.deleteButton,onClick:function(e){e.stopPropagation(),W(!0)},loading:B,"data-testid":"widget-card.delete-button"},/*#__PURE__*/S.default.createElement(y.Delete,null)))),sx:cl.header}),/*#__PURE__*/S.default.createElement(n.CardContent,{sx:cl.content},/*#__PURE__*/S.default.createElement(i.AccessGuard,{features:T,extraPermissions:N,onTrialRequest:function(e){try{return Promise.resolve(dl(function(){return Promise.resolve(null==D?void 0:D.startTrial({input:{featureKey:e}})).then(function(){return Promise.resolve(i.refreshUserData()).then(function(){return!0})})},function(e){return console.error("Failed to start trial:",e),!1}))}catch(e){return Promise.reject(e)}},onFeatureRequest:function(e){var n=e.featureKey,t=e.requestType,r=e.workplaceId;try{return Promise.resolve(dl(function(){return Promise.resolve(null==D?void 0:D.requestFeatureAccess({input:{featureKey:n,requestType:t.toUpperCase(),workplaceId:r}})).then(function(){return Promise.resolve(i.refreshUserData()).then(function(){return!0})})},function(e){return console.error("Failed to request feature access:",e),!1}))}catch(e){return Promise.reject(e)}}},/*#__PURE__*/S.default.createElement(u,{id:c,url:l,wsUrl:d,lang:p,data:f,filters:m,settings:g,openSettingsModal:b,onSettingsModalOpened:h,onSettingsModalClosed:v,sidePanelOpened:I,updateSidePanelProps:A,editMode:w}))),w&&a)});exports.ActualStaffingCountsDocument=mr,exports.ApplicationInfoDocument=gr,exports.AssignOperatorDocument=zr,exports.AssignOperatorToWorkplaceDocument=Ht,exports.AvailabilityInsightsDocument=br,exports.BulkUpsertStaffingPlansDocument=Ft,exports.CompanyConfigDocument=hr,exports.ConfirmTooltip=z,exports.CounterDirectoriesDocument=vr,exports.CountersDocument=Ir,exports.CreateDashboardDocument=Xt,exports.CreateOrderDocument=Lt,exports.CreateProductDocument=Zt,exports.CreateStaffingPlanDocument=Yt,exports.CreateStatusChangeDocument=jt,exports.CreateUserPresenceDocument=Jt,exports.CreateWidgetDocument=zt,exports.CurrentUserDocument=yr,exports.DashboardFilters=function(r){var o=r.initialValues,a=r.onChange,s=r.shifts,u=void 0===s?[]:s,c=r.onFeatureRequest,l=t.useTranslation(),d=l.i18n,p=l.t,f=e.useState(function(){return null!=o?o:{dayType:exports.DayType.Production,dateRange:(e=D.default().format("YYYY-MM-DD"),{from:e+"T00:00:00",to:e+"T23:59:59"}),shiftIds:[]};var e}),m=f[0],g=f[1],b=e.useState(function(){return null==o?void 0:o.selectedPeriodId}),h=b[0],v=b[1],I=e.useState(!1),y=I[0],C=I[1],x=e.useState(!1),A=x[0],E=x[1],w=e.useRef(null),R=i.useAccess([Mi]),T=R.hasAccess,N=R.accessState,G=R.buttons,k=R.cooldownInfo,B=R.features,P=e.useMemo(function(){var e,n=B.find(function(e){return e.featureKey===Mi});return null!=(e=null==n?void 0:n.daysSinceExpiry)?e:null},[B]),M=e.useMemo(function(){return G.filter(function(e){return"start_trial"!==e.action})},[G]);e.useEffect(function(){if(null!=d&&d.store)for(var e="translation",n=0,t=Object.entries(_);n<t.length;n++){var r=t[n],i=r[1];i[e]&&d.addResources(r[0],e,i[e])}},[d]),e.useEffect(function(){if(o){var e=o.selectedPeriodId&&null!=u&&u.length?bi(o.selectedPeriodId,u):null,n=e?L({},o,{shiftIds:[e]}):o;g(function(e){return JSON.stringify(n)===JSON.stringify(e)?e:n}),v(o.selectedPeriodId)}},[o,u]),e.useEffect(function(){if(h){var e=hi.find(function(e){return e.id===h});if(e){var n=e.calculate({dayType:m.dayType,shifts:u,selectedShiftIds:m.shiftIds});g(function(e){var t=L({},e,{dateRange:n,selectedPeriodId:h});return e.dateRange.from===n.from&&e.dateRange.to===n.to&&e.selectedPeriodId===h?e:t})}}},[m.dayType,m.shiftIds,u,h]),e.useEffect(function(){if(h){var e=Ci(h,{dayType:m.dayType,shifts:u,selectedShiftIds:m.shiftIds});if(e){var n=e.getTime()-Date.now(),t=function(){var e=hi.find(function(e){return e.id===h});if(e){var n=bi(h,u),t=n?[n]:m.shiftIds,r=e.calculate({dayType:m.dayType,shifts:u,selectedShiftIds:t}),i=L({},m,{dateRange:r,selectedPeriodId:h,shiftIds:t});g(i),a(i)}};if(!(n<=0)){var r=setTimeout(t,n);return function(){return clearTimeout(r)}}t()}}},[h,m.dayType,m.shiftIds,u]);var V,W,H,F=e.useCallback(function(e){var n=L({},m,{dayType:e});g(n),a(n)},[m,a]),X=e.useCallback(function(e){var n=L({},m,{shiftIds:e});g(n),a(n)},[m,a]),Z=e.useCallback(function(e){v(void 0);var n=L({},m,{dateRange:e,selectedPeriodId:void 0,shiftIds:[]});g(n),a(n)},[m,a]),Y=e.useCallback(function(e,n){if(!e.needAccess||T){v(e.id);var t=bi(e.id,u),r=L({},m,{dateRange:n,selectedPeriodId:e.id,shiftIds:t?[t]:[]});g(r),a(r)}else C(!0)},[m,T,a,u]),j=e.useCallback(function(){C(!1)},[]),J=e.useCallback(function(){C(!0)},[]),z=e.useCallback(function(){E(!0)},[]),U=e.useCallback(function(){E(!1)},[]);/*#__PURE__*/return S.default.createElement(n.Box,{sx:Pi.container},/*#__PURE__*/S.default.createElement(n.Stack,{direction:"row",spacing:2,alignItems:"center"},/*#__PURE__*/S.default.createElement(n.TextField,{ref:w,label:p("filters.dateRange.label"),value:(V=m.dateRange,W=D.default(V.from).format("YYYY-MM-DD"),H=D.default(V.to).format("YYYY-MM-DD"),W===H?W:W+" - "+H),onClick:z,size:"small",InputProps:{readOnly:!0,startAdornment:/*#__PURE__*/S.default.createElement(n.InputAdornment,{position:"start"},/*#__PURE__*/S.default.createElement(O.default,{sx:{fontSize:16}}))},sx:Pi.dateField,"data-testid":"dashboard-filters.date-range-input"}),/*#__PURE__*/S.default.createElement(Bi,{shifts:u,selectedShiftIds:m.shiftIds,onChange:X})),/*#__PURE__*/S.default.createElement(n.Popover,{open:A,anchorEl:w.current,onClose:U,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},sx:Pi.popover,"data-testid":"dashboard-filters.date-popover"},/*#__PURE__*/S.default.createElement(n.Box,{sx:Pi.popoverContent},/*#__PURE__*/S.default.createElement(Gi,{dateRange:m.dateRange,dayType:m.dayType,shifts:u,selectedShiftIds:m.shiftIds,hasAccess:T,selectedPeriodId:h,onDayTypeChange:F,onDateRangeChange:Z,onPeriodSelect:Y,onAccessDenied:J}))),/*#__PURE__*/S.default.createElement(Ai,{open:y,onClose:j,accessState:N,buttons:M,daysSinceExpiry:P,cooldownInfo:k,onFeatureRequest:c}))},exports.DashboardsDocument=Cr,exports.DepartmentsDocument=xr,exports.FloorPlansDocument=Ar,exports.GetWorkplacePerformanceInsightsDocument=Ur,exports.GraphqlWsClient=ol,exports.ListActualStaffingCountsDocument=qr,exports.ListStaffingPlansDocument=Qr,exports.ListStatusChangesDocument=$r,exports.ListWorkOrdersDocument=Kr,exports.ListWorkplaceAssignmentsDocument=ei,exports.ListWorkplacesDocument=ni,exports.MetricCard=function(e){var r=e.title,i=e.metricLabel,o=e.metricValue,a=e.extraValue,s=e.animateBackgroundColor,u=e.rounded,c=Z(e,ji),l=t.useTranslation().t,d=function(e){return{card:L({position:"relative",width:"100%",height:"100%"},e.showBgPattern&&{mixBlendMode:"hard-light",background:"url("+H.default+"), linear-gradient(329.66deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.75) 100%)",backgroundSize:"cover"},e.card.rounded?{borderRadius:"4px"}:{borderTopLeftRadius:0,borderTopRightRadius:0}),cardOverlay:L({position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:-1},e.showBgPattern&&{mixBlendMode:"hard-light"},e.card.rounded?{borderRadius:"4px"}:{borderTopLeftRadius:0,borderTopRightRadius:0},e.cardOverlay,{animation:e.animateBackgroundColor?(t=e.backgroundColor,v.keyframes(Fi||(Fi=Y(["\n 0% {\n background: ",";\n }\n\n 50% {\n background: ",";\n }\n\n 100% {\n background: ",";\n }\n"])),Yi(t,.5),Yi(t,1),Yi(t,.5))+" 3s infinite"):"none"}),cardHeader:{height:"3em",color:Zi,borderBottom:"1px solid rgba(0, 0, 0, 0.1)",background:"rgba(0, 0, 0, 0.05)","& span":{lineHeight:"3em",fontSize:"1em",fontWeight:500}},cardContent:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"80%",minWidth:"auto",minHeight:"auto",maxWidth:"none",background:"transparent","& > img":{flexBasis:"25%",minWidth:"125px",maxWidth:"25%"}},cardLabel:{width:"100%",lineHeight:"2.5em",fontSize:"1.8em",fontWeight:700,whiteSpace:"nowrap",overflow:"hidden",textAlign:"center",textOverflow:"ellipsis",color:Zi},cardValue:{lineHeight:"1.2em",textAlign:"center",fontSize:"1.6em",fontWeight:700,color:n.lighten(Zi,.15)},cardExtra:{lineHeight:"4em",textAlign:"center",fontSize:"1em",fontWeight:600,color:Zi}};var t}({card:{rounded:u},cardOverlay:{background:function(){var e=null==o?void 0:o.statusColor;if(e)switch(e){case exports.AndonLightColor.Green:return"linear-gradient(180deg, #31BF59 0%, #32D74B 100%)";case exports.AndonLightColor.Yellow:return"linear-gradient(360deg, #FFD60A 0%, #FFC12F 100%)";case exports.AndonLightColor.Red:return"linear-gradient(0deg, #F05C53 0%, #FF3B2F 100%)";default:return"rgba(187, 187, 187, 0.75)"}return"rgba(255, 255, 255, 0.75)"}()},showBgPattern:!0,backgroundColor:function(){var e=null==o?void 0:o.statusColor;if(e)switch(e){case exports.AndonLightColor.Green:return"#32D74B";case exports.AndonLightColor.Yellow:return"#FFC12F";case exports.AndonLightColor.Red:return"#FF3B2F";default:return"#BBBBBBBF"}return"#FFFFFFBF"}(),animateBackgroundColor:s});/*#__PURE__*/return S.default.createElement(n.Card,L({sx:d.card},c),/*#__PURE__*/S.default.createElement(n.Box,{sx:d.cardOverlay}),/*#__PURE__*/S.default.createElement(n.CardHeader,{title:/*#__PURE__*/S.default.createElement(Li,{line:1,text:r}),sx:d.cardHeader}),/*#__PURE__*/S.default.createElement(n.CardContent,{sx:d.cardContent},/*#__PURE__*/S.default.createElement(n.Typography,{sx:d.cardLabel},i),/*#__PURE__*/S.default.createElement(n.Typography,{sx:d.cardValue},o?function(e){var n=e.textValue;if(n){var t=D.default.duration(Number(n),"seconds");return Math.floor(t.asMinutes())+"m "+t.seconds()+"s"}return""}(o):/*#__PURE__*/S.default.createElement(t.Trans,{t:l},"No value for the selected metric")),a&&/*#__PURE__*/S.default.createElement(n.Typography,{sx:d.cardExtra},a)))},exports.MetricValuesDocument=Er,exports.MetricsDocument=wr,exports.NotificationsDocument=Rr,exports.OrdersDocument=Tr,exports.OrdersExecutionsDocument=Sr,exports.PauseOrderExecutionDocument=_t,exports.ProductionInsightsDocument=Nr,exports.ProductsDocument=Or,exports.ReasonsDocument=Dr,exports.ReasonsRecommendationDocument=Gr,exports.RemoveDashboardDocument=Ut,exports.RemoveStaffingPlanDocument=qt,exports.RemoveUserPresenceDocument=Qt,exports.RemoveWidgetDocument=$t,exports.RemoveWorkplaceUsersPresencesDocument=Kt,exports.RequestFeatureAccessDocument=er,exports.SetCounterDocument=nr,exports.ShiftsDocument=kr,exports.SortableSelect=function(e){var n=e.options,t=e.selected,r=e.onChange,i=function(e){var n,i,o,a=e.active,s=e.over;if(a.id!==(null==s?void 0:s.id)){var u=t.findIndex(function(e){return e===a.id}),c=t.findIndex(function(e){return e===(null==s?void 0:s.id)});r((n=t,i=u,o=c,function(e,n,t){const r=n<0?e.length+n:n;if(r>=0&&r<e.length){const r=t<0?e.length+t:t,[i]=e.splice(n,1);e.splice(r,0,i)}}(n=[...n],i,o),n))}};/*#__PURE__*/return S.default.createElement(Es,{placeholder:e.placeholder,isMulti:!0,options:n,value:t.map(function(e){return n.find(function(n){return n.value===e})}),onChange:function(e){return r([].concat(e||[]).map(function(e){return e.value}))},closeMenuOnSelect:!1,components:{MultiValueContainer:Pc,MultiValueLabel:Mc,ValueContainer:function(e){/*#__PURE__*/return S.default.createElement(vc,{onDragEnd:i},/*#__PURE__*/S.default.createElement(Sc,{items:t},e.children))}},styles:{control:function(e,n){return L({},e,{padding:"6px 0 6px 8px",borderColor:"rgba(255, 255, 255, 0.15)",background:"#1C1F25"},n.isFocused&&{borderColor:"#4E5A67",boxShadow:"none"},{"&:hover":{borderColor:"#4E5A67",boxShadow:"none"}})},menu:function(e){return L({},e,{background:"#1C1F25"})},option:function(e,n){return L({},e,{background:n.isFocused?"#2A2E34":"#1C1F25"})}}})},exports.StaffingPlansDocument=Br,exports.StandardRatesDocument=Pr,exports.StartOrderExecutionDocument=tr,exports.StartTrialDocument=rr,exports.StatusChangeTransitionPermissionsDocument=Mr,exports.StatusChangesDocument=Vr,exports.StopOrderExecutionDocument=ir,exports.UnassignOperatorDocument=_r,exports.UnassignOperatorFromWorkplaceDocument=or,exports.UpdateDashboardDocument=ar,exports.UpdateNotificationDocument=sr,exports.UpdateOrderDocument=ur,exports.UpdateOrderExecutionDocument=cr,exports.UpdateStaffingPlanDocument=lr,exports.UpdateStatusChangeDocument=dr,exports.UpdateWidgetDocument=pr,exports.UpdateWorkOrderDocument=fr,exports.UsersDocument=Wr,exports.UsersPresencesDocument=Hr,exports.WidgetCard=pl,exports.WidgetDocument=Fr,exports.WidgetsDocument=Xr,exports.WorkOrdersDocument=Lr,exports.WorkOrdersInsightsDocument=Zr,exports.WorkplaceAssignmentsDocument=Yr,exports.WorkplaceEventDocument=ti,exports.WorkplacePerformanceInsightsDocument=jr,exports.WorkplacesDocument=Jr,exports.findPeriodById=function(e){return hi.find(function(n){return n.id===e})},exports.generateTimeRange=function(e,n,t,r){for(var i=[],o=e,a=e.isAfter(n);a?o.isAfter(n)||o.isSame(n):o.isBefore(n)||o.isSame(n);)i.push(o),o=a?o.subtract(r,t):o.add(r,t);return i},exports.getCurrentShift=si,exports.getGqlWsClient=al,exports.getGraphqlSdk=sl,exports.getNextBoundary=Ci,exports.getRecentShift=ui,exports.getSdk=ii,exports.getShiftTimeRange=Ii,exports.getTimeRangeLabel=vi,exports.normalizeShifts=ai,exports.periods=hi,exports.resolveShiftIdForPeriod=bi,exports.useGqlClients=ul,exports.version="1.5.33";
|
|
15
|
+
return N.createElement(xs,to({ref:t},r))}),Es=As;const ws="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function Rs(e){const n=Object.prototype.toString.call(e);return"[object Window]"===n||"[object global]"===n}function Ts(e){return"nodeType"in e}function Ss(e){var n,t;return e?Rs(e)?e:Ts(e)&&null!=(n=null==(t=e.ownerDocument)?void 0:t.defaultView)?n:window:window}function Ns(e){const{Document:n}=Ss(e);return e instanceof n}function Os(e){return!Rs(e)&&e instanceof Ss(e).HTMLElement}function Ds(e){return e instanceof Ss(e).SVGElement}function Gs(e){return e?Rs(e)?e.document:Ts(e)?Ns(e)?e:Os(e)||Ds(e)?e.ownerDocument:document:document:document}const ks=ws?e.useLayoutEffect:e.useEffect;function Bs(n){const t=e.useRef(n);return ks(()=>{t.current=n}),e.useCallback(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)},[])}function Ps(n,t){void 0===t&&(t=[n]);const r=e.useRef(n);return ks(()=>{r.current!==n&&(r.current=n)},t),r}function Ms(n,t){const r=e.useRef();return e.useMemo(()=>{const e=n(r.current);return r.current=e,e},[...t])}function Vs(n){const t=Bs(n),r=e.useRef(null),i=e.useCallback(e=>{e!==r.current&&(null==t||t(e,r.current)),r.current=e},[]);return[r,i]}function Ws(n){const t=e.useRef();return e.useEffect(()=>{t.current=n},[n]),t.current}let Hs={};function Fs(n,t){return e.useMemo(()=>{if(t)return t;const e=null==Hs[n]?0:Hs[n]+1;return Hs[n]=e,n+"-"+e},[n,t])}function Xs(e){return function(n){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return r.reduce((n,t)=>{const r=Object.entries(t);for(const[t,i]of r){const r=n[t];null!=r&&(n[t]=r+e*i)}return n},{...n})}}const Ls=/*#__PURE__*/Xs(1),Zs=/*#__PURE__*/Xs(-1);function Ys(e){if(!e)return!1;const{KeyboardEvent:n}=Ss(e.target);return n&&e instanceof n}function js(e){if(function(e){if(!e)return!1;const{TouchEvent:n}=Ss(e.target);return n&&e instanceof n}(e)){if(e.touches&&e.touches.length){const{clientX:n,clientY:t}=e.touches[0];return{x:n,y:t}}if(e.changedTouches&&e.changedTouches.length){const{clientX:n,clientY:t}=e.changedTouches[0];return{x:n,y:t}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const Js=/*#__PURE__*/Object.freeze({Translate:{toString(e){if(!e)return;const{x:n,y:t}=e;return"translate3d("+(n?Math.round(n):0)+"px, "+(t?Math.round(t):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:n,scaleY:t}=e;return"scaleX("+n+") scaleY("+t+")"}},Transform:{toString(e){if(e)return[Js.Translate.toString(e),Js.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:n,duration:t,easing:r}=e;return n+" "+t+"ms "+r}}}),zs="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function _s(e){return e.matches(zs)?e:e.querySelector(zs)}const Us={display:"none"};function qs(e){let{id:n,value:t}=e;return S.default.createElement("div",{id:n,style:Us},t)}function Qs(e){let{id:n,announcement:t,ariaLiveType:r="assertive"}=e;return S.default.createElement("div",{id:n,style:{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"},role:"status","aria-live":r,"aria-atomic":!0},t)}const $s=/*#__PURE__*/e.createContext(null),Ks={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},eu={onDragStart(e){let{active:n}=e;return"Picked up draggable item "+n.id+"."},onDragOver(e){let{active:n,over:t}=e;return t?"Draggable item "+n.id+" was moved over droppable area "+t.id+".":"Draggable item "+n.id+" is no longer over a droppable area."},onDragEnd(e){let{active:n,over:t}=e;return t?"Draggable item "+n.id+" was dropped over droppable area "+t.id:"Draggable item "+n.id+" was dropped."},onDragCancel(e){let{active:n}=e;return"Dragging was cancelled. Draggable item "+n.id+" was dropped."}};function nu(n){let{announcements:t=eu,container:r,hiddenTextDescribedById:i,screenReaderInstructions:o=Ks}=n;const{announce:a,announcement:s}=function(){const[n,t]=e.useState("");return{announce:e.useCallback(e=>{null!=e&&t(e)},[]),announcement:n}}(),u=Fs("DndLiveRegion"),[c,l]=e.useState(!1);if(e.useEffect(()=>{l(!0)},[]),function(n){const t=e.useContext($s);e.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(n)},[n,t])}(e.useMemo(()=>({onDragStart(e){let{active:n}=e;a(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&a(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;a(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;a(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;a(t.onDragCancel({active:n,over:r}))}}),[a,t])),!c)return null;const d=S.default.createElement(S.default.Fragment,null,S.default.createElement(qs,{id:i,value:o.draggable}),S.default.createElement(Qs,{id:u,announcement:s}));return r?I.createPortal(d,r):d}var tu;function ru(){}!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"}(tu||(tu={}));const iu=/*#__PURE__*/Object.freeze({x:0,y:0});function ou(e,n){let{data:{value:t}}=e,{data:{value:r}}=n;return r-t}function au(e,n){const t=Math.max(n.top,e.top),r=Math.max(n.left,e.left),i=Math.min(n.left+n.width,e.left+e.width),o=Math.min(n.top+n.height,e.top+e.height);if(r<i&&t<o){const a=(i-r)*(o-t);return Number((a/(n.width*n.height+e.width*e.height-a)).toFixed(4))}return 0}const su=e=>{let{collisionRect:n,droppableRects:t,droppableContainers:r}=e;const i=[];for(const e of r){const{id:r}=e,o=t.get(r);if(o){const t=au(o,n);t>0&&i.push({id:r,data:{droppableContainer:e,value:t}})}}return i.sort(ou)};function uu(e,n){return e&&n?{x:e.left-n.left,y:e.top-n.top}:iu}function cu(e){return function(n){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return r.reduce((n,t)=>({...n,top:n.top+e*t.y,bottom:n.bottom+e*t.y,left:n.left+e*t.x,right:n.right+e*t.x}),{...n})}}const lu=/*#__PURE__*/cu(1),du={ignoreTransform:!1};function pu(e,n){void 0===n&&(n=du);let t=e.getBoundingClientRect();if(n.ignoreTransform){const{transform:n,transformOrigin:r}=Ss(e).getComputedStyle(e);n&&(t=function(e,n,t){const r=function(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]}}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}(n);if(!r)return e;const{scaleX:i,scaleY:o,x:a,y:s}=r,u=e.left-a-(1-i)*parseFloat(t),c=e.top-s-(1-o)*parseFloat(t.slice(t.indexOf(" ")+1)),l=i?e.width/i:e.width,d=o?e.height/o:e.height;return{width:l,height:d,top:c,right:u+l,bottom:c+d,left:u}}(t,n,r))}const{top:r,left:i,width:o,height:a,bottom:s,right:u}=t;return{top:r,left:i,width:o,height:a,bottom:s,right:u}}function fu(e){return pu(e,{ignoreTransform:!0})}function mu(e,n){const t=[];return e?function r(i){if(null!=n&&t.length>=n)return t;if(!i)return t;if(Ns(i)&&null!=i.scrollingElement&&!t.includes(i.scrollingElement))return t.push(i.scrollingElement),t;if(!Os(i)||Ds(i))return t;if(t.includes(i))return t;const o=Ss(e).getComputedStyle(i);return i!==e&&function(e,n){void 0===n&&(n=Ss(e).getComputedStyle(e));const t=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(e=>{const r=n[e];return"string"==typeof r&&t.test(r)})}(i,o)&&t.push(i),function(e,n){return void 0===n&&(n=Ss(e).getComputedStyle(e)),"fixed"===n.position}(i,o)?t:r(i.parentNode)}(e):t}function gu(e){const[n]=mu(e,1);return null!=n?n:null}function bu(e){return ws&&e?Rs(e)?e:Ts(e)?Ns(e)||e===Gs(e).scrollingElement?window:Os(e)?e:null:null:null}function hu(e){return Rs(e)?e.scrollX:e.scrollLeft}function vu(e){return Rs(e)?e.scrollY:e.scrollTop}function Iu(e){return{x:hu(e),y:vu(e)}}var yu;function Cu(e){return!(!ws||!e)&&e===document.scrollingElement}function xu(e){const n={x:0,y:0},t=Cu(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-t.width,y:e.scrollHeight-t.height};return{isTop:e.scrollTop<=n.y,isLeft:e.scrollLeft<=n.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:n}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(yu||(yu={}));const Au={x:.2,y:.2};function Eu(e,n,t,r,i){let{top:o,left:a,right:s,bottom:u}=t;void 0===r&&(r=10),void 0===i&&(i=Au);const{isTop:c,isBottom:l,isLeft:d,isRight:p}=xu(e),f={x:0,y:0},m={x:0,y:0},g=n.height*i.y,b=n.width*i.x;return!c&&o<=n.top+g?(f.y=yu.Backward,m.y=r*Math.abs((n.top+g-o)/g)):!l&&u>=n.bottom-g&&(f.y=yu.Forward,m.y=r*Math.abs((n.bottom-g-u)/g)),!p&&s>=n.right-b?(f.x=yu.Forward,m.x=r*Math.abs((n.right-b-s)/b)):!d&&a<=n.left+b&&(f.x=yu.Backward,m.x=r*Math.abs((n.left+b-a)/b)),{direction:f,speed:m}}function wu(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:n}=window;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}const{top:n,left:t,right:r,bottom:i}=e.getBoundingClientRect();return{top:n,left:t,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function Ru(e){return e.reduce((e,n)=>Ls(e,Iu(n)),iu)}const Tu=[["x",["left","right"],function(e){return e.reduce((e,n)=>e+hu(n),0)}],["y",["top","bottom"],function(e){return e.reduce((e,n)=>e+vu(n),0)}]];class Su{constructor(e,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const t=mu(n),r=Ru(t);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,n,i]of Tu)for(const o of n)Object.defineProperty(this,o,{get:()=>{const n=i(t);return this.rect[o]+(r[e]-n)},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Nu{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var n;return null==(n=this.target)?void 0:n.removeEventListener(...e)})},this.target=e}add(e,n,t){var r;null==(r=this.target)||r.addEventListener(e,n,t),this.listeners.push([e,n,t])}}function Ou(e,n){const t=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof n?Math.sqrt(t**2+r**2)>n:"x"in n&&"y"in n?t>n.x&&r>n.y:"x"in n?t>n.x:"y"in n&&r>n.y}var Du,Gu;function ku(e){e.preventDefault()}function Bu(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(Du||(Du={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"}(Gu||(Gu={}));const Pu={start:[Gu.Space,Gu.Enter],cancel:[Gu.Esc],end:[Gu.Space,Gu.Enter,Gu.Tab]},Mu=(e,n)=>{let{currentCoordinates:t}=n;switch(e.code){case Gu.Right:return{...t,x:t.x+25};case Gu.Left:return{...t,x:t.x-25};case Gu.Down:return{...t,y:t.y+25};case Gu.Up:return{...t,y:t.y-25}}};class Vu{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:n}}=e;this.props=e,this.listeners=new Nu(Gs(n)),this.windowListeners=new Nu(Ss(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Du.Resize,this.handleCancel),this.windowListeners.add(Du.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Du.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,t=e.node.current;t&&function(e,n){if(void 0===n&&(n=pu),!e)return;const{top:t,left:r,bottom:i,right:o}=n(e);gu(e)&&(i<=0||o<=0||t>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(t),n(iu)}handleKeyDown(e){if(Ys(e)){const{active:n,context:t,options:r}=this.props,{keyboardCodes:i=Pu,coordinateGetter:o=Mu,scrollBehavior:a="smooth"}=r,{code:s}=e;if(i.end.includes(s))return void this.handleEnd(e);if(i.cancel.includes(s))return void this.handleCancel(e);const{collisionRect:u}=t.current,c=u?{x:u.left,y:u.top}:iu;this.referenceCoordinates||(this.referenceCoordinates=c);const l=o(e,{active:n,context:t.current,currentCoordinates:c});if(l){const n=Zs(l,c),r={x:0,y:0},{scrollableAncestors:i}=t.current;for(const t of i){const i=e.code,{isTop:o,isRight:s,isLeft:u,isBottom:c,maxScroll:d,minScroll:p}=xu(t),f=wu(t),m={x:Math.min(i===Gu.Right?f.right-f.width/2:f.right,Math.max(i===Gu.Right?f.left:f.left+f.width/2,l.x)),y:Math.min(i===Gu.Down?f.bottom-f.height/2:f.bottom,Math.max(i===Gu.Down?f.top:f.top+f.height/2,l.y))},g=i===Gu.Down&&!c||i===Gu.Up&&!o;if((i===Gu.Right&&!s||i===Gu.Left&&!u)&&m.x!==l.x){const e=t.scrollLeft+n.x,o=i===Gu.Right&&e<=d.x||i===Gu.Left&&e>=p.x;if(o&&!n.y)return void t.scrollTo({left:e,behavior:a});r.x=o?t.scrollLeft-e:i===Gu.Right?t.scrollLeft-d.x:t.scrollLeft-p.x,r.x&&t.scrollBy({left:-r.x,behavior:a});break}if(g&&m.y!==l.y){const e=t.scrollTop+n.y,o=i===Gu.Down&&e<=d.y||i===Gu.Up&&e>=p.y;if(o&&!n.x)return void t.scrollTo({top:e,behavior:a});r.y=o?t.scrollTop-e:i===Gu.Down?t.scrollTop-d.y:t.scrollTop-p.y,r.y&&t.scrollBy({top:-r.y,behavior:a});break}}this.handleMove(e,Ls(Zs(l,this.referenceCoordinates),r))}}}handleMove(e,n){const{onMove:t}=this.props;e.preventDefault(),t(n)}handleEnd(e){const{onEnd:n}=this.props;e.preventDefault(),this.detach(),n()}handleCancel(e){const{onCancel:n}=this.props;e.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function Wu(e){return Boolean(e&&"distance"in e)}function Hu(e){return Boolean(e&&"delay"in e)}Vu.activators=[{eventName:"onKeyDown",handler:(e,n,t)=>{let{keyboardCodes:r=Pu,onActivation:i}=n,{active:o}=t;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const n=o.activatorNode.current;return!(n&&e.target!==n||(e.preventDefault(),null==i||i({event:e.nativeEvent}),0))}return!1}}];class Fu{constructor(e,n,t){var r;void 0===t&&(t=function(e){const{EventTarget:n}=Ss(e);return e instanceof n?e:Gs(e)}(e.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=e,this.events=n;const{event:i}=e,{target:o}=i;this.props=e,this.events=n,this.document=Gs(o),this.documentListeners=new Nu(this.document),this.listeners=new Nu(t),this.windowListeners=new Nu(Ss(o)),this.initialCoordinates=null!=(r=js(i))?r:iu,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:e,props:{options:{activationConstraint:n,bypassActivationConstraint:t}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(Du.Resize,this.handleCancel),this.windowListeners.add(Du.DragStart,ku),this.windowListeners.add(Du.VisibilityChange,this.handleCancel),this.windowListeners.add(Du.ContextMenu,ku),this.documentListeners.add(Du.Keydown,this.handleKeydown),n){if(null!=t&&t({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Hu(n))return this.timeoutId=setTimeout(this.handleStart,n.delay),void this.handlePending(n);if(Wu(n))return void this.handlePending(n)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,n){const{active:t,onPending:r}=this.props;r(t,e,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:e}=this,{onStart:n}=this.props;e&&(this.activated=!0,this.documentListeners.add(Du.Click,Bu,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Du.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:t,initialCoordinates:r,props:i}=this,{onMove:o,options:{activationConstraint:a}}=i;if(!r)return;const s=null!=(n=js(e))?n:iu,u=Zs(r,s);if(!t&&a){if(Wu(a)){if(null!=a.tolerance&&Ou(u,a.tolerance))return this.handleCancel();if(Ou(u,a.distance))return this.handleStart()}return Hu(a)&&Ou(u,a.tolerance)?this.handleCancel():void this.handlePending(a,u)}e.cancelable&&e.preventDefault(),o(s)}handleEnd(){const{onAbort:e,onEnd:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleCancel(){const{onAbort:e,onCancel:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleKeydown(e){e.code===Gu.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const Xu={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Lu extends Fu{constructor(e){const{event:n}=e,t=Gs(n.target);super(e,Xu,t)}}Lu.activators=[{eventName:"onPointerDown",handler:(e,n)=>{let{nativeEvent:t}=e,{onActivation:r}=n;return!(!t.isPrimary||0!==t.button||(null==r||r({event:t}),0))}}];const Zu={move:{name:"mousemove"},end:{name:"mouseup"}};var Yu;!function(e){e[e.RightClick=2]="RightClick"}(Yu||(Yu={})),class extends Fu{constructor(e){super(e,Zu,Gs(e.event.target))}}.activators=[{eventName:"onMouseDown",handler:(e,n)=>{let{nativeEvent:t}=e,{onActivation:r}=n;return t.button!==Yu.RightClick&&(null==r||r({event:t}),!0)}}];const ju={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var Ju,zu;(class extends Fu{constructor(e){super(e,ju)}static setup(){return window.addEventListener(ju.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(ju.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,n)=>{let{nativeEvent:t}=e,{onActivation:r}=n;const{touches:i}=t;return!(i.length>1||(null==r||r({event:t}),0))}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(Ju||(Ju={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(zu||(zu={}));const _u={x:{[yu.Backward]:!1,[yu.Forward]:!1},y:{[yu.Backward]:!1,[yu.Forward]:!1}};var Uu,qu;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(Uu||(Uu={})),function(e){e.Optimized="optimized"}(qu||(qu={}));const Qu=/*#__PURE__*/new Map;function $u(e,n){return Ms(t=>e?t||("function"==typeof n?n(e):e):null,[n,e])}function Ku(n){let{callback:t,disabled:r}=n;const i=Bs(t),o=e.useMemo(()=>{if(r||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(i)},[r]);return e.useEffect(()=>()=>null==o?void 0:o.disconnect(),[o]),o}function ec(e){return new Su(pu(e),e)}function nc(n,t,r){void 0===t&&(t=ec);const[i,o]=e.useState(null);function a(){o(e=>{if(!n)return null;var i;if(!1===n.isConnected)return null!=(i=null!=e?e:r)?i:null;const o=t(n);return JSON.stringify(e)===JSON.stringify(o)?e:o})}const s=function(n){let{callback:t,disabled:r}=n;const i=Bs(t),o=e.useMemo(()=>{if(r||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(i)},[i,r]);return e.useEffect(()=>()=>null==o?void 0:o.disconnect(),[o]),o}({callback(e){if(n)for(const t of e){const{type:e,target:r}=t;if("childList"===e&&r instanceof HTMLElement&&r.contains(n)){a();break}}}}),u=Ku({callback:a});return ks(()=>{a(),n?(null==u||u.observe(n),null==s||s.observe(document.body,{childList:!0,subtree:!0})):(null==u||u.disconnect(),null==s||s.disconnect())},[n]),i}const tc=[];function rc(n,t){void 0===t&&(t=[]);const r=e.useRef(null);return e.useEffect(()=>{r.current=null},t),e.useEffect(()=>{const e=n!==iu;e&&!r.current&&(r.current=n),!e&&r.current&&(r.current=null)},[n]),r.current?Zs(n,r.current):iu}function ic(n){return e.useMemo(()=>n?function(e){const n=e.innerWidth,t=e.innerHeight;return{top:0,left:0,right:n,bottom:t,width:n,height:t}}(n):null,[n])}const oc=[],ac=[{sensor:Lu,options:{}},{sensor:Vu,options:{}}],sc={current:{}},uc={draggable:{measure:fu},droppable:{measure:fu,strategy:Uu.WhileDragging,frequency:qu.Optimized},dragOverlay:{measure:pu}};class cc extends Map{get(e){var n;return null!=e&&null!=(n=super.get(e))?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:n}=e;return!n})}getNodeFor(e){var n,t;return null!=(n=null==(t=this.get(e))?void 0:t.node.current)?n:void 0}}const lc={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:/*#__PURE__*/new Map,droppableRects:/*#__PURE__*/new Map,droppableContainers:/*#__PURE__*/new cc,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:ru},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:uc,measureDroppableContainers:ru,windowRect:null,measuringScheduled:!1},dc=/*#__PURE__*/e.createContext({activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:ru,draggableNodes:/*#__PURE__*/new Map,over:null,measureDroppableContainers:ru}),pc=/*#__PURE__*/e.createContext(lc);function fc(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new cc}}}function mc(e,n){switch(n.type){case tu.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:n.initialCoordinates,active:n.active}};case tu.DragMove:return null==e.draggable.active?e:{...e,draggable:{...e.draggable,translate:{x:n.coordinates.x-e.draggable.initialCoordinates.x,y:n.coordinates.y-e.draggable.initialCoordinates.y}}};case tu.DragEnd:case tu.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case tu.RegisterDroppable:{const{element:t}=n,{id:r}=t,i=new cc(e.droppable.containers);return i.set(r,t),{...e,droppable:{...e.droppable,containers:i}}}case tu.SetDroppableDisabled:{const{id:t,key:r,disabled:i}=n,o=e.droppable.containers.get(t);if(!o||r!==o.key)return e;const a=new cc(e.droppable.containers);return a.set(t,{...o,disabled:i}),{...e,droppable:{...e.droppable,containers:a}}}case tu.UnregisterDroppable:{const{id:t,key:r}=n,i=e.droppable.containers.get(t);if(!i||r!==i.key)return e;const o=new cc(e.droppable.containers);return o.delete(t),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function gc(n){let{disabled:t}=n;const{active:r,activatorEvent:i,draggableNodes:o}=e.useContext(dc),a=Ws(i),s=Ws(null==r?void 0:r.id);return e.useEffect(()=>{if(!t&&!i&&a&&null!=s){if(!Ys(a))return;if(document.activeElement===a.target)return;const e=o.get(s);if(!e)return;const{activatorNode:n,node:t}=e;if(!n.current&&!t.current)return;requestAnimationFrame(()=>{for(const e of[n.current,t.current]){if(!e)continue;const n=_s(e);if(n){n.focus();break}}})}},[i,t,o,s,a]),null}const bc=/*#__PURE__*/e.createContext({...iu,scaleX:1,scaleY:1});var hc;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(hc||(hc={}));const vc=/*#__PURE__*/e.memo(function(n){var t,r,i,o;let{id:a,accessibility:s,autoScroll:u=!0,children:c,sensors:l=ac,collisionDetection:d=su,measuring:p,modifiers:f,...m}=n;const g=e.useReducer(mc,void 0,fc),[b,h]=g,[v,y]=function(){const[n]=e.useState(()=>new Set),t=e.useCallback(e=>(n.add(e),()=>n.delete(e)),[n]),r=e.useCallback(e=>{let{type:t,event:r}=e;n.forEach(e=>{var n;return null==(n=e[t])?void 0:n.call(e,r)})},[n]);return[r,t]}(),[C,x]=e.useState(hc.Uninitialized),A=C===hc.Initialized,{draggable:{active:E,nodes:w,translate:R},droppable:{containers:T}}=b,N=null!=E?w.get(E):null,O=e.useRef({initial:null,translated:null}),D=e.useMemo(()=>{var e;return null!=E?{id:E,data:null!=(e=null==N?void 0:N.data)?e:sc,rect:O}:null},[E,N]),G=e.useRef(null),[k,B]=e.useState(null),[P,M]=e.useState(null),V=Ps(m,Object.values(m)),W=Fs("DndDescribedBy",a),H=e.useMemo(()=>T.getEnabled(),[T]),F=function(n){return e.useMemo(()=>({draggable:{...uc.draggable,...null==n?void 0:n.draggable},droppable:{...uc.droppable,...null==n?void 0:n.droppable},dragOverlay:{...uc.dragOverlay,...null==n?void 0:n.dragOverlay}}),[null==n?void 0:n.draggable,null==n?void 0:n.droppable,null==n?void 0:n.dragOverlay])}(p),{droppableRects:X,measureDroppableContainers:L,measuringScheduled:Z}=function(n,t){let{dragging:r,dependencies:i,config:o}=t;const[a,s]=e.useState(null),{frequency:u,measure:c,strategy:l}=o,d=e.useRef(n),p=function(){switch(l){case Uu.Always:return!1;case Uu.BeforeDragging:return r;default:return!r}}(),f=Ps(p),m=e.useCallback(function(e){void 0===e&&(e=[]),f.current||s(n=>null===n?e:n.concat(e.filter(e=>!n.includes(e))))},[f]),g=e.useRef(null),b=Ms(e=>{if(p&&!r)return Qu;if(!e||e===Qu||d.current!==n||null!=a){const e=new Map;for(let t of n){if(!t)continue;if(a&&a.length>0&&!a.includes(t.id)&&t.rect.current){e.set(t.id,t.rect.current);continue}const n=t.node.current,r=n?new Su(c(n),n):null;t.rect.current=r,r&&e.set(t.id,r)}return e}return e},[n,a,r,p,c]);return e.useEffect(()=>{d.current=n},[n]),e.useEffect(()=>{p||m()},[r,p]),e.useEffect(()=>{a&&a.length>0&&s(null)},[JSON.stringify(a)]),e.useEffect(()=>{p||"number"!=typeof u||null!==g.current||(g.current=setTimeout(()=>{m(),g.current=null},u))},[u,p,m,...i]),{droppableRects:b,measureDroppableContainers:m,measuringScheduled:null!=a}}(H,{dragging:A,dependencies:[R.x,R.y],config:F.droppable}),Y=function(e,n){const t=null!=n?e.get(n):void 0,r=t?t.node.current:null;return Ms(e=>{var t;return null==n?null:null!=(t=null!=r?r:e)?t:null},[r,n])}(w,E),j=e.useMemo(()=>P?js(P):null,[P]),J=function(){const e=A&&!(!1===(null==k?void 0:k.autoScrollEnabled))&&!("object"==typeof u?!1===u.enabled:!1===u);return"object"==typeof u?{...u,enabled:e}:{enabled:e}}(),z=function(e,n){return $u(e,n)}(Y,F.draggable.measure);!function(n){let{activeNode:t,measure:r,initialRect:i,config:o=!0}=n;const a=e.useRef(!1),{x:s,y:u}="boolean"==typeof o?{x:o,y:o}:o;ks(()=>{if(!s&&!u||!t)return void(a.current=!1);if(a.current||!i)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const n=uu(r(e),i);if(s||(n.x=0),u||(n.y=0),a.current=!0,Math.abs(n.x)>0||Math.abs(n.y)>0){const t=gu(e);t&&t.scrollBy({top:n.y,left:n.x})}},[t,s,u,i,r])}({activeNode:null!=E?w.get(E):null,config:J.layoutShiftCompensation,initialRect:z,measure:F.draggable.measure});const _=nc(Y,F.draggable.measure,z),U=nc(Y?Y.parentElement:null),q=e.useRef({activatorEvent:null,active:null,activeNode:Y,collisionRect:null,collisions:null,droppableRects:X,draggableNodes:w,draggingNode:null,draggingNodeRect:null,droppableContainers:T,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Q=T.getNodeFor(null==(t=q.current.over)?void 0:t.id),$=function(n){let{measure:t}=n;const[r,i]=e.useState(null),o=e.useCallback(e=>{for(const{target:n}of e)if(Os(n)){i(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t]),a=Ku({callback:o}),s=e.useCallback(e=>{const n=function(e){if(!e)return null;if(e.children.length>1)return e;const n=e.children[0];return Os(n)?n:e}(e);null==a||a.disconnect(),n&&(null==a||a.observe(n)),i(n?t(n):null)},[t,a]),[u,c]=Vs(s);return e.useMemo(()=>({nodeRef:u,rect:r,setRef:c}),[r,u,c])}({measure:F.dragOverlay.measure}),K=null!=(r=$.nodeRef.current)?r:Y,ee=A?null!=(i=$.rect)?i:_:null,ne=Boolean($.nodeRef.current&&$.rect),te=uu(re=ne?null:_,$u(re));var re;const ie=ic(K?Ss(K):null),oe=function(n){const t=e.useRef(n),r=Ms(e=>n?e&&e!==tc&&n&&t.current&&n.parentNode===t.current.parentNode?e:mu(n):tc,[n]);return e.useEffect(()=>{t.current=n},[n]),r}(A?null!=Q?Q:Y:null),ae=function(n,t){void 0===t&&(t=pu);const[r]=n,i=ic(r?Ss(r):null),[o,a]=e.useState(oc);function s(){a(()=>n.length?n.map(e=>Cu(e)?i:new Su(t(e),e)):oc)}const u=Ku({callback:s});return ks(()=>{null==u||u.disconnect(),s(),n.forEach(e=>null==u?void 0:u.observe(e))},[n]),o}(oe),se=function(e,n){let{transform:t,...r}=n;return null!=e&&e.length?e.reduce((e,n)=>n({transform:e,...r}),t):t}(f,{transform:{x:R.x-te.x,y:R.y-te.y,scaleX:1,scaleY:1},activatorEvent:P,active:D,activeNodeRect:_,containerNodeRect:U,draggingNodeRect:ee,over:q.current.over,overlayNodeRect:$.rect,scrollableAncestors:oe,scrollableAncestorRects:ae,windowRect:ie}),ue=j?Ls(j,R):null,ce=function(n){const[t,r]=e.useState(null),i=e.useRef(n),o=e.useCallback(e=>{const n=bu(e.target);n&&r(e=>e?(e.set(n,Iu(n)),new Map(e)):null)},[]);return e.useEffect(()=>{const e=i.current;if(n!==e){t(e);const a=n.map(e=>{const n=bu(e);return n?(n.addEventListener("scroll",o,{passive:!0}),[n,Iu(n)]):null}).filter(e=>null!=e);r(a.length?new Map(a):null),i.current=n}return()=>{t(n),t(e)};function t(e){e.forEach(e=>{const n=bu(e);null==n||n.removeEventListener("scroll",o)})}},[o,n]),e.useMemo(()=>n.length?t?Array.from(t.values()).reduce((e,n)=>Ls(e,n),iu):Ru(n):iu,[n,t])}(oe),le=rc(ce),de=rc(ce,[_]),pe=Ls(se,le),fe=ee?lu(ee,se):null,me=D&&fe?d({active:D,collisionRect:fe,droppableRects:X,droppableContainers:H,pointerCoordinates:ue}):null,ge=function(e){if(!e||0===e.length)return null;const[n]=e;return n.id}(me),[be,he]=e.useState(null),ve=function(e,n,t){return{...e,scaleX:n&&t?n.width/t.width:1,scaleY:n&&t?n.height/t.height:1}}(ne?se:Ls(se,de),null!=(o=null==be?void 0:be.rect)?o:null,_),Ie=e.useRef(null),ye=e.useCallback((e,n)=>{let{sensor:t,options:r}=n;if(null==G.current)return;const i=w.get(G.current);if(!i)return;const o=e.nativeEvent,a=new t({active:G.current,activeNode:i,event:o,options:r,context:q,onAbort(e){if(!w.get(e))return;const{onDragAbort:n}=V.current,t={id:e};null==n||n(t),v({type:"onDragAbort",event:t})},onPending(e,n,t,r){if(!w.get(e))return;const{onDragPending:i}=V.current,o={id:e,constraint:n,initialCoordinates:t,offset:r};null==i||i(o),v({type:"onDragPending",event:o})},onStart(e){const n=G.current;if(null==n)return;const t=w.get(n);if(!t)return;const{onDragStart:r}=V.current,i={activatorEvent:o,active:{id:n,data:t.data,rect:O}};I.unstable_batchedUpdates(()=>{null==r||r(i),x(hc.Initializing),h({type:tu.DragStart,initialCoordinates:e,active:n}),v({type:"onDragStart",event:i}),B(Ie.current),M(o)})},onMove(e){h({type:tu.DragMove,coordinates:e})},onEnd:s(tu.DragEnd),onCancel:s(tu.DragCancel)});function s(e){return async function(){const{active:n,collisions:t,over:r,scrollAdjustedTranslate:i}=q.current;let a=null;if(n&&i){const{cancelDrop:s}=V.current;a={activatorEvent:o,active:n,collisions:t,delta:i,over:r},e===tu.DragEnd&&"function"==typeof s&&await Promise.resolve(s(a))&&(e=tu.DragCancel)}G.current=null,I.unstable_batchedUpdates(()=>{h({type:e}),x(hc.Uninitialized),he(null),B(null),M(null),Ie.current=null;const n=e===tu.DragEnd?"onDragEnd":"onDragCancel";if(a){const e=V.current[n];null==e||e(a),v({type:n,event:a})}})}}Ie.current=a},[w]),Ce=e.useCallback((e,n)=>(t,r)=>{const i=t.nativeEvent,o=w.get(r);null!==G.current||!o||i.dndKit||i.defaultPrevented||!0===e(t,n.options,{active:o})&&(i.dndKit={capturedBy:n.sensor},G.current=r,ye(t,n))},[w,ye]),xe=function(n,t){return e.useMemo(()=>n.reduce((e,n)=>{const{sensor:r}=n;return[...e,...r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}))]},[]),[n,t])}(l,Ce);!function(n){e.useEffect(()=>{if(!ws)return;const e=n.map(e=>{let{sensor:n}=e;return null==n.setup?void 0:n.setup()});return()=>{for(const n of e)null==n||n()}},n.map(e=>{let{sensor:n}=e;return n}))}(l),ks(()=>{_&&C===hc.Initializing&&x(hc.Initialized)},[_,C]),e.useEffect(()=>{const{onDragMove:e}=V.current,{active:n,activatorEvent:t,collisions:r,over:i}=q.current;if(!n||!t)return;const o={active:n,activatorEvent:t,collisions:r,delta:{x:pe.x,y:pe.y},over:i};I.unstable_batchedUpdates(()=>{null==e||e(o),v({type:"onDragMove",event:o})})},[pe.x,pe.y]),e.useEffect(()=>{const{active:e,activatorEvent:n,collisions:t,droppableContainers:r,scrollAdjustedTranslate:i}=q.current;if(!e||null==G.current||!n||!i)return;const{onDragOver:o}=V.current,a=r.get(ge),s=a&&a.rect.current?{id:a.id,rect:a.rect.current,data:a.data,disabled:a.disabled}:null,u={active:e,activatorEvent:n,collisions:t,delta:{x:i.x,y:i.y},over:s};I.unstable_batchedUpdates(()=>{he(s),null==o||o(u),v({type:"onDragOver",event:u})})},[ge]),ks(()=>{q.current={activatorEvent:P,active:D,activeNode:Y,collisionRect:fe,collisions:me,droppableRects:X,draggableNodes:w,draggingNode:K,draggingNodeRect:ee,droppableContainers:T,over:be,scrollableAncestors:oe,scrollAdjustedTranslate:pe},O.current={initial:ee,translated:fe}},[D,Y,me,fe,w,K,ee,X,T,be,oe,pe]),function(n){let{acceleration:t,activator:r=Ju.Pointer,canScroll:i,draggingRect:o,enabled:a,interval:s=5,order:u=zu.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:d,delta:p,threshold:f}=n;const m=function(e){let{delta:n,disabled:t}=e;const r=Ws(n);return Ms(e=>{if(t||!r||!e)return _u;const i=Math.sign(n.x-r.x),o=Math.sign(n.y-r.y);return{x:{[yu.Backward]:e.x[yu.Backward]||-1===i,[yu.Forward]:e.x[yu.Forward]||1===i},y:{[yu.Backward]:e.y[yu.Backward]||-1===o,[yu.Forward]:e.y[yu.Forward]||1===o}}},[t,n,r])}({delta:p,disabled:!a}),[g,b]=function(){const n=e.useRef(null);return[e.useCallback((e,t)=>{n.current=setInterval(e,t)},[]),e.useCallback(()=>{null!==n.current&&(clearInterval(n.current),n.current=null)},[])]}(),h=e.useRef({x:0,y:0}),v=e.useRef({x:0,y:0}),I=e.useMemo(()=>{switch(r){case Ju.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Ju.DraggableRect:return o}},[r,o,c]),y=e.useRef(null),C=e.useCallback(()=>{const e=y.current;e&&e.scrollBy(h.current.x*v.current.x,h.current.y*v.current.y)},[]),x=e.useMemo(()=>u===zu.TreeOrder?[...l].reverse():l,[u,l]);e.useEffect(()=>{if(a&&l.length&&I){for(const e of x){if(!1===(null==i?void 0:i(e)))continue;const n=l.indexOf(e),r=d[n];if(!r)continue;const{direction:o,speed:a}=Eu(e,r,I,t,f);for(const e of["x","y"])m[e][o[e]]||(a[e]=0,o[e]=0);if(a.x>0||a.y>0)return b(),y.current=e,g(C,s),h.current=a,void(v.current=o)}h.current={x:0,y:0},v.current={x:0,y:0},b()}else b()},[t,C,i,b,a,s,JSON.stringify(I),JSON.stringify(m),g,l,x,d,JSON.stringify(f)])}({...J,delta:R,draggingRect:fe,pointerCoordinates:ue,scrollableAncestors:oe,scrollableAncestorRects:ae});const Ae=e.useMemo(()=>({active:D,activeNode:Y,activeNodeRect:_,activatorEvent:P,collisions:me,containerNodeRect:U,dragOverlay:$,draggableNodes:w,droppableContainers:T,droppableRects:X,over:be,measureDroppableContainers:L,scrollableAncestors:oe,scrollableAncestorRects:ae,measuringConfiguration:F,measuringScheduled:Z,windowRect:ie}),[D,Y,_,P,me,U,$,w,T,X,be,L,oe,ae,F,Z,ie]),Ee=e.useMemo(()=>({activatorEvent:P,activators:xe,active:D,activeNodeRect:_,ariaDescribedById:{draggable:W},dispatch:h,draggableNodes:w,over:be,measureDroppableContainers:L}),[P,xe,D,_,h,W,w,be,L]);return S.default.createElement($s.Provider,{value:y},S.default.createElement(dc.Provider,{value:Ee},S.default.createElement(pc.Provider,{value:Ae},S.default.createElement(bc.Provider,{value:ve},c)),S.default.createElement(gc,{disabled:!1===(null==s?void 0:s.restoreFocus)})),S.default.createElement(nu,{...s,hiddenTextDescribedById:W}))}),Ic=/*#__PURE__*/e.createContext(null),yc="button",Cc={timeout:25};function xc(e,n,t){const r=e.slice();return r.splice(t<0?r.length+t:t,0,r.splice(n,1)[0]),r}function Ac(e,n){return e.reduce((e,t,r)=>{const i=n.get(t);return i&&(e[r]=i),e},Array(e.length))}function Ec(e){return null!==e&&e>=0}const wc=e=>{let{rects:n,activeIndex:t,overIndex:r,index:i}=e;const o=xc(n,r,t),a=n[i],s=o[i];return s&&a?{x:s.left-a.left,y:s.top-a.top,scaleX:s.width/a.width,scaleY:s.height/a.height}:null},Rc="Sortable",Tc=/*#__PURE__*/S.default.createContext({activeIndex:-1,containerId:Rc,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:wc,disabled:{draggable:!1,droppable:!1}});function Sc(n){let{children:t,id:r,items:i,strategy:o=wc,disabled:a=!1}=n;const{active:s,dragOverlay:u,droppableRects:c,over:l,measureDroppableContainers:d}=e.useContext(pc),p=Fs(Rc,r),f=Boolean(null!==u.rect),m=e.useMemo(()=>i.map(e=>"object"==typeof e&&"id"in e?e.id:e),[i]),g=null!=s,b=s?m.indexOf(s.id):-1,h=l?m.indexOf(l.id):-1,v=e.useRef(m),I=!function(e,n){if(e===n)return!0;if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t]!==n[t])return!1;return!0}(m,v.current),y=-1!==h&&-1===b||I,C=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(a);ks(()=>{I&&g&&d(m)},[I,m,g,d]),e.useEffect(()=>{v.current=m},[m]);const x=e.useMemo(()=>({activeIndex:b,containerId:p,disabled:C,disableTransforms:y,items:m,overIndex:h,useDragOverlay:f,sortedRects:Ac(m,c),strategy:o}),[b,p,C.draggable,C.droppable,y,m,h,c,f,o]);return S.default.createElement(Tc.Provider,{value:x},t)}const Nc=e=>{let{id:n,items:t,activeIndex:r,overIndex:i}=e;return xc(t,r,i).indexOf(n)},Oc=e=>{let{containerId:n,isSorting:t,wasDragging:r,index:i,items:o,newIndex:a,previousItems:s,previousContainerId:u,transition:c}=e;return!(!c||!r||s!==o&&i===a||!t&&(a===i||n!==u))},Dc={duration:200,easing:"ease"},Gc="transform",kc=/*#__PURE__*/Js.Transition.toString({property:Gc,duration:0,easing:"linear"}),Bc={roleDescription:"sortable"};var Pc=function(n){var t=function(n){let{animateLayoutChanges:t=Oc,attributes:r,disabled:i,data:o,getNewIndex:a=Nc,id:s,strategy:u,resizeObserverConfig:c,transition:l=Dc}=n;const{items:d,containerId:p,activeIndex:f,disabled:m,disableTransforms:g,sortedRects:b,overIndex:h,useDragOverlay:v,strategy:I}=e.useContext(Tc),y=function(e,n){var t,r;return"boolean"==typeof e?{draggable:e,droppable:!1}:{draggable:null!=(t=null==e?void 0:e.draggable)?t:n.draggable,droppable:null!=(r=null==e?void 0:e.droppable)?r:n.droppable}}(i,m),C=d.indexOf(s),x=e.useMemo(()=>({sortable:{containerId:p,index:C,items:d},...o}),[p,o,C,d]),A=e.useMemo(()=>d.slice(d.indexOf(s)),[d,s]),{rect:E,node:w,isOver:R,setNodeRef:T}=function(n){let{data:t,disabled:r=!1,id:i,resizeObserverConfig:o}=n;const a=Fs("Droppable"),{active:s,dispatch:u,over:c,measureDroppableContainers:l}=e.useContext(dc),d=e.useRef({disabled:r}),p=e.useRef(!1),f=e.useRef(null),m=e.useRef(null),{disabled:g,updateMeasurementsFor:b,timeout:h}={...Cc,...o},v=Ps(null!=b?b:i),I=Ku({callback:e.useCallback(()=>{p.current?(null!=m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{l(Array.isArray(v.current)?v.current:[v.current]),m.current=null},h)):p.current=!0},[h]),disabled:g||!s}),y=e.useCallback((e,n)=>{I&&(n&&(I.unobserve(n),p.current=!1),e&&I.observe(e))},[I]),[C,x]=Vs(y),A=Ps(t);return e.useEffect(()=>{I&&C.current&&(I.disconnect(),p.current=!1,I.observe(C.current))},[C,I]),e.useEffect(()=>(u({type:tu.RegisterDroppable,element:{id:i,key:a,disabled:r,node:C,rect:f,data:A}}),()=>u({type:tu.UnregisterDroppable,key:a,id:i})),[i]),e.useEffect(()=>{r!==d.current.disabled&&(u({type:tu.SetDroppableDisabled,id:i,key:a,disabled:r}),d.current.disabled=r)},[i,a,r,u]),{active:s,rect:f,isOver:(null==c?void 0:c.id)===i,node:C,over:c,setNodeRef:x}}({id:s,data:x,disabled:y.droppable,resizeObserverConfig:{updateMeasurementsFor:A,...c}}),{active:S,activatorEvent:N,activeNodeRect:O,attributes:D,setNodeRef:G,listeners:k,isDragging:B,over:P,setActivatorNodeRef:M,transform:V}=function(n){let{id:t,data:r,disabled:i=!1,attributes:o}=n;const a=Fs("Draggable"),{activators:s,activatorEvent:u,active:c,activeNodeRect:l,ariaDescribedById:d,draggableNodes:p,over:f}=e.useContext(dc),{role:m=yc,roleDescription:g="draggable",tabIndex:b=0}=null!=o?o:{},h=(null==c?void 0:c.id)===t,v=e.useContext(h?bc:Ic),[I,y]=Vs(),[C,x]=Vs(),A=function(n,t){return e.useMemo(()=>n.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[n,t])}(s,t),E=Ps(r);return ks(()=>(p.set(t,{id:t,key:a,node:I,activatorNode:C,data:E}),()=>{const e=p.get(t);e&&e.key===a&&p.delete(t)}),[p,t]),{active:c,activatorEvent:u,activeNodeRect:l,attributes:e.useMemo(()=>({role:m,tabIndex:b,"aria-disabled":i,"aria-pressed":!(!h||m!==yc)||void 0,"aria-roledescription":g,"aria-describedby":d.draggable}),[i,m,b,h,g,d.draggable]),isDragging:h,listeners:i?void 0:A,node:I,over:f,setNodeRef:y,setActivatorNodeRef:x,transform:v}}({id:s,data:x,attributes:{...Bc,...r},disabled:y.draggable}),W=function(){for(var n=arguments.length,t=new Array(n),r=0;r<n;r++)t[r]=arguments[r];return e.useMemo(()=>e=>{t.forEach(n=>n(e))},t)}(T,G),H=Boolean(S),F=H&&!g&&Ec(f)&&Ec(h),X=!v&&B,L=X&&F?V:null,Z=F?null!=L?L:(null!=u?u:I)({rects:b,activeNodeRect:O,activeIndex:f,overIndex:h,index:C}):null,Y=Ec(f)&&Ec(h)?a({id:s,items:d,activeIndex:f,overIndex:h}):C,j=null==S?void 0:S.id,J=e.useRef({activeId:j,items:d,newIndex:Y,containerId:p}),z=d!==J.current.items,_=t({active:S,containerId:p,isDragging:B,isSorting:H,id:s,index:C,items:d,newIndex:J.current.newIndex,previousItems:J.current.items,previousContainerId:J.current.containerId,transition:l,wasDragging:null!=J.current.activeId}),U=function(n){let{disabled:t,index:r,node:i,rect:o}=n;const[a,s]=e.useState(null),u=e.useRef(r);return ks(()=>{if(!t&&r!==u.current&&i.current){const e=o.current;if(e){const n=pu(i.current,{ignoreTransform:!0}),t={x:e.left-n.left,y:e.top-n.top,scaleX:e.width/n.width,scaleY:e.height/n.height};(t.x||t.y)&&s(t)}}r!==u.current&&(u.current=r)},[t,r,i,o]),e.useEffect(()=>{a&&s(null)},[a]),a}({disabled:!_,index:C,node:w,rect:E});return e.useEffect(()=>{H&&J.current.newIndex!==Y&&(J.current.newIndex=Y),p!==J.current.containerId&&(J.current.containerId=p),d!==J.current.items&&(J.current.items=d)},[H,Y,p,d]),e.useEffect(()=>{if(j===J.current.activeId)return;if(null!=j&&null==J.current.activeId)return void(J.current.activeId=j);const e=setTimeout(()=>{J.current.activeId=j},50);return()=>clearTimeout(e)},[j]),{active:S,activeIndex:f,attributes:D,data:x,rect:E,index:C,newIndex:Y,items:d,isOver:R,isSorting:H,isDragging:B,listeners:k,node:w,overIndex:h,over:P,setNodeRef:W,setActivatorNodeRef:M,setDroppableNodeRef:T,setDraggableNodeRef:G,transform:null!=U?U:Z,transition:U||z&&J.current.newIndex===C?kc:X&&!Ys(N)||!l?void 0:H||_?Js.Transition.toString({...l,property:Gc}):void 0}}({id:n.data.value}),r=t.attributes,i=t.listeners,o=t.setNodeRef,a=t.transition,s={display:"flex",transform:Js.Transform.toString(t.transform),transition:a};/*#__PURE__*/return S.default.createElement("div",L({ref:o,style:s},r,i,{onPointerDown:function(e){e.target instanceof HTMLElement&&(["svg","path"].includes(e.target.nodeName)&&(e.preventDefault(),e.stopPropagation()),null==i||i.onPointerDown(e))}}),/*#__PURE__*/S.default.createElement(Ea.MultiValueContainer,n))},Mc=function(e){var n=L({},e.innerProps,{style:{cursor:"grab"},onMouseDown:function(e){e.preventDefault(),e.stopPropagation()}});/*#__PURE__*/return S.default.createElement(Ea.MultiValueLabel,L({},e,{innerProps:n}))},Vc=Hi(function(e,n){var t,r,i,o="[object Map]",a="[object Promise]",s="[object Set]",u="[object WeakMap]",c="[object DataView]",l=/^\[object .+?Constructor\]$/,d="object"==typeof self&&self&&self.Object===Object&&self,p="object"==typeof Vi&&Vi&&Vi.Object===Object&&Vi||d||Function("return this")(),f=n&&!n.nodeType&&n,m=f&&e&&!e.nodeType&&e,g=m&&m.exports===f,b=Function.prototype,h=Object.prototype,v=p["__core-js_shared__"],I=(t=/[^.]+$/.exec(v&&v.keys&&v.keys.IE_PROTO||""))?"Symbol(src)_1."+t:"",y=b.toString,C=h.hasOwnProperty,x=h.toString,A=RegExp("^"+y.call(C).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),E=g?p.Buffer:void 0,w=h.propertyIsEnumerable,R=E?E.isBuffer:void 0,T=(r=Object.keys,i=Object,function(e){return r(i(e))}),S=H(p,"DataView"),N=H(p,"Map"),O=H(p,"Promise"),D=H(p,"Set"),G=H(p,"WeakMap"),k=!w.call({valueOf:1},"valueOf"),B=X(S),P=X(N),M=X(O),V=X(D),W=X(G);function H(e,n){var t=function(e,n){return null==e?void 0:e[n]}(e,n);return function(e){if(!J(e)||function(e){return!!I&&I in e}(e))return!1;var n=j(e)||function(e){var n=!1;if(null!=e&&"function"!=typeof e.toString)try{n=!!(e+"")}catch(e){}return n}(e)?A:l;return n.test(X(e))}(t)?t:void 0}var F=function(e){return x.call(e)};function X(e){if(null!=e){try{return y.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(S&&F(new S(new ArrayBuffer(1)))!=c||N&&F(new N)!=o||O&&F(O.resolve())!=a||D&&F(new D)!=s||G&&F(new G)!=u)&&(F=function(e){var n=x.call(e),t="[object Object]"==n?e.constructor:void 0,r=t?X(t):void 0;if(r)switch(r){case B:return c;case P:return o;case M:return a;case V:return s;case W:return u}return n});var L=Array.isArray;function Z(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}(e.length)&&!j(e)}var Y=R||function(){return!1};function j(e){var n=J(e)?x.call(e):"";return"[object Function]"==n||"[object GeneratorFunction]"==n}function J(e){var n=typeof e;return!!e&&("object"==n||"function"==n)}e.exports=function(e){if(Z(e)&&(L(e)||"string"==typeof e||"function"==typeof e.splice||Y(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Z(e)}(e)&&C.call(e,"callee")&&(!w.call(e,"callee")||"[object Arguments]"==x.call(e))}(e)))return!e.length;var n=F(e);if(n==o||n==s)return!e.size;if(k||function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||h)}(e))return!T(e).length;for(var t in e)if(C.call(e,t))return!1;return!0}}),Wc=function(e,n){return Wc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)n.hasOwnProperty(t)&&(e[t]=n[t])},Wc(e,n)};function Hc(e,n){function t(){this.constructor=e}Wc(e,n),e.prototype=null===n?Object.create(n):(t.prototype=n.prototype,new t)}function Fc(e){return"function"==typeof e}var Xc=!1,Lc={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){Xc=e},get useDeprecatedSynchronousErrorHandling(){return Xc}};function Zc(e){setTimeout(function(){throw e},0)}var Yc={closed:!0,next:function(e){},error:function(e){if(Lc.useDeprecatedSynchronousErrorHandling)throw e;Zc(e)},complete:function(){}},jc=/*@__PURE__*/function(){return Array.isArray||function(e){return e&&"number"==typeof e.length}}();function Jc(e){return null!==e&&"object"==typeof e}var zc=/*@__PURE__*/function(){function e(e){return Error.call(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map(function(e,n){return n+1+") "+e.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=e,this}return e.prototype=/*@__PURE__*/Object.create(Error.prototype),e}(),_c=zc,Uc=/*@__PURE__*/function(){function e(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}return e.prototype.unsubscribe=function(){var n;if(!this.closed){var t=this,r=t._parentOrParents,i=t._ctorUnsubscribe,o=t._unsubscribe,a=t._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,r instanceof e)r.remove(this);else if(null!==r)for(var s=0;s<r.length;++s)r[s].remove(this);if(Fc(o)){i&&(this._unsubscribe=void 0);try{o.call(this)}catch(e){n=e instanceof _c?qc(e.errors):[e]}}if(jc(a)){s=-1;for(var u=a.length;++s<u;){var c=a[s];if(Jc(c))try{c.unsubscribe()}catch(e){n=n||[],e instanceof _c?n=n.concat(qc(e.errors)):n.push(e)}}}if(n)throw new _c(n)}},e.prototype.add=function(n){var t=n;if(!n)return e.EMPTY;switch(typeof n){case"function":t=new e(n);case"object":if(t===this||t.closed||"function"!=typeof t.unsubscribe)return t;if(this.closed)return t.unsubscribe(),t;if(!(t instanceof e)){var r=t;(t=new e)._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+n+" added to Subscription.")}var i=t._parentOrParents;if(null===i)t._parentOrParents=this;else if(i instanceof e){if(i===this)return t;t._parentOrParents=[i,this]}else{if(-1!==i.indexOf(this))return t;i.push(this)}var o=this._subscriptions;return null===o?this._subscriptions=[t]:o.push(t),t},e.prototype.remove=function(e){var n=this._subscriptions;if(n){var t=n.indexOf(e);-1!==t&&n.splice(t,1)}},e.EMPTY=function(e){return e.closed=!0,e}(new e),e}();function qc(e){return e.reduce(function(e,n){return e.concat(n instanceof _c?n.errors:n)},[])}var Qc=/*@__PURE__*/function(){return"function"==typeof Symbol?/*@__PURE__*/Symbol("rxSubscriber"):"@@rxSubscriber_"+/*@__PURE__*/Math.random()}(),$c=/*@__PURE__*/function(e){function n(t,r,i){var o=e.call(this)||this;switch(o.syncErrorValue=null,o.syncErrorThrown=!1,o.syncErrorThrowable=!1,o.isStopped=!1,arguments.length){case 0:o.destination=Yc;break;case 1:if(!t){o.destination=Yc;break}if("object"==typeof t){t instanceof n?(o.syncErrorThrowable=t.syncErrorThrowable,o.destination=t,t.add(o)):(o.syncErrorThrowable=!0,o.destination=new Kc(o,t));break}default:o.syncErrorThrowable=!0,o.destination=new Kc(o,t,r,i)}return o}return Hc(n,e),n.prototype[Qc]=function(){return this},n.create=function(e,t,r){var i=new n(e,t,r);return i.syncErrorThrowable=!1,i},n.prototype.next=function(e){this.isStopped||this._next(e)},n.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},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))},n.prototype._next=function(e){this.destination.next(e)},n.prototype._error=function(e){this.destination.error(e),this.unsubscribe()},n.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},n.prototype._unsubscribeAndRecycle=function(){var e=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this},n}(Uc),Kc=/*@__PURE__*/function(e){function n(n,t,r,i){var o,a=e.call(this)||this;a._parentSubscriber=n;var s=a;return Fc(t)?o=t:t&&(o=t.next,r=t.error,i=t.complete,t!==Yc&&(Fc((s=Object.create(t)).unsubscribe)&&a.add(s.unsubscribe.bind(s)),s.unsubscribe=a.unsubscribe.bind(a))),a._context=s,a._next=o,a._error=r,a._complete=i,a}return Hc(n,e),n.prototype.next=function(e){if(!this.isStopped&&this._next){var n=this._parentSubscriber;Lc.useDeprecatedSynchronousErrorHandling&&n.syncErrorThrowable?this.__tryOrSetError(n,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}},n.prototype.error=function(e){if(!this.isStopped){var n=this._parentSubscriber,t=Lc.useDeprecatedSynchronousErrorHandling;if(this._error)t&&n.syncErrorThrowable?(this.__tryOrSetError(n,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(n.syncErrorThrowable)t?(n.syncErrorValue=e,n.syncErrorThrown=!0):Zc(e),this.unsubscribe();else{if(this.unsubscribe(),t)throw e;Zc(e)}}},n.prototype.complete=function(){var e=this;if(!this.isStopped){var n=this._parentSubscriber;if(this._complete){var t=function(){return e._complete.call(e._context)};Lc.useDeprecatedSynchronousErrorHandling&&n.syncErrorThrowable?(this.__tryOrSetError(n,t),this.unsubscribe()):(this.__tryOrUnsub(t),this.unsubscribe())}else this.unsubscribe()}},n.prototype.__tryOrUnsub=function(e,n){try{e.call(this._context,n)}catch(e){if(this.unsubscribe(),Lc.useDeprecatedSynchronousErrorHandling)throw e;Zc(e)}},n.prototype.__tryOrSetError=function(e,n,t){if(!Lc.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{n.call(this._context,t)}catch(n){return Lc.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=n,e.syncErrorThrown=!0,!0):(Zc(n),!0)}return!1},n.prototype._unsubscribe=function(){var e=this._parentSubscriber;this._context=null,this._parentSubscriber=null,e.unsubscribe()},n}($c),el=/*@__PURE__*/function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();function nl(e){return e}var tl=/*@__PURE__*/function(){function e(e){this._isScalar=!1,e&&(this._subscribe=e)}return e.prototype.lift=function(n){var t=new e;return t.source=this,t.operator=n,t},e.prototype.subscribe=function(e,n,t){var r=this.operator,i=function(e,n,t){if(e){if(e instanceof $c)return e;if(e[Qc])return e[Qc]()}return e||n||t?new $c(e,n,t):new $c(Yc)}(e,n,t);if(i.add(r?r.call(i,this.source):this.source||Lc.useDeprecatedSynchronousErrorHandling&&!i.syncErrorThrowable?this._subscribe(i):this._trySubscribe(i)),Lc.useDeprecatedSynchronousErrorHandling&&i.syncErrorThrowable&&(i.syncErrorThrowable=!1,i.syncErrorThrown))throw i.syncErrorValue;return i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(n){Lc.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=n),function(e){for(;e;){var n=e.destination;if(e.closed||e.isStopped)return!1;e=n&&n instanceof $c?n:null}return!0}(e)?e.error(n):console.warn(n)}},e.prototype.forEach=function(e,n){var t=this;return new(n=rl(n))(function(n,r){var i;i=t.subscribe(function(n){try{e(n)}catch(e){r(e),i&&i.unsubscribe()}},r,n)})},e.prototype._subscribe=function(e){var n=this.source;return n&&n.subscribe(e)},e.prototype[el]=function(){return this},e.prototype.pipe=function(){for(var e,n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return 0===n.length?this:(0===(e=n).length?nl:1===e.length?e[0]:function(n){return e.reduce(function(e,n){return n(e)},n)})(this)},e.prototype.toPromise=function(e){var n=this;return new(e=rl(e))(function(e,t){var r;n.subscribe(function(e){return r=e},function(e){return t(e)},function(){return e(r)})})},e.create=function(n){return new e(n)},e}();function rl(e){if(e||(e=Lc.Promise||Promise),!e)throw new Error("no Promise impl found");return e}var il=/*#__PURE__*/function(){function e(e){var n=this;this.wsURL=void 0,this.cable=null,this.subscriptions=new Map,this.addSubscription=function(e,t){n.subscriptions.set(e,t)},this.wsURL=e}var n=e.prototype;return n.connect=function(e,n){this.cable=F.default.createConsumer(this.wsURL+"?token="+e+"&lang="+n)},n.request=function(e){var n,t=this.cable,r=this.subscriptions,i=this.addSubscription;return new tl(function(o){if(t){var a,s=(null==(a=e.variables)?void 0:a.id)||"company";r.has(s)||(n=t.subscriptions.create({channel:"GraphqlChannel",channelId:Math.round(Date.now()+1e5*Math.random()).toString(16)},{connected:function(){this.perform("execute",e)},received:function(e){e.more?e.result.errors?o.error&&o.error(e.result.errors[0]):e.result.data&&o.next&&(Vc(e.result.data)||o.next(e.result)):o.complete&&o.complete()}}),i(s,n))}})},n.hasSubscription=function(e){return this.subscriptions.has(e)},e}(),ol=/*#__PURE__*/function(){function e(e,n,t){this.actionCableClient=null,this.actionCableClient=new il(e),this.actionCableClient.connect(n,t)}return e.prototype.subscribe=function(e,n,t,r){if(void 0===r&&(r=function(e){throw e}),!this.actionCableClient)throw new Error("No WS client available");var i=this.actionCableClient.request({query:e,variables:n}).subscribe({next:function(e){var n=e.data,i=e.errors;if(i)return r(new Error(JSON.stringify(i)));n&&t&&t(function(e){var n=Object.keys(e);if(1!==n.length)throw new Error("Expected exactly one response key, got: "+n.join(", "));return e[n[0]]}(n))}});return function(){return i.unsubscribe()}},e}(),al=function(e,n,t){return new ol(e,n,t)},sl=function(e,n){return ii(new E.GraphQLClient(e,{fetch:n}))},ul=function(n){var t,r=n.url,o=n.wsUrl,a=n.lang,s=i.useStore().sessionStore,u=e.useState(),c=u[0],l=u[1],d=e.useState(),p=d[0],f=d[1],m=o||r.replace("graphql","cable"),g=(null==(t=s.loginStatus.authResponse)?void 0:t.accessToken)||"";return e.useEffect(function(){r&&l(sl(r,i.fetch))},[r]),e.useEffect(function(){r&&g&&f(al(m||r.replace("graphql","cable"),g,a))},[r,m,g,a]),{graphqlSdk:c,gqlWsClient:p}},cl={root:{boxShadow:"none","& .react-resizable-handle":{width:"24px",height:"24px",borderRadius:"4px",background:function(e){return e.palette.primary.main+" url("+X.default+")"},backgroundRepeat:"no-repeat",backgroundSize:"50%",backgroundPosition:"50%","&:hover":{backgroundColor:function(e){return e.palette.primary.dark}}},"& .react-resizable-handle:after":{display:"none"}},header:{height:"40px"},dragIcon:{width:"30px",height:"30px",marginLeft:function(e){return"-"+e.spacing(1)},padding:"8px",borderRadius:"4px",background:function(e){return e.palette.primary.main},"&:hover":{cursor:"move",background:function(e){return e.palette.primary.dark}}},actionButtons:{height:"30px",marginTop:"-7px"},settingsButton:{color:"rgba(255, 255, 255, 0.45)",borderRadius:"4px",borderTopRightRadius:0,borderBottomRightRadius:0,borderColor:"rgba(255,255,255,0.1)",background:"rgba(255,255,255,0.1)","&:focus":{boxShadow:"0 0 0 1px rgba(255, 255, 255, 0.1)"},"&:hover":{opacity:.8}},infoButton:{marginLeft:"1px",color:"rgba(255, 255, 255, 0.45)",borderRadius:0,borderColor:"rgba(255,255,255,0.1)",background:"rgba(255,255,255,0.1)","&:focus":{boxShadow:"0 0 0 1px rgba(255, 255, 255, 0.1)"},"&:hover":{opacity:.8}},deleteButton:{marginLeft:"1px",color:"rgba(255, 255, 255, 0.45)",borderRadius:"4px",borderTopLeftRadius:0,borderBottomLeftRadius:0,borderColor:"rgba(255,255,255,0.1)",background:"rgba(255,255,255,0.1)","&:focus":{boxShadow:"0 0 0 1px rgba(255, 255, 255, 0.1)"},"&:hover":{opacity:.8}},content:{height:"calc(100% - 40px)",padding:0,background:"transparent",border:"1px solid rgba(255, 255, 255, 0.2)",borderTop:"none",borderRadius:"4px",boxShadow:"0px 4px 8px rgba(0, 0, 0, 0.25)","&:last-child":{paddingBottom:0}}},ll=["children","title","Widget","id","url","wsUrl","lang","data","filters","settings","openSettingsModal","onSettingsModalOpened","onSettingsModalClosed","sidePanelOpened","updateSidePanelProps","onDelete","editMode","version","requiredFeatures","extraPermissions"];function dl(e,n){try{var t=e()}catch(e){return n(e)}return t&&t.then?t.then(void 0,n):t}var pl=S.default.forwardRef(function(r,o){var a=r.children,s=r.title,u=r.Widget,c=r.id,l=r.url,d=r.wsUrl,p=r.lang,f=r.data,m=r.filters,g=r.settings,b=r.openSettingsModal,h=r.onSettingsModalOpened,v=r.onSettingsModalClosed,I=r.sidePanelOpened,A=r.updateSidePanelProps,E=r.onDelete,w=r.editMode,R=r.version,T=r.requiredFeatures,N=r.extraPermissions,O=Z(r,ll),D=ul({url:l,wsUrl:d,lang:p}).graphqlSdk,G=i.useAccess(T,{extraPermissions:N}).hasAccess,k=e.useState(!1),B=k[0],P=k[1],M=e.useState(!1),V=M[0],W=M[1],H=t.useTranslation().t;return i.registerTranslations(_),/*#__PURE__*/S.default.createElement(n.Card,L({ref:o,sx:cl.root},O),/*#__PURE__*/S.default.createElement(n.CardHeader,{avatar:w&&/*#__PURE__*/S.default.createElement(n.SvgIcon,{component:x.ReactComponent,className:"draggable-handle",sx:cl.dragIcon,inheritViewBox:!0}),title:s,titleTypographyProps:{variant:"subtitle1"},action:w&&/*#__PURE__*/S.default.createElement(n.Stack,{direction:"row",sx:cl.actionButtons},/*#__PURE__*/S.default.createElement(n.Button,{color:"secondary",sx:cl.settingsButton,onClick:function(){h&&h()},disabled:!G,"data-testid":"widget-card.settings-button"},/*#__PURE__*/S.default.createElement(y.Settings,null)),R&&/*#__PURE__*/S.default.createElement(S.default.Fragment,null,/*#__PURE__*/S.default.createElement(n.Tooltip,{title:R},/*#__PURE__*/S.default.createElement(n.Button,{color:"secondary",sx:cl.infoButton,"data-testid":"widget-card.info-button"},/*#__PURE__*/S.default.createElement(y.Info,null)))),/*#__PURE__*/S.default.createElement(z,{open:V,confirmMessage:H("Are you sure you want to delete this widget?"),confirmButtonText:H("Delete"),cancelButtonText:H("Cancel"),onCancel:function(){return W(!1)},onConfirm:function(){try{var e=function(){P(!1)};P(!0),W(!1);var n=function(){if(E)return Promise.resolve(E()).then(function(){})}();return Promise.resolve(n&&n.then?n.then(e):e())}catch(e){return Promise.reject(e)}},confirmButtonTestId:"widget-card.delete-confirm",cancelButtonTestId:"widget-card.delete-cancel"},/*#__PURE__*/S.default.createElement(C.LoadingButton,{color:"secondary",sx:cl.deleteButton,onClick:function(e){e.stopPropagation(),W(!0)},loading:B,"data-testid":"widget-card.delete-button"},/*#__PURE__*/S.default.createElement(y.Delete,null)))),sx:cl.header}),/*#__PURE__*/S.default.createElement(n.CardContent,{sx:cl.content},/*#__PURE__*/S.default.createElement(i.AccessGuard,{features:T,extraPermissions:N,onTrialRequest:function(e){try{return Promise.resolve(dl(function(){return Promise.resolve(null==D?void 0:D.startTrial({input:{featureKey:e}})).then(function(){return Promise.resolve(i.refreshUserData()).then(function(){return!0})})},function(e){return console.error("Failed to start trial:",e),!1}))}catch(e){return Promise.reject(e)}},onFeatureRequest:function(e){var n=e.featureKey,t=e.requestType,r=e.workplaceId;try{return Promise.resolve(dl(function(){return Promise.resolve(null==D?void 0:D.requestFeatureAccess({input:{featureKey:n,requestType:t.toUpperCase(),workplaceId:r}})).then(function(){return Promise.resolve(i.refreshUserData()).then(function(){return!0})})},function(e){return console.error("Failed to request feature access:",e),!1}))}catch(e){return Promise.reject(e)}}},/*#__PURE__*/S.default.createElement(u,{id:c,url:l,wsUrl:d,lang:p,data:f,filters:m,settings:g,openSettingsModal:b,onSettingsModalOpened:h,onSettingsModalClosed:v,sidePanelOpened:I,updateSidePanelProps:A,editMode:w}))),w&&a)});exports.ActualStaffingCountsDocument=mr,exports.ApplicationInfoDocument=gr,exports.AssignOperatorDocument=zr,exports.AssignOperatorToWorkplaceDocument=Ht,exports.AvailabilityInsightsDocument=br,exports.BulkUpsertStaffingPlansDocument=Ft,exports.CompanyConfigDocument=hr,exports.ConfirmTooltip=z,exports.CounterDirectoriesDocument=vr,exports.CountersDocument=Ir,exports.CreateDashboardDocument=Xt,exports.CreateOrderDocument=Lt,exports.CreateProductDocument=Zt,exports.CreateStaffingPlanDocument=Yt,exports.CreateStatusChangeDocument=jt,exports.CreateUserPresenceDocument=Jt,exports.CreateWidgetDocument=zt,exports.CurrentUserDocument=yr,exports.DashboardFilters=function(r){var o=r.initialValues,a=r.onChange,s=r.shifts,u=void 0===s?[]:s,c=r.onFeatureRequest,l=t.useTranslation().t,d=e.useState(function(){return null!=o?o:{dayType:exports.DayType.Production,dateRange:(e=D.default().format("YYYY-MM-DD"),{from:e+"T00:00:00",to:e+"T23:59:59"}),shiftIds:[]};var e}),p=d[0],f=d[1],m=e.useState(function(){return null==o?void 0:o.selectedPeriodId}),g=m[0],b=m[1],h=e.useState(!1),v=h[0],I=h[1],y=e.useState(!1),C=y[0],x=y[1],A=e.useRef(null),E=i.useAccess([Mi]),w=E.hasAccess,R=E.accessState,T=E.buttons,N=E.cooldownInfo,G=E.features,k=e.useMemo(function(){var e,n=G.find(function(e){return e.featureKey===Mi});return null!=(e=null==n?void 0:n.daysSinceExpiry)?e:null},[G]),B=e.useMemo(function(){return T.filter(function(e){return"start_trial"!==e.action})},[T]);i.registerTranslations(_),e.useEffect(function(){if(o){var e=o.selectedPeriodId&&null!=u&&u.length?bi(o.selectedPeriodId,u):null,n=e?L({},o,{shiftIds:[e]}):o;f(function(e){return JSON.stringify(n)===JSON.stringify(e)?e:n}),b(o.selectedPeriodId)}},[o,u]),e.useEffect(function(){if(g){var e=hi.find(function(e){return e.id===g});if(e){var n=e.calculate({dayType:p.dayType,shifts:u,selectedShiftIds:p.shiftIds});f(function(e){var t=L({},e,{dateRange:n,selectedPeriodId:g});return e.dateRange.from===n.from&&e.dateRange.to===n.to&&e.selectedPeriodId===g?e:t})}}},[p.dayType,p.shiftIds,u,g]),e.useEffect(function(){if(g){var e=Ci(g,{dayType:p.dayType,shifts:u,selectedShiftIds:p.shiftIds});if(e){var n=e.getTime()-Date.now(),t=function(){var e=hi.find(function(e){return e.id===g});e&&f(function(n){var t=bi(g,u),r=t?[t]:n.shiftIds,i=L({},n,{dateRange:e.calculate({dayType:n.dayType,shifts:u,selectedShiftIds:r}),selectedPeriodId:g,shiftIds:r});return a(i),i})};if(!(n<=0)){var r=setTimeout(t,n);return function(){return clearTimeout(r)}}t()}}},[g,p.dayType,p.shiftIds,u,a]);var P,M,V,W=e.useCallback(function(e){var n=L({},p,{dayType:e});f(n),a(n)},[p,a]),H=e.useCallback(function(e){var n=L({},p,{shiftIds:e});f(n),a(n)},[p,a]),F=e.useCallback(function(e){b(void 0);var n=L({},p,{dateRange:e,selectedPeriodId:void 0,shiftIds:[]});f(n),a(n)},[p,a]),X=e.useCallback(function(e,n){if(!e.needAccess||w){b(e.id);var t=bi(e.id,u),r=L({},p,{dateRange:n,selectedPeriodId:e.id,shiftIds:t?[t]:[]});f(r),a(r)}else I(!0)},[p,w,a,u]),Z=e.useCallback(function(){I(!1)},[]),Y=e.useCallback(function(){I(!0)},[]),j=e.useCallback(function(){x(!0)},[]),J=e.useCallback(function(){x(!1)},[]);/*#__PURE__*/return S.default.createElement(n.Box,{sx:Pi.container},/*#__PURE__*/S.default.createElement(n.Stack,{direction:"row",spacing:2,alignItems:"center"},/*#__PURE__*/S.default.createElement(n.TextField,{ref:A,label:l("filters.dateRange.label"),value:(P=p.dateRange,M=D.default(P.from).format("YYYY-MM-DD"),V=D.default(P.to).format("YYYY-MM-DD"),M===V?M:M+" - "+V),onClick:j,size:"small",InputProps:{readOnly:!0,startAdornment:/*#__PURE__*/S.default.createElement(n.InputAdornment,{position:"start"},/*#__PURE__*/S.default.createElement(O.default,{sx:{fontSize:16}}))},sx:Pi.dateField,"data-testid":"dashboard-filters.date-range-input"}),/*#__PURE__*/S.default.createElement(Bi,{shifts:u,selectedShiftIds:p.shiftIds,onChange:H})),/*#__PURE__*/S.default.createElement(n.Popover,{open:C,anchorEl:A.current,onClose:J,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},sx:Pi.popover,"data-testid":"dashboard-filters.date-popover"},/*#__PURE__*/S.default.createElement(n.Box,{sx:Pi.popoverContent},/*#__PURE__*/S.default.createElement(Gi,{dateRange:p.dateRange,dayType:p.dayType,shifts:u,selectedShiftIds:p.shiftIds,hasAccess:w,selectedPeriodId:g,onDayTypeChange:W,onDateRangeChange:F,onPeriodSelect:X,onAccessDenied:Y}))),/*#__PURE__*/S.default.createElement(Ai,{open:v,onClose:Z,accessState:R,buttons:B,daysSinceExpiry:k,cooldownInfo:N,onFeatureRequest:c}))},exports.DashboardsDocument=Cr,exports.DepartmentsDocument=xr,exports.FloorPlansDocument=Ar,exports.GetWorkplacePerformanceInsightsDocument=Ur,exports.GraphqlWsClient=ol,exports.ListActualStaffingCountsDocument=qr,exports.ListStaffingPlansDocument=Qr,exports.ListStatusChangesDocument=$r,exports.ListWorkOrdersDocument=Kr,exports.ListWorkplaceAssignmentsDocument=ei,exports.ListWorkplacesDocument=ni,exports.MetricCard=function(e){var r=e.title,i=e.metricLabel,o=e.metricValue,a=e.extraValue,s=e.animateBackgroundColor,u=e.rounded,c=Z(e,ji),l=t.useTranslation().t,d=function(e){return{card:L({position:"relative",width:"100%",height:"100%"},e.showBgPattern&&{mixBlendMode:"hard-light",background:"url("+H.default+"), linear-gradient(329.66deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.75) 100%)",backgroundSize:"cover"},e.card.rounded?{borderRadius:"4px"}:{borderTopLeftRadius:0,borderTopRightRadius:0}),cardOverlay:L({position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:-1},e.showBgPattern&&{mixBlendMode:"hard-light"},e.card.rounded?{borderRadius:"4px"}:{borderTopLeftRadius:0,borderTopRightRadius:0},e.cardOverlay,{animation:e.animateBackgroundColor?(t=e.backgroundColor,v.keyframes(Fi||(Fi=Y(["\n 0% {\n background: ",";\n }\n\n 50% {\n background: ",";\n }\n\n 100% {\n background: ",";\n }\n"])),Yi(t,.5),Yi(t,1),Yi(t,.5))+" 3s infinite"):"none"}),cardHeader:{height:"3em",color:Zi,borderBottom:"1px solid rgba(0, 0, 0, 0.1)",background:"rgba(0, 0, 0, 0.05)","& span":{lineHeight:"3em",fontSize:"1em",fontWeight:500}},cardContent:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"80%",minWidth:"auto",minHeight:"auto",maxWidth:"none",background:"transparent","& > img":{flexBasis:"25%",minWidth:"125px",maxWidth:"25%"}},cardLabel:{width:"100%",lineHeight:"2.5em",fontSize:"1.8em",fontWeight:700,whiteSpace:"nowrap",overflow:"hidden",textAlign:"center",textOverflow:"ellipsis",color:Zi},cardValue:{lineHeight:"1.2em",textAlign:"center",fontSize:"1.6em",fontWeight:700,color:n.lighten(Zi,.15)},cardExtra:{lineHeight:"4em",textAlign:"center",fontSize:"1em",fontWeight:600,color:Zi}};var t}({card:{rounded:u},cardOverlay:{background:function(){var e=null==o?void 0:o.statusColor;if(e)switch(e){case exports.AndonLightColor.Green:return"linear-gradient(180deg, #31BF59 0%, #32D74B 100%)";case exports.AndonLightColor.Yellow:return"linear-gradient(360deg, #FFD60A 0%, #FFC12F 100%)";case exports.AndonLightColor.Red:return"linear-gradient(0deg, #F05C53 0%, #FF3B2F 100%)";default:return"rgba(187, 187, 187, 0.75)"}return"rgba(255, 255, 255, 0.75)"}()},showBgPattern:!0,backgroundColor:function(){var e=null==o?void 0:o.statusColor;if(e)switch(e){case exports.AndonLightColor.Green:return"#32D74B";case exports.AndonLightColor.Yellow:return"#FFC12F";case exports.AndonLightColor.Red:return"#FF3B2F";default:return"#BBBBBBBF"}return"#FFFFFFBF"}(),animateBackgroundColor:s});/*#__PURE__*/return S.default.createElement(n.Card,L({sx:d.card},c),/*#__PURE__*/S.default.createElement(n.Box,{sx:d.cardOverlay}),/*#__PURE__*/S.default.createElement(n.CardHeader,{title:/*#__PURE__*/S.default.createElement(Li,{line:1,text:r}),sx:d.cardHeader}),/*#__PURE__*/S.default.createElement(n.CardContent,{sx:d.cardContent},/*#__PURE__*/S.default.createElement(n.Typography,{sx:d.cardLabel},i),/*#__PURE__*/S.default.createElement(n.Typography,{sx:d.cardValue},o?function(e){var n=e.textValue;if(n){var t=D.default.duration(Number(n),"seconds");return Math.floor(t.asMinutes())+"m "+t.seconds()+"s"}return""}(o):/*#__PURE__*/S.default.createElement(t.Trans,{t:l},"No value for the selected metric")),a&&/*#__PURE__*/S.default.createElement(n.Typography,{sx:d.cardExtra},a)))},exports.MetricValuesDocument=Er,exports.MetricsDocument=wr,exports.NotificationsDocument=Rr,exports.OrdersDocument=Tr,exports.OrdersExecutionsDocument=Sr,exports.PauseOrderExecutionDocument=_t,exports.ProductionInsightsDocument=Nr,exports.ProductsDocument=Or,exports.ReasonsDocument=Dr,exports.ReasonsRecommendationDocument=Gr,exports.RemoveDashboardDocument=Ut,exports.RemoveStaffingPlanDocument=qt,exports.RemoveUserPresenceDocument=Qt,exports.RemoveWidgetDocument=$t,exports.RemoveWorkplaceUsersPresencesDocument=Kt,exports.RequestFeatureAccessDocument=er,exports.SetCounterDocument=nr,exports.ShiftsDocument=kr,exports.SortableSelect=function(e){var n=e.options,t=e.selected,r=e.onChange,i=function(e){var n,i,o,a=e.active,s=e.over;if(a.id!==(null==s?void 0:s.id)){var u=t.findIndex(function(e){return e===a.id}),c=t.findIndex(function(e){return e===(null==s?void 0:s.id)});r((n=t,i=u,o=c,function(e,n,t){const r=n<0?e.length+n:n;if(r>=0&&r<e.length){const r=t<0?e.length+t:t,[i]=e.splice(n,1);e.splice(r,0,i)}}(n=[...n],i,o),n))}};/*#__PURE__*/return S.default.createElement(Es,{placeholder:e.placeholder,isMulti:!0,options:n,value:t.map(function(e){return n.find(function(n){return n.value===e})}),onChange:function(e){return r([].concat(e||[]).map(function(e){return e.value}))},closeMenuOnSelect:!1,components:{MultiValueContainer:Pc,MultiValueLabel:Mc,ValueContainer:function(e){/*#__PURE__*/return S.default.createElement(vc,{onDragEnd:i},/*#__PURE__*/S.default.createElement(Sc,{items:t},e.children))}},styles:{control:function(e,n){return L({},e,{padding:"6px 0 6px 8px",borderColor:"rgba(255, 255, 255, 0.15)",background:"#1C1F25"},n.isFocused&&{borderColor:"#4E5A67",boxShadow:"none"},{"&:hover":{borderColor:"#4E5A67",boxShadow:"none"}})},menu:function(e){return L({},e,{background:"#1C1F25"})},option:function(e,n){return L({},e,{background:n.isFocused?"#2A2E34":"#1C1F25"})}}})},exports.StaffingPlansDocument=Br,exports.StandardRatesDocument=Pr,exports.StartOrderExecutionDocument=tr,exports.StartTrialDocument=rr,exports.StatusChangeTransitionPermissionsDocument=Mr,exports.StatusChangesDocument=Vr,exports.StopOrderExecutionDocument=ir,exports.UnassignOperatorDocument=_r,exports.UnassignOperatorFromWorkplaceDocument=or,exports.UpdateDashboardDocument=ar,exports.UpdateNotificationDocument=sr,exports.UpdateOrderDocument=ur,exports.UpdateOrderExecutionDocument=cr,exports.UpdateStaffingPlanDocument=lr,exports.UpdateStatusChangeDocument=dr,exports.UpdateWidgetDocument=pr,exports.UpdateWorkOrderDocument=fr,exports.UsersDocument=Wr,exports.UsersPresencesDocument=Hr,exports.WidgetCard=pl,exports.WidgetDocument=Fr,exports.WidgetsDocument=Xr,exports.WorkOrdersDocument=Lr,exports.WorkOrdersInsightsDocument=Zr,exports.WorkplaceAssignmentsDocument=Yr,exports.WorkplaceEventDocument=ti,exports.WorkplacePerformanceInsightsDocument=jr,exports.WorkplacesDocument=Jr,exports.findPeriodById=function(e){return hi.find(function(n){return n.id===e})},exports.generateTimeRange=function(e,n,t,r){for(var i=[],o=e,a=e.isAfter(n);a?o.isAfter(n)||o.isSame(n):o.isBefore(n)||o.isSame(n);)i.push(o),o=a?o.subtract(r,t):o.add(r,t);return i},exports.getCurrentShift=si,exports.getGqlWsClient=al,exports.getGraphqlSdk=sl,exports.getNextBoundary=Ci,exports.getRecentShift=ui,exports.getSdk=ii,exports.getShiftTimeRange=Ii,exports.getTimeRangeLabel=vi,exports.normalizeShifts=ai,exports.periods=hi,exports.resolveShiftIdForPeriod=bi,exports.useGqlClients=ul,exports.version="1.5.34";
|
|
16
16
|
//# sourceMappingURL=index.js.map
|