andoncloud-station-assignment-widget 1.0.4 → 1.0.6
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 +2 -2
- package/dist/index.js.map +1 -1
- 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"),u=require("@mui/icons-material/ChevronLeft"),d=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 m=/*#__PURE__*/p(e),g=/*#__PURE__*/f(e),h=/*#__PURE__*/p(r),b=/*#__PURE__*/p(s),E=/*#__PURE__*/p(l),v=/*#__PURE__*/p(c),y=/*#__PURE__*/p(u),N=/*#__PURE__*/p(d);function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function D(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return x(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?x(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function O(){return O=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},O.apply(null,arguments)}var w={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",presenceStatus:"Presence status",presenceStatusPresent:"Present",presenceStatusNotPresent:"Not present",presenceStatusPresentElsewhere:"Present elsewhere",assignedWorkplace:"Assigned workplace",checkedInLocation:"Checked in at",checkedInTime:"Check-in time",workingFor:"Working for",unassignedOperator:"Unassigned",removeOperator:"Remove operator",statusOk:"Fully staffed",statusMissing:"Missing operators",statusOvercapacity:"Too many operators",statusUnplanned:"Unplanned operators present",overcapacity:"Overcapacity",checkedInUnassigned:"Checked in (unassigned)",assignHere:"Assign to check-in location",unplannedStaffing:"Unplanned staffing",presentElsewhereLabel:"Present elsewhere",unplannedSectionLabel:"Checked in (unplanned)"}},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",presenceStatus:"Status obecności",presenceStatusPresent:"Obecny",presenceStatusNotPresent:"Nieobecny",presenceStatusPresentElsewhere:"Obecny na innym stanowisku",assignedWorkplace:"Przypisane stanowisko",checkedInLocation:"Miejsce zameldowania",checkedInTime:"Godzina zameldowania",workingFor:"Czas pracy",unassignedOperator:"Nieprzypisany",removeOperator:"Usuń operatora",statusOk:"Komplet operatorów",statusMissing:"Brakuje operatorów",statusOvercapacity:"Za dużo operatorów",statusUnplanned:"Zameldowani poza planem",overcapacity:"Przepełnienie",checkedInUnassigned:"Zameldowany (nieprzypisany)",assignHere:"Przypisz do miejsca zameldowania",unplannedStaffing:"Nieplanowana obsada",presentElsewhereLabel:"Obecni na innym stanowisku",unplannedSectionLabel:"Zameldowani poza planem"}}},S=function(e){return[].concat(e).sort(function(e,t){return e.startedAt.localeCompare(t.startedAt)})},I=function(e,t){return e.find(function(e){return e.name===t})},_=function(e){var n=S(e),r=h.default(),o=r.format("YYYY-MM-DD"),i=t.normalizeShifts(n,r),a=t.getCurrentShift(r,i);if(a){var s=I(n,a.name);if(s)return{date:o,shift:s,isCurrentShift:!0}}var l=i.find(function(e){return e.startedAt.isAfter(r)});if(l){var c=I(n,l.name);if(c)return{date:o,shift:c,isCurrentShift:!1}}var u=h.default(r).add(1,"day").startOf("day"),d=t.normalizeShifts(n,u);if(d.length>0){var p=I(n,d[0].name);if(p)return{date:u.format("YYYY-MM-DD"),shift:p,isCurrentShift:!1}}return null},C=function(e,t,n){var r=S(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},A="1.0.4",T=function(t){var n,r=t.data,s=t.formProps,l=e.useState("1"),c=l[0],u=l[1],d=o.useTranslation().t;return m.default.createElement(i.TabContext,{value:c},m.default.createElement(a.Box,{sx:{borderBottom:1,borderColor:"divider"}},m.default.createElement(i.TabList,{onChange:function(e,t){u(t)}},m.default.createElement(a.Tab,{label:d("filters"),value:"1"}),m.default.createElement(a.Tab,{label:d("advanced"),value:"2"}))),m.default.createElement(i.TabPanel,{value:"1"},m.default.createElement(a.FormControl,{fullWidth:!0},m.default.createElement(a.InputLabel,{id:"department-label"},d("department")),m.default.createElement(a.Select,{name:"departmentId",labelId:"department-label",variant:"outlined",value:null!=(n=s.values.departmentId)?n:"",onChange:s.handleChange,fullWidth:!0},m.default.createElement(a.MenuItem,{value:""},d("allDepartments")),r.departments.map(function(e){return m.default.createElement(a.MenuItem,{key:e.id,value:e.id},e.name)})))),m.default.createElement(i.TabPanel,{value:"2"},m.default.createElement(a.FormControl,{fullWidth:!0},m.default.createElement(a.InputLabel,{id:"refresh-interval-label"},d("refreshInterval")),m.default.createElement(a.Select,{name:"refreshInterval",labelId:"refresh-interval-label",variant:"outlined",value:s.values.refreshInterval,onChange:s.handleChange,fullWidth:!0},m.default.createElement(a.MenuItem,{value:15},"15s"),m.default.createElement(a.MenuItem,{value:30},"30s"),m.default.createElement(a.MenuItem,{value:60},"60s")))))},P="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):void 0;function V(e){var t=e.prototype.toJSON;"function"==typeof t||function(){if(!Boolean(0))throw new Error("Unexpected invariant triggered.")}(),e.prototype.inspect=t,P&&(e.prototype[P]=t)}V(/*#__PURE__*/function(){function e(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}return e.prototype.toJSON=function(){return{start:this.start,end:this.end}},e}());var k=/*#__PURE__*/function(){function e(e,t,n,r,o,i,a){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=o,this.value=a,this.prev=i,this.next=null}return e.prototype.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}();function R(e){return null!=e&&"string"==typeof e.kind}function B(e){return B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},B(e)}function F(e){return $(e,[])}function $(e,t){switch(B(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return null===e?"null":function(e,t){if(-1!==t.indexOf(e))return"[Circular]";var n=[].concat(t,[e]),r=function(e){var t=e[String(P)];return"function"==typeof t?t:"function"==typeof e.inspect?e.inspect:void 0}(e);if(void 0!==r){var o=r.call(e);if(o!==e)return"string"==typeof o?o:$(o,n)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";for(var n=Math.min(10,e.length),r=e.length-n,o=[],i=0;i<n;++i)o.push($(e[i],t));return 1===r?o.push("... 1 more item"):r>1&&o.push("... ".concat(r," more items")),"["+o.join(", ")+"]"}(e,n);return function(e,t){var n=Object.keys(e);return 0===n.length?"{}":t.length>2?"["+function(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){var n=e.constructor.name;if("string"==typeof n&&""!==n)return n}return t}(e)+"]":"{ "+n.map(function(n){return n+": "+$(e[n],t)}).join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}V(k);var L={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},M=Object.freeze({});function j(e,t,n){var r=e[t];if(r){if(!n&&"function"==typeof r)return r;var o=n?r.leave:r.enter;if("function"==typeof o)return o}else{var i=n?e.leave:e.enter;if(i){if("function"==typeof i)return i;var a=i[t];if("function"==typeof a)return a}}}var G={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return W(e.definitions,"\n\n")+"\n"},OperationDefinition:function(e){var t=e.operation,n=e.name,r=q("(",W(e.variableDefinitions,", "),")"),o=W(e.directives," "),i=e.selectionSet;return n||o||r||"query"!==t?W([t,W([n,r]),o,i]," "):i},VariableDefinition:function(e){var t=e.directives;return e.variable+": "+e.type+q(" = ",e.defaultValue)+q(" ",W(t," "))},SelectionSet:function(e){return z(e.selections)},Field:function(e){var t=e.name,n=e.arguments,r=e.directives,o=e.selectionSet,i=q("",e.alias,": ")+t,a=i+q("(",W(n,", "),")");return a.length>80&&(a=i+q("(\n",H(W(n,"\n")),"\n)")),W([a,W(r," "),o]," ")},Argument:function(e){return e.name+": "+e.value},FragmentSpread:function(e){return"..."+e.name+q(" ",W(e.directives," "))},InlineFragment:function(e){var t=e.directives,n=e.selectionSet;return W(["...",q("on ",e.typeCondition),W(t," "),n]," ")},FragmentDefinition:function(e){var t=e.typeCondition,n=e.variableDefinitions,r=e.directives,o=e.selectionSet;return"fragment ".concat(e.name).concat(q("(",W(n,", "),")")," ")+"on ".concat(t," ").concat(q("",W(r," ")," "))+o},IntValue:function(e){return e.value},FloatValue:function(e){return e.value},StringValue:function(e,t){var n=e.value;return e.block?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=-1===e.indexOf("\n"),o=!r||'"'===e[e.length-1]||"\\"===e[e.length-1]||n,i="";return!o||r&&(" "===e[0]||"\t"===e[0])||(i+="\n"+t),i+=t?e.replace(/\n/g,"\n"+t):e,o&&(i+="\n"),'"""'+i.replace(/"""/g,'\\"""')+'"""'}(n,"description"===t?"":" "):JSON.stringify(n)},BooleanValue:function(e){return e.value?"true":"false"},NullValue:function(){return"null"},EnumValue:function(e){return e.value},ListValue:function(e){return"["+W(e.values,", ")+"]"},ObjectValue:function(e){return"{"+W(e.fields,", ")+"}"},ObjectField:function(e){return e.name+": "+e.value},Directive:function(e){return"@"+e.name+q("(",W(e.arguments,", "),")")},NamedType:function(e){return e.name},ListType:function(e){return"["+e.type+"]"},NonNullType:function(e){return e.type+"!"},SchemaDefinition:U(function(e){var t=e.operationTypes;return W(["schema",W(e.directives," "),z(t)]," ")}),OperationTypeDefinition:function(e){return e.operation+": "+e.type},ScalarTypeDefinition:U(function(e){return W(["scalar",e.name,W(e.directives," ")]," ")}),ObjectTypeDefinition:U(function(e){var t=e.directives,n=e.fields;return W(["type",e.name,q("implements ",W(e.interfaces," & ")),W(t," "),z(n)]," ")}),FieldDefinition:U(function(e){var t=e.arguments,n=e.type,r=e.directives;return e.name+(K(t)?q("(\n",H(W(t,"\n")),"\n)"):q("(",W(t,", "),")"))+": "+n+q(" ",W(r," "))}),InputValueDefinition:U(function(e){var t=e.directives;return W([e.name+": "+e.type,q("= ",e.defaultValue),W(t," ")]," ")}),InterfaceTypeDefinition:U(function(e){var t=e.directives,n=e.fields;return W(["interface",e.name,q("implements ",W(e.interfaces," & ")),W(t," "),z(n)]," ")}),UnionTypeDefinition:U(function(e){var t=e.types;return W(["union",e.name,W(e.directives," "),t&&0!==t.length?"= "+W(t," | "):""]," ")}),EnumTypeDefinition:U(function(e){var t=e.values;return W(["enum",e.name,W(e.directives," "),z(t)]," ")}),EnumValueDefinition:U(function(e){return W([e.name,W(e.directives," ")]," ")}),InputObjectTypeDefinition:U(function(e){var t=e.fields;return W(["input",e.name,W(e.directives," "),z(t)]," ")}),DirectiveDefinition:U(function(e){var t=e.arguments,n=e.repeatable,r=e.locations;return"directive @"+e.name+(K(t)?q("(\n",H(W(t,"\n")),"\n)"):q("(",W(t,", "),")"))+(n?" repeatable":"")+" on "+W(r," | ")}),SchemaExtension:function(e){var t=e.operationTypes;return W(["extend schema",W(e.directives," "),z(t)]," ")},ScalarTypeExtension:function(e){return W(["extend scalar",e.name,W(e.directives," ")]," ")},ObjectTypeExtension:function(e){var t=e.directives,n=e.fields;return W(["extend type",e.name,q("implements ",W(e.interfaces," & ")),W(t," "),z(n)]," ")},InterfaceTypeExtension:function(e){var t=e.directives,n=e.fields;return W(["extend interface",e.name,q("implements ",W(e.interfaces," & ")),W(t," "),z(n)]," ")},UnionTypeExtension:function(e){var t=e.types;return W(["extend union",e.name,W(e.directives," "),t&&0!==t.length?"= "+W(t," | "):""]," ")},EnumTypeExtension:function(e){var t=e.values;return W(["extend enum",e.name,W(e.directives," "),z(t)]," ")},InputObjectTypeExtension:function(e){var t=e.fields;return W(["extend input",e.name,W(e.directives," "),z(t)]," ")}};function U(e){return function(t){return W([t.description,e(t)],"\n")}}function W(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return null!==(t=null==e?void 0:e.filter(function(e){return e}).join(n))&&void 0!==t?t:""}function z(e){return q("{\n",H(W(e,"\n")),"\n}")}function q(e,t){return null!=t&&""!==t?e+t+(arguments.length>2&&void 0!==arguments[2]?arguments[2]:""):""}function H(e){return q(" ",e.replace(/\n/g,"\n "))}function Y(e){return-1!==e.indexOf("\n")}function K(e){return null!=e&&e.some(Y)}function Z(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 J=/* @__PURE__ */(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),X=()=>Math.random().toString(36).substring(7).split("").join("."),Q={INIT:`@@redux/INIT${X()}`,REPLACE:`@@redux/REPLACE${X()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${X()}`};function ee(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 te(e,t,n){if("function"!=typeof e)throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?Z(2):`Expected the root reducer to be a function. Instead, received: '${ee(e)}'`);if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?Z(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?Z(1):`Expected the enhancer to be a function. Instead, received: '${ee(n)}'`);return n(te)(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 u(){if(l)throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?Z(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 d(e){if("function"!=typeof e)throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?Z(4):`Expected the listener to be a function. Instead, received: '${ee(e)}'`);if(l)throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?Z(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?Z(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?Z(7):`Actions must be plain objects. Instead, the actual type was: '${ee(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?Z(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?Z(17):`Action "type" property must be a string. Instead, the actual type was: '${ee(e.type)}'. Value was: '${e.type}' (stringified)`);if(l)throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?Z(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:Q.INIT}),{dispatch:p,subscribe:d,getState:u,replaceReducer:function(e){if("function"!=typeof e)throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?Z(10):`Expected the nextReducer to be a function. Instead, received: '${ee(e)}`);r=e,p({type:Q.REPLACE})},[J]:function(){const e=d;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?Z(11):`Expected the observer to be an object. Instead, received: '${ee(t)}'`);function n(){t.next&&t.next(u())}return n(),{unsubscribe:e(n)}},[J](){return this}}}}}function ne(e,t){return function(...n){return t(e.apply(this,n))}}function re(e,t){if("function"==typeof e)return ne(e,t);if("object"!=typeof e||null===e)throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?Z(16):`bindActionCreators expected an object or a function, but instead received: '${ee(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]=ne(o,t))}return n}function oe(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce((e,t)=>(...n)=>e(t(...n)))}function ie(e){var t={exports:{}};return e(t,t.exports),t.exports}var ae="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},se=m.default.useSyncExternalStore,le=m.default.useRef,ce=m.default.useEffect,ue=m.default.useMemo,de=m.default.useDebugValue,pe={useSyncExternalStoreWithSelector:function(e,t,n,r,o){var i=le(null);if(null===i.current){var a={hasValue:!1,value:null};i.current=a}else a=i.current;i=ue(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,ae(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=se(e,i[0],i[1]);return ce(function(){a.hasValue=!0,a.value=s},[s]),de(s),s}},fe=ie(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=m.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,u){var d=o(null);if(null===d.current){var p={hasValue:!1,value:null};d.current=p}else p=d.current;d=a(function(){function e(e){if(!i){if(i=!0,r=e,e=c(e),void 0!==u&&p.hasValue){var t=p.value;if(u(t,e))return o=t}return o=e}if(t=o,n(r,e))return t;var a=c(e);return void 0!==u&&u(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,u]);var f=r(e,d[0],d[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())}()});ie(function(e){e.exports="production"==='{NODE_ENV:"production"}'.NODE_ENV?pe:fe});var me=/* @__PURE__ */g.version.startsWith("19"),ge=/* @__PURE__ */Symbol.for(me?"react.transitional.element":"react.element"),he=/* @__PURE__ */Symbol.for("react.portal"),be=/* @__PURE__ */Symbol.for("react.fragment"),Ee=/* @__PURE__ */Symbol.for("react.strict_mode"),ve=/* @__PURE__ */Symbol.for("react.profiler"),ye=/* @__PURE__ */Symbol.for("react.consumer"),Ne=/* @__PURE__ */Symbol.for("react.context"),xe=/* @__PURE__ */Symbol.for("react.forward_ref"),De=/* @__PURE__ */Symbol.for("react.suspense"),Oe=/* @__PURE__ */Symbol.for("react.suspense_list"),we=/* @__PURE__ */Symbol.for("react.memo"),Se=/* @__PURE__ */Symbol.for("react.lazy"),Ie=/* @__PURE__ */Symbol.for("react.offscreen"),_e=/* @__PURE__ */Symbol.for("react.client.reference"),Ce=xe,Ae=we;function Te(e){return"string"==typeof e||"function"==typeof e||e===be||e===ve||e===Ee||e===De||e===Oe||e===Ie||"object"==typeof e&&null!==e&&(e.$$typeof===Se||e.$$typeof===we||e.$$typeof===Ne||e.$$typeof===ye||e.$$typeof===xe||e.$$typeof===_e||void 0!==e.getModuleId)}function Pe(e){if("object"==typeof e&&null!==e){const{$$typeof:t}=e;switch(t){case ge:switch(e=e.type){case be:case ve:case Ee:case De:case Oe:return e;default:switch(e=e&&e.$$typeof){case Ne:case xe:case Se:case we:case ye:return e;default:return t}}case he:return t}}}function Ve(e){return me?Pe(e)===ye:Pe(e)===Ne}function ke(e){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e);try{throw new Error(e)}catch(e){}}function Re(e,t){if(!e)throw new Error(`Unexpected value for ${t} in connect.`);"mapStateToProps"!==t&&"mapDispatchToProps"!==t||Object.prototype.hasOwnProperty.call(e,"dependsOnOwnProps")||ke(`The selector for ${t} of connect did not specify a value for dependsOnOwnProps.`)}function Be(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)||ke(`${n}() in ${t} must return a plain object. Instead received ${e}.`)}function Fe(e){return function(t){const n=e(t);function r(){return n}return r.dependsOnOwnProps=!1,r}}function $e(e){return e.dependsOnOwnProps?Boolean(e.dependsOnOwnProps):1!==e.length}function Le(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=$e(e);let a=o(n,i);return"function"==typeof a&&(o.mapToProps=a,o.dependsOnOwnProps=$e(a),a=o(n,i)),"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&Be(a,r,t),a},o}}function Me(e,t){return(n,r)=>{throw new Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${r.wrappedComponentName}.`)}}function je(e,t,n){return{...n,...e,...t}}var Ge={notify(){},get:()=>[]};function Ue(e,t){let n,r=Ge,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=Ge)}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 We=/* @__PURE__ */(()=>!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement))(),ze=/* @__PURE__ */(()=>"undefined"!=typeof navigator&&"ReactNative"===navigator.product)(),qe=/* @__PURE__ */(()=>We||ze?g.useLayoutEffect:g.useEffect)();function He(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function Ye(e,t){if(He(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])||!He(e[n[r]],t[n[r]]))return!1;return!0}var Ke={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Ze={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Je={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Xe={[Ce]:{$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},[Ae]:Je};function Qe(e){return function(e){return Pe(e)===we}(e)?Je:Xe[e.$$typeof]||Ke}var et=Object.defineProperty,tt=Object.getOwnPropertyNames,nt=Object.getOwnPropertySymbols,rt=Object.getOwnPropertyDescriptor,ot=Object.getPrototypeOf,it=Object.prototype;function at(e,t){if("string"!=typeof t){if(it){const n=ot(t);n&&n!==it&&at(e,n)}let n=tt(t);nt&&(n=n.concat(nt(t)));const r=Qe(e),o=Qe(t);for(let i=0;i<n.length;++i){const a=n[i];if(!(Ze[a]||o&&o[a]||r&&r[a])){const n=rt(t,a);try{et(e,a,n)}catch(e){}}}}return e}var st=/* @__PURE__ */Symbol.for("react-redux-context"),lt="undefined"!=typeof globalThis?globalThis:{};function ct(){if(!g.createContext)return{};const e=lt[st]??=/* @__PURE__ */new Map;let t=e.get(g.createContext);return t||(t=g.createContext(null),"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&(t.displayName="ReactRedux"),e.set(g.createContext,t)),t}var ut=/* @__PURE__ */ct(),dt=[null,null];function pt(e,t,n,r,o,i){e.current=r,n.current=!1,o.current&&(o.current=null,i())}function ft(e,t){return e===t}var mt=!1,gt=function(e,t,n,{pure:r,areStatesEqual:o=ft,areOwnPropsEqual:i=Ye,areStatePropsEqual:a=Ye,areMergedPropsEqual:s=Ye,forwardRef:l=!1,context:c=ut}={}){"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&(void 0===r||mt||(mt=!0,ke('The `pure` option has been removed. `connect` is now always a "pure/memoized" component')));const u=c,d=function(e){return e?"function"==typeof e?Le(e,"mapStateToProps"):Me(e,"mapStateToProps"):Fe(()=>({}))}(e),p=function(e){return e&&"object"==typeof e?Fe(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?Le(e,"mapDispatchToProps"):Me(e,"mapDispatchToProps"):Fe(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&&Be(o,n,"mergeProps")),o}}}(e):Me(e,"mergeProps"):()=>je}(n),m=Boolean(e);return e=>{if("production"!=='{NODE_ENV:"production"}'.NODE_ENV&&!/* @__PURE__ */Te(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:m,displayName:n,wrappedComponentName:t,WrappedComponent:e,initMapStateToProps:d,initMapDispatchToProps:p,initMergeProps:f,areStatesEqual:o,areStatePropsEqual:a,areOwnPropsEqual:i,areMergedPropsEqual:s};function c(t){const[o,i,a]=g.useMemo(()=>{const{reactReduxForwardedRef:e,...n}=t;return[t.context,e,n]},[t]),s=g.useMemo(()=>{let e=u;if(o?.Consumer&&"production"!=='{NODE_ENV:"production"}'.NODE_ENV){if(!/* @__PURE__ */Ve(
|
|
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"),u=require("@mui/icons-material/ChevronLeft"),d=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 m=/*#__PURE__*/p(e),g=/*#__PURE__*/f(e),h=/*#__PURE__*/p(r),b=/*#__PURE__*/p(s),E=/*#__PURE__*/p(l),v=/*#__PURE__*/p(c),y=/*#__PURE__*/p(u),N=/*#__PURE__*/p(d);function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function D(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return x(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?x(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function O(){return O=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},O.apply(null,arguments)}var w={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",presenceStatus:"Presence status",presenceStatusPresent:"Present",presenceStatusNotPresent:"Not present",presenceStatusPresentElsewhere:"Present elsewhere",assignedWorkplace:"Assigned workplace",checkedInLocation:"Checked in at",checkedInTime:"Check-in time",workingFor:"Working for",unassignedOperator:"Unassigned",removeOperator:"Remove operator",statusOk:"Fully staffed",statusMissing:"Missing operators",statusOvercapacity:"Too many operators",statusUnplanned:"Unplanned operators present",overcapacity:"Overcapacity",checkedInUnassigned:"Checked in (unassigned)",assignHere:"Assign to check-in location",unplannedStaffing:"Unplanned staffing",presentElsewhereLabel:"Present elsewhere",unplannedSectionLabel:"Checked in (unplanned)"}},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",presenceStatus:"Status obecności",presenceStatusPresent:"Obecny",presenceStatusNotPresent:"Nieobecny",presenceStatusPresentElsewhere:"Obecny na innym stanowisku",assignedWorkplace:"Przypisane stanowisko",checkedInLocation:"Miejsce zameldowania",checkedInTime:"Godzina zameldowania",workingFor:"Czas pracy",unassignedOperator:"Nieprzypisany",removeOperator:"Usuń operatora",statusOk:"Komplet operatorów",statusMissing:"Brakuje operatorów",statusOvercapacity:"Za dużo operatorów",statusUnplanned:"Zameldowani poza planem",overcapacity:"Przepełnienie",checkedInUnassigned:"Zameldowany (nieprzypisany)",assignHere:"Przypisz do miejsca zameldowania",unplannedStaffing:"Nieplanowana obsada",presentElsewhereLabel:"Obecni na innym stanowisku",unplannedSectionLabel:"Zameldowani poza planem"}}},S=function(e){return[].concat(e).sort(function(e,t){return e.startedAt.localeCompare(t.startedAt)})},I=function(e,t){return e.find(function(e){return e.name===t})},_=function(e){var n=S(e),r=h.default(),o=r.format("YYYY-MM-DD"),i=t.normalizeShifts(n,r),a=t.getCurrentShift(r,i);if(a){var s=I(n,a.name);if(s)return{date:o,shift:s,isCurrentShift:!0}}var l=i.find(function(e){return e.startedAt.isAfter(r)});if(l){var c=I(n,l.name);if(c)return{date:o,shift:c,isCurrentShift:!1}}var u=h.default(r).add(1,"day").startOf("day"),d=t.normalizeShifts(n,u);if(d.length>0){var p=I(n,d[0].name);if(p)return{date:u.format("YYYY-MM-DD"),shift:p,isCurrentShift:!1}}return null},C=function(e,t,n){var r=S(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},A="1.0.6",T=function(t){var n,r=t.data,s=t.formProps,l=e.useState("1"),c=l[0],u=l[1],d=o.useTranslation().t;return m.default.createElement(i.TabContext,{value:c},m.default.createElement(a.Box,{sx:{borderBottom:1,borderColor:"divider"}},m.default.createElement(i.TabList,{onChange:function(e,t){u(t)}},m.default.createElement(a.Tab,{label:d("filters"),value:"1"}),m.default.createElement(a.Tab,{label:d("advanced"),value:"2"}))),m.default.createElement(i.TabPanel,{value:"1"},m.default.createElement(a.FormControl,{fullWidth:!0},m.default.createElement(a.InputLabel,{id:"department-label"},d("department")),m.default.createElement(a.Select,{name:"departmentId",labelId:"department-label",variant:"outlined",value:null!=(n=s.values.departmentId)?n:"",onChange:s.handleChange,fullWidth:!0},m.default.createElement(a.MenuItem,{value:""},d("allDepartments")),r.departments.map(function(e){return m.default.createElement(a.MenuItem,{key:e.id,value:e.id},e.name)})))),m.default.createElement(i.TabPanel,{value:"2"},m.default.createElement(a.FormControl,{fullWidth:!0},m.default.createElement(a.InputLabel,{id:"refresh-interval-label"},d("refreshInterval")),m.default.createElement(a.Select,{name:"refreshInterval",labelId:"refresh-interval-label",variant:"outlined",value:s.values.refreshInterval,onChange:s.handleChange,fullWidth:!0},m.default.createElement(a.MenuItem,{value:15},"15s"),m.default.createElement(a.MenuItem,{value:30},"30s"),m.default.createElement(a.MenuItem,{value:60},"60s")))))},P="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):void 0;function V(e){var t=e.prototype.toJSON;"function"==typeof t||function(){if(!Boolean(0))throw new Error("Unexpected invariant triggered.")}(),e.prototype.inspect=t,P&&(e.prototype[P]=t)}V(/*#__PURE__*/function(){function e(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}return e.prototype.toJSON=function(){return{start:this.start,end:this.end}},e}());var k=/*#__PURE__*/function(){function e(e,t,n,r,o,i,a){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=o,this.value=a,this.prev=i,this.next=null}return e.prototype.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}();function R(e){return null!=e&&"string"==typeof e.kind}function B(e){return B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},B(e)}function F(e){return $(e,[])}function $(e,t){switch(B(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return null===e?"null":function(e,t){if(-1!==t.indexOf(e))return"[Circular]";var n=[].concat(t,[e]),r=function(e){var t=e[String(P)];return"function"==typeof t?t:"function"==typeof e.inspect?e.inspect:void 0}(e);if(void 0!==r){var o=r.call(e);if(o!==e)return"string"==typeof o?o:$(o,n)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";for(var n=Math.min(10,e.length),r=e.length-n,o=[],i=0;i<n;++i)o.push($(e[i],t));return 1===r?o.push("... 1 more item"):r>1&&o.push("... ".concat(r," more items")),"["+o.join(", ")+"]"}(e,n);return function(e,t){var n=Object.keys(e);return 0===n.length?"{}":t.length>2?"["+function(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){var n=e.constructor.name;if("string"==typeof n&&""!==n)return n}return t}(e)+"]":"{ "+n.map(function(n){return n+": "+$(e[n],t)}).join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}V(k);var L={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},M=Object.freeze({});function j(e,t,n){var r=e[t];if(r){if(!n&&"function"==typeof r)return r;var o=n?r.leave:r.enter;if("function"==typeof o)return o}else{var i=n?e.leave:e.enter;if(i){if("function"==typeof i)return i;var a=i[t];if("function"==typeof a)return a}}}var G={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return W(e.definitions,"\n\n")+"\n"},OperationDefinition:function(e){var t=e.operation,n=e.name,r=q("(",W(e.variableDefinitions,", "),")"),o=W(e.directives," "),i=e.selectionSet;return n||o||r||"query"!==t?W([t,W([n,r]),o,i]," "):i},VariableDefinition:function(e){var t=e.directives;return e.variable+": "+e.type+q(" = ",e.defaultValue)+q(" ",W(t," "))},SelectionSet:function(e){return z(e.selections)},Field:function(e){var t=e.name,n=e.arguments,r=e.directives,o=e.selectionSet,i=q("",e.alias,": ")+t,a=i+q("(",W(n,", "),")");return a.length>80&&(a=i+q("(\n",H(W(n,"\n")),"\n)")),W([a,W(r," "),o]," ")},Argument:function(e){return e.name+": "+e.value},FragmentSpread:function(e){return"..."+e.name+q(" ",W(e.directives," "))},InlineFragment:function(e){var t=e.directives,n=e.selectionSet;return W(["...",q("on ",e.typeCondition),W(t," "),n]," ")},FragmentDefinition:function(e){var t=e.typeCondition,n=e.variableDefinitions,r=e.directives,o=e.selectionSet;return"fragment ".concat(e.name).concat(q("(",W(n,", "),")")," ")+"on ".concat(t," ").concat(q("",W(r," ")," "))+o},IntValue:function(e){return e.value},FloatValue:function(e){return e.value},StringValue:function(e,t){var n=e.value;return e.block?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=-1===e.indexOf("\n"),o=!r||'"'===e[e.length-1]||"\\"===e[e.length-1]||n,i="";return!o||r&&(" "===e[0]||"\t"===e[0])||(i+="\n"+t),i+=t?e.replace(/\n/g,"\n"+t):e,o&&(i+="\n"),'"""'+i.replace(/"""/g,'\\"""')+'"""'}(n,"description"===t?"":" "):JSON.stringify(n)},BooleanValue:function(e){return e.value?"true":"false"},NullValue:function(){return"null"},EnumValue:function(e){return e.value},ListValue:function(e){return"["+W(e.values,", ")+"]"},ObjectValue:function(e){return"{"+W(e.fields,", ")+"}"},ObjectField:function(e){return e.name+": "+e.value},Directive:function(e){return"@"+e.name+q("(",W(e.arguments,", "),")")},NamedType:function(e){return e.name},ListType:function(e){return"["+e.type+"]"},NonNullType:function(e){return e.type+"!"},SchemaDefinition:U(function(e){var t=e.operationTypes;return W(["schema",W(e.directives," "),z(t)]," ")}),OperationTypeDefinition:function(e){return e.operation+": "+e.type},ScalarTypeDefinition:U(function(e){return W(["scalar",e.name,W(e.directives," ")]," ")}),ObjectTypeDefinition:U(function(e){var t=e.directives,n=e.fields;return W(["type",e.name,q("implements ",W(e.interfaces," & ")),W(t," "),z(n)]," ")}),FieldDefinition:U(function(e){var t=e.arguments,n=e.type,r=e.directives;return e.name+(K(t)?q("(\n",H(W(t,"\n")),"\n)"):q("(",W(t,", "),")"))+": "+n+q(" ",W(r," "))}),InputValueDefinition:U(function(e){var t=e.directives;return W([e.name+": "+e.type,q("= ",e.defaultValue),W(t," ")]," ")}),InterfaceTypeDefinition:U(function(e){var t=e.directives,n=e.fields;return W(["interface",e.name,q("implements ",W(e.interfaces," & ")),W(t," "),z(n)]," ")}),UnionTypeDefinition:U(function(e){var t=e.types;return W(["union",e.name,W(e.directives," "),t&&0!==t.length?"= "+W(t," | "):""]," ")}),EnumTypeDefinition:U(function(e){var t=e.values;return W(["enum",e.name,W(e.directives," "),z(t)]," ")}),EnumValueDefinition:U(function(e){return W([e.name,W(e.directives," ")]," ")}),InputObjectTypeDefinition:U(function(e){var t=e.fields;return W(["input",e.name,W(e.directives," "),z(t)]," ")}),DirectiveDefinition:U(function(e){var t=e.arguments,n=e.repeatable,r=e.locations;return"directive @"+e.name+(K(t)?q("(\n",H(W(t,"\n")),"\n)"):q("(",W(t,", "),")"))+(n?" repeatable":"")+" on "+W(r," | ")}),SchemaExtension:function(e){var t=e.operationTypes;return W(["extend schema",W(e.directives," "),z(t)]," ")},ScalarTypeExtension:function(e){return W(["extend scalar",e.name,W(e.directives," ")]," ")},ObjectTypeExtension:function(e){var t=e.directives,n=e.fields;return W(["extend type",e.name,q("implements ",W(e.interfaces," & ")),W(t," "),z(n)]," ")},InterfaceTypeExtension:function(e){var t=e.directives,n=e.fields;return W(["extend interface",e.name,q("implements ",W(e.interfaces," & ")),W(t," "),z(n)]," ")},UnionTypeExtension:function(e){var t=e.types;return W(["extend union",e.name,W(e.directives," "),t&&0!==t.length?"= "+W(t," | "):""]," ")},EnumTypeExtension:function(e){var t=e.values;return W(["extend enum",e.name,W(e.directives," "),z(t)]," ")},InputObjectTypeExtension:function(e){var t=e.fields;return W(["extend input",e.name,W(e.directives," "),z(t)]," ")}};function U(e){return function(t){return W([t.description,e(t)],"\n")}}function W(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return null!==(t=null==e?void 0:e.filter(function(e){return e}).join(n))&&void 0!==t?t:""}function z(e){return q("{\n",H(W(e,"\n")),"\n}")}function q(e,t){return null!=t&&""!==t?e+t+(arguments.length>2&&void 0!==arguments[2]?arguments[2]:""):""}function H(e){return q(" ",e.replace(/\n/g,"\n "))}function Y(e){return-1!==e.indexOf("\n")}function K(e){return null!=e&&e.some(Y)}function Z(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 J=/* @__PURE__ */(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),X=()=>Math.random().toString(36).substring(7).split("").join("."),Q={INIT:`@@redux/INIT${X()}`,REPLACE:`@@redux/REPLACE${X()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${X()}`};function ee(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 te(e,t,n){if("function"!=typeof e)throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?Z(2):`Expected the root reducer to be a function. Instead, received: '${ee(e)}'`);if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?Z(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?Z(1):`Expected the enhancer to be a function. Instead, received: '${ee(n)}'`);return n(te)(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 u(){if(l)throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?Z(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 d(e){if("function"!=typeof e)throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?Z(4):`Expected the listener to be a function. Instead, received: '${ee(e)}'`);if(l)throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?Z(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?Z(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?Z(7):`Actions must be plain objects. Instead, the actual type was: '${ee(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?Z(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?Z(17):`Action "type" property must be a string. Instead, the actual type was: '${ee(e.type)}'. Value was: '${e.type}' (stringified)`);if(l)throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?Z(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:Q.INIT}),{dispatch:p,subscribe:d,getState:u,replaceReducer:function(e){if("function"!=typeof e)throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?Z(10):`Expected the nextReducer to be a function. Instead, received: '${ee(e)}`);r=e,p({type:Q.REPLACE})},[J]:function(){const e=d;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?Z(11):`Expected the observer to be an object. Instead, received: '${ee(t)}'`);function n(){t.next&&t.next(u())}return n(),{unsubscribe:e(n)}},[J](){return this}}}}}function ne(e,t){return function(...n){return t(e.apply(this,n))}}function re(e,t){if("function"==typeof e)return ne(e,t);if("object"!=typeof e||null===e)throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?Z(16):`bindActionCreators expected an object or a function, but instead received: '${ee(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]=ne(o,t))}return n}function oe(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce((e,t)=>(...n)=>e(t(...n)))}function ie(e){var t={exports:{}};return e(t,t.exports),t.exports}var ae="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},se=m.default.useSyncExternalStore,le=m.default.useRef,ce=m.default.useEffect,ue=m.default.useMemo,de=m.default.useDebugValue,pe={useSyncExternalStoreWithSelector:function(e,t,n,r,o){var i=le(null);if(null===i.current){var a={hasValue:!1,value:null};i.current=a}else a=i.current;i=ue(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,ae(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=se(e,i[0],i[1]);return ce(function(){a.hasValue=!0,a.value=s},[s]),de(s),s}},fe=ie(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=m.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,u){var d=o(null);if(null===d.current){var p={hasValue:!1,value:null};d.current=p}else p=d.current;d=a(function(){function e(e){if(!i){if(i=!0,r=e,e=c(e),void 0!==u&&p.hasValue){var t=p.value;if(u(t,e))return o=t}return o=e}if(t=o,n(r,e))return t;var a=c(e);return void 0!==u&&u(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,u]);var f=r(e,d[0],d[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())}()});ie(function(e){e.exports="production"==='{NODE_ENV:"production"}'.NODE_ENV?pe:fe});var me=/* @__PURE__ */g.version.startsWith("19"),ge=/* @__PURE__ */Symbol.for(me?"react.transitional.element":"react.element"),he=/* @__PURE__ */Symbol.for("react.portal"),be=/* @__PURE__ */Symbol.for("react.fragment"),Ee=/* @__PURE__ */Symbol.for("react.strict_mode"),ve=/* @__PURE__ */Symbol.for("react.profiler"),ye=/* @__PURE__ */Symbol.for("react.consumer"),Ne=/* @__PURE__ */Symbol.for("react.context"),xe=/* @__PURE__ */Symbol.for("react.forward_ref"),De=/* @__PURE__ */Symbol.for("react.suspense"),Oe=/* @__PURE__ */Symbol.for("react.suspense_list"),we=/* @__PURE__ */Symbol.for("react.memo"),Se=/* @__PURE__ */Symbol.for("react.lazy"),Ie=/* @__PURE__ */Symbol.for("react.offscreen"),_e=/* @__PURE__ */Symbol.for("react.client.reference"),Ce=xe,Ae=we;function Te(e){return"string"==typeof e||"function"==typeof e||e===be||e===ve||e===Ee||e===De||e===Oe||e===Ie||"object"==typeof e&&null!==e&&(e.$$typeof===Se||e.$$typeof===we||e.$$typeof===Ne||e.$$typeof===ye||e.$$typeof===xe||e.$$typeof===_e||void 0!==e.getModuleId)}function Pe(e){if("object"==typeof e&&null!==e){const{$$typeof:t}=e;switch(t){case ge:switch(e=e.type){case be:case ve:case Ee:case De:case Oe:return e;default:switch(e=e&&e.$$typeof){case Ne:case xe:case Se:case we:case ye:return e;default:return t}}case he:return t}}}function Ve(e){return me?Pe(e)===ye:Pe(e)===Ne}function ke(e){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e);try{throw new Error(e)}catch(e){}}function Re(e,t){if(!e)throw new Error(`Unexpected value for ${t} in connect.`);"mapStateToProps"!==t&&"mapDispatchToProps"!==t||Object.prototype.hasOwnProperty.call(e,"dependsOnOwnProps")||ke(`The selector for ${t} of connect did not specify a value for dependsOnOwnProps.`)}function Be(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)||ke(`${n}() in ${t} must return a plain object. Instead received ${e}.`)}function Fe(e){return function(t){const n=e(t);function r(){return n}return r.dependsOnOwnProps=!1,r}}function $e(e){return e.dependsOnOwnProps?Boolean(e.dependsOnOwnProps):1!==e.length}function Le(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=$e(e);let a=o(n,i);return"function"==typeof a&&(o.mapToProps=a,o.dependsOnOwnProps=$e(a),a=o(n,i)),"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&Be(a,r,t),a},o}}function Me(e,t){return(n,r)=>{throw new Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${r.wrappedComponentName}.`)}}function je(e,t,n){return{...n,...e,...t}}var Ge={notify(){},get:()=>[]};function Ue(e,t){let n,r=Ge,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=Ge)}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 We=/* @__PURE__ */(()=>!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement))(),ze=/* @__PURE__ */(()=>"undefined"!=typeof navigator&&"ReactNative"===navigator.product)(),qe=/* @__PURE__ */(()=>We||ze?g.useLayoutEffect:g.useEffect)();function He(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function Ye(e,t){if(He(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])||!He(e[n[r]],t[n[r]]))return!1;return!0}var Ke={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Ze={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Je={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Xe={[Ce]:{$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},[Ae]:Je};function Qe(e){return function(e){return Pe(e)===we}(e)?Je:Xe[e.$$typeof]||Ke}var et=Object.defineProperty,tt=Object.getOwnPropertyNames,nt=Object.getOwnPropertySymbols,rt=Object.getOwnPropertyDescriptor,ot=Object.getPrototypeOf,it=Object.prototype;function at(e,t){if("string"!=typeof t){if(it){const n=ot(t);n&&n!==it&&at(e,n)}let n=tt(t);nt&&(n=n.concat(nt(t)));const r=Qe(e),o=Qe(t);for(let i=0;i<n.length;++i){const a=n[i];if(!(Ze[a]||o&&o[a]||r&&r[a])){const n=rt(t,a);try{et(e,a,n)}catch(e){}}}}return e}var st=/* @__PURE__ */Symbol.for("react-redux-context"),lt="undefined"!=typeof globalThis?globalThis:{};function ct(){if(!g.createContext)return{};const e=lt[st]??=/* @__PURE__ */new Map;let t=e.get(g.createContext);return t||(t=g.createContext(null),"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&(t.displayName="ReactRedux"),e.set(g.createContext,t)),t}var ut=/* @__PURE__ */ct(),dt=[null,null];function pt(e,t,n,r,o,i){e.current=r,n.current=!1,o.current&&(o.current=null,i())}function ft(e,t){return e===t}var mt=!1,gt=function(e,t,n,{pure:r,areStatesEqual:o=ft,areOwnPropsEqual:i=Ye,areStatePropsEqual:a=Ye,areMergedPropsEqual:s=Ye,forwardRef:l=!1,context:c=ut}={}){"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&(void 0===r||mt||(mt=!0,ke('The `pure` option has been removed. `connect` is now always a "pure/memoized" component')));const u=c,d=function(e){return e?"function"==typeof e?Le(e,"mapStateToProps"):Me(e,"mapStateToProps"):Fe(()=>({}))}(e),p=function(e){return e&&"object"==typeof e?Fe(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?Le(e,"mapDispatchToProps"):Me(e,"mapDispatchToProps"):Fe(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&&Be(o,n,"mergeProps")),o}}}(e):Me(e,"mergeProps"):()=>je}(n),m=Boolean(e);return e=>{if("production"!=='{NODE_ENV:"production"}'.NODE_ENV&&!/* @__PURE__ */Te(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:m,displayName:n,wrappedComponentName:t,WrappedComponent:e,initMapStateToProps:d,initMapDispatchToProps:p,initMergeProps:f,areStatesEqual:o,areStatePropsEqual:a,areOwnPropsEqual:i,areMergedPropsEqual:s};function c(t){const[o,i,a]=g.useMemo(()=>{const{reactReduxForwardedRef:e,...n}=t;return[t.context,e,n]},[t]),s=g.useMemo(()=>{let e=u;if(o?.Consumer&&"production"!=='{NODE_ENV:"production"}'.NODE_ENV){if(!/* @__PURE__ */Ve(
|
|
2
2
|
/* @__PURE__ */
|
|
3
3
|
g.createElement(o.Consumer,null)))throw new Error("You must pass a valid React context consumer as `props.context`");e=o}return e},[o,u]),l=g.useContext(s),c=Boolean(t.store)&&Boolean(t.store.getState)&&Boolean(t.store.dispatch),d=Boolean(l)&&Boolean(l.store);if("production"!=='{NODE_ENV:"production"}'.NODE_ENV&&!c&&!d)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=d?l.getServerState:p.getState,h=g.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){Re(e,"mapStateToProps"),Re(t,"mapDispatchToProps"),Re(n,"mergeProps")}(i,a,s),function(e,t,n,r,{areStatesEqual:o,areOwnPropsEqual:i,areStatePropsEqual:a}){let s,l,c,u,d,p=!1;return function(f,m){return p?function(p,f){const m=!i(f,l),g=!o(p,s,f,l);return s=p,l=f,m&&g?(c=e(s,l),t.dependsOnOwnProps&&(u=t(r,l)),d=n(c,u,l),d):m?(e.dependsOnOwnProps&&(c=e(s,l)),t.dependsOnOwnProps&&(u=t(r,l)),d=n(c,u,l),d):g?function(){const t=e(s,l),r=!a(t,c);return c=t,r&&(d=n(c,u,l)),d}():d}(f,m):(s=f,l=m,c=e(s,l),u=t(r,l),d=n(c,u,l),p=!0,d)}}(i,a,s,e,o)}(p.dispatch,r),[p]),[b,E]=g.useMemo(()=>{if(!m)return dt;const e=Ue(p,c?void 0:l.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]},[p,c,l]),v=g.useMemo(()=>c?l:{...l,subscription:b},[c,l,b]),y=g.useRef(void 0),N=g.useRef(a),x=g.useRef(void 0),D=g.useRef(!1),O=g.useRef(!1),w=g.useRef(void 0);qe(()=>(O.current=!0,()=>{O.current=!1}),[]);const S=g.useMemo(()=>()=>x.current&&a===N.current?x.current:h(p.getState(),a),[p,a]),I=g.useMemo(()=>e=>b?function(e,t,n,r,o,i,a,s,l,c,u){if(!e)return()=>{};let d=!1,p=null;const f=()=>{if(d||!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,u())};return n.onStateChange=f,n.trySubscribe(),f(),()=>{if(d=!0,n.tryUnsubscribe(),n.onStateChange=null,p)throw p}}(m,p,b,h,N,y,D,O,x,E,e):()=>{},[b]);var _,C;let A;_=pt,C=[N,y,D,a,x,E],qe(()=>_(...C),void 0);try{A=g.useSyncExternalStore(I,S,f?()=>h(f(),a):S)}catch(e){throw w.current&&(e.message+=`\nThe error may be correlated with this previous error:\n${w.current.stack}\n\n`),e}qe(()=>{w.current=void 0,x.current=void 0,y.current=A});const T=g.useMemo(()=>
|
|
4
4
|
/* @__PURE__ */g.createElement(e,{...A,ref:i}),[i,e,A]);return g.useMemo(()=>m?/* @__PURE__ */g.createElement(s.Provider,{value:v},T):T,[s,T,v])}const h=g.memo(c);if(h.WrappedComponent=e,h.displayName=c.displayName=n,l){const t=g.forwardRef(function(e,t){/* @__PURE__ */
|
|
5
5
|
return g.createElement(h,{...e,reactReduxForwardedRef:t})});return t.displayName=n,t.WrappedComponent=e,/* @__PURE__ */at(t,e)}/* @__PURE__ */
|
|
6
6
|
return at(h,e)}},ht=function(e){const{children:t,context:n,serverState:r,store:o}=e,i=g.useMemo(()=>{const t=Ue(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=g.useMemo(()=>o.getState(),[o]);return qe(()=>{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__ */g.createElement((n||ut).Provider,{value:i},t)},bt="production"==='{NODE_ENV:"production"}'.NODE_ENV,Et="Invariant failed";function vt(e,t){if(!e){if(bt)throw new Error(Et);var n="function"==typeof t?t():t,r=n?"".concat(Et,": ").concat(n):Et;throw new Error(r)}}var yt=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}}},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}},xt=function(e,t){return{top:e.top+t.top,left:e.left+t.left,bottom:e.bottom-t.bottom,right:e.right-t.right}},Dt={top:0,right:0,bottom:0,left:0},Ot=function(e){var t=e.borderBox,n=e.margin,r=void 0===n?Dt:n,o=e.border,i=void 0===o?Dt:o,a=e.padding,s=void 0===a?Dt:a,l=yt(Nt(t,r)),c=yt(xt(t,i)),u=yt(xt(c,s));return{marginBox:l,borderBox:yt(t),paddingBox:c,contentBox:u,margin:r,border:i,padding:s}},wt=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?vt(!1,"Could not parse value [raw: "+e+", without suffix: "+t+"]"):vt(!1)),n},St=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})},It=function(e,t){return void 0===t&&(t={x:window.pageXOffset,y:window.pageYOffset}),St(e,t)},_t=function(e,t){var n={top:wt(t.marginTop),right:wt(t.marginRight),bottom:wt(t.marginBottom),left:wt(t.marginLeft)},r={top:wt(t.paddingTop),right:wt(t.paddingRight),bottom:wt(t.paddingBottom),left:wt(t.paddingLeft)},o={top:wt(t.borderTopWidth),right:wt(t.borderRightWidth),bottom:wt(t.borderBottomWidth),left:wt(t.borderLeftWidth)};return Ot({borderBox:e,margin:n,padding:r,border:o})},Ct=function(e){var t=e.getBoundingClientRect(),n=window.getComputedStyle(e);return _t(t,n)},At=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 Tt(){return Tt=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},Tt.apply(null,arguments)}const Pt="production"==='{NODE_ENV:"production"}'.NODE_ENV,Vt=/[ \t]{2,}/g,kt=/^[ \t]*/gm,Rt=e=>e.replace(Vt," ").replace(kt,"").trim(),Bt=e=>Rt(`\n %c@hello-pangea/dnd\n\n %c${Rt(e)}\n\n %c👷 This is a development only message. It will be removed in production builds.\n`);function Ft(e,t){Pt||"undefined"!=typeof window&&window["__@hello-pangea/dnd-disable-dev-warnings"]||console[e](...(e=>[Bt(e),"color: #00C584; font-size: 1.2em; font-weight: bold;","line-height: 1.5","color: #723874;"])(t))}const $t=Ft.bind(null,"warn"),Lt=Ft.bind(null,"error");function Mt(){}function jt(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 Gt="production"==='{NODE_ENV:"production"}'.NODE_ENV,Ut="Invariant failed";class Wt extends Error{}function zt(e,t){throw new Wt(Gt?Ut:`${Ut}: ${t||""}`)}Wt.prototype.toString=function(){return this.message};class qt extends m.default.Component{constructor(...e){super(...e),this.callbacks=null,this.unbind=Mt,this.onWindowError=e=>{const t=this.getCallbacks();t.isDragging()&&(t.tryAbort(),"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&$t("\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 Wt&&(e.preventDefault(),"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&Lt(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=jt(window,[{eventName:"error",fn:this.onWindowError}])}componentDidCatch(e){if(e instanceof Wt)return"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&Lt(e.message),void this.setState({});throw e}componentWillUnmount(){this.unbind()}render(){return this.props.children(this.setCallbacks)}}const Ht=e=>e+1,Yt=(e,t)=>{const n=e.droppableId===t.droppableId,r=Ht(e.index),o=Ht(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 `},Kt=(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 `,Zt=e=>`\n The item has returned to its starting position\n of ${Ht(e.index)}\n`,Jt=e=>`\n You have lifted an item in position ${Ht(e.source.index)}\n`,Xt=e=>{const t=e.destination;if(t)return Yt(e.source,t);const n=e.combine;return n?Kt(e.draggableId,e.source,n):"You are over an area that cannot be dropped on"},Qt=e=>{if("CANCEL"===e.reason)return`\n Movement cancelled.\n ${Zt(e.source)}\n `;const t=e.destination,n=e.combine;return t?`\n You have dropped the item.\n ${Yt(e.source,t)}\n `:n?`\n You have dropped the item.\n ${Kt(e.draggableId,e.source,n)}\n `:`\n The item has been dropped while not over a drop area.\n ${Zt(e.source)}\n `};function en(e,t){return e===t||!(!Number.isNaN(e)||!Number.isNaN(t))}function tn(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!en(e[n],t[n]))return!1;return!0}function nn(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&&tn(n,i.current.inputs))?i.current:{inputs:n,result:t()};return e.useEffect(()=>{o.current=!1,i.current=a},[a]),a.result}function rn(e,t){return nn(()=>e,t)}const on={x:0,y:0},an=(e,t)=>({x:e.x+t.x,y:e.y+t.y}),sn=(e,t)=>({x:e.x-t.x,y:e.y-t.y}),ln=(e,t)=>e.x===t.x&&e.y===t.y,cn=e=>({x:0!==e.x?-e.x:0,y:0!==e.y?-e.y:0}),un=(e,t,n=0)=>"x"===e?{x:t,y:n}:{x:n,y:t},dn=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2),pn=(e,t)=>Math.min(...t.map(t=>dn(e,t))),fn=e=>t=>({x:e(t.x),y:e(t.y)}),mn=(e,t)=>({top:e.top+t.y,left:e.left+t.x,bottom:e.bottom+t.y,right:e.right+t.x}),gn=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}],hn=(e,t)=>t&&t.shouldClipSubject?((e,t)=>{const n=yt({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):yt(e);var bn=({page:e,withPlaceholder:t,axis:n,frame:r})=>{const o=((e,t)=>t?mn(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:hn(i,r)}},En=(e,t)=>{e.frame||zt();const n=e.frame,r=sn(t,n.scroll.initial),o=cn(r),i={...n,scroll:{initial:n.scroll.initial,current:t,diff:{value:r,displacement:o},max:n.scroll.max}},a=bn({page:e.subject.page,withPlaceholder:e.subject.withPlaceholder,axis:e.axis,frame:i});return{...e,frame:i,subject:a}};function vn(e,t=tn){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 yn=vn(e=>e.reduce((e,t)=>(e[t.descriptor.id]=t,e),{})),Nn=vn(e=>e.reduce((e,t)=>(e[t.descriptor.id]=t,e),{})),xn=vn(e=>Object.values(e)),Dn=vn(e=>Object.values(e));var On=vn((e,t)=>{const n=Dn(t).filter(t=>e===t.descriptor.droppableId).sort((e,t)=>e.descriptor.index-t.descriptor.index);return n});function wn(e){return e.at&&"REORDER"===e.at.type?e.at.destination:null}function Sn(e){return e.at&&"COMBINE"===e.at.type?e.at.combine:null}var In=vn((e,t)=>t.filter(t=>t.descriptor.id!==e.descriptor.id)),_n=(e,t)=>e.descriptor.droppableId===t.descriptor.id;const Cn={point:on,value:0},An={invisible:{},visible:{},all:[]},Tn={displaced:An,displacedBy:Cn,at:null};var Pn=(e,t)=>n=>e<=n&&n<=t,Vn=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}},kn=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 Rn={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},Bn={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"},Fn=({target:e,destination:t,viewport:n,withDroppableDisplacement:r,isVisibleThroughFrameFn:o})=>{const i=r?((e,t)=>mn(e,t.frame?t.frame.scroll.diff.displacement:on))(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)},$n=e=>Fn({...e,isVisibleThroughFrameFn:kn});function Ln({afterDragging:e,destination:t,displacedBy:n,viewport:r,forceShouldAnimate:o,last:i}){return e.reduce(function(e,a){const s=function(e,t){return yt(Nt(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},!Fn({...c,isVisibleThroughFrameFn:Vn}))return e.invisible[a.descriptor.id]=!0,e;const u=((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:u},e},{all:[],visible:{},invisible:{}})}function Mn({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:An,displacedBy:n,at:{type:"REORDER",destination:{droppableId:r.descriptor.id,index:o}}}}function jn({draggable:e,insideDestination:t,destination:n,viewport:r,displacedBy:o,last:i,index:a,forceShouldAnimate:s}){const l=_n(e,n);if(null==a)return Mn({insideDestination:t,inHomeList:l,displacedBy:o,destination:n});const c=t.find(e=>e.descriptor.index===a);if(!c)return Mn({insideDestination:t,inHomeList:l,displacedBy:o,destination:n});const u=In(e,t),d=t.indexOf(c);return{displaced:Ln({afterDragging:u.slice(d),destination:n,displacedBy:o,last:i,viewport:r.frame,forceShouldAnimate:s}),displacedBy:o,at:{type:"REORDER",destination:{droppableId:n.descriptor.id,index:a}}}}function Gn(e,t){return Boolean(t.effected[e])}const Un=(e,t)=>t.margin[e.start]+t.borderBox[e.size]/2,Wn=(e,t,n)=>t[e.crossAxisStart]+n.margin[e.crossAxisStart]+n.borderBox[e.crossAxisSize]/2,zn=({axis:e,moveRelativeTo:t,isMoving:n})=>un(e.line,t.marginBox[e.end]+Un(e,n),Wn(e,t.marginBox,n)),qn=({axis:e,moveRelativeTo:t,isMoving:n})=>un(e.line,t.marginBox[e.start]-((e,t)=>t.margin[e.end]+t.borderBox[e.size]/2)(e,n),Wn(e,t.marginBox,n));var Hn=(e,t)=>{const n=e.frame;return n?an(t,n.scroll.diff.displacement):t},Yn=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=On(r.descriptor.id,n),a=t.page,s=r.axis;if(!i.length)return(({axis:e,moveInto:t,isMoving:n})=>un(e.line,t.contentBox[e.start]+Un(e,n),Wn(e,t.contentBox,n)))({axis:s,moveInto:r.page,isMoving:a});const{displaced:l,displacedBy:c}=e,u=l.all[0];if(u){const e=n[u];if(Gn(u,o))return qn({axis:s,moveRelativeTo:e.page,isMoving:a});const t=St(e.page,c.point);return qn({axis:s,moveRelativeTo:t,isMoving:a})}const d=i[i.length-1];if(d.descriptor.id===t.descriptor.id)return a.borderBox.center;if(Gn(d.descriptor.id,o)){const e=St(d.page,cn(o.displacedBy.point));return zn({axis:s,moveRelativeTo:e,isMoving:a})}return zn({axis:s,moveRelativeTo:d.page,isMoving:a})})({impact:e,draggable:t,draggables:r,droppable:n,afterCritical:o}):(({afterCritical:e,impact:t,draggables:n})=>{const r=Sn(t);r||zt();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 Gn(n,t)?o?on:cn(r.point):o?r.point:on})({displaced:t.displaced,afterCritical:e,combineWith:o,displacedBy:t.displacedBy});return an(i,a)})({impact:e,draggables:r,afterCritical:o}):i})(e),n=e.droppable;return n?Hn(n,t):t},Kn=(e,t)=>{const n=sn(t,e.scroll.initial),r=cn(n);return{frame:yt({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 Zn(e,t){return e.map(e=>t[e])}var Jn=({pageBorderBoxCenter:e,draggable:t,viewport:n})=>{const r=((e,t)=>an(e.scroll.diff.displacement,t))(n,e),o=sn(r,t.page.borderBox.center);return an(t.client.borderBox.center,o)},Xn=({draggable:e,destination:t,newPageBorderBoxCenter:n,viewport:r,withDroppableDisplacement:o,onlyOnMainAxis:i=!1})=>{const a=sn(n,e.page.borderBox.center),s={target:mn(e.page.borderBox,a),destination:t,withDroppableDisplacement:o,viewport:r};return i?(e=>{return Fn({...e,isVisibleThroughFrameFn:(t=e.destination.axis,e=>{const n=Pn(e.top,e.bottom),r=Pn(e.left,e.right);return e=>t===Rn?n(e.top)&&n(e.bottom):r(e.left)&&r(e.right)})});var t})(s):$n(s)};const Qn=e=>{const t=e.subject.active;return t||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot get clipped area from droppable"):zt()),t},er=(e,t)=>{const n=e.page.borderBox.center;return Gn(e.descriptor.id,t)?sn(n,t.displacedBy.point):n},tr=(e,t)=>{const n=e.page.borderBox;return Gn(e.descriptor.id,t)?mn(n,cn(t.displacedBy.point)):n};var nr=vn(function(e,t){const n=t[e.line];return{value:n,point:un(e.line,n)}});const rr=(e,t)=>({...e,scroll:{...e.scroll,max:t}}),or=(e,t,n)=>{const r=e.frame;_n(t,e)&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Should not add placeholder space to home list"):zt()),e.subject.withPlaceholder&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot add placeholder size to a subject when it already has one"):zt());const o=nr(e.axis,t.displaceBy).point,i=((e,t,n)=>{const r=e.axis;if("virtual"===e.descriptor.mode)return un(r.line,t[r.line]);const o=e.subject.page.contentBox[r.size],i=On(e.descriptor.id,n).reduce((e,t)=>e+t.client.marginBox[r.size],0)+t[r.line]-o;return i<=0?null:un(r.line,i)})(e,o,n),a={placeholderSize:o,increasedBy:i,oldFrameMaxScroll:e.frame?e.frame.scroll.max:null};if(!r){const t=bn({page:e.subject.page,withPlaceholder:a,axis:e.axis,frame:e.frame});return{...e,subject:t}}const s=i?an(r.scroll.max,i):r.scroll.max,l=rr(r,s),c=bn({page:e.subject.page,withPlaceholder:a,axis:e.axis,frame:l});return{...e,subject:c,frame:l}};var ir=e=>{const t=e.at;return t?"REORDER"===t.type?t.destination.droppableId:t.combine.droppableId:null};function ar(e){return"DRAGGING"===e.phase||"COLLECTING"===e.phase}function sr(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 lr=(e,t)=>yt(mn(e,t));function cr({displaced:e,id:t}){return Boolean(e.visible[t]||e.invisible[t])}var ur=({pageOffset:e,draggable:t,draggables:n,droppables:r,previousImpact:o,viewport:i,afterCritical:a})=>{const s=lr(t.page.borderBox,e),l=function({pageBorderBox:e,draggable:t,droppables:n}){const r=xn(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(sr(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]),u=c(s),d=c(l);return!u&&!d||(u?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=un(t.axis.line,e.center[n.line],t.page.borderBox.center[n.crossAxisLine]);return{id:t.descriptor.id,distance:dn(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 Tn;const c=r[l],u=On(c.descriptor.id,n),d=((e,t)=>{const n=e.frame;return n?lr(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=nr(r.axis,e.displaceBy),l=s.value,c=t[a.start],u=t[a.end],d=In(e,o).find(e=>{const t=e.descriptor.id,r=e.page.borderBox,o=r[a.size]/4,s=Gn(t,i),d=cr({displaced:n.displaced,id:t});return s?d?u>r[a.start]+o&&u<r[a.end]-o:c>r[a.start]-l+o&&c<r[a.end]-l-o:d?u>r[a.start]+l+o&&u<r[a.end]+l-o:c>r[a.start]+o&&c<r[a.end]-o});return d?{displacedBy:s,displaced:n.displaced,at:{type:"COMBINE",combine:{draggableId:d.descriptor.id,droppableId:r.descriptor.id}}}:null})({pageBorderBoxWithDroppableScroll:d,draggable:t,previousImpact:o,destination:c,insideDestination:u,afterCritical:a})||(({pageBorderBoxWithDroppableScroll:e,draggable:t,destination:n,insideDestination:r,last:o,viewport:i,afterCritical:a})=>{const s=n.axis,l=nr(n.axis,t.displaceBy),c=l.value,u=e[s.start],d=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:In(t,r).find(e=>{const t=e.descriptor.id,n=e.page.borderBox.center[s.line],r=Gn(t,a),i=cr({displaced:o,id:t});return r?i?d<=n:u<n-c:i?d<=n+c:u<n})||null,inHomeList:_n(t,n)});return jn({draggable:t,insideDestination:r,destination:n,viewport:i,last:o,displacedBy:l,index:p})})({pageBorderBoxWithDroppableScroll:d,draggable:t,destination:c,insideDestination:u,last:o.displaced,viewport:i,afterCritical:a})},dr=(e,t)=>({...e,[t.descriptor.id]:t}),pr=({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=sn(l,e.initial.client.selection),u={offset:c,selection:l,borderBoxCenter:an(e.initial.client.borderBoxCenter,c)},d={selection:an(u.selection,a.scroll.current),borderBoxCenter:an(u.borderBoxCenter,a.scroll.current),offset:an(u.offset,a.scroll.diff.value)},p={client:u,page:d};if("COLLECTING"===e.phase)return{...e,dimensions:s,viewport:a,current:p};const f=s.draggables[e.critical.draggable.id],m=o||ur({pageOffset:d.offset,draggable:f,draggables:s.draggables,droppables:s.droppables,previousImpact:e.impact,viewport:a,afterCritical:e.afterCritical}),g=(({draggable:e,draggables:t,droppables:n,previousImpact:r,impact:o})=>{const i=(({previousImpact:e,impact:t,droppables:n})=>{const r=ir(e),o=ir(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?zt(0,"Cannot remove placeholder form subject when there was none"):zt());const n=e.frame;if(!n){const t=bn({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?zt(0,"Expected droppable with frame to have old max frame scroll when removing placeholder"):zt());const o=rr(n,r),i=bn({page:e.subject.page,axis:e.axis,frame:o,withPlaceholder:null});return{...e,subject:i,frame:o}})(i);return dr(n,a)})({previousImpact:r,impact:o,droppables:n}),a=ir(o);if(!a)return i;const s=n[a];if(_n(e,s))return i;if(s.subject.withPlaceholder)return i;const l=or(s,e,t);return dr(i,l)})({draggable:f,impact:m,previousImpact:e.impact,draggables:s.draggables,droppables:s.droppables});return{...e,current:p,dimensions:{draggables:s.draggables,droppables:g},impact:m,viewport:a,scrollJumpRequest:i||null,forceShouldAnimate:!i&&null}},fr=({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=Ln({afterDragging:a,destination:r,displacedBy:e.displacedBy,viewport:t.frame,forceShouldAnimate:o,last:i});return{...e,displaced:s}},mr=({impact:e,draggable:t,droppable:n,draggables:r,viewport:o,afterCritical:i})=>{const a=Yn({impact:e,draggable:t,draggables:r,droppable:n,afterCritical:i});return Jn({pageBorderBoxCenter:a,draggable:t,viewport:o})},gr=({state:e,dimensions:t,viewport:n})=>{"SNAP"!==e.movementMode&&zt();const r=e.impact,o=n||e.viewport,i=t||e.dimensions,{draggables:a,droppables:s}=i,l=a[e.critical.draggable.id],c=ir(r);c||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Must be over a destination in SNAP movement mode"):zt());const u=s[c],d=fr({impact:r,viewport:o,destination:u,draggables:a}),p=mr({impact:d,draggable:l,droppable:u,draggables:a,viewport:o,afterCritical:e.afterCritical});return pr({impact:d,clientSelection:p,state:e,dimensions:i,viewport:o})},hr=({draggable:e,home:t,draggables:n,viewport:r})=>{const o=nr(t.axis,e.displaceBy),i=On(t.descriptor.id,n),a=i.indexOf(e);-1===a&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Expected draggable to be inside home list"):zt());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 u;return{impact:{displaced:Ln({afterDragging:s,destination:t,displacedBy:o,last:null,viewport:r.frame,forceShouldAnimate:!1}),displacedBy:o,at:{type:"REORDER",destination:(u=e.descriptor,{index:u.index,droppableId:u.droppableId})}},afterCritical:c}};const br=e=>"SNAP"===e.movementMode,Er=(e,t,n)=>{const r=((e,t)=>({draggables:e.draggables,droppables:dr(e.droppables,t)}))(e.dimensions,t);return!br(e)||n?pr({state:e,dimensions:r}):gr({state:e,dimensions:r})};function vr(e){return e.isDragging&&"SNAP"===e.movementMode?{...e,scrollJumpRequest:null}:e}const yr={phase:"IDLE",completed:null,shouldFlush:!1};var Nr=(e=yr,t)=>{if("FLUSH"===t.type)return{...yr,shouldFlush:!0};if("INITIAL_PUBLISH"===t.type){"IDLE"!==e.phase&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"INITIAL_PUBLISH must come after a IDLE phase"):zt());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:on},u={client:c,page:{selection:an(c.selection,o.scroll.initial),borderBoxCenter:an(c.selection,o.scroll.initial),offset:an(c.selection,o.scroll.diff.value)}},d=xn(i.droppables).every(e=>!e.isFixedOnPage),{impact:p,afterCritical:f}=hr({draggable:s,home:l,draggables:i.draggables,viewport:o});return{phase:"DRAGGING",isDragging:!0,critical:n,movementMode:a,dimensions:i,initial:u,current:u,isWindowScrollAllowed:d,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?zt(0,`Collection cannot start from phase ${e.phase}`):zt()),{...e,phase:"COLLECTING"});if("PUBLISH_WHILE_DRAGGING"===t.type)return"COLLECTING"!==e.phase&&"DROP_PENDING"!==e.phase&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,`Unexpected ${t.type} received in phase ${e.phase}`):zt()),(({state:e,published:t})=>{const n=t.modified.map(t=>En(e.dimensions.droppables[t.droppableId],t.scroll)),r={...e.dimensions.droppables,...yn(n)},o=Nn((({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?zt(0,"Expected Droppable to have a frame"):zt()),t})(t[e.descriptor.droppableId]),i=(({draggable:e,offset:t,initialWindowScroll:n})=>{const r=St(e.client,t),o=It(r,n);return{...e,placeholder:{...e.placeholder,client:r},client:r,page:o}})({draggable:e,offset:an(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=ir(e.impact),l=s?a.droppables[s]:null,c=a.draggables[e.critical.draggable.id],u=a.droppables[e.critical.droppable.id],{impact:d,afterCritical:p}=hr({draggable:c,home:u,draggables:i,viewport:e.viewport}),f=ur({pageOffset:e.current.page.offset,draggable:a.draggables[e.critical.draggable.id],draggables:a.draggables,droppables:a.droppables,previousImpact:l&&l.isCombineEnabled?e.impact:d,viewport:e.viewport,afterCritical:p}),m={...e,phase:"DRAGGING",impact:f,onLiftImpact:d,dimensions:a,afterCritical:p,forceShouldAnimate:!1};return"COLLECTING"===e.phase?m:{...m,phase:"DROP_PENDING",reason:e.reason,isWaiting:!1}})({state:e,published:t.payload});if("MOVE"===t.type){if("DROP_PENDING"===e.phase)return e;ar(e)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,`${t.type} not permitted in phase ${e.phase}`):zt());const{client:n}=t.payload;return ln(n,e.current.client.selection)?e:pr({state:e,clientSelection:n,impact:br(e)?e.impact:null})}if("UPDATE_DROPPABLE_SCROLL"===t.type){if("DROP_PENDING"===e.phase)return vr(e);if("COLLECTING"===e.phase)return vr(e);ar(e)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,`${t.type} not permitted in phase ${e.phase}`):zt());const{id:n,newScroll:r}=t.payload,o=e.dimensions.droppables[n];if(!o)return e;const i=En(o,r);return Er(e,i,!1)}if("UPDATE_DROPPABLE_IS_ENABLED"===t.type){if("DROP_PENDING"===e.phase)return e;ar(e)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,`Attempting to move in an unsupported phase ${e.phase}`):zt());const{id:n,isEnabled:r}=t.payload,o=e.dimensions.droppables[n];o||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,`Cannot find Droppable[id: ${n}] to toggle its enabled state`):zt()),o.isEnabled===r&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,`Trying to set droppable isEnabled to ${String(r)}\n but it is already ${String(o.isEnabled)}`):zt());const i={...o,isEnabled:r};return Er(e,i,!0)}if("UPDATE_DROPPABLE_IS_COMBINE_ENABLED"===t.type){if("DROP_PENDING"===e.phase)return e;ar(e)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,`Attempting to move in an unsupported phase ${e.phase}`):zt());const{id:n,isCombineEnabled:r}=t.payload,o=e.dimensions.droppables[n];o||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,`Cannot find Droppable[id: ${n}] to toggle its isCombineEnabled state`):zt()),o.isCombineEnabled===r&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,`Trying to set droppable isCombineEnabled to ${String(r)}\n but it is already ${String(o.isCombineEnabled)}`):zt());const i={...o,isCombineEnabled:r};return Er(e,i,!0)}if("MOVE_BY_WINDOW_SCROLL"===t.type){if("DROP_PENDING"===e.phase||"DROP_ANIMATING"===e.phase)return e;ar(e)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,`Cannot move by window in phase ${e.phase}`):zt()),e.isWindowScrollAllowed||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Window scrolling is currently not supported for fixed lists"):zt());const n=t.payload.newScroll;if(ln(e.viewport.scroll.current,n))return vr(e);const r=Kn(e.viewport,n);return br(e)?gr({state:e,viewport:r}):pr({state:e,viewport:r})}if("UPDATE_VIEWPORT_MAX_SCROLL"===t.type){if(!ar(e))return e;const n=t.payload.maxScroll;if(ln(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?zt(0,`${t.type} received while not in DRAGGING phase`):zt());const n=(({state:e,type:t})=>{const n=((e,t)=>{const n=ir(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:u,droppables:d}=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=On(n.descriptor.id,r),u=_n(t,n),d=(({isMovingForward:e,draggable:t,destination:n,insideDestination:r,previousImpact:o})=>{if(!n.isCombineEnabled)return null;if(!wn(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=In(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?zt(0,"Could not find displaced item in set"):zt());const u=c-1;return u<0?null:i(l[u].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?zt(0,"Cannot move in direction without previous impact location"):zt()),"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:jn({draggable:n,insideDestination:i,destination:o,viewport:s,last:a.displaced,displacedBy:a.displacedBy,index:r})}const u=(({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 Gn(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==u?null:jn({draggable:n,insideDestination:i,destination:o,viewport:s,last:a.displaced,displacedBy:a.displacedBy,index:u})})({isMovingForward:e,isInHomeList:u,draggable:t,draggables:r,destination:n,insideDestination:c,previousImpact:o,viewport:i,afterCritical:l});if(!d)return null;const p=Yn({impact:d,draggable:t,droppable:n,draggables:r,afterCritical:l});if(Xn({draggable:t,destination:n,newPageBorderBoxCenter:p,viewport:i.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0}))return{clientSelection:Jn({pageBorderBoxCenter:p,draggable:t,viewport:i}),impact:d,scrollJumpRequest:null};const f=sn(p,a),m=(({impact:e,viewport:t,destination:n,draggables:r,maxScrollChange:o})=>{const i=Kn(t,an(t.scroll.current,o)),a=n.frame?En(n,an(n.frame.scroll.current,o)):n,s=e.displaced,l=Ln({afterDragging:Zn(s.all,r),destination:n,displacedBy:e.displacedBy,viewport:i.frame,last:s,forceShouldAnimate:!1}),c=Ln({afterDragging:Zn(s.all,r),destination:a,displacedBy:e.displacedBy,viewport:t.frame,last:s,forceShouldAnimate:!1}),u={},d={},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?d[e]=t:u[e]=!0}),{...e,displaced:{all:s.all,invisible:u,visible:d}}})({impact:d,viewport:i,destination:n,draggables:r,maxScrollChange:f});return{clientSelection:s,impact:m,scrollJumpRequest:f}})({isMovingForward:s,previousPageBorderBoxCenter:c,draggable:l,destination:o,draggables:u,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=xn(r).filter(e=>e!==n).filter(e=>e.isEnabled).filter(e=>Boolean(e.subject.active)).filter(e=>Vn(o.frame)(Qn(e))).filter(t=>{const n=Qn(t);return e?i[a.crossAxisEnd]<n[a.crossAxisEnd]:n[a.crossAxisStart]<i[a.crossAxisStart]}).filter(e=>{const t=Qn(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=Qn(t)[a.crossAxisStart],o=Qn(n)[a.crossAxisStart];return e?r-o:o-r}).filter((e,t,n)=>Qn(e)[a.crossAxisStart]===Qn(n[0])[a.crossAxisStart]);if(!l.length)return null;if(1===l.length)return l[0];const c=l.filter(e=>Pn(Qn(e)[a.start],Qn(e)[a.end])(t[a.line]));return 1===c.length?c[0]:c.length>1?c.sort((e,t)=>Qn(e)[a.start]-Qn(t)[a.start])[0]:l.sort((e,n)=>{const r=pn(t,gn(Qn(e))),o=pn(t,gn(Qn(n)));return r!==o?r-o:Qn(e)[a.start]-Qn(n)[a.start]})[0]})({isMovingForward:e,pageBorderBoxCenter:t,source:r,droppables:i,viewport:a});if(!l)return null;const c=On(l.descriptor.id,o),u=(({pageBorderBoxCenter:e,viewport:t,destination:n,insideDestination:r,afterCritical:o})=>{const i=r.filter(e=>$n({target:tr(e,o),destination:n,viewport:t.frame,withDroppableDisplacement:!0})).sort((t,r)=>{const i=dn(e,Hn(n,er(t,o))),a=dn(e,Hn(n,er(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}),d=(({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:An,displacedBy:Cn,at:{type:"REORDER",destination:{droppableId:i.descriptor.id,index:0}}},t=Yn({impact:e,draggable:r,droppable:i,draggables:o,afterCritical:s}),l=_n(r,i)?i:or(i,r,o);return Xn({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})(),u=nr(i.axis,r.displaceBy);return jn({draggable:r,insideDestination:n,destination:i,viewport:a,displacedBy:u,last:An,index:c})})({previousPageBorderBoxCenter:t,destination:l,draggable:n,draggables:o,moveRelativeTo:u,insideDestination:c,viewport:a,afterCritical:s});if(!d)return null;const p=Yn({impact:d,draggable:n,droppable:l,draggables:o,afterCritical:s});return{clientSelection:Jn({pageBorderBoxCenter:p,draggable:n,viewport:a}),impact:d,scrollJumpRequest:null}})({isMovingForward:s,previousPageBorderBoxCenter:c,draggable:l,isOver:o,draggables:u,droppables:d,viewport:e.viewport,afterCritical:e.afterCritical})})({state:e,type:t.type});return n?pr({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?zt(0,"Can only move into the DROP_PENDING phase from the COLLECTING phase"):zt()),{...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?zt(0,`Cannot animate drop from phase ${e.phase}`):zt()),{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 xr(e,t){return e instanceof Object&&"type"in e&&e.type===t}const Dr=e=>({type:"PUBLISH_WHILE_DRAGGING",payload:e}),Or=()=>({type:"COLLECTION_STARTING",payload:null}),wr=e=>({type:"UPDATE_DROPPABLE_SCROLL",payload:e}),Sr=e=>({type:"UPDATE_DROPPABLE_IS_ENABLED",payload:e}),Ir=e=>({type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:e}),_r=e=>({type:"MOVE",payload:e}),Cr=()=>({type:"MOVE_UP",payload:null}),Ar=()=>({type:"MOVE_DOWN",payload:null}),Tr=()=>({type:"MOVE_RIGHT",payload:null}),Pr=()=>({type:"MOVE_LEFT",payload:null}),Vr=e=>({type:"DROP_COMPLETE",payload:e}),kr=e=>({type:"DROP",payload:e}),Rr="cubic-bezier(.2,1,.1,1)",Br={outOfTheWay:.2,minDropTime:.33,maxDropTime:.55},Fr=`${Br.outOfTheWay}s cubic-bezier(0.2, 0, 0, 1)`,$r={fluid:`opacity ${Fr}`,snap:`transform ${Fr}, opacity ${Fr}`,drop:e=>{const t=`${e}s ${Rr}`;return`transform ${t}, opacity ${t}`},outOfTheWay:`transform ${Fr}`,placeholder:`height ${Fr}, width ${Fr}, margin ${Fr}`},Lr=e=>ln(e,on)?void 0:`translate(${e.x}px, ${e.y}px)`,Mr=Lr,{minDropTime:jr,maxDropTime:Gr}=Br,Ur=Gr-jr,Wr=({getState:e,dispatch:t})=>n=>r=>{if(!xr(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?zt(0,"A DROP action occurred while DROP_PENDING and still waiting"):zt()),"DRAGGING"!==o.phase&&"DROP_PENDING"!==o.phase&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,`Cannot drop in phase: ${o.phase}`):zt());const s=o.critical,l=o.dimensions,c=l.draggables[o.critical.draggable.id],{impact:u,didDropInsideDroppable:d}=(({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:An},didDropInsideDroppable:!0}:{impact:fr({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=d?wn(u):null,f=d?Sn(u):null,m={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},g=(({impact:e,draggable:t,dimensions:n,viewport:r,afterCritical:o})=>{const{draggables:i,droppables:a}=n,s=ir(e),l=mr({impact:e,draggable:t,draggables:i,afterCritical:o,droppable:(s?a[s]:null)||a[t.descriptor.droppableId],viewport:r});return sn(l,t.client.borderBox.center)})({impact:u,draggable:c,dimensions:l,viewport:o.viewport,afterCritical:o.afterCritical}),h={critical:o.critical,afterCritical:o.afterCritical,result:m,impact:u};if(ln(o.current.client.offset,g)&&!Boolean(m.combine))return void t(Vr({completed:h}));const b=(({current:e,destination:t,reason:n})=>{const r=dn(e,t);if(r<=0)return jr;if(r>=1500)return Gr;const o=jr+Ur*(r/1500);return Number(("CANCEL"===n?.6*o:o).toFixed(2))})({current:o.current.client.offset,destination:g,reason:i});t((e=>({type:"DROP_ANIMATE",payload:e}))({newHomeClientOffset:g,dropDuration:b,completed:h}))};var zr=()=>({x:window.pageXOffset,y:window.pageYOffset});const qr=e=>{const t=function({onWindowScroll:e}){const t=At(function(){e(zr())}),n=function(e){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:t=>{t.target!==window&&t.target!==window.document||e()}}}(t);let r=Mt;function o(){return r!==Mt}return{start:function(){o()&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot start scroll listener when already active"):zt()),r=jt(window,[n])},stop:function(){o()||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot stop scroll listener when not active"):zt()),t.cancel(),r(),r=Mt},isActive:o}}({onWindowScroll:t=>{e.dispatch({type:"MOVE_BY_WINDOW_SCROLL",payload:{newScroll:t}})}});return e=>n=>{!t.isActive()&&xr(n,"INITIAL_PUBLISH")&&t.start(),t.isActive()&&(e=>xr(e,"DROP_COMPLETE")||xr(e,"DROP_ANIMATE")||xr(e,"FLUSH"))(n)&&t.stop(),e(n)}},Hr=(e,t)=>{t()},Yr=(e,t)=>({draggableId:e.draggable.id,type:e.droppable.type,source:{droppableId:e.droppable.id,index:e.draggable.index},mode:t});function Kr(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&&$t("Announcement already made. Not making a second announcement"):n?"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&$t("\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 Zr=e=>t=>n=>{if(!xr(n,"DROP_ANIMATION_FINISHED"))return void t(n);const r=e.getState();"DROP_ANIMATING"!==r.phase&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot finish a drop animating when no drop is occurring"):zt()),e.dispatch(Vr({completed:r.completed}))},Jr=e=>{let t=null,n=null;return r=>o=>{if((xr(o,"FLUSH")||xr(o,"DROP_COMPLETE")||xr(o,"DROP_ANIMATION_FINISHED"))&&(n&&(cancelAnimationFrame(n),n=null),t&&(t(),t=null)),r(o),!xr(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=jt(window,[i])})}},Xr=e=>t=>n=>{if(t(n),!xr(n,"PUBLISH_WHILE_DRAGGING"))return;const r=e.getState();"DROP_PENDING"===r.phase&&(r.isWaiting||e.dispatch(kr({reason:r.reason})))},Qr="production"!=='{NODE_ENV:"production"}'.NODE_ENV&&"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({name:"@hello-pangea/dnd"}):oe;var eo=({scrollHeight:e,scrollWidth:t,height:n,width:r})=>{const o=sn({x:t,y:e},{x:r,y:n});return{x:Math.max(0,o.x),y:Math.max(0,o.y)}},to=()=>{const e=document.documentElement;return e||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot find document.documentElement"):zt()),e},no=()=>{const e=to();return eo({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,width:e.clientWidth,height:e.clientHeight})};function ro(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&&$t(`\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 oo=(e,t)=>"IDLE"===e.phase||"DROP_ANIMATING"===e.phase&&e.completed.result.draggableId!==t&&"DROP"===e.completed.result.reason,io=e=>{window.scrollBy(e.x,e.y)};const ao=vn(e=>xn(e).filter(e=>!!e.isEnabled&&!!e.frame)),so={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:e=>e**2,durationDampening:{stopDampeningAt:1200,accelerateAt:360},disabled:!1};var lo=({startOfRange:e,endOfRange:t,current:n})=>{const r=t-e;return 0===r?("production"!=='{NODE_ENV:"production"}'.NODE_ENV&&$t("\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},co=({distanceToEdge:e,thresholds:t,dragStartTime:n,shouldUseTimeDampening:r,getAutoScrollerOptions:o})=>{const i=((e,t,n=()=>so)=>{const r=n();if(e>t.startScrollingFrom)return 0;if(e<=t.maxScrollValueAt)return r.maxPixelScroll;if(e===t.startScrollingFrom)return 1;const o=lo({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=lo({startOfRange:o,endOfRange:s,current:l}),u=e*r.ease(c);return Math.ceil(u)})(i,n,o),1):i},uo=({container:e,distanceToEdges:t,dragStartTime:n,axis:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const a=((e,t,n=()=>so)=>{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]?co({distanceToEdge:t[r.end],thresholds:a,dragStartTime:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i}):-1*co({distanceToEdge:t[r.start],thresholds:a,dragStartTime:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i})};const po=fn(e=>0===e?0:e);var fo=({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=uo({container:t,distanceToEdges:a,dragStartTime:e,axis:Rn,shouldUseTimeDampening:o,getAutoScrollerOptions:i}),l=uo({container:t,distanceToEdges:a,dragStartTime:e,axis:Bn,shouldUseTimeDampening:o,getAutoScrollerOptions:i}),c=po({x:l,y:s});if(ln(c,on))return null;const u=(({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 u?ln(u,on)?null:u:null};const mo=fn(e=>0===e?0:e>0?1:-1),go=(()=>{const e=(e,t)=>e<0?e:e>t?e-t:0;return({current:t,max:n,change:r})=>{const o=an(t,r),i={x:e(o.x,n.x),y:e(o.y,n.y)};return ln(i,on)?null:i}})(),ho=({max:e,current:t,change:n})=>{const r={x:Math.max(t.x,e.x),y:Math.max(t.y,e.y)},o=mo(n),i=go({max:r,current:t,change:o});return!i||0!==o.x&&0===i.x||0!==o.y&&0===i.y},bo=(e,t)=>ho({current:e.scroll.current,max:e.scroll.max,change:t}),Eo=(e,t)=>{const n=e.frame;return!!n&&ho({current:n.scroll.current,max:n.scroll.max,change:t})};var vo=({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=fo({dragStartTime:r,container:e.frame,subject:t,center:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i});return a&&bo(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=ao(t).find(t=>(t.frame||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Invalid result"):zt()),sr(t.frame.pageMarginBox)(e)))||null;return n})(e,n);return r})({center:a,destination:ir(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=fo({dragStartTime:r,container:a.pageMarginBox,subject:t,center:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i});return s&&Eo(e,s)?s:null})({dragStartTime:t,droppable:l,subject:s,center:a,shouldUseTimeDampening:n,getAutoScrollerOptions:i});c&&o(l.descriptor.id,c)};const yo="data-rfd",No=(()=>{const e=`${yo}-drag-handle`;return{base:e,draggableId:`${e}-draggable-id`,contextId:`${e}-context-id`}})(),xo=(()=>{const e=`${yo}-draggable`;return{base:e,contextId:`${e}-context-id`,id:`${e}-id`}})(),Do=(()=>{const e=`${yo}-droppable`;return{base:e,contextId:`${e}-context-id`,id:`${e}-id`}})(),Oo={contextId:`${yo}-scroll-container-context-id`},wo=(e,t)=>e.map(e=>{const n=e.styles[t];return n?`${e.selector} { ${n} }`:""}).join(" "),So="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?zt(0,"Cannot find the head to append a style to"):zt()),e},_o=e=>{const t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.type="text/css",t};function Co(e,t){return Array.from(e.querySelectorAll(t))}var Ao=e=>e&&e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView:window;function To(e){return e instanceof Ao(e).HTMLElement}function Po(e,t){const n=Co(document,`[${No.contextId}="${e}"]`);if(!n.length)return"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&$t(`Unable to find any drag handles in the context "${e}"`),null;const r=n.find(e=>e.getAttribute(No.draggableId)===t);return r?To(r)?r:("production"!=='{NODE_ENV:"production"}'.NODE_ENV&&$t("drag handle needs to be a HTMLElement"),null):("production"!=='{NODE_ENV:"production"}'.NODE_ENV&&$t(`Unable to find drag handle with id "${t}" as no handle with a matching id was found`),null)}function Vo(){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?zt(0,`Cannot find draggable entry with id [${e}]`):zt()),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?zt(0,`Cannot find droppable entry with id [${e}]`):zt()),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 ko=m.default.createContext(null),Ro=()=>{const e=document.body;return e||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot find document.body"):zt()),e};const Bo={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},Fo={separator:"::"};function $o(e,t=Fo){const n=m.default.useId();return nn(()=>`${e}${t.separator}${n}`,[t.separator,e,n])}var Lo=m.default.createContext(null);const Mo=/(\d+)\.(\d+)\.(\d+)/,jo=e=>{const t=Mo.exec(e);return null==t&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,`Unable to parse React version ${e}`):zt()),{major:Number(t[1]),minor:Number(t[2]),patch:Number(t[3]),raw:e}},Go="\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 Uo(e){"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&e()}function Wo(t,n){Uo(()=>{e.useEffect(()=>{try{t()}catch(e){Lt(`\n A setup problem was encountered.\n\n > ${e.message}\n `)}},n)})}function zo(t){const n=e.useRef(t);return e.useEffect(()=>{n.current=t}),n}function qo(e){return"IDLE"!==e.phase&&"DROP_ANIMATING"!==e.phase&&e.isDragging}const Ho=9,Yo=13,Ko=33,Zo=34,Jo=35,Xo=36,Qo={[Yo]:!0,[Ho]:!0};var ei=e=>{Qo[e.keyCode]&&e.preventDefault()};const ti=(()=>{const e="visibilitychange";return"undefined"==typeof document?e:[e,`ms${e}`,`webkit${e}`,`moz${e}`,`o${e}`].find(e=>`on${e}`in document)||e})(),ni={type:"IDLE"};function ri(){}const oi={[Zo]:!0,[Ko]:!0,[Xo]:!0,[Jo]:!0},ii={type:"IDLE"},ai=["input","button","textarea","select","option","optgroup","video","audio"];function si(e,t){if(null==t)return!1;if(ai.includes(t.tagName.toLowerCase()))return!0;const n=t.getAttribute("contenteditable");return"true"===n||""===n||t!==e&&si(e,t.parentElement)}function li(e,t){const n=t.target;return!!To(n)&&si(e,n)}var ci=e=>yt(e.getBoundingClientRect()).center;const ui=(()=>{const e="matches";return"undefined"==typeof document?e:[e,"msMatchesSelector","webkitMatchesSelector"].find(e=>e in Element.prototype)||e})();function di(e,t){return null==e?null:e[ui](t)?e:di(e.parentElement,t)}function pi(e,t){return e.closest?e.closest(t):di(e,t)}function fi(e){e.preventDefault()}function mi({expected:e,phase:t,isLockActive:n,shouldWarn:r}){return n()?e===t||(r&&"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&$t(`\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&&$t("\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 gi({lockAPI:e,store:t,registry:n,draggableId:r}){if(e.isClaimed())return!1;const o=n.draggable.findById(r);return o?!!o.options.isEnabled&&!!oo(t.getState(),r):("production"!=='{NODE_ENV:"production"}'.NODE_ENV&&$t(`Unable to find draggable with id: ${r}`),!1)}const hi=[function(t){const n=e.useRef(ni),r=e.useRef(Mt),o=nn(()=>({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(),u(o,i)}}),[t]),i=nn(()=>({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=rn(function(){r.current=jt(window,[i,o],{passive:!1,capture:!0})},[i,o]),s=rn(()=>{"IDLE"!==n.current.type&&(n.current=ni,r.current(),a())},[a]),l=rn(()=>{const e=n.current;s(),"DRAGGING"===e.type&&e.actions.cancel({shouldBlockNextClick:!0}),"PENDING"===e.type&&e.actions.abort()},[s]),c=rn(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?zt(0,"Cannot be IDLE"):zt()),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 u=s.actions.fluidLift(a);r({type:"DRAGGING",actions:u})}},{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 ei(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?zt(0,"Unexpected phase"):zt()),r.actions.shouldRespectForcePress()?e():t.preventDefault()}},{eventName:ti,fn:e}]}({cancel:l,completed:s,getPhase:()=>n.current,setPhase:e=>{n.current=e}});r.current=jt(window,e,{capture:!0,passive:!1})},[l,s]),u=rn(function(e,t){"IDLE"!==n.current.type&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Expected to move from IDLE to PENDING drag"):zt()),n.current={type:"PENDING",point:t,actions:e},c()},[c]);So(function(){return a(),function(){r.current()}},[a])},function(t){const n=e.useRef(ri),r=nn(()=>({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?zt(0,"Cannot stop capturing a keyboard drag when not capturing"):zt()),a=!1,n.current(),o()}n.current(),n.current=jt(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(oi[r.keyCode]?r.preventDefault():ei(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:ti,fn:n}]}(s,l),{capture:!0,passive:!1})}}),[t]),o=rn(function(){n.current=jt(window,[r],{passive:!1,capture:!0})},[r]);So(function(){return o(),function(){n.current()}},[o])},function(t){const n=e.useRef(ii),r=e.useRef(Mt),o=rn(function(){return n.current},[]),i=rn(function(e){n.current=e},[]),a=nn(()=>({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=rn(function(){r.current=jt(window,[a],{capture:!0,passive:!1})},[a]),l=rn(()=>{const e=n.current;"IDLE"!==e.type&&("PENDING"===e.type&&clearTimeout(e.longPressTimerId),i(ii),r.current(),s())},[s,i]),c=rn(()=>{const e=n.current;l(),"DRAGGING"===e.type&&e.actions.cancel({shouldBlockNextClick:!0}),"PENDING"===e.type&&e.actions.abort()},[l]),u=rn(function(){const e={capture:!0,passive:!1},t={cancel:c,completed:l,getPhase:o},n=jt(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&&zt();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:ti,fn:e}]}(t),e),i=jt(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:ti,fn:e}]}(t),e);r.current=function(){n(),i()}},[c,o,l]),d=rn(function(){const e=o();"PENDING"!==e.type&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,`Cannot start dragging from phase ${e.type}`):zt());const t=e.actions.fluidLift(e.point);i({type:"DRAGGING",actions:t,hasMoved:!1})},[o,i]),p=rn(function(e,t){"IDLE"!==o().type&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Expected to move from IDLE to PENDING drag"):zt());const n=setTimeout(d,120);i({type:"PENDING",point:t,actions:e,longPressTimerId:n}),u()},[u,o,i,d]);So(function(){return s(),function(){r.current();const e=o();"PENDING"===e.type&&(clearTimeout(e.longPressTimerId),i(ii))}},[o,s,i]),So(function(){return jt(window,[{eventName:"touchmove",fn:()=>{},options:{capture:!1,passive:!1}}])},[])}];function bi({contextId:t,store:n,registry:r,customSensors:o,enableDefaultSensors:i}){const a=[...i?hi:[],...o||[]],s=e.useState(()=>function(){let e=null;function t(){e||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot release lock when there is no lock"):zt()),e=null}return{isClaimed:function(){return Boolean(e)},isActive:function(t){return t===e},claim:function(t){e&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot claim lock as it is already claimed"):zt());const n={abandon:t};return e=n,n},release:t,tryAbandon:function(){e&&(e.abandon(),t())}}}())[0],l=rn(function(e,t){qo(e)&&!qo(t)&&s.tryAbandon()},[s]);So(function(){let e=n.getState();return n.subscribe(()=>{const t=n.getState();l(e,t),e=t})},[s,n,l]),So(()=>s.tryAbandon,[s.tryAbandon]);const c=rn(e=>gi({lockAPI:s,registry:r,store:n,draggableId:e}),[s,r,n]),u=rn((e,o,i)=>function({lockAPI:e,contextId:t,store:n,registry:r,draggableId:o,forceSensorStop:i,sourceEvent:a}){if(!gi({lockAPI:e,store:n,registry:r,draggableId:o}))return null;const s=r.draggable.getById(o),l=function(e,t){const n=Co(document,`[${xo.contextId}="${e}"]`).find(e=>e.getAttribute(xo.id)===t);return n?To(n)?n:("production"!=='{NODE_ENV:"production"}'.NODE_ENV&&$t("Draggable element is not a HTMLElement"),null):null}(t,s.descriptor.id);if(!l)return"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&$t(`Unable to find draggable element with id: ${o}`),null;if(a&&!s.options.canDragInteractiveElements&&li(l,a))return null;const c=e.claim(i||Mt);let u="PRE_DRAG";function d(){return s.options.shouldRespectForcePress}function p(){return e.isActive(c)}const f=function(e,t){mi({expected:e,phase:u,isLockActive:p,shouldWarn:!0})&&n.dispatch(t())}.bind(null,"DRAGGING");function m(t){function r(){e.release(),u="COMPLETED"}function o(e,o={shouldBlockNextClick:!1}){if(t.cleanup(),o.shouldBlockNextClick){const e=jt(window,[{eventName:"click",fn:fi,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(e)}r(),n.dispatch(kr({reason:e}))}return"PRE_DRAG"!==u&&(r(),"production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,`Cannot lift in phase ${u}`):zt()),n.dispatch((e=>({type:"LIFT",payload:e}))(t.liftActionArgs)),u="DRAGGING",{isActive:()=>mi({expected:"DRAGGING",phase:u,isLockActive:p,shouldWarn:!1}),shouldRespectForcePress:d,drop:e=>o("DROP",e),cancel:e=>o("CANCEL",e),...t.actions}}return{isActive:()=>mi({expected:"PRE_DRAG",phase:u,isLockActive:p,shouldWarn:!1}),shouldRespectForcePress:d,fluidLift:function(e){const t=At(e=>{f(()=>_r({client:e}))});return{...m({liftActionArgs:{id:o,clientSelection:e,movementMode:"FLUID"},cleanup:()=>t.cancel(),actions:{move:t}}),move:t}},snapLift:function(){const e={moveUp:()=>f(Cr),moveRight:()=>f(Tr),moveDown:()=>f(Ar),moveLeft:()=>f(Pr)};return m({liftActionArgs:{id:o,clientSelection:ci(l),movementMode:"SNAP"},cleanup:Mt,actions:e})},abort:function(){mi({expected:"PRE_DRAG",phase:u,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]),d=rn(e=>function(e,t){const n=function(e,t){const n=t.target;if(!((r=n)instanceof Ao(r).Element))return"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&$t("event.target must be a Element"),null;var r;const o=function(e){return`[${No.contextId}="${e}"]`}(e),i=pi(n,o);return i?To(i)?i:("production"!=='{NODE_ENV:"production"}'.NODE_ENV&&$t("drag handle must be a HTMLElement"),null):null}(e,t);return n?n.getAttribute(No.draggableId):null}(t,e),[t]),p=rn(e=>{const t=r.draggable.findById(e);return t?t.options:null},[r.draggable]),f=rn(function(){s.isClaimed()&&(s.tryAbandon(),"IDLE"!==n.getState().phase&&n.dispatch({type:"FLUSH",payload:null}))},[s,n]),m=rn(()=>s.isClaimed(),[s]),g=nn(()=>({canGetLock:c,tryGetLock:u,findClosestDraggableId:d,findOptionsForDraggable:p,tryReleaseLock:f,isLockClaimed:m}),[c,u,d,p,f,m]);var h;h=a,Uo(()=>{const e=zo(h);Wo(()=>{e.current.length!==h.length&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot change the amount of sensor hooks after mounting"):zt())})});for(let e=0;e<a.length;e++)a[e](g)}function Ei(e){return e.current||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Could not find store from lazy ref"):zt()),e.current}function vi(t){const{contextId:n,setCallbacks:r,sensors:o,nonce:i,dragHandleUsageInstructions:a}=t,l=e.useRef(null);Wo(()=>{((e,t)=>{const n=jo("^18.0.0 || ^19.0.0"),r=jo(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&&$t(`\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,m.default.version),(()=>{const e=document.doctype;e?("html"!==e.name.toLowerCase()&&"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&$t(`\n Unexpected <!doctype> found: (${e.name})\n\n ${Go}\n `),""!==e.publicId&&"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&$t(`\n Unexpected <!doctype> publicId found: (${e.publicId})\n A html5 doctype does not have a publicId\n\n ${Go}\n `)):"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&$t(`\n No <!doctype html> found.\n\n ${Go}\n `)})()},[]);const c=zo(t),u=rn(()=>(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]),d=rn(()=>(e=>({...so,...e.autoScrollerOptions,durationDampening:{...so.durationDampening,...e.autoScrollerOptions}}))(c.current),[c]),p=function(t){const n=nn(()=>(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"),Tt(e.style,Bo),Ro().appendChild(e),function(){setTimeout(function(){const t=Ro();t.contains(e)&&t.removeChild(e),e===r.current&&(r.current=null)})}},[n]),rn(e=>{const t=r.current;t?t.textContent=e:"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&$t(`\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=$o("hidden-text",{separator:"-"}),o=nn(()=>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",Ro().appendChild(e),function(){const t=Ro();t.contains(e)&&t.removeChild(e)}},[o,n]),o}({contextId:n,text:a}),g=function(t,n){const r=nn(()=>(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(No.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: ${$r.outOfTheWay};\n `;return{selector:t(xo.contextId),styles:{dragging:e,dropAnimating:e,userCancel:e}}})(),r,{selector:t(Do.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:wo(o,"always"),resting:wo(o,"resting"),dragging:wo(o,"dragging"),dropAnimating:wo(o,"dropAnimating"),userCancel:wo(o,"userCancel")}})(t),[t]),o=e.useRef(null),i=e.useRef(null),a=rn(vn(e=>{const t=i.current;t||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot set dynamic style element if it is not set"):zt()),t.textContent=e}),[]),s=rn(e=>{const t=o.current;t||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot set dynamic style element if it is not set"):zt()),t.textContent=e},[]);So(()=>{(o.current||i.current)&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"style elements already mounted"):zt());const e=_o(n),l=_o(n);return o.current=e,i.current=l,e.setAttribute(`${yo}-always`,t),l.setAttribute(`${yo}-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?zt(0,"Cannot unmount ref as it is not set"):zt()),Io().removeChild(t),e.current=null};e(o),e(i)}},[n,s,a,r.always,r.resting,t]);const l=rn(()=>a(r.dragging),[a,r.dragging]),c=rn(e=>{a("DROP"!==e?r.userCancel:r.dropAnimating)},[a,r.dropAnimating,r.userCancel]),u=rn(()=>{i.current&&a(r.resting)},[a,r.resting]);return nn(()=>({dragging:l,dropping:c,resting:u}),[l,c,u])}(n,i),h=rn(e=>{Ei(l).dispatch(e)},[]),b=nn(()=>re({publishWhileDragging:Dr,updateDroppableScroll:wr,updateDroppableIsEnabled:Sr,updateDroppableIsCombineEnabled:Ir,collectionStarting:Or},h),[h]),E=function(){const t=nn(Vo,[]);return e.useEffect(()=>function(){t.clean()},[t]),t}(),v=nn(()=>((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(on)).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?zt(0,"Should only be subscribed when a collection is occurring"):zt());const o=n.critical.draggable;"ADDITION"===t.type&&ro(e,o,t.value)&&r.add(t.value),"REMOVAL"===t.type&&ro(e,o,t.value)&&r.remove(t.value)},i={updateDroppableIsEnabled:(r,o)=>{e.droppable.exists(r)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,`Cannot update is enabled flag of Droppable ${r} as it is not registered`):zt()),n&&t.updateDroppableIsEnabled({id:r,isEnabled:o})},updateDroppableIsCombineEnabled:(r,o)=>{n&&(e.droppable.exists(r)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,`Cannot update isCombineEnabled flag of Droppable ${r} as it is not registered`):zt()),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?zt(0,`Cannot update the scroll on Droppable ${r} as it is not registered`):zt()),t.updateDroppableScroll({id:r,newScroll:o}))},startPublishing:t=>{n&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot start capturing critical dimensions as there is already a collection"):zt());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=zr(),t=no(),n=e.y,r=e.x,o=to();return{frame:yt({top:n,left:r,right:r+o.clientWidth,bottom:n+o.clientHeight}),scroll:{initial:e,current:e,max:t,diff:{value:on,displacement:on}}}})(),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:Nn(a),droppables:yn(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=nn(()=>(({scrollDroppable:e,scrollWindow:t,move:n,getAutoScrollerOptions:r})=>{const o=(({scrollWindow:e,scrollDroppable:t,getAutoScrollerOptions:n=()=>so})=>{const r=At(e),o=At(t);let i=null;const a=e=>{i||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot fluid scroll if not dragging"):zt());const{shouldUseTimeDampening:t,dragStartTime:a}=i;vo({state:e,scrollWindow:r,scrollDroppable:o,dragStartTime:a,shouldUseTimeDampening:t,getAutoScrollerOptions:n})};return{start:e=>{i&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot start auto scrolling when already started"):zt());const t=Date.now();let r=!1;const o=()=>{r=!0};vo({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=ir(r.impact);i||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot perform a jump scroll when there is no destination"):zt());const a=((e,n)=>{if(!Eo(e,n))return n;const r=((e,t)=>{const n=e.frame;return n&&Eo(e,t)?go({current:n.scroll.current,max:n.scroll.max,change:t}):null})(e,n);if(!r)return t(e.descriptor.id,n),null;const o=sn(n,r);return t(e.descriptor.id,o),sn(n,o)})(r.dimensions.droppables[i],o);if(!a)return;const s=((e,t,r)=>{if(!e)return r;if(!bo(t,r))return r;const o=((e,t)=>bo(e,t)?go({current:e.scroll.current,max:e.scroll.max,change:t}):null)(t,r);if(!o)return n(r),null;const i=sn(r,o);return n(i),sn(r,i)})(r.isWindowScrollAllowed,r.viewport,a);s&&((t,n)=>{const r=an(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:io,scrollDroppable:v.scrollDroppable,getAutoScrollerOptions:d,...re({move:_r},h)}),[v.scrollDroppable,h,d]),N=function(t){const n=e.useRef({}),r=e.useRef(null),o=e.useRef(null),i=e.useRef(!1),a=rn(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=rn(function(e){const n=Po(t,e);n&&n!==document.activeElement&&n.focus()},[t]),l=rn(function(e,t){r.current===e&&(r.current=t)},[]),c=rn(function(){o.current||i.current&&(o.current=requestAnimationFrame(()=>{o.current=null;const e=r.current;e&&s(e)}))},[s]),u=rn(function(e){r.current=null;const t=document.activeElement;t&&t.getAttribute(No.draggableId)===e&&(r.current=e)},[]);return So(()=>(i.current=!0,function(){i.current=!1;const e=o.current;e&&cancelAnimationFrame(e)}),[]),nn(()=>({register:a,tryRecordFocus:u,tryRestoreFocusRecorded:c,tryShiftRecord:l}),[a,u,c,l])}(n),x=nn(()=>(({dimensionMarshal:e,focusMarshal:t,styleMarshal:n,getResponders:r,announce:o,autoScroller:i})=>{return te(Nr,Qr(function(...e){return t=>(n,r)=>{const o=t(n,r);let i=()=>{throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?Z(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=oe(...s)(o.dispatch),{...o,dispatch:i}}}((a=n,()=>e=>t=>{xr(t,"INITIAL_PUBLISH")&&a.dragging(),xr(t,"DROP_ANIMATE")&&a.dropping(t.payload.completed.result.reason),(xr(t,"FLUSH")||xr(t,"DROP_COMPLETE"))&&a.resting(),e(t)}),(e=>()=>t=>n=>{(xr(n,"DROP_COMPLETE")||xr(n,"FLUSH")||xr(n,"DROP_ANIMATE"))&&e.stopPublishing(),t(n)})(e),(e=>({getState:t,dispatch:n})=>r=>o=>{if(!xr(o,"LIFT"))return void r(o);const{id:i,clientSelection:a,movementMode:s}=o.payload,l=t();"DROP_ANIMATING"===l.phase&&n(Vr({completed:l.completed})),"IDLE"!==t().phase&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Unexpected phase to start a drag"):zt()),n({type:"FLUSH",payload:null}),n({type:"BEFORE_INITIAL_CAPTURE",payload:{draggableId:i,movementMode:s}});const c={draggableId:i,scrollOptions:{shouldPublishImmediately:"SNAP"===s}},{critical:u,dimensions:d,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&&$t(`\n Detected non-consecutive <Draggable /> indexes.\n\n (This can cause unexpected bugs)\n\n ${r}\n `)}(On(e.droppable.id,t.draggables))})(u,d),n({type:"INITIAL_PUBLISH",payload:{critical:u,dimensions:d,clientSelection:a,movementMode:s,viewport:p}})})(e),Wr,Zr,Jr,Xr,(e=>t=>n=>r=>{if((e=>xr(e,"DROP_COMPLETE")||xr(e,"DROP_ANIMATE")||xr(e,"FLUSH"))(r))return e.stop(),void n(r);if(xr(r,"INITIAL_PUBLISH")){n(r);const o=t.getState();return"DRAGGING"!==o.phase&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Expected phase to be DRAGGING after INITIAL_PUBLISH"):zt()),void e.start(o)}n(r),e.scroll(t.getState())})(i),qr,(e=>{let t=!1;return()=>n=>r=>{if(xr(r,"INITIAL_PUBLISH"))return t=!0,e.tryRecordFocus(r.payload.critical.draggable.id),n(r),void e.tryRestoreFocusRecorded();if(n(r),t){if(xr(r,"FLUSH"))return t=!1,void e.tryRestoreFocusRecorded();if(xr(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?zt(0,"Could not find timer"):zt());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?zt(0,"Cannot fire onDragEnd when there is no matching onDragStart"):zt()),r=null,Hr(0,()=>Kr(e().onDragEnd,n,t,Qt))};return{beforeCapture:(t,n)=>{r&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot fire onBeforeCapture as a drag start has already been published"):zt()),Hr(0,()=>{const r=e().onBeforeCapture;r&&r({draggableId:t,mode:n})})},beforeStart:(t,n)=>{r&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot fire onBeforeDragStart as a drag start has already been published"):zt()),Hr(0,()=>{const r=e().onBeforeDragStart;r&&r(Yr(t,n))})},start:(o,i)=>{r&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot fire onBeforeDragStart as a drag start has already been published"):zt());const a=Yr(o,i);r={mode:i,lastCritical:o,lastLocation:a.source,lastCombine:null},n.add(()=>{Hr(0,()=>Kr(e().onDragStart,a,t,Jt))})},update:(o,i)=>{const a=wn(i),s=Sn(i);r||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot fire onDragMove when onDragStart has not been called"):zt());const l=!((c=o)===(u=r.lastCritical)||c.draggable.id===u.draggable.id&&c.draggable.droppableId===u.draggable.droppableId&&c.draggable.type===u.draggable.type&&c.draggable.index===u.draggable.index&&c.droppable.id===u.droppable.id&&c.droppable.type===u.droppable.type);var c,u;l&&(r.lastCritical=o);const d=!((e,t)=>null==e&&null==t||null!=e&&null!=t&&e.droppableId===t.droppableId&&e.index===t.index)(r.lastLocation,a);d&&(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&&!d&&!p)return;const f={...Yr(o,r.mode),combine:s,destination:a};n.add(()=>{Hr(0,()=>Kr(e().onDragUpdate,f,t,Xt))})},flush:()=>{r||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Can only flush responders while dragging"):zt()),n.flush()},drop:o,abort:()=>{if(!r)return;const e={...Yr(r.lastCritical,r.mode),combine:null,destination:null,reason:"CANCEL"};o(e)}}})(e,t);return e=>t=>r=>{if(xr(r,"BEFORE_INITIAL_CAPTURE"))return void n.beforeCapture(r.payload.draggableId,r.payload.movementMode);if(xr(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(xr(r,"DROP_COMPLETE")){const e=r.payload.completed.result;return n.flush(),t(r),void n.drop(e)}if(t(r),xr(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:u,styleMarshal:g}),[p,y,v,N,u,g]);"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&l.current&&l.current!==x&&"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&$t("unexpected store change"),l.current=x;const D=rn(()=>{const e=Ei(l);"IDLE"!==e.getState().phase&&e.dispatch({type:"FLUSH",payload:null})},[]),O=rn(()=>{const e=Ei(l).getState();return"DROP_ANIMATING"===e.phase||"IDLE"!==e.phase&&e.isDragging},[]);r(nn(()=>({isDragging:O,tryAbort:D}),[O,D]));const w=rn(e=>oo(Ei(l).getState(),e),[]),S=rn(()=>ar(Ei(l).getState()),[]),I=nn(()=>({marshal:v,focus:N,contextId:n,canLift:w,isMovementAllowed:S,dragHandleUsageInstructionsId:f,registry:E}),[n,v,f,N,w,S,E]);return bi({contextId:n,store:x,registry:E,customSensors:o||null,enableDefaultSensors:!1!==t.enableDefaultSensors}),e.useEffect(()=>D,[D]),m.default.createElement(Lo.Provider,{value:I},m.default.createElement(ht,{context:ko,store:x},t.children))}function yi(e){const t=m.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 m.default.createElement(qt,null,r=>m.default.createElement(vi,{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 Ni=(e,t)=>t?$r.drop(t.duration):e?$r.snap:$r.fluid,xi=(e,t)=>{if(e)return t?0:.7};var Di=m.default.createContext(null);function Oi(e){e&&To(e)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(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 "):zt())}function wi(t){const n=e.useContext(t);return n||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Could not find required context"):zt()),n}function Si(e){e.preventDefault()}var Ii=(e,t)=>e===t,_i=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 Ai={mapped:{type:"SECONDARY",offset:on,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:Ci(null)}},Ti=gt(()=>{const e=function(){const e=vn((e,t)=>({x:e,y:t})),t=vn((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=vn((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(qo(r)){if(r.critical.draggable.id!==o.draggableId)return null;const t=r.current.client.offset,a=r.dimensions.draggables[o.draggableId],s=ir(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=_i(a),c=(e=>e.combine?e.combine.draggableId:null)(a),u={duration:r.dropDuration,curve:Rr,moveTo:r.newHomeClientOffset,opacity:c?0:null,scale:c?.75:null};return{mapped:{type:"DRAGGING",offset:r.newHomeClientOffset,dimension:i,dropping:u,draggingOver:l,combineWith:c,mode:s,forceShouldAnimate:null,snapshot:t(s,n,l,c,u)}}}return null}}(),t=function(){const e=vn((e,t)=>({x:e,y:t})),t=vn(Ci),n=vn((e,n=null,r)=>({mapped:{type:"SECONDARY",offset:e,combineTargetFor:n,shouldAnimateDisplacement:r,snapshot:t(n)}})),r=e=>e?n(on,e,!0):null,o=(t,o,i,a)=>{const s=i.displaced.visible[t],l=Boolean(a.inVirtualList&&a.effected[t]),c=Sn(i),u=c&&c.draggableId===t?o:null;if(!s){if(!l)return r(u);if(i.displaced.invisible[t])return null;const o=cn(a.displacedBy.point),s=e(o.x,o.y);return n(s,u,!0)}if(l)return r(u);const d=i.displacedBy.point,p=e(d.x,d.y);return n(p,u,s.shouldAnimate)};return(e,t)=>{if(qo(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)||Ai},{dropAnimationFinished:()=>({type:"DROP_ANIMATION_FINISHED",payload:null})},null,{context:ko,areStatePropsEqual:Ii})(t=>{const n=e.useRef(null),r=rn((e=null)=>{n.current=e},[]),o=rn(()=>n.current,[]),{contextId:i,dragHandleUsageInstructionsId:a,registry:l}=wi(Lo),{type:c,droppableId:u}=wi(Di),d=nn(()=>({id:t.draggableId,index:t.index,type:c,droppableId:u}),[t.draggableId,t.index,c,u]),{children:p,draggableId:f,isEnabled:g,shouldRespectForcePress:h,canDragInteractiveElements:b,isClone:E,mapped:v,dropAnimationFinished:y}=t;(function(e,t,n){Wo(()=>{function r(e){return`Draggable[id: ${e}]: `}const o=e.draggableId;o||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Draggable requires a draggableId"):zt()),"string"!=typeof o&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,`Draggable requires a [string] draggableId.\n Provided: [type: ${typeof o}] (value: ${o})`):zt()),Number.isInteger(e.index)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,`${r(o)} requires an integer index prop`):zt()),"DRAGGING"!==e.mapped.type&&(Oi(n()),e.isEnabled&&(Po(t,o)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,`${r(o)} Unable to find drag handle`):zt())))})})(t,i,o),function(t){Uo(()=>{const n=e.useRef(t);Wo(()=>{t!==n.current&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Draggable isClone prop value changed during component life"):zt())},[t])})}(E),E||function(t){const n=$o("draggable"),{descriptor:r,registry:o,getDraggableRef:i,canDragInteractiveElements:a,shouldRespectForcePress:s,isEnabled:l}=t,c=nn(()=>({canDragInteractiveElements:a,shouldRespectForcePress:s,isEnabled:l}),[a,l,s]),u=rn(e=>{const t=i();return t||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot get dimension when no ref is set"):zt()),function(e,t,n=on){const r=window.getComputedStyle(t),o=t.getBoundingClientRect(),i=_t(o,r),a=It(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]),d=nn(()=>({uniqueId:n,descriptor:r,options:c,getDimension:u}),[r,u,c,n]),p=e.useRef(d),f=e.useRef(!0);So(()=>(o.draggable.register(p.current),()=>o.draggable.unregister(p.current)),[o.draggable]),So(()=>{if(f.current)return void(f.current=!1);const e=p.current;p.current=d,o.draggable.update(d,e)},[d,o.draggable])}(nn(()=>({descriptor:d,registry:l,getDraggableRef:o,canDragInteractiveElements:b,shouldRespectForcePress:h,isEnabled:g}),[d,l,o,b,h,g]));const N=nn(()=>g?{tabIndex:0,role:"button","aria-describedby":a,"data-rfd-drag-handle-draggable-id":f,"data-rfd-drag-handle-context-id":i,draggable:!1,onDragStart:Si}:null,[i,a,f,g]),x=rn(e=>{"DRAGGING"===v.type&&v.dropping&&"transform"===e.propertyName&&s.flushSync(y)},[y,v]),D=nn(()=>{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=Lr(e);if(n)return t?`${n} scale(0.75)`:n})(n,i):Mr(n);return{position:"fixed",top:t.marginBox.top,left:t.marginBox.left,boxSizing:"border-box",width:t.borderBox.width,height:t.borderBox.height,transition:Ni(a,o),transform:l,opacity:xi(i,s),zIndex:s?4500:5e3,pointerEvents:"none"}}(e):{transform:Mr((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?x:void 0},dragHandleProps:N}},[i,N,f,v,x,r]),O=nn(()=>({draggableId:d.id,type:d.type,source:{index:d.index,droppableId:d.droppableId}}),[d.droppableId,d.id,d.index,d.type]);return m.default.createElement(m.default.Fragment,null,p(D,v.snapshot,O))});function Pi(e){return wi(Di).isUsingCloneFor!==e.draggableId||e.isClone?m.default.createElement(Ti,e):null}function Vi(e){const t="boolean"!=typeof e.isDragDisabled||!e.isDragDisabled,n=Boolean(e.disableInteractiveElementBlocking),r=Boolean(e.shouldRespectForcePress);return m.default.createElement(Pi,Tt({},e,{isClone:!1,isEnabled:t,canDragInteractiveElements:n,shouldRespectForcePress:r}))}const ki=e=>t=>e===t,Ri=ki("scroll"),Bi=ki("auto"),Fi=ki("visible"),$i=(e,t)=>t(e.overflowX)||t(e.overflowY),Li=e=>{const t=window.getComputedStyle(e),n={overflowX:t.overflowX,overflowY:t.overflowY};return $i(n,Ri)||$i(n,Bi)},Mi=e=>null==e?null:e===document.body?(()=>{if("production"==='{NODE_ENV:"production"}'.NODE_ENV)return!1;const e=Ro(),t=document.documentElement;if(t||zt(),!Li(e))return!1;const n=window.getComputedStyle(t);return(o=Fi)((r={overflowX:n.overflowX,overflowY:n.overflowY}).overflowX)&&o(r.overflowY)||"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&$t("\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:Li(e)?e:Mi(e.parentElement);var ji=e=>({x:e.scrollLeft,y:e.scrollTop});const Gi=e=>!!e&&("fixed"===window.getComputedStyle(e).position||Gi(e.parentElement)),Ui={passive:!1},Wi={passive:!0};var zi=e=>e.shouldPublishImmediately?Ui:Wi;const qi=e=>e&&e.env.closestScrollable||null;function Hi(){}const Yi={width:0,height:0,margin:{top:0,right:0,bottom:0,left:0}};var Ki=m.default.memo(t=>{const n=e.useRef(null),r=rn(()=>{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),Hi):n.current?Hi:(n.current=setTimeout(()=>{n.current=null,c(!1)}),r):Hi,[o,l,r]);const u=rn(e=>{"height"===e.propertyName&&(i(),"close"===o&&a())},[o,a,i]),d=(({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>{const r=(({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>e||"close"===n?Yi:{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?$r.placeholder:null}})({isAnimatingOpenOnMount:l,animate:t.animate,placeholder:t.placeholder});return m.default.createElement(t.placeholder.tagName,{style:d,"data-rfd-placeholder-context-id":s,onTransitionEnd:u,ref:t.innerRef})});function Zi(e){return"boolean"==typeof e}function Ji(e,t){t.forEach(t=>t(e))}const Xi=[function({props:e}){e.droppableId||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"A Droppable requires a droppableId prop"):zt()),"string"!=typeof e.droppableId&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,`A Droppable requires a [string] droppableId. Provided: [${typeof e.droppableId}]`):zt())},function({props:e}){Zi(e.isDropDisabled)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"isDropDisabled must be a boolean"):zt()),Zi(e.isCombineEnabled)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"isCombineEnabled must be a boolean"):zt()),Zi(e.ignoreContainerClipping)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"ignoreContainerClipping must be a boolean"):zt())},function({getDroppableRef:e}){Oi(e())}],Qi=[function({props:e,getPlaceholderRef:t}){e.placeholder&&(t()||"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&$t(`\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 `))}],ea=[function({props:e}){e.renderClone||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Must provide a clone render function (renderClone) for virtual lists"):zt())},function({getPlaceholderRef:e}){e()&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Expected virtual list to not have a placeholder"):zt())}];class ta extends m.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 na={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?zt(0,"document.body is not ready"):zt()),document.body}},ra=e=>{let t,n={...e};for(t in na)void 0===e[t]&&(n={...n,[t]:na[t]});return n},oa=(e,t)=>e===t.droppable.type,ia=(e,t)=>t.draggables[e.draggable.id],aa=gt(()=>{const e={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},t={...e,shouldAnimatePlaceholder:!1},n=vn(e=>({draggableId:e.id,type:e.type,source:{index:e.index,droppableId:e.droppableId}})),r=vn((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=ra(o),a=i.droppableId,s=i.type,l=!i.isDropDisabled,c=i.renderClone;if(qo(n)){const e=n.critical;if(!oa(s,e))return t;const o=ia(e,n.dimensions),i=ir(n.impact)===a;return r(a,l,i,i,o,c)}if("DROP_ANIMATING"===n.phase){const e=n.completed;if(!oa(s,e.critical))return t;const o=ia(e.critical,n.dimensions);return r(a,l,_i(e.result)===a,ir(e.impact)===a,o,c)}if("IDLE"===n.phase&&n.completed&&!n.shouldFlush){const r=n.completed;if(!oa(s,r.critical))return t;const o=ir(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)=>({...ra(n),...e,...t}),{context:ko,areStatePropsEqual:Ii})(t=>{const n=e.useContext(Lo);n||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Could not find app context"):zt());const{contextId:r,isMovementAllowed:o}=n,i=e.useRef(null),a=e.useRef(null),{children:s,droppableId:l,type:c,mode:u,direction:d,ignoreContainerClipping:p,isDropDisabled:f,isCombineEnabled:g,snapshot:h,useClone:E,updateViewportMaxScroll:v,getContainerForClone:y}=t,N=rn(()=>i.current,[]),x=rn((e=null)=>{i.current=e},[]),D=rn(()=>a.current,[]),O=rn((e=null)=>{a.current=e},[]);var w;w={props:t,getDroppableRef:N,getPlaceholderRef:D},Wo(()=>{Ji(w,Xi),"standard"===w.props.mode&&Ji(w,Qi),"virtual"===w.props.mode&&Ji(w,ea)});const S=rn(()=>{o()&&v({maxScroll:no()})},[o,v]);!function(t){const n=e.useRef(null),r=wi(Lo),o=$o("droppable"),{registry:i,marshal:a}=r,s=zo(t),l=nn(()=>({id:t.droppableId,type:t.type,mode:t.mode}),[t.droppableId,t.mode,t.type]),c=e.useRef(l),u=nn(()=>vn((e,t)=>{n.current||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Can only update scroll when dragging"):zt()),a.updateDroppableScroll(l.id,{x:e,y:t})}),[l.id,a]),d=rn(()=>{const e=n.current;return e&&e.env.closestScrollable?ji(e.env.closestScrollable):on},[]),p=rn(()=>{const e=d();u(e.x,e.y)},[d,u]),f=nn(()=>At(p),[p]),m=rn(()=>{const e=n.current,t=qi(e);e&&t||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Could not find scroll options while scrolling"):zt()),e.scrollOptions.shouldPublishImmediately?p():f()},[f,p]),g=rn((e,t)=>{n.current&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot collect a droppable while a drag is occurring"):zt());const o=s.current,i=o.getDroppableRef();i||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot collect without a droppable ref"):zt());const a={closestScrollable:Mi(c=i),isFixedOnPage:Gi(c)};var c;const u={ref:i,descriptor:l,env:a,scrollOptions:t};n.current=u;const d=(({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=Nt({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),u=It(c,r),d=(()=>{if(!l)return null;const e=Ct(l),t={scrollHeight:l.scrollHeight,scrollWidth:l.scrollWidth};return{client:e,page:It(e,r),scroll:ji(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=eo({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:on,displacement:on}}}})(),c="vertical"===o?Rn:Bn;return{descriptor:e,isCombineEnabled:n,isFixedOnPage:r,axis:c,isEnabled:t,client:i,page:a,frame:l,subject:bn({page:a,withPlaceholder:null,axis:c,frame:l})}})({descriptor:t,isEnabled:!i,isCombineEnabled:a,isFixedOnPage:n.isFixedOnPage,direction:o,client:c,page:u,closest:d});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(Oo.contextId,r.contextId),p.addEventListener("scroll",m,zi(u.scrollOptions)),"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&(e=>{e&&Mi(e.parentElement)&&"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&$t("\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)),d},[r.contextId,l,m,s]),h=rn(()=>{const e=n.current,t=qi(e);return e&&t||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Can only recollect Droppable client for Droppables that have a scroll container"):zt()),ji(t)},[]),b=rn(()=>{const e=n.current;e||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot stop drag when no active drag"):zt());const t=qi(e);n.current=null,t&&(f.cancel(),t.removeAttribute(Oo.contextId),t.removeEventListener("scroll",m,zi(e.scrollOptions)))},[m,f]),E=rn(e=>{const t=n.current;t||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot scroll when there is no drag"):zt());const r=qi(t);r||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot scroll a droppable with no closest scrollable"):zt()),r.scrollTop+=e.y,r.scrollLeft+=e.x},[]),v=nn(()=>({getDimensionAndWatchScroll:g,getScrollWhileDragging:h,dragStopped:b,scroll:E}),[b,g,h,E]),y=nn(()=>({uniqueId:o,descriptor:l,callbacks:v}),[v,l,o]);So(()=>(c.current=y.descriptor,i.droppable.register(y),()=>{n.current&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV&&$t("Unsupported: changing the droppableId or type of a Droppable during a drag"),b()),i.droppable.unregister(y)}),[v,l,b,y,a,i.droppable]),So(()=>{n.current&&a.updateDroppableIsEnabled(c.current.id,!t.isDropDisabled)},[t.isDropDisabled,a]),So(()=>{n.current&&a.updateDroppableIsCombineEnabled(c.current.id,t.isCombineEnabled)},[t.isCombineEnabled,a])}({droppableId:l,type:c,mode:u,direction:d,isDropDisabled:f,isCombineEnabled:g,ignoreContainerClipping:p,getDroppableRef:N});const I=nn(()=>m.default.createElement(ta,{on:t.placeholder,shouldAnimate:t.shouldAnimatePlaceholder},({onClose:e,data:t,animate:n})=>m.default.createElement(Ki,{placeholder:t,onClose:e,innerRef:O,animate:n,contextId:r,onTransitionEnd:S})),[r,S,t.placeholder,t.shouldAnimatePlaceholder,O]),_=nn(()=>({innerRef:x,placeholder:I,droppableProps:{"data-rfd-droppable-id":l,"data-rfd-droppable-context-id":r}}),[r,l,I,x]),C=E?E.dragging.draggableId:null,A=nn(()=>({droppableId:l,type:c,isUsingCloneFor:C}),[l,C,c]);return m.default.createElement(Di.Provider,{value:A},s(_,h),function(){if(!E)return null;const{dragging:e,render:t}=E,n=m.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 sa,la,ca,ua=((sa={})[t.PresenceStatusEnum.Present]="presenceStatusPresent",sa[t.PresenceStatusEnum.NotPresent]="presenceStatusNotPresent",sa[t.PresenceStatusEnum.PresentElsewhere]="presenceStatusPresentElsewhere",sa),da="unplanned:",pa=function(e){return e.startsWith(da)},fa=function(e){return pa(e)?e.slice(10):e},ma=((la={})[t.PresenceStatusEnum.Present]="success.main",la[t.PresenceStatusEnum.NotPresent]="error.main",la[t.PresenceStatusEnum.PresentElsewhere]="warning.main",la),ga={properties:{gap:function(e){return e.spacing(.5)}},property:{marginLeft:function(e){return e.spacing(2)}},propertyLabel:{marginBottom:function(e){return e.spacing(.5)},fontWeight:"bold"},propertyValue:{fontSize:function(e){return e.typography.pxToRem(14)},color:"text.primary"},checkedInValue:{fontSize:function(e){return e.typography.pxToRem(14)},fontWeight:600,color:"warning.main"},unplannedIndicator:{flexShrink:0,width:12,height:12,borderRadius:"50%",backgroundColor:"success.main"},assignButton:{marginTop:function(e){return e.spacing(2)}},separator:{width:"100%",height:"1px",margin:function(e){return e.spacing(1,0)},background:"linear-gradient(90deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.05) 100%)"}},ha=function(n){var r,i,s,l,c,u=n.userId,d=n.data,p=n.gqlClients,f=n.viewState,g=n.onAssignToWorkplace,b=o.useTranslation().t,E=e.useState(null),v=E[0],y=E[1],N=e.useState(null),x=N[0],O=N[1],w=e.useState(!1),S=w[0],I=w[1],_=function(e,t){for(var n,r=D(e.workplaces);!(n=r()).done;){var o=n.value,i=o.assignedOperators.find(function(e){return e.user.id===t});if(i)return{presenceStatus:i.presenceStatus,assignedWorkplaceName:o.workplace.name}}for(var a,s=D(e.workplaces);!(a=s()).done;){var l=a.value;if(l.unplannedOperators.find(function(e){return e.user.id===t&&!e.plannedWorkplace}))return{isUnplanned:!0,checkedInWorkplace:l.workplace}}return{}}(d,u),C=_.isUnplanned||_.presenceStatus===t.PresenceStatusEnum.Present||_.presenceStatus===t.PresenceStatusEnum.PresentElsewhere;return e.useEffect(function(){C&&p.graphqlSdk&&(I(!0),p.graphqlSdk.usersPresences({filter:{user_id_eq:u,shift_id_eq:f.shift.id}}).then(function(e){var t=e.usersPresences;if(t.length>0){var n=t[t.length-1];y(n.startedAt);var r=d.workplaces.find(function(e){return e.workplace.id===n.workplaceId});r&&O(r.workplace.name)}}).catch(function(){}).finally(function(){return I(!1)}))},[u,C,p.graphqlSdk,f.shift.id,d.workplaces]),m.default.createElement(a.Stack,{sx:ga.properties},m.default.createElement(a.Box,{sx:ga.property},m.default.createElement(a.Typography,{sx:ga.propertyLabel},b("presenceStatus")),m.default.createElement(a.Stack,{direction:"row",spacing:1,alignItems:"center"},_.isUnplanned&&m.default.createElement(a.Box,{title:b("checkedInUnassigned"),sx:ga.unplannedIndicator}),!_.isUnplanned&&_.presenceStatus&&m.default.createElement(a.Box,{title:b(ua[_.presenceStatus]),sx:(c=_.presenceStatus,{flexShrink:0,width:12,height:12,borderRadius:"50%",backgroundColor:ma[c]})}),m.default.createElement(a.Typography,{sx:ga.propertyValue},_.isUnplanned?b("checkedInUnassigned"):function(e,t){return e(t?ua[t]:"unassignedOperator")}(b,_.presenceStatus)))),_.isUnplanned&&_.checkedInWorkplace&&m.default.createElement(m.default.Fragment,null,m.default.createElement(a.Box,{sx:ga.separator}),m.default.createElement(a.Box,{sx:ga.property},m.default.createElement(a.Typography,{sx:ga.propertyLabel},b("checkedInLocation")),m.default.createElement(a.Typography,{sx:ga.propertyValue},_.checkedInWorkplace.name))),_.assignedWorkplaceName&&m.default.createElement(m.default.Fragment,null,m.default.createElement(a.Box,{sx:ga.separator}),m.default.createElement(a.Box,{sx:ga.property},m.default.createElement(a.Typography,{sx:ga.propertyLabel},b("assignedWorkplace")),m.default.createElement(a.Typography,{sx:ga.propertyValue},_.assignedWorkplaceName))),S&&m.default.createElement(m.default.Fragment,null,m.default.createElement(a.Box,{sx:ga.separator}),m.default.createElement(a.Box,{sx:ga.property,display:"flex",justifyContent:"center",mt:2},m.default.createElement(a.CircularProgress,{size:16}))),!S&&v&&m.default.createElement(m.default.Fragment,null,_.presenceStatus===t.PresenceStatusEnum.PresentElsewhere&&x&&m.default.createElement(m.default.Fragment,null,m.default.createElement(a.Box,{sx:ga.separator}),m.default.createElement(a.Box,{sx:ga.property},m.default.createElement(a.Typography,{sx:ga.propertyLabel},b("checkedInLocation")),m.default.createElement(a.Typography,{sx:ga.checkedInValue},x))),m.default.createElement(a.Box,{sx:ga.separator}),m.default.createElement(a.Box,{sx:ga.property},m.default.createElement(a.Typography,{sx:ga.propertyLabel},b("checkedInTime")),m.default.createElement(a.Typography,{sx:ga.propertyValue},h.default(v).format("HH:mm"))),m.default.createElement(a.Box,{sx:ga.separator}),m.default.createElement(a.Box,{sx:ga.property},m.default.createElement(a.Typography,{sx:ga.propertyLabel},b("workingFor")),m.default.createElement(a.Typography,{sx:ga.propertyValue},(r=h.default(v),l=(i=h.default().diff(r,"minute"))%60,(s=Math.floor(i/60))>0?s+"h "+l+"m":l+"m")))),_.isUnplanned&&_.checkedInWorkplace&&m.default.createElement(m.default.Fragment,null,m.default.createElement(a.Box,{sx:ga.separator}),m.default.createElement(a.Box,{sx:ga.property,display:"flex",justifyContent:"flex-end"},m.default.createElement(a.Button,{variant:"contained",size:"small",color:"info",sx:ga.assignButton,onClick:function(){_.checkedInWorkplace&&g&&g(u,_.checkedInWorkplace.id)}},b("assignHere")))))},ba=function(e){var t=e.children;return m.default.createElement(aa,{droppableId:e.droppableId,renderClone:e.renderClone},function(e,n){return m.default.createElement(a.Box,O({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})},Ea=((ca={})[t.PresenceStatusEnum.Present]="success.main",ca[t.PresenceStatusEnum.NotPresent]="error.main",ca[t.PresenceStatusEnum.PresentElsewhere]="warning.main",ca),va=function(e,t){return void 0===t&&(t=!0),O({display:"flex",alignItems:"center",gap:function(e){return e.spacing(1)},cursor:t?"pointer":"default",padding:function(e){return e.spacing(1)},borderBottom:"1px solid rgba(255, 255, 255, 0.15)",boxShadow:"none","&:last-of-type":{borderBottom:"none"}},t&&{"&:hover":{backgroundColor:"rgba(255, 255, 255, 0.05)"}},e&&{opacity:.5})},ya={flexShrink:0,width:10,height:10,borderRadius:"50%",backgroundColor:"success.main"},Na={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}}},xa=function(e){var t=e.provided,n=e.user;return m.default.createElement(a.Card,O({ref:t.innerRef},t.draggableProps,t.dragHandleProps,{sx:va(!0)}),m.default.createElement(a.Typography,{sx:Na.name},n.name))},Da=function(e){var t=e.user,n=e.index,r=e.draggableId,i=e.showPresence,s=e.presenceStatus,l=e.isUnplanned,c=e.onClick,u=e.onRemove,d=o.useTranslation().t;return m.default.createElement(Vi,{draggableId:r,index:n},function(e,n){return m.default.createElement(a.Card,O({ref:e.innerRef},e.draggableProps,e.dragHandleProps,{sx:va(n.isDragging,!!c),onClick:function(){!n.isDragging&&c&&c()}}),l&&m.default.createElement(a.Box,{title:d("checkedInUnassigned"),sx:ya}),!l&&i&&s&&m.default.createElement(a.Box,{title:d(ua[s]),sx:(r=s,{flexShrink:0,width:10,height:10,borderRadius:"50%",backgroundColor:Ea[r]})}),m.default.createElement(a.Typography,{title:t.name,sx:Na.name},t.name),u&&m.default.createElement(a.IconButton,{title:d("removeOperator"),size:"small",color:"error",onClick:function(e){e.stopPropagation(),u()},sx:Na.removeButton},m.default.createElement(v.default,{fontSize:"small"})));var r})},Oa={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)}},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"}},wa=function(t){var n=t.operators,r=t.unplannedUserIds,i=t.onOperatorClick,s=e.useState(""),l=s[0],c=s[1],u=o.useTranslation().t,d=e.useMemo(function(){return r?n.filter(function(e){return!r.has(e.id)}):n},[n,r]),p=e.useMemo(function(){if(!l.trim())return d;var e=l.toLowerCase();return d.filter(function(t){return t.name.toLowerCase().split(" ").some(function(t){return t.startsWith(e)})})},[d,l]);return m.default.createElement(a.Card,{sx:Oa.root},m.default.createElement(a.CardHeader,{title:u("unassignedPool"),action:d.length,slotProps:{title:{variant:"subtitle1"},action:{sx:Oa.action}},sx:Oa.header}),m.default.createElement(a.TextField,{size:"small",label:u("searchOperators"),value:l,onChange:function(e){return c(e.target.value)},sx:Oa.search,slotProps:{input:{startAdornment:m.default.createElement(a.InputAdornment,{position:"start"},m.default.createElement(E.default,{fontSize:"small"}))}}}),m.default.createElement(a.CardContent,{sx:Oa.content},m.default.createElement(ba,{droppableId:"pool",renderClone:function(e,t,n){return m.default.createElement(xa,{provided:e,user:p[n.source.index]})}},function(){return m.default.createElement(m.default.Fragment,null,p.map(function(e,t){return m.default.createElement(Da,{key:e.id,user:e,index:t,draggableId:e.id,onClick:i?function(){return i(e.id,e.name)}:void 0})}))})))},Sa={overcapacity:{borderColor:"error.main",labelColor:"error.contrastText",labelBg:"error.main"},unplanned:{borderColor:"warning.main",labelColor:"warning.contrastText",labelBg:"warning.main"}},Ia=function(e,t,n){return O({display:"flex",flexDirection:"column",flexShrink:0,position:"relative",width:250,minHeight:200,border:"normal"!==e?2:1,borderColor:"normal"!==e?Sa[e].borderColor:"divider"},"normal"!==e&&{"&::after":{content:'"'+n+'"',position:"absolute",bottom:-2,left:-2,padding:function(e){return e.spacing(.25,.75)},fontSize:function(e){return e.typography.pxToRem(10)},color:Sa[e].labelColor,backgroundColor:Sa[e].labelBg,borderRadius:"0 4px 0 0",textShadow:"0 1px 2px rgba(0, 0, 0, 0.3)",pointerEvents:"none"}},void 0!==t&&{overflow:"hidden",maxHeight:t})},_a={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)}},unplannedLabel:{display:"block",margin:function(e){return e.spacing(1,0)},padding:function(e){return e.spacing(0,.5)},color:"text.primary",opacity:.7,textAlign:"center"},unplannedSeparator:{height:"1px",backgroundColor:"text.primary",opacity:.3}},Ca={ok:{color:"success.contrastText",backgroundColor:"success.main"},missing:{color:"error.contrastText",backgroundColor:"error.main"},overcapacity:{color:"error.contrastText",backgroundColor:"error.main"},warning:{color:"warning.contrastText",backgroundColor:"warning.main"}},Aa=function(n){var r,i,s=n.assignment,l=n.viewState,c=n.registerRef,u=n.frozenHeight,d=n.onOperatorClick,p=n.onRemoveOperator,f=o.useTranslation().t,g=l.isCurrentShift,h=e.useMemo(function(){return[].concat(s.assignedOperators).sort(function(e,t){return e.user.name.localeCompare(t.user.name,void 0,{numeric:!0})})},[s.assignedOperators]),b=e.useMemo(function(){return g?s.unplannedOperators.filter(function(e){return!e.plannedWorkplace}).sort(function(e,t){return e.user.name.localeCompare(t.user.name,void 0,{numeric:!0})}):[]},[s.unplannedOperators,g]),E=e.useMemo(function(){return g?{localOperators:h.filter(function(e){return e.presenceStatus!==t.PresenceStatusEnum.PresentElsewhere}),elsewhereOperators:h.filter(function(e){return e.presenceStatus===t.PresenceStatusEnum.PresentElsewhere})}:{localOperators:h,elsewhereOperators:[]}},[h,g]),v=E.localOperators,y=E.elsewhereOperators,N=g?function(e,n){var r=e.assignedOperators.filter(function(e){return e.presenceStatus===t.PresenceStatusEnum.Present}).length+n;return r>e.recommendedOperators?{text:"+"+(r-e.recommendedOperators),status:"overcapacity",titleKey:"statusOvercapacity",checkedInHereCount:r}:r<e.recommendedOperators?{text:""+(r-e.recommendedOperators),status:"missing",titleKey:"statusMissing",checkedInHereCount:r}:0===n?{text:"OK",status:"ok",titleKey:"statusOk",checkedInHereCount:r}:{text:"OK",status:"warning",titleKey:"statusUnplanned",checkedInHereCount:r}}(s,b.length):null,x=g?null:function(e){var t=e.assignedCount-e.recommendedOperators;return t>0?{text:"+"+t,status:"overcapacity",titleKey:"statusOvercapacity"}:t<0?{text:""+t,status:"missing",titleKey:"statusMissing"}:{text:"OK",status:"ok",titleKey:"statusOk"}}(s),D=N||x,w=(g?s.assignedCount>s.recommendedOperators||(null!=(r=null==N?void 0:N.checkedInHereCount)?r:0)>s.recommendedOperators:s.assignedCount>s.recommendedOperators)?{status:"overcapacity",label:f("overcapacity")}:g&&b.length>0?{status:"unplanned",label:f("unplannedStaffing")}:{status:"normal",label:""},S=N?N.checkedInHereCount:s.assignedCount;return m.default.createElement(a.Card,{ref:c,sx:Ia(w.status,u,w.label)},m.default.createElement(a.CardHeader,{title:s.workplace.name,action:m.default.createElement(m.default.Fragment,null,m.default.createElement(a.Typography,null,S+"/"+s.recommendedOperators),m.default.createElement(a.Typography,{title:f(D.titleKey),variant:"caption",sx:(i=D.status,O({padding:function(e){return e.spacing(.25)+" "+e.spacing(1)},borderRadius:1},Ca[i]))},D.text)),slotProps:{title:{variant:"subtitle1",title:s.workplace.name,sx:_a.title},action:{sx:_a.action}},sx:_a.header}),m.default.createElement(a.CardContent,{sx:_a.content},m.default.createElement(ba,{droppableId:s.workplace.id,renderClone:function(e,t,n){var r,o,i=n.source.index,s=v.length+y.length;if(i<v.length)r=null==(o=v[i])?void 0:o.user;else if(i<s){var l;r=null==(l=y[i-v.length])?void 0:l.user}else{var c;r=null==(c=b[i-s])?void 0:c.user}return r?m.default.createElement(xa,{provided:e,user:r}):m.default.createElement(a.Card,O({ref:e.innerRef},e.draggableProps,e.dragHandleProps))}},function(){var e=v.length,t=e+y.length;return m.default.createElement(m.default.Fragment,null,v.map(function(e,t){return m.default.createElement(Da,{key:e.user.id,user:e.user,index:t,draggableId:e.user.id,showPresence:g,presenceStatus:e.presenceStatus,onClick:d?function(){return d(e.user.id,e.user.name)}:void 0,onRemove:p?function(){return p(e.user.id)}:void 0})}),y.length>0&&m.default.createElement(m.default.Fragment,null,m.default.createElement(a.Typography,{variant:"caption",sx:_a.unplannedLabel},f("presentElsewhereLabel")),m.default.createElement(a.Box,{sx:_a.unplannedSeparator})),y.map(function(t,n){return m.default.createElement(Da,{key:t.user.id,user:t.user,index:e+n,draggableId:t.user.id,showPresence:!0,presenceStatus:t.presenceStatus,onClick:d?function(){return d(t.user.id,t.user.name)}:void 0,onRemove:p?function(){return p(t.user.id)}:void 0})}),b.length>0&&m.default.createElement(m.default.Fragment,null,m.default.createElement(a.Typography,{variant:"caption",sx:_a.unplannedLabel},f("unplannedSectionLabel")),m.default.createElement(a.Box,{sx:_a.unplannedSeparator})),b.map(function(e,n){return m.default.createElement(Da,{key:e.user.id,user:e.user,index:t+n,draggableId:(r=e.user.id,""+da+r),isUnplanned:!0,onClick:d?function(){return d(e.user.id,e.user.name)}:void 0});var r}))})))},Ta={grid:function(e){return{display:"flex",flexDirection:"column",flexWrap:"wrap",alignContent:"flex-start",gap:e.spacing(1),height:"100%",overflowX:"auto"}}},Pa=function(n){var r=n.data,o=n.viewState,i=n.gqlClients,s=n.updateData,l=n.updateSidePanelProps,c=n.refetchAssignments,u=i.graphqlSdk,d=e.useState({}),p=d[0],f=d[1],g=e.useRef({}),h=e.useRef(r);h.current=r;var b=e.useMemo(function(){for(var e,t=new Set,n=D(r.workplaces);!(e=n()).done;)for(var o,i=D(e.value.unplannedOperators);!(o=i()).done;)t.add(o.value.user.id);return t},[r.workplaces]),E=e.useCallback(function(e,t){g.current[e]=t},[]),v=e.useCallback(function(e){var t={};Object.entries(g.current).forEach(function(e){var n=e[1];n&&(t[e[0]]=n.getBoundingClientRect().height)}),f(t)},[]),y=e.useCallback(function(e,t){if(u){var n=r.workplaces.find(function(e){return e.workplace.id===t}),i=null==n?void 0:n.assignedOperators.find(function(t){return t.user.id===e});n&&i&&(s({workplaces:r.workplaces.map(function(n){return n.workplace.id===t?O({},n,{assignedOperators:n.assignedOperators.filter(function(t){return t.user.id!==e}),assignedCount:n.assignedCount-1}):n}),unassignedOperators:[i.user].concat(r.unassignedOperators)}),u.unassignOperator({input:{userId:e,shiftId:o.shift.id,validFrom:o.date}}).catch(function(){}))}},[u,r,o,s]),N=e.useCallback(function(e,n){u&&(s({workplaces:r.workplaces.map(function(r){var o=r.workplace.id===n,i=r.unplannedOperators.find(function(t){return t.user.id===e});return O({},r,{unplannedOperators:r.unplannedOperators.filter(function(t){return t.user.id!==e})},o&&i?{assignedOperators:[].concat(r.assignedOperators,[{user:i.user,presenceStatus:t.PresenceStatusEnum.Present}]).sort(function(e,t){return e.user.name.localeCompare(t.user.name,void 0,{numeric:!0})}),assignedCount:r.assignedCount+1}:{})}),unassignedOperators:r.unassignedOperators.filter(function(t){return t.id!==e})}),l({open:!1}),u.assignOperator({input:{userId:e,workplaceId:n,shiftId:o.shift.id,validFrom:o.date}}).then(c).catch(function(){}))},[u,r,o,s,l,c]),x=e.useCallback(function(e,t){l({open:!0,title:t,width:"25%",mainContent:m.default.createElement(ha,{userId:e,data:r,gqlClients:i,viewState:o,onAssignToWorkplace:N})})},[r,i,o,l,N]);return m.default.createElement(yi,{onDragStart:v,onDragEnd:function(e){if(f({}),u){var n=function(e,n){var r=n.source,o=n.destination,i=n.draggableId;if(!o)return null;if(r.droppableId===o.droppableId&&r.index===o.index)return null;var a,s=pa(i),l=fa(i),c="pool"===r.droppableId,u="pool"===o.droppableId;if(s&&u)return null;var d=t.PresenceStatusEnum.NotPresent,p=[].concat(e.unassignedOperators),f=e.workplaces.map(function(e){return O({},e,{assignedOperators:[].concat(e.assignedOperators),unplannedOperators:[].concat(e.unplannedOperators)})});if(s){var m=f.find(function(e){return e.workplace.id===r.droppableId});if(m){var g=m.unplannedOperators.findIndex(function(e){return e.user.id===l});-1!==g&&(a=m.unplannedOperators[g].user,d=t.PresenceStatusEnum.PresentElsewhere,m.unplannedOperators.splice(g,1))}var h=p.findIndex(function(e){return e.id===l});-1!==h&&p.splice(h,1)}else if(c){var b=p.findIndex(function(e){return e.id===l});-1!==b&&(a=p[b],p.splice(b,1))}else{var E=f.find(function(e){return e.workplace.id===r.droppableId});if(E){var v=E.assignedOperators.findIndex(function(e){return e.user.id===l});-1!==v&&(a=E.assignedOperators[v].user,d=E.assignedOperators[v].presenceStatus,E.assignedOperators.splice(v,1),E.assignedCount-=1)}}if(!a)return null;if(u)p.splice(o.index,0,a);else{var y=f.find(function(e){return e.workplace.id===o.droppableId});y&&(y.assignedOperators.splice(o.index,0,{user:a,presenceStatus:d}),y.assignedCount+=1)}return{workplaces:f,unassignedOperators:p}}(r,e);if(n){s(n);var i=e.destination,a=fa(e.draggableId);if("pool"===i.droppableId)u.unassignOperator({input:{userId:a,shiftId:o.shift.id,validFrom:o.date}}).catch(function(){});else{var l=i.droppableId,c=u.assignOperator({input:{userId:a,workplaceId:l,shiftId:o.shift.id,validFrom:o.date}});o.isCurrentShift?c.then(function(){return u.usersPresences({filter:{user_id_eq:a,shift_id_eq:o.shift.id}})}).then(function(e){var n=e.usersPresences;if(0!==n.length){var r=n[n.length-1].workplaceId===l?t.PresenceStatusEnum.Present:t.PresenceStatusEnum.PresentElsewhere;s({workplaces:h.current.workplaces.map(function(e){return e.workplace.id===l?O({},e,{assignedOperators:e.assignedOperators.map(function(e){return e.user.id===a?O({},e,{presenceStatus:r}):e})}):e})})}}).catch(function(){}):c.catch(function(){})}}}}},m.default.createElement(a.Box,{sx:Ta.grid},m.default.createElement(wa,{operators:r.unassignedOperators,unplannedUserIds:o.isCurrentShift?b:void 0,onOperatorClick:o.isCurrentShift?x:void 0}),r.workplaces.map(function(e){return m.default.createElement(Aa,{key:e.workplace.id,assignment:e,viewState:o,registerRef:function(t){return E(e.workplace.id,t)},frozenHeight:p[e.workplace.id],onOperatorClick:o.isCurrentShift?x:void 0,onRemoveOperator:function(t){return y(t,e.workplace.id)}})})))},Va={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)"}},ka=function(e){var t=e.viewState,n=e.departmentName,r=e.canPrev,o=e.canNext,i=void 0===o||o,s=e.onNavigate;return m.default.createElement(a.Box,{sx:Va.root},m.default.createElement(a.IconButton,{color:"secondary",disabled:!(void 0===r||r),onClick:function(){return s("prev")}},m.default.createElement(y.default,null)),m.default.createElement(a.Typography,{sx:Va.label},t.date," - ",t.shift.name,n&&" - "+n),m.default.createElement(a.IconButton,{color:"secondary",disabled:!i,onClick:function(){return s("next")}},m.default.createElement(N.default,null)))},Ra={root:{display:"flex",flexDirection:"column",height:"100%"},loader:{display:"flex",justifyContent:"center",alignItems:"center",flexGrow:1}},Ba=function(n){var r=n.data,i=n.updateData,s=n.gqlClients,l=n.settings,c=n.updateSidePanelProps,u=o.useTranslation().t,d=e.useState(null),p=d[0],f=d[1],g=e.useState(!0),b=g[0],E=g[1],v=e.useState(!1),y=v[0],N=v[1],x=e.useMemo(function(){if(null!=l&&l.departmentId){var e=r.departments.find(function(e){return e.id===l.departmentId});return null==e?void 0:e.name}},[null==l?void 0:l.departmentId,r.departments]),D=s.graphqlSdk,O=s.gqlWsClient;e.useEffect(function(){if(r.shifts.length>0&&!p){var e=_(r.shifts);e&&f(e)}},[r.shifts,p]),e.useEffect(function(){var e;O&&null!=r&&null!=(e=r.workplaces)&&e.length&&!y&&(r.workplaces.forEach(function(e){var n=e.workplace;return O.subscribe(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:L,r=void 0,o=Array.isArray(e),i=[e],a=-1,s=[],l=void 0,c=void 0,u=void 0,d=[],p=[],f=e;do{var m=++a===i.length,g=m&&0!==s.length;if(m){if(c=0===p.length?void 0:d[d.length-1],l=u,u=p.pop(),g){if(o)l=l.slice();else{for(var h={},b=0,E=Object.keys(l);b<E.length;b++){var v=E[b];h[v]=l[v]}l=h}for(var y=0,N=0;N<s.length;N++){var x=s[N][0],D=s[N][1];o&&(x-=y),o&&null===D?(l.splice(x,1),y++):l[x]=D}}a=r.index,i=r.keys,s=r.edits,o=r.inArray,r=r.prev}else{if(c=u?o?a:i[a]:void 0,null==(l=u?u[c]:f))continue;u&&d.push(c)}var O,w=void 0;if(!Array.isArray(l)){if(!R(l))throw new Error("Invalid AST Node: ".concat(F(l),"."));var S=j(t,l.kind,m);if(S){if((w=S.call(t,l,c,u,d,p))===M)break;if(!1===w){if(!m){d.pop();continue}}else if(void 0!==w&&(s.push([c,w]),!m)){if(!R(w)){d.pop();continue}l=w}}}void 0===w&&g&&s.push([c,l]),m?d.pop():(r={inArray:o,index:a,keys:i,edits:s,prev:r},i=(o=Array.isArray(l))?l:null!==(O=n[l.kind])&&void 0!==O?O:[],a=-1,s=[],u&&p.push(u),u=l)}while(void 0!==r);return 0!==s.length&&(f=s[s.length-1][1]),f}(t.WorkplaceEventDocument,{leave:G}),{id:n.id},function(e){var n=e.subject;if(e.event===t.WorkplaceEvent.CurrentShiftChanged&&n){var r=n,o=h.default().format("YYYY-MM-DD");f(function(e){return null!=e&&e.isCurrentShift?{date:o,shift:r,isCurrentShift:!0}:e})}})}),N(!0))},[O,null==r?void 0:r.workplaces,y]);var w=e.useRef(null);w.current=function(){D&&p&&i&&(E(!0),D.workplaceAssignments({input:{date:p.date,shiftId:p.shift.id,departmentId:(null==l?void 0:l.departmentId)||void 0}}).then(function(e){return i(e.workplaceAssignments)}).catch(function(){}).finally(function(){return E(!1)}))},e.useEffect(function(){if(p&&D){null==w.current||w.current();var e=setInterval(function(){return null==w.current?void 0:w.current()},1e3*((null==l?void 0:l.refreshInterval)||60));return function(){return clearInterval(e)}}},[p,D,null==l?void 0:l.departmentId,null==l?void 0:l.refreshInterval]);var I=e.useCallback(function(e){if(p){var n=function(e,n,r){var o=S(n);if(!C(e,o,r))return e;var i=o.findIndex(function(t){return t.id===e.shift.id}),a=function(e,n){var r=h.default();if(e!==r.format("YYYY-MM-DD"))return!1;var i=t.normalizeShifts(o,r),a=t.getCurrentShift(r,i);return(null==a?void 0:a.name)===n.name};if("next"===r){if(i<o.length-1){var s=o[i+1];return{date:e.date,shift:s,isCurrentShift:a(e.date,s)}}return{date:h.default(e.date).add(1,"day").format("YYYY-MM-DD"),shift:o[0],isCurrentShift:!1}}if(i>0){var l=o[i-1];return{date:e.date,shift:l,isCurrentShift:a(e.date,l)}}return{date:h.default(e.date).subtract(1,"day").format("YYYY-MM-DD"),shift:o[o.length-1],isCurrentShift:!1}}(p,r.shifts,e);f(n)}},[p,r.shifts]),A=!!p&&C(p,r.shifts,"prev"),T=!!p&&C(p,r.shifts,"next");return m.default.createElement(a.Box,{sx:Ra.root},p?m.default.createElement(m.default.Fragment,null,m.default.createElement(ka,{viewState:p,departmentName:x,canPrev:A,canNext:T,onNavigate:I}),b?m.default.createElement(a.Box,{sx:Ra.loader},m.default.createElement(a.CircularProgress,null)):m.default.createElement(Pa,{data:r,viewState:p,gqlClients:s,updateData:i,updateSidePanelProps:c,refetchAssignments:function(){return null==w.current?void 0:w.current()}})):m.default.createElement(a.Typography,null,u("noShiftsAvailable")))};function Fa(e){this._maxSize=e,this.clear()}Fa.prototype.clear=function(){this._size=0,this._values=Object.create(null)},Fa.prototype.get=function(e){return this._values[e]},Fa.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var $a=/[^.^\]^[]+|(?=\[\]|\.\.)/g,La=/^\d+$/,Ma=/^\d/,ja=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,Ga=/^\s*(['"]?)(.*?)(\1)\s*$/,Ua=new Fa(512),Wa=new Fa(512),za=new Fa(512),qa={Cache:Fa,split:Ya,normalizePath:Ha,setter:function(e){var t=Ha(e);return Wa.get(e)||Wa.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=Ha(e);return za.get(e)||za.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+(Ka(t)||La.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])&&(Za(r)&&(r='"'+r+'"'),i=!(a=Ka(r))&&/^\d+$/.test(r),t.call(n,r,a,i,o,e))}(Array.isArray(e)?e:Ya(e),t,n)}};function Ha(e){return Ua.get(e)||Ua.set(e,Ya(e).map(function(e){return e.replace(Ga,"$2")}))}function Ya(e){return e.match($a)||[""]}function Ka(e){return"string"==typeof e&&e&&-1!==["'",'"'].indexOf(e.charAt(0))}function Za(e){return!Ka(e)&&(function(e){return e.match(Ma)&&!e.match(La)}(e)||function(e){return ja.test(e)}(e))}const Ja=/[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,Xa=e=>e.match(Ja)||[];var Qa=e=>Xa(e).reduce((e,t)=>`${e}${e?t[0].toUpperCase()+t.slice(1).toLowerCase():t.toLowerCase()}`,""),es=e=>(e=>Xa(e).join("_").toLowerCase())(e),ts=function(e){return ns(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 ns(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 u=a.get(e)||new Set;if(t=(u=Array.from(u)).length){i.add(e);do{var d=u[--t];l(d,s.get(d),i)}while(t);i.delete(e)}r[--n]=e}}}ts.array=ns;const rs=Object.prototype.toString,os=Error.prototype.toString,is=RegExp.prototype.toString,as="undefined"!=typeof Symbol?Symbol.prototype.toString:()=>"",ss=/^Symbol\((.*)\)(.*)$/;function ls(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 as.call(e).replace(ss,"Symbol($1)");const r=rs.call(e).slice(8,-1);return"Date"===r?isNaN(e.getTime())?""+e:e.toISOString(e):"Error"===r||e instanceof Error?"["+os.call(e)+"]":"RegExp"===r?is.call(e):null}function cs(e,t){let n=ls(e,t);return null!==n?n:JSON.stringify(e,function(e,n){let r=ls(this[e],t);return null!==r?r:n},2)}function us(e){return null==e?[]:[].concat(e)}let ds,ps,fs,ms=/\$\{\s*(\w+)\s*\}/g;ds=Symbol.toStringTag;class gs{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[ds]="Error",this.name="ValidationError",this.value=t,this.path=n,this.type=r,this.errors=[],this.inner=[],us(e).forEach(e=>{hs.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]}}ps=Symbol.hasInstance,fs=Symbol.toStringTag;class hs 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(ms,(e,n)=>cs(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 gs(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[fs]="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,hs)}static[ps](e){return gs[Symbol.hasInstance](e)||super[Symbol.hasInstance](e)}}let bs={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 \`${cs(r,!0)}\`).`:".";return"mixed"!==t?`${e} must be a \`${t}\` type, but the final value was: \`${cs(n,!0)}\``+o:`${e} must match the configured type. The validated value was: \`${cs(n,!0)}\``+o}},Es={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"},vs={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"},ys={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Ns={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},xs={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: \`${cs(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: \`${cs(n,!0)}\``}return hs.formatError(bs.notType,e)}};var Ds=Object.assign(Object.create(null),{mixed:bs,string:Es,number:vs,date:ys,object:Ns,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:xs});const Os=e=>e&&e.__isYupSchema__;class ws{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 ws(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(!Os(r))throw new TypeError("conditions must return a schema object");return r.resolve(t)}}class Ss{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&&qa.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}}Ss.prototype.__isYupRef=!0;const Is=e=>null==e;function _s(e){function t({value:t,path:n="",options:r,originalValue:o,schema:i},a,s){const{name:l,test:c,params:u,message:d,skipAbsent:p}=e;let{parent:f,context:m,abortEarly:g=i.spec.abortEarly,disableStackTrace:h=i.spec.disableStackTrace}=r;const b={value:t,parent:f,context:m};function E(e={}){const r=Cs(Object.assign({value:t,originalValue:o,label:i.spec.label,path:e.path||n,spec:i.spec,disableStackTrace:e.disableStackTrace||h},u,e.params),b),a=new hs(hs.formatError(e.message||d,r),t,r.path,e.type||l,r.disableStackTrace);return a.params=r,a}const v=g?a:s;let y={path:n,parent:f,type:l,from:r.from,createError:E,resolve:e=>As(e,b),options:r,originalValue:o,schema:i};const N=e=>{hs.isError(e)?v(e):e?s(null):v(E())},x=e=>{hs.isError(e)?v(e):a(e)};if(p&&Is(t))return N(!0);let D;try{var O;if(D=c.call(y,t,y),"function"==typeof(null==(O=D)?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(D).then(N,x)}}catch(e){return void x(e)}N(D)}return t.OPTIONS=e,t}function Cs(e,t){if(!e)return e;for(const n of Object.keys(e))e[n]=As(e[n],t);return e}function As(e,t){return Ss.isRef(e)?e.getValue(t.value,t.parent,t.context):e}function Ts(e,t,n,r=n){let o,i,a;return t?(qa.forEach(t,(s,l,c)=>{let u=l?s.slice(1,s.length-1):s,d="tuple"===(e=e.resolve({context:r,parent:o,value:n})).type,p=c?parseInt(u,10):0;if(e.innerType||d){if(d&&!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=d?e.spec.types[p]:e.innerType}if(!c){if(!e.fields||!e.fields[u])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[u],e=e.fields[u]}i=u,a=l?"["+s+"]":"."+s}),{schema:e,parent:o,parentPath:i}):{parent:o,parentPath:t,schema:e}}class Ps extends Set{describe(){const e=[];for(const t of this.values())e.push(Ss.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 Ps(this.values())}merge(e,t){const n=this.clone();return e.forEach(e=>n.add(e)),t.forEach(e=>n.delete(e)),n}}function Vs(e,t=new Map){if(Os(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]=Vs(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,Vs(o,t))}else if(e instanceof Set){n=new Set,t.set(e,n);for(const r of e)n.add(Vs(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]=Vs(o,t)}return n}function ks(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 Rs(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:ks(n)}))}(e,t);const r=t?`${t}.${e.path}`:e.path;return e.inner.flatMap(e=>Rs(e,r))}class Bs{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 Ps,this._blacklist=new Ps,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(bs.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=Vs(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&&Is(o))return o;let i=cs(e),a=cs(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))},u=e=>{r||(r=!0,n(e,i))},d=o.length,p=[];if(!d)return u([]);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)),--d<=0&&u(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)=>{hs.isError(e)&&(e.value=t),i(e)},(e,t)=>{e.length?i(new hs(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 hs.isError(e)&&(e.value=t),e},(t,n)=>{if(t.length)throw new hs(t,e,void 0,void 0,i);r=n}),r}isValid(e,t){return this.validate(e,t).then(()=>!0,e=>{if(hs.isError(e))return!1;throw e})}isValidSync(e,t){try{return this.validateSync(e,t),!0}catch(e){if(hs.isError(e))return!1;throw e}}_getDefault(e){let t=this.spec.default;return null==t?t:"function"==typeof t?t.call(this,e):Vs(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=_s({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=_s({message:t,name:"optionality",test(e){return void 0!==e||this.schema.spec.optional}}),n}optional(){return this.optionality(!0)}defined(e=bs.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=bs.notNull){return this.nullability(!1,e)}required(e=bs.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=bs.default),"function"!=typeof t.test)throw new TypeError("`test` is a required parameters");let n=this.clone(),r=_s(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=us(e).map(e=>new Ss(e));return r.forEach(e=>{e.isSibling&&n.deps.push(e.key)}),n.conditions.push("function"==typeof t?new ws(r,t):ws.fromOptions(r,t)),n}typeError(e){let t=this.clone();return t.internalTests.typeError=_s({message:e,name:"typeError",skipAbsent:!0,test(e){return!!this.schema._typeCheck(e)||this.createError({params:{type:this.schema.type}})}}),t}oneOf(e,t=bs.oneOf){let n=this.clone();return e.forEach(e=>{n._whitelist.add(e),n._blacklist.delete(e)}),n.internalTests.whiteList=_s({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=bs.notOneOf){let n=this.clone();return e.forEach(e=>{n._blacklist.add(e),n._whitelist.delete(e)}),n.internalTests.blacklist=_s({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?Cs(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 hs)return{issues:Rs(e)};throw e}}}}}Bs.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])Bs.prototype[`${e}At`]=function(t,n,r={}){const{parent:o,parentPath:i,schema:a}=Ts(this,t,n,r.context);return a[e](o&&o[i],Object.assign({},r,{parent:o,path:t}))};for(const e of["equals","is"])Bs.prototype[e]=Bs.prototype.oneOf;for(const e of["not","nope"])Bs.prototype[e]=Bs.prototype.notOneOf;const Fs=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function $s(e){var t,n;const r=Fs.exec(e);return r?{year:Ls(r[1]),month:Ls(r[2],1)-1,day:Ls(r[3],1),hour:Ls(r[4]),minute:Ls(r[5]),second:Ls(r[6]),millisecond:r[7]?Ls(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:Ls(r[10]),minuteOffset:Ls(r[11])}:null}function Ls(e,t=0){return Number(e)||t}let Ms=/^[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])?)*$/,js=/^((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,Gs=/^(?:[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,Us=new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"),Ws=e=>Is(e)||e===e.trim(),zs={}.toString();function qs(){return new Hs}class Hs extends Bs{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===zs?e:n})})}required(e){return super.required(e).withMutation(t=>t.test({message:e||bs.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=Es.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=Es.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=Es.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||Es.matches,params:{regex:e},skipAbsent:!0,test:t=>""===t&&o||-1!==t.search(e)})}email(e=Es.email){return this.matches(Ms,{name:"email",message:e,excludeEmptyString:!0})}url(e=Es.url){return this.matches(js,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=Es.uuid){return this.matches(Gs,{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(Us,{name:"datetime",message:r||Es.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:r||Es.datetime_offset,params:{allowOffset:t},skipAbsent:!0,test:e=>{if(!e||t)return!0;const n=$s(e);return!!n&&!!n.z}}).test({name:"datetime_precision",message:r||Es.datetime_precision,params:{precision:n},skipAbsent:!0,test:e=>{if(!e||null==n)return!0;const t=$s(e);return!!t&&t.precision===n}})}ensure(){return this.default("").transform(e=>null===e?"":e)}trim(e=Es.trim){return this.transform(e=>null!=e?e.trim():e).test({message:e,name:"trim",test:Ws})}lowercase(e=Es.lowercase){return this.transform(e=>Is(e)?e:e.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:e=>Is(e)||e===e.toLowerCase()})}uppercase(e=Es.uppercase){return this.transform(e=>Is(e)?e:e.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:e=>Is(e)||e===e.toUpperCase()})}}function Ys(){return new Ks}qs.prototype=Hs.prototype;class Ks extends Bs{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=vs.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=vs.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=vs.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=vs.moreThan){return this.test({message:t,name:"min",exclusive:!0,params:{more:e},skipAbsent:!0,test(t){return t>this.resolve(e)}})}positive(e=vs.positive){return this.moreThan(0,e)}negative(e=vs.negative){return this.lessThan(0,e)}integer(e=vs.integer){return this.test({name:"integer",message:e,skipAbsent:!0,test:e=>Number.isInteger(e)})}truncate(){return this.transform(e=>Is(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=>Is(t)?t:Math[e](t))}}Ys.prototype=Ks.prototype;let Zs=new Date("");class Js extends Bs{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=$s(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)?Js.INVALID_DATE:new Date(e)))})}prepareParam(e,t){let n;if(Ss.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=ys.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=ys.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 Xs(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 Qs(e){return(t,n)=>Xs(e,t)-Xs(e,n)}Js.INVALID_DATE=Zs;const el=(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 tl(e){if("fields"in e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=tl(r);return e.setFields(t)}if("array"===e.type){const t=e.optional();return t.innerType&&(t.innerType=tl(t.innerType)),t}return"tuple"===e.type?e.optional().clone({types:e.spec.types.map(tl)}):"optional"in e?e.optional():e}let nl=e=>"[object Object]"===Object.prototype.toString.call(e);function rl(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(e=>-1===n.indexOf(e))}const ol=Qs([]);function il(e){return new al(e)}class al extends Bs{constructor(e){super({type:"object",check:e=>nl(e)||"function"==typeof e}),this.fields=Object.create(null),this._sortErrors=ol,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,u=r[e];if(n){let o;l.path=(t.path?`${t.path}.`:"")+e,n=n.resolve({value:u,context:t.context,parent:s});let i=n instanceof Bs?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?u:n.cast(u,l),void 0!==o&&(s[e]=o)}else a&&!i&&(s[e]=u);a===e in s&&s[e]===u||(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||!nl(o))return void r(e,o);i=i||o;let s=[];for(let e of this._nodes){let n=this.fields[e];n&&!Ss.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=qa.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),Ss.isRef(n)&&n.isSibling?i(n.path,t):Os(n)&&"deps"in n&&n.deps.forEach(e=>i(e,t))}return ts.array(Array.from(r),n).reverse()}(e,t),n._sortErrors=Qs(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 tl(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=qa.getter(e,!0);return this.transform(o=>{if(!o)return o;let i=o;return((e,t)=>{const n=[...qa.normalizePath(t)];if(1===n.length)return n[0]in e;let r=n.pop(),o=qa.getter(qa.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(el)}exact(e){return this.test({name:"exact",exclusive:!0,message:e||Ns.exact,test(e){if(null==e)return!0;const t=rl(this.schema,e);return 0===t.length||this.createError({params:{properties:t.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(e=!0,t=Ns.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=rl(this.schema,t);return!e||0===n.length||this.createError({params:{unknown:n.join(", ")}})}});return n.spec.noUnknown=e,n}unknown(e=!0,t=Ns.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(Qa)}snakeCase(){return this.transformKeys(es)}constantCase(){return this.transformKeys(e=>es(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}}il.prototype=al.prototype;var sl=function(e){var t;return t={mixed:{required:e("This field is required")}},Object.keys(t).forEach(e=>{Object.keys(t[e]).forEach(n=>{Ds[e][n]=t[e][n]})}),{initialValues:{departmentId:void 0,refreshInterval:60},validationSchema:il({departmentId:qs(),refreshInterval:Ys().oneOf([15,30,60]).required()})}},ll=["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,ll),u=t.useGqlClients({url:o,wsUrl:i,lang:a}),d=u.graphqlSdk,p=u.gqlWsClient,f=e.useState(s),g=f[0],h=f[1];return e.useEffect(function(){!s&&d&&Promise.all([d.departments(),d.shifts()]).then(function(e){var t=e[0].departments,n=e[1].shifts,r=_(n);if(r)return d.workplaceAssignments({input:{date:r.date,shiftId:r.shift.id,departmentId:(null==l?void 0:l.departmentId)||void 0}}).then(function(e){return h(O({},e.workplaceAssignments,{departments:t,shifts:n}))})}).catch(function(){})},[s,d,null==l?void 0:l.departmentId]),m.default.createElement(n.BaseWidget,O({lang:a,locales:w,data:g,gqlClients:{graphqlSdk:d,gqlWsClient:p},WidgetView:Ba,getSettingsFormProps:sl,SettingsFormContent:T,version:A,"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=A;
|
|
7
|
+
return Object.assign(n,{stabilityCheck:r,identityFunctionCheck:t})}},[o,r]),a=g.useMemo(()=>o.getState(),[o]);return qe(()=>{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__ */g.createElement((n||ut).Provider,{value:i},t)},bt="production"==='{NODE_ENV:"production"}'.NODE_ENV,Et="Invariant failed";function vt(e,t){if(!e){if(bt)throw new Error(Et);var n="function"==typeof t?t():t,r=n?"".concat(Et,": ").concat(n):Et;throw new Error(r)}}var yt=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}}},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}},xt=function(e,t){return{top:e.top+t.top,left:e.left+t.left,bottom:e.bottom-t.bottom,right:e.right-t.right}},Dt={top:0,right:0,bottom:0,left:0},Ot=function(e){var t=e.borderBox,n=e.margin,r=void 0===n?Dt:n,o=e.border,i=void 0===o?Dt:o,a=e.padding,s=void 0===a?Dt:a,l=yt(Nt(t,r)),c=yt(xt(t,i)),u=yt(xt(c,s));return{marginBox:l,borderBox:yt(t),paddingBox:c,contentBox:u,margin:r,border:i,padding:s}},wt=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?vt(!1,"Could not parse value [raw: "+e+", without suffix: "+t+"]"):vt(!1)),n},St=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})},It=function(e,t){return void 0===t&&(t={x:window.pageXOffset,y:window.pageYOffset}),St(e,t)},_t=function(e,t){var n={top:wt(t.marginTop),right:wt(t.marginRight),bottom:wt(t.marginBottom),left:wt(t.marginLeft)},r={top:wt(t.paddingTop),right:wt(t.paddingRight),bottom:wt(t.paddingBottom),left:wt(t.paddingLeft)},o={top:wt(t.borderTopWidth),right:wt(t.borderRightWidth),bottom:wt(t.borderBottomWidth),left:wt(t.borderLeftWidth)};return Ot({borderBox:e,margin:n,padding:r,border:o})},Ct=function(e){var t=e.getBoundingClientRect(),n=window.getComputedStyle(e);return _t(t,n)},At=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 Tt(){return Tt=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},Tt.apply(null,arguments)}const Pt="production"==='{NODE_ENV:"production"}'.NODE_ENV,Vt=/[ \t]{2,}/g,kt=/^[ \t]*/gm,Rt=e=>e.replace(Vt," ").replace(kt,"").trim(),Bt=e=>Rt(`\n %c@hello-pangea/dnd\n\n %c${Rt(e)}\n\n %c👷 This is a development only message. It will be removed in production builds.\n`);function Ft(e,t){Pt||"undefined"!=typeof window&&window["__@hello-pangea/dnd-disable-dev-warnings"]||console[e](...(e=>[Bt(e),"color: #00C584; font-size: 1.2em; font-weight: bold;","line-height: 1.5","color: #723874;"])(t))}const $t=Ft.bind(null,"warn"),Lt=Ft.bind(null,"error");function Mt(){}function jt(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 Gt="production"==='{NODE_ENV:"production"}'.NODE_ENV,Ut="Invariant failed";class Wt extends Error{}function zt(e,t){throw new Wt(Gt?Ut:`${Ut}: ${t||""}`)}Wt.prototype.toString=function(){return this.message};class qt extends m.default.Component{constructor(...e){super(...e),this.callbacks=null,this.unbind=Mt,this.onWindowError=e=>{const t=this.getCallbacks();t.isDragging()&&(t.tryAbort(),"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&$t("\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 Wt&&(e.preventDefault(),"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&Lt(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=jt(window,[{eventName:"error",fn:this.onWindowError}])}componentDidCatch(e){if(e instanceof Wt)return"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&Lt(e.message),void this.setState({});throw e}componentWillUnmount(){this.unbind()}render(){return this.props.children(this.setCallbacks)}}const Ht=e=>e+1,Yt=(e,t)=>{const n=e.droppableId===t.droppableId,r=Ht(e.index),o=Ht(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 `},Kt=(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 `,Zt=e=>`\n The item has returned to its starting position\n of ${Ht(e.index)}\n`,Jt=e=>`\n You have lifted an item in position ${Ht(e.source.index)}\n`,Xt=e=>{const t=e.destination;if(t)return Yt(e.source,t);const n=e.combine;return n?Kt(e.draggableId,e.source,n):"You are over an area that cannot be dropped on"},Qt=e=>{if("CANCEL"===e.reason)return`\n Movement cancelled.\n ${Zt(e.source)}\n `;const t=e.destination,n=e.combine;return t?`\n You have dropped the item.\n ${Yt(e.source,t)}\n `:n?`\n You have dropped the item.\n ${Kt(e.draggableId,e.source,n)}\n `:`\n The item has been dropped while not over a drop area.\n ${Zt(e.source)}\n `};function en(e,t){return e===t||!(!Number.isNaN(e)||!Number.isNaN(t))}function tn(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!en(e[n],t[n]))return!1;return!0}function nn(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&&tn(n,i.current.inputs))?i.current:{inputs:n,result:t()};return e.useEffect(()=>{o.current=!1,i.current=a},[a]),a.result}function rn(e,t){return nn(()=>e,t)}const on={x:0,y:0},an=(e,t)=>({x:e.x+t.x,y:e.y+t.y}),sn=(e,t)=>({x:e.x-t.x,y:e.y-t.y}),ln=(e,t)=>e.x===t.x&&e.y===t.y,cn=e=>({x:0!==e.x?-e.x:0,y:0!==e.y?-e.y:0}),un=(e,t,n=0)=>"x"===e?{x:t,y:n}:{x:n,y:t},dn=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2),pn=(e,t)=>Math.min(...t.map(t=>dn(e,t))),fn=e=>t=>({x:e(t.x),y:e(t.y)}),mn=(e,t)=>({top:e.top+t.y,left:e.left+t.x,bottom:e.bottom+t.y,right:e.right+t.x}),gn=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}],hn=(e,t)=>t&&t.shouldClipSubject?((e,t)=>{const n=yt({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):yt(e);var bn=({page:e,withPlaceholder:t,axis:n,frame:r})=>{const o=((e,t)=>t?mn(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:hn(i,r)}},En=(e,t)=>{e.frame||zt();const n=e.frame,r=sn(t,n.scroll.initial),o=cn(r),i={...n,scroll:{initial:n.scroll.initial,current:t,diff:{value:r,displacement:o},max:n.scroll.max}},a=bn({page:e.subject.page,withPlaceholder:e.subject.withPlaceholder,axis:e.axis,frame:i});return{...e,frame:i,subject:a}};function vn(e,t=tn){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 yn=vn(e=>e.reduce((e,t)=>(e[t.descriptor.id]=t,e),{})),Nn=vn(e=>e.reduce((e,t)=>(e[t.descriptor.id]=t,e),{})),xn=vn(e=>Object.values(e)),Dn=vn(e=>Object.values(e));var On=vn((e,t)=>{const n=Dn(t).filter(t=>e===t.descriptor.droppableId).sort((e,t)=>e.descriptor.index-t.descriptor.index);return n});function wn(e){return e.at&&"REORDER"===e.at.type?e.at.destination:null}function Sn(e){return e.at&&"COMBINE"===e.at.type?e.at.combine:null}var In=vn((e,t)=>t.filter(t=>t.descriptor.id!==e.descriptor.id)),_n=(e,t)=>e.descriptor.droppableId===t.descriptor.id;const Cn={point:on,value:0},An={invisible:{},visible:{},all:[]},Tn={displaced:An,displacedBy:Cn,at:null};var Pn=(e,t)=>n=>e<=n&&n<=t,Vn=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}},kn=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 Rn={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},Bn={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"},Fn=({target:e,destination:t,viewport:n,withDroppableDisplacement:r,isVisibleThroughFrameFn:o})=>{const i=r?((e,t)=>mn(e,t.frame?t.frame.scroll.diff.displacement:on))(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)},$n=e=>Fn({...e,isVisibleThroughFrameFn:kn});function Ln({afterDragging:e,destination:t,displacedBy:n,viewport:r,forceShouldAnimate:o,last:i}){return e.reduce(function(e,a){const s=function(e,t){return yt(Nt(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},!Fn({...c,isVisibleThroughFrameFn:Vn}))return e.invisible[a.descriptor.id]=!0,e;const u=((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:u},e},{all:[],visible:{},invisible:{}})}function Mn({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:An,displacedBy:n,at:{type:"REORDER",destination:{droppableId:r.descriptor.id,index:o}}}}function jn({draggable:e,insideDestination:t,destination:n,viewport:r,displacedBy:o,last:i,index:a,forceShouldAnimate:s}){const l=_n(e,n);if(null==a)return Mn({insideDestination:t,inHomeList:l,displacedBy:o,destination:n});const c=t.find(e=>e.descriptor.index===a);if(!c)return Mn({insideDestination:t,inHomeList:l,displacedBy:o,destination:n});const u=In(e,t),d=t.indexOf(c);return{displaced:Ln({afterDragging:u.slice(d),destination:n,displacedBy:o,last:i,viewport:r.frame,forceShouldAnimate:s}),displacedBy:o,at:{type:"REORDER",destination:{droppableId:n.descriptor.id,index:a}}}}function Gn(e,t){return Boolean(t.effected[e])}const Un=(e,t)=>t.margin[e.start]+t.borderBox[e.size]/2,Wn=(e,t,n)=>t[e.crossAxisStart]+n.margin[e.crossAxisStart]+n.borderBox[e.crossAxisSize]/2,zn=({axis:e,moveRelativeTo:t,isMoving:n})=>un(e.line,t.marginBox[e.end]+Un(e,n),Wn(e,t.marginBox,n)),qn=({axis:e,moveRelativeTo:t,isMoving:n})=>un(e.line,t.marginBox[e.start]-((e,t)=>t.margin[e.end]+t.borderBox[e.size]/2)(e,n),Wn(e,t.marginBox,n));var Hn=(e,t)=>{const n=e.frame;return n?an(t,n.scroll.diff.displacement):t},Yn=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=On(r.descriptor.id,n),a=t.page,s=r.axis;if(!i.length)return(({axis:e,moveInto:t,isMoving:n})=>un(e.line,t.contentBox[e.start]+Un(e,n),Wn(e,t.contentBox,n)))({axis:s,moveInto:r.page,isMoving:a});const{displaced:l,displacedBy:c}=e,u=l.all[0];if(u){const e=n[u];if(Gn(u,o))return qn({axis:s,moveRelativeTo:e.page,isMoving:a});const t=St(e.page,c.point);return qn({axis:s,moveRelativeTo:t,isMoving:a})}const d=i[i.length-1];if(d.descriptor.id===t.descriptor.id)return a.borderBox.center;if(Gn(d.descriptor.id,o)){const e=St(d.page,cn(o.displacedBy.point));return zn({axis:s,moveRelativeTo:e,isMoving:a})}return zn({axis:s,moveRelativeTo:d.page,isMoving:a})})({impact:e,draggable:t,draggables:r,droppable:n,afterCritical:o}):(({afterCritical:e,impact:t,draggables:n})=>{const r=Sn(t);r||zt();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 Gn(n,t)?o?on:cn(r.point):o?r.point:on})({displaced:t.displaced,afterCritical:e,combineWith:o,displacedBy:t.displacedBy});return an(i,a)})({impact:e,draggables:r,afterCritical:o}):i})(e),n=e.droppable;return n?Hn(n,t):t},Kn=(e,t)=>{const n=sn(t,e.scroll.initial),r=cn(n);return{frame:yt({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 Zn(e,t){return e.map(e=>t[e])}var Jn=({pageBorderBoxCenter:e,draggable:t,viewport:n})=>{const r=((e,t)=>an(e.scroll.diff.displacement,t))(n,e),o=sn(r,t.page.borderBox.center);return an(t.client.borderBox.center,o)},Xn=({draggable:e,destination:t,newPageBorderBoxCenter:n,viewport:r,withDroppableDisplacement:o,onlyOnMainAxis:i=!1})=>{const a=sn(n,e.page.borderBox.center),s={target:mn(e.page.borderBox,a),destination:t,withDroppableDisplacement:o,viewport:r};return i?(e=>{return Fn({...e,isVisibleThroughFrameFn:(t=e.destination.axis,e=>{const n=Pn(e.top,e.bottom),r=Pn(e.left,e.right);return e=>t===Rn?n(e.top)&&n(e.bottom):r(e.left)&&r(e.right)})});var t})(s):$n(s)};const Qn=e=>{const t=e.subject.active;return t||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot get clipped area from droppable"):zt()),t},er=(e,t)=>{const n=e.page.borderBox.center;return Gn(e.descriptor.id,t)?sn(n,t.displacedBy.point):n},tr=(e,t)=>{const n=e.page.borderBox;return Gn(e.descriptor.id,t)?mn(n,cn(t.displacedBy.point)):n};var nr=vn(function(e,t){const n=t[e.line];return{value:n,point:un(e.line,n)}});const rr=(e,t)=>({...e,scroll:{...e.scroll,max:t}}),or=(e,t,n)=>{const r=e.frame;_n(t,e)&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Should not add placeholder space to home list"):zt()),e.subject.withPlaceholder&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot add placeholder size to a subject when it already has one"):zt());const o=nr(e.axis,t.displaceBy).point,i=((e,t,n)=>{const r=e.axis;if("virtual"===e.descriptor.mode)return un(r.line,t[r.line]);const o=e.subject.page.contentBox[r.size],i=On(e.descriptor.id,n).reduce((e,t)=>e+t.client.marginBox[r.size],0)+t[r.line]-o;return i<=0?null:un(r.line,i)})(e,o,n),a={placeholderSize:o,increasedBy:i,oldFrameMaxScroll:e.frame?e.frame.scroll.max:null};if(!r){const t=bn({page:e.subject.page,withPlaceholder:a,axis:e.axis,frame:e.frame});return{...e,subject:t}}const s=i?an(r.scroll.max,i):r.scroll.max,l=rr(r,s),c=bn({page:e.subject.page,withPlaceholder:a,axis:e.axis,frame:l});return{...e,subject:c,frame:l}};var ir=e=>{const t=e.at;return t?"REORDER"===t.type?t.destination.droppableId:t.combine.droppableId:null};function ar(e){return"DRAGGING"===e.phase||"COLLECTING"===e.phase}function sr(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 lr=(e,t)=>yt(mn(e,t));function cr({displaced:e,id:t}){return Boolean(e.visible[t]||e.invisible[t])}var ur=({pageOffset:e,draggable:t,draggables:n,droppables:r,previousImpact:o,viewport:i,afterCritical:a})=>{const s=lr(t.page.borderBox,e),l=function({pageBorderBox:e,draggable:t,droppables:n}){const r=xn(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(sr(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]),u=c(s),d=c(l);return!u&&!d||(u?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=un(t.axis.line,e.center[n.line],t.page.borderBox.center[n.crossAxisLine]);return{id:t.descriptor.id,distance:dn(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 Tn;const c=r[l],u=On(c.descriptor.id,n),d=((e,t)=>{const n=e.frame;return n?lr(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=nr(r.axis,e.displaceBy),l=s.value,c=t[a.start],u=t[a.end],d=In(e,o).find(e=>{const t=e.descriptor.id,r=e.page.borderBox,o=r[a.size]/4,s=Gn(t,i),d=cr({displaced:n.displaced,id:t});return s?d?u>r[a.start]+o&&u<r[a.end]-o:c>r[a.start]-l+o&&c<r[a.end]-l-o:d?u>r[a.start]+l+o&&u<r[a.end]+l-o:c>r[a.start]+o&&c<r[a.end]-o});return d?{displacedBy:s,displaced:n.displaced,at:{type:"COMBINE",combine:{draggableId:d.descriptor.id,droppableId:r.descriptor.id}}}:null})({pageBorderBoxWithDroppableScroll:d,draggable:t,previousImpact:o,destination:c,insideDestination:u,afterCritical:a})||(({pageBorderBoxWithDroppableScroll:e,draggable:t,destination:n,insideDestination:r,last:o,viewport:i,afterCritical:a})=>{const s=n.axis,l=nr(n.axis,t.displaceBy),c=l.value,u=e[s.start],d=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:In(t,r).find(e=>{const t=e.descriptor.id,n=e.page.borderBox.center[s.line],r=Gn(t,a),i=cr({displaced:o,id:t});return r?i?d<=n:u<n-c:i?d<=n+c:u<n})||null,inHomeList:_n(t,n)});return jn({draggable:t,insideDestination:r,destination:n,viewport:i,last:o,displacedBy:l,index:p})})({pageBorderBoxWithDroppableScroll:d,draggable:t,destination:c,insideDestination:u,last:o.displaced,viewport:i,afterCritical:a})},dr=(e,t)=>({...e,[t.descriptor.id]:t}),pr=({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=sn(l,e.initial.client.selection),u={offset:c,selection:l,borderBoxCenter:an(e.initial.client.borderBoxCenter,c)},d={selection:an(u.selection,a.scroll.current),borderBoxCenter:an(u.borderBoxCenter,a.scroll.current),offset:an(u.offset,a.scroll.diff.value)},p={client:u,page:d};if("COLLECTING"===e.phase)return{...e,dimensions:s,viewport:a,current:p};const f=s.draggables[e.critical.draggable.id],m=o||ur({pageOffset:d.offset,draggable:f,draggables:s.draggables,droppables:s.droppables,previousImpact:e.impact,viewport:a,afterCritical:e.afterCritical}),g=(({draggable:e,draggables:t,droppables:n,previousImpact:r,impact:o})=>{const i=(({previousImpact:e,impact:t,droppables:n})=>{const r=ir(e),o=ir(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?zt(0,"Cannot remove placeholder form subject when there was none"):zt());const n=e.frame;if(!n){const t=bn({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?zt(0,"Expected droppable with frame to have old max frame scroll when removing placeholder"):zt());const o=rr(n,r),i=bn({page:e.subject.page,axis:e.axis,frame:o,withPlaceholder:null});return{...e,subject:i,frame:o}})(i);return dr(n,a)})({previousImpact:r,impact:o,droppables:n}),a=ir(o);if(!a)return i;const s=n[a];if(_n(e,s))return i;if(s.subject.withPlaceholder)return i;const l=or(s,e,t);return dr(i,l)})({draggable:f,impact:m,previousImpact:e.impact,draggables:s.draggables,droppables:s.droppables});return{...e,current:p,dimensions:{draggables:s.draggables,droppables:g},impact:m,viewport:a,scrollJumpRequest:i||null,forceShouldAnimate:!i&&null}},fr=({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=Ln({afterDragging:a,destination:r,displacedBy:e.displacedBy,viewport:t.frame,forceShouldAnimate:o,last:i});return{...e,displaced:s}},mr=({impact:e,draggable:t,droppable:n,draggables:r,viewport:o,afterCritical:i})=>{const a=Yn({impact:e,draggable:t,draggables:r,droppable:n,afterCritical:i});return Jn({pageBorderBoxCenter:a,draggable:t,viewport:o})},gr=({state:e,dimensions:t,viewport:n})=>{"SNAP"!==e.movementMode&&zt();const r=e.impact,o=n||e.viewport,i=t||e.dimensions,{draggables:a,droppables:s}=i,l=a[e.critical.draggable.id],c=ir(r);c||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Must be over a destination in SNAP movement mode"):zt());const u=s[c],d=fr({impact:r,viewport:o,destination:u,draggables:a}),p=mr({impact:d,draggable:l,droppable:u,draggables:a,viewport:o,afterCritical:e.afterCritical});return pr({impact:d,clientSelection:p,state:e,dimensions:i,viewport:o})},hr=({draggable:e,home:t,draggables:n,viewport:r})=>{const o=nr(t.axis,e.displaceBy),i=On(t.descriptor.id,n),a=i.indexOf(e);-1===a&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Expected draggable to be inside home list"):zt());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 u;return{impact:{displaced:Ln({afterDragging:s,destination:t,displacedBy:o,last:null,viewport:r.frame,forceShouldAnimate:!1}),displacedBy:o,at:{type:"REORDER",destination:(u=e.descriptor,{index:u.index,droppableId:u.droppableId})}},afterCritical:c}};const br=e=>"SNAP"===e.movementMode,Er=(e,t,n)=>{const r=((e,t)=>({draggables:e.draggables,droppables:dr(e.droppables,t)}))(e.dimensions,t);return!br(e)||n?pr({state:e,dimensions:r}):gr({state:e,dimensions:r})};function vr(e){return e.isDragging&&"SNAP"===e.movementMode?{...e,scrollJumpRequest:null}:e}const yr={phase:"IDLE",completed:null,shouldFlush:!1};var Nr=(e=yr,t)=>{if("FLUSH"===t.type)return{...yr,shouldFlush:!0};if("INITIAL_PUBLISH"===t.type){"IDLE"!==e.phase&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"INITIAL_PUBLISH must come after a IDLE phase"):zt());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:on},u={client:c,page:{selection:an(c.selection,o.scroll.initial),borderBoxCenter:an(c.selection,o.scroll.initial),offset:an(c.selection,o.scroll.diff.value)}},d=xn(i.droppables).every(e=>!e.isFixedOnPage),{impact:p,afterCritical:f}=hr({draggable:s,home:l,draggables:i.draggables,viewport:o});return{phase:"DRAGGING",isDragging:!0,critical:n,movementMode:a,dimensions:i,initial:u,current:u,isWindowScrollAllowed:d,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?zt(0,`Collection cannot start from phase ${e.phase}`):zt()),{...e,phase:"COLLECTING"});if("PUBLISH_WHILE_DRAGGING"===t.type)return"COLLECTING"!==e.phase&&"DROP_PENDING"!==e.phase&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,`Unexpected ${t.type} received in phase ${e.phase}`):zt()),(({state:e,published:t})=>{const n=t.modified.map(t=>En(e.dimensions.droppables[t.droppableId],t.scroll)),r={...e.dimensions.droppables,...yn(n)},o=Nn((({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?zt(0,"Expected Droppable to have a frame"):zt()),t})(t[e.descriptor.droppableId]),i=(({draggable:e,offset:t,initialWindowScroll:n})=>{const r=St(e.client,t),o=It(r,n);return{...e,placeholder:{...e.placeholder,client:r},client:r,page:o}})({draggable:e,offset:an(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=ir(e.impact),l=s?a.droppables[s]:null,c=a.draggables[e.critical.draggable.id],u=a.droppables[e.critical.droppable.id],{impact:d,afterCritical:p}=hr({draggable:c,home:u,draggables:i,viewport:e.viewport}),f=ur({pageOffset:e.current.page.offset,draggable:a.draggables[e.critical.draggable.id],draggables:a.draggables,droppables:a.droppables,previousImpact:l&&l.isCombineEnabled?e.impact:d,viewport:e.viewport,afterCritical:p}),m={...e,phase:"DRAGGING",impact:f,onLiftImpact:d,dimensions:a,afterCritical:p,forceShouldAnimate:!1};return"COLLECTING"===e.phase?m:{...m,phase:"DROP_PENDING",reason:e.reason,isWaiting:!1}})({state:e,published:t.payload});if("MOVE"===t.type){if("DROP_PENDING"===e.phase)return e;ar(e)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,`${t.type} not permitted in phase ${e.phase}`):zt());const{client:n}=t.payload;return ln(n,e.current.client.selection)?e:pr({state:e,clientSelection:n,impact:br(e)?e.impact:null})}if("UPDATE_DROPPABLE_SCROLL"===t.type){if("DROP_PENDING"===e.phase)return vr(e);if("COLLECTING"===e.phase)return vr(e);ar(e)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,`${t.type} not permitted in phase ${e.phase}`):zt());const{id:n,newScroll:r}=t.payload,o=e.dimensions.droppables[n];if(!o)return e;const i=En(o,r);return Er(e,i,!1)}if("UPDATE_DROPPABLE_IS_ENABLED"===t.type){if("DROP_PENDING"===e.phase)return e;ar(e)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,`Attempting to move in an unsupported phase ${e.phase}`):zt());const{id:n,isEnabled:r}=t.payload,o=e.dimensions.droppables[n];o||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,`Cannot find Droppable[id: ${n}] to toggle its enabled state`):zt()),o.isEnabled===r&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,`Trying to set droppable isEnabled to ${String(r)}\n but it is already ${String(o.isEnabled)}`):zt());const i={...o,isEnabled:r};return Er(e,i,!0)}if("UPDATE_DROPPABLE_IS_COMBINE_ENABLED"===t.type){if("DROP_PENDING"===e.phase)return e;ar(e)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,`Attempting to move in an unsupported phase ${e.phase}`):zt());const{id:n,isCombineEnabled:r}=t.payload,o=e.dimensions.droppables[n];o||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,`Cannot find Droppable[id: ${n}] to toggle its isCombineEnabled state`):zt()),o.isCombineEnabled===r&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,`Trying to set droppable isCombineEnabled to ${String(r)}\n but it is already ${String(o.isCombineEnabled)}`):zt());const i={...o,isCombineEnabled:r};return Er(e,i,!0)}if("MOVE_BY_WINDOW_SCROLL"===t.type){if("DROP_PENDING"===e.phase||"DROP_ANIMATING"===e.phase)return e;ar(e)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,`Cannot move by window in phase ${e.phase}`):zt()),e.isWindowScrollAllowed||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Window scrolling is currently not supported for fixed lists"):zt());const n=t.payload.newScroll;if(ln(e.viewport.scroll.current,n))return vr(e);const r=Kn(e.viewport,n);return br(e)?gr({state:e,viewport:r}):pr({state:e,viewport:r})}if("UPDATE_VIEWPORT_MAX_SCROLL"===t.type){if(!ar(e))return e;const n=t.payload.maxScroll;if(ln(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?zt(0,`${t.type} received while not in DRAGGING phase`):zt());const n=(({state:e,type:t})=>{const n=((e,t)=>{const n=ir(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:u,droppables:d}=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=On(n.descriptor.id,r),u=_n(t,n),d=(({isMovingForward:e,draggable:t,destination:n,insideDestination:r,previousImpact:o})=>{if(!n.isCombineEnabled)return null;if(!wn(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=In(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?zt(0,"Could not find displaced item in set"):zt());const u=c-1;return u<0?null:i(l[u].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?zt(0,"Cannot move in direction without previous impact location"):zt()),"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:jn({draggable:n,insideDestination:i,destination:o,viewport:s,last:a.displaced,displacedBy:a.displacedBy,index:r})}const u=(({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 Gn(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==u?null:jn({draggable:n,insideDestination:i,destination:o,viewport:s,last:a.displaced,displacedBy:a.displacedBy,index:u})})({isMovingForward:e,isInHomeList:u,draggable:t,draggables:r,destination:n,insideDestination:c,previousImpact:o,viewport:i,afterCritical:l});if(!d)return null;const p=Yn({impact:d,draggable:t,droppable:n,draggables:r,afterCritical:l});if(Xn({draggable:t,destination:n,newPageBorderBoxCenter:p,viewport:i.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0}))return{clientSelection:Jn({pageBorderBoxCenter:p,draggable:t,viewport:i}),impact:d,scrollJumpRequest:null};const f=sn(p,a),m=(({impact:e,viewport:t,destination:n,draggables:r,maxScrollChange:o})=>{const i=Kn(t,an(t.scroll.current,o)),a=n.frame?En(n,an(n.frame.scroll.current,o)):n,s=e.displaced,l=Ln({afterDragging:Zn(s.all,r),destination:n,displacedBy:e.displacedBy,viewport:i.frame,last:s,forceShouldAnimate:!1}),c=Ln({afterDragging:Zn(s.all,r),destination:a,displacedBy:e.displacedBy,viewport:t.frame,last:s,forceShouldAnimate:!1}),u={},d={},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?d[e]=t:u[e]=!0}),{...e,displaced:{all:s.all,invisible:u,visible:d}}})({impact:d,viewport:i,destination:n,draggables:r,maxScrollChange:f});return{clientSelection:s,impact:m,scrollJumpRequest:f}})({isMovingForward:s,previousPageBorderBoxCenter:c,draggable:l,destination:o,draggables:u,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=xn(r).filter(e=>e!==n).filter(e=>e.isEnabled).filter(e=>Boolean(e.subject.active)).filter(e=>Vn(o.frame)(Qn(e))).filter(t=>{const n=Qn(t);return e?i[a.crossAxisEnd]<n[a.crossAxisEnd]:n[a.crossAxisStart]<i[a.crossAxisStart]}).filter(e=>{const t=Qn(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=Qn(t)[a.crossAxisStart],o=Qn(n)[a.crossAxisStart];return e?r-o:o-r}).filter((e,t,n)=>Qn(e)[a.crossAxisStart]===Qn(n[0])[a.crossAxisStart]);if(!l.length)return null;if(1===l.length)return l[0];const c=l.filter(e=>Pn(Qn(e)[a.start],Qn(e)[a.end])(t[a.line]));return 1===c.length?c[0]:c.length>1?c.sort((e,t)=>Qn(e)[a.start]-Qn(t)[a.start])[0]:l.sort((e,n)=>{const r=pn(t,gn(Qn(e))),o=pn(t,gn(Qn(n)));return r!==o?r-o:Qn(e)[a.start]-Qn(n)[a.start]})[0]})({isMovingForward:e,pageBorderBoxCenter:t,source:r,droppables:i,viewport:a});if(!l)return null;const c=On(l.descriptor.id,o),u=(({pageBorderBoxCenter:e,viewport:t,destination:n,insideDestination:r,afterCritical:o})=>{const i=r.filter(e=>$n({target:tr(e,o),destination:n,viewport:t.frame,withDroppableDisplacement:!0})).sort((t,r)=>{const i=dn(e,Hn(n,er(t,o))),a=dn(e,Hn(n,er(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}),d=(({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:An,displacedBy:Cn,at:{type:"REORDER",destination:{droppableId:i.descriptor.id,index:0}}},t=Yn({impact:e,draggable:r,droppable:i,draggables:o,afterCritical:s}),l=_n(r,i)?i:or(i,r,o);return Xn({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})(),u=nr(i.axis,r.displaceBy);return jn({draggable:r,insideDestination:n,destination:i,viewport:a,displacedBy:u,last:An,index:c})})({previousPageBorderBoxCenter:t,destination:l,draggable:n,draggables:o,moveRelativeTo:u,insideDestination:c,viewport:a,afterCritical:s});if(!d)return null;const p=Yn({impact:d,draggable:n,droppable:l,draggables:o,afterCritical:s});return{clientSelection:Jn({pageBorderBoxCenter:p,draggable:n,viewport:a}),impact:d,scrollJumpRequest:null}})({isMovingForward:s,previousPageBorderBoxCenter:c,draggable:l,isOver:o,draggables:u,droppables:d,viewport:e.viewport,afterCritical:e.afterCritical})})({state:e,type:t.type});return n?pr({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?zt(0,"Can only move into the DROP_PENDING phase from the COLLECTING phase"):zt()),{...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?zt(0,`Cannot animate drop from phase ${e.phase}`):zt()),{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 xr(e,t){return e instanceof Object&&"type"in e&&e.type===t}const Dr=e=>({type:"PUBLISH_WHILE_DRAGGING",payload:e}),Or=()=>({type:"COLLECTION_STARTING",payload:null}),wr=e=>({type:"UPDATE_DROPPABLE_SCROLL",payload:e}),Sr=e=>({type:"UPDATE_DROPPABLE_IS_ENABLED",payload:e}),Ir=e=>({type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:e}),_r=e=>({type:"MOVE",payload:e}),Cr=()=>({type:"MOVE_UP",payload:null}),Ar=()=>({type:"MOVE_DOWN",payload:null}),Tr=()=>({type:"MOVE_RIGHT",payload:null}),Pr=()=>({type:"MOVE_LEFT",payload:null}),Vr=e=>({type:"DROP_COMPLETE",payload:e}),kr=e=>({type:"DROP",payload:e}),Rr="cubic-bezier(.2,1,.1,1)",Br={outOfTheWay:.2,minDropTime:.33,maxDropTime:.55},Fr=`${Br.outOfTheWay}s cubic-bezier(0.2, 0, 0, 1)`,$r={fluid:`opacity ${Fr}`,snap:`transform ${Fr}, opacity ${Fr}`,drop:e=>{const t=`${e}s ${Rr}`;return`transform ${t}, opacity ${t}`},outOfTheWay:`transform ${Fr}`,placeholder:`height ${Fr}, width ${Fr}, margin ${Fr}`},Lr=e=>ln(e,on)?void 0:`translate(${e.x}px, ${e.y}px)`,Mr=Lr,{minDropTime:jr,maxDropTime:Gr}=Br,Ur=Gr-jr,Wr=({getState:e,dispatch:t})=>n=>r=>{if(!xr(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?zt(0,"A DROP action occurred while DROP_PENDING and still waiting"):zt()),"DRAGGING"!==o.phase&&"DROP_PENDING"!==o.phase&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,`Cannot drop in phase: ${o.phase}`):zt());const s=o.critical,l=o.dimensions,c=l.draggables[o.critical.draggable.id],{impact:u,didDropInsideDroppable:d}=(({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:An},didDropInsideDroppable:!0}:{impact:fr({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=d?wn(u):null,f=d?Sn(u):null,m={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},g=(({impact:e,draggable:t,dimensions:n,viewport:r,afterCritical:o})=>{const{draggables:i,droppables:a}=n,s=ir(e),l=mr({impact:e,draggable:t,draggables:i,afterCritical:o,droppable:(s?a[s]:null)||a[t.descriptor.droppableId],viewport:r});return sn(l,t.client.borderBox.center)})({impact:u,draggable:c,dimensions:l,viewport:o.viewport,afterCritical:o.afterCritical}),h={critical:o.critical,afterCritical:o.afterCritical,result:m,impact:u};if(ln(o.current.client.offset,g)&&!Boolean(m.combine))return void t(Vr({completed:h}));const b=(({current:e,destination:t,reason:n})=>{const r=dn(e,t);if(r<=0)return jr;if(r>=1500)return Gr;const o=jr+Ur*(r/1500);return Number(("CANCEL"===n?.6*o:o).toFixed(2))})({current:o.current.client.offset,destination:g,reason:i});t((e=>({type:"DROP_ANIMATE",payload:e}))({newHomeClientOffset:g,dropDuration:b,completed:h}))};var zr=()=>({x:window.pageXOffset,y:window.pageYOffset});const qr=e=>{const t=function({onWindowScroll:e}){const t=At(function(){e(zr())}),n=function(e){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:t=>{t.target!==window&&t.target!==window.document||e()}}}(t);let r=Mt;function o(){return r!==Mt}return{start:function(){o()&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot start scroll listener when already active"):zt()),r=jt(window,[n])},stop:function(){o()||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot stop scroll listener when not active"):zt()),t.cancel(),r(),r=Mt},isActive:o}}({onWindowScroll:t=>{e.dispatch({type:"MOVE_BY_WINDOW_SCROLL",payload:{newScroll:t}})}});return e=>n=>{!t.isActive()&&xr(n,"INITIAL_PUBLISH")&&t.start(),t.isActive()&&(e=>xr(e,"DROP_COMPLETE")||xr(e,"DROP_ANIMATE")||xr(e,"FLUSH"))(n)&&t.stop(),e(n)}},Hr=(e,t)=>{t()},Yr=(e,t)=>({draggableId:e.draggable.id,type:e.droppable.type,source:{droppableId:e.droppable.id,index:e.draggable.index},mode:t});function Kr(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&&$t("Announcement already made. Not making a second announcement"):n?"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&$t("\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 Zr=e=>t=>n=>{if(!xr(n,"DROP_ANIMATION_FINISHED"))return void t(n);const r=e.getState();"DROP_ANIMATING"!==r.phase&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot finish a drop animating when no drop is occurring"):zt()),e.dispatch(Vr({completed:r.completed}))},Jr=e=>{let t=null,n=null;return r=>o=>{if((xr(o,"FLUSH")||xr(o,"DROP_COMPLETE")||xr(o,"DROP_ANIMATION_FINISHED"))&&(n&&(cancelAnimationFrame(n),n=null),t&&(t(),t=null)),r(o),!xr(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=jt(window,[i])})}},Xr=e=>t=>n=>{if(t(n),!xr(n,"PUBLISH_WHILE_DRAGGING"))return;const r=e.getState();"DROP_PENDING"===r.phase&&(r.isWaiting||e.dispatch(kr({reason:r.reason})))},Qr="production"!=='{NODE_ENV:"production"}'.NODE_ENV&&"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({name:"@hello-pangea/dnd"}):oe;var eo=({scrollHeight:e,scrollWidth:t,height:n,width:r})=>{const o=sn({x:t,y:e},{x:r,y:n});return{x:Math.max(0,o.x),y:Math.max(0,o.y)}},to=()=>{const e=document.documentElement;return e||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot find document.documentElement"):zt()),e},no=()=>{const e=to();return eo({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,width:e.clientWidth,height:e.clientHeight})};function ro(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&&$t(`\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 oo=(e,t)=>"IDLE"===e.phase||"DROP_ANIMATING"===e.phase&&e.completed.result.draggableId!==t&&"DROP"===e.completed.result.reason,io=e=>{window.scrollBy(e.x,e.y)};const ao=vn(e=>xn(e).filter(e=>!!e.isEnabled&&!!e.frame)),so={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:e=>e**2,durationDampening:{stopDampeningAt:1200,accelerateAt:360},disabled:!1};var lo=({startOfRange:e,endOfRange:t,current:n})=>{const r=t-e;return 0===r?("production"!=='{NODE_ENV:"production"}'.NODE_ENV&&$t("\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},co=({distanceToEdge:e,thresholds:t,dragStartTime:n,shouldUseTimeDampening:r,getAutoScrollerOptions:o})=>{const i=((e,t,n=()=>so)=>{const r=n();if(e>t.startScrollingFrom)return 0;if(e<=t.maxScrollValueAt)return r.maxPixelScroll;if(e===t.startScrollingFrom)return 1;const o=lo({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=lo({startOfRange:o,endOfRange:s,current:l}),u=e*r.ease(c);return Math.ceil(u)})(i,n,o),1):i},uo=({container:e,distanceToEdges:t,dragStartTime:n,axis:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const a=((e,t,n=()=>so)=>{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]?co({distanceToEdge:t[r.end],thresholds:a,dragStartTime:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i}):-1*co({distanceToEdge:t[r.start],thresholds:a,dragStartTime:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i})};const po=fn(e=>0===e?0:e);var fo=({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=uo({container:t,distanceToEdges:a,dragStartTime:e,axis:Rn,shouldUseTimeDampening:o,getAutoScrollerOptions:i}),l=uo({container:t,distanceToEdges:a,dragStartTime:e,axis:Bn,shouldUseTimeDampening:o,getAutoScrollerOptions:i}),c=po({x:l,y:s});if(ln(c,on))return null;const u=(({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 u?ln(u,on)?null:u:null};const mo=fn(e=>0===e?0:e>0?1:-1),go=(()=>{const e=(e,t)=>e<0?e:e>t?e-t:0;return({current:t,max:n,change:r})=>{const o=an(t,r),i={x:e(o.x,n.x),y:e(o.y,n.y)};return ln(i,on)?null:i}})(),ho=({max:e,current:t,change:n})=>{const r={x:Math.max(t.x,e.x),y:Math.max(t.y,e.y)},o=mo(n),i=go({max:r,current:t,change:o});return!i||0!==o.x&&0===i.x||0!==o.y&&0===i.y},bo=(e,t)=>ho({current:e.scroll.current,max:e.scroll.max,change:t}),Eo=(e,t)=>{const n=e.frame;return!!n&&ho({current:n.scroll.current,max:n.scroll.max,change:t})};var vo=({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=fo({dragStartTime:r,container:e.frame,subject:t,center:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i});return a&&bo(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=ao(t).find(t=>(t.frame||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Invalid result"):zt()),sr(t.frame.pageMarginBox)(e)))||null;return n})(e,n);return r})({center:a,destination:ir(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=fo({dragStartTime:r,container:a.pageMarginBox,subject:t,center:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i});return s&&Eo(e,s)?s:null})({dragStartTime:t,droppable:l,subject:s,center:a,shouldUseTimeDampening:n,getAutoScrollerOptions:i});c&&o(l.descriptor.id,c)};const yo="data-rfd",No=(()=>{const e=`${yo}-drag-handle`;return{base:e,draggableId:`${e}-draggable-id`,contextId:`${e}-context-id`}})(),xo=(()=>{const e=`${yo}-draggable`;return{base:e,contextId:`${e}-context-id`,id:`${e}-id`}})(),Do=(()=>{const e=`${yo}-droppable`;return{base:e,contextId:`${e}-context-id`,id:`${e}-id`}})(),Oo={contextId:`${yo}-scroll-container-context-id`},wo=(e,t)=>e.map(e=>{const n=e.styles[t];return n?`${e.selector} { ${n} }`:""}).join(" "),So="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?zt(0,"Cannot find the head to append a style to"):zt()),e},_o=e=>{const t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.type="text/css",t};function Co(e,t){return Array.from(e.querySelectorAll(t))}var Ao=e=>e&&e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView:window;function To(e){return e instanceof Ao(e).HTMLElement}function Po(e,t){const n=Co(document,`[${No.contextId}="${e}"]`);if(!n.length)return"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&$t(`Unable to find any drag handles in the context "${e}"`),null;const r=n.find(e=>e.getAttribute(No.draggableId)===t);return r?To(r)?r:("production"!=='{NODE_ENV:"production"}'.NODE_ENV&&$t("drag handle needs to be a HTMLElement"),null):("production"!=='{NODE_ENV:"production"}'.NODE_ENV&&$t(`Unable to find drag handle with id "${t}" as no handle with a matching id was found`),null)}function Vo(){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?zt(0,`Cannot find draggable entry with id [${e}]`):zt()),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?zt(0,`Cannot find droppable entry with id [${e}]`):zt()),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 ko=m.default.createContext(null),Ro=()=>{const e=document.body;return e||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot find document.body"):zt()),e};const Bo={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},Fo={separator:"::"};function $o(e,t=Fo){const n=m.default.useId();return nn(()=>`${e}${t.separator}${n}`,[t.separator,e,n])}var Lo=m.default.createContext(null);const Mo=/(\d+)\.(\d+)\.(\d+)/,jo=e=>{const t=Mo.exec(e);return null==t&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,`Unable to parse React version ${e}`):zt()),{major:Number(t[1]),minor:Number(t[2]),patch:Number(t[3]),raw:e}},Go="\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 Uo(e){"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&e()}function Wo(t,n){Uo(()=>{e.useEffect(()=>{try{t()}catch(e){Lt(`\n A setup problem was encountered.\n\n > ${e.message}\n `)}},n)})}function zo(t){const n=e.useRef(t);return e.useEffect(()=>{n.current=t}),n}function qo(e){return"IDLE"!==e.phase&&"DROP_ANIMATING"!==e.phase&&e.isDragging}const Ho=9,Yo=13,Ko=33,Zo=34,Jo=35,Xo=36,Qo={[Yo]:!0,[Ho]:!0};var ei=e=>{Qo[e.keyCode]&&e.preventDefault()};const ti=(()=>{const e="visibilitychange";return"undefined"==typeof document?e:[e,`ms${e}`,`webkit${e}`,`moz${e}`,`o${e}`].find(e=>`on${e}`in document)||e})(),ni={type:"IDLE"};function ri(){}const oi={[Zo]:!0,[Ko]:!0,[Xo]:!0,[Jo]:!0},ii={type:"IDLE"},ai=["input","button","textarea","select","option","optgroup","video","audio"];function si(e,t){if(null==t)return!1;if(ai.includes(t.tagName.toLowerCase()))return!0;const n=t.getAttribute("contenteditable");return"true"===n||""===n||t!==e&&si(e,t.parentElement)}function li(e,t){const n=t.target;return!!To(n)&&si(e,n)}var ci=e=>yt(e.getBoundingClientRect()).center;const ui=(()=>{const e="matches";return"undefined"==typeof document?e:[e,"msMatchesSelector","webkitMatchesSelector"].find(e=>e in Element.prototype)||e})();function di(e,t){return null==e?null:e[ui](t)?e:di(e.parentElement,t)}function pi(e,t){return e.closest?e.closest(t):di(e,t)}function fi(e){e.preventDefault()}function mi({expected:e,phase:t,isLockActive:n,shouldWarn:r}){return n()?e===t||(r&&"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&$t(`\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&&$t("\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 gi({lockAPI:e,store:t,registry:n,draggableId:r}){if(e.isClaimed())return!1;const o=n.draggable.findById(r);return o?!!o.options.isEnabled&&!!oo(t.getState(),r):("production"!=='{NODE_ENV:"production"}'.NODE_ENV&&$t(`Unable to find draggable with id: ${r}`),!1)}const hi=[function(t){const n=e.useRef(ni),r=e.useRef(Mt),o=nn(()=>({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(),u(o,i)}}),[t]),i=nn(()=>({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=rn(function(){r.current=jt(window,[i,o],{passive:!1,capture:!0})},[i,o]),s=rn(()=>{"IDLE"!==n.current.type&&(n.current=ni,r.current(),a())},[a]),l=rn(()=>{const e=n.current;s(),"DRAGGING"===e.type&&e.actions.cancel({shouldBlockNextClick:!0}),"PENDING"===e.type&&e.actions.abort()},[s]),c=rn(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?zt(0,"Cannot be IDLE"):zt()),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 u=s.actions.fluidLift(a);r({type:"DRAGGING",actions:u})}},{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 ei(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?zt(0,"Unexpected phase"):zt()),r.actions.shouldRespectForcePress()?e():t.preventDefault()}},{eventName:ti,fn:e}]}({cancel:l,completed:s,getPhase:()=>n.current,setPhase:e=>{n.current=e}});r.current=jt(window,e,{capture:!0,passive:!1})},[l,s]),u=rn(function(e,t){"IDLE"!==n.current.type&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Expected to move from IDLE to PENDING drag"):zt()),n.current={type:"PENDING",point:t,actions:e},c()},[c]);So(function(){return a(),function(){r.current()}},[a])},function(t){const n=e.useRef(ri),r=nn(()=>({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?zt(0,"Cannot stop capturing a keyboard drag when not capturing"):zt()),a=!1,n.current(),o()}n.current(),n.current=jt(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(oi[r.keyCode]?r.preventDefault():ei(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:ti,fn:n}]}(s,l),{capture:!0,passive:!1})}}),[t]),o=rn(function(){n.current=jt(window,[r],{passive:!1,capture:!0})},[r]);So(function(){return o(),function(){n.current()}},[o])},function(t){const n=e.useRef(ii),r=e.useRef(Mt),o=rn(function(){return n.current},[]),i=rn(function(e){n.current=e},[]),a=nn(()=>({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=rn(function(){r.current=jt(window,[a],{capture:!0,passive:!1})},[a]),l=rn(()=>{const e=n.current;"IDLE"!==e.type&&("PENDING"===e.type&&clearTimeout(e.longPressTimerId),i(ii),r.current(),s())},[s,i]),c=rn(()=>{const e=n.current;l(),"DRAGGING"===e.type&&e.actions.cancel({shouldBlockNextClick:!0}),"PENDING"===e.type&&e.actions.abort()},[l]),u=rn(function(){const e={capture:!0,passive:!1},t={cancel:c,completed:l,getPhase:o},n=jt(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&&zt();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:ti,fn:e}]}(t),e),i=jt(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:ti,fn:e}]}(t),e);r.current=function(){n(),i()}},[c,o,l]),d=rn(function(){const e=o();"PENDING"!==e.type&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,`Cannot start dragging from phase ${e.type}`):zt());const t=e.actions.fluidLift(e.point);i({type:"DRAGGING",actions:t,hasMoved:!1})},[o,i]),p=rn(function(e,t){"IDLE"!==o().type&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Expected to move from IDLE to PENDING drag"):zt());const n=setTimeout(d,120);i({type:"PENDING",point:t,actions:e,longPressTimerId:n}),u()},[u,o,i,d]);So(function(){return s(),function(){r.current();const e=o();"PENDING"===e.type&&(clearTimeout(e.longPressTimerId),i(ii))}},[o,s,i]),So(function(){return jt(window,[{eventName:"touchmove",fn:()=>{},options:{capture:!1,passive:!1}}])},[])}];function bi({contextId:t,store:n,registry:r,customSensors:o,enableDefaultSensors:i}){const a=[...i?hi:[],...o||[]],s=e.useState(()=>function(){let e=null;function t(){e||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot release lock when there is no lock"):zt()),e=null}return{isClaimed:function(){return Boolean(e)},isActive:function(t){return t===e},claim:function(t){e&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot claim lock as it is already claimed"):zt());const n={abandon:t};return e=n,n},release:t,tryAbandon:function(){e&&(e.abandon(),t())}}}())[0],l=rn(function(e,t){qo(e)&&!qo(t)&&s.tryAbandon()},[s]);So(function(){let e=n.getState();return n.subscribe(()=>{const t=n.getState();l(e,t),e=t})},[s,n,l]),So(()=>s.tryAbandon,[s.tryAbandon]);const c=rn(e=>gi({lockAPI:s,registry:r,store:n,draggableId:e}),[s,r,n]),u=rn((e,o,i)=>function({lockAPI:e,contextId:t,store:n,registry:r,draggableId:o,forceSensorStop:i,sourceEvent:a}){if(!gi({lockAPI:e,store:n,registry:r,draggableId:o}))return null;const s=r.draggable.getById(o),l=function(e,t){const n=Co(document,`[${xo.contextId}="${e}"]`).find(e=>e.getAttribute(xo.id)===t);return n?To(n)?n:("production"!=='{NODE_ENV:"production"}'.NODE_ENV&&$t("Draggable element is not a HTMLElement"),null):null}(t,s.descriptor.id);if(!l)return"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&$t(`Unable to find draggable element with id: ${o}`),null;if(a&&!s.options.canDragInteractiveElements&&li(l,a))return null;const c=e.claim(i||Mt);let u="PRE_DRAG";function d(){return s.options.shouldRespectForcePress}function p(){return e.isActive(c)}const f=function(e,t){mi({expected:e,phase:u,isLockActive:p,shouldWarn:!0})&&n.dispatch(t())}.bind(null,"DRAGGING");function m(t){function r(){e.release(),u="COMPLETED"}function o(e,o={shouldBlockNextClick:!1}){if(t.cleanup(),o.shouldBlockNextClick){const e=jt(window,[{eventName:"click",fn:fi,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(e)}r(),n.dispatch(kr({reason:e}))}return"PRE_DRAG"!==u&&(r(),"production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,`Cannot lift in phase ${u}`):zt()),n.dispatch((e=>({type:"LIFT",payload:e}))(t.liftActionArgs)),u="DRAGGING",{isActive:()=>mi({expected:"DRAGGING",phase:u,isLockActive:p,shouldWarn:!1}),shouldRespectForcePress:d,drop:e=>o("DROP",e),cancel:e=>o("CANCEL",e),...t.actions}}return{isActive:()=>mi({expected:"PRE_DRAG",phase:u,isLockActive:p,shouldWarn:!1}),shouldRespectForcePress:d,fluidLift:function(e){const t=At(e=>{f(()=>_r({client:e}))});return{...m({liftActionArgs:{id:o,clientSelection:e,movementMode:"FLUID"},cleanup:()=>t.cancel(),actions:{move:t}}),move:t}},snapLift:function(){const e={moveUp:()=>f(Cr),moveRight:()=>f(Tr),moveDown:()=>f(Ar),moveLeft:()=>f(Pr)};return m({liftActionArgs:{id:o,clientSelection:ci(l),movementMode:"SNAP"},cleanup:Mt,actions:e})},abort:function(){mi({expected:"PRE_DRAG",phase:u,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]),d=rn(e=>function(e,t){const n=function(e,t){const n=t.target;if(!((r=n)instanceof Ao(r).Element))return"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&$t("event.target must be a Element"),null;var r;const o=function(e){return`[${No.contextId}="${e}"]`}(e),i=pi(n,o);return i?To(i)?i:("production"!=='{NODE_ENV:"production"}'.NODE_ENV&&$t("drag handle must be a HTMLElement"),null):null}(e,t);return n?n.getAttribute(No.draggableId):null}(t,e),[t]),p=rn(e=>{const t=r.draggable.findById(e);return t?t.options:null},[r.draggable]),f=rn(function(){s.isClaimed()&&(s.tryAbandon(),"IDLE"!==n.getState().phase&&n.dispatch({type:"FLUSH",payload:null}))},[s,n]),m=rn(()=>s.isClaimed(),[s]),g=nn(()=>({canGetLock:c,tryGetLock:u,findClosestDraggableId:d,findOptionsForDraggable:p,tryReleaseLock:f,isLockClaimed:m}),[c,u,d,p,f,m]);var h;h=a,Uo(()=>{const e=zo(h);Wo(()=>{e.current.length!==h.length&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot change the amount of sensor hooks after mounting"):zt())})});for(let e=0;e<a.length;e++)a[e](g)}function Ei(e){return e.current||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Could not find store from lazy ref"):zt()),e.current}function vi(t){const{contextId:n,setCallbacks:r,sensors:o,nonce:i,dragHandleUsageInstructions:a}=t,l=e.useRef(null);Wo(()=>{((e,t)=>{const n=jo("^18.0.0 || ^19.0.0"),r=jo(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&&$t(`\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,m.default.version),(()=>{const e=document.doctype;e?("html"!==e.name.toLowerCase()&&"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&$t(`\n Unexpected <!doctype> found: (${e.name})\n\n ${Go}\n `),""!==e.publicId&&"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&$t(`\n Unexpected <!doctype> publicId found: (${e.publicId})\n A html5 doctype does not have a publicId\n\n ${Go}\n `)):"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&$t(`\n No <!doctype html> found.\n\n ${Go}\n `)})()},[]);const c=zo(t),u=rn(()=>(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]),d=rn(()=>(e=>({...so,...e.autoScrollerOptions,durationDampening:{...so.durationDampening,...e.autoScrollerOptions}}))(c.current),[c]),p=function(t){const n=nn(()=>(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"),Tt(e.style,Bo),Ro().appendChild(e),function(){setTimeout(function(){const t=Ro();t.contains(e)&&t.removeChild(e),e===r.current&&(r.current=null)})}},[n]),rn(e=>{const t=r.current;t?t.textContent=e:"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&$t(`\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=$o("hidden-text",{separator:"-"}),o=nn(()=>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",Ro().appendChild(e),function(){const t=Ro();t.contains(e)&&t.removeChild(e)}},[o,n]),o}({contextId:n,text:a}),g=function(t,n){const r=nn(()=>(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(No.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: ${$r.outOfTheWay};\n `;return{selector:t(xo.contextId),styles:{dragging:e,dropAnimating:e,userCancel:e}}})(),r,{selector:t(Do.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:wo(o,"always"),resting:wo(o,"resting"),dragging:wo(o,"dragging"),dropAnimating:wo(o,"dropAnimating"),userCancel:wo(o,"userCancel")}})(t),[t]),o=e.useRef(null),i=e.useRef(null),a=rn(vn(e=>{const t=i.current;t||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot set dynamic style element if it is not set"):zt()),t.textContent=e}),[]),s=rn(e=>{const t=o.current;t||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot set dynamic style element if it is not set"):zt()),t.textContent=e},[]);So(()=>{(o.current||i.current)&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"style elements already mounted"):zt());const e=_o(n),l=_o(n);return o.current=e,i.current=l,e.setAttribute(`${yo}-always`,t),l.setAttribute(`${yo}-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?zt(0,"Cannot unmount ref as it is not set"):zt()),Io().removeChild(t),e.current=null};e(o),e(i)}},[n,s,a,r.always,r.resting,t]);const l=rn(()=>a(r.dragging),[a,r.dragging]),c=rn(e=>{a("DROP"!==e?r.userCancel:r.dropAnimating)},[a,r.dropAnimating,r.userCancel]),u=rn(()=>{i.current&&a(r.resting)},[a,r.resting]);return nn(()=>({dragging:l,dropping:c,resting:u}),[l,c,u])}(n,i),h=rn(e=>{Ei(l).dispatch(e)},[]),b=nn(()=>re({publishWhileDragging:Dr,updateDroppableScroll:wr,updateDroppableIsEnabled:Sr,updateDroppableIsCombineEnabled:Ir,collectionStarting:Or},h),[h]),E=function(){const t=nn(Vo,[]);return e.useEffect(()=>function(){t.clean()},[t]),t}(),v=nn(()=>((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(on)).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?zt(0,"Should only be subscribed when a collection is occurring"):zt());const o=n.critical.draggable;"ADDITION"===t.type&&ro(e,o,t.value)&&r.add(t.value),"REMOVAL"===t.type&&ro(e,o,t.value)&&r.remove(t.value)},i={updateDroppableIsEnabled:(r,o)=>{e.droppable.exists(r)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,`Cannot update is enabled flag of Droppable ${r} as it is not registered`):zt()),n&&t.updateDroppableIsEnabled({id:r,isEnabled:o})},updateDroppableIsCombineEnabled:(r,o)=>{n&&(e.droppable.exists(r)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,`Cannot update isCombineEnabled flag of Droppable ${r} as it is not registered`):zt()),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?zt(0,`Cannot update the scroll on Droppable ${r} as it is not registered`):zt()),t.updateDroppableScroll({id:r,newScroll:o}))},startPublishing:t=>{n&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot start capturing critical dimensions as there is already a collection"):zt());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=zr(),t=no(),n=e.y,r=e.x,o=to();return{frame:yt({top:n,left:r,right:r+o.clientWidth,bottom:n+o.clientHeight}),scroll:{initial:e,current:e,max:t,diff:{value:on,displacement:on}}}})(),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:Nn(a),droppables:yn(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=nn(()=>(({scrollDroppable:e,scrollWindow:t,move:n,getAutoScrollerOptions:r})=>{const o=(({scrollWindow:e,scrollDroppable:t,getAutoScrollerOptions:n=()=>so})=>{const r=At(e),o=At(t);let i=null;const a=e=>{i||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot fluid scroll if not dragging"):zt());const{shouldUseTimeDampening:t,dragStartTime:a}=i;vo({state:e,scrollWindow:r,scrollDroppable:o,dragStartTime:a,shouldUseTimeDampening:t,getAutoScrollerOptions:n})};return{start:e=>{i&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot start auto scrolling when already started"):zt());const t=Date.now();let r=!1;const o=()=>{r=!0};vo({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=ir(r.impact);i||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot perform a jump scroll when there is no destination"):zt());const a=((e,n)=>{if(!Eo(e,n))return n;const r=((e,t)=>{const n=e.frame;return n&&Eo(e,t)?go({current:n.scroll.current,max:n.scroll.max,change:t}):null})(e,n);if(!r)return t(e.descriptor.id,n),null;const o=sn(n,r);return t(e.descriptor.id,o),sn(n,o)})(r.dimensions.droppables[i],o);if(!a)return;const s=((e,t,r)=>{if(!e)return r;if(!bo(t,r))return r;const o=((e,t)=>bo(e,t)?go({current:e.scroll.current,max:e.scroll.max,change:t}):null)(t,r);if(!o)return n(r),null;const i=sn(r,o);return n(i),sn(r,i)})(r.isWindowScrollAllowed,r.viewport,a);s&&((t,n)=>{const r=an(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:io,scrollDroppable:v.scrollDroppable,getAutoScrollerOptions:d,...re({move:_r},h)}),[v.scrollDroppable,h,d]),N=function(t){const n=e.useRef({}),r=e.useRef(null),o=e.useRef(null),i=e.useRef(!1),a=rn(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=rn(function(e){const n=Po(t,e);n&&n!==document.activeElement&&n.focus()},[t]),l=rn(function(e,t){r.current===e&&(r.current=t)},[]),c=rn(function(){o.current||i.current&&(o.current=requestAnimationFrame(()=>{o.current=null;const e=r.current;e&&s(e)}))},[s]),u=rn(function(e){r.current=null;const t=document.activeElement;t&&t.getAttribute(No.draggableId)===e&&(r.current=e)},[]);return So(()=>(i.current=!0,function(){i.current=!1;const e=o.current;e&&cancelAnimationFrame(e)}),[]),nn(()=>({register:a,tryRecordFocus:u,tryRestoreFocusRecorded:c,tryShiftRecord:l}),[a,u,c,l])}(n),x=nn(()=>(({dimensionMarshal:e,focusMarshal:t,styleMarshal:n,getResponders:r,announce:o,autoScroller:i})=>{return te(Nr,Qr(function(...e){return t=>(n,r)=>{const o=t(n,r);let i=()=>{throw new Error("production"==='{NODE_ENV:"production"}'.NODE_ENV?Z(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=oe(...s)(o.dispatch),{...o,dispatch:i}}}((a=n,()=>e=>t=>{xr(t,"INITIAL_PUBLISH")&&a.dragging(),xr(t,"DROP_ANIMATE")&&a.dropping(t.payload.completed.result.reason),(xr(t,"FLUSH")||xr(t,"DROP_COMPLETE"))&&a.resting(),e(t)}),(e=>()=>t=>n=>{(xr(n,"DROP_COMPLETE")||xr(n,"FLUSH")||xr(n,"DROP_ANIMATE"))&&e.stopPublishing(),t(n)})(e),(e=>({getState:t,dispatch:n})=>r=>o=>{if(!xr(o,"LIFT"))return void r(o);const{id:i,clientSelection:a,movementMode:s}=o.payload,l=t();"DROP_ANIMATING"===l.phase&&n(Vr({completed:l.completed})),"IDLE"!==t().phase&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Unexpected phase to start a drag"):zt()),n({type:"FLUSH",payload:null}),n({type:"BEFORE_INITIAL_CAPTURE",payload:{draggableId:i,movementMode:s}});const c={draggableId:i,scrollOptions:{shouldPublishImmediately:"SNAP"===s}},{critical:u,dimensions:d,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&&$t(`\n Detected non-consecutive <Draggable /> indexes.\n\n (This can cause unexpected bugs)\n\n ${r}\n `)}(On(e.droppable.id,t.draggables))})(u,d),n({type:"INITIAL_PUBLISH",payload:{critical:u,dimensions:d,clientSelection:a,movementMode:s,viewport:p}})})(e),Wr,Zr,Jr,Xr,(e=>t=>n=>r=>{if((e=>xr(e,"DROP_COMPLETE")||xr(e,"DROP_ANIMATE")||xr(e,"FLUSH"))(r))return e.stop(),void n(r);if(xr(r,"INITIAL_PUBLISH")){n(r);const o=t.getState();return"DRAGGING"!==o.phase&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Expected phase to be DRAGGING after INITIAL_PUBLISH"):zt()),void e.start(o)}n(r),e.scroll(t.getState())})(i),qr,(e=>{let t=!1;return()=>n=>r=>{if(xr(r,"INITIAL_PUBLISH"))return t=!0,e.tryRecordFocus(r.payload.critical.draggable.id),n(r),void e.tryRestoreFocusRecorded();if(n(r),t){if(xr(r,"FLUSH"))return t=!1,void e.tryRestoreFocusRecorded();if(xr(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?zt(0,"Could not find timer"):zt());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?zt(0,"Cannot fire onDragEnd when there is no matching onDragStart"):zt()),r=null,Hr(0,()=>Kr(e().onDragEnd,n,t,Qt))};return{beforeCapture:(t,n)=>{r&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot fire onBeforeCapture as a drag start has already been published"):zt()),Hr(0,()=>{const r=e().onBeforeCapture;r&&r({draggableId:t,mode:n})})},beforeStart:(t,n)=>{r&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot fire onBeforeDragStart as a drag start has already been published"):zt()),Hr(0,()=>{const r=e().onBeforeDragStart;r&&r(Yr(t,n))})},start:(o,i)=>{r&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot fire onBeforeDragStart as a drag start has already been published"):zt());const a=Yr(o,i);r={mode:i,lastCritical:o,lastLocation:a.source,lastCombine:null},n.add(()=>{Hr(0,()=>Kr(e().onDragStart,a,t,Jt))})},update:(o,i)=>{const a=wn(i),s=Sn(i);r||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot fire onDragMove when onDragStart has not been called"):zt());const l=!((c=o)===(u=r.lastCritical)||c.draggable.id===u.draggable.id&&c.draggable.droppableId===u.draggable.droppableId&&c.draggable.type===u.draggable.type&&c.draggable.index===u.draggable.index&&c.droppable.id===u.droppable.id&&c.droppable.type===u.droppable.type);var c,u;l&&(r.lastCritical=o);const d=!((e,t)=>null==e&&null==t||null!=e&&null!=t&&e.droppableId===t.droppableId&&e.index===t.index)(r.lastLocation,a);d&&(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&&!d&&!p)return;const f={...Yr(o,r.mode),combine:s,destination:a};n.add(()=>{Hr(0,()=>Kr(e().onDragUpdate,f,t,Xt))})},flush:()=>{r||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Can only flush responders while dragging"):zt()),n.flush()},drop:o,abort:()=>{if(!r)return;const e={...Yr(r.lastCritical,r.mode),combine:null,destination:null,reason:"CANCEL"};o(e)}}})(e,t);return e=>t=>r=>{if(xr(r,"BEFORE_INITIAL_CAPTURE"))return void n.beforeCapture(r.payload.draggableId,r.payload.movementMode);if(xr(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(xr(r,"DROP_COMPLETE")){const e=r.payload.completed.result;return n.flush(),t(r),void n.drop(e)}if(t(r),xr(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:u,styleMarshal:g}),[p,y,v,N,u,g]);"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&l.current&&l.current!==x&&"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&$t("unexpected store change"),l.current=x;const D=rn(()=>{const e=Ei(l);"IDLE"!==e.getState().phase&&e.dispatch({type:"FLUSH",payload:null})},[]),O=rn(()=>{const e=Ei(l).getState();return"DROP_ANIMATING"===e.phase||"IDLE"!==e.phase&&e.isDragging},[]);r(nn(()=>({isDragging:O,tryAbort:D}),[O,D]));const w=rn(e=>oo(Ei(l).getState(),e),[]),S=rn(()=>ar(Ei(l).getState()),[]),I=nn(()=>({marshal:v,focus:N,contextId:n,canLift:w,isMovementAllowed:S,dragHandleUsageInstructionsId:f,registry:E}),[n,v,f,N,w,S,E]);return bi({contextId:n,store:x,registry:E,customSensors:o||null,enableDefaultSensors:!1!==t.enableDefaultSensors}),e.useEffect(()=>D,[D]),m.default.createElement(Lo.Provider,{value:I},m.default.createElement(ht,{context:ko,store:x},t.children))}function yi(e){const t=m.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 m.default.createElement(qt,null,r=>m.default.createElement(vi,{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 Ni=(e,t)=>t?$r.drop(t.duration):e?$r.snap:$r.fluid,xi=(e,t)=>{if(e)return t?0:.7};var Di=m.default.createContext(null);function Oi(e){e&&To(e)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(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 "):zt())}function wi(t){const n=e.useContext(t);return n||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Could not find required context"):zt()),n}function Si(e){e.preventDefault()}var Ii=(e,t)=>e===t,_i=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 Ai={mapped:{type:"SECONDARY",offset:on,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:Ci(null)}},Ti=gt(()=>{const e=function(){const e=vn((e,t)=>({x:e,y:t})),t=vn((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=vn((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(qo(r)){if(r.critical.draggable.id!==o.draggableId)return null;const t=r.current.client.offset,a=r.dimensions.draggables[o.draggableId],s=ir(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=_i(a),c=(e=>e.combine?e.combine.draggableId:null)(a),u={duration:r.dropDuration,curve:Rr,moveTo:r.newHomeClientOffset,opacity:c?0:null,scale:c?.75:null};return{mapped:{type:"DRAGGING",offset:r.newHomeClientOffset,dimension:i,dropping:u,draggingOver:l,combineWith:c,mode:s,forceShouldAnimate:null,snapshot:t(s,n,l,c,u)}}}return null}}(),t=function(){const e=vn((e,t)=>({x:e,y:t})),t=vn(Ci),n=vn((e,n=null,r)=>({mapped:{type:"SECONDARY",offset:e,combineTargetFor:n,shouldAnimateDisplacement:r,snapshot:t(n)}})),r=e=>e?n(on,e,!0):null,o=(t,o,i,a)=>{const s=i.displaced.visible[t],l=Boolean(a.inVirtualList&&a.effected[t]),c=Sn(i),u=c&&c.draggableId===t?o:null;if(!s){if(!l)return r(u);if(i.displaced.invisible[t])return null;const o=cn(a.displacedBy.point),s=e(o.x,o.y);return n(s,u,!0)}if(l)return r(u);const d=i.displacedBy.point,p=e(d.x,d.y);return n(p,u,s.shouldAnimate)};return(e,t)=>{if(qo(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)||Ai},{dropAnimationFinished:()=>({type:"DROP_ANIMATION_FINISHED",payload:null})},null,{context:ko,areStatePropsEqual:Ii})(t=>{const n=e.useRef(null),r=rn((e=null)=>{n.current=e},[]),o=rn(()=>n.current,[]),{contextId:i,dragHandleUsageInstructionsId:a,registry:l}=wi(Lo),{type:c,droppableId:u}=wi(Di),d=nn(()=>({id:t.draggableId,index:t.index,type:c,droppableId:u}),[t.draggableId,t.index,c,u]),{children:p,draggableId:f,isEnabled:g,shouldRespectForcePress:h,canDragInteractiveElements:b,isClone:E,mapped:v,dropAnimationFinished:y}=t;(function(e,t,n){Wo(()=>{function r(e){return`Draggable[id: ${e}]: `}const o=e.draggableId;o||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Draggable requires a draggableId"):zt()),"string"!=typeof o&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,`Draggable requires a [string] draggableId.\n Provided: [type: ${typeof o}] (value: ${o})`):zt()),Number.isInteger(e.index)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,`${r(o)} requires an integer index prop`):zt()),"DRAGGING"!==e.mapped.type&&(Oi(n()),e.isEnabled&&(Po(t,o)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,`${r(o)} Unable to find drag handle`):zt())))})})(t,i,o),function(t){Uo(()=>{const n=e.useRef(t);Wo(()=>{t!==n.current&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Draggable isClone prop value changed during component life"):zt())},[t])})}(E),E||function(t){const n=$o("draggable"),{descriptor:r,registry:o,getDraggableRef:i,canDragInteractiveElements:a,shouldRespectForcePress:s,isEnabled:l}=t,c=nn(()=>({canDragInteractiveElements:a,shouldRespectForcePress:s,isEnabled:l}),[a,l,s]),u=rn(e=>{const t=i();return t||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot get dimension when no ref is set"):zt()),function(e,t,n=on){const r=window.getComputedStyle(t),o=t.getBoundingClientRect(),i=_t(o,r),a=It(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]),d=nn(()=>({uniqueId:n,descriptor:r,options:c,getDimension:u}),[r,u,c,n]),p=e.useRef(d),f=e.useRef(!0);So(()=>(o.draggable.register(p.current),()=>o.draggable.unregister(p.current)),[o.draggable]),So(()=>{if(f.current)return void(f.current=!1);const e=p.current;p.current=d,o.draggable.update(d,e)},[d,o.draggable])}(nn(()=>({descriptor:d,registry:l,getDraggableRef:o,canDragInteractiveElements:b,shouldRespectForcePress:h,isEnabled:g}),[d,l,o,b,h,g]));const N=nn(()=>g?{tabIndex:0,role:"button","aria-describedby":a,"data-rfd-drag-handle-draggable-id":f,"data-rfd-drag-handle-context-id":i,draggable:!1,onDragStart:Si}:null,[i,a,f,g]),x=rn(e=>{"DRAGGING"===v.type&&v.dropping&&"transform"===e.propertyName&&s.flushSync(y)},[y,v]),D=nn(()=>{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=Lr(e);if(n)return t?`${n} scale(0.75)`:n})(n,i):Mr(n);return{position:"fixed",top:t.marginBox.top,left:t.marginBox.left,boxSizing:"border-box",width:t.borderBox.width,height:t.borderBox.height,transition:Ni(a,o),transform:l,opacity:xi(i,s),zIndex:s?4500:5e3,pointerEvents:"none"}}(e):{transform:Mr((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?x:void 0},dragHandleProps:N}},[i,N,f,v,x,r]),O=nn(()=>({draggableId:d.id,type:d.type,source:{index:d.index,droppableId:d.droppableId}}),[d.droppableId,d.id,d.index,d.type]);return m.default.createElement(m.default.Fragment,null,p(D,v.snapshot,O))});function Pi(e){return wi(Di).isUsingCloneFor!==e.draggableId||e.isClone?m.default.createElement(Ti,e):null}function Vi(e){const t="boolean"!=typeof e.isDragDisabled||!e.isDragDisabled,n=Boolean(e.disableInteractiveElementBlocking),r=Boolean(e.shouldRespectForcePress);return m.default.createElement(Pi,Tt({},e,{isClone:!1,isEnabled:t,canDragInteractiveElements:n,shouldRespectForcePress:r}))}const ki=e=>t=>e===t,Ri=ki("scroll"),Bi=ki("auto"),Fi=ki("visible"),$i=(e,t)=>t(e.overflowX)||t(e.overflowY),Li=e=>{const t=window.getComputedStyle(e),n={overflowX:t.overflowX,overflowY:t.overflowY};return $i(n,Ri)||$i(n,Bi)},Mi=e=>null==e?null:e===document.body?(()=>{if("production"==='{NODE_ENV:"production"}'.NODE_ENV)return!1;const e=Ro(),t=document.documentElement;if(t||zt(),!Li(e))return!1;const n=window.getComputedStyle(t);return(o=Fi)((r={overflowX:n.overflowX,overflowY:n.overflowY}).overflowX)&&o(r.overflowY)||"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&$t("\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:Li(e)?e:Mi(e.parentElement);var ji=e=>({x:e.scrollLeft,y:e.scrollTop});const Gi=e=>!!e&&("fixed"===window.getComputedStyle(e).position||Gi(e.parentElement)),Ui={passive:!1},Wi={passive:!0};var zi=e=>e.shouldPublishImmediately?Ui:Wi;const qi=e=>e&&e.env.closestScrollable||null;function Hi(){}const Yi={width:0,height:0,margin:{top:0,right:0,bottom:0,left:0}};var Ki=m.default.memo(t=>{const n=e.useRef(null),r=rn(()=>{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),Hi):n.current?Hi:(n.current=setTimeout(()=>{n.current=null,c(!1)}),r):Hi,[o,l,r]);const u=rn(e=>{"height"===e.propertyName&&(i(),"close"===o&&a())},[o,a,i]),d=(({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>{const r=(({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>e||"close"===n?Yi:{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?$r.placeholder:null}})({isAnimatingOpenOnMount:l,animate:t.animate,placeholder:t.placeholder});return m.default.createElement(t.placeholder.tagName,{style:d,"data-rfd-placeholder-context-id":s,onTransitionEnd:u,ref:t.innerRef})});function Zi(e){return"boolean"==typeof e}function Ji(e,t){t.forEach(t=>t(e))}const Xi=[function({props:e}){e.droppableId||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"A Droppable requires a droppableId prop"):zt()),"string"!=typeof e.droppableId&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,`A Droppable requires a [string] droppableId. Provided: [${typeof e.droppableId}]`):zt())},function({props:e}){Zi(e.isDropDisabled)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"isDropDisabled must be a boolean"):zt()),Zi(e.isCombineEnabled)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"isCombineEnabled must be a boolean"):zt()),Zi(e.ignoreContainerClipping)||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"ignoreContainerClipping must be a boolean"):zt())},function({getDroppableRef:e}){Oi(e())}],Qi=[function({props:e,getPlaceholderRef:t}){e.placeholder&&(t()||"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&$t(`\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 `))}],ea=[function({props:e}){e.renderClone||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Must provide a clone render function (renderClone) for virtual lists"):zt())},function({getPlaceholderRef:e}){e()&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Expected virtual list to not have a placeholder"):zt())}];class ta extends m.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 na={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?zt(0,"document.body is not ready"):zt()),document.body}},ra=e=>{let t,n={...e};for(t in na)void 0===e[t]&&(n={...n,[t]:na[t]});return n},oa=(e,t)=>e===t.droppable.type,ia=(e,t)=>t.draggables[e.draggable.id],aa=gt(()=>{const e={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},t={...e,shouldAnimatePlaceholder:!1},n=vn(e=>({draggableId:e.id,type:e.type,source:{index:e.index,droppableId:e.droppableId}})),r=vn((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=ra(o),a=i.droppableId,s=i.type,l=!i.isDropDisabled,c=i.renderClone;if(qo(n)){const e=n.critical;if(!oa(s,e))return t;const o=ia(e,n.dimensions),i=ir(n.impact)===a;return r(a,l,i,i,o,c)}if("DROP_ANIMATING"===n.phase){const e=n.completed;if(!oa(s,e.critical))return t;const o=ia(e.critical,n.dimensions);return r(a,l,_i(e.result)===a,ir(e.impact)===a,o,c)}if("IDLE"===n.phase&&n.completed&&!n.shouldFlush){const r=n.completed;if(!oa(s,r.critical))return t;const o=ir(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)=>({...ra(n),...e,...t}),{context:ko,areStatePropsEqual:Ii})(t=>{const n=e.useContext(Lo);n||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Could not find app context"):zt());const{contextId:r,isMovementAllowed:o}=n,i=e.useRef(null),a=e.useRef(null),{children:s,droppableId:l,type:c,mode:u,direction:d,ignoreContainerClipping:p,isDropDisabled:f,isCombineEnabled:g,snapshot:h,useClone:E,updateViewportMaxScroll:v,getContainerForClone:y}=t,N=rn(()=>i.current,[]),x=rn((e=null)=>{i.current=e},[]),D=rn(()=>a.current,[]),O=rn((e=null)=>{a.current=e},[]);var w;w={props:t,getDroppableRef:N,getPlaceholderRef:D},Wo(()=>{Ji(w,Xi),"standard"===w.props.mode&&Ji(w,Qi),"virtual"===w.props.mode&&Ji(w,ea)});const S=rn(()=>{o()&&v({maxScroll:no()})},[o,v]);!function(t){const n=e.useRef(null),r=wi(Lo),o=$o("droppable"),{registry:i,marshal:a}=r,s=zo(t),l=nn(()=>({id:t.droppableId,type:t.type,mode:t.mode}),[t.droppableId,t.mode,t.type]),c=e.useRef(l),u=nn(()=>vn((e,t)=>{n.current||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Can only update scroll when dragging"):zt()),a.updateDroppableScroll(l.id,{x:e,y:t})}),[l.id,a]),d=rn(()=>{const e=n.current;return e&&e.env.closestScrollable?ji(e.env.closestScrollable):on},[]),p=rn(()=>{const e=d();u(e.x,e.y)},[d,u]),f=nn(()=>At(p),[p]),m=rn(()=>{const e=n.current,t=qi(e);e&&t||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Could not find scroll options while scrolling"):zt()),e.scrollOptions.shouldPublishImmediately?p():f()},[f,p]),g=rn((e,t)=>{n.current&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot collect a droppable while a drag is occurring"):zt());const o=s.current,i=o.getDroppableRef();i||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot collect without a droppable ref"):zt());const a={closestScrollable:Mi(c=i),isFixedOnPage:Gi(c)};var c;const u={ref:i,descriptor:l,env:a,scrollOptions:t};n.current=u;const d=(({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=Nt({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),u=It(c,r),d=(()=>{if(!l)return null;const e=Ct(l),t={scrollHeight:l.scrollHeight,scrollWidth:l.scrollWidth};return{client:e,page:It(e,r),scroll:ji(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=eo({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:on,displacement:on}}}})(),c="vertical"===o?Rn:Bn;return{descriptor:e,isCombineEnabled:n,isFixedOnPage:r,axis:c,isEnabled:t,client:i,page:a,frame:l,subject:bn({page:a,withPlaceholder:null,axis:c,frame:l})}})({descriptor:t,isEnabled:!i,isCombineEnabled:a,isFixedOnPage:n.isFixedOnPage,direction:o,client:c,page:u,closest:d});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(Oo.contextId,r.contextId),p.addEventListener("scroll",m,zi(u.scrollOptions)),"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&(e=>{e&&Mi(e.parentElement)&&"production"!=='{NODE_ENV:"production"}'.NODE_ENV&&$t("\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)),d},[r.contextId,l,m,s]),h=rn(()=>{const e=n.current,t=qi(e);return e&&t||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Can only recollect Droppable client for Droppables that have a scroll container"):zt()),ji(t)},[]),b=rn(()=>{const e=n.current;e||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot stop drag when no active drag"):zt());const t=qi(e);n.current=null,t&&(f.cancel(),t.removeAttribute(Oo.contextId),t.removeEventListener("scroll",m,zi(e.scrollOptions)))},[m,f]),E=rn(e=>{const t=n.current;t||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot scroll when there is no drag"):zt());const r=qi(t);r||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?zt(0,"Cannot scroll a droppable with no closest scrollable"):zt()),r.scrollTop+=e.y,r.scrollLeft+=e.x},[]),v=nn(()=>({getDimensionAndWatchScroll:g,getScrollWhileDragging:h,dragStopped:b,scroll:E}),[b,g,h,E]),y=nn(()=>({uniqueId:o,descriptor:l,callbacks:v}),[v,l,o]);So(()=>(c.current=y.descriptor,i.droppable.register(y),()=>{n.current&&("production"!=='{NODE_ENV:"production"}'.NODE_ENV&&$t("Unsupported: changing the droppableId or type of a Droppable during a drag"),b()),i.droppable.unregister(y)}),[v,l,b,y,a,i.droppable]),So(()=>{n.current&&a.updateDroppableIsEnabled(c.current.id,!t.isDropDisabled)},[t.isDropDisabled,a]),So(()=>{n.current&&a.updateDroppableIsCombineEnabled(c.current.id,t.isCombineEnabled)},[t.isCombineEnabled,a])}({droppableId:l,type:c,mode:u,direction:d,isDropDisabled:f,isCombineEnabled:g,ignoreContainerClipping:p,getDroppableRef:N});const I=nn(()=>m.default.createElement(ta,{on:t.placeholder,shouldAnimate:t.shouldAnimatePlaceholder},({onClose:e,data:t,animate:n})=>m.default.createElement(Ki,{placeholder:t,onClose:e,innerRef:O,animate:n,contextId:r,onTransitionEnd:S})),[r,S,t.placeholder,t.shouldAnimatePlaceholder,O]),_=nn(()=>({innerRef:x,placeholder:I,droppableProps:{"data-rfd-droppable-id":l,"data-rfd-droppable-context-id":r}}),[r,l,I,x]),C=E?E.dragging.draggableId:null,A=nn(()=>({droppableId:l,type:c,isUsingCloneFor:C}),[l,C,c]);return m.default.createElement(Di.Provider,{value:A},s(_,h),function(){if(!E)return null;const{dragging:e,render:t}=E,n=m.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 sa,la,ca,ua=((sa={})[t.PresenceStatusEnum.Present]="presenceStatusPresent",sa[t.PresenceStatusEnum.NotPresent]="presenceStatusNotPresent",sa[t.PresenceStatusEnum.PresentElsewhere]="presenceStatusPresentElsewhere",sa),da="unplanned:",pa=function(e){return e.startsWith(da)},fa=function(e){return pa(e)?e.slice(10):e},ma=((la={})[t.PresenceStatusEnum.Present]="success.main",la[t.PresenceStatusEnum.NotPresent]="error.main",la[t.PresenceStatusEnum.PresentElsewhere]="warning.main",la),ga={properties:{gap:function(e){return e.spacing(.5)}},property:{marginLeft:function(e){return e.spacing(2)}},propertyLabel:{marginBottom:function(e){return e.spacing(.5)},fontWeight:"bold"},propertyValue:{fontSize:function(e){return e.typography.pxToRem(14)},color:"text.primary"},checkedInValue:{fontSize:function(e){return e.typography.pxToRem(14)},fontWeight:600,color:"warning.main"},unplannedIndicator:{flexShrink:0,width:12,height:12,borderRadius:"50%",backgroundColor:"success.main"},assignButton:{marginTop:function(e){return e.spacing(2)}},separator:{width:"100%",height:"1px",margin:function(e){return e.spacing(1,0)},background:"linear-gradient(90deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.05) 100%)"}},ha=function(n){var r,i,s,l,c,u=n.userId,d=n.data,p=n.gqlClients,f=n.viewState,g=n.onAssignToWorkplace,b=o.useTranslation().t,E=e.useState(null),v=E[0],y=E[1],N=e.useState(null),x=N[0],O=N[1],w=e.useState(!1),S=w[0],I=w[1],_=function(e,t){for(var n,r=D(e.workplaces);!(n=r()).done;){var o=n.value,i=o.assignedOperators.find(function(e){return e.user.id===t});if(i)return{presenceStatus:i.presenceStatus,assignedWorkplaceName:o.workplace.name}}for(var a,s=D(e.workplaces);!(a=s()).done;){var l=a.value;if(l.unplannedOperators.find(function(e){return e.user.id===t&&!e.plannedWorkplace}))return{isUnplanned:!0,checkedInWorkplace:l.workplace}}return{}}(d,u),C=_.isUnplanned||_.presenceStatus===t.PresenceStatusEnum.Present||_.presenceStatus===t.PresenceStatusEnum.PresentElsewhere;return e.useEffect(function(){C&&p.graphqlSdk&&(I(!0),p.graphqlSdk.usersPresences({filter:{user_id_eq:u,shift_id_eq:f.shift.id,finished_at_null:"true"}}).then(function(e){var t=e.usersPresences;if(t.length>0){var n=t[t.length-1];y(n.startedAt);var r=d.workplaces.find(function(e){return e.workplace.id===n.workplaceId});r&&O(r.workplace.name)}}).catch(function(){}).finally(function(){return I(!1)}))},[u,C,p.graphqlSdk,f.shift.id,d.workplaces]),m.default.createElement(a.Stack,{sx:ga.properties},m.default.createElement(a.Box,{sx:ga.property},m.default.createElement(a.Typography,{sx:ga.propertyLabel},b("presenceStatus")),m.default.createElement(a.Stack,{direction:"row",spacing:1,alignItems:"center"},_.isUnplanned&&m.default.createElement(a.Box,{title:b("checkedInUnassigned"),sx:ga.unplannedIndicator}),!_.isUnplanned&&_.presenceStatus&&m.default.createElement(a.Box,{title:b(ua[_.presenceStatus]),sx:(c=_.presenceStatus,{flexShrink:0,width:12,height:12,borderRadius:"50%",backgroundColor:ma[c]})}),m.default.createElement(a.Typography,{sx:ga.propertyValue},_.isUnplanned?b("checkedInUnassigned"):function(e,t){return e(t?ua[t]:"unassignedOperator")}(b,_.presenceStatus)))),_.isUnplanned&&_.checkedInWorkplace&&m.default.createElement(m.default.Fragment,null,m.default.createElement(a.Box,{sx:ga.separator}),m.default.createElement(a.Box,{sx:ga.property},m.default.createElement(a.Typography,{sx:ga.propertyLabel},b("checkedInLocation")),m.default.createElement(a.Typography,{sx:ga.propertyValue},_.checkedInWorkplace.name))),_.assignedWorkplaceName&&m.default.createElement(m.default.Fragment,null,m.default.createElement(a.Box,{sx:ga.separator}),m.default.createElement(a.Box,{sx:ga.property},m.default.createElement(a.Typography,{sx:ga.propertyLabel},b("assignedWorkplace")),m.default.createElement(a.Typography,{sx:ga.propertyValue},_.assignedWorkplaceName))),S&&m.default.createElement(m.default.Fragment,null,m.default.createElement(a.Box,{sx:ga.separator}),m.default.createElement(a.Box,{sx:ga.property,display:"flex",justifyContent:"center",mt:2},m.default.createElement(a.CircularProgress,{size:16}))),!S&&v&&m.default.createElement(m.default.Fragment,null,_.presenceStatus===t.PresenceStatusEnum.PresentElsewhere&&x&&m.default.createElement(m.default.Fragment,null,m.default.createElement(a.Box,{sx:ga.separator}),m.default.createElement(a.Box,{sx:ga.property},m.default.createElement(a.Typography,{sx:ga.propertyLabel},b("checkedInLocation")),m.default.createElement(a.Typography,{sx:ga.checkedInValue},x))),m.default.createElement(a.Box,{sx:ga.separator}),m.default.createElement(a.Box,{sx:ga.property},m.default.createElement(a.Typography,{sx:ga.propertyLabel},b("checkedInTime")),m.default.createElement(a.Typography,{sx:ga.propertyValue},h.default(v).format("HH:mm"))),m.default.createElement(a.Box,{sx:ga.separator}),m.default.createElement(a.Box,{sx:ga.property},m.default.createElement(a.Typography,{sx:ga.propertyLabel},b("workingFor")),m.default.createElement(a.Typography,{sx:ga.propertyValue},(r=h.default(v),l=(i=h.default().diff(r,"minute"))%60,(s=Math.floor(i/60))>0?s+"h "+l+"m":l+"m")))),_.isUnplanned&&_.checkedInWorkplace&&m.default.createElement(m.default.Fragment,null,m.default.createElement(a.Box,{sx:ga.separator}),m.default.createElement(a.Box,{sx:ga.property,display:"flex",justifyContent:"flex-end"},m.default.createElement(a.Button,{variant:"contained",size:"small",color:"info",sx:ga.assignButton,onClick:function(){_.checkedInWorkplace&&g&&g(u,_.checkedInWorkplace.id)}},b("assignHere")))))},ba=function(e){var t=e.children;return m.default.createElement(aa,{droppableId:e.droppableId,renderClone:e.renderClone},function(e,n){return m.default.createElement(a.Box,O({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})},Ea=((ca={})[t.PresenceStatusEnum.Present]="success.main",ca[t.PresenceStatusEnum.NotPresent]="error.main",ca[t.PresenceStatusEnum.PresentElsewhere]="warning.main",ca),va=function(e,t){return void 0===t&&(t=!0),O({display:"flex",alignItems:"center",gap:function(e){return e.spacing(1)},cursor:t?"pointer":"default",padding:function(e){return e.spacing(1)},borderBottom:"1px solid rgba(255, 255, 255, 0.15)",boxShadow:"none","&:last-of-type":{borderBottom:"none"}},t&&{"&:hover":{backgroundColor:"rgba(255, 255, 255, 0.05)"}},e&&{opacity:.5})},ya={flexShrink:0,width:10,height:10,borderRadius:"50%",backgroundColor:"success.main"},Na={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}}},xa=function(e){var t=e.provided,n=e.user;return m.default.createElement(a.Card,O({ref:t.innerRef},t.draggableProps,t.dragHandleProps,{sx:va(!0)}),m.default.createElement(a.Typography,{sx:Na.name},n.name))},Da=function(e){var t=e.user,n=e.index,r=e.draggableId,i=e.showPresence,s=e.presenceStatus,l=e.isUnplanned,c=e.onClick,u=e.onRemove,d=o.useTranslation().t;return m.default.createElement(Vi,{draggableId:r,index:n},function(e,n){return m.default.createElement(a.Card,O({ref:e.innerRef},e.draggableProps,e.dragHandleProps,{sx:va(n.isDragging,!!c),onClick:function(){!n.isDragging&&c&&c()}}),l&&m.default.createElement(a.Box,{title:d("checkedInUnassigned"),sx:ya}),!l&&i&&s&&m.default.createElement(a.Box,{title:d(ua[s]),sx:(r=s,{flexShrink:0,width:10,height:10,borderRadius:"50%",backgroundColor:Ea[r]})}),m.default.createElement(a.Typography,{title:t.name,sx:Na.name},t.name),u&&m.default.createElement(a.IconButton,{title:d("removeOperator"),size:"small",color:"error",onClick:function(e){e.stopPropagation(),u()},sx:Na.removeButton},m.default.createElement(v.default,{fontSize:"small"})));var r})},Oa={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)}},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"}},wa=function(t){var n=t.operators,r=t.unplannedUserIds,i=t.onOperatorClick,s=e.useState(""),l=s[0],c=s[1],u=o.useTranslation().t,d=e.useMemo(function(){return r?n.filter(function(e){return!r.has(e.id)}):n},[n,r]),p=e.useMemo(function(){if(!l.trim())return d;var e=l.toLowerCase();return d.filter(function(t){return t.name.toLowerCase().split(" ").some(function(t){return t.startsWith(e)})})},[d,l]);return m.default.createElement(a.Card,{sx:Oa.root},m.default.createElement(a.CardHeader,{title:u("unassignedPool"),action:d.length,slotProps:{title:{variant:"subtitle1"},action:{sx:Oa.action}},sx:Oa.header}),m.default.createElement(a.TextField,{size:"small",label:u("searchOperators"),value:l,onChange:function(e){return c(e.target.value)},sx:Oa.search,slotProps:{input:{startAdornment:m.default.createElement(a.InputAdornment,{position:"start"},m.default.createElement(E.default,{fontSize:"small"}))}}}),m.default.createElement(a.CardContent,{sx:Oa.content},m.default.createElement(ba,{droppableId:"pool",renderClone:function(e,t,n){return m.default.createElement(xa,{provided:e,user:p[n.source.index]})}},function(){return m.default.createElement(m.default.Fragment,null,p.map(function(e,t){return m.default.createElement(Da,{key:e.id,user:e,index:t,draggableId:e.id,onClick:i?function(){return i(e.id,e.name)}:void 0})}))})))},Sa={overcapacity:{borderColor:"error.main",labelColor:"error.contrastText",labelBg:"error.main"},unplanned:{borderColor:"warning.main",labelColor:"warning.contrastText",labelBg:"warning.main"}},Ia=function(e,t,n){return O({display:"flex",flexDirection:"column",flexShrink:0,position:"relative",width:250,minHeight:200,border:"normal"!==e?2:1,borderColor:"normal"!==e?Sa[e].borderColor:"divider"},"normal"!==e&&{"&::after":{content:'"'+n+'"',position:"absolute",bottom:-2,left:-2,padding:function(e){return e.spacing(.25,.75)},fontSize:function(e){return e.typography.pxToRem(10)},color:Sa[e].labelColor,backgroundColor:Sa[e].labelBg,borderRadius:"0 4px 0 0",textShadow:"0 1px 2px rgba(0, 0, 0, 0.3)",pointerEvents:"none"}},void 0!==t&&{overflow:"hidden",maxHeight:t})},_a={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)}},unplannedLabel:{display:"block",margin:function(e){return e.spacing(1,0)},padding:function(e){return e.spacing(0,.5)},color:"text.primary",opacity:.7,textAlign:"center"},unplannedSeparator:{height:"1px",backgroundColor:"text.primary",opacity:.3}},Ca={ok:{color:"success.contrastText",backgroundColor:"success.main"},missing:{color:"error.contrastText",backgroundColor:"error.main"},overcapacity:{color:"error.contrastText",backgroundColor:"error.main"},warning:{color:"warning.contrastText",backgroundColor:"warning.main"}},Aa=function(n){var r,i,s=n.assignment,l=n.viewState,c=n.registerRef,u=n.frozenHeight,d=n.onOperatorClick,p=n.onRemoveOperator,f=o.useTranslation().t,g=l.isCurrentShift,h=e.useMemo(function(){return[].concat(s.assignedOperators).sort(function(e,t){return e.user.name.localeCompare(t.user.name,void 0,{numeric:!0})})},[s.assignedOperators]),b=e.useMemo(function(){return g?s.unplannedOperators.filter(function(e){return!e.plannedWorkplace}).sort(function(e,t){return e.user.name.localeCompare(t.user.name,void 0,{numeric:!0})}):[]},[s.unplannedOperators,g]),E=e.useMemo(function(){return g?{localOperators:h.filter(function(e){return e.presenceStatus!==t.PresenceStatusEnum.PresentElsewhere}),elsewhereOperators:h.filter(function(e){return e.presenceStatus===t.PresenceStatusEnum.PresentElsewhere})}:{localOperators:h,elsewhereOperators:[]}},[h,g]),v=E.localOperators,y=E.elsewhereOperators,N=g?function(e,n){var r=e.assignedOperators.filter(function(e){return e.presenceStatus===t.PresenceStatusEnum.Present}).length+n;return r>e.recommendedOperators?{text:"+"+(r-e.recommendedOperators),status:"overcapacity",titleKey:"statusOvercapacity",checkedInHereCount:r}:r<e.recommendedOperators?{text:""+(r-e.recommendedOperators),status:"missing",titleKey:"statusMissing",checkedInHereCount:r}:0===n?{text:"OK",status:"ok",titleKey:"statusOk",checkedInHereCount:r}:{text:"OK",status:"warning",titleKey:"statusUnplanned",checkedInHereCount:r}}(s,b.length):null,x=g?null:function(e){var t=e.assignedCount-e.recommendedOperators;return t>0?{text:"+"+t,status:"overcapacity",titleKey:"statusOvercapacity"}:t<0?{text:""+t,status:"missing",titleKey:"statusMissing"}:{text:"OK",status:"ok",titleKey:"statusOk"}}(s),D=N||x,w=(g?s.assignedCount>s.recommendedOperators||(null!=(r=null==N?void 0:N.checkedInHereCount)?r:0)>s.recommendedOperators:s.assignedCount>s.recommendedOperators)?{status:"overcapacity",label:f("overcapacity")}:g&&b.length>0?{status:"unplanned",label:f("unplannedStaffing")}:{status:"normal",label:""},S=N?N.checkedInHereCount:s.assignedCount;return m.default.createElement(a.Card,{ref:c,sx:Ia(w.status,u,w.label)},m.default.createElement(a.CardHeader,{title:s.workplace.name,action:m.default.createElement(m.default.Fragment,null,m.default.createElement(a.Typography,null,S+"/"+s.recommendedOperators),m.default.createElement(a.Typography,{title:f(D.titleKey),variant:"caption",sx:(i=D.status,O({padding:function(e){return e.spacing(.25)+" "+e.spacing(1)},borderRadius:1},Ca[i]))},D.text)),slotProps:{title:{variant:"subtitle1",title:s.workplace.name,sx:_a.title},action:{sx:_a.action}},sx:_a.header}),m.default.createElement(a.CardContent,{sx:_a.content},m.default.createElement(ba,{droppableId:s.workplace.id,renderClone:function(e,t,n){var r,o,i=n.source.index,s=v.length+y.length;if(i<v.length)r=null==(o=v[i])?void 0:o.user;else if(i<s){var l;r=null==(l=y[i-v.length])?void 0:l.user}else{var c;r=null==(c=b[i-s])?void 0:c.user}return r?m.default.createElement(xa,{provided:e,user:r}):m.default.createElement(a.Card,O({ref:e.innerRef},e.draggableProps,e.dragHandleProps))}},function(){var e=v.length,t=e+y.length;return m.default.createElement(m.default.Fragment,null,v.map(function(e,t){return m.default.createElement(Da,{key:e.user.id,user:e.user,index:t,draggableId:e.user.id,showPresence:g,presenceStatus:e.presenceStatus,onClick:d?function(){return d(e.user.id,e.user.name)}:void 0,onRemove:p?function(){return p(e.user.id)}:void 0})}),y.length>0&&m.default.createElement(m.default.Fragment,null,m.default.createElement(a.Typography,{variant:"caption",sx:_a.unplannedLabel},f("presentElsewhereLabel")),m.default.createElement(a.Box,{sx:_a.unplannedSeparator})),y.map(function(t,n){return m.default.createElement(Da,{key:t.user.id,user:t.user,index:e+n,draggableId:t.user.id,showPresence:!0,presenceStatus:t.presenceStatus,onClick:d?function(){return d(t.user.id,t.user.name)}:void 0,onRemove:p?function(){return p(t.user.id)}:void 0})}),b.length>0&&m.default.createElement(m.default.Fragment,null,m.default.createElement(a.Typography,{variant:"caption",sx:_a.unplannedLabel},f("unplannedSectionLabel")),m.default.createElement(a.Box,{sx:_a.unplannedSeparator})),b.map(function(e,n){return m.default.createElement(Da,{key:e.user.id,user:e.user,index:t+n,draggableId:(r=e.user.id,""+da+r),isUnplanned:!0,onClick:d?function(){return d(e.user.id,e.user.name)}:void 0});var r}))})))},Ta={grid:function(e){return{display:"flex",flexDirection:"column",flexWrap:"wrap",alignContent:"flex-start",gap:e.spacing(1),height:"100%",overflowX:"auto"}}},Pa=function(n){var r=n.data,o=n.viewState,i=n.gqlClients,s=n.updateData,l=n.updateSidePanelProps,c=n.refetchAssignments,u=i.graphqlSdk,d=e.useState({}),p=d[0],f=d[1],g=e.useRef({}),h=e.useRef(r);h.current=r;var b=e.useMemo(function(){for(var e,t=new Set,n=D(r.workplaces);!(e=n()).done;)for(var o,i=D(e.value.unplannedOperators);!(o=i()).done;)t.add(o.value.user.id);return t},[r.workplaces]),E=e.useCallback(function(e,t){g.current[e]=t},[]),v=e.useCallback(function(e){var t={};Object.entries(g.current).forEach(function(e){var n=e[1];n&&(t[e[0]]=n.getBoundingClientRect().height)}),f(t)},[]),y=e.useCallback(function(e,t){if(u){var n=r.workplaces.find(function(e){return e.workplace.id===t}),i=null==n?void 0:n.assignedOperators.find(function(t){return t.user.id===e});n&&i&&(s({workplaces:r.workplaces.map(function(n){return n.workplace.id===t?O({},n,{assignedOperators:n.assignedOperators.filter(function(t){return t.user.id!==e}),assignedCount:n.assignedCount-1}):n}),unassignedOperators:[i.user].concat(r.unassignedOperators)}),u.unassignOperator({input:{userId:e,shiftId:o.shift.id,validFrom:o.date}}).catch(function(){}))}},[u,r,o,s]),N=e.useCallback(function(e,n){u&&(s({workplaces:r.workplaces.map(function(r){var o=r.workplace.id===n,i=r.unplannedOperators.find(function(t){return t.user.id===e});return O({},r,{unplannedOperators:r.unplannedOperators.filter(function(t){return t.user.id!==e})},o&&i?{assignedOperators:[].concat(r.assignedOperators,[{user:i.user,presenceStatus:t.PresenceStatusEnum.Present}]).sort(function(e,t){return e.user.name.localeCompare(t.user.name,void 0,{numeric:!0})}),assignedCount:r.assignedCount+1}:{})}),unassignedOperators:r.unassignedOperators.filter(function(t){return t.id!==e})}),l({open:!1}),u.assignOperator({input:{userId:e,workplaceId:n,shiftId:o.shift.id,validFrom:o.date}}).then(c).catch(function(){}))},[u,r,o,s,l,c]),x=e.useCallback(function(e,t){l({open:!0,title:t,width:"25%",mainContent:m.default.createElement(ha,{userId:e,data:r,gqlClients:i,viewState:o,onAssignToWorkplace:N})})},[r,i,o,l,N]);return m.default.createElement(yi,{onDragStart:v,onDragEnd:function(e){if(f({}),u){var n=function(e,n){var r=n.source,o=n.destination,i=n.draggableId;if(!o)return null;if(r.droppableId===o.droppableId&&r.index===o.index)return null;var a,s=pa(i),l=fa(i),c="pool"===r.droppableId,u="pool"===o.droppableId;if(s&&u)return null;var d=t.PresenceStatusEnum.NotPresent,p=[].concat(e.unassignedOperators),f=e.workplaces.map(function(e){return O({},e,{assignedOperators:[].concat(e.assignedOperators),unplannedOperators:[].concat(e.unplannedOperators)})});if(s){var m=f.find(function(e){return e.workplace.id===r.droppableId});if(m){var g=m.unplannedOperators.findIndex(function(e){return e.user.id===l});-1!==g&&(a=m.unplannedOperators[g].user,d=t.PresenceStatusEnum.PresentElsewhere,m.unplannedOperators.splice(g,1))}var h=p.findIndex(function(e){return e.id===l});-1!==h&&p.splice(h,1)}else if(c){var b=p.findIndex(function(e){return e.id===l});-1!==b&&(a=p[b],p.splice(b,1))}else{var E=f.find(function(e){return e.workplace.id===r.droppableId});if(E){var v=E.assignedOperators.findIndex(function(e){return e.user.id===l});-1!==v&&(a=E.assignedOperators[v].user,d=E.assignedOperators[v].presenceStatus,E.assignedOperators.splice(v,1),E.assignedCount-=1)}}if(!a)return null;if(u)p.splice(o.index,0,a);else{var y=f.find(function(e){return e.workplace.id===o.droppableId});y&&(y.assignedOperators.splice(o.index,0,{user:a,presenceStatus:d}),y.assignedCount+=1)}return{workplaces:f,unassignedOperators:p}}(r,e);if(n){s(n);var i=e.destination,a=fa(e.draggableId);if("pool"===i.droppableId)u.unassignOperator({input:{userId:a,shiftId:o.shift.id,validFrom:o.date}}).catch(function(){});else{var l=i.droppableId,c=u.assignOperator({input:{userId:a,workplaceId:l,shiftId:o.shift.id,validFrom:o.date}});o.isCurrentShift?c.then(function(){return u.usersPresences({filter:{user_id_eq:a,shift_id_eq:o.shift.id,finished_at_null:"true"}})}).then(function(e){var n=e.usersPresences;if(0!==n.length){var r=n[n.length-1].workplaceId===l?t.PresenceStatusEnum.Present:t.PresenceStatusEnum.PresentElsewhere;s({workplaces:h.current.workplaces.map(function(e){return e.workplace.id===l?O({},e,{assignedOperators:e.assignedOperators.map(function(e){return e.user.id===a?O({},e,{presenceStatus:r}):e})}):e})})}}).catch(function(){}):c.catch(function(){})}}}}},m.default.createElement(a.Box,{sx:Ta.grid},m.default.createElement(wa,{operators:r.unassignedOperators,unplannedUserIds:o.isCurrentShift?b:void 0,onOperatorClick:o.isCurrentShift?x:void 0}),r.workplaces.map(function(e){return m.default.createElement(Aa,{key:e.workplace.id,assignment:e,viewState:o,registerRef:function(t){return E(e.workplace.id,t)},frozenHeight:p[e.workplace.id],onOperatorClick:o.isCurrentShift?x:void 0,onRemoveOperator:function(t){return y(t,e.workplace.id)}})})))},Va={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)"}},ka=function(e){var t=e.viewState,n=e.departmentName,r=e.canPrev,o=e.canNext,i=void 0===o||o,s=e.onNavigate;return m.default.createElement(a.Box,{sx:Va.root},m.default.createElement(a.IconButton,{color:"secondary",disabled:!(void 0===r||r),onClick:function(){return s("prev")}},m.default.createElement(y.default,null)),m.default.createElement(a.Typography,{sx:Va.label},t.date," - ",t.shift.name,n&&" - "+n),m.default.createElement(a.IconButton,{color:"secondary",disabled:!i,onClick:function(){return s("next")}},m.default.createElement(N.default,null)))},Ra={root:{display:"flex",flexDirection:"column",height:"100%"},loader:{display:"flex",justifyContent:"center",alignItems:"center",flexGrow:1}},Ba=function(n){var r=n.data,i=n.updateData,s=n.gqlClients,l=n.settings,c=n.updateSidePanelProps,u=o.useTranslation().t,d=e.useState(null),p=d[0],f=d[1],g=e.useState(!0),b=g[0],E=g[1],v=e.useState(!1),y=v[0],N=v[1],x=e.useMemo(function(){if(null!=l&&l.departmentId){var e=r.departments.find(function(e){return e.id===l.departmentId});return null==e?void 0:e.name}},[null==l?void 0:l.departmentId,r.departments]),D=s.graphqlSdk,O=s.gqlWsClient;e.useEffect(function(){if(r.shifts.length>0&&!p){var e=_(r.shifts);e&&f(e)}},[r.shifts,p]),e.useEffect(function(){var e;O&&null!=r&&null!=(e=r.workplaces)&&e.length&&!y&&(r.workplaces.forEach(function(e){var n=e.workplace;return O.subscribe(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:L,r=void 0,o=Array.isArray(e),i=[e],a=-1,s=[],l=void 0,c=void 0,u=void 0,d=[],p=[],f=e;do{var m=++a===i.length,g=m&&0!==s.length;if(m){if(c=0===p.length?void 0:d[d.length-1],l=u,u=p.pop(),g){if(o)l=l.slice();else{for(var h={},b=0,E=Object.keys(l);b<E.length;b++){var v=E[b];h[v]=l[v]}l=h}for(var y=0,N=0;N<s.length;N++){var x=s[N][0],D=s[N][1];o&&(x-=y),o&&null===D?(l.splice(x,1),y++):l[x]=D}}a=r.index,i=r.keys,s=r.edits,o=r.inArray,r=r.prev}else{if(c=u?o?a:i[a]:void 0,null==(l=u?u[c]:f))continue;u&&d.push(c)}var O,w=void 0;if(!Array.isArray(l)){if(!R(l))throw new Error("Invalid AST Node: ".concat(F(l),"."));var S=j(t,l.kind,m);if(S){if((w=S.call(t,l,c,u,d,p))===M)break;if(!1===w){if(!m){d.pop();continue}}else if(void 0!==w&&(s.push([c,w]),!m)){if(!R(w)){d.pop();continue}l=w}}}void 0===w&&g&&s.push([c,l]),m?d.pop():(r={inArray:o,index:a,keys:i,edits:s,prev:r},i=(o=Array.isArray(l))?l:null!==(O=n[l.kind])&&void 0!==O?O:[],a=-1,s=[],u&&p.push(u),u=l)}while(void 0!==r);return 0!==s.length&&(f=s[s.length-1][1]),f}(t.WorkplaceEventDocument,{leave:G}),{id:n.id},function(e){var n=e.subject;if(e.event===t.WorkplaceEvent.CurrentShiftChanged&&n){var r=n,o=h.default().format("YYYY-MM-DD");f(function(e){return null!=e&&e.isCurrentShift?{date:o,shift:r,isCurrentShift:!0}:e})}})}),N(!0))},[O,null==r?void 0:r.workplaces,y]);var w=e.useRef(null);w.current=function(e){void 0===e&&(e=!1),D&&p&&i&&(e&&E(!0),D.workplaceAssignments({input:{date:p.date,shiftId:p.shift.id,departmentId:(null==l?void 0:l.departmentId)||void 0}}).then(function(e){return i(e.workplaceAssignments)}).catch(function(){}).finally(function(){e&&E(!1)}))},e.useEffect(function(){if(p&&D){null==w.current||w.current(!0);var e=setInterval(function(){return null==w.current?void 0:w.current()},1e3*((null==l?void 0:l.refreshInterval)||60));return function(){return clearInterval(e)}}},[p,D,null==l?void 0:l.departmentId,null==l?void 0:l.refreshInterval]);var I=e.useCallback(function(e){if(p){var n=function(e,n,r){var o=S(n);if(!C(e,o,r))return e;var i=o.findIndex(function(t){return t.id===e.shift.id}),a=function(e,n){var r=h.default();if(e!==r.format("YYYY-MM-DD"))return!1;var i=t.normalizeShifts(o,r),a=t.getCurrentShift(r,i);return(null==a?void 0:a.name)===n.name};if("next"===r){if(i<o.length-1){var s=o[i+1];return{date:e.date,shift:s,isCurrentShift:a(e.date,s)}}return{date:h.default(e.date).add(1,"day").format("YYYY-MM-DD"),shift:o[0],isCurrentShift:!1}}if(i>0){var l=o[i-1];return{date:e.date,shift:l,isCurrentShift:a(e.date,l)}}return{date:h.default(e.date).subtract(1,"day").format("YYYY-MM-DD"),shift:o[o.length-1],isCurrentShift:!1}}(p,r.shifts,e);f(n)}},[p,r.shifts]),A=!!p&&C(p,r.shifts,"prev"),T=!!p&&C(p,r.shifts,"next");return m.default.createElement(a.Box,{sx:Ra.root},p?m.default.createElement(m.default.Fragment,null,m.default.createElement(ka,{viewState:p,departmentName:x,canPrev:A,canNext:T,onNavigate:I}),b?m.default.createElement(a.Box,{sx:Ra.loader},m.default.createElement(a.CircularProgress,null)):m.default.createElement(Pa,{data:r,viewState:p,gqlClients:s,updateData:i,updateSidePanelProps:c,refetchAssignments:function(){return null==w.current?void 0:w.current()}})):m.default.createElement(a.Typography,null,u("noShiftsAvailable")))};function Fa(e){this._maxSize=e,this.clear()}Fa.prototype.clear=function(){this._size=0,this._values=Object.create(null)},Fa.prototype.get=function(e){return this._values[e]},Fa.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var $a=/[^.^\]^[]+|(?=\[\]|\.\.)/g,La=/^\d+$/,Ma=/^\d/,ja=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,Ga=/^\s*(['"]?)(.*?)(\1)\s*$/,Ua=new Fa(512),Wa=new Fa(512),za=new Fa(512),qa={Cache:Fa,split:Ya,normalizePath:Ha,setter:function(e){var t=Ha(e);return Wa.get(e)||Wa.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=Ha(e);return za.get(e)||za.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+(Ka(t)||La.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])&&(Za(r)&&(r='"'+r+'"'),i=!(a=Ka(r))&&/^\d+$/.test(r),t.call(n,r,a,i,o,e))}(Array.isArray(e)?e:Ya(e),t,n)}};function Ha(e){return Ua.get(e)||Ua.set(e,Ya(e).map(function(e){return e.replace(Ga,"$2")}))}function Ya(e){return e.match($a)||[""]}function Ka(e){return"string"==typeof e&&e&&-1!==["'",'"'].indexOf(e.charAt(0))}function Za(e){return!Ka(e)&&(function(e){return e.match(Ma)&&!e.match(La)}(e)||function(e){return ja.test(e)}(e))}const Ja=/[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,Xa=e=>e.match(Ja)||[];var Qa=e=>Xa(e).reduce((e,t)=>`${e}${e?t[0].toUpperCase()+t.slice(1).toLowerCase():t.toLowerCase()}`,""),es=e=>(e=>Xa(e).join("_").toLowerCase())(e),ts=function(e){return ns(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 ns(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 u=a.get(e)||new Set;if(t=(u=Array.from(u)).length){i.add(e);do{var d=u[--t];l(d,s.get(d),i)}while(t);i.delete(e)}r[--n]=e}}}ts.array=ns;const rs=Object.prototype.toString,os=Error.prototype.toString,is=RegExp.prototype.toString,as="undefined"!=typeof Symbol?Symbol.prototype.toString:()=>"",ss=/^Symbol\((.*)\)(.*)$/;function ls(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 as.call(e).replace(ss,"Symbol($1)");const r=rs.call(e).slice(8,-1);return"Date"===r?isNaN(e.getTime())?""+e:e.toISOString(e):"Error"===r||e instanceof Error?"["+os.call(e)+"]":"RegExp"===r?is.call(e):null}function cs(e,t){let n=ls(e,t);return null!==n?n:JSON.stringify(e,function(e,n){let r=ls(this[e],t);return null!==r?r:n},2)}function us(e){return null==e?[]:[].concat(e)}let ds,ps,fs,ms=/\$\{\s*(\w+)\s*\}/g;ds=Symbol.toStringTag;class gs{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[ds]="Error",this.name="ValidationError",this.value=t,this.path=n,this.type=r,this.errors=[],this.inner=[],us(e).forEach(e=>{hs.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]}}ps=Symbol.hasInstance,fs=Symbol.toStringTag;class hs 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(ms,(e,n)=>cs(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 gs(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[fs]="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,hs)}static[ps](e){return gs[Symbol.hasInstance](e)||super[Symbol.hasInstance](e)}}let bs={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 \`${cs(r,!0)}\`).`:".";return"mixed"!==t?`${e} must be a \`${t}\` type, but the final value was: \`${cs(n,!0)}\``+o:`${e} must match the configured type. The validated value was: \`${cs(n,!0)}\``+o}},Es={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"},vs={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"},ys={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Ns={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},xs={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: \`${cs(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: \`${cs(n,!0)}\``}return hs.formatError(bs.notType,e)}};var Ds=Object.assign(Object.create(null),{mixed:bs,string:Es,number:vs,date:ys,object:Ns,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:xs});const Os=e=>e&&e.__isYupSchema__;class ws{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 ws(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(!Os(r))throw new TypeError("conditions must return a schema object");return r.resolve(t)}}class Ss{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&&qa.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}}Ss.prototype.__isYupRef=!0;const Is=e=>null==e;function _s(e){function t({value:t,path:n="",options:r,originalValue:o,schema:i},a,s){const{name:l,test:c,params:u,message:d,skipAbsent:p}=e;let{parent:f,context:m,abortEarly:g=i.spec.abortEarly,disableStackTrace:h=i.spec.disableStackTrace}=r;const b={value:t,parent:f,context:m};function E(e={}){const r=Cs(Object.assign({value:t,originalValue:o,label:i.spec.label,path:e.path||n,spec:i.spec,disableStackTrace:e.disableStackTrace||h},u,e.params),b),a=new hs(hs.formatError(e.message||d,r),t,r.path,e.type||l,r.disableStackTrace);return a.params=r,a}const v=g?a:s;let y={path:n,parent:f,type:l,from:r.from,createError:E,resolve:e=>As(e,b),options:r,originalValue:o,schema:i};const N=e=>{hs.isError(e)?v(e):e?s(null):v(E())},x=e=>{hs.isError(e)?v(e):a(e)};if(p&&Is(t))return N(!0);let D;try{var O;if(D=c.call(y,t,y),"function"==typeof(null==(O=D)?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(D).then(N,x)}}catch(e){return void x(e)}N(D)}return t.OPTIONS=e,t}function Cs(e,t){if(!e)return e;for(const n of Object.keys(e))e[n]=As(e[n],t);return e}function As(e,t){return Ss.isRef(e)?e.getValue(t.value,t.parent,t.context):e}function Ts(e,t,n,r=n){let o,i,a;return t?(qa.forEach(t,(s,l,c)=>{let u=l?s.slice(1,s.length-1):s,d="tuple"===(e=e.resolve({context:r,parent:o,value:n})).type,p=c?parseInt(u,10):0;if(e.innerType||d){if(d&&!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=d?e.spec.types[p]:e.innerType}if(!c){if(!e.fields||!e.fields[u])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[u],e=e.fields[u]}i=u,a=l?"["+s+"]":"."+s}),{schema:e,parent:o,parentPath:i}):{parent:o,parentPath:t,schema:e}}class Ps extends Set{describe(){const e=[];for(const t of this.values())e.push(Ss.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 Ps(this.values())}merge(e,t){const n=this.clone();return e.forEach(e=>n.add(e)),t.forEach(e=>n.delete(e)),n}}function Vs(e,t=new Map){if(Os(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]=Vs(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,Vs(o,t))}else if(e instanceof Set){n=new Set,t.set(e,n);for(const r of e)n.add(Vs(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]=Vs(o,t)}return n}function ks(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 Rs(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:ks(n)}))}(e,t);const r=t?`${t}.${e.path}`:e.path;return e.inner.flatMap(e=>Rs(e,r))}class Bs{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 Ps,this._blacklist=new Ps,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(bs.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=Vs(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&&Is(o))return o;let i=cs(e),a=cs(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))},u=e=>{r||(r=!0,n(e,i))},d=o.length,p=[];if(!d)return u([]);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)),--d<=0&&u(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)=>{hs.isError(e)&&(e.value=t),i(e)},(e,t)=>{e.length?i(new hs(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 hs.isError(e)&&(e.value=t),e},(t,n)=>{if(t.length)throw new hs(t,e,void 0,void 0,i);r=n}),r}isValid(e,t){return this.validate(e,t).then(()=>!0,e=>{if(hs.isError(e))return!1;throw e})}isValidSync(e,t){try{return this.validateSync(e,t),!0}catch(e){if(hs.isError(e))return!1;throw e}}_getDefault(e){let t=this.spec.default;return null==t?t:"function"==typeof t?t.call(this,e):Vs(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=_s({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=_s({message:t,name:"optionality",test(e){return void 0!==e||this.schema.spec.optional}}),n}optional(){return this.optionality(!0)}defined(e=bs.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=bs.notNull){return this.nullability(!1,e)}required(e=bs.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=bs.default),"function"!=typeof t.test)throw new TypeError("`test` is a required parameters");let n=this.clone(),r=_s(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=us(e).map(e=>new Ss(e));return r.forEach(e=>{e.isSibling&&n.deps.push(e.key)}),n.conditions.push("function"==typeof t?new ws(r,t):ws.fromOptions(r,t)),n}typeError(e){let t=this.clone();return t.internalTests.typeError=_s({message:e,name:"typeError",skipAbsent:!0,test(e){return!!this.schema._typeCheck(e)||this.createError({params:{type:this.schema.type}})}}),t}oneOf(e,t=bs.oneOf){let n=this.clone();return e.forEach(e=>{n._whitelist.add(e),n._blacklist.delete(e)}),n.internalTests.whiteList=_s({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=bs.notOneOf){let n=this.clone();return e.forEach(e=>{n._blacklist.add(e),n._whitelist.delete(e)}),n.internalTests.blacklist=_s({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?Cs(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 hs)return{issues:Rs(e)};throw e}}}}}Bs.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])Bs.prototype[`${e}At`]=function(t,n,r={}){const{parent:o,parentPath:i,schema:a}=Ts(this,t,n,r.context);return a[e](o&&o[i],Object.assign({},r,{parent:o,path:t}))};for(const e of["equals","is"])Bs.prototype[e]=Bs.prototype.oneOf;for(const e of["not","nope"])Bs.prototype[e]=Bs.prototype.notOneOf;const Fs=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function $s(e){var t,n;const r=Fs.exec(e);return r?{year:Ls(r[1]),month:Ls(r[2],1)-1,day:Ls(r[3],1),hour:Ls(r[4]),minute:Ls(r[5]),second:Ls(r[6]),millisecond:r[7]?Ls(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:Ls(r[10]),minuteOffset:Ls(r[11])}:null}function Ls(e,t=0){return Number(e)||t}let Ms=/^[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])?)*$/,js=/^((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,Gs=/^(?:[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,Us=new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"),Ws=e=>Is(e)||e===e.trim(),zs={}.toString();function qs(){return new Hs}class Hs extends Bs{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===zs?e:n})})}required(e){return super.required(e).withMutation(t=>t.test({message:e||bs.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=Es.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=Es.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=Es.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||Es.matches,params:{regex:e},skipAbsent:!0,test:t=>""===t&&o||-1!==t.search(e)})}email(e=Es.email){return this.matches(Ms,{name:"email",message:e,excludeEmptyString:!0})}url(e=Es.url){return this.matches(js,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=Es.uuid){return this.matches(Gs,{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(Us,{name:"datetime",message:r||Es.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:r||Es.datetime_offset,params:{allowOffset:t},skipAbsent:!0,test:e=>{if(!e||t)return!0;const n=$s(e);return!!n&&!!n.z}}).test({name:"datetime_precision",message:r||Es.datetime_precision,params:{precision:n},skipAbsent:!0,test:e=>{if(!e||null==n)return!0;const t=$s(e);return!!t&&t.precision===n}})}ensure(){return this.default("").transform(e=>null===e?"":e)}trim(e=Es.trim){return this.transform(e=>null!=e?e.trim():e).test({message:e,name:"trim",test:Ws})}lowercase(e=Es.lowercase){return this.transform(e=>Is(e)?e:e.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:e=>Is(e)||e===e.toLowerCase()})}uppercase(e=Es.uppercase){return this.transform(e=>Is(e)?e:e.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:e=>Is(e)||e===e.toUpperCase()})}}function Ys(){return new Ks}qs.prototype=Hs.prototype;class Ks extends Bs{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=vs.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=vs.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=vs.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=vs.moreThan){return this.test({message:t,name:"min",exclusive:!0,params:{more:e},skipAbsent:!0,test(t){return t>this.resolve(e)}})}positive(e=vs.positive){return this.moreThan(0,e)}negative(e=vs.negative){return this.lessThan(0,e)}integer(e=vs.integer){return this.test({name:"integer",message:e,skipAbsent:!0,test:e=>Number.isInteger(e)})}truncate(){return this.transform(e=>Is(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=>Is(t)?t:Math[e](t))}}Ys.prototype=Ks.prototype;let Zs=new Date("");class Js extends Bs{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=$s(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)?Js.INVALID_DATE:new Date(e)))})}prepareParam(e,t){let n;if(Ss.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=ys.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=ys.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 Xs(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 Qs(e){return(t,n)=>Xs(e,t)-Xs(e,n)}Js.INVALID_DATE=Zs;const el=(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 tl(e){if("fields"in e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=tl(r);return e.setFields(t)}if("array"===e.type){const t=e.optional();return t.innerType&&(t.innerType=tl(t.innerType)),t}return"tuple"===e.type?e.optional().clone({types:e.spec.types.map(tl)}):"optional"in e?e.optional():e}let nl=e=>"[object Object]"===Object.prototype.toString.call(e);function rl(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(e=>-1===n.indexOf(e))}const ol=Qs([]);function il(e){return new al(e)}class al extends Bs{constructor(e){super({type:"object",check:e=>nl(e)||"function"==typeof e}),this.fields=Object.create(null),this._sortErrors=ol,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,u=r[e];if(n){let o;l.path=(t.path?`${t.path}.`:"")+e,n=n.resolve({value:u,context:t.context,parent:s});let i=n instanceof Bs?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?u:n.cast(u,l),void 0!==o&&(s[e]=o)}else a&&!i&&(s[e]=u);a===e in s&&s[e]===u||(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||!nl(o))return void r(e,o);i=i||o;let s=[];for(let e of this._nodes){let n=this.fields[e];n&&!Ss.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=qa.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),Ss.isRef(n)&&n.isSibling?i(n.path,t):Os(n)&&"deps"in n&&n.deps.forEach(e=>i(e,t))}return ts.array(Array.from(r),n).reverse()}(e,t),n._sortErrors=Qs(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 tl(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=qa.getter(e,!0);return this.transform(o=>{if(!o)return o;let i=o;return((e,t)=>{const n=[...qa.normalizePath(t)];if(1===n.length)return n[0]in e;let r=n.pop(),o=qa.getter(qa.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(el)}exact(e){return this.test({name:"exact",exclusive:!0,message:e||Ns.exact,test(e){if(null==e)return!0;const t=rl(this.schema,e);return 0===t.length||this.createError({params:{properties:t.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(e=!0,t=Ns.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=rl(this.schema,t);return!e||0===n.length||this.createError({params:{unknown:n.join(", ")}})}});return n.spec.noUnknown=e,n}unknown(e=!0,t=Ns.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(Qa)}snakeCase(){return this.transformKeys(es)}constantCase(){return this.transformKeys(e=>es(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}}il.prototype=al.prototype;var sl=function(e){var t;return t={mixed:{required:e("This field is required")}},Object.keys(t).forEach(e=>{Object.keys(t[e]).forEach(n=>{Ds[e][n]=t[e][n]})}),{initialValues:{departmentId:void 0,refreshInterval:60},validationSchema:il({departmentId:qs(),refreshInterval:Ys().oneOf([15,30,60]).required()})}},ll=["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,ll),u=t.useGqlClients({url:o,wsUrl:i,lang:a}),d=u.graphqlSdk,p=u.gqlWsClient,f=e.useState(s),g=f[0],h=f[1];return e.useEffect(function(){!s&&d&&Promise.all([d.departments(),d.shifts()]).then(function(e){var t=e[0].departments,n=e[1].shifts,r=_(n);if(r)return d.workplaceAssignments({input:{date:r.date,shiftId:r.shift.id,departmentId:(null==l?void 0:l.departmentId)||void 0}}).then(function(e){return h(O({},e.workplaceAssignments,{departments:t,shifts:n}))})}).catch(function(){})},[s,d,null==l?void 0:l.departmentId]),m.default.createElement(n.BaseWidget,O({lang:a,locales:w,data:g,gqlClients:{graphqlSdk:d,gqlWsClient:p},WidgetView:Ba,getSettingsFormProps:sl,SettingsFormContent:T,version:A,"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=A;
|
|
8
8
|
//# sourceMappingURL=index.js.map
|