andoncloud-dashboard-toolkit 1.5.6 → 1.5.7
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/types.d.ts +2 -0
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -12,5 +12,5 @@ return A.createElement("div",null,u)}var c=a[0]?this.getOptionValue(a[0]):"";/*#
|
|
|
12
12
|
return A.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 A.createElement(ia,Si({},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 A.createElement(r,Si({},d,{className:a,innerProps:{id:s,onKeyDown:this.onKeyDown},isDisabled:u,isFocused:l}),this.renderLiveRegion(),/*#__PURE__*/A.createElement(n,Si({},d,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:u,isFocused:l,menuIsOpen:c}),/*#__PURE__*/A.createElement(i,Si({},d,{isDisabled:u}),this.renderPlaceholderOrValue(),this.renderInput()),/*#__PURE__*/A.createElement(t,Si({},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=lo(l),g={};if(t&&(l!==t.value||c!==t.options||d!==t.menuIsOpen||p!==t.inputValue)){var h=d?function(e,n){return Wa(Va(e,n))}(e,m):[],b=d?Ha(Va(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,h);g={selectValue:m,focusedOption:I,focusedOptionId:Xa(b,I),focusableOptionsWithIds:b,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:wo(f,m,m[0]||null),options:m,action:"initial-input-focus"},x=!s),"initial-input-focus"===(null==o?void 0:o.action)&&(C=null),xi(xi(xi({},g),y),{},{prevProps:e,ariaSelection:C,prevWasFocused:x})}}]),i}();Ua.defaultProps=Ma;var qa=/*#__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=Ri(n,Ti),h=Ei(e.useState(void 0!==u?u:r),2),b=h[0],v=h[1],I=Ei(e.useState(void 0!==c?c:o),2),y=I[0],C=I[1],x=Ei(e.useState(void 0!==m?m:s),2),A=x[0],w=x[1],E=e.useCallback(function(e,n){"function"==typeof l&&l(e,n),w(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]),O=void 0!==u?u:b,N=void 0!==c?c:y,D=void 0!==m?m:A;return xi(xi({},g),{},{inputValue:O,menuIsOpen:N,onChange:E,onInputChange:R,onMenuClose:S,onMenuOpen:T,value:D})}(n);/*#__PURE__*/
|
|
15
|
-
return A.createElement(Ua,Si({ref:t},r))}),$a=qa;const Qa="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function Ka(e){const n=Object.prototype.toString.call(e);return"[object Window]"===n||"[object global]"===n}function es(e){return"nodeType"in e}function ns(e){var n,t;return e?Ka(e)?e:es(e)&&null!=(n=null==(t=e.ownerDocument)?void 0:t.defaultView)?n:window:window}function ts(e){const{Document:n}=ns(e);return e instanceof n}function rs(e){return!Ka(e)&&e instanceof ns(e).HTMLElement}function is(e){return e instanceof ns(e).SVGElement}function os(e){return e?Ka(e)?e.document:es(e)?ts(e)?e:rs(e)||is(e)?e.ownerDocument:document:document:document}const as=Qa?e.useLayoutEffect:e.useEffect;function ss(n){const t=e.useRef(n);return as(()=>{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 us(n,t){void 0===t&&(t=[n]);const r=e.useRef(n);return as(()=>{r.current!==n&&(r.current=n)},t),r}function cs(n,t){const r=e.useRef();return e.useMemo(()=>{const e=n(r.current);return r.current=e,e},[...t])}function ls(n){const t=ss(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 ds(n){const t=e.useRef();return e.useEffect(()=>{t.current=n},[n]),t.current}let ps={};function fs(n,t){return e.useMemo(()=>{if(t)return t;const e=null==ps[n]?0:ps[n]+1;return ps[n]=e,n+"-"+e},[n,t])}function ms(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 gs=/*#__PURE__*/ms(1),hs=/*#__PURE__*/ms(-1);function bs(e){if(!e)return!1;const{KeyboardEvent:n}=ns(e.target);return n&&e instanceof n}function vs(e){if(function(e){if(!e)return!1;const{TouchEvent:n}=ns(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 Is=/*#__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[Is.Translate.toString(e),Is.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:n,duration:t,easing:r}=e;return n+" "+t+"ms "+r}}}),ys="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Cs(e){return e.matches(ys)?e:e.querySelector(ys)}const xs={display:"none"};function As(e){let{id:n,value:t}=e;return x.default.createElement("div",{id:n,style:xs},t)}function ws(e){let{id:n,announcement:t,ariaLiveType:r="assertive"}=e;return x.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 Es=/*#__PURE__*/e.createContext(null),Rs={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 "},Ts={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 Ss(n){let{announcements:t=Ts,container:r,hiddenTextDescribedById:i,screenReaderInstructions:o=Rs}=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(Es);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=x.default.createElement(x.default.Fragment,null,x.default.createElement(As,{id:i,value:o.draggable}),x.default.createElement(ws,{id:u,announcement:s}));return r?m.createPortal(d,r):d}var Os;function Ns(){}!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"}(Os||(Os={}));const Ds=/*#__PURE__*/Object.freeze({x:0,y:0});function ks(e,n){let{data:{value:t}}=e,{data:{value:r}}=n;return r-t}function Gs(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 Bs=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=Gs(o,n);t>0&&i.push({id:r,data:{droppableContainer:e,value:t}})}}return i.sort(ks)};function Ms(e,n){return e&&n?{x:e.left-n.left,y:e.top-n.top}:Ds}function Ps(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 Vs=/*#__PURE__*/Ps(1),Ws={ignoreTransform:!1};function Hs(e,n){void 0===n&&(n=Ws);let t=e.getBoundingClientRect();if(n.ignoreTransform){const{transform:n,transformOrigin:r}=ns(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 Fs(e){return Hs(e,{ignoreTransform:!0})}function Xs(e,n){const t=[];return e?function r(i){if(null!=n&&t.length>=n)return t;if(!i)return t;if(ts(i)&&null!=i.scrollingElement&&!t.includes(i.scrollingElement))return t.push(i.scrollingElement),t;if(!rs(i)||is(i))return t;if(t.includes(i))return t;const o=ns(e).getComputedStyle(i);return i!==e&&function(e,n){void 0===n&&(n=ns(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=ns(e).getComputedStyle(e)),"fixed"===n.position}(i,o)?t:r(i.parentNode)}(e):t}function Ls(e){const[n]=Xs(e,1);return null!=n?n:null}function Ys(e){return Qa&&e?Ka(e)?e:es(e)?ts(e)||e===os(e).scrollingElement?window:rs(e)?e:null:null:null}function Zs(e){return Ka(e)?e.scrollX:e.scrollLeft}function js(e){return Ka(e)?e.scrollY:e.scrollTop}function zs(e){return{x:Zs(e),y:js(e)}}var Js;function _s(e){return!(!Qa||!e)&&e===document.scrollingElement}function Us(e){const n={x:0,y:0},t=_s(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"}(Js||(Js={}));const qs={x:.2,y:.2};function $s(e,n,t,r,i){let{top:o,left:a,right:s,bottom:u}=t;void 0===r&&(r=10),void 0===i&&(i=qs);const{isTop:c,isBottom:l,isLeft:d,isRight:p}=Us(e),f={x:0,y:0},m={x:0,y:0},g=n.height*i.y,h=n.width*i.x;return!c&&o<=n.top+g?(f.y=Js.Backward,m.y=r*Math.abs((n.top+g-o)/g)):!l&&u>=n.bottom-g&&(f.y=Js.Forward,m.y=r*Math.abs((n.bottom-g-u)/g)),!p&&s>=n.right-h?(f.x=Js.Forward,m.x=r*Math.abs((n.right-h-s)/h)):!d&&a<=n.left+h&&(f.x=Js.Backward,m.x=r*Math.abs((n.left+h-a)/h)),{direction:f,speed:m}}function Qs(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 Ks(e){return e.reduce((e,n)=>gs(e,zs(n)),Ds)}const eu=[["x",["left","right"],function(e){return e.reduce((e,n)=>e+Zs(n),0)}],["y",["top","bottom"],function(e){return e.reduce((e,n)=>e+js(n),0)}]];class nu{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=Xs(n),r=Ks(t);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,n,i]of eu)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 tu{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 ru(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 iu,ou;function au(e){e.preventDefault()}function su(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"}(iu||(iu={})),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"}(ou||(ou={}));const uu={start:[ou.Space,ou.Enter],cancel:[ou.Esc],end:[ou.Space,ou.Enter,ou.Tab]},cu=(e,n)=>{let{currentCoordinates:t}=n;switch(e.code){case ou.Right:return{...t,x:t.x+25};case ou.Left:return{...t,x:t.x-25};case ou.Down:return{...t,y:t.y+25};case ou.Up:return{...t,y:t.y-25}}};class lu{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 tu(os(n)),this.windowListeners=new tu(ns(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(iu.Resize,this.handleCancel),this.windowListeners.add(iu.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(iu.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,t=e.node.current;t&&function(e,n){if(void 0===n&&(n=Hs),!e)return;const{top:t,left:r,bottom:i,right:o}=n(e);Ls(e)&&(i<=0||o<=0||t>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(t),n(Ds)}handleKeyDown(e){if(bs(e)){const{active:n,context:t,options:r}=this.props,{keyboardCodes:i=uu,coordinateGetter:o=cu,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}:Ds;this.referenceCoordinates||(this.referenceCoordinates=c);const l=o(e,{active:n,context:t.current,currentCoordinates:c});if(l){const n=hs(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}=Us(t),f=Qs(t),m={x:Math.min(i===ou.Right?f.right-f.width/2:f.right,Math.max(i===ou.Right?f.left:f.left+f.width/2,l.x)),y:Math.min(i===ou.Down?f.bottom-f.height/2:f.bottom,Math.max(i===ou.Down?f.top:f.top+f.height/2,l.y))},g=i===ou.Down&&!c||i===ou.Up&&!o;if((i===ou.Right&&!s||i===ou.Left&&!u)&&m.x!==l.x){const e=t.scrollLeft+n.x,o=i===ou.Right&&e<=d.x||i===ou.Left&&e>=p.x;if(o&&!n.y)return void t.scrollTo({left:e,behavior:a});r.x=o?t.scrollLeft-e:i===ou.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===ou.Down&&e<=d.y||i===ou.Up&&e>=p.y;if(o&&!n.x)return void t.scrollTo({top:e,behavior:a});r.y=o?t.scrollTop-e:i===ou.Down?t.scrollTop-d.y:t.scrollTop-p.y,r.y&&t.scrollBy({top:-r.y,behavior:a});break}}this.handleMove(e,gs(hs(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 du(e){return Boolean(e&&"distance"in e)}function pu(e){return Boolean(e&&"delay"in e)}lu.activators=[{eventName:"onKeyDown",handler:(e,n,t)=>{let{keyboardCodes:r=uu,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}=ns(e);return e instanceof n?e:os(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=os(o),this.documentListeners=new tu(this.document),this.listeners=new tu(t),this.windowListeners=new tu(ns(o)),this.initialCoordinates=null!=(r=vs(i))?r:Ds,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(iu.Resize,this.handleCancel),this.windowListeners.add(iu.DragStart,au),this.windowListeners.add(iu.VisibilityChange,this.handleCancel),this.windowListeners.add(iu.ContextMenu,au),this.documentListeners.add(iu.Keydown,this.handleKeydown),n){if(null!=t&&t({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(pu(n))return this.timeoutId=setTimeout(this.handleStart,n.delay),void this.handlePending(n);if(du(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(iu.Click,su,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(iu.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=vs(e))?n:Ds,u=hs(r,s);if(!t&&a){if(du(a)){if(null!=a.tolerance&&ru(u,a.tolerance))return this.handleCancel();if(ru(u,a.distance))return this.handleStart()}return pu(a)&&ru(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===ou.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const mu={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class gu extends fu{constructor(e){const{event:n}=e,t=os(n.target);super(e,mu,t)}}gu.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 hu={move:{name:"mousemove"},end:{name:"mouseup"}};var bu;!function(e){e[e.RightClick=2]="RightClick"}(bu||(bu={})),class extends fu{constructor(e){super(e,hu,os(e.event.target))}}.activators=[{eventName:"onMouseDown",handler:(e,n)=>{let{nativeEvent:t}=e,{onActivation:r}=n;return t.button!==bu.RightClick&&(null==r||r({event:t}),!0)}}];const vu={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var Iu,yu;(class extends fu{constructor(e){super(e,vu)}static setup(){return window.addEventListener(vu.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(vu.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"}(Iu||(Iu={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(yu||(yu={}));const Cu={x:{[Js.Backward]:!1,[Js.Forward]:!1},y:{[Js.Backward]:!1,[Js.Forward]:!1}};var xu,Au;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(xu||(xu={})),function(e){e.Optimized="optimized"}(Au||(Au={}));const wu=/*#__PURE__*/new Map;function Eu(e,n){return cs(t=>e?t||("function"==typeof n?n(e):e):null,[n,e])}function Ru(n){let{callback:t,disabled:r}=n;const i=ss(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 Tu(e){return new nu(Hs(e),e)}function Su(n,t,r){void 0===t&&(t=Tu);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=ss(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=Ru({callback:a});return as(()=>{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 Ou=[];function Nu(n,t){void 0===t&&(t=[]);const r=e.useRef(null);return e.useEffect(()=>{r.current=null},t),e.useEffect(()=>{const e=n!==Ds;e&&!r.current&&(r.current=n),!e&&r.current&&(r.current=null)},[n]),r.current?hs(n,r.current):Ds}function Du(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 ku=[],Gu=[{sensor:gu,options:{}},{sensor:lu,options:{}}],Bu={current:{}},Mu={draggable:{measure:Fs},droppable:{measure:Fs,strategy:xu.WhileDragging,frequency:Au.Optimized},dragOverlay:{measure:Hs}};class Pu 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 Vu={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:/*#__PURE__*/new Map,droppableRects:/*#__PURE__*/new Map,droppableContainers:/*#__PURE__*/new Pu,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ns},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Mu,measureDroppableContainers:Ns,windowRect:null,measuringScheduled:!1},Wu=/*#__PURE__*/e.createContext({activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ns,draggableNodes:/*#__PURE__*/new Map,over:null,measureDroppableContainers:Ns}),Hu=/*#__PURE__*/e.createContext(Vu);function Fu(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Pu}}}function Xu(e,n){switch(n.type){case Os.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:n.initialCoordinates,active:n.active}};case Os.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 Os.DragEnd:case Os.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Os.RegisterDroppable:{const{element:t}=n,{id:r}=t,i=new Pu(e.droppable.containers);return i.set(r,t),{...e,droppable:{...e.droppable,containers:i}}}case Os.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 Pu(e.droppable.containers);return a.set(t,{...o,disabled:i}),{...e,droppable:{...e.droppable,containers:a}}}case Os.UnregisterDroppable:{const{id:t,key:r}=n,i=e.droppable.containers.get(t);if(!i||r!==i.key)return e;const o=new Pu(e.droppable.containers);return o.delete(t),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function Lu(n){let{disabled:t}=n;const{active:r,activatorEvent:i,draggableNodes:o}=e.useContext(Wu),a=ds(i),s=ds(null==r?void 0:r.id);return e.useEffect(()=>{if(!t&&!i&&a&&null!=s){if(!bs(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=Cs(e);if(n){n.focus();break}}})}},[i,t,o,s,a]),null}const Yu=/*#__PURE__*/e.createContext({...Ds,scaleX:1,scaleY:1});var Zu;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(Zu||(Zu={}));const ju=/*#__PURE__*/e.memo(function(n){var t,r,i,o;let{id:a,accessibility:s,autoScroll:u=!0,children:c,sensors:l=Gu,collisionDetection:d=Bs,measuring:p,modifiers:f,...g}=n;const h=e.useReducer(Xu,void 0,Fu),[b,v]=h,[I,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,A]=e.useState(Zu.Uninitialized),w=C===Zu.Initialized,{draggable:{active:E,nodes:R,translate:T},droppable:{containers:S}}=b,O=null!=E?R.get(E):null,N=e.useRef({initial:null,translated:null}),D=e.useMemo(()=>{var e;return null!=E?{id:E,data:null!=(e=null==O?void 0:O.data)?e:Bu,rect:N}:null},[E,O]),k=e.useRef(null),[G,B]=e.useState(null),[M,P]=e.useState(null),V=us(g,Object.values(g)),W=fs("DndDescribedBy",a),H=e.useMemo(()=>S.getEnabled(),[S]),F=function(n){return e.useMemo(()=>({draggable:{...Mu.draggable,...null==n?void 0:n.draggable},droppable:{...Mu.droppable,...null==n?void 0:n.droppable},dragOverlay:{...Mu.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:Y}=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 xu.Always:return!1;case xu.BeforeDragging:return r;default:return!r}}(),f=us(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),h=cs(e=>{if(p&&!r)return wu;if(!e||e===wu||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 nu(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:h,measureDroppableContainers:m,measuringScheduled:null!=a}}(H,{dragging:w,dependencies:[T.x,T.y],config:F.droppable}),Z=function(e,n){const t=null!=n?e.get(n):void 0,r=t?t.node.current:null;return cs(e=>{var t;return null==n?null:null!=(t=null!=r?r:e)?t:null},[r,n])}(R,E),j=e.useMemo(()=>M?vs(M):null,[M]),z=function(){const e=w&&!(!1===(null==G?void 0:G.autoScrollEnabled))&&!("object"==typeof u?!1===u.enabled:!1===u);return"object"==typeof u?{...u,enabled:e}:{enabled:e}}(),J=function(e,n){return Eu(e,n)}(Z,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;as(()=>{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=Ms(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=Ls(e);t&&t.scrollBy({top:n.y,left:n.x})}},[t,s,u,i,r])}({activeNode:null!=E?R.get(E):null,config:z.layoutShiftCompensation,initialRect:J,measure:F.draggable.measure});const _=Su(Z,F.draggable.measure,J),U=Su(Z?Z.parentElement:null),q=e.useRef({activatorEvent:null,active:null,activeNode:Z,collisionRect:null,collisions:null,droppableRects:X,draggableNodes:R,draggingNode:null,draggingNodeRect:null,droppableContainers:S,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),$=S.getNodeFor(null==(t=q.current.over)?void 0:t.id),Q=function(n){let{measure:t}=n;const[r,i]=e.useState(null),o=e.useCallback(e=>{for(const{target:n}of e)if(rs(n)){i(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t]),a=Ru({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 rs(n)?n:e}(e);null==a||a.disconnect(),n&&(null==a||a.observe(n)),i(n?t(n):null)},[t,a]),[u,c]=ls(s);return e.useMemo(()=>({nodeRef:u,rect:r,setRef:c}),[r,u,c])}({measure:F.dragOverlay.measure}),K=null!=(r=Q.nodeRef.current)?r:Z,ee=w?null!=(i=Q.rect)?i:_:null,ne=Boolean(Q.nodeRef.current&&Q.rect),te=Ms(re=ne?null:_,Eu(re));var re;const ie=Du(K?ns(K):null),oe=function(n){const t=e.useRef(n),r=cs(e=>n?e&&e!==Ou&&n&&t.current&&n.parentNode===t.current.parentNode?e:Xs(n):Ou,[n]);return e.useEffect(()=>{t.current=n},[n]),r}(w?null!=$?$:Z:null),ae=function(n,t){void 0===t&&(t=Hs);const[r]=n,i=Du(r?ns(r):null),[o,a]=e.useState(ku);function s(){a(()=>n.length?n.map(e=>_s(e)?i:new nu(t(e),e)):ku)}const u=Ru({callback:s});return as(()=>{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:T.x-te.x,y:T.y-te.y,scaleX:1,scaleY:1},activatorEvent:M,active:D,activeNodeRect:_,containerNodeRect:U,draggingNodeRect:ee,over:q.current.over,overlayNodeRect:Q.rect,scrollableAncestors:oe,scrollableAncestorRects:ae,windowRect:ie}),ue=j?gs(j,T):null,ce=function(n){const[t,r]=e.useState(null),i=e.useRef(n),o=e.useCallback(e=>{const n=Ys(e.target);n&&r(e=>e?(e.set(n,zs(n)),new Map(e)):null)},[]);return e.useEffect(()=>{const e=i.current;if(n!==e){t(e);const a=n.map(e=>{const n=Ys(e);return n?(n.addEventListener("scroll",o,{passive:!0}),[n,zs(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=Ys(e);null==n||n.removeEventListener("scroll",o)})}},[o,n]),e.useMemo(()=>n.length?t?Array.from(t.values()).reduce((e,n)=>gs(e,n),Ds):Ks(n):Ds,[n,t])}(oe),le=Nu(ce),de=Nu(ce,[_]),pe=gs(se,le),fe=ee?Vs(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),[he,be]=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:gs(se,de),null!=(o=null==he?void 0:he.rect)?o:null,_),Ie=e.useRef(null),ye=e.useCallback((e,n)=>{let{sensor:t,options:r}=n;if(null==k.current)return;const i=R.get(k.current);if(!i)return;const o=e.nativeEvent,a=new t({active:k.current,activeNode:i,event:o,options:r,context:q,onAbort(e){if(!R.get(e))return;const{onDragAbort:n}=V.current,t={id:e};null==n||n(t),I({type:"onDragAbort",event:t})},onPending(e,n,t,r){if(!R.get(e))return;const{onDragPending:i}=V.current,o={id:e,constraint:n,initialCoordinates:t,offset:r};null==i||i(o),I({type:"onDragPending",event:o})},onStart(e){const n=k.current;if(null==n)return;const t=R.get(n);if(!t)return;const{onDragStart:r}=V.current,i={activatorEvent:o,active:{id:n,data:t.data,rect:N}};m.unstable_batchedUpdates(()=>{null==r||r(i),A(Zu.Initializing),v({type:Os.DragStart,initialCoordinates:e,active:n}),I({type:"onDragStart",event:i}),B(Ie.current),P(o)})},onMove(e){v({type:Os.DragMove,coordinates:e})},onEnd:s(Os.DragEnd),onCancel:s(Os.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===Os.DragEnd&&"function"==typeof s&&await Promise.resolve(s(a))&&(e=Os.DragCancel)}k.current=null,m.unstable_batchedUpdates(()=>{v({type:e}),A(Zu.Uninitialized),be(null),B(null),P(null),Ie.current=null;const n=e===Os.DragEnd?"onDragEnd":"onDragCancel";if(a){const e=V.current[n];null==e||e(a),I({type:n,event:a})}})}}Ie.current=a},[R]),Ce=e.useCallback((e,n)=>(t,r)=>{const i=t.nativeEvent,o=R.get(r);null!==k.current||!o||i.dndKit||i.defaultPrevented||!0===e(t,n.options,{active:o})&&(i.dndKit={capturedBy:n.sensor},k.current=r,ye(t,n))},[R,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(!Qa)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),as(()=>{_&&C===Zu.Initializing&&A(Zu.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};m.unstable_batchedUpdates(()=>{null==e||e(o),I({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==k.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};m.unstable_batchedUpdates(()=>{be(s),null==o||o(u),I({type:"onDragOver",event:u})})},[ge]),as(()=>{q.current={activatorEvent:M,active:D,activeNode:Z,collisionRect:fe,collisions:me,droppableRects:X,draggableNodes:R,draggingNode:K,draggingNodeRect:ee,droppableContainers:S,over:he,scrollableAncestors:oe,scrollAdjustedTranslate:pe},N.current={initial:ee,translated:fe}},[D,Z,me,fe,R,K,ee,X,S,he,oe,pe]),function(n){let{acceleration:t,activator:r=Iu.Pointer,canScroll:i,draggingRect:o,enabled:a,interval:s=5,order:u=yu.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:d,delta:p,threshold:f}=n;const m=function(e){let{delta:n,disabled:t}=e;const r=ds(n);return cs(e=>{if(t||!r||!e)return Cu;const i=Math.sign(n.x-r.x),o=Math.sign(n.y-r.y);return{x:{[Js.Backward]:e.x[Js.Backward]||-1===i,[Js.Forward]:e.x[Js.Forward]||1===i},y:{[Js.Backward]:e.y[Js.Backward]||-1===o,[Js.Forward]:e.y[Js.Forward]||1===o}}},[t,n,r])}({delta:p,disabled:!a}),[g,h]=function(){const n=e.useRef(null),t=e.useCallback((e,t)=>{n.current=setInterval(e,t)},[]);return[t,e.useCallback(()=>{null!==n.current&&(clearInterval(n.current),n.current=null)},[])]}(),b=e.useRef({x:0,y:0}),v=e.useRef({x:0,y:0}),I=e.useMemo(()=>{switch(r){case Iu.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Iu.DraggableRect:return o}},[r,o,c]),y=e.useRef(null),C=e.useCallback(()=>{const e=y.current;e&&e.scrollBy(b.current.x*v.current.x,b.current.y*v.current.y)},[]),x=e.useMemo(()=>u===yu.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}=$s(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 h(),y.current=e,g(C,s),b.current=a,void(v.current=o)}b.current={x:0,y:0},v.current={x:0,y:0},h()}else h()},[t,C,i,h,a,s,JSON.stringify(I),JSON.stringify(m),g,l,x,d,JSON.stringify(f)])}({...z,delta:T,draggingRect:fe,pointerCoordinates:ue,scrollableAncestors:oe,scrollableAncestorRects:ae});const Ae=e.useMemo(()=>({active:D,activeNode:Z,activeNodeRect:_,activatorEvent:M,collisions:me,containerNodeRect:U,dragOverlay:Q,draggableNodes:R,droppableContainers:S,droppableRects:X,over:he,measureDroppableContainers:L,scrollableAncestors:oe,scrollableAncestorRects:ae,measuringConfiguration:F,measuringScheduled:Y,windowRect:ie}),[D,Z,_,M,me,U,Q,R,S,X,he,L,oe,ae,F,Y,ie]),we=e.useMemo(()=>({activatorEvent:M,activators:xe,active:D,activeNodeRect:_,ariaDescribedById:{draggable:W},dispatch:v,draggableNodes:R,over:he,measureDroppableContainers:L}),[M,xe,D,_,v,W,R,he,L]);return x.default.createElement(Es.Provider,{value:y},x.default.createElement(Wu.Provider,{value:we},x.default.createElement(Hu.Provider,{value:Ae},x.default.createElement(Yu.Provider,{value:ve},c)),x.default.createElement(Lu,{disabled:!1===(null==s?void 0:s.restoreFocus)})),x.default.createElement(Ss,{...s,hiddenTextDescribedById:W}))}),zu=/*#__PURE__*/e.createContext(null),Ju="button",_u={timeout:25};function Uu(e,n,t){const r=e.slice();return r.splice(t<0?r.length+t:t,0,r.splice(n,1)[0]),r}function qu(e,n){return e.reduce((e,t,r)=>{const i=n.get(t);return i&&(e[r]=i),e},Array(e.length))}function $u(e){return null!==e&&e>=0}const Qu=e=>{let{rects:n,activeIndex:t,overIndex:r,index:i}=e;const o=Uu(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},Ku="Sortable",ec=/*#__PURE__*/x.default.createContext({activeIndex:-1,containerId:Ku,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Qu,disabled:{draggable:!1,droppable:!1}});function nc(n){let{children:t,id:r,items:i,strategy:o=Qu,disabled:a=!1}=n;const{active:s,dragOverlay:u,droppableRects:c,over:l,measureDroppableContainers:d}=e.useContext(Hu),p=fs(Ku,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,h=s?m.indexOf(s.id):-1,b=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!==b&&-1===h||I,C=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(a);as(()=>{I&&g&&d(m)},[I,m,g,d]),e.useEffect(()=>{v.current=m},[m]);const A=e.useMemo(()=>({activeIndex:h,containerId:p,disabled:C,disableTransforms:y,items:m,overIndex:b,useDragOverlay:f,sortedRects:qu(m,c),strategy:o}),[h,p,C.draggable,C.droppable,y,m,b,c,f,o]);return x.default.createElement(ec.Provider,{value:A},t)}const tc=e=>{let{id:n,items:t,activeIndex:r,overIndex:i}=e;return Uu(t,r,i).indexOf(n)},rc=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))},ic={duration:200,easing:"ease"},oc="transform",ac=/*#__PURE__*/Is.Transition.toString({property:oc,duration:0,easing:"linear"}),sc={roleDescription:"sortable"};var uc=function(n){var t=function(n){let{animateLayoutChanges:t=rc,attributes:r,disabled:i,data:o,getNewIndex:a=tc,id:s,strategy:u,resizeObserverConfig:c,transition:l=ic}=n;const{items:d,containerId:p,activeIndex:f,disabled:m,disableTransforms:g,sortedRects:h,overIndex:b,useDragOverlay:v,strategy:I}=e.useContext(ec),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:w,node:E,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(Wu),d=e.useRef({disabled:r}),p=e.useRef(!1),f=e.useRef(null),m=e.useRef(null),{disabled:g,updateMeasurementsFor:h,timeout:b}={..._u,...o},v=us(null!=h?h:i),I=Ru({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},b)):p.current=!0},[b]),disabled:g||!s}),y=e.useCallback((e,n)=>{I&&(n&&(I.unobserve(n),p.current=!1),e&&I.observe(e))},[I]),[C,x]=ls(y),A=us(t);return e.useEffect(()=>{I&&C.current&&(I.disconnect(),p.current=!1,I.observe(C.current))},[C,I]),e.useEffect(()=>(u({type:Os.RegisterDroppable,element:{id:i,key:a,disabled:r,node:C,rect:f,data:A}}),()=>u({type:Os.UnregisterDroppable,key:a,id:i})),[i]),e.useEffect(()=>{r!==d.current.disabled&&(u({type:Os.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:O,activeNodeRect:N,attributes:D,setNodeRef:k,listeners:G,isDragging:B,over:M,setActivatorNodeRef:P,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(Wu),{role:m=Ju,roleDescription:g="draggable",tabIndex:h=0}=null!=o?o:{},b=(null==c?void 0:c.id)===t,v=e.useContext(b?Yu:zu),[I,y]=ls(),[C,x]=ls(),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),w=us(r);return as(()=>(p.set(t,{id:t,key:a,node:I,activatorNode:C,data:w}),()=>{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:h,"aria-disabled":i,"aria-pressed":!(!b||m!==Ju)||void 0,"aria-roledescription":g,"aria-describedby":d.draggable}),[i,m,h,b,g,d.draggable]),isDragging:b,listeners:i?void 0:A,node:I,over:f,setNodeRef:y,setActivatorNodeRef:x,transform:v}}({id:s,data:x,attributes:{...sc,...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,k),H=Boolean(S),F=H&&!g&&$u(f)&&$u(b),X=!v&&B,L=X&&F?V:null,Y=F?null!=L?L:(null!=u?u:I)({rects:h,activeNodeRect:N,activeIndex:f,overIndex:b,index:C}):null,Z=$u(f)&&$u(b)?a({id:s,items:d,activeIndex:f,overIndex:b}):C,j=null==S?void 0:S.id,z=e.useRef({activeId:j,items:d,newIndex:Z,containerId:p}),J=d!==z.current.items,_=t({active:S,containerId:p,isDragging:B,isSorting:H,id:s,index:C,items:d,newIndex:z.current.newIndex,previousItems:z.current.items,previousContainerId:z.current.containerId,transition:l,wasDragging:null!=z.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 as(()=>{if(!t&&r!==u.current&&i.current){const e=o.current;if(e){const n=Hs(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:E,rect:w});return e.useEffect(()=>{H&&z.current.newIndex!==Z&&(z.current.newIndex=Z),p!==z.current.containerId&&(z.current.containerId=p),d!==z.current.items&&(z.current.items=d)},[H,Z,p,d]),e.useEffect(()=>{if(j===z.current.activeId)return;if(null!=j&&null==z.current.activeId)return void(z.current.activeId=j);const e=setTimeout(()=>{z.current.activeId=j},50);return()=>clearTimeout(e)},[j]),{active:S,activeIndex:f,attributes:D,data:x,rect:w,index:C,newIndex:Z,items:d,isOver:R,isSorting:H,isDragging:B,listeners:G,node:E,overIndex:b,over:M,setNodeRef:W,setActivatorNodeRef:P,setDroppableNodeRef:T,setDraggableNodeRef:k,transform:null!=U?U:Y,transition:U||J&&z.current.newIndex===C?ac:X&&!bs(O)||!l?void 0:H||_?Is.Transition.toString({...l,property:oc}):void 0}}({id:n.data.value}),r=t.attributes,i=t.listeners,o=t.setNodeRef,a=t.transition,s={display:"flex",transform:Is.Transform.toString(t.transform),transition:a};return x.default.createElement("div",D({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))}}),x.default.createElement($o.MultiValueContainer,D({},n)))},cc=function(e){var n=D({},e.innerProps,{style:{cursor:"grab"},onMouseDown:function(e){e.preventDefault(),e.stopPropagation()}});return x.default.createElement($o.MultiValueLabel,D({},e,{innerProps:n}))},lc={en:{translation:{"Are you sure you want to delete this widget?":"Are you sure you want to delete this widget?",Cancel:"Cancel",Delete:"Delete","filters.dayType.label":"Day type","filters.dayType.calendar":"Calendar","filters.dayType.production":"Production","filters.shifts.label":"Shifts","filters.shifts.allShifts":"All shifts","filters.dateRange.label":"Date range","filters.dateRange.from":"From","filters.dateRange.to":"To","filters.search.placeholder":"Search periods...","filters.search.noResults":"No periods found","filters.premium.indicator":"Premium","filters.periods.today":"Today","filters.periods.yesterday":"Yesterday","filters.periods.last7Days":"Last 7 days","filters.periods.last14Days":"Last 14 days","filters.periods.last30Days":"Last 30 days","filters.periods.last90Days":"Last 90 days","filters.periods.last180Days":"Last 180 days","filters.periods.last365Days":"Last 365 days","filters.periods.currentWeek":"Current week","filters.periods.currentMonth":"Current month","filters.periods.currentQuarter":"Current quarter","filters.periods.currentYear":"Current year","filters.periods.previousWeek":"Previous week","filters.periods.previousMonth":"Previous month","filters.periods.previousQuarter":"Previous quarter","filters.periods.previousYear":"Previous year","filters.periods.last2Weeks":"Last 2 weeks","filters.periods.last4Weeks":"Last 4 weeks","filters.periods.last8Weeks":"Last 8 weeks","filters.periods.last12Weeks":"Last 12 weeks","filters.periods.last3Months":"Last 3 months","filters.periods.last6Months":"Last 6 months","filters.periods.last12Months":"Last 12 months","filters.accessDenied.title":"Premium feature","filters.accessDenied.close":"Close"}},pl:{translation:{"Are you sure you want to delete this widget?":"Czy na pewno usunąć ten widżet?",Cancel:"Anuluj",Delete:"Usuń","filters.dayType.label":"Typ dnia","filters.dayType.calendar":"Kalendarzowy","filters.dayType.production":"Produkcyjny","filters.shifts.label":"Zmiany","filters.shifts.allShifts":"Wszystkie zmiany","filters.dateRange.label":"Zakres dat","filters.dateRange.from":"Od","filters.dateRange.to":"Do","filters.search.placeholder":"Szukaj okresów...","filters.search.noResults":"Nie znaleziono okresów","filters.premium.indicator":"Premium","filters.periods.today":"Dzisiaj","filters.periods.yesterday":"Wczoraj","filters.periods.last7Days":"Ostatnie 7 dni","filters.periods.last14Days":"Ostatnie 14 dni","filters.periods.last30Days":"Ostatnie 30 dni","filters.periods.last90Days":"Ostatnie 90 dni","filters.periods.last180Days":"Ostatnie 180 dni","filters.periods.last365Days":"Ostatnie 365 dni","filters.periods.currentWeek":"Bieżący tydzień","filters.periods.currentMonth":"Bieżący miesiąc","filters.periods.currentQuarter":"Bieżący kwartał","filters.periods.currentYear":"Bieżący rok","filters.periods.previousWeek":"Poprzedni tydzień","filters.periods.previousMonth":"Poprzedni miesiąc","filters.periods.previousQuarter":"Poprzedni kwartał","filters.periods.previousYear":"Poprzedni rok","filters.periods.last2Weeks":"Ostatnie 2 tygodnie","filters.periods.last4Weeks":"Ostatnie 4 tygodnie","filters.periods.last8Weeks":"Ostatnie 8 tygodni","filters.periods.last12Weeks":"Ostatnie 12 tygodni","filters.periods.last3Months":"Ostatnie 3 miesiące","filters.periods.last6Months":"Ostatnie 6 miesięcy","filters.periods.last12Months":"Ostatnie 12 miesięcy","filters.accessDenied.title":"Funkcja Premium","filters.accessDenied.close":"Zamknij"}}},dc=H(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 V&&V&&V.Object===Object&&V||d||Function("return this")(),f=n&&!n.nodeType&&n,m=f&&e&&!e.nodeType&&e,g=m&&m.exports===f,h=Function.prototype,b=Object.prototype,v=p["__core-js_shared__"],I=(t=/[^.]+$/.exec(v&&v.keys&&v.keys.IE_PROTO||""))?"Symbol(src)_1."+t:"",y=h.toString,C=b.hasOwnProperty,x=b.toString,A=RegExp("^"+y.call(C).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),w=g?p.Buffer:void 0,E=b.propertyIsEnumerable,R=w?w.isBuffer:void 0,T=(r=Object.keys,i=Object,function(e){return r(i(e))}),S=F(p,"DataView"),O=F(p,"Map"),N=F(p,"Promise"),D=F(p,"Set"),k=F(p,"WeakMap"),G=!E.call({valueOf:1},"valueOf"),B=L(S),M=L(O),P=L(N),W=L(D),H=L(k);function F(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=z(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(L(e))}(t)?t:void 0}var X=function(e){return x.call(e)};function L(e){if(null!=e){try{return y.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(S&&X(new S(new ArrayBuffer(1)))!=c||O&&X(new O)!=o||N&&X(N.resolve())!=a||D&&X(new D)!=s||k&&X(new k)!=u)&&(X=function(e){var n=x.call(e),t="[object Object]"==n?e.constructor:void 0,r=t?L(t):void 0;if(r)switch(r){case B:return c;case M:return o;case P:return a;case W:return s;case H:return u}return n});var Y=Array.isArray;function Z(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}(e.length)&&!z(e)}var j=R||function(){return!1};function z(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)&&(Y(e)||"string"==typeof e||"function"==typeof e.splice||j(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Z(e)}(e)&&C.call(e,"callee")&&(!E.call(e,"callee")||"[object Arguments]"==x.call(e))}(e)))return!e.length;var n=X(e);if(n==o||n==s)return!e.size;if(G||function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||b)}(e))return!T(e).length;for(var t in e)if(C.call(e,t))return!1;return!0}}),pc=function(e,n){return pc=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])},pc(e,n)};function fc(e,n){function t(){this.constructor=e}pc(e,n),e.prototype=null===n?Object.create(n):(t.prototype=n.prototype,new t)}function mc(e){return"function"==typeof e}var gc=!1,hc={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){gc=e},get useDeprecatedSynchronousErrorHandling(){return gc}};function bc(e){setTimeout(function(){throw e},0)}var vc={closed:!0,next:function(e){},error:function(e){if(hc.useDeprecatedSynchronousErrorHandling)throw e;bc(e)},complete:function(){}},Ic=/*@__PURE__*/function(){return Array.isArray||function(e){return e&&"number"==typeof e.length}}();function yc(e){return null!==e&&"object"==typeof e}var Cc=/*@__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}(),xc=Cc,Ac=/*@__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(mc(o)){i&&(this._unsubscribe=void 0);try{o.call(this)}catch(e){n=e instanceof xc?wc(e.errors):[e]}}if(Ic(a)){s=-1;for(var u=a.length;++s<u;){var c=a[s];if(yc(c))try{c.unsubscribe()}catch(e){n=n||[],e instanceof xc?n=n.concat(wc(e.errors)):n.push(e)}}}if(n)throw new xc(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 wc(e){return e.reduce(function(e,n){return e.concat(n instanceof xc?n.errors:n)},[])}var Ec=/*@__PURE__*/function(){return"function"==typeof Symbol?/*@__PURE__*/Symbol("rxSubscriber"):"@@rxSubscriber_"+/*@__PURE__*/Math.random()}(),Rc=/*@__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=vc;break;case 1:if(!t){o.destination=vc;break}if("object"==typeof t){t instanceof n?(o.syncErrorThrowable=t.syncErrorThrowable,o.destination=t,t.add(o)):(o.syncErrorThrowable=!0,o.destination=new Tc(o,t));break}default:o.syncErrorThrowable=!0,o.destination=new Tc(o,t,r,i)}return o}return fc(n,e),n.prototype[Ec]=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}(Ac),Tc=/*@__PURE__*/function(e){function n(n,t,r,i){var o,a=e.call(this)||this;a._parentSubscriber=n;var s=a;return mc(t)?o=t:t&&(o=t.next,r=t.error,i=t.complete,t!==vc&&(mc((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 fc(n,e),n.prototype.next=function(e){if(!this.isStopped&&this._next){var n=this._parentSubscriber;hc.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=hc.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):bc(e),this.unsubscribe();else{if(this.unsubscribe(),t)throw e;bc(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)};hc.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(),hc.useDeprecatedSynchronousErrorHandling)throw e;bc(e)}},n.prototype.__tryOrSetError=function(e,n,t){if(!hc.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{n.call(this._context,t)}catch(n){return hc.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=n,e.syncErrorThrown=!0,!0):(bc(n),!0)}return!1},n.prototype._unsubscribe=function(){var e=this._parentSubscriber;this._context=null,this._parentSubscriber=null,e.unsubscribe()},n}(Rc),Sc=/*@__PURE__*/function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();function Oc(e){return e}var Nc=/*@__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 Rc)return e;if(e[Ec])return e[Ec]()}return e||n||t?new Rc(e,n,t):new Rc(vc)}(e,n,t);if(i.add(r?r.call(i,this.source):this.source||hc.useDeprecatedSynchronousErrorHandling&&!i.syncErrorThrowable?this._subscribe(i):this._trySubscribe(i)),hc.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){hc.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 Rc?n:null}return!0}(e)?e.error(n):console.warn(n)}},e.prototype.forEach=function(e,n){var t=this;return new(n=Dc(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[Sc]=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?Oc: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=Dc(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 Dc(e){if(e||(e=hc.Promise||Promise),!e)throw new Error("no Promise impl found");return e}var kc=/*#__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=O.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 Nc(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&&(dc(e.result.data)||o.next(e.result)):o.complete&&o.complete()}}),i(s,n))}})},n.hasSubscription=function(e){return this.subscriptions.has(e)},e}(),Gc=/*#__PURE__*/function(){function e(e,n,t){this.actionCableClient=null,this.actionCableClient=new kc(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}(),Bc=function(e,n,t){return new Gc(e,n,t)},Mc=function(e,n){return Xr(new v.GraphQLClient(e,{fetch:n}))},Pc=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(Mc(r,i.fetch))},[r]),e.useEffect(function(){r&&g&&f(Bc(m||r.replace("graphql","cable"),g,a))},[r,m,g,a]),{graphqlSdk:c,gqlWsClient:p}},Vc={root:{boxShadow:"none","& .react-resizable-handle":{width:"24px",height:"24px",borderRadius:"4px",background:function(e){return e.palette.primary.main+" url("+N.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}}},Wc=["children","title","Widget","id","url","wsUrl","lang","data","settings","openSettingsModal","onSettingsModalOpened","onSettingsModalClosed","sidePanelOpened","updateSidePanelProps","onDelete","editMode","version","requiredFeatures","extraPermissions"];function Hc(e,n){try{var t=e()}catch(e){return n(e)}return t&&t.then?t.then(void 0,n):t}var Fc=x.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.settings,b=r.openSettingsModal,v=r.onSettingsModalOpened,I=r.onSettingsModalClosed,y=r.sidePanelOpened,C=r.updateSidePanelProps,A=r.onDelete,w=r.editMode,E=r.version,R=r.requiredFeatures,T=r.extraPermissions,S=k(r,Wc),O=Pc({url:l,wsUrl:d,lang:p}).graphqlSdk,N=i.useAccess(R,{extraPermissions:T}).hasAccess,G=e.useState(!1),B=G[0],M=G[1],V=e.useState(!1),W=V[0],H=V[1],F=t.useTranslation(),X=F.i18n,L=F.t;return e.useEffect(function(){for(var e="translation",n=0,t=Object.entries(lc);n<t.length;n++){var r=t[n];X.addResources(r[0],e,r[1][e])}},[X]),x.default.createElement(n.Card,D({ref:o,sx:Vc.root},S),x.default.createElement(n.CardHeader,{avatar:w&&x.default.createElement(n.SvgIcon,{component:h.ReactComponent,className:"draggable-handle",sx:Vc.dragIcon,inheritViewBox:!0}),title:s,titleTypographyProps:{variant:"subtitle1"},action:w&&x.default.createElement(n.Stack,{direction:"row",sx:Vc.actionButtons},x.default.createElement(n.Button,{color:"secondary",sx:Vc.settingsButton,onClick:function(){v&&v()},disabled:!N},x.default.createElement(g.Settings,null)),E&&x.default.createElement(x.default.Fragment,null,x.default.createElement(n.Tooltip,{title:E},x.default.createElement(n.Button,{color:"secondary",sx:Vc.infoButton},x.default.createElement(g.Info,null)))),x.default.createElement(P,{open:W,confirmMessage:L("Are you sure you want to delete this widget?"),confirmButtonText:L("Delete"),cancelButtonText:L("Cancel"),onCancel:function(){return H(!1)},onConfirm:function(){try{var e=function(){M(!1)};M(!0),H(!1);var n=function(){if(A)return Promise.resolve(A()).then(function(){})}();return Promise.resolve(n&&n.then?n.then(e):e())}catch(e){return Promise.reject(e)}}},x.default.createElement(n.Button,{color:"secondary",sx:Vc.deleteButton,onClick:function(e){e.stopPropagation(),H(!0)},disabled:B},x.default.createElement(g.Delete,null)))),sx:Vc.header}),x.default.createElement(n.CardContent,{sx:Vc.content},x.default.createElement(i.AccessGuard,{features:R,extraPermissions:T,onTrialRequest:function(e){try{return Promise.resolve(Hc(function(){return Promise.resolve(null==O?void 0:O.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(Hc(function(){return Promise.resolve(null==O?void 0:O.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)}}},x.default.createElement(u,{id:c,url:l,wsUrl:d,lang:p,data:f,settings:m,openSettingsModal:b,onSettingsModalOpened:v,onSettingsModalClosed:I,sidePanelOpened:y,updateSidePanelProps:C,editMode:w}))),w&&a)});F.extend(Zr);var Xc=function(e,n){return n.year(e.year()).month(e.month()).date(e.date())};exports.ActualStaffingCountsDocument=er,exports.ApplicationInfoDocument=nr,exports.AssignOperatorDocument=Nr,exports.AssignOperatorToWorkplaceDocument=Rt,exports.BulkUpsertStaffingPlansDocument=Tt,exports.CompanyConfigDocument=tr,exports.ConfirmTooltip=P,exports.CounterDirectoriesDocument=rr,exports.CountersDocument=ir,exports.CreateDashboardDocument=St,exports.CreateOrderDocument=Ot,exports.CreateProductDocument=Nt,exports.CreateStaffingPlanDocument=Dt,exports.CreateStatusChangeDocument=kt,exports.CreateUserPresenceDocument=Gt,exports.CreateWidgetDocument=Bt,exports.CurrentUserDocument=or,exports.DashboardFilters=function(r){var o=r.initialValues,a=r.onChange,s=r.shifts,u=r.onFeatureRequest,c=e.useState(function(){return null!=o?o:{dayType:exports.DayType.Production,dateRange:(e=F().format("YYYY-MM-DD"),{from:e+"T00:00:00",to:e+"T23:59:59"}),shiftIds:[]};var e}),l=c[0],d=c[1],p=e.useState(),f=p[0],m=p[1],g=e.useState(!1),h=g[0],b=g[1],v=e.useState(!1),I=v[0],y=v[1],C=e.useRef(null),A=i.useAccess([pi]),E=A.hasAccess,R=A.accessState,T=A.buttons,S=A.cooldownInfo,O=A.features,N=e.useMemo(function(){var e,n=O.find(function(e){return e.featureKey===pi});return null!=(e=null==n?void 0:n.daysSinceExpiry)?e:null},[O]),k=e.useMemo(function(){return T.filter(function(e){return"start_trial"!==e.action})},[T]);e.useEffect(function(){if(f){var e=ni.find(function(e){return e.id===f});if(e){var n=e.calculate({dayType:l.dayType,shifts:s,selectedShiftIds:l.shiftIds});d(function(e){return D({},e,{dateRange:n})}),a(D({},l,{dateRange:n}))}}},[l.dayType,l.shiftIds,s,f]);var G,B,M,P=t.useTranslation().t,V=e.useCallback(function(e){var n=D({},l,{dayType:e});d(n),a(n)},[l,a]),W=e.useCallback(function(e){var n=D({},l,{shiftIds:e});d(n),a(n)},[l,a]),H=e.useCallback(function(e){m(void 0);var n=D({},l,{dateRange:e});d(n),a(n)},[l,a]),X=e.useCallback(function(e,n){if(!e.needAccess||E){m(e.id);var t=D({},l,{dateRange:n});d(t),a(t)}else b(!0)},[l,E,a]),L=e.useCallback(function(){b(!1)},[]),Y=e.useCallback(function(){b(!0)},[]),Z=e.useCallback(function(){y(!0)},[]),j=e.useCallback(function(){y(!1)},[]);return x.default.createElement(n.Box,{sx:di.container},x.default.createElement(n.Stack,{direction:"row",spacing:2,alignItems:"center"},x.default.createElement(n.TextField,{ref:C,label:P("filters.dateRange.label"),value:(G=l.dateRange,B=F(G.from).format("YYYY-MM-DD"),M=F(G.to).format("YYYY-MM-DD"),B===M?B:B+" - "+M),onClick:Z,size:"small",InputProps:{readOnly:!0,startAdornment:x.default.createElement(n.InputAdornment,{position:"start"},x.default.createElement(w.default,{sx:{fontSize:16}}))},sx:di.dateField}),x.default.createElement(li,{shifts:s,selectedShiftIds:l.shiftIds,onChange:W})),x.default.createElement(n.Popover,{open:I,anchorEl:C.current,onClose:j,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},sx:di.popover},x.default.createElement(n.Box,{sx:di.popoverContent},x.default.createElement(ui,{dateRange:l.dateRange,dayType:l.dayType,shifts:s,selectedShiftIds:l.shiftIds,hasAccess:E,selectedPeriodId:f,onDayTypeChange:V,onDateRangeChange:H,onPeriodSelect:X,onAccessDenied:Y}))),x.default.createElement(Yr,{open:h,onClose:L,accessState:R,buttons:k,daysSinceExpiry:N,cooldownInfo:S,onFeatureRequest:u}))},exports.DashboardsDocument=ar,exports.DepartmentsDocument=sr,exports.FloorPlansDocument=ur,exports.GetWorkplacePerformanceInsightsDocument=kr,exports.GraphqlWsClient=Gc,exports.ListActualStaffingCountsDocument=Gr,exports.ListStaffingPlansDocument=Br,exports.ListStatusChangesDocument=Mr,exports.ListWorkOrdersDocument=Pr,exports.ListWorkplaceAssignmentsDocument=Vr,exports.ListWorkplacesDocument=Wr,exports.MetricCard=function(e){var r=e.title,i=e.metricLabel,o=e.metricValue,a=e.extraValue,s=e.animateBackgroundColor,u=e.rounded,c=k(e,bi),l=t.useTranslation().t,d=function(e){return{card:D({position:"relative",width:"100%",height:"100%"},e.showBgPattern&&{mixBlendMode:"hard-light",background:"url("+S.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:D({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,f.keyframes(ai||(ai=G(["\n 0% {\n background: ",";\n }\n\n 50% {\n background: ",";\n }\n\n 100% {\n background: ",";\n }\n"])),hi(t,.5),hi(t,1),hi(t,.5))+" 3s infinite"):"none"}),cardHeader:{height:"3em",color:"#090B0E",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:"#090B0E"},cardValue:{lineHeight:"1.2em",textAlign:"center",fontSize:"1.6em",fontWeight:700,color:n.lighten("#090B0E",.15)},cardExtra:{lineHeight:"4em",textAlign:"center",fontSize:"1em",fontWeight:600,color:"#090B0E"}};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});return x.default.createElement(n.Card,D({sx:d.card},c),x.default.createElement(n.Box,{sx:d.cardOverlay}),x.default.createElement(n.CardHeader,{title:x.default.createElement(mi,{line:1,text:r}),sx:d.cardHeader}),x.default.createElement(n.CardContent,{sx:d.cardContent},x.default.createElement(n.Typography,{sx:d.cardLabel},i),x.default.createElement(n.Typography,{sx:d.cardValue},o?function(e){var n=e.textValue;if(n){var t=F.duration(Number(n),"seconds");return Math.floor(t.asMinutes())+"m "+t.seconds()+"s"}return""}(o):x.default.createElement(t.Trans,{t:l},"No value for the selected metric")),a&&x.default.createElement(n.Typography,{sx:d.cardExtra},a)))},exports.MetricValuesDocument=cr,exports.MetricsDocument=lr,exports.NotificationsDocument=dr,exports.OrdersDocument=pr,exports.OrdersExecutionsDocument=fr,exports.PauseOrderExecutionDocument=Mt,exports.ProductsDocument=mr,exports.ReasonsDocument=gr,exports.ReasonsRecommendationDocument=hr,exports.RemoveDashboardDocument=Pt,exports.RemoveUserPresenceDocument=Vt,exports.RemoveWidgetDocument=Wt,exports.RemoveWorkplaceUsersPresencesDocument=Ht,exports.RequestFeatureAccessDocument=Ft,exports.SetCounterDocument=Xt,exports.ShiftsDocument=br,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))}};return x.default.createElement($a,{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:uc,MultiValueLabel:cc,ValueContainer:function(e){return x.default.createElement(ju,{onDragEnd:i},x.default.createElement(nc,{items:t},e.children))}},styles:{control:function(e,n){return D({},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 D({},e,{background:"#1C1F25"})},option:function(e,n){return D({},e,{background:n.isFocused?"#2A2E34":"#1C1F25"})}}})},exports.StaffingPlansDocument=vr,exports.StandardRatesDocument=Ir,exports.StartOrderExecutionDocument=Lt,exports.StartTrialDocument=Yt,exports.StatusChangeTransitionPermissionsDocument=yr,exports.StatusChangesDocument=Cr,exports.StopOrderExecutionDocument=Zt,exports.UnassignOperatorDocument=Dr,exports.UnassignOperatorFromWorkplaceDocument=jt,exports.UpdateDashboardDocument=zt,exports.UpdateNotificationDocument=Jt,exports.UpdateOrderDocument=_t,exports.UpdateOrderExecutionDocument=Ut,exports.UpdateStaffingPlanDocument=qt,exports.UpdateStatusChangeDocument=$t,exports.UpdateWidgetDocument=Qt,exports.UpdateWorkOrderDocument=Kt,exports.UsersDocument=xr,exports.UsersPresencesDocument=Ar,exports.WidgetCard=Fc,exports.WidgetDocument=wr,exports.WidgetsDocument=Er,exports.WorkOrdersDocument=Rr,exports.WorkplaceAssignmentsDocument=Tr,exports.WorkplaceEventDocument=Hr,exports.WorkplacePerformanceInsightsDocument=Sr,exports.WorkplacesDocument=Or,exports.getCurrentShift=function(e,n){return n.find(function(n){return e.isBetween(n.startedAt,n.finishedAt)})||null},exports.getGqlWsClient=Bc,exports.getGraphqlSdk=Mc,exports.getRecentShift=function(e,n){return n.length?n.reduce(function(n,t){return Math.abs(e.diff(t.finishedAt))<Math.abs(e.diff(n.finishedAt))?t:n}):null},exports.getSdk=Xr,exports.normalizeShifts=function(e,n){var t=[];return e.forEach(function(e){var r=F(e.startedAt,"YYYY-MM-DD HH:mm:ss ZZ"),i=F(e.finishedAt,"YYYY-MM-DD HH:mm:ss ZZ");if(r=Xc(n,r),i=Xc(n,i),r.isAfter(i)){var o=r.subtract(1,"day"),a=i.add(1,"day");t.push({name:e.name,startedAt:o,finishedAt:i}),t.push({name:e.name,startedAt:r,finishedAt:a})}else t.push({name:e.name,startedAt:r,finishedAt:i})}),t},exports.useGqlClients=Pc,exports.version="1.5.6";
|
|
15
|
+
return A.createElement(Ua,Si({ref:t},r))}),$a=qa;const Qa="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function Ka(e){const n=Object.prototype.toString.call(e);return"[object Window]"===n||"[object global]"===n}function es(e){return"nodeType"in e}function ns(e){var n,t;return e?Ka(e)?e:es(e)&&null!=(n=null==(t=e.ownerDocument)?void 0:t.defaultView)?n:window:window}function ts(e){const{Document:n}=ns(e);return e instanceof n}function rs(e){return!Ka(e)&&e instanceof ns(e).HTMLElement}function is(e){return e instanceof ns(e).SVGElement}function os(e){return e?Ka(e)?e.document:es(e)?ts(e)?e:rs(e)||is(e)?e.ownerDocument:document:document:document}const as=Qa?e.useLayoutEffect:e.useEffect;function ss(n){const t=e.useRef(n);return as(()=>{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 us(n,t){void 0===t&&(t=[n]);const r=e.useRef(n);return as(()=>{r.current!==n&&(r.current=n)},t),r}function cs(n,t){const r=e.useRef();return e.useMemo(()=>{const e=n(r.current);return r.current=e,e},[...t])}function ls(n){const t=ss(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 ds(n){const t=e.useRef();return e.useEffect(()=>{t.current=n},[n]),t.current}let ps={};function fs(n,t){return e.useMemo(()=>{if(t)return t;const e=null==ps[n]?0:ps[n]+1;return ps[n]=e,n+"-"+e},[n,t])}function ms(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 gs=/*#__PURE__*/ms(1),hs=/*#__PURE__*/ms(-1);function bs(e){if(!e)return!1;const{KeyboardEvent:n}=ns(e.target);return n&&e instanceof n}function vs(e){if(function(e){if(!e)return!1;const{TouchEvent:n}=ns(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 Is=/*#__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[Is.Translate.toString(e),Is.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:n,duration:t,easing:r}=e;return n+" "+t+"ms "+r}}}),ys="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Cs(e){return e.matches(ys)?e:e.querySelector(ys)}const xs={display:"none"};function As(e){let{id:n,value:t}=e;return x.default.createElement("div",{id:n,style:xs},t)}function ws(e){let{id:n,announcement:t,ariaLiveType:r="assertive"}=e;return x.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 Es=/*#__PURE__*/e.createContext(null),Rs={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 "},Ts={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 Ss(n){let{announcements:t=Ts,container:r,hiddenTextDescribedById:i,screenReaderInstructions:o=Rs}=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(Es);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=x.default.createElement(x.default.Fragment,null,x.default.createElement(As,{id:i,value:o.draggable}),x.default.createElement(ws,{id:u,announcement:s}));return r?m.createPortal(d,r):d}var Os;function Ns(){}!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"}(Os||(Os={}));const Ds=/*#__PURE__*/Object.freeze({x:0,y:0});function ks(e,n){let{data:{value:t}}=e,{data:{value:r}}=n;return r-t}function Gs(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 Bs=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=Gs(o,n);t>0&&i.push({id:r,data:{droppableContainer:e,value:t}})}}return i.sort(ks)};function Ms(e,n){return e&&n?{x:e.left-n.left,y:e.top-n.top}:Ds}function Ps(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 Vs=/*#__PURE__*/Ps(1),Ws={ignoreTransform:!1};function Hs(e,n){void 0===n&&(n=Ws);let t=e.getBoundingClientRect();if(n.ignoreTransform){const{transform:n,transformOrigin:r}=ns(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 Fs(e){return Hs(e,{ignoreTransform:!0})}function Xs(e,n){const t=[];return e?function r(i){if(null!=n&&t.length>=n)return t;if(!i)return t;if(ts(i)&&null!=i.scrollingElement&&!t.includes(i.scrollingElement))return t.push(i.scrollingElement),t;if(!rs(i)||is(i))return t;if(t.includes(i))return t;const o=ns(e).getComputedStyle(i);return i!==e&&function(e,n){void 0===n&&(n=ns(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=ns(e).getComputedStyle(e)),"fixed"===n.position}(i,o)?t:r(i.parentNode)}(e):t}function Ls(e){const[n]=Xs(e,1);return null!=n?n:null}function Ys(e){return Qa&&e?Ka(e)?e:es(e)?ts(e)||e===os(e).scrollingElement?window:rs(e)?e:null:null:null}function Zs(e){return Ka(e)?e.scrollX:e.scrollLeft}function js(e){return Ka(e)?e.scrollY:e.scrollTop}function zs(e){return{x:Zs(e),y:js(e)}}var Js;function _s(e){return!(!Qa||!e)&&e===document.scrollingElement}function Us(e){const n={x:0,y:0},t=_s(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"}(Js||(Js={}));const qs={x:.2,y:.2};function $s(e,n,t,r,i){let{top:o,left:a,right:s,bottom:u}=t;void 0===r&&(r=10),void 0===i&&(i=qs);const{isTop:c,isBottom:l,isLeft:d,isRight:p}=Us(e),f={x:0,y:0},m={x:0,y:0},g=n.height*i.y,h=n.width*i.x;return!c&&o<=n.top+g?(f.y=Js.Backward,m.y=r*Math.abs((n.top+g-o)/g)):!l&&u>=n.bottom-g&&(f.y=Js.Forward,m.y=r*Math.abs((n.bottom-g-u)/g)),!p&&s>=n.right-h?(f.x=Js.Forward,m.x=r*Math.abs((n.right-h-s)/h)):!d&&a<=n.left+h&&(f.x=Js.Backward,m.x=r*Math.abs((n.left+h-a)/h)),{direction:f,speed:m}}function Qs(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 Ks(e){return e.reduce((e,n)=>gs(e,zs(n)),Ds)}const eu=[["x",["left","right"],function(e){return e.reduce((e,n)=>e+Zs(n),0)}],["y",["top","bottom"],function(e){return e.reduce((e,n)=>e+js(n),0)}]];class nu{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=Xs(n),r=Ks(t);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,n,i]of eu)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 tu{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 ru(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 iu,ou;function au(e){e.preventDefault()}function su(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"}(iu||(iu={})),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"}(ou||(ou={}));const uu={start:[ou.Space,ou.Enter],cancel:[ou.Esc],end:[ou.Space,ou.Enter,ou.Tab]},cu=(e,n)=>{let{currentCoordinates:t}=n;switch(e.code){case ou.Right:return{...t,x:t.x+25};case ou.Left:return{...t,x:t.x-25};case ou.Down:return{...t,y:t.y+25};case ou.Up:return{...t,y:t.y-25}}};class lu{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 tu(os(n)),this.windowListeners=new tu(ns(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(iu.Resize,this.handleCancel),this.windowListeners.add(iu.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(iu.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,t=e.node.current;t&&function(e,n){if(void 0===n&&(n=Hs),!e)return;const{top:t,left:r,bottom:i,right:o}=n(e);Ls(e)&&(i<=0||o<=0||t>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(t),n(Ds)}handleKeyDown(e){if(bs(e)){const{active:n,context:t,options:r}=this.props,{keyboardCodes:i=uu,coordinateGetter:o=cu,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}:Ds;this.referenceCoordinates||(this.referenceCoordinates=c);const l=o(e,{active:n,context:t.current,currentCoordinates:c});if(l){const n=hs(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}=Us(t),f=Qs(t),m={x:Math.min(i===ou.Right?f.right-f.width/2:f.right,Math.max(i===ou.Right?f.left:f.left+f.width/2,l.x)),y:Math.min(i===ou.Down?f.bottom-f.height/2:f.bottom,Math.max(i===ou.Down?f.top:f.top+f.height/2,l.y))},g=i===ou.Down&&!c||i===ou.Up&&!o;if((i===ou.Right&&!s||i===ou.Left&&!u)&&m.x!==l.x){const e=t.scrollLeft+n.x,o=i===ou.Right&&e<=d.x||i===ou.Left&&e>=p.x;if(o&&!n.y)return void t.scrollTo({left:e,behavior:a});r.x=o?t.scrollLeft-e:i===ou.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===ou.Down&&e<=d.y||i===ou.Up&&e>=p.y;if(o&&!n.x)return void t.scrollTo({top:e,behavior:a});r.y=o?t.scrollTop-e:i===ou.Down?t.scrollTop-d.y:t.scrollTop-p.y,r.y&&t.scrollBy({top:-r.y,behavior:a});break}}this.handleMove(e,gs(hs(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 du(e){return Boolean(e&&"distance"in e)}function pu(e){return Boolean(e&&"delay"in e)}lu.activators=[{eventName:"onKeyDown",handler:(e,n,t)=>{let{keyboardCodes:r=uu,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}=ns(e);return e instanceof n?e:os(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=os(o),this.documentListeners=new tu(this.document),this.listeners=new tu(t),this.windowListeners=new tu(ns(o)),this.initialCoordinates=null!=(r=vs(i))?r:Ds,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(iu.Resize,this.handleCancel),this.windowListeners.add(iu.DragStart,au),this.windowListeners.add(iu.VisibilityChange,this.handleCancel),this.windowListeners.add(iu.ContextMenu,au),this.documentListeners.add(iu.Keydown,this.handleKeydown),n){if(null!=t&&t({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(pu(n))return this.timeoutId=setTimeout(this.handleStart,n.delay),void this.handlePending(n);if(du(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(iu.Click,su,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(iu.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=vs(e))?n:Ds,u=hs(r,s);if(!t&&a){if(du(a)){if(null!=a.tolerance&&ru(u,a.tolerance))return this.handleCancel();if(ru(u,a.distance))return this.handleStart()}return pu(a)&&ru(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===ou.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const mu={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class gu extends fu{constructor(e){const{event:n}=e,t=os(n.target);super(e,mu,t)}}gu.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 hu={move:{name:"mousemove"},end:{name:"mouseup"}};var bu;!function(e){e[e.RightClick=2]="RightClick"}(bu||(bu={})),class extends fu{constructor(e){super(e,hu,os(e.event.target))}}.activators=[{eventName:"onMouseDown",handler:(e,n)=>{let{nativeEvent:t}=e,{onActivation:r}=n;return t.button!==bu.RightClick&&(null==r||r({event:t}),!0)}}];const vu={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var Iu,yu;(class extends fu{constructor(e){super(e,vu)}static setup(){return window.addEventListener(vu.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(vu.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"}(Iu||(Iu={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(yu||(yu={}));const Cu={x:{[Js.Backward]:!1,[Js.Forward]:!1},y:{[Js.Backward]:!1,[Js.Forward]:!1}};var xu,Au;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(xu||(xu={})),function(e){e.Optimized="optimized"}(Au||(Au={}));const wu=/*#__PURE__*/new Map;function Eu(e,n){return cs(t=>e?t||("function"==typeof n?n(e):e):null,[n,e])}function Ru(n){let{callback:t,disabled:r}=n;const i=ss(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 Tu(e){return new nu(Hs(e),e)}function Su(n,t,r){void 0===t&&(t=Tu);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=ss(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=Ru({callback:a});return as(()=>{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 Ou=[];function Nu(n,t){void 0===t&&(t=[]);const r=e.useRef(null);return e.useEffect(()=>{r.current=null},t),e.useEffect(()=>{const e=n!==Ds;e&&!r.current&&(r.current=n),!e&&r.current&&(r.current=null)},[n]),r.current?hs(n,r.current):Ds}function Du(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 ku=[],Gu=[{sensor:gu,options:{}},{sensor:lu,options:{}}],Bu={current:{}},Mu={draggable:{measure:Fs},droppable:{measure:Fs,strategy:xu.WhileDragging,frequency:Au.Optimized},dragOverlay:{measure:Hs}};class Pu 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 Vu={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:/*#__PURE__*/new Map,droppableRects:/*#__PURE__*/new Map,droppableContainers:/*#__PURE__*/new Pu,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ns},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Mu,measureDroppableContainers:Ns,windowRect:null,measuringScheduled:!1},Wu=/*#__PURE__*/e.createContext({activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ns,draggableNodes:/*#__PURE__*/new Map,over:null,measureDroppableContainers:Ns}),Hu=/*#__PURE__*/e.createContext(Vu);function Fu(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Pu}}}function Xu(e,n){switch(n.type){case Os.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:n.initialCoordinates,active:n.active}};case Os.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 Os.DragEnd:case Os.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Os.RegisterDroppable:{const{element:t}=n,{id:r}=t,i=new Pu(e.droppable.containers);return i.set(r,t),{...e,droppable:{...e.droppable,containers:i}}}case Os.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 Pu(e.droppable.containers);return a.set(t,{...o,disabled:i}),{...e,droppable:{...e.droppable,containers:a}}}case Os.UnregisterDroppable:{const{id:t,key:r}=n,i=e.droppable.containers.get(t);if(!i||r!==i.key)return e;const o=new Pu(e.droppable.containers);return o.delete(t),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function Lu(n){let{disabled:t}=n;const{active:r,activatorEvent:i,draggableNodes:o}=e.useContext(Wu),a=ds(i),s=ds(null==r?void 0:r.id);return e.useEffect(()=>{if(!t&&!i&&a&&null!=s){if(!bs(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=Cs(e);if(n){n.focus();break}}})}},[i,t,o,s,a]),null}const Yu=/*#__PURE__*/e.createContext({...Ds,scaleX:1,scaleY:1});var Zu;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(Zu||(Zu={}));const ju=/*#__PURE__*/e.memo(function(n){var t,r,i,o;let{id:a,accessibility:s,autoScroll:u=!0,children:c,sensors:l=Gu,collisionDetection:d=Bs,measuring:p,modifiers:f,...g}=n;const h=e.useReducer(Xu,void 0,Fu),[b,v]=h,[I,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,A]=e.useState(Zu.Uninitialized),w=C===Zu.Initialized,{draggable:{active:E,nodes:R,translate:T},droppable:{containers:S}}=b,O=null!=E?R.get(E):null,N=e.useRef({initial:null,translated:null}),D=e.useMemo(()=>{var e;return null!=E?{id:E,data:null!=(e=null==O?void 0:O.data)?e:Bu,rect:N}:null},[E,O]),k=e.useRef(null),[G,B]=e.useState(null),[M,P]=e.useState(null),V=us(g,Object.values(g)),W=fs("DndDescribedBy",a),H=e.useMemo(()=>S.getEnabled(),[S]),F=function(n){return e.useMemo(()=>({draggable:{...Mu.draggable,...null==n?void 0:n.draggable},droppable:{...Mu.droppable,...null==n?void 0:n.droppable},dragOverlay:{...Mu.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:Y}=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 xu.Always:return!1;case xu.BeforeDragging:return r;default:return!r}}(),f=us(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),h=cs(e=>{if(p&&!r)return wu;if(!e||e===wu||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 nu(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:h,measureDroppableContainers:m,measuringScheduled:null!=a}}(H,{dragging:w,dependencies:[T.x,T.y],config:F.droppable}),Z=function(e,n){const t=null!=n?e.get(n):void 0,r=t?t.node.current:null;return cs(e=>{var t;return null==n?null:null!=(t=null!=r?r:e)?t:null},[r,n])}(R,E),j=e.useMemo(()=>M?vs(M):null,[M]),z=function(){const e=w&&!(!1===(null==G?void 0:G.autoScrollEnabled))&&!("object"==typeof u?!1===u.enabled:!1===u);return"object"==typeof u?{...u,enabled:e}:{enabled:e}}(),J=function(e,n){return Eu(e,n)}(Z,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;as(()=>{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=Ms(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=Ls(e);t&&t.scrollBy({top:n.y,left:n.x})}},[t,s,u,i,r])}({activeNode:null!=E?R.get(E):null,config:z.layoutShiftCompensation,initialRect:J,measure:F.draggable.measure});const _=Su(Z,F.draggable.measure,J),U=Su(Z?Z.parentElement:null),q=e.useRef({activatorEvent:null,active:null,activeNode:Z,collisionRect:null,collisions:null,droppableRects:X,draggableNodes:R,draggingNode:null,draggingNodeRect:null,droppableContainers:S,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),$=S.getNodeFor(null==(t=q.current.over)?void 0:t.id),Q=function(n){let{measure:t}=n;const[r,i]=e.useState(null),o=e.useCallback(e=>{for(const{target:n}of e)if(rs(n)){i(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t]),a=Ru({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 rs(n)?n:e}(e);null==a||a.disconnect(),n&&(null==a||a.observe(n)),i(n?t(n):null)},[t,a]),[u,c]=ls(s);return e.useMemo(()=>({nodeRef:u,rect:r,setRef:c}),[r,u,c])}({measure:F.dragOverlay.measure}),K=null!=(r=Q.nodeRef.current)?r:Z,ee=w?null!=(i=Q.rect)?i:_:null,ne=Boolean(Q.nodeRef.current&&Q.rect),te=Ms(re=ne?null:_,Eu(re));var re;const ie=Du(K?ns(K):null),oe=function(n){const t=e.useRef(n),r=cs(e=>n?e&&e!==Ou&&n&&t.current&&n.parentNode===t.current.parentNode?e:Xs(n):Ou,[n]);return e.useEffect(()=>{t.current=n},[n]),r}(w?null!=$?$:Z:null),ae=function(n,t){void 0===t&&(t=Hs);const[r]=n,i=Du(r?ns(r):null),[o,a]=e.useState(ku);function s(){a(()=>n.length?n.map(e=>_s(e)?i:new nu(t(e),e)):ku)}const u=Ru({callback:s});return as(()=>{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:T.x-te.x,y:T.y-te.y,scaleX:1,scaleY:1},activatorEvent:M,active:D,activeNodeRect:_,containerNodeRect:U,draggingNodeRect:ee,over:q.current.over,overlayNodeRect:Q.rect,scrollableAncestors:oe,scrollableAncestorRects:ae,windowRect:ie}),ue=j?gs(j,T):null,ce=function(n){const[t,r]=e.useState(null),i=e.useRef(n),o=e.useCallback(e=>{const n=Ys(e.target);n&&r(e=>e?(e.set(n,zs(n)),new Map(e)):null)},[]);return e.useEffect(()=>{const e=i.current;if(n!==e){t(e);const a=n.map(e=>{const n=Ys(e);return n?(n.addEventListener("scroll",o,{passive:!0}),[n,zs(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=Ys(e);null==n||n.removeEventListener("scroll",o)})}},[o,n]),e.useMemo(()=>n.length?t?Array.from(t.values()).reduce((e,n)=>gs(e,n),Ds):Ks(n):Ds,[n,t])}(oe),le=Nu(ce),de=Nu(ce,[_]),pe=gs(se,le),fe=ee?Vs(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),[he,be]=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:gs(se,de),null!=(o=null==he?void 0:he.rect)?o:null,_),Ie=e.useRef(null),ye=e.useCallback((e,n)=>{let{sensor:t,options:r}=n;if(null==k.current)return;const i=R.get(k.current);if(!i)return;const o=e.nativeEvent,a=new t({active:k.current,activeNode:i,event:o,options:r,context:q,onAbort(e){if(!R.get(e))return;const{onDragAbort:n}=V.current,t={id:e};null==n||n(t),I({type:"onDragAbort",event:t})},onPending(e,n,t,r){if(!R.get(e))return;const{onDragPending:i}=V.current,o={id:e,constraint:n,initialCoordinates:t,offset:r};null==i||i(o),I({type:"onDragPending",event:o})},onStart(e){const n=k.current;if(null==n)return;const t=R.get(n);if(!t)return;const{onDragStart:r}=V.current,i={activatorEvent:o,active:{id:n,data:t.data,rect:N}};m.unstable_batchedUpdates(()=>{null==r||r(i),A(Zu.Initializing),v({type:Os.DragStart,initialCoordinates:e,active:n}),I({type:"onDragStart",event:i}),B(Ie.current),P(o)})},onMove(e){v({type:Os.DragMove,coordinates:e})},onEnd:s(Os.DragEnd),onCancel:s(Os.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===Os.DragEnd&&"function"==typeof s&&await Promise.resolve(s(a))&&(e=Os.DragCancel)}k.current=null,m.unstable_batchedUpdates(()=>{v({type:e}),A(Zu.Uninitialized),be(null),B(null),P(null),Ie.current=null;const n=e===Os.DragEnd?"onDragEnd":"onDragCancel";if(a){const e=V.current[n];null==e||e(a),I({type:n,event:a})}})}}Ie.current=a},[R]),Ce=e.useCallback((e,n)=>(t,r)=>{const i=t.nativeEvent,o=R.get(r);null!==k.current||!o||i.dndKit||i.defaultPrevented||!0===e(t,n.options,{active:o})&&(i.dndKit={capturedBy:n.sensor},k.current=r,ye(t,n))},[R,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(!Qa)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),as(()=>{_&&C===Zu.Initializing&&A(Zu.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};m.unstable_batchedUpdates(()=>{null==e||e(o),I({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==k.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};m.unstable_batchedUpdates(()=>{be(s),null==o||o(u),I({type:"onDragOver",event:u})})},[ge]),as(()=>{q.current={activatorEvent:M,active:D,activeNode:Z,collisionRect:fe,collisions:me,droppableRects:X,draggableNodes:R,draggingNode:K,draggingNodeRect:ee,droppableContainers:S,over:he,scrollableAncestors:oe,scrollAdjustedTranslate:pe},N.current={initial:ee,translated:fe}},[D,Z,me,fe,R,K,ee,X,S,he,oe,pe]),function(n){let{acceleration:t,activator:r=Iu.Pointer,canScroll:i,draggingRect:o,enabled:a,interval:s=5,order:u=yu.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:d,delta:p,threshold:f}=n;const m=function(e){let{delta:n,disabled:t}=e;const r=ds(n);return cs(e=>{if(t||!r||!e)return Cu;const i=Math.sign(n.x-r.x),o=Math.sign(n.y-r.y);return{x:{[Js.Backward]:e.x[Js.Backward]||-1===i,[Js.Forward]:e.x[Js.Forward]||1===i},y:{[Js.Backward]:e.y[Js.Backward]||-1===o,[Js.Forward]:e.y[Js.Forward]||1===o}}},[t,n,r])}({delta:p,disabled:!a}),[g,h]=function(){const n=e.useRef(null),t=e.useCallback((e,t)=>{n.current=setInterval(e,t)},[]);return[t,e.useCallback(()=>{null!==n.current&&(clearInterval(n.current),n.current=null)},[])]}(),b=e.useRef({x:0,y:0}),v=e.useRef({x:0,y:0}),I=e.useMemo(()=>{switch(r){case Iu.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Iu.DraggableRect:return o}},[r,o,c]),y=e.useRef(null),C=e.useCallback(()=>{const e=y.current;e&&e.scrollBy(b.current.x*v.current.x,b.current.y*v.current.y)},[]),x=e.useMemo(()=>u===yu.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}=$s(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 h(),y.current=e,g(C,s),b.current=a,void(v.current=o)}b.current={x:0,y:0},v.current={x:0,y:0},h()}else h()},[t,C,i,h,a,s,JSON.stringify(I),JSON.stringify(m),g,l,x,d,JSON.stringify(f)])}({...z,delta:T,draggingRect:fe,pointerCoordinates:ue,scrollableAncestors:oe,scrollableAncestorRects:ae});const Ae=e.useMemo(()=>({active:D,activeNode:Z,activeNodeRect:_,activatorEvent:M,collisions:me,containerNodeRect:U,dragOverlay:Q,draggableNodes:R,droppableContainers:S,droppableRects:X,over:he,measureDroppableContainers:L,scrollableAncestors:oe,scrollableAncestorRects:ae,measuringConfiguration:F,measuringScheduled:Y,windowRect:ie}),[D,Z,_,M,me,U,Q,R,S,X,he,L,oe,ae,F,Y,ie]),we=e.useMemo(()=>({activatorEvent:M,activators:xe,active:D,activeNodeRect:_,ariaDescribedById:{draggable:W},dispatch:v,draggableNodes:R,over:he,measureDroppableContainers:L}),[M,xe,D,_,v,W,R,he,L]);return x.default.createElement(Es.Provider,{value:y},x.default.createElement(Wu.Provider,{value:we},x.default.createElement(Hu.Provider,{value:Ae},x.default.createElement(Yu.Provider,{value:ve},c)),x.default.createElement(Lu,{disabled:!1===(null==s?void 0:s.restoreFocus)})),x.default.createElement(Ss,{...s,hiddenTextDescribedById:W}))}),zu=/*#__PURE__*/e.createContext(null),Ju="button",_u={timeout:25};function Uu(e,n,t){const r=e.slice();return r.splice(t<0?r.length+t:t,0,r.splice(n,1)[0]),r}function qu(e,n){return e.reduce((e,t,r)=>{const i=n.get(t);return i&&(e[r]=i),e},Array(e.length))}function $u(e){return null!==e&&e>=0}const Qu=e=>{let{rects:n,activeIndex:t,overIndex:r,index:i}=e;const o=Uu(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},Ku="Sortable",ec=/*#__PURE__*/x.default.createContext({activeIndex:-1,containerId:Ku,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Qu,disabled:{draggable:!1,droppable:!1}});function nc(n){let{children:t,id:r,items:i,strategy:o=Qu,disabled:a=!1}=n;const{active:s,dragOverlay:u,droppableRects:c,over:l,measureDroppableContainers:d}=e.useContext(Hu),p=fs(Ku,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,h=s?m.indexOf(s.id):-1,b=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!==b&&-1===h||I,C=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(a);as(()=>{I&&g&&d(m)},[I,m,g,d]),e.useEffect(()=>{v.current=m},[m]);const A=e.useMemo(()=>({activeIndex:h,containerId:p,disabled:C,disableTransforms:y,items:m,overIndex:b,useDragOverlay:f,sortedRects:qu(m,c),strategy:o}),[h,p,C.draggable,C.droppable,y,m,b,c,f,o]);return x.default.createElement(ec.Provider,{value:A},t)}const tc=e=>{let{id:n,items:t,activeIndex:r,overIndex:i}=e;return Uu(t,r,i).indexOf(n)},rc=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))},ic={duration:200,easing:"ease"},oc="transform",ac=/*#__PURE__*/Is.Transition.toString({property:oc,duration:0,easing:"linear"}),sc={roleDescription:"sortable"};var uc=function(n){var t=function(n){let{animateLayoutChanges:t=rc,attributes:r,disabled:i,data:o,getNewIndex:a=tc,id:s,strategy:u,resizeObserverConfig:c,transition:l=ic}=n;const{items:d,containerId:p,activeIndex:f,disabled:m,disableTransforms:g,sortedRects:h,overIndex:b,useDragOverlay:v,strategy:I}=e.useContext(ec),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:w,node:E,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(Wu),d=e.useRef({disabled:r}),p=e.useRef(!1),f=e.useRef(null),m=e.useRef(null),{disabled:g,updateMeasurementsFor:h,timeout:b}={..._u,...o},v=us(null!=h?h:i),I=Ru({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},b)):p.current=!0},[b]),disabled:g||!s}),y=e.useCallback((e,n)=>{I&&(n&&(I.unobserve(n),p.current=!1),e&&I.observe(e))},[I]),[C,x]=ls(y),A=us(t);return e.useEffect(()=>{I&&C.current&&(I.disconnect(),p.current=!1,I.observe(C.current))},[C,I]),e.useEffect(()=>(u({type:Os.RegisterDroppable,element:{id:i,key:a,disabled:r,node:C,rect:f,data:A}}),()=>u({type:Os.UnregisterDroppable,key:a,id:i})),[i]),e.useEffect(()=>{r!==d.current.disabled&&(u({type:Os.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:O,activeNodeRect:N,attributes:D,setNodeRef:k,listeners:G,isDragging:B,over:M,setActivatorNodeRef:P,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(Wu),{role:m=Ju,roleDescription:g="draggable",tabIndex:h=0}=null!=o?o:{},b=(null==c?void 0:c.id)===t,v=e.useContext(b?Yu:zu),[I,y]=ls(),[C,x]=ls(),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),w=us(r);return as(()=>(p.set(t,{id:t,key:a,node:I,activatorNode:C,data:w}),()=>{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:h,"aria-disabled":i,"aria-pressed":!(!b||m!==Ju)||void 0,"aria-roledescription":g,"aria-describedby":d.draggable}),[i,m,h,b,g,d.draggable]),isDragging:b,listeners:i?void 0:A,node:I,over:f,setNodeRef:y,setActivatorNodeRef:x,transform:v}}({id:s,data:x,attributes:{...sc,...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,k),H=Boolean(S),F=H&&!g&&$u(f)&&$u(b),X=!v&&B,L=X&&F?V:null,Y=F?null!=L?L:(null!=u?u:I)({rects:h,activeNodeRect:N,activeIndex:f,overIndex:b,index:C}):null,Z=$u(f)&&$u(b)?a({id:s,items:d,activeIndex:f,overIndex:b}):C,j=null==S?void 0:S.id,z=e.useRef({activeId:j,items:d,newIndex:Z,containerId:p}),J=d!==z.current.items,_=t({active:S,containerId:p,isDragging:B,isSorting:H,id:s,index:C,items:d,newIndex:z.current.newIndex,previousItems:z.current.items,previousContainerId:z.current.containerId,transition:l,wasDragging:null!=z.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 as(()=>{if(!t&&r!==u.current&&i.current){const e=o.current;if(e){const n=Hs(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:E,rect:w});return e.useEffect(()=>{H&&z.current.newIndex!==Z&&(z.current.newIndex=Z),p!==z.current.containerId&&(z.current.containerId=p),d!==z.current.items&&(z.current.items=d)},[H,Z,p,d]),e.useEffect(()=>{if(j===z.current.activeId)return;if(null!=j&&null==z.current.activeId)return void(z.current.activeId=j);const e=setTimeout(()=>{z.current.activeId=j},50);return()=>clearTimeout(e)},[j]),{active:S,activeIndex:f,attributes:D,data:x,rect:w,index:C,newIndex:Z,items:d,isOver:R,isSorting:H,isDragging:B,listeners:G,node:E,overIndex:b,over:M,setNodeRef:W,setActivatorNodeRef:P,setDroppableNodeRef:T,setDraggableNodeRef:k,transform:null!=U?U:Y,transition:U||J&&z.current.newIndex===C?ac:X&&!bs(O)||!l?void 0:H||_?Is.Transition.toString({...l,property:oc}):void 0}}({id:n.data.value}),r=t.attributes,i=t.listeners,o=t.setNodeRef,a=t.transition,s={display:"flex",transform:Is.Transform.toString(t.transform),transition:a};return x.default.createElement("div",D({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))}}),x.default.createElement($o.MultiValueContainer,D({},n)))},cc=function(e){var n=D({},e.innerProps,{style:{cursor:"grab"},onMouseDown:function(e){e.preventDefault(),e.stopPropagation()}});return x.default.createElement($o.MultiValueLabel,D({},e,{innerProps:n}))},lc={en:{translation:{"Are you sure you want to delete this widget?":"Are you sure you want to delete this widget?",Cancel:"Cancel",Delete:"Delete","filters.dayType.label":"Day type","filters.dayType.calendar":"Calendar","filters.dayType.production":"Production","filters.shifts.label":"Shifts","filters.shifts.allShifts":"All shifts","filters.dateRange.label":"Date range","filters.dateRange.from":"From","filters.dateRange.to":"To","filters.search.placeholder":"Search periods...","filters.search.noResults":"No periods found","filters.premium.indicator":"Premium","filters.periods.today":"Today","filters.periods.yesterday":"Yesterday","filters.periods.last7Days":"Last 7 days","filters.periods.last14Days":"Last 14 days","filters.periods.last30Days":"Last 30 days","filters.periods.last90Days":"Last 90 days","filters.periods.last180Days":"Last 180 days","filters.periods.last365Days":"Last 365 days","filters.periods.currentWeek":"Current week","filters.periods.currentMonth":"Current month","filters.periods.currentQuarter":"Current quarter","filters.periods.currentYear":"Current year","filters.periods.previousWeek":"Previous week","filters.periods.previousMonth":"Previous month","filters.periods.previousQuarter":"Previous quarter","filters.periods.previousYear":"Previous year","filters.periods.last2Weeks":"Last 2 weeks","filters.periods.last4Weeks":"Last 4 weeks","filters.periods.last8Weeks":"Last 8 weeks","filters.periods.last12Weeks":"Last 12 weeks","filters.periods.last3Months":"Last 3 months","filters.periods.last6Months":"Last 6 months","filters.periods.last12Months":"Last 12 months","filters.accessDenied.title":"Premium feature","filters.accessDenied.close":"Close"}},pl:{translation:{"Are you sure you want to delete this widget?":"Czy na pewno usunąć ten widżet?",Cancel:"Anuluj",Delete:"Usuń","filters.dayType.label":"Typ dnia","filters.dayType.calendar":"Kalendarzowy","filters.dayType.production":"Produkcyjny","filters.shifts.label":"Zmiany","filters.shifts.allShifts":"Wszystkie zmiany","filters.dateRange.label":"Zakres dat","filters.dateRange.from":"Od","filters.dateRange.to":"Do","filters.search.placeholder":"Szukaj okresów...","filters.search.noResults":"Nie znaleziono okresów","filters.premium.indicator":"Premium","filters.periods.today":"Dzisiaj","filters.periods.yesterday":"Wczoraj","filters.periods.last7Days":"Ostatnie 7 dni","filters.periods.last14Days":"Ostatnie 14 dni","filters.periods.last30Days":"Ostatnie 30 dni","filters.periods.last90Days":"Ostatnie 90 dni","filters.periods.last180Days":"Ostatnie 180 dni","filters.periods.last365Days":"Ostatnie 365 dni","filters.periods.currentWeek":"Bieżący tydzień","filters.periods.currentMonth":"Bieżący miesiąc","filters.periods.currentQuarter":"Bieżący kwartał","filters.periods.currentYear":"Bieżący rok","filters.periods.previousWeek":"Poprzedni tydzień","filters.periods.previousMonth":"Poprzedni miesiąc","filters.periods.previousQuarter":"Poprzedni kwartał","filters.periods.previousYear":"Poprzedni rok","filters.periods.last2Weeks":"Ostatnie 2 tygodnie","filters.periods.last4Weeks":"Ostatnie 4 tygodnie","filters.periods.last8Weeks":"Ostatnie 8 tygodni","filters.periods.last12Weeks":"Ostatnie 12 tygodni","filters.periods.last3Months":"Ostatnie 3 miesiące","filters.periods.last6Months":"Ostatnie 6 miesięcy","filters.periods.last12Months":"Ostatnie 12 miesięcy","filters.accessDenied.title":"Funkcja Premium","filters.accessDenied.close":"Zamknij"}}},dc=H(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 V&&V&&V.Object===Object&&V||d||Function("return this")(),f=n&&!n.nodeType&&n,m=f&&e&&!e.nodeType&&e,g=m&&m.exports===f,h=Function.prototype,b=Object.prototype,v=p["__core-js_shared__"],I=(t=/[^.]+$/.exec(v&&v.keys&&v.keys.IE_PROTO||""))?"Symbol(src)_1."+t:"",y=h.toString,C=b.hasOwnProperty,x=b.toString,A=RegExp("^"+y.call(C).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),w=g?p.Buffer:void 0,E=b.propertyIsEnumerable,R=w?w.isBuffer:void 0,T=(r=Object.keys,i=Object,function(e){return r(i(e))}),S=F(p,"DataView"),O=F(p,"Map"),N=F(p,"Promise"),D=F(p,"Set"),k=F(p,"WeakMap"),G=!E.call({valueOf:1},"valueOf"),B=L(S),M=L(O),P=L(N),W=L(D),H=L(k);function F(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=z(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(L(e))}(t)?t:void 0}var X=function(e){return x.call(e)};function L(e){if(null!=e){try{return y.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(S&&X(new S(new ArrayBuffer(1)))!=c||O&&X(new O)!=o||N&&X(N.resolve())!=a||D&&X(new D)!=s||k&&X(new k)!=u)&&(X=function(e){var n=x.call(e),t="[object Object]"==n?e.constructor:void 0,r=t?L(t):void 0;if(r)switch(r){case B:return c;case M:return o;case P:return a;case W:return s;case H:return u}return n});var Y=Array.isArray;function Z(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}(e.length)&&!z(e)}var j=R||function(){return!1};function z(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)&&(Y(e)||"string"==typeof e||"function"==typeof e.splice||j(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Z(e)}(e)&&C.call(e,"callee")&&(!E.call(e,"callee")||"[object Arguments]"==x.call(e))}(e)))return!e.length;var n=X(e);if(n==o||n==s)return!e.size;if(G||function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||b)}(e))return!T(e).length;for(var t in e)if(C.call(e,t))return!1;return!0}}),pc=function(e,n){return pc=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])},pc(e,n)};function fc(e,n){function t(){this.constructor=e}pc(e,n),e.prototype=null===n?Object.create(n):(t.prototype=n.prototype,new t)}function mc(e){return"function"==typeof e}var gc=!1,hc={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){gc=e},get useDeprecatedSynchronousErrorHandling(){return gc}};function bc(e){setTimeout(function(){throw e},0)}var vc={closed:!0,next:function(e){},error:function(e){if(hc.useDeprecatedSynchronousErrorHandling)throw e;bc(e)},complete:function(){}},Ic=/*@__PURE__*/function(){return Array.isArray||function(e){return e&&"number"==typeof e.length}}();function yc(e){return null!==e&&"object"==typeof e}var Cc=/*@__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}(),xc=Cc,Ac=/*@__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(mc(o)){i&&(this._unsubscribe=void 0);try{o.call(this)}catch(e){n=e instanceof xc?wc(e.errors):[e]}}if(Ic(a)){s=-1;for(var u=a.length;++s<u;){var c=a[s];if(yc(c))try{c.unsubscribe()}catch(e){n=n||[],e instanceof xc?n=n.concat(wc(e.errors)):n.push(e)}}}if(n)throw new xc(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 wc(e){return e.reduce(function(e,n){return e.concat(n instanceof xc?n.errors:n)},[])}var Ec=/*@__PURE__*/function(){return"function"==typeof Symbol?/*@__PURE__*/Symbol("rxSubscriber"):"@@rxSubscriber_"+/*@__PURE__*/Math.random()}(),Rc=/*@__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=vc;break;case 1:if(!t){o.destination=vc;break}if("object"==typeof t){t instanceof n?(o.syncErrorThrowable=t.syncErrorThrowable,o.destination=t,t.add(o)):(o.syncErrorThrowable=!0,o.destination=new Tc(o,t));break}default:o.syncErrorThrowable=!0,o.destination=new Tc(o,t,r,i)}return o}return fc(n,e),n.prototype[Ec]=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}(Ac),Tc=/*@__PURE__*/function(e){function n(n,t,r,i){var o,a=e.call(this)||this;a._parentSubscriber=n;var s=a;return mc(t)?o=t:t&&(o=t.next,r=t.error,i=t.complete,t!==vc&&(mc((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 fc(n,e),n.prototype.next=function(e){if(!this.isStopped&&this._next){var n=this._parentSubscriber;hc.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=hc.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):bc(e),this.unsubscribe();else{if(this.unsubscribe(),t)throw e;bc(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)};hc.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(),hc.useDeprecatedSynchronousErrorHandling)throw e;bc(e)}},n.prototype.__tryOrSetError=function(e,n,t){if(!hc.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{n.call(this._context,t)}catch(n){return hc.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=n,e.syncErrorThrown=!0,!0):(bc(n),!0)}return!1},n.prototype._unsubscribe=function(){var e=this._parentSubscriber;this._context=null,this._parentSubscriber=null,e.unsubscribe()},n}(Rc),Sc=/*@__PURE__*/function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();function Oc(e){return e}var Nc=/*@__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 Rc)return e;if(e[Ec])return e[Ec]()}return e||n||t?new Rc(e,n,t):new Rc(vc)}(e,n,t);if(i.add(r?r.call(i,this.source):this.source||hc.useDeprecatedSynchronousErrorHandling&&!i.syncErrorThrowable?this._subscribe(i):this._trySubscribe(i)),hc.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){hc.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 Rc?n:null}return!0}(e)?e.error(n):console.warn(n)}},e.prototype.forEach=function(e,n){var t=this;return new(n=Dc(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[Sc]=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?Oc: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=Dc(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 Dc(e){if(e||(e=hc.Promise||Promise),!e)throw new Error("no Promise impl found");return e}var kc=/*#__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=O.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 Nc(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&&(dc(e.result.data)||o.next(e.result)):o.complete&&o.complete()}}),i(s,n))}})},n.hasSubscription=function(e){return this.subscriptions.has(e)},e}(),Gc=/*#__PURE__*/function(){function e(e,n,t){this.actionCableClient=null,this.actionCableClient=new kc(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}(),Bc=function(e,n,t){return new Gc(e,n,t)},Mc=function(e,n){return Xr(new v.GraphQLClient(e,{fetch:n}))},Pc=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(Mc(r,i.fetch))},[r]),e.useEffect(function(){r&&g&&f(Bc(m||r.replace("graphql","cable"),g,a))},[r,m,g,a]),{graphqlSdk:c,gqlWsClient:p}},Vc={root:{boxShadow:"none","& .react-resizable-handle":{width:"24px",height:"24px",borderRadius:"4px",background:function(e){return e.palette.primary.main+" url("+N.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}}},Wc=["children","title","Widget","id","url","wsUrl","lang","data","filters","settings","openSettingsModal","onSettingsModalOpened","onSettingsModalClosed","sidePanelOpened","updateSidePanelProps","onDelete","editMode","version","requiredFeatures","extraPermissions"];function Hc(e,n){try{var t=e()}catch(e){return n(e)}return t&&t.then?t.then(void 0,n):t}var Fc=x.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,b=r.settings,v=r.openSettingsModal,I=r.onSettingsModalOpened,y=r.onSettingsModalClosed,C=r.sidePanelOpened,A=r.updateSidePanelProps,w=r.onDelete,E=r.editMode,R=r.version,T=r.requiredFeatures,S=r.extraPermissions,O=k(r,Wc),N=Pc({url:l,wsUrl:d,lang:p}).graphqlSdk,G=i.useAccess(T,{extraPermissions:S}).hasAccess,B=e.useState(!1),M=B[0],V=B[1],W=e.useState(!1),H=W[0],F=W[1],X=t.useTranslation(),L=X.i18n,Y=X.t;return e.useEffect(function(){for(var e="translation",n=0,t=Object.entries(lc);n<t.length;n++){var r=t[n];L.addResources(r[0],e,r[1][e])}},[L]),x.default.createElement(n.Card,D({ref:o,sx:Vc.root},O),x.default.createElement(n.CardHeader,{avatar:E&&x.default.createElement(n.SvgIcon,{component:h.ReactComponent,className:"draggable-handle",sx:Vc.dragIcon,inheritViewBox:!0}),title:s,titleTypographyProps:{variant:"subtitle1"},action:E&&x.default.createElement(n.Stack,{direction:"row",sx:Vc.actionButtons},x.default.createElement(n.Button,{color:"secondary",sx:Vc.settingsButton,onClick:function(){I&&I()},disabled:!G},x.default.createElement(g.Settings,null)),R&&x.default.createElement(x.default.Fragment,null,x.default.createElement(n.Tooltip,{title:R},x.default.createElement(n.Button,{color:"secondary",sx:Vc.infoButton},x.default.createElement(g.Info,null)))),x.default.createElement(P,{open:H,confirmMessage:Y("Are you sure you want to delete this widget?"),confirmButtonText:Y("Delete"),cancelButtonText:Y("Cancel"),onCancel:function(){return F(!1)},onConfirm:function(){try{var e=function(){V(!1)};V(!0),F(!1);var n=function(){if(w)return Promise.resolve(w()).then(function(){})}();return Promise.resolve(n&&n.then?n.then(e):e())}catch(e){return Promise.reject(e)}}},x.default.createElement(n.Button,{color:"secondary",sx:Vc.deleteButton,onClick:function(e){e.stopPropagation(),F(!0)},disabled:M},x.default.createElement(g.Delete,null)))),sx:Vc.header}),x.default.createElement(n.CardContent,{sx:Vc.content},x.default.createElement(i.AccessGuard,{features:T,extraPermissions:S,onTrialRequest:function(e){try{return Promise.resolve(Hc(function(){return Promise.resolve(null==N?void 0:N.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(Hc(function(){return Promise.resolve(null==N?void 0:N.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)}}},x.default.createElement(u,{id:c,url:l,wsUrl:d,lang:p,data:f,filters:m,settings:b,openSettingsModal:v,onSettingsModalOpened:I,onSettingsModalClosed:y,sidePanelOpened:C,updateSidePanelProps:A,editMode:E}))),E&&a)});F.extend(Zr);var Xc=function(e,n){return n.year(e.year()).month(e.month()).date(e.date())};exports.ActualStaffingCountsDocument=er,exports.ApplicationInfoDocument=nr,exports.AssignOperatorDocument=Nr,exports.AssignOperatorToWorkplaceDocument=Rt,exports.BulkUpsertStaffingPlansDocument=Tt,exports.CompanyConfigDocument=tr,exports.ConfirmTooltip=P,exports.CounterDirectoriesDocument=rr,exports.CountersDocument=ir,exports.CreateDashboardDocument=St,exports.CreateOrderDocument=Ot,exports.CreateProductDocument=Nt,exports.CreateStaffingPlanDocument=Dt,exports.CreateStatusChangeDocument=kt,exports.CreateUserPresenceDocument=Gt,exports.CreateWidgetDocument=Bt,exports.CurrentUserDocument=or,exports.DashboardFilters=function(r){var o=r.initialValues,a=r.onChange,s=r.shifts,u=r.onFeatureRequest,c=e.useState(function(){return null!=o?o:{dayType:exports.DayType.Production,dateRange:(e=F().format("YYYY-MM-DD"),{from:e+"T00:00:00",to:e+"T23:59:59"}),shiftIds:[]};var e}),l=c[0],d=c[1],p=e.useState(),f=p[0],m=p[1],g=e.useState(!1),h=g[0],b=g[1],v=e.useState(!1),I=v[0],y=v[1],C=e.useRef(null),A=i.useAccess([pi]),E=A.hasAccess,R=A.accessState,T=A.buttons,S=A.cooldownInfo,O=A.features,N=e.useMemo(function(){var e,n=O.find(function(e){return e.featureKey===pi});return null!=(e=null==n?void 0:n.daysSinceExpiry)?e:null},[O]),k=e.useMemo(function(){return T.filter(function(e){return"start_trial"!==e.action})},[T]);e.useEffect(function(){if(f){var e=ni.find(function(e){return e.id===f});if(e){var n=e.calculate({dayType:l.dayType,shifts:s,selectedShiftIds:l.shiftIds});d(function(e){return D({},e,{dateRange:n})}),a(D({},l,{dateRange:n}))}}},[l.dayType,l.shiftIds,s,f]);var G,B,M,P=t.useTranslation().t,V=e.useCallback(function(e){var n=D({},l,{dayType:e});d(n),a(n)},[l,a]),W=e.useCallback(function(e){var n=D({},l,{shiftIds:e});d(n),a(n)},[l,a]),H=e.useCallback(function(e){m(void 0);var n=D({},l,{dateRange:e});d(n),a(n)},[l,a]),X=e.useCallback(function(e,n){if(!e.needAccess||E){m(e.id);var t=D({},l,{dateRange:n});d(t),a(t)}else b(!0)},[l,E,a]),L=e.useCallback(function(){b(!1)},[]),Y=e.useCallback(function(){b(!0)},[]),Z=e.useCallback(function(){y(!0)},[]),j=e.useCallback(function(){y(!1)},[]);return x.default.createElement(n.Box,{sx:di.container},x.default.createElement(n.Stack,{direction:"row",spacing:2,alignItems:"center"},x.default.createElement(n.TextField,{ref:C,label:P("filters.dateRange.label"),value:(G=l.dateRange,B=F(G.from).format("YYYY-MM-DD"),M=F(G.to).format("YYYY-MM-DD"),B===M?B:B+" - "+M),onClick:Z,size:"small",InputProps:{readOnly:!0,startAdornment:x.default.createElement(n.InputAdornment,{position:"start"},x.default.createElement(w.default,{sx:{fontSize:16}}))},sx:di.dateField}),x.default.createElement(li,{shifts:s,selectedShiftIds:l.shiftIds,onChange:W})),x.default.createElement(n.Popover,{open:I,anchorEl:C.current,onClose:j,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},sx:di.popover},x.default.createElement(n.Box,{sx:di.popoverContent},x.default.createElement(ui,{dateRange:l.dateRange,dayType:l.dayType,shifts:s,selectedShiftIds:l.shiftIds,hasAccess:E,selectedPeriodId:f,onDayTypeChange:V,onDateRangeChange:H,onPeriodSelect:X,onAccessDenied:Y}))),x.default.createElement(Yr,{open:h,onClose:L,accessState:R,buttons:k,daysSinceExpiry:N,cooldownInfo:S,onFeatureRequest:u}))},exports.DashboardsDocument=ar,exports.DepartmentsDocument=sr,exports.FloorPlansDocument=ur,exports.GetWorkplacePerformanceInsightsDocument=kr,exports.GraphqlWsClient=Gc,exports.ListActualStaffingCountsDocument=Gr,exports.ListStaffingPlansDocument=Br,exports.ListStatusChangesDocument=Mr,exports.ListWorkOrdersDocument=Pr,exports.ListWorkplaceAssignmentsDocument=Vr,exports.ListWorkplacesDocument=Wr,exports.MetricCard=function(e){var r=e.title,i=e.metricLabel,o=e.metricValue,a=e.extraValue,s=e.animateBackgroundColor,u=e.rounded,c=k(e,bi),l=t.useTranslation().t,d=function(e){return{card:D({position:"relative",width:"100%",height:"100%"},e.showBgPattern&&{mixBlendMode:"hard-light",background:"url("+S.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:D({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,f.keyframes(ai||(ai=G(["\n 0% {\n background: ",";\n }\n\n 50% {\n background: ",";\n }\n\n 100% {\n background: ",";\n }\n"])),hi(t,.5),hi(t,1),hi(t,.5))+" 3s infinite"):"none"}),cardHeader:{height:"3em",color:"#090B0E",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:"#090B0E"},cardValue:{lineHeight:"1.2em",textAlign:"center",fontSize:"1.6em",fontWeight:700,color:n.lighten("#090B0E",.15)},cardExtra:{lineHeight:"4em",textAlign:"center",fontSize:"1em",fontWeight:600,color:"#090B0E"}};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});return x.default.createElement(n.Card,D({sx:d.card},c),x.default.createElement(n.Box,{sx:d.cardOverlay}),x.default.createElement(n.CardHeader,{title:x.default.createElement(mi,{line:1,text:r}),sx:d.cardHeader}),x.default.createElement(n.CardContent,{sx:d.cardContent},x.default.createElement(n.Typography,{sx:d.cardLabel},i),x.default.createElement(n.Typography,{sx:d.cardValue},o?function(e){var n=e.textValue;if(n){var t=F.duration(Number(n),"seconds");return Math.floor(t.asMinutes())+"m "+t.seconds()+"s"}return""}(o):x.default.createElement(t.Trans,{t:l},"No value for the selected metric")),a&&x.default.createElement(n.Typography,{sx:d.cardExtra},a)))},exports.MetricValuesDocument=cr,exports.MetricsDocument=lr,exports.NotificationsDocument=dr,exports.OrdersDocument=pr,exports.OrdersExecutionsDocument=fr,exports.PauseOrderExecutionDocument=Mt,exports.ProductsDocument=mr,exports.ReasonsDocument=gr,exports.ReasonsRecommendationDocument=hr,exports.RemoveDashboardDocument=Pt,exports.RemoveUserPresenceDocument=Vt,exports.RemoveWidgetDocument=Wt,exports.RemoveWorkplaceUsersPresencesDocument=Ht,exports.RequestFeatureAccessDocument=Ft,exports.SetCounterDocument=Xt,exports.ShiftsDocument=br,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))}};return x.default.createElement($a,{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:uc,MultiValueLabel:cc,ValueContainer:function(e){return x.default.createElement(ju,{onDragEnd:i},x.default.createElement(nc,{items:t},e.children))}},styles:{control:function(e,n){return D({},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 D({},e,{background:"#1C1F25"})},option:function(e,n){return D({},e,{background:n.isFocused?"#2A2E34":"#1C1F25"})}}})},exports.StaffingPlansDocument=vr,exports.StandardRatesDocument=Ir,exports.StartOrderExecutionDocument=Lt,exports.StartTrialDocument=Yt,exports.StatusChangeTransitionPermissionsDocument=yr,exports.StatusChangesDocument=Cr,exports.StopOrderExecutionDocument=Zt,exports.UnassignOperatorDocument=Dr,exports.UnassignOperatorFromWorkplaceDocument=jt,exports.UpdateDashboardDocument=zt,exports.UpdateNotificationDocument=Jt,exports.UpdateOrderDocument=_t,exports.UpdateOrderExecutionDocument=Ut,exports.UpdateStaffingPlanDocument=qt,exports.UpdateStatusChangeDocument=$t,exports.UpdateWidgetDocument=Qt,exports.UpdateWorkOrderDocument=Kt,exports.UsersDocument=xr,exports.UsersPresencesDocument=Ar,exports.WidgetCard=Fc,exports.WidgetDocument=wr,exports.WidgetsDocument=Er,exports.WorkOrdersDocument=Rr,exports.WorkplaceAssignmentsDocument=Tr,exports.WorkplaceEventDocument=Hr,exports.WorkplacePerformanceInsightsDocument=Sr,exports.WorkplacesDocument=Or,exports.getCurrentShift=function(e,n){return n.find(function(n){return e.isBetween(n.startedAt,n.finishedAt)})||null},exports.getGqlWsClient=Bc,exports.getGraphqlSdk=Mc,exports.getRecentShift=function(e,n){return n.length?n.reduce(function(n,t){return Math.abs(e.diff(t.finishedAt))<Math.abs(e.diff(n.finishedAt))?t:n}):null},exports.getSdk=Xr,exports.normalizeShifts=function(e,n){var t=[];return e.forEach(function(e){var r=F(e.startedAt,"YYYY-MM-DD HH:mm:ss ZZ"),i=F(e.finishedAt,"YYYY-MM-DD HH:mm:ss ZZ");if(r=Xc(n,r),i=Xc(n,i),r.isAfter(i)){var o=r.subtract(1,"day"),a=i.add(1,"day");t.push({name:e.name,startedAt:o,finishedAt:i}),t.push({name:e.name,startedAt:r,finishedAt:a})}else t.push({name:e.name,startedAt:r,finishedAt:i})}),t},exports.useGqlClients=Pc,exports.version="1.5.7";
|
|
16
16
|
//# sourceMappingURL=index.js.map
|