@wilow_app/design-system 0.0.3 → 0.0.4

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.d.ts CHANGED
@@ -31,6 +31,7 @@ export declare interface PathData {
31
31
  name: string;
32
32
  };
33
33
  status: string | {
34
+ code: string;
34
35
  name: string;
35
36
  };
36
37
  driver: {
@@ -48,6 +49,10 @@ export declare interface PathOrder {
48
49
  eta_end: string;
49
50
  completed_at: string | null;
50
51
  customer: Customer;
52
+ status: string | {
53
+ code: string;
54
+ name: string;
55
+ };
51
56
  }
52
57
 
53
58
  export { }
package/dist/index.es.js CHANGED
@@ -6335,97 +6335,106 @@ const ur = {
6335
6335
  minute: "2-digit",
6336
6336
  hour12: !0
6337
6337
  }) : "--:--", fr = (e) => typeof e == "object" && (e != null && e.name) ? e.name : e, Od = ({ order: e, index: t, pathType: n, pathPeriod: r }) => {
6338
- const o = !!e.completed_at;
6339
- return /* @__PURE__ */ C(ql, { draggableId: e.id.toString(), index: t, children: (i, s) => {
6340
- var c, a, d;
6341
- return /* @__PURE__ */ L(
6342
- "div",
6343
- {
6344
- ref: i.innerRef,
6345
- ...i.draggableProps,
6346
- style: {
6347
- ...P.timelineItem,
6348
- ...i.draggableProps.style,
6349
- opacity: s.isDragging ? 0.8 : 1
6350
- },
6351
- children: [
6352
- /* @__PURE__ */ L(
6353
- "div",
6354
- {
6355
- style: {
6356
- ...P.bubble,
6357
- ...o ? P.bubbleCompleted : P.bubblePending
6358
- },
6359
- children: [
6360
- t + 1,
6361
- " "
6362
- ]
6363
- }
6364
- ),
6365
- /* @__PURE__ */ L("div", { style: P.card, children: [
6366
- /* @__PURE__ */ L("div", { style: P.cardHeader, children: [
6338
+ var i, s;
6339
+ const o = typeof e.status == "string" ? e.status.toLowerCase() === "completed" : ((s = (i = e.status) == null ? void 0 : i.code) == null ? void 0 : s.toLowerCase()) === "completed";
6340
+ return /* @__PURE__ */ C(
6341
+ ql,
6342
+ {
6343
+ draggableId: e.id.toString(),
6344
+ index: t,
6345
+ isDragDisabled: o,
6346
+ children: (c, a) => {
6347
+ var d, p, l;
6348
+ return /* @__PURE__ */ L(
6349
+ "div",
6350
+ {
6351
+ ref: c.innerRef,
6352
+ ...c.draggableProps,
6353
+ style: {
6354
+ ...P.timelineItem,
6355
+ ...c.draggableProps.style,
6356
+ opacity: a.isDragging ? 0.8 : 1
6357
+ },
6358
+ children: [
6367
6359
  /* @__PURE__ */ L(
6368
6360
  "div",
6369
6361
  {
6370
- style: { display: "flex", alignItems: "center", gap: "8px" },
6362
+ style: {
6363
+ ...P.bubble,
6364
+ ...o ? P.bubbleCompleted : P.bubblePending
6365
+ },
6371
6366
  children: [
6372
- /* @__PURE__ */ L("span", { style: P.title, children: [
6373
- n,
6374
- " #",
6375
- e.sequence_rank
6376
- ] }),
6377
- o && /* @__PURE__ */ L("span", { style: P.completedBadge, children: [
6378
- /* @__PURE__ */ C(Pt, { color: "#16a34a", children: /* @__PURE__ */ C(xd, {}) }),
6379
- " ",
6380
- "Completed at ",
6381
- Rt(e.completed_at)
6382
- ] })
6367
+ t + 1,
6368
+ " "
6383
6369
  ]
6384
6370
  }
6385
6371
  ),
6386
- /* @__PURE__ */ C("div", { ...i.dragHandleProps, children: /* @__PURE__ */ C(Id, {}) })
6387
- ] }),
6388
- /* @__PURE__ */ L("div", { style: P.customerRow, children: [
6389
- "Customer:",
6390
- " ",
6391
- /* @__PURE__ */ C("span", { style: { color: "#374151" }, children: (c = e.customer) == null ? void 0 : c.name })
6392
- ] }),
6393
- /* @__PURE__ */ L("div", { style: P.detailsGrid, children: [
6394
- /* @__PURE__ */ L("div", { style: P.gridItem, children: [
6395
- /* @__PURE__ */ C("div", { style: P.gridLabel, children: "Order" }),
6396
- /* @__PURE__ */ L("div", { style: P.gridValue, children: [
6397
- "#",
6398
- e.order_id
6399
- ] })
6400
- ] }),
6401
- /* @__PURE__ */ L("div", { style: P.gridItem, children: [
6402
- /* @__PURE__ */ C("div", { style: P.gridLabel, children: "Location" }),
6403
- /* @__PURE__ */ L("div", { style: P.gridValueWithIcon, children: [
6404
- /* @__PURE__ */ C(Pt, { color: "#3b82f6", children: /* @__PURE__ */ C(Dd, {}) }),
6405
- /* @__PURE__ */ C("span", { style: P.truncate, children: ((d = (a = e.customer) == null ? void 0 : a.address) == null ? void 0 : d.street_area) || "No Address" })
6406
- ] })
6407
- ] }),
6408
- /* @__PURE__ */ L("div", { style: P.gridItem, children: [
6409
- /* @__PURE__ */ C("div", { style: P.gridLabel, children: "Period" }),
6410
- /* @__PURE__ */ C("div", { style: P.gridValue, children: r })
6411
- ] }),
6412
- /* @__PURE__ */ L("div", { style: P.gridItem, children: [
6413
- /* @__PURE__ */ C("div", { style: P.gridLabel, children: "Time Window" }),
6414
- /* @__PURE__ */ L("div", { style: P.gridValueWithIcon, children: [
6415
- /* @__PURE__ */ C(Pt, { children: /* @__PURE__ */ C(Nd, {}) }),
6416
- /* @__PURE__ */ L("span", { children: [
6417
- Rt(e.eta_start),
6418
- " - ",
6419
- Rt(e.eta_end)
6372
+ /* @__PURE__ */ L("div", { style: P.card, children: [
6373
+ /* @__PURE__ */ L("div", { style: P.cardHeader, children: [
6374
+ /* @__PURE__ */ L(
6375
+ "div",
6376
+ {
6377
+ style: { display: "flex", alignItems: "center", gap: "8px" },
6378
+ children: [
6379
+ /* @__PURE__ */ L("span", { style: P.title, children: [
6380
+ n,
6381
+ " #",
6382
+ e.sequence_rank
6383
+ ] }),
6384
+ o && /* @__PURE__ */ L("span", { style: P.completedBadge, children: [
6385
+ /* @__PURE__ */ C(Pt, { color: "#16a34a", children: /* @__PURE__ */ C(xd, {}) }),
6386
+ " ",
6387
+ "Completed at ",
6388
+ Rt(e.completed_at || "")
6389
+ ] })
6390
+ ]
6391
+ }
6392
+ ),
6393
+ !o && /* @__PURE__ */ C("div", { ...c.dragHandleProps, children: /* @__PURE__ */ C(Id, {}) })
6394
+ ] }),
6395
+ /* @__PURE__ */ L("div", { style: P.customerRow, children: [
6396
+ "Customer:",
6397
+ " ",
6398
+ /* @__PURE__ */ C("span", { style: { color: "#374151" }, children: (d = e.customer) == null ? void 0 : d.name })
6399
+ ] }),
6400
+ /* @__PURE__ */ L("div", { style: P.detailsGrid, children: [
6401
+ /* @__PURE__ */ L("div", { style: P.gridItem, children: [
6402
+ /* @__PURE__ */ C("div", { style: P.gridLabel, children: "Order" }),
6403
+ /* @__PURE__ */ L("div", { style: P.gridValue, children: [
6404
+ "#",
6405
+ e.order_id
6406
+ ] })
6407
+ ] }),
6408
+ /* @__PURE__ */ L("div", { style: P.gridItem, children: [
6409
+ /* @__PURE__ */ C("div", { style: P.gridLabel, children: "Location" }),
6410
+ /* @__PURE__ */ L("div", { style: P.gridValueWithIcon, children: [
6411
+ /* @__PURE__ */ C(Pt, { color: "#3b82f6", children: /* @__PURE__ */ C(Dd, {}) }),
6412
+ /* @__PURE__ */ C("span", { style: P.truncate, children: ((l = (p = e.customer) == null ? void 0 : p.address) == null ? void 0 : l.street_area) || "No Address" })
6413
+ ] })
6414
+ ] }),
6415
+ /* @__PURE__ */ L("div", { style: P.gridItem, children: [
6416
+ /* @__PURE__ */ C("div", { style: P.gridLabel, children: "Period" }),
6417
+ /* @__PURE__ */ C("div", { style: P.gridValue, children: r })
6418
+ ] }),
6419
+ /* @__PURE__ */ L("div", { style: P.gridItem, children: [
6420
+ /* @__PURE__ */ C("div", { style: P.gridLabel, children: "Time Window" }),
6421
+ /* @__PURE__ */ L("div", { style: P.gridValueWithIcon, children: [
6422
+ /* @__PURE__ */ C(Pt, { children: /* @__PURE__ */ C(Nd, {}) }),
6423
+ /* @__PURE__ */ L("span", { children: [
6424
+ Rt(e.eta_start),
6425
+ " - ",
6426
+ Rt(e.eta_end)
6427
+ ] })
6428
+ ] })
6420
6429
  ] })
6421
6430
  ] })
6422
6431
  ] })
6423
- ] })
6424
- ] })
6425
- ]
6432
+ ]
6433
+ }
6434
+ );
6426
6435
  }
6427
- );
6428
- } });
6436
+ }
6437
+ );
6429
6438
  }, _d = ({
6430
6439
  path: e,
6431
6440
  onReorder: t
@@ -6559,7 +6568,11 @@ const ur = {
6559
6568
  borderRadius: "8px"
6560
6569
  },
6561
6570
  gridItem: { display: "flex", flexDirection: "column", gap: "4px" },
6562
- gridLabel: { fontSize: "11px", color: "#9ca3af", textTransform: "uppercase" },
6571
+ gridLabel: {
6572
+ fontSize: "11px",
6573
+ color: "#9ca3af",
6574
+ textTransform: "uppercase"
6575
+ },
6563
6576
  gridValue: { fontSize: "13px", fontWeight: "600", color: "#374151" },
6564
6577
  gridValueWithIcon: {
6565
6578
  fontSize: "13px",
package/dist/index.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(Q,D){typeof exports=="object"&&typeof module<"u"?D(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],D):(Q=typeof globalThis<"u"?globalThis:Q||self,D(Q["my-react-component"]={},Q.jsxRuntime,Q.React,Q.ReactDOM))})(this,function(Q,D,E,rt){"use strict";function _o(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const C=_o(E);function G(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 Po=typeof Symbol=="function"&&Symbol.observable||"@@observable",bn=Po,vn=()=>Math.random().toString(36).substring(7).split("").join("."),To={INIT:`@@redux/INIT${vn()}`,REPLACE:`@@redux/REPLACE${vn()}`},yn=To;function Bo(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function Vo(e){if(e===void 0)return"undefined";if(e===null)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(Mo(e))return"date";if(Lo(e))return"error";const n=Ro(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,"")}function Ro(e){return typeof e.constructor=="function"?e.constructor.name:null}function Lo(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function Mo(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function ee(e){let t=typeof e;return process.env.NODE_ENV!=="production"&&(t=Vo(e)),t}function En(e,t,n){if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?G(2):`Expected the root reducer to be a function. Instead, received: '${ee(e)}'`);if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?G(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(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(process.env.NODE_ENV==="production"?G(1):`Expected the enhancer to be a function. Instead, received: '${ee(n)}'`);return n(En)(e,t)}let r=e,o=t,i=new Map,s=i,c=0,a=!1;function d(){s===i&&(s=new Map,i.forEach((h,y)=>{s.set(y,h)}))}function p(){if(a)throw new Error(process.env.NODE_ENV==="production"?G(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 l(h){if(typeof h!="function")throw new Error(process.env.NODE_ENV==="production"?G(4):`Expected the listener to be a function. Instead, received: '${ee(h)}'`);if(a)throw new Error(process.env.NODE_ENV==="production"?G(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 y=!0;d();const v=c++;return s.set(v,h),function(){if(y){if(a)throw new Error(process.env.NODE_ENV==="production"?G(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.");y=!1,d(),s.delete(v),i=null}}}function u(h){if(!Bo(h))throw new Error(process.env.NODE_ENV==="production"?G(7):`Actions must be plain objects. Instead, the actual type was: '${ee(h)}'. 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(typeof h.type>"u")throw new Error(process.env.NODE_ENV==="production"?G(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(typeof h.type!="string")throw new Error(process.env.NODE_ENV==="production"?G(17):`Action "type" property must be a string. Instead, the actual type was: '${ee(h.type)}'. Value was: '${h.type}' (stringified)`);if(a)throw new Error(process.env.NODE_ENV==="production"?G(9):"Reducers may not dispatch actions.");try{a=!0,o=r(o,h)}finally{a=!1}return(i=s).forEach(v=>{v()}),h}function g(h){if(typeof h!="function")throw new Error(process.env.NODE_ENV==="production"?G(10):`Expected the nextReducer to be a function. Instead, received: '${ee(h)}`);r=h,u({type:yn.REPLACE})}function m(){const h=l;return{subscribe(y){if(typeof y!="object"||y===null)throw new Error(process.env.NODE_ENV==="production"?G(11):`Expected the observer to be an object. Instead, received: '${ee(y)}'`);function v(){const I=y;I.next&&I.next(p())}return v(),{unsubscribe:h(v)}},[bn](){return this}}}return u({type:yn.INIT}),{dispatch:u,subscribe:l,getState:p,replaceReducer:g,[bn]:m}}function Dn(e,t){return function(...n){return t(e.apply(this,n))}}function Nn(e,t){if(typeof e=="function")return Dn(e,t);if(typeof e!="object"||e===null)throw new Error(process.env.NODE_ENV==="production"?G(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];typeof o=="function"&&(n[r]=Dn(o,t))}return n}function xn(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function $o(...e){return t=>(n,r)=>{const o=t(n,r);let i=()=>{throw new Error(process.env.NODE_ENV==="production"?G(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")};const s={getState:o.getState,dispatch:(a,...d)=>i(a,...d)},c=e.map(a=>a(s));return i=xn(...c)(o.dispatch),{...o,dispatch:i}}}var ot={};/**
1
+ (function(Q,D){typeof exports=="object"&&typeof module<"u"?D(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],D):(Q=typeof globalThis<"u"?globalThis:Q||self,D(Q["my-react-component"]={},Q.jsxRuntime,Q.React,Q.ReactDOM))})(this,function(Q,D,E,rt){"use strict";function _o(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const C=_o(E);function G(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 Po=typeof Symbol=="function"&&Symbol.observable||"@@observable",bn=Po,vn=()=>Math.random().toString(36).substring(7).split("").join("."),To={INIT:`@@redux/INIT${vn()}`,REPLACE:`@@redux/REPLACE${vn()}`},yn=To;function Bo(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function Vo(e){if(e===void 0)return"undefined";if(e===null)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(Mo(e))return"date";if(Ro(e))return"error";const n=Lo(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,"")}function Lo(e){return typeof e.constructor=="function"?e.constructor.name:null}function Ro(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function Mo(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function ee(e){let t=typeof e;return process.env.NODE_ENV!=="production"&&(t=Vo(e)),t}function En(e,t,n){if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?G(2):`Expected the root reducer to be a function. Instead, received: '${ee(e)}'`);if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?G(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(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(process.env.NODE_ENV==="production"?G(1):`Expected the enhancer to be a function. Instead, received: '${ee(n)}'`);return n(En)(e,t)}let r=e,o=t,i=new Map,s=i,c=0,a=!1;function d(){s===i&&(s=new Map,i.forEach((h,y)=>{s.set(y,h)}))}function p(){if(a)throw new Error(process.env.NODE_ENV==="production"?G(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 l(h){if(typeof h!="function")throw new Error(process.env.NODE_ENV==="production"?G(4):`Expected the listener to be a function. Instead, received: '${ee(h)}'`);if(a)throw new Error(process.env.NODE_ENV==="production"?G(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 y=!0;d();const v=c++;return s.set(v,h),function(){if(y){if(a)throw new Error(process.env.NODE_ENV==="production"?G(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.");y=!1,d(),s.delete(v),i=null}}}function u(h){if(!Bo(h))throw new Error(process.env.NODE_ENV==="production"?G(7):`Actions must be plain objects. Instead, the actual type was: '${ee(h)}'. 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(typeof h.type>"u")throw new Error(process.env.NODE_ENV==="production"?G(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(typeof h.type!="string")throw new Error(process.env.NODE_ENV==="production"?G(17):`Action "type" property must be a string. Instead, the actual type was: '${ee(h.type)}'. Value was: '${h.type}' (stringified)`);if(a)throw new Error(process.env.NODE_ENV==="production"?G(9):"Reducers may not dispatch actions.");try{a=!0,o=r(o,h)}finally{a=!1}return(i=s).forEach(v=>{v()}),h}function g(h){if(typeof h!="function")throw new Error(process.env.NODE_ENV==="production"?G(10):`Expected the nextReducer to be a function. Instead, received: '${ee(h)}`);r=h,u({type:yn.REPLACE})}function m(){const h=l;return{subscribe(y){if(typeof y!="object"||y===null)throw new Error(process.env.NODE_ENV==="production"?G(11):`Expected the observer to be an object. Instead, received: '${ee(y)}'`);function v(){const I=y;I.next&&I.next(p())}return v(),{unsubscribe:h(v)}},[bn](){return this}}}return u({type:yn.INIT}),{dispatch:u,subscribe:l,getState:p,replaceReducer:g,[bn]:m}}function Dn(e,t){return function(...n){return t(e.apply(this,n))}}function Nn(e,t){if(typeof e=="function")return Dn(e,t);if(typeof e!="object"||e===null)throw new Error(process.env.NODE_ENV==="production"?G(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];typeof o=="function"&&(n[r]=Dn(o,t))}return n}function xn(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function $o(...e){return t=>(n,r)=>{const o=t(n,r);let i=()=>{throw new Error(process.env.NODE_ENV==="production"?G(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")};const s={getState:o.getState,dispatch:(a,...d)=>i(a,...d)},c=e.map(a=>a(s));return i=xn(...c)(o.dispatch),{...o,dispatch:i}}}var ot={};/**
2
2
  * @license React
3
3
  * use-sync-external-store-with-selector.production.js
4
4
  *
@@ -14,11 +14,11 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var On;function Fo(){return On||(On=1,process.env.NODE_ENV!=="production"&&function(){function e(a,d){return a===d&&(a!==0||1/a===1/d)||a!==a&&d!==d}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=E,n=typeof Object.is=="function"?Object.is:e,r=t.useSyncExternalStore,o=t.useRef,i=t.useEffect,s=t.useMemo,c=t.useDebugValue;it.useSyncExternalStoreWithSelector=function(a,d,p,l,u){var g=o(null);if(g.current===null){var m={hasValue:!1,value:null};g.current=m}else m=g.current;g=s(function(){function h(N){if(!y){if(y=!0,v=N,N=l(N),u!==void 0&&m.hasValue){var O=m.value;if(u(O,N))return S=O}return S=N}if(O=S,n(v,N))return O;var A=l(N);return u!==void 0&&u(O,A)?(v=N,O):(v=N,S=A)}var y=!1,v,S,I=p===void 0?null:p;return[function(){return h(d())},I===null?void 0:function(){return h(I())}]},[d,p,l,u]);var b=r(a,g[0],g[1]);return i(function(){m.hasValue=!0,m.value=b},[b]),c(b),b},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),it}process.env.NODE_ENV==="production"?Go():Fo();var Sn=C.version.startsWith("19"),ko=Symbol.for(Sn?"react.transitional.element":"react.element"),Wo=Symbol.for("react.portal"),wn=Symbol.for("react.fragment"),Cn=Symbol.for("react.strict_mode"),An=Symbol.for("react.profiler"),st=Symbol.for("react.consumer"),ct=Symbol.for("react.context"),at=Symbol.for("react.forward_ref"),_n=Symbol.for("react.suspense"),Pn=Symbol.for("react.suspense_list"),Me=Symbol.for("react.memo"),Tn=Symbol.for("react.lazy"),Uo=Symbol.for("react.offscreen"),Ho=Symbol.for("react.client.reference"),jo=at,zo=Me;function qo(e){return typeof e=="string"||typeof e=="function"||e===wn||e===An||e===Cn||e===_n||e===Pn||e===Uo||typeof e=="object"&&e!==null&&(e.$$typeof===Tn||e.$$typeof===Me||e.$$typeof===ct||e.$$typeof===st||e.$$typeof===at||e.$$typeof===Ho||e.getModuleId!==void 0)}function lt(e){if(typeof e=="object"&&e!==null){const{$$typeof:t}=e;switch(t){case ko:switch(e=e.type,e){case wn:case An:case Cn:case _n:case Pn:return e;default:switch(e=e&&e.$$typeof,e){case ct:case at:case Tn:case Me:return e;case st:return e;default:return t}}case Wo:return t}}}function Yo(e){return Sn?lt(e)===st:lt(e)===ct}function Xo(e){return lt(e)===Me}function dt(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function ut(e,t){if(e)(t==="mapStateToProps"||t==="mapDispatchToProps")&&(Object.prototype.hasOwnProperty.call(e,"dependsOnOwnProps")||dt(`The selector for ${t} of connect did not specify a value for dependsOnOwnProps.`));else throw new Error(`Unexpected value for ${t} in connect.`)}function Ko(e,t,n){ut(e,"mapStateToProps"),ut(t,"mapDispatchToProps"),ut(n,"mergeProps")}function Jo(e,t,n,r,{areStatesEqual:o,areOwnPropsEqual:i,areStatePropsEqual:s}){let c=!1,a,d,p,l,u;function g(v,S){return a=v,d=S,p=e(a,d),l=t(r,d),u=n(p,l,d),c=!0,u}function m(){return p=e(a,d),t.dependsOnOwnProps&&(l=t(r,d)),u=n(p,l,d),u}function b(){return e.dependsOnOwnProps&&(p=e(a,d)),t.dependsOnOwnProps&&(l=t(r,d)),u=n(p,l,d),u}function h(){const v=e(a,d),S=!s(v,p);return p=v,S&&(u=n(p,l,d)),u}function y(v,S){const I=!i(S,d),N=!o(v,a,S,d);return a=v,d=S,I&&N?m():I?b():N?h():u}return function(S,I){return c?y(S,I):g(S,I)}}function Zo(e,{initMapStateToProps:t,initMapDispatchToProps:n,initMergeProps:r,...o}){const i=t(e,o),s=n(e,o),c=r(e,o);return process.env.NODE_ENV!=="production"&&Ko(i,s,c),Jo(i,s,c,e,o)}function Qo(e,t){const n={};for(const r in e){const o=e[r];typeof o=="function"&&(n[r]=(...i)=>t(o(...i)))}return n}function ei(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);if(t===null)return!0;let n=t;for(;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return t===n}function Bn(e,t,n){ei(e)||dt(`${n}() in ${t} must return a plain object. Instead received ${e}.`)}function pt(e){return function(n){const r=e(n);function o(){return r}return o.dependsOnOwnProps=!1,o}}function Vn(e){return e.dependsOnOwnProps?!!e.dependsOnOwnProps:e.length!==1}function Rn(e,t){return function(r,{displayName:o}){const i=function(c,a){return i.dependsOnOwnProps?i.mapToProps(c,a):i.mapToProps(c,void 0)};return i.dependsOnOwnProps=!0,i.mapToProps=function(c,a){i.mapToProps=e,i.dependsOnOwnProps=Vn(e);let d=i(c,a);return typeof d=="function"&&(i.mapToProps=d,i.dependsOnOwnProps=Vn(d),d=i(c,a)),process.env.NODE_ENV!=="production"&&Bn(d,o,t),d},i}}function ft(e,t){return(n,r)=>{throw new Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${r.wrappedComponentName}.`)}}function ti(e){return e&&typeof e=="object"?pt(t=>Qo(e,t)):e?typeof e=="function"?Rn(e,"mapDispatchToProps"):ft(e,"mapDispatchToProps"):pt(t=>({dispatch:t}))}function ni(e){return e?typeof e=="function"?Rn(e,"mapStateToProps"):ft(e,"mapStateToProps"):pt(()=>({}))}function ri(e,t,n){return{...n,...e,...t}}function oi(e){return function(n,{displayName:r,areMergedPropsEqual:o}){let i=!1,s;return function(a,d,p){const l=e(a,d,p);return i?o(l,s)||(s=l):(i=!0,s=l,process.env.NODE_ENV!=="production"&&Bn(s,r,"mergeProps")),s}}}function ii(e){return e?typeof e=="function"?oi(e):ft(e,"mergeProps"):()=>ri}function si(e){e()}function ci(){let e=null,t=null;return{clear(){e=null,t=null},notify(){si(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},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||e===null||(r=!1,o.next?o.next.prev=o.prev:t=o.prev,o.prev?o.prev.next=o.next:e=o.next)}}}}var Ln={notify(){},get:()=>[]};function Mn(e,t){let n,r=Ln,o=0,i=!1;function s(b){p();const h=r.subscribe(b);let y=!1;return()=>{y||(y=!0,h(),l())}}function c(){r.notify()}function a(){m.onStateChange&&m.onStateChange()}function d(){return i}function p(){o++,n||(n=t?t.addNestedSub(a):e.subscribe(a),r=ci())}function l(){o--,n&&o===0&&(n(),n=void 0,r.clear(),r=Ln)}function u(){i||(i=!0,p())}function g(){i&&(i=!1,l())}const m={addNestedSub:s,notifyNestedSubs:c,handleChangeWrapper:a,isSubscribed:d,trySubscribe:u,tryUnsubscribe:g,getListeners:()=>r};return m}var ai=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",li=ai(),di=()=>typeof navigator<"u"&&navigator.product==="ReactNative",ui=di(),pi=()=>li||ui?C.useLayoutEffect:C.useEffect,$e=pi();function $n(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function gt(e,t){if($n(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let o=0;o<n.length;o++)if(!Object.prototype.hasOwnProperty.call(t,n[o])||!$n(e[n[o]],t[n[o]]))return!1;return!0}var fi={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},gi={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},mi={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Gn={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},hi={[jo]:mi,[zo]:Gn};function Fn(e){return Xo(e)?Gn:hi[e.$$typeof]||fi}var bi=Object.defineProperty,vi=Object.getOwnPropertyNames,kn=Object.getOwnPropertySymbols,yi=Object.getOwnPropertyDescriptor,Ei=Object.getPrototypeOf,Wn=Object.prototype;function mt(e,t){if(typeof t!="string"){if(Wn){const i=Ei(t);i&&i!==Wn&&mt(e,i)}let n=vi(t);kn&&(n=n.concat(kn(t)));const r=Fn(e),o=Fn(t);for(let i=0;i<n.length;++i){const s=n[i];if(!gi[s]&&!(o&&o[s])&&!(r&&r[s])){const c=yi(t,s);try{bi(e,s,c)}catch{}}}}return e}var ht=Symbol.for("react-redux-context"),bt=typeof globalThis<"u"?globalThis:{};function Di(){if(!C.createContext)return{};const e=bt[ht]??(bt[ht]=new Map);let t=e.get(C.createContext);return t||(t=C.createContext(null),process.env.NODE_ENV!=="production"&&(t.displayName="ReactRedux"),e.set(C.createContext,t)),t}var Un=Di(),Ni=[null,null],xi=e=>{try{return JSON.stringify(e)}catch{return String(e)}};function Ii(e,t,n){$e(()=>e(...t),n)}function Oi(e,t,n,r,o,i){e.current=r,n.current=!1,o.current&&(o.current=null,i())}function Si(e,t,n,r,o,i,s,c,a,d,p){if(!e)return()=>{};let l=!1,u=null;const g=()=>{if(l||!c.current)return;const b=t.getState();let h,y;try{h=r(b,o.current)}catch(v){y=v,u=v}y||(u=null),h===i.current?s.current||d():(i.current=h,a.current=h,s.current=!0,p())};return n.onStateChange=g,n.trySubscribe(),g(),()=>{if(l=!0,n.tryUnsubscribe(),n.onStateChange=null,u)throw u}}function wi(e,t){return e===t}var Hn=!1;function Ci(e,t,n,{pure:r,areStatesEqual:o=wi,areOwnPropsEqual:i=gt,areStatePropsEqual:s=gt,areMergedPropsEqual:c=gt,forwardRef:a=!1,context:d=Un}={}){process.env.NODE_ENV!=="production"&&r!==void 0&&!Hn&&(Hn=!0,dt('The `pure` option has been removed. `connect` is now always a "pure/memoized" component'));const p=d,l=ni(e),u=ti(t),g=ii(n),m=!!e;return h=>{if(process.env.NODE_ENV!=="production"&&!qo(h))throw new Error(`You must pass a component to the function returned by connect. Instead received ${xi(h)}`);const y=h.displayName||h.name||"Component",v=`Connect(${y})`,S={shouldHandleStateChanges:m,displayName:v,wrappedComponentName:y,WrappedComponent:h,initMapStateToProps:l,initMapDispatchToProps:u,initMergeProps:g,areStatesEqual:o,areStatePropsEqual:s,areOwnPropsEqual:i,areMergedPropsEqual:c};function I(A){const[P,H,V]=C.useMemo(()=>{const{reactReduxForwardedRef:z,...ge}=A;return[A.context,z,ge]},[A]),j=C.useMemo(()=>{let z=p;if(P!=null&&P.Consumer&&process.env.NODE_ENV!=="production"){if(!Yo(C.createElement(P.Consumer,null)))throw new Error("You must pass a valid React context consumer as `props.context`");z=P}return z},[P,p]),R=C.useContext(j),J=!!A.store&&!!A.store.getState&&!!A.store.dispatch,fe=!!R&&!!R.store;if(process.env.NODE_ENV!=="production"&&!J&&!fe)throw new Error(`Could not find "store" in the context of "${v}". Either wrap the root component in a <Provider>, or pass a custom React context provider to <Provider> and the corresponding React context consumer to ${v} in connect options.`);const Z=J?A.store:R.store,tt=fe?R.getServerState:Z.getState,un=C.useMemo(()=>Zo(Z.dispatch,S),[Z]),[Re,So]=C.useMemo(()=>{if(!m)return Ni;const z=Mn(Z,J?void 0:R.subscription),ge=z.notifyNestedSubs.bind(z);return[z,ge]},[Z,J,R]),wo=C.useMemo(()=>J?R:{...R,subscription:Re},[J,R,Re]),pn=C.useRef(void 0),fn=C.useRef(V),Le=C.useRef(void 0),Co=C.useRef(!1),gn=C.useRef(!1),mn=C.useRef(void 0);$e(()=>(gn.current=!0,()=>{gn.current=!1}),[]);const Ao=C.useMemo(()=>()=>Le.current&&V===fn.current?Le.current:un(Z.getState(),V),[Z,V]),hd=C.useMemo(()=>ge=>Re?Si(m,Z,Re,un,fn,pn,Co,gn,Le,So,ge):()=>{},[Re]);Ii(Oi,[fn,pn,Co,V,Le,So]);let nt;try{nt=C.useSyncExternalStore(hd,Ao,tt?()=>un(tt(),V):Ao)}catch(z){throw mn.current&&(z.message+=`
17
+ */var On;function Fo(){return On||(On=1,process.env.NODE_ENV!=="production"&&function(){function e(a,d){return a===d&&(a!==0||1/a===1/d)||a!==a&&d!==d}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=E,n=typeof Object.is=="function"?Object.is:e,r=t.useSyncExternalStore,o=t.useRef,i=t.useEffect,s=t.useMemo,c=t.useDebugValue;it.useSyncExternalStoreWithSelector=function(a,d,p,l,u){var g=o(null);if(g.current===null){var m={hasValue:!1,value:null};g.current=m}else m=g.current;g=s(function(){function h(N){if(!y){if(y=!0,v=N,N=l(N),u!==void 0&&m.hasValue){var O=m.value;if(u(O,N))return S=O}return S=N}if(O=S,n(v,N))return O;var A=l(N);return u!==void 0&&u(O,A)?(v=N,O):(v=N,S=A)}var y=!1,v,S,I=p===void 0?null:p;return[function(){return h(d())},I===null?void 0:function(){return h(I())}]},[d,p,l,u]);var b=r(a,g[0],g[1]);return i(function(){m.hasValue=!0,m.value=b},[b]),c(b),b},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),it}process.env.NODE_ENV==="production"?Go():Fo();var Sn=C.version.startsWith("19"),ko=Symbol.for(Sn?"react.transitional.element":"react.element"),Wo=Symbol.for("react.portal"),wn=Symbol.for("react.fragment"),Cn=Symbol.for("react.strict_mode"),An=Symbol.for("react.profiler"),st=Symbol.for("react.consumer"),ct=Symbol.for("react.context"),at=Symbol.for("react.forward_ref"),_n=Symbol.for("react.suspense"),Pn=Symbol.for("react.suspense_list"),Me=Symbol.for("react.memo"),Tn=Symbol.for("react.lazy"),Uo=Symbol.for("react.offscreen"),Ho=Symbol.for("react.client.reference"),jo=at,zo=Me;function qo(e){return typeof e=="string"||typeof e=="function"||e===wn||e===An||e===Cn||e===_n||e===Pn||e===Uo||typeof e=="object"&&e!==null&&(e.$$typeof===Tn||e.$$typeof===Me||e.$$typeof===ct||e.$$typeof===st||e.$$typeof===at||e.$$typeof===Ho||e.getModuleId!==void 0)}function lt(e){if(typeof e=="object"&&e!==null){const{$$typeof:t}=e;switch(t){case ko:switch(e=e.type,e){case wn:case An:case Cn:case _n:case Pn:return e;default:switch(e=e&&e.$$typeof,e){case ct:case at:case Tn:case Me:return e;case st:return e;default:return t}}case Wo:return t}}}function Yo(e){return Sn?lt(e)===st:lt(e)===ct}function Xo(e){return lt(e)===Me}function dt(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function ut(e,t){if(e)(t==="mapStateToProps"||t==="mapDispatchToProps")&&(Object.prototype.hasOwnProperty.call(e,"dependsOnOwnProps")||dt(`The selector for ${t} of connect did not specify a value for dependsOnOwnProps.`));else throw new Error(`Unexpected value for ${t} in connect.`)}function Ko(e,t,n){ut(e,"mapStateToProps"),ut(t,"mapDispatchToProps"),ut(n,"mergeProps")}function Jo(e,t,n,r,{areStatesEqual:o,areOwnPropsEqual:i,areStatePropsEqual:s}){let c=!1,a,d,p,l,u;function g(v,S){return a=v,d=S,p=e(a,d),l=t(r,d),u=n(p,l,d),c=!0,u}function m(){return p=e(a,d),t.dependsOnOwnProps&&(l=t(r,d)),u=n(p,l,d),u}function b(){return e.dependsOnOwnProps&&(p=e(a,d)),t.dependsOnOwnProps&&(l=t(r,d)),u=n(p,l,d),u}function h(){const v=e(a,d),S=!s(v,p);return p=v,S&&(u=n(p,l,d)),u}function y(v,S){const I=!i(S,d),N=!o(v,a,S,d);return a=v,d=S,I&&N?m():I?b():N?h():u}return function(S,I){return c?y(S,I):g(S,I)}}function Zo(e,{initMapStateToProps:t,initMapDispatchToProps:n,initMergeProps:r,...o}){const i=t(e,o),s=n(e,o),c=r(e,o);return process.env.NODE_ENV!=="production"&&Ko(i,s,c),Jo(i,s,c,e,o)}function Qo(e,t){const n={};for(const r in e){const o=e[r];typeof o=="function"&&(n[r]=(...i)=>t(o(...i)))}return n}function ei(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);if(t===null)return!0;let n=t;for(;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return t===n}function Bn(e,t,n){ei(e)||dt(`${n}() in ${t} must return a plain object. Instead received ${e}.`)}function pt(e){return function(n){const r=e(n);function o(){return r}return o.dependsOnOwnProps=!1,o}}function Vn(e){return e.dependsOnOwnProps?!!e.dependsOnOwnProps:e.length!==1}function Ln(e,t){return function(r,{displayName:o}){const i=function(c,a){return i.dependsOnOwnProps?i.mapToProps(c,a):i.mapToProps(c,void 0)};return i.dependsOnOwnProps=!0,i.mapToProps=function(c,a){i.mapToProps=e,i.dependsOnOwnProps=Vn(e);let d=i(c,a);return typeof d=="function"&&(i.mapToProps=d,i.dependsOnOwnProps=Vn(d),d=i(c,a)),process.env.NODE_ENV!=="production"&&Bn(d,o,t),d},i}}function ft(e,t){return(n,r)=>{throw new Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${r.wrappedComponentName}.`)}}function ti(e){return e&&typeof e=="object"?pt(t=>Qo(e,t)):e?typeof e=="function"?Ln(e,"mapDispatchToProps"):ft(e,"mapDispatchToProps"):pt(t=>({dispatch:t}))}function ni(e){return e?typeof e=="function"?Ln(e,"mapStateToProps"):ft(e,"mapStateToProps"):pt(()=>({}))}function ri(e,t,n){return{...n,...e,...t}}function oi(e){return function(n,{displayName:r,areMergedPropsEqual:o}){let i=!1,s;return function(a,d,p){const l=e(a,d,p);return i?o(l,s)||(s=l):(i=!0,s=l,process.env.NODE_ENV!=="production"&&Bn(s,r,"mergeProps")),s}}}function ii(e){return e?typeof e=="function"?oi(e):ft(e,"mergeProps"):()=>ri}function si(e){e()}function ci(){let e=null,t=null;return{clear(){e=null,t=null},notify(){si(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},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||e===null||(r=!1,o.next?o.next.prev=o.prev:t=o.prev,o.prev?o.prev.next=o.next:e=o.next)}}}}var Rn={notify(){},get:()=>[]};function Mn(e,t){let n,r=Rn,o=0,i=!1;function s(b){p();const h=r.subscribe(b);let y=!1;return()=>{y||(y=!0,h(),l())}}function c(){r.notify()}function a(){m.onStateChange&&m.onStateChange()}function d(){return i}function p(){o++,n||(n=t?t.addNestedSub(a):e.subscribe(a),r=ci())}function l(){o--,n&&o===0&&(n(),n=void 0,r.clear(),r=Rn)}function u(){i||(i=!0,p())}function g(){i&&(i=!1,l())}const m={addNestedSub:s,notifyNestedSubs:c,handleChangeWrapper:a,isSubscribed:d,trySubscribe:u,tryUnsubscribe:g,getListeners:()=>r};return m}var ai=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",li=ai(),di=()=>typeof navigator<"u"&&navigator.product==="ReactNative",ui=di(),pi=()=>li||ui?C.useLayoutEffect:C.useEffect,$e=pi();function $n(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function gt(e,t){if($n(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let o=0;o<n.length;o++)if(!Object.prototype.hasOwnProperty.call(t,n[o])||!$n(e[n[o]],t[n[o]]))return!1;return!0}var fi={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},gi={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},mi={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Gn={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},hi={[jo]:mi,[zo]:Gn};function Fn(e){return Xo(e)?Gn:hi[e.$$typeof]||fi}var bi=Object.defineProperty,vi=Object.getOwnPropertyNames,kn=Object.getOwnPropertySymbols,yi=Object.getOwnPropertyDescriptor,Ei=Object.getPrototypeOf,Wn=Object.prototype;function mt(e,t){if(typeof t!="string"){if(Wn){const i=Ei(t);i&&i!==Wn&&mt(e,i)}let n=vi(t);kn&&(n=n.concat(kn(t)));const r=Fn(e),o=Fn(t);for(let i=0;i<n.length;++i){const s=n[i];if(!gi[s]&&!(o&&o[s])&&!(r&&r[s])){const c=yi(t,s);try{bi(e,s,c)}catch{}}}}return e}var ht=Symbol.for("react-redux-context"),bt=typeof globalThis<"u"?globalThis:{};function Di(){if(!C.createContext)return{};const e=bt[ht]??(bt[ht]=new Map);let t=e.get(C.createContext);return t||(t=C.createContext(null),process.env.NODE_ENV!=="production"&&(t.displayName="ReactRedux"),e.set(C.createContext,t)),t}var Un=Di(),Ni=[null,null],xi=e=>{try{return JSON.stringify(e)}catch{return String(e)}};function Ii(e,t,n){$e(()=>e(...t),n)}function Oi(e,t,n,r,o,i){e.current=r,n.current=!1,o.current&&(o.current=null,i())}function Si(e,t,n,r,o,i,s,c,a,d,p){if(!e)return()=>{};let l=!1,u=null;const g=()=>{if(l||!c.current)return;const b=t.getState();let h,y;try{h=r(b,o.current)}catch(v){y=v,u=v}y||(u=null),h===i.current?s.current||d():(i.current=h,a.current=h,s.current=!0,p())};return n.onStateChange=g,n.trySubscribe(),g(),()=>{if(l=!0,n.tryUnsubscribe(),n.onStateChange=null,u)throw u}}function wi(e,t){return e===t}var Hn=!1;function Ci(e,t,n,{pure:r,areStatesEqual:o=wi,areOwnPropsEqual:i=gt,areStatePropsEqual:s=gt,areMergedPropsEqual:c=gt,forwardRef:a=!1,context:d=Un}={}){process.env.NODE_ENV!=="production"&&r!==void 0&&!Hn&&(Hn=!0,dt('The `pure` option has been removed. `connect` is now always a "pure/memoized" component'));const p=d,l=ni(e),u=ti(t),g=ii(n),m=!!e;return h=>{if(process.env.NODE_ENV!=="production"&&!qo(h))throw new Error(`You must pass a component to the function returned by connect. Instead received ${xi(h)}`);const y=h.displayName||h.name||"Component",v=`Connect(${y})`,S={shouldHandleStateChanges:m,displayName:v,wrappedComponentName:y,WrappedComponent:h,initMapStateToProps:l,initMapDispatchToProps:u,initMergeProps:g,areStatesEqual:o,areStatePropsEqual:s,areOwnPropsEqual:i,areMergedPropsEqual:c};function I(A){const[P,H,V]=C.useMemo(()=>{const{reactReduxForwardedRef:z,...ge}=A;return[A.context,z,ge]},[A]),j=C.useMemo(()=>{let z=p;if(P!=null&&P.Consumer&&process.env.NODE_ENV!=="production"){if(!Yo(C.createElement(P.Consumer,null)))throw new Error("You must pass a valid React context consumer as `props.context`");z=P}return z},[P,p]),L=C.useContext(j),J=!!A.store&&!!A.store.getState&&!!A.store.dispatch,fe=!!L&&!!L.store;if(process.env.NODE_ENV!=="production"&&!J&&!fe)throw new Error(`Could not find "store" in the context of "${v}". Either wrap the root component in a <Provider>, or pass a custom React context provider to <Provider> and the corresponding React context consumer to ${v} in connect options.`);const Z=J?A.store:L.store,tt=fe?L.getServerState:Z.getState,un=C.useMemo(()=>Zo(Z.dispatch,S),[Z]),[Le,So]=C.useMemo(()=>{if(!m)return Ni;const z=Mn(Z,J?void 0:L.subscription),ge=z.notifyNestedSubs.bind(z);return[z,ge]},[Z,J,L]),wo=C.useMemo(()=>J?L:{...L,subscription:Le},[J,L,Le]),pn=C.useRef(void 0),fn=C.useRef(V),Re=C.useRef(void 0),Co=C.useRef(!1),gn=C.useRef(!1),mn=C.useRef(void 0);$e(()=>(gn.current=!0,()=>{gn.current=!1}),[]);const Ao=C.useMemo(()=>()=>Re.current&&V===fn.current?Re.current:un(Z.getState(),V),[Z,V]),hd=C.useMemo(()=>ge=>Le?Si(m,Z,Le,un,fn,pn,Co,gn,Re,So,ge):()=>{},[Le]);Ii(Oi,[fn,pn,Co,V,Re,So]);let nt;try{nt=C.useSyncExternalStore(hd,Ao,tt?()=>un(tt(),V):Ao)}catch(z){throw mn.current&&(z.message+=`
18
18
  The error may be correlated with this previous error:
19
19
  ${mn.current.stack}
20
20
 
21
- `),z}$e(()=>{mn.current=void 0,Le.current=void 0,pn.current=nt});const hn=C.useMemo(()=>C.createElement(h,{...nt,ref:H}),[H,h,nt]);return C.useMemo(()=>m?C.createElement(j.Provider,{value:wo},hn):hn,[j,hn,wo])}const O=C.memo(I);if(O.WrappedComponent=h,O.displayName=I.displayName=v,a){const P=C.forwardRef(function(V,j){return C.createElement(O,{...V,reactReduxForwardedRef:j})});return P.displayName=v,P.WrappedComponent=h,mt(P,h)}return mt(O,h)}}var jn=Ci;function Ai(e){const{children:t,context:n,serverState:r,store:o}=e,i=C.useMemo(()=>{const a=Mn(o),d={store:o,subscription:a,getServerState:r?()=>r:void 0};if(process.env.NODE_ENV==="production")return d;{const{identityFunctionCheck:p="once",stabilityCheck:l="once"}=e;return Object.assign(d,{stabilityCheck:l,identityFunctionCheck:p})}},[o,r]),s=C.useMemo(()=>o.getState(),[o]);$e(()=>{const{subscription:a}=i;return a.onStateChange=a.notifyNestedSubs,a.trySubscribe(),s!==o.getState()&&a.notifyNestedSubs(),()=>{a.tryUnsubscribe(),a.onStateChange=void 0}},[i,s]);const c=n||Un;return C.createElement(c.Provider,{value:i},t)}var _i=Ai,Pi=process.env.NODE_ENV==="production",vt="Invariant failed";function zn(e,t){if(Pi)throw new Error(vt);var n=typeof t=="function"?t():t,r=n?"".concat(vt,": ").concat(n):vt;throw new Error(r)}var K=function(t){var n=t.top,r=t.right,o=t.bottom,i=t.left,s=r-i,c=o-n,a={top:n,right:r,bottom:o,left:i,width:s,height:c,x:i,y:n,center:{x:(r+i)/2,y:(o+n)/2}};return a},yt=function(t,n){return{top:t.top-n.top,left:t.left-n.left,bottom:t.bottom+n.bottom,right:t.right+n.right}},qn=function(t,n){return{top:t.top+n.top,left:t.left+n.left,bottom:t.bottom-n.bottom,right:t.right-n.right}},Ti=function(t,n){return{top:t.top+n.y,left:t.left+n.x,bottom:t.bottom+n.y,right:t.right+n.x}},Et={top:0,right:0,bottom:0,left:0},Dt=function(t){var n=t.borderBox,r=t.margin,o=r===void 0?Et:r,i=t.border,s=i===void 0?Et:i,c=t.padding,a=c===void 0?Et:c,d=K(yt(n,o)),p=K(qn(n,s)),l=K(qn(p,a));return{marginBox:d,borderBox:K(n),paddingBox:p,contentBox:l,margin:o,border:s,padding:a}},q=function(t){var n=t.slice(0,-2),r=t.slice(-2);if(r!=="px")return 0;var o=Number(n);return isNaN(o)&&(process.env.NODE_ENV!=="production"?zn(!1,"Could not parse value [raw: "+t+", without suffix: "+n+"]"):zn()),o},Bi=function(){return{x:window.pageXOffset,y:window.pageYOffset}},Ge=function(t,n){var r=t.borderBox,o=t.border,i=t.margin,s=t.padding,c=Ti(r,n);return Dt({borderBox:c,border:o,margin:i,padding:s})},Fe=function(t,n){return n===void 0&&(n=Bi()),Ge(t,n)},Yn=function(t,n){var r={top:q(n.marginTop),right:q(n.marginRight),bottom:q(n.marginBottom),left:q(n.marginLeft)},o={top:q(n.paddingTop),right:q(n.paddingRight),bottom:q(n.paddingBottom),left:q(n.paddingLeft)},i={top:q(n.borderTopWidth),right:q(n.borderRightWidth),bottom:q(n.borderBottomWidth),left:q(n.borderLeftWidth)};return Dt({borderBox:t,margin:r,padding:o,border:i})},Xn=function(t){var n=t.getBoundingClientRect(),r=window.getComputedStyle(t);return Yn(n,r)},me=function(t){var n=[],r=null,o=function(){for(var s=arguments.length,c=new Array(s),a=0;a<s;a++)c[a]=arguments[a];n=c,!r&&(r=requestAnimationFrame(function(){r=null,t.apply(void 0,n)}))};return o.cancel=function(){r&&(cancelAnimationFrame(r),r=null)},o};function ke(){return ke=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},ke.apply(null,arguments)}const Vi=process.env.NODE_ENV==="production",Ri=/[ \t]{2,}/g,Li=/^[ \t]*/gm,Kn=e=>e.replace(Ri," ").replace(Li,"").trim(),Mi=e=>Kn(`
21
+ `),z}$e(()=>{mn.current=void 0,Re.current=void 0,pn.current=nt});const hn=C.useMemo(()=>C.createElement(h,{...nt,ref:H}),[H,h,nt]);return C.useMemo(()=>m?C.createElement(j.Provider,{value:wo},hn):hn,[j,hn,wo])}const O=C.memo(I);if(O.WrappedComponent=h,O.displayName=I.displayName=v,a){const P=C.forwardRef(function(V,j){return C.createElement(O,{...V,reactReduxForwardedRef:j})});return P.displayName=v,P.WrappedComponent=h,mt(P,h)}return mt(O,h)}}var jn=Ci;function Ai(e){const{children:t,context:n,serverState:r,store:o}=e,i=C.useMemo(()=>{const a=Mn(o),d={store:o,subscription:a,getServerState:r?()=>r:void 0};if(process.env.NODE_ENV==="production")return d;{const{identityFunctionCheck:p="once",stabilityCheck:l="once"}=e;return Object.assign(d,{stabilityCheck:l,identityFunctionCheck:p})}},[o,r]),s=C.useMemo(()=>o.getState(),[o]);$e(()=>{const{subscription:a}=i;return a.onStateChange=a.notifyNestedSubs,a.trySubscribe(),s!==o.getState()&&a.notifyNestedSubs(),()=>{a.tryUnsubscribe(),a.onStateChange=void 0}},[i,s]);const c=n||Un;return C.createElement(c.Provider,{value:i},t)}var _i=Ai,Pi=process.env.NODE_ENV==="production",vt="Invariant failed";function zn(e,t){if(Pi)throw new Error(vt);var n=typeof t=="function"?t():t,r=n?"".concat(vt,": ").concat(n):vt;throw new Error(r)}var K=function(t){var n=t.top,r=t.right,o=t.bottom,i=t.left,s=r-i,c=o-n,a={top:n,right:r,bottom:o,left:i,width:s,height:c,x:i,y:n,center:{x:(r+i)/2,y:(o+n)/2}};return a},yt=function(t,n){return{top:t.top-n.top,left:t.left-n.left,bottom:t.bottom+n.bottom,right:t.right+n.right}},qn=function(t,n){return{top:t.top+n.top,left:t.left+n.left,bottom:t.bottom-n.bottom,right:t.right-n.right}},Ti=function(t,n){return{top:t.top+n.y,left:t.left+n.x,bottom:t.bottom+n.y,right:t.right+n.x}},Et={top:0,right:0,bottom:0,left:0},Dt=function(t){var n=t.borderBox,r=t.margin,o=r===void 0?Et:r,i=t.border,s=i===void 0?Et:i,c=t.padding,a=c===void 0?Et:c,d=K(yt(n,o)),p=K(qn(n,s)),l=K(qn(p,a));return{marginBox:d,borderBox:K(n),paddingBox:p,contentBox:l,margin:o,border:s,padding:a}},q=function(t){var n=t.slice(0,-2),r=t.slice(-2);if(r!=="px")return 0;var o=Number(n);return isNaN(o)&&(process.env.NODE_ENV!=="production"?zn(!1,"Could not parse value [raw: "+t+", without suffix: "+n+"]"):zn()),o},Bi=function(){return{x:window.pageXOffset,y:window.pageYOffset}},Ge=function(t,n){var r=t.borderBox,o=t.border,i=t.margin,s=t.padding,c=Ti(r,n);return Dt({borderBox:c,border:o,margin:i,padding:s})},Fe=function(t,n){return n===void 0&&(n=Bi()),Ge(t,n)},Yn=function(t,n){var r={top:q(n.marginTop),right:q(n.marginRight),bottom:q(n.marginBottom),left:q(n.marginLeft)},o={top:q(n.paddingTop),right:q(n.paddingRight),bottom:q(n.paddingBottom),left:q(n.paddingLeft)},i={top:q(n.borderTopWidth),right:q(n.borderRightWidth),bottom:q(n.borderBottomWidth),left:q(n.borderLeftWidth)};return Dt({borderBox:t,margin:r,padding:o,border:i})},Xn=function(t){var n=t.getBoundingClientRect(),r=window.getComputedStyle(t);return Yn(n,r)},me=function(t){var n=[],r=null,o=function(){for(var s=arguments.length,c=new Array(s),a=0;a<s;a++)c[a]=arguments[a];n=c,!r&&(r=requestAnimationFrame(function(){r=null,t.apply(void 0,n)}))};return o.cancel=function(){r&&(cancelAnimationFrame(r),r=null)},o};function ke(){return ke=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},ke.apply(null,arguments)}const Vi=process.env.NODE_ENV==="production",Li=/[ \t]{2,}/g,Ri=/^[ \t]*/gm,Kn=e=>e.replace(Li," ").replace(Ri,"").trim(),Mi=e=>Kn(`
22
22
  %c@hello-pangea/dnd
23
23
 
24
24
  %c${Kn(e)}
@@ -63,18 +63,18 @@ ${mn.current.stack}
63
63
  `:`
64
64
  The item has been dropped while not over a drop area.
65
65
  ${tr(e.source)}
66
- `}};function zi(e,t){return!!(e===t||Number.isNaN(e)&&Number.isNaN(t))}function nr(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!zi(e[n],t[n]))return!1;return!0}function w(e,t){const n=E.useState(()=>({inputs:t,result:e()}))[0],r=E.useRef(!0),o=E.useRef(n),s=r.current||!!(t&&o.current.inputs&&nr(t,o.current.inputs))?o.current:{inputs:t,result:e()};return E.useEffect(()=>{r.current=!1,o.current=s},[s]),s.result}function x(e,t){return w(()=>e,t)}const L={x:0,y:0},$=(e,t)=>({x:e.x+t.x,y:e.y+t.y}),k=(e,t)=>({x:e.x-t.x,y:e.y-t.y}),ne=(e,t)=>e.x===t.x&&e.y===t.y,ae=e=>({x:e.x!==0?-e.x:0,y:e.y!==0?-e.y:0}),oe=(e,t,n=0)=>e==="x"?{x:t,y:n}:{x:n,y:t},be=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2),rr=(e,t)=>Math.min(...t.map(n=>be(e,n))),or=e=>t=>({x:e(t.x),y:e(t.y)});var qi=(e,t)=>{const n=K({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};const ve=(e,t)=>({top:e.top+t.y,left:e.left+t.x,bottom:e.bottom+t.y,right:e.right+t.x}),ir=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}],Yi={top:0,right:0,bottom:0,left:0},Xi=(e,t)=>t?ve(e,t.scroll.diff.displacement):e,Ki=(e,t,n)=>n&&n.increasedBy?{...e,[t.end]:e[t.end]+n.increasedBy[t.line]}:e,Ji=(e,t)=>t&&t.shouldClipSubject?qi(t.pageMarginBox,e):K(e);var le=({page:e,withPlaceholder:t,axis:n,frame:r})=>{const o=Xi(e.marginBox,r),i=Ki(o,n,t),s=Ji(i,r);return{page:e,withPlaceholder:t,active:s}},xt=(e,t)=>{e.frame||(process.env.NODE_ENV,f());const n=e.frame,r=k(t,n.scroll.initial),o=ae(r),i={...n,scroll:{initial:n.scroll.initial,current:t,diff:{value:r,displacement:o},max:n.scroll.max}},s=le({page:e.subject.page,withPlaceholder:e.subject.withPlaceholder,axis:e.axis,frame:i});return{...e,frame:i,subject:s}};function M(e,t=nr){let n=null;function r(...o){if(n&&n.lastThis===this&&t(o,n.lastArgs))return n.lastResult;const i=e.apply(this,o);return n={lastResult:i,lastArgs:o,lastThis:this},i}return r.clear=function(){n=null},r}const sr=M(e=>e.reduce((t,n)=>(t[n.descriptor.id]=n,t),{})),cr=M(e=>e.reduce((t,n)=>(t[n.descriptor.id]=n,t),{})),He=M(e=>Object.values(e)),Zi=M(e=>Object.values(e));var ie=M((e,t)=>Zi(t).filter(r=>e===r.descriptor.droppableId).sort((r,o)=>r.descriptor.index-o.descriptor.index));function It(e){return e.at&&e.at.type==="REORDER"?e.at.destination:null}function je(e){return e.at&&e.at.type==="COMBINE"?e.at.combine:null}var ze=M((e,t)=>t.filter(n=>n.descriptor.id!==e.descriptor.id)),Qi=({isMovingForward:e,draggable:t,destination:n,insideDestination:r,previousImpact:o})=>{if(!n.isCombineEnabled||!It(o))return null;function s(g){const m={type:"COMBINE",combine:{draggableId:g,droppableId:n.descriptor.id}};return{...o,at:m}}const c=o.displaced.all,a=c.length?c[0]:null;if(e)return a?s(a):null;const d=ze(t,r);if(!a){if(!d.length)return null;const g=d[d.length-1];return s(g.descriptor.id)}const p=d.findIndex(g=>g.descriptor.id===a);p===-1&&(process.env.NODE_ENV!=="production"?f(!1,"Could not find displaced item in set"):f());const l=p-1;if(l<0)return null;const u=d[l];return s(u.descriptor.id)},de=(e,t)=>e.descriptor.droppableId===t.descriptor.id;const ar={point:L,value:0},ye={invisible:{},visible:{},all:[]},es={displaced:ye,displacedBy:ar,at:null};var X=(e,t)=>n=>e<=n&&n<=t,lr=e=>{const t=X(e.top,e.bottom),n=X(e.left,e.right);return r=>{if(t(r.top)&&t(r.bottom)&&n(r.left)&&n(r.right))return!0;const i=t(r.top)||t(r.bottom),s=n(r.left)||n(r.right);if(i&&s)return!0;const a=r.top<e.top&&r.bottom>e.bottom,d=r.left<e.left&&r.right>e.right;return a&&d?!0:a&&s||d&&i}},ts=e=>{const t=X(e.top,e.bottom),n=X(e.left,e.right);return r=>t(r.top)&&t(r.bottom)&&n(r.left)&&n(r.right)};const Ot={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},dr={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"};var ns=e=>t=>{const n=X(t.top,t.bottom),r=X(t.left,t.right);return o=>e===Ot?n(o.top)&&n(o.bottom):r(o.left)&&r(o.right)};const rs=(e,t)=>{const n=t.frame?t.frame.scroll.diff.displacement:L;return ve(e,n)},os=(e,t,n)=>t.subject.active?n(t.subject.active)(e):!1,is=(e,t,n)=>n(t)(e),St=({target:e,destination:t,viewport:n,withDroppableDisplacement:r,isVisibleThroughFrameFn:o})=>{const i=r?rs(e,t):e;return os(i,t,o)&&is(i,n,o)},ss=e=>St({...e,isVisibleThroughFrameFn:lr}),ur=e=>St({...e,isVisibleThroughFrameFn:ts}),cs=e=>St({...e,isVisibleThroughFrameFn:ns(e.destination.axis)}),as=(e,t,n)=>{if(typeof n=="boolean")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:!0};function ls(e,t){const n=e.page.marginBox,r={top:t.point.y,right:0,bottom:0,left:t.point.x};return K(yt(n,r))}function Ee({afterDragging:e,destination:t,displacedBy:n,viewport:r,forceShouldAnimate:o,last:i}){return e.reduce(function(c,a){const d=ls(a,n),p=a.descriptor.id;if(c.all.push(p),!ss({target:d,destination:t,viewport:r,withDroppableDisplacement:!0}))return c.invisible[a.descriptor.id]=!0,c;const u=as(p,i,o),g={draggableId:p,shouldAnimate:u};return c.visible[p]=g,c},{all:[],visible:{},invisible:{}})}function ds(e,t){if(!e.length)return 0;const n=e[e.length-1].descriptor.index;return t.inHomeList?n:n+1}function pr({insideDestination:e,inHomeList:t,displacedBy:n,destination:r}){const o=ds(e,{inHomeList:t});return{displaced:ye,displacedBy:n,at:{type:"REORDER",destination:{droppableId:r.descriptor.id,index:o}}}}function qe({draggable:e,insideDestination:t,destination:n,viewport:r,displacedBy:o,last:i,index:s,forceShouldAnimate:c}){const a=de(e,n);if(s==null)return pr({insideDestination:t,inHomeList:a,displacedBy:o,destination:n});const d=t.find(m=>m.descriptor.index===s);if(!d)return pr({insideDestination:t,inHomeList:a,displacedBy:o,destination:n});const p=ze(e,t),l=t.indexOf(d),u=p.slice(l);return{displaced:Ee({afterDragging:u,destination:n,displacedBy:o,last:i,viewport:r.frame,forceShouldAnimate:c}),displacedBy:o,at:{type:"REORDER",destination:{droppableId:n.descriptor.id,index:s}}}}function re(e,t){return!!t.effected[e]}var us=({isMovingForward:e,destination:t,draggables:n,combine:r,afterCritical:o})=>{if(!t.isCombineEnabled)return null;const i=r.draggableId,c=n[i].descriptor.index;return re(i,o)?e?c:c-1:e?c+1:c},ps=({isMovingForward:e,isInHomeList:t,insideDestination:n,location:r})=>{if(!n.length)return null;const o=r.index,i=e?o+1:o-1,s=n[0].descriptor.index,c=n[n.length-1].descriptor.index,a=t?c:c+1;return i<s||i>a?null:i},fs=({isMovingForward:e,isInHomeList:t,draggable:n,draggables:r,destination:o,insideDestination:i,previousImpact:s,viewport:c,afterCritical:a})=>{const d=s.at;if(d||(process.env.NODE_ENV!=="production"?f(!1,"Cannot move in direction without previous impact location"):f()),d.type==="REORDER"){const l=ps({isMovingForward:e,isInHomeList:t,location:d.destination,insideDestination:i});return l==null?null:qe({draggable:n,insideDestination:i,destination:o,viewport:c,last:s.displaced,displacedBy:s.displacedBy,index:l})}const p=us({isMovingForward:e,destination:o,displaced:s.displaced,draggables:r,combine:d.combine,afterCritical:a});return p==null?null:qe({draggable:n,insideDestination:i,destination:o,viewport:c,last:s.displaced,displacedBy:s.displacedBy,index:p})},gs=({displaced:e,afterCritical:t,combineWith:n,displacedBy:r})=>{const o=!!(e.visible[n]||e.invisible[n]);return re(n,t)?o?L:ae(r.point):o?r.point:L},ms=({afterCritical:e,impact:t,draggables:n})=>{const r=je(t);r||(process.env.NODE_ENV,f());const o=r.draggableId,i=n[o].page.borderBox.center,s=gs({displaced:t.displaced,afterCritical:e,combineWith:o,displacedBy:t.displacedBy});return $(i,s)};const fr=(e,t)=>t.margin[e.start]+t.borderBox[e.size]/2,hs=(e,t)=>t.margin[e.end]+t.borderBox[e.size]/2,wt=(e,t,n)=>t[e.crossAxisStart]+n.margin[e.crossAxisStart]+n.borderBox[e.crossAxisSize]/2,gr=({axis:e,moveRelativeTo:t,isMoving:n})=>oe(e.line,t.marginBox[e.end]+fr(e,n),wt(e,t.marginBox,n)),mr=({axis:e,moveRelativeTo:t,isMoving:n})=>oe(e.line,t.marginBox[e.start]-hs(e,n),wt(e,t.marginBox,n)),bs=({axis:e,moveInto:t,isMoving:n})=>oe(e.line,t.contentBox[e.start]+fr(e,n),wt(e,t.contentBox,n));var vs=({impact:e,draggable:t,draggables:n,droppable:r,afterCritical:o})=>{const i=ie(r.descriptor.id,n),s=t.page,c=r.axis;if(!i.length)return bs({axis:c,moveInto:r.page,isMoving:s});const{displaced:a,displacedBy:d}=e,p=a.all[0];if(p){const u=n[p];if(re(p,o))return mr({axis:c,moveRelativeTo:u.page,isMoving:s});const g=Ge(u.page,d.point);return mr({axis:c,moveRelativeTo:g,isMoving:s})}const l=i[i.length-1];if(l.descriptor.id===t.descriptor.id)return s.borderBox.center;if(re(l.descriptor.id,o)){const u=Ge(l.page,ae(o.displacedBy.point));return gr({axis:c,moveRelativeTo:u,isMoving:s})}return gr({axis:c,moveRelativeTo:l.page,isMoving:s})},Ct=(e,t)=>{const n=e.frame;return n?$(t,n.scroll.diff.displacement):t};const ys=({impact:e,draggable:t,droppable:n,draggables:r,afterCritical:o})=>{const i=t.page.borderBox.center,s=e.at;return!n||!s?i:s.type==="REORDER"?vs({impact:e,draggable:t,draggables:r,droppable:n,afterCritical:o}):ms({impact:e,draggables:r,afterCritical:o})};var Ye=e=>{const t=ys(e),n=e.droppable;return n?Ct(n,t):t},hr=(e,t)=>{const n=k(t,e.scroll.initial),r=ae(n);return{frame:K({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 br(e,t){return e.map(n=>t[n])}function Es(e,t){for(let n=0;n<t.length;n++){const r=t[n].visible[e];if(r)return r}return null}var Ds=({impact:e,viewport:t,destination:n,draggables:r,maxScrollChange:o})=>{const i=hr(t,$(t.scroll.current,o)),s=n.frame?xt(n,$(n.frame.scroll.current,o)):n,c=e.displaced,a=Ee({afterDragging:br(c.all,r),destination:n,displacedBy:e.displacedBy,viewport:i.frame,last:c,forceShouldAnimate:!1}),d=Ee({afterDragging:br(c.all,r),destination:s,displacedBy:e.displacedBy,viewport:t.frame,last:c,forceShouldAnimate:!1}),p={},l={},u=[c,a,d];return c.all.forEach(m=>{const b=Es(m,u);if(b){l[m]=b;return}p[m]=!0}),{...e,displaced:{all:c.all,invisible:p,visible:l}}},Ns=(e,t)=>$(e.scroll.diff.displacement,t),At=({pageBorderBoxCenter:e,draggable:t,viewport:n})=>{const r=Ns(n,e),o=k(r,t.page.borderBox.center);return $(t.client.borderBox.center,o)},vr=({draggable:e,destination:t,newPageBorderBoxCenter:n,viewport:r,withDroppableDisplacement:o,onlyOnMainAxis:i=!1})=>{const s=k(n,e.page.borderBox.center),a={target:ve(e.page.borderBox,s),destination:t,withDroppableDisplacement:o,viewport:r};return i?cs(a):ur(a)},xs=({isMovingForward:e,draggable:t,destination:n,draggables:r,previousImpact:o,viewport:i,previousPageBorderBoxCenter:s,previousClientSelection:c,afterCritical:a})=>{if(!n.isEnabled)return null;const d=ie(n.descriptor.id,r),p=de(t,n),l=Qi({isMovingForward:e,draggable:t,destination:n,insideDestination:d,previousImpact:o})||fs({isMovingForward:e,isInHomeList:p,draggable:t,draggables:r,destination:n,insideDestination:d,previousImpact:o,viewport:i,afterCritical:a});if(!l)return null;const u=Ye({impact:l,draggable:t,droppable:n,draggables:r,afterCritical:a});if(vr({draggable:t,destination:n,newPageBorderBoxCenter:u,viewport:i.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0}))return{clientSelection:At({pageBorderBoxCenter:u,draggable:t,viewport:i}),impact:l,scrollJumpRequest:null};const m=k(u,s),b=Ds({impact:l,viewport:i,destination:n,draggables:r,maxScrollChange:m});return{clientSelection:c,impact:b,scrollJumpRequest:m}};const F=e=>{const t=e.subject.active;return t||(process.env.NODE_ENV!=="production"?f(!1,"Cannot get clipped area from droppable"):f()),t};var Is=({isMovingForward:e,pageBorderBoxCenter:t,source:n,droppables:r,viewport:o})=>{const i=n.subject.active;if(!i)return null;const s=n.axis,c=X(i[s.start],i[s.end]),a=He(r).filter(p=>p!==n).filter(p=>p.isEnabled).filter(p=>!!p.subject.active).filter(p=>lr(o.frame)(F(p))).filter(p=>{const l=F(p);return e?i[s.crossAxisEnd]<l[s.crossAxisEnd]:l[s.crossAxisStart]<i[s.crossAxisStart]}).filter(p=>{const l=F(p),u=X(l[s.start],l[s.end]);return c(l[s.start])||c(l[s.end])||u(i[s.start])||u(i[s.end])}).sort((p,l)=>{const u=F(p)[s.crossAxisStart],g=F(l)[s.crossAxisStart];return e?u-g:g-u}).filter((p,l,u)=>F(p)[s.crossAxisStart]===F(u[0])[s.crossAxisStart]);if(!a.length)return null;if(a.length===1)return a[0];const d=a.filter(p=>X(F(p)[s.start],F(p)[s.end])(t[s.line]));return d.length===1?d[0]:d.length>1?d.sort((p,l)=>F(p)[s.start]-F(l)[s.start])[0]:a.sort((p,l)=>{const u=rr(t,ir(F(p))),g=rr(t,ir(F(l)));return u!==g?u-g:F(p)[s.start]-F(l)[s.start]})[0]};const yr=(e,t)=>{const n=e.page.borderBox.center;return re(e.descriptor.id,t)?k(n,t.displacedBy.point):n},Os=(e,t)=>{const n=e.page.borderBox;return re(e.descriptor.id,t)?ve(n,ae(t.displacedBy.point)):n};var Ss=({pageBorderBoxCenter:e,viewport:t,destination:n,insideDestination:r,afterCritical:o})=>r.filter(s=>ur({target:Os(s,o),destination:n,viewport:t.frame,withDroppableDisplacement:!0})).sort((s,c)=>{const a=be(e,Ct(n,yr(s,o))),d=be(e,Ct(n,yr(c,o)));return a<d?-1:d<a?1:s.descriptor.index-c.descriptor.index})[0]||null,De=M(function(t,n){const r=n[t.line];return{value:r,point:oe(t.line,r)}});const ws=(e,t,n)=>{const r=e.axis;if(e.descriptor.mode==="virtual")return oe(r.line,t[r.line]);const o=e.subject.page.contentBox[r.size],a=ie(e.descriptor.id,n).reduce((d,p)=>d+p.client.marginBox[r.size],0)+t[r.line]-o;return a<=0?null:oe(r.line,a)},Er=(e,t)=>({...e,scroll:{...e.scroll,max:t}}),Dr=(e,t,n)=>{const r=e.frame;de(t,e)&&(process.env.NODE_ENV!=="production"?f(!1,"Should not add placeholder space to home list"):f()),e.subject.withPlaceholder&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot add placeholder size to a subject when it already has one"):f());const o=De(e.axis,t.displaceBy).point,i=ws(e,o,n),s={placeholderSize:o,increasedBy:i,oldFrameMaxScroll:e.frame?e.frame.scroll.max:null};if(!r){const p=le({page:e.subject.page,withPlaceholder:s,axis:e.axis,frame:e.frame});return{...e,subject:p}}const c=i?$(r.scroll.max,i):r.scroll.max,a=Er(r,c),d=le({page:e.subject.page,withPlaceholder:s,axis:e.axis,frame:a});return{...e,subject:d,frame:a}},Cs=e=>{const t=e.subject.withPlaceholder;t||(process.env.NODE_ENV!=="production"?f(!1,"Cannot remove placeholder form subject when there was none"):f());const n=e.frame;if(!n){const s=le({page:e.subject.page,axis:e.axis,frame:null,withPlaceholder:null});return{...e,subject:s}}const r=t.oldFrameMaxScroll;r||(process.env.NODE_ENV!=="production"?f(!1,"Expected droppable with frame to have old max frame scroll when removing placeholder"):f());const o=Er(n,r),i=le({page:e.subject.page,axis:e.axis,frame:o,withPlaceholder:null});return{...e,subject:i,frame:o}};var As=({previousPageBorderBoxCenter:e,moveRelativeTo:t,insideDestination:n,draggable:r,draggables:o,destination:i,viewport:s,afterCritical:c})=>{if(!t){if(n.length)return null;const l={displaced:ye,displacedBy:ar,at:{type:"REORDER",destination:{droppableId:i.descriptor.id,index:0}}},u=Ye({impact:l,draggable:r,droppable:i,draggables:o,afterCritical:c}),g=de(r,i)?i:Dr(i,r,o);return vr({draggable:r,destination:g,newPageBorderBoxCenter:u,viewport:s.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0})?l:null}const a=e[i.axis.line]<=t.page.borderBox.center[i.axis.line],d=(()=>{const l=t.descriptor.index;return t.descriptor.id===r.descriptor.id||a?l:l+1})(),p=De(i.axis,r.displaceBy);return qe({draggable:r,insideDestination:n,destination:i,viewport:s,displacedBy:p,last:ye,index:d})},_s=({isMovingForward:e,previousPageBorderBoxCenter:t,draggable:n,isOver:r,draggables:o,droppables:i,viewport:s,afterCritical:c})=>{const a=Is({isMovingForward:e,pageBorderBoxCenter:t,source:r,droppables:i,viewport:s});if(!a)return null;const d=ie(a.descriptor.id,o),p=Ss({pageBorderBoxCenter:t,viewport:s,destination:a,insideDestination:d,afterCritical:c}),l=As({previousPageBorderBoxCenter:t,destination:a,draggable:n,draggables:o,moveRelativeTo:p,insideDestination:d,viewport:s,afterCritical:c});if(!l)return null;const u=Ye({impact:l,draggable:n,droppable:a,draggables:o,afterCritical:c});return{clientSelection:At({pageBorderBoxCenter:u,draggable:n,viewport:s}),impact:l,scrollJumpRequest:null}},W=e=>{const t=e.at;return t?t.type==="REORDER"?t.destination.droppableId:t.combine.droppableId:null};const Ps=(e,t)=>{const n=W(e);return n?t[n]:null};var Ts=({state:e,type:t})=>{const n=Ps(e.impact,e.dimensions.droppables),r=!!n,o=e.dimensions.droppables[e.critical.droppable.id],i=n||o,s=i.axis.direction,c=s==="vertical"&&(t==="MOVE_UP"||t==="MOVE_DOWN")||s==="horizontal"&&(t==="MOVE_LEFT"||t==="MOVE_RIGHT");if(c&&!r)return null;const a=t==="MOVE_DOWN"||t==="MOVE_RIGHT",d=e.dimensions.draggables[e.critical.draggable.id],p=e.current.page.borderBoxCenter,{draggables:l,droppables:u}=e.dimensions;return c?xs({isMovingForward:a,previousPageBorderBoxCenter:p,draggable:d,destination:i,draggables:l,viewport:e.viewport,previousClientSelection:e.current.client.selection,previousImpact:e.impact,afterCritical:e.afterCritical}):_s({isMovingForward:a,previousPageBorderBoxCenter:p,draggable:d,isOver:i,draggables:l,droppables:u,viewport:e.viewport,afterCritical:e.afterCritical})};function se(e){return e.phase==="DRAGGING"||e.phase==="COLLECTING"}function Nr(e){const t=X(e.top,e.bottom),n=X(e.left,e.right);return function(o){return t(o.y)&&n(o.x)}}function Bs(e,t){return e.left<t.right&&e.right>t.left&&e.top<t.bottom&&e.bottom>t.top}function Vs({pageBorderBox:e,draggable:t,candidates:n}){const r=t.page.borderBox.center,o=n.map(i=>{const s=i.axis,c=oe(i.axis.line,e.center[s.line],i.page.borderBox.center[s.crossAxisLine]);return{id:i.descriptor.id,distance:be(r,c)}}).sort((i,s)=>s.distance-i.distance);return o[0]?o[0].id:null}function Rs({pageBorderBox:e,draggable:t,droppables:n}){const r=He(n).filter(o=>{if(!o.isEnabled)return!1;const i=o.subject.active;if(!i||!Bs(e,i))return!1;if(Nr(i)(e.center))return!0;const s=o.axis,c=i.center[s.crossAxisLine],a=e[s.crossAxisStart],d=e[s.crossAxisEnd],p=X(i[s.crossAxisStart],i[s.crossAxisEnd]),l=p(a),u=p(d);return!l&&!u?!0:l?a<c:d>c});return r.length?r.length===1?r[0].descriptor.id:Vs({pageBorderBox:e,draggable:t,candidates:r}):null}const xr=(e,t)=>K(ve(e,t));var Ls=(e,t)=>{const n=e.frame;return n?xr(t,n.scroll.diff.value):t};function Ir({displaced:e,id:t}){return!!(e.visible[t]||e.invisible[t])}function Ms({draggable:e,closest:t,inHomeList:n}){return t?n&&t.descriptor.index>e.descriptor.index?t.descriptor.index-1:t.descriptor.index:null}var $s=({pageBorderBoxWithDroppableScroll:e,draggable:t,destination:n,insideDestination:r,last:o,viewport:i,afterCritical:s})=>{const c=n.axis,a=De(n.axis,t.displaceBy),d=a.value,p=e[c.start],l=e[c.end],g=ze(t,r).find(b=>{const h=b.descriptor.id,y=b.page.borderBox.center[c.line],v=re(h,s),S=Ir({displaced:o,id:h});return v?S?l<=y:p<y-d:S?l<=y+d:p<y})||null,m=Ms({draggable:t,closest:g,inHomeList:de(t,n)});return qe({draggable:t,insideDestination:r,destination:n,viewport:i,last:o,displacedBy:a,index:m})};const Gs=4;var Fs=({draggable:e,pageBorderBoxWithDroppableScroll:t,previousImpact:n,destination:r,insideDestination:o,afterCritical:i})=>{if(!r.isCombineEnabled)return null;const s=r.axis,c=De(r.axis,e.displaceBy),a=c.value,d=t[s.start],p=t[s.end],u=ze(e,o).find(m=>{const b=m.descriptor.id,h=m.page.borderBox,v=h[s.size]/Gs,S=re(b,i),I=Ir({displaced:n.displaced,id:b});return S?I?p>h[s.start]+v&&p<h[s.end]-v:d>h[s.start]-a+v&&d<h[s.end]-a-v:I?p>h[s.start]+a+v&&p<h[s.end]+a-v:d>h[s.start]+v&&d<h[s.end]-v});return u?{displacedBy:c,displaced:n.displaced,at:{type:"COMBINE",combine:{draggableId:u.descriptor.id,droppableId:r.descriptor.id}}}:null},Or=({pageOffset:e,draggable:t,draggables:n,droppables:r,previousImpact:o,viewport:i,afterCritical:s})=>{const c=xr(t.page.borderBox,e),a=Rs({pageBorderBox:c,draggable:t,droppables:r});if(!a)return es;const d=r[a],p=ie(d.descriptor.id,n),l=Ls(d,c);return Fs({pageBorderBoxWithDroppableScroll:l,draggable:t,previousImpact:o,destination:d,insideDestination:p,afterCritical:s})||$s({pageBorderBoxWithDroppableScroll:l,draggable:t,destination:d,insideDestination:p,last:o.displaced,viewport:i,afterCritical:s})},_t=(e,t)=>({...e,[t.descriptor.id]:t});const ks=({previousImpact:e,impact:t,droppables:n})=>{const r=W(e),o=W(t);if(!r||r===o)return n;const i=n[r];if(!i.subject.withPlaceholder)return n;const s=Cs(i);return _t(n,s)};var Ws=({draggable:e,draggables:t,droppables:n,previousImpact:r,impact:o})=>{const i=ks({previousImpact:r,impact:o,droppables:n}),s=W(o);if(!s)return i;const c=n[s];if(de(e,c)||c.subject.withPlaceholder)return i;const a=Dr(c,e,t);return _t(i,a)},Ne=({state:e,clientSelection:t,dimensions:n,viewport:r,impact:o,scrollJumpRequest:i})=>{const s=r||e.viewport,c=n||e.dimensions,a=t||e.current.client.selection,d=k(a,e.initial.client.selection),p={offset:d,selection:a,borderBoxCenter:$(e.initial.client.borderBoxCenter,d)},l={selection:$(p.selection,s.scroll.current),borderBoxCenter:$(p.borderBoxCenter,s.scroll.current),offset:$(p.offset,s.scroll.diff.value)},u={client:p,page:l};if(e.phase==="COLLECTING")return{...e,dimensions:c,viewport:s,current:u};const g=c.draggables[e.critical.draggable.id],m=o||Or({pageOffset:l.offset,draggable:g,draggables:c.draggables,droppables:c.droppables,previousImpact:e.impact,viewport:s,afterCritical:e.afterCritical}),b=Ws({draggable:g,impact:m,previousImpact:e.impact,draggables:c.draggables,droppables:c.droppables});return{...e,current:u,dimensions:{draggables:c.draggables,droppables:b},impact:m,viewport:s,scrollJumpRequest:i||null,forceShouldAnimate:i?!1:null}};function Us(e,t){return e.map(n=>t[n])}var Sr=({impact:e,viewport:t,draggables:n,destination:r,forceShouldAnimate:o})=>{const i=e.displaced,s=Us(i.all,n),c=Ee({afterDragging:s,destination:r,displacedBy:e.displacedBy,viewport:t.frame,forceShouldAnimate:o,last:i});return{...e,displaced:c}},wr=({impact:e,draggable:t,droppable:n,draggables:r,viewport:o,afterCritical:i})=>{const s=Ye({impact:e,draggable:t,draggables:r,droppable:n,afterCritical:i});return At({pageBorderBoxCenter:s,draggable:t,viewport:o})},Cr=({state:e,dimensions:t,viewport:n})=>{e.movementMode!=="SNAP"&&(process.env.NODE_ENV,f());const r=e.impact,o=n||e.viewport,i=t||e.dimensions,{draggables:s,droppables:c}=i,a=s[e.critical.draggable.id],d=W(r);d||(process.env.NODE_ENV!=="production"?f(!1,"Must be over a destination in SNAP movement mode"):f());const p=c[d],l=Sr({impact:r,viewport:o,destination:p,draggables:s}),u=wr({impact:l,draggable:a,droppable:p,draggables:s,viewport:o,afterCritical:e.afterCritical});return Ne({impact:l,clientSelection:u,state:e,dimensions:i,viewport:o})},Hs=e=>({index:e.index,droppableId:e.droppableId}),Ar=({draggable:e,home:t,draggables:n,viewport:r})=>{const o=De(t.axis,e.displaceBy),i=ie(t.descriptor.id,n),s=i.indexOf(e);s===-1&&(process.env.NODE_ENV!=="production"?f(!1,"Expected draggable to be inside home list"):f());const c=i.slice(s+1),a=c.reduce((u,g)=>(u[g.descriptor.id]=!0,u),{}),d={inVirtualList:t.descriptor.mode==="virtual",displacedBy:o,effected:a};return{impact:{displaced:Ee({afterDragging:c,destination:t,displacedBy:o,last:null,viewport:r.frame,forceShouldAnimate:!1}),displacedBy:o,at:{type:"REORDER",destination:Hs(e.descriptor)}},afterCritical:d}},js=(e,t)=>({draggables:e.draggables,droppables:_t(e.droppables,t)});const xe=e=>{process.env.NODE_ENV},Ie=e=>{process.env.NODE_ENV};var zs=({draggable:e,offset:t,initialWindowScroll:n})=>{const r=Ge(e.client,t),o=Fe(r,n);return{...e,placeholder:{...e.placeholder,client:r},client:r,page:o}},qs=e=>{const t=e.frame;return t||(process.env.NODE_ENV!=="production"?f(!1,"Expected Droppable to have a frame"):f()),t},Ys=({additions:e,updatedDroppables:t,viewport:n})=>{const r=n.scroll.diff.value;return e.map(o=>{const i=o.descriptor.droppableId,s=t[i],a=qs(s).scroll.diff.value,d=$(r,a);return zs({draggable:o,offset:d,initialWindowScroll:n.scroll.initial})})},Xs=({state:e,published:t})=>{xe();const n=t.modified.map(y=>{const v=e.dimensions.droppables[y.droppableId];return xt(v,y.scroll)}),r={...e.dimensions.droppables,...sr(n)},o=cr(Ys({additions:t.additions,updatedDroppables:r,viewport:e.viewport})),i={...e.dimensions.draggables,...o};t.removals.forEach(y=>{delete i[y]});const s={droppables:r,draggables:i},c=W(e.impact),a=c?s.droppables[c]:null,d=s.draggables[e.critical.draggable.id],p=s.droppables[e.critical.droppable.id],{impact:l,afterCritical:u}=Ar({draggable:d,home:p,draggables:i,viewport:e.viewport}),g=a&&a.isCombineEnabled?e.impact:l,m=Or({pageOffset:e.current.page.offset,draggable:s.draggables[e.critical.draggable.id],draggables:s.draggables,droppables:s.droppables,previousImpact:g,viewport:e.viewport,afterCritical:u});Ie();const b={...e,phase:"DRAGGING",impact:m,onLiftImpact:l,dimensions:s,afterCritical:u,forceShouldAnimate:!1};return e.phase==="COLLECTING"?b:{...b,phase:"DROP_PENDING",reason:e.reason,isWaiting:!1}};const Pt=e=>e.movementMode==="SNAP",Tt=(e,t,n)=>{const r=js(e.dimensions,t);return!Pt(e)||n?Ne({state:e,dimensions:r}):Cr({state:e,dimensions:r})};function Bt(e){return e.isDragging&&e.movementMode==="SNAP"?{...e,scrollJumpRequest:null}:e}const _r={phase:"IDLE",completed:null,shouldFlush:!1};var Ks=(e=_r,t)=>{if(t.type==="FLUSH")return{..._r,shouldFlush:!0};if(t.type==="INITIAL_PUBLISH"){e.phase!=="IDLE"&&(process.env.NODE_ENV!=="production"?f(!1,"INITIAL_PUBLISH must come after a IDLE phase"):f());const{critical:n,clientSelection:r,viewport:o,dimensions:i,movementMode:s}=t.payload,c=i.draggables[n.draggable.id],a=i.droppables[n.droppable.id],d={selection:r,borderBoxCenter:c.client.borderBox.center,offset:L},p={client:d,page:{selection:$(d.selection,o.scroll.initial),borderBoxCenter:$(d.selection,o.scroll.initial),offset:$(d.selection,o.scroll.diff.value)}},l=He(i.droppables).every(b=>!b.isFixedOnPage),{impact:u,afterCritical:g}=Ar({draggable:c,home:a,draggables:i.draggables,viewport:o});return{phase:"DRAGGING",isDragging:!0,critical:n,movementMode:s,dimensions:i,initial:p,current:p,isWindowScrollAllowed:l,impact:u,afterCritical:g,onLiftImpact:u,viewport:o,scrollJumpRequest:null,forceShouldAnimate:null}}if(t.type==="COLLECTION_STARTING")return e.phase==="COLLECTING"||e.phase==="DROP_PENDING"?e:(e.phase!=="DRAGGING"&&(process.env.NODE_ENV!=="production"?f(!1,`Collection cannot start from phase ${e.phase}`):f()),{...e,phase:"COLLECTING"});if(t.type==="PUBLISH_WHILE_DRAGGING")return e.phase==="COLLECTING"||e.phase==="DROP_PENDING"||(process.env.NODE_ENV!=="production"?f(!1,`Unexpected ${t.type} received in phase ${e.phase}`):f()),Xs({state:e,published:t.payload});if(t.type==="MOVE"){if(e.phase==="DROP_PENDING")return e;se(e)||(process.env.NODE_ENV!=="production"?f(!1,`${t.type} not permitted in phase ${e.phase}`):f());const{client:n}=t.payload;return ne(n,e.current.client.selection)?e:Ne({state:e,clientSelection:n,impact:Pt(e)?e.impact:null})}if(t.type==="UPDATE_DROPPABLE_SCROLL"){if(e.phase==="DROP_PENDING"||e.phase==="COLLECTING")return Bt(e);se(e)||(process.env.NODE_ENV!=="production"?f(!1,`${t.type} not permitted in phase ${e.phase}`):f());const{id:n,newScroll:r}=t.payload,o=e.dimensions.droppables[n];if(!o)return e;const i=xt(o,r);return Tt(e,i,!1)}if(t.type==="UPDATE_DROPPABLE_IS_ENABLED"){if(e.phase==="DROP_PENDING")return e;se(e)||(process.env.NODE_ENV!=="production"?f(!1,`Attempting to move in an unsupported phase ${e.phase}`):f());const{id:n,isEnabled:r}=t.payload,o=e.dimensions.droppables[n];o||(process.env.NODE_ENV!=="production"?f(!1,`Cannot find Droppable[id: ${n}] to toggle its enabled state`):f()),o.isEnabled===r&&(process.env.NODE_ENV!=="production"?f(!1,`Trying to set droppable isEnabled to ${String(r)}
66
+ `}};function zi(e,t){return!!(e===t||Number.isNaN(e)&&Number.isNaN(t))}function nr(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!zi(e[n],t[n]))return!1;return!0}function w(e,t){const n=E.useState(()=>({inputs:t,result:e()}))[0],r=E.useRef(!0),o=E.useRef(n),s=r.current||!!(t&&o.current.inputs&&nr(t,o.current.inputs))?o.current:{inputs:t,result:e()};return E.useEffect(()=>{r.current=!1,o.current=s},[s]),s.result}function x(e,t){return w(()=>e,t)}const R={x:0,y:0},$=(e,t)=>({x:e.x+t.x,y:e.y+t.y}),k=(e,t)=>({x:e.x-t.x,y:e.y-t.y}),ne=(e,t)=>e.x===t.x&&e.y===t.y,ae=e=>({x:e.x!==0?-e.x:0,y:e.y!==0?-e.y:0}),oe=(e,t,n=0)=>e==="x"?{x:t,y:n}:{x:n,y:t},be=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2),rr=(e,t)=>Math.min(...t.map(n=>be(e,n))),or=e=>t=>({x:e(t.x),y:e(t.y)});var qi=(e,t)=>{const n=K({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};const ve=(e,t)=>({top:e.top+t.y,left:e.left+t.x,bottom:e.bottom+t.y,right:e.right+t.x}),ir=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}],Yi={top:0,right:0,bottom:0,left:0},Xi=(e,t)=>t?ve(e,t.scroll.diff.displacement):e,Ki=(e,t,n)=>n&&n.increasedBy?{...e,[t.end]:e[t.end]+n.increasedBy[t.line]}:e,Ji=(e,t)=>t&&t.shouldClipSubject?qi(t.pageMarginBox,e):K(e);var le=({page:e,withPlaceholder:t,axis:n,frame:r})=>{const o=Xi(e.marginBox,r),i=Ki(o,n,t),s=Ji(i,r);return{page:e,withPlaceholder:t,active:s}},xt=(e,t)=>{e.frame||(process.env.NODE_ENV,f());const n=e.frame,r=k(t,n.scroll.initial),o=ae(r),i={...n,scroll:{initial:n.scroll.initial,current:t,diff:{value:r,displacement:o},max:n.scroll.max}},s=le({page:e.subject.page,withPlaceholder:e.subject.withPlaceholder,axis:e.axis,frame:i});return{...e,frame:i,subject:s}};function M(e,t=nr){let n=null;function r(...o){if(n&&n.lastThis===this&&t(o,n.lastArgs))return n.lastResult;const i=e.apply(this,o);return n={lastResult:i,lastArgs:o,lastThis:this},i}return r.clear=function(){n=null},r}const sr=M(e=>e.reduce((t,n)=>(t[n.descriptor.id]=n,t),{})),cr=M(e=>e.reduce((t,n)=>(t[n.descriptor.id]=n,t),{})),He=M(e=>Object.values(e)),Zi=M(e=>Object.values(e));var ie=M((e,t)=>Zi(t).filter(r=>e===r.descriptor.droppableId).sort((r,o)=>r.descriptor.index-o.descriptor.index));function It(e){return e.at&&e.at.type==="REORDER"?e.at.destination:null}function je(e){return e.at&&e.at.type==="COMBINE"?e.at.combine:null}var ze=M((e,t)=>t.filter(n=>n.descriptor.id!==e.descriptor.id)),Qi=({isMovingForward:e,draggable:t,destination:n,insideDestination:r,previousImpact:o})=>{if(!n.isCombineEnabled||!It(o))return null;function s(g){const m={type:"COMBINE",combine:{draggableId:g,droppableId:n.descriptor.id}};return{...o,at:m}}const c=o.displaced.all,a=c.length?c[0]:null;if(e)return a?s(a):null;const d=ze(t,r);if(!a){if(!d.length)return null;const g=d[d.length-1];return s(g.descriptor.id)}const p=d.findIndex(g=>g.descriptor.id===a);p===-1&&(process.env.NODE_ENV!=="production"?f(!1,"Could not find displaced item in set"):f());const l=p-1;if(l<0)return null;const u=d[l];return s(u.descriptor.id)},de=(e,t)=>e.descriptor.droppableId===t.descriptor.id;const ar={point:R,value:0},ye={invisible:{},visible:{},all:[]},es={displaced:ye,displacedBy:ar,at:null};var X=(e,t)=>n=>e<=n&&n<=t,lr=e=>{const t=X(e.top,e.bottom),n=X(e.left,e.right);return r=>{if(t(r.top)&&t(r.bottom)&&n(r.left)&&n(r.right))return!0;const i=t(r.top)||t(r.bottom),s=n(r.left)||n(r.right);if(i&&s)return!0;const a=r.top<e.top&&r.bottom>e.bottom,d=r.left<e.left&&r.right>e.right;return a&&d?!0:a&&s||d&&i}},ts=e=>{const t=X(e.top,e.bottom),n=X(e.left,e.right);return r=>t(r.top)&&t(r.bottom)&&n(r.left)&&n(r.right)};const Ot={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},dr={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"};var ns=e=>t=>{const n=X(t.top,t.bottom),r=X(t.left,t.right);return o=>e===Ot?n(o.top)&&n(o.bottom):r(o.left)&&r(o.right)};const rs=(e,t)=>{const n=t.frame?t.frame.scroll.diff.displacement:R;return ve(e,n)},os=(e,t,n)=>t.subject.active?n(t.subject.active)(e):!1,is=(e,t,n)=>n(t)(e),St=({target:e,destination:t,viewport:n,withDroppableDisplacement:r,isVisibleThroughFrameFn:o})=>{const i=r?rs(e,t):e;return os(i,t,o)&&is(i,n,o)},ss=e=>St({...e,isVisibleThroughFrameFn:lr}),ur=e=>St({...e,isVisibleThroughFrameFn:ts}),cs=e=>St({...e,isVisibleThroughFrameFn:ns(e.destination.axis)}),as=(e,t,n)=>{if(typeof n=="boolean")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:!0};function ls(e,t){const n=e.page.marginBox,r={top:t.point.y,right:0,bottom:0,left:t.point.x};return K(yt(n,r))}function Ee({afterDragging:e,destination:t,displacedBy:n,viewport:r,forceShouldAnimate:o,last:i}){return e.reduce(function(c,a){const d=ls(a,n),p=a.descriptor.id;if(c.all.push(p),!ss({target:d,destination:t,viewport:r,withDroppableDisplacement:!0}))return c.invisible[a.descriptor.id]=!0,c;const u=as(p,i,o),g={draggableId:p,shouldAnimate:u};return c.visible[p]=g,c},{all:[],visible:{},invisible:{}})}function ds(e,t){if(!e.length)return 0;const n=e[e.length-1].descriptor.index;return t.inHomeList?n:n+1}function pr({insideDestination:e,inHomeList:t,displacedBy:n,destination:r}){const o=ds(e,{inHomeList:t});return{displaced:ye,displacedBy:n,at:{type:"REORDER",destination:{droppableId:r.descriptor.id,index:o}}}}function qe({draggable:e,insideDestination:t,destination:n,viewport:r,displacedBy:o,last:i,index:s,forceShouldAnimate:c}){const a=de(e,n);if(s==null)return pr({insideDestination:t,inHomeList:a,displacedBy:o,destination:n});const d=t.find(m=>m.descriptor.index===s);if(!d)return pr({insideDestination:t,inHomeList:a,displacedBy:o,destination:n});const p=ze(e,t),l=t.indexOf(d),u=p.slice(l);return{displaced:Ee({afterDragging:u,destination:n,displacedBy:o,last:i,viewport:r.frame,forceShouldAnimate:c}),displacedBy:o,at:{type:"REORDER",destination:{droppableId:n.descriptor.id,index:s}}}}function re(e,t){return!!t.effected[e]}var us=({isMovingForward:e,destination:t,draggables:n,combine:r,afterCritical:o})=>{if(!t.isCombineEnabled)return null;const i=r.draggableId,c=n[i].descriptor.index;return re(i,o)?e?c:c-1:e?c+1:c},ps=({isMovingForward:e,isInHomeList:t,insideDestination:n,location:r})=>{if(!n.length)return null;const o=r.index,i=e?o+1:o-1,s=n[0].descriptor.index,c=n[n.length-1].descriptor.index,a=t?c:c+1;return i<s||i>a?null:i},fs=({isMovingForward:e,isInHomeList:t,draggable:n,draggables:r,destination:o,insideDestination:i,previousImpact:s,viewport:c,afterCritical:a})=>{const d=s.at;if(d||(process.env.NODE_ENV!=="production"?f(!1,"Cannot move in direction without previous impact location"):f()),d.type==="REORDER"){const l=ps({isMovingForward:e,isInHomeList:t,location:d.destination,insideDestination:i});return l==null?null:qe({draggable:n,insideDestination:i,destination:o,viewport:c,last:s.displaced,displacedBy:s.displacedBy,index:l})}const p=us({isMovingForward:e,destination:o,displaced:s.displaced,draggables:r,combine:d.combine,afterCritical:a});return p==null?null:qe({draggable:n,insideDestination:i,destination:o,viewport:c,last:s.displaced,displacedBy:s.displacedBy,index:p})},gs=({displaced:e,afterCritical:t,combineWith:n,displacedBy:r})=>{const o=!!(e.visible[n]||e.invisible[n]);return re(n,t)?o?R:ae(r.point):o?r.point:R},ms=({afterCritical:e,impact:t,draggables:n})=>{const r=je(t);r||(process.env.NODE_ENV,f());const o=r.draggableId,i=n[o].page.borderBox.center,s=gs({displaced:t.displaced,afterCritical:e,combineWith:o,displacedBy:t.displacedBy});return $(i,s)};const fr=(e,t)=>t.margin[e.start]+t.borderBox[e.size]/2,hs=(e,t)=>t.margin[e.end]+t.borderBox[e.size]/2,wt=(e,t,n)=>t[e.crossAxisStart]+n.margin[e.crossAxisStart]+n.borderBox[e.crossAxisSize]/2,gr=({axis:e,moveRelativeTo:t,isMoving:n})=>oe(e.line,t.marginBox[e.end]+fr(e,n),wt(e,t.marginBox,n)),mr=({axis:e,moveRelativeTo:t,isMoving:n})=>oe(e.line,t.marginBox[e.start]-hs(e,n),wt(e,t.marginBox,n)),bs=({axis:e,moveInto:t,isMoving:n})=>oe(e.line,t.contentBox[e.start]+fr(e,n),wt(e,t.contentBox,n));var vs=({impact:e,draggable:t,draggables:n,droppable:r,afterCritical:o})=>{const i=ie(r.descriptor.id,n),s=t.page,c=r.axis;if(!i.length)return bs({axis:c,moveInto:r.page,isMoving:s});const{displaced:a,displacedBy:d}=e,p=a.all[0];if(p){const u=n[p];if(re(p,o))return mr({axis:c,moveRelativeTo:u.page,isMoving:s});const g=Ge(u.page,d.point);return mr({axis:c,moveRelativeTo:g,isMoving:s})}const l=i[i.length-1];if(l.descriptor.id===t.descriptor.id)return s.borderBox.center;if(re(l.descriptor.id,o)){const u=Ge(l.page,ae(o.displacedBy.point));return gr({axis:c,moveRelativeTo:u,isMoving:s})}return gr({axis:c,moveRelativeTo:l.page,isMoving:s})},Ct=(e,t)=>{const n=e.frame;return n?$(t,n.scroll.diff.displacement):t};const ys=({impact:e,draggable:t,droppable:n,draggables:r,afterCritical:o})=>{const i=t.page.borderBox.center,s=e.at;return!n||!s?i:s.type==="REORDER"?vs({impact:e,draggable:t,draggables:r,droppable:n,afterCritical:o}):ms({impact:e,draggables:r,afterCritical:o})};var Ye=e=>{const t=ys(e),n=e.droppable;return n?Ct(n,t):t},hr=(e,t)=>{const n=k(t,e.scroll.initial),r=ae(n);return{frame:K({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 br(e,t){return e.map(n=>t[n])}function Es(e,t){for(let n=0;n<t.length;n++){const r=t[n].visible[e];if(r)return r}return null}var Ds=({impact:e,viewport:t,destination:n,draggables:r,maxScrollChange:o})=>{const i=hr(t,$(t.scroll.current,o)),s=n.frame?xt(n,$(n.frame.scroll.current,o)):n,c=e.displaced,a=Ee({afterDragging:br(c.all,r),destination:n,displacedBy:e.displacedBy,viewport:i.frame,last:c,forceShouldAnimate:!1}),d=Ee({afterDragging:br(c.all,r),destination:s,displacedBy:e.displacedBy,viewport:t.frame,last:c,forceShouldAnimate:!1}),p={},l={},u=[c,a,d];return c.all.forEach(m=>{const b=Es(m,u);if(b){l[m]=b;return}p[m]=!0}),{...e,displaced:{all:c.all,invisible:p,visible:l}}},Ns=(e,t)=>$(e.scroll.diff.displacement,t),At=({pageBorderBoxCenter:e,draggable:t,viewport:n})=>{const r=Ns(n,e),o=k(r,t.page.borderBox.center);return $(t.client.borderBox.center,o)},vr=({draggable:e,destination:t,newPageBorderBoxCenter:n,viewport:r,withDroppableDisplacement:o,onlyOnMainAxis:i=!1})=>{const s=k(n,e.page.borderBox.center),a={target:ve(e.page.borderBox,s),destination:t,withDroppableDisplacement:o,viewport:r};return i?cs(a):ur(a)},xs=({isMovingForward:e,draggable:t,destination:n,draggables:r,previousImpact:o,viewport:i,previousPageBorderBoxCenter:s,previousClientSelection:c,afterCritical:a})=>{if(!n.isEnabled)return null;const d=ie(n.descriptor.id,r),p=de(t,n),l=Qi({isMovingForward:e,draggable:t,destination:n,insideDestination:d,previousImpact:o})||fs({isMovingForward:e,isInHomeList:p,draggable:t,draggables:r,destination:n,insideDestination:d,previousImpact:o,viewport:i,afterCritical:a});if(!l)return null;const u=Ye({impact:l,draggable:t,droppable:n,draggables:r,afterCritical:a});if(vr({draggable:t,destination:n,newPageBorderBoxCenter:u,viewport:i.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0}))return{clientSelection:At({pageBorderBoxCenter:u,draggable:t,viewport:i}),impact:l,scrollJumpRequest:null};const m=k(u,s),b=Ds({impact:l,viewport:i,destination:n,draggables:r,maxScrollChange:m});return{clientSelection:c,impact:b,scrollJumpRequest:m}};const F=e=>{const t=e.subject.active;return t||(process.env.NODE_ENV!=="production"?f(!1,"Cannot get clipped area from droppable"):f()),t};var Is=({isMovingForward:e,pageBorderBoxCenter:t,source:n,droppables:r,viewport:o})=>{const i=n.subject.active;if(!i)return null;const s=n.axis,c=X(i[s.start],i[s.end]),a=He(r).filter(p=>p!==n).filter(p=>p.isEnabled).filter(p=>!!p.subject.active).filter(p=>lr(o.frame)(F(p))).filter(p=>{const l=F(p);return e?i[s.crossAxisEnd]<l[s.crossAxisEnd]:l[s.crossAxisStart]<i[s.crossAxisStart]}).filter(p=>{const l=F(p),u=X(l[s.start],l[s.end]);return c(l[s.start])||c(l[s.end])||u(i[s.start])||u(i[s.end])}).sort((p,l)=>{const u=F(p)[s.crossAxisStart],g=F(l)[s.crossAxisStart];return e?u-g:g-u}).filter((p,l,u)=>F(p)[s.crossAxisStart]===F(u[0])[s.crossAxisStart]);if(!a.length)return null;if(a.length===1)return a[0];const d=a.filter(p=>X(F(p)[s.start],F(p)[s.end])(t[s.line]));return d.length===1?d[0]:d.length>1?d.sort((p,l)=>F(p)[s.start]-F(l)[s.start])[0]:a.sort((p,l)=>{const u=rr(t,ir(F(p))),g=rr(t,ir(F(l)));return u!==g?u-g:F(p)[s.start]-F(l)[s.start]})[0]};const yr=(e,t)=>{const n=e.page.borderBox.center;return re(e.descriptor.id,t)?k(n,t.displacedBy.point):n},Os=(e,t)=>{const n=e.page.borderBox;return re(e.descriptor.id,t)?ve(n,ae(t.displacedBy.point)):n};var Ss=({pageBorderBoxCenter:e,viewport:t,destination:n,insideDestination:r,afterCritical:o})=>r.filter(s=>ur({target:Os(s,o),destination:n,viewport:t.frame,withDroppableDisplacement:!0})).sort((s,c)=>{const a=be(e,Ct(n,yr(s,o))),d=be(e,Ct(n,yr(c,o)));return a<d?-1:d<a?1:s.descriptor.index-c.descriptor.index})[0]||null,De=M(function(t,n){const r=n[t.line];return{value:r,point:oe(t.line,r)}});const ws=(e,t,n)=>{const r=e.axis;if(e.descriptor.mode==="virtual")return oe(r.line,t[r.line]);const o=e.subject.page.contentBox[r.size],a=ie(e.descriptor.id,n).reduce((d,p)=>d+p.client.marginBox[r.size],0)+t[r.line]-o;return a<=0?null:oe(r.line,a)},Er=(e,t)=>({...e,scroll:{...e.scroll,max:t}}),Dr=(e,t,n)=>{const r=e.frame;de(t,e)&&(process.env.NODE_ENV!=="production"?f(!1,"Should not add placeholder space to home list"):f()),e.subject.withPlaceholder&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot add placeholder size to a subject when it already has one"):f());const o=De(e.axis,t.displaceBy).point,i=ws(e,o,n),s={placeholderSize:o,increasedBy:i,oldFrameMaxScroll:e.frame?e.frame.scroll.max:null};if(!r){const p=le({page:e.subject.page,withPlaceholder:s,axis:e.axis,frame:e.frame});return{...e,subject:p}}const c=i?$(r.scroll.max,i):r.scroll.max,a=Er(r,c),d=le({page:e.subject.page,withPlaceholder:s,axis:e.axis,frame:a});return{...e,subject:d,frame:a}},Cs=e=>{const t=e.subject.withPlaceholder;t||(process.env.NODE_ENV!=="production"?f(!1,"Cannot remove placeholder form subject when there was none"):f());const n=e.frame;if(!n){const s=le({page:e.subject.page,axis:e.axis,frame:null,withPlaceholder:null});return{...e,subject:s}}const r=t.oldFrameMaxScroll;r||(process.env.NODE_ENV!=="production"?f(!1,"Expected droppable with frame to have old max frame scroll when removing placeholder"):f());const o=Er(n,r),i=le({page:e.subject.page,axis:e.axis,frame:o,withPlaceholder:null});return{...e,subject:i,frame:o}};var As=({previousPageBorderBoxCenter:e,moveRelativeTo:t,insideDestination:n,draggable:r,draggables:o,destination:i,viewport:s,afterCritical:c})=>{if(!t){if(n.length)return null;const l={displaced:ye,displacedBy:ar,at:{type:"REORDER",destination:{droppableId:i.descriptor.id,index:0}}},u=Ye({impact:l,draggable:r,droppable:i,draggables:o,afterCritical:c}),g=de(r,i)?i:Dr(i,r,o);return vr({draggable:r,destination:g,newPageBorderBoxCenter:u,viewport:s.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0})?l:null}const a=e[i.axis.line]<=t.page.borderBox.center[i.axis.line],d=(()=>{const l=t.descriptor.index;return t.descriptor.id===r.descriptor.id||a?l:l+1})(),p=De(i.axis,r.displaceBy);return qe({draggable:r,insideDestination:n,destination:i,viewport:s,displacedBy:p,last:ye,index:d})},_s=({isMovingForward:e,previousPageBorderBoxCenter:t,draggable:n,isOver:r,draggables:o,droppables:i,viewport:s,afterCritical:c})=>{const a=Is({isMovingForward:e,pageBorderBoxCenter:t,source:r,droppables:i,viewport:s});if(!a)return null;const d=ie(a.descriptor.id,o),p=Ss({pageBorderBoxCenter:t,viewport:s,destination:a,insideDestination:d,afterCritical:c}),l=As({previousPageBorderBoxCenter:t,destination:a,draggable:n,draggables:o,moveRelativeTo:p,insideDestination:d,viewport:s,afterCritical:c});if(!l)return null;const u=Ye({impact:l,draggable:n,droppable:a,draggables:o,afterCritical:c});return{clientSelection:At({pageBorderBoxCenter:u,draggable:n,viewport:s}),impact:l,scrollJumpRequest:null}},W=e=>{const t=e.at;return t?t.type==="REORDER"?t.destination.droppableId:t.combine.droppableId:null};const Ps=(e,t)=>{const n=W(e);return n?t[n]:null};var Ts=({state:e,type:t})=>{const n=Ps(e.impact,e.dimensions.droppables),r=!!n,o=e.dimensions.droppables[e.critical.droppable.id],i=n||o,s=i.axis.direction,c=s==="vertical"&&(t==="MOVE_UP"||t==="MOVE_DOWN")||s==="horizontal"&&(t==="MOVE_LEFT"||t==="MOVE_RIGHT");if(c&&!r)return null;const a=t==="MOVE_DOWN"||t==="MOVE_RIGHT",d=e.dimensions.draggables[e.critical.draggable.id],p=e.current.page.borderBoxCenter,{draggables:l,droppables:u}=e.dimensions;return c?xs({isMovingForward:a,previousPageBorderBoxCenter:p,draggable:d,destination:i,draggables:l,viewport:e.viewport,previousClientSelection:e.current.client.selection,previousImpact:e.impact,afterCritical:e.afterCritical}):_s({isMovingForward:a,previousPageBorderBoxCenter:p,draggable:d,isOver:i,draggables:l,droppables:u,viewport:e.viewport,afterCritical:e.afterCritical})};function se(e){return e.phase==="DRAGGING"||e.phase==="COLLECTING"}function Nr(e){const t=X(e.top,e.bottom),n=X(e.left,e.right);return function(o){return t(o.y)&&n(o.x)}}function Bs(e,t){return e.left<t.right&&e.right>t.left&&e.top<t.bottom&&e.bottom>t.top}function Vs({pageBorderBox:e,draggable:t,candidates:n}){const r=t.page.borderBox.center,o=n.map(i=>{const s=i.axis,c=oe(i.axis.line,e.center[s.line],i.page.borderBox.center[s.crossAxisLine]);return{id:i.descriptor.id,distance:be(r,c)}}).sort((i,s)=>s.distance-i.distance);return o[0]?o[0].id:null}function Ls({pageBorderBox:e,draggable:t,droppables:n}){const r=He(n).filter(o=>{if(!o.isEnabled)return!1;const i=o.subject.active;if(!i||!Bs(e,i))return!1;if(Nr(i)(e.center))return!0;const s=o.axis,c=i.center[s.crossAxisLine],a=e[s.crossAxisStart],d=e[s.crossAxisEnd],p=X(i[s.crossAxisStart],i[s.crossAxisEnd]),l=p(a),u=p(d);return!l&&!u?!0:l?a<c:d>c});return r.length?r.length===1?r[0].descriptor.id:Vs({pageBorderBox:e,draggable:t,candidates:r}):null}const xr=(e,t)=>K(ve(e,t));var Rs=(e,t)=>{const n=e.frame;return n?xr(t,n.scroll.diff.value):t};function Ir({displaced:e,id:t}){return!!(e.visible[t]||e.invisible[t])}function Ms({draggable:e,closest:t,inHomeList:n}){return t?n&&t.descriptor.index>e.descriptor.index?t.descriptor.index-1:t.descriptor.index:null}var $s=({pageBorderBoxWithDroppableScroll:e,draggable:t,destination:n,insideDestination:r,last:o,viewport:i,afterCritical:s})=>{const c=n.axis,a=De(n.axis,t.displaceBy),d=a.value,p=e[c.start],l=e[c.end],g=ze(t,r).find(b=>{const h=b.descriptor.id,y=b.page.borderBox.center[c.line],v=re(h,s),S=Ir({displaced:o,id:h});return v?S?l<=y:p<y-d:S?l<=y+d:p<y})||null,m=Ms({draggable:t,closest:g,inHomeList:de(t,n)});return qe({draggable:t,insideDestination:r,destination:n,viewport:i,last:o,displacedBy:a,index:m})};const Gs=4;var Fs=({draggable:e,pageBorderBoxWithDroppableScroll:t,previousImpact:n,destination:r,insideDestination:o,afterCritical:i})=>{if(!r.isCombineEnabled)return null;const s=r.axis,c=De(r.axis,e.displaceBy),a=c.value,d=t[s.start],p=t[s.end],u=ze(e,o).find(m=>{const b=m.descriptor.id,h=m.page.borderBox,v=h[s.size]/Gs,S=re(b,i),I=Ir({displaced:n.displaced,id:b});return S?I?p>h[s.start]+v&&p<h[s.end]-v:d>h[s.start]-a+v&&d<h[s.end]-a-v:I?p>h[s.start]+a+v&&p<h[s.end]+a-v:d>h[s.start]+v&&d<h[s.end]-v});return u?{displacedBy:c,displaced:n.displaced,at:{type:"COMBINE",combine:{draggableId:u.descriptor.id,droppableId:r.descriptor.id}}}:null},Or=({pageOffset:e,draggable:t,draggables:n,droppables:r,previousImpact:o,viewport:i,afterCritical:s})=>{const c=xr(t.page.borderBox,e),a=Ls({pageBorderBox:c,draggable:t,droppables:r});if(!a)return es;const d=r[a],p=ie(d.descriptor.id,n),l=Rs(d,c);return Fs({pageBorderBoxWithDroppableScroll:l,draggable:t,previousImpact:o,destination:d,insideDestination:p,afterCritical:s})||$s({pageBorderBoxWithDroppableScroll:l,draggable:t,destination:d,insideDestination:p,last:o.displaced,viewport:i,afterCritical:s})},_t=(e,t)=>({...e,[t.descriptor.id]:t});const ks=({previousImpact:e,impact:t,droppables:n})=>{const r=W(e),o=W(t);if(!r||r===o)return n;const i=n[r];if(!i.subject.withPlaceholder)return n;const s=Cs(i);return _t(n,s)};var Ws=({draggable:e,draggables:t,droppables:n,previousImpact:r,impact:o})=>{const i=ks({previousImpact:r,impact:o,droppables:n}),s=W(o);if(!s)return i;const c=n[s];if(de(e,c)||c.subject.withPlaceholder)return i;const a=Dr(c,e,t);return _t(i,a)},Ne=({state:e,clientSelection:t,dimensions:n,viewport:r,impact:o,scrollJumpRequest:i})=>{const s=r||e.viewport,c=n||e.dimensions,a=t||e.current.client.selection,d=k(a,e.initial.client.selection),p={offset:d,selection:a,borderBoxCenter:$(e.initial.client.borderBoxCenter,d)},l={selection:$(p.selection,s.scroll.current),borderBoxCenter:$(p.borderBoxCenter,s.scroll.current),offset:$(p.offset,s.scroll.diff.value)},u={client:p,page:l};if(e.phase==="COLLECTING")return{...e,dimensions:c,viewport:s,current:u};const g=c.draggables[e.critical.draggable.id],m=o||Or({pageOffset:l.offset,draggable:g,draggables:c.draggables,droppables:c.droppables,previousImpact:e.impact,viewport:s,afterCritical:e.afterCritical}),b=Ws({draggable:g,impact:m,previousImpact:e.impact,draggables:c.draggables,droppables:c.droppables});return{...e,current:u,dimensions:{draggables:c.draggables,droppables:b},impact:m,viewport:s,scrollJumpRequest:i||null,forceShouldAnimate:i?!1:null}};function Us(e,t){return e.map(n=>t[n])}var Sr=({impact:e,viewport:t,draggables:n,destination:r,forceShouldAnimate:o})=>{const i=e.displaced,s=Us(i.all,n),c=Ee({afterDragging:s,destination:r,displacedBy:e.displacedBy,viewport:t.frame,forceShouldAnimate:o,last:i});return{...e,displaced:c}},wr=({impact:e,draggable:t,droppable:n,draggables:r,viewport:o,afterCritical:i})=>{const s=Ye({impact:e,draggable:t,draggables:r,droppable:n,afterCritical:i});return At({pageBorderBoxCenter:s,draggable:t,viewport:o})},Cr=({state:e,dimensions:t,viewport:n})=>{e.movementMode!=="SNAP"&&(process.env.NODE_ENV,f());const r=e.impact,o=n||e.viewport,i=t||e.dimensions,{draggables:s,droppables:c}=i,a=s[e.critical.draggable.id],d=W(r);d||(process.env.NODE_ENV!=="production"?f(!1,"Must be over a destination in SNAP movement mode"):f());const p=c[d],l=Sr({impact:r,viewport:o,destination:p,draggables:s}),u=wr({impact:l,draggable:a,droppable:p,draggables:s,viewport:o,afterCritical:e.afterCritical});return Ne({impact:l,clientSelection:u,state:e,dimensions:i,viewport:o})},Hs=e=>({index:e.index,droppableId:e.droppableId}),Ar=({draggable:e,home:t,draggables:n,viewport:r})=>{const o=De(t.axis,e.displaceBy),i=ie(t.descriptor.id,n),s=i.indexOf(e);s===-1&&(process.env.NODE_ENV!=="production"?f(!1,"Expected draggable to be inside home list"):f());const c=i.slice(s+1),a=c.reduce((u,g)=>(u[g.descriptor.id]=!0,u),{}),d={inVirtualList:t.descriptor.mode==="virtual",displacedBy:o,effected:a};return{impact:{displaced:Ee({afterDragging:c,destination:t,displacedBy:o,last:null,viewport:r.frame,forceShouldAnimate:!1}),displacedBy:o,at:{type:"REORDER",destination:Hs(e.descriptor)}},afterCritical:d}},js=(e,t)=>({draggables:e.draggables,droppables:_t(e.droppables,t)});const xe=e=>{process.env.NODE_ENV},Ie=e=>{process.env.NODE_ENV};var zs=({draggable:e,offset:t,initialWindowScroll:n})=>{const r=Ge(e.client,t),o=Fe(r,n);return{...e,placeholder:{...e.placeholder,client:r},client:r,page:o}},qs=e=>{const t=e.frame;return t||(process.env.NODE_ENV!=="production"?f(!1,"Expected Droppable to have a frame"):f()),t},Ys=({additions:e,updatedDroppables:t,viewport:n})=>{const r=n.scroll.diff.value;return e.map(o=>{const i=o.descriptor.droppableId,s=t[i],a=qs(s).scroll.diff.value,d=$(r,a);return zs({draggable:o,offset:d,initialWindowScroll:n.scroll.initial})})},Xs=({state:e,published:t})=>{xe();const n=t.modified.map(y=>{const v=e.dimensions.droppables[y.droppableId];return xt(v,y.scroll)}),r={...e.dimensions.droppables,...sr(n)},o=cr(Ys({additions:t.additions,updatedDroppables:r,viewport:e.viewport})),i={...e.dimensions.draggables,...o};t.removals.forEach(y=>{delete i[y]});const s={droppables:r,draggables:i},c=W(e.impact),a=c?s.droppables[c]:null,d=s.draggables[e.critical.draggable.id],p=s.droppables[e.critical.droppable.id],{impact:l,afterCritical:u}=Ar({draggable:d,home:p,draggables:i,viewport:e.viewport}),g=a&&a.isCombineEnabled?e.impact:l,m=Or({pageOffset:e.current.page.offset,draggable:s.draggables[e.critical.draggable.id],draggables:s.draggables,droppables:s.droppables,previousImpact:g,viewport:e.viewport,afterCritical:u});Ie();const b={...e,phase:"DRAGGING",impact:m,onLiftImpact:l,dimensions:s,afterCritical:u,forceShouldAnimate:!1};return e.phase==="COLLECTING"?b:{...b,phase:"DROP_PENDING",reason:e.reason,isWaiting:!1}};const Pt=e=>e.movementMode==="SNAP",Tt=(e,t,n)=>{const r=js(e.dimensions,t);return!Pt(e)||n?Ne({state:e,dimensions:r}):Cr({state:e,dimensions:r})};function Bt(e){return e.isDragging&&e.movementMode==="SNAP"?{...e,scrollJumpRequest:null}:e}const _r={phase:"IDLE",completed:null,shouldFlush:!1};var Ks=(e=_r,t)=>{if(t.type==="FLUSH")return{..._r,shouldFlush:!0};if(t.type==="INITIAL_PUBLISH"){e.phase!=="IDLE"&&(process.env.NODE_ENV!=="production"?f(!1,"INITIAL_PUBLISH must come after a IDLE phase"):f());const{critical:n,clientSelection:r,viewport:o,dimensions:i,movementMode:s}=t.payload,c=i.draggables[n.draggable.id],a=i.droppables[n.droppable.id],d={selection:r,borderBoxCenter:c.client.borderBox.center,offset:R},p={client:d,page:{selection:$(d.selection,o.scroll.initial),borderBoxCenter:$(d.selection,o.scroll.initial),offset:$(d.selection,o.scroll.diff.value)}},l=He(i.droppables).every(b=>!b.isFixedOnPage),{impact:u,afterCritical:g}=Ar({draggable:c,home:a,draggables:i.draggables,viewport:o});return{phase:"DRAGGING",isDragging:!0,critical:n,movementMode:s,dimensions:i,initial:p,current:p,isWindowScrollAllowed:l,impact:u,afterCritical:g,onLiftImpact:u,viewport:o,scrollJumpRequest:null,forceShouldAnimate:null}}if(t.type==="COLLECTION_STARTING")return e.phase==="COLLECTING"||e.phase==="DROP_PENDING"?e:(e.phase!=="DRAGGING"&&(process.env.NODE_ENV!=="production"?f(!1,`Collection cannot start from phase ${e.phase}`):f()),{...e,phase:"COLLECTING"});if(t.type==="PUBLISH_WHILE_DRAGGING")return e.phase==="COLLECTING"||e.phase==="DROP_PENDING"||(process.env.NODE_ENV!=="production"?f(!1,`Unexpected ${t.type} received in phase ${e.phase}`):f()),Xs({state:e,published:t.payload});if(t.type==="MOVE"){if(e.phase==="DROP_PENDING")return e;se(e)||(process.env.NODE_ENV!=="production"?f(!1,`${t.type} not permitted in phase ${e.phase}`):f());const{client:n}=t.payload;return ne(n,e.current.client.selection)?e:Ne({state:e,clientSelection:n,impact:Pt(e)?e.impact:null})}if(t.type==="UPDATE_DROPPABLE_SCROLL"){if(e.phase==="DROP_PENDING"||e.phase==="COLLECTING")return Bt(e);se(e)||(process.env.NODE_ENV!=="production"?f(!1,`${t.type} not permitted in phase ${e.phase}`):f());const{id:n,newScroll:r}=t.payload,o=e.dimensions.droppables[n];if(!o)return e;const i=xt(o,r);return Tt(e,i,!1)}if(t.type==="UPDATE_DROPPABLE_IS_ENABLED"){if(e.phase==="DROP_PENDING")return e;se(e)||(process.env.NODE_ENV!=="production"?f(!1,`Attempting to move in an unsupported phase ${e.phase}`):f());const{id:n,isEnabled:r}=t.payload,o=e.dimensions.droppables[n];o||(process.env.NODE_ENV!=="production"?f(!1,`Cannot find Droppable[id: ${n}] to toggle its enabled state`):f()),o.isEnabled===r&&(process.env.NODE_ENV!=="production"?f(!1,`Trying to set droppable isEnabled to ${String(r)}
67
67
  but it is already ${String(o.isEnabled)}`):f());const i={...o,isEnabled:r};return Tt(e,i,!0)}if(t.type==="UPDATE_DROPPABLE_IS_COMBINE_ENABLED"){if(e.phase==="DROP_PENDING")return e;se(e)||(process.env.NODE_ENV!=="production"?f(!1,`Attempting to move in an unsupported phase ${e.phase}`):f());const{id:n,isCombineEnabled:r}=t.payload,o=e.dimensions.droppables[n];o||(process.env.NODE_ENV!=="production"?f(!1,`Cannot find Droppable[id: ${n}] to toggle its isCombineEnabled state`):f()),o.isCombineEnabled===r&&(process.env.NODE_ENV!=="production"?f(!1,`Trying to set droppable isCombineEnabled to ${String(r)}
68
- but it is already ${String(o.isCombineEnabled)}`):f());const i={...o,isCombineEnabled:r};return Tt(e,i,!0)}if(t.type==="MOVE_BY_WINDOW_SCROLL"){if(e.phase==="DROP_PENDING"||e.phase==="DROP_ANIMATING")return e;se(e)||(process.env.NODE_ENV!=="production"?f(!1,`Cannot move by window in phase ${e.phase}`):f()),e.isWindowScrollAllowed||(process.env.NODE_ENV!=="production"?f(!1,"Window scrolling is currently not supported for fixed lists"):f());const n=t.payload.newScroll;if(ne(e.viewport.scroll.current,n))return Bt(e);const r=hr(e.viewport,n);return Pt(e)?Cr({state:e,viewport:r}):Ne({state:e,viewport:r})}if(t.type==="UPDATE_VIEWPORT_MAX_SCROLL"){if(!se(e))return e;const n=t.payload.maxScroll;if(ne(n,e.viewport.scroll.max))return e;const r={...e.viewport,scroll:{...e.viewport.scroll,max:n}};return{...e,viewport:r}}if(t.type==="MOVE_UP"||t.type==="MOVE_DOWN"||t.type==="MOVE_LEFT"||t.type==="MOVE_RIGHT"){if(e.phase==="COLLECTING"||e.phase==="DROP_PENDING")return e;e.phase!=="DRAGGING"&&(process.env.NODE_ENV!=="production"?f(!1,`${t.type} received while not in DRAGGING phase`):f());const n=Ts({state:e,type:t.type});return n?Ne({state:e,impact:n.impact,clientSelection:n.clientSelection,scrollJumpRequest:n.scrollJumpRequest}):e}if(t.type==="DROP_PENDING"){const n=t.payload.reason;return e.phase!=="COLLECTING"&&(process.env.NODE_ENV!=="production"?f(!1,"Can only move into the DROP_PENDING phase from the COLLECTING phase"):f()),{...e,phase:"DROP_PENDING",isWaiting:!0,reason:n}}if(t.type==="DROP_ANIMATE"){const{completed:n,dropDuration:r,newHomeClientOffset:o}=t.payload;return e.phase==="DRAGGING"||e.phase==="DROP_PENDING"||(process.env.NODE_ENV!=="production"?f(!1,`Cannot animate drop from phase ${e.phase}`):f()),{phase:"DROP_ANIMATING",completed:n,dropDuration:r,newHomeClientOffset:o,dimensions:e.dimensions}}if(t.type==="DROP_COMPLETE"){const{completed:n}=t.payload;return{phase:"IDLE",completed:n,shouldFlush:!1}}return e};function _(e,t){return e instanceof Object&&"type"in e&&e.type===t}const Js=e=>({type:"BEFORE_INITIAL_CAPTURE",payload:e}),Zs=e=>({type:"LIFT",payload:e}),Qs=e=>({type:"INITIAL_PUBLISH",payload:e}),ec=e=>({type:"PUBLISH_WHILE_DRAGGING",payload:e}),tc=()=>({type:"COLLECTION_STARTING",payload:null}),nc=e=>({type:"UPDATE_DROPPABLE_SCROLL",payload:e}),rc=e=>({type:"UPDATE_DROPPABLE_IS_ENABLED",payload:e}),oc=e=>({type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:e}),Pr=e=>({type:"MOVE",payload:e}),ic=e=>({type:"MOVE_BY_WINDOW_SCROLL",payload:e}),sc=e=>({type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:e}),cc=()=>({type:"MOVE_UP",payload:null}),ac=()=>({type:"MOVE_DOWN",payload:null}),lc=()=>({type:"MOVE_RIGHT",payload:null}),dc=()=>({type:"MOVE_LEFT",payload:null}),Vt=()=>({type:"FLUSH",payload:null}),uc=e=>({type:"DROP_ANIMATE",payload:e}),Rt=e=>({type:"DROP_COMPLETE",payload:e}),Tr=e=>({type:"DROP",payload:e}),pc=e=>({type:"DROP_PENDING",payload:e}),Br=()=>({type:"DROP_ANIMATION_FINISHED",payload:null});function fc(e){if(e.length<=1)return;const t=e.map(o=>o.descriptor.index),n={};for(let o=1;o<t.length;o++){const i=t[o],s=t[o-1];i!==s+1&&(n[i]=!0)}if(!Object.keys(n).length)return;const r=t.map(o=>!!n[o]?`[🔥${o}]`:`${o}`).join(", ");process.env.NODE_ENV!=="production"&&T(`
68
+ but it is already ${String(o.isCombineEnabled)}`):f());const i={...o,isCombineEnabled:r};return Tt(e,i,!0)}if(t.type==="MOVE_BY_WINDOW_SCROLL"){if(e.phase==="DROP_PENDING"||e.phase==="DROP_ANIMATING")return e;se(e)||(process.env.NODE_ENV!=="production"?f(!1,`Cannot move by window in phase ${e.phase}`):f()),e.isWindowScrollAllowed||(process.env.NODE_ENV!=="production"?f(!1,"Window scrolling is currently not supported for fixed lists"):f());const n=t.payload.newScroll;if(ne(e.viewport.scroll.current,n))return Bt(e);const r=hr(e.viewport,n);return Pt(e)?Cr({state:e,viewport:r}):Ne({state:e,viewport:r})}if(t.type==="UPDATE_VIEWPORT_MAX_SCROLL"){if(!se(e))return e;const n=t.payload.maxScroll;if(ne(n,e.viewport.scroll.max))return e;const r={...e.viewport,scroll:{...e.viewport.scroll,max:n}};return{...e,viewport:r}}if(t.type==="MOVE_UP"||t.type==="MOVE_DOWN"||t.type==="MOVE_LEFT"||t.type==="MOVE_RIGHT"){if(e.phase==="COLLECTING"||e.phase==="DROP_PENDING")return e;e.phase!=="DRAGGING"&&(process.env.NODE_ENV!=="production"?f(!1,`${t.type} received while not in DRAGGING phase`):f());const n=Ts({state:e,type:t.type});return n?Ne({state:e,impact:n.impact,clientSelection:n.clientSelection,scrollJumpRequest:n.scrollJumpRequest}):e}if(t.type==="DROP_PENDING"){const n=t.payload.reason;return e.phase!=="COLLECTING"&&(process.env.NODE_ENV!=="production"?f(!1,"Can only move into the DROP_PENDING phase from the COLLECTING phase"):f()),{...e,phase:"DROP_PENDING",isWaiting:!0,reason:n}}if(t.type==="DROP_ANIMATE"){const{completed:n,dropDuration:r,newHomeClientOffset:o}=t.payload;return e.phase==="DRAGGING"||e.phase==="DROP_PENDING"||(process.env.NODE_ENV!=="production"?f(!1,`Cannot animate drop from phase ${e.phase}`):f()),{phase:"DROP_ANIMATING",completed:n,dropDuration:r,newHomeClientOffset:o,dimensions:e.dimensions}}if(t.type==="DROP_COMPLETE"){const{completed:n}=t.payload;return{phase:"IDLE",completed:n,shouldFlush:!1}}return e};function _(e,t){return e instanceof Object&&"type"in e&&e.type===t}const Js=e=>({type:"BEFORE_INITIAL_CAPTURE",payload:e}),Zs=e=>({type:"LIFT",payload:e}),Qs=e=>({type:"INITIAL_PUBLISH",payload:e}),ec=e=>({type:"PUBLISH_WHILE_DRAGGING",payload:e}),tc=()=>({type:"COLLECTION_STARTING",payload:null}),nc=e=>({type:"UPDATE_DROPPABLE_SCROLL",payload:e}),rc=e=>({type:"UPDATE_DROPPABLE_IS_ENABLED",payload:e}),oc=e=>({type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:e}),Pr=e=>({type:"MOVE",payload:e}),ic=e=>({type:"MOVE_BY_WINDOW_SCROLL",payload:e}),sc=e=>({type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:e}),cc=()=>({type:"MOVE_UP",payload:null}),ac=()=>({type:"MOVE_DOWN",payload:null}),lc=()=>({type:"MOVE_RIGHT",payload:null}),dc=()=>({type:"MOVE_LEFT",payload:null}),Vt=()=>({type:"FLUSH",payload:null}),uc=e=>({type:"DROP_ANIMATE",payload:e}),Lt=e=>({type:"DROP_COMPLETE",payload:e}),Tr=e=>({type:"DROP",payload:e}),pc=e=>({type:"DROP_PENDING",payload:e}),Br=()=>({type:"DROP_ANIMATION_FINISHED",payload:null});function fc(e){if(e.length<=1)return;const t=e.map(o=>o.descriptor.index),n={};for(let o=1;o<t.length;o++){const i=t[o],s=t[o-1];i!==s+1&&(n[i]=!0)}if(!Object.keys(n).length)return;const r=t.map(o=>!!n[o]?`[🔥${o}]`:`${o}`).join(", ");process.env.NODE_ENV!=="production"&&T(`
69
69
  Detected non-consecutive <Draggable /> indexes.
70
70
 
71
71
  (This can cause unexpected bugs)
72
72
 
73
73
  ${r}
74
- `)}function gc(e,t){if(process.env.NODE_ENV!=="production"){const n=ie(e.droppable.id,t.draggables);fc(n)}}var mc=e=>({getState:t,dispatch:n})=>r=>o=>{if(!_(o,"LIFT")){r(o);return}const{id:i,clientSelection:s,movementMode:c}=o.payload,a=t();a.phase==="DROP_ANIMATING"&&n(Rt({completed:a.completed})),t().phase!=="IDLE"&&(process.env.NODE_ENV!=="production"?f(!1,"Unexpected phase to start a drag"):f()),n(Vt()),n(Js({draggableId:i,movementMode:c}));const p={draggableId:i,scrollOptions:{shouldPublishImmediately:c==="SNAP"}},{critical:l,dimensions:u,viewport:g}=e.startPublishing(p);gc(l,u),n(Qs({critical:l,dimensions:u,clientSelection:s,movementMode:c,viewport:g}))},hc=e=>()=>t=>n=>{_(n,"INITIAL_PUBLISH")&&e.dragging(),_(n,"DROP_ANIMATE")&&e.dropping(n.payload.completed.result.reason),(_(n,"FLUSH")||_(n,"DROP_COMPLETE"))&&e.resting(),t(n)};const Lt={outOfTheWay:"cubic-bezier(0.2, 0, 0, 1)",drop:"cubic-bezier(.2,1,.1,1)"},Oe={opacity:{drop:0,combining:.7},scale:{drop:.75}},Vr={outOfTheWay:.2,minDropTime:.33,maxDropTime:.55},ce=`${Vr.outOfTheWay}s ${Lt.outOfTheWay}`,Se={fluid:`opacity ${ce}`,snap:`transform ${ce}, opacity ${ce}`,drop:e=>{const t=`${e}s ${Lt.drop}`;return`transform ${t}, opacity ${t}`},outOfTheWay:`transform ${ce}`,placeholder:`height ${ce}, width ${ce}, margin ${ce}`},Rr=e=>ne(e,L)?void 0:`translate(${e.x}px, ${e.y}px)`,Mt={moveTo:Rr,drop:(e,t)=>{const n=Rr(e);if(n)return t?`${n} scale(${Oe.scale.drop})`:n}},{minDropTime:$t,maxDropTime:Lr}=Vr,bc=Lr-$t,Mr=1500,vc=.6;var yc=({current:e,destination:t,reason:n})=>{const r=be(e,t);if(r<=0)return $t;if(r>=Mr)return Lr;const o=r/Mr,i=$t+bc*o,s=n==="CANCEL"?i*vc:i;return Number(s.toFixed(2))},Ec=({impact:e,draggable:t,dimensions:n,viewport:r,afterCritical:o})=>{const{draggables:i,droppables:s}=n,c=W(e),a=c?s[c]:null,d=s[t.descriptor.droppableId],p=wr({impact:e,draggable:t,draggables:i,afterCritical:o,droppable:a||d,viewport:r});return k(p,t.client.borderBox.center)},Dc=({draggables:e,reason:t,lastImpact:n,home:r,viewport:o,onLiftImpact:i})=>!n.at||t!=="DROP"?{impact:Sr({draggables:e,impact:i,destination:r,viewport:o,forceShouldAnimate:!0}),didDropInsideDroppable:!1}:n.at.type==="REORDER"?{impact:n,didDropInsideDroppable:!0}:{impact:{...n,displaced:ye},didDropInsideDroppable:!0};const Nc=({getState:e,dispatch:t})=>n=>r=>{if(!_(r,"DROP")){n(r);return}const o=e(),i=r.payload.reason;if(o.phase==="COLLECTING"){t(pc({reason:i}));return}if(o.phase==="IDLE")return;o.phase==="DROP_PENDING"&&o.isWaiting&&(process.env.NODE_ENV!=="production"?f(!1,"A DROP action occurred while DROP_PENDING and still waiting"):f()),o.phase==="DRAGGING"||o.phase==="DROP_PENDING"||(process.env.NODE_ENV!=="production"?f(!1,`Cannot drop in phase: ${o.phase}`):f());const c=o.critical,a=o.dimensions,d=a.draggables[o.critical.draggable.id],{impact:p,didDropInsideDroppable:l}=Dc({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}),u=l?It(p):null,g=l?je(p):null,m={index:c.draggable.index,droppableId:c.droppable.id},b={draggableId:d.descriptor.id,type:d.descriptor.type,source:m,reason:i,mode:o.movementMode,destination:u,combine:g},h=Ec({impact:p,draggable:d,dimensions:a,viewport:o.viewport,afterCritical:o.afterCritical}),y={critical:o.critical,afterCritical:o.afterCritical,result:b,impact:p};if(!(!ne(o.current.client.offset,h)||!!b.combine)){t(Rt({completed:y}));return}const S=yc({current:o.current.client.offset,destination:h,reason:i});t(uc({newHomeClientOffset:h,dropDuration:S,completed:y}))};var $r=()=>({x:window.pageXOffset,y:window.pageYOffset});function xc(e){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:t=>{t.target!==window&&t.target!==window.document||e()}}}function Ic({onWindowScroll:e}){function t(){e($r())}const n=me(t),r=xc(n);let o=te;function i(){return o!==te}function s(){i()&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot start scroll listener when already active"):f()),o=Y(window,[r])}function c(){i()||(process.env.NODE_ENV!=="production"?f(!1,"Cannot stop scroll listener when not active"):f()),n.cancel(),o(),o=te}return{start:s,stop:c,isActive:i}}const Oc=e=>_(e,"DROP_COMPLETE")||_(e,"DROP_ANIMATE")||_(e,"FLUSH"),Sc=e=>{const t=Ic({onWindowScroll:n=>{e.dispatch(ic({newScroll:n}))}});return n=>r=>{!t.isActive()&&_(r,"INITIAL_PUBLISH")&&t.start(),t.isActive()&&Oc(r)&&t.stop(),n(r)}};var wc=e=>{let t=!1,n=!1;const r=setTimeout(()=>{n=!0}),o=i=>{if(t){process.env.NODE_ENV!=="production"&&T("Announcement already made. Not making a second announcement");return}if(n){process.env.NODE_ENV!=="production"&&T(`
74
+ `)}function gc(e,t){if(process.env.NODE_ENV!=="production"){const n=ie(e.droppable.id,t.draggables);fc(n)}}var mc=e=>({getState:t,dispatch:n})=>r=>o=>{if(!_(o,"LIFT")){r(o);return}const{id:i,clientSelection:s,movementMode:c}=o.payload,a=t();a.phase==="DROP_ANIMATING"&&n(Lt({completed:a.completed})),t().phase!=="IDLE"&&(process.env.NODE_ENV!=="production"?f(!1,"Unexpected phase to start a drag"):f()),n(Vt()),n(Js({draggableId:i,movementMode:c}));const p={draggableId:i,scrollOptions:{shouldPublishImmediately:c==="SNAP"}},{critical:l,dimensions:u,viewport:g}=e.startPublishing(p);gc(l,u),n(Qs({critical:l,dimensions:u,clientSelection:s,movementMode:c,viewport:g}))},hc=e=>()=>t=>n=>{_(n,"INITIAL_PUBLISH")&&e.dragging(),_(n,"DROP_ANIMATE")&&e.dropping(n.payload.completed.result.reason),(_(n,"FLUSH")||_(n,"DROP_COMPLETE"))&&e.resting(),t(n)};const Rt={outOfTheWay:"cubic-bezier(0.2, 0, 0, 1)",drop:"cubic-bezier(.2,1,.1,1)"},Oe={opacity:{drop:0,combining:.7},scale:{drop:.75}},Vr={outOfTheWay:.2,minDropTime:.33,maxDropTime:.55},ce=`${Vr.outOfTheWay}s ${Rt.outOfTheWay}`,Se={fluid:`opacity ${ce}`,snap:`transform ${ce}, opacity ${ce}`,drop:e=>{const t=`${e}s ${Rt.drop}`;return`transform ${t}, opacity ${t}`},outOfTheWay:`transform ${ce}`,placeholder:`height ${ce}, width ${ce}, margin ${ce}`},Lr=e=>ne(e,R)?void 0:`translate(${e.x}px, ${e.y}px)`,Mt={moveTo:Lr,drop:(e,t)=>{const n=Lr(e);if(n)return t?`${n} scale(${Oe.scale.drop})`:n}},{minDropTime:$t,maxDropTime:Rr}=Vr,bc=Rr-$t,Mr=1500,vc=.6;var yc=({current:e,destination:t,reason:n})=>{const r=be(e,t);if(r<=0)return $t;if(r>=Mr)return Rr;const o=r/Mr,i=$t+bc*o,s=n==="CANCEL"?i*vc:i;return Number(s.toFixed(2))},Ec=({impact:e,draggable:t,dimensions:n,viewport:r,afterCritical:o})=>{const{draggables:i,droppables:s}=n,c=W(e),a=c?s[c]:null,d=s[t.descriptor.droppableId],p=wr({impact:e,draggable:t,draggables:i,afterCritical:o,droppable:a||d,viewport:r});return k(p,t.client.borderBox.center)},Dc=({draggables:e,reason:t,lastImpact:n,home:r,viewport:o,onLiftImpact:i})=>!n.at||t!=="DROP"?{impact:Sr({draggables:e,impact:i,destination:r,viewport:o,forceShouldAnimate:!0}),didDropInsideDroppable:!1}:n.at.type==="REORDER"?{impact:n,didDropInsideDroppable:!0}:{impact:{...n,displaced:ye},didDropInsideDroppable:!0};const Nc=({getState:e,dispatch:t})=>n=>r=>{if(!_(r,"DROP")){n(r);return}const o=e(),i=r.payload.reason;if(o.phase==="COLLECTING"){t(pc({reason:i}));return}if(o.phase==="IDLE")return;o.phase==="DROP_PENDING"&&o.isWaiting&&(process.env.NODE_ENV!=="production"?f(!1,"A DROP action occurred while DROP_PENDING and still waiting"):f()),o.phase==="DRAGGING"||o.phase==="DROP_PENDING"||(process.env.NODE_ENV!=="production"?f(!1,`Cannot drop in phase: ${o.phase}`):f());const c=o.critical,a=o.dimensions,d=a.draggables[o.critical.draggable.id],{impact:p,didDropInsideDroppable:l}=Dc({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}),u=l?It(p):null,g=l?je(p):null,m={index:c.draggable.index,droppableId:c.droppable.id},b={draggableId:d.descriptor.id,type:d.descriptor.type,source:m,reason:i,mode:o.movementMode,destination:u,combine:g},h=Ec({impact:p,draggable:d,dimensions:a,viewport:o.viewport,afterCritical:o.afterCritical}),y={critical:o.critical,afterCritical:o.afterCritical,result:b,impact:p};if(!(!ne(o.current.client.offset,h)||!!b.combine)){t(Lt({completed:y}));return}const S=yc({current:o.current.client.offset,destination:h,reason:i});t(uc({newHomeClientOffset:h,dropDuration:S,completed:y}))};var $r=()=>({x:window.pageXOffset,y:window.pageYOffset});function xc(e){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:t=>{t.target!==window&&t.target!==window.document||e()}}}function Ic({onWindowScroll:e}){function t(){e($r())}const n=me(t),r=xc(n);let o=te;function i(){return o!==te}function s(){i()&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot start scroll listener when already active"):f()),o=Y(window,[r])}function c(){i()||(process.env.NODE_ENV!=="production"?f(!1,"Cannot stop scroll listener when not active"):f()),n.cancel(),o(),o=te}return{start:s,stop:c,isActive:i}}const Oc=e=>_(e,"DROP_COMPLETE")||_(e,"DROP_ANIMATE")||_(e,"FLUSH"),Sc=e=>{const t=Ic({onWindowScroll:n=>{e.dispatch(ic({newScroll:n}))}});return n=>r=>{!t.isActive()&&_(r,"INITIAL_PUBLISH")&&t.start(),t.isActive()&&Oc(r)&&t.stop(),n(r)}};var wc=e=>{let t=!1,n=!1;const r=setTimeout(()=>{n=!0}),o=i=>{if(t){process.env.NODE_ENV!=="production"&&T("Announcement already made. Not making a second announcement");return}if(n){process.env.NODE_ENV!=="production"&&T(`
75
75
  Announcements cannot be made asynchronously.
76
76
  Default message has already been announced.
77
- `);return}t=!0,e(i),clearTimeout(r)};return o.wasCalled=()=>t,o},Cc=()=>{const e=[],t=o=>{const i=e.findIndex(c=>c.timerId===o);i===-1&&(process.env.NODE_ENV!=="production"?f(!1,"Could not find timer"):f());const[s]=e.splice(i,1);s.callback()};return{add:o=>{const i=setTimeout(()=>t(i)),s={timerId:i,callback:o};e.push(s)},flush:()=>{if(!e.length)return;const o=[...e];e.length=0,o.forEach(i=>{clearTimeout(i.timerId),i.callback()})}}};const Ac=(e,t)=>e==null&&t==null?!0:e==null||t==null?!1:e.droppableId===t.droppableId&&e.index===t.index,_c=(e,t)=>e==null&&t==null?!0:e==null||t==null?!1:e.draggableId===t.draggableId&&e.droppableId===t.droppableId,Pc=(e,t)=>{if(e===t)return!0;const n=e.draggable.id===t.draggable.id&&e.draggable.droppableId===t.draggable.droppableId&&e.draggable.type===t.draggable.type&&e.draggable.index===t.draggable.index,r=e.droppable.id===t.droppable.id&&e.droppable.type===t.droppable.type;return n&&r},we=(e,t)=>{xe(),t(),Ie()},Xe=(e,t)=>({draggableId:e.draggable.id,type:e.droppable.type,source:{droppableId:e.droppable.id,index:e.draggable.index},mode:t});function Gt(e,t,n,r){if(!e){n(r(t));return}const o=wc(n);e(t,{announce:o}),o.wasCalled()||n(r(t))}var Tc=(e,t)=>{const n=Cc();let r=null;const o=(l,u)=>{r&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot fire onBeforeCapture as a drag start has already been published"):f()),we("onBeforeCapture",()=>{const g=e().onBeforeCapture;g&&g({draggableId:l,mode:u})})},i=(l,u)=>{r&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot fire onBeforeDragStart as a drag start has already been published"):f()),we("onBeforeDragStart",()=>{const g=e().onBeforeDragStart;g&&g(Xe(l,u))})},s=(l,u)=>{r&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot fire onBeforeDragStart as a drag start has already been published"):f());const g=Xe(l,u);r={mode:u,lastCritical:l,lastLocation:g.source,lastCombine:null},n.add(()=>{we("onDragStart",()=>Gt(e().onDragStart,g,t,Ue.onDragStart))})},c=(l,u)=>{const g=It(u),m=je(u);r||(process.env.NODE_ENV!=="production"?f(!1,"Cannot fire onDragMove when onDragStart has not been called"):f());const b=!Pc(l,r.lastCritical);b&&(r.lastCritical=l);const h=!Ac(r.lastLocation,g);h&&(r.lastLocation=g);const y=!_c(r.lastCombine,m);if(y&&(r.lastCombine=m),!b&&!h&&!y)return;const v={...Xe(l,r.mode),combine:m,destination:g};n.add(()=>{we("onDragUpdate",()=>Gt(e().onDragUpdate,v,t,Ue.onDragUpdate))})},a=()=>{r||(process.env.NODE_ENV!=="production"?f(!1,"Can only flush responders while dragging"):f()),n.flush()},d=l=>{r||(process.env.NODE_ENV!=="production"?f(!1,"Cannot fire onDragEnd when there is no matching onDragStart"):f()),r=null,we("onDragEnd",()=>Gt(e().onDragEnd,l,t,Ue.onDragEnd))};return{beforeCapture:o,beforeStart:i,start:s,update:c,flush:a,drop:d,abort:()=>{if(!r)return;const l={...Xe(r.lastCritical,r.mode),combine:null,destination:null,reason:"CANCEL"};d(l)}}},Bc=(e,t)=>{const n=Tc(e,t);return r=>o=>i=>{if(_(i,"BEFORE_INITIAL_CAPTURE")){n.beforeCapture(i.payload.draggableId,i.payload.movementMode);return}if(_(i,"INITIAL_PUBLISH")){const c=i.payload.critical;n.beforeStart(c,i.payload.movementMode),o(i),n.start(c,i.payload.movementMode);return}if(_(i,"DROP_COMPLETE")){const c=i.payload.completed.result;n.flush(),o(i),n.drop(c);return}if(o(i),_(i,"FLUSH")){n.abort();return}const s=r.getState();s.phase==="DRAGGING"&&n.update(s.critical,s.impact)}};const Vc=e=>t=>n=>{if(!_(n,"DROP_ANIMATION_FINISHED")){t(n);return}const r=e.getState();r.phase!=="DROP_ANIMATING"&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot finish a drop animating when no drop is occurring"):f()),e.dispatch(Rt({completed:r.completed}))},Rc=e=>{let t=null,n=null;function r(){n&&(cancelAnimationFrame(n),n=null),t&&(t(),t=null)}return o=>i=>{if((_(i,"FLUSH")||_(i,"DROP_COMPLETE")||_(i,"DROP_ANIMATION_FINISHED"))&&r(),o(i),!_(i,"DROP_ANIMATE"))return;const s={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){e.getState().phase==="DROP_ANIMATING"&&e.dispatch(Br())}};n=requestAnimationFrame(()=>{n=null,t=Y(window,[s])})}};var Lc=e=>()=>t=>n=>{(_(n,"DROP_COMPLETE")||_(n,"FLUSH")||_(n,"DROP_ANIMATE"))&&e.stopPublishing(),t(n)},Mc=e=>{let t=!1;return()=>n=>r=>{if(_(r,"INITIAL_PUBLISH")){t=!0,e.tryRecordFocus(r.payload.critical.draggable.id),n(r),e.tryRestoreFocusRecorded();return}if(n(r),!!t){if(_(r,"FLUSH")){t=!1,e.tryRestoreFocusRecorded();return}if(_(r,"DROP_COMPLETE")){t=!1;const o=r.payload.completed.result;o.combine&&e.tryShiftRecord(o.draggableId,o.combine.draggableId),e.tryRestoreFocusRecorded()}}}};const $c=e=>_(e,"DROP_COMPLETE")||_(e,"DROP_ANIMATE")||_(e,"FLUSH");var Gc=e=>t=>n=>r=>{if($c(r)){e.stop(),n(r);return}if(_(r,"INITIAL_PUBLISH")){n(r);const o=t.getState();o.phase!=="DRAGGING"&&(process.env.NODE_ENV!=="production"?f(!1,"Expected phase to be DRAGGING after INITIAL_PUBLISH"):f()),e.start(o);return}n(r),e.scroll(t.getState())};const Fc=e=>t=>n=>{if(t(n),!_(n,"PUBLISH_WHILE_DRAGGING"))return;const r=e.getState();r.phase==="DROP_PENDING"&&(r.isWaiting||e.dispatch(Tr({reason:r.reason})))},kc=process.env.NODE_ENV!=="production"&&typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({name:"@hello-pangea/dnd"}):xn;var Wc=({dimensionMarshal:e,focusMarshal:t,styleMarshal:n,getResponders:r,announce:o,autoScroller:i})=>En(Ks,kc($o(hc(n),Lc(e),mc(e),Nc,Vc,Rc,Fc,Gc(i),Sc,Mc(t),Bc(r,o))));const Ft=()=>({additions:{},removals:{},modified:{}});function Uc({registry:e,callbacks:t}){let n=Ft(),r=null;const o=()=>{r||(t.collectionStarting(),r=requestAnimationFrame(()=>{r=null,xe();const{additions:a,removals:d,modified:p}=n,l=Object.keys(a).map(m=>e.draggable.getById(m).getDimension(L)).sort((m,b)=>m.descriptor.index-b.descriptor.index),u=Object.keys(p).map(m=>{const h=e.droppable.getById(m).callbacks.getScrollWhileDragging();return{droppableId:m,scroll:h}}),g={additions:l,removals:Object.keys(d),modified:u};n=Ft(),Ie(),t.publish(g)}))};return{add:a=>{const d=a.descriptor.id;n.additions[d]=a,n.modified[a.descriptor.droppableId]=!0,n.removals[d]&&delete n.removals[d],o()},remove:a=>{const d=a.descriptor;n.removals[d.id]=!0,n.modified[d.droppableId]=!0,n.additions[d.id]&&delete n.additions[d.id],o()},stop:()=>{r&&(cancelAnimationFrame(r),r=null,n=Ft())}}}var Gr=({scrollHeight:e,scrollWidth:t,height:n,width:r})=>{const o=k({x:t,y:e},{x:r,y:n});return{x:Math.max(0,o.x),y:Math.max(0,o.y)}},Fr=()=>{const e=document.documentElement;return e||(process.env.NODE_ENV!=="production"?f(!1,"Cannot find document.documentElement"):f()),e},kr=()=>{const e=Fr();return Gr({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,width:e.clientWidth,height:e.clientHeight})},Hc=()=>{const e=$r(),t=kr(),n=e.y,r=e.x,o=Fr(),i=o.clientWidth,s=o.clientHeight,c=r+i,a=n+s;return{frame:K({top:n,left:r,right:c,bottom:a}),scroll:{initial:e,current:e,max:t,diff:{value:L,displacement:L}}}},jc=({critical:e,scrollOptions:t,registry:n})=>{xe();const r=Hc(),o=r.scroll.current,i=e.droppable,s=n.droppable.getAllByType(i.type).map(p=>p.callbacks.getDimensionAndWatchScroll(o,t)),c=n.draggable.getAllByType(e.draggable.type).map(p=>p.getDimension(o)),a={draggables:cr(c),droppables:sr(s)};return Ie(),{dimensions:a,critical:e,viewport:r}};function Wr(e,t,n){return n.descriptor.id===t.id||n.descriptor.type!==t.type?!1:e.droppable.getById(n.descriptor.droppableId).descriptor.mode!=="virtual"?(process.env.NODE_ENV!=="production"&&T(`
77
+ `);return}t=!0,e(i),clearTimeout(r)};return o.wasCalled=()=>t,o},Cc=()=>{const e=[],t=o=>{const i=e.findIndex(c=>c.timerId===o);i===-1&&(process.env.NODE_ENV!=="production"?f(!1,"Could not find timer"):f());const[s]=e.splice(i,1);s.callback()};return{add:o=>{const i=setTimeout(()=>t(i)),s={timerId:i,callback:o};e.push(s)},flush:()=>{if(!e.length)return;const o=[...e];e.length=0,o.forEach(i=>{clearTimeout(i.timerId),i.callback()})}}};const Ac=(e,t)=>e==null&&t==null?!0:e==null||t==null?!1:e.droppableId===t.droppableId&&e.index===t.index,_c=(e,t)=>e==null&&t==null?!0:e==null||t==null?!1:e.draggableId===t.draggableId&&e.droppableId===t.droppableId,Pc=(e,t)=>{if(e===t)return!0;const n=e.draggable.id===t.draggable.id&&e.draggable.droppableId===t.draggable.droppableId&&e.draggable.type===t.draggable.type&&e.draggable.index===t.draggable.index,r=e.droppable.id===t.droppable.id&&e.droppable.type===t.droppable.type;return n&&r},we=(e,t)=>{xe(),t(),Ie()},Xe=(e,t)=>({draggableId:e.draggable.id,type:e.droppable.type,source:{droppableId:e.droppable.id,index:e.draggable.index},mode:t});function Gt(e,t,n,r){if(!e){n(r(t));return}const o=wc(n);e(t,{announce:o}),o.wasCalled()||n(r(t))}var Tc=(e,t)=>{const n=Cc();let r=null;const o=(l,u)=>{r&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot fire onBeforeCapture as a drag start has already been published"):f()),we("onBeforeCapture",()=>{const g=e().onBeforeCapture;g&&g({draggableId:l,mode:u})})},i=(l,u)=>{r&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot fire onBeforeDragStart as a drag start has already been published"):f()),we("onBeforeDragStart",()=>{const g=e().onBeforeDragStart;g&&g(Xe(l,u))})},s=(l,u)=>{r&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot fire onBeforeDragStart as a drag start has already been published"):f());const g=Xe(l,u);r={mode:u,lastCritical:l,lastLocation:g.source,lastCombine:null},n.add(()=>{we("onDragStart",()=>Gt(e().onDragStart,g,t,Ue.onDragStart))})},c=(l,u)=>{const g=It(u),m=je(u);r||(process.env.NODE_ENV!=="production"?f(!1,"Cannot fire onDragMove when onDragStart has not been called"):f());const b=!Pc(l,r.lastCritical);b&&(r.lastCritical=l);const h=!Ac(r.lastLocation,g);h&&(r.lastLocation=g);const y=!_c(r.lastCombine,m);if(y&&(r.lastCombine=m),!b&&!h&&!y)return;const v={...Xe(l,r.mode),combine:m,destination:g};n.add(()=>{we("onDragUpdate",()=>Gt(e().onDragUpdate,v,t,Ue.onDragUpdate))})},a=()=>{r||(process.env.NODE_ENV!=="production"?f(!1,"Can only flush responders while dragging"):f()),n.flush()},d=l=>{r||(process.env.NODE_ENV!=="production"?f(!1,"Cannot fire onDragEnd when there is no matching onDragStart"):f()),r=null,we("onDragEnd",()=>Gt(e().onDragEnd,l,t,Ue.onDragEnd))};return{beforeCapture:o,beforeStart:i,start:s,update:c,flush:a,drop:d,abort:()=>{if(!r)return;const l={...Xe(r.lastCritical,r.mode),combine:null,destination:null,reason:"CANCEL"};d(l)}}},Bc=(e,t)=>{const n=Tc(e,t);return r=>o=>i=>{if(_(i,"BEFORE_INITIAL_CAPTURE")){n.beforeCapture(i.payload.draggableId,i.payload.movementMode);return}if(_(i,"INITIAL_PUBLISH")){const c=i.payload.critical;n.beforeStart(c,i.payload.movementMode),o(i),n.start(c,i.payload.movementMode);return}if(_(i,"DROP_COMPLETE")){const c=i.payload.completed.result;n.flush(),o(i),n.drop(c);return}if(o(i),_(i,"FLUSH")){n.abort();return}const s=r.getState();s.phase==="DRAGGING"&&n.update(s.critical,s.impact)}};const Vc=e=>t=>n=>{if(!_(n,"DROP_ANIMATION_FINISHED")){t(n);return}const r=e.getState();r.phase!=="DROP_ANIMATING"&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot finish a drop animating when no drop is occurring"):f()),e.dispatch(Lt({completed:r.completed}))},Lc=e=>{let t=null,n=null;function r(){n&&(cancelAnimationFrame(n),n=null),t&&(t(),t=null)}return o=>i=>{if((_(i,"FLUSH")||_(i,"DROP_COMPLETE")||_(i,"DROP_ANIMATION_FINISHED"))&&r(),o(i),!_(i,"DROP_ANIMATE"))return;const s={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){e.getState().phase==="DROP_ANIMATING"&&e.dispatch(Br())}};n=requestAnimationFrame(()=>{n=null,t=Y(window,[s])})}};var Rc=e=>()=>t=>n=>{(_(n,"DROP_COMPLETE")||_(n,"FLUSH")||_(n,"DROP_ANIMATE"))&&e.stopPublishing(),t(n)},Mc=e=>{let t=!1;return()=>n=>r=>{if(_(r,"INITIAL_PUBLISH")){t=!0,e.tryRecordFocus(r.payload.critical.draggable.id),n(r),e.tryRestoreFocusRecorded();return}if(n(r),!!t){if(_(r,"FLUSH")){t=!1,e.tryRestoreFocusRecorded();return}if(_(r,"DROP_COMPLETE")){t=!1;const o=r.payload.completed.result;o.combine&&e.tryShiftRecord(o.draggableId,o.combine.draggableId),e.tryRestoreFocusRecorded()}}}};const $c=e=>_(e,"DROP_COMPLETE")||_(e,"DROP_ANIMATE")||_(e,"FLUSH");var Gc=e=>t=>n=>r=>{if($c(r)){e.stop(),n(r);return}if(_(r,"INITIAL_PUBLISH")){n(r);const o=t.getState();o.phase!=="DRAGGING"&&(process.env.NODE_ENV!=="production"?f(!1,"Expected phase to be DRAGGING after INITIAL_PUBLISH"):f()),e.start(o);return}n(r),e.scroll(t.getState())};const Fc=e=>t=>n=>{if(t(n),!_(n,"PUBLISH_WHILE_DRAGGING"))return;const r=e.getState();r.phase==="DROP_PENDING"&&(r.isWaiting||e.dispatch(Tr({reason:r.reason})))},kc=process.env.NODE_ENV!=="production"&&typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({name:"@hello-pangea/dnd"}):xn;var Wc=({dimensionMarshal:e,focusMarshal:t,styleMarshal:n,getResponders:r,announce:o,autoScroller:i})=>En(Ks,kc($o(hc(n),Rc(e),mc(e),Nc,Vc,Lc,Fc,Gc(i),Sc,Mc(t),Bc(r,o))));const Ft=()=>({additions:{},removals:{},modified:{}});function Uc({registry:e,callbacks:t}){let n=Ft(),r=null;const o=()=>{r||(t.collectionStarting(),r=requestAnimationFrame(()=>{r=null,xe();const{additions:a,removals:d,modified:p}=n,l=Object.keys(a).map(m=>e.draggable.getById(m).getDimension(R)).sort((m,b)=>m.descriptor.index-b.descriptor.index),u=Object.keys(p).map(m=>{const h=e.droppable.getById(m).callbacks.getScrollWhileDragging();return{droppableId:m,scroll:h}}),g={additions:l,removals:Object.keys(d),modified:u};n=Ft(),Ie(),t.publish(g)}))};return{add:a=>{const d=a.descriptor.id;n.additions[d]=a,n.modified[a.descriptor.droppableId]=!0,n.removals[d]&&delete n.removals[d],o()},remove:a=>{const d=a.descriptor;n.removals[d.id]=!0,n.modified[d.droppableId]=!0,n.additions[d.id]&&delete n.additions[d.id],o()},stop:()=>{r&&(cancelAnimationFrame(r),r=null,n=Ft())}}}var Gr=({scrollHeight:e,scrollWidth:t,height:n,width:r})=>{const o=k({x:t,y:e},{x:r,y:n});return{x:Math.max(0,o.x),y:Math.max(0,o.y)}},Fr=()=>{const e=document.documentElement;return e||(process.env.NODE_ENV!=="production"?f(!1,"Cannot find document.documentElement"):f()),e},kr=()=>{const e=Fr();return Gr({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,width:e.clientWidth,height:e.clientHeight})},Hc=()=>{const e=$r(),t=kr(),n=e.y,r=e.x,o=Fr(),i=o.clientWidth,s=o.clientHeight,c=r+i,a=n+s;return{frame:K({top:n,left:r,right:c,bottom:a}),scroll:{initial:e,current:e,max:t,diff:{value:R,displacement:R}}}},jc=({critical:e,scrollOptions:t,registry:n})=>{xe();const r=Hc(),o=r.scroll.current,i=e.droppable,s=n.droppable.getAllByType(i.type).map(p=>p.callbacks.getDimensionAndWatchScroll(o,t)),c=n.draggable.getAllByType(e.draggable.type).map(p=>p.getDimension(o)),a={draggables:cr(c),droppables:sr(s)};return Ie(),{dimensions:a,critical:e,viewport:r}};function Wr(e,t,n){return n.descriptor.id===t.id||n.descriptor.type!==t.type?!1:e.droppable.getById(n.descriptor.droppableId).descriptor.mode!=="virtual"?(process.env.NODE_ENV!=="production"&&T(`
78
78
  You are attempting to add or remove a Draggable [id: ${n.descriptor.id}]
79
79
  while a drag is occurring. This is only supported for virtual lists.
80
80
 
@@ -83,7 +83,7 @@ ${mn.current.stack}
83
83
  Detected distance range of 0 in the fluid auto scroller
84
84
  This is unexpected and would cause a divide by 0 issue.
85
85
  Not allowing an auto scroll
86
- `),0):(n-e)/r},kt=1,Zc=(e,t,n=()=>Ce)=>{const r=n();if(e>t.startScrollingFrom)return 0;if(e<=t.maxScrollValueAt)return r.maxPixelScroll;if(e===t.startScrollingFrom)return kt;const i=1-Hr({startOfRange:t.maxScrollValueAt,endOfRange:t.startScrollingFrom,current:e}),s=r.maxPixelScroll*r.ease(i);return Math.ceil(s)},Qc=(e,t,n)=>{const r=n(),o=r.durationDampening.accelerateAt,i=r.durationDampening.stopDampeningAt,s=t,c=i,d=Date.now()-s;if(d>=i)return e;if(d<o)return kt;const p=Hr({startOfRange:o,endOfRange:c,current:d}),l=e*r.ease(p);return Math.ceil(l)},jr=({distanceToEdge:e,thresholds:t,dragStartTime:n,shouldUseTimeDampening:r,getAutoScrollerOptions:o})=>{const i=Zc(e,t,o);return i===0?0:r?Math.max(Qc(i,n,o),kt):i},zr=({container:e,distanceToEdges:t,dragStartTime:n,axis:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const s=Jc(e,r,i);return t[r.end]<t[r.start]?jr({distanceToEdge:t[r.end],thresholds:s,dragStartTime:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i}):-1*jr({distanceToEdge:t[r.start],thresholds:s,dragStartTime:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i})},ea=({container:e,subject:t,proposedScroll:n})=>{const r=t.height>e.height,o=t.width>e.width;return!o&&!r?n:o&&r?null:{x:o?0:n.x,y:r?0:n.y}};const ta=or(e=>e===0?0:e);var qr=({dragStartTime:e,container:t,subject:n,center:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const s={top:r.y-t.top,right:t.right-r.x,bottom:t.bottom-r.y,left:r.x-t.left},c=zr({container:t,distanceToEdges:s,dragStartTime:e,axis:Ot,shouldUseTimeDampening:o,getAutoScrollerOptions:i}),a=zr({container:t,distanceToEdges:s,dragStartTime:e,axis:dr,shouldUseTimeDampening:o,getAutoScrollerOptions:i}),d=ta({x:a,y:c});if(ne(d,L))return null;const p=ea({container:t,subject:n,proposedScroll:d});return p?ne(p,L)?null:p:null};const na=or(e=>e===0?0:e>0?1:-1),Wt=(()=>{const e=(t,n)=>t<0?t:t>n?t-n:0;return({current:t,max:n,change:r})=>{const o=$(t,r),i={x:e(o.x,n.x),y:e(o.y,n.y)};return ne(i,L)?null:i}})(),Yr=({max:e,current:t,change:n})=>{const r={x:Math.max(t.x,e.x),y:Math.max(t.y,e.y)},o=na(n),i=Wt({max:r,current:t,change:o});return!i||o.x!==0&&i.x===0||o.y!==0&&i.y===0},Ut=(e,t)=>Yr({current:e.scroll.current,max:e.scroll.max,change:t}),ra=(e,t)=>{if(!Ut(e,t))return null;const n=e.scroll.max,r=e.scroll.current;return Wt({current:r,max:n,change:t})},Ht=(e,t)=>{const n=e.frame;return n?Yr({current:n.scroll.current,max:n.scroll.max,change:t}):!1},oa=(e,t)=>{const n=e.frame;return!n||!Ht(e,t)?null:Wt({current:n.scroll.current,max:n.scroll.max,change:t})};var ia=({viewport:e,subject:t,center:n,dragStartTime:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const s=qr({dragStartTime:r,container:e.frame,subject:t,center:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i});return s&&Ut(e,s)?s:null},sa=({droppable:e,subject:t,center:n,dragStartTime:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const s=e.frame;if(!s)return null;const c=qr({dragStartTime:r,container:s.pageMarginBox,subject:t,center:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i});return c&&Ht(e,c)?c:null},Xr=({state:e,dragStartTime:t,shouldUseTimeDampening:n,scrollWindow:r,scrollDroppable:o,getAutoScrollerOptions:i})=>{const s=e.current.page.borderBoxCenter,a=e.dimensions.draggables[e.critical.draggable.id].page.marginBox;if(e.isWindowScrollAllowed){const l=e.viewport,u=ia({dragStartTime:t,viewport:l,subject:a,center:s,shouldUseTimeDampening:n,getAutoScrollerOptions:i});if(u){r(u);return}}const d=Kc({center:s,destination:W(e.impact),droppables:e.dimensions.droppables});if(!d)return;const p=sa({dragStartTime:t,droppable:d,subject:a,center:s,shouldUseTimeDampening:n,getAutoScrollerOptions:i});p&&o(d.descriptor.id,p)},ca=({scrollWindow:e,scrollDroppable:t,getAutoScrollerOptions:n=()=>Ce})=>{const r=me(e),o=me(t);let i=null;const s=d=>{i||(process.env.NODE_ENV!=="production"?f(!1,"Cannot fluid scroll if not dragging"):f());const{shouldUseTimeDampening:p,dragStartTime:l}=i;Xr({state:d,scrollWindow:r,scrollDroppable:o,dragStartTime:l,shouldUseTimeDampening:p,getAutoScrollerOptions:n})};return{start:d=>{xe(),i&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot start auto scrolling when already started"):f());const p=Date.now();let l=!1;const u=()=>{l=!0};Xr({state:d,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:u,scrollDroppable:u,getAutoScrollerOptions:n}),i={dragStartTime:p,shouldUseTimeDampening:l},Ie(),l&&s(d)},stop:()=>{i&&(r.cancel(),o.cancel(),i=null)},scroll:s}},aa=({move:e,scrollDroppable:t,scrollWindow:n})=>{const r=(c,a)=>{const d=$(c.current.client.selection,a);e({client:d})},o=(c,a)=>{if(!Ht(c,a))return a;const d=oa(c,a);if(!d)return t(c.descriptor.id,a),null;const p=k(a,d);return t(c.descriptor.id,p),k(a,p)},i=(c,a,d)=>{if(!c||!Ut(a,d))return d;const p=ra(a,d);if(!p)return n(d),null;const l=k(d,p);return n(l),k(d,l)};return c=>{const a=c.scrollJumpRequest;if(!a)return;const d=W(c.impact);d||(process.env.NODE_ENV!=="production"?f(!1,"Cannot perform a jump scroll when there is no destination"):f());const p=o(c.dimensions.droppables[d],a);if(!p)return;const l=c.viewport,u=i(c.isWindowScrollAllowed,l,p);u&&r(c,u)}},la=({scrollDroppable:e,scrollWindow:t,move:n,getAutoScrollerOptions:r})=>{const o=ca({scrollWindow:t,scrollDroppable:e,getAutoScrollerOptions:r}),i=aa({move:n,scrollWindow:t,scrollDroppable:e});return{scroll:a=>{if(!(r().disabled||a.phase!=="DRAGGING")){if(a.movementMode==="FLUID"){o.scroll(a);return}a.scrollJumpRequest&&i(a)}},start:o.start,stop:o.stop}};const ue="data-rfd",pe=(()=>{const e=`${ue}-drag-handle`;return{base:e,draggableId:`${e}-draggable-id`,contextId:`${e}-context-id`}})(),jt=(()=>{const e=`${ue}-draggable`;return{base:e,contextId:`${e}-context-id`,id:`${e}-id`}})(),da=(()=>{const e=`${ue}-droppable`;return{base:e,contextId:`${e}-context-id`,id:`${e}-id`}})(),Kr={contextId:`${ue}-scroll-container-context-id`},ua=e=>t=>`[${t}="${e}"]`,Ae=(e,t)=>e.map(n=>{const r=n.styles[t];return r?`${n.selector} { ${r} }`:""}).join(" "),pa="pointer-events: none;";var fa=e=>{const t=ua(e),n=(()=>{const c=`
86
+ `),0):(n-e)/r},kt=1,Zc=(e,t,n=()=>Ce)=>{const r=n();if(e>t.startScrollingFrom)return 0;if(e<=t.maxScrollValueAt)return r.maxPixelScroll;if(e===t.startScrollingFrom)return kt;const i=1-Hr({startOfRange:t.maxScrollValueAt,endOfRange:t.startScrollingFrom,current:e}),s=r.maxPixelScroll*r.ease(i);return Math.ceil(s)},Qc=(e,t,n)=>{const r=n(),o=r.durationDampening.accelerateAt,i=r.durationDampening.stopDampeningAt,s=t,c=i,d=Date.now()-s;if(d>=i)return e;if(d<o)return kt;const p=Hr({startOfRange:o,endOfRange:c,current:d}),l=e*r.ease(p);return Math.ceil(l)},jr=({distanceToEdge:e,thresholds:t,dragStartTime:n,shouldUseTimeDampening:r,getAutoScrollerOptions:o})=>{const i=Zc(e,t,o);return i===0?0:r?Math.max(Qc(i,n,o),kt):i},zr=({container:e,distanceToEdges:t,dragStartTime:n,axis:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const s=Jc(e,r,i);return t[r.end]<t[r.start]?jr({distanceToEdge:t[r.end],thresholds:s,dragStartTime:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i}):-1*jr({distanceToEdge:t[r.start],thresholds:s,dragStartTime:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i})},ea=({container:e,subject:t,proposedScroll:n})=>{const r=t.height>e.height,o=t.width>e.width;return!o&&!r?n:o&&r?null:{x:o?0:n.x,y:r?0:n.y}};const ta=or(e=>e===0?0:e);var qr=({dragStartTime:e,container:t,subject:n,center:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const s={top:r.y-t.top,right:t.right-r.x,bottom:t.bottom-r.y,left:r.x-t.left},c=zr({container:t,distanceToEdges:s,dragStartTime:e,axis:Ot,shouldUseTimeDampening:o,getAutoScrollerOptions:i}),a=zr({container:t,distanceToEdges:s,dragStartTime:e,axis:dr,shouldUseTimeDampening:o,getAutoScrollerOptions:i}),d=ta({x:a,y:c});if(ne(d,R))return null;const p=ea({container:t,subject:n,proposedScroll:d});return p?ne(p,R)?null:p:null};const na=or(e=>e===0?0:e>0?1:-1),Wt=(()=>{const e=(t,n)=>t<0?t:t>n?t-n:0;return({current:t,max:n,change:r})=>{const o=$(t,r),i={x:e(o.x,n.x),y:e(o.y,n.y)};return ne(i,R)?null:i}})(),Yr=({max:e,current:t,change:n})=>{const r={x:Math.max(t.x,e.x),y:Math.max(t.y,e.y)},o=na(n),i=Wt({max:r,current:t,change:o});return!i||o.x!==0&&i.x===0||o.y!==0&&i.y===0},Ut=(e,t)=>Yr({current:e.scroll.current,max:e.scroll.max,change:t}),ra=(e,t)=>{if(!Ut(e,t))return null;const n=e.scroll.max,r=e.scroll.current;return Wt({current:r,max:n,change:t})},Ht=(e,t)=>{const n=e.frame;return n?Yr({current:n.scroll.current,max:n.scroll.max,change:t}):!1},oa=(e,t)=>{const n=e.frame;return!n||!Ht(e,t)?null:Wt({current:n.scroll.current,max:n.scroll.max,change:t})};var ia=({viewport:e,subject:t,center:n,dragStartTime:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const s=qr({dragStartTime:r,container:e.frame,subject:t,center:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i});return s&&Ut(e,s)?s:null},sa=({droppable:e,subject:t,center:n,dragStartTime:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const s=e.frame;if(!s)return null;const c=qr({dragStartTime:r,container:s.pageMarginBox,subject:t,center:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i});return c&&Ht(e,c)?c:null},Xr=({state:e,dragStartTime:t,shouldUseTimeDampening:n,scrollWindow:r,scrollDroppable:o,getAutoScrollerOptions:i})=>{const s=e.current.page.borderBoxCenter,a=e.dimensions.draggables[e.critical.draggable.id].page.marginBox;if(e.isWindowScrollAllowed){const l=e.viewport,u=ia({dragStartTime:t,viewport:l,subject:a,center:s,shouldUseTimeDampening:n,getAutoScrollerOptions:i});if(u){r(u);return}}const d=Kc({center:s,destination:W(e.impact),droppables:e.dimensions.droppables});if(!d)return;const p=sa({dragStartTime:t,droppable:d,subject:a,center:s,shouldUseTimeDampening:n,getAutoScrollerOptions:i});p&&o(d.descriptor.id,p)},ca=({scrollWindow:e,scrollDroppable:t,getAutoScrollerOptions:n=()=>Ce})=>{const r=me(e),o=me(t);let i=null;const s=d=>{i||(process.env.NODE_ENV!=="production"?f(!1,"Cannot fluid scroll if not dragging"):f());const{shouldUseTimeDampening:p,dragStartTime:l}=i;Xr({state:d,scrollWindow:r,scrollDroppable:o,dragStartTime:l,shouldUseTimeDampening:p,getAutoScrollerOptions:n})};return{start:d=>{xe(),i&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot start auto scrolling when already started"):f());const p=Date.now();let l=!1;const u=()=>{l=!0};Xr({state:d,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:u,scrollDroppable:u,getAutoScrollerOptions:n}),i={dragStartTime:p,shouldUseTimeDampening:l},Ie(),l&&s(d)},stop:()=>{i&&(r.cancel(),o.cancel(),i=null)},scroll:s}},aa=({move:e,scrollDroppable:t,scrollWindow:n})=>{const r=(c,a)=>{const d=$(c.current.client.selection,a);e({client:d})},o=(c,a)=>{if(!Ht(c,a))return a;const d=oa(c,a);if(!d)return t(c.descriptor.id,a),null;const p=k(a,d);return t(c.descriptor.id,p),k(a,p)},i=(c,a,d)=>{if(!c||!Ut(a,d))return d;const p=ra(a,d);if(!p)return n(d),null;const l=k(d,p);return n(l),k(d,l)};return c=>{const a=c.scrollJumpRequest;if(!a)return;const d=W(c.impact);d||(process.env.NODE_ENV!=="production"?f(!1,"Cannot perform a jump scroll when there is no destination"):f());const p=o(c.dimensions.droppables[d],a);if(!p)return;const l=c.viewport,u=i(c.isWindowScrollAllowed,l,p);u&&r(c,u)}},la=({scrollDroppable:e,scrollWindow:t,move:n,getAutoScrollerOptions:r})=>{const o=ca({scrollWindow:t,scrollDroppable:e,getAutoScrollerOptions:r}),i=aa({move:n,scrollWindow:t,scrollDroppable:e});return{scroll:a=>{if(!(r().disabled||a.phase!=="DRAGGING")){if(a.movementMode==="FLUID"){o.scroll(a);return}a.scrollJumpRequest&&i(a)}},start:o.start,stop:o.stop}};const ue="data-rfd",pe=(()=>{const e=`${ue}-drag-handle`;return{base:e,draggableId:`${e}-draggable-id`,contextId:`${e}-context-id`}})(),jt=(()=>{const e=`${ue}-draggable`;return{base:e,contextId:`${e}-context-id`,id:`${e}-id`}})(),da=(()=>{const e=`${ue}-droppable`;return{base:e,contextId:`${e}-context-id`,id:`${e}-id`}})(),Kr={contextId:`${ue}-scroll-container-context-id`},ua=e=>t=>`[${t}="${e}"]`,Ae=(e,t)=>e.map(n=>{const r=n.styles[t];return r?`${n.selector} { ${r} }`:""}).join(" "),pa="pointer-events: none;";var fa=e=>{const t=ua(e),n=(()=>{const c=`
87
87
  cursor: -webkit-grab;
88
88
  cursor: grab;
89
89
  `;return{selector:t(pe.contextId),styles:{always:`
@@ -136,7 +136,7 @@ ${mn.current.stack}
136
136
  A setup problem was encountered.
137
137
 
138
138
  > ${n.message}
139
- `)}},t)})}function Aa(){Te(()=>{wa(Ia.react,E.version),Ca(document)},[])}function Jt(e){const t=E.useRef(e);return E.useEffect(()=>{t.current=e}),t}function _a(){let e=null;function t(){return!!e}function n(s){return s===e}function r(s){e&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot claim lock as it is already claimed"):f());const c={abandon:s};return e=c,c}function o(){e||(process.env.NODE_ENV!=="production"?f(!1,"Cannot release lock when there is no lock"):f()),e=null}function i(){e&&(e.abandon(),o())}return{isClaimed:t,isActive:n,claim:r,release:o,tryAbandon:i}}function Be(e){return e.phase==="IDLE"||e.phase==="DROP_ANIMATING"?!1:e.isDragging}const Pa=9,Ta=13,Zt=27,no=32,Ba=33,Va=34,Ra=35,La=36,Ma=37,$a=38,Ga=39,Fa=40,ka={[Ta]:!0,[Pa]:!0};var ro=e=>{ka[e.keyCode]&&e.preventDefault()};const Je=(()=>{const e="visibilitychange";return typeof document>"u"?e:[e,`ms${e}`,`webkit${e}`,`moz${e}`,`o${e}`].find(r=>`on${r}`in document)||e})(),oo=0,io=5;function Wa(e,t){return Math.abs(t.x-e.x)>=io||Math.abs(t.y-e.y)>=io}const so={type:"IDLE"};function Ua({cancel:e,completed:t,getPhase:n,setPhase:r}){return[{eventName:"mousemove",fn:o=>{const{button:i,clientX:s,clientY:c}=o;if(i!==oo)return;const a={x:s,y:c},d=n();if(d.type==="DRAGGING"){o.preventDefault(),d.actions.move(a);return}d.type!=="PENDING"&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot be IDLE"):f());const p=d.point;if(!Wa(p,a))return;o.preventDefault();const l=d.actions.fluidLift(a);r({type:"DRAGGING",actions:l})}},{eventName:"mouseup",fn:o=>{const i=n();if(i.type!=="DRAGGING"){e();return}o.preventDefault(),i.actions.drop({shouldBlockNextClick:!0}),t()}},{eventName:"mousedown",fn:o=>{n().type==="DRAGGING"&&o.preventDefault(),e()}},{eventName:"keydown",fn:o=>{if(n().type==="PENDING"){e();return}if(o.keyCode===Zt){o.preventDefault(),e();return}ro(o)}},{eventName:"resize",fn:e},{eventName:"scroll",options:{passive:!0,capture:!1},fn:()=>{n().type==="PENDING"&&e()}},{eventName:"webkitmouseforcedown",fn:o=>{const i=n();if(i.type==="IDLE"&&(process.env.NODE_ENV!=="production"?f(!1,"Unexpected phase"):f()),i.actions.shouldRespectForcePress()){e();return}o.preventDefault()}},{eventName:Je,fn:e}]}function Ha(e){const t=E.useRef(so),n=E.useRef(te),r=w(()=>({eventName:"mousedown",fn:function(l){if(l.defaultPrevented||l.button!==oo||l.ctrlKey||l.metaKey||l.shiftKey||l.altKey)return;const u=e.findClosestDraggableId(l);if(!u)return;const g=e.tryGetLock(u,s,{sourceEvent:l});if(!g)return;l.preventDefault();const m={x:l.clientX,y:l.clientY};n.current(),d(g,m)}}),[e]),o=w(()=>({eventName:"webkitmouseforcewillbegin",fn:p=>{if(p.defaultPrevented)return;const l=e.findClosestDraggableId(p);if(!l)return;const u=e.findOptionsForDraggable(l);u&&(u.shouldRespectForcePress||e.canGetLock(l)&&p.preventDefault())}}),[e]),i=x(function(){const l={passive:!1,capture:!0};n.current=Y(window,[o,r],l)},[o,r]),s=x(()=>{t.current.type!=="IDLE"&&(t.current=so,n.current(),i())},[i]),c=x(()=>{const p=t.current;s(),p.type==="DRAGGING"&&p.actions.cancel({shouldBlockNextClick:!0}),p.type==="PENDING"&&p.actions.abort()},[s]),a=x(function(){const l={capture:!0,passive:!1},u=Ua({cancel:c,completed:s,getPhase:()=>t.current,setPhase:g=>{t.current=g}});n.current=Y(window,u,l)},[c,s]),d=x(function(l,u){t.current.type!=="IDLE"&&(process.env.NODE_ENV!=="production"?f(!1,"Expected to move from IDLE to PENDING drag"):f()),t.current={type:"PENDING",point:u,actions:l},a()},[a]);U(function(){return i(),function(){n.current()}},[i])}function ja(){}const za={[Va]:!0,[Ba]:!0,[La]:!0,[Ra]:!0};function qa(e,t){function n(){t(),e.cancel()}function r(){t(),e.drop()}return[{eventName:"keydown",fn:o=>{if(o.keyCode===Zt){o.preventDefault(),n();return}if(o.keyCode===no){o.preventDefault(),r();return}if(o.keyCode===Fa){o.preventDefault(),e.moveDown();return}if(o.keyCode===$a){o.preventDefault(),e.moveUp();return}if(o.keyCode===Ga){o.preventDefault(),e.moveRight();return}if(o.keyCode===Ma){o.preventDefault(),e.moveLeft();return}if(za[o.keyCode]){o.preventDefault();return}ro(o)}},{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:Je,fn:n}]}function Ya(e){const t=E.useRef(ja),n=w(()=>({eventName:"keydown",fn:function(i){if(i.defaultPrevented||i.keyCode!==no)return;const s=e.findClosestDraggableId(i);if(!s)return;const c=e.tryGetLock(s,p,{sourceEvent:i});if(!c)return;i.preventDefault();let a=!0;const d=c.snapLift();t.current();function p(){a||(process.env.NODE_ENV!=="production"?f(!1,"Cannot stop capturing a keyboard drag when not capturing"):f()),a=!1,t.current(),r()}t.current=Y(window,qa(d,p),{capture:!0,passive:!1})}}),[e]),r=x(function(){const i={passive:!1,capture:!0};t.current=Y(window,[n],i)},[n]);U(function(){return r(),function(){t.current()}},[r])}const Qt={type:"IDLE"},Xa=120,Ka=.15;function Ja({cancel:e,getPhase:t}){return[{eventName:"orientationchange",fn:e},{eventName:"resize",fn:e},{eventName:"contextmenu",fn:n=>{n.preventDefault()}},{eventName:"keydown",fn:n=>{if(t().type!=="DRAGGING"){e();return}n.keyCode===Zt&&n.preventDefault(),e()}},{eventName:Je,fn:e}]}function Za({cancel:e,completed:t,getPhase:n}){return[{eventName:"touchmove",options:{capture:!1},fn:r=>{const o=n();if(o.type!=="DRAGGING"){e();return}o.hasMoved=!0;const{clientX:i,clientY:s}=r.touches[0],c={x:i,y:s};r.preventDefault(),o.actions.move(c)}},{eventName:"touchend",fn:r=>{const o=n();if(o.type!=="DRAGGING"){e();return}r.preventDefault(),o.actions.drop({shouldBlockNextClick:!0}),t()}},{eventName:"touchcancel",fn:r=>{if(n().type!=="DRAGGING"){e();return}r.preventDefault(),e()}},{eventName:"touchforcechange",fn:r=>{const o=n();o.type==="IDLE"&&(process.env.NODE_ENV,f());const i=r.touches[0];if(!i||!(i.force>=Ka))return;const c=o.actions.shouldRespectForcePress();if(o.type==="PENDING"){c&&e();return}if(c){if(o.hasMoved){r.preventDefault();return}e();return}r.preventDefault()}},{eventName:Je,fn:e}]}function Qa(e){const t=E.useRef(Qt),n=E.useRef(te),r=x(function(){return t.current},[]),o=x(function(g){t.current=g},[]),i=w(()=>({eventName:"touchstart",fn:function(g){if(g.defaultPrevented)return;const m=e.findClosestDraggableId(g);if(!m)return;const b=e.tryGetLock(m,c,{sourceEvent:g});if(!b)return;const h=g.touches[0],{clientX:y,clientY:v}=h,S={x:y,y:v};n.current(),l(b,S)}}),[e]),s=x(function(){const g={capture:!0,passive:!1};n.current=Y(window,[i],g)},[i]),c=x(()=>{const u=t.current;u.type!=="IDLE"&&(u.type==="PENDING"&&clearTimeout(u.longPressTimerId),o(Qt),n.current(),s())},[s,o]),a=x(()=>{const u=t.current;c(),u.type==="DRAGGING"&&u.actions.cancel({shouldBlockNextClick:!0}),u.type==="PENDING"&&u.actions.abort()},[c]),d=x(function(){const g={capture:!0,passive:!1},m={cancel:a,completed:c,getPhase:r},b=Y(window,Za(m),g),h=Y(window,Ja(m),g);n.current=function(){b(),h()}},[a,r,c]),p=x(function(){const g=r();g.type!=="PENDING"&&(process.env.NODE_ENV!=="production"?f(!1,`Cannot start dragging from phase ${g.type}`):f());const m=g.actions.fluidLift(g.point);o({type:"DRAGGING",actions:m,hasMoved:!1})},[r,o]),l=x(function(g,m){r().type!=="IDLE"&&(process.env.NODE_ENV!=="production"?f(!1,"Expected to move from IDLE to PENDING drag"):f());const b=setTimeout(p,Xa);o({type:"PENDING",point:m,actions:g,longPressTimerId:b}),d()},[d,r,o,p]);U(function(){return s(),function(){n.current();const m=r();m.type==="PENDING"&&(clearTimeout(m.longPressTimerId),o(Qt))}},[r,s,o]),U(function(){return Y(window,[{eventName:"touchmove",fn:()=>{},options:{capture:!1,passive:!1}}])},[])}function el(e){Kt(()=>{const t=Jt(e);Te(()=>{t.current.length!==e.length&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot change the amount of sensor hooks after mounting"):f(!1))})})}const tl=["input","button","textarea","select","option","optgroup","video","audio"];function co(e,t){if(t==null)return!1;if(tl.includes(t.tagName.toLowerCase()))return!0;const r=t.getAttribute("contenteditable");return r==="true"||r===""?!0:t===e?!1:co(e,t.parentElement)}function nl(e,t){const n=t.target;return _e(n)?co(e,n):!1}var rl=e=>K(e.getBoundingClientRect()).center;function ol(e){return e instanceof Qr(e).Element}const il=(()=>{const e="matches";return typeof document>"u"?e:[e,"msMatchesSelector","webkitMatchesSelector"].find(r=>r in Element.prototype)||e})();function ao(e,t){return e==null?null:e[il](t)?e:ao(e.parentElement,t)}function sl(e,t){return e.closest?e.closest(t):ao(e,t)}function cl(e){return`[${pe.contextId}="${e}"]`}function al(e,t){const n=t.target;if(!ol(n))return process.env.NODE_ENV!=="production"&&T("event.target must be a Element"),null;const r=cl(e),o=sl(n,r);return o?_e(o)?o:(process.env.NODE_ENV!=="production"&&T("drag handle must be a HTMLElement"),null):null}function ll(e,t){const n=al(e,t);return n?n.getAttribute(pe.draggableId):null}function dl(e,t){const n=`[${jt.contextId}="${e}"]`,o=Zr(document,n).find(i=>i.getAttribute(jt.id)===t);return o?_e(o)?o:(process.env.NODE_ENV!=="production"&&T("Draggable element is not a HTMLElement"),null):null}function ul(e){e.preventDefault()}function Ze({expected:e,phase:t,isLockActive:n,shouldWarn:r}){return n()?e!==t?(r&&process.env.NODE_ENV!=="production"&&T(`
139
+ `)}},t)})}function Aa(){Te(()=>{wa(Ia.react,E.version),Ca(document)},[])}function Jt(e){const t=E.useRef(e);return E.useEffect(()=>{t.current=e}),t}function _a(){let e=null;function t(){return!!e}function n(s){return s===e}function r(s){e&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot claim lock as it is already claimed"):f());const c={abandon:s};return e=c,c}function o(){e||(process.env.NODE_ENV!=="production"?f(!1,"Cannot release lock when there is no lock"):f()),e=null}function i(){e&&(e.abandon(),o())}return{isClaimed:t,isActive:n,claim:r,release:o,tryAbandon:i}}function Be(e){return e.phase==="IDLE"||e.phase==="DROP_ANIMATING"?!1:e.isDragging}const Pa=9,Ta=13,Zt=27,no=32,Ba=33,Va=34,La=35,Ra=36,Ma=37,$a=38,Ga=39,Fa=40,ka={[Ta]:!0,[Pa]:!0};var ro=e=>{ka[e.keyCode]&&e.preventDefault()};const Je=(()=>{const e="visibilitychange";return typeof document>"u"?e:[e,`ms${e}`,`webkit${e}`,`moz${e}`,`o${e}`].find(r=>`on${r}`in document)||e})(),oo=0,io=5;function Wa(e,t){return Math.abs(t.x-e.x)>=io||Math.abs(t.y-e.y)>=io}const so={type:"IDLE"};function Ua({cancel:e,completed:t,getPhase:n,setPhase:r}){return[{eventName:"mousemove",fn:o=>{const{button:i,clientX:s,clientY:c}=o;if(i!==oo)return;const a={x:s,y:c},d=n();if(d.type==="DRAGGING"){o.preventDefault(),d.actions.move(a);return}d.type!=="PENDING"&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot be IDLE"):f());const p=d.point;if(!Wa(p,a))return;o.preventDefault();const l=d.actions.fluidLift(a);r({type:"DRAGGING",actions:l})}},{eventName:"mouseup",fn:o=>{const i=n();if(i.type!=="DRAGGING"){e();return}o.preventDefault(),i.actions.drop({shouldBlockNextClick:!0}),t()}},{eventName:"mousedown",fn:o=>{n().type==="DRAGGING"&&o.preventDefault(),e()}},{eventName:"keydown",fn:o=>{if(n().type==="PENDING"){e();return}if(o.keyCode===Zt){o.preventDefault(),e();return}ro(o)}},{eventName:"resize",fn:e},{eventName:"scroll",options:{passive:!0,capture:!1},fn:()=>{n().type==="PENDING"&&e()}},{eventName:"webkitmouseforcedown",fn:o=>{const i=n();if(i.type==="IDLE"&&(process.env.NODE_ENV!=="production"?f(!1,"Unexpected phase"):f()),i.actions.shouldRespectForcePress()){e();return}o.preventDefault()}},{eventName:Je,fn:e}]}function Ha(e){const t=E.useRef(so),n=E.useRef(te),r=w(()=>({eventName:"mousedown",fn:function(l){if(l.defaultPrevented||l.button!==oo||l.ctrlKey||l.metaKey||l.shiftKey||l.altKey)return;const u=e.findClosestDraggableId(l);if(!u)return;const g=e.tryGetLock(u,s,{sourceEvent:l});if(!g)return;l.preventDefault();const m={x:l.clientX,y:l.clientY};n.current(),d(g,m)}}),[e]),o=w(()=>({eventName:"webkitmouseforcewillbegin",fn:p=>{if(p.defaultPrevented)return;const l=e.findClosestDraggableId(p);if(!l)return;const u=e.findOptionsForDraggable(l);u&&(u.shouldRespectForcePress||e.canGetLock(l)&&p.preventDefault())}}),[e]),i=x(function(){const l={passive:!1,capture:!0};n.current=Y(window,[o,r],l)},[o,r]),s=x(()=>{t.current.type!=="IDLE"&&(t.current=so,n.current(),i())},[i]),c=x(()=>{const p=t.current;s(),p.type==="DRAGGING"&&p.actions.cancel({shouldBlockNextClick:!0}),p.type==="PENDING"&&p.actions.abort()},[s]),a=x(function(){const l={capture:!0,passive:!1},u=Ua({cancel:c,completed:s,getPhase:()=>t.current,setPhase:g=>{t.current=g}});n.current=Y(window,u,l)},[c,s]),d=x(function(l,u){t.current.type!=="IDLE"&&(process.env.NODE_ENV!=="production"?f(!1,"Expected to move from IDLE to PENDING drag"):f()),t.current={type:"PENDING",point:u,actions:l},a()},[a]);U(function(){return i(),function(){n.current()}},[i])}function ja(){}const za={[Va]:!0,[Ba]:!0,[Ra]:!0,[La]:!0};function qa(e,t){function n(){t(),e.cancel()}function r(){t(),e.drop()}return[{eventName:"keydown",fn:o=>{if(o.keyCode===Zt){o.preventDefault(),n();return}if(o.keyCode===no){o.preventDefault(),r();return}if(o.keyCode===Fa){o.preventDefault(),e.moveDown();return}if(o.keyCode===$a){o.preventDefault(),e.moveUp();return}if(o.keyCode===Ga){o.preventDefault(),e.moveRight();return}if(o.keyCode===Ma){o.preventDefault(),e.moveLeft();return}if(za[o.keyCode]){o.preventDefault();return}ro(o)}},{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:Je,fn:n}]}function Ya(e){const t=E.useRef(ja),n=w(()=>({eventName:"keydown",fn:function(i){if(i.defaultPrevented||i.keyCode!==no)return;const s=e.findClosestDraggableId(i);if(!s)return;const c=e.tryGetLock(s,p,{sourceEvent:i});if(!c)return;i.preventDefault();let a=!0;const d=c.snapLift();t.current();function p(){a||(process.env.NODE_ENV!=="production"?f(!1,"Cannot stop capturing a keyboard drag when not capturing"):f()),a=!1,t.current(),r()}t.current=Y(window,qa(d,p),{capture:!0,passive:!1})}}),[e]),r=x(function(){const i={passive:!1,capture:!0};t.current=Y(window,[n],i)},[n]);U(function(){return r(),function(){t.current()}},[r])}const Qt={type:"IDLE"},Xa=120,Ka=.15;function Ja({cancel:e,getPhase:t}){return[{eventName:"orientationchange",fn:e},{eventName:"resize",fn:e},{eventName:"contextmenu",fn:n=>{n.preventDefault()}},{eventName:"keydown",fn:n=>{if(t().type!=="DRAGGING"){e();return}n.keyCode===Zt&&n.preventDefault(),e()}},{eventName:Je,fn:e}]}function Za({cancel:e,completed:t,getPhase:n}){return[{eventName:"touchmove",options:{capture:!1},fn:r=>{const o=n();if(o.type!=="DRAGGING"){e();return}o.hasMoved=!0;const{clientX:i,clientY:s}=r.touches[0],c={x:i,y:s};r.preventDefault(),o.actions.move(c)}},{eventName:"touchend",fn:r=>{const o=n();if(o.type!=="DRAGGING"){e();return}r.preventDefault(),o.actions.drop({shouldBlockNextClick:!0}),t()}},{eventName:"touchcancel",fn:r=>{if(n().type!=="DRAGGING"){e();return}r.preventDefault(),e()}},{eventName:"touchforcechange",fn:r=>{const o=n();o.type==="IDLE"&&(process.env.NODE_ENV,f());const i=r.touches[0];if(!i||!(i.force>=Ka))return;const c=o.actions.shouldRespectForcePress();if(o.type==="PENDING"){c&&e();return}if(c){if(o.hasMoved){r.preventDefault();return}e();return}r.preventDefault()}},{eventName:Je,fn:e}]}function Qa(e){const t=E.useRef(Qt),n=E.useRef(te),r=x(function(){return t.current},[]),o=x(function(g){t.current=g},[]),i=w(()=>({eventName:"touchstart",fn:function(g){if(g.defaultPrevented)return;const m=e.findClosestDraggableId(g);if(!m)return;const b=e.tryGetLock(m,c,{sourceEvent:g});if(!b)return;const h=g.touches[0],{clientX:y,clientY:v}=h,S={x:y,y:v};n.current(),l(b,S)}}),[e]),s=x(function(){const g={capture:!0,passive:!1};n.current=Y(window,[i],g)},[i]),c=x(()=>{const u=t.current;u.type!=="IDLE"&&(u.type==="PENDING"&&clearTimeout(u.longPressTimerId),o(Qt),n.current(),s())},[s,o]),a=x(()=>{const u=t.current;c(),u.type==="DRAGGING"&&u.actions.cancel({shouldBlockNextClick:!0}),u.type==="PENDING"&&u.actions.abort()},[c]),d=x(function(){const g={capture:!0,passive:!1},m={cancel:a,completed:c,getPhase:r},b=Y(window,Za(m),g),h=Y(window,Ja(m),g);n.current=function(){b(),h()}},[a,r,c]),p=x(function(){const g=r();g.type!=="PENDING"&&(process.env.NODE_ENV!=="production"?f(!1,`Cannot start dragging from phase ${g.type}`):f());const m=g.actions.fluidLift(g.point);o({type:"DRAGGING",actions:m,hasMoved:!1})},[r,o]),l=x(function(g,m){r().type!=="IDLE"&&(process.env.NODE_ENV!=="production"?f(!1,"Expected to move from IDLE to PENDING drag"):f());const b=setTimeout(p,Xa);o({type:"PENDING",point:m,actions:g,longPressTimerId:b}),d()},[d,r,o,p]);U(function(){return s(),function(){n.current();const m=r();m.type==="PENDING"&&(clearTimeout(m.longPressTimerId),o(Qt))}},[r,s,o]),U(function(){return Y(window,[{eventName:"touchmove",fn:()=>{},options:{capture:!1,passive:!1}}])},[])}function el(e){Kt(()=>{const t=Jt(e);Te(()=>{t.current.length!==e.length&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot change the amount of sensor hooks after mounting"):f(!1))})})}const tl=["input","button","textarea","select","option","optgroup","video","audio"];function co(e,t){if(t==null)return!1;if(tl.includes(t.tagName.toLowerCase()))return!0;const r=t.getAttribute("contenteditable");return r==="true"||r===""?!0:t===e?!1:co(e,t.parentElement)}function nl(e,t){const n=t.target;return _e(n)?co(e,n):!1}var rl=e=>K(e.getBoundingClientRect()).center;function ol(e){return e instanceof Qr(e).Element}const il=(()=>{const e="matches";return typeof document>"u"?e:[e,"msMatchesSelector","webkitMatchesSelector"].find(r=>r in Element.prototype)||e})();function ao(e,t){return e==null?null:e[il](t)?e:ao(e.parentElement,t)}function sl(e,t){return e.closest?e.closest(t):ao(e,t)}function cl(e){return`[${pe.contextId}="${e}"]`}function al(e,t){const n=t.target;if(!ol(n))return process.env.NODE_ENV!=="production"&&T("event.target must be a Element"),null;const r=cl(e),o=sl(n,r);return o?_e(o)?o:(process.env.NODE_ENV!=="production"&&T("drag handle must be a HTMLElement"),null):null}function ll(e,t){const n=al(e,t);return n?n.getAttribute(pe.draggableId):null}function dl(e,t){const n=`[${jt.contextId}="${e}"]`,o=Zr(document,n).find(i=>i.getAttribute(jt.id)===t);return o?_e(o)?o:(process.env.NODE_ENV!=="production"&&T("Draggable element is not a HTMLElement"),null):null}function ul(e){e.preventDefault()}function Ze({expected:e,phase:t,isLockActive:n,shouldWarn:r}){return n()?e!==t?(r&&process.env.NODE_ENV!=="production"&&T(`
140
140
  Cannot perform action.
141
141
  The actions you used belong to an outdated phase
142
142
 
@@ -154,13 +154,13 @@ ${mn.current.stack}
154
154
 
155
155
  - Throw away your action handlers when forceStop() is called
156
156
  - Check actions.isActive() if you really need to
157
- `),!1)}function lo({lockAPI:e,store:t,registry:n,draggableId:r}){if(e.isClaimed())return!1;const o=n.draggable.findById(r);return o?!(!o.options.isEnabled||!Ur(t.getState(),r)):(process.env.NODE_ENV!=="production"&&T(`Unable to find draggable with id: ${r}`),!1)}function pl({lockAPI:e,contextId:t,store:n,registry:r,draggableId:o,forceSensorStop:i,sourceEvent:s}){if(!lo({lockAPI:e,store:n,registry:r,draggableId:o}))return null;const a=r.draggable.getById(o),d=dl(t,a.descriptor.id);if(!d)return process.env.NODE_ENV!=="production"&&T(`Unable to find draggable element with id: ${o}`),null;if(s&&!a.options.canDragInteractiveElements&&nl(d,s))return null;const p=e.claim(i||te);let l="PRE_DRAG";function u(){return a.options.shouldRespectForcePress}function g(){return e.isActive(p)}function m(N,O){Ze({expected:N,phase:l,isLockActive:g,shouldWarn:!0})&&n.dispatch(O())}const b=m.bind(null,"DRAGGING");function h(N){function O(){e.release(),l="COMPLETED"}l!=="PRE_DRAG"&&(O(),process.env.NODE_ENV!=="production"?f(!1,`Cannot lift in phase ${l}`):f()),n.dispatch(Zs(N.liftActionArgs)),l="DRAGGING";function A(P,H={shouldBlockNextClick:!1}){if(N.cleanup(),H.shouldBlockNextClick){const V=Y(window,[{eventName:"click",fn:ul,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(V)}O(),n.dispatch(Tr({reason:P}))}return{isActive:()=>Ze({expected:"DRAGGING",phase:l,isLockActive:g,shouldWarn:!1}),shouldRespectForcePress:u,drop:P=>A("DROP",P),cancel:P=>A("CANCEL",P),...N.actions}}function y(N){const O=me(P=>{b(()=>Pr({client:P}))});return{...h({liftActionArgs:{id:o,clientSelection:N,movementMode:"FLUID"},cleanup:()=>O.cancel(),actions:{move:O}}),move:O}}function v(){const N={moveUp:()=>b(cc),moveRight:()=>b(lc),moveDown:()=>b(ac),moveLeft:()=>b(dc)};return h({liftActionArgs:{id:o,clientSelection:rl(d),movementMode:"SNAP"},cleanup:te,actions:N})}function S(){Ze({expected:"PRE_DRAG",phase:l,isLockActive:g,shouldWarn:!0})&&e.release()}return{isActive:()=>Ze({expected:"PRE_DRAG",phase:l,isLockActive:g,shouldWarn:!1}),shouldRespectForcePress:u,fluidLift:y,snapLift:v,abort:S}}const fl=[Ha,Ya,Qa];function gl({contextId:e,store:t,registry:n,customSensors:r,enableDefaultSensors:o}){const i=[...o?fl:[],...r||[]],s=E.useState(()=>_a())[0],c=x(function(h,y){Be(h)&&!Be(y)&&s.tryAbandon()},[s]);U(function(){let h=t.getState();return t.subscribe(()=>{const v=t.getState();c(h,v),h=v})},[s,t,c]),U(()=>s.tryAbandon,[s.tryAbandon]);const a=x(b=>lo({lockAPI:s,registry:n,store:t,draggableId:b}),[s,n,t]),d=x((b,h,y)=>pl({lockAPI:s,registry:n,contextId:e,store:t,draggableId:b,forceSensorStop:h||null,sourceEvent:y&&y.sourceEvent?y.sourceEvent:null}),[e,s,n,t]),p=x(b=>ll(e,b),[e]),l=x(b=>{const h=n.draggable.findById(b);return h?h.options:null},[n.draggable]),u=x(function(){s.isClaimed()&&(s.tryAbandon(),t.getState().phase!=="IDLE"&&t.dispatch(Vt()))},[s,t]),g=x(()=>s.isClaimed(),[s]),m=w(()=>({canGetLock:a,tryGetLock:d,findClosestDraggableId:p,findOptionsForDraggable:l,tryReleaseLock:u,isLockClaimed:g}),[a,d,p,l,u,g]);el(i);for(let b=0;b<i.length;b++)i[b](m)}const ml=e=>({onBeforeCapture:t=>{const n=()=>{e.onBeforeCapture&&e.onBeforeCapture(t)};rt.flushSync(n)},onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragEnd:e.onDragEnd,onDragUpdate:e.onDragUpdate}),hl=e=>({...Ce,...e.autoScrollerOptions,durationDampening:{...Ce.durationDampening,...e.autoScrollerOptions}});function Ve(e){return e.current||(process.env.NODE_ENV!=="production"?f(!1,"Could not find store from lazy ref"):f()),e.current}function bl(e){const{contextId:t,setCallbacks:n,sensors:r,nonce:o,dragHandleUsageInstructions:i}=e,s=E.useRef(null);Aa();const c=Jt(e),a=x(()=>ml(c.current),[c]),d=x(()=>hl(c.current),[c]),p=Ea(t),l=xa({contextId:t,text:i}),u=ga(t,o),g=x(V=>{Ve(s).dispatch(V)},[]),m=w(()=>Nn({publishWhileDragging:ec,updateDroppableScroll:nc,updateDroppableIsEnabled:rc,updateDroppableIsCombineEnabled:oc,collectionStarting:tc},g),[g]),b=ba(),h=w(()=>zc(b,m),[b,m]),y=w(()=>la({scrollWindow:qc,scrollDroppable:h.scrollDroppable,getAutoScrollerOptions:d,...Nn({move:Pr},g)}),[h.scrollDroppable,g,d]),v=ma(t),S=w(()=>Wc({announce:p,autoScroller:y,dimensionMarshal:h,focusMarshal:v,getResponders:a,styleMarshal:u}),[p,y,h,v,a,u]);process.env.NODE_ENV!=="production"&&s.current&&s.current!==S&&process.env.NODE_ENV!=="production"&&T("unexpected store change"),s.current=S;const I=x(()=>{const V=Ve(s);V.getState().phase!=="IDLE"&&V.dispatch(Vt())},[]),N=x(()=>{const V=Ve(s).getState();return V.phase==="DROP_ANIMATING"?!0:V.phase==="IDLE"?!1:V.isDragging},[]),O=w(()=>({isDragging:N,tryAbort:I}),[N,I]);n(O);const A=x(V=>Ur(Ve(s).getState(),V),[]),P=x(()=>se(Ve(s).getState()),[]),H=w(()=>({marshal:h,focus:v,contextId:t,canLift:A,isMovementAllowed:P,dragHandleUsageInstructionsId:l,registry:b}),[t,h,l,v,A,P,b]);return gl({contextId:t,store:S,registry:b,customSensors:r||null,enableDefaultSensors:e.enableDefaultSensors!==!1}),E.useEffect(()=>I,[I]),E.createElement(Ke.Provider,{value:H},E.createElement(_i,{context:qt,store:S},e.children))}function vl(){return E.useId()}function yl(e){const t=vl(),n=e.dragHandleUsageInstructions||Ue.dragHandleUsageInstructions;return E.createElement(Wi,null,r=>E.createElement(bl,{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 uo={dragging:5e3,dropAnimating:4500},El=(e,t)=>t?Se.drop(t.duration):e?Se.snap:Se.fluid,Dl=(e,t)=>{if(e)return t?Oe.opacity.drop:Oe.opacity.combining},Nl=e=>e.forceShouldAnimate!=null?e.forceShouldAnimate:e.mode==="SNAP";function xl(e){const n=e.dimension.client,{offset:r,combineWith:o,dropping:i}=e,s=!!o,c=Nl(e),a=!!i,d=a?Mt.drop(r,s):Mt.moveTo(r);return{position:"fixed",top:n.marginBox.top,left:n.marginBox.left,boxSizing:"border-box",width:n.borderBox.width,height:n.borderBox.height,transition:El(c,i),transform:d,opacity:Dl(s,a),zIndex:a?uo.dropAnimating:uo.dragging,pointerEvents:"none"}}function Il(e){return{transform:Mt.moveTo(e.offset),transition:e.shouldAnimateDisplacement?void 0:"none"}}function Ol(e){return e.type==="DRAGGING"?xl(e):Il(e)}function Sl(e,t,n=L){const r=window.getComputedStyle(t),o=t.getBoundingClientRect(),i=Yn(o,r),s=Fe(i,n),c={client:i,tagName:t.tagName.toLowerCase(),display:r.display},a={x:i.marginBox.width,y:i.marginBox.height};return{descriptor:e,placeholder:c,displaceBy:a,client:i,page:s}}function wl(e){const t=Yt("draggable"),{descriptor:n,registry:r,getDraggableRef:o,canDragInteractiveElements:i,shouldRespectForcePress:s,isEnabled:c}=e,a=w(()=>({canDragInteractiveElements:i,shouldRespectForcePress:s,isEnabled:c}),[i,c,s]),d=x(g=>{const m=o();return m||(process.env.NODE_ENV!=="production"?f(!1,"Cannot get dimension when no ref is set"):f()),Sl(n,m,g)},[n,o]),p=w(()=>({uniqueId:t,descriptor:n,options:a,getDimension:d}),[n,d,a,t]),l=E.useRef(p),u=E.useRef(!0);U(()=>(r.draggable.register(l.current),()=>r.draggable.unregister(l.current)),[r.draggable]),U(()=>{if(u.current){u.current=!1;return}const g=l.current;l.current=p,r.draggable.update(p,g)},[p,r.draggable])}var en=E.createContext(null);function po(e){e&&_e(e)||(process.env.NODE_ENV!=="production"?f(!1,`
157
+ `),!1)}function lo({lockAPI:e,store:t,registry:n,draggableId:r}){if(e.isClaimed())return!1;const o=n.draggable.findById(r);return o?!(!o.options.isEnabled||!Ur(t.getState(),r)):(process.env.NODE_ENV!=="production"&&T(`Unable to find draggable with id: ${r}`),!1)}function pl({lockAPI:e,contextId:t,store:n,registry:r,draggableId:o,forceSensorStop:i,sourceEvent:s}){if(!lo({lockAPI:e,store:n,registry:r,draggableId:o}))return null;const a=r.draggable.getById(o),d=dl(t,a.descriptor.id);if(!d)return process.env.NODE_ENV!=="production"&&T(`Unable to find draggable element with id: ${o}`),null;if(s&&!a.options.canDragInteractiveElements&&nl(d,s))return null;const p=e.claim(i||te);let l="PRE_DRAG";function u(){return a.options.shouldRespectForcePress}function g(){return e.isActive(p)}function m(N,O){Ze({expected:N,phase:l,isLockActive:g,shouldWarn:!0})&&n.dispatch(O())}const b=m.bind(null,"DRAGGING");function h(N){function O(){e.release(),l="COMPLETED"}l!=="PRE_DRAG"&&(O(),process.env.NODE_ENV!=="production"?f(!1,`Cannot lift in phase ${l}`):f()),n.dispatch(Zs(N.liftActionArgs)),l="DRAGGING";function A(P,H={shouldBlockNextClick:!1}){if(N.cleanup(),H.shouldBlockNextClick){const V=Y(window,[{eventName:"click",fn:ul,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(V)}O(),n.dispatch(Tr({reason:P}))}return{isActive:()=>Ze({expected:"DRAGGING",phase:l,isLockActive:g,shouldWarn:!1}),shouldRespectForcePress:u,drop:P=>A("DROP",P),cancel:P=>A("CANCEL",P),...N.actions}}function y(N){const O=me(P=>{b(()=>Pr({client:P}))});return{...h({liftActionArgs:{id:o,clientSelection:N,movementMode:"FLUID"},cleanup:()=>O.cancel(),actions:{move:O}}),move:O}}function v(){const N={moveUp:()=>b(cc),moveRight:()=>b(lc),moveDown:()=>b(ac),moveLeft:()=>b(dc)};return h({liftActionArgs:{id:o,clientSelection:rl(d),movementMode:"SNAP"},cleanup:te,actions:N})}function S(){Ze({expected:"PRE_DRAG",phase:l,isLockActive:g,shouldWarn:!0})&&e.release()}return{isActive:()=>Ze({expected:"PRE_DRAG",phase:l,isLockActive:g,shouldWarn:!1}),shouldRespectForcePress:u,fluidLift:y,snapLift:v,abort:S}}const fl=[Ha,Ya,Qa];function gl({contextId:e,store:t,registry:n,customSensors:r,enableDefaultSensors:o}){const i=[...o?fl:[],...r||[]],s=E.useState(()=>_a())[0],c=x(function(h,y){Be(h)&&!Be(y)&&s.tryAbandon()},[s]);U(function(){let h=t.getState();return t.subscribe(()=>{const v=t.getState();c(h,v),h=v})},[s,t,c]),U(()=>s.tryAbandon,[s.tryAbandon]);const a=x(b=>lo({lockAPI:s,registry:n,store:t,draggableId:b}),[s,n,t]),d=x((b,h,y)=>pl({lockAPI:s,registry:n,contextId:e,store:t,draggableId:b,forceSensorStop:h||null,sourceEvent:y&&y.sourceEvent?y.sourceEvent:null}),[e,s,n,t]),p=x(b=>ll(e,b),[e]),l=x(b=>{const h=n.draggable.findById(b);return h?h.options:null},[n.draggable]),u=x(function(){s.isClaimed()&&(s.tryAbandon(),t.getState().phase!=="IDLE"&&t.dispatch(Vt()))},[s,t]),g=x(()=>s.isClaimed(),[s]),m=w(()=>({canGetLock:a,tryGetLock:d,findClosestDraggableId:p,findOptionsForDraggable:l,tryReleaseLock:u,isLockClaimed:g}),[a,d,p,l,u,g]);el(i);for(let b=0;b<i.length;b++)i[b](m)}const ml=e=>({onBeforeCapture:t=>{const n=()=>{e.onBeforeCapture&&e.onBeforeCapture(t)};rt.flushSync(n)},onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragEnd:e.onDragEnd,onDragUpdate:e.onDragUpdate}),hl=e=>({...Ce,...e.autoScrollerOptions,durationDampening:{...Ce.durationDampening,...e.autoScrollerOptions}});function Ve(e){return e.current||(process.env.NODE_ENV!=="production"?f(!1,"Could not find store from lazy ref"):f()),e.current}function bl(e){const{contextId:t,setCallbacks:n,sensors:r,nonce:o,dragHandleUsageInstructions:i}=e,s=E.useRef(null);Aa();const c=Jt(e),a=x(()=>ml(c.current),[c]),d=x(()=>hl(c.current),[c]),p=Ea(t),l=xa({contextId:t,text:i}),u=ga(t,o),g=x(V=>{Ve(s).dispatch(V)},[]),m=w(()=>Nn({publishWhileDragging:ec,updateDroppableScroll:nc,updateDroppableIsEnabled:rc,updateDroppableIsCombineEnabled:oc,collectionStarting:tc},g),[g]),b=ba(),h=w(()=>zc(b,m),[b,m]),y=w(()=>la({scrollWindow:qc,scrollDroppable:h.scrollDroppable,getAutoScrollerOptions:d,...Nn({move:Pr},g)}),[h.scrollDroppable,g,d]),v=ma(t),S=w(()=>Wc({announce:p,autoScroller:y,dimensionMarshal:h,focusMarshal:v,getResponders:a,styleMarshal:u}),[p,y,h,v,a,u]);process.env.NODE_ENV!=="production"&&s.current&&s.current!==S&&process.env.NODE_ENV!=="production"&&T("unexpected store change"),s.current=S;const I=x(()=>{const V=Ve(s);V.getState().phase!=="IDLE"&&V.dispatch(Vt())},[]),N=x(()=>{const V=Ve(s).getState();return V.phase==="DROP_ANIMATING"?!0:V.phase==="IDLE"?!1:V.isDragging},[]),O=w(()=>({isDragging:N,tryAbort:I}),[N,I]);n(O);const A=x(V=>Ur(Ve(s).getState(),V),[]),P=x(()=>se(Ve(s).getState()),[]),H=w(()=>({marshal:h,focus:v,contextId:t,canLift:A,isMovementAllowed:P,dragHandleUsageInstructionsId:l,registry:b}),[t,h,l,v,A,P,b]);return gl({contextId:t,store:S,registry:b,customSensors:r||null,enableDefaultSensors:e.enableDefaultSensors!==!1}),E.useEffect(()=>I,[I]),E.createElement(Ke.Provider,{value:H},E.createElement(_i,{context:qt,store:S},e.children))}function vl(){return E.useId()}function yl(e){const t=vl(),n=e.dragHandleUsageInstructions||Ue.dragHandleUsageInstructions;return E.createElement(Wi,null,r=>E.createElement(bl,{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 uo={dragging:5e3,dropAnimating:4500},El=(e,t)=>t?Se.drop(t.duration):e?Se.snap:Se.fluid,Dl=(e,t)=>{if(e)return t?Oe.opacity.drop:Oe.opacity.combining},Nl=e=>e.forceShouldAnimate!=null?e.forceShouldAnimate:e.mode==="SNAP";function xl(e){const n=e.dimension.client,{offset:r,combineWith:o,dropping:i}=e,s=!!o,c=Nl(e),a=!!i,d=a?Mt.drop(r,s):Mt.moveTo(r);return{position:"fixed",top:n.marginBox.top,left:n.marginBox.left,boxSizing:"border-box",width:n.borderBox.width,height:n.borderBox.height,transition:El(c,i),transform:d,opacity:Dl(s,a),zIndex:a?uo.dropAnimating:uo.dragging,pointerEvents:"none"}}function Il(e){return{transform:Mt.moveTo(e.offset),transition:e.shouldAnimateDisplacement?void 0:"none"}}function Ol(e){return e.type==="DRAGGING"?xl(e):Il(e)}function Sl(e,t,n=R){const r=window.getComputedStyle(t),o=t.getBoundingClientRect(),i=Yn(o,r),s=Fe(i,n),c={client:i,tagName:t.tagName.toLowerCase(),display:r.display},a={x:i.marginBox.width,y:i.marginBox.height};return{descriptor:e,placeholder:c,displaceBy:a,client:i,page:s}}function wl(e){const t=Yt("draggable"),{descriptor:n,registry:r,getDraggableRef:o,canDragInteractiveElements:i,shouldRespectForcePress:s,isEnabled:c}=e,a=w(()=>({canDragInteractiveElements:i,shouldRespectForcePress:s,isEnabled:c}),[i,c,s]),d=x(g=>{const m=o();return m||(process.env.NODE_ENV!=="production"?f(!1,"Cannot get dimension when no ref is set"):f()),Sl(n,m,g)},[n,o]),p=w(()=>({uniqueId:t,descriptor:n,options:a,getDimension:d}),[n,d,a,t]),l=E.useRef(p),u=E.useRef(!0);U(()=>(r.draggable.register(l.current),()=>r.draggable.unregister(l.current)),[r.draggable]),U(()=>{if(u.current){u.current=!1;return}const g=l.current;l.current=p,r.draggable.update(p,g)},[p,r.draggable])}var en=E.createContext(null);function po(e){e&&_e(e)||(process.env.NODE_ENV!=="production"?f(!1,`
158
158
  provided.innerRef has not been provided with a HTMLElement.
159
159
 
160
160
  You can find a guide on using the innerRef callback functions at:
161
161
  https://github.com/hello-pangea/dnd/blob/main/docs/guides/using-inner-ref.md
162
162
  `):f())}function Cl(e,t,n){Te(()=>{function r(i){return`Draggable[id: ${i}]: `}const o=e.draggableId;o||(process.env.NODE_ENV!=="production"?f(!1,"Draggable requires a draggableId"):f(!1)),typeof o!="string"&&(process.env.NODE_ENV!=="production"?f(!1,`Draggable requires a [string] draggableId.
163
- Provided: [type: ${typeof o}] (value: ${o})`):f(!1)),Number.isInteger(e.index)||(process.env.NODE_ENV!=="production"?f(!1,`${r(o)} requires an integer index prop`):f(!1)),e.mapped.type!=="DRAGGING"&&(po(n()),e.isEnabled&&(eo(t,o)||(process.env.NODE_ENV!=="production"?f(!1,`${r(o)} Unable to find drag handle`):f(!1))))})}function Al(e){Kt(()=>{const t=E.useRef(e);Te(()=>{e!==t.current&&(process.env.NODE_ENV!=="production"?f(!1,"Draggable isClone prop value changed during component life"):f(!1))},[e])})}function Qe(e){const t=E.useContext(e);return t||(process.env.NODE_ENV!=="production"?f(!1,"Could not find required context"):f()),t}function _l(e){e.preventDefault()}const Pl=e=>{const t=E.useRef(null),n=x((O=null)=>{t.current=O},[]),r=x(()=>t.current,[]),{contextId:o,dragHandleUsageInstructionsId:i,registry:s}=Qe(Ke),{type:c,droppableId:a}=Qe(en),d=w(()=>({id:e.draggableId,index:e.index,type:c,droppableId:a}),[e.draggableId,e.index,c,a]),{children:p,draggableId:l,isEnabled:u,shouldRespectForcePress:g,canDragInteractiveElements:m,isClone:b,mapped:h,dropAnimationFinished:y}=e;if(Cl(e,o,r),Al(b),!b){const O=w(()=>({descriptor:d,registry:s,getDraggableRef:r,canDragInteractiveElements:m,shouldRespectForcePress:g,isEnabled:u}),[d,s,r,m,g,u]);wl(O)}const v=w(()=>u?{tabIndex:0,role:"button","aria-describedby":i,"data-rfd-drag-handle-draggable-id":l,"data-rfd-drag-handle-context-id":o,draggable:!1,onDragStart:_l}:null,[o,i,l,u]),S=x(O=>{h.type==="DRAGGING"&&h.dropping&&O.propertyName==="transform"&&rt.flushSync(y)},[y,h]),I=w(()=>{const O=Ol(h),A=h.type==="DRAGGING"&&h.dropping?S:void 0;return{innerRef:n,draggableProps:{"data-rfd-draggable-context-id":o,"data-rfd-draggable-id":l,style:O,onTransitionEnd:A},dragHandleProps:v}},[o,v,l,h,S,n]),N=w(()=>({draggableId:d.id,type:d.type,source:{index:d.index,droppableId:d.droppableId}}),[d.droppableId,d.id,d.index,d.type]);return E.createElement(E.Fragment,null,p(I,h.snapshot,N))};var fo=(e,t)=>e===t,go=e=>{const{combine:t,destination:n}=e;return n?n.droppableId:t?t.droppableId:null};const Tl=e=>e.combine?e.combine.draggableId:null,Bl=e=>e.at&&e.at.type==="COMBINE"?e.at.combine.draggableId:null;function Vl(){const e=M((o,i)=>({x:o,y:i})),t=M((o,i,s=null,c=null,a=null)=>({isDragging:!0,isClone:i,isDropAnimating:!!a,dropAnimation:a,mode:o,draggingOver:s,combineWith:c,combineTargetFor:null})),n=M((o,i,s,c,a=null,d=null,p=null)=>({mapped:{type:"DRAGGING",dropping:null,draggingOver:a,combineWith:d,mode:i,offset:o,dimension:s,forceShouldAnimate:p,snapshot:t(i,c,a,d,null)}}));return(o,i)=>{if(Be(o)){if(o.critical.draggable.id!==i.draggableId)return null;const s=o.current.client.offset,c=o.dimensions.draggables[i.draggableId],a=W(o.impact),d=Bl(o.impact),p=o.forceShouldAnimate;return n(e(s.x,s.y),o.movementMode,c,i.isClone,a,d,p)}if(o.phase==="DROP_ANIMATING"){const s=o.completed;if(s.result.draggableId!==i.draggableId)return null;const c=i.isClone,a=o.dimensions.draggables[i.draggableId],d=s.result,p=d.mode,l=go(d),u=Tl(d),m={duration:o.dropDuration,curve:Lt.drop,moveTo:o.newHomeClientOffset,opacity:u?Oe.opacity.drop:null,scale:u?Oe.scale.drop:null};return{mapped:{type:"DRAGGING",offset:o.newHomeClientOffset,dimension:a,dropping:m,draggingOver:l,combineWith:u,mode:p,forceShouldAnimate:null,snapshot:t(p,c,l,u,m)}}}return null}}function mo(e=null){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:e,combineWith:null}}const Rl={mapped:{type:"SECONDARY",offset:L,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:mo(null)}};function Ll(){const e=M((s,c)=>({x:s,y:c})),t=M(mo),n=M((s,c=null,a)=>({mapped:{type:"SECONDARY",offset:s,combineTargetFor:c,shouldAnimateDisplacement:a,snapshot:t(c)}})),r=s=>s?n(L,s,!0):null,o=(s,c,a,d)=>{const p=a.displaced.visible[s],l=!!(d.inVirtualList&&d.effected[s]),u=je(a),g=u&&u.draggableId===s?c:null;if(!p){if(!l)return r(g);if(a.displaced.invisible[s])return null;const h=ae(d.displacedBy.point),y=e(h.x,h.y);return n(y,g,!0)}if(l)return r(g);const m=a.displacedBy.point,b=e(m.x,m.y);return n(b,g,p.shouldAnimate)};return(s,c)=>{if(Be(s))return s.critical.draggable.id===c.draggableId?null:o(c.draggableId,s.critical.draggable.id,s.impact,s.afterCritical);if(s.phase==="DROP_ANIMATING"){const a=s.completed;return a.result.draggableId===c.draggableId?null:o(c.draggableId,a.result.draggableId,a.impact,a.afterCritical)}return null}}const Ml=jn(()=>{const e=Vl(),t=Ll();return(r,o)=>e(r,o)||t(r,o)||Rl},{dropAnimationFinished:Br},null,{context:qt,areStatePropsEqual:fo})(Pl);function ho(e){return Qe(en).isUsingCloneFor===e.draggableId&&!e.isClone?null:E.createElement(Ml,e)}function $l(e){const t=typeof e.isDragDisabled=="boolean"?!e.isDragDisabled:!0,n=!!e.disableInteractiveElementBlocking,r=!!e.shouldRespectForcePress;return E.createElement(ho,ke({},e,{isClone:!1,isEnabled:t,canDragInteractiveElements:n,shouldRespectForcePress:r}))}const tn=e=>t=>e===t,Gl=tn("scroll"),Fl=tn("auto"),kl=tn("visible"),bo=(e,t)=>t(e.overflowX)||t(e.overflowY),Wl=(e,t)=>t(e.overflowX)&&t(e.overflowY),vo=e=>{const t=window.getComputedStyle(e),n={overflowX:t.overflowX,overflowY:t.overflowY};return bo(n,Gl)||bo(n,Fl)},Ul=()=>{if(process.env.NODE_ENV==="production")return!1;const e=Pe(),t=document.documentElement;if(t||(process.env.NODE_ENV,f()),!vo(e))return!1;const n=window.getComputedStyle(t),r={overflowX:n.overflowX,overflowY:n.overflowY};return Wl(r,kl)||process.env.NODE_ENV!=="production"&&T(`
163
+ Provided: [type: ${typeof o}] (value: ${o})`):f(!1)),Number.isInteger(e.index)||(process.env.NODE_ENV!=="production"?f(!1,`${r(o)} requires an integer index prop`):f(!1)),e.mapped.type!=="DRAGGING"&&(po(n()),e.isEnabled&&(eo(t,o)||(process.env.NODE_ENV!=="production"?f(!1,`${r(o)} Unable to find drag handle`):f(!1))))})}function Al(e){Kt(()=>{const t=E.useRef(e);Te(()=>{e!==t.current&&(process.env.NODE_ENV!=="production"?f(!1,"Draggable isClone prop value changed during component life"):f(!1))},[e])})}function Qe(e){const t=E.useContext(e);return t||(process.env.NODE_ENV!=="production"?f(!1,"Could not find required context"):f()),t}function _l(e){e.preventDefault()}const Pl=e=>{const t=E.useRef(null),n=x((O=null)=>{t.current=O},[]),r=x(()=>t.current,[]),{contextId:o,dragHandleUsageInstructionsId:i,registry:s}=Qe(Ke),{type:c,droppableId:a}=Qe(en),d=w(()=>({id:e.draggableId,index:e.index,type:c,droppableId:a}),[e.draggableId,e.index,c,a]),{children:p,draggableId:l,isEnabled:u,shouldRespectForcePress:g,canDragInteractiveElements:m,isClone:b,mapped:h,dropAnimationFinished:y}=e;if(Cl(e,o,r),Al(b),!b){const O=w(()=>({descriptor:d,registry:s,getDraggableRef:r,canDragInteractiveElements:m,shouldRespectForcePress:g,isEnabled:u}),[d,s,r,m,g,u]);wl(O)}const v=w(()=>u?{tabIndex:0,role:"button","aria-describedby":i,"data-rfd-drag-handle-draggable-id":l,"data-rfd-drag-handle-context-id":o,draggable:!1,onDragStart:_l}:null,[o,i,l,u]),S=x(O=>{h.type==="DRAGGING"&&h.dropping&&O.propertyName==="transform"&&rt.flushSync(y)},[y,h]),I=w(()=>{const O=Ol(h),A=h.type==="DRAGGING"&&h.dropping?S:void 0;return{innerRef:n,draggableProps:{"data-rfd-draggable-context-id":o,"data-rfd-draggable-id":l,style:O,onTransitionEnd:A},dragHandleProps:v}},[o,v,l,h,S,n]),N=w(()=>({draggableId:d.id,type:d.type,source:{index:d.index,droppableId:d.droppableId}}),[d.droppableId,d.id,d.index,d.type]);return E.createElement(E.Fragment,null,p(I,h.snapshot,N))};var fo=(e,t)=>e===t,go=e=>{const{combine:t,destination:n}=e;return n?n.droppableId:t?t.droppableId:null};const Tl=e=>e.combine?e.combine.draggableId:null,Bl=e=>e.at&&e.at.type==="COMBINE"?e.at.combine.draggableId:null;function Vl(){const e=M((o,i)=>({x:o,y:i})),t=M((o,i,s=null,c=null,a=null)=>({isDragging:!0,isClone:i,isDropAnimating:!!a,dropAnimation:a,mode:o,draggingOver:s,combineWith:c,combineTargetFor:null})),n=M((o,i,s,c,a=null,d=null,p=null)=>({mapped:{type:"DRAGGING",dropping:null,draggingOver:a,combineWith:d,mode:i,offset:o,dimension:s,forceShouldAnimate:p,snapshot:t(i,c,a,d,null)}}));return(o,i)=>{if(Be(o)){if(o.critical.draggable.id!==i.draggableId)return null;const s=o.current.client.offset,c=o.dimensions.draggables[i.draggableId],a=W(o.impact),d=Bl(o.impact),p=o.forceShouldAnimate;return n(e(s.x,s.y),o.movementMode,c,i.isClone,a,d,p)}if(o.phase==="DROP_ANIMATING"){const s=o.completed;if(s.result.draggableId!==i.draggableId)return null;const c=i.isClone,a=o.dimensions.draggables[i.draggableId],d=s.result,p=d.mode,l=go(d),u=Tl(d),m={duration:o.dropDuration,curve:Rt.drop,moveTo:o.newHomeClientOffset,opacity:u?Oe.opacity.drop:null,scale:u?Oe.scale.drop:null};return{mapped:{type:"DRAGGING",offset:o.newHomeClientOffset,dimension:a,dropping:m,draggingOver:l,combineWith:u,mode:p,forceShouldAnimate:null,snapshot:t(p,c,l,u,m)}}}return null}}function mo(e=null){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:e,combineWith:null}}const Ll={mapped:{type:"SECONDARY",offset:R,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:mo(null)}};function Rl(){const e=M((s,c)=>({x:s,y:c})),t=M(mo),n=M((s,c=null,a)=>({mapped:{type:"SECONDARY",offset:s,combineTargetFor:c,shouldAnimateDisplacement:a,snapshot:t(c)}})),r=s=>s?n(R,s,!0):null,o=(s,c,a,d)=>{const p=a.displaced.visible[s],l=!!(d.inVirtualList&&d.effected[s]),u=je(a),g=u&&u.draggableId===s?c:null;if(!p){if(!l)return r(g);if(a.displaced.invisible[s])return null;const h=ae(d.displacedBy.point),y=e(h.x,h.y);return n(y,g,!0)}if(l)return r(g);const m=a.displacedBy.point,b=e(m.x,m.y);return n(b,g,p.shouldAnimate)};return(s,c)=>{if(Be(s))return s.critical.draggable.id===c.draggableId?null:o(c.draggableId,s.critical.draggable.id,s.impact,s.afterCritical);if(s.phase==="DROP_ANIMATING"){const a=s.completed;return a.result.draggableId===c.draggableId?null:o(c.draggableId,a.result.draggableId,a.impact,a.afterCritical)}return null}}const Ml=jn(()=>{const e=Vl(),t=Rl();return(r,o)=>e(r,o)||t(r,o)||Ll},{dropAnimationFinished:Br},null,{context:qt,areStatePropsEqual:fo})(Pl);function ho(e){return Qe(en).isUsingCloneFor===e.draggableId&&!e.isClone?null:E.createElement(Ml,e)}function $l(e){const t=typeof e.isDragDisabled=="boolean"?!e.isDragDisabled:!0,n=!!e.disableInteractiveElementBlocking,r=!!e.shouldRespectForcePress;return E.createElement(ho,ke({},e,{isClone:!1,isEnabled:t,canDragInteractiveElements:n,shouldRespectForcePress:r}))}const tn=e=>t=>e===t,Gl=tn("scroll"),Fl=tn("auto"),kl=tn("visible"),bo=(e,t)=>t(e.overflowX)||t(e.overflowY),Wl=(e,t)=>t(e.overflowX)&&t(e.overflowY),vo=e=>{const t=window.getComputedStyle(e),n={overflowX:t.overflowX,overflowY:t.overflowY};return bo(n,Gl)||bo(n,Fl)},Ul=()=>{if(process.env.NODE_ENV==="production")return!1;const e=Pe(),t=document.documentElement;if(t||(process.env.NODE_ENV,f()),!vo(e))return!1;const n=window.getComputedStyle(t),r={overflowX:n.overflowX,overflowY:n.overflowY};return Wl(r,kl)||process.env.NODE_ENV!=="production"&&T(`
164
164
  We have detected that your <body> element might be a scroll container.
165
165
  We have found no reliable way of detecting whether the <body> element is a scroll container.
166
166
  Under most circumstances a <body> scroll bar will be on the <html> element (document.documentElement)
@@ -175,10 +175,10 @@ ${mn.current.stack}
175
175
  Nested scroll containers are currently not supported.
176
176
 
177
177
  We hope to support nested scroll containers soon: https://github.com/atlassian/react-beautiful-dnd/issues/131
178
- `)},rn=e=>({x:e.scrollLeft,y:e.scrollTop});const yo=e=>e?window.getComputedStyle(e).position==="fixed"?!0:yo(e.parentElement):!1;var jl=e=>{const t=nn(e),n=yo(e);return{closestScrollable:t,isFixedOnPage:n}},zl=({descriptor:e,isEnabled:t,isCombineEnabled:n,isFixedOnPage:r,direction:o,client:i,page:s,closest:c})=>{const a=(()=>{if(!c)return null;const{scrollSize:u,client:g}=c,m=Gr({scrollHeight:u.scrollHeight,scrollWidth:u.scrollWidth,height:g.paddingBox.height,width:g.paddingBox.width});return{pageMarginBox:c.page.marginBox,frameClient:g,scrollSize:u,shouldClipSubject:c.shouldClipSubject,scroll:{initial:c.scroll,current:c.scroll,max:m,diff:{value:L,displacement:L}}}})(),d=o==="vertical"?Ot:dr,p=le({page:s,withPlaceholder:null,axis:d,frame:a});return{descriptor:e,isCombineEnabled:n,isFixedOnPage:r,axis:d,isEnabled:t,client:i,page:s,frame:a,subject:p}};const ql=(e,t)=>{const n=Xn(e);if(!t||e!==t)return n;const r=n.paddingBox.top-t.scrollTop,o=n.paddingBox.left-t.scrollLeft,i=r+t.scrollHeight,s=o+t.scrollWidth,a=yt({top:r,right:s,bottom:i,left:o},n.border);return Dt({borderBox:a,margin:n.margin,border:n.border,padding:n.padding})};var Yl=({ref:e,descriptor:t,env:n,windowScroll:r,direction:o,isDropDisabled:i,isCombineEnabled:s,shouldClipSubject:c})=>{const a=n.closestScrollable,d=ql(e,a),p=Fe(d,r),l=(()=>{if(!a)return null;const g=Xn(a),m={scrollHeight:a.scrollHeight,scrollWidth:a.scrollWidth};return{client:g,page:Fe(g,r),scroll:rn(a),scrollSize:m,shouldClipSubject:c}})();return zl({descriptor:t,isEnabled:!i,isCombineEnabled:s,isFixedOnPage:n.isFixedOnPage,direction:o,client:d,page:p,closest:l})};const Xl={passive:!1},Kl={passive:!0};var Eo=e=>e.shouldPublishImmediately?Xl:Kl;const et=e=>e&&e.env.closestScrollable||null;function Jl(e){const t=E.useRef(null),n=Qe(Ke),r=Yt("droppable"),{registry:o,marshal:i}=n,s=Jt(e),c=w(()=>({id:e.droppableId,type:e.type,mode:e.mode}),[e.droppableId,e.mode,e.type]),a=E.useRef(c),d=w(()=>M((I,N)=>{t.current||(process.env.NODE_ENV!=="production"?f(!1,"Can only update scroll when dragging"):f());const O={x:I,y:N};i.updateDroppableScroll(c.id,O)}),[c.id,i]),p=x(()=>{const I=t.current;return!I||!I.env.closestScrollable?L:rn(I.env.closestScrollable)},[]),l=x(()=>{const I=p();d(I.x,I.y)},[p,d]),u=w(()=>me(l),[l]),g=x(()=>{const I=t.current,N=et(I);if(I&&N||(process.env.NODE_ENV!=="production"?f(!1,"Could not find scroll options while scrolling"):f()),I.scrollOptions.shouldPublishImmediately){l();return}u()},[u,l]),m=x((I,N)=>{t.current&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot collect a droppable while a drag is occurring"):f());const O=s.current,A=O.getDroppableRef();A||(process.env.NODE_ENV!=="production"?f(!1,"Cannot collect without a droppable ref"):f());const P=jl(A),H={ref:A,descriptor:c,env:P,scrollOptions:N};t.current=H;const V=Yl({ref:A,descriptor:c,env:P,windowScroll:I,direction:O.direction,isDropDisabled:O.isDropDisabled,isCombineEnabled:O.isCombineEnabled,shouldClipSubject:!O.ignoreContainerClipping}),j=P.closestScrollable;return j&&(j.setAttribute(Kr.contextId,n.contextId),j.addEventListener("scroll",g,Eo(H.scrollOptions)),process.env.NODE_ENV!=="production"&&Hl(j)),V},[n.contextId,c,g,s]),b=x(()=>{const I=t.current,N=et(I);return I&&N||(process.env.NODE_ENV!=="production"?f(!1,"Can only recollect Droppable client for Droppables that have a scroll container"):f()),rn(N)},[]),h=x(()=>{const I=t.current;I||(process.env.NODE_ENV!=="production"?f(!1,"Cannot stop drag when no active drag"):f());const N=et(I);t.current=null,N&&(u.cancel(),N.removeAttribute(Kr.contextId),N.removeEventListener("scroll",g,Eo(I.scrollOptions)))},[g,u]),y=x(I=>{const N=t.current;N||(process.env.NODE_ENV!=="production"?f(!1,"Cannot scroll when there is no drag"):f());const O=et(N);O||(process.env.NODE_ENV!=="production"?f(!1,"Cannot scroll a droppable with no closest scrollable"):f()),O.scrollTop+=I.y,O.scrollLeft+=I.x},[]),v=w(()=>({getDimensionAndWatchScroll:m,getScrollWhileDragging:b,dragStopped:h,scroll:y}),[h,m,b,y]),S=w(()=>({uniqueId:r,descriptor:c,callbacks:v}),[v,c,r]);U(()=>(a.current=S.descriptor,o.droppable.register(S),()=>{t.current&&(process.env.NODE_ENV!=="production"&&T("Unsupported: changing the droppableId or type of a Droppable during a drag"),h()),o.droppable.unregister(S)}),[v,c,h,S,i,o.droppable]),U(()=>{t.current&&i.updateDroppableIsEnabled(a.current.id,!e.isDropDisabled)},[e.isDropDisabled,i]),U(()=>{t.current&&i.updateDroppableIsCombineEnabled(a.current.id,e.isCombineEnabled)},[e.isCombineEnabled,i])}function on(){}const Do={width:0,height:0,margin:Yi},Zl=({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>e||n==="close"?Do:{height:t.client.borderBox.height,width:t.client.borderBox.width,margin:t.client.margin},Ql=({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>{const r=Zl({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:n!=="none"?Se.placeholder:null}},ed=e=>{const t=E.useRef(null),n=x(()=>{t.current&&(clearTimeout(t.current),t.current=null)},[]),{animate:r,onTransitionEnd:o,onClose:i,contextId:s}=e,[c,a]=E.useState(e.animate==="open");E.useEffect(()=>c?r!=="open"?(n(),a(!1),on):t.current?on:(t.current=setTimeout(()=>{t.current=null,a(!1)}),n):on,[r,c,n]);const d=x(l=>{l.propertyName==="height"&&(o(),r==="close"&&i())},[r,i,o]),p=Ql({isAnimatingOpenOnMount:c,animate:e.animate,placeholder:e.placeholder});return E.createElement(e.placeholder.tagName,{style:p,"data-rfd-placeholder-context-id":s,onTransitionEnd:d,ref:e.innerRef})};var td=E.memo(ed);function sn(e){return typeof e=="boolean"}function cn(e,t){t.forEach(n=>n(e))}const nd=[function({props:t}){t.droppableId||(process.env.NODE_ENV!=="production"?f(!1,"A Droppable requires a droppableId prop"):f()),typeof t.droppableId!="string"&&(process.env.NODE_ENV!=="production"?f(!1,`A Droppable requires a [string] droppableId. Provided: [${typeof t.droppableId}]`):f())},function({props:t}){sn(t.isDropDisabled)||(process.env.NODE_ENV!=="production"?f(!1,"isDropDisabled must be a boolean"):f()),sn(t.isCombineEnabled)||(process.env.NODE_ENV!=="production"?f(!1,"isCombineEnabled must be a boolean"):f()),sn(t.ignoreContainerClipping)||(process.env.NODE_ENV!=="production"?f(!1,"ignoreContainerClipping must be a boolean"):f())},function({getDroppableRef:t}){po(t())}],rd=[function({props:t,getPlaceholderRef:n}){!t.placeholder||n()||process.env.NODE_ENV!=="production"&&T(`
178
+ `)},rn=e=>({x:e.scrollLeft,y:e.scrollTop});const yo=e=>e?window.getComputedStyle(e).position==="fixed"?!0:yo(e.parentElement):!1;var jl=e=>{const t=nn(e),n=yo(e);return{closestScrollable:t,isFixedOnPage:n}},zl=({descriptor:e,isEnabled:t,isCombineEnabled:n,isFixedOnPage:r,direction:o,client:i,page:s,closest:c})=>{const a=(()=>{if(!c)return null;const{scrollSize:u,client:g}=c,m=Gr({scrollHeight:u.scrollHeight,scrollWidth:u.scrollWidth,height:g.paddingBox.height,width:g.paddingBox.width});return{pageMarginBox:c.page.marginBox,frameClient:g,scrollSize:u,shouldClipSubject:c.shouldClipSubject,scroll:{initial:c.scroll,current:c.scroll,max:m,diff:{value:R,displacement:R}}}})(),d=o==="vertical"?Ot:dr,p=le({page:s,withPlaceholder:null,axis:d,frame:a});return{descriptor:e,isCombineEnabled:n,isFixedOnPage:r,axis:d,isEnabled:t,client:i,page:s,frame:a,subject:p}};const ql=(e,t)=>{const n=Xn(e);if(!t||e!==t)return n;const r=n.paddingBox.top-t.scrollTop,o=n.paddingBox.left-t.scrollLeft,i=r+t.scrollHeight,s=o+t.scrollWidth,a=yt({top:r,right:s,bottom:i,left:o},n.border);return Dt({borderBox:a,margin:n.margin,border:n.border,padding:n.padding})};var Yl=({ref:e,descriptor:t,env:n,windowScroll:r,direction:o,isDropDisabled:i,isCombineEnabled:s,shouldClipSubject:c})=>{const a=n.closestScrollable,d=ql(e,a),p=Fe(d,r),l=(()=>{if(!a)return null;const g=Xn(a),m={scrollHeight:a.scrollHeight,scrollWidth:a.scrollWidth};return{client:g,page:Fe(g,r),scroll:rn(a),scrollSize:m,shouldClipSubject:c}})();return zl({descriptor:t,isEnabled:!i,isCombineEnabled:s,isFixedOnPage:n.isFixedOnPage,direction:o,client:d,page:p,closest:l})};const Xl={passive:!1},Kl={passive:!0};var Eo=e=>e.shouldPublishImmediately?Xl:Kl;const et=e=>e&&e.env.closestScrollable||null;function Jl(e){const t=E.useRef(null),n=Qe(Ke),r=Yt("droppable"),{registry:o,marshal:i}=n,s=Jt(e),c=w(()=>({id:e.droppableId,type:e.type,mode:e.mode}),[e.droppableId,e.mode,e.type]),a=E.useRef(c),d=w(()=>M((I,N)=>{t.current||(process.env.NODE_ENV!=="production"?f(!1,"Can only update scroll when dragging"):f());const O={x:I,y:N};i.updateDroppableScroll(c.id,O)}),[c.id,i]),p=x(()=>{const I=t.current;return!I||!I.env.closestScrollable?R:rn(I.env.closestScrollable)},[]),l=x(()=>{const I=p();d(I.x,I.y)},[p,d]),u=w(()=>me(l),[l]),g=x(()=>{const I=t.current,N=et(I);if(I&&N||(process.env.NODE_ENV!=="production"?f(!1,"Could not find scroll options while scrolling"):f()),I.scrollOptions.shouldPublishImmediately){l();return}u()},[u,l]),m=x((I,N)=>{t.current&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot collect a droppable while a drag is occurring"):f());const O=s.current,A=O.getDroppableRef();A||(process.env.NODE_ENV!=="production"?f(!1,"Cannot collect without a droppable ref"):f());const P=jl(A),H={ref:A,descriptor:c,env:P,scrollOptions:N};t.current=H;const V=Yl({ref:A,descriptor:c,env:P,windowScroll:I,direction:O.direction,isDropDisabled:O.isDropDisabled,isCombineEnabled:O.isCombineEnabled,shouldClipSubject:!O.ignoreContainerClipping}),j=P.closestScrollable;return j&&(j.setAttribute(Kr.contextId,n.contextId),j.addEventListener("scroll",g,Eo(H.scrollOptions)),process.env.NODE_ENV!=="production"&&Hl(j)),V},[n.contextId,c,g,s]),b=x(()=>{const I=t.current,N=et(I);return I&&N||(process.env.NODE_ENV!=="production"?f(!1,"Can only recollect Droppable client for Droppables that have a scroll container"):f()),rn(N)},[]),h=x(()=>{const I=t.current;I||(process.env.NODE_ENV!=="production"?f(!1,"Cannot stop drag when no active drag"):f());const N=et(I);t.current=null,N&&(u.cancel(),N.removeAttribute(Kr.contextId),N.removeEventListener("scroll",g,Eo(I.scrollOptions)))},[g,u]),y=x(I=>{const N=t.current;N||(process.env.NODE_ENV!=="production"?f(!1,"Cannot scroll when there is no drag"):f());const O=et(N);O||(process.env.NODE_ENV!=="production"?f(!1,"Cannot scroll a droppable with no closest scrollable"):f()),O.scrollTop+=I.y,O.scrollLeft+=I.x},[]),v=w(()=>({getDimensionAndWatchScroll:m,getScrollWhileDragging:b,dragStopped:h,scroll:y}),[h,m,b,y]),S=w(()=>({uniqueId:r,descriptor:c,callbacks:v}),[v,c,r]);U(()=>(a.current=S.descriptor,o.droppable.register(S),()=>{t.current&&(process.env.NODE_ENV!=="production"&&T("Unsupported: changing the droppableId or type of a Droppable during a drag"),h()),o.droppable.unregister(S)}),[v,c,h,S,i,o.droppable]),U(()=>{t.current&&i.updateDroppableIsEnabled(a.current.id,!e.isDropDisabled)},[e.isDropDisabled,i]),U(()=>{t.current&&i.updateDroppableIsCombineEnabled(a.current.id,e.isCombineEnabled)},[e.isCombineEnabled,i])}function on(){}const Do={width:0,height:0,margin:Yi},Zl=({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>e||n==="close"?Do:{height:t.client.borderBox.height,width:t.client.borderBox.width,margin:t.client.margin},Ql=({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>{const r=Zl({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:n!=="none"?Se.placeholder:null}},ed=e=>{const t=E.useRef(null),n=x(()=>{t.current&&(clearTimeout(t.current),t.current=null)},[]),{animate:r,onTransitionEnd:o,onClose:i,contextId:s}=e,[c,a]=E.useState(e.animate==="open");E.useEffect(()=>c?r!=="open"?(n(),a(!1),on):t.current?on:(t.current=setTimeout(()=>{t.current=null,a(!1)}),n):on,[r,c,n]);const d=x(l=>{l.propertyName==="height"&&(o(),r==="close"&&i())},[r,i,o]),p=Ql({isAnimatingOpenOnMount:c,animate:e.animate,placeholder:e.placeholder});return E.createElement(e.placeholder.tagName,{style:p,"data-rfd-placeholder-context-id":s,onTransitionEnd:d,ref:e.innerRef})};var td=E.memo(ed);function sn(e){return typeof e=="boolean"}function cn(e,t){t.forEach(n=>n(e))}const nd=[function({props:t}){t.droppableId||(process.env.NODE_ENV!=="production"?f(!1,"A Droppable requires a droppableId prop"):f()),typeof t.droppableId!="string"&&(process.env.NODE_ENV!=="production"?f(!1,`A Droppable requires a [string] droppableId. Provided: [${typeof t.droppableId}]`):f())},function({props:t}){sn(t.isDropDisabled)||(process.env.NODE_ENV!=="production"?f(!1,"isDropDisabled must be a boolean"):f()),sn(t.isCombineEnabled)||(process.env.NODE_ENV!=="production"?f(!1,"isCombineEnabled must be a boolean"):f()),sn(t.ignoreContainerClipping)||(process.env.NODE_ENV!=="production"?f(!1,"ignoreContainerClipping must be a boolean"):f())},function({getDroppableRef:t}){po(t())}],rd=[function({props:t,getPlaceholderRef:n}){!t.placeholder||n()||process.env.NODE_ENV!=="production"&&T(`
179
179
  Droppable setup issue [droppableId: "${t.droppableId}"]:
180
180
  DroppableProvided > placeholder could not be found.
181
181
 
182
182
  Please be sure to add the {provided.placeholder} React Node as a child of your Droppable.
183
183
  More information: https://github.com/hello-pangea/dnd/blob/main/docs/api/droppable.md
184
- `)}],od=[function({props:t}){t.renderClone||(process.env.NODE_ENV!=="production"?f(!1,"Must provide a clone render function (renderClone) for virtual lists"):f())},function({getPlaceholderRef:t}){t()&&(process.env.NODE_ENV!=="production"?f(!1,"Expected virtual list to not have a placeholder"):f())}];function id(e){Te(()=>{cn(e,nd),e.props.mode==="standard"&&cn(e,rd),e.props.mode==="virtual"&&cn(e,od)})}class sd extends E.PureComponent{constructor(...t){super(...t),this.state={isVisible:!!this.props.on,data:this.props.on,animate:this.props.shouldAnimate&&this.props.on?"open":"none"},this.onClose=()=>{this.state.animate==="close"&&this.setState({isVisible:!1})}}static getDerivedStateFromProps(t,n){return t.shouldAnimate?t.on?{isVisible:!0,data:t.on,animate:"open"}:n.isVisible?{isVisible:!0,data:n.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:!!t.on,data:t.on,animate:"none"}}render(){if(!this.state.isVisible)return null;const t={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(t)}}const cd=e=>{const t=E.useContext(Ke);t||(process.env.NODE_ENV!=="production"?f(!1,"Could not find app context"):f());const{contextId:n,isMovementAllowed:r}=t,o=E.useRef(null),i=E.useRef(null),{children:s,droppableId:c,type:a,mode:d,direction:p,ignoreContainerClipping:l,isDropDisabled:u,isCombineEnabled:g,snapshot:m,useClone:b,updateViewportMaxScroll:h,getContainerForClone:y}=e,v=x(()=>o.current,[]),S=x((R=null)=>{o.current=R},[]),I=x(()=>i.current,[]),N=x((R=null)=>{i.current=R},[]);id({props:e,getDroppableRef:v,getPlaceholderRef:I});const O=x(()=>{r()&&h({maxScroll:kr()})},[r,h]);Jl({droppableId:c,type:a,mode:d,direction:p,isDropDisabled:u,isCombineEnabled:g,ignoreContainerClipping:l,getDroppableRef:v});const A=w(()=>E.createElement(sd,{on:e.placeholder,shouldAnimate:e.shouldAnimatePlaceholder},({onClose:R,data:J,animate:fe})=>E.createElement(td,{placeholder:J,onClose:R,innerRef:N,animate:fe,contextId:n,onTransitionEnd:O})),[n,O,e.placeholder,e.shouldAnimatePlaceholder,N]),P=w(()=>({innerRef:S,placeholder:A,droppableProps:{"data-rfd-droppable-id":c,"data-rfd-droppable-context-id":n}}),[n,c,A,S]),H=b?b.dragging.draggableId:null,V=w(()=>({droppableId:c,type:a,isUsingCloneFor:H}),[c,H,a]);function j(){if(!b)return null;const{dragging:R,render:J}=b,fe=E.createElement(ho,{draggableId:R.draggableId,index:R.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},(Z,tt)=>J(Z,tt,R));return rt.createPortal(fe,y())}return E.createElement(en.Provider,{value:V},s(P,m),j())};function ad(){return document.body||(process.env.NODE_ENV!=="production"?f(!1,"document.body is not ready"):f()),document.body}const No={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:ad},xo=e=>{let t={...e},n;for(n in No)e[n]===void 0&&(t={...t,[n]:No[n]});return t},an=(e,t)=>e===t.droppable.type,Io=(e,t)=>t.draggables[e.draggable.id],ld=jn(()=>{const e={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},t={...e,shouldAnimatePlaceholder:!1},n=M(i=>({draggableId:i.id,type:i.type,source:{index:i.index,droppableId:i.droppableId}})),r=M((i,s,c,a,d,p)=>{const l=d.descriptor.id;if(d.descriptor.droppableId===i){const m=p?{render:p,dragging:n(d.descriptor)}:null,b={isDraggingOver:c,draggingOverWith:c?l:null,draggingFromThisWith:l,isUsingPlaceholder:!0};return{placeholder:d.placeholder,shouldAnimatePlaceholder:!1,snapshot:b,useClone:m}}if(!s)return t;if(!a)return e;const g={isDraggingOver:c,draggingOverWith:l,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:d.placeholder,shouldAnimatePlaceholder:!0,snapshot:g,useClone:null}});return(i,s)=>{const c=xo(s),a=c.droppableId,d=c.type,p=!c.isDropDisabled,l=c.renderClone;if(Be(i)){const u=i.critical;if(!an(d,u))return t;const g=Io(u,i.dimensions),m=W(i.impact)===a;return r(a,p,m,m,g,l)}if(i.phase==="DROP_ANIMATING"){const u=i.completed;if(!an(d,u.critical))return t;const g=Io(u.critical,i.dimensions);return r(a,p,go(u.result)===a,W(u.impact)===a,g,l)}if(i.phase==="IDLE"&&i.completed&&!i.shouldFlush){const u=i.completed;if(!an(d,u.critical))return t;const g=W(u.impact)===a,m=!!(u.impact.at&&u.impact.at.type==="COMBINE"),b=u.critical.droppable.id===a;return g?m?e:t:b?e:t}return t}},{updateViewportMaxScroll:sc},(e,t,n)=>({...xo(n),...e,...t}),{context:qt,areStatePropsEqual:fo})(cd),ln=({children:e,color:t="#9ca3af"})=>D.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",color:t},children:e}),dd=()=>D.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[D.jsx("path",{d:"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"}),D.jsx("circle",{cx:"12",cy:"10",r:"3"})]}),ud=()=>D.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[D.jsx("circle",{cx:"12",cy:"12",r:"10"}),D.jsx("polyline",{points:"12 6 12 12 16 14"})]}),pd=()=>D.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round",children:D.jsx("polyline",{points:"20 6 9 17 4 12"})}),fd=()=>D.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#9ca3af",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{cursor:"grab"},children:[D.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),D.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),D.jsx("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]}),dn=e=>e?new Date(e).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}):"--:--",Oo=e=>typeof e=="object"&&(e!=null&&e.name)?e.name:e,gd=({order:e,index:t,pathType:n,pathPeriod:r})=>{const o=!!e.completed_at;return D.jsx($l,{draggableId:e.id.toString(),index:t,children:(i,s)=>{var c,a,d;return D.jsxs("div",{ref:i.innerRef,...i.draggableProps,style:{...B.timelineItem,...i.draggableProps.style,opacity:s.isDragging?.8:1},children:[D.jsxs("div",{style:{...B.bubble,...o?B.bubbleCompleted:B.bubblePending},children:[t+1," "]}),D.jsxs("div",{style:B.card,children:[D.jsxs("div",{style:B.cardHeader,children:[D.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[D.jsxs("span",{style:B.title,children:[n," #",e.sequence_rank]}),o&&D.jsxs("span",{style:B.completedBadge,children:[D.jsx(ln,{color:"#16a34a",children:D.jsx(pd,{})})," ","Completed at ",dn(e.completed_at)]})]}),D.jsx("div",{...i.dragHandleProps,children:D.jsx(fd,{})})]}),D.jsxs("div",{style:B.customerRow,children:["Customer:"," ",D.jsx("span",{style:{color:"#374151"},children:(c=e.customer)==null?void 0:c.name})]}),D.jsxs("div",{style:B.detailsGrid,children:[D.jsxs("div",{style:B.gridItem,children:[D.jsx("div",{style:B.gridLabel,children:"Order"}),D.jsxs("div",{style:B.gridValue,children:["#",e.order_id]})]}),D.jsxs("div",{style:B.gridItem,children:[D.jsx("div",{style:B.gridLabel,children:"Location"}),D.jsxs("div",{style:B.gridValueWithIcon,children:[D.jsx(ln,{color:"#3b82f6",children:D.jsx(dd,{})}),D.jsx("span",{style:B.truncate,children:((d=(a=e.customer)==null?void 0:a.address)==null?void 0:d.street_area)||"No Address"})]})]}),D.jsxs("div",{style:B.gridItem,children:[D.jsx("div",{style:B.gridLabel,children:"Period"}),D.jsx("div",{style:B.gridValue,children:r})]}),D.jsxs("div",{style:B.gridItem,children:[D.jsx("div",{style:B.gridLabel,children:"Time Window"}),D.jsxs("div",{style:B.gridValueWithIcon,children:[D.jsx(ln,{children:D.jsx(ud,{})}),D.jsxs("span",{children:[dn(e.eta_start)," - ",dn(e.eta_end)]})]})]})]})]})]})}})},md=({path:e,onReorder:t})=>{const[n,r]=E.useState([]);if(E.useEffect(()=>{if(e&&e.path_orders){const c=[...e.path_orders].sort((a,d)=>a.sequence_rank-d.sequence_rank);r(c)}},[e]),!e||!n.length)return D.jsx("div",{children:"No Path Data"});const o=Oo(e.type),i=Oo(e.period),s=c=>{if(!c.destination)return;const a=Array.from(n),[d]=a.splice(c.source.index,1);if(a.splice(c.destination.index,0,d),r(a),t){const p=a.map(l=>l.stop_id);t(e.id,p)}};return D.jsx("div",{style:B.container,children:D.jsx(yl,{onDragEnd:s,children:D.jsx(ld,{droppableId:"path-orders-list",children:c=>D.jsxs("div",{style:B.timelineWrapper,ref:c.innerRef,...c.droppableProps,children:[D.jsx("div",{style:B.verticalLine}),D.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"24px"},children:n.map((a,d)=>D.jsx(gd,{index:d,order:a,pathType:o,pathPeriod:i},a.id))}),c.placeholder]})})})})},B={container:{fontFamily:"ui-sans-serif, system-ui, sans-serif",maxWidth:"800px",margin:"0 auto"},timelineWrapper:{position:"relative",paddingLeft:"0"},verticalLine:{position:"absolute",left:"19px",top:"20px",bottom:"20px",width:"2px",backgroundColor:"#f3f4f6",zIndex:0},timelineItem:{position:"relative",zIndex:1,display:"flex",gap:"16px",alignItems:"flex-start",marginBottom:"24px",background:"transparent"},bubble:{flexShrink:0,width:"40px",height:"40px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"14px",fontWeight:"bold",border:"2px solid",backgroundColor:"#fff"},bubblePending:{borderColor:"#f3f4f6",color:"#9ca3af"},bubbleCompleted:{borderColor:"#dcfce7",backgroundColor:"#f0fdf4",color:"#16a34a"},card:{flex:1,backgroundColor:"#fff",border:"1px solid #f3f4f6",borderRadius:"12px",padding:"16px",boxShadow:"0 1px 2px 0 rgba(0, 0, 0, 0.05)"},cardHeader:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"12px"},title:{fontSize:"16px",fontWeight:"700",color:"#111827"},completedBadge:{display:"flex",alignItems:"center",gap:"4px",fontSize:"12px",color:"#16a34a",backgroundColor:"#f0fdf4",padding:"2px 8px",borderRadius:"4px"},customerRow:{fontSize:"12px",color:"#6b7280",marginBottom:"12px"},detailsGrid:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"12px",backgroundColor:"#f9fafb",padding:"12px",borderRadius:"8px"},gridItem:{display:"flex",flexDirection:"column",gap:"4px"},gridLabel:{fontSize:"11px",color:"#9ca3af",textTransform:"uppercase"},gridValue:{fontSize:"13px",fontWeight:"600",color:"#374151"},gridValueWithIcon:{fontSize:"13px",fontWeight:"500",color:"#374151",display:"flex",alignItems:"center",gap:"6px"},truncate:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"200px"}};Q.LogisticsDashboard=md,Object.defineProperty(Q,Symbol.toStringTag,{value:"Module"})});
184
+ `)}],od=[function({props:t}){t.renderClone||(process.env.NODE_ENV!=="production"?f(!1,"Must provide a clone render function (renderClone) for virtual lists"):f())},function({getPlaceholderRef:t}){t()&&(process.env.NODE_ENV!=="production"?f(!1,"Expected virtual list to not have a placeholder"):f())}];function id(e){Te(()=>{cn(e,nd),e.props.mode==="standard"&&cn(e,rd),e.props.mode==="virtual"&&cn(e,od)})}class sd extends E.PureComponent{constructor(...t){super(...t),this.state={isVisible:!!this.props.on,data:this.props.on,animate:this.props.shouldAnimate&&this.props.on?"open":"none"},this.onClose=()=>{this.state.animate==="close"&&this.setState({isVisible:!1})}}static getDerivedStateFromProps(t,n){return t.shouldAnimate?t.on?{isVisible:!0,data:t.on,animate:"open"}:n.isVisible?{isVisible:!0,data:n.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:!!t.on,data:t.on,animate:"none"}}render(){if(!this.state.isVisible)return null;const t={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(t)}}const cd=e=>{const t=E.useContext(Ke);t||(process.env.NODE_ENV!=="production"?f(!1,"Could not find app context"):f());const{contextId:n,isMovementAllowed:r}=t,o=E.useRef(null),i=E.useRef(null),{children:s,droppableId:c,type:a,mode:d,direction:p,ignoreContainerClipping:l,isDropDisabled:u,isCombineEnabled:g,snapshot:m,useClone:b,updateViewportMaxScroll:h,getContainerForClone:y}=e,v=x(()=>o.current,[]),S=x((L=null)=>{o.current=L},[]),I=x(()=>i.current,[]),N=x((L=null)=>{i.current=L},[]);id({props:e,getDroppableRef:v,getPlaceholderRef:I});const O=x(()=>{r()&&h({maxScroll:kr()})},[r,h]);Jl({droppableId:c,type:a,mode:d,direction:p,isDropDisabled:u,isCombineEnabled:g,ignoreContainerClipping:l,getDroppableRef:v});const A=w(()=>E.createElement(sd,{on:e.placeholder,shouldAnimate:e.shouldAnimatePlaceholder},({onClose:L,data:J,animate:fe})=>E.createElement(td,{placeholder:J,onClose:L,innerRef:N,animate:fe,contextId:n,onTransitionEnd:O})),[n,O,e.placeholder,e.shouldAnimatePlaceholder,N]),P=w(()=>({innerRef:S,placeholder:A,droppableProps:{"data-rfd-droppable-id":c,"data-rfd-droppable-context-id":n}}),[n,c,A,S]),H=b?b.dragging.draggableId:null,V=w(()=>({droppableId:c,type:a,isUsingCloneFor:H}),[c,H,a]);function j(){if(!b)return null;const{dragging:L,render:J}=b,fe=E.createElement(ho,{draggableId:L.draggableId,index:L.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},(Z,tt)=>J(Z,tt,L));return rt.createPortal(fe,y())}return E.createElement(en.Provider,{value:V},s(P,m),j())};function ad(){return document.body||(process.env.NODE_ENV!=="production"?f(!1,"document.body is not ready"):f()),document.body}const No={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:ad},xo=e=>{let t={...e},n;for(n in No)e[n]===void 0&&(t={...t,[n]:No[n]});return t},an=(e,t)=>e===t.droppable.type,Io=(e,t)=>t.draggables[e.draggable.id],ld=jn(()=>{const e={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},t={...e,shouldAnimatePlaceholder:!1},n=M(i=>({draggableId:i.id,type:i.type,source:{index:i.index,droppableId:i.droppableId}})),r=M((i,s,c,a,d,p)=>{const l=d.descriptor.id;if(d.descriptor.droppableId===i){const m=p?{render:p,dragging:n(d.descriptor)}:null,b={isDraggingOver:c,draggingOverWith:c?l:null,draggingFromThisWith:l,isUsingPlaceholder:!0};return{placeholder:d.placeholder,shouldAnimatePlaceholder:!1,snapshot:b,useClone:m}}if(!s)return t;if(!a)return e;const g={isDraggingOver:c,draggingOverWith:l,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:d.placeholder,shouldAnimatePlaceholder:!0,snapshot:g,useClone:null}});return(i,s)=>{const c=xo(s),a=c.droppableId,d=c.type,p=!c.isDropDisabled,l=c.renderClone;if(Be(i)){const u=i.critical;if(!an(d,u))return t;const g=Io(u,i.dimensions),m=W(i.impact)===a;return r(a,p,m,m,g,l)}if(i.phase==="DROP_ANIMATING"){const u=i.completed;if(!an(d,u.critical))return t;const g=Io(u.critical,i.dimensions);return r(a,p,go(u.result)===a,W(u.impact)===a,g,l)}if(i.phase==="IDLE"&&i.completed&&!i.shouldFlush){const u=i.completed;if(!an(d,u.critical))return t;const g=W(u.impact)===a,m=!!(u.impact.at&&u.impact.at.type==="COMBINE"),b=u.critical.droppable.id===a;return g?m?e:t:b?e:t}return t}},{updateViewportMaxScroll:sc},(e,t,n)=>({...xo(n),...e,...t}),{context:qt,areStatePropsEqual:fo})(cd),ln=({children:e,color:t="#9ca3af"})=>D.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",color:t},children:e}),dd=()=>D.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[D.jsx("path",{d:"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"}),D.jsx("circle",{cx:"12",cy:"10",r:"3"})]}),ud=()=>D.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[D.jsx("circle",{cx:"12",cy:"12",r:"10"}),D.jsx("polyline",{points:"12 6 12 12 16 14"})]}),pd=()=>D.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round",children:D.jsx("polyline",{points:"20 6 9 17 4 12"})}),fd=()=>D.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#9ca3af",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{cursor:"grab"},children:[D.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),D.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),D.jsx("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]}),dn=e=>e?new Date(e).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}):"--:--",Oo=e=>typeof e=="object"&&(e!=null&&e.name)?e.name:e,gd=({order:e,index:t,pathType:n,pathPeriod:r})=>{var i,s;const o=typeof e.status=="string"?e.status.toLowerCase()==="completed":((s=(i=e.status)==null?void 0:i.code)==null?void 0:s.toLowerCase())==="completed";return D.jsx($l,{draggableId:e.id.toString(),index:t,isDragDisabled:o,children:(c,a)=>{var d,p,l;return D.jsxs("div",{ref:c.innerRef,...c.draggableProps,style:{...B.timelineItem,...c.draggableProps.style,opacity:a.isDragging?.8:1},children:[D.jsxs("div",{style:{...B.bubble,...o?B.bubbleCompleted:B.bubblePending},children:[t+1," "]}),D.jsxs("div",{style:B.card,children:[D.jsxs("div",{style:B.cardHeader,children:[D.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[D.jsxs("span",{style:B.title,children:[n," #",e.sequence_rank]}),o&&D.jsxs("span",{style:B.completedBadge,children:[D.jsx(ln,{color:"#16a34a",children:D.jsx(pd,{})})," ","Completed at ",dn(e.completed_at||"")]})]}),!o&&D.jsx("div",{...c.dragHandleProps,children:D.jsx(fd,{})})]}),D.jsxs("div",{style:B.customerRow,children:["Customer:"," ",D.jsx("span",{style:{color:"#374151"},children:(d=e.customer)==null?void 0:d.name})]}),D.jsxs("div",{style:B.detailsGrid,children:[D.jsxs("div",{style:B.gridItem,children:[D.jsx("div",{style:B.gridLabel,children:"Order"}),D.jsxs("div",{style:B.gridValue,children:["#",e.order_id]})]}),D.jsxs("div",{style:B.gridItem,children:[D.jsx("div",{style:B.gridLabel,children:"Location"}),D.jsxs("div",{style:B.gridValueWithIcon,children:[D.jsx(ln,{color:"#3b82f6",children:D.jsx(dd,{})}),D.jsx("span",{style:B.truncate,children:((l=(p=e.customer)==null?void 0:p.address)==null?void 0:l.street_area)||"No Address"})]})]}),D.jsxs("div",{style:B.gridItem,children:[D.jsx("div",{style:B.gridLabel,children:"Period"}),D.jsx("div",{style:B.gridValue,children:r})]}),D.jsxs("div",{style:B.gridItem,children:[D.jsx("div",{style:B.gridLabel,children:"Time Window"}),D.jsxs("div",{style:B.gridValueWithIcon,children:[D.jsx(ln,{children:D.jsx(ud,{})}),D.jsxs("span",{children:[dn(e.eta_start)," - ",dn(e.eta_end)]})]})]})]})]})]})}})},md=({path:e,onReorder:t})=>{const[n,r]=E.useState([]);if(E.useEffect(()=>{if(e&&e.path_orders){const c=[...e.path_orders].sort((a,d)=>a.sequence_rank-d.sequence_rank);r(c)}},[e]),!e||!n.length)return D.jsx("div",{children:"No Path Data"});const o=Oo(e.type),i=Oo(e.period),s=c=>{if(!c.destination)return;const a=Array.from(n),[d]=a.splice(c.source.index,1);if(a.splice(c.destination.index,0,d),r(a),t){const p=a.map(l=>l.stop_id);t(e.id,p)}};return D.jsx("div",{style:B.container,children:D.jsx(yl,{onDragEnd:s,children:D.jsx(ld,{droppableId:"path-orders-list",children:c=>D.jsxs("div",{style:B.timelineWrapper,ref:c.innerRef,...c.droppableProps,children:[D.jsx("div",{style:B.verticalLine}),D.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"24px"},children:n.map((a,d)=>D.jsx(gd,{index:d,order:a,pathType:o,pathPeriod:i},a.id))}),c.placeholder]})})})})},B={container:{fontFamily:"ui-sans-serif, system-ui, sans-serif",maxWidth:"800px",margin:"0 auto"},timelineWrapper:{position:"relative",paddingLeft:"0"},verticalLine:{position:"absolute",left:"19px",top:"20px",bottom:"20px",width:"2px",backgroundColor:"#f3f4f6",zIndex:0},timelineItem:{position:"relative",zIndex:1,display:"flex",gap:"16px",alignItems:"flex-start",marginBottom:"24px",background:"transparent"},bubble:{flexShrink:0,width:"40px",height:"40px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"14px",fontWeight:"bold",border:"2px solid",backgroundColor:"#fff"},bubblePending:{borderColor:"#f3f4f6",color:"#9ca3af"},bubbleCompleted:{borderColor:"#dcfce7",backgroundColor:"#f0fdf4",color:"#16a34a"},card:{flex:1,backgroundColor:"#fff",border:"1px solid #f3f4f6",borderRadius:"12px",padding:"16px",boxShadow:"0 1px 2px 0 rgba(0, 0, 0, 0.05)"},cardHeader:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"12px"},title:{fontSize:"16px",fontWeight:"700",color:"#111827"},completedBadge:{display:"flex",alignItems:"center",gap:"4px",fontSize:"12px",color:"#16a34a",backgroundColor:"#f0fdf4",padding:"2px 8px",borderRadius:"4px"},customerRow:{fontSize:"12px",color:"#6b7280",marginBottom:"12px"},detailsGrid:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"12px",backgroundColor:"#f9fafb",padding:"12px",borderRadius:"8px"},gridItem:{display:"flex",flexDirection:"column",gap:"4px"},gridLabel:{fontSize:"11px",color:"#9ca3af",textTransform:"uppercase"},gridValue:{fontSize:"13px",fontWeight:"600",color:"#374151"},gridValueWithIcon:{fontSize:"13px",fontWeight:"500",color:"#374151",display:"flex",alignItems:"center",gap:"6px"},truncate:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"200px"}};Q.LogisticsDashboard=md,Object.defineProperty(Q,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wilow_app/design-system",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"