andoncloud-station-assignment-widget 1.0.2 → 1.0.3
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 +5 -5
- package/dist/index.js.map +1 -1
- package/dist/locales/index.d.ts +2 -0
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var e=require("react"),t=require("andoncloud-dashboard-toolkit"),n=require("andoncloud-widget-base"),r=require("dayjs"),o=require("react-i18next"),i=require("@mui/lab"),a=require("@mui/material"),s=require("react-dom"),l=require("@mui/icons-material/Search"),c=require("@mui/icons-material/Close"),d=require("@mui/icons-material/ChevronLeft"),u=require("@mui/icons-material/ChevronRight");function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function f(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,t}var g=/*#__PURE__*/p(e),m=/*#__PURE__*/f(e),h=/*#__PURE__*/p(r),b=/*#__PURE__*/p(s),E=/*#__PURE__*/p(l),v=/*#__PURE__*/p(c),y=/*#__PURE__*/p(d),N=/*#__PURE__*/p(u);function D(){return D=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},D.apply(null,arguments)}var x={en:{translation:{Loading:"Loading","Choose workplace":"Choose workplace",Cancel:"Cancel",Save:"Save",Settings:"Settings",noShiftsAvailable:"No shifts available",unassignedPool:"Unassigned",searchOperators:"Search operators",department:"Department",allDepartments:"All departments",refreshInterval:"Refresh interval",filters:"Filters",advanced:"Advanced"}},pl:{translation:{Loading:"Wczytywanie","Choose workplace":"Wybierz stanowisko",Cancel:"Anuluj",Save:"Zapisz",Settings:"Ustawienia",noShiftsAvailable:"Brak dostępnych zmian",unassignedPool:"Nieprzypisani",searchOperators:"Szukaj operatorów",department:"Wydział",allDepartments:"Wszystkie wydziały",refreshInterval:"Interwał odświeżania",filters:"Filtry",advanced:"Zaawansowane"}}},O=function(e,t){return e.find(function(e){return e.name===t})},w=function(e){var n=h.default(),r=n.format("YYYY-MM-DD"),o=t.normalizeShifts(e,n),i=t.getCurrentShift(n,o);if(i){var a=O(e,i.name);if(a)return{date:r,shift:a}}var s=o.find(function(e){return e.startedAt.isAfter(n)});if(s){var l=O(e,s.name);if(l)return{date:r,shift:l}}var c=h.default(n).add(1,"day").startOf("day"),d=t.normalizeShifts(e,c);if(d.length>0){var u=O(e,d[0].name);if(u)return{date:c.format("YYYY-MM-DD"),shift:u}}return null},_=function(e,t,n){var r=h.default().format("YYYY-MM-DD"),o=h.default().add(14,"day").format("YYYY-MM-DD"),i=t.findIndex(function(t){return t.id===e.shift.id});return"next"===n?i<t.length-1||h.default(e.date).add(1,"day").format("YYYY-MM-DD")<=o:i>0?e.date>=r:h.default(e.date).subtract(1,"day").format("YYYY-MM-DD")>=r},I="1.0.2",S=function(t){var n,r=t.data,s=t.formProps,l=e.useState("1"),c=l[0],d=l[1],u=o.useTranslation().t;return g.default.createElement(i.TabContext,{value:c},g.default.createElement(a.Box,{sx:{borderBottom:1,borderColor:"divider"}},g.default.createElement(i.TabList,{onChange:function(e,t){d(t)}},g.default.createElement(a.Tab,{label:u("filters"),value:"1"}),g.default.createElement(a.Tab,{label:u("advanced"),value:"2"}))),g.default.createElement(i.TabPanel,{value:"1"},g.default.createElement(a.FormControl,{fullWidth:!0},g.default.createElement(a.InputLabel,{id:"department-label"},u("department")),g.default.createElement(a.Select,{name:"departmentId",labelId:"department-label",variant:"outlined",value:null!=(n=s.values.departmentId)?n:"",onChange:s.handleChange,fullWidth:!0},g.default.createElement(a.MenuItem,{value:""},u("allDepartments")),r.departments.map(function(e){return g.default.createElement(a.MenuItem,{key:e.id,value:e.id},e.name)})))),g.default.createElement(i.TabPanel,{value:"2"},g.default.createElement(a.FormControl,{fullWidth:!0},g.default.createElement(a.InputLabel,{id:"refresh-interval-label"},u("refreshInterval")),g.default.createElement(a.Select,{name:"refreshInterval",labelId:"refresh-interval-label",variant:"outlined",value:s.values.refreshInterval,onChange:s.handleChange,fullWidth:!0},g.default.createElement(a.MenuItem,{value:15},"15s"),g.default.createElement(a.MenuItem,{value:30},"30s"),g.default.createElement(a.MenuItem,{value:60},"60s")))))};function C(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var A=/* @__PURE__ */(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),V=()=>Math.random().toString(36).substring(7).split("").join("."),P={INIT:`@@redux/INIT${V()}`,REPLACE:`@@redux/REPLACE${V()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${V()}`};function T(e){let t=typeof e;return"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&(t=function(e){if(void 0===e)return"undefined";if(null===e)return"null";const t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(function(e){return e instanceof Date||"function"==typeof e.toDateString&&"function"==typeof e.getDate&&"function"==typeof e.setDate}(e))return"date";if(function(e){return e instanceof Error||"string"==typeof e.message&&e.constructor&&"number"==typeof e.constructor.stackTraceLimit}(e))return"error";const n=function(e){return"function"==typeof e.constructor?e.constructor.name:null}(e);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return Object.prototype.toString.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"")}(e)),t}function R(e,t,n){if("function"!=typeof e)throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?C(2):`Expected the root reducer to be a function. Instead, received: '${T(e)}'`);if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?C(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?C(1):`Expected the enhancer to be a function. Instead, received: '${T(n)}'`);return n(R)(e,t)}let r=e,o=t,i=/* @__PURE__ */new Map,a=i,s=0,l=!1;function c(){a===i&&(a=/* @__PURE__ */new Map,i.forEach((e,t)=>{a.set(t,e)}))}function d(){if(l)throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?C(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return o}function u(e){if("function"!=typeof e)throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?C(4):`Expected the listener to be a function. Instead, received: '${T(e)}'`);if(l)throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?C(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");let t=!0;c();const n=s++;return a.set(n,e),function(){if(t){if(l)throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?C(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");t=!1,c(),a.delete(n),i=null}}}function p(e){if(!function(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}(e))throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?C(7):`Actions must be plain objects. Instead, the actual type was: '${T(e)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);if(void 0===e.type)throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?C(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if("string"!=typeof e.type)throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?C(17):`Action "type" property must be a string. Instead, the actual type was: '${T(e.type)}'. Value was: '${e.type}' (stringified)`);if(l)throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?C(9):"Reducers may not dispatch actions.");try{l=!0,o=r(o,e)}finally{l=!1}return(i=a).forEach(e=>{e()}),e}return p({type:P.INIT}),{dispatch:p,subscribe:u,getState:d,replaceReducer:function(e){if("function"!=typeof e)throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?C(10):`Expected the nextReducer to be a function. Instead, received: '${T(e)}`);r=e,p({type:P.REPLACE})},[A]:function(){const e=u;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?C(11):`Expected the observer to be an object. Instead, received: '${T(t)}'`);function n(){t.next&&t.next(d())}return n(),{unsubscribe:e(n)}},[A](){return this}}}}}function $(e,t){return function(...n){return t(e.apply(this,n))}}function B(e,t){if("function"==typeof e)return $(e,t);if("object"!=typeof e||null===e)throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?C(16):`bindActionCreators expected an object or a function, but instead received: '${T(e)}'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?`);const n={};for(const r in e){const o=e[r];"function"==typeof o&&(n[r]=$(o,t))}return n}function k(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce((e,t)=>(...n)=>e(t(...n)))}function F(e){var t={exports:{}};return e(t,t.exports),t.exports}var M="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},L=g.default.useSyncExternalStore,j=g.default.useRef,G=g.default.useEffect,U=g.default.useMemo,W=g.default.useDebugValue,q={useSyncExternalStoreWithSelector:function(e,t,n,r,o){var i=j(null);if(null===i.current){var a={hasValue:!1,value:null};i.current=a}else a=i.current;i=U(function(){function e(e){if(!l){if(l=!0,i=e,e=r(e),void 0!==o&&a.hasValue){var t=a.value;if(o(t,e))return s=t}return s=e}if(t=s,M(i,e))return t;var n=r(e);return void 0!==o&&o(t,n)?(i=e,t):(i=e,s=n)}var i,s,l=!1,c=void 0===n?null:n;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]},[t,n,r,o]);var s=L(e,i[0],i[1]);return G(function(){a.hasValue=!0,a.value=s},[s]),W(s),s}},z=F(function(e,t){"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var e=g.default,n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=e.useSyncExternalStore,o=e.useRef,i=e.useEffect,a=e.useMemo,s=e.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,l,c,d){var u=o(null);if(null===u.current){var p={hasValue:!1,value:null};u.current=p}else p=u.current;u=a(function(){function e(e){if(!i){if(i=!0,r=e,e=c(e),void 0!==d&&p.hasValue){var t=p.value;if(d(t,e))return o=t}return o=e}if(t=o,n(r,e))return t;var a=c(e);return void 0!==d&&d(t,a)?(r=e,t):(r=e,o=a)}var r,o,i=!1,a=void 0===l?null:l;return[function(){return e(t())},null===a?void 0:function(){return e(a())}]},[t,l,c,d]);var f=r(e,u[0],u[1]);return i(function(){p.hasValue=!0,p.value=f},[f]),s(f),f},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()});F(function(e){e.exports="production"==='{NODE_ENV:"production"}'.NODE_ENV?q:z});var H=/* @__PURE__ */m.version.startsWith("19"),Y=/* @__PURE__ */Symbol.for(H?"react.transitional.element":"react.element"),Z=/* @__PURE__ */Symbol.for("react.portal"),X=/* @__PURE__ */Symbol.for("react.fragment"),K=/* @__PURE__ */Symbol.for("react.strict_mode"),J=/* @__PURE__ */Symbol.for("react.profiler"),Q=/* @__PURE__ */Symbol.for("react.consumer"),ee=/* @__PURE__ */Symbol.for("react.context"),te=/* @__PURE__ */Symbol.for("react.forward_ref"),ne=/* @__PURE__ */Symbol.for("react.suspense"),re=/* @__PURE__ */Symbol.for("react.suspense_list"),oe=/* @__PURE__ */Symbol.for("react.memo"),ie=/* @__PURE__ */Symbol.for("react.lazy"),ae=/* @__PURE__ */Symbol.for("react.offscreen"),se=/* @__PURE__ */Symbol.for("react.client.reference"),le=te,ce=oe;function de(e){return"string"==typeof e||"function"==typeof e||e===X||e===J||e===K||e===ne||e===re||e===ae||"object"==typeof e&&null!==e&&(e.$$typeof===ie||e.$$typeof===oe||e.$$typeof===ee||e.$$typeof===Q||e.$$typeof===te||e.$$typeof===se||void 0!==e.getModuleId)}function ue(e){if("object"==typeof e&&null!==e){const{$$typeof:t}=e;switch(t){case Y:switch(e=e.type){case X:case J:case K:case ne:case re:return e;default:switch(e=e&&e.$$typeof){case ee:case te:case ie:case oe:case Q:return e;default:return t}}case Z:return t}}}function pe(e){return H?ue(e)===Q:ue(e)===ee}function fe(e){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e);try{throw new Error(e)}catch(e){}}function ge(e,t){if(!e)throw new Error(`Unexpected value for ${t} in connect.`);"mapStateToProps"!==t&&"mapDispatchToProps"!==t||Object.prototype.hasOwnProperty.call(e,"dependsOnOwnProps")||fe(`The selector for ${t} of connect did not specify a value for dependsOnOwnProps.`)}function me(e,t,n){(function(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);if(null===t)return!0;let n=t;for(;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return t===n})(e)||fe(`${n}() in ${t} must return a plain object. Instead received ${e}.`)}function he(e){return function(t){const n=e(t);function r(){return n}return r.dependsOnOwnProps=!1,r}}function be(e){return e.dependsOnOwnProps?Boolean(e.dependsOnOwnProps):1!==e.length}function Ee(e,t){return function(n,{displayName:r}){const o=function(e,t){return o.mapToProps(e,o.dependsOnOwnProps?t:void 0)};return o.dependsOnOwnProps=!0,o.mapToProps=function(n,i){o.mapToProps=e,o.dependsOnOwnProps=be(e);let a=o(n,i);return"function"==typeof a&&(o.mapToProps=a,o.dependsOnOwnProps=be(a),a=o(n,i)),"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&me(a,r,t),a},o}}function ve(e,t){return(n,r)=>{throw new Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${r.wrappedComponentName}.`)}}function ye(e,t,n){return{...n,...e,...t}}var Ne={notify(){},get:()=>[]};function De(e,t){let n,r=Ne,o=0,i=!1;function a(){c.onStateChange&&c.onStateChange()}function s(){o++,n||(n=t?t.addNestedSub(a):e.subscribe(a),r=function(){let e=null,t=null;return{clear(){e=null,t=null},notify(){(()=>{let t=e;for(;t;)t.callback(),t=t.next})()},get(){const t=[];let n=e;for(;n;)t.push(n),n=n.next;return t},subscribe(n){let r=!0;const o=t={callback:n,next:null,prev:t};return o.prev?o.prev.next=o:e=o,function(){r&&null!==e&&(r=!1,o.next?o.next.prev=o.prev:t=o.prev,o.prev?o.prev.next=o.next:e=o.next)}}}}())}function l(){o--,n&&0===o&&(n(),n=void 0,r.clear(),r=Ne)}const c={addNestedSub:function(e){s();const t=r.subscribe(e);let n=!1;return()=>{n||(n=!0,t(),l())}},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:a,isSubscribed:function(){return i},trySubscribe:function(){i||(i=!0,s())},tryUnsubscribe:function(){i&&(i=!1,l())},getListeners:()=>r};return c}var xe=/* @__PURE__ */(()=>!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement))(),Oe=/* @__PURE__ */(()=>"undefined"!=typeof navigator&&"ReactNative"===navigator.product)(),we=/* @__PURE__ */(()=>xe||Oe?m.useLayoutEffect:m.useEffect)();function _e(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function Ie(e,t){if(_e(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!_e(e[n[r]],t[n[r]]))return!1;return!0}var Se={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Ce={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Ae={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Ve={[le]:{$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},[ce]:Ae};function Pe(e){return function(e){return ue(e)===oe}(e)?Ae:Ve[e.$$typeof]||Se}var Te=Object.defineProperty,Re=Object.getOwnPropertyNames,$e=Object.getOwnPropertySymbols,Be=Object.getOwnPropertyDescriptor,ke=Object.getPrototypeOf,Fe=Object.prototype;function Me(e,t){if("string"!=typeof t){if(Fe){const n=ke(t);n&&n!==Fe&&Me(e,n)}let n=Re(t);$e&&(n=n.concat($e(t)));const r=Pe(e),o=Pe(t);for(let i=0;i<n.length;++i){const a=n[i];if(!(Ce[a]||o&&o[a]||r&&r[a])){const n=Be(t,a);try{Te(e,a,n)}catch(e){}}}}return e}var Le=/* @__PURE__ */Symbol.for("react-redux-context"),je="undefined"!=typeof globalThis?globalThis:{};function Ge(){if(!m.createContext)return{};const e=je[Le]??=/* @__PURE__ */new Map;let t=e.get(m.createContext);return t||(t=m.createContext(null),"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&(t.displayName="ReactRedux"),e.set(m.createContext,t)),t}var Ue=/* @__PURE__ */Ge(),We=[null,null];function qe(e,t,n,r,o,i){e.current=r,n.current=!1,o.current&&(o.current=null,i())}function ze(e,t){return e===t}var He=!1,Ye=function(e,t,n,{pure:r,areStatesEqual:o=ze,areOwnPropsEqual:i=Ie,areStatePropsEqual:a=Ie,areMergedPropsEqual:s=Ie,forwardRef:l=!1,context:c=Ue}={}){"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&(void 0===r||He||(He=!0,fe('The `pure` option has been removed. `connect` is now always a "pure/memoized" component')));const d=c,u=function(e){return e?"function"==typeof e?Ee(e,"mapStateToProps"):ve(e,"mapStateToProps"):he(()=>({}))}(e),p=function(e){return e&&"object"==typeof e?he(t=>function(e,t){const n={};for(const r in e){const o=e[r];"function"==typeof o&&(n[r]=(...e)=>t(o(...e)))}return n}(e,t)):e?"function"==typeof e?Ee(e,"mapDispatchToProps"):ve(e,"mapDispatchToProps"):he(e=>({dispatch:e}))}(t),f=function(e){return e?"function"==typeof e?function(e){return function(t,{displayName:n,areMergedPropsEqual:r}){let o,i=!1;return function(t,a,s){const l=e(t,a,s);return i?r(l,o)||(o=l):(i=!0,o=l,"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&me(o,n,"mergeProps")),o}}}(e):ve(e,"mergeProps"):()=>ye}(n),g=Boolean(e);return e=>{if("production"!=='{NODE_ENV:"production"}'.NODE_ENV&&!/* @__PURE__ */de(e))throw new Error(`You must pass a component to the function returned by connect. Instead received ${(e=>{try{return JSON.stringify(e)}catch(t){return String(e)}})(e)}`);const t=e.displayName||e.name||"Component",n=`Connect(${t})`,r={shouldHandleStateChanges:g,displayName:n,wrappedComponentName:t,WrappedComponent:e,initMapStateToProps:u,initMapDispatchToProps:p,initMergeProps:f,areStatesEqual:o,areStatePropsEqual:a,areOwnPropsEqual:i,areMergedPropsEqual:s};function c(t){const[o,i,a]=m.useMemo(()=>{const{reactReduxForwardedRef:e,...n}=t;return[t.context,e,n]},[t]),s=m.useMemo(()=>{let e=d;if(o?.Consumer&&"production"!=='{NODE_ENV:"production"}'.NODE_ENV){if(!/* @__PURE__ */pe(
|
|
1
|
+
var e=require("react"),t=require("andoncloud-dashboard-toolkit"),n=require("andoncloud-widget-base"),r=require("dayjs"),o=require("react-i18next"),i=require("@mui/lab"),a=require("@mui/material"),s=require("react-dom"),l=require("@mui/icons-material/Search"),c=require("@mui/icons-material/Close"),d=require("@mui/icons-material/ChevronLeft"),u=require("@mui/icons-material/ChevronRight");function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function f(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,t}var g=/*#__PURE__*/p(e),m=/*#__PURE__*/f(e),h=/*#__PURE__*/p(r),b=/*#__PURE__*/p(s),E=/*#__PURE__*/p(l),v=/*#__PURE__*/p(c),y=/*#__PURE__*/p(d),N=/*#__PURE__*/p(u);function D(){return D=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},D.apply(null,arguments)}var x={en:{translation:{Loading:"Loading","Choose workplace":"Choose workplace",Cancel:"Cancel",Save:"Save",Settings:"Settings",noShiftsAvailable:"No shifts available",unassignedPool:"Unassigned",searchOperators:"Search operators",department:"Department",allDepartments:"All departments",refreshInterval:"Refresh interval",filters:"Filters",advanced:"Advanced"}},pl:{translation:{Loading:"Wczytywanie","Choose workplace":"Wybierz stanowisko",Cancel:"Anuluj",Save:"Zapisz",Settings:"Ustawienia",noShiftsAvailable:"Brak dostępnych zmian",unassignedPool:"Nieprzypisani",searchOperators:"Szukaj operatorów",department:"Wydział",allDepartments:"Wszystkie wydziały",refreshInterval:"Interwał odświeżania",filters:"Filtry",advanced:"Zaawansowane"}}},O=function(e){return[].concat(e).sort(function(e,t){return e.startedAt.localeCompare(t.startedAt)})},w=function(e,t){return e.find(function(e){return e.name===t})},_=function(e){var n=O(e),r=h.default(),o=r.format("YYYY-MM-DD"),i=t.normalizeShifts(n,r),a=t.getCurrentShift(r,i);if(a){var s=w(n,a.name);if(s)return{date:o,shift:s}}var l=i.find(function(e){return e.startedAt.isAfter(r)});if(l){var c=w(n,l.name);if(c)return{date:o,shift:c}}var d=h.default(r).add(1,"day").startOf("day"),u=t.normalizeShifts(n,d);if(u.length>0){var p=w(n,u[0].name);if(p)return{date:d.format("YYYY-MM-DD"),shift:p}}return null},I=function(e,t,n){var r=O(t),o=h.default().format("YYYY-MM-DD"),i=h.default().add(14,"day").format("YYYY-MM-DD"),a=r.findIndex(function(t){return t.id===e.shift.id});return"next"===n?a<r.length-1||h.default(e.date).add(1,"day").format("YYYY-MM-DD")<=i:a>0?e.date>=o:h.default(e.date).subtract(1,"day").format("YYYY-MM-DD")>=o},S="1.0.3",C=function(t){var n,r=t.data,s=t.formProps,l=e.useState("1"),c=l[0],d=l[1],u=o.useTranslation().t;return g.default.createElement(i.TabContext,{value:c},g.default.createElement(a.Box,{sx:{borderBottom:1,borderColor:"divider"}},g.default.createElement(i.TabList,{onChange:function(e,t){d(t)}},g.default.createElement(a.Tab,{label:u("filters"),value:"1"}),g.default.createElement(a.Tab,{label:u("advanced"),value:"2"}))),g.default.createElement(i.TabPanel,{value:"1"},g.default.createElement(a.FormControl,{fullWidth:!0},g.default.createElement(a.InputLabel,{id:"department-label"},u("department")),g.default.createElement(a.Select,{name:"departmentId",labelId:"department-label",variant:"outlined",value:null!=(n=s.values.departmentId)?n:"",onChange:s.handleChange,fullWidth:!0},g.default.createElement(a.MenuItem,{value:""},u("allDepartments")),r.departments.map(function(e){return g.default.createElement(a.MenuItem,{key:e.id,value:e.id},e.name)})))),g.default.createElement(i.TabPanel,{value:"2"},g.default.createElement(a.FormControl,{fullWidth:!0},g.default.createElement(a.InputLabel,{id:"refresh-interval-label"},u("refreshInterval")),g.default.createElement(a.Select,{name:"refreshInterval",labelId:"refresh-interval-label",variant:"outlined",value:s.values.refreshInterval,onChange:s.handleChange,fullWidth:!0},g.default.createElement(a.MenuItem,{value:15},"15s"),g.default.createElement(a.MenuItem,{value:30},"30s"),g.default.createElement(a.MenuItem,{value:60},"60s")))))};function A(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var V=/* @__PURE__ */(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),P=()=>Math.random().toString(36).substring(7).split("").join("."),T={INIT:`@@redux/INIT${P()}`,REPLACE:`@@redux/REPLACE${P()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${P()}`};function R(e){let t=typeof e;return"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&(t=function(e){if(void 0===e)return"undefined";if(null===e)return"null";const t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(function(e){return e instanceof Date||"function"==typeof e.toDateString&&"function"==typeof e.getDate&&"function"==typeof e.setDate}(e))return"date";if(function(e){return e instanceof Error||"string"==typeof e.message&&e.constructor&&"number"==typeof e.constructor.stackTraceLimit}(e))return"error";const n=function(e){return"function"==typeof e.constructor?e.constructor.name:null}(e);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return Object.prototype.toString.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"")}(e)),t}function $(e,t,n){if("function"!=typeof e)throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?A(2):`Expected the root reducer to be a function. Instead, received: '${R(e)}'`);if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?A(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?A(1):`Expected the enhancer to be a function. Instead, received: '${R(n)}'`);return n($)(e,t)}let r=e,o=t,i=/* @__PURE__ */new Map,a=i,s=0,l=!1;function c(){a===i&&(a=/* @__PURE__ */new Map,i.forEach((e,t)=>{a.set(t,e)}))}function d(){if(l)throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?A(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return o}function u(e){if("function"!=typeof e)throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?A(4):`Expected the listener to be a function. Instead, received: '${R(e)}'`);if(l)throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?A(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");let t=!0;c();const n=s++;return a.set(n,e),function(){if(t){if(l)throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?A(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");t=!1,c(),a.delete(n),i=null}}}function p(e){if(!function(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}(e))throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?A(7):`Actions must be plain objects. Instead, the actual type was: '${R(e)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);if(void 0===e.type)throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?A(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if("string"!=typeof e.type)throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?A(17):`Action "type" property must be a string. Instead, the actual type was: '${R(e.type)}'. Value was: '${e.type}' (stringified)`);if(l)throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?A(9):"Reducers may not dispatch actions.");try{l=!0,o=r(o,e)}finally{l=!1}return(i=a).forEach(e=>{e()}),e}return p({type:T.INIT}),{dispatch:p,subscribe:u,getState:d,replaceReducer:function(e){if("function"!=typeof e)throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?A(10):`Expected the nextReducer to be a function. Instead, received: '${R(e)}`);r=e,p({type:T.REPLACE})},[V]:function(){const e=u;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?A(11):`Expected the observer to be an object. Instead, received: '${R(t)}'`);function n(){t.next&&t.next(d())}return n(),{unsubscribe:e(n)}},[V](){return this}}}}}function B(e,t){return function(...n){return t(e.apply(this,n))}}function k(e,t){if("function"==typeof e)return B(e,t);if("object"!=typeof e||null===e)throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?A(16):`bindActionCreators expected an object or a function, but instead received: '${R(e)}'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?`);const n={};for(const r in e){const o=e[r];"function"==typeof o&&(n[r]=B(o,t))}return n}function F(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce((e,t)=>(...n)=>e(t(...n)))}function M(e){var t={exports:{}};return e(t,t.exports),t.exports}var L="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},j=g.default.useSyncExternalStore,G=g.default.useRef,U=g.default.useEffect,W=g.default.useMemo,q=g.default.useDebugValue,z={useSyncExternalStoreWithSelector:function(e,t,n,r,o){var i=G(null);if(null===i.current){var a={hasValue:!1,value:null};i.current=a}else a=i.current;i=W(function(){function e(e){if(!l){if(l=!0,i=e,e=r(e),void 0!==o&&a.hasValue){var t=a.value;if(o(t,e))return s=t}return s=e}if(t=s,L(i,e))return t;var n=r(e);return void 0!==o&&o(t,n)?(i=e,t):(i=e,s=n)}var i,s,l=!1,c=void 0===n?null:n;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]},[t,n,r,o]);var s=j(e,i[0],i[1]);return U(function(){a.hasValue=!0,a.value=s},[s]),q(s),s}},H=M(function(e,t){"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var e=g.default,n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=e.useSyncExternalStore,o=e.useRef,i=e.useEffect,a=e.useMemo,s=e.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,l,c,d){var u=o(null);if(null===u.current){var p={hasValue:!1,value:null};u.current=p}else p=u.current;u=a(function(){function e(e){if(!i){if(i=!0,r=e,e=c(e),void 0!==d&&p.hasValue){var t=p.value;if(d(t,e))return o=t}return o=e}if(t=o,n(r,e))return t;var a=c(e);return void 0!==d&&d(t,a)?(r=e,t):(r=e,o=a)}var r,o,i=!1,a=void 0===l?null:l;return[function(){return e(t())},null===a?void 0:function(){return e(a())}]},[t,l,c,d]);var f=r(e,u[0],u[1]);return i(function(){p.hasValue=!0,p.value=f},[f]),s(f),f},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()});M(function(e){e.exports="production"==='{NODE_ENV:"production"}'.NODE_ENV?z:H});var Y=/* @__PURE__ */m.version.startsWith("19"),Z=/* @__PURE__ */Symbol.for(Y?"react.transitional.element":"react.element"),X=/* @__PURE__ */Symbol.for("react.portal"),K=/* @__PURE__ */Symbol.for("react.fragment"),J=/* @__PURE__ */Symbol.for("react.strict_mode"),Q=/* @__PURE__ */Symbol.for("react.profiler"),ee=/* @__PURE__ */Symbol.for("react.consumer"),te=/* @__PURE__ */Symbol.for("react.context"),ne=/* @__PURE__ */Symbol.for("react.forward_ref"),re=/* @__PURE__ */Symbol.for("react.suspense"),oe=/* @__PURE__ */Symbol.for("react.suspense_list"),ie=/* @__PURE__ */Symbol.for("react.memo"),ae=/* @__PURE__ */Symbol.for("react.lazy"),se=/* @__PURE__ */Symbol.for("react.offscreen"),le=/* @__PURE__ */Symbol.for("react.client.reference"),ce=ne,de=ie;function ue(e){return"string"==typeof e||"function"==typeof e||e===K||e===Q||e===J||e===re||e===oe||e===se||"object"==typeof e&&null!==e&&(e.$$typeof===ae||e.$$typeof===ie||e.$$typeof===te||e.$$typeof===ee||e.$$typeof===ne||e.$$typeof===le||void 0!==e.getModuleId)}function pe(e){if("object"==typeof e&&null!==e){const{$$typeof:t}=e;switch(t){case Z:switch(e=e.type){case K:case Q:case J:case re:case oe:return e;default:switch(e=e&&e.$$typeof){case te:case ne:case ae:case ie:case ee:return e;default:return t}}case X:return t}}}function fe(e){return Y?pe(e)===ee:pe(e)===te}function ge(e){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e);try{throw new Error(e)}catch(e){}}function me(e,t){if(!e)throw new Error(`Unexpected value for ${t} in connect.`);"mapStateToProps"!==t&&"mapDispatchToProps"!==t||Object.prototype.hasOwnProperty.call(e,"dependsOnOwnProps")||ge(`The selector for ${t} of connect did not specify a value for dependsOnOwnProps.`)}function he(e,t,n){(function(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);if(null===t)return!0;let n=t;for(;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return t===n})(e)||ge(`${n}() in ${t} must return a plain object. Instead received ${e}.`)}function be(e){return function(t){const n=e(t);function r(){return n}return r.dependsOnOwnProps=!1,r}}function Ee(e){return e.dependsOnOwnProps?Boolean(e.dependsOnOwnProps):1!==e.length}function ve(e,t){return function(n,{displayName:r}){const o=function(e,t){return o.mapToProps(e,o.dependsOnOwnProps?t:void 0)};return o.dependsOnOwnProps=!0,o.mapToProps=function(n,i){o.mapToProps=e,o.dependsOnOwnProps=Ee(e);let a=o(n,i);return"function"==typeof a&&(o.mapToProps=a,o.dependsOnOwnProps=Ee(a),a=o(n,i)),"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&he(a,r,t),a},o}}function ye(e,t){return(n,r)=>{throw new Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${r.wrappedComponentName}.`)}}function Ne(e,t,n){return{...n,...e,...t}}var De={notify(){},get:()=>[]};function xe(e,t){let n,r=De,o=0,i=!1;function a(){c.onStateChange&&c.onStateChange()}function s(){o++,n||(n=t?t.addNestedSub(a):e.subscribe(a),r=function(){let e=null,t=null;return{clear(){e=null,t=null},notify(){(()=>{let t=e;for(;t;)t.callback(),t=t.next})()},get(){const t=[];let n=e;for(;n;)t.push(n),n=n.next;return t},subscribe(n){let r=!0;const o=t={callback:n,next:null,prev:t};return o.prev?o.prev.next=o:e=o,function(){r&&null!==e&&(r=!1,o.next?o.next.prev=o.prev:t=o.prev,o.prev?o.prev.next=o.next:e=o.next)}}}}())}function l(){o--,n&&0===o&&(n(),n=void 0,r.clear(),r=De)}const c={addNestedSub:function(e){s();const t=r.subscribe(e);let n=!1;return()=>{n||(n=!0,t(),l())}},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:a,isSubscribed:function(){return i},trySubscribe:function(){i||(i=!0,s())},tryUnsubscribe:function(){i&&(i=!1,l())},getListeners:()=>r};return c}var Oe=/* @__PURE__ */(()=>!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement))(),we=/* @__PURE__ */(()=>"undefined"!=typeof navigator&&"ReactNative"===navigator.product)(),_e=/* @__PURE__ */(()=>Oe||we?m.useLayoutEffect:m.useEffect)();function Ie(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function Se(e,t){if(Ie(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Ie(e[n[r]],t[n[r]]))return!1;return!0}var Ce={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Ae={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Ve={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Pe={[ce]:{$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},[de]:Ve};function Te(e){return function(e){return pe(e)===ie}(e)?Ve:Pe[e.$$typeof]||Ce}var Re=Object.defineProperty,$e=Object.getOwnPropertyNames,Be=Object.getOwnPropertySymbols,ke=Object.getOwnPropertyDescriptor,Fe=Object.getPrototypeOf,Me=Object.prototype;function Le(e,t){if("string"!=typeof t){if(Me){const n=Fe(t);n&&n!==Me&&Le(e,n)}let n=$e(t);Be&&(n=n.concat(Be(t)));const r=Te(e),o=Te(t);for(let i=0;i<n.length;++i){const a=n[i];if(!(Ae[a]||o&&o[a]||r&&r[a])){const n=ke(t,a);try{Re(e,a,n)}catch(e){}}}}return e}var je=/* @__PURE__ */Symbol.for("react-redux-context"),Ge="undefined"!=typeof globalThis?globalThis:{};function Ue(){if(!m.createContext)return{};const e=Ge[je]??=/* @__PURE__ */new Map;let t=e.get(m.createContext);return t||(t=m.createContext(null),"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&(t.displayName="ReactRedux"),e.set(m.createContext,t)),t}var We=/* @__PURE__ */Ue(),qe=[null,null];function ze(e,t,n,r,o,i){e.current=r,n.current=!1,o.current&&(o.current=null,i())}function He(e,t){return e===t}var Ye=!1,Ze=function(e,t,n,{pure:r,areStatesEqual:o=He,areOwnPropsEqual:i=Se,areStatePropsEqual:a=Se,areMergedPropsEqual:s=Se,forwardRef:l=!1,context:c=We}={}){"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&(void 0===r||Ye||(Ye=!0,ge('The `pure` option has been removed. `connect` is now always a "pure/memoized" component')));const d=c,u=function(e){return e?"function"==typeof e?ve(e,"mapStateToProps"):ye(e,"mapStateToProps"):be(()=>({}))}(e),p=function(e){return e&&"object"==typeof e?be(t=>function(e,t){const n={};for(const r in e){const o=e[r];"function"==typeof o&&(n[r]=(...e)=>t(o(...e)))}return n}(e,t)):e?"function"==typeof e?ve(e,"mapDispatchToProps"):ye(e,"mapDispatchToProps"):be(e=>({dispatch:e}))}(t),f=function(e){return e?"function"==typeof e?function(e){return function(t,{displayName:n,areMergedPropsEqual:r}){let o,i=!1;return function(t,a,s){const l=e(t,a,s);return i?r(l,o)||(o=l):(i=!0,o=l,"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&he(o,n,"mergeProps")),o}}}(e):ye(e,"mergeProps"):()=>Ne}(n),g=Boolean(e);return e=>{if("production"!=='{NODE_ENV:"production"}'.NODE_ENV&&!/* @__PURE__ */ue(e))throw new Error(`You must pass a component to the function returned by connect. Instead received ${(e=>{try{return JSON.stringify(e)}catch(t){return String(e)}})(e)}`);const t=e.displayName||e.name||"Component",n=`Connect(${t})`,r={shouldHandleStateChanges:g,displayName:n,wrappedComponentName:t,WrappedComponent:e,initMapStateToProps:u,initMapDispatchToProps:p,initMergeProps:f,areStatesEqual:o,areStatePropsEqual:a,areOwnPropsEqual:i,areMergedPropsEqual:s};function c(t){const[o,i,a]=m.useMemo(()=>{const{reactReduxForwardedRef:e,...n}=t;return[t.context,e,n]},[t]),s=m.useMemo(()=>{let e=d;if(o?.Consumer&&"production"!=='{NODE_ENV:"production"}'.NODE_ENV){if(!/* @__PURE__ */fe(
|
|
2
2
|
/* @__PURE__ */
|
|
3
|
-
m.createElement(o.Consumer,null)))throw new Error("You must pass a valid React context consumer as `props.context`");e=o}return e},[o,d]),l=m.useContext(s),c=Boolean(t.store)&&Boolean(t.store.getState)&&Boolean(t.store.dispatch),u=Boolean(l)&&Boolean(l.store);if("production"!=='{NODE_ENV:"production"}'.NODE_ENV&&!c&&!u)throw new Error(`Could not find "store" in the context of "${n}". Either wrap the root component in a <Provider>, or pass a custom React context provider to <Provider> and the corresponding React context consumer to ${n} in connect options.`);const p=c?t.store:l.store,f=u?l.getServerState:p.getState,h=m.useMemo(()=>function(e,{initMapStateToProps:t,initMapDispatchToProps:n,initMergeProps:r,...o}){const i=t(e,o),a=n(e,o),s=r(e,o);return"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&function(e,t,n){
|
|
3
|
+
m.createElement(o.Consumer,null)))throw new Error("You must pass a valid React context consumer as `props.context`");e=o}return e},[o,d]),l=m.useContext(s),c=Boolean(t.store)&&Boolean(t.store.getState)&&Boolean(t.store.dispatch),u=Boolean(l)&&Boolean(l.store);if("production"!=='{NODE_ENV:"production"}'.NODE_ENV&&!c&&!u)throw new Error(`Could not find "store" in the context of "${n}". Either wrap the root component in a <Provider>, or pass a custom React context provider to <Provider> and the corresponding React context consumer to ${n} in connect options.`);const p=c?t.store:l.store,f=u?l.getServerState:p.getState,h=m.useMemo(()=>function(e,{initMapStateToProps:t,initMapDispatchToProps:n,initMergeProps:r,...o}){const i=t(e,o),a=n(e,o),s=r(e,o);return"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&function(e,t,n){me(e,"mapStateToProps"),me(t,"mapDispatchToProps"),me(n,"mergeProps")}(i,a,s),function(e,t,n,r,{areStatesEqual:o,areOwnPropsEqual:i,areStatePropsEqual:a}){let s,l,c,d,u,p=!1;return function(f,g){return p?function(p,f){const g=!i(f,l),m=!o(p,s,f,l);return s=p,l=f,g&&m?(c=e(s,l),t.dependsOnOwnProps&&(d=t(r,l)),u=n(c,d,l),u):g?(e.dependsOnOwnProps&&(c=e(s,l)),t.dependsOnOwnProps&&(d=t(r,l)),u=n(c,d,l),u):m?function(){const t=e(s,l),r=!a(t,c);return c=t,r&&(u=n(c,d,l)),u}():u}(f,g):(s=f,l=g,c=e(s,l),d=t(r,l),u=n(c,d,l),p=!0,u)}}(i,a,s,e,o)}(p.dispatch,r),[p]),[b,E]=m.useMemo(()=>{if(!g)return qe;const e=xe(p,c?void 0:l.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]},[p,c,l]),v=m.useMemo(()=>c?l:{...l,subscription:b},[c,l,b]),y=m.useRef(void 0),N=m.useRef(a),D=m.useRef(void 0),x=m.useRef(!1),O=m.useRef(!1),w=m.useRef(void 0);_e(()=>(O.current=!0,()=>{O.current=!1}),[]);const _=m.useMemo(()=>()=>D.current&&a===N.current?D.current:h(p.getState(),a),[p,a]),I=m.useMemo(()=>e=>b?function(e,t,n,r,o,i,a,s,l,c,d){if(!e)return()=>{};let u=!1,p=null;const f=()=>{if(u||!s.current)return;const e=t.getState();let n,f;try{n=r(e,o.current)}catch(e){f=e,p=e}f||(p=null),n===i.current?a.current||c():(i.current=n,l.current=n,a.current=!0,d())};return n.onStateChange=f,n.trySubscribe(),f(),()=>{if(u=!0,n.tryUnsubscribe(),n.onStateChange=null,p)throw p}}(g,p,b,h,N,y,x,O,D,E,e):()=>{},[b]);var S,C;let A;S=ze,C=[N,y,x,a,D,E],_e(()=>S(...C),void 0);try{A=m.useSyncExternalStore(I,_,f?()=>h(f(),a):_)}catch(e){throw w.current&&(e.message+=`\nThe error may be correlated with this previous error:\n${w.current.stack}\n\n`),e}_e(()=>{w.current=void 0,D.current=void 0,y.current=A});const V=m.useMemo(()=>
|
|
4
4
|
/* @__PURE__ */m.createElement(e,{...A,ref:i}),[i,e,A]);return m.useMemo(()=>g?/* @__PURE__ */m.createElement(s.Provider,{value:v},V):V,[s,V,v])}const h=m.memo(c);if(h.WrappedComponent=e,h.displayName=c.displayName=n,l){const t=m.forwardRef(function(e,t){/* @__PURE__ */
|
|
5
|
-
return m.createElement(h,{...e,reactReduxForwardedRef:t})});return t.displayName=n,t.WrappedComponent=e,/* @__PURE__ */
|
|
6
|
-
return
|
|
7
|
-
return Object.assign(n,{stabilityCheck:r,identityFunctionCheck:t})}},[o,r]),a=m.useMemo(()=>o.getState(),[o]);return we(()=>{const{subscription:e}=i;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),a!==o.getState()&&e.notifyNestedSubs(),()=>{e.tryUnsubscribe(),e.onStateChange=void 0}},[i,a]),/* @__PURE__ */m.createElement((n||Ue).Provider,{value:i},t)},Xe="production"==='{NODE_ENV:"production"}'.NODE_ENV,Ke="Invariant failed";function Je(e,t){if(!e){if(Xe)throw new Error(Ke);var n="function"==typeof t?t():t,r=n?"".concat(Ke,": ").concat(n):Ke;throw new Error(r)}}var Qe=function(e){var t=e.top,n=e.right,r=e.bottom,o=e.left;return{top:t,right:n,bottom:r,left:o,width:n-o,height:r-t,x:o,y:t,center:{x:(n+o)/2,y:(r+t)/2}}},et=function(e,t){return{top:e.top-t.top,left:e.left-t.left,bottom:e.bottom+t.bottom,right:e.right+t.right}},tt=function(e,t){return{top:e.top+t.top,left:e.left+t.left,bottom:e.bottom-t.bottom,right:e.right-t.right}},nt={top:0,right:0,bottom:0,left:0},rt=function(e){var t=e.borderBox,n=e.margin,r=void 0===n?nt:n,o=e.border,i=void 0===o?nt:o,a=e.padding,s=void 0===a?nt:a,l=Qe(et(t,r)),c=Qe(tt(t,i)),d=Qe(tt(c,s));return{marginBox:l,borderBox:Qe(t),paddingBox:c,contentBox:d,margin:r,border:i,padding:s}},ot=function(e){var t=e.slice(0,-2);if("px"!==e.slice(-2))return 0;var n=Number(t);return isNaN(n)&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Je(!1,"Could not parse value [raw: "+e+", without suffix: "+t+"]"):Je(!1)),n},it=function(e,t){var n,r,o={top:(n=e.borderBox).top+(r=t).y,left:n.left+r.x,bottom:n.bottom+r.y,right:n.right+r.x};return rt({borderBox:o,border:e.border,margin:e.margin,padding:e.padding})},at=function(e,t){return void 0===t&&(t={x:window.pageXOffset,y:window.pageYOffset}),it(e,t)},st=function(e,t){var n={top:ot(t.marginTop),right:ot(t.marginRight),bottom:ot(t.marginBottom),left:ot(t.marginLeft)},r={top:ot(t.paddingTop),right:ot(t.paddingRight),bottom:ot(t.paddingBottom),left:ot(t.paddingLeft)},o={top:ot(t.borderTopWidth),right:ot(t.borderRightWidth),bottom:ot(t.borderBottomWidth),left:ot(t.borderLeftWidth)};return rt({borderBox:e,margin:n,padding:r,border:o})},lt=function(e){var t=e.getBoundingClientRect(),n=window.getComputedStyle(e);return st(t,n)},ct=function(e){var t=[],n=null,r=function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];t=o,n||(n=requestAnimationFrame(function(){n=null,e.apply(void 0,t)}))};return r.cancel=function(){n&&(cancelAnimationFrame(n),n=null)},r};function dt(){return dt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},dt.apply(null,arguments)}const ut="production"==='{NODE_ENV:"production"}'.NODE_ENV,pt=/[ \t]{2,}/g,ft=/^[ \t]*/gm,gt=e=>e.replace(pt," ").replace(ft,"").trim(),mt=e=>gt(`\n %c@hello-pangea/dnd\n\n %c${gt(e)}\n\n %c👷 This is a development only message. It will be removed in production builds.\n`);function ht(e,t){ut||"undefined"!=typeof window&&window["__@hello-pangea/dnd-disable-dev-warnings"]||console[e](...(e=>[mt(e),"color: #00C584; font-size: 1.2em; font-weight: bold;","line-height: 1.5","color: #723874;"])(t))}const bt=ht.bind(null,"warn"),Et=ht.bind(null,"error");function vt(){}function yt(e,t,n){const r=t.map(t=>{const r=function(e,t){return{...e,...t}}(n,t.options);return e.addEventListener(t.eventName,t.fn,r),function(){e.removeEventListener(t.eventName,t.fn,r)}});return function(){r.forEach(e=>{e()})}}const Nt="production"==='{NODE_ENV:"production"}'.NODE_ENV,Dt="Invariant failed";class xt extends Error{}function Ot(e,t){throw new xt(Nt?Dt:`${Dt}: ${t||""}`)}xt.prototype.toString=function(){return this.message};class wt extends g.default.Component{constructor(...e){super(...e),this.callbacks=null,this.unbind=vt,this.onWindowError=e=>{const t=this.getCallbacks();t.isDragging()&&(t.tryAbort(),"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&bt("\n An error was caught by our window 'error' event listener while a drag was occurring.\n The active drag has been aborted.\n "));const n=e.error;n instanceof xt&&(e.preventDefault(),"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&Et(n.message))},this.getCallbacks=()=>{if(!this.callbacks)throw new Error("Unable to find AppCallbacks in <ErrorBoundary/>");return this.callbacks},this.setCallbacks=e=>{this.callbacks=e}}componentDidMount(){this.unbind=yt(window,[{eventName:"error",fn:this.onWindowError}])}componentDidCatch(e){if(e instanceof xt)return"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&Et(e.message),void this.setState({});throw e}componentWillUnmount(){this.unbind()}render(){return this.props.children(this.setCallbacks)}}const _t=e=>e+1,It=(e,t)=>{const n=e.droppableId===t.droppableId,r=_t(e.index),o=_t(t.index);return n?`\n You have moved the item from position ${r}\n to position ${o}\n `:`\n You have moved the item from position ${r}\n in list ${e.droppableId}\n to list ${t.droppableId}\n in position ${o}\n `},St=(e,t,n)=>t.droppableId===n.droppableId?`\n The item ${e}\n has been combined with ${n.draggableId}`:`\n The item ${e}\n in list ${t.droppableId}\n has been combined with ${n.draggableId}\n in list ${n.droppableId}\n `,Ct=e=>`\n The item has returned to its starting position\n of ${_t(e.index)}\n`,At=e=>`\n You have lifted an item in position ${_t(e.source.index)}\n`,Vt=e=>{const t=e.destination;if(t)return It(e.source,t);const n=e.combine;return n?St(e.draggableId,e.source,n):"You are over an area that cannot be dropped on"},Pt=e=>{if("CANCEL"===e.reason)return`\n Movement cancelled.\n ${Ct(e.source)}\n `;const t=e.destination,n=e.combine;return t?`\n You have dropped the item.\n ${It(e.source,t)}\n `:n?`\n You have dropped the item.\n ${St(e.draggableId,e.source,n)}\n `:`\n The item has been dropped while not over a drop area.\n ${Ct(e.source)}\n `};function Tt(e,t){return e===t||!(!Number.isNaN(e)||!Number.isNaN(t))}function Rt(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Tt(e[n],t[n]))return!1;return!0}function $t(t,n){const r=e.useState(()=>({inputs:n,result:t()}))[0],o=e.useRef(!0),i=e.useRef(r),a=o.current||Boolean(n&&i.current.inputs&&Rt(n,i.current.inputs))?i.current:{inputs:n,result:t()};return e.useEffect(()=>{o.current=!1,i.current=a},[a]),a.result}function Bt(e,t){return $t(()=>e,t)}const kt={x:0,y:0},Ft=(e,t)=>({x:e.x+t.x,y:e.y+t.y}),Mt=(e,t)=>({x:e.x-t.x,y:e.y-t.y}),Lt=(e,t)=>e.x===t.x&&e.y===t.y,jt=e=>({x:0!==e.x?-e.x:0,y:0!==e.y?-e.y:0}),Gt=(e,t,n=0)=>"x"===e?{x:t,y:n}:{x:n,y:t},Ut=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2),Wt=(e,t)=>Math.min(...t.map(t=>Ut(e,t))),qt=e=>t=>({x:e(t.x),y:e(t.y)}),zt=(e,t)=>({top:e.top+t.y,left:e.left+t.x,bottom:e.bottom+t.y,right:e.right+t.x}),Ht=e=>[{x:e.left,y:e.top},{x:e.right,y:e.top},{x:e.left,y:e.bottom},{x:e.right,y:e.bottom}],Yt=(e,t)=>t&&t.shouldClipSubject?((e,t)=>{const n=Qe({top:Math.max(t.top,e.top),right:Math.min(t.right,e.right),bottom:Math.min(t.bottom,e.bottom),left:Math.max(t.left,e.left)});return n.width<=0||n.height<=0?null:n})(t.pageMarginBox,e):Qe(e);var Zt=({page:e,withPlaceholder:t,axis:n,frame:r})=>{const o=((e,t)=>t?zt(e,t.scroll.diff.displacement):e)(e.marginBox,r),i=((e,t,n)=>n&&n.increasedBy?{...e,[t.end]:e[t.end]+n.increasedBy[t.line]}:e)(o,n,t);return{page:e,withPlaceholder:t,active:Yt(i,r)}},Xt=(e,t)=>{e.frame||Ot();const n=e.frame,r=Mt(t,n.scroll.initial),o=jt(r),i={...n,scroll:{initial:n.scroll.initial,current:t,diff:{value:r,displacement:o},max:n.scroll.max}},a=Zt({page:e.subject.page,withPlaceholder:e.subject.withPlaceholder,axis:e.axis,frame:i});return{...e,frame:i,subject:a}};function Kt(e,t=Rt){let n=null;function r(...r){if(n&&n.lastThis===this&&t(r,n.lastArgs))return n.lastResult;const o=e.apply(this,r);return n={lastResult:o,lastArgs:r,lastThis:this},o}return r.clear=function(){n=null},r}const Jt=Kt(e=>e.reduce((e,t)=>(e[t.descriptor.id]=t,e),{})),Qt=Kt(e=>e.reduce((e,t)=>(e[t.descriptor.id]=t,e),{})),en=Kt(e=>Object.values(e)),tn=Kt(e=>Object.values(e));var nn=Kt((e,t)=>{const n=tn(t).filter(t=>e===t.descriptor.droppableId).sort((e,t)=>e.descriptor.index-t.descriptor.index);return n});function rn(e){return e.at&&"REORDER"===e.at.type?e.at.destination:null}function on(e){return e.at&&"COMBINE"===e.at.type?e.at.combine:null}var an=Kt((e,t)=>t.filter(t=>t.descriptor.id!==e.descriptor.id)),sn=(e,t)=>e.descriptor.droppableId===t.descriptor.id;const ln={point:kt,value:0},cn={invisible:{},visible:{},all:[]},dn={displaced:cn,displacedBy:ln,at:null};var un=(e,t)=>n=>e<=n&&n<=t,pn=e=>{const t=un(e.top,e.bottom),n=un(e.left,e.right);return r=>{if(t(r.top)&&t(r.bottom)&&n(r.left)&&n(r.right))return!0;const o=t(r.top)||t(r.bottom),i=n(r.left)||n(r.right);if(o&&i)return!0;const a=r.top<e.top&&r.bottom>e.bottom,s=r.left<e.left&&r.right>e.right;return!(!a||!s)||a&&i||s&&o}},fn=e=>{const t=un(e.top,e.bottom),n=un(e.left,e.right);return e=>t(e.top)&&t(e.bottom)&&n(e.left)&&n(e.right)};const gn={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},mn={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"},hn=({target:e,destination:t,viewport:n,withDroppableDisplacement:r,isVisibleThroughFrameFn:o})=>{const i=r?((e,t)=>zt(e,t.frame?t.frame.scroll.diff.displacement:kt))(e,t):e;return((e,t,n)=>!!t.subject.active&&n(t.subject.active)(e))(i,t,o)&&((e,t,n)=>n(t)(e))(i,n,o)},bn=e=>hn({...e,isVisibleThroughFrameFn:fn});function En({afterDragging:e,destination:t,displacedBy:n,viewport:r,forceShouldAnimate:o,last:i}){return e.reduce(function(e,a){const s=function(e,t){return Qe(et(e.page.marginBox,{top:t.point.y,right:0,bottom:0,left:t.point.x}))}(a,n),l=a.descriptor.id;var c;if(e.all.push(l),c={target:s,destination:t,viewport:r,withDroppableDisplacement:!0},!hn({...c,isVisibleThroughFrameFn:pn}))return e.invisible[a.descriptor.id]=!0,e;const d=((e,t,n)=>{if("boolean"==typeof n)return n;if(!t)return!0;const{invisible:r,visible:o}=t;if(r[e])return!1;const i=o[e];return!i||i.shouldAnimate})(l,i,o);return e.visible[l]={draggableId:l,shouldAnimate:d},e},{all:[],visible:{},invisible:{}})}function vn({insideDestination:e,inHomeList:t,displacedBy:n,destination:r}){const o=function(e,t){if(!e.length)return 0;const n=e[e.length-1].descriptor.index;return t.inHomeList?n:n+1}(e,{inHomeList:t});return{displaced:cn,displacedBy:n,at:{type:"REORDER",destination:{droppableId:r.descriptor.id,index:o}}}}function yn({draggable:e,insideDestination:t,destination:n,viewport:r,displacedBy:o,last:i,index:a,forceShouldAnimate:s}){const l=sn(e,n);if(null==a)return vn({insideDestination:t,inHomeList:l,displacedBy:o,destination:n});const c=t.find(e=>e.descriptor.index===a);if(!c)return vn({insideDestination:t,inHomeList:l,displacedBy:o,destination:n});const d=an(e,t),u=t.indexOf(c);return{displaced:En({afterDragging:d.slice(u),destination:n,displacedBy:o,last:i,viewport:r.frame,forceShouldAnimate:s}),displacedBy:o,at:{type:"REORDER",destination:{droppableId:n.descriptor.id,index:a}}}}function Nn(e,t){return Boolean(t.effected[e])}const Dn=(e,t)=>t.margin[e.start]+t.borderBox[e.size]/2,xn=(e,t,n)=>t[e.crossAxisStart]+n.margin[e.crossAxisStart]+n.borderBox[e.crossAxisSize]/2,On=({axis:e,moveRelativeTo:t,isMoving:n})=>Gt(e.line,t.marginBox[e.end]+Dn(e,n),xn(e,t.marginBox,n)),wn=({axis:e,moveRelativeTo:t,isMoving:n})=>Gt(e.line,t.marginBox[e.start]-((e,t)=>t.margin[e.end]+t.borderBox[e.size]/2)(e,n),xn(e,t.marginBox,n));var _n=(e,t)=>{const n=e.frame;return n?Ft(t,n.scroll.diff.displacement):t},In=e=>{const t=(({impact:e,draggable:t,droppable:n,draggables:r,afterCritical:o})=>{const i=t.page.borderBox.center,a=e.at;return n&&a?"REORDER"===a.type?(({impact:e,draggable:t,draggables:n,droppable:r,afterCritical:o})=>{const i=nn(r.descriptor.id,n),a=t.page,s=r.axis;if(!i.length)return(({axis:e,moveInto:t,isMoving:n})=>Gt(e.line,t.contentBox[e.start]+Dn(e,n),xn(e,t.contentBox,n)))({axis:s,moveInto:r.page,isMoving:a});const{displaced:l,displacedBy:c}=e,d=l.all[0];if(d){const e=n[d];if(Nn(d,o))return wn({axis:s,moveRelativeTo:e.page,isMoving:a});const t=it(e.page,c.point);return wn({axis:s,moveRelativeTo:t,isMoving:a})}const u=i[i.length-1];if(u.descriptor.id===t.descriptor.id)return a.borderBox.center;if(Nn(u.descriptor.id,o)){const e=it(u.page,jt(o.displacedBy.point));return On({axis:s,moveRelativeTo:e,isMoving:a})}return On({axis:s,moveRelativeTo:u.page,isMoving:a})})({impact:e,draggable:t,draggables:r,droppable:n,afterCritical:o}):(({afterCritical:e,impact:t,draggables:n})=>{const r=on(t);r||Ot();const o=r.draggableId,i=n[o].page.borderBox.center,a=(({displaced:e,afterCritical:t,combineWith:n,displacedBy:r})=>{const o=Boolean(e.visible[n]||e.invisible[n]);return Nn(n,t)?o?kt:jt(r.point):o?r.point:kt})({displaced:t.displaced,afterCritical:e,combineWith:o,displacedBy:t.displacedBy});return Ft(i,a)})({impact:e,draggables:r,afterCritical:o}):i})(e),n=e.droppable;return n?_n(n,t):t},Sn=(e,t)=>{const n=Mt(t,e.scroll.initial),r=jt(n);return{frame:Qe({top:t.y,bottom:t.y+e.frame.height,left:t.x,right:t.x+e.frame.width}),scroll:{initial:e.scroll.initial,max:e.scroll.max,current:t,diff:{value:n,displacement:r}}}};function Cn(e,t){return e.map(e=>t[e])}var An=({pageBorderBoxCenter:e,draggable:t,viewport:n})=>{const r=((e,t)=>Ft(e.scroll.diff.displacement,t))(n,e),o=Mt(r,t.page.borderBox.center);return Ft(t.client.borderBox.center,o)},Vn=({draggable:e,destination:t,newPageBorderBoxCenter:n,viewport:r,withDroppableDisplacement:o,onlyOnMainAxis:i=!1})=>{const a=Mt(n,e.page.borderBox.center),s={target:zt(e.page.borderBox,a),destination:t,withDroppableDisplacement:o,viewport:r};return i?(e=>{return hn({...e,isVisibleThroughFrameFn:(t=e.destination.axis,e=>{const n=un(e.top,e.bottom),r=un(e.left,e.right);return e=>t===gn?n(e.top)&&n(e.bottom):r(e.left)&&r(e.right)})});var t})(s):bn(s)};const Pn=e=>{const t=e.subject.active;return t||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Cannot get clipped area from droppable"):Ot()),t},Tn=(e,t)=>{const n=e.page.borderBox.center;return Nn(e.descriptor.id,t)?Mt(n,t.displacedBy.point):n},Rn=(e,t)=>{const n=e.page.borderBox;return Nn(e.descriptor.id,t)?zt(n,jt(t.displacedBy.point)):n};var $n=Kt(function(e,t){const n=t[e.line];return{value:n,point:Gt(e.line,n)}});const Bn=(e,t)=>({...e,scroll:{...e.scroll,max:t}}),kn=(e,t,n)=>{const r=e.frame;sn(t,e)&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Should not add placeholder space to home list"):Ot()),e.subject.withPlaceholder&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Cannot add placeholder size to a subject when it already has one"):Ot());const o=$n(e.axis,t.displaceBy).point,i=((e,t,n)=>{const r=e.axis;if("virtual"===e.descriptor.mode)return Gt(r.line,t[r.line]);const o=e.subject.page.contentBox[r.size],i=nn(e.descriptor.id,n).reduce((e,t)=>e+t.client.marginBox[r.size],0)+t[r.line]-o;return i<=0?null:Gt(r.line,i)})(e,o,n),a={placeholderSize:o,increasedBy:i,oldFrameMaxScroll:e.frame?e.frame.scroll.max:null};if(!r){const t=Zt({page:e.subject.page,withPlaceholder:a,axis:e.axis,frame:e.frame});return{...e,subject:t}}const s=i?Ft(r.scroll.max,i):r.scroll.max,l=Bn(r,s),c=Zt({page:e.subject.page,withPlaceholder:a,axis:e.axis,frame:l});return{...e,subject:c,frame:l}};var Fn=e=>{const t=e.at;return t?"REORDER"===t.type?t.destination.droppableId:t.combine.droppableId:null};function Mn(e){return"DRAGGING"===e.phase||"COLLECTING"===e.phase}function Ln(e){const t=un(e.top,e.bottom),n=un(e.left,e.right);return function(e){return t(e.y)&&n(e.x)}}const jn=(e,t)=>Qe(zt(e,t));function Gn({displaced:e,id:t}){return Boolean(e.visible[t]||e.invisible[t])}var Un=({pageOffset:e,draggable:t,draggables:n,droppables:r,previousImpact:o,viewport:i,afterCritical:a})=>{const s=jn(t.page.borderBox,e),l=function({pageBorderBox:e,draggable:t,droppables:n}){const r=en(n).filter(t=>{if(!t.isEnabled)return!1;const n=t.subject.active;if(!n)return!1;if(!((r=e).left<(o=n).right&&r.right>o.left&&r.top<o.bottom&&r.bottom>o.top))return!1;var r,o;if(Ln(n)(e.center))return!0;const i=t.axis,a=n.center[i.crossAxisLine],s=e[i.crossAxisStart],l=e[i.crossAxisEnd],c=un(n[i.crossAxisStart],n[i.crossAxisEnd]),d=c(s),u=c(l);return!d&&!u||(d?s<a:l>a)});return r.length?1===r.length?r[0].descriptor.id:function({pageBorderBox:e,draggable:t,candidates:n}){const r=t.page.borderBox.center,o=n.map(t=>{const n=t.axis,o=Gt(t.axis.line,e.center[n.line],t.page.borderBox.center[n.crossAxisLine]);return{id:t.descriptor.id,distance:Ut(r,o)}}).sort((e,t)=>t.distance-e.distance);return o[0]?o[0].id:null}({pageBorderBox:e,draggable:t,candidates:r}):null}({pageBorderBox:s,draggable:t,droppables:r});if(!l)return dn;const c=r[l],d=nn(c.descriptor.id,n),u=((e,t)=>{const n=e.frame;return n?jn(t,n.scroll.diff.value):t})(c,s);return(({draggable:e,pageBorderBoxWithDroppableScroll:t,previousImpact:n,destination:r,insideDestination:o,afterCritical:i})=>{if(!r.isCombineEnabled)return null;const a=r.axis,s=$n(r.axis,e.displaceBy),l=s.value,c=t[a.start],d=t[a.end],u=an(e,o).find(e=>{const t=e.descriptor.id,r=e.page.borderBox,o=r[a.size]/4,s=Nn(t,i),u=Gn({displaced:n.displaced,id:t});return s?u?d>r[a.start]+o&&d<r[a.end]-o:c>r[a.start]-l+o&&c<r[a.end]-l-o:u?d>r[a.start]+l+o&&d<r[a.end]+l-o:c>r[a.start]+o&&c<r[a.end]-o});return u?{displacedBy:s,displaced:n.displaced,at:{type:"COMBINE",combine:{draggableId:u.descriptor.id,droppableId:r.descriptor.id}}}:null})({pageBorderBoxWithDroppableScroll:u,draggable:t,previousImpact:o,destination:c,insideDestination:d,afterCritical:a})||(({pageBorderBoxWithDroppableScroll:e,draggable:t,destination:n,insideDestination:r,last:o,viewport:i,afterCritical:a})=>{const s=n.axis,l=$n(n.axis,t.displaceBy),c=l.value,d=e[s.start],u=e[s.end],p=function({draggable:e,closest:t,inHomeList:n}){return t?n&&t.descriptor.index>e.descriptor.index?t.descriptor.index-1:t.descriptor.index:null}({draggable:t,closest:an(t,r).find(e=>{const t=e.descriptor.id,n=e.page.borderBox.center[s.line],r=Nn(t,a),i=Gn({displaced:o,id:t});return r?i?u<=n:d<n-c:i?u<=n+c:d<n})||null,inHomeList:sn(t,n)});return yn({draggable:t,insideDestination:r,destination:n,viewport:i,last:o,displacedBy:l,index:p})})({pageBorderBoxWithDroppableScroll:u,draggable:t,destination:c,insideDestination:d,last:o.displaced,viewport:i,afterCritical:a})},Wn=(e,t)=>({...e,[t.descriptor.id]:t}),qn=({state:e,clientSelection:t,dimensions:n,viewport:r,impact:o,scrollJumpRequest:i})=>{const a=r||e.viewport,s=n||e.dimensions,l=t||e.current.client.selection,c=Mt(l,e.initial.client.selection),d={offset:c,selection:l,borderBoxCenter:Ft(e.initial.client.borderBoxCenter,c)},u={selection:Ft(d.selection,a.scroll.current),borderBoxCenter:Ft(d.borderBoxCenter,a.scroll.current),offset:Ft(d.offset,a.scroll.diff.value)},p={client:d,page:u};if("COLLECTING"===e.phase)return{...e,dimensions:s,viewport:a,current:p};const f=s.draggables[e.critical.draggable.id],g=o||Un({pageOffset:u.offset,draggable:f,draggables:s.draggables,droppables:s.droppables,previousImpact:e.impact,viewport:a,afterCritical:e.afterCritical}),m=(({draggable:e,draggables:t,droppables:n,previousImpact:r,impact:o})=>{const i=(({previousImpact:e,impact:t,droppables:n})=>{const r=Fn(e),o=Fn(t);if(!r)return n;if(r===o)return n;const i=n[r];if(!i.subject.withPlaceholder)return n;const a=(e=>{const t=e.subject.withPlaceholder;t||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Cannot remove placeholder form subject when there was none"):Ot());const n=e.frame;if(!n){const t=Zt({page:e.subject.page,axis:e.axis,frame:null,withPlaceholder:null});return{...e,subject:t}}const r=t.oldFrameMaxScroll;r||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Expected droppable with frame to have old max frame scroll when removing placeholder"):Ot());const o=Bn(n,r),i=Zt({page:e.subject.page,axis:e.axis,frame:o,withPlaceholder:null});return{...e,subject:i,frame:o}})(i);return Wn(n,a)})({previousImpact:r,impact:o,droppables:n}),a=Fn(o);if(!a)return i;const s=n[a];if(sn(e,s))return i;if(s.subject.withPlaceholder)return i;const l=kn(s,e,t);return Wn(i,l)})({draggable:f,impact:g,previousImpact:e.impact,draggables:s.draggables,droppables:s.droppables});return{...e,current:p,dimensions:{draggables:s.draggables,droppables:m},impact:g,viewport:a,scrollJumpRequest:i||null,forceShouldAnimate:!i&&null}},zn=({impact:e,viewport:t,draggables:n,destination:r,forceShouldAnimate:o})=>{const i=e.displaced,a=function(e,t){return e.map(e=>t[e])}(i.all,n),s=En({afterDragging:a,destination:r,displacedBy:e.displacedBy,viewport:t.frame,forceShouldAnimate:o,last:i});return{...e,displaced:s}},Hn=({impact:e,draggable:t,droppable:n,draggables:r,viewport:o,afterCritical:i})=>{const a=In({impact:e,draggable:t,draggables:r,droppable:n,afterCritical:i});return An({pageBorderBoxCenter:a,draggable:t,viewport:o})},Yn=({state:e,dimensions:t,viewport:n})=>{"SNAP"!==e.movementMode&&Ot();const r=e.impact,o=n||e.viewport,i=t||e.dimensions,{draggables:a,droppables:s}=i,l=a[e.critical.draggable.id],c=Fn(r);c||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Must be over a destination in SNAP movement mode"):Ot());const d=s[c],u=zn({impact:r,viewport:o,destination:d,draggables:a}),p=Hn({impact:u,draggable:l,droppable:d,draggables:a,viewport:o,afterCritical:e.afterCritical});return qn({impact:u,clientSelection:p,state:e,dimensions:i,viewport:o})},Zn=({draggable:e,home:t,draggables:n,viewport:r})=>{const o=$n(t.axis,e.displaceBy),i=nn(t.descriptor.id,n),a=i.indexOf(e);-1===a&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Expected draggable to be inside home list"):Ot());const s=i.slice(a+1),l=s.reduce((e,t)=>(e[t.descriptor.id]=!0,e),{}),c={inVirtualList:"virtual"===t.descriptor.mode,displacedBy:o,effected:l};var d;return{impact:{displaced:En({afterDragging:s,destination:t,displacedBy:o,last:null,viewport:r.frame,forceShouldAnimate:!1}),displacedBy:o,at:{type:"REORDER",destination:(d=e.descriptor,{index:d.index,droppableId:d.droppableId})}},afterCritical:c}};const Xn=e=>"SNAP"===e.movementMode,Kn=(e,t,n)=>{const r=((e,t)=>({draggables:e.draggables,droppables:Wn(e.droppables,t)}))(e.dimensions,t);return!Xn(e)||n?qn({state:e,dimensions:r}):Yn({state:e,dimensions:r})};function Jn(e){return e.isDragging&&"SNAP"===e.movementMode?{...e,scrollJumpRequest:null}:e}const Qn={phase:"IDLE",completed:null,shouldFlush:!1};var er=(e=Qn,t)=>{if("FLUSH"===t.type)return{...Qn,shouldFlush:!0};if("INITIAL_PUBLISH"===t.type){"IDLE"!==e.phase&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"INITIAL_PUBLISH must come after a IDLE phase"):Ot());const{critical:n,clientSelection:r,viewport:o,dimensions:i,movementMode:a}=t.payload,s=i.draggables[n.draggable.id],l=i.droppables[n.droppable.id],c={selection:r,borderBoxCenter:s.client.borderBox.center,offset:kt},d={client:c,page:{selection:Ft(c.selection,o.scroll.initial),borderBoxCenter:Ft(c.selection,o.scroll.initial),offset:Ft(c.selection,o.scroll.diff.value)}},u=en(i.droppables).every(e=>!e.isFixedOnPage),{impact:p,afterCritical:f}=Zn({draggable:s,home:l,draggables:i.draggables,viewport:o});return{phase:"DRAGGING",isDragging:!0,critical:n,movementMode:a,dimensions:i,initial:d,current:d,isWindowScrollAllowed:u,impact:p,afterCritical:f,onLiftImpact:p,viewport:o,scrollJumpRequest:null,forceShouldAnimate:null}}if("COLLECTION_STARTING"===t.type)return"COLLECTING"===e.phase||"DROP_PENDING"===e.phase?e:("DRAGGING"!==e.phase&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,`Collection cannot start from phase ${e.phase}`):Ot()),{...e,phase:"COLLECTING"});if("PUBLISH_WHILE_DRAGGING"===t.type)return"COLLECTING"!==e.phase&&"DROP_PENDING"!==e.phase&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,`Unexpected ${t.type} received in phase ${e.phase}`):Ot()),(({state:e,published:t})=>{const n=t.modified.map(t=>Xt(e.dimensions.droppables[t.droppableId],t.scroll)),r={...e.dimensions.droppables,...Jt(n)},o=Qt((({additions:e,updatedDroppables:t,viewport:n})=>{const r=n.scroll.diff.value;return e.map(e=>{const o=(e=>{const t=e.frame;return t||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Expected Droppable to have a frame"):Ot()),t})(t[e.descriptor.droppableId]),i=(({draggable:e,offset:t,initialWindowScroll:n})=>{const r=it(e.client,t),o=at(r,n);return{...e,placeholder:{...e.placeholder,client:r},client:r,page:o}})({draggable:e,offset:Ft(r,o.scroll.diff.value),initialWindowScroll:n.scroll.initial});return i})})({additions:t.additions,updatedDroppables:r,viewport:e.viewport})),i={...e.dimensions.draggables,...o};t.removals.forEach(e=>{delete i[e]});const a={droppables:r,draggables:i},s=Fn(e.impact),l=s?a.droppables[s]:null,c=a.draggables[e.critical.draggable.id],d=a.droppables[e.critical.droppable.id],{impact:u,afterCritical:p}=Zn({draggable:c,home:d,draggables:i,viewport:e.viewport}),f=Un({pageOffset:e.current.page.offset,draggable:a.draggables[e.critical.draggable.id],draggables:a.draggables,droppables:a.droppables,previousImpact:l&&l.isCombineEnabled?e.impact:u,viewport:e.viewport,afterCritical:p}),g={...e,phase:"DRAGGING",impact:f,onLiftImpact:u,dimensions:a,afterCritical:p,forceShouldAnimate:!1};return"COLLECTING"===e.phase?g:{...g,phase:"DROP_PENDING",reason:e.reason,isWaiting:!1}})({state:e,published:t.payload});if("MOVE"===t.type){if("DROP_PENDING"===e.phase)return e;Mn(e)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,`${t.type} not permitted in phase ${e.phase}`):Ot());const{client:n}=t.payload;return Lt(n,e.current.client.selection)?e:qn({state:e,clientSelection:n,impact:Xn(e)?e.impact:null})}if("UPDATE_DROPPABLE_SCROLL"===t.type){if("DROP_PENDING"===e.phase)return Jn(e);if("COLLECTING"===e.phase)return Jn(e);Mn(e)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,`${t.type} not permitted in phase ${e.phase}`):Ot());const{id:n,newScroll:r}=t.payload,o=e.dimensions.droppables[n];if(!o)return e;const i=Xt(o,r);return Kn(e,i,!1)}if("UPDATE_DROPPABLE_IS_ENABLED"===t.type){if("DROP_PENDING"===e.phase)return e;Mn(e)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,`Attempting to move in an unsupported phase ${e.phase}`):Ot());const{id:n,isEnabled:r}=t.payload,o=e.dimensions.droppables[n];o||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,`Cannot find Droppable[id: ${n}] to toggle its enabled state`):Ot()),o.isEnabled===r&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,`Trying to set droppable isEnabled to ${String(r)}\n but it is already ${String(o.isEnabled)}`):Ot());const i={...o,isEnabled:r};return Kn(e,i,!0)}if("UPDATE_DROPPABLE_IS_COMBINE_ENABLED"===t.type){if("DROP_PENDING"===e.phase)return e;Mn(e)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,`Attempting to move in an unsupported phase ${e.phase}`):Ot());const{id:n,isCombineEnabled:r}=t.payload,o=e.dimensions.droppables[n];o||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,`Cannot find Droppable[id: ${n}] to toggle its isCombineEnabled state`):Ot()),o.isCombineEnabled===r&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,`Trying to set droppable isCombineEnabled to ${String(r)}\n but it is already ${String(o.isCombineEnabled)}`):Ot());const i={...o,isCombineEnabled:r};return Kn(e,i,!0)}if("MOVE_BY_WINDOW_SCROLL"===t.type){if("DROP_PENDING"===e.phase||"DROP_ANIMATING"===e.phase)return e;Mn(e)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,`Cannot move by window in phase ${e.phase}`):Ot()),e.isWindowScrollAllowed||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Window scrolling is currently not supported for fixed lists"):Ot());const n=t.payload.newScroll;if(Lt(e.viewport.scroll.current,n))return Jn(e);const r=Sn(e.viewport,n);return Xn(e)?Yn({state:e,viewport:r}):qn({state:e,viewport:r})}if("UPDATE_VIEWPORT_MAX_SCROLL"===t.type){if(!Mn(e))return e;const n=t.payload.maxScroll;if(Lt(n,e.viewport.scroll.max))return e;const r={...e.viewport,scroll:{...e.viewport.scroll,max:n}};return{...e,viewport:r}}if("MOVE_UP"===t.type||"MOVE_DOWN"===t.type||"MOVE_LEFT"===t.type||"MOVE_RIGHT"===t.type){if("COLLECTING"===e.phase||"DROP_PENDING"===e.phase)return e;"DRAGGING"!==e.phase&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,`${t.type} received while not in DRAGGING phase`):Ot());const n=(({state:e,type:t})=>{const n=((e,t)=>{const n=Fn(e);return n?t[n]:null})(e.impact,e.dimensions.droppables),r=Boolean(n),o=n||e.dimensions.droppables[e.critical.droppable.id],i=o.axis.direction,a="vertical"===i&&("MOVE_UP"===t||"MOVE_DOWN"===t)||"horizontal"===i&&("MOVE_LEFT"===t||"MOVE_RIGHT"===t);if(a&&!r)return null;const s="MOVE_DOWN"===t||"MOVE_RIGHT"===t,l=e.dimensions.draggables[e.critical.draggable.id],c=e.current.page.borderBoxCenter,{draggables:d,droppables:u}=e.dimensions;return a?(({isMovingForward:e,draggable:t,destination:n,draggables:r,previousImpact:o,viewport:i,previousPageBorderBoxCenter:a,previousClientSelection:s,afterCritical:l})=>{if(!n.isEnabled)return null;const c=nn(n.descriptor.id,r),d=sn(t,n),u=(({isMovingForward:e,draggable:t,destination:n,insideDestination:r,previousImpact:o})=>{if(!n.isCombineEnabled)return null;if(!rn(o))return null;function i(e){const t={type:"COMBINE",combine:{draggableId:e,droppableId:n.descriptor.id}};return{...o,at:t}}const a=o.displaced.all,s=a.length?a[0]:null;if(e)return s?i(s):null;const l=an(t,r);if(!s)return l.length?i(l[l.length-1].descriptor.id):null;const c=l.findIndex(e=>e.descriptor.id===s);-1===c&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Could not find displaced item in set"):Ot());const d=c-1;return d<0?null:i(l[d].descriptor.id)})({isMovingForward:e,draggable:t,destination:n,insideDestination:c,previousImpact:o})||(({isMovingForward:e,isInHomeList:t,draggable:n,draggables:r,destination:o,insideDestination:i,previousImpact:a,viewport:s,afterCritical:l})=>{const c=a.at;if(c||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Cannot move in direction without previous impact location"):Ot()),"REORDER"===c.type){const r=(({isMovingForward:e,isInHomeList:t,insideDestination:n,location:r})=>{if(!n.length)return null;const o=r.index,i=e?o+1:o-1,a=n[n.length-1].descriptor.index;return i<n[0].descriptor.index||i>(t?a:a+1)?null:i})({isMovingForward:e,isInHomeList:t,location:c.destination,insideDestination:i});return null==r?null:yn({draggable:n,insideDestination:i,destination:o,viewport:s,last:a.displaced,displacedBy:a.displacedBy,index:r})}const d=(({isMovingForward:e,destination:t,draggables:n,combine:r,afterCritical:o})=>{if(!t.isCombineEnabled)return null;const i=r.draggableId,a=n[i].descriptor.index;return Nn(i,o)?e?a:a-1:e?a+1:a})({isMovingForward:e,destination:o,displaced:a.displaced,draggables:r,combine:c.combine,afterCritical:l});return null==d?null:yn({draggable:n,insideDestination:i,destination:o,viewport:s,last:a.displaced,displacedBy:a.displacedBy,index:d})})({isMovingForward:e,isInHomeList:d,draggable:t,draggables:r,destination:n,insideDestination:c,previousImpact:o,viewport:i,afterCritical:l});if(!u)return null;const p=In({impact:u,draggable:t,droppable:n,draggables:r,afterCritical:l});if(Vn({draggable:t,destination:n,newPageBorderBoxCenter:p,viewport:i.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0}))return{clientSelection:An({pageBorderBoxCenter:p,draggable:t,viewport:i}),impact:u,scrollJumpRequest:null};const f=Mt(p,a),g=(({impact:e,viewport:t,destination:n,draggables:r,maxScrollChange:o})=>{const i=Sn(t,Ft(t.scroll.current,o)),a=n.frame?Xt(n,Ft(n.frame.scroll.current,o)):n,s=e.displaced,l=En({afterDragging:Cn(s.all,r),destination:n,displacedBy:e.displacedBy,viewport:i.frame,last:s,forceShouldAnimate:!1}),c=En({afterDragging:Cn(s.all,r),destination:a,displacedBy:e.displacedBy,viewport:t.frame,last:s,forceShouldAnimate:!1}),d={},u={},p=[s,l,c];return s.all.forEach(e=>{const t=function(e,t){for(let n=0;n<t.length;n++){const r=t[n].visible[e];if(r)return r}return null}(e,p);t?u[e]=t:d[e]=!0}),{...e,displaced:{all:s.all,invisible:d,visible:u}}})({impact:u,viewport:i,destination:n,draggables:r,maxScrollChange:f});return{clientSelection:s,impact:g,scrollJumpRequest:f}})({isMovingForward:s,previousPageBorderBoxCenter:c,draggable:l,destination:o,draggables:d,viewport:e.viewport,previousClientSelection:e.current.client.selection,previousImpact:e.impact,afterCritical:e.afterCritical}):(({isMovingForward:e,previousPageBorderBoxCenter:t,draggable:n,isOver:r,draggables:o,droppables:i,viewport:a,afterCritical:s})=>{const l=(({isMovingForward:e,pageBorderBoxCenter:t,source:n,droppables:r,viewport:o})=>{const i=n.subject.active;if(!i)return null;const a=n.axis,s=un(i[a.start],i[a.end]),l=en(r).filter(e=>e!==n).filter(e=>e.isEnabled).filter(e=>Boolean(e.subject.active)).filter(e=>pn(o.frame)(Pn(e))).filter(t=>{const n=Pn(t);return e?i[a.crossAxisEnd]<n[a.crossAxisEnd]:n[a.crossAxisStart]<i[a.crossAxisStart]}).filter(e=>{const t=Pn(e),n=un(t[a.start],t[a.end]);return s(t[a.start])||s(t[a.end])||n(i[a.start])||n(i[a.end])}).sort((t,n)=>{const r=Pn(t)[a.crossAxisStart],o=Pn(n)[a.crossAxisStart];return e?r-o:o-r}).filter((e,t,n)=>Pn(e)[a.crossAxisStart]===Pn(n[0])[a.crossAxisStart]);if(!l.length)return null;if(1===l.length)return l[0];const c=l.filter(e=>un(Pn(e)[a.start],Pn(e)[a.end])(t[a.line]));return 1===c.length?c[0]:c.length>1?c.sort((e,t)=>Pn(e)[a.start]-Pn(t)[a.start])[0]:l.sort((e,n)=>{const r=Wt(t,Ht(Pn(e))),o=Wt(t,Ht(Pn(n)));return r!==o?r-o:Pn(e)[a.start]-Pn(n)[a.start]})[0]})({isMovingForward:e,pageBorderBoxCenter:t,source:r,droppables:i,viewport:a});if(!l)return null;const c=nn(l.descriptor.id,o),d=(({pageBorderBoxCenter:e,viewport:t,destination:n,insideDestination:r,afterCritical:o})=>{const i=r.filter(e=>bn({target:Rn(e,o),destination:n,viewport:t.frame,withDroppableDisplacement:!0})).sort((t,r)=>{const i=Ut(e,_n(n,Tn(t,o))),a=Ut(e,_n(n,Tn(r,o)));return i<a?-1:a<i?1:t.descriptor.index-r.descriptor.index});return i[0]||null})({pageBorderBoxCenter:t,viewport:a,destination:l,insideDestination:c,afterCritical:s}),u=(({previousPageBorderBoxCenter:e,moveRelativeTo:t,insideDestination:n,draggable:r,draggables:o,destination:i,viewport:a,afterCritical:s})=>{if(!t){if(n.length)return null;const e={displaced:cn,displacedBy:ln,at:{type:"REORDER",destination:{droppableId:i.descriptor.id,index:0}}},t=In({impact:e,draggable:r,droppable:i,draggables:o,afterCritical:s}),l=sn(r,i)?i:kn(i,r,o);return Vn({draggable:r,destination:l,newPageBorderBoxCenter:t,viewport:a.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0})?e:null}const l=Boolean(e[i.axis.line]<=t.page.borderBox.center[i.axis.line]),c=(()=>{const e=t.descriptor.index;return t.descriptor.id===r.descriptor.id||l?e:e+1})(),d=$n(i.axis,r.displaceBy);return yn({draggable:r,insideDestination:n,destination:i,viewport:a,displacedBy:d,last:cn,index:c})})({previousPageBorderBoxCenter:t,destination:l,draggable:n,draggables:o,moveRelativeTo:d,insideDestination:c,viewport:a,afterCritical:s});if(!u)return null;const p=In({impact:u,draggable:n,droppable:l,draggables:o,afterCritical:s});return{clientSelection:An({pageBorderBoxCenter:p,draggable:n,viewport:a}),impact:u,scrollJumpRequest:null}})({isMovingForward:s,previousPageBorderBoxCenter:c,draggable:l,isOver:o,draggables:d,droppables:u,viewport:e.viewport,afterCritical:e.afterCritical})})({state:e,type:t.type});return n?qn({state:e,impact:n.impact,clientSelection:n.clientSelection,scrollJumpRequest:n.scrollJumpRequest}):e}if("DROP_PENDING"===t.type){const n=t.payload.reason;return"COLLECTING"!==e.phase&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Can only move into the DROP_PENDING phase from the COLLECTING phase"):Ot()),{...e,phase:"DROP_PENDING",isWaiting:!0,reason:n}}if("DROP_ANIMATE"===t.type){const{completed:n,dropDuration:r,newHomeClientOffset:o}=t.payload;return"DRAGGING"!==e.phase&&"DROP_PENDING"!==e.phase&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,`Cannot animate drop from phase ${e.phase}`):Ot()),{phase:"DROP_ANIMATING",completed:n,dropDuration:r,newHomeClientOffset:o,dimensions:e.dimensions}}if("DROP_COMPLETE"===t.type){const{completed:e}=t.payload;return{phase:"IDLE",completed:e,shouldFlush:!1}}return e};function tr(e,t){return e instanceof Object&&"type"in e&&e.type===t}const nr=e=>({type:"PUBLISH_WHILE_DRAGGING",payload:e}),rr=()=>({type:"COLLECTION_STARTING",payload:null}),or=e=>({type:"UPDATE_DROPPABLE_SCROLL",payload:e}),ir=e=>({type:"UPDATE_DROPPABLE_IS_ENABLED",payload:e}),ar=e=>({type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:e}),sr=e=>({type:"MOVE",payload:e}),lr=()=>({type:"MOVE_UP",payload:null}),cr=()=>({type:"MOVE_DOWN",payload:null}),dr=()=>({type:"MOVE_RIGHT",payload:null}),ur=()=>({type:"MOVE_LEFT",payload:null}),pr=e=>({type:"DROP_COMPLETE",payload:e}),fr=e=>({type:"DROP",payload:e}),gr="cubic-bezier(.2,1,.1,1)",mr={outOfTheWay:.2,minDropTime:.33,maxDropTime:.55},hr=`${mr.outOfTheWay}s cubic-bezier(0.2, 0, 0, 1)`,br={fluid:`opacity ${hr}`,snap:`transform ${hr}, opacity ${hr}`,drop:e=>{const t=`${e}s ${gr}`;return`transform ${t}, opacity ${t}`},outOfTheWay:`transform ${hr}`,placeholder:`height ${hr}, width ${hr}, margin ${hr}`},Er=e=>Lt(e,kt)?void 0:`translate(${e.x}px, ${e.y}px)`,vr=Er,{minDropTime:yr,maxDropTime:Nr}=mr,Dr=Nr-yr,xr=({getState:e,dispatch:t})=>n=>r=>{if(!tr(r,"DROP"))return void n(r);const o=e(),i=r.payload.reason;if("COLLECTING"===o.phase)return void t((a={reason:i},{type:"DROP_PENDING",payload:a}));var a;if("IDLE"===o.phase)return;"DROP_PENDING"===o.phase&&o.isWaiting&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"A DROP action occurred while DROP_PENDING and still waiting"):Ot()),"DRAGGING"!==o.phase&&"DROP_PENDING"!==o.phase&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,`Cannot drop in phase: ${o.phase}`):Ot());const s=o.critical,l=o.dimensions,c=l.draggables[o.critical.draggable.id],{impact:d,didDropInsideDroppable:u}=(({draggables:e,reason:t,lastImpact:n,home:r,viewport:o,onLiftImpact:i})=>n.at&&"DROP"===t?"REORDER"===n.at.type?{impact:n,didDropInsideDroppable:!0}:{impact:{...n,displaced:cn},didDropInsideDroppable:!0}:{impact:zn({draggables:e,impact:i,destination:r,viewport:o,forceShouldAnimate:!0}),didDropInsideDroppable:!1})({reason:i,lastImpact:o.impact,afterCritical:o.afterCritical,onLiftImpact:o.onLiftImpact,home:o.dimensions.droppables[o.critical.droppable.id],viewport:o.viewport,draggables:o.dimensions.draggables}),p=u?rn(d):null,f=u?on(d):null,g={draggableId:c.descriptor.id,type:c.descriptor.type,source:{index:s.draggable.index,droppableId:s.droppable.id},reason:i,mode:o.movementMode,destination:p,combine:f},m=(({impact:e,draggable:t,dimensions:n,viewport:r,afterCritical:o})=>{const{draggables:i,droppables:a}=n,s=Fn(e),l=Hn({impact:e,draggable:t,draggables:i,afterCritical:o,droppable:(s?a[s]:null)||a[t.descriptor.droppableId],viewport:r});return Mt(l,t.client.borderBox.center)})({impact:d,draggable:c,dimensions:l,viewport:o.viewport,afterCritical:o.afterCritical}),h={critical:o.critical,afterCritical:o.afterCritical,result:g,impact:d};if(Lt(o.current.client.offset,m)&&!Boolean(g.combine))return void t(pr({completed:h}));const b=(({current:e,destination:t,reason:n})=>{const r=Ut(e,t);if(r<=0)return yr;if(r>=1500)return Nr;const o=yr+Dr*(r/1500);return Number(("CANCEL"===n?.6*o:o).toFixed(2))})({current:o.current.client.offset,destination:m,reason:i});t((e=>({type:"DROP_ANIMATE",payload:e}))({newHomeClientOffset:m,dropDuration:b,completed:h}))};var Or=()=>({x:window.pageXOffset,y:window.pageYOffset});const wr=e=>{const t=function({onWindowScroll:e}){const t=ct(function(){e(Or())}),n=function(e){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:t=>{t.target!==window&&t.target!==window.document||e()}}}(t);let r=vt;function o(){return r!==vt}return{start:function(){o()&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Cannot start scroll listener when already active"):Ot()),r=yt(window,[n])},stop:function(){o()||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Cannot stop scroll listener when not active"):Ot()),t.cancel(),r(),r=vt},isActive:o}}({onWindowScroll:t=>{e.dispatch({type:"MOVE_BY_WINDOW_SCROLL",payload:{newScroll:t}})}});return e=>n=>{!t.isActive()&&tr(n,"INITIAL_PUBLISH")&&t.start(),t.isActive()&&(e=>tr(e,"DROP_COMPLETE")||tr(e,"DROP_ANIMATE")||tr(e,"FLUSH"))(n)&&t.stop(),e(n)}},_r=(e,t)=>{t()},Ir=(e,t)=>({draggableId:e.draggable.id,type:e.droppable.type,source:{droppableId:e.droppable.id,index:e.draggable.index},mode:t});function Sr(e,t,n,r){if(!e)return void n(r(t));const o=(e=>{let t=!1,n=!1;const r=setTimeout(()=>{n=!0}),o=o=>{t?"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&bt("Announcement already made. Not making a second announcement"):n?"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&bt("\n Announcements cannot be made asynchronously.\n Default message has already been announced.\n "):(t=!0,e(o),clearTimeout(r))};return o.wasCalled=()=>t,o})(n);e(t,{announce:o}),o.wasCalled()||n(r(t))}const Cr=e=>t=>n=>{if(!tr(n,"DROP_ANIMATION_FINISHED"))return void t(n);const r=e.getState();"DROP_ANIMATING"!==r.phase&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Cannot finish a drop animating when no drop is occurring"):Ot()),e.dispatch(pr({completed:r.completed}))},Ar=e=>{let t=null,n=null;return r=>o=>{if((tr(o,"FLUSH")||tr(o,"DROP_COMPLETE")||tr(o,"DROP_ANIMATION_FINISHED"))&&(n&&(cancelAnimationFrame(n),n=null),t&&(t(),t=null)),r(o),!tr(o,"DROP_ANIMATE"))return;const i={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){"DROP_ANIMATING"===e.getState().phase&&e.dispatch({type:"DROP_ANIMATION_FINISHED",payload:null})}};n=requestAnimationFrame(()=>{n=null,t=yt(window,[i])})}},Vr=e=>t=>n=>{if(t(n),!tr(n,"PUBLISH_WHILE_DRAGGING"))return;const r=e.getState();"DROP_PENDING"===r.phase&&(r.isWaiting||e.dispatch(fr({reason:r.reason})))},Pr="production"!=='{NODE_ENV:"production"}'.NODE_ENV&&"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({name:"@hello-pangea/dnd"}):k;var Tr=({scrollHeight:e,scrollWidth:t,height:n,width:r})=>{const o=Mt({x:t,y:e},{x:r,y:n});return{x:Math.max(0,o.x),y:Math.max(0,o.y)}},Rr=()=>{const e=document.documentElement;return e||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Cannot find document.documentElement"):Ot()),e},$r=()=>{const e=Rr();return Tr({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,width:e.clientWidth,height:e.clientHeight})};function Br(e,t,n){return n.descriptor.id!==t.id&&n.descriptor.type===t.type&&("virtual"===e.droppable.getById(n.descriptor.droppableId).descriptor.mode||("production"!=='{NODE_ENV:"production"}'.NODE_ENV&&bt(`\n You are attempting to add or remove a Draggable [id: ${n.descriptor.id}]\n while a drag is occurring. This is only supported for virtual lists.\n\n See https://github.com/hello-pangea/dnd/blob/main/docs/patterns/virtual-lists.md\n `),!1))}var kr=(e,t)=>"IDLE"===e.phase||"DROP_ANIMATING"===e.phase&&e.completed.result.draggableId!==t&&"DROP"===e.completed.result.reason,Fr=e=>{window.scrollBy(e.x,e.y)};const Mr=Kt(e=>en(e).filter(e=>!!e.isEnabled&&!!e.frame)),Lr={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:e=>e**2,durationDampening:{stopDampeningAt:1200,accelerateAt:360},disabled:!1};var jr=({startOfRange:e,endOfRange:t,current:n})=>{const r=t-e;return 0===r?("production"!=='{NODE_ENV:"production"}'.NODE_ENV&&bt("\n Detected distance range of 0 in the fluid auto scroller\n This is unexpected and would cause a divide by 0 issue.\n Not allowing an auto scroll\n "),0):(n-e)/r},Gr=({distanceToEdge:e,thresholds:t,dragStartTime:n,shouldUseTimeDampening:r,getAutoScrollerOptions:o})=>{const i=((e,t,n=()=>Lr)=>{const r=n();if(e>t.startScrollingFrom)return 0;if(e<=t.maxScrollValueAt)return r.maxPixelScroll;if(e===t.startScrollingFrom)return 1;const o=jr({startOfRange:t.maxScrollValueAt,endOfRange:t.startScrollingFrom,current:e}),i=r.maxPixelScroll*r.ease(1-o);return Math.ceil(i)})(e,t,o);return 0===i?0:r?Math.max(((e,t,n)=>{const r=n(),o=r.durationDampening.accelerateAt,i=r.durationDampening.stopDampeningAt,a=t,s=i,l=Date.now()-a;if(l>=i)return e;if(l<o)return 1;const c=jr({startOfRange:o,endOfRange:s,current:l}),d=e*r.ease(c);return Math.ceil(d)})(i,n,o),1):i},Ur=({container:e,distanceToEdges:t,dragStartTime:n,axis:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const a=((e,t,n=()=>Lr)=>{const r=n();return{startScrollingFrom:e[t.size]*r.startFromPercentage,maxScrollValueAt:e[t.size]*r.maxScrollAtPercentage}})(e,r,i);return t[r.end]<t[r.start]?Gr({distanceToEdge:t[r.end],thresholds:a,dragStartTime:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i}):-1*Gr({distanceToEdge:t[r.start],thresholds:a,dragStartTime:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i})};const Wr=qt(e=>0===e?0:e);var qr=({dragStartTime:e,container:t,subject:n,center:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const a={top:r.y-t.top,right:t.right-r.x,bottom:t.bottom-r.y,left:r.x-t.left},s=Ur({container:t,distanceToEdges:a,dragStartTime:e,axis:gn,shouldUseTimeDampening:o,getAutoScrollerOptions:i}),l=Ur({container:t,distanceToEdges:a,dragStartTime:e,axis:mn,shouldUseTimeDampening:o,getAutoScrollerOptions:i}),c=Wr({x:l,y:s});if(Lt(c,kt))return null;const d=(({container:e,subject:t,proposedScroll:n})=>{const r=t.height>e.height,o=t.width>e.width;return o||r?o&&r?null:{x:o?0:n.x,y:r?0:n.y}:n})({container:t,subject:n,proposedScroll:c});return d?Lt(d,kt)?null:d:null};const zr=qt(e=>0===e?0:e>0?1:-1),Hr=(()=>{const e=(e,t)=>e<0?e:e>t?e-t:0;return({current:t,max:n,change:r})=>{const o=Ft(t,r),i={x:e(o.x,n.x),y:e(o.y,n.y)};return Lt(i,kt)?null:i}})(),Yr=({max:e,current:t,change:n})=>{const r={x:Math.max(t.x,e.x),y:Math.max(t.y,e.y)},o=zr(n),i=Hr({max:r,current:t,change:o});return!i||0!==o.x&&0===i.x||0!==o.y&&0===i.y},Zr=(e,t)=>Yr({current:e.scroll.current,max:e.scroll.max,change:t}),Xr=(e,t)=>{const n=e.frame;return!!n&&Yr({current:n.scroll.current,max:n.scroll.max,change:t})};var Kr=({state:e,dragStartTime:t,shouldUseTimeDampening:n,scrollWindow:r,scrollDroppable:o,getAutoScrollerOptions:i})=>{const a=e.current.page.borderBoxCenter,s=e.dimensions.draggables[e.critical.draggable.id].page.marginBox;if(e.isWindowScrollAllowed){const o=(({viewport:e,subject:t,center:n,dragStartTime:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const a=qr({dragStartTime:r,container:e.frame,subject:t,center:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i});return a&&Zr(e,a)?a:null})({dragStartTime:t,viewport:e.viewport,subject:s,center:a,shouldUseTimeDampening:n,getAutoScrollerOptions:i});if(o)return void r(o)}const l=(({center:e,destination:t,droppables:n})=>{if(t){const e=n[t];return e.frame?e:null}const r=((e,t)=>{const n=Mr(t).find(t=>(t.frame||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Invalid result"):Ot()),Ln(t.frame.pageMarginBox)(e)))||null;return n})(e,n);return r})({center:a,destination:Fn(e.impact),droppables:e.dimensions.droppables});if(!l)return;const c=(({droppable:e,subject:t,center:n,dragStartTime:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const a=e.frame;if(!a)return null;const s=qr({dragStartTime:r,container:a.pageMarginBox,subject:t,center:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i});return s&&Xr(e,s)?s:null})({dragStartTime:t,droppable:l,subject:s,center:a,shouldUseTimeDampening:n,getAutoScrollerOptions:i});c&&o(l.descriptor.id,c)};const Jr="data-rfd",Qr=(()=>{const e=`${Jr}-drag-handle`;return{base:e,draggableId:`${e}-draggable-id`,contextId:`${e}-context-id`}})(),eo=(()=>{const e=`${Jr}-draggable`;return{base:e,contextId:`${e}-context-id`,id:`${e}-id`}})(),to=(()=>{const e=`${Jr}-droppable`;return{base:e,contextId:`${e}-context-id`,id:`${e}-id`}})(),no={contextId:`${Jr}-scroll-container-context-id`},ro=(e,t)=>e.map(e=>{const n=e.styles[t];return n?`${e.selector} { ${n} }`:""}).join(" "),oo="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?e.useLayoutEffect:e.useEffect,io=()=>{const e=document.querySelector("head");return e||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Cannot find the head to append a style to"):Ot()),e},ao=e=>{const t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.type="text/css",t};function so(e,t){return Array.from(e.querySelectorAll(t))}var lo=e=>e&&e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView:window;function co(e){return e instanceof lo(e).HTMLElement}function uo(e,t){const n=so(document,`[${Qr.contextId}="${e}"]`);if(!n.length)return"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&bt(`Unable to find any drag handles in the context "${e}"`),null;const r=n.find(e=>e.getAttribute(Qr.draggableId)===t);return r?co(r)?r:("production"!=='{NODE_ENV:"production"}'.NODE_ENV&&bt("drag handle needs to be a HTMLElement"),null):("production"!=='{NODE_ENV:"production"}'.NODE_ENV&&bt(`Unable to find drag handle with id "${t}" as no handle with a matching id was found`),null)}function po(){const e={draggables:{},droppables:{}},t=[];function n(e){t.length&&t.forEach(t=>t(e))}function r(t){return e.draggables[t]||null}function o(t){return e.droppables[t]||null}return{draggable:{register:t=>{e.draggables[t.descriptor.id]=t,n({type:"ADDITION",value:t})},update:(t,n)=>{const r=e.draggables[n.descriptor.id];r&&r.uniqueId===t.uniqueId&&(delete e.draggables[n.descriptor.id],e.draggables[t.descriptor.id]=t)},unregister:t=>{const o=t.descriptor.id,i=r(o);i&&t.uniqueId===i.uniqueId&&(delete e.draggables[o],e.droppables[t.descriptor.droppableId]&&n({type:"REMOVAL",value:t}))},getById:function(e){const t=r(e);return t||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,`Cannot find draggable entry with id [${e}]`):Ot()),t},findById:r,exists:e=>Boolean(r(e)),getAllByType:t=>Object.values(e.draggables).filter(e=>e.descriptor.type===t)},droppable:{register:t=>{e.droppables[t.descriptor.id]=t},unregister:t=>{const n=o(t.descriptor.id);n&&t.uniqueId===n.uniqueId&&delete e.droppables[t.descriptor.id]},getById:function(e){const t=o(e);return t||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,`Cannot find droppable entry with id [${e}]`):Ot()),t},findById:o,exists:e=>Boolean(o(e)),getAllByType:t=>Object.values(e.droppables).filter(e=>e.descriptor.type===t)},subscribe:function(e){return t.push(e),function(){const n=t.indexOf(e);-1!==n&&t.splice(n,1)}},clean:function(){e.draggables={},e.droppables={},t.length=0}}}var fo=g.default.createContext(null),go=()=>{const e=document.body;return e||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Cannot find document.body"):Ot()),e};const mo={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},ho={separator:"::"};function bo(e,t=ho){const n=g.default.useId();return $t(()=>`${e}${t.separator}${n}`,[t.separator,e,n])}var Eo=g.default.createContext(null);const vo=/(\d+)\.(\d+)\.(\d+)/,yo=e=>{const t=vo.exec(e);return null==t&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,`Unable to parse React version ${e}`):Ot()),{major:Number(t[1]),minor:Number(t[2]),patch:Number(t[3]),raw:e}},No="\n We expect a html5 doctype: <!doctype html>\n This is to ensure consistent browser layout and measurement\n\n More information: https://github.com/hello-pangea/dnd/blob/main/docs/guides/doctype.md\n";function Do(e){"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&e()}function xo(t,n){Do(()=>{e.useEffect(()=>{try{t()}catch(e){Et(`\n A setup problem was encountered.\n\n > ${e.message}\n `)}},n)})}function Oo(t){const n=e.useRef(t);return e.useEffect(()=>{n.current=t}),n}function wo(e){return"IDLE"!==e.phase&&"DROP_ANIMATING"!==e.phase&&e.isDragging}const _o=9,Io=13,So=33,Co=34,Ao=35,Vo=36,Po={[Io]:!0,[_o]:!0};var To=e=>{Po[e.keyCode]&&e.preventDefault()};const Ro=(()=>{const e="visibilitychange";return"undefined"==typeof document?e:[e,`ms${e}`,`webkit${e}`,`moz${e}`,`o${e}`].find(e=>`on${e}`in document)||e})(),$o={type:"IDLE"};function Bo(){}const ko={[Co]:!0,[So]:!0,[Vo]:!0,[Ao]:!0},Fo={type:"IDLE"},Mo=["input","button","textarea","select","option","optgroup","video","audio"];function Lo(e,t){if(null==t)return!1;if(Mo.includes(t.tagName.toLowerCase()))return!0;const n=t.getAttribute("contenteditable");return"true"===n||""===n||t!==e&&Lo(e,t.parentElement)}function jo(e,t){const n=t.target;return!!co(n)&&Lo(e,n)}var Go=e=>Qe(e.getBoundingClientRect()).center;const Uo=(()=>{const e="matches";return"undefined"==typeof document?e:[e,"msMatchesSelector","webkitMatchesSelector"].find(e=>e in Element.prototype)||e})();function Wo(e,t){return null==e?null:e[Uo](t)?e:Wo(e.parentElement,t)}function qo(e,t){return e.closest?e.closest(t):Wo(e,t)}function zo(e){e.preventDefault()}function Ho({expected:e,phase:t,isLockActive:n,shouldWarn:r}){return n()?e===t||(r&&"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&bt(`\n Cannot perform action.\n The actions you used belong to an outdated phase\n\n Current phase: ${e}\n You called an action from outdated phase: ${t}\n\n Tips:\n\n - Do not use preDragActions actions after calling preDragActions.lift()\n `),!1):(r&&"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&bt("\n Cannot perform action.\n The sensor no longer has an action lock.\n\n Tips:\n\n - Throw away your action handlers when forceStop() is called\n - Check actions.isActive() if you really need to\n "),!1)}function Yo({lockAPI:e,store:t,registry:n,draggableId:r}){if(e.isClaimed())return!1;const o=n.draggable.findById(r);return o?!!o.options.isEnabled&&!!kr(t.getState(),r):("production"!=='{NODE_ENV:"production"}'.NODE_ENV&&bt(`Unable to find draggable with id: ${r}`),!1)}const Zo=[function(t){const n=e.useRef($o),r=e.useRef(vt),o=$t(()=>({eventName:"mousedown",fn:function(e){if(e.defaultPrevented)return;if(0!==e.button)return;if(e.ctrlKey||e.metaKey||e.shiftKey||e.altKey)return;const n=t.findClosestDraggableId(e);if(!n)return;const o=t.tryGetLock(n,s,{sourceEvent:e});if(!o)return;e.preventDefault();const i={x:e.clientX,y:e.clientY};r.current(),d(o,i)}}),[t]),i=$t(()=>({eventName:"webkitmouseforcewillbegin",fn:e=>{if(e.defaultPrevented)return;const n=t.findClosestDraggableId(e);if(!n)return;const r=t.findOptionsForDraggable(n);r&&(r.shouldRespectForcePress||t.canGetLock(n)&&e.preventDefault())}}),[t]),a=Bt(function(){r.current=yt(window,[i,o],{passive:!1,capture:!0})},[i,o]),s=Bt(()=>{"IDLE"!==n.current.type&&(n.current=$o,r.current(),a())},[a]),l=Bt(()=>{const e=n.current;s(),"DRAGGING"===e.type&&e.actions.cancel({shouldBlockNextClick:!0}),"PENDING"===e.type&&e.actions.abort()},[s]),c=Bt(function(){const e=function({cancel:e,completed:t,getPhase:n,setPhase:r}){return[{eventName:"mousemove",fn:e=>{const{button:t,clientX:o,clientY:i}=e;if(0!==t)return;const a={x:o,y:i},s=n();if("DRAGGING"===s.type)return e.preventDefault(),void s.actions.move(a);if("PENDING"!==s.type&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Cannot be IDLE"):Ot()),l=s.point,c=a,!(Math.abs(c.x-l.x)>=5||Math.abs(c.y-l.y)>=5))return;var l,c;e.preventDefault();const d=s.actions.fluidLift(a);r({type:"DRAGGING",actions:d})}},{eventName:"mouseup",fn:r=>{const o=n();"DRAGGING"===o.type?(r.preventDefault(),o.actions.drop({shouldBlockNextClick:!0}),t()):e()}},{eventName:"mousedown",fn:t=>{"DRAGGING"===n().type&&t.preventDefault(),e()}},{eventName:"keydown",fn:t=>{if("PENDING"!==n().type)return 27===t.keyCode?(t.preventDefault(),void e()):void To(t);e()}},{eventName:"resize",fn:e},{eventName:"scroll",options:{passive:!0,capture:!1},fn:()=>{"PENDING"===n().type&&e()}},{eventName:"webkitmouseforcedown",fn:t=>{const r=n();"IDLE"===r.type&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Unexpected phase"):Ot()),r.actions.shouldRespectForcePress()?e():t.preventDefault()}},{eventName:Ro,fn:e}]}({cancel:l,completed:s,getPhase:()=>n.current,setPhase:e=>{n.current=e}});r.current=yt(window,e,{capture:!0,passive:!1})},[l,s]),d=Bt(function(e,t){"IDLE"!==n.current.type&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Expected to move from IDLE to PENDING drag"):Ot()),n.current={type:"PENDING",point:t,actions:e},c()},[c]);oo(function(){return a(),function(){r.current()}},[a])},function(t){const n=e.useRef(Bo),r=$t(()=>({eventName:"keydown",fn:function(e){if(e.defaultPrevented)return;if(32!==e.keyCode)return;const r=t.findClosestDraggableId(e);if(!r)return;const i=t.tryGetLock(r,l,{sourceEvent:e});if(!i)return;e.preventDefault();let a=!0;const s=i.snapLift();function l(){a||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Cannot stop capturing a keyboard drag when not capturing"):Ot()),a=!1,n.current(),o()}n.current(),n.current=yt(window,function(e,t){function n(){t(),e.cancel()}return[{eventName:"keydown",fn:r=>27===r.keyCode?(r.preventDefault(),void n()):32===r.keyCode?(r.preventDefault(),t(),void e.drop()):40===r.keyCode?(r.preventDefault(),void e.moveDown()):38===r.keyCode?(r.preventDefault(),void e.moveUp()):39===r.keyCode?(r.preventDefault(),void e.moveRight()):37===r.keyCode?(r.preventDefault(),void e.moveLeft()):void(ko[r.keyCode]?r.preventDefault():To(r))},{eventName:"mousedown",fn:n},{eventName:"mouseup",fn:n},{eventName:"click",fn:n},{eventName:"touchstart",fn:n},{eventName:"resize",fn:n},{eventName:"wheel",fn:n,options:{passive:!0}},{eventName:Ro,fn:n}]}(s,l),{capture:!0,passive:!1})}}),[t]),o=Bt(function(){n.current=yt(window,[r],{passive:!1,capture:!0})},[r]);oo(function(){return o(),function(){n.current()}},[o])},function(t){const n=e.useRef(Fo),r=e.useRef(vt),o=Bt(function(){return n.current},[]),i=Bt(function(e){n.current=e},[]),a=$t(()=>({eventName:"touchstart",fn:function(e){if(e.defaultPrevented)return;const n=t.findClosestDraggableId(e);if(!n)return;const o=t.tryGetLock(n,l,{sourceEvent:e});if(!o)return;const i=e.touches[0],{clientX:a,clientY:s}=i,c={x:a,y:s};r.current(),p(o,c)}}),[t]),s=Bt(function(){r.current=yt(window,[a],{capture:!0,passive:!1})},[a]),l=Bt(()=>{const e=n.current;"IDLE"!==e.type&&("PENDING"===e.type&&clearTimeout(e.longPressTimerId),i(Fo),r.current(),s())},[s,i]),c=Bt(()=>{const e=n.current;l(),"DRAGGING"===e.type&&e.actions.cancel({shouldBlockNextClick:!0}),"PENDING"===e.type&&e.actions.abort()},[l]),d=Bt(function(){const e={capture:!0,passive:!1},t={cancel:c,completed:l,getPhase:o},n=yt(window,function({cancel:e,completed:t,getPhase:n}){return[{eventName:"touchmove",options:{capture:!1},fn:t=>{const r=n();if("DRAGGING"!==r.type)return void e();r.hasMoved=!0;const{clientX:o,clientY:i}=t.touches[0],a={x:o,y:i};t.preventDefault(),r.actions.move(a)}},{eventName:"touchend",fn:r=>{const o=n();"DRAGGING"===o.type?(r.preventDefault(),o.actions.drop({shouldBlockNextClick:!0}),t()):e()}},{eventName:"touchcancel",fn:t=>{"DRAGGING"===n().type?(t.preventDefault(),e()):e()}},{eventName:"touchforcechange",fn:t=>{const r=n();"IDLE"===r.type&&Ot();const o=t.touches[0];if(!o)return;if(!(o.force>=.15))return;const i=r.actions.shouldRespectForcePress();if("PENDING"!==r.type)return i?r.hasMoved?void t.preventDefault():void e():void t.preventDefault();i&&e()}},{eventName:Ro,fn:e}]}(t),e),i=yt(window,function({cancel:e,getPhase:t}){return[{eventName:"orientationchange",fn:e},{eventName:"resize",fn:e},{eventName:"contextmenu",fn:e=>{e.preventDefault()}},{eventName:"keydown",fn:n=>{"DRAGGING"===t().type?(27===n.keyCode&&n.preventDefault(),e()):e()}},{eventName:Ro,fn:e}]}(t),e);r.current=function(){n(),i()}},[c,o,l]),u=Bt(function(){const e=o();"PENDING"!==e.type&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,`Cannot start dragging from phase ${e.type}`):Ot());const t=e.actions.fluidLift(e.point);i({type:"DRAGGING",actions:t,hasMoved:!1})},[o,i]),p=Bt(function(e,t){"IDLE"!==o().type&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Expected to move from IDLE to PENDING drag"):Ot());const n=setTimeout(u,120);i({type:"PENDING",point:t,actions:e,longPressTimerId:n}),d()},[d,o,i,u]);oo(function(){return s(),function(){r.current();const e=o();"PENDING"===e.type&&(clearTimeout(e.longPressTimerId),i(Fo))}},[o,s,i]),oo(function(){return yt(window,[{eventName:"touchmove",fn:()=>{},options:{capture:!1,passive:!1}}])},[])}];function Xo({contextId:t,store:n,registry:r,customSensors:o,enableDefaultSensors:i}){const a=[...i?Zo:[],...o||[]],s=e.useState(()=>function(){let e=null;function t(){e||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Cannot release lock when there is no lock"):Ot()),e=null}return{isClaimed:function(){return Boolean(e)},isActive:function(t){return t===e},claim:function(t){e&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Cannot claim lock as it is already claimed"):Ot());const n={abandon:t};return e=n,n},release:t,tryAbandon:function(){e&&(e.abandon(),t())}}}())[0],l=Bt(function(e,t){wo(e)&&!wo(t)&&s.tryAbandon()},[s]);oo(function(){let e=n.getState();return n.subscribe(()=>{const t=n.getState();l(e,t),e=t})},[s,n,l]),oo(()=>s.tryAbandon,[s.tryAbandon]);const c=Bt(e=>Yo({lockAPI:s,registry:r,store:n,draggableId:e}),[s,r,n]),d=Bt((e,o,i)=>function({lockAPI:e,contextId:t,store:n,registry:r,draggableId:o,forceSensorStop:i,sourceEvent:a}){if(!Yo({lockAPI:e,store:n,registry:r,draggableId:o}))return null;const s=r.draggable.getById(o),l=function(e,t){const n=so(document,`[${eo.contextId}="${e}"]`).find(e=>e.getAttribute(eo.id)===t);return n?co(n)?n:("production"!=='{NODE_ENV:"production"}'.NODE_ENV&&bt("Draggable element is not a HTMLElement"),null):null}(t,s.descriptor.id);if(!l)return"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&bt(`Unable to find draggable element with id: ${o}`),null;if(a&&!s.options.canDragInteractiveElements&&jo(l,a))return null;const c=e.claim(i||vt);let d="PRE_DRAG";function u(){return s.options.shouldRespectForcePress}function p(){return e.isActive(c)}const f=function(e,t){Ho({expected:e,phase:d,isLockActive:p,shouldWarn:!0})&&n.dispatch(t())}.bind(null,"DRAGGING");function g(t){function r(){e.release(),d="COMPLETED"}function o(e,o={shouldBlockNextClick:!1}){if(t.cleanup(),o.shouldBlockNextClick){const e=yt(window,[{eventName:"click",fn:zo,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(e)}r(),n.dispatch(fr({reason:e}))}return"PRE_DRAG"!==d&&(r(),"production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,`Cannot lift in phase ${d}`):Ot()),n.dispatch((e=>({type:"LIFT",payload:e}))(t.liftActionArgs)),d="DRAGGING",{isActive:()=>Ho({expected:"DRAGGING",phase:d,isLockActive:p,shouldWarn:!1}),shouldRespectForcePress:u,drop:e=>o("DROP",e),cancel:e=>o("CANCEL",e),...t.actions}}return{isActive:()=>Ho({expected:"PRE_DRAG",phase:d,isLockActive:p,shouldWarn:!1}),shouldRespectForcePress:u,fluidLift:function(e){const t=ct(e=>{f(()=>sr({client:e}))});return{...g({liftActionArgs:{id:o,clientSelection:e,movementMode:"FLUID"},cleanup:()=>t.cancel(),actions:{move:t}}),move:t}},snapLift:function(){const e={moveUp:()=>f(lr),moveRight:()=>f(dr),moveDown:()=>f(cr),moveLeft:()=>f(ur)};return g({liftActionArgs:{id:o,clientSelection:Go(l),movementMode:"SNAP"},cleanup:vt,actions:e})},abort:function(){Ho({expected:"PRE_DRAG",phase:d,isLockActive:p,shouldWarn:!0})&&e.release()}}}({lockAPI:s,registry:r,contextId:t,store:n,draggableId:e,forceSensorStop:o||null,sourceEvent:i&&i.sourceEvent?i.sourceEvent:null}),[t,s,r,n]),u=Bt(e=>function(e,t){const n=function(e,t){const n=t.target;if(!((r=n)instanceof lo(r).Element))return"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&bt("event.target must be a Element"),null;var r;const o=function(e){return`[${Qr.contextId}="${e}"]`}(e),i=qo(n,o);return i?co(i)?i:("production"!=='{NODE_ENV:"production"}'.NODE_ENV&&bt("drag handle must be a HTMLElement"),null):null}(e,t);return n?n.getAttribute(Qr.draggableId):null}(t,e),[t]),p=Bt(e=>{const t=r.draggable.findById(e);return t?t.options:null},[r.draggable]),f=Bt(function(){s.isClaimed()&&(s.tryAbandon(),"IDLE"!==n.getState().phase&&n.dispatch({type:"FLUSH",payload:null}))},[s,n]),g=Bt(()=>s.isClaimed(),[s]),m=$t(()=>({canGetLock:c,tryGetLock:d,findClosestDraggableId:u,findOptionsForDraggable:p,tryReleaseLock:f,isLockClaimed:g}),[c,d,u,p,f,g]);var h;h=a,Do(()=>{const e=Oo(h);xo(()=>{e.current.length!==h.length&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Cannot change the amount of sensor hooks after mounting"):Ot())})});for(let e=0;e<a.length;e++)a[e](m)}function Ko(e){return e.current||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Could not find store from lazy ref"):Ot()),e.current}function Jo(t){const{contextId:n,setCallbacks:r,sensors:o,nonce:i,dragHandleUsageInstructions:a}=t,l=e.useRef(null);xo(()=>{((e,t)=>{const n=yo("^18.0.0 || ^19.0.0"),r=yo(t);((e,t)=>t.major>e.major||!(t.major<e.major)&&(t.minor>e.minor||!(t.minor<e.minor)&&t.patch>=e.patch))(n,r)||"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&bt(`\n React version: [${r.raw}]\n does not satisfy expected peer dependency version: [${n.raw}]\n\n This can result in run time bugs, and even fatal crashes\n `)})(0,g.default.version),(()=>{const e=document.doctype;e?("html"!==e.name.toLowerCase()&&"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&bt(`\n Unexpected <!doctype> found: (${e.name})\n\n ${No}\n `),""!==e.publicId&&"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&bt(`\n Unexpected <!doctype> publicId found: (${e.publicId})\n A html5 doctype does not have a publicId\n\n ${No}\n `)):"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&bt(`\n No <!doctype html> found.\n\n ${No}\n `)})()},[]);const c=Oo(t),d=Bt(()=>(e=>({onBeforeCapture:t=>{s.flushSync(()=>{e.onBeforeCapture&&e.onBeforeCapture(t)})},onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragEnd:e.onDragEnd,onDragUpdate:e.onDragUpdate}))(c.current),[c]),u=Bt(()=>(e=>({...Lr,...e.autoScrollerOptions,durationDampening:{...Lr.durationDampening,...e.autoScrollerOptions}}))(c.current),[c]),p=function(t){const n=$t(()=>(e=>`rfd-announcement-${e}`)(t),[t]),r=e.useRef(null);return e.useEffect(function(){const e=document.createElement("div");return r.current=e,e.id=n,e.setAttribute("aria-live","assertive"),e.setAttribute("aria-atomic","true"),dt(e.style,mo),go().appendChild(e),function(){setTimeout(function(){const t=go();t.contains(e)&&t.removeChild(e),e===r.current&&(r.current=null)})}},[n]),Bt(e=>{const t=r.current;t?t.textContent=e:"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&bt(`\n A screen reader message was trying to be announced but it was unable to do so.\n This can occur if you unmount your <DragDropContext /> in your onDragEnd.\n Consider calling provided.announce() before the unmount so that the instruction will\n not be lost for users relying on a screen reader.\n\n Message not passed to screen reader:\n\n "${e}"\n `)},[])}(n),f=function({contextId:t,text:n}){const r=bo("hidden-text",{separator:"-"}),o=$t(()=>function({contextId:e,uniqueId:t}){return`rfd-hidden-text-${e}-${t}`}({contextId:t,uniqueId:r}),[r,t]);return e.useEffect(function(){const e=document.createElement("div");return e.id=o,e.textContent=n,e.style.display="none",go().appendChild(e),function(){const t=go();t.contains(e)&&t.removeChild(e)}},[o,n]),o}({contextId:n,text:a}),m=function(t,n){const r=$t(()=>(e=>{const t=(n=e,e=>`[${e}="${n}"]`);var n;const r=(()=>{const e="\n cursor: -webkit-grab;\n cursor: grab;\n ";return{selector:t(Qr.contextId),styles:{always:"\n -webkit-touch-callout: none;\n -webkit-tap-highlight-color: rgba(0,0,0,0);\n touch-action: manipulation;\n ",resting:e,dragging:"pointer-events: none;",dropAnimating:e}}})(),o=[(()=>{const e=`\n transition: ${br.outOfTheWay};\n `;return{selector:t(eo.contextId),styles:{dragging:e,dropAnimating:e,userCancel:e}}})(),r,{selector:t(to.contextId),styles:{always:"overflow-anchor: none;"}},{selector:"body",styles:{dragging:"\n cursor: grabbing;\n cursor: -webkit-grabbing;\n user-select: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n overflow-anchor: none;\n "}}];return{always:ro(o,"always"),resting:ro(o,"resting"),dragging:ro(o,"dragging"),dropAnimating:ro(o,"dropAnimating"),userCancel:ro(o,"userCancel")}})(t),[t]),o=e.useRef(null),i=e.useRef(null),a=Bt(Kt(e=>{const t=i.current;t||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Cannot set dynamic style element if it is not set"):Ot()),t.textContent=e}),[]),s=Bt(e=>{const t=o.current;t||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Cannot set dynamic style element if it is not set"):Ot()),t.textContent=e},[]);oo(()=>{(o.current||i.current)&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"style elements already mounted"):Ot());const e=ao(n),l=ao(n);return o.current=e,i.current=l,e.setAttribute(`${Jr}-always`,t),l.setAttribute(`${Jr}-dynamic`,t),io().appendChild(e),io().appendChild(l),s(r.always),a(r.resting),()=>{const e=e=>{const t=e.current;t||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Cannot unmount ref as it is not set"):Ot()),io().removeChild(t),e.current=null};e(o),e(i)}},[n,s,a,r.always,r.resting,t]);const l=Bt(()=>a(r.dragging),[a,r.dragging]),c=Bt(e=>{a("DROP"!==e?r.userCancel:r.dropAnimating)},[a,r.dropAnimating,r.userCancel]),d=Bt(()=>{i.current&&a(r.resting)},[a,r.resting]);return $t(()=>({dragging:l,dropping:c,resting:d}),[l,c,d])}(n,i),h=Bt(e=>{Ko(l).dispatch(e)},[]),b=$t(()=>B({publishWhileDragging:nr,updateDroppableScroll:or,updateDroppableIsEnabled:ir,updateDroppableIsCombineEnabled:ar,collectionStarting:rr},h),[h]),E=function(){const t=$t(po,[]);return e.useEffect(()=>function(){t.clean()},[t]),t}(),v=$t(()=>((e,t)=>{let n=null;const r=function({registry:e,callbacks:t}){let n={additions:{},removals:{},modified:{}},r=null;const o=()=>{r||(t.collectionStarting(),r=requestAnimationFrame(()=>{r=null;const{additions:o,removals:i,modified:a}=n,s=Object.keys(o).map(t=>e.draggable.getById(t).getDimension(kt)).sort((e,t)=>e.descriptor.index-t.descriptor.index),l=Object.keys(a).map(t=>({droppableId:t,scroll:e.droppable.getById(t).callbacks.getScrollWhileDragging()})),c={additions:s,removals:Object.keys(i),modified:l};n={additions:{},removals:{},modified:{}},t.publish(c)}))};return{add:e=>{const t=e.descriptor.id;n.additions[t]=e,n.modified[e.descriptor.droppableId]=!0,n.removals[t]&&delete n.removals[t],o()},remove:e=>{const t=e.descriptor;n.removals[t.id]=!0,n.modified[t.droppableId]=!0,n.additions[t.id]&&delete n.additions[t.id],o()},stop:()=>{r&&(cancelAnimationFrame(r),r=null,n={additions:{},removals:{},modified:{}})}}}({callbacks:{publish:t.publishWhileDragging,collectionStarting:t.collectionStarting},registry:e}),o=t=>{n||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Should only be subscribed when a collection is occurring"):Ot());const o=n.critical.draggable;"ADDITION"===t.type&&Br(e,o,t.value)&&r.add(t.value),"REMOVAL"===t.type&&Br(e,o,t.value)&&r.remove(t.value)},i={updateDroppableIsEnabled:(r,o)=>{e.droppable.exists(r)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,`Cannot update is enabled flag of Droppable ${r} as it is not registered`):Ot()),n&&t.updateDroppableIsEnabled({id:r,isEnabled:o})},updateDroppableIsCombineEnabled:(r,o)=>{n&&(e.droppable.exists(r)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,`Cannot update isCombineEnabled flag of Droppable ${r} as it is not registered`):Ot()),t.updateDroppableIsCombineEnabled({id:r,isCombineEnabled:o}))},scrollDroppable:(t,r)=>{n&&e.droppable.getById(t).callbacks.scroll(r)},updateDroppableScroll:(r,o)=>{n&&(e.droppable.exists(r)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,`Cannot update the scroll on Droppable ${r} as it is not registered`):Ot()),t.updateDroppableScroll({id:r,newScroll:o}))},startPublishing:t=>{n&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Cannot start capturing critical dimensions as there is already a collection"):Ot());const r=e.draggable.getById(t.draggableId),i=e.droppable.getById(r.descriptor.droppableId),a={draggable:r.descriptor,droppable:i.descriptor},s=e.subscribe(o);return n={critical:a,unsubscribe:s},(({critical:e,scrollOptions:t,registry:n})=>{const r=(()=>{const e=Or(),t=$r(),n=e.y,r=e.x,o=Rr();return{frame:Qe({top:n,left:r,right:r+o.clientWidth,bottom:n+o.clientHeight}),scroll:{initial:e,current:e,max:t,diff:{value:kt,displacement:kt}}}})(),o=r.scroll.current,i=n.droppable.getAllByType(e.droppable.type).map(e=>e.callbacks.getDimensionAndWatchScroll(o,t)),a=n.draggable.getAllByType(e.draggable.type).map(e=>e.getDimension(o));return{dimensions:{draggables:Qt(a),droppables:Jt(i)},critical:e,viewport:r}})({critical:a,registry:e,scrollOptions:t.scrollOptions})},stopPublishing:()=>{n&&(r.stop(),e.droppable.getAllByType(n.critical.droppable.type).forEach(e=>e.callbacks.dragStopped()),n.unsubscribe(),n=null)}};return i})(E,b),[E,b]),y=$t(()=>(({scrollDroppable:e,scrollWindow:t,move:n,getAutoScrollerOptions:r})=>{const o=(({scrollWindow:e,scrollDroppable:t,getAutoScrollerOptions:n=()=>Lr})=>{const r=ct(e),o=ct(t);let i=null;const a=e=>{i||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Cannot fluid scroll if not dragging"):Ot());const{shouldUseTimeDampening:t,dragStartTime:a}=i;Kr({state:e,scrollWindow:r,scrollDroppable:o,dragStartTime:a,shouldUseTimeDampening:t,getAutoScrollerOptions:n})};return{start:e=>{i&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Cannot start auto scrolling when already started"):Ot());const t=Date.now();let r=!1;const o=()=>{r=!0};Kr({state:e,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:o,scrollDroppable:o,getAutoScrollerOptions:n}),i={dragStartTime:t,shouldUseTimeDampening:r},r&&a(e)},stop:()=>{i&&(r.cancel(),o.cancel(),i=null)},scroll:a}})({scrollWindow:t,scrollDroppable:e,getAutoScrollerOptions:r}),i=(({move:e,scrollDroppable:t,scrollWindow:n})=>r=>{const o=r.scrollJumpRequest;if(!o)return;const i=Fn(r.impact);i||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Cannot perform a jump scroll when there is no destination"):Ot());const a=((e,n)=>{if(!Xr(e,n))return n;const r=((e,t)=>{const n=e.frame;return n&&Xr(e,t)?Hr({current:n.scroll.current,max:n.scroll.max,change:t}):null})(e,n);if(!r)return t(e.descriptor.id,n),null;const o=Mt(n,r);return t(e.descriptor.id,o),Mt(n,o)})(r.dimensions.droppables[i],o);if(!a)return;const s=((e,t,r)=>{if(!e)return r;if(!Zr(t,r))return r;const o=((e,t)=>Zr(e,t)?Hr({current:e.scroll.current,max:e.scroll.max,change:t}):null)(t,r);if(!o)return n(r),null;const i=Mt(r,o);return n(i),Mt(r,i)})(r.isWindowScrollAllowed,r.viewport,a);s&&((t,n)=>{const r=Ft(t.current.client.selection,n);e({client:r})})(r,s)})({move:n,scrollWindow:t,scrollDroppable:e});return{scroll:e=>{r().disabled||"DRAGGING"!==e.phase||("FLUID"!==e.movementMode?e.scrollJumpRequest&&i(e):o.scroll(e))},start:o.start,stop:o.stop}})({scrollWindow:Fr,scrollDroppable:v.scrollDroppable,getAutoScrollerOptions:u,...B({move:sr},h)}),[v.scrollDroppable,h,u]),N=function(t){const n=e.useRef({}),r=e.useRef(null),o=e.useRef(null),i=e.useRef(!1),a=Bt(function(e,t){const r={id:e,focus:t};return n.current[e]=r,function(){const t=n.current;t[e]!==r&&delete t[e]}},[]),s=Bt(function(e){const n=uo(t,e);n&&n!==document.activeElement&&n.focus()},[t]),l=Bt(function(e,t){r.current===e&&(r.current=t)},[]),c=Bt(function(){o.current||i.current&&(o.current=requestAnimationFrame(()=>{o.current=null;const e=r.current;e&&s(e)}))},[s]),d=Bt(function(e){r.current=null;const t=document.activeElement;t&&t.getAttribute(Qr.draggableId)===e&&(r.current=e)},[]);return oo(()=>(i.current=!0,function(){i.current=!1;const e=o.current;e&&cancelAnimationFrame(e)}),[]),$t(()=>({register:a,tryRecordFocus:d,tryRestoreFocusRecorded:c,tryShiftRecord:l}),[a,d,c,l])}(n),D=$t(()=>(({dimensionMarshal:e,focusMarshal:t,styleMarshal:n,getResponders:r,announce:o,autoScroller:i})=>{return R(er,Pr(function(...e){return t=>(n,r)=>{const o=t(n,r);let i=()=>{throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?C(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")};const a={getState:o.getState,dispatch:(e,...t)=>i(e,...t)},s=e.map(e=>e(a));return i=k(...s)(o.dispatch),{...o,dispatch:i}}}((a=n,()=>e=>t=>{tr(t,"INITIAL_PUBLISH")&&a.dragging(),tr(t,"DROP_ANIMATE")&&a.dropping(t.payload.completed.result.reason),(tr(t,"FLUSH")||tr(t,"DROP_COMPLETE"))&&a.resting(),e(t)}),(e=>()=>t=>n=>{(tr(n,"DROP_COMPLETE")||tr(n,"FLUSH")||tr(n,"DROP_ANIMATE"))&&e.stopPublishing(),t(n)})(e),(e=>({getState:t,dispatch:n})=>r=>o=>{if(!tr(o,"LIFT"))return void r(o);const{id:i,clientSelection:a,movementMode:s}=o.payload,l=t();"DROP_ANIMATING"===l.phase&&n(pr({completed:l.completed})),"IDLE"!==t().phase&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Unexpected phase to start a drag"):Ot()),n({type:"FLUSH",payload:null}),n({type:"BEFORE_INITIAL_CAPTURE",payload:{draggableId:i,movementMode:s}});const c={draggableId:i,scrollOptions:{shouldPublishImmediately:"SNAP"===s}},{critical:d,dimensions:u,viewport:p}=e.startPublishing(c);(function(e,t){"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&function(e){if(e.length<=1)return;const t=e.map(e=>e.descriptor.index),n={};for(let e=1;e<t.length;e++){const r=t[e];r!==t[e-1]+1&&(n[r]=!0)}if(!Object.keys(n).length)return;const r=t.map(e=>Boolean(n[e])?`[🔥${e}]`:`${e}`).join(", ");"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&bt(`\n Detected non-consecutive <Draggable /> indexes.\n\n (This can cause unexpected bugs)\n\n ${r}\n `)}(nn(e.droppable.id,t.draggables))})(d,u),n({type:"INITIAL_PUBLISH",payload:{critical:d,dimensions:u,clientSelection:a,movementMode:s,viewport:p}})})(e),xr,Cr,Ar,Vr,(e=>t=>n=>r=>{if((e=>tr(e,"DROP_COMPLETE")||tr(e,"DROP_ANIMATE")||tr(e,"FLUSH"))(r))return e.stop(),void n(r);if(tr(r,"INITIAL_PUBLISH")){n(r);const o=t.getState();return"DRAGGING"!==o.phase&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Expected phase to be DRAGGING after INITIAL_PUBLISH"):Ot()),void e.start(o)}n(r),e.scroll(t.getState())})(i),wr,(e=>{let t=!1;return()=>n=>r=>{if(tr(r,"INITIAL_PUBLISH"))return t=!0,e.tryRecordFocus(r.payload.critical.draggable.id),n(r),void e.tryRestoreFocusRecorded();if(n(r),t){if(tr(r,"FLUSH"))return t=!1,void e.tryRestoreFocusRecorded();if(tr(r,"DROP_COMPLETE")){t=!1;const n=r.payload.completed.result;n.combine&&e.tryShiftRecord(n.draggableId,n.combine.draggableId),e.tryRestoreFocusRecorded()}}}})(t),((e,t)=>{const n=((e,t)=>{const n=(()=>{const e=[];return{add:t=>{const n=setTimeout(()=>(t=>{const n=e.findIndex(e=>e.timerId===t);-1===n&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Could not find timer"):Ot());const[r]=e.splice(n,1);r.callback()})(n));e.push({timerId:n,callback:t})},flush:()=>{if(!e.length)return;const t=[...e];e.length=0,t.forEach(e=>{clearTimeout(e.timerId),e.callback()})}}})();let r=null;const o=n=>{r||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Cannot fire onDragEnd when there is no matching onDragStart"):Ot()),r=null,_r(0,()=>Sr(e().onDragEnd,n,t,Pt))};return{beforeCapture:(t,n)=>{r&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Cannot fire onBeforeCapture as a drag start has already been published"):Ot()),_r(0,()=>{const r=e().onBeforeCapture;r&&r({draggableId:t,mode:n})})},beforeStart:(t,n)=>{r&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Cannot fire onBeforeDragStart as a drag start has already been published"):Ot()),_r(0,()=>{const r=e().onBeforeDragStart;r&&r(Ir(t,n))})},start:(o,i)=>{r&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Cannot fire onBeforeDragStart as a drag start has already been published"):Ot());const a=Ir(o,i);r={mode:i,lastCritical:o,lastLocation:a.source,lastCombine:null},n.add(()=>{_r(0,()=>Sr(e().onDragStart,a,t,At))})},update:(o,i)=>{const a=rn(i),s=on(i);r||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Cannot fire onDragMove when onDragStart has not been called"):Ot());const l=!((c=o)===(d=r.lastCritical)||c.draggable.id===d.draggable.id&&c.draggable.droppableId===d.draggable.droppableId&&c.draggable.type===d.draggable.type&&c.draggable.index===d.draggable.index&&c.droppable.id===d.droppable.id&&c.droppable.type===d.droppable.type);var c,d;l&&(r.lastCritical=o);const u=!((e,t)=>null==e&&null==t||null!=e&&null!=t&&e.droppableId===t.droppableId&&e.index===t.index)(r.lastLocation,a);u&&(r.lastLocation=a);const p=!((e,t)=>null==e&&null==t||null!=e&&null!=t&&e.draggableId===t.draggableId&&e.droppableId===t.droppableId)(r.lastCombine,s);if(p&&(r.lastCombine=s),!l&&!u&&!p)return;const f={...Ir(o,r.mode),combine:s,destination:a};n.add(()=>{_r(0,()=>Sr(e().onDragUpdate,f,t,Vt))})},flush:()=>{r||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Can only flush responders while dragging"):Ot()),n.flush()},drop:o,abort:()=>{if(!r)return;const e={...Ir(r.lastCritical,r.mode),combine:null,destination:null,reason:"CANCEL"};o(e)}}})(e,t);return e=>t=>r=>{if(tr(r,"BEFORE_INITIAL_CAPTURE"))return void n.beforeCapture(r.payload.draggableId,r.payload.movementMode);if(tr(r,"INITIAL_PUBLISH")){const e=r.payload.critical;return n.beforeStart(e,r.payload.movementMode),t(r),void n.start(e,r.payload.movementMode)}if(tr(r,"DROP_COMPLETE")){const e=r.payload.completed.result;return n.flush(),t(r),void n.drop(e)}if(t(r),tr(r,"FLUSH"))return void n.abort();const o=e.getState();"DRAGGING"===o.phase&&n.update(o.critical,o.impact)}})(r,o))));var a})({announce:p,autoScroller:y,dimensionMarshal:v,focusMarshal:N,getResponders:d,styleMarshal:m}),[p,y,v,N,d,m]);"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&l.current&&l.current!==D&&"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&bt("unexpected store change"),l.current=D;const x=Bt(()=>{const e=Ko(l);"IDLE"!==e.getState().phase&&e.dispatch({type:"FLUSH",payload:null})},[]),O=Bt(()=>{const e=Ko(l).getState();return"DROP_ANIMATING"===e.phase||"IDLE"!==e.phase&&e.isDragging},[]);r($t(()=>({isDragging:O,tryAbort:x}),[O,x]));const w=Bt(e=>kr(Ko(l).getState(),e),[]),_=Bt(()=>Mn(Ko(l).getState()),[]),I=$t(()=>({marshal:v,focus:N,contextId:n,canLift:w,isMovementAllowed:_,dragHandleUsageInstructionsId:f,registry:E}),[n,v,f,N,w,_,E]);return Xo({contextId:n,store:D,registry:E,customSensors:o||null,enableDefaultSensors:!1!==t.enableDefaultSensors}),e.useEffect(()=>x,[x]),g.default.createElement(Eo.Provider,{value:I},g.default.createElement(Ze,{context:fo,store:D},t.children))}function Qo(e){const t=g.default.useId(),n=e.dragHandleUsageInstructions||"\n Press space bar to start a drag.\n When dragging you can use the arrow keys to move the item around and escape to cancel.\n Some screen readers may require you to be in focus mode or to use your pass through key\n";return g.default.createElement(wt,null,r=>g.default.createElement(Jo,{nonce:e.nonce,contextId:t,setCallbacks:r,dragHandleUsageInstructions:n,enableDefaultSensors:e.enableDefaultSensors,sensors:e.sensors,onBeforeCapture:e.onBeforeCapture,onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragUpdate:e.onDragUpdate,onDragEnd:e.onDragEnd,autoScrollerOptions:e.autoScrollerOptions},e.children))}const ei=(e,t)=>t?br.drop(t.duration):e?br.snap:br.fluid,ti=(e,t)=>{if(e)return t?0:.7};var ni=g.default.createContext(null);function ri(e){e&&co(e)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"\n provided.innerRef has not been provided with a HTMLElement.\n\n You can find a guide on using the innerRef callback functions at:\n https://github.com/hello-pangea/dnd/blob/main/docs/guides/using-inner-ref.md\n "):Ot())}function oi(t){const n=e.useContext(t);return n||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Could not find required context"):Ot()),n}function ii(e){e.preventDefault()}var ai=(e,t)=>e===t,si=e=>{const{combine:t,destination:n}=e;return n?n.droppableId:t?t.droppableId:null};function li(e=null){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:e,combineWith:null}}const ci={mapped:{type:"SECONDARY",offset:kt,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:li(null)}},di=Ye(()=>{const e=function(){const e=Kt((e,t)=>({x:e,y:t})),t=Kt((e,t,n=null,r=null,o=null)=>({isDragging:!0,isClone:t,isDropAnimating:Boolean(o),dropAnimation:o,mode:e,draggingOver:n,combineWith:r,combineTargetFor:null})),n=Kt((e,n,r,o,i=null,a=null,s=null)=>({mapped:{type:"DRAGGING",dropping:null,draggingOver:i,combineWith:a,mode:n,offset:e,dimension:r,forceShouldAnimate:s,snapshot:t(n,o,i,a,null)}}));return(r,o)=>{if(wo(r)){if(r.critical.draggable.id!==o.draggableId)return null;const t=r.current.client.offset,a=r.dimensions.draggables[o.draggableId],s=Fn(r.impact),l=(i=r.impact).at&&"COMBINE"===i.at.type?i.at.combine.draggableId:null,c=r.forceShouldAnimate;return n(e(t.x,t.y),r.movementMode,a,o.isClone,s,l,c)}var i;if("DROP_ANIMATING"===r.phase){const e=r.completed;if(e.result.draggableId!==o.draggableId)return null;const n=o.isClone,i=r.dimensions.draggables[o.draggableId],a=e.result,s=a.mode,l=si(a),c=(e=>e.combine?e.combine.draggableId:null)(a),d={duration:r.dropDuration,curve:gr,moveTo:r.newHomeClientOffset,opacity:c?0:null,scale:c?.75:null};return{mapped:{type:"DRAGGING",offset:r.newHomeClientOffset,dimension:i,dropping:d,draggingOver:l,combineWith:c,mode:s,forceShouldAnimate:null,snapshot:t(s,n,l,c,d)}}}return null}}(),t=function(){const e=Kt((e,t)=>({x:e,y:t})),t=Kt(li),n=Kt((e,n=null,r)=>({mapped:{type:"SECONDARY",offset:e,combineTargetFor:n,shouldAnimateDisplacement:r,snapshot:t(n)}})),r=e=>e?n(kt,e,!0):null,o=(t,o,i,a)=>{const s=i.displaced.visible[t],l=Boolean(a.inVirtualList&&a.effected[t]),c=on(i),d=c&&c.draggableId===t?o:null;if(!s){if(!l)return r(d);if(i.displaced.invisible[t])return null;const o=jt(a.displacedBy.point),s=e(o.x,o.y);return n(s,d,!0)}if(l)return r(d);const u=i.displacedBy.point,p=e(u.x,u.y);return n(p,d,s.shouldAnimate)};return(e,t)=>{if(wo(e))return e.critical.draggable.id===t.draggableId?null:o(t.draggableId,e.critical.draggable.id,e.impact,e.afterCritical);if("DROP_ANIMATING"===e.phase){const n=e.completed;return n.result.draggableId===t.draggableId?null:o(t.draggableId,n.result.draggableId,n.impact,n.afterCritical)}return null}}();return(n,r)=>e(n,r)||t(n,r)||ci},{dropAnimationFinished:()=>({type:"DROP_ANIMATION_FINISHED",payload:null})},null,{context:fo,areStatePropsEqual:ai})(t=>{const n=e.useRef(null),r=Bt((e=null)=>{n.current=e},[]),o=Bt(()=>n.current,[]),{contextId:i,dragHandleUsageInstructionsId:a,registry:l}=oi(Eo),{type:c,droppableId:d}=oi(ni),u=$t(()=>({id:t.draggableId,index:t.index,type:c,droppableId:d}),[t.draggableId,t.index,c,d]),{children:p,draggableId:f,isEnabled:m,shouldRespectForcePress:h,canDragInteractiveElements:b,isClone:E,mapped:v,dropAnimationFinished:y}=t;(function(e,t,n){xo(()=>{function r(e){return`Draggable[id: ${e}]: `}const o=e.draggableId;o||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Draggable requires a draggableId"):Ot()),"string"!=typeof o&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,`Draggable requires a [string] draggableId.\n Provided: [type: ${typeof o}] (value: ${o})`):Ot()),Number.isInteger(e.index)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,`${r(o)} requires an integer index prop`):Ot()),"DRAGGING"!==e.mapped.type&&(ri(n()),e.isEnabled&&(uo(t,o)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,`${r(o)} Unable to find drag handle`):Ot())))})})(t,i,o),function(t){Do(()=>{const n=e.useRef(t);xo(()=>{t!==n.current&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Draggable isClone prop value changed during component life"):Ot())},[t])})}(E),E||function(t){const n=bo("draggable"),{descriptor:r,registry:o,getDraggableRef:i,canDragInteractiveElements:a,shouldRespectForcePress:s,isEnabled:l}=t,c=$t(()=>({canDragInteractiveElements:a,shouldRespectForcePress:s,isEnabled:l}),[a,l,s]),d=Bt(e=>{const t=i();return t||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Cannot get dimension when no ref is set"):Ot()),function(e,t,n=kt){const r=window.getComputedStyle(t),o=t.getBoundingClientRect(),i=st(o,r),a=at(i,n);return{descriptor:e,placeholder:{client:i,tagName:t.tagName.toLowerCase(),display:r.display},displaceBy:{x:i.marginBox.width,y:i.marginBox.height},client:i,page:a}}(r,t,e)},[r,i]),u=$t(()=>({uniqueId:n,descriptor:r,options:c,getDimension:d}),[r,d,c,n]),p=e.useRef(u),f=e.useRef(!0);oo(()=>(o.draggable.register(p.current),()=>o.draggable.unregister(p.current)),[o.draggable]),oo(()=>{if(f.current)return void(f.current=!1);const e=p.current;p.current=u,o.draggable.update(u,e)},[u,o.draggable])}($t(()=>({descriptor:u,registry:l,getDraggableRef:o,canDragInteractiveElements:b,shouldRespectForcePress:h,isEnabled:m}),[u,l,o,b,h,m]));const N=$t(()=>m?{tabIndex:0,role:"button","aria-describedby":a,"data-rfd-drag-handle-draggable-id":f,"data-rfd-drag-handle-context-id":i,draggable:!1,onDragStart:ii}:null,[i,a,f,m]),D=Bt(e=>{"DRAGGING"===v.type&&v.dropping&&"transform"===e.propertyName&&s.flushSync(y)},[y,v]),x=$t(()=>{const e=function(e){return"DRAGGING"===e.type?function(e){const t=e.dimension.client,{offset:n,combineWith:r,dropping:o}=e,i=Boolean(r),a=(e=>null!=e.forceShouldAnimate?e.forceShouldAnimate:"SNAP"===e.mode)(e),s=Boolean(o),l=s?((e,t)=>{const n=Er(e);if(n)return t?`${n} scale(0.75)`:n})(n,i):vr(n);return{position:"fixed",top:t.marginBox.top,left:t.marginBox.left,boxSizing:"border-box",width:t.borderBox.width,height:t.borderBox.height,transition:ei(a,o),transform:l,opacity:ti(i,s),zIndex:s?4500:5e3,pointerEvents:"none"}}(e):{transform:vr((t=e).offset),transition:t.shouldAnimateDisplacement?void 0:"none"};var t}(v);return{innerRef:r,draggableProps:{"data-rfd-draggable-context-id":i,"data-rfd-draggable-id":f,style:e,onTransitionEnd:"DRAGGING"===v.type&&v.dropping?D:void 0},dragHandleProps:N}},[i,N,f,v,D,r]),O=$t(()=>({draggableId:u.id,type:u.type,source:{index:u.index,droppableId:u.droppableId}}),[u.droppableId,u.id,u.index,u.type]);return g.default.createElement(g.default.Fragment,null,p(x,v.snapshot,O))});function ui(e){return oi(ni).isUsingCloneFor!==e.draggableId||e.isClone?g.default.createElement(di,e):null}function pi(e){const t="boolean"!=typeof e.isDragDisabled||!e.isDragDisabled,n=Boolean(e.disableInteractiveElementBlocking),r=Boolean(e.shouldRespectForcePress);return g.default.createElement(ui,dt({},e,{isClone:!1,isEnabled:t,canDragInteractiveElements:n,shouldRespectForcePress:r}))}const fi=e=>t=>e===t,gi=fi("scroll"),mi=fi("auto"),hi=fi("visible"),bi=(e,t)=>t(e.overflowX)||t(e.overflowY),Ei=e=>{const t=window.getComputedStyle(e),n={overflowX:t.overflowX,overflowY:t.overflowY};return bi(n,gi)||bi(n,mi)},vi=e=>null==e?null:e===document.body?(()=>{if("production"==='{NODE_ENV:"production"}'.NODE_ENV)return!1;const e=go(),t=document.documentElement;if(t||Ot(),!Ei(e))return!1;const n=window.getComputedStyle(t);return(o=hi)((r={overflowX:n.overflowX,overflowY:n.overflowY}).overflowX)&&o(r.overflowY)||"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&bt("\n We have detected that your <body> element might be a scroll container.\n We have found no reliable way of detecting whether the <body> element is a scroll container.\n Under most circumstances a <body> scroll bar will be on the <html> element (document.documentElement)\n\n Because we cannot determine if the <body> is a scroll container, and generally it is not one,\n we will be treating the <body> as *not* a scroll container\n\n More information: https://github.com/hello-pangea/dnd/blob/main/docs/guides/how-we-detect-scroll-containers.md\n "),!1;var r,o})()?e:null:e===document.documentElement?null:Ei(e)?e:vi(e.parentElement);var yi=e=>({x:e.scrollLeft,y:e.scrollTop});const Ni=e=>!!e&&("fixed"===window.getComputedStyle(e).position||Ni(e.parentElement)),Di={passive:!1},xi={passive:!0};var Oi=e=>e.shouldPublishImmediately?Di:xi;const wi=e=>e&&e.env.closestScrollable||null;function _i(){}const Ii={width:0,height:0,margin:{top:0,right:0,bottom:0,left:0}};var Si=g.default.memo(t=>{const n=e.useRef(null),r=Bt(()=>{n.current&&(clearTimeout(n.current),n.current=null)},[]),{animate:o,onTransitionEnd:i,onClose:a,contextId:s}=t,[l,c]=e.useState("open"===t.animate);e.useEffect(()=>l?"open"!==o?(r(),c(!1),_i):n.current?_i:(n.current=setTimeout(()=>{n.current=null,c(!1)}),r):_i,[o,l,r]);const d=Bt(e=>{"height"===e.propertyName&&(i(),"close"===o&&a())},[o,a,i]),u=(({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>{const r=(({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>e||"close"===n?Ii:{height:t.client.borderBox.height,width:t.client.borderBox.width,margin:t.client.margin})({isAnimatingOpenOnMount:e,placeholder:t,animate:n});return{display:t.display,boxSizing:"border-box",width:r.width,height:r.height,marginTop:r.margin.top,marginRight:r.margin.right,marginBottom:r.margin.bottom,marginLeft:r.margin.left,flexShrink:"0",flexGrow:"0",pointerEvents:"none",transition:"none"!==n?br.placeholder:null}})({isAnimatingOpenOnMount:l,animate:t.animate,placeholder:t.placeholder});return g.default.createElement(t.placeholder.tagName,{style:u,"data-rfd-placeholder-context-id":s,onTransitionEnd:d,ref:t.innerRef})});function Ci(e){return"boolean"==typeof e}function Ai(e,t){t.forEach(t=>t(e))}const Vi=[function({props:e}){e.droppableId||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"A Droppable requires a droppableId prop"):Ot()),"string"!=typeof e.droppableId&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,`A Droppable requires a [string] droppableId. Provided: [${typeof e.droppableId}]`):Ot())},function({props:e}){Ci(e.isDropDisabled)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"isDropDisabled must be a boolean"):Ot()),Ci(e.isCombineEnabled)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"isCombineEnabled must be a boolean"):Ot()),Ci(e.ignoreContainerClipping)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"ignoreContainerClipping must be a boolean"):Ot())},function({getDroppableRef:e}){ri(e())}],Pi=[function({props:e,getPlaceholderRef:t}){e.placeholder&&(t()||"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&bt(`\n Droppable setup issue [droppableId: "${e.droppableId}"]:\n DroppableProvided > placeholder could not be found.\n\n Please be sure to add the {provided.placeholder} React Node as a child of your Droppable.\n More information: https://github.com/hello-pangea/dnd/blob/main/docs/api/droppable.md\n `))}],Ti=[function({props:e}){e.renderClone||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Must provide a clone render function (renderClone) for virtual lists"):Ot())},function({getPlaceholderRef:e}){e()&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Expected virtual list to not have a placeholder"):Ot())}];class Ri extends g.default.PureComponent{constructor(...e){super(...e),this.state={isVisible:Boolean(this.props.on),data:this.props.on,animate:this.props.shouldAnimate&&this.props.on?"open":"none"},this.onClose=()=>{"close"===this.state.animate&&this.setState({isVisible:!1})}}static getDerivedStateFromProps(e,t){return e.shouldAnimate?e.on?{isVisible:!0,data:e.on,animate:"open"}:t.isVisible?{isVisible:!0,data:t.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:Boolean(e.on),data:e.on,animate:"none"}}render(){return this.state.isVisible?this.props.children({onClose:this.onClose,data:this.state.data,animate:this.state.animate}):null}}const $i={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:function(){return document.body||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"document.body is not ready"):Ot()),document.body}},Bi=e=>{let t,n={...e};for(t in $i)void 0===e[t]&&(n={...n,[t]:$i[t]});return n},ki=(e,t)=>e===t.droppable.type,Fi=(e,t)=>t.draggables[e.draggable.id],Mi=Ye(()=>{const e={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},t={...e,shouldAnimatePlaceholder:!1},n=Kt(e=>({draggableId:e.id,type:e.type,source:{index:e.index,droppableId:e.droppableId}})),r=Kt((r,o,i,a,s,l)=>{const c=s.descriptor.id;if(s.descriptor.droppableId===r){const e=l?{render:l,dragging:n(s.descriptor)}:null;return{placeholder:s.placeholder,shouldAnimatePlaceholder:!1,snapshot:{isDraggingOver:i,draggingOverWith:i?c:null,draggingFromThisWith:c,isUsingPlaceholder:!0},useClone:e}}return o?a?{placeholder:s.placeholder,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:i,draggingOverWith:c,draggingFromThisWith:null,isUsingPlaceholder:!0},useClone:null}:e:t});return(n,o)=>{const i=Bi(o),a=i.droppableId,s=i.type,l=!i.isDropDisabled,c=i.renderClone;if(wo(n)){const e=n.critical;if(!ki(s,e))return t;const o=Fi(e,n.dimensions),i=Fn(n.impact)===a;return r(a,l,i,i,o,c)}if("DROP_ANIMATING"===n.phase){const e=n.completed;if(!ki(s,e.critical))return t;const o=Fi(e.critical,n.dimensions);return r(a,l,si(e.result)===a,Fn(e.impact)===a,o,c)}if("IDLE"===n.phase&&n.completed&&!n.shouldFlush){const r=n.completed;if(!ki(s,r.critical))return t;const o=Fn(r.impact)===a,i=Boolean(r.impact.at&&"COMBINE"===r.impact.at.type);return o?i?e:t:r.critical.droppable.id===a?e:t}return t}},{updateViewportMaxScroll:e=>({type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:e})},(e,t,n)=>({...Bi(n),...e,...t}),{context:fo,areStatePropsEqual:ai})(t=>{const n=e.useContext(Eo);n||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Could not find app context"):Ot());const{contextId:r,isMovementAllowed:o}=n,i=e.useRef(null),a=e.useRef(null),{children:s,droppableId:l,type:c,mode:d,direction:u,ignoreContainerClipping:p,isDropDisabled:f,isCombineEnabled:m,snapshot:h,useClone:E,updateViewportMaxScroll:v,getContainerForClone:y}=t,N=Bt(()=>i.current,[]),D=Bt((e=null)=>{i.current=e},[]),x=Bt(()=>a.current,[]),O=Bt((e=null)=>{a.current=e},[]);var w;w={props:t,getDroppableRef:N,getPlaceholderRef:x},xo(()=>{Ai(w,Vi),"standard"===w.props.mode&&Ai(w,Pi),"virtual"===w.props.mode&&Ai(w,Ti)});const _=Bt(()=>{o()&&v({maxScroll:$r()})},[o,v]);!function(t){const n=e.useRef(null),r=oi(Eo),o=bo("droppable"),{registry:i,marshal:a}=r,s=Oo(t),l=$t(()=>({id:t.droppableId,type:t.type,mode:t.mode}),[t.droppableId,t.mode,t.type]),c=e.useRef(l),d=$t(()=>Kt((e,t)=>{n.current||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Can only update scroll when dragging"):Ot()),a.updateDroppableScroll(l.id,{x:e,y:t})}),[l.id,a]),u=Bt(()=>{const e=n.current;return e&&e.env.closestScrollable?yi(e.env.closestScrollable):kt},[]),p=Bt(()=>{const e=u();d(e.x,e.y)},[u,d]),f=$t(()=>ct(p),[p]),g=Bt(()=>{const e=n.current,t=wi(e);e&&t||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Could not find scroll options while scrolling"):Ot()),e.scrollOptions.shouldPublishImmediately?p():f()},[f,p]),m=Bt((e,t)=>{n.current&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Cannot collect a droppable while a drag is occurring"):Ot());const o=s.current,i=o.getDroppableRef();i||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Cannot collect without a droppable ref"):Ot());const a={closestScrollable:vi(c=i),isFixedOnPage:Ni(c)};var c;const d={ref:i,descriptor:l,env:a,scrollOptions:t};n.current=d;const u=(({ref:e,descriptor:t,env:n,windowScroll:r,direction:o,isDropDisabled:i,isCombineEnabled:a,shouldClipSubject:s})=>{const l=n.closestScrollable,c=((e,t)=>{const n=lt(e);if(!t)return n;if(e!==t)return n;const r=n.paddingBox.top-t.scrollTop,o=n.paddingBox.left-t.scrollLeft,i=et({top:r,right:o+t.scrollWidth,bottom:r+t.scrollHeight,left:o},n.border);return rt({borderBox:i,margin:n.margin,border:n.border,padding:n.padding})})(e,l),d=at(c,r),u=(()=>{if(!l)return null;const e=lt(l),t={scrollHeight:l.scrollHeight,scrollWidth:l.scrollWidth};return{client:e,page:at(e,r),scroll:yi(l),scrollSize:t,shouldClipSubject:s}})(),p=(({descriptor:e,isEnabled:t,isCombineEnabled:n,isFixedOnPage:r,direction:o,client:i,page:a,closest:s})=>{const l=(()=>{if(!s)return null;const{scrollSize:e,client:t}=s,n=Tr({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,height:t.paddingBox.height,width:t.paddingBox.width});return{pageMarginBox:s.page.marginBox,frameClient:t,scrollSize:e,shouldClipSubject:s.shouldClipSubject,scroll:{initial:s.scroll,current:s.scroll,max:n,diff:{value:kt,displacement:kt}}}})(),c="vertical"===o?gn:mn;return{descriptor:e,isCombineEnabled:n,isFixedOnPage:r,axis:c,isEnabled:t,client:i,page:a,frame:l,subject:Zt({page:a,withPlaceholder:null,axis:c,frame:l})}})({descriptor:t,isEnabled:!i,isCombineEnabled:a,isFixedOnPage:n.isFixedOnPage,direction:o,client:c,page:d,closest:u});return p})({ref:i,descriptor:l,env:a,windowScroll:e,direction:o.direction,isDropDisabled:o.isDropDisabled,isCombineEnabled:o.isCombineEnabled,shouldClipSubject:!o.ignoreContainerClipping}),p=a.closestScrollable;return p&&(p.setAttribute(no.contextId,r.contextId),p.addEventListener("scroll",g,Oi(d.scrollOptions)),"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&(e=>{e&&vi(e.parentElement)&&"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&bt("\n Droppable: unsupported nested scroll container detected.\n A Droppable can only have one scroll parent (which can be itself)\n Nested scroll containers are currently not supported.\n\n We hope to support nested scroll containers soon: https://github.com/atlassian/react-beautiful-dnd/issues/131\n ")})(p)),u},[r.contextId,l,g,s]),h=Bt(()=>{const e=n.current,t=wi(e);return e&&t||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Can only recollect Droppable client for Droppables that have a scroll container"):Ot()),yi(t)},[]),b=Bt(()=>{const e=n.current;e||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Cannot stop drag when no active drag"):Ot());const t=wi(e);n.current=null,t&&(f.cancel(),t.removeAttribute(no.contextId),t.removeEventListener("scroll",g,Oi(e.scrollOptions)))},[g,f]),E=Bt(e=>{const t=n.current;t||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Cannot scroll when there is no drag"):Ot());const r=wi(t);r||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Ot(0,"Cannot scroll a droppable with no closest scrollable"):Ot()),r.scrollTop+=e.y,r.scrollLeft+=e.x},[]),v=$t(()=>({getDimensionAndWatchScroll:m,getScrollWhileDragging:h,dragStopped:b,scroll:E}),[b,m,h,E]),y=$t(()=>({uniqueId:o,descriptor:l,callbacks:v}),[v,l,o]);oo(()=>(c.current=y.descriptor,i.droppable.register(y),()=>{n.current&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV&&bt("Unsupported: changing the droppableId or type of a Droppable during a drag"),b()),i.droppable.unregister(y)}),[v,l,b,y,a,i.droppable]),oo(()=>{n.current&&a.updateDroppableIsEnabled(c.current.id,!t.isDropDisabled)},[t.isDropDisabled,a]),oo(()=>{n.current&&a.updateDroppableIsCombineEnabled(c.current.id,t.isCombineEnabled)},[t.isCombineEnabled,a])}({droppableId:l,type:c,mode:d,direction:u,isDropDisabled:f,isCombineEnabled:m,ignoreContainerClipping:p,getDroppableRef:N});const I=$t(()=>g.default.createElement(Ri,{on:t.placeholder,shouldAnimate:t.shouldAnimatePlaceholder},({onClose:e,data:t,animate:n})=>g.default.createElement(Si,{placeholder:t,onClose:e,innerRef:O,animate:n,contextId:r,onTransitionEnd:_})),[r,_,t.placeholder,t.shouldAnimatePlaceholder,O]),S=$t(()=>({innerRef:D,placeholder:I,droppableProps:{"data-rfd-droppable-id":l,"data-rfd-droppable-context-id":r}}),[r,l,I,D]),C=E?E.dragging.draggableId:null,A=$t(()=>({droppableId:l,type:c,isUsingCloneFor:C}),[l,C,c]);return g.default.createElement(ni.Provider,{value:A},s(S,h),function(){if(!E)return null;const{dragging:e,render:t}=E,n=g.default.createElement(ui,{draggableId:e.draggableId,index:e.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},(n,r)=>t(n,r,e));return b.default.createPortal(n,y())}())});var Li,ji=function(e){var t=e.children;return g.default.createElement(Mi,{droppableId:e.droppableId,renderClone:e.renderClone},function(e,n){return g.default.createElement(a.Box,D({ref:e.innerRef},e.droppableProps,{sx:(r=n.isDraggingOver,{height:"100%",transition:"background-color 0.2s ease",backgroundColor:r?"rgba(0,0,0,0.1)":"transparent"})}),t(e),e.placeholder);var r})},Gi=((Li={})[t.PresenceStatusEnum.Present]="success.main",Li[t.PresenceStatusEnum.NotPresent]="error.main",Li[t.PresenceStatusEnum.PresentElsewhere]="warning.main",Li),Ui=function(e){return D({display:"flex",alignItems:"center",gap:function(e){return e.spacing(1)},padding:function(e){return e.spacing(1)},borderBottom:"1px solid rgba(255, 255, 255, 0.15)",boxShadow:"none","&:last-of-type":{borderBottom:"none"}},e&&{opacity:.5})},Wi={name:{flexGrow:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},removeButton:{flexShrink:0,opacity:.6,padding:function(e){return e.spacing(.25)},marginLeft:"auto","&:hover":{opacity:1}}},qi=function(e){var t=e.provided,n=e.user;return g.default.createElement(a.Card,D({ref:t.innerRef},t.draggableProps,t.dragHandleProps,{sx:Ui(!0)}),g.default.createElement(a.Typography,{sx:Wi.name},n.name))},zi=function(e){var t=e.user,n=e.showPresence,r=e.presenceStatus,o=e.onRemove;return g.default.createElement(pi,{draggableId:e.draggableId,index:e.index},function(e,i){return g.default.createElement(a.Card,D({ref:e.innerRef},e.draggableProps,e.dragHandleProps,{sx:Ui(i.isDragging)}),n&&r&&g.default.createElement(a.Box,{sx:(s=r,{flexShrink:0,width:10,height:10,borderRadius:"50%",backgroundColor:Gi[s]})}),g.default.createElement(a.Typography,{sx:Wi.name},t.name),o&&g.default.createElement(a.IconButton,{size:"small",color:"error",onClick:o,sx:Wi.removeButton},g.default.createElement(v.default,{fontSize:"small"})));var s})},Hi={root:{display:"flex",flexDirection:"column",flexShrink:0,width:250,height:"100%"},header:{display:"flex",padding:function(e){return e.spacing(.5,1)}},action:{display:"flex",alignSelf:"center",margin:function(e){return e.spacing(0,0,0,1)}},count:{fontWeight:"bold"},search:{margin:function(e){return e.spacing(0,1,1,1)},"&.MuiFormControl-root":{margin:0},"& .MuiOutlinedInput-notchedOutline":{border:"none"},"& .MuiInputAdornment-root":{color:"text.primary"}},content:{flexGrow:1,padding:function(e){return e.spacing(.5)},overflow:"auto"}},Yi=function(t){var n=t.operators,r=e.useState(""),i=r[0],s=r[1],l=o.useTranslation().t,c=e.useMemo(function(){if(!i.trim())return n;var e=i.toLowerCase();return n.filter(function(t){return t.name.toLowerCase().includes(e)})},[n,i]);return g.default.createElement(a.Card,{sx:Hi.root},g.default.createElement(a.CardHeader,{title:l("unassignedPool"),action:n.length,slotProps:{title:{variant:"subtitle1"},action:{sx:Hi.action}},sx:Hi.header}),g.default.createElement(a.TextField,{size:"small",label:l("searchOperators"),value:i,onChange:function(e){return s(e.target.value)},sx:Hi.search,slotProps:{input:{startAdornment:g.default.createElement(a.InputAdornment,{position:"start"},g.default.createElement(E.default,{fontSize:"small"}))}}}),g.default.createElement(a.CardContent,{sx:Hi.content},g.default.createElement(ji,{droppableId:"pool",renderClone:function(e,t,n){return g.default.createElement(qi,{provided:e,user:c[n.source.index]})}},function(){return g.default.createElement(g.default.Fragment,null,c.map(function(e,t){return g.default.createElement(zi,{key:e.id,user:e,index:t,draggableId:e.id})}))})))},Zi={header:{display:"flex",padding:function(e){return e.spacing(.5,1)},"& .MuiCardHeader-content":{overflowX:"hidden"}},title:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},action:{display:"flex",alignSelf:"center",gap:function(e){return e.spacing(1)},margin:function(e){return e.spacing(0,0,0,1)}},content:{flexGrow:1,padding:function(e){return e.spacing(.5)}}},Xi=function(e){var t,n,r,o,i=e.assignment,s=e.onRemoveOperator,l=(t=i.assignedCount-i.recommendedOperators)>0?{text:"+"+t,status:"overcapacity"}:t<0?{text:""+t,status:"missing"}:{text:"OK",status:"ok"};return g.default.createElement(a.Card,{ref:e.registerRef,sx:(r=i.isOvercapacity,o=e.frozenHeight,D({display:"flex",flexDirection:"column",flexShrink:0,width:250,minHeight:200,border:r?2:1,borderColor:r?"error.main":"divider"},void 0!==o&&{overflow:"hidden",maxHeight:o}))},g.default.createElement(a.CardHeader,{title:i.workplace.name,action:g.default.createElement(g.default.Fragment,null,g.default.createElement(a.Typography,null,i.assignedCount+"/"+i.recommendedOperators),g.default.createElement(a.Typography,{variant:"caption",sx:(n=l.status,{padding:function(e){return e.spacing(.25)+" "+e.spacing(1)},borderRadius:1,color:"ok"===n?"success.contrastText":"error.contrastText",backgroundColor:"ok"===n?"success.main":"error.main"})},l.text)),slotProps:{title:{variant:"subtitle1",sx:Zi.title},action:{sx:Zi.action}},sx:Zi.header}),g.default.createElement(a.CardContent,{sx:Zi.content},g.default.createElement(ji,{droppableId:i.workplace.id,renderClone:function(e,t,n){return g.default.createElement(qi,{provided:e,user:i.assignedOperators[n.source.index].user})}},function(){return g.default.createElement(g.default.Fragment,null,i.assignedOperators.map(function(e,t){return g.default.createElement(zi,{key:e.user.id,user:e.user,index:t,draggableId:e.user.id,showPresence:!0,presenceStatus:e.presenceStatus,onRemove:s?function(){return s(e.user.id)}:void 0})}))})))},Ki={grid:function(e){return{display:"flex",flexDirection:"column",flexWrap:"wrap",alignContent:"flex-start",gap:e.spacing(1),height:"100%",overflowX:"auto"}}},Ji=function(n){var r=n.data,o=n.viewState,i=n.updateData,s=n.onMutationComplete,l=n.gqlClients.graphqlSdk,c=e.useState({}),d=c[0],u=c[1],p=e.useRef({}),f=e.useCallback(function(e,t){p.current[e]=t},[]),m=e.useCallback(function(e){var t={};Object.entries(p.current).forEach(function(e){var n=e[1];n&&(t[e[0]]=n.getBoundingClientRect().height)}),u(t)},[]),h=e.useCallback(function(e,t){if(l){var n=r.workplaces.find(function(e){return e.workplace.id===t}),a=null==n?void 0:n.assignedOperators.find(function(t){return t.user.id===e});n&&a&&(i({workplaces:r.workplaces.map(function(n){return n.workplace.id===t?D({},n,{assignedOperators:n.assignedOperators.filter(function(t){return t.user.id!==e}),assignedCount:n.assignedCount-1}):n}),unassignedOperators:[].concat(r.unassignedOperators,[a.user])}),l.unassignOperator({input:{userId:e,shiftId:o.shift.id,validFrom:o.date}}).catch(function(){}))}},[l,r,o,i]);return g.default.createElement(Qo,{onDragStart:m,onDragEnd:function(e){if(u({}),l){var n=function(e,n){var r=n.source,o=n.destination;if(!o)return null;if(r.droppableId===o.droppableId&&r.index===o.index)return null;var i,a=n.draggableId,s="pool"===r.droppableId,l="pool"===o.droppableId,c=t.PresenceStatusEnum.NotPresent,d=[].concat(e.unassignedOperators),u=e.workplaces.map(function(e){return D({},e,{assignedOperators:[].concat(e.assignedOperators)})});if(s){var p=d.findIndex(function(e){return e.id===a});-1!==p&&(i=d[p],d.splice(p,1))}else{var f=u.find(function(e){return e.workplace.id===r.droppableId});if(f){var g=f.assignedOperators.findIndex(function(e){return e.user.id===a});-1!==g&&(i=f.assignedOperators[g].user,c=f.assignedOperators[g].presenceStatus,f.assignedOperators.splice(g,1))}}if(!i)return null;if(l)d.splice(o.index,0,i);else{var m=u.find(function(e){return e.workplace.id===o.droppableId});m&&m.assignedOperators.splice(o.index,0,{user:i,presenceStatus:c})}return{workplaces:u,unassignedOperators:d}}(r,e);if(n){i(n);var a=e.destination,c=e.draggableId;"pool"===a.droppableId?l.unassignOperator({input:{userId:c,shiftId:o.shift.id,validFrom:o.date}}).then(s).catch(function(){}):l.assignOperator({input:{userId:c,workplaceId:a.droppableId,shiftId:o.shift.id,validFrom:o.date}}).then(s).catch(function(){})}}}},g.default.createElement(a.Box,{sx:Ki.grid},g.default.createElement(Yi,{operators:r.unassignedOperators}),r.workplaces.map(function(e){return g.default.createElement(Xi,{key:e.workplace.id,assignment:e,registerRef:function(t){return f(e.workplace.id,t)},frozenHeight:d[e.workplace.id],onRemoveOperator:function(t){return h(t,e.workplace.id)}})})))},Qi={root:{display:"flex",alignItems:"center",justifyContent:"center",gap:function(e){return e.spacing(2)},marginBottom:function(e){return e.spacing(1)},padding:function(e){return e.spacing(1)},borderBottom:"1px solid #717171",background:"#525860"},label:{minWidth:200,textAlign:"center",color:"rgba(255, 255, 255, 0.65)"}},ea=function(e){var t=e.viewState,n=e.departmentName,r=e.canPrev,o=e.canNext,i=void 0===o||o,s=e.onNavigate;return g.default.createElement(a.Box,{sx:Qi.root},g.default.createElement(a.IconButton,{color:"secondary",disabled:!(void 0===r||r),onClick:function(){return s("prev")}},g.default.createElement(y.default,null)),g.default.createElement(a.Typography,{sx:Qi.label},t.date," - ",t.shift.name,n&&" - "+n),g.default.createElement(a.IconButton,{color:"secondary",disabled:!i,onClick:function(){return s("next")}},g.default.createElement(N.default,null)))},ta={root:{display:"flex",flexDirection:"column",height:"100%"}},na=function(t){var n=t.data,r=t.updateData,i=t.gqlClients,s=t.settings,l=o.useTranslation().t,c=e.useState(null),d=c[0],u=c[1],p=e.useMemo(function(){if(null!=s&&s.departmentId){var e=n.departments.find(function(e){return e.id===s.departmentId});return null==e?void 0:e.name}},[null==s?void 0:s.departmentId,n.departments]),f=i.graphqlSdk;e.useEffect(function(){if(n.shifts.length>0&&!d){var e=w(n.shifts);e&&u(e)}},[n.shifts,d]);var m=e.useRef(null);m.current=function(){f&&d&&r&&f.workplaceAssignments({input:{date:d.date,shiftId:d.shift.id,departmentId:(null==s?void 0:s.departmentId)||void 0}}).then(function(e){return r(e.workplaceAssignments)}).catch(function(){})},e.useEffect(function(){if(d&&f){null==m.current||m.current();var e=setInterval(function(){return null==m.current?void 0:m.current()},1e3*((null==s?void 0:s.refreshInterval)||60));return function(){return clearInterval(e)}}},[d,f,null==s?void 0:s.departmentId,null==s?void 0:s.refreshInterval]);var b=e.useCallback(function(e){if(d){var t=function(e,t,n){if(!_(e,t,n))return e;var r=t.findIndex(function(t){return t.id===e.shift.id});return"next"===n?r<t.length-1?{date:e.date,shift:t[r+1]}:{date:h.default(e.date).add(1,"day").format("YYYY-MM-DD"),shift:t[0]}:r>0?{date:e.date,shift:t[r-1]}:{date:h.default(e.date).subtract(1,"day").format("YYYY-MM-DD"),shift:t[t.length-1]}}(d,n.shifts,e);u(t)}},[d,n.shifts]),E=!!d&&_(d,n.shifts,"prev"),v=!!d&&_(d,n.shifts,"next");return g.default.createElement(a.Box,{sx:ta.root},d?g.default.createElement(g.default.Fragment,null,g.default.createElement(ea,{viewState:d,departmentName:p,canPrev:E,canNext:v,onNavigate:b}),g.default.createElement(Ji,{data:n,viewState:d,gqlClients:i,updateData:r,onMutationComplete:function(){return null==m.current?void 0:m.current()}})):g.default.createElement(a.Typography,null,l("noShiftsAvailable")))};function ra(e){this._maxSize=e,this.clear()}ra.prototype.clear=function(){this._size=0,this._values=Object.create(null)},ra.prototype.get=function(e){return this._values[e]},ra.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var oa=/[^.^\]^[]+|(?=\[\]|\.\.)/g,ia=/^\d+$/,aa=/^\d/,sa=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,la=/^\s*(['"]?)(.*?)(\1)\s*$/,ca=new ra(512),da=new ra(512),ua=new ra(512),pa={Cache:ra,split:ga,normalizePath:fa,setter:function(e){var t=fa(e);return da.get(e)||da.set(e,function(e,n){for(var r=0,o=t.length,i=e;r<o-1;){var a=t[r];if("__proto__"===a||"constructor"===a||"prototype"===a)return e;i=i[t[r++]]}i[t[r]]=n})},getter:function(e,t){var n=fa(e);return ua.get(e)||ua.set(e,function(e){for(var r=0,o=n.length;r<o;){if(null==e&&t)return;e=e[n[r++]]}return e})},join:function(e){return e.reduce(function(e,t){return e+(ma(t)||ia.test(t)?"["+t+"]":(e?".":"")+t)},"")},forEach:function(e,t,n){!function(e,t,n){var r,o,i,a,s=e.length;for(o=0;o<s;o++)(r=e[o])&&(ha(r)&&(r='"'+r+'"'),i=!(a=ma(r))&&/^\d+$/.test(r),t.call(n,r,a,i,o,e))}(Array.isArray(e)?e:ga(e),t,n)}};function fa(e){return ca.get(e)||ca.set(e,ga(e).map(function(e){return e.replace(la,"$2")}))}function ga(e){return e.match(oa)||[""]}function ma(e){return"string"==typeof e&&e&&-1!==["'",'"'].indexOf(e.charAt(0))}function ha(e){return!ma(e)&&(function(e){return e.match(aa)&&!e.match(ia)}(e)||function(e){return sa.test(e)}(e))}const ba=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,Ea=e=>e.match(ba)||[];var va=e=>Ea(e).reduce((e,t)=>`${e}${e?t[0].toUpperCase()+t.slice(1).toLowerCase():t.toLowerCase()}`,""),ya=e=>(e=>Ea(e).join("_").toLowerCase())(e),Na=function(e){return Da(function(e){for(var t=new Set,n=0,r=e.length;n<r;n++){var o=e[n];t.add(o[0]),t.add(o[1])}return Array.from(t)}(e),e)};function Da(e,t){var n=e.length,r=new Array(n),o={},i=n,a=function(e){for(var t=new Map,n=0,r=e.length;n<r;n++){var o=e[n];t.has(o[0])||t.set(o[0],new Set),t.has(o[1])||t.set(o[1],new Set),t.get(o[0]).add(o[1])}return t}(t),s=function(e){for(var t=new Map,n=0,r=e.length;n<r;n++)t.set(e[n],n);return t}(e);for(t.forEach(function(e){if(!s.has(e[0])||!s.has(e[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});i--;)o[i]||l(e[i],i,new Set);return r;function l(e,t,i){if(i.has(e)){var c;try{c=", node was:"+JSON.stringify(e)}catch(e){c=""}throw new Error("Cyclic dependency"+c)}if(!s.has(e))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(e));if(!o[t]){o[t]=!0;var d=a.get(e)||new Set;if(t=(d=Array.from(d)).length){i.add(e);do{var u=d[--t];l(u,s.get(u),i)}while(t);i.delete(e)}r[--n]=e}}}Na.array=Da;const xa=Object.prototype.toString,Oa=Error.prototype.toString,wa=RegExp.prototype.toString,_a="undefined"!=typeof Symbol?Symbol.prototype.toString:()=>"",Ia=/^Symbol\((.*)\)(.*)$/;function Sa(e,t=!1){if(null==e||!0===e||!1===e)return""+e;const n=typeof e;if("number"===n)return function(e){return e!=+e?"NaN":0===e&&1/e<0?"-0":""+e}(e);if("string"===n)return t?`"${e}"`:e;if("function"===n)return"[Function "+(e.name||"anonymous")+"]";if("symbol"===n)return _a.call(e).replace(Ia,"Symbol($1)");const r=xa.call(e).slice(8,-1);return"Date"===r?isNaN(e.getTime())?""+e:e.toISOString(e):"Error"===r||e instanceof Error?"["+Oa.call(e)+"]":"RegExp"===r?wa.call(e):null}function Ca(e,t){let n=Sa(e,t);return null!==n?n:JSON.stringify(e,function(e,n){let r=Sa(this[e],t);return null!==r?r:n},2)}function Aa(e){return null==e?[]:[].concat(e)}let Va,Pa,Ta,Ra=/\$\{\s*(\w+)\s*\}/g;Va=Symbol.toStringTag;class $a{constructor(e,t,n,r){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[Va]="Error",this.name="ValidationError",this.value=t,this.path=n,this.type=r,this.errors=[],this.inner=[],Aa(e).forEach(e=>{Ba.isError(e)?(this.errors.push(...e.errors),this.inner.push(...e.inner.length?e.inner:[e])):this.errors.push(e)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}Pa=Symbol.hasInstance,Ta=Symbol.toStringTag;class Ba extends Error{static formatError(e,t){return t=Object.assign({},t,{path:t.label||t.path||"this",originalPath:t.path}),"string"==typeof e?e.replace(Ra,(e,n)=>Ca(t[n])):"function"==typeof e?e(t):e}static isError(e){return e&&"ValidationError"===e.name}constructor(e,t,n,r,o){const i=new $a(e,t,n,r);if(o)return i;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[Ta]="Error",this.name=i.name,this.message=i.message,this.type=i.type,this.value=i.value,this.path=i.path,this.errors=i.errors,this.inner=i.inner,Error.captureStackTrace&&Error.captureStackTrace(this,Ba)}static[Pa](e){return $a[Symbol.hasInstance](e)||super[Symbol.hasInstance](e)}}let ka={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:n,originalValue:r})=>{const o=null!=r&&r!==n?` (cast from the value \`${Ca(r,!0)}\`).`:".";return"mixed"!==t?`${e} must be a \`${t}\` type, but the final value was: \`${Ca(n,!0)}\``+o:`${e} must match the configured type. The validated value was: \`${Ca(n,!0)}\``+o}},Fa={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},Ma={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},La={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},ja={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},Ga={notType:e=>{const{path:t,value:n,spec:r}=e,o=r.types.length;if(Array.isArray(n)){if(n.length<o)return`${t} tuple value has too few items, expected a length of ${o} but got ${n.length} for value: \`${Ca(n,!0)}\``;if(n.length>o)return`${t} tuple value has too many items, expected a length of ${o} but got ${n.length} for value: \`${Ca(n,!0)}\``}return Ba.formatError(ka.notType,e)}};var Ua=Object.assign(Object.create(null),{mixed:ka,string:Fa,number:Ma,date:La,object:ja,array:{min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},boolean:{isValue:"${path} field must be ${value}"},tuple:Ga});const Wa=e=>e&&e.__isYupSchema__;class qa{static fromOptions(e,t){if(!t.then&&!t.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:n,then:r,otherwise:o}=t,i="function"==typeof n?n:(...e)=>e.every(e=>e===n);return new qa(e,(e,t)=>{var n;let a=i(...e)?r:o;return null!=(n=null==a?void 0:a(t))?n:t})}constructor(e,t){this.fn=void 0,this.refs=e,this.refs=e,this.fn=t}resolve(e,t){let n=this.refs.map(e=>e.getValue(null==t?void 0:t.value,null==t?void 0:t.parent,null==t?void 0:t.context)),r=this.fn(n,e,t);if(void 0===r||r===e)return e;if(!Wa(r))throw new TypeError("conditions must return a schema object");return r.resolve(t)}}class za{constructor(e,t={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,"string"!=typeof e)throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),""===e)throw new TypeError("ref must be a non-empty string");this.isContext="$"===this.key[0],this.isValue="."===this.key[0],this.isSibling=!this.isContext&&!this.isValue,this.path=this.key.slice((this.isContext?"$":this.isValue?".":"").length),this.getter=this.path&&pa.getter(this.path,!0),this.map=t.map}getValue(e,t,n){let r=this.isContext?n:this.isValue?e:t;return this.getter&&(r=this.getter(r||{})),this.map&&(r=this.map(r)),r}cast(e,t){return this.getValue(e,null==t?void 0:t.parent,null==t?void 0:t.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}}za.prototype.__isYupRef=!0;const Ha=e=>null==e;function Ya(e){function t({value:t,path:n="",options:r,originalValue:o,schema:i},a,s){const{name:l,test:c,params:d,message:u,skipAbsent:p}=e;let{parent:f,context:g,abortEarly:m=i.spec.abortEarly,disableStackTrace:h=i.spec.disableStackTrace}=r;const b={value:t,parent:f,context:g};function E(e={}){const r=Za(Object.assign({value:t,originalValue:o,label:i.spec.label,path:e.path||n,spec:i.spec,disableStackTrace:e.disableStackTrace||h},d,e.params),b),a=new Ba(Ba.formatError(e.message||u,r),t,r.path,e.type||l,r.disableStackTrace);return a.params=r,a}const v=m?a:s;let y={path:n,parent:f,type:l,from:r.from,createError:E,resolve:e=>Xa(e,b),options:r,originalValue:o,schema:i};const N=e=>{Ba.isError(e)?v(e):e?s(null):v(E())},D=e=>{Ba.isError(e)?v(e):a(e)};if(p&&Ha(t))return N(!0);let x;try{var O;if(x=c.call(y,t,y),"function"==typeof(null==(O=x)?void 0:O.then)){if(r.sync)throw new Error(`Validation test of type: "${y.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(x).then(N,D)}}catch(e){return void D(e)}N(x)}return t.OPTIONS=e,t}function Za(e,t){if(!e)return e;for(const n of Object.keys(e))e[n]=Xa(e[n],t);return e}function Xa(e,t){return za.isRef(e)?e.getValue(t.value,t.parent,t.context):e}function Ka(e,t,n,r=n){let o,i,a;return t?(pa.forEach(t,(s,l,c)=>{let d=l?s.slice(1,s.length-1):s,u="tuple"===(e=e.resolve({context:r,parent:o,value:n})).type,p=c?parseInt(d,10):0;if(e.innerType||u){if(u&&!c)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${a}" must contain an index to the tuple element, e.g. "${a}[0]"`);if(n&&p>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${s}, in the path: ${t}. because there is no value at that index. `);o=n,n=n&&n[p],e=u?e.spec.types[p]:e.innerType}if(!c){if(!e.fields||!e.fields[d])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${a} which is a type: "${e.type}")`);o=n,n=n&&n[d],e=e.fields[d]}i=d,a=l?"["+s+"]":"."+s}),{schema:e,parent:o,parentPath:i}):{parent:o,parentPath:t,schema:e}}class Ja extends Set{describe(){const e=[];for(const t of this.values())e.push(za.isRef(t)?t.describe():t);return e}resolveAll(e){let t=[];for(const n of this.values())t.push(e(n));return t}clone(){return new Ja(this.values())}merge(e,t){const n=this.clone();return e.forEach(e=>n.add(e)),t.forEach(e=>n.delete(e)),n}}function Qa(e,t=new Map){if(Wa(e)||!e||"object"!=typeof e)return e;if(t.has(e))return t.get(e);let n;if(e instanceof Date)n=new Date(e.getTime()),t.set(e,n);else if(e instanceof RegExp)n=new RegExp(e),t.set(e,n);else if(Array.isArray(e)){n=new Array(e.length),t.set(e,n);for(let r=0;r<e.length;r++)n[r]=Qa(e[r],t)}else if(e instanceof Map){n=new Map,t.set(e,n);for(const[r,o]of e.entries())n.set(r,Qa(o,t))}else if(e instanceof Set){n=new Set,t.set(e,n);for(const r of e)n.add(Qa(r,t))}else{if(!(e instanceof Object))throw Error(`Unable to clone ${e}`);n={},t.set(e,n);for(const[r,o]of Object.entries(e))n[r]=Qa(o,t)}return n}function es(e){if(null==e||!e.length)return;const t=[];let n="",r=!1,o=!1;for(let i=0;i<e.length;i++){const a=e[i];"["!==a||o?"]"!==a||o?'"'!==a?"."!==a||r||o?n+=a:n&&(t.push(n),n=""):o=!o:(n&&(/^\d+$/.test(n)?t.push(n):t.push(n.replace(/^"|"$/g,"")),n=""),r=!1):(n&&(t.push(...n.split(".").filter(Boolean)),n=""),r=!0)}return n&&t.push(...n.split(".").filter(Boolean)),t}function ts(e,t){var n;if((null==(n=e.inner)||!n.length)&&e.errors.length)return function(e,t){const n=t?`${t}.${e.path}`:e.path;return e.errors.map(e=>({message:e,path:es(n)}))}(e,t);const r=t?`${t}.${e.path}`:e.path;return e.inner.flatMap(e=>ts(e,r))}class ns{constructor(e){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new Ja,this._blacklist=new Ja,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(ka.notType)}),this.type=e.type,this._typeCheck=e.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},null==e?void 0:e.spec),this.withMutation(e=>{e.nonNullable()})}get _type(){return this.type}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;const t=Object.create(Object.getPrototypeOf(this));return t.type=this.type,t._typeCheck=this._typeCheck,t._whitelist=this._whitelist.clone(),t._blacklist=this._blacklist.clone(),t.internalTests=Object.assign({},this.internalTests),t.exclusiveTests=Object.assign({},this.exclusiveTests),t.deps=[...this.deps],t.conditions=[...this.conditions],t.tests=[...this.tests],t.transforms=[...this.transforms],t.spec=Qa(Object.assign({},this.spec,e)),t}label(e){let t=this.clone();return t.spec.label=e,t}meta(...e){if(0===e.length)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},e[0]),t}withMutation(e){let t=this._mutate;this._mutate=!0;let n=e(this);return this._mutate=t,n}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&"mixed"!==this.type)throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let t=this,n=e.clone();const r=Object.assign({},t.spec,n.spec);return n.spec=r,n.internalTests=Object.assign({},t.internalTests,n.internalTests),n._whitelist=t._whitelist.merge(e._whitelist,e._blacklist),n._blacklist=t._blacklist.merge(e._blacklist,e._whitelist),n.tests=t.tests,n.exclusiveTests=t.exclusiveTests,n.withMutation(t=>{e.tests.forEach(e=>{t.test(e.OPTIONS)})}),n.transforms=[...t.transforms,...n.transforms],n}isType(e){return null==e?!(!this.spec.nullable||null!==e)||!(!this.spec.optional||void 0!==e):this._typeCheck(e)}resolve(e){let t=this;if(t.conditions.length){let n=t.conditions;t=t.clone(),t.conditions=[],t=n.reduce((t,n)=>n.resolve(t,e),t),t=t.resolve(e)}return t}resolveOptions(e){var t,n,r,o;return Object.assign({},e,{from:e.from||[],strict:null!=(t=e.strict)?t:this.spec.strict,abortEarly:null!=(n=e.abortEarly)?n:this.spec.abortEarly,recursive:null!=(r=e.recursive)?r:this.spec.recursive,disableStackTrace:null!=(o=e.disableStackTrace)?o:this.spec.disableStackTrace})}cast(e,t={}){let n=this.resolve(Object.assign({},t,{value:e})),r="ignore-optionality"===t.assert,o=n._cast(e,t);if(!1!==t.assert&&!n.isType(o)){if(r&&Ha(o))return o;let i=Ca(e),a=Ca(o);throw new TypeError(`The value of ${t.path||"field"} could not be cast to a value that satisfies the schema type: "${n.type}". \n\nattempted value: ${i} \n`+(a!==i?`result of cast: ${a}`:""))}return o}_cast(e,t){let n=void 0===e?e:this.transforms.reduce((n,r)=>r.call(this,n,e,this,t),e);return void 0===n&&(n=this.getDefault(t)),n}_validate(e,t={},n,r){let{path:o,originalValue:i=e,strict:a=this.spec.strict}=t,s=e;a||(s=this._cast(s,Object.assign({assert:!1},t)));let l=[];for(let e of Object.values(this.internalTests))e&&l.push(e);this.runTests({path:o,value:s,originalValue:i,options:t,tests:l},n,e=>{if(e.length)return r(e,s);this.runTests({path:o,value:s,originalValue:i,options:t,tests:this.tests},n,r)})}runTests(e,t,n){let r=!1,{tests:o,value:i,originalValue:a,path:s,options:l}=e,c=e=>{r||(r=!0,t(e,i))},d=e=>{r||(r=!0,n(e,i))},u=o.length,p=[];if(!u)return d([]);let f={value:i,originalValue:a,path:s,options:l,schema:this};for(let e=0;e<o.length;e++)(0,o[e])(f,c,function(e){e&&(Array.isArray(e)?p.push(...e):p.push(e)),--u<=0&&d(p)})}asNestedTest({key:e,index:t,parent:n,parentPath:r,originalParent:o,options:i}){const a=null!=e?e:t;if(null==a)throw TypeError("Must include `key` or `index` for nested validations");const s="number"==typeof a;let l=n[a];const c=Object.assign({},i,{strict:!0,parent:n,value:l,originalValue:o[a],key:void 0,[s?"index":"key"]:a,path:s||a.includes(".")?`${r||""}[${s?a:`"${a}"`}]`:(r?`${r}.`:"")+e});return(e,t,n)=>this.resolve(c)._validate(l,c,t,n)}validate(e,t){var n;let r=this.resolve(Object.assign({},t,{value:e})),o=null!=(n=null==t?void 0:t.disableStackTrace)?n:r.spec.disableStackTrace;return new Promise((n,i)=>r._validate(e,t,(e,t)=>{Ba.isError(e)&&(e.value=t),i(e)},(e,t)=>{e.length?i(new Ba(e,t,void 0,void 0,o)):n(t)}))}validateSync(e,t){var n;let r,o=this.resolve(Object.assign({},t,{value:e})),i=null!=(n=null==t?void 0:t.disableStackTrace)?n:o.spec.disableStackTrace;return o._validate(e,Object.assign({},t,{sync:!0}),(e,t)=>{throw Ba.isError(e)&&(e.value=t),e},(t,n)=>{if(t.length)throw new Ba(t,e,void 0,void 0,i);r=n}),r}isValid(e,t){return this.validate(e,t).then(()=>!0,e=>{if(Ba.isError(e))return!1;throw e})}isValidSync(e,t){try{return this.validateSync(e,t),!0}catch(e){if(Ba.isError(e))return!1;throw e}}_getDefault(e){let t=this.spec.default;return null==t?t:"function"==typeof t?t.call(this,e):Qa(t)}getDefault(e){return this.resolve(e||{})._getDefault(e)}default(e){return 0===arguments.length?this._getDefault():this.clone({default:e})}strict(e=!0){return this.clone({strict:e})}nullability(e,t){const n=this.clone({nullable:e});return n.internalTests.nullable=Ya({message:t,name:"nullable",test(e){return null!==e||this.schema.spec.nullable}}),n}optionality(e,t){const n=this.clone({optional:e});return n.internalTests.optionality=Ya({message:t,name:"optionality",test(e){return void 0!==e||this.schema.spec.optional}}),n}optional(){return this.optionality(!0)}defined(e=ka.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=ka.notNull){return this.nullability(!1,e)}required(e=ka.required){return this.clone().withMutation(t=>t.nonNullable(e).defined(e))}notRequired(){return this.clone().withMutation(e=>e.nullable().optional())}transform(e){let t=this.clone();return t.transforms.push(e),t}test(...e){let t;if(t=1===e.length?"function"==typeof e[0]?{test:e[0]}:e[0]:2===e.length?{name:e[0],test:e[1]}:{name:e[0],message:e[1],test:e[2]},void 0===t.message&&(t.message=ka.default),"function"!=typeof t.test)throw new TypeError("`test` is a required parameters");let n=this.clone(),r=Ya(t),o=t.exclusive||t.name&&!0===n.exclusiveTests[t.name];if(t.exclusive&&!t.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return t.name&&(n.exclusiveTests[t.name]=!!t.exclusive),n.tests=n.tests.filter(e=>{if(e.OPTIONS.name===t.name){if(o)return!1;if(e.OPTIONS.test===r.OPTIONS.test)return!1}return!0}),n.tests.push(r),n}when(e,t){Array.isArray(e)||"string"==typeof e||(t=e,e=".");let n=this.clone(),r=Aa(e).map(e=>new za(e));return r.forEach(e=>{e.isSibling&&n.deps.push(e.key)}),n.conditions.push("function"==typeof t?new qa(r,t):qa.fromOptions(r,t)),n}typeError(e){let t=this.clone();return t.internalTests.typeError=Ya({message:e,name:"typeError",skipAbsent:!0,test(e){return!!this.schema._typeCheck(e)||this.createError({params:{type:this.schema.type}})}}),t}oneOf(e,t=ka.oneOf){let n=this.clone();return e.forEach(e=>{n._whitelist.add(e),n._blacklist.delete(e)}),n.internalTests.whiteList=Ya({message:t,name:"oneOf",skipAbsent:!0,test(e){let t=this.schema._whitelist,n=t.resolveAll(this.resolve);return!!n.includes(e)||this.createError({params:{values:Array.from(t).join(", "),resolved:n}})}}),n}notOneOf(e,t=ka.notOneOf){let n=this.clone();return e.forEach(e=>{n._blacklist.add(e),n._whitelist.delete(e)}),n.internalTests.blacklist=Ya({message:t,name:"notOneOf",test(e){let t=this.schema._blacklist,n=t.resolveAll(this.resolve);return!n.includes(e)||this.createError({params:{values:Array.from(t).join(", "),resolved:n}})}}),n}strip(e=!0){let t=this.clone();return t.spec.strip=e,t}describe(e){const t=(e?this.resolve(e):this).clone(),{label:n,meta:r,optional:o,nullable:i}=t.spec;return{meta:r,label:n,optional:o,nullable:i,default:t.getDefault(e),type:t.type,oneOf:t._whitelist.describe(),notOneOf:t._blacklist.describe(),tests:t.tests.filter((e,t,n)=>n.findIndex(t=>t.OPTIONS.name===e.OPTIONS.name)===t).map(t=>{const n=t.OPTIONS.params&&e?Za(Object.assign({},t.OPTIONS.params),e):t.OPTIONS.params;return{name:t.OPTIONS.name,params:n}})}}get"~standard"(){const e=this;return{version:1,vendor:"yup",async validate(t){try{return{value:await e.validate(t,{abortEarly:!1})}}catch(e){if(e instanceof Ba)return{issues:ts(e)};throw e}}}}}ns.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])ns.prototype[`${e}At`]=function(t,n,r={}){const{parent:o,parentPath:i,schema:a}=Ka(this,t,n,r.context);return a[e](o&&o[i],Object.assign({},r,{parent:o,path:t}))};for(const e of["equals","is"])ns.prototype[e]=ns.prototype.oneOf;for(const e of["not","nope"])ns.prototype[e]=ns.prototype.notOneOf;const rs=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function os(e){var t,n;const r=rs.exec(e);return r?{year:is(r[1]),month:is(r[2],1)-1,day:is(r[3],1),hour:is(r[4]),minute:is(r[5]),second:is(r[6]),millisecond:r[7]?is(r[7].substring(0,3)):0,precision:null!=(t=null==(n=r[7])?void 0:n.length)?t:void 0,z:r[8]||void 0,plusMinus:r[9]||void 0,hourOffset:is(r[10]),minuteOffset:is(r[11])}:null}function is(e,t=0){return Number(e)||t}let as=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,ss=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,ls=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,cs=new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"),ds=e=>Ha(e)||e===e.trim(),us={}.toString();function ps(){return new fs}class fs extends ns{constructor(){super({type:"string",check:e=>(e instanceof String&&(e=e.valueOf()),"string"==typeof e)}),this.withMutation(()=>{this.transform((e,t)=>{if(!this.spec.coerce||this.isType(e))return e;if(Array.isArray(e))return e;const n=null!=e&&e.toString?e.toString():e;return n===us?e:n})})}required(e){return super.required(e).withMutation(t=>t.test({message:e||ka.required,name:"required",skipAbsent:!0,test:e=>!!e.length}))}notRequired(){return super.notRequired().withMutation(e=>(e.tests=e.tests.filter(e=>"required"!==e.OPTIONS.name),e))}length(e,t=Fa.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(t){return t.length===this.resolve(e)}})}min(e,t=Fa.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(t){return t.length>=this.resolve(e)}})}max(e,t=Fa.max){return this.test({name:"max",exclusive:!0,message:t,params:{max:e},skipAbsent:!0,test(t){return t.length<=this.resolve(e)}})}matches(e,t){let n,r,o=!1;return t&&("object"==typeof t?({excludeEmptyString:o=!1,message:n,name:r}=t):n=t),this.test({name:r||"matches",message:n||Fa.matches,params:{regex:e},skipAbsent:!0,test:t=>""===t&&o||-1!==t.search(e)})}email(e=Fa.email){return this.matches(as,{name:"email",message:e,excludeEmptyString:!0})}url(e=Fa.url){return this.matches(ss,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=Fa.uuid){return this.matches(ls,{name:"uuid",message:e,excludeEmptyString:!1})}datetime(e){let t,n,r="";return e&&("object"==typeof e?({message:r="",allowOffset:t=!1,precision:n}=e):r=e),this.matches(cs,{name:"datetime",message:r||Fa.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:r||Fa.datetime_offset,params:{allowOffset:t},skipAbsent:!0,test:e=>{if(!e||t)return!0;const n=os(e);return!!n&&!!n.z}}).test({name:"datetime_precision",message:r||Fa.datetime_precision,params:{precision:n},skipAbsent:!0,test:e=>{if(!e||null==n)return!0;const t=os(e);return!!t&&t.precision===n}})}ensure(){return this.default("").transform(e=>null===e?"":e)}trim(e=Fa.trim){return this.transform(e=>null!=e?e.trim():e).test({message:e,name:"trim",test:ds})}lowercase(e=Fa.lowercase){return this.transform(e=>Ha(e)?e:e.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:e=>Ha(e)||e===e.toLowerCase()})}uppercase(e=Fa.uppercase){return this.transform(e=>Ha(e)?e:e.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:e=>Ha(e)||e===e.toUpperCase()})}}function gs(){return new ms}ps.prototype=fs.prototype;class ms extends ns{constructor(){super({type:"number",check:e=>(e instanceof Number&&(e=e.valueOf()),"number"==typeof e&&!(e=>e!=+e)(e))}),this.withMutation(()=>{this.transform((e,t)=>{if(!this.spec.coerce)return e;let n=e;if("string"==typeof n){if(n=n.replace(/\s/g,""),""===n)return NaN;n=+n}return this.isType(n)||null===n?n:parseFloat(n)})})}min(e,t=Ma.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(t){return t>=this.resolve(e)}})}max(e,t=Ma.max){return this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(t){return t<=this.resolve(e)}})}lessThan(e,t=Ma.lessThan){return this.test({message:t,name:"max",exclusive:!0,params:{less:e},skipAbsent:!0,test(t){return t<this.resolve(e)}})}moreThan(e,t=Ma.moreThan){return this.test({message:t,name:"min",exclusive:!0,params:{more:e},skipAbsent:!0,test(t){return t>this.resolve(e)}})}positive(e=Ma.positive){return this.moreThan(0,e)}negative(e=Ma.negative){return this.lessThan(0,e)}integer(e=Ma.integer){return this.test({name:"integer",message:e,skipAbsent:!0,test:e=>Number.isInteger(e)})}truncate(){return this.transform(e=>Ha(e)?e:0|e)}round(e){var t;let n=["ceil","floor","round","trunc"];if("trunc"===(e=(null==(t=e)?void 0:t.toLowerCase())||"round"))return this.truncate();if(-1===n.indexOf(e.toLowerCase()))throw new TypeError("Only valid options for round() are: "+n.join(", "));return this.transform(t=>Ha(t)?t:Math[e](t))}}gs.prototype=ms.prototype;let hs=new Date("");class bs extends ns{constructor(){super({type:"date",check:e=>"[object Date]"===Object.prototype.toString.call(e)&&!isNaN(e.getTime())}),this.withMutation(()=>{this.transform((e,t)=>!this.spec.coerce||this.isType(e)||null===e?e:(e=function(e){const t=os(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;if(void 0===t.z&&void 0===t.plusMinus)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let n=0;return"Z"!==t.z&&void 0!==t.plusMinus&&(n=60*t.hourOffset+t.minuteOffset,"+"===t.plusMinus&&(n=0-n)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+n,t.second,t.millisecond)}(e),isNaN(e)?bs.INVALID_DATE:new Date(e)))})}prepareParam(e,t){let n;if(za.isRef(e))n=e;else{let r=this.cast(e);if(!this._typeCheck(r))throw new TypeError(`\`${t}\` must be a Date or a value that can be \`cast()\` to a Date`);n=r}return n}min(e,t=La.min){let n=this.prepareParam(e,"min");return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(e){return e>=this.resolve(n)}})}max(e,t=La.max){let n=this.prepareParam(e,"max");return this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(e){return e<=this.resolve(n)}})}}function Es(e,t){let n=Infinity;return e.some((e,r)=>{var o;if(null!=(o=t.path)&&o.includes(e))return n=r,!0}),n}function vs(e){return(t,n)=>Es(e,t)-Es(e,n)}bs.INVALID_DATE=hs;const ys=(e,t,n)=>{if("string"!=typeof e)return e;let r=e;try{r=JSON.parse(e)}catch(e){}return n.isType(r)?r:e};function Ns(e){if("fields"in e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=Ns(r);return e.setFields(t)}if("array"===e.type){const t=e.optional();return t.innerType&&(t.innerType=Ns(t.innerType)),t}return"tuple"===e.type?e.optional().clone({types:e.spec.types.map(Ns)}):"optional"in e?e.optional():e}let Ds=e=>"[object Object]"===Object.prototype.toString.call(e);function xs(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(e=>-1===n.indexOf(e))}const Os=vs([]);function ws(e){return new _s(e)}class _s extends ns{constructor(e){super({type:"object",check:e=>Ds(e)||"function"==typeof e}),this.fields=Object.create(null),this._sortErrors=Os,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{e&&this.shape(e)})}_cast(e,t={}){var n;let r=super._cast(e,t);if(void 0===r)return this.getDefault(t);if(!this._typeCheck(r))return r;let o=this.fields,i=null!=(n=t.stripUnknown)?n:this.spec.noUnknown,a=[].concat(this._nodes,Object.keys(r).filter(e=>!this._nodes.includes(e))),s={},l=Object.assign({},t,{parent:s,__validating:t.__validating||!1}),c=!1;for(const e of a){let n=o[e],a=e in r,d=r[e];if(n){let o;l.path=(t.path?`${t.path}.`:"")+e,n=n.resolve({value:d,context:t.context,parent:s});let i=n instanceof ns?n.spec:void 0,a=null==i?void 0:i.strict;if(null!=i&&i.strip){c=c||e in r;continue}o=t.__validating&&a?d:n.cast(d,l),void 0!==o&&(s[e]=o)}else a&&!i&&(s[e]=d);a===e in s&&s[e]===d||(c=!0)}return c?s:r}_validate(e,t={},n,r){let{from:o=[],originalValue:i=e,recursive:a=this.spec.recursive}=t;t.from=[{schema:this,value:i},...o],t.__validating=!0,t.originalValue=i,super._validate(e,t,n,(e,o)=>{if(!a||!Ds(o))return void r(e,o);i=i||o;let s=[];for(let e of this._nodes){let n=this.fields[e];n&&!za.isRef(n)&&s.push(n.asNestedTest({options:t,key:e,parent:o,parentPath:t.path,originalParent:i}))}this.runTests({tests:s,value:o,originalValue:i,options:t},n,t=>{r(t.sort(this._sortErrors).concat(e),o)})})}clone(e){const t=super.clone(e);return t.fields=Object.assign({},this.fields),t._nodes=this._nodes,t._excludedEdges=this._excludedEdges,t._sortErrors=this._sortErrors,t}concat(e){let t=super.concat(e),n=t.fields;for(let[e,t]of Object.entries(this.fields)){const r=n[e];n[e]=void 0===r?t:r}return t.withMutation(t=>t.setFields(n,[...this._excludedEdges,...e._excludedEdges]))}_getDefault(e){if("default"in this.spec)return super._getDefault(e);if(!this._nodes.length)return;let t={};return this._nodes.forEach(n=>{var r;const o=this.fields[n];let i=e;null!=(r=i)&&r.value&&(i=Object.assign({},i,{parent:i.value,value:i.value[n]})),t[n]=o&&"getDefault"in o?o.getDefault(i):void 0}),t}setFields(e,t){let n=this.clone();return n.fields=e,n._nodes=function(e,t=[]){let n=[],r=new Set,o=new Set(t.map(([e,t])=>`${e}-${t}`));function i(e,t){let i=pa.split(e)[0];r.add(i),o.has(`${t}-${i}`)||n.push([t,i])}for(const t of Object.keys(e)){let n=e[t];r.add(t),za.isRef(n)&&n.isSibling?i(n.path,t):Wa(n)&&"deps"in n&&n.deps.forEach(e=>i(e,t))}return Na.array(Array.from(r),n).reverse()}(e,t),n._sortErrors=vs(Object.keys(e)),t&&(n._excludedEdges=t),n}shape(e,t=[]){return this.clone().withMutation(n=>{let r=n._excludedEdges;return t.length&&(Array.isArray(t[0])||(t=[t]),r=[...n._excludedEdges,...t]),n.setFields(Object.assign(n.fields,e),r)})}partial(){const e={};for(const[t,n]of Object.entries(this.fields))e[t]="optional"in n&&n.optional instanceof Function?n.optional():n;return this.setFields(e)}deepPartial(){return Ns(this)}pick(e){const t={};for(const n of e)this.fields[n]&&(t[n]=this.fields[n]);return this.setFields(t,this._excludedEdges.filter(([t,n])=>e.includes(t)&&e.includes(n)))}omit(e){const t=[];for(const n of Object.keys(this.fields))e.includes(n)||t.push(n);return this.pick(t)}from(e,t,n){let r=pa.getter(e,!0);return this.transform(o=>{if(!o)return o;let i=o;return((e,t)=>{const n=[...pa.normalizePath(t)];if(1===n.length)return n[0]in e;let r=n.pop(),o=pa.getter(pa.join(n),!0)(e);return!(!o||!(r in o))})(o,e)&&(i=Object.assign({},o),n||delete i[e],i[t]=r(o)),i})}json(){return this.transform(ys)}exact(e){return this.test({name:"exact",exclusive:!0,message:e||ja.exact,test(e){if(null==e)return!0;const t=xs(this.schema,e);return 0===t.length||this.createError({params:{properties:t.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(e=!0,t=ja.noUnknown){"boolean"!=typeof e&&(t=e,e=!0);let n=this.test({name:"noUnknown",exclusive:!0,message:t,test(t){if(null==t)return!0;const n=xs(this.schema,t);return!e||0===n.length||this.createError({params:{unknown:n.join(", ")}})}});return n.spec.noUnknown=e,n}unknown(e=!0,t=ja.noUnknown){return this.noUnknown(!e,t)}transformKeys(e){return this.transform(t=>{if(!t)return t;const n={};for(const r of Object.keys(t))n[e(r)]=t[r];return n})}camelCase(){return this.transformKeys(va)}snakeCase(){return this.transformKeys(ya)}constantCase(){return this.transformKeys(e=>ya(e).toUpperCase())}describe(e){const t=(e?this.resolve(e):this).clone(),n=super.describe(e);n.fields={};for(const[o,i]of Object.entries(t.fields)){var r;let t=e;null!=(r=t)&&r.value&&(t=Object.assign({},t,{parent:t.value,value:t.value[o]})),n.fields[o]=i.describe(t)}return n}}ws.prototype=_s.prototype;var Is=function(e){var t;return t={mixed:{required:e("This field is required")}},Object.keys(t).forEach(e=>{Object.keys(t[e]).forEach(n=>{Ua[e][n]=t[e][n]})}),{initialValues:{departmentId:void 0,refreshInterval:60},validationSchema:ws({departmentId:ps(),refreshInterval:gs().oneOf([15,30,60]).required()})}},Ss=["url","wsUrl","lang","data","settings"];exports.Widget=function(r){var o=r.url,i=r.wsUrl,a=r.lang,s=r.data,l=r.settings,c=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(r,Ss),d=t.useGqlClients({url:o,wsUrl:i,lang:a}),u=d.graphqlSdk,p=d.gqlWsClient,f=e.useState(s),m=f[0],h=f[1];return e.useEffect(function(){!s&&u&&Promise.all([u.departments(),u.shifts()]).then(function(e){var t=e[0].departments,n=e[1].shifts,r=w(n);if(r)return u.workplaceAssignments({input:{date:r.date,shiftId:r.shift.id,departmentId:(null==l?void 0:l.departmentId)||void 0}}).then(function(e){return h(D({},e.workplaceAssignments,{departments:t,shifts:n}))})}).catch(function(){})},[s,u,null==l?void 0:l.departmentId]),g.default.createElement(n.BaseWidget,D({lang:a,locales:x,data:m,gqlClients:{graphqlSdk:u,gqlWsClient:p},WidgetView:na,getSettingsFormProps:Is,SettingsFormContent:S,version:I,"data-testid":"station-assignment-widget"},c))},exports.extraPermissions=[],exports.getDisplayName=function(e){switch(e){case"en":return"Operator assignment";case"pl":return"Przypisanie operatorów";default:return"station-assignment-widget"}},exports.requiredFeatures=["feature.station-assignment-widget"],exports.version=I;
|
|
5
|
+
return m.createElement(h,{...e,reactReduxForwardedRef:t})});return t.displayName=n,t.WrappedComponent=e,/* @__PURE__ */Le(t,e)}/* @__PURE__ */
|
|
6
|
+
return Le(h,e)}},Xe=function(e){const{children:t,context:n,serverState:r,store:o}=e,i=m.useMemo(()=>{const t=xe(o),n={store:o,subscription:t,getServerState:r?()=>r:void 0};if("production"==='{NODE_ENV:"production"}'.NODE_ENV)return n;{const{identityFunctionCheck:t="once",stabilityCheck:r="once"}=e;/* @__PURE__ */
|
|
7
|
+
return Object.assign(n,{stabilityCheck:r,identityFunctionCheck:t})}},[o,r]),a=m.useMemo(()=>o.getState(),[o]);return _e(()=>{const{subscription:e}=i;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),a!==o.getState()&&e.notifyNestedSubs(),()=>{e.tryUnsubscribe(),e.onStateChange=void 0}},[i,a]),/* @__PURE__ */m.createElement((n||We).Provider,{value:i},t)},Ke="production"==='{NODE_ENV:"production"}'.NODE_ENV,Je="Invariant failed";function Qe(e,t){if(!e){if(Ke)throw new Error(Je);var n="function"==typeof t?t():t,r=n?"".concat(Je,": ").concat(n):Je;throw new Error(r)}}var et=function(e){var t=e.top,n=e.right,r=e.bottom,o=e.left;return{top:t,right:n,bottom:r,left:o,width:n-o,height:r-t,x:o,y:t,center:{x:(n+o)/2,y:(r+t)/2}}},tt=function(e,t){return{top:e.top-t.top,left:e.left-t.left,bottom:e.bottom+t.bottom,right:e.right+t.right}},nt=function(e,t){return{top:e.top+t.top,left:e.left+t.left,bottom:e.bottom-t.bottom,right:e.right-t.right}},rt={top:0,right:0,bottom:0,left:0},ot=function(e){var t=e.borderBox,n=e.margin,r=void 0===n?rt:n,o=e.border,i=void 0===o?rt:o,a=e.padding,s=void 0===a?rt:a,l=et(tt(t,r)),c=et(nt(t,i)),d=et(nt(c,s));return{marginBox:l,borderBox:et(t),paddingBox:c,contentBox:d,margin:r,border:i,padding:s}},it=function(e){var t=e.slice(0,-2);if("px"!==e.slice(-2))return 0;var n=Number(t);return isNaN(n)&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?Qe(!1,"Could not parse value [raw: "+e+", without suffix: "+t+"]"):Qe(!1)),n},at=function(e,t){var n,r,o={top:(n=e.borderBox).top+(r=t).y,left:n.left+r.x,bottom:n.bottom+r.y,right:n.right+r.x};return ot({borderBox:o,border:e.border,margin:e.margin,padding:e.padding})},st=function(e,t){return void 0===t&&(t={x:window.pageXOffset,y:window.pageYOffset}),at(e,t)},lt=function(e,t){var n={top:it(t.marginTop),right:it(t.marginRight),bottom:it(t.marginBottom),left:it(t.marginLeft)},r={top:it(t.paddingTop),right:it(t.paddingRight),bottom:it(t.paddingBottom),left:it(t.paddingLeft)},o={top:it(t.borderTopWidth),right:it(t.borderRightWidth),bottom:it(t.borderBottomWidth),left:it(t.borderLeftWidth)};return ot({borderBox:e,margin:n,padding:r,border:o})},ct=function(e){var t=e.getBoundingClientRect(),n=window.getComputedStyle(e);return lt(t,n)},dt=function(e){var t=[],n=null,r=function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];t=o,n||(n=requestAnimationFrame(function(){n=null,e.apply(void 0,t)}))};return r.cancel=function(){n&&(cancelAnimationFrame(n),n=null)},r};function ut(){return ut=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ut.apply(null,arguments)}const pt="production"==='{NODE_ENV:"production"}'.NODE_ENV,ft=/[ \t]{2,}/g,gt=/^[ \t]*/gm,mt=e=>e.replace(ft," ").replace(gt,"").trim(),ht=e=>mt(`\n %c@hello-pangea/dnd\n\n %c${mt(e)}\n\n %c👷 This is a development only message. It will be removed in production builds.\n`);function bt(e,t){pt||"undefined"!=typeof window&&window["__@hello-pangea/dnd-disable-dev-warnings"]||console[e](...(e=>[ht(e),"color: #00C584; font-size: 1.2em; font-weight: bold;","line-height: 1.5","color: #723874;"])(t))}const Et=bt.bind(null,"warn"),vt=bt.bind(null,"error");function yt(){}function Nt(e,t,n){const r=t.map(t=>{const r=function(e,t){return{...e,...t}}(n,t.options);return e.addEventListener(t.eventName,t.fn,r),function(){e.removeEventListener(t.eventName,t.fn,r)}});return function(){r.forEach(e=>{e()})}}const Dt="production"==='{NODE_ENV:"production"}'.NODE_ENV,xt="Invariant failed";class Ot extends Error{}function wt(e,t){throw new Ot(Dt?xt:`${xt}: ${t||""}`)}Ot.prototype.toString=function(){return this.message};class _t extends g.default.Component{constructor(...e){super(...e),this.callbacks=null,this.unbind=yt,this.onWindowError=e=>{const t=this.getCallbacks();t.isDragging()&&(t.tryAbort(),"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&Et("\n An error was caught by our window 'error' event listener while a drag was occurring.\n The active drag has been aborted.\n "));const n=e.error;n instanceof Ot&&(e.preventDefault(),"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&vt(n.message))},this.getCallbacks=()=>{if(!this.callbacks)throw new Error("Unable to find AppCallbacks in <ErrorBoundary/>");return this.callbacks},this.setCallbacks=e=>{this.callbacks=e}}componentDidMount(){this.unbind=Nt(window,[{eventName:"error",fn:this.onWindowError}])}componentDidCatch(e){if(e instanceof Ot)return"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&vt(e.message),void this.setState({});throw e}componentWillUnmount(){this.unbind()}render(){return this.props.children(this.setCallbacks)}}const It=e=>e+1,St=(e,t)=>{const n=e.droppableId===t.droppableId,r=It(e.index),o=It(t.index);return n?`\n You have moved the item from position ${r}\n to position ${o}\n `:`\n You have moved the item from position ${r}\n in list ${e.droppableId}\n to list ${t.droppableId}\n in position ${o}\n `},Ct=(e,t,n)=>t.droppableId===n.droppableId?`\n The item ${e}\n has been combined with ${n.draggableId}`:`\n The item ${e}\n in list ${t.droppableId}\n has been combined with ${n.draggableId}\n in list ${n.droppableId}\n `,At=e=>`\n The item has returned to its starting position\n of ${It(e.index)}\n`,Vt=e=>`\n You have lifted an item in position ${It(e.source.index)}\n`,Pt=e=>{const t=e.destination;if(t)return St(e.source,t);const n=e.combine;return n?Ct(e.draggableId,e.source,n):"You are over an area that cannot be dropped on"},Tt=e=>{if("CANCEL"===e.reason)return`\n Movement cancelled.\n ${At(e.source)}\n `;const t=e.destination,n=e.combine;return t?`\n You have dropped the item.\n ${St(e.source,t)}\n `:n?`\n You have dropped the item.\n ${Ct(e.draggableId,e.source,n)}\n `:`\n The item has been dropped while not over a drop area.\n ${At(e.source)}\n `};function Rt(e,t){return e===t||!(!Number.isNaN(e)||!Number.isNaN(t))}function $t(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Rt(e[n],t[n]))return!1;return!0}function Bt(t,n){const r=e.useState(()=>({inputs:n,result:t()}))[0],o=e.useRef(!0),i=e.useRef(r),a=o.current||Boolean(n&&i.current.inputs&&$t(n,i.current.inputs))?i.current:{inputs:n,result:t()};return e.useEffect(()=>{o.current=!1,i.current=a},[a]),a.result}function kt(e,t){return Bt(()=>e,t)}const Ft={x:0,y:0},Mt=(e,t)=>({x:e.x+t.x,y:e.y+t.y}),Lt=(e,t)=>({x:e.x-t.x,y:e.y-t.y}),jt=(e,t)=>e.x===t.x&&e.y===t.y,Gt=e=>({x:0!==e.x?-e.x:0,y:0!==e.y?-e.y:0}),Ut=(e,t,n=0)=>"x"===e?{x:t,y:n}:{x:n,y:t},Wt=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2),qt=(e,t)=>Math.min(...t.map(t=>Wt(e,t))),zt=e=>t=>({x:e(t.x),y:e(t.y)}),Ht=(e,t)=>({top:e.top+t.y,left:e.left+t.x,bottom:e.bottom+t.y,right:e.right+t.x}),Yt=e=>[{x:e.left,y:e.top},{x:e.right,y:e.top},{x:e.left,y:e.bottom},{x:e.right,y:e.bottom}],Zt=(e,t)=>t&&t.shouldClipSubject?((e,t)=>{const n=et({top:Math.max(t.top,e.top),right:Math.min(t.right,e.right),bottom:Math.min(t.bottom,e.bottom),left:Math.max(t.left,e.left)});return n.width<=0||n.height<=0?null:n})(t.pageMarginBox,e):et(e);var Xt=({page:e,withPlaceholder:t,axis:n,frame:r})=>{const o=((e,t)=>t?Ht(e,t.scroll.diff.displacement):e)(e.marginBox,r),i=((e,t,n)=>n&&n.increasedBy?{...e,[t.end]:e[t.end]+n.increasedBy[t.line]}:e)(o,n,t);return{page:e,withPlaceholder:t,active:Zt(i,r)}},Kt=(e,t)=>{e.frame||wt();const n=e.frame,r=Lt(t,n.scroll.initial),o=Gt(r),i={...n,scroll:{initial:n.scroll.initial,current:t,diff:{value:r,displacement:o},max:n.scroll.max}},a=Xt({page:e.subject.page,withPlaceholder:e.subject.withPlaceholder,axis:e.axis,frame:i});return{...e,frame:i,subject:a}};function Jt(e,t=$t){let n=null;function r(...r){if(n&&n.lastThis===this&&t(r,n.lastArgs))return n.lastResult;const o=e.apply(this,r);return n={lastResult:o,lastArgs:r,lastThis:this},o}return r.clear=function(){n=null},r}const Qt=Jt(e=>e.reduce((e,t)=>(e[t.descriptor.id]=t,e),{})),en=Jt(e=>e.reduce((e,t)=>(e[t.descriptor.id]=t,e),{})),tn=Jt(e=>Object.values(e)),nn=Jt(e=>Object.values(e));var rn=Jt((e,t)=>{const n=nn(t).filter(t=>e===t.descriptor.droppableId).sort((e,t)=>e.descriptor.index-t.descriptor.index);return n});function on(e){return e.at&&"REORDER"===e.at.type?e.at.destination:null}function an(e){return e.at&&"COMBINE"===e.at.type?e.at.combine:null}var sn=Jt((e,t)=>t.filter(t=>t.descriptor.id!==e.descriptor.id)),ln=(e,t)=>e.descriptor.droppableId===t.descriptor.id;const cn={point:Ft,value:0},dn={invisible:{},visible:{},all:[]},un={displaced:dn,displacedBy:cn,at:null};var pn=(e,t)=>n=>e<=n&&n<=t,fn=e=>{const t=pn(e.top,e.bottom),n=pn(e.left,e.right);return r=>{if(t(r.top)&&t(r.bottom)&&n(r.left)&&n(r.right))return!0;const o=t(r.top)||t(r.bottom),i=n(r.left)||n(r.right);if(o&&i)return!0;const a=r.top<e.top&&r.bottom>e.bottom,s=r.left<e.left&&r.right>e.right;return!(!a||!s)||a&&i||s&&o}},gn=e=>{const t=pn(e.top,e.bottom),n=pn(e.left,e.right);return e=>t(e.top)&&t(e.bottom)&&n(e.left)&&n(e.right)};const mn={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},hn={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"},bn=({target:e,destination:t,viewport:n,withDroppableDisplacement:r,isVisibleThroughFrameFn:o})=>{const i=r?((e,t)=>Ht(e,t.frame?t.frame.scroll.diff.displacement:Ft))(e,t):e;return((e,t,n)=>!!t.subject.active&&n(t.subject.active)(e))(i,t,o)&&((e,t,n)=>n(t)(e))(i,n,o)},En=e=>bn({...e,isVisibleThroughFrameFn:gn});function vn({afterDragging:e,destination:t,displacedBy:n,viewport:r,forceShouldAnimate:o,last:i}){return e.reduce(function(e,a){const s=function(e,t){return et(tt(e.page.marginBox,{top:t.point.y,right:0,bottom:0,left:t.point.x}))}(a,n),l=a.descriptor.id;var c;if(e.all.push(l),c={target:s,destination:t,viewport:r,withDroppableDisplacement:!0},!bn({...c,isVisibleThroughFrameFn:fn}))return e.invisible[a.descriptor.id]=!0,e;const d=((e,t,n)=>{if("boolean"==typeof n)return n;if(!t)return!0;const{invisible:r,visible:o}=t;if(r[e])return!1;const i=o[e];return!i||i.shouldAnimate})(l,i,o);return e.visible[l]={draggableId:l,shouldAnimate:d},e},{all:[],visible:{},invisible:{}})}function yn({insideDestination:e,inHomeList:t,displacedBy:n,destination:r}){const o=function(e,t){if(!e.length)return 0;const n=e[e.length-1].descriptor.index;return t.inHomeList?n:n+1}(e,{inHomeList:t});return{displaced:dn,displacedBy:n,at:{type:"REORDER",destination:{droppableId:r.descriptor.id,index:o}}}}function Nn({draggable:e,insideDestination:t,destination:n,viewport:r,displacedBy:o,last:i,index:a,forceShouldAnimate:s}){const l=ln(e,n);if(null==a)return yn({insideDestination:t,inHomeList:l,displacedBy:o,destination:n});const c=t.find(e=>e.descriptor.index===a);if(!c)return yn({insideDestination:t,inHomeList:l,displacedBy:o,destination:n});const d=sn(e,t),u=t.indexOf(c);return{displaced:vn({afterDragging:d.slice(u),destination:n,displacedBy:o,last:i,viewport:r.frame,forceShouldAnimate:s}),displacedBy:o,at:{type:"REORDER",destination:{droppableId:n.descriptor.id,index:a}}}}function Dn(e,t){return Boolean(t.effected[e])}const xn=(e,t)=>t.margin[e.start]+t.borderBox[e.size]/2,On=(e,t,n)=>t[e.crossAxisStart]+n.margin[e.crossAxisStart]+n.borderBox[e.crossAxisSize]/2,wn=({axis:e,moveRelativeTo:t,isMoving:n})=>Ut(e.line,t.marginBox[e.end]+xn(e,n),On(e,t.marginBox,n)),_n=({axis:e,moveRelativeTo:t,isMoving:n})=>Ut(e.line,t.marginBox[e.start]-((e,t)=>t.margin[e.end]+t.borderBox[e.size]/2)(e,n),On(e,t.marginBox,n));var In=(e,t)=>{const n=e.frame;return n?Mt(t,n.scroll.diff.displacement):t},Sn=e=>{const t=(({impact:e,draggable:t,droppable:n,draggables:r,afterCritical:o})=>{const i=t.page.borderBox.center,a=e.at;return n&&a?"REORDER"===a.type?(({impact:e,draggable:t,draggables:n,droppable:r,afterCritical:o})=>{const i=rn(r.descriptor.id,n),a=t.page,s=r.axis;if(!i.length)return(({axis:e,moveInto:t,isMoving:n})=>Ut(e.line,t.contentBox[e.start]+xn(e,n),On(e,t.contentBox,n)))({axis:s,moveInto:r.page,isMoving:a});const{displaced:l,displacedBy:c}=e,d=l.all[0];if(d){const e=n[d];if(Dn(d,o))return _n({axis:s,moveRelativeTo:e.page,isMoving:a});const t=at(e.page,c.point);return _n({axis:s,moveRelativeTo:t,isMoving:a})}const u=i[i.length-1];if(u.descriptor.id===t.descriptor.id)return a.borderBox.center;if(Dn(u.descriptor.id,o)){const e=at(u.page,Gt(o.displacedBy.point));return wn({axis:s,moveRelativeTo:e,isMoving:a})}return wn({axis:s,moveRelativeTo:u.page,isMoving:a})})({impact:e,draggable:t,draggables:r,droppable:n,afterCritical:o}):(({afterCritical:e,impact:t,draggables:n})=>{const r=an(t);r||wt();const o=r.draggableId,i=n[o].page.borderBox.center,a=(({displaced:e,afterCritical:t,combineWith:n,displacedBy:r})=>{const o=Boolean(e.visible[n]||e.invisible[n]);return Dn(n,t)?o?Ft:Gt(r.point):o?r.point:Ft})({displaced:t.displaced,afterCritical:e,combineWith:o,displacedBy:t.displacedBy});return Mt(i,a)})({impact:e,draggables:r,afterCritical:o}):i})(e),n=e.droppable;return n?In(n,t):t},Cn=(e,t)=>{const n=Lt(t,e.scroll.initial),r=Gt(n);return{frame:et({top:t.y,bottom:t.y+e.frame.height,left:t.x,right:t.x+e.frame.width}),scroll:{initial:e.scroll.initial,max:e.scroll.max,current:t,diff:{value:n,displacement:r}}}};function An(e,t){return e.map(e=>t[e])}var Vn=({pageBorderBoxCenter:e,draggable:t,viewport:n})=>{const r=((e,t)=>Mt(e.scroll.diff.displacement,t))(n,e),o=Lt(r,t.page.borderBox.center);return Mt(t.client.borderBox.center,o)},Pn=({draggable:e,destination:t,newPageBorderBoxCenter:n,viewport:r,withDroppableDisplacement:o,onlyOnMainAxis:i=!1})=>{const a=Lt(n,e.page.borderBox.center),s={target:Ht(e.page.borderBox,a),destination:t,withDroppableDisplacement:o,viewport:r};return i?(e=>{return bn({...e,isVisibleThroughFrameFn:(t=e.destination.axis,e=>{const n=pn(e.top,e.bottom),r=pn(e.left,e.right);return e=>t===mn?n(e.top)&&n(e.bottom):r(e.left)&&r(e.right)})});var t})(s):En(s)};const Tn=e=>{const t=e.subject.active;return t||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Cannot get clipped area from droppable"):wt()),t},Rn=(e,t)=>{const n=e.page.borderBox.center;return Dn(e.descriptor.id,t)?Lt(n,t.displacedBy.point):n},$n=(e,t)=>{const n=e.page.borderBox;return Dn(e.descriptor.id,t)?Ht(n,Gt(t.displacedBy.point)):n};var Bn=Jt(function(e,t){const n=t[e.line];return{value:n,point:Ut(e.line,n)}});const kn=(e,t)=>({...e,scroll:{...e.scroll,max:t}}),Fn=(e,t,n)=>{const r=e.frame;ln(t,e)&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Should not add placeholder space to home list"):wt()),e.subject.withPlaceholder&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Cannot add placeholder size to a subject when it already has one"):wt());const o=Bn(e.axis,t.displaceBy).point,i=((e,t,n)=>{const r=e.axis;if("virtual"===e.descriptor.mode)return Ut(r.line,t[r.line]);const o=e.subject.page.contentBox[r.size],i=rn(e.descriptor.id,n).reduce((e,t)=>e+t.client.marginBox[r.size],0)+t[r.line]-o;return i<=0?null:Ut(r.line,i)})(e,o,n),a={placeholderSize:o,increasedBy:i,oldFrameMaxScroll:e.frame?e.frame.scroll.max:null};if(!r){const t=Xt({page:e.subject.page,withPlaceholder:a,axis:e.axis,frame:e.frame});return{...e,subject:t}}const s=i?Mt(r.scroll.max,i):r.scroll.max,l=kn(r,s),c=Xt({page:e.subject.page,withPlaceholder:a,axis:e.axis,frame:l});return{...e,subject:c,frame:l}};var Mn=e=>{const t=e.at;return t?"REORDER"===t.type?t.destination.droppableId:t.combine.droppableId:null};function Ln(e){return"DRAGGING"===e.phase||"COLLECTING"===e.phase}function jn(e){const t=pn(e.top,e.bottom),n=pn(e.left,e.right);return function(e){return t(e.y)&&n(e.x)}}const Gn=(e,t)=>et(Ht(e,t));function Un({displaced:e,id:t}){return Boolean(e.visible[t]||e.invisible[t])}var Wn=({pageOffset:e,draggable:t,draggables:n,droppables:r,previousImpact:o,viewport:i,afterCritical:a})=>{const s=Gn(t.page.borderBox,e),l=function({pageBorderBox:e,draggable:t,droppables:n}){const r=tn(n).filter(t=>{if(!t.isEnabled)return!1;const n=t.subject.active;if(!n)return!1;if(!((r=e).left<(o=n).right&&r.right>o.left&&r.top<o.bottom&&r.bottom>o.top))return!1;var r,o;if(jn(n)(e.center))return!0;const i=t.axis,a=n.center[i.crossAxisLine],s=e[i.crossAxisStart],l=e[i.crossAxisEnd],c=pn(n[i.crossAxisStart],n[i.crossAxisEnd]),d=c(s),u=c(l);return!d&&!u||(d?s<a:l>a)});return r.length?1===r.length?r[0].descriptor.id:function({pageBorderBox:e,draggable:t,candidates:n}){const r=t.page.borderBox.center,o=n.map(t=>{const n=t.axis,o=Ut(t.axis.line,e.center[n.line],t.page.borderBox.center[n.crossAxisLine]);return{id:t.descriptor.id,distance:Wt(r,o)}}).sort((e,t)=>t.distance-e.distance);return o[0]?o[0].id:null}({pageBorderBox:e,draggable:t,candidates:r}):null}({pageBorderBox:s,draggable:t,droppables:r});if(!l)return un;const c=r[l],d=rn(c.descriptor.id,n),u=((e,t)=>{const n=e.frame;return n?Gn(t,n.scroll.diff.value):t})(c,s);return(({draggable:e,pageBorderBoxWithDroppableScroll:t,previousImpact:n,destination:r,insideDestination:o,afterCritical:i})=>{if(!r.isCombineEnabled)return null;const a=r.axis,s=Bn(r.axis,e.displaceBy),l=s.value,c=t[a.start],d=t[a.end],u=sn(e,o).find(e=>{const t=e.descriptor.id,r=e.page.borderBox,o=r[a.size]/4,s=Dn(t,i),u=Un({displaced:n.displaced,id:t});return s?u?d>r[a.start]+o&&d<r[a.end]-o:c>r[a.start]-l+o&&c<r[a.end]-l-o:u?d>r[a.start]+l+o&&d<r[a.end]+l-o:c>r[a.start]+o&&c<r[a.end]-o});return u?{displacedBy:s,displaced:n.displaced,at:{type:"COMBINE",combine:{draggableId:u.descriptor.id,droppableId:r.descriptor.id}}}:null})({pageBorderBoxWithDroppableScroll:u,draggable:t,previousImpact:o,destination:c,insideDestination:d,afterCritical:a})||(({pageBorderBoxWithDroppableScroll:e,draggable:t,destination:n,insideDestination:r,last:o,viewport:i,afterCritical:a})=>{const s=n.axis,l=Bn(n.axis,t.displaceBy),c=l.value,d=e[s.start],u=e[s.end],p=function({draggable:e,closest:t,inHomeList:n}){return t?n&&t.descriptor.index>e.descriptor.index?t.descriptor.index-1:t.descriptor.index:null}({draggable:t,closest:sn(t,r).find(e=>{const t=e.descriptor.id,n=e.page.borderBox.center[s.line],r=Dn(t,a),i=Un({displaced:o,id:t});return r?i?u<=n:d<n-c:i?u<=n+c:d<n})||null,inHomeList:ln(t,n)});return Nn({draggable:t,insideDestination:r,destination:n,viewport:i,last:o,displacedBy:l,index:p})})({pageBorderBoxWithDroppableScroll:u,draggable:t,destination:c,insideDestination:d,last:o.displaced,viewport:i,afterCritical:a})},qn=(e,t)=>({...e,[t.descriptor.id]:t}),zn=({state:e,clientSelection:t,dimensions:n,viewport:r,impact:o,scrollJumpRequest:i})=>{const a=r||e.viewport,s=n||e.dimensions,l=t||e.current.client.selection,c=Lt(l,e.initial.client.selection),d={offset:c,selection:l,borderBoxCenter:Mt(e.initial.client.borderBoxCenter,c)},u={selection:Mt(d.selection,a.scroll.current),borderBoxCenter:Mt(d.borderBoxCenter,a.scroll.current),offset:Mt(d.offset,a.scroll.diff.value)},p={client:d,page:u};if("COLLECTING"===e.phase)return{...e,dimensions:s,viewport:a,current:p};const f=s.draggables[e.critical.draggable.id],g=o||Wn({pageOffset:u.offset,draggable:f,draggables:s.draggables,droppables:s.droppables,previousImpact:e.impact,viewport:a,afterCritical:e.afterCritical}),m=(({draggable:e,draggables:t,droppables:n,previousImpact:r,impact:o})=>{const i=(({previousImpact:e,impact:t,droppables:n})=>{const r=Mn(e),o=Mn(t);if(!r)return n;if(r===o)return n;const i=n[r];if(!i.subject.withPlaceholder)return n;const a=(e=>{const t=e.subject.withPlaceholder;t||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Cannot remove placeholder form subject when there was none"):wt());const n=e.frame;if(!n){const t=Xt({page:e.subject.page,axis:e.axis,frame:null,withPlaceholder:null});return{...e,subject:t}}const r=t.oldFrameMaxScroll;r||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Expected droppable with frame to have old max frame scroll when removing placeholder"):wt());const o=kn(n,r),i=Xt({page:e.subject.page,axis:e.axis,frame:o,withPlaceholder:null});return{...e,subject:i,frame:o}})(i);return qn(n,a)})({previousImpact:r,impact:o,droppables:n}),a=Mn(o);if(!a)return i;const s=n[a];if(ln(e,s))return i;if(s.subject.withPlaceholder)return i;const l=Fn(s,e,t);return qn(i,l)})({draggable:f,impact:g,previousImpact:e.impact,draggables:s.draggables,droppables:s.droppables});return{...e,current:p,dimensions:{draggables:s.draggables,droppables:m},impact:g,viewport:a,scrollJumpRequest:i||null,forceShouldAnimate:!i&&null}},Hn=({impact:e,viewport:t,draggables:n,destination:r,forceShouldAnimate:o})=>{const i=e.displaced,a=function(e,t){return e.map(e=>t[e])}(i.all,n),s=vn({afterDragging:a,destination:r,displacedBy:e.displacedBy,viewport:t.frame,forceShouldAnimate:o,last:i});return{...e,displaced:s}},Yn=({impact:e,draggable:t,droppable:n,draggables:r,viewport:o,afterCritical:i})=>{const a=Sn({impact:e,draggable:t,draggables:r,droppable:n,afterCritical:i});return Vn({pageBorderBoxCenter:a,draggable:t,viewport:o})},Zn=({state:e,dimensions:t,viewport:n})=>{"SNAP"!==e.movementMode&&wt();const r=e.impact,o=n||e.viewport,i=t||e.dimensions,{draggables:a,droppables:s}=i,l=a[e.critical.draggable.id],c=Mn(r);c||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Must be over a destination in SNAP movement mode"):wt());const d=s[c],u=Hn({impact:r,viewport:o,destination:d,draggables:a}),p=Yn({impact:u,draggable:l,droppable:d,draggables:a,viewport:o,afterCritical:e.afterCritical});return zn({impact:u,clientSelection:p,state:e,dimensions:i,viewport:o})},Xn=({draggable:e,home:t,draggables:n,viewport:r})=>{const o=Bn(t.axis,e.displaceBy),i=rn(t.descriptor.id,n),a=i.indexOf(e);-1===a&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Expected draggable to be inside home list"):wt());const s=i.slice(a+1),l=s.reduce((e,t)=>(e[t.descriptor.id]=!0,e),{}),c={inVirtualList:"virtual"===t.descriptor.mode,displacedBy:o,effected:l};var d;return{impact:{displaced:vn({afterDragging:s,destination:t,displacedBy:o,last:null,viewport:r.frame,forceShouldAnimate:!1}),displacedBy:o,at:{type:"REORDER",destination:(d=e.descriptor,{index:d.index,droppableId:d.droppableId})}},afterCritical:c}};const Kn=e=>"SNAP"===e.movementMode,Jn=(e,t,n)=>{const r=((e,t)=>({draggables:e.draggables,droppables:qn(e.droppables,t)}))(e.dimensions,t);return!Kn(e)||n?zn({state:e,dimensions:r}):Zn({state:e,dimensions:r})};function Qn(e){return e.isDragging&&"SNAP"===e.movementMode?{...e,scrollJumpRequest:null}:e}const er={phase:"IDLE",completed:null,shouldFlush:!1};var tr=(e=er,t)=>{if("FLUSH"===t.type)return{...er,shouldFlush:!0};if("INITIAL_PUBLISH"===t.type){"IDLE"!==e.phase&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"INITIAL_PUBLISH must come after a IDLE phase"):wt());const{critical:n,clientSelection:r,viewport:o,dimensions:i,movementMode:a}=t.payload,s=i.draggables[n.draggable.id],l=i.droppables[n.droppable.id],c={selection:r,borderBoxCenter:s.client.borderBox.center,offset:Ft},d={client:c,page:{selection:Mt(c.selection,o.scroll.initial),borderBoxCenter:Mt(c.selection,o.scroll.initial),offset:Mt(c.selection,o.scroll.diff.value)}},u=tn(i.droppables).every(e=>!e.isFixedOnPage),{impact:p,afterCritical:f}=Xn({draggable:s,home:l,draggables:i.draggables,viewport:o});return{phase:"DRAGGING",isDragging:!0,critical:n,movementMode:a,dimensions:i,initial:d,current:d,isWindowScrollAllowed:u,impact:p,afterCritical:f,onLiftImpact:p,viewport:o,scrollJumpRequest:null,forceShouldAnimate:null}}if("COLLECTION_STARTING"===t.type)return"COLLECTING"===e.phase||"DROP_PENDING"===e.phase?e:("DRAGGING"!==e.phase&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,`Collection cannot start from phase ${e.phase}`):wt()),{...e,phase:"COLLECTING"});if("PUBLISH_WHILE_DRAGGING"===t.type)return"COLLECTING"!==e.phase&&"DROP_PENDING"!==e.phase&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,`Unexpected ${t.type} received in phase ${e.phase}`):wt()),(({state:e,published:t})=>{const n=t.modified.map(t=>Kt(e.dimensions.droppables[t.droppableId],t.scroll)),r={...e.dimensions.droppables,...Qt(n)},o=en((({additions:e,updatedDroppables:t,viewport:n})=>{const r=n.scroll.diff.value;return e.map(e=>{const o=(e=>{const t=e.frame;return t||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Expected Droppable to have a frame"):wt()),t})(t[e.descriptor.droppableId]),i=(({draggable:e,offset:t,initialWindowScroll:n})=>{const r=at(e.client,t),o=st(r,n);return{...e,placeholder:{...e.placeholder,client:r},client:r,page:o}})({draggable:e,offset:Mt(r,o.scroll.diff.value),initialWindowScroll:n.scroll.initial});return i})})({additions:t.additions,updatedDroppables:r,viewport:e.viewport})),i={...e.dimensions.draggables,...o};t.removals.forEach(e=>{delete i[e]});const a={droppables:r,draggables:i},s=Mn(e.impact),l=s?a.droppables[s]:null,c=a.draggables[e.critical.draggable.id],d=a.droppables[e.critical.droppable.id],{impact:u,afterCritical:p}=Xn({draggable:c,home:d,draggables:i,viewport:e.viewport}),f=Wn({pageOffset:e.current.page.offset,draggable:a.draggables[e.critical.draggable.id],draggables:a.draggables,droppables:a.droppables,previousImpact:l&&l.isCombineEnabled?e.impact:u,viewport:e.viewport,afterCritical:p}),g={...e,phase:"DRAGGING",impact:f,onLiftImpact:u,dimensions:a,afterCritical:p,forceShouldAnimate:!1};return"COLLECTING"===e.phase?g:{...g,phase:"DROP_PENDING",reason:e.reason,isWaiting:!1}})({state:e,published:t.payload});if("MOVE"===t.type){if("DROP_PENDING"===e.phase)return e;Ln(e)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,`${t.type} not permitted in phase ${e.phase}`):wt());const{client:n}=t.payload;return jt(n,e.current.client.selection)?e:zn({state:e,clientSelection:n,impact:Kn(e)?e.impact:null})}if("UPDATE_DROPPABLE_SCROLL"===t.type){if("DROP_PENDING"===e.phase)return Qn(e);if("COLLECTING"===e.phase)return Qn(e);Ln(e)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,`${t.type} not permitted in phase ${e.phase}`):wt());const{id:n,newScroll:r}=t.payload,o=e.dimensions.droppables[n];if(!o)return e;const i=Kt(o,r);return Jn(e,i,!1)}if("UPDATE_DROPPABLE_IS_ENABLED"===t.type){if("DROP_PENDING"===e.phase)return e;Ln(e)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,`Attempting to move in an unsupported phase ${e.phase}`):wt());const{id:n,isEnabled:r}=t.payload,o=e.dimensions.droppables[n];o||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,`Cannot find Droppable[id: ${n}] to toggle its enabled state`):wt()),o.isEnabled===r&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,`Trying to set droppable isEnabled to ${String(r)}\n but it is already ${String(o.isEnabled)}`):wt());const i={...o,isEnabled:r};return Jn(e,i,!0)}if("UPDATE_DROPPABLE_IS_COMBINE_ENABLED"===t.type){if("DROP_PENDING"===e.phase)return e;Ln(e)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,`Attempting to move in an unsupported phase ${e.phase}`):wt());const{id:n,isCombineEnabled:r}=t.payload,o=e.dimensions.droppables[n];o||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,`Cannot find Droppable[id: ${n}] to toggle its isCombineEnabled state`):wt()),o.isCombineEnabled===r&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,`Trying to set droppable isCombineEnabled to ${String(r)}\n but it is already ${String(o.isCombineEnabled)}`):wt());const i={...o,isCombineEnabled:r};return Jn(e,i,!0)}if("MOVE_BY_WINDOW_SCROLL"===t.type){if("DROP_PENDING"===e.phase||"DROP_ANIMATING"===e.phase)return e;Ln(e)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,`Cannot move by window in phase ${e.phase}`):wt()),e.isWindowScrollAllowed||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Window scrolling is currently not supported for fixed lists"):wt());const n=t.payload.newScroll;if(jt(e.viewport.scroll.current,n))return Qn(e);const r=Cn(e.viewport,n);return Kn(e)?Zn({state:e,viewport:r}):zn({state:e,viewport:r})}if("UPDATE_VIEWPORT_MAX_SCROLL"===t.type){if(!Ln(e))return e;const n=t.payload.maxScroll;if(jt(n,e.viewport.scroll.max))return e;const r={...e.viewport,scroll:{...e.viewport.scroll,max:n}};return{...e,viewport:r}}if("MOVE_UP"===t.type||"MOVE_DOWN"===t.type||"MOVE_LEFT"===t.type||"MOVE_RIGHT"===t.type){if("COLLECTING"===e.phase||"DROP_PENDING"===e.phase)return e;"DRAGGING"!==e.phase&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,`${t.type} received while not in DRAGGING phase`):wt());const n=(({state:e,type:t})=>{const n=((e,t)=>{const n=Mn(e);return n?t[n]:null})(e.impact,e.dimensions.droppables),r=Boolean(n),o=n||e.dimensions.droppables[e.critical.droppable.id],i=o.axis.direction,a="vertical"===i&&("MOVE_UP"===t||"MOVE_DOWN"===t)||"horizontal"===i&&("MOVE_LEFT"===t||"MOVE_RIGHT"===t);if(a&&!r)return null;const s="MOVE_DOWN"===t||"MOVE_RIGHT"===t,l=e.dimensions.draggables[e.critical.draggable.id],c=e.current.page.borderBoxCenter,{draggables:d,droppables:u}=e.dimensions;return a?(({isMovingForward:e,draggable:t,destination:n,draggables:r,previousImpact:o,viewport:i,previousPageBorderBoxCenter:a,previousClientSelection:s,afterCritical:l})=>{if(!n.isEnabled)return null;const c=rn(n.descriptor.id,r),d=ln(t,n),u=(({isMovingForward:e,draggable:t,destination:n,insideDestination:r,previousImpact:o})=>{if(!n.isCombineEnabled)return null;if(!on(o))return null;function i(e){const t={type:"COMBINE",combine:{draggableId:e,droppableId:n.descriptor.id}};return{...o,at:t}}const a=o.displaced.all,s=a.length?a[0]:null;if(e)return s?i(s):null;const l=sn(t,r);if(!s)return l.length?i(l[l.length-1].descriptor.id):null;const c=l.findIndex(e=>e.descriptor.id===s);-1===c&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Could not find displaced item in set"):wt());const d=c-1;return d<0?null:i(l[d].descriptor.id)})({isMovingForward:e,draggable:t,destination:n,insideDestination:c,previousImpact:o})||(({isMovingForward:e,isInHomeList:t,draggable:n,draggables:r,destination:o,insideDestination:i,previousImpact:a,viewport:s,afterCritical:l})=>{const c=a.at;if(c||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Cannot move in direction without previous impact location"):wt()),"REORDER"===c.type){const r=(({isMovingForward:e,isInHomeList:t,insideDestination:n,location:r})=>{if(!n.length)return null;const o=r.index,i=e?o+1:o-1,a=n[n.length-1].descriptor.index;return i<n[0].descriptor.index||i>(t?a:a+1)?null:i})({isMovingForward:e,isInHomeList:t,location:c.destination,insideDestination:i});return null==r?null:Nn({draggable:n,insideDestination:i,destination:o,viewport:s,last:a.displaced,displacedBy:a.displacedBy,index:r})}const d=(({isMovingForward:e,destination:t,draggables:n,combine:r,afterCritical:o})=>{if(!t.isCombineEnabled)return null;const i=r.draggableId,a=n[i].descriptor.index;return Dn(i,o)?e?a:a-1:e?a+1:a})({isMovingForward:e,destination:o,displaced:a.displaced,draggables:r,combine:c.combine,afterCritical:l});return null==d?null:Nn({draggable:n,insideDestination:i,destination:o,viewport:s,last:a.displaced,displacedBy:a.displacedBy,index:d})})({isMovingForward:e,isInHomeList:d,draggable:t,draggables:r,destination:n,insideDestination:c,previousImpact:o,viewport:i,afterCritical:l});if(!u)return null;const p=Sn({impact:u,draggable:t,droppable:n,draggables:r,afterCritical:l});if(Pn({draggable:t,destination:n,newPageBorderBoxCenter:p,viewport:i.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0}))return{clientSelection:Vn({pageBorderBoxCenter:p,draggable:t,viewport:i}),impact:u,scrollJumpRequest:null};const f=Lt(p,a),g=(({impact:e,viewport:t,destination:n,draggables:r,maxScrollChange:o})=>{const i=Cn(t,Mt(t.scroll.current,o)),a=n.frame?Kt(n,Mt(n.frame.scroll.current,o)):n,s=e.displaced,l=vn({afterDragging:An(s.all,r),destination:n,displacedBy:e.displacedBy,viewport:i.frame,last:s,forceShouldAnimate:!1}),c=vn({afterDragging:An(s.all,r),destination:a,displacedBy:e.displacedBy,viewport:t.frame,last:s,forceShouldAnimate:!1}),d={},u={},p=[s,l,c];return s.all.forEach(e=>{const t=function(e,t){for(let n=0;n<t.length;n++){const r=t[n].visible[e];if(r)return r}return null}(e,p);t?u[e]=t:d[e]=!0}),{...e,displaced:{all:s.all,invisible:d,visible:u}}})({impact:u,viewport:i,destination:n,draggables:r,maxScrollChange:f});return{clientSelection:s,impact:g,scrollJumpRequest:f}})({isMovingForward:s,previousPageBorderBoxCenter:c,draggable:l,destination:o,draggables:d,viewport:e.viewport,previousClientSelection:e.current.client.selection,previousImpact:e.impact,afterCritical:e.afterCritical}):(({isMovingForward:e,previousPageBorderBoxCenter:t,draggable:n,isOver:r,draggables:o,droppables:i,viewport:a,afterCritical:s})=>{const l=(({isMovingForward:e,pageBorderBoxCenter:t,source:n,droppables:r,viewport:o})=>{const i=n.subject.active;if(!i)return null;const a=n.axis,s=pn(i[a.start],i[a.end]),l=tn(r).filter(e=>e!==n).filter(e=>e.isEnabled).filter(e=>Boolean(e.subject.active)).filter(e=>fn(o.frame)(Tn(e))).filter(t=>{const n=Tn(t);return e?i[a.crossAxisEnd]<n[a.crossAxisEnd]:n[a.crossAxisStart]<i[a.crossAxisStart]}).filter(e=>{const t=Tn(e),n=pn(t[a.start],t[a.end]);return s(t[a.start])||s(t[a.end])||n(i[a.start])||n(i[a.end])}).sort((t,n)=>{const r=Tn(t)[a.crossAxisStart],o=Tn(n)[a.crossAxisStart];return e?r-o:o-r}).filter((e,t,n)=>Tn(e)[a.crossAxisStart]===Tn(n[0])[a.crossAxisStart]);if(!l.length)return null;if(1===l.length)return l[0];const c=l.filter(e=>pn(Tn(e)[a.start],Tn(e)[a.end])(t[a.line]));return 1===c.length?c[0]:c.length>1?c.sort((e,t)=>Tn(e)[a.start]-Tn(t)[a.start])[0]:l.sort((e,n)=>{const r=qt(t,Yt(Tn(e))),o=qt(t,Yt(Tn(n)));return r!==o?r-o:Tn(e)[a.start]-Tn(n)[a.start]})[0]})({isMovingForward:e,pageBorderBoxCenter:t,source:r,droppables:i,viewport:a});if(!l)return null;const c=rn(l.descriptor.id,o),d=(({pageBorderBoxCenter:e,viewport:t,destination:n,insideDestination:r,afterCritical:o})=>{const i=r.filter(e=>En({target:$n(e,o),destination:n,viewport:t.frame,withDroppableDisplacement:!0})).sort((t,r)=>{const i=Wt(e,In(n,Rn(t,o))),a=Wt(e,In(n,Rn(r,o)));return i<a?-1:a<i?1:t.descriptor.index-r.descriptor.index});return i[0]||null})({pageBorderBoxCenter:t,viewport:a,destination:l,insideDestination:c,afterCritical:s}),u=(({previousPageBorderBoxCenter:e,moveRelativeTo:t,insideDestination:n,draggable:r,draggables:o,destination:i,viewport:a,afterCritical:s})=>{if(!t){if(n.length)return null;const e={displaced:dn,displacedBy:cn,at:{type:"REORDER",destination:{droppableId:i.descriptor.id,index:0}}},t=Sn({impact:e,draggable:r,droppable:i,draggables:o,afterCritical:s}),l=ln(r,i)?i:Fn(i,r,o);return Pn({draggable:r,destination:l,newPageBorderBoxCenter:t,viewport:a.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0})?e:null}const l=Boolean(e[i.axis.line]<=t.page.borderBox.center[i.axis.line]),c=(()=>{const e=t.descriptor.index;return t.descriptor.id===r.descriptor.id||l?e:e+1})(),d=Bn(i.axis,r.displaceBy);return Nn({draggable:r,insideDestination:n,destination:i,viewport:a,displacedBy:d,last:dn,index:c})})({previousPageBorderBoxCenter:t,destination:l,draggable:n,draggables:o,moveRelativeTo:d,insideDestination:c,viewport:a,afterCritical:s});if(!u)return null;const p=Sn({impact:u,draggable:n,droppable:l,draggables:o,afterCritical:s});return{clientSelection:Vn({pageBorderBoxCenter:p,draggable:n,viewport:a}),impact:u,scrollJumpRequest:null}})({isMovingForward:s,previousPageBorderBoxCenter:c,draggable:l,isOver:o,draggables:d,droppables:u,viewport:e.viewport,afterCritical:e.afterCritical})})({state:e,type:t.type});return n?zn({state:e,impact:n.impact,clientSelection:n.clientSelection,scrollJumpRequest:n.scrollJumpRequest}):e}if("DROP_PENDING"===t.type){const n=t.payload.reason;return"COLLECTING"!==e.phase&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Can only move into the DROP_PENDING phase from the COLLECTING phase"):wt()),{...e,phase:"DROP_PENDING",isWaiting:!0,reason:n}}if("DROP_ANIMATE"===t.type){const{completed:n,dropDuration:r,newHomeClientOffset:o}=t.payload;return"DRAGGING"!==e.phase&&"DROP_PENDING"!==e.phase&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,`Cannot animate drop from phase ${e.phase}`):wt()),{phase:"DROP_ANIMATING",completed:n,dropDuration:r,newHomeClientOffset:o,dimensions:e.dimensions}}if("DROP_COMPLETE"===t.type){const{completed:e}=t.payload;return{phase:"IDLE",completed:e,shouldFlush:!1}}return e};function nr(e,t){return e instanceof Object&&"type"in e&&e.type===t}const rr=e=>({type:"PUBLISH_WHILE_DRAGGING",payload:e}),or=()=>({type:"COLLECTION_STARTING",payload:null}),ir=e=>({type:"UPDATE_DROPPABLE_SCROLL",payload:e}),ar=e=>({type:"UPDATE_DROPPABLE_IS_ENABLED",payload:e}),sr=e=>({type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:e}),lr=e=>({type:"MOVE",payload:e}),cr=()=>({type:"MOVE_UP",payload:null}),dr=()=>({type:"MOVE_DOWN",payload:null}),ur=()=>({type:"MOVE_RIGHT",payload:null}),pr=()=>({type:"MOVE_LEFT",payload:null}),fr=e=>({type:"DROP_COMPLETE",payload:e}),gr=e=>({type:"DROP",payload:e}),mr="cubic-bezier(.2,1,.1,1)",hr={outOfTheWay:.2,minDropTime:.33,maxDropTime:.55},br=`${hr.outOfTheWay}s cubic-bezier(0.2, 0, 0, 1)`,Er={fluid:`opacity ${br}`,snap:`transform ${br}, opacity ${br}`,drop:e=>{const t=`${e}s ${mr}`;return`transform ${t}, opacity ${t}`},outOfTheWay:`transform ${br}`,placeholder:`height ${br}, width ${br}, margin ${br}`},vr=e=>jt(e,Ft)?void 0:`translate(${e.x}px, ${e.y}px)`,yr=vr,{minDropTime:Nr,maxDropTime:Dr}=hr,xr=Dr-Nr,Or=({getState:e,dispatch:t})=>n=>r=>{if(!nr(r,"DROP"))return void n(r);const o=e(),i=r.payload.reason;if("COLLECTING"===o.phase)return void t((a={reason:i},{type:"DROP_PENDING",payload:a}));var a;if("IDLE"===o.phase)return;"DROP_PENDING"===o.phase&&o.isWaiting&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"A DROP action occurred while DROP_PENDING and still waiting"):wt()),"DRAGGING"!==o.phase&&"DROP_PENDING"!==o.phase&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,`Cannot drop in phase: ${o.phase}`):wt());const s=o.critical,l=o.dimensions,c=l.draggables[o.critical.draggable.id],{impact:d,didDropInsideDroppable:u}=(({draggables:e,reason:t,lastImpact:n,home:r,viewport:o,onLiftImpact:i})=>n.at&&"DROP"===t?"REORDER"===n.at.type?{impact:n,didDropInsideDroppable:!0}:{impact:{...n,displaced:dn},didDropInsideDroppable:!0}:{impact:Hn({draggables:e,impact:i,destination:r,viewport:o,forceShouldAnimate:!0}),didDropInsideDroppable:!1})({reason:i,lastImpact:o.impact,afterCritical:o.afterCritical,onLiftImpact:o.onLiftImpact,home:o.dimensions.droppables[o.critical.droppable.id],viewport:o.viewport,draggables:o.dimensions.draggables}),p=u?on(d):null,f=u?an(d):null,g={draggableId:c.descriptor.id,type:c.descriptor.type,source:{index:s.draggable.index,droppableId:s.droppable.id},reason:i,mode:o.movementMode,destination:p,combine:f},m=(({impact:e,draggable:t,dimensions:n,viewport:r,afterCritical:o})=>{const{draggables:i,droppables:a}=n,s=Mn(e),l=Yn({impact:e,draggable:t,draggables:i,afterCritical:o,droppable:(s?a[s]:null)||a[t.descriptor.droppableId],viewport:r});return Lt(l,t.client.borderBox.center)})({impact:d,draggable:c,dimensions:l,viewport:o.viewport,afterCritical:o.afterCritical}),h={critical:o.critical,afterCritical:o.afterCritical,result:g,impact:d};if(jt(o.current.client.offset,m)&&!Boolean(g.combine))return void t(fr({completed:h}));const b=(({current:e,destination:t,reason:n})=>{const r=Wt(e,t);if(r<=0)return Nr;if(r>=1500)return Dr;const o=Nr+xr*(r/1500);return Number(("CANCEL"===n?.6*o:o).toFixed(2))})({current:o.current.client.offset,destination:m,reason:i});t((e=>({type:"DROP_ANIMATE",payload:e}))({newHomeClientOffset:m,dropDuration:b,completed:h}))};var wr=()=>({x:window.pageXOffset,y:window.pageYOffset});const _r=e=>{const t=function({onWindowScroll:e}){const t=dt(function(){e(wr())}),n=function(e){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:t=>{t.target!==window&&t.target!==window.document||e()}}}(t);let r=yt;function o(){return r!==yt}return{start:function(){o()&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Cannot start scroll listener when already active"):wt()),r=Nt(window,[n])},stop:function(){o()||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Cannot stop scroll listener when not active"):wt()),t.cancel(),r(),r=yt},isActive:o}}({onWindowScroll:t=>{e.dispatch({type:"MOVE_BY_WINDOW_SCROLL",payload:{newScroll:t}})}});return e=>n=>{!t.isActive()&&nr(n,"INITIAL_PUBLISH")&&t.start(),t.isActive()&&(e=>nr(e,"DROP_COMPLETE")||nr(e,"DROP_ANIMATE")||nr(e,"FLUSH"))(n)&&t.stop(),e(n)}},Ir=(e,t)=>{t()},Sr=(e,t)=>({draggableId:e.draggable.id,type:e.droppable.type,source:{droppableId:e.droppable.id,index:e.draggable.index},mode:t});function Cr(e,t,n,r){if(!e)return void n(r(t));const o=(e=>{let t=!1,n=!1;const r=setTimeout(()=>{n=!0}),o=o=>{t?"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&Et("Announcement already made. Not making a second announcement"):n?"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&Et("\n Announcements cannot be made asynchronously.\n Default message has already been announced.\n "):(t=!0,e(o),clearTimeout(r))};return o.wasCalled=()=>t,o})(n);e(t,{announce:o}),o.wasCalled()||n(r(t))}const Ar=e=>t=>n=>{if(!nr(n,"DROP_ANIMATION_FINISHED"))return void t(n);const r=e.getState();"DROP_ANIMATING"!==r.phase&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Cannot finish a drop animating when no drop is occurring"):wt()),e.dispatch(fr({completed:r.completed}))},Vr=e=>{let t=null,n=null;return r=>o=>{if((nr(o,"FLUSH")||nr(o,"DROP_COMPLETE")||nr(o,"DROP_ANIMATION_FINISHED"))&&(n&&(cancelAnimationFrame(n),n=null),t&&(t(),t=null)),r(o),!nr(o,"DROP_ANIMATE"))return;const i={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){"DROP_ANIMATING"===e.getState().phase&&e.dispatch({type:"DROP_ANIMATION_FINISHED",payload:null})}};n=requestAnimationFrame(()=>{n=null,t=Nt(window,[i])})}},Pr=e=>t=>n=>{if(t(n),!nr(n,"PUBLISH_WHILE_DRAGGING"))return;const r=e.getState();"DROP_PENDING"===r.phase&&(r.isWaiting||e.dispatch(gr({reason:r.reason})))},Tr="production"!=='{NODE_ENV:"production"}'.NODE_ENV&&"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({name:"@hello-pangea/dnd"}):F;var Rr=({scrollHeight:e,scrollWidth:t,height:n,width:r})=>{const o=Lt({x:t,y:e},{x:r,y:n});return{x:Math.max(0,o.x),y:Math.max(0,o.y)}},$r=()=>{const e=document.documentElement;return e||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Cannot find document.documentElement"):wt()),e},Br=()=>{const e=$r();return Rr({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,width:e.clientWidth,height:e.clientHeight})};function kr(e,t,n){return n.descriptor.id!==t.id&&n.descriptor.type===t.type&&("virtual"===e.droppable.getById(n.descriptor.droppableId).descriptor.mode||("production"!=='{NODE_ENV:"production"}'.NODE_ENV&&Et(`\n You are attempting to add or remove a Draggable [id: ${n.descriptor.id}]\n while a drag is occurring. This is only supported for virtual lists.\n\n See https://github.com/hello-pangea/dnd/blob/main/docs/patterns/virtual-lists.md\n `),!1))}var Fr=(e,t)=>"IDLE"===e.phase||"DROP_ANIMATING"===e.phase&&e.completed.result.draggableId!==t&&"DROP"===e.completed.result.reason,Mr=e=>{window.scrollBy(e.x,e.y)};const Lr=Jt(e=>tn(e).filter(e=>!!e.isEnabled&&!!e.frame)),jr={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:e=>e**2,durationDampening:{stopDampeningAt:1200,accelerateAt:360},disabled:!1};var Gr=({startOfRange:e,endOfRange:t,current:n})=>{const r=t-e;return 0===r?("production"!=='{NODE_ENV:"production"}'.NODE_ENV&&Et("\n Detected distance range of 0 in the fluid auto scroller\n This is unexpected and would cause a divide by 0 issue.\n Not allowing an auto scroll\n "),0):(n-e)/r},Ur=({distanceToEdge:e,thresholds:t,dragStartTime:n,shouldUseTimeDampening:r,getAutoScrollerOptions:o})=>{const i=((e,t,n=()=>jr)=>{const r=n();if(e>t.startScrollingFrom)return 0;if(e<=t.maxScrollValueAt)return r.maxPixelScroll;if(e===t.startScrollingFrom)return 1;const o=Gr({startOfRange:t.maxScrollValueAt,endOfRange:t.startScrollingFrom,current:e}),i=r.maxPixelScroll*r.ease(1-o);return Math.ceil(i)})(e,t,o);return 0===i?0:r?Math.max(((e,t,n)=>{const r=n(),o=r.durationDampening.accelerateAt,i=r.durationDampening.stopDampeningAt,a=t,s=i,l=Date.now()-a;if(l>=i)return e;if(l<o)return 1;const c=Gr({startOfRange:o,endOfRange:s,current:l}),d=e*r.ease(c);return Math.ceil(d)})(i,n,o),1):i},Wr=({container:e,distanceToEdges:t,dragStartTime:n,axis:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const a=((e,t,n=()=>jr)=>{const r=n();return{startScrollingFrom:e[t.size]*r.startFromPercentage,maxScrollValueAt:e[t.size]*r.maxScrollAtPercentage}})(e,r,i);return t[r.end]<t[r.start]?Ur({distanceToEdge:t[r.end],thresholds:a,dragStartTime:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i}):-1*Ur({distanceToEdge:t[r.start],thresholds:a,dragStartTime:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i})};const qr=zt(e=>0===e?0:e);var zr=({dragStartTime:e,container:t,subject:n,center:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const a={top:r.y-t.top,right:t.right-r.x,bottom:t.bottom-r.y,left:r.x-t.left},s=Wr({container:t,distanceToEdges:a,dragStartTime:e,axis:mn,shouldUseTimeDampening:o,getAutoScrollerOptions:i}),l=Wr({container:t,distanceToEdges:a,dragStartTime:e,axis:hn,shouldUseTimeDampening:o,getAutoScrollerOptions:i}),c=qr({x:l,y:s});if(jt(c,Ft))return null;const d=(({container:e,subject:t,proposedScroll:n})=>{const r=t.height>e.height,o=t.width>e.width;return o||r?o&&r?null:{x:o?0:n.x,y:r?0:n.y}:n})({container:t,subject:n,proposedScroll:c});return d?jt(d,Ft)?null:d:null};const Hr=zt(e=>0===e?0:e>0?1:-1),Yr=(()=>{const e=(e,t)=>e<0?e:e>t?e-t:0;return({current:t,max:n,change:r})=>{const o=Mt(t,r),i={x:e(o.x,n.x),y:e(o.y,n.y)};return jt(i,Ft)?null:i}})(),Zr=({max:e,current:t,change:n})=>{const r={x:Math.max(t.x,e.x),y:Math.max(t.y,e.y)},o=Hr(n),i=Yr({max:r,current:t,change:o});return!i||0!==o.x&&0===i.x||0!==o.y&&0===i.y},Xr=(e,t)=>Zr({current:e.scroll.current,max:e.scroll.max,change:t}),Kr=(e,t)=>{const n=e.frame;return!!n&&Zr({current:n.scroll.current,max:n.scroll.max,change:t})};var Jr=({state:e,dragStartTime:t,shouldUseTimeDampening:n,scrollWindow:r,scrollDroppable:o,getAutoScrollerOptions:i})=>{const a=e.current.page.borderBoxCenter,s=e.dimensions.draggables[e.critical.draggable.id].page.marginBox;if(e.isWindowScrollAllowed){const o=(({viewport:e,subject:t,center:n,dragStartTime:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const a=zr({dragStartTime:r,container:e.frame,subject:t,center:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i});return a&&Xr(e,a)?a:null})({dragStartTime:t,viewport:e.viewport,subject:s,center:a,shouldUseTimeDampening:n,getAutoScrollerOptions:i});if(o)return void r(o)}const l=(({center:e,destination:t,droppables:n})=>{if(t){const e=n[t];return e.frame?e:null}const r=((e,t)=>{const n=Lr(t).find(t=>(t.frame||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Invalid result"):wt()),jn(t.frame.pageMarginBox)(e)))||null;return n})(e,n);return r})({center:a,destination:Mn(e.impact),droppables:e.dimensions.droppables});if(!l)return;const c=(({droppable:e,subject:t,center:n,dragStartTime:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const a=e.frame;if(!a)return null;const s=zr({dragStartTime:r,container:a.pageMarginBox,subject:t,center:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i});return s&&Kr(e,s)?s:null})({dragStartTime:t,droppable:l,subject:s,center:a,shouldUseTimeDampening:n,getAutoScrollerOptions:i});c&&o(l.descriptor.id,c)};const Qr="data-rfd",eo=(()=>{const e=`${Qr}-drag-handle`;return{base:e,draggableId:`${e}-draggable-id`,contextId:`${e}-context-id`}})(),to=(()=>{const e=`${Qr}-draggable`;return{base:e,contextId:`${e}-context-id`,id:`${e}-id`}})(),no=(()=>{const e=`${Qr}-droppable`;return{base:e,contextId:`${e}-context-id`,id:`${e}-id`}})(),ro={contextId:`${Qr}-scroll-container-context-id`},oo=(e,t)=>e.map(e=>{const n=e.styles[t];return n?`${e.selector} { ${n} }`:""}).join(" "),io="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?e.useLayoutEffect:e.useEffect,ao=()=>{const e=document.querySelector("head");return e||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Cannot find the head to append a style to"):wt()),e},so=e=>{const t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.type="text/css",t};function lo(e,t){return Array.from(e.querySelectorAll(t))}var co=e=>e&&e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView:window;function uo(e){return e instanceof co(e).HTMLElement}function po(e,t){const n=lo(document,`[${eo.contextId}="${e}"]`);if(!n.length)return"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&Et(`Unable to find any drag handles in the context "${e}"`),null;const r=n.find(e=>e.getAttribute(eo.draggableId)===t);return r?uo(r)?r:("production"!=='{NODE_ENV:"production"}'.NODE_ENV&&Et("drag handle needs to be a HTMLElement"),null):("production"!=='{NODE_ENV:"production"}'.NODE_ENV&&Et(`Unable to find drag handle with id "${t}" as no handle with a matching id was found`),null)}function fo(){const e={draggables:{},droppables:{}},t=[];function n(e){t.length&&t.forEach(t=>t(e))}function r(t){return e.draggables[t]||null}function o(t){return e.droppables[t]||null}return{draggable:{register:t=>{e.draggables[t.descriptor.id]=t,n({type:"ADDITION",value:t})},update:(t,n)=>{const r=e.draggables[n.descriptor.id];r&&r.uniqueId===t.uniqueId&&(delete e.draggables[n.descriptor.id],e.draggables[t.descriptor.id]=t)},unregister:t=>{const o=t.descriptor.id,i=r(o);i&&t.uniqueId===i.uniqueId&&(delete e.draggables[o],e.droppables[t.descriptor.droppableId]&&n({type:"REMOVAL",value:t}))},getById:function(e){const t=r(e);return t||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,`Cannot find draggable entry with id [${e}]`):wt()),t},findById:r,exists:e=>Boolean(r(e)),getAllByType:t=>Object.values(e.draggables).filter(e=>e.descriptor.type===t)},droppable:{register:t=>{e.droppables[t.descriptor.id]=t},unregister:t=>{const n=o(t.descriptor.id);n&&t.uniqueId===n.uniqueId&&delete e.droppables[t.descriptor.id]},getById:function(e){const t=o(e);return t||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,`Cannot find droppable entry with id [${e}]`):wt()),t},findById:o,exists:e=>Boolean(o(e)),getAllByType:t=>Object.values(e.droppables).filter(e=>e.descriptor.type===t)},subscribe:function(e){return t.push(e),function(){const n=t.indexOf(e);-1!==n&&t.splice(n,1)}},clean:function(){e.draggables={},e.droppables={},t.length=0}}}var go=g.default.createContext(null),mo=()=>{const e=document.body;return e||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Cannot find document.body"):wt()),e};const ho={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},bo={separator:"::"};function Eo(e,t=bo){const n=g.default.useId();return Bt(()=>`${e}${t.separator}${n}`,[t.separator,e,n])}var vo=g.default.createContext(null);const yo=/(\d+)\.(\d+)\.(\d+)/,No=e=>{const t=yo.exec(e);return null==t&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,`Unable to parse React version ${e}`):wt()),{major:Number(t[1]),minor:Number(t[2]),patch:Number(t[3]),raw:e}},Do="\n We expect a html5 doctype: <!doctype html>\n This is to ensure consistent browser layout and measurement\n\n More information: https://github.com/hello-pangea/dnd/blob/main/docs/guides/doctype.md\n";function xo(e){"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&e()}function Oo(t,n){xo(()=>{e.useEffect(()=>{try{t()}catch(e){vt(`\n A setup problem was encountered.\n\n > ${e.message}\n `)}},n)})}function wo(t){const n=e.useRef(t);return e.useEffect(()=>{n.current=t}),n}function _o(e){return"IDLE"!==e.phase&&"DROP_ANIMATING"!==e.phase&&e.isDragging}const Io=9,So=13,Co=33,Ao=34,Vo=35,Po=36,To={[So]:!0,[Io]:!0};var Ro=e=>{To[e.keyCode]&&e.preventDefault()};const $o=(()=>{const e="visibilitychange";return"undefined"==typeof document?e:[e,`ms${e}`,`webkit${e}`,`moz${e}`,`o${e}`].find(e=>`on${e}`in document)||e})(),Bo={type:"IDLE"};function ko(){}const Fo={[Ao]:!0,[Co]:!0,[Po]:!0,[Vo]:!0},Mo={type:"IDLE"},Lo=["input","button","textarea","select","option","optgroup","video","audio"];function jo(e,t){if(null==t)return!1;if(Lo.includes(t.tagName.toLowerCase()))return!0;const n=t.getAttribute("contenteditable");return"true"===n||""===n||t!==e&&jo(e,t.parentElement)}function Go(e,t){const n=t.target;return!!uo(n)&&jo(e,n)}var Uo=e=>et(e.getBoundingClientRect()).center;const Wo=(()=>{const e="matches";return"undefined"==typeof document?e:[e,"msMatchesSelector","webkitMatchesSelector"].find(e=>e in Element.prototype)||e})();function qo(e,t){return null==e?null:e[Wo](t)?e:qo(e.parentElement,t)}function zo(e,t){return e.closest?e.closest(t):qo(e,t)}function Ho(e){e.preventDefault()}function Yo({expected:e,phase:t,isLockActive:n,shouldWarn:r}){return n()?e===t||(r&&"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&Et(`\n Cannot perform action.\n The actions you used belong to an outdated phase\n\n Current phase: ${e}\n You called an action from outdated phase: ${t}\n\n Tips:\n\n - Do not use preDragActions actions after calling preDragActions.lift()\n `),!1):(r&&"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&Et("\n Cannot perform action.\n The sensor no longer has an action lock.\n\n Tips:\n\n - Throw away your action handlers when forceStop() is called\n - Check actions.isActive() if you really need to\n "),!1)}function Zo({lockAPI:e,store:t,registry:n,draggableId:r}){if(e.isClaimed())return!1;const o=n.draggable.findById(r);return o?!!o.options.isEnabled&&!!Fr(t.getState(),r):("production"!=='{NODE_ENV:"production"}'.NODE_ENV&&Et(`Unable to find draggable with id: ${r}`),!1)}const Xo=[function(t){const n=e.useRef(Bo),r=e.useRef(yt),o=Bt(()=>({eventName:"mousedown",fn:function(e){if(e.defaultPrevented)return;if(0!==e.button)return;if(e.ctrlKey||e.metaKey||e.shiftKey||e.altKey)return;const n=t.findClosestDraggableId(e);if(!n)return;const o=t.tryGetLock(n,s,{sourceEvent:e});if(!o)return;e.preventDefault();const i={x:e.clientX,y:e.clientY};r.current(),d(o,i)}}),[t]),i=Bt(()=>({eventName:"webkitmouseforcewillbegin",fn:e=>{if(e.defaultPrevented)return;const n=t.findClosestDraggableId(e);if(!n)return;const r=t.findOptionsForDraggable(n);r&&(r.shouldRespectForcePress||t.canGetLock(n)&&e.preventDefault())}}),[t]),a=kt(function(){r.current=Nt(window,[i,o],{passive:!1,capture:!0})},[i,o]),s=kt(()=>{"IDLE"!==n.current.type&&(n.current=Bo,r.current(),a())},[a]),l=kt(()=>{const e=n.current;s(),"DRAGGING"===e.type&&e.actions.cancel({shouldBlockNextClick:!0}),"PENDING"===e.type&&e.actions.abort()},[s]),c=kt(function(){const e=function({cancel:e,completed:t,getPhase:n,setPhase:r}){return[{eventName:"mousemove",fn:e=>{const{button:t,clientX:o,clientY:i}=e;if(0!==t)return;const a={x:o,y:i},s=n();if("DRAGGING"===s.type)return e.preventDefault(),void s.actions.move(a);if("PENDING"!==s.type&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Cannot be IDLE"):wt()),l=s.point,c=a,!(Math.abs(c.x-l.x)>=5||Math.abs(c.y-l.y)>=5))return;var l,c;e.preventDefault();const d=s.actions.fluidLift(a);r({type:"DRAGGING",actions:d})}},{eventName:"mouseup",fn:r=>{const o=n();"DRAGGING"===o.type?(r.preventDefault(),o.actions.drop({shouldBlockNextClick:!0}),t()):e()}},{eventName:"mousedown",fn:t=>{"DRAGGING"===n().type&&t.preventDefault(),e()}},{eventName:"keydown",fn:t=>{if("PENDING"!==n().type)return 27===t.keyCode?(t.preventDefault(),void e()):void Ro(t);e()}},{eventName:"resize",fn:e},{eventName:"scroll",options:{passive:!0,capture:!1},fn:()=>{"PENDING"===n().type&&e()}},{eventName:"webkitmouseforcedown",fn:t=>{const r=n();"IDLE"===r.type&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Unexpected phase"):wt()),r.actions.shouldRespectForcePress()?e():t.preventDefault()}},{eventName:$o,fn:e}]}({cancel:l,completed:s,getPhase:()=>n.current,setPhase:e=>{n.current=e}});r.current=Nt(window,e,{capture:!0,passive:!1})},[l,s]),d=kt(function(e,t){"IDLE"!==n.current.type&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Expected to move from IDLE to PENDING drag"):wt()),n.current={type:"PENDING",point:t,actions:e},c()},[c]);io(function(){return a(),function(){r.current()}},[a])},function(t){const n=e.useRef(ko),r=Bt(()=>({eventName:"keydown",fn:function(e){if(e.defaultPrevented)return;if(32!==e.keyCode)return;const r=t.findClosestDraggableId(e);if(!r)return;const i=t.tryGetLock(r,l,{sourceEvent:e});if(!i)return;e.preventDefault();let a=!0;const s=i.snapLift();function l(){a||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Cannot stop capturing a keyboard drag when not capturing"):wt()),a=!1,n.current(),o()}n.current(),n.current=Nt(window,function(e,t){function n(){t(),e.cancel()}return[{eventName:"keydown",fn:r=>27===r.keyCode?(r.preventDefault(),void n()):32===r.keyCode?(r.preventDefault(),t(),void e.drop()):40===r.keyCode?(r.preventDefault(),void e.moveDown()):38===r.keyCode?(r.preventDefault(),void e.moveUp()):39===r.keyCode?(r.preventDefault(),void e.moveRight()):37===r.keyCode?(r.preventDefault(),void e.moveLeft()):void(Fo[r.keyCode]?r.preventDefault():Ro(r))},{eventName:"mousedown",fn:n},{eventName:"mouseup",fn:n},{eventName:"click",fn:n},{eventName:"touchstart",fn:n},{eventName:"resize",fn:n},{eventName:"wheel",fn:n,options:{passive:!0}},{eventName:$o,fn:n}]}(s,l),{capture:!0,passive:!1})}}),[t]),o=kt(function(){n.current=Nt(window,[r],{passive:!1,capture:!0})},[r]);io(function(){return o(),function(){n.current()}},[o])},function(t){const n=e.useRef(Mo),r=e.useRef(yt),o=kt(function(){return n.current},[]),i=kt(function(e){n.current=e},[]),a=Bt(()=>({eventName:"touchstart",fn:function(e){if(e.defaultPrevented)return;const n=t.findClosestDraggableId(e);if(!n)return;const o=t.tryGetLock(n,l,{sourceEvent:e});if(!o)return;const i=e.touches[0],{clientX:a,clientY:s}=i,c={x:a,y:s};r.current(),p(o,c)}}),[t]),s=kt(function(){r.current=Nt(window,[a],{capture:!0,passive:!1})},[a]),l=kt(()=>{const e=n.current;"IDLE"!==e.type&&("PENDING"===e.type&&clearTimeout(e.longPressTimerId),i(Mo),r.current(),s())},[s,i]),c=kt(()=>{const e=n.current;l(),"DRAGGING"===e.type&&e.actions.cancel({shouldBlockNextClick:!0}),"PENDING"===e.type&&e.actions.abort()},[l]),d=kt(function(){const e={capture:!0,passive:!1},t={cancel:c,completed:l,getPhase:o},n=Nt(window,function({cancel:e,completed:t,getPhase:n}){return[{eventName:"touchmove",options:{capture:!1},fn:t=>{const r=n();if("DRAGGING"!==r.type)return void e();r.hasMoved=!0;const{clientX:o,clientY:i}=t.touches[0],a={x:o,y:i};t.preventDefault(),r.actions.move(a)}},{eventName:"touchend",fn:r=>{const o=n();"DRAGGING"===o.type?(r.preventDefault(),o.actions.drop({shouldBlockNextClick:!0}),t()):e()}},{eventName:"touchcancel",fn:t=>{"DRAGGING"===n().type?(t.preventDefault(),e()):e()}},{eventName:"touchforcechange",fn:t=>{const r=n();"IDLE"===r.type&&wt();const o=t.touches[0];if(!o)return;if(!(o.force>=.15))return;const i=r.actions.shouldRespectForcePress();if("PENDING"!==r.type)return i?r.hasMoved?void t.preventDefault():void e():void t.preventDefault();i&&e()}},{eventName:$o,fn:e}]}(t),e),i=Nt(window,function({cancel:e,getPhase:t}){return[{eventName:"orientationchange",fn:e},{eventName:"resize",fn:e},{eventName:"contextmenu",fn:e=>{e.preventDefault()}},{eventName:"keydown",fn:n=>{"DRAGGING"===t().type?(27===n.keyCode&&n.preventDefault(),e()):e()}},{eventName:$o,fn:e}]}(t),e);r.current=function(){n(),i()}},[c,o,l]),u=kt(function(){const e=o();"PENDING"!==e.type&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,`Cannot start dragging from phase ${e.type}`):wt());const t=e.actions.fluidLift(e.point);i({type:"DRAGGING",actions:t,hasMoved:!1})},[o,i]),p=kt(function(e,t){"IDLE"!==o().type&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Expected to move from IDLE to PENDING drag"):wt());const n=setTimeout(u,120);i({type:"PENDING",point:t,actions:e,longPressTimerId:n}),d()},[d,o,i,u]);io(function(){return s(),function(){r.current();const e=o();"PENDING"===e.type&&(clearTimeout(e.longPressTimerId),i(Mo))}},[o,s,i]),io(function(){return Nt(window,[{eventName:"touchmove",fn:()=>{},options:{capture:!1,passive:!1}}])},[])}];function Ko({contextId:t,store:n,registry:r,customSensors:o,enableDefaultSensors:i}){const a=[...i?Xo:[],...o||[]],s=e.useState(()=>function(){let e=null;function t(){e||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Cannot release lock when there is no lock"):wt()),e=null}return{isClaimed:function(){return Boolean(e)},isActive:function(t){return t===e},claim:function(t){e&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Cannot claim lock as it is already claimed"):wt());const n={abandon:t};return e=n,n},release:t,tryAbandon:function(){e&&(e.abandon(),t())}}}())[0],l=kt(function(e,t){_o(e)&&!_o(t)&&s.tryAbandon()},[s]);io(function(){let e=n.getState();return n.subscribe(()=>{const t=n.getState();l(e,t),e=t})},[s,n,l]),io(()=>s.tryAbandon,[s.tryAbandon]);const c=kt(e=>Zo({lockAPI:s,registry:r,store:n,draggableId:e}),[s,r,n]),d=kt((e,o,i)=>function({lockAPI:e,contextId:t,store:n,registry:r,draggableId:o,forceSensorStop:i,sourceEvent:a}){if(!Zo({lockAPI:e,store:n,registry:r,draggableId:o}))return null;const s=r.draggable.getById(o),l=function(e,t){const n=lo(document,`[${to.contextId}="${e}"]`).find(e=>e.getAttribute(to.id)===t);return n?uo(n)?n:("production"!=='{NODE_ENV:"production"}'.NODE_ENV&&Et("Draggable element is not a HTMLElement"),null):null}(t,s.descriptor.id);if(!l)return"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&Et(`Unable to find draggable element with id: ${o}`),null;if(a&&!s.options.canDragInteractiveElements&&Go(l,a))return null;const c=e.claim(i||yt);let d="PRE_DRAG";function u(){return s.options.shouldRespectForcePress}function p(){return e.isActive(c)}const f=function(e,t){Yo({expected:e,phase:d,isLockActive:p,shouldWarn:!0})&&n.dispatch(t())}.bind(null,"DRAGGING");function g(t){function r(){e.release(),d="COMPLETED"}function o(e,o={shouldBlockNextClick:!1}){if(t.cleanup(),o.shouldBlockNextClick){const e=Nt(window,[{eventName:"click",fn:Ho,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(e)}r(),n.dispatch(gr({reason:e}))}return"PRE_DRAG"!==d&&(r(),"production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,`Cannot lift in phase ${d}`):wt()),n.dispatch((e=>({type:"LIFT",payload:e}))(t.liftActionArgs)),d="DRAGGING",{isActive:()=>Yo({expected:"DRAGGING",phase:d,isLockActive:p,shouldWarn:!1}),shouldRespectForcePress:u,drop:e=>o("DROP",e),cancel:e=>o("CANCEL",e),...t.actions}}return{isActive:()=>Yo({expected:"PRE_DRAG",phase:d,isLockActive:p,shouldWarn:!1}),shouldRespectForcePress:u,fluidLift:function(e){const t=dt(e=>{f(()=>lr({client:e}))});return{...g({liftActionArgs:{id:o,clientSelection:e,movementMode:"FLUID"},cleanup:()=>t.cancel(),actions:{move:t}}),move:t}},snapLift:function(){const e={moveUp:()=>f(cr),moveRight:()=>f(ur),moveDown:()=>f(dr),moveLeft:()=>f(pr)};return g({liftActionArgs:{id:o,clientSelection:Uo(l),movementMode:"SNAP"},cleanup:yt,actions:e})},abort:function(){Yo({expected:"PRE_DRAG",phase:d,isLockActive:p,shouldWarn:!0})&&e.release()}}}({lockAPI:s,registry:r,contextId:t,store:n,draggableId:e,forceSensorStop:o||null,sourceEvent:i&&i.sourceEvent?i.sourceEvent:null}),[t,s,r,n]),u=kt(e=>function(e,t){const n=function(e,t){const n=t.target;if(!((r=n)instanceof co(r).Element))return"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&Et("event.target must be a Element"),null;var r;const o=function(e){return`[${eo.contextId}="${e}"]`}(e),i=zo(n,o);return i?uo(i)?i:("production"!=='{NODE_ENV:"production"}'.NODE_ENV&&Et("drag handle must be a HTMLElement"),null):null}(e,t);return n?n.getAttribute(eo.draggableId):null}(t,e),[t]),p=kt(e=>{const t=r.draggable.findById(e);return t?t.options:null},[r.draggable]),f=kt(function(){s.isClaimed()&&(s.tryAbandon(),"IDLE"!==n.getState().phase&&n.dispatch({type:"FLUSH",payload:null}))},[s,n]),g=kt(()=>s.isClaimed(),[s]),m=Bt(()=>({canGetLock:c,tryGetLock:d,findClosestDraggableId:u,findOptionsForDraggable:p,tryReleaseLock:f,isLockClaimed:g}),[c,d,u,p,f,g]);var h;h=a,xo(()=>{const e=wo(h);Oo(()=>{e.current.length!==h.length&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Cannot change the amount of sensor hooks after mounting"):wt())})});for(let e=0;e<a.length;e++)a[e](m)}function Jo(e){return e.current||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Could not find store from lazy ref"):wt()),e.current}function Qo(t){const{contextId:n,setCallbacks:r,sensors:o,nonce:i,dragHandleUsageInstructions:a}=t,l=e.useRef(null);Oo(()=>{((e,t)=>{const n=No("^18.0.0 || ^19.0.0"),r=No(t);((e,t)=>t.major>e.major||!(t.major<e.major)&&(t.minor>e.minor||!(t.minor<e.minor)&&t.patch>=e.patch))(n,r)||"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&Et(`\n React version: [${r.raw}]\n does not satisfy expected peer dependency version: [${n.raw}]\n\n This can result in run time bugs, and even fatal crashes\n `)})(0,g.default.version),(()=>{const e=document.doctype;e?("html"!==e.name.toLowerCase()&&"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&Et(`\n Unexpected <!doctype> found: (${e.name})\n\n ${Do}\n `),""!==e.publicId&&"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&Et(`\n Unexpected <!doctype> publicId found: (${e.publicId})\n A html5 doctype does not have a publicId\n\n ${Do}\n `)):"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&Et(`\n No <!doctype html> found.\n\n ${Do}\n `)})()},[]);const c=wo(t),d=kt(()=>(e=>({onBeforeCapture:t=>{s.flushSync(()=>{e.onBeforeCapture&&e.onBeforeCapture(t)})},onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragEnd:e.onDragEnd,onDragUpdate:e.onDragUpdate}))(c.current),[c]),u=kt(()=>(e=>({...jr,...e.autoScrollerOptions,durationDampening:{...jr.durationDampening,...e.autoScrollerOptions}}))(c.current),[c]),p=function(t){const n=Bt(()=>(e=>`rfd-announcement-${e}`)(t),[t]),r=e.useRef(null);return e.useEffect(function(){const e=document.createElement("div");return r.current=e,e.id=n,e.setAttribute("aria-live","assertive"),e.setAttribute("aria-atomic","true"),ut(e.style,ho),mo().appendChild(e),function(){setTimeout(function(){const t=mo();t.contains(e)&&t.removeChild(e),e===r.current&&(r.current=null)})}},[n]),kt(e=>{const t=r.current;t?t.textContent=e:"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&Et(`\n A screen reader message was trying to be announced but it was unable to do so.\n This can occur if you unmount your <DragDropContext /> in your onDragEnd.\n Consider calling provided.announce() before the unmount so that the instruction will\n not be lost for users relying on a screen reader.\n\n Message not passed to screen reader:\n\n "${e}"\n `)},[])}(n),f=function({contextId:t,text:n}){const r=Eo("hidden-text",{separator:"-"}),o=Bt(()=>function({contextId:e,uniqueId:t}){return`rfd-hidden-text-${e}-${t}`}({contextId:t,uniqueId:r}),[r,t]);return e.useEffect(function(){const e=document.createElement("div");return e.id=o,e.textContent=n,e.style.display="none",mo().appendChild(e),function(){const t=mo();t.contains(e)&&t.removeChild(e)}},[o,n]),o}({contextId:n,text:a}),m=function(t,n){const r=Bt(()=>(e=>{const t=(n=e,e=>`[${e}="${n}"]`);var n;const r=(()=>{const e="\n cursor: -webkit-grab;\n cursor: grab;\n ";return{selector:t(eo.contextId),styles:{always:"\n -webkit-touch-callout: none;\n -webkit-tap-highlight-color: rgba(0,0,0,0);\n touch-action: manipulation;\n ",resting:e,dragging:"pointer-events: none;",dropAnimating:e}}})(),o=[(()=>{const e=`\n transition: ${Er.outOfTheWay};\n `;return{selector:t(to.contextId),styles:{dragging:e,dropAnimating:e,userCancel:e}}})(),r,{selector:t(no.contextId),styles:{always:"overflow-anchor: none;"}},{selector:"body",styles:{dragging:"\n cursor: grabbing;\n cursor: -webkit-grabbing;\n user-select: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n overflow-anchor: none;\n "}}];return{always:oo(o,"always"),resting:oo(o,"resting"),dragging:oo(o,"dragging"),dropAnimating:oo(o,"dropAnimating"),userCancel:oo(o,"userCancel")}})(t),[t]),o=e.useRef(null),i=e.useRef(null),a=kt(Jt(e=>{const t=i.current;t||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Cannot set dynamic style element if it is not set"):wt()),t.textContent=e}),[]),s=kt(e=>{const t=o.current;t||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Cannot set dynamic style element if it is not set"):wt()),t.textContent=e},[]);io(()=>{(o.current||i.current)&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"style elements already mounted"):wt());const e=so(n),l=so(n);return o.current=e,i.current=l,e.setAttribute(`${Qr}-always`,t),l.setAttribute(`${Qr}-dynamic`,t),ao().appendChild(e),ao().appendChild(l),s(r.always),a(r.resting),()=>{const e=e=>{const t=e.current;t||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Cannot unmount ref as it is not set"):wt()),ao().removeChild(t),e.current=null};e(o),e(i)}},[n,s,a,r.always,r.resting,t]);const l=kt(()=>a(r.dragging),[a,r.dragging]),c=kt(e=>{a("DROP"!==e?r.userCancel:r.dropAnimating)},[a,r.dropAnimating,r.userCancel]),d=kt(()=>{i.current&&a(r.resting)},[a,r.resting]);return Bt(()=>({dragging:l,dropping:c,resting:d}),[l,c,d])}(n,i),h=kt(e=>{Jo(l).dispatch(e)},[]),b=Bt(()=>k({publishWhileDragging:rr,updateDroppableScroll:ir,updateDroppableIsEnabled:ar,updateDroppableIsCombineEnabled:sr,collectionStarting:or},h),[h]),E=function(){const t=Bt(fo,[]);return e.useEffect(()=>function(){t.clean()},[t]),t}(),v=Bt(()=>((e,t)=>{let n=null;const r=function({registry:e,callbacks:t}){let n={additions:{},removals:{},modified:{}},r=null;const o=()=>{r||(t.collectionStarting(),r=requestAnimationFrame(()=>{r=null;const{additions:o,removals:i,modified:a}=n,s=Object.keys(o).map(t=>e.draggable.getById(t).getDimension(Ft)).sort((e,t)=>e.descriptor.index-t.descriptor.index),l=Object.keys(a).map(t=>({droppableId:t,scroll:e.droppable.getById(t).callbacks.getScrollWhileDragging()})),c={additions:s,removals:Object.keys(i),modified:l};n={additions:{},removals:{},modified:{}},t.publish(c)}))};return{add:e=>{const t=e.descriptor.id;n.additions[t]=e,n.modified[e.descriptor.droppableId]=!0,n.removals[t]&&delete n.removals[t],o()},remove:e=>{const t=e.descriptor;n.removals[t.id]=!0,n.modified[t.droppableId]=!0,n.additions[t.id]&&delete n.additions[t.id],o()},stop:()=>{r&&(cancelAnimationFrame(r),r=null,n={additions:{},removals:{},modified:{}})}}}({callbacks:{publish:t.publishWhileDragging,collectionStarting:t.collectionStarting},registry:e}),o=t=>{n||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Should only be subscribed when a collection is occurring"):wt());const o=n.critical.draggable;"ADDITION"===t.type&&kr(e,o,t.value)&&r.add(t.value),"REMOVAL"===t.type&&kr(e,o,t.value)&&r.remove(t.value)},i={updateDroppableIsEnabled:(r,o)=>{e.droppable.exists(r)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,`Cannot update is enabled flag of Droppable ${r} as it is not registered`):wt()),n&&t.updateDroppableIsEnabled({id:r,isEnabled:o})},updateDroppableIsCombineEnabled:(r,o)=>{n&&(e.droppable.exists(r)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,`Cannot update isCombineEnabled flag of Droppable ${r} as it is not registered`):wt()),t.updateDroppableIsCombineEnabled({id:r,isCombineEnabled:o}))},scrollDroppable:(t,r)=>{n&&e.droppable.getById(t).callbacks.scroll(r)},updateDroppableScroll:(r,o)=>{n&&(e.droppable.exists(r)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,`Cannot update the scroll on Droppable ${r} as it is not registered`):wt()),t.updateDroppableScroll({id:r,newScroll:o}))},startPublishing:t=>{n&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Cannot start capturing critical dimensions as there is already a collection"):wt());const r=e.draggable.getById(t.draggableId),i=e.droppable.getById(r.descriptor.droppableId),a={draggable:r.descriptor,droppable:i.descriptor},s=e.subscribe(o);return n={critical:a,unsubscribe:s},(({critical:e,scrollOptions:t,registry:n})=>{const r=(()=>{const e=wr(),t=Br(),n=e.y,r=e.x,o=$r();return{frame:et({top:n,left:r,right:r+o.clientWidth,bottom:n+o.clientHeight}),scroll:{initial:e,current:e,max:t,diff:{value:Ft,displacement:Ft}}}})(),o=r.scroll.current,i=n.droppable.getAllByType(e.droppable.type).map(e=>e.callbacks.getDimensionAndWatchScroll(o,t)),a=n.draggable.getAllByType(e.draggable.type).map(e=>e.getDimension(o));return{dimensions:{draggables:en(a),droppables:Qt(i)},critical:e,viewport:r}})({critical:a,registry:e,scrollOptions:t.scrollOptions})},stopPublishing:()=>{n&&(r.stop(),e.droppable.getAllByType(n.critical.droppable.type).forEach(e=>e.callbacks.dragStopped()),n.unsubscribe(),n=null)}};return i})(E,b),[E,b]),y=Bt(()=>(({scrollDroppable:e,scrollWindow:t,move:n,getAutoScrollerOptions:r})=>{const o=(({scrollWindow:e,scrollDroppable:t,getAutoScrollerOptions:n=()=>jr})=>{const r=dt(e),o=dt(t);let i=null;const a=e=>{i||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Cannot fluid scroll if not dragging"):wt());const{shouldUseTimeDampening:t,dragStartTime:a}=i;Jr({state:e,scrollWindow:r,scrollDroppable:o,dragStartTime:a,shouldUseTimeDampening:t,getAutoScrollerOptions:n})};return{start:e=>{i&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Cannot start auto scrolling when already started"):wt());const t=Date.now();let r=!1;const o=()=>{r=!0};Jr({state:e,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:o,scrollDroppable:o,getAutoScrollerOptions:n}),i={dragStartTime:t,shouldUseTimeDampening:r},r&&a(e)},stop:()=>{i&&(r.cancel(),o.cancel(),i=null)},scroll:a}})({scrollWindow:t,scrollDroppable:e,getAutoScrollerOptions:r}),i=(({move:e,scrollDroppable:t,scrollWindow:n})=>r=>{const o=r.scrollJumpRequest;if(!o)return;const i=Mn(r.impact);i||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Cannot perform a jump scroll when there is no destination"):wt());const a=((e,n)=>{if(!Kr(e,n))return n;const r=((e,t)=>{const n=e.frame;return n&&Kr(e,t)?Yr({current:n.scroll.current,max:n.scroll.max,change:t}):null})(e,n);if(!r)return t(e.descriptor.id,n),null;const o=Lt(n,r);return t(e.descriptor.id,o),Lt(n,o)})(r.dimensions.droppables[i],o);if(!a)return;const s=((e,t,r)=>{if(!e)return r;if(!Xr(t,r))return r;const o=((e,t)=>Xr(e,t)?Yr({current:e.scroll.current,max:e.scroll.max,change:t}):null)(t,r);if(!o)return n(r),null;const i=Lt(r,o);return n(i),Lt(r,i)})(r.isWindowScrollAllowed,r.viewport,a);s&&((t,n)=>{const r=Mt(t.current.client.selection,n);e({client:r})})(r,s)})({move:n,scrollWindow:t,scrollDroppable:e});return{scroll:e=>{r().disabled||"DRAGGING"!==e.phase||("FLUID"!==e.movementMode?e.scrollJumpRequest&&i(e):o.scroll(e))},start:o.start,stop:o.stop}})({scrollWindow:Mr,scrollDroppable:v.scrollDroppable,getAutoScrollerOptions:u,...k({move:lr},h)}),[v.scrollDroppable,h,u]),N=function(t){const n=e.useRef({}),r=e.useRef(null),o=e.useRef(null),i=e.useRef(!1),a=kt(function(e,t){const r={id:e,focus:t};return n.current[e]=r,function(){const t=n.current;t[e]!==r&&delete t[e]}},[]),s=kt(function(e){const n=po(t,e);n&&n!==document.activeElement&&n.focus()},[t]),l=kt(function(e,t){r.current===e&&(r.current=t)},[]),c=kt(function(){o.current||i.current&&(o.current=requestAnimationFrame(()=>{o.current=null;const e=r.current;e&&s(e)}))},[s]),d=kt(function(e){r.current=null;const t=document.activeElement;t&&t.getAttribute(eo.draggableId)===e&&(r.current=e)},[]);return io(()=>(i.current=!0,function(){i.current=!1;const e=o.current;e&&cancelAnimationFrame(e)}),[]),Bt(()=>({register:a,tryRecordFocus:d,tryRestoreFocusRecorded:c,tryShiftRecord:l}),[a,d,c,l])}(n),D=Bt(()=>(({dimensionMarshal:e,focusMarshal:t,styleMarshal:n,getResponders:r,announce:o,autoScroller:i})=>{return $(tr,Tr(function(...e){return t=>(n,r)=>{const o=t(n,r);let i=()=>{throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?A(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")};const a={getState:o.getState,dispatch:(e,...t)=>i(e,...t)},s=e.map(e=>e(a));return i=F(...s)(o.dispatch),{...o,dispatch:i}}}((a=n,()=>e=>t=>{nr(t,"INITIAL_PUBLISH")&&a.dragging(),nr(t,"DROP_ANIMATE")&&a.dropping(t.payload.completed.result.reason),(nr(t,"FLUSH")||nr(t,"DROP_COMPLETE"))&&a.resting(),e(t)}),(e=>()=>t=>n=>{(nr(n,"DROP_COMPLETE")||nr(n,"FLUSH")||nr(n,"DROP_ANIMATE"))&&e.stopPublishing(),t(n)})(e),(e=>({getState:t,dispatch:n})=>r=>o=>{if(!nr(o,"LIFT"))return void r(o);const{id:i,clientSelection:a,movementMode:s}=o.payload,l=t();"DROP_ANIMATING"===l.phase&&n(fr({completed:l.completed})),"IDLE"!==t().phase&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Unexpected phase to start a drag"):wt()),n({type:"FLUSH",payload:null}),n({type:"BEFORE_INITIAL_CAPTURE",payload:{draggableId:i,movementMode:s}});const c={draggableId:i,scrollOptions:{shouldPublishImmediately:"SNAP"===s}},{critical:d,dimensions:u,viewport:p}=e.startPublishing(c);(function(e,t){"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&function(e){if(e.length<=1)return;const t=e.map(e=>e.descriptor.index),n={};for(let e=1;e<t.length;e++){const r=t[e];r!==t[e-1]+1&&(n[r]=!0)}if(!Object.keys(n).length)return;const r=t.map(e=>Boolean(n[e])?`[🔥${e}]`:`${e}`).join(", ");"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&Et(`\n Detected non-consecutive <Draggable /> indexes.\n\n (This can cause unexpected bugs)\n\n ${r}\n `)}(rn(e.droppable.id,t.draggables))})(d,u),n({type:"INITIAL_PUBLISH",payload:{critical:d,dimensions:u,clientSelection:a,movementMode:s,viewport:p}})})(e),Or,Ar,Vr,Pr,(e=>t=>n=>r=>{if((e=>nr(e,"DROP_COMPLETE")||nr(e,"DROP_ANIMATE")||nr(e,"FLUSH"))(r))return e.stop(),void n(r);if(nr(r,"INITIAL_PUBLISH")){n(r);const o=t.getState();return"DRAGGING"!==o.phase&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Expected phase to be DRAGGING after INITIAL_PUBLISH"):wt()),void e.start(o)}n(r),e.scroll(t.getState())})(i),_r,(e=>{let t=!1;return()=>n=>r=>{if(nr(r,"INITIAL_PUBLISH"))return t=!0,e.tryRecordFocus(r.payload.critical.draggable.id),n(r),void e.tryRestoreFocusRecorded();if(n(r),t){if(nr(r,"FLUSH"))return t=!1,void e.tryRestoreFocusRecorded();if(nr(r,"DROP_COMPLETE")){t=!1;const n=r.payload.completed.result;n.combine&&e.tryShiftRecord(n.draggableId,n.combine.draggableId),e.tryRestoreFocusRecorded()}}}})(t),((e,t)=>{const n=((e,t)=>{const n=(()=>{const e=[];return{add:t=>{const n=setTimeout(()=>(t=>{const n=e.findIndex(e=>e.timerId===t);-1===n&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Could not find timer"):wt());const[r]=e.splice(n,1);r.callback()})(n));e.push({timerId:n,callback:t})},flush:()=>{if(!e.length)return;const t=[...e];e.length=0,t.forEach(e=>{clearTimeout(e.timerId),e.callback()})}}})();let r=null;const o=n=>{r||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Cannot fire onDragEnd when there is no matching onDragStart"):wt()),r=null,Ir(0,()=>Cr(e().onDragEnd,n,t,Tt))};return{beforeCapture:(t,n)=>{r&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Cannot fire onBeforeCapture as a drag start has already been published"):wt()),Ir(0,()=>{const r=e().onBeforeCapture;r&&r({draggableId:t,mode:n})})},beforeStart:(t,n)=>{r&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Cannot fire onBeforeDragStart as a drag start has already been published"):wt()),Ir(0,()=>{const r=e().onBeforeDragStart;r&&r(Sr(t,n))})},start:(o,i)=>{r&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Cannot fire onBeforeDragStart as a drag start has already been published"):wt());const a=Sr(o,i);r={mode:i,lastCritical:o,lastLocation:a.source,lastCombine:null},n.add(()=>{Ir(0,()=>Cr(e().onDragStart,a,t,Vt))})},update:(o,i)=>{const a=on(i),s=an(i);r||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Cannot fire onDragMove when onDragStart has not been called"):wt());const l=!((c=o)===(d=r.lastCritical)||c.draggable.id===d.draggable.id&&c.draggable.droppableId===d.draggable.droppableId&&c.draggable.type===d.draggable.type&&c.draggable.index===d.draggable.index&&c.droppable.id===d.droppable.id&&c.droppable.type===d.droppable.type);var c,d;l&&(r.lastCritical=o);const u=!((e,t)=>null==e&&null==t||null!=e&&null!=t&&e.droppableId===t.droppableId&&e.index===t.index)(r.lastLocation,a);u&&(r.lastLocation=a);const p=!((e,t)=>null==e&&null==t||null!=e&&null!=t&&e.draggableId===t.draggableId&&e.droppableId===t.droppableId)(r.lastCombine,s);if(p&&(r.lastCombine=s),!l&&!u&&!p)return;const f={...Sr(o,r.mode),combine:s,destination:a};n.add(()=>{Ir(0,()=>Cr(e().onDragUpdate,f,t,Pt))})},flush:()=>{r||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Can only flush responders while dragging"):wt()),n.flush()},drop:o,abort:()=>{if(!r)return;const e={...Sr(r.lastCritical,r.mode),combine:null,destination:null,reason:"CANCEL"};o(e)}}})(e,t);return e=>t=>r=>{if(nr(r,"BEFORE_INITIAL_CAPTURE"))return void n.beforeCapture(r.payload.draggableId,r.payload.movementMode);if(nr(r,"INITIAL_PUBLISH")){const e=r.payload.critical;return n.beforeStart(e,r.payload.movementMode),t(r),void n.start(e,r.payload.movementMode)}if(nr(r,"DROP_COMPLETE")){const e=r.payload.completed.result;return n.flush(),t(r),void n.drop(e)}if(t(r),nr(r,"FLUSH"))return void n.abort();const o=e.getState();"DRAGGING"===o.phase&&n.update(o.critical,o.impact)}})(r,o))));var a})({announce:p,autoScroller:y,dimensionMarshal:v,focusMarshal:N,getResponders:d,styleMarshal:m}),[p,y,v,N,d,m]);"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&l.current&&l.current!==D&&"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&Et("unexpected store change"),l.current=D;const x=kt(()=>{const e=Jo(l);"IDLE"!==e.getState().phase&&e.dispatch({type:"FLUSH",payload:null})},[]),O=kt(()=>{const e=Jo(l).getState();return"DROP_ANIMATING"===e.phase||"IDLE"!==e.phase&&e.isDragging},[]);r(Bt(()=>({isDragging:O,tryAbort:x}),[O,x]));const w=kt(e=>Fr(Jo(l).getState(),e),[]),_=kt(()=>Ln(Jo(l).getState()),[]),I=Bt(()=>({marshal:v,focus:N,contextId:n,canLift:w,isMovementAllowed:_,dragHandleUsageInstructionsId:f,registry:E}),[n,v,f,N,w,_,E]);return Ko({contextId:n,store:D,registry:E,customSensors:o||null,enableDefaultSensors:!1!==t.enableDefaultSensors}),e.useEffect(()=>x,[x]),g.default.createElement(vo.Provider,{value:I},g.default.createElement(Xe,{context:go,store:D},t.children))}function ei(e){const t=g.default.useId(),n=e.dragHandleUsageInstructions||"\n Press space bar to start a drag.\n When dragging you can use the arrow keys to move the item around and escape to cancel.\n Some screen readers may require you to be in focus mode or to use your pass through key\n";return g.default.createElement(_t,null,r=>g.default.createElement(Qo,{nonce:e.nonce,contextId:t,setCallbacks:r,dragHandleUsageInstructions:n,enableDefaultSensors:e.enableDefaultSensors,sensors:e.sensors,onBeforeCapture:e.onBeforeCapture,onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragUpdate:e.onDragUpdate,onDragEnd:e.onDragEnd,autoScrollerOptions:e.autoScrollerOptions},e.children))}const ti=(e,t)=>t?Er.drop(t.duration):e?Er.snap:Er.fluid,ni=(e,t)=>{if(e)return t?0:.7};var ri=g.default.createContext(null);function oi(e){e&&uo(e)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"\n provided.innerRef has not been provided with a HTMLElement.\n\n You can find a guide on using the innerRef callback functions at:\n https://github.com/hello-pangea/dnd/blob/main/docs/guides/using-inner-ref.md\n "):wt())}function ii(t){const n=e.useContext(t);return n||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Could not find required context"):wt()),n}function ai(e){e.preventDefault()}var si=(e,t)=>e===t,li=e=>{const{combine:t,destination:n}=e;return n?n.droppableId:t?t.droppableId:null};function ci(e=null){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:e,combineWith:null}}const di={mapped:{type:"SECONDARY",offset:Ft,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:ci(null)}},ui=Ze(()=>{const e=function(){const e=Jt((e,t)=>({x:e,y:t})),t=Jt((e,t,n=null,r=null,o=null)=>({isDragging:!0,isClone:t,isDropAnimating:Boolean(o),dropAnimation:o,mode:e,draggingOver:n,combineWith:r,combineTargetFor:null})),n=Jt((e,n,r,o,i=null,a=null,s=null)=>({mapped:{type:"DRAGGING",dropping:null,draggingOver:i,combineWith:a,mode:n,offset:e,dimension:r,forceShouldAnimate:s,snapshot:t(n,o,i,a,null)}}));return(r,o)=>{if(_o(r)){if(r.critical.draggable.id!==o.draggableId)return null;const t=r.current.client.offset,a=r.dimensions.draggables[o.draggableId],s=Mn(r.impact),l=(i=r.impact).at&&"COMBINE"===i.at.type?i.at.combine.draggableId:null,c=r.forceShouldAnimate;return n(e(t.x,t.y),r.movementMode,a,o.isClone,s,l,c)}var i;if("DROP_ANIMATING"===r.phase){const e=r.completed;if(e.result.draggableId!==o.draggableId)return null;const n=o.isClone,i=r.dimensions.draggables[o.draggableId],a=e.result,s=a.mode,l=li(a),c=(e=>e.combine?e.combine.draggableId:null)(a),d={duration:r.dropDuration,curve:mr,moveTo:r.newHomeClientOffset,opacity:c?0:null,scale:c?.75:null};return{mapped:{type:"DRAGGING",offset:r.newHomeClientOffset,dimension:i,dropping:d,draggingOver:l,combineWith:c,mode:s,forceShouldAnimate:null,snapshot:t(s,n,l,c,d)}}}return null}}(),t=function(){const e=Jt((e,t)=>({x:e,y:t})),t=Jt(ci),n=Jt((e,n=null,r)=>({mapped:{type:"SECONDARY",offset:e,combineTargetFor:n,shouldAnimateDisplacement:r,snapshot:t(n)}})),r=e=>e?n(Ft,e,!0):null,o=(t,o,i,a)=>{const s=i.displaced.visible[t],l=Boolean(a.inVirtualList&&a.effected[t]),c=an(i),d=c&&c.draggableId===t?o:null;if(!s){if(!l)return r(d);if(i.displaced.invisible[t])return null;const o=Gt(a.displacedBy.point),s=e(o.x,o.y);return n(s,d,!0)}if(l)return r(d);const u=i.displacedBy.point,p=e(u.x,u.y);return n(p,d,s.shouldAnimate)};return(e,t)=>{if(_o(e))return e.critical.draggable.id===t.draggableId?null:o(t.draggableId,e.critical.draggable.id,e.impact,e.afterCritical);if("DROP_ANIMATING"===e.phase){const n=e.completed;return n.result.draggableId===t.draggableId?null:o(t.draggableId,n.result.draggableId,n.impact,n.afterCritical)}return null}}();return(n,r)=>e(n,r)||t(n,r)||di},{dropAnimationFinished:()=>({type:"DROP_ANIMATION_FINISHED",payload:null})},null,{context:go,areStatePropsEqual:si})(t=>{const n=e.useRef(null),r=kt((e=null)=>{n.current=e},[]),o=kt(()=>n.current,[]),{contextId:i,dragHandleUsageInstructionsId:a,registry:l}=ii(vo),{type:c,droppableId:d}=ii(ri),u=Bt(()=>({id:t.draggableId,index:t.index,type:c,droppableId:d}),[t.draggableId,t.index,c,d]),{children:p,draggableId:f,isEnabled:m,shouldRespectForcePress:h,canDragInteractiveElements:b,isClone:E,mapped:v,dropAnimationFinished:y}=t;(function(e,t,n){Oo(()=>{function r(e){return`Draggable[id: ${e}]: `}const o=e.draggableId;o||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Draggable requires a draggableId"):wt()),"string"!=typeof o&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,`Draggable requires a [string] draggableId.\n Provided: [type: ${typeof o}] (value: ${o})`):wt()),Number.isInteger(e.index)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,`${r(o)} requires an integer index prop`):wt()),"DRAGGING"!==e.mapped.type&&(oi(n()),e.isEnabled&&(po(t,o)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,`${r(o)} Unable to find drag handle`):wt())))})})(t,i,o),function(t){xo(()=>{const n=e.useRef(t);Oo(()=>{t!==n.current&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Draggable isClone prop value changed during component life"):wt())},[t])})}(E),E||function(t){const n=Eo("draggable"),{descriptor:r,registry:o,getDraggableRef:i,canDragInteractiveElements:a,shouldRespectForcePress:s,isEnabled:l}=t,c=Bt(()=>({canDragInteractiveElements:a,shouldRespectForcePress:s,isEnabled:l}),[a,l,s]),d=kt(e=>{const t=i();return t||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Cannot get dimension when no ref is set"):wt()),function(e,t,n=Ft){const r=window.getComputedStyle(t),o=t.getBoundingClientRect(),i=lt(o,r),a=st(i,n);return{descriptor:e,placeholder:{client:i,tagName:t.tagName.toLowerCase(),display:r.display},displaceBy:{x:i.marginBox.width,y:i.marginBox.height},client:i,page:a}}(r,t,e)},[r,i]),u=Bt(()=>({uniqueId:n,descriptor:r,options:c,getDimension:d}),[r,d,c,n]),p=e.useRef(u),f=e.useRef(!0);io(()=>(o.draggable.register(p.current),()=>o.draggable.unregister(p.current)),[o.draggable]),io(()=>{if(f.current)return void(f.current=!1);const e=p.current;p.current=u,o.draggable.update(u,e)},[u,o.draggable])}(Bt(()=>({descriptor:u,registry:l,getDraggableRef:o,canDragInteractiveElements:b,shouldRespectForcePress:h,isEnabled:m}),[u,l,o,b,h,m]));const N=Bt(()=>m?{tabIndex:0,role:"button","aria-describedby":a,"data-rfd-drag-handle-draggable-id":f,"data-rfd-drag-handle-context-id":i,draggable:!1,onDragStart:ai}:null,[i,a,f,m]),D=kt(e=>{"DRAGGING"===v.type&&v.dropping&&"transform"===e.propertyName&&s.flushSync(y)},[y,v]),x=Bt(()=>{const e=function(e){return"DRAGGING"===e.type?function(e){const t=e.dimension.client,{offset:n,combineWith:r,dropping:o}=e,i=Boolean(r),a=(e=>null!=e.forceShouldAnimate?e.forceShouldAnimate:"SNAP"===e.mode)(e),s=Boolean(o),l=s?((e,t)=>{const n=vr(e);if(n)return t?`${n} scale(0.75)`:n})(n,i):yr(n);return{position:"fixed",top:t.marginBox.top,left:t.marginBox.left,boxSizing:"border-box",width:t.borderBox.width,height:t.borderBox.height,transition:ti(a,o),transform:l,opacity:ni(i,s),zIndex:s?4500:5e3,pointerEvents:"none"}}(e):{transform:yr((t=e).offset),transition:t.shouldAnimateDisplacement?void 0:"none"};var t}(v);return{innerRef:r,draggableProps:{"data-rfd-draggable-context-id":i,"data-rfd-draggable-id":f,style:e,onTransitionEnd:"DRAGGING"===v.type&&v.dropping?D:void 0},dragHandleProps:N}},[i,N,f,v,D,r]),O=Bt(()=>({draggableId:u.id,type:u.type,source:{index:u.index,droppableId:u.droppableId}}),[u.droppableId,u.id,u.index,u.type]);return g.default.createElement(g.default.Fragment,null,p(x,v.snapshot,O))});function pi(e){return ii(ri).isUsingCloneFor!==e.draggableId||e.isClone?g.default.createElement(ui,e):null}function fi(e){const t="boolean"!=typeof e.isDragDisabled||!e.isDragDisabled,n=Boolean(e.disableInteractiveElementBlocking),r=Boolean(e.shouldRespectForcePress);return g.default.createElement(pi,ut({},e,{isClone:!1,isEnabled:t,canDragInteractiveElements:n,shouldRespectForcePress:r}))}const gi=e=>t=>e===t,mi=gi("scroll"),hi=gi("auto"),bi=gi("visible"),Ei=(e,t)=>t(e.overflowX)||t(e.overflowY),vi=e=>{const t=window.getComputedStyle(e),n={overflowX:t.overflowX,overflowY:t.overflowY};return Ei(n,mi)||Ei(n,hi)},yi=e=>null==e?null:e===document.body?(()=>{if("production"==='{NODE_ENV:"production"}'.NODE_ENV)return!1;const e=mo(),t=document.documentElement;if(t||wt(),!vi(e))return!1;const n=window.getComputedStyle(t);return(o=bi)((r={overflowX:n.overflowX,overflowY:n.overflowY}).overflowX)&&o(r.overflowY)||"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&Et("\n We have detected that your <body> element might be a scroll container.\n We have found no reliable way of detecting whether the <body> element is a scroll container.\n Under most circumstances a <body> scroll bar will be on the <html> element (document.documentElement)\n\n Because we cannot determine if the <body> is a scroll container, and generally it is not one,\n we will be treating the <body> as *not* a scroll container\n\n More information: https://github.com/hello-pangea/dnd/blob/main/docs/guides/how-we-detect-scroll-containers.md\n "),!1;var r,o})()?e:null:e===document.documentElement?null:vi(e)?e:yi(e.parentElement);var Ni=e=>({x:e.scrollLeft,y:e.scrollTop});const Di=e=>!!e&&("fixed"===window.getComputedStyle(e).position||Di(e.parentElement)),xi={passive:!1},Oi={passive:!0};var wi=e=>e.shouldPublishImmediately?xi:Oi;const _i=e=>e&&e.env.closestScrollable||null;function Ii(){}const Si={width:0,height:0,margin:{top:0,right:0,bottom:0,left:0}};var Ci=g.default.memo(t=>{const n=e.useRef(null),r=kt(()=>{n.current&&(clearTimeout(n.current),n.current=null)},[]),{animate:o,onTransitionEnd:i,onClose:a,contextId:s}=t,[l,c]=e.useState("open"===t.animate);e.useEffect(()=>l?"open"!==o?(r(),c(!1),Ii):n.current?Ii:(n.current=setTimeout(()=>{n.current=null,c(!1)}),r):Ii,[o,l,r]);const d=kt(e=>{"height"===e.propertyName&&(i(),"close"===o&&a())},[o,a,i]),u=(({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>{const r=(({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>e||"close"===n?Si:{height:t.client.borderBox.height,width:t.client.borderBox.width,margin:t.client.margin})({isAnimatingOpenOnMount:e,placeholder:t,animate:n});return{display:t.display,boxSizing:"border-box",width:r.width,height:r.height,marginTop:r.margin.top,marginRight:r.margin.right,marginBottom:r.margin.bottom,marginLeft:r.margin.left,flexShrink:"0",flexGrow:"0",pointerEvents:"none",transition:"none"!==n?Er.placeholder:null}})({isAnimatingOpenOnMount:l,animate:t.animate,placeholder:t.placeholder});return g.default.createElement(t.placeholder.tagName,{style:u,"data-rfd-placeholder-context-id":s,onTransitionEnd:d,ref:t.innerRef})});function Ai(e){return"boolean"==typeof e}function Vi(e,t){t.forEach(t=>t(e))}const Pi=[function({props:e}){e.droppableId||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"A Droppable requires a droppableId prop"):wt()),"string"!=typeof e.droppableId&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,`A Droppable requires a [string] droppableId. Provided: [${typeof e.droppableId}]`):wt())},function({props:e}){Ai(e.isDropDisabled)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"isDropDisabled must be a boolean"):wt()),Ai(e.isCombineEnabled)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"isCombineEnabled must be a boolean"):wt()),Ai(e.ignoreContainerClipping)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"ignoreContainerClipping must be a boolean"):wt())},function({getDroppableRef:e}){oi(e())}],Ti=[function({props:e,getPlaceholderRef:t}){e.placeholder&&(t()||"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&Et(`\n Droppable setup issue [droppableId: "${e.droppableId}"]:\n DroppableProvided > placeholder could not be found.\n\n Please be sure to add the {provided.placeholder} React Node as a child of your Droppable.\n More information: https://github.com/hello-pangea/dnd/blob/main/docs/api/droppable.md\n `))}],Ri=[function({props:e}){e.renderClone||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Must provide a clone render function (renderClone) for virtual lists"):wt())},function({getPlaceholderRef:e}){e()&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Expected virtual list to not have a placeholder"):wt())}];class $i extends g.default.PureComponent{constructor(...e){super(...e),this.state={isVisible:Boolean(this.props.on),data:this.props.on,animate:this.props.shouldAnimate&&this.props.on?"open":"none"},this.onClose=()=>{"close"===this.state.animate&&this.setState({isVisible:!1})}}static getDerivedStateFromProps(e,t){return e.shouldAnimate?e.on?{isVisible:!0,data:e.on,animate:"open"}:t.isVisible?{isVisible:!0,data:t.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:Boolean(e.on),data:e.on,animate:"none"}}render(){return this.state.isVisible?this.props.children({onClose:this.onClose,data:this.state.data,animate:this.state.animate}):null}}const Bi={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:function(){return document.body||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"document.body is not ready"):wt()),document.body}},ki=e=>{let t,n={...e};for(t in Bi)void 0===e[t]&&(n={...n,[t]:Bi[t]});return n},Fi=(e,t)=>e===t.droppable.type,Mi=(e,t)=>t.draggables[e.draggable.id],Li=Ze(()=>{const e={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},t={...e,shouldAnimatePlaceholder:!1},n=Jt(e=>({draggableId:e.id,type:e.type,source:{index:e.index,droppableId:e.droppableId}})),r=Jt((r,o,i,a,s,l)=>{const c=s.descriptor.id;if(s.descriptor.droppableId===r){const e=l?{render:l,dragging:n(s.descriptor)}:null;return{placeholder:s.placeholder,shouldAnimatePlaceholder:!1,snapshot:{isDraggingOver:i,draggingOverWith:i?c:null,draggingFromThisWith:c,isUsingPlaceholder:!0},useClone:e}}return o?a?{placeholder:s.placeholder,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:i,draggingOverWith:c,draggingFromThisWith:null,isUsingPlaceholder:!0},useClone:null}:e:t});return(n,o)=>{const i=ki(o),a=i.droppableId,s=i.type,l=!i.isDropDisabled,c=i.renderClone;if(_o(n)){const e=n.critical;if(!Fi(s,e))return t;const o=Mi(e,n.dimensions),i=Mn(n.impact)===a;return r(a,l,i,i,o,c)}if("DROP_ANIMATING"===n.phase){const e=n.completed;if(!Fi(s,e.critical))return t;const o=Mi(e.critical,n.dimensions);return r(a,l,li(e.result)===a,Mn(e.impact)===a,o,c)}if("IDLE"===n.phase&&n.completed&&!n.shouldFlush){const r=n.completed;if(!Fi(s,r.critical))return t;const o=Mn(r.impact)===a,i=Boolean(r.impact.at&&"COMBINE"===r.impact.at.type);return o?i?e:t:r.critical.droppable.id===a?e:t}return t}},{updateViewportMaxScroll:e=>({type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:e})},(e,t,n)=>({...ki(n),...e,...t}),{context:go,areStatePropsEqual:si})(t=>{const n=e.useContext(vo);n||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Could not find app context"):wt());const{contextId:r,isMovementAllowed:o}=n,i=e.useRef(null),a=e.useRef(null),{children:s,droppableId:l,type:c,mode:d,direction:u,ignoreContainerClipping:p,isDropDisabled:f,isCombineEnabled:m,snapshot:h,useClone:E,updateViewportMaxScroll:v,getContainerForClone:y}=t,N=kt(()=>i.current,[]),D=kt((e=null)=>{i.current=e},[]),x=kt(()=>a.current,[]),O=kt((e=null)=>{a.current=e},[]);var w;w={props:t,getDroppableRef:N,getPlaceholderRef:x},Oo(()=>{Vi(w,Pi),"standard"===w.props.mode&&Vi(w,Ti),"virtual"===w.props.mode&&Vi(w,Ri)});const _=kt(()=>{o()&&v({maxScroll:Br()})},[o,v]);!function(t){const n=e.useRef(null),r=ii(vo),o=Eo("droppable"),{registry:i,marshal:a}=r,s=wo(t),l=Bt(()=>({id:t.droppableId,type:t.type,mode:t.mode}),[t.droppableId,t.mode,t.type]),c=e.useRef(l),d=Bt(()=>Jt((e,t)=>{n.current||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Can only update scroll when dragging"):wt()),a.updateDroppableScroll(l.id,{x:e,y:t})}),[l.id,a]),u=kt(()=>{const e=n.current;return e&&e.env.closestScrollable?Ni(e.env.closestScrollable):Ft},[]),p=kt(()=>{const e=u();d(e.x,e.y)},[u,d]),f=Bt(()=>dt(p),[p]),g=kt(()=>{const e=n.current,t=_i(e);e&&t||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Could not find scroll options while scrolling"):wt()),e.scrollOptions.shouldPublishImmediately?p():f()},[f,p]),m=kt((e,t)=>{n.current&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Cannot collect a droppable while a drag is occurring"):wt());const o=s.current,i=o.getDroppableRef();i||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Cannot collect without a droppable ref"):wt());const a={closestScrollable:yi(c=i),isFixedOnPage:Di(c)};var c;const d={ref:i,descriptor:l,env:a,scrollOptions:t};n.current=d;const u=(({ref:e,descriptor:t,env:n,windowScroll:r,direction:o,isDropDisabled:i,isCombineEnabled:a,shouldClipSubject:s})=>{const l=n.closestScrollable,c=((e,t)=>{const n=ct(e);if(!t)return n;if(e!==t)return n;const r=n.paddingBox.top-t.scrollTop,o=n.paddingBox.left-t.scrollLeft,i=tt({top:r,right:o+t.scrollWidth,bottom:r+t.scrollHeight,left:o},n.border);return ot({borderBox:i,margin:n.margin,border:n.border,padding:n.padding})})(e,l),d=st(c,r),u=(()=>{if(!l)return null;const e=ct(l),t={scrollHeight:l.scrollHeight,scrollWidth:l.scrollWidth};return{client:e,page:st(e,r),scroll:Ni(l),scrollSize:t,shouldClipSubject:s}})(),p=(({descriptor:e,isEnabled:t,isCombineEnabled:n,isFixedOnPage:r,direction:o,client:i,page:a,closest:s})=>{const l=(()=>{if(!s)return null;const{scrollSize:e,client:t}=s,n=Rr({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,height:t.paddingBox.height,width:t.paddingBox.width});return{pageMarginBox:s.page.marginBox,frameClient:t,scrollSize:e,shouldClipSubject:s.shouldClipSubject,scroll:{initial:s.scroll,current:s.scroll,max:n,diff:{value:Ft,displacement:Ft}}}})(),c="vertical"===o?mn:hn;return{descriptor:e,isCombineEnabled:n,isFixedOnPage:r,axis:c,isEnabled:t,client:i,page:a,frame:l,subject:Xt({page:a,withPlaceholder:null,axis:c,frame:l})}})({descriptor:t,isEnabled:!i,isCombineEnabled:a,isFixedOnPage:n.isFixedOnPage,direction:o,client:c,page:d,closest:u});return p})({ref:i,descriptor:l,env:a,windowScroll:e,direction:o.direction,isDropDisabled:o.isDropDisabled,isCombineEnabled:o.isCombineEnabled,shouldClipSubject:!o.ignoreContainerClipping}),p=a.closestScrollable;return p&&(p.setAttribute(ro.contextId,r.contextId),p.addEventListener("scroll",g,wi(d.scrollOptions)),"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&(e=>{e&&yi(e.parentElement)&&"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&Et("\n Droppable: unsupported nested scroll container detected.\n A Droppable can only have one scroll parent (which can be itself)\n Nested scroll containers are currently not supported.\n\n We hope to support nested scroll containers soon: https://github.com/atlassian/react-beautiful-dnd/issues/131\n ")})(p)),u},[r.contextId,l,g,s]),h=kt(()=>{const e=n.current,t=_i(e);return e&&t||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Can only recollect Droppable client for Droppables that have a scroll container"):wt()),Ni(t)},[]),b=kt(()=>{const e=n.current;e||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Cannot stop drag when no active drag"):wt());const t=_i(e);n.current=null,t&&(f.cancel(),t.removeAttribute(ro.contextId),t.removeEventListener("scroll",g,wi(e.scrollOptions)))},[g,f]),E=kt(e=>{const t=n.current;t||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Cannot scroll when there is no drag"):wt());const r=_i(t);r||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?wt(0,"Cannot scroll a droppable with no closest scrollable"):wt()),r.scrollTop+=e.y,r.scrollLeft+=e.x},[]),v=Bt(()=>({getDimensionAndWatchScroll:m,getScrollWhileDragging:h,dragStopped:b,scroll:E}),[b,m,h,E]),y=Bt(()=>({uniqueId:o,descriptor:l,callbacks:v}),[v,l,o]);io(()=>(c.current=y.descriptor,i.droppable.register(y),()=>{n.current&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV&&Et("Unsupported: changing the droppableId or type of a Droppable during a drag"),b()),i.droppable.unregister(y)}),[v,l,b,y,a,i.droppable]),io(()=>{n.current&&a.updateDroppableIsEnabled(c.current.id,!t.isDropDisabled)},[t.isDropDisabled,a]),io(()=>{n.current&&a.updateDroppableIsCombineEnabled(c.current.id,t.isCombineEnabled)},[t.isCombineEnabled,a])}({droppableId:l,type:c,mode:d,direction:u,isDropDisabled:f,isCombineEnabled:m,ignoreContainerClipping:p,getDroppableRef:N});const I=Bt(()=>g.default.createElement($i,{on:t.placeholder,shouldAnimate:t.shouldAnimatePlaceholder},({onClose:e,data:t,animate:n})=>g.default.createElement(Ci,{placeholder:t,onClose:e,innerRef:O,animate:n,contextId:r,onTransitionEnd:_})),[r,_,t.placeholder,t.shouldAnimatePlaceholder,O]),S=Bt(()=>({innerRef:D,placeholder:I,droppableProps:{"data-rfd-droppable-id":l,"data-rfd-droppable-context-id":r}}),[r,l,I,D]),C=E?E.dragging.draggableId:null,A=Bt(()=>({droppableId:l,type:c,isUsingCloneFor:C}),[l,C,c]);return g.default.createElement(ri.Provider,{value:A},s(S,h),function(){if(!E)return null;const{dragging:e,render:t}=E,n=g.default.createElement(pi,{draggableId:e.draggableId,index:e.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},(n,r)=>t(n,r,e));return b.default.createPortal(n,y())}())});var ji,Gi=function(e){var t=e.children;return g.default.createElement(Li,{droppableId:e.droppableId,renderClone:e.renderClone},function(e,n){return g.default.createElement(a.Box,D({ref:e.innerRef},e.droppableProps,{sx:(r=n.isDraggingOver,{height:"100%",transition:"background-color 0.2s ease",backgroundColor:r?"rgba(0,0,0,0.1)":"transparent"})}),t(e),e.placeholder);var r})},Ui=((ji={})[t.PresenceStatusEnum.Present]="success.main",ji[t.PresenceStatusEnum.NotPresent]="error.main",ji[t.PresenceStatusEnum.PresentElsewhere]="warning.main",ji),Wi=function(e){return D({display:"flex",alignItems:"center",gap:function(e){return e.spacing(1)},padding:function(e){return e.spacing(1)},borderBottom:"1px solid rgba(255, 255, 255, 0.15)",boxShadow:"none","&:last-of-type":{borderBottom:"none"}},e&&{opacity:.5})},qi={name:{flexGrow:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},removeButton:{flexShrink:0,opacity:.6,padding:function(e){return e.spacing(.25)},marginLeft:"auto","&:hover":{opacity:1}}},zi=function(e){var t=e.provided,n=e.user;return g.default.createElement(a.Card,D({ref:t.innerRef},t.draggableProps,t.dragHandleProps,{sx:Wi(!0)}),g.default.createElement(a.Typography,{sx:qi.name},n.name))},Hi=function(e){var t=e.user,n=e.showPresence,r=e.presenceStatus,o=e.onRemove;return g.default.createElement(fi,{draggableId:e.draggableId,index:e.index},function(e,i){return g.default.createElement(a.Card,D({ref:e.innerRef},e.draggableProps,e.dragHandleProps,{sx:Wi(i.isDragging)}),n&&r&&g.default.createElement(a.Box,{sx:(s=r,{flexShrink:0,width:10,height:10,borderRadius:"50%",backgroundColor:Ui[s]})}),g.default.createElement(a.Typography,{sx:qi.name},t.name),o&&g.default.createElement(a.IconButton,{size:"small",color:"error",onClick:o,sx:qi.removeButton},g.default.createElement(v.default,{fontSize:"small"})));var s})},Yi={root:{display:"flex",flexDirection:"column",flexShrink:0,width:250,height:"100%"},header:{display:"flex",padding:function(e){return e.spacing(.5,1)}},action:{display:"flex",alignSelf:"center",margin:function(e){return e.spacing(0,0,0,1)}},count:{fontWeight:"bold"},search:{margin:function(e){return e.spacing(0,1,1,1)},"&.MuiFormControl-root":{margin:0},"& .MuiOutlinedInput-notchedOutline":{border:"none"},"& .MuiInputAdornment-root":{color:"text.primary"}},content:{flexGrow:1,padding:function(e){return e.spacing(.5)},overflow:"auto"}},Zi=function(t){var n=t.operators,r=e.useState(""),i=r[0],s=r[1],l=o.useTranslation().t,c=e.useMemo(function(){if(!i.trim())return n;var e=i.toLowerCase();return n.filter(function(t){return t.name.toLowerCase().includes(e)})},[n,i]);return g.default.createElement(a.Card,{sx:Yi.root},g.default.createElement(a.CardHeader,{title:l("unassignedPool"),action:n.length,slotProps:{title:{variant:"subtitle1"},action:{sx:Yi.action}},sx:Yi.header}),g.default.createElement(a.TextField,{size:"small",label:l("searchOperators"),value:i,onChange:function(e){return s(e.target.value)},sx:Yi.search,slotProps:{input:{startAdornment:g.default.createElement(a.InputAdornment,{position:"start"},g.default.createElement(E.default,{fontSize:"small"}))}}}),g.default.createElement(a.CardContent,{sx:Yi.content},g.default.createElement(Gi,{droppableId:"pool",renderClone:function(e,t,n){return g.default.createElement(zi,{provided:e,user:c[n.source.index]})}},function(){return g.default.createElement(g.default.Fragment,null,c.map(function(e,t){return g.default.createElement(Hi,{key:e.id,user:e,index:t,draggableId:e.id})}))})))},Xi={header:{display:"flex",padding:function(e){return e.spacing(.5,1)},"& .MuiCardHeader-content":{overflowX:"hidden"}},title:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},action:{display:"flex",alignSelf:"center",gap:function(e){return e.spacing(1)},margin:function(e){return e.spacing(0,0,0,1)}},content:{flexGrow:1,padding:function(e){return e.spacing(.5)}}},Ki=function(e){var t,n,r,o,i=e.assignment,s=e.onRemoveOperator,l=(t=i.assignedCount-i.recommendedOperators)>0?{text:"+"+t,status:"overcapacity"}:t<0?{text:""+t,status:"missing"}:{text:"OK",status:"ok"};return g.default.createElement(a.Card,{ref:e.registerRef,sx:(r=i.isOvercapacity,o=e.frozenHeight,D({display:"flex",flexDirection:"column",flexShrink:0,width:250,minHeight:200,border:r?2:1,borderColor:r?"error.main":"divider"},void 0!==o&&{overflow:"hidden",maxHeight:o}))},g.default.createElement(a.CardHeader,{title:i.workplace.name,action:g.default.createElement(g.default.Fragment,null,g.default.createElement(a.Typography,null,i.assignedCount+"/"+i.recommendedOperators),g.default.createElement(a.Typography,{variant:"caption",sx:(n=l.status,{padding:function(e){return e.spacing(.25)+" "+e.spacing(1)},borderRadius:1,color:"ok"===n?"success.contrastText":"error.contrastText",backgroundColor:"ok"===n?"success.main":"error.main"})},l.text)),slotProps:{title:{variant:"subtitle1",sx:Xi.title},action:{sx:Xi.action}},sx:Xi.header}),g.default.createElement(a.CardContent,{sx:Xi.content},g.default.createElement(Gi,{droppableId:i.workplace.id,renderClone:function(e,t,n){return g.default.createElement(zi,{provided:e,user:i.assignedOperators[n.source.index].user})}},function(){return g.default.createElement(g.default.Fragment,null,i.assignedOperators.map(function(e,t){return g.default.createElement(Hi,{key:e.user.id,user:e.user,index:t,draggableId:e.user.id,showPresence:!0,presenceStatus:e.presenceStatus,onRemove:s?function(){return s(e.user.id)}:void 0})}))})))},Ji={grid:function(e){return{display:"flex",flexDirection:"column",flexWrap:"wrap",alignContent:"flex-start",gap:e.spacing(1),height:"100%",overflowX:"auto"}}},Qi=function(n){var r=n.data,o=n.viewState,i=n.updateData,s=n.onMutationComplete,l=n.gqlClients.graphqlSdk,c=e.useState({}),d=c[0],u=c[1],p=e.useRef({}),f=e.useCallback(function(e,t){p.current[e]=t},[]),m=e.useCallback(function(e){var t={};Object.entries(p.current).forEach(function(e){var n=e[1];n&&(t[e[0]]=n.getBoundingClientRect().height)}),u(t)},[]),h=e.useCallback(function(e,t){if(l){var n=r.workplaces.find(function(e){return e.workplace.id===t}),a=null==n?void 0:n.assignedOperators.find(function(t){return t.user.id===e});n&&a&&(i({workplaces:r.workplaces.map(function(n){return n.workplace.id===t?D({},n,{assignedOperators:n.assignedOperators.filter(function(t){return t.user.id!==e}),assignedCount:n.assignedCount-1}):n}),unassignedOperators:[].concat(r.unassignedOperators,[a.user])}),l.unassignOperator({input:{userId:e,shiftId:o.shift.id,validFrom:o.date}}).catch(function(){}))}},[l,r,o,i]);return g.default.createElement(ei,{onDragStart:m,onDragEnd:function(e){if(u({}),l){var n=function(e,n){var r=n.source,o=n.destination;if(!o)return null;if(r.droppableId===o.droppableId&&r.index===o.index)return null;var i,a=n.draggableId,s="pool"===r.droppableId,l="pool"===o.droppableId,c=t.PresenceStatusEnum.NotPresent,d=[].concat(e.unassignedOperators),u=e.workplaces.map(function(e){return D({},e,{assignedOperators:[].concat(e.assignedOperators)})});if(s){var p=d.findIndex(function(e){return e.id===a});-1!==p&&(i=d[p],d.splice(p,1))}else{var f=u.find(function(e){return e.workplace.id===r.droppableId});if(f){var g=f.assignedOperators.findIndex(function(e){return e.user.id===a});-1!==g&&(i=f.assignedOperators[g].user,c=f.assignedOperators[g].presenceStatus,f.assignedOperators.splice(g,1))}}if(!i)return null;if(l)d.splice(o.index,0,i);else{var m=u.find(function(e){return e.workplace.id===o.droppableId});m&&m.assignedOperators.splice(o.index,0,{user:i,presenceStatus:c})}return{workplaces:u,unassignedOperators:d}}(r,e);if(n){i(n);var a=e.destination,c=e.draggableId;"pool"===a.droppableId?l.unassignOperator({input:{userId:c,shiftId:o.shift.id,validFrom:o.date}}).then(s).catch(function(){}):l.assignOperator({input:{userId:c,workplaceId:a.droppableId,shiftId:o.shift.id,validFrom:o.date}}).then(s).catch(function(){})}}}},g.default.createElement(a.Box,{sx:Ji.grid},g.default.createElement(Zi,{operators:r.unassignedOperators}),r.workplaces.map(function(e){return g.default.createElement(Ki,{key:e.workplace.id,assignment:e,registerRef:function(t){return f(e.workplace.id,t)},frozenHeight:d[e.workplace.id],onRemoveOperator:function(t){return h(t,e.workplace.id)}})})))},ea={root:{display:"flex",alignItems:"center",justifyContent:"center",gap:function(e){return e.spacing(2)},marginBottom:function(e){return e.spacing(1)},padding:function(e){return e.spacing(1)},borderBottom:"1px solid #717171",background:"#525860"},label:{minWidth:200,textAlign:"center",color:"rgba(255, 255, 255, 0.65)"}},ta=function(e){var t=e.viewState,n=e.departmentName,r=e.canPrev,o=e.canNext,i=void 0===o||o,s=e.onNavigate;return g.default.createElement(a.Box,{sx:ea.root},g.default.createElement(a.IconButton,{color:"secondary",disabled:!(void 0===r||r),onClick:function(){return s("prev")}},g.default.createElement(y.default,null)),g.default.createElement(a.Typography,{sx:ea.label},t.date," - ",t.shift.name,n&&" - "+n),g.default.createElement(a.IconButton,{color:"secondary",disabled:!i,onClick:function(){return s("next")}},g.default.createElement(N.default,null)))},na={root:{display:"flex",flexDirection:"column",height:"100%"}},ra=function(t){var n=t.data,r=t.updateData,i=t.gqlClients,s=t.settings,l=o.useTranslation().t,c=e.useState(null),d=c[0],u=c[1],p=e.useMemo(function(){if(null!=s&&s.departmentId){var e=n.departments.find(function(e){return e.id===s.departmentId});return null==e?void 0:e.name}},[null==s?void 0:s.departmentId,n.departments]),f=i.graphqlSdk;e.useEffect(function(){if(n.shifts.length>0&&!d){var e=_(n.shifts);e&&u(e)}},[n.shifts,d]);var m=e.useRef(null);m.current=function(){f&&d&&r&&f.workplaceAssignments({input:{date:d.date,shiftId:d.shift.id,departmentId:(null==s?void 0:s.departmentId)||void 0}}).then(function(e){return r(e.workplaceAssignments)}).catch(function(){})},e.useEffect(function(){if(d&&f){null==m.current||m.current();var e=setInterval(function(){return null==m.current?void 0:m.current()},1e3*((null==s?void 0:s.refreshInterval)||60));return function(){return clearInterval(e)}}},[d,f,null==s?void 0:s.departmentId,null==s?void 0:s.refreshInterval]);var b=e.useCallback(function(e){if(d){var t=function(e,t,n){var r=O(t);if(!I(e,r,n))return e;var o=r.findIndex(function(t){return t.id===e.shift.id});return"next"===n?o<r.length-1?{date:e.date,shift:r[o+1]}:{date:h.default(e.date).add(1,"day").format("YYYY-MM-DD"),shift:r[0]}:o>0?{date:e.date,shift:r[o-1]}:{date:h.default(e.date).subtract(1,"day").format("YYYY-MM-DD"),shift:r[r.length-1]}}(d,n.shifts,e);u(t)}},[d,n.shifts]),E=!!d&&I(d,n.shifts,"prev"),v=!!d&&I(d,n.shifts,"next");return g.default.createElement(a.Box,{sx:na.root},d?g.default.createElement(g.default.Fragment,null,g.default.createElement(ta,{viewState:d,departmentName:p,canPrev:E,canNext:v,onNavigate:b}),g.default.createElement(Qi,{data:n,viewState:d,gqlClients:i,updateData:r,onMutationComplete:function(){return null==m.current?void 0:m.current()}})):g.default.createElement(a.Typography,null,l("noShiftsAvailable")))};function oa(e){this._maxSize=e,this.clear()}oa.prototype.clear=function(){this._size=0,this._values=Object.create(null)},oa.prototype.get=function(e){return this._values[e]},oa.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var ia=/[^.^\]^[]+|(?=\[\]|\.\.)/g,aa=/^\d+$/,sa=/^\d/,la=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,ca=/^\s*(['"]?)(.*?)(\1)\s*$/,da=new oa(512),ua=new oa(512),pa=new oa(512),fa={Cache:oa,split:ma,normalizePath:ga,setter:function(e){var t=ga(e);return ua.get(e)||ua.set(e,function(e,n){for(var r=0,o=t.length,i=e;r<o-1;){var a=t[r];if("__proto__"===a||"constructor"===a||"prototype"===a)return e;i=i[t[r++]]}i[t[r]]=n})},getter:function(e,t){var n=ga(e);return pa.get(e)||pa.set(e,function(e){for(var r=0,o=n.length;r<o;){if(null==e&&t)return;e=e[n[r++]]}return e})},join:function(e){return e.reduce(function(e,t){return e+(ha(t)||aa.test(t)?"["+t+"]":(e?".":"")+t)},"")},forEach:function(e,t,n){!function(e,t,n){var r,o,i,a,s=e.length;for(o=0;o<s;o++)(r=e[o])&&(ba(r)&&(r='"'+r+'"'),i=!(a=ha(r))&&/^\d+$/.test(r),t.call(n,r,a,i,o,e))}(Array.isArray(e)?e:ma(e),t,n)}};function ga(e){return da.get(e)||da.set(e,ma(e).map(function(e){return e.replace(ca,"$2")}))}function ma(e){return e.match(ia)||[""]}function ha(e){return"string"==typeof e&&e&&-1!==["'",'"'].indexOf(e.charAt(0))}function ba(e){return!ha(e)&&(function(e){return e.match(sa)&&!e.match(aa)}(e)||function(e){return la.test(e)}(e))}const Ea=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,va=e=>e.match(Ea)||[];var ya=e=>va(e).reduce((e,t)=>`${e}${e?t[0].toUpperCase()+t.slice(1).toLowerCase():t.toLowerCase()}`,""),Na=e=>(e=>va(e).join("_").toLowerCase())(e),Da=function(e){return xa(function(e){for(var t=new Set,n=0,r=e.length;n<r;n++){var o=e[n];t.add(o[0]),t.add(o[1])}return Array.from(t)}(e),e)};function xa(e,t){var n=e.length,r=new Array(n),o={},i=n,a=function(e){for(var t=new Map,n=0,r=e.length;n<r;n++){var o=e[n];t.has(o[0])||t.set(o[0],new Set),t.has(o[1])||t.set(o[1],new Set),t.get(o[0]).add(o[1])}return t}(t),s=function(e){for(var t=new Map,n=0,r=e.length;n<r;n++)t.set(e[n],n);return t}(e);for(t.forEach(function(e){if(!s.has(e[0])||!s.has(e[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});i--;)o[i]||l(e[i],i,new Set);return r;function l(e,t,i){if(i.has(e)){var c;try{c=", node was:"+JSON.stringify(e)}catch(e){c=""}throw new Error("Cyclic dependency"+c)}if(!s.has(e))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(e));if(!o[t]){o[t]=!0;var d=a.get(e)||new Set;if(t=(d=Array.from(d)).length){i.add(e);do{var u=d[--t];l(u,s.get(u),i)}while(t);i.delete(e)}r[--n]=e}}}Da.array=xa;const Oa=Object.prototype.toString,wa=Error.prototype.toString,_a=RegExp.prototype.toString,Ia="undefined"!=typeof Symbol?Symbol.prototype.toString:()=>"",Sa=/^Symbol\((.*)\)(.*)$/;function Ca(e,t=!1){if(null==e||!0===e||!1===e)return""+e;const n=typeof e;if("number"===n)return function(e){return e!=+e?"NaN":0===e&&1/e<0?"-0":""+e}(e);if("string"===n)return t?`"${e}"`:e;if("function"===n)return"[Function "+(e.name||"anonymous")+"]";if("symbol"===n)return Ia.call(e).replace(Sa,"Symbol($1)");const r=Oa.call(e).slice(8,-1);return"Date"===r?isNaN(e.getTime())?""+e:e.toISOString(e):"Error"===r||e instanceof Error?"["+wa.call(e)+"]":"RegExp"===r?_a.call(e):null}function Aa(e,t){let n=Ca(e,t);return null!==n?n:JSON.stringify(e,function(e,n){let r=Ca(this[e],t);return null!==r?r:n},2)}function Va(e){return null==e?[]:[].concat(e)}let Pa,Ta,Ra,$a=/\$\{\s*(\w+)\s*\}/g;Pa=Symbol.toStringTag;class Ba{constructor(e,t,n,r){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[Pa]="Error",this.name="ValidationError",this.value=t,this.path=n,this.type=r,this.errors=[],this.inner=[],Va(e).forEach(e=>{ka.isError(e)?(this.errors.push(...e.errors),this.inner.push(...e.inner.length?e.inner:[e])):this.errors.push(e)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}Ta=Symbol.hasInstance,Ra=Symbol.toStringTag;class ka extends Error{static formatError(e,t){return t=Object.assign({},t,{path:t.label||t.path||"this",originalPath:t.path}),"string"==typeof e?e.replace($a,(e,n)=>Aa(t[n])):"function"==typeof e?e(t):e}static isError(e){return e&&"ValidationError"===e.name}constructor(e,t,n,r,o){const i=new Ba(e,t,n,r);if(o)return i;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[Ra]="Error",this.name=i.name,this.message=i.message,this.type=i.type,this.value=i.value,this.path=i.path,this.errors=i.errors,this.inner=i.inner,Error.captureStackTrace&&Error.captureStackTrace(this,ka)}static[Ta](e){return Ba[Symbol.hasInstance](e)||super[Symbol.hasInstance](e)}}let Fa={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:n,originalValue:r})=>{const o=null!=r&&r!==n?` (cast from the value \`${Aa(r,!0)}\`).`:".";return"mixed"!==t?`${e} must be a \`${t}\` type, but the final value was: \`${Aa(n,!0)}\``+o:`${e} must match the configured type. The validated value was: \`${Aa(n,!0)}\``+o}},Ma={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},La={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},ja={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Ga={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},Ua={notType:e=>{const{path:t,value:n,spec:r}=e,o=r.types.length;if(Array.isArray(n)){if(n.length<o)return`${t} tuple value has too few items, expected a length of ${o} but got ${n.length} for value: \`${Aa(n,!0)}\``;if(n.length>o)return`${t} tuple value has too many items, expected a length of ${o} but got ${n.length} for value: \`${Aa(n,!0)}\``}return ka.formatError(Fa.notType,e)}};var Wa=Object.assign(Object.create(null),{mixed:Fa,string:Ma,number:La,date:ja,object:Ga,array:{min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},boolean:{isValue:"${path} field must be ${value}"},tuple:Ua});const qa=e=>e&&e.__isYupSchema__;class za{static fromOptions(e,t){if(!t.then&&!t.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:n,then:r,otherwise:o}=t,i="function"==typeof n?n:(...e)=>e.every(e=>e===n);return new za(e,(e,t)=>{var n;let a=i(...e)?r:o;return null!=(n=null==a?void 0:a(t))?n:t})}constructor(e,t){this.fn=void 0,this.refs=e,this.refs=e,this.fn=t}resolve(e,t){let n=this.refs.map(e=>e.getValue(null==t?void 0:t.value,null==t?void 0:t.parent,null==t?void 0:t.context)),r=this.fn(n,e,t);if(void 0===r||r===e)return e;if(!qa(r))throw new TypeError("conditions must return a schema object");return r.resolve(t)}}class Ha{constructor(e,t={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,"string"!=typeof e)throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),""===e)throw new TypeError("ref must be a non-empty string");this.isContext="$"===this.key[0],this.isValue="."===this.key[0],this.isSibling=!this.isContext&&!this.isValue,this.path=this.key.slice((this.isContext?"$":this.isValue?".":"").length),this.getter=this.path&&fa.getter(this.path,!0),this.map=t.map}getValue(e,t,n){let r=this.isContext?n:this.isValue?e:t;return this.getter&&(r=this.getter(r||{})),this.map&&(r=this.map(r)),r}cast(e,t){return this.getValue(e,null==t?void 0:t.parent,null==t?void 0:t.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}}Ha.prototype.__isYupRef=!0;const Ya=e=>null==e;function Za(e){function t({value:t,path:n="",options:r,originalValue:o,schema:i},a,s){const{name:l,test:c,params:d,message:u,skipAbsent:p}=e;let{parent:f,context:g,abortEarly:m=i.spec.abortEarly,disableStackTrace:h=i.spec.disableStackTrace}=r;const b={value:t,parent:f,context:g};function E(e={}){const r=Xa(Object.assign({value:t,originalValue:o,label:i.spec.label,path:e.path||n,spec:i.spec,disableStackTrace:e.disableStackTrace||h},d,e.params),b),a=new ka(ka.formatError(e.message||u,r),t,r.path,e.type||l,r.disableStackTrace);return a.params=r,a}const v=m?a:s;let y={path:n,parent:f,type:l,from:r.from,createError:E,resolve:e=>Ka(e,b),options:r,originalValue:o,schema:i};const N=e=>{ka.isError(e)?v(e):e?s(null):v(E())},D=e=>{ka.isError(e)?v(e):a(e)};if(p&&Ya(t))return N(!0);let x;try{var O;if(x=c.call(y,t,y),"function"==typeof(null==(O=x)?void 0:O.then)){if(r.sync)throw new Error(`Validation test of type: "${y.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(x).then(N,D)}}catch(e){return void D(e)}N(x)}return t.OPTIONS=e,t}function Xa(e,t){if(!e)return e;for(const n of Object.keys(e))e[n]=Ka(e[n],t);return e}function Ka(e,t){return Ha.isRef(e)?e.getValue(t.value,t.parent,t.context):e}function Ja(e,t,n,r=n){let o,i,a;return t?(fa.forEach(t,(s,l,c)=>{let d=l?s.slice(1,s.length-1):s,u="tuple"===(e=e.resolve({context:r,parent:o,value:n})).type,p=c?parseInt(d,10):0;if(e.innerType||u){if(u&&!c)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${a}" must contain an index to the tuple element, e.g. "${a}[0]"`);if(n&&p>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${s}, in the path: ${t}. because there is no value at that index. `);o=n,n=n&&n[p],e=u?e.spec.types[p]:e.innerType}if(!c){if(!e.fields||!e.fields[d])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${a} which is a type: "${e.type}")`);o=n,n=n&&n[d],e=e.fields[d]}i=d,a=l?"["+s+"]":"."+s}),{schema:e,parent:o,parentPath:i}):{parent:o,parentPath:t,schema:e}}class Qa extends Set{describe(){const e=[];for(const t of this.values())e.push(Ha.isRef(t)?t.describe():t);return e}resolveAll(e){let t=[];for(const n of this.values())t.push(e(n));return t}clone(){return new Qa(this.values())}merge(e,t){const n=this.clone();return e.forEach(e=>n.add(e)),t.forEach(e=>n.delete(e)),n}}function es(e,t=new Map){if(qa(e)||!e||"object"!=typeof e)return e;if(t.has(e))return t.get(e);let n;if(e instanceof Date)n=new Date(e.getTime()),t.set(e,n);else if(e instanceof RegExp)n=new RegExp(e),t.set(e,n);else if(Array.isArray(e)){n=new Array(e.length),t.set(e,n);for(let r=0;r<e.length;r++)n[r]=es(e[r],t)}else if(e instanceof Map){n=new Map,t.set(e,n);for(const[r,o]of e.entries())n.set(r,es(o,t))}else if(e instanceof Set){n=new Set,t.set(e,n);for(const r of e)n.add(es(r,t))}else{if(!(e instanceof Object))throw Error(`Unable to clone ${e}`);n={},t.set(e,n);for(const[r,o]of Object.entries(e))n[r]=es(o,t)}return n}function ts(e){if(null==e||!e.length)return;const t=[];let n="",r=!1,o=!1;for(let i=0;i<e.length;i++){const a=e[i];"["!==a||o?"]"!==a||o?'"'!==a?"."!==a||r||o?n+=a:n&&(t.push(n),n=""):o=!o:(n&&(/^\d+$/.test(n)?t.push(n):t.push(n.replace(/^"|"$/g,"")),n=""),r=!1):(n&&(t.push(...n.split(".").filter(Boolean)),n=""),r=!0)}return n&&t.push(...n.split(".").filter(Boolean)),t}function ns(e,t){var n;if((null==(n=e.inner)||!n.length)&&e.errors.length)return function(e,t){const n=t?`${t}.${e.path}`:e.path;return e.errors.map(e=>({message:e,path:ts(n)}))}(e,t);const r=t?`${t}.${e.path}`:e.path;return e.inner.flatMap(e=>ns(e,r))}class rs{constructor(e){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new Qa,this._blacklist=new Qa,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(Fa.notType)}),this.type=e.type,this._typeCheck=e.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},null==e?void 0:e.spec),this.withMutation(e=>{e.nonNullable()})}get _type(){return this.type}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;const t=Object.create(Object.getPrototypeOf(this));return t.type=this.type,t._typeCheck=this._typeCheck,t._whitelist=this._whitelist.clone(),t._blacklist=this._blacklist.clone(),t.internalTests=Object.assign({},this.internalTests),t.exclusiveTests=Object.assign({},this.exclusiveTests),t.deps=[...this.deps],t.conditions=[...this.conditions],t.tests=[...this.tests],t.transforms=[...this.transforms],t.spec=es(Object.assign({},this.spec,e)),t}label(e){let t=this.clone();return t.spec.label=e,t}meta(...e){if(0===e.length)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},e[0]),t}withMutation(e){let t=this._mutate;this._mutate=!0;let n=e(this);return this._mutate=t,n}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&"mixed"!==this.type)throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let t=this,n=e.clone();const r=Object.assign({},t.spec,n.spec);return n.spec=r,n.internalTests=Object.assign({},t.internalTests,n.internalTests),n._whitelist=t._whitelist.merge(e._whitelist,e._blacklist),n._blacklist=t._blacklist.merge(e._blacklist,e._whitelist),n.tests=t.tests,n.exclusiveTests=t.exclusiveTests,n.withMutation(t=>{e.tests.forEach(e=>{t.test(e.OPTIONS)})}),n.transforms=[...t.transforms,...n.transforms],n}isType(e){return null==e?!(!this.spec.nullable||null!==e)||!(!this.spec.optional||void 0!==e):this._typeCheck(e)}resolve(e){let t=this;if(t.conditions.length){let n=t.conditions;t=t.clone(),t.conditions=[],t=n.reduce((t,n)=>n.resolve(t,e),t),t=t.resolve(e)}return t}resolveOptions(e){var t,n,r,o;return Object.assign({},e,{from:e.from||[],strict:null!=(t=e.strict)?t:this.spec.strict,abortEarly:null!=(n=e.abortEarly)?n:this.spec.abortEarly,recursive:null!=(r=e.recursive)?r:this.spec.recursive,disableStackTrace:null!=(o=e.disableStackTrace)?o:this.spec.disableStackTrace})}cast(e,t={}){let n=this.resolve(Object.assign({},t,{value:e})),r="ignore-optionality"===t.assert,o=n._cast(e,t);if(!1!==t.assert&&!n.isType(o)){if(r&&Ya(o))return o;let i=Aa(e),a=Aa(o);throw new TypeError(`The value of ${t.path||"field"} could not be cast to a value that satisfies the schema type: "${n.type}". \n\nattempted value: ${i} \n`+(a!==i?`result of cast: ${a}`:""))}return o}_cast(e,t){let n=void 0===e?e:this.transforms.reduce((n,r)=>r.call(this,n,e,this,t),e);return void 0===n&&(n=this.getDefault(t)),n}_validate(e,t={},n,r){let{path:o,originalValue:i=e,strict:a=this.spec.strict}=t,s=e;a||(s=this._cast(s,Object.assign({assert:!1},t)));let l=[];for(let e of Object.values(this.internalTests))e&&l.push(e);this.runTests({path:o,value:s,originalValue:i,options:t,tests:l},n,e=>{if(e.length)return r(e,s);this.runTests({path:o,value:s,originalValue:i,options:t,tests:this.tests},n,r)})}runTests(e,t,n){let r=!1,{tests:o,value:i,originalValue:a,path:s,options:l}=e,c=e=>{r||(r=!0,t(e,i))},d=e=>{r||(r=!0,n(e,i))},u=o.length,p=[];if(!u)return d([]);let f={value:i,originalValue:a,path:s,options:l,schema:this};for(let e=0;e<o.length;e++)(0,o[e])(f,c,function(e){e&&(Array.isArray(e)?p.push(...e):p.push(e)),--u<=0&&d(p)})}asNestedTest({key:e,index:t,parent:n,parentPath:r,originalParent:o,options:i}){const a=null!=e?e:t;if(null==a)throw TypeError("Must include `key` or `index` for nested validations");const s="number"==typeof a;let l=n[a];const c=Object.assign({},i,{strict:!0,parent:n,value:l,originalValue:o[a],key:void 0,[s?"index":"key"]:a,path:s||a.includes(".")?`${r||""}[${s?a:`"${a}"`}]`:(r?`${r}.`:"")+e});return(e,t,n)=>this.resolve(c)._validate(l,c,t,n)}validate(e,t){var n;let r=this.resolve(Object.assign({},t,{value:e})),o=null!=(n=null==t?void 0:t.disableStackTrace)?n:r.spec.disableStackTrace;return new Promise((n,i)=>r._validate(e,t,(e,t)=>{ka.isError(e)&&(e.value=t),i(e)},(e,t)=>{e.length?i(new ka(e,t,void 0,void 0,o)):n(t)}))}validateSync(e,t){var n;let r,o=this.resolve(Object.assign({},t,{value:e})),i=null!=(n=null==t?void 0:t.disableStackTrace)?n:o.spec.disableStackTrace;return o._validate(e,Object.assign({},t,{sync:!0}),(e,t)=>{throw ka.isError(e)&&(e.value=t),e},(t,n)=>{if(t.length)throw new ka(t,e,void 0,void 0,i);r=n}),r}isValid(e,t){return this.validate(e,t).then(()=>!0,e=>{if(ka.isError(e))return!1;throw e})}isValidSync(e,t){try{return this.validateSync(e,t),!0}catch(e){if(ka.isError(e))return!1;throw e}}_getDefault(e){let t=this.spec.default;return null==t?t:"function"==typeof t?t.call(this,e):es(t)}getDefault(e){return this.resolve(e||{})._getDefault(e)}default(e){return 0===arguments.length?this._getDefault():this.clone({default:e})}strict(e=!0){return this.clone({strict:e})}nullability(e,t){const n=this.clone({nullable:e});return n.internalTests.nullable=Za({message:t,name:"nullable",test(e){return null!==e||this.schema.spec.nullable}}),n}optionality(e,t){const n=this.clone({optional:e});return n.internalTests.optionality=Za({message:t,name:"optionality",test(e){return void 0!==e||this.schema.spec.optional}}),n}optional(){return this.optionality(!0)}defined(e=Fa.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=Fa.notNull){return this.nullability(!1,e)}required(e=Fa.required){return this.clone().withMutation(t=>t.nonNullable(e).defined(e))}notRequired(){return this.clone().withMutation(e=>e.nullable().optional())}transform(e){let t=this.clone();return t.transforms.push(e),t}test(...e){let t;if(t=1===e.length?"function"==typeof e[0]?{test:e[0]}:e[0]:2===e.length?{name:e[0],test:e[1]}:{name:e[0],message:e[1],test:e[2]},void 0===t.message&&(t.message=Fa.default),"function"!=typeof t.test)throw new TypeError("`test` is a required parameters");let n=this.clone(),r=Za(t),o=t.exclusive||t.name&&!0===n.exclusiveTests[t.name];if(t.exclusive&&!t.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return t.name&&(n.exclusiveTests[t.name]=!!t.exclusive),n.tests=n.tests.filter(e=>{if(e.OPTIONS.name===t.name){if(o)return!1;if(e.OPTIONS.test===r.OPTIONS.test)return!1}return!0}),n.tests.push(r),n}when(e,t){Array.isArray(e)||"string"==typeof e||(t=e,e=".");let n=this.clone(),r=Va(e).map(e=>new Ha(e));return r.forEach(e=>{e.isSibling&&n.deps.push(e.key)}),n.conditions.push("function"==typeof t?new za(r,t):za.fromOptions(r,t)),n}typeError(e){let t=this.clone();return t.internalTests.typeError=Za({message:e,name:"typeError",skipAbsent:!0,test(e){return!!this.schema._typeCheck(e)||this.createError({params:{type:this.schema.type}})}}),t}oneOf(e,t=Fa.oneOf){let n=this.clone();return e.forEach(e=>{n._whitelist.add(e),n._blacklist.delete(e)}),n.internalTests.whiteList=Za({message:t,name:"oneOf",skipAbsent:!0,test(e){let t=this.schema._whitelist,n=t.resolveAll(this.resolve);return!!n.includes(e)||this.createError({params:{values:Array.from(t).join(", "),resolved:n}})}}),n}notOneOf(e,t=Fa.notOneOf){let n=this.clone();return e.forEach(e=>{n._blacklist.add(e),n._whitelist.delete(e)}),n.internalTests.blacklist=Za({message:t,name:"notOneOf",test(e){let t=this.schema._blacklist,n=t.resolveAll(this.resolve);return!n.includes(e)||this.createError({params:{values:Array.from(t).join(", "),resolved:n}})}}),n}strip(e=!0){let t=this.clone();return t.spec.strip=e,t}describe(e){const t=(e?this.resolve(e):this).clone(),{label:n,meta:r,optional:o,nullable:i}=t.spec;return{meta:r,label:n,optional:o,nullable:i,default:t.getDefault(e),type:t.type,oneOf:t._whitelist.describe(),notOneOf:t._blacklist.describe(),tests:t.tests.filter((e,t,n)=>n.findIndex(t=>t.OPTIONS.name===e.OPTIONS.name)===t).map(t=>{const n=t.OPTIONS.params&&e?Xa(Object.assign({},t.OPTIONS.params),e):t.OPTIONS.params;return{name:t.OPTIONS.name,params:n}})}}get"~standard"(){const e=this;return{version:1,vendor:"yup",async validate(t){try{return{value:await e.validate(t,{abortEarly:!1})}}catch(e){if(e instanceof ka)return{issues:ns(e)};throw e}}}}}rs.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])rs.prototype[`${e}At`]=function(t,n,r={}){const{parent:o,parentPath:i,schema:a}=Ja(this,t,n,r.context);return a[e](o&&o[i],Object.assign({},r,{parent:o,path:t}))};for(const e of["equals","is"])rs.prototype[e]=rs.prototype.oneOf;for(const e of["not","nope"])rs.prototype[e]=rs.prototype.notOneOf;const os=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function is(e){var t,n;const r=os.exec(e);return r?{year:as(r[1]),month:as(r[2],1)-1,day:as(r[3],1),hour:as(r[4]),minute:as(r[5]),second:as(r[6]),millisecond:r[7]?as(r[7].substring(0,3)):0,precision:null!=(t=null==(n=r[7])?void 0:n.length)?t:void 0,z:r[8]||void 0,plusMinus:r[9]||void 0,hourOffset:as(r[10]),minuteOffset:as(r[11])}:null}function as(e,t=0){return Number(e)||t}let ss=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,ls=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,cs=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,ds=new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"),us=e=>Ya(e)||e===e.trim(),ps={}.toString();function fs(){return new gs}class gs extends rs{constructor(){super({type:"string",check:e=>(e instanceof String&&(e=e.valueOf()),"string"==typeof e)}),this.withMutation(()=>{this.transform((e,t)=>{if(!this.spec.coerce||this.isType(e))return e;if(Array.isArray(e))return e;const n=null!=e&&e.toString?e.toString():e;return n===ps?e:n})})}required(e){return super.required(e).withMutation(t=>t.test({message:e||Fa.required,name:"required",skipAbsent:!0,test:e=>!!e.length}))}notRequired(){return super.notRequired().withMutation(e=>(e.tests=e.tests.filter(e=>"required"!==e.OPTIONS.name),e))}length(e,t=Ma.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(t){return t.length===this.resolve(e)}})}min(e,t=Ma.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(t){return t.length>=this.resolve(e)}})}max(e,t=Ma.max){return this.test({name:"max",exclusive:!0,message:t,params:{max:e},skipAbsent:!0,test(t){return t.length<=this.resolve(e)}})}matches(e,t){let n,r,o=!1;return t&&("object"==typeof t?({excludeEmptyString:o=!1,message:n,name:r}=t):n=t),this.test({name:r||"matches",message:n||Ma.matches,params:{regex:e},skipAbsent:!0,test:t=>""===t&&o||-1!==t.search(e)})}email(e=Ma.email){return this.matches(ss,{name:"email",message:e,excludeEmptyString:!0})}url(e=Ma.url){return this.matches(ls,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=Ma.uuid){return this.matches(cs,{name:"uuid",message:e,excludeEmptyString:!1})}datetime(e){let t,n,r="";return e&&("object"==typeof e?({message:r="",allowOffset:t=!1,precision:n}=e):r=e),this.matches(ds,{name:"datetime",message:r||Ma.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:r||Ma.datetime_offset,params:{allowOffset:t},skipAbsent:!0,test:e=>{if(!e||t)return!0;const n=is(e);return!!n&&!!n.z}}).test({name:"datetime_precision",message:r||Ma.datetime_precision,params:{precision:n},skipAbsent:!0,test:e=>{if(!e||null==n)return!0;const t=is(e);return!!t&&t.precision===n}})}ensure(){return this.default("").transform(e=>null===e?"":e)}trim(e=Ma.trim){return this.transform(e=>null!=e?e.trim():e).test({message:e,name:"trim",test:us})}lowercase(e=Ma.lowercase){return this.transform(e=>Ya(e)?e:e.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:e=>Ya(e)||e===e.toLowerCase()})}uppercase(e=Ma.uppercase){return this.transform(e=>Ya(e)?e:e.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:e=>Ya(e)||e===e.toUpperCase()})}}function ms(){return new hs}fs.prototype=gs.prototype;class hs extends rs{constructor(){super({type:"number",check:e=>(e instanceof Number&&(e=e.valueOf()),"number"==typeof e&&!(e=>e!=+e)(e))}),this.withMutation(()=>{this.transform((e,t)=>{if(!this.spec.coerce)return e;let n=e;if("string"==typeof n){if(n=n.replace(/\s/g,""),""===n)return NaN;n=+n}return this.isType(n)||null===n?n:parseFloat(n)})})}min(e,t=La.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(t){return t>=this.resolve(e)}})}max(e,t=La.max){return this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(t){return t<=this.resolve(e)}})}lessThan(e,t=La.lessThan){return this.test({message:t,name:"max",exclusive:!0,params:{less:e},skipAbsent:!0,test(t){return t<this.resolve(e)}})}moreThan(e,t=La.moreThan){return this.test({message:t,name:"min",exclusive:!0,params:{more:e},skipAbsent:!0,test(t){return t>this.resolve(e)}})}positive(e=La.positive){return this.moreThan(0,e)}negative(e=La.negative){return this.lessThan(0,e)}integer(e=La.integer){return this.test({name:"integer",message:e,skipAbsent:!0,test:e=>Number.isInteger(e)})}truncate(){return this.transform(e=>Ya(e)?e:0|e)}round(e){var t;let n=["ceil","floor","round","trunc"];if("trunc"===(e=(null==(t=e)?void 0:t.toLowerCase())||"round"))return this.truncate();if(-1===n.indexOf(e.toLowerCase()))throw new TypeError("Only valid options for round() are: "+n.join(", "));return this.transform(t=>Ya(t)?t:Math[e](t))}}ms.prototype=hs.prototype;let bs=new Date("");class Es extends rs{constructor(){super({type:"date",check:e=>"[object Date]"===Object.prototype.toString.call(e)&&!isNaN(e.getTime())}),this.withMutation(()=>{this.transform((e,t)=>!this.spec.coerce||this.isType(e)||null===e?e:(e=function(e){const t=is(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;if(void 0===t.z&&void 0===t.plusMinus)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let n=0;return"Z"!==t.z&&void 0!==t.plusMinus&&(n=60*t.hourOffset+t.minuteOffset,"+"===t.plusMinus&&(n=0-n)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+n,t.second,t.millisecond)}(e),isNaN(e)?Es.INVALID_DATE:new Date(e)))})}prepareParam(e,t){let n;if(Ha.isRef(e))n=e;else{let r=this.cast(e);if(!this._typeCheck(r))throw new TypeError(`\`${t}\` must be a Date or a value that can be \`cast()\` to a Date`);n=r}return n}min(e,t=ja.min){let n=this.prepareParam(e,"min");return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(e){return e>=this.resolve(n)}})}max(e,t=ja.max){let n=this.prepareParam(e,"max");return this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(e){return e<=this.resolve(n)}})}}function vs(e,t){let n=Infinity;return e.some((e,r)=>{var o;if(null!=(o=t.path)&&o.includes(e))return n=r,!0}),n}function ys(e){return(t,n)=>vs(e,t)-vs(e,n)}Es.INVALID_DATE=bs;const Ns=(e,t,n)=>{if("string"!=typeof e)return e;let r=e;try{r=JSON.parse(e)}catch(e){}return n.isType(r)?r:e};function Ds(e){if("fields"in e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=Ds(r);return e.setFields(t)}if("array"===e.type){const t=e.optional();return t.innerType&&(t.innerType=Ds(t.innerType)),t}return"tuple"===e.type?e.optional().clone({types:e.spec.types.map(Ds)}):"optional"in e?e.optional():e}let xs=e=>"[object Object]"===Object.prototype.toString.call(e);function Os(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(e=>-1===n.indexOf(e))}const ws=ys([]);function _s(e){return new Is(e)}class Is extends rs{constructor(e){super({type:"object",check:e=>xs(e)||"function"==typeof e}),this.fields=Object.create(null),this._sortErrors=ws,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{e&&this.shape(e)})}_cast(e,t={}){var n;let r=super._cast(e,t);if(void 0===r)return this.getDefault(t);if(!this._typeCheck(r))return r;let o=this.fields,i=null!=(n=t.stripUnknown)?n:this.spec.noUnknown,a=[].concat(this._nodes,Object.keys(r).filter(e=>!this._nodes.includes(e))),s={},l=Object.assign({},t,{parent:s,__validating:t.__validating||!1}),c=!1;for(const e of a){let n=o[e],a=e in r,d=r[e];if(n){let o;l.path=(t.path?`${t.path}.`:"")+e,n=n.resolve({value:d,context:t.context,parent:s});let i=n instanceof rs?n.spec:void 0,a=null==i?void 0:i.strict;if(null!=i&&i.strip){c=c||e in r;continue}o=t.__validating&&a?d:n.cast(d,l),void 0!==o&&(s[e]=o)}else a&&!i&&(s[e]=d);a===e in s&&s[e]===d||(c=!0)}return c?s:r}_validate(e,t={},n,r){let{from:o=[],originalValue:i=e,recursive:a=this.spec.recursive}=t;t.from=[{schema:this,value:i},...o],t.__validating=!0,t.originalValue=i,super._validate(e,t,n,(e,o)=>{if(!a||!xs(o))return void r(e,o);i=i||o;let s=[];for(let e of this._nodes){let n=this.fields[e];n&&!Ha.isRef(n)&&s.push(n.asNestedTest({options:t,key:e,parent:o,parentPath:t.path,originalParent:i}))}this.runTests({tests:s,value:o,originalValue:i,options:t},n,t=>{r(t.sort(this._sortErrors).concat(e),o)})})}clone(e){const t=super.clone(e);return t.fields=Object.assign({},this.fields),t._nodes=this._nodes,t._excludedEdges=this._excludedEdges,t._sortErrors=this._sortErrors,t}concat(e){let t=super.concat(e),n=t.fields;for(let[e,t]of Object.entries(this.fields)){const r=n[e];n[e]=void 0===r?t:r}return t.withMutation(t=>t.setFields(n,[...this._excludedEdges,...e._excludedEdges]))}_getDefault(e){if("default"in this.spec)return super._getDefault(e);if(!this._nodes.length)return;let t={};return this._nodes.forEach(n=>{var r;const o=this.fields[n];let i=e;null!=(r=i)&&r.value&&(i=Object.assign({},i,{parent:i.value,value:i.value[n]})),t[n]=o&&"getDefault"in o?o.getDefault(i):void 0}),t}setFields(e,t){let n=this.clone();return n.fields=e,n._nodes=function(e,t=[]){let n=[],r=new Set,o=new Set(t.map(([e,t])=>`${e}-${t}`));function i(e,t){let i=fa.split(e)[0];r.add(i),o.has(`${t}-${i}`)||n.push([t,i])}for(const t of Object.keys(e)){let n=e[t];r.add(t),Ha.isRef(n)&&n.isSibling?i(n.path,t):qa(n)&&"deps"in n&&n.deps.forEach(e=>i(e,t))}return Da.array(Array.from(r),n).reverse()}(e,t),n._sortErrors=ys(Object.keys(e)),t&&(n._excludedEdges=t),n}shape(e,t=[]){return this.clone().withMutation(n=>{let r=n._excludedEdges;return t.length&&(Array.isArray(t[0])||(t=[t]),r=[...n._excludedEdges,...t]),n.setFields(Object.assign(n.fields,e),r)})}partial(){const e={};for(const[t,n]of Object.entries(this.fields))e[t]="optional"in n&&n.optional instanceof Function?n.optional():n;return this.setFields(e)}deepPartial(){return Ds(this)}pick(e){const t={};for(const n of e)this.fields[n]&&(t[n]=this.fields[n]);return this.setFields(t,this._excludedEdges.filter(([t,n])=>e.includes(t)&&e.includes(n)))}omit(e){const t=[];for(const n of Object.keys(this.fields))e.includes(n)||t.push(n);return this.pick(t)}from(e,t,n){let r=fa.getter(e,!0);return this.transform(o=>{if(!o)return o;let i=o;return((e,t)=>{const n=[...fa.normalizePath(t)];if(1===n.length)return n[0]in e;let r=n.pop(),o=fa.getter(fa.join(n),!0)(e);return!(!o||!(r in o))})(o,e)&&(i=Object.assign({},o),n||delete i[e],i[t]=r(o)),i})}json(){return this.transform(Ns)}exact(e){return this.test({name:"exact",exclusive:!0,message:e||Ga.exact,test(e){if(null==e)return!0;const t=Os(this.schema,e);return 0===t.length||this.createError({params:{properties:t.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(e=!0,t=Ga.noUnknown){"boolean"!=typeof e&&(t=e,e=!0);let n=this.test({name:"noUnknown",exclusive:!0,message:t,test(t){if(null==t)return!0;const n=Os(this.schema,t);return!e||0===n.length||this.createError({params:{unknown:n.join(", ")}})}});return n.spec.noUnknown=e,n}unknown(e=!0,t=Ga.noUnknown){return this.noUnknown(!e,t)}transformKeys(e){return this.transform(t=>{if(!t)return t;const n={};for(const r of Object.keys(t))n[e(r)]=t[r];return n})}camelCase(){return this.transformKeys(ya)}snakeCase(){return this.transformKeys(Na)}constantCase(){return this.transformKeys(e=>Na(e).toUpperCase())}describe(e){const t=(e?this.resolve(e):this).clone(),n=super.describe(e);n.fields={};for(const[o,i]of Object.entries(t.fields)){var r;let t=e;null!=(r=t)&&r.value&&(t=Object.assign({},t,{parent:t.value,value:t.value[o]})),n.fields[o]=i.describe(t)}return n}}_s.prototype=Is.prototype;var Ss=function(e){var t;return t={mixed:{required:e("This field is required")}},Object.keys(t).forEach(e=>{Object.keys(t[e]).forEach(n=>{Wa[e][n]=t[e][n]})}),{initialValues:{departmentId:void 0,refreshInterval:60},validationSchema:_s({departmentId:fs(),refreshInterval:ms().oneOf([15,30,60]).required()})}},Cs=["url","wsUrl","lang","data","settings"];exports.Widget=function(r){var o=r.url,i=r.wsUrl,a=r.lang,s=r.data,l=r.settings,c=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(r,Cs),d=t.useGqlClients({url:o,wsUrl:i,lang:a}),u=d.graphqlSdk,p=d.gqlWsClient,f=e.useState(s),m=f[0],h=f[1];return e.useEffect(function(){!s&&u&&Promise.all([u.departments(),u.shifts()]).then(function(e){var t=e[0].departments,n=e[1].shifts,r=_(n);if(r)return u.workplaceAssignments({input:{date:r.date,shiftId:r.shift.id,departmentId:(null==l?void 0:l.departmentId)||void 0}}).then(function(e){return h(D({},e.workplaceAssignments,{departments:t,shifts:n}))})}).catch(function(){})},[s,u,null==l?void 0:l.departmentId]),g.default.createElement(n.BaseWidget,D({lang:a,locales:x,data:m,gqlClients:{graphqlSdk:u,gqlWsClient:p},WidgetView:ra,getSettingsFormProps:Ss,SettingsFormContent:C,version:S,"data-testid":"station-assignment-widget"},c))},exports.extraPermissions=[],exports.getDisplayName=function(e){switch(e){case"en":return"Operator assignment";case"pl":return"Przypisanie operatorów";default:return"station-assignment-widget"}},exports.requiredFeatures=["feature.station-assignment-widget"],exports.version=S;
|
|
8
8
|
//# sourceMappingURL=index.js.map
|