@wilow_app/design-system 0.1.7 → 0.1.9
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.es.js +923 -918
- package/dist/index.umd.js +41 -41
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(Q,v){typeof exports=="object"&&typeof module<"u"?v(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],v):(Q=typeof globalThis<"u"?globalThis:Q||self,v(Q["my-react-component"]={},Q.jsxRuntime,Q.React,Q.ReactDOM))})(this,function(Q,v,D,
|
|
1
|
+
(function(Q,v){typeof exports=="object"&&typeof module<"u"?v(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],v):(Q=typeof globalThis<"u"?globalThis:Q||self,v(Q["my-react-component"]={},Q.jsxRuntime,Q.React,Q.ReactDOM))})(this,function(Q,v,D,ot){"use strict";function To(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 _=To(D);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 Bo=typeof Symbol=="function"&&Symbol.observable||"@@observable",bn=Bo,vn=()=>Math.random().toString(36).substring(7).split("").join("."),Vo={INIT:`@@redux/INIT${vn()}`,REPLACE:`@@redux/REPLACE${vn()}`},yn=Vo;function Lo(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 Ro(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(Go(e))return"date";if($o(e))return"error";const n=Mo(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 Mo(e){return typeof e.constructor=="function"?e.constructor.name:null}function $o(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function Go(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=Ro(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((m,E)=>{s.set(E,m)}))}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(m){if(typeof m!="function")throw new Error(process.env.NODE_ENV==="production"?G(4):`Expected the listener to be a function. Instead, received: '${ee(m)}'`);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 E=!0;d();const y=c++;return s.set(y,m),function(){if(E){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.");E=!1,d(),s.delete(y),i=null}}}function u(m){if(!Lo(m))throw new Error(process.env.NODE_ENV==="production"?G(7):`Actions must be plain objects. Instead, the actual type was: '${ee(m)}'. 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 m.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 m.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(m.type)}'. Value was: '${m.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,m)}finally{a=!1}return(i=s).forEach(y=>{y()}),m}function g(m){if(typeof m!="function")throw new Error(process.env.NODE_ENV==="production"?G(10):`Expected the nextReducer to be a function. Instead, received: '${ee(m)}`);r=m,u({type:yn.REPLACE})}function h(){const m=l;return{subscribe(E){if(typeof E!="object"||E===null)throw new Error(process.env.NODE_ENV==="production"?G(11):`Expected the observer to be an object. Instead, received: '${ee(E)}'`);function y(){const I=E;I.next&&I.next(p())}return y(),{unsubscribe:m(y)}},[bn](){return this}}}return u({type:yn.INIT}),{dispatch:u,subscribe:l,getState:p,replaceReducer:g,[bn]:h}}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 ko(...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 it={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* use-sync-external-store-with-selector.production.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var In;function Fo(){if(In)return it;In=1;var e=D;function t(a,d){return a===d&&(a!==0||1/a===1/d)||a!==a&&d!==d}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,o=e.useRef,i=e.useEffect,s=e.useMemo,c=e.useDebugValue;return it.useSyncExternalStoreWithSelector=function(a,d,p,l,u){var g=o(null);if(g.current===null){var h={hasValue:!1,value:null};g.current=h}else h=g.current;g=s(function(){function m(N){if(!E){if(E=!0,y=N,N=l(N),u!==void 0&&h.hasValue){var C=h.value;if(u(C,N))return S=C}return S=N}if(C=S,n(y,N))return C;var A=l(N);return u!==void 0&&u(C,A)?(y=N,C):(y=N,S=A)}var E=!1,y,S,I=p===void 0?null:p;return[function(){return m(d())},I===null?void 0:function(){return m(I())}]},[d,p,l,u]);var b=r(a,g[0],g[1]);return i(function(){h.hasValue=!0,h.value=b},[b]),c(b),b},it}var st={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* use-sync-external-store-with-selector.development.js
|
|
12
12
|
*
|
|
@@ -14,26 +14,26 @@
|
|
|
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 Sn;function Fo(){return Sn||(Sn=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=D,n=typeof Object.is=="function"?Object.is:e,r=t.useSyncExternalStore,o=t.useRef,i=t.useEffect,s=t.useMemo,c=t.useDebugValue;ct.useSyncExternalStoreWithSelector=function(a,d,p,l,u){var g=o(null);if(g.current===null){var h={hasValue:!1,value:null};g.current=h}else h=g.current;g=s(function(){function m(N){if(!E){if(E=!0,y=N,N=l(N),u!==void 0&&h.hasValue){var C=h.value;if(u(C,N))return S=C}return S=N}if(C=S,n(y,N))return C;var A=l(N);return u!==void 0&&u(C,A)?(y=N,C):(y=N,S=A)}var E=!1,y,S,I=p===void 0?null:p;return[function(){return m(d())},I===null?void 0:function(){return m(I())}]},[d,p,l,u]);var b=r(a,g[0],g[1]);return i(function(){h.hasValue=!0,h.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())}()),ct}process.env.NODE_ENV==="production"?ko():Fo();var On=_.version.startsWith("19"),Wo=Symbol.for(On?"react.transitional.element":"react.element"),Uo=Symbol.for("react.portal"),wn=Symbol.for("react.fragment"),_n=Symbol.for("react.strict_mode"),An=Symbol.for("react.profiler"),at=Symbol.for("react.consumer"),lt=Symbol.for("react.context"),dt=Symbol.for("react.forward_ref"),Pn=Symbol.for("react.suspense"),Tn=Symbol.for("react.suspense_list"),Me=Symbol.for("react.memo"),Bn=Symbol.for("react.lazy"),Ho=Symbol.for("react.offscreen"),zo=Symbol.for("react.client.reference"),qo=dt,jo=Me;function Yo(e){return typeof e=="string"||typeof e=="function"||e===wn||e===An||e===_n||e===Pn||e===Tn||e===Ho||typeof e=="object"&&e!==null&&(e.$$typeof===Bn||e.$$typeof===Me||e.$$typeof===lt||e.$$typeof===at||e.$$typeof===dt||e.$$typeof===zo||e.getModuleId!==void 0)}function ut(e){if(typeof e=="object"&&e!==null){const{$$typeof:t}=e;switch(t){case Wo:switch(e=e.type,e){case wn:case An:case _n:case Pn:case Tn:return e;default:switch(e=e&&e.$$typeof,e){case lt:case dt:case Bn:case Me:return e;case at:return e;default:return t}}case Uo:return t}}}function Xo(e){return On?ut(e)===at:ut(e)===lt}function Ko(e){return ut(e)===Me}function pt(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function ft(e,t){if(e)(t==="mapStateToProps"||t==="mapDispatchToProps")&&(Object.prototype.hasOwnProperty.call(e,"dependsOnOwnProps")||pt(`The selector for ${t} of connect did not specify a value for dependsOnOwnProps.`));else throw new Error(`Unexpected value for ${t} in connect.`)}function Jo(e,t,n){ft(e,"mapStateToProps"),ft(t,"mapDispatchToProps"),ft(n,"mergeProps")}function Zo(e,t,n,r,{areStatesEqual:o,areOwnPropsEqual:i,areStatePropsEqual:s}){let c=!1,a,d,p,l,u;function g(y,S){return a=y,d=S,p=e(a,d),l=t(r,d),u=n(p,l,d),c=!0,u}function h(){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 m(){const y=e(a,d),S=!s(y,p);return p=y,S&&(u=n(p,l,d)),u}function E(y,S){const I=!i(S,d),N=!o(y,a,S,d);return a=y,d=S,I&&N?h():I?b():N?m():u}return function(S,I){return c?E(S,I):g(S,I)}}function Qo(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"&&Jo(i,s,c),Zo(i,s,c,e,o)}function ei(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 ti(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 Vn(e,t,n){ti(e)||pt(`${n}() in ${t} must return a plain object. Instead received ${e}.`)}function gt(e){return function(n){const r=e(n);function o(){return r}return o.dependsOnOwnProps=!1,o}}function Ln(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=Ln(e);let d=i(c,a);return typeof d=="function"&&(i.mapToProps=d,i.dependsOnOwnProps=Ln(d),d=i(c,a)),process.env.NODE_ENV!=="production"&&Vn(d,o,t),d},i}}function mt(e,t){return(n,r)=>{throw new Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${r.wrappedComponentName}.`)}}function ni(e){return e&&typeof e=="object"?gt(t=>ei(e,t)):e?typeof e=="function"?Rn(e,"mapDispatchToProps"):mt(e,"mapDispatchToProps"):gt(t=>({dispatch:t}))}function ri(e){return e?typeof e=="function"?Rn(e,"mapStateToProps"):mt(e,"mapStateToProps"):gt(()=>({}))}function oi(e,t,n){return{...n,...e,...t}}function ii(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"&&Vn(s,r,"mergeProps")),s}}}function si(e){return e?typeof e=="function"?ii(e):mt(e,"mergeProps"):()=>oi}function ci(e){e()}function ai(){let e=null,t=null;return{clear(){e=null,t=null},notify(){ci(()=>{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 Mn={notify(){},get:()=>[]};function $n(e,t){let n,r=Mn,o=0,i=!1;function s(b){p();const m=r.subscribe(b);let E=!1;return()=>{E||(E=!0,m(),l())}}function c(){r.notify()}function a(){h.onStateChange&&h.onStateChange()}function d(){return i}function p(){o++,n||(n=t?t.addNestedSub(a):e.subscribe(a),r=ai())}function l(){o--,n&&o===0&&(n(),n=void 0,r.clear(),r=Mn)}function u(){i||(i=!0,p())}function g(){i&&(i=!1,l())}const h={addNestedSub:s,notifyNestedSubs:c,handleChangeWrapper:a,isSubscribed:d,trySubscribe:u,tryUnsubscribe:g,getListeners:()=>r};return h}var li=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",di=li(),ui=()=>typeof navigator<"u"&&navigator.product==="ReactNative",pi=ui(),fi=()=>di||pi?_.useLayoutEffect:_.useEffect,$e=fi();function Gn(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function ht(e,t){if(Gn(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])||!Gn(e[n[o]],t[n[o]]))return!1;return!0}var gi={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},mi={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},hi={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},kn={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},bi={[qo]:hi,[jo]:kn};function Fn(e){return Ko(e)?kn:bi[e.$$typeof]||gi}var vi=Object.defineProperty,yi=Object.getOwnPropertyNames,Wn=Object.getOwnPropertySymbols,Ei=Object.getOwnPropertyDescriptor,Di=Object.getPrototypeOf,Un=Object.prototype;function bt(e,t){if(typeof t!="string"){if(Un){const i=Di(t);i&&i!==Un&&bt(e,i)}let n=yi(t);Wn&&(n=n.concat(Wn(t)));const r=Fn(e),o=Fn(t);for(let i=0;i<n.length;++i){const s=n[i];if(!mi[s]&&!(o&&o[s])&&!(r&&r[s])){const c=Ei(t,s);try{vi(e,s,c)}catch{}}}}return e}var vt=Symbol.for("react-redux-context"),yt=typeof globalThis<"u"?globalThis:{};function Ni(){if(!_.createContext)return{};const e=yt[vt]??(yt[vt]=new Map);let t=e.get(_.createContext);return t||(t=_.createContext(null),process.env.NODE_ENV!=="production"&&(t.displayName="ReactRedux"),e.set(_.createContext,t)),t}var Hn=Ni(),xi=[null,null],Ii=e=>{try{return JSON.stringify(e)}catch{return String(e)}};function Ci(e,t,n){$e(()=>e(...t),n)}function Si(e,t,n,r,o,i){e.current=r,n.current=!1,o.current&&(o.current=null,i())}function Oi(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 m,E;try{m=r(b,o.current)}catch(y){E=y,u=y}E||(u=null),m===i.current?s.current||d():(i.current=m,a.current=m,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 zn=!1;function _i(e,t,n,{pure:r,areStatesEqual:o=wi,areOwnPropsEqual:i=ht,areStatePropsEqual:s=ht,areMergedPropsEqual:c=ht,forwardRef:a=!1,context:d=Hn}={}){process.env.NODE_ENV!=="production"&&r!==void 0&&!zn&&(zn=!0,pt('The `pure` option has been removed. `connect` is now always a "pure/memoized" component'));const p=d,l=ri(e),u=ni(t),g=si(n),h=!!e;return m=>{if(process.env.NODE_ENV!=="production"&&!Yo(m))throw new Error(`You must pass a component to the function returned by connect. Instead received ${Ii(m)}`);const E=m.displayName||m.name||"Component",y=`Connect(${E})`,S={shouldHandleStateChanges:h,displayName:y,wrappedComponentName:E,WrappedComponent:m,initMapStateToProps:l,initMapDispatchToProps:u,initMergeProps:g,areStatesEqual:o,areStatePropsEqual:s,areOwnPropsEqual:i,areMergedPropsEqual:c};function I(A){const[T,H,V]=_.useMemo(()=>{const{reactReduxForwardedRef:q,...ge}=A;return[A.context,q,ge]},[A]),z=_.useMemo(()=>{let q=p;if(T!=null&&T.Consumer&&process.env.NODE_ENV!=="production"){if(!Xo(_.createElement(T.Consumer,null)))throw new Error("You must pass a valid React context consumer as `props.context`");q=T}return q},[T,p]),L=_.useContext(z),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 "${y}". Either wrap the root component in a <Provider>, or pass a custom React context provider to <Provider> and the corresponding React context consumer to ${y} in connect options.`);const Z=J?A.store:L.store,rt=fe?L.getServerState:Z.getState,pn=_.useMemo(()=>Qo(Z.dispatch,S),[Z]),[Le,Oo]=_.useMemo(()=>{if(!h)return xi;const q=$n(Z,J?void 0:L.subscription),ge=q.notifyNestedSubs.bind(q);return[q,ge]},[Z,J,L]),wo=_.useMemo(()=>J?L:{...L,subscription:Le},[J,L,Le]),fn=_.useRef(void 0),gn=_.useRef(V),Re=_.useRef(void 0),_o=_.useRef(!1),mn=_.useRef(!1),hn=_.useRef(void 0);$e(()=>(mn.current=!0,()=>{mn.current=!1}),[]);const Ao=_.useMemo(()=>()=>Re.current&&V===gn.current?Re.current:pn(Z.getState(),V),[Z,V]),Ed=_.useMemo(()=>ge=>Le?Oi(h,Z,Le,pn,gn,fn,_o,mn,Re,Oo,ge):()=>{},[Le]);Ci(Si,[gn,fn,_o,V,Re,Oo]);let ot;try{ot=_.useSyncExternalStore(Ed,Ao,rt?()=>pn(rt(),V):Ao)}catch(q){throw hn.current&&(q.message+=`
|
|
17
|
+
*/var Cn;function Wo(){return Cn||(Cn=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=D,n=typeof Object.is=="function"?Object.is:e,r=t.useSyncExternalStore,o=t.useRef,i=t.useEffect,s=t.useMemo,c=t.useDebugValue;st.useSyncExternalStoreWithSelector=function(a,d,p,l,u){var g=o(null);if(g.current===null){var h={hasValue:!1,value:null};g.current=h}else h=g.current;g=s(function(){function m(N){if(!E){if(E=!0,y=N,N=l(N),u!==void 0&&h.hasValue){var C=h.value;if(u(C,N))return S=C}return S=N}if(C=S,n(y,N))return C;var A=l(N);return u!==void 0&&u(C,A)?(y=N,C):(y=N,S=A)}var E=!1,y,S,I=p===void 0?null:p;return[function(){return m(d())},I===null?void 0:function(){return m(I())}]},[d,p,l,u]);var b=r(a,g[0],g[1]);return i(function(){h.hasValue=!0,h.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())}()),st}process.env.NODE_ENV==="production"?Fo():Wo();var Sn=_.version.startsWith("19"),Uo=Symbol.for(Sn?"react.transitional.element":"react.element"),Ho=Symbol.for("react.portal"),On=Symbol.for("react.fragment"),wn=Symbol.for("react.strict_mode"),_n=Symbol.for("react.profiler"),ct=Symbol.for("react.consumer"),at=Symbol.for("react.context"),lt=Symbol.for("react.forward_ref"),An=Symbol.for("react.suspense"),Pn=Symbol.for("react.suspense_list"),Me=Symbol.for("react.memo"),Tn=Symbol.for("react.lazy"),zo=Symbol.for("react.offscreen"),qo=Symbol.for("react.client.reference"),jo=lt,Yo=Me;function Xo(e){return typeof e=="string"||typeof e=="function"||e===On||e===_n||e===wn||e===An||e===Pn||e===zo||typeof e=="object"&&e!==null&&(e.$$typeof===Tn||e.$$typeof===Me||e.$$typeof===at||e.$$typeof===ct||e.$$typeof===lt||e.$$typeof===qo||e.getModuleId!==void 0)}function dt(e){if(typeof e=="object"&&e!==null){const{$$typeof:t}=e;switch(t){case Uo:switch(e=e.type,e){case On:case _n:case wn:case An:case Pn:return e;default:switch(e=e&&e.$$typeof,e){case at:case lt:case Tn:case Me:return e;case ct:return e;default:return t}}case Ho:return t}}}function Ko(e){return Sn?dt(e)===ct:dt(e)===at}function Jo(e){return dt(e)===Me}function ut(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function pt(e,t){if(e)(t==="mapStateToProps"||t==="mapDispatchToProps")&&(Object.prototype.hasOwnProperty.call(e,"dependsOnOwnProps")||ut(`The selector for ${t} of connect did not specify a value for dependsOnOwnProps.`));else throw new Error(`Unexpected value for ${t} in connect.`)}function Zo(e,t,n){pt(e,"mapStateToProps"),pt(t,"mapDispatchToProps"),pt(n,"mergeProps")}function Qo(e,t,n,r,{areStatesEqual:o,areOwnPropsEqual:i,areStatePropsEqual:s}){let c=!1,a,d,p,l,u;function g(y,S){return a=y,d=S,p=e(a,d),l=t(r,d),u=n(p,l,d),c=!0,u}function h(){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 m(){const y=e(a,d),S=!s(y,p);return p=y,S&&(u=n(p,l,d)),u}function E(y,S){const I=!i(S,d),N=!o(y,a,S,d);return a=y,d=S,I&&N?h():I?b():N?m():u}return function(S,I){return c?E(S,I):g(S,I)}}function ei(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"&&Zo(i,s,c),Qo(i,s,c,e,o)}function ti(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 ni(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){ni(e)||ut(`${n}() in ${t} must return a plain object. Instead received ${e}.`)}function ft(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 gt(e,t){return(n,r)=>{throw new Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${r.wrappedComponentName}.`)}}function ri(e){return e&&typeof e=="object"?ft(t=>ti(e,t)):e?typeof e=="function"?Ln(e,"mapDispatchToProps"):gt(e,"mapDispatchToProps"):ft(t=>({dispatch:t}))}function oi(e){return e?typeof e=="function"?Ln(e,"mapStateToProps"):gt(e,"mapStateToProps"):ft(()=>({}))}function ii(e,t,n){return{...n,...e,...t}}function si(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 ci(e){return e?typeof e=="function"?si(e):gt(e,"mergeProps"):()=>ii}function ai(e){e()}function li(){let e=null,t=null;return{clear(){e=null,t=null},notify(){ai(()=>{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 m=r.subscribe(b);let E=!1;return()=>{E||(E=!0,m(),l())}}function c(){r.notify()}function a(){h.onStateChange&&h.onStateChange()}function d(){return i}function p(){o++,n||(n=t?t.addNestedSub(a):e.subscribe(a),r=li())}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 h={addNestedSub:s,notifyNestedSubs:c,handleChangeWrapper:a,isSubscribed:d,trySubscribe:u,tryUnsubscribe:g,getListeners:()=>r};return h}var di=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ui=di(),pi=()=>typeof navigator<"u"&&navigator.product==="ReactNative",fi=pi(),gi=()=>ui||fi?_.useLayoutEffect:_.useEffect,$e=gi();function $n(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function mt(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 mi={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},hi={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},bi={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Gn={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},vi={[jo]:bi,[Yo]:Gn};function kn(e){return Jo(e)?Gn:vi[e.$$typeof]||mi}var yi=Object.defineProperty,Ei=Object.getOwnPropertyNames,Fn=Object.getOwnPropertySymbols,Di=Object.getOwnPropertyDescriptor,Ni=Object.getPrototypeOf,Wn=Object.prototype;function ht(e,t){if(typeof t!="string"){if(Wn){const i=Ni(t);i&&i!==Wn&&ht(e,i)}let n=Ei(t);Fn&&(n=n.concat(Fn(t)));const r=kn(e),o=kn(t);for(let i=0;i<n.length;++i){const s=n[i];if(!hi[s]&&!(o&&o[s])&&!(r&&r[s])){const c=Di(t,s);try{yi(e,s,c)}catch{}}}}return e}var bt=Symbol.for("react-redux-context"),vt=typeof globalThis<"u"?globalThis:{};function xi(){if(!_.createContext)return{};const e=vt[bt]??(vt[bt]=new Map);let t=e.get(_.createContext);return t||(t=_.createContext(null),process.env.NODE_ENV!=="production"&&(t.displayName="ReactRedux"),e.set(_.createContext,t)),t}var Un=xi(),Ii=[null,null],Ci=e=>{try{return JSON.stringify(e)}catch{return String(e)}};function Si(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 wi(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 m,E;try{m=r(b,o.current)}catch(y){E=y,u=y}E||(u=null),m===i.current?s.current||d():(i.current=m,a.current=m,s.current=!0,p())};return n.onStateChange=g,n.trySubscribe(),g(),()=>{if(l=!0,n.tryUnsubscribe(),n.onStateChange=null,u)throw u}}function _i(e,t){return e===t}var Hn=!1;function Ai(e,t,n,{pure:r,areStatesEqual:o=_i,areOwnPropsEqual:i=mt,areStatePropsEqual:s=mt,areMergedPropsEqual:c=mt,forwardRef:a=!1,context:d=Un}={}){process.env.NODE_ENV!=="production"&&r!==void 0&&!Hn&&(Hn=!0,ut('The `pure` option has been removed. `connect` is now always a "pure/memoized" component'));const p=d,l=oi(e),u=ri(t),g=ci(n),h=!!e;return m=>{if(process.env.NODE_ENV!=="production"&&!Xo(m))throw new Error(`You must pass a component to the function returned by connect. Instead received ${Ci(m)}`);const E=m.displayName||m.name||"Component",y=`Connect(${E})`,S={shouldHandleStateChanges:h,displayName:y,wrappedComponentName:E,WrappedComponent:m,initMapStateToProps:l,initMapDispatchToProps:u,initMergeProps:g,areStatesEqual:o,areStatePropsEqual:s,areOwnPropsEqual:i,areMergedPropsEqual:c};function I(A){const[T,H,V]=_.useMemo(()=>{const{reactReduxForwardedRef:q,...ge}=A;return[A.context,q,ge]},[A]),z=_.useMemo(()=>{let q=p;if(T!=null&&T.Consumer&&process.env.NODE_ENV!=="production"){if(!Ko(_.createElement(T.Consumer,null)))throw new Error("You must pass a valid React context consumer as `props.context`");q=T}return q},[T,p]),L=_.useContext(z),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 "${y}". Either wrap the root component in a <Provider>, or pass a custom React context provider to <Provider> and the corresponding React context consumer to ${y} in connect options.`);const Z=J?A.store:L.store,nt=fe?L.getServerState:Z.getState,un=_.useMemo(()=>ei(Z.dispatch,S),[Z]),[Le,wo]=_.useMemo(()=>{if(!h)return Ii;const q=Mn(Z,J?void 0:L.subscription),ge=q.notifyNestedSubs.bind(q);return[q,ge]},[Z,J,L]),_o=_.useMemo(()=>J?L:{...L,subscription:Le},[J,L,Le]),pn=_.useRef(void 0),fn=_.useRef(V),Re=_.useRef(void 0),Ao=_.useRef(!1),gn=_.useRef(!1),mn=_.useRef(void 0);$e(()=>(gn.current=!0,()=>{gn.current=!1}),[]);const Po=_.useMemo(()=>()=>Re.current&&V===fn.current?Re.current:un(Z.getState(),V),[Z,V]),Dd=_.useMemo(()=>ge=>Le?wi(h,Z,Le,un,fn,pn,Ao,gn,Re,wo,ge):()=>{},[Le]);Si(Oi,[fn,pn,Ao,V,Re,wo]);let rt;try{rt=_.useSyncExternalStore(Dd,Po,nt?()=>un(nt(),V):Po)}catch(q){throw mn.current&&(q.message+=`
|
|
18
18
|
The error may be correlated with this previous error:
|
|
19
|
-
${
|
|
19
|
+
${mn.current.stack}
|
|
20
20
|
|
|
21
|
-
`),q}$e(()=>{
|
|
21
|
+
`),q}$e(()=>{mn.current=void 0,Re.current=void 0,pn.current=rt});const hn=_.useMemo(()=>_.createElement(m,{...rt,ref:H}),[H,m,rt]);return _.useMemo(()=>h?_.createElement(z.Provider,{value:_o},hn):hn,[z,hn,_o])}const C=_.memo(I);if(C.WrappedComponent=m,C.displayName=I.displayName=y,a){const T=_.forwardRef(function(V,z){return _.createElement(C,{...V,reactReduxForwardedRef:z})});return T.displayName=y,T.WrappedComponent=m,ht(T,m)}return ht(C,m)}}var zn=Ai;function Pi(e){const{children:t,context:n,serverState:r,store:o}=e,i=_.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=_.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 _.createElement(c.Provider,{value:i},t)}var Ti=Pi,Bi=process.env.NODE_ENV==="production",yt="Invariant failed";function qn(e,t){if(Bi)throw new Error(yt);var n=typeof t=="function"?t():t,r=n?"".concat(yt,": ").concat(n):yt;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},Et=function(t,n){return{top:t.top-n.top,left:t.left-n.left,bottom:t.bottom+n.bottom,right:t.right+n.right}},jn=function(t,n){return{top:t.top+n.top,left:t.left+n.left,bottom:t.bottom-n.bottom,right:t.right-n.right}},Vi=function(t,n){return{top:t.top+n.y,left:t.left+n.x,bottom:t.bottom+n.y,right:t.right+n.x}},Dt={top:0,right:0,bottom:0,left:0},Nt=function(t){var n=t.borderBox,r=t.margin,o=r===void 0?Dt:r,i=t.border,s=i===void 0?Dt:i,c=t.padding,a=c===void 0?Dt:c,d=K(Et(n,o)),p=K(jn(n,s)),l=K(jn(p,a));return{marginBox:d,borderBox:K(n),paddingBox:p,contentBox:l,margin:o,border:s,padding:a}},j=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"?qn(!1,"Could not parse value [raw: "+t+", without suffix: "+n+"]"):qn()),o},Li=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=Vi(r,n);return Nt({borderBox:c,border:o,margin:i,padding:s})},ke=function(t,n){return n===void 0&&(n=Li()),Ge(t,n)},Yn=function(t,n){var r={top:j(n.marginTop),right:j(n.marginRight),bottom:j(n.marginBottom),left:j(n.marginLeft)},o={top:j(n.paddingTop),right:j(n.paddingRight),bottom:j(n.paddingBottom),left:j(n.paddingLeft)},i={top:j(n.borderTopWidth),right:j(n.borderRightWidth),bottom:j(n.borderBottomWidth),left:j(n.borderLeftWidth)};return Nt({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 Fe(){return Fe=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},Fe.apply(null,arguments)}const Ri=process.env.NODE_ENV==="production",Mi=/[ \t]{2,}/g,$i=/^[ \t]*/gm,Kn=e=>e.replace(Mi," ").replace($i,"").trim(),Gi=e=>Kn(`
|
|
22
22
|
%c@hello-pangea/dnd
|
|
23
23
|
|
|
24
|
-
%c${
|
|
24
|
+
%c${Kn(e)}
|
|
25
25
|
|
|
26
26
|
%c👷 This is a development only message. It will be removed in production builds.
|
|
27
|
-
`),
|
|
27
|
+
`),ki=e=>[Gi(e),"color: #00C584; font-size: 1.2em; font-weight: bold;","line-height: 1.5","color: #723874;"],Fi="__@hello-pangea/dnd-disable-dev-warnings";function Jn(e,t){Ri||typeof window<"u"&&window[Fi]||console[e](...ki(t))}const B=Jn.bind(null,"warn"),xt=Jn.bind(null,"error");function te(){}function Wi(e,t){return{...e,...t}}function Y(e,t,n){const r=t.map(o=>{const i=Wi(n,o.options);return e.addEventListener(o.eventName,o.fn,i),function(){e.removeEventListener(o.eventName,o.fn,i)}});return function(){r.forEach(i=>{i()})}}const Ui=process.env.NODE_ENV==="production",Zn="Invariant failed";class he extends Error{}he.prototype.toString=function(){return this.message};function f(e,t){throw Ui?new he(Zn):new he(`${Zn}: ${t||""}`)}class Hi extends D.Component{constructor(...t){super(...t),this.callbacks=null,this.unbind=te,this.onWindowError=n=>{const r=this.getCallbacks();r.isDragging()&&(r.tryAbort(),process.env.NODE_ENV!=="production"&&B(`
|
|
28
28
|
An error was caught by our window 'error' event listener while a drag was occurring.
|
|
29
29
|
The active drag has been aborted.
|
|
30
|
-
`));const o=n.error;o instanceof he&&(n.preventDefault(),process.env.NODE_ENV!=="production"&&
|
|
30
|
+
`));const o=n.error;o instanceof he&&(n.preventDefault(),process.env.NODE_ENV!=="production"&&xt(o.message))},this.getCallbacks=()=>{if(!this.callbacks)throw new Error("Unable to find AppCallbacks in <ErrorBoundary/>");return this.callbacks},this.setCallbacks=n=>{this.callbacks=n}}componentDidMount(){this.unbind=Y(window,[{eventName:"error",fn:this.onWindowError}])}componentDidCatch(t){if(t instanceof he){process.env.NODE_ENV!=="production"&&xt(t.message),this.setState({});return}throw t}componentWillUnmount(){this.unbind()}render(){return this.props.children(this.setCallbacks)}}const zi=`
|
|
31
31
|
Press space bar to start a drag.
|
|
32
32
|
When dragging you can use the arrow keys to move the item around and escape to cancel.
|
|
33
33
|
Some screen readers may require you to be in focus mode or to use your pass through key
|
|
34
|
-
`,We=e=>e+1,
|
|
34
|
+
`,We=e=>e+1,qi=e=>`
|
|
35
35
|
You have lifted an item in position ${We(e.source.index)}
|
|
36
|
-
`,
|
|
36
|
+
`,Qn=(e,t)=>{const n=e.droppableId===t.droppableId,r=We(e.index),o=We(t.index);return n?`
|
|
37
37
|
You have moved the item from position ${r}
|
|
38
38
|
to position ${o}
|
|
39
39
|
`:`
|
|
@@ -41,58 +41,58 @@ ${hn.current.stack}
|
|
|
41
41
|
in list ${e.droppableId}
|
|
42
42
|
to list ${t.droppableId}
|
|
43
43
|
in position ${o}
|
|
44
|
-
`},
|
|
44
|
+
`},er=(e,t,n)=>t.droppableId===n.droppableId?`
|
|
45
45
|
The item ${e}
|
|
46
46
|
has been combined with ${n.draggableId}`:`
|
|
47
47
|
The item ${e}
|
|
48
48
|
in list ${t.droppableId}
|
|
49
49
|
has been combined with ${n.draggableId}
|
|
50
50
|
in list ${n.droppableId}
|
|
51
|
-
`,
|
|
51
|
+
`,ji=e=>{const t=e.destination;if(t)return Qn(e.source,t);const n=e.combine;return n?er(e.draggableId,e.source,n):"You are over an area that cannot be dropped on"},tr=e=>`
|
|
52
52
|
The item has returned to its starting position
|
|
53
53
|
of ${We(e.index)}
|
|
54
|
-
`,Ue={dragHandleUsageInstructions:
|
|
54
|
+
`,Ue={dragHandleUsageInstructions:zi,onDragStart:qi,onDragUpdate:ji,onDragEnd:e=>{if(e.reason==="CANCEL")return`
|
|
55
55
|
Movement cancelled.
|
|
56
|
-
${
|
|
56
|
+
${tr(e.source)}
|
|
57
57
|
`;const t=e.destination,n=e.combine;return t?`
|
|
58
58
|
You have dropped the item.
|
|
59
|
-
${
|
|
59
|
+
${Qn(e.source,t)}
|
|
60
60
|
`:n?`
|
|
61
61
|
You have dropped the item.
|
|
62
|
-
${
|
|
62
|
+
${er(e.draggableId,e.source,n)}
|
|
63
63
|
`:`
|
|
64
64
|
The item has been dropped while not over a drop area.
|
|
65
|
-
${
|
|
66
|
-
`}};function ji(e,t){return!!(e===t||Number.isNaN(e)&&Number.isNaN(t))}function rr(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!ji(e[n],t[n]))return!1;return!0}function w(e,t){const n=D.useState(()=>({inputs:t,result:e()}))[0],r=D.useRef(!0),o=D.useRef(n),s=r.current||!!(t&&o.current.inputs&&rr(t,o.current.inputs))?o.current:{inputs:t,result:e()};return D.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}),F=(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),or=(e,t)=>Math.min(...t.map(n=>be(e,n))),ir=e=>t=>({x:e(t.x),y:e(t.y)});var Yi=(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}),sr=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}],Xi={top:0,right:0,bottom:0,left:0},Ki=(e,t)=>t?ve(e,t.scroll.diff.displacement):e,Ji=(e,t,n)=>n&&n.increasedBy?{...e,[t.end]:e[t.end]+n.increasedBy[t.line]}:e,Zi=(e,t)=>t&&t.shouldClipSubject?Yi(t.pageMarginBox,e):K(e);var le=({page:e,withPlaceholder:t,axis:n,frame:r})=>{const o=Ki(e.marginBox,r),i=Ji(o,n,t),s=Zi(i,r);return{page:e,withPlaceholder:t,active:s}},Ct=(e,t)=>{e.frame||(process.env.NODE_ENV,f());const n=e.frame,r=F(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=rr){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 cr=M(e=>e.reduce((t,n)=>(t[n.descriptor.id]=n,t),{})),ar=M(e=>e.reduce((t,n)=>(t[n.descriptor.id]=n,t),{})),He=M(e=>Object.values(e)),Qi=M(e=>Object.values(e));var ie=M((e,t)=>Qi(t).filter(r=>e===r.descriptor.droppableId).sort((r,o)=>r.descriptor.index-o.descriptor.index));function St(e){return e.at&&e.at.type==="REORDER"?e.at.destination:null}function ze(e){return e.at&&e.at.type==="COMBINE"?e.at.combine:null}var qe=M((e,t)=>t.filter(n=>n.descriptor.id!==e.descriptor.id)),es=({isMovingForward:e,draggable:t,destination:n,insideDestination:r,previousImpact:o})=>{if(!n.isCombineEnabled||!St(o))return null;function s(g){const h={type:"COMBINE",combine:{draggableId:g,droppableId:n.descriptor.id}};return{...o,at:h}}const c=o.displaced.all,a=c.length?c[0]:null;if(e)return a?s(a):null;const d=qe(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 lr={point:R,value:0},ye={invisible:{},visible:{},all:[]},ts={displaced:ye,displacedBy:lr,at:null};var X=(e,t)=>n=>e<=n&&n<=t,dr=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}},ns=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"},ur={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"};var rs=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 os=(e,t)=>{const n=t.frame?t.frame.scroll.diff.displacement:R;return ve(e,n)},is=(e,t,n)=>t.subject.active?n(t.subject.active)(e):!1,ss=(e,t,n)=>n(t)(e),wt=({target:e,destination:t,viewport:n,withDroppableDisplacement:r,isVisibleThroughFrameFn:o})=>{const i=r?os(e,t):e;return is(i,t,o)&&ss(i,n,o)},cs=e=>wt({...e,isVisibleThroughFrameFn:dr}),pr=e=>wt({...e,isVisibleThroughFrameFn:ns}),as=e=>wt({...e,isVisibleThroughFrameFn:rs(e.destination.axis)}),ls=(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 ds(e,t){const n=e.page.marginBox,r={top:t.point.y,right:0,bottom:0,left:t.point.x};return K(Dt(n,r))}function Ee({afterDragging:e,destination:t,displacedBy:n,viewport:r,forceShouldAnimate:o,last:i}){return e.reduce(function(c,a){const d=ds(a,n),p=a.descriptor.id;if(c.all.push(p),!cs({target:d,destination:t,viewport:r,withDroppableDisplacement:!0}))return c.invisible[a.descriptor.id]=!0,c;const u=ls(p,i,o),g={draggableId:p,shouldAnimate:u};return c.visible[p]=g,c},{all:[],visible:{},invisible:{}})}function us(e,t){if(!e.length)return 0;const n=e[e.length-1].descriptor.index;return t.inHomeList?n:n+1}function fr({insideDestination:e,inHomeList:t,displacedBy:n,destination:r}){const o=us(e,{inHomeList:t});return{displaced:ye,displacedBy:n,at:{type:"REORDER",destination:{droppableId:r.descriptor.id,index:o}}}}function je({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 fr({insideDestination:t,inHomeList:a,displacedBy:o,destination:n});const d=t.find(h=>h.descriptor.index===s);if(!d)return fr({insideDestination:t,inHomeList:a,displacedBy:o,destination:n});const p=qe(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 ps=({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},fs=({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},gs=({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=fs({isMovingForward:e,isInHomeList:t,location:d.destination,insideDestination:i});return l==null?null:je({draggable:n,insideDestination:i,destination:o,viewport:c,last:s.displaced,displacedBy:s.displacedBy,index:l})}const p=ps({isMovingForward:e,destination:o,displaced:s.displaced,draggables:r,combine:d.combine,afterCritical:a});return p==null?null:je({draggable:n,insideDestination:i,destination:o,viewport:c,last:s.displaced,displacedBy:s.displacedBy,index:p})},ms=({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},hs=({afterCritical:e,impact:t,draggables:n})=>{const r=ze(t);r||(process.env.NODE_ENV,f());const o=r.draggableId,i=n[o].page.borderBox.center,s=ms({displaced:t.displaced,afterCritical:e,combineWith:o,displacedBy:t.displacedBy});return $(i,s)};const gr=(e,t)=>t.margin[e.start]+t.borderBox[e.size]/2,bs=(e,t)=>t.margin[e.end]+t.borderBox[e.size]/2,_t=(e,t,n)=>t[e.crossAxisStart]+n.margin[e.crossAxisStart]+n.borderBox[e.crossAxisSize]/2,mr=({axis:e,moveRelativeTo:t,isMoving:n})=>oe(e.line,t.marginBox[e.end]+gr(e,n),_t(e,t.marginBox,n)),hr=({axis:e,moveRelativeTo:t,isMoving:n})=>oe(e.line,t.marginBox[e.start]-bs(e,n),_t(e,t.marginBox,n)),vs=({axis:e,moveInto:t,isMoving:n})=>oe(e.line,t.contentBox[e.start]+gr(e,n),_t(e,t.contentBox,n));var ys=({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 vs({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 hr({axis:c,moveRelativeTo:u.page,isMoving:s});const g=Ge(u.page,d.point);return hr({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 mr({axis:c,moveRelativeTo:u,isMoving:s})}return mr({axis:c,moveRelativeTo:l.page,isMoving:s})},At=(e,t)=>{const n=e.frame;return n?$(t,n.scroll.diff.displacement):t};const Es=({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"?ys({impact:e,draggable:t,draggables:r,droppable:n,afterCritical:o}):hs({impact:e,draggables:r,afterCritical:o})};var Ye=e=>{const t=Es(e),n=e.droppable;return n?At(n,t):t},br=(e,t)=>{const n=F(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 vr(e,t){return e.map(n=>t[n])}function Ds(e,t){for(let n=0;n<t.length;n++){const r=t[n].visible[e];if(r)return r}return null}var Ns=({impact:e,viewport:t,destination:n,draggables:r,maxScrollChange:o})=>{const i=br(t,$(t.scroll.current,o)),s=n.frame?Ct(n,$(n.frame.scroll.current,o)):n,c=e.displaced,a=Ee({afterDragging:vr(c.all,r),destination:n,displacedBy:e.displacedBy,viewport:i.frame,last:c,forceShouldAnimate:!1}),d=Ee({afterDragging:vr(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(h=>{const b=Ds(h,u);if(b){l[h]=b;return}p[h]=!0}),{...e,displaced:{all:c.all,invisible:p,visible:l}}},xs=(e,t)=>$(e.scroll.diff.displacement,t),Pt=({pageBorderBoxCenter:e,draggable:t,viewport:n})=>{const r=xs(n,e),o=F(r,t.page.borderBox.center);return $(t.client.borderBox.center,o)},yr=({draggable:e,destination:t,newPageBorderBoxCenter:n,viewport:r,withDroppableDisplacement:o,onlyOnMainAxis:i=!1})=>{const s=F(n,e.page.borderBox.center),a={target:ve(e.page.borderBox,s),destination:t,withDroppableDisplacement:o,viewport:r};return i?as(a):pr(a)},Is=({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=es({isMovingForward:e,draggable:t,destination:n,insideDestination:d,previousImpact:o})||gs({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(yr({draggable:t,destination:n,newPageBorderBoxCenter:u,viewport:i.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0}))return{clientSelection:Pt({pageBorderBoxCenter:u,draggable:t,viewport:i}),impact:l,scrollJumpRequest:null};const h=F(u,s),b=Ns({impact:l,viewport:i,destination:n,draggables:r,maxScrollChange:h});return{clientSelection:c,impact:b,scrollJumpRequest:h}};const k=e=>{const t=e.subject.active;return t||(process.env.NODE_ENV!=="production"?f(!1,"Cannot get clipped area from droppable"):f()),t};var Cs=({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=>dr(o.frame)(k(p))).filter(p=>{const l=k(p);return e?i[s.crossAxisEnd]<l[s.crossAxisEnd]:l[s.crossAxisStart]<i[s.crossAxisStart]}).filter(p=>{const l=k(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=k(p)[s.crossAxisStart],g=k(l)[s.crossAxisStart];return e?u-g:g-u}).filter((p,l,u)=>k(p)[s.crossAxisStart]===k(u[0])[s.crossAxisStart]);if(!a.length)return null;if(a.length===1)return a[0];const d=a.filter(p=>X(k(p)[s.start],k(p)[s.end])(t[s.line]));return d.length===1?d[0]:d.length>1?d.sort((p,l)=>k(p)[s.start]-k(l)[s.start])[0]:a.sort((p,l)=>{const u=or(t,sr(k(p))),g=or(t,sr(k(l)));return u!==g?u-g:k(p)[s.start]-k(l)[s.start]})[0]};const Er=(e,t)=>{const n=e.page.borderBox.center;return re(e.descriptor.id,t)?F(n,t.displacedBy.point):n},Ss=(e,t)=>{const n=e.page.borderBox;return re(e.descriptor.id,t)?ve(n,ae(t.displacedBy.point)):n};var Os=({pageBorderBoxCenter:e,viewport:t,destination:n,insideDestination:r,afterCritical:o})=>r.filter(s=>pr({target:Ss(s,o),destination:n,viewport:t.frame,withDroppableDisplacement:!0})).sort((s,c)=>{const a=be(e,At(n,Er(s,o))),d=be(e,At(n,Er(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)},Dr=(e,t)=>({...e,scroll:{...e.scroll,max:t}}),Nr=(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=Dr(r,c),d=le({page:e.subject.page,withPlaceholder:s,axis:e.axis,frame:a});return{...e,subject:d,frame:a}},_s=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=Dr(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:lr,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:Nr(i,r,o);return yr({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 je({draggable:r,insideDestination:n,destination:i,viewport:s,displacedBy:p,last:ye,index:d})},Ps=({isMovingForward:e,previousPageBorderBoxCenter:t,draggable:n,isOver:r,draggables:o,droppables:i,viewport:s,afterCritical:c})=>{const a=Cs({isMovingForward:e,pageBorderBoxCenter:t,source:r,droppables:i,viewport:s});if(!a)return null;const d=ie(a.descriptor.id,o),p=Os({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:Pt({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 Ts=(e,t)=>{const n=W(e);return n?t[n]:null};var Bs=({state:e,type:t})=>{const n=Ts(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?Is({isMovingForward:a,previousPageBorderBoxCenter:p,draggable:d,destination:i,draggables:l,viewport:e.viewport,previousClientSelection:e.current.client.selection,previousImpact:e.impact,afterCritical:e.afterCritical}):Ps({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 xr(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 Vs(e,t){return e.left<t.right&&e.right>t.left&&e.top<t.bottom&&e.bottom>t.top}function Ls({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||!Vs(e,i))return!1;if(xr(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:Ls({pageBorderBox:e,draggable:t,candidates:r}):null}const Ir=(e,t)=>K(ve(e,t));var Ms=(e,t)=>{const n=e.frame;return n?Ir(t,n.scroll.diff.value):t};function Cr({displaced:e,id:t}){return!!(e.visible[t]||e.invisible[t])}function $s({draggable:e,closest:t,inHomeList:n}){return t?n&&t.descriptor.index>e.descriptor.index?t.descriptor.index-1:t.descriptor.index:null}var Gs=({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=qe(t,r).find(b=>{const m=b.descriptor.id,E=b.page.borderBox.center[c.line],y=re(m,s),S=Cr({displaced:o,id:m});return y?S?l<=E:p<E-d:S?l<=E+d:p<E})||null,h=$s({draggable:t,closest:g,inHomeList:de(t,n)});return je({draggable:t,insideDestination:r,destination:n,viewport:i,last:o,displacedBy:a,index:h})};const ks=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=qe(e,o).find(h=>{const b=h.descriptor.id,m=h.page.borderBox,y=m[s.size]/ks,S=re(b,i),I=Cr({displaced:n.displaced,id:b});return S?I?p>m[s.start]+y&&p<m[s.end]-y:d>m[s.start]-a+y&&d<m[s.end]-a-y:I?p>m[s.start]+a+y&&p<m[s.end]+a-y:d>m[s.start]+y&&d<m[s.end]-y});return u?{displacedBy:c,displaced:n.displaced,at:{type:"COMBINE",combine:{draggableId:u.descriptor.id,droppableId:r.descriptor.id}}}:null},Sr=({pageOffset:e,draggable:t,draggables:n,droppables:r,previousImpact:o,viewport:i,afterCritical:s})=>{const c=Ir(t.page.borderBox,e),a=Rs({pageBorderBox:c,draggable:t,droppables:r});if(!a)return ts;const d=r[a],p=ie(d.descriptor.id,n),l=Ms(d,c);return Fs({pageBorderBoxWithDroppableScroll:l,draggable:t,previousImpact:o,destination:d,insideDestination:p,afterCritical:s})||Gs({pageBorderBoxWithDroppableScroll:l,draggable:t,destination:d,insideDestination:p,last:o.displaced,viewport:i,afterCritical:s})},Tt=(e,t)=>({...e,[t.descriptor.id]:t});const Ws=({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=_s(i);return Tt(n,s)};var Us=({draggable:e,draggables:t,droppables:n,previousImpact:r,impact:o})=>{const i=Ws({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=Nr(c,e,t);return Tt(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=F(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],h=o||Sr({pageOffset:l.offset,draggable:g,draggables:c.draggables,droppables:c.droppables,previousImpact:e.impact,viewport:s,afterCritical:e.afterCritical}),b=Us({draggable:g,impact:h,previousImpact:e.impact,draggables:c.draggables,droppables:c.droppables});return{...e,current:u,dimensions:{draggables:c.draggables,droppables:b},impact:h,viewport:s,scrollJumpRequest:i||null,forceShouldAnimate:i?!1:null}};function Hs(e,t){return e.map(n=>t[n])}var Or=({impact:e,viewport:t,draggables:n,destination:r,forceShouldAnimate:o})=>{const i=e.displaced,s=Hs(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 Pt({pageBorderBoxCenter:s,draggable:t,viewport:o})},_r=({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=Or({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})},zs=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:zs(e.descriptor)}},afterCritical:d}},qs=(e,t)=>({draggables:e.draggables,droppables:Tt(e.droppables,t)});const xe=e=>{process.env.NODE_ENV},Ie=e=>{process.env.NODE_ENV};var js=({draggable:e,offset:t,initialWindowScroll:n})=>{const r=Ge(e.client,t),o=ke(r,n);return{...e,placeholder:{...e.placeholder,client:r},client:r,page:o}},Ys=e=>{const t=e.frame;return t||(process.env.NODE_ENV!=="production"?f(!1,"Expected Droppable to have a frame"):f()),t},Xs=({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=Ys(s).scroll.diff.value,d=$(r,a);return js({draggable:o,offset:d,initialWindowScroll:n.scroll.initial})})},Ks=({state:e,published:t})=>{xe();const n=t.modified.map(E=>{const y=e.dimensions.droppables[E.droppableId];return Ct(y,E.scroll)}),r={...e.dimensions.droppables,...cr(n)},o=ar(Xs({additions:t.additions,updatedDroppables:r,viewport:e.viewport})),i={...e.dimensions.draggables,...o};t.removals.forEach(E=>{delete i[E]});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,h=Sr({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:h,onLiftImpact:l,dimensions:s,afterCritical:u,forceShouldAnimate:!1};return e.phase==="COLLECTING"?b:{...b,phase:"DROP_PENDING",reason:e.reason,isWaiting:!1}};const Bt=e=>e.movementMode==="SNAP",Vt=(e,t,n)=>{const r=qs(e.dimensions,t);return!Bt(e)||n?Ne({state:e,dimensions:r}):_r({state:e,dimensions:r})};function Lt(e){return e.isDragging&&e.movementMode==="SNAP"?{...e,scrollJumpRequest:null}:e}const Pr={phase:"IDLE",completed:null,shouldFlush:!1};var Js=(e=Pr,t)=>{if(t.type==="FLUSH")return{...Pr,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()),Ks({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:Bt(e)?e.impact:null})}if(t.type==="UPDATE_DROPPABLE_SCROLL"){if(e.phase==="DROP_PENDING"||e.phase==="COLLECTING")return Lt(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=Ct(o,r);return Vt(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
|
-
but it is already ${String(o.isEnabled)}`):f());const i={...o,isEnabled:r};return
|
|
68
|
-
but it is already ${String(o.isCombineEnabled)}`):f());const i={...o,isCombineEnabled:r};return
|
|
65
|
+
${tr(e.source)}
|
|
66
|
+
`}};function Yi(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(!Yi(e[n],t[n]))return!1;return!0}function w(e,t){const n=D.useState(()=>({inputs:t,result:e()}))[0],r=D.useRef(!0),o=D.useRef(n),s=r.current||!!(t&&o.current.inputs&&nr(t,o.current.inputs))?o.current:{inputs:t,result:e()};return D.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}),F=(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 Xi=(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}],Ki={top:0,right:0,bottom:0,left:0},Ji=(e,t)=>t?ve(e,t.scroll.diff.displacement):e,Zi=(e,t,n)=>n&&n.increasedBy?{...e,[t.end]:e[t.end]+n.increasedBy[t.line]}:e,Qi=(e,t)=>t&&t.shouldClipSubject?Xi(t.pageMarginBox,e):K(e);var le=({page:e,withPlaceholder:t,axis:n,frame:r})=>{const o=Ji(e.marginBox,r),i=Zi(o,n,t),s=Qi(i,r);return{page:e,withPlaceholder:t,active:s}},It=(e,t)=>{e.frame||(process.env.NODE_ENV,f());const n=e.frame,r=F(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)),es=M(e=>Object.values(e));var ie=M((e,t)=>es(t).filter(r=>e===r.descriptor.droppableId).sort((r,o)=>r.descriptor.index-o.descriptor.index));function Ct(e){return e.at&&e.at.type==="REORDER"?e.at.destination:null}function ze(e){return e.at&&e.at.type==="COMBINE"?e.at.combine:null}var qe=M((e,t)=>t.filter(n=>n.descriptor.id!==e.descriptor.id)),ts=({isMovingForward:e,draggable:t,destination:n,insideDestination:r,previousImpact:o})=>{if(!n.isCombineEnabled||!Ct(o))return null;function s(g){const h={type:"COMBINE",combine:{draggableId:g,droppableId:n.descriptor.id}};return{...o,at:h}}const c=o.displaced.all,a=c.length?c[0]:null;if(e)return a?s(a):null;const d=qe(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:[]},ns={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}},rs=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 St={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 os=e=>t=>{const n=X(t.top,t.bottom),r=X(t.left,t.right);return o=>e===St?n(o.top)&&n(o.bottom):r(o.left)&&r(o.right)};const is=(e,t)=>{const n=t.frame?t.frame.scroll.diff.displacement:R;return ve(e,n)},ss=(e,t,n)=>t.subject.active?n(t.subject.active)(e):!1,cs=(e,t,n)=>n(t)(e),Ot=({target:e,destination:t,viewport:n,withDroppableDisplacement:r,isVisibleThroughFrameFn:o})=>{const i=r?is(e,t):e;return ss(i,t,o)&&cs(i,n,o)},as=e=>Ot({...e,isVisibleThroughFrameFn:lr}),ur=e=>Ot({...e,isVisibleThroughFrameFn:rs}),ls=e=>Ot({...e,isVisibleThroughFrameFn:os(e.destination.axis)}),ds=(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 us(e,t){const n=e.page.marginBox,r={top:t.point.y,right:0,bottom:0,left:t.point.x};return K(Et(n,r))}function Ee({afterDragging:e,destination:t,displacedBy:n,viewport:r,forceShouldAnimate:o,last:i}){return e.reduce(function(c,a){const d=us(a,n),p=a.descriptor.id;if(c.all.push(p),!as({target:d,destination:t,viewport:r,withDroppableDisplacement:!0}))return c.invisible[a.descriptor.id]=!0,c;const u=ds(p,i,o),g={draggableId:p,shouldAnimate:u};return c.visible[p]=g,c},{all:[],visible:{},invisible:{}})}function ps(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=ps(e,{inHomeList:t});return{displaced:ye,displacedBy:n,at:{type:"REORDER",destination:{droppableId:r.descriptor.id,index:o}}}}function je({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(h=>h.descriptor.index===s);if(!d)return pr({insideDestination:t,inHomeList:a,displacedBy:o,destination:n});const p=qe(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 fs=({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},gs=({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},ms=({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=gs({isMovingForward:e,isInHomeList:t,location:d.destination,insideDestination:i});return l==null?null:je({draggable:n,insideDestination:i,destination:o,viewport:c,last:s.displaced,displacedBy:s.displacedBy,index:l})}const p=fs({isMovingForward:e,destination:o,displaced:s.displaced,draggables:r,combine:d.combine,afterCritical:a});return p==null?null:je({draggable:n,insideDestination:i,destination:o,viewport:c,last:s.displaced,displacedBy:s.displacedBy,index:p})},hs=({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},bs=({afterCritical:e,impact:t,draggables:n})=>{const r=ze(t);r||(process.env.NODE_ENV,f());const o=r.draggableId,i=n[o].page.borderBox.center,s=hs({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,vs=(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]-vs(e,n),wt(e,t.marginBox,n)),ys=({axis:e,moveInto:t,isMoving:n})=>oe(e.line,t.contentBox[e.start]+fr(e,n),wt(e,t.contentBox,n));var Es=({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 ys({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})},_t=(e,t)=>{const n=e.frame;return n?$(t,n.scroll.diff.displacement):t};const Ds=({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"?Es({impact:e,draggable:t,draggables:r,droppable:n,afterCritical:o}):bs({impact:e,draggables:r,afterCritical:o})};var Ye=e=>{const t=Ds(e),n=e.droppable;return n?_t(n,t):t},hr=(e,t)=>{const n=F(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 Ns(e,t){for(let n=0;n<t.length;n++){const r=t[n].visible[e];if(r)return r}return null}var xs=({impact:e,viewport:t,destination:n,draggables:r,maxScrollChange:o})=>{const i=hr(t,$(t.scroll.current,o)),s=n.frame?It(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(h=>{const b=Ns(h,u);if(b){l[h]=b;return}p[h]=!0}),{...e,displaced:{all:c.all,invisible:p,visible:l}}},Is=(e,t)=>$(e.scroll.diff.displacement,t),At=({pageBorderBoxCenter:e,draggable:t,viewport:n})=>{const r=Is(n,e),o=F(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=F(n,e.page.borderBox.center),a={target:ve(e.page.borderBox,s),destination:t,withDroppableDisplacement:o,viewport:r};return i?ls(a):ur(a)},Cs=({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=ts({isMovingForward:e,draggable:t,destination:n,insideDestination:d,previousImpact:o})||ms({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 h=F(u,s),b=xs({impact:l,viewport:i,destination:n,draggables:r,maxScrollChange:h});return{clientSelection:c,impact:b,scrollJumpRequest:h}};const k=e=>{const t=e.subject.active;return t||(process.env.NODE_ENV!=="production"?f(!1,"Cannot get clipped area from droppable"):f()),t};var Ss=({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)(k(p))).filter(p=>{const l=k(p);return e?i[s.crossAxisEnd]<l[s.crossAxisEnd]:l[s.crossAxisStart]<i[s.crossAxisStart]}).filter(p=>{const l=k(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=k(p)[s.crossAxisStart],g=k(l)[s.crossAxisStart];return e?u-g:g-u}).filter((p,l,u)=>k(p)[s.crossAxisStart]===k(u[0])[s.crossAxisStart]);if(!a.length)return null;if(a.length===1)return a[0];const d=a.filter(p=>X(k(p)[s.start],k(p)[s.end])(t[s.line]));return d.length===1?d[0]:d.length>1?d.sort((p,l)=>k(p)[s.start]-k(l)[s.start])[0]:a.sort((p,l)=>{const u=rr(t,ir(k(p))),g=rr(t,ir(k(l)));return u!==g?u-g:k(p)[s.start]-k(l)[s.start]})[0]};const yr=(e,t)=>{const n=e.page.borderBox.center;return re(e.descriptor.id,t)?F(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 ws=({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,_t(n,yr(s,o))),d=be(e,_t(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 _s=(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=_s(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}},As=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 Ps=({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 je({draggable:r,insideDestination:n,destination:i,viewport:s,displacedBy:p,last:ye,index:d})},Ts=({isMovingForward:e,previousPageBorderBoxCenter:t,draggable:n,isOver:r,draggables:o,droppables:i,viewport:s,afterCritical:c})=>{const a=Ss({isMovingForward:e,pageBorderBoxCenter:t,source:r,droppables:i,viewport:s});if(!a)return null;const d=ie(a.descriptor.id,o),p=ws({pageBorderBoxCenter:t,viewport:s,destination:a,insideDestination:d,afterCritical:c}),l=Ps({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 Bs=(e,t)=>{const n=W(e);return n?t[n]:null};var Vs=({state:e,type:t})=>{const n=Bs(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?Cs({isMovingForward:a,previousPageBorderBoxCenter:p,draggable:d,destination:i,draggables:l,viewport:e.viewport,previousClientSelection:e.current.client.selection,previousImpact:e.impact,afterCritical:e.afterCritical}):Ts({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 Ls(e,t){return e.left<t.right&&e.right>t.left&&e.top<t.bottom&&e.bottom>t.top}function Rs({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 Ms({pageBorderBox:e,draggable:t,droppables:n}){const r=He(n).filter(o=>{if(!o.isEnabled)return!1;const i=o.subject.active;if(!i||!Ls(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:Rs({pageBorderBox:e,draggable:t,candidates:r}):null}const xr=(e,t)=>K(ve(e,t));var $s=(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 Gs({draggable:e,closest:t,inHomeList:n}){return t?n&&t.descriptor.index>e.descriptor.index?t.descriptor.index-1:t.descriptor.index:null}var ks=({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=qe(t,r).find(b=>{const m=b.descriptor.id,E=b.page.borderBox.center[c.line],y=re(m,s),S=Ir({displaced:o,id:m});return y?S?l<=E:p<E-d:S?l<=E+d:p<E})||null,h=Gs({draggable:t,closest:g,inHomeList:de(t,n)});return je({draggable:t,insideDestination:r,destination:n,viewport:i,last:o,displacedBy:a,index:h})};const Fs=4;var Ws=({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=qe(e,o).find(h=>{const b=h.descriptor.id,m=h.page.borderBox,y=m[s.size]/Fs,S=re(b,i),I=Ir({displaced:n.displaced,id:b});return S?I?p>m[s.start]+y&&p<m[s.end]-y:d>m[s.start]-a+y&&d<m[s.end]-a-y:I?p>m[s.start]+a+y&&p<m[s.end]+a-y:d>m[s.start]+y&&d<m[s.end]-y});return u?{displacedBy:c,displaced:n.displaced,at:{type:"COMBINE",combine:{draggableId:u.descriptor.id,droppableId:r.descriptor.id}}}:null},Cr=({pageOffset:e,draggable:t,draggables:n,droppables:r,previousImpact:o,viewport:i,afterCritical:s})=>{const c=xr(t.page.borderBox,e),a=Ms({pageBorderBox:c,draggable:t,droppables:r});if(!a)return ns;const d=r[a],p=ie(d.descriptor.id,n),l=$s(d,c);return Ws({pageBorderBoxWithDroppableScroll:l,draggable:t,previousImpact:o,destination:d,insideDestination:p,afterCritical:s})||ks({pageBorderBoxWithDroppableScroll:l,draggable:t,destination:d,insideDestination:p,last:o.displaced,viewport:i,afterCritical:s})},Pt=(e,t)=>({...e,[t.descriptor.id]:t});const Us=({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=As(i);return Pt(n,s)};var Hs=({draggable:e,draggables:t,droppables:n,previousImpact:r,impact:o})=>{const i=Us({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 Pt(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=F(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],h=o||Cr({pageOffset:l.offset,draggable:g,draggables:c.draggables,droppables:c.droppables,previousImpact:e.impact,viewport:s,afterCritical:e.afterCritical}),b=Hs({draggable:g,impact:h,previousImpact:e.impact,draggables:c.draggables,droppables:c.droppables});return{...e,current:u,dimensions:{draggables:c.draggables,droppables:b},impact:h,viewport:s,scrollJumpRequest:i||null,forceShouldAnimate:i?!1:null}};function zs(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=zs(i.all,n),c=Ee({afterDragging:s,destination:r,displacedBy:e.displacedBy,viewport:t.frame,forceShouldAnimate:o,last:i});return{...e,displaced:c}},Or=({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})},wr=({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=Or({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})},qs=e=>({index:e.index,droppableId:e.droppableId}),_r=({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:qs(e.descriptor)}},afterCritical:d}},js=(e,t)=>({draggables:e.draggables,droppables:Pt(e.droppables,t)});const xe=e=>{process.env.NODE_ENV},Ie=e=>{process.env.NODE_ENV};var Ys=({draggable:e,offset:t,initialWindowScroll:n})=>{const r=Ge(e.client,t),o=ke(r,n);return{...e,placeholder:{...e.placeholder,client:r},client:r,page:o}},Xs=e=>{const t=e.frame;return t||(process.env.NODE_ENV!=="production"?f(!1,"Expected Droppable to have a frame"):f()),t},Ks=({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=Xs(s).scroll.diff.value,d=$(r,a);return Ys({draggable:o,offset:d,initialWindowScroll:n.scroll.initial})})},Js=({state:e,published:t})=>{xe();const n=t.modified.map(E=>{const y=e.dimensions.droppables[E.droppableId];return It(y,E.scroll)}),r={...e.dimensions.droppables,...sr(n)},o=cr(Ks({additions:t.additions,updatedDroppables:r,viewport:e.viewport})),i={...e.dimensions.draggables,...o};t.removals.forEach(E=>{delete i[E]});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}=_r({draggable:d,home:p,draggables:i,viewport:e.viewport}),g=a&&a.isCombineEnabled?e.impact:l,h=Cr({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:h,onLiftImpact:l,dimensions:s,afterCritical:u,forceShouldAnimate:!1};return e.phase==="COLLECTING"?b:{...b,phase:"DROP_PENDING",reason:e.reason,isWaiting:!1}};const Tt=e=>e.movementMode==="SNAP",Bt=(e,t,n)=>{const r=js(e.dimensions,t);return!Tt(e)||n?Ne({state:e,dimensions:r}):wr({state:e,dimensions:r})};function Vt(e){return e.isDragging&&e.movementMode==="SNAP"?{...e,scrollJumpRequest:null}:e}const Ar={phase:"IDLE",completed:null,shouldFlush:!1};var Zs=(e=Ar,t)=>{if(t.type==="FLUSH")return{...Ar,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}=_r({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()),Js({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:Tt(e)?e.impact:null})}if(t.type==="UPDATE_DROPPABLE_SCROLL"){if(e.phase==="DROP_PENDING"||e.phase==="COLLECTING")return Vt(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=It(o,r);return Bt(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
|
+
but it is already ${String(o.isEnabled)}`):f());const i={...o,isEnabled:r};return Bt(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 Bt(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 Vt(e);const r=hr(e.viewport,n);return Tt(e)?wr({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=Vs({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 P(e,t){return e instanceof Object&&"type"in e&&e.type===t}const Qs=e=>({type:"BEFORE_INITIAL_CAPTURE",payload:e}),ec=e=>({type:"LIFT",payload:e}),tc=e=>({type:"INITIAL_PUBLISH",payload:e}),nc=e=>({type:"PUBLISH_WHILE_DRAGGING",payload:e}),rc=()=>({type:"COLLECTION_STARTING",payload:null}),oc=e=>({type:"UPDATE_DROPPABLE_SCROLL",payload:e}),ic=e=>({type:"UPDATE_DROPPABLE_IS_ENABLED",payload:e}),sc=e=>({type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:e}),Pr=e=>({type:"MOVE",payload:e}),cc=e=>({type:"MOVE_BY_WINDOW_SCROLL",payload:e}),ac=e=>({type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:e}),lc=()=>({type:"MOVE_UP",payload:null}),dc=()=>({type:"MOVE_DOWN",payload:null}),uc=()=>({type:"MOVE_RIGHT",payload:null}),pc=()=>({type:"MOVE_LEFT",payload:null}),Lt=()=>({type:"FLUSH",payload:null}),fc=e=>({type:"DROP_ANIMATE",payload:e}),Rt=e=>({type:"DROP_COMPLETE",payload:e}),Tr=e=>({type:"DROP",payload:e}),gc=e=>({type:"DROP_PENDING",payload:e}),Br=()=>({type:"DROP_ANIMATION_FINISHED",payload:null});function mc(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"&&B(`
|
|
69
69
|
Detected non-consecutive <Draggable /> indexes.
|
|
70
70
|
|
|
71
71
|
(This can cause unexpected bugs)
|
|
72
72
|
|
|
73
73
|
${r}
|
|
74
|
-
`)}function
|
|
74
|
+
`)}function hc(e,t){if(process.env.NODE_ENV!=="production"){const n=ie(e.droppable.id,t.draggables);mc(n)}}var bc=e=>({getState:t,dispatch:n})=>r=>o=>{if(!P(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(Lt()),n(Qs({draggableId:i,movementMode:c}));const p={draggableId:i,scrollOptions:{shouldPublishImmediately:c==="SNAP"}},{critical:l,dimensions:u,viewport:g}=e.startPublishing(p);hc(l,u),n(tc({critical:l,dimensions:u,clientSelection:s,movementMode:c,viewport:g}))},vc=e=>()=>t=>n=>{P(n,"INITIAL_PUBLISH")&&e.dragging(),P(n,"DROP_ANIMATE")&&e.dropping(n.payload.completed.result.reason),(P(n,"FLUSH")||P(n,"DROP_COMPLETE"))&&e.resting(),t(n)};const Mt={outOfTheWay:"cubic-bezier(0.2, 0, 0, 1)",drop:"cubic-bezier(.2,1,.1,1)"},Ce={opacity:{drop:0,combining:.7},scale:{drop:.75}},Vr={outOfTheWay:.2,minDropTime:.33,maxDropTime:.55},ce=`${Vr.outOfTheWay}s ${Mt.outOfTheWay}`,Se={fluid:`opacity ${ce}`,snap:`transform ${ce}, opacity ${ce}`,drop:e=>{const t=`${e}s ${Mt.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)`,$t={moveTo:Lr,drop:(e,t)=>{const n=Lr(e);if(n)return t?`${n} scale(${Ce.scale.drop})`:n}},{minDropTime:Gt,maxDropTime:Rr}=Vr,yc=Rr-Gt,Mr=1500,Ec=.6;var Dc=({current:e,destination:t,reason:n})=>{const r=be(e,t);if(r<=0)return Gt;if(r>=Mr)return Rr;const o=r/Mr,i=Gt+yc*o,s=n==="CANCEL"?i*Ec:i;return Number(s.toFixed(2))},Nc=({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=Or({impact:e,draggable:t,draggables:i,afterCritical:o,droppable:a||d,viewport:r});return F(p,t.client.borderBox.center)},xc=({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 Ic=({getState:e,dispatch:t})=>n=>r=>{if(!P(r,"DROP")){n(r);return}const o=e(),i=r.payload.reason;if(o.phase==="COLLECTING"){t(gc({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}=xc({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?Ct(p):null,g=l?ze(p):null,h={index:c.draggable.index,droppableId:c.droppable.id},b={draggableId:d.descriptor.id,type:d.descriptor.type,source:h,reason:i,mode:o.movementMode,destination:u,combine:g},m=Nc({impact:p,draggable:d,dimensions:a,viewport:o.viewport,afterCritical:o.afterCritical}),E={critical:o.critical,afterCritical:o.afterCritical,result:b,impact:p};if(!(!ne(o.current.client.offset,m)||!!b.combine)){t(Rt({completed:E}));return}const S=Dc({current:o.current.client.offset,destination:m,reason:i});t(fc({newHomeClientOffset:m,dropDuration:S,completed:E}))};var $r=()=>({x:window.pageXOffset,y:window.pageYOffset});function Cc(e){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:t=>{t.target!==window&&t.target!==window.document||e()}}}function Sc({onWindowScroll:e}){function t(){e($r())}const n=me(t),r=Cc(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=>P(e,"DROP_COMPLETE")||P(e,"DROP_ANIMATE")||P(e,"FLUSH"),wc=e=>{const t=Sc({onWindowScroll:n=>{e.dispatch(cc({newScroll:n}))}});return n=>r=>{!t.isActive()&&P(r,"INITIAL_PUBLISH")&&t.start(),t.isActive()&&Oc(r)&&t.stop(),n(r)}};var _c=e=>{let t=!1,n=!1;const r=setTimeout(()=>{n=!0}),o=i=>{if(t){process.env.NODE_ENV!=="production"&&B("Announcement already made. Not making a second announcement");return}if(n){process.env.NODE_ENV!=="production"&&B(`
|
|
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},
|
|
77
|
+
`);return}t=!0,e(i),clearTimeout(r)};return o.wasCalled=()=>t,o},Ac=()=>{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 Pc=(e,t)=>e==null&&t==null?!0:e==null||t==null?!1:e.droppableId===t.droppableId&&e.index===t.index,Tc=(e,t)=>e==null&&t==null?!0:e==null||t==null?!1:e.draggableId===t.draggableId&&e.droppableId===t.droppableId,Bc=(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},Oe=(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 kt(e,t,n,r){if(!e){n(r(t));return}const o=_c(n);e(t,{announce:o}),o.wasCalled()||n(r(t))}var Vc=(e,t)=>{const n=Ac();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()),Oe("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()),Oe("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(()=>{Oe("onDragStart",()=>kt(e().onDragStart,g,t,Ue.onDragStart))})},c=(l,u)=>{const g=Ct(u),h=ze(u);r||(process.env.NODE_ENV!=="production"?f(!1,"Cannot fire onDragMove when onDragStart has not been called"):f());const b=!Bc(l,r.lastCritical);b&&(r.lastCritical=l);const m=!Pc(r.lastLocation,g);m&&(r.lastLocation=g);const E=!Tc(r.lastCombine,h);if(E&&(r.lastCombine=h),!b&&!m&&!E)return;const y={...Xe(l,r.mode),combine:h,destination:g};n.add(()=>{Oe("onDragUpdate",()=>kt(e().onDragUpdate,y,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,Oe("onDragEnd",()=>kt(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)}}},Lc=(e,t)=>{const n=Vc(e,t);return r=>o=>i=>{if(P(i,"BEFORE_INITIAL_CAPTURE")){n.beforeCapture(i.payload.draggableId,i.payload.movementMode);return}if(P(i,"INITIAL_PUBLISH")){const c=i.payload.critical;n.beforeStart(c,i.payload.movementMode),o(i),n.start(c,i.payload.movementMode);return}if(P(i,"DROP_COMPLETE")){const c=i.payload.completed.result;n.flush(),o(i),n.drop(c);return}if(o(i),P(i,"FLUSH")){n.abort();return}const s=r.getState();s.phase==="DRAGGING"&&n.update(s.critical,s.impact)}};const Rc=e=>t=>n=>{if(!P(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}))},Mc=e=>{let t=null,n=null;function r(){n&&(cancelAnimationFrame(n),n=null),t&&(t(),t=null)}return o=>i=>{if((P(i,"FLUSH")||P(i,"DROP_COMPLETE")||P(i,"DROP_ANIMATION_FINISHED"))&&r(),o(i),!P(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 $c=e=>()=>t=>n=>{(P(n,"DROP_COMPLETE")||P(n,"FLUSH")||P(n,"DROP_ANIMATE"))&&e.stopPublishing(),t(n)},Gc=e=>{let t=!1;return()=>n=>r=>{if(P(r,"INITIAL_PUBLISH")){t=!0,e.tryRecordFocus(r.payload.critical.draggable.id),n(r),e.tryRestoreFocusRecorded();return}if(n(r),!!t){if(P(r,"FLUSH")){t=!1,e.tryRestoreFocusRecorded();return}if(P(r,"DROP_COMPLETE")){t=!1;const o=r.payload.completed.result;o.combine&&e.tryShiftRecord(o.draggableId,o.combine.draggableId),e.tryRestoreFocusRecorded()}}}};const kc=e=>P(e,"DROP_COMPLETE")||P(e,"DROP_ANIMATE")||P(e,"FLUSH");var Fc=e=>t=>n=>r=>{if(kc(r)){e.stop(),n(r);return}if(P(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 Wc=e=>t=>n=>{if(t(n),!P(n,"PUBLISH_WHILE_DRAGGING"))return;const r=e.getState();r.phase==="DROP_PENDING"&&(r.isWaiting||e.dispatch(Tr({reason:r.reason})))},Uc=process.env.NODE_ENV!=="production"&&typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({name:"@hello-pangea/dnd"}):xn;var Hc=({dimensionMarshal:e,focusMarshal:t,styleMarshal:n,getResponders:r,announce:o,autoScroller:i})=>En(Zs,Uc(ko(vc(n),$c(e),bc(e),Ic,Rc,Mc,Wc,Fc(i),wc,Gc(t),Lc(r,o))));const Ft=()=>({additions:{},removals:{},modified:{}});function zc({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(h=>e.draggable.getById(h).getDimension(R)).sort((h,b)=>h.descriptor.index-b.descriptor.index),u=Object.keys(p).map(h=>{const m=e.droppable.getById(h).callbacks.getScrollWhileDragging();return{droppableId:h,scroll:m}}),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=F({x:t,y:e},{x:r,y:n});return{x:Math.max(0,o.x),y:Math.max(0,o.y)}},kr=()=>{const e=document.documentElement;return e||(process.env.NODE_ENV!=="production"?f(!1,"Cannot find document.documentElement"):f()),e},Fr=()=>{const e=kr();return Gr({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,width:e.clientWidth,height:e.clientHeight})},qc=()=>{const e=$r(),t=Fr(),n=e.y,r=e.x,o=kr(),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=qc(),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"&&B(`
|
|
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
|
|
|
81
81
|
See https://github.com/hello-pangea/dnd/blob/main/docs/patterns/virtual-lists.md
|
|
82
|
-
`),!1):!0}var
|
|
82
|
+
`),!1):!0}var Yc=(e,t)=>{let n=null;const r=zc({callbacks:{publish:t.publishWhileDragging,collectionStarting:t.collectionStarting},registry:e}),o=(u,g)=>{e.droppable.exists(u)||(process.env.NODE_ENV!=="production"?f(!1,`Cannot update is enabled flag of Droppable ${u} as it is not registered`):f()),n&&t.updateDroppableIsEnabled({id:u,isEnabled:g})},i=(u,g)=>{n&&(e.droppable.exists(u)||(process.env.NODE_ENV!=="production"?f(!1,`Cannot update isCombineEnabled flag of Droppable ${u} as it is not registered`):f()),t.updateDroppableIsCombineEnabled({id:u,isCombineEnabled:g}))},s=(u,g)=>{n&&(e.droppable.exists(u)||(process.env.NODE_ENV!=="production"?f(!1,`Cannot update the scroll on Droppable ${u} as it is not registered`):f()),t.updateDroppableScroll({id:u,newScroll:g}))},c=(u,g)=>{n&&e.droppable.getById(u).callbacks.scroll(g)},a=()=>{if(!n)return;r.stop();const u=n.critical.droppable;e.droppable.getAllByType(u.type).forEach(g=>g.callbacks.dragStopped()),n.unsubscribe(),n=null},d=u=>{n||(process.env.NODE_ENV!=="production"?f(!1,"Should only be subscribed when a collection is occurring"):f());const g=n.critical.draggable;u.type==="ADDITION"&&Wr(e,g,u.value)&&r.add(u.value),u.type==="REMOVAL"&&Wr(e,g,u.value)&&r.remove(u.value)};return{updateDroppableIsEnabled:o,updateDroppableIsCombineEnabled:i,scrollDroppable:c,updateDroppableScroll:s,startPublishing:u=>{n&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot start capturing critical dimensions as there is already a collection"):f());const g=e.draggable.getById(u.draggableId),h=e.droppable.getById(g.descriptor.droppableId),b={draggable:g.descriptor,droppable:h.descriptor},m=e.subscribe(d);return n={critical:b,unsubscribe:m},jc({critical:b,registry:e,scrollOptions:u.scrollOptions})},stopPublishing:a}},Ur=(e,t)=>e.phase==="IDLE"?!0:e.phase!=="DROP_ANIMATING"||e.completed.result.draggableId===t?!1:e.completed.result.reason==="DROP",Xc=e=>{window.scrollBy(e.x,e.y)};const Kc=M(e=>He(e).filter(t=>!(!t.isEnabled||!t.frame))),Jc=(e,t)=>Kc(t).find(r=>(r.frame||(process.env.NODE_ENV!=="production"?f(!1,"Invalid result"):f()),Nr(r.frame.pageMarginBox)(e)))||null;var Zc=({center:e,destination:t,droppables:n})=>{if(t){const o=n[t];return o.frame?o:null}return Jc(e,n)};const we={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:e=>e**2,durationDampening:{stopDampeningAt:1200,accelerateAt:360},disabled:!1};var Qc=(e,t,n=()=>we)=>{const r=n(),o=e[t.size]*r.startFromPercentage,i=e[t.size]*r.maxScrollAtPercentage;return{startScrollingFrom:o,maxScrollValueAt:i}},Hr=({startOfRange:e,endOfRange:t,current:n})=>{const r=t-e;return r===0?(process.env.NODE_ENV!=="production"&&B(`
|
|
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},
|
|
86
|
+
`),0):(n-e)/r},Wt=1,ea=(e,t,n=()=>we)=>{const r=n();if(e>t.startScrollingFrom)return 0;if(e<=t.maxScrollValueAt)return r.maxPixelScroll;if(e===t.startScrollingFrom)return Wt;const i=1-Hr({startOfRange:t.maxScrollValueAt,endOfRange:t.startScrollingFrom,current:e}),s=r.maxPixelScroll*r.ease(i);return Math.ceil(s)},ta=(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 Wt;const p=Hr({startOfRange:o,endOfRange:c,current:d}),l=e*r.ease(p);return Math.ceil(l)},zr=({distanceToEdge:e,thresholds:t,dragStartTime:n,shouldUseTimeDampening:r,getAutoScrollerOptions:o})=>{const i=ea(e,t,o);return i===0?0:r?Math.max(ta(i,n,o),Wt):i},qr=({container:e,distanceToEdges:t,dragStartTime:n,axis:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const s=Qc(e,r,i);return t[r.end]<t[r.start]?zr({distanceToEdge:t[r.end],thresholds:s,dragStartTime:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i}):-1*zr({distanceToEdge:t[r.start],thresholds:s,dragStartTime:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i})},na=({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 ra=or(e=>e===0?0:e);var jr=({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=qr({container:t,distanceToEdges:s,dragStartTime:e,axis:St,shouldUseTimeDampening:o,getAutoScrollerOptions:i}),a=qr({container:t,distanceToEdges:s,dragStartTime:e,axis:dr,shouldUseTimeDampening:o,getAutoScrollerOptions:i}),d=ra({x:a,y:c});if(ne(d,R))return null;const p=na({container:t,subject:n,proposedScroll:d});return p?ne(p,R)?null:p:null};const oa=or(e=>e===0?0:e>0?1:-1),Ut=(()=>{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=oa(n),i=Ut({max:r,current:t,change:o});return!i||o.x!==0&&i.x===0||o.y!==0&&i.y===0},Ht=(e,t)=>Yr({current:e.scroll.current,max:e.scroll.max,change:t}),ia=(e,t)=>{if(!Ht(e,t))return null;const n=e.scroll.max,r=e.scroll.current;return Ut({current:r,max:n,change:t})},zt=(e,t)=>{const n=e.frame;return n?Yr({current:n.scroll.current,max:n.scroll.max,change:t}):!1},sa=(e,t)=>{const n=e.frame;return!n||!zt(e,t)?null:Ut({current:n.scroll.current,max:n.scroll.max,change:t})};var ca=({viewport:e,subject:t,center:n,dragStartTime:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const s=jr({dragStartTime:r,container:e.frame,subject:t,center:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i});return s&&Ht(e,s)?s:null},aa=({droppable:e,subject:t,center:n,dragStartTime:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const s=e.frame;if(!s)return null;const c=jr({dragStartTime:r,container:s.pageMarginBox,subject:t,center:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i});return c&&zt(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=ca({dragStartTime:t,viewport:l,subject:a,center:s,shouldUseTimeDampening:n,getAutoScrollerOptions:i});if(u){r(u);return}}const d=Zc({center:s,destination:W(e.impact),droppables:e.dimensions.droppables});if(!d)return;const p=aa({dragStartTime:t,droppable:d,subject:a,center:s,shouldUseTimeDampening:n,getAutoScrollerOptions:i});p&&o(d.descriptor.id,p)},la=({scrollWindow:e,scrollDroppable:t,getAutoScrollerOptions:n=()=>we})=>{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}},da=({move:e,scrollDroppable:t,scrollWindow:n})=>{const r=(c,a)=>{const d=$(c.current.client.selection,a);e({client:d})},o=(c,a)=>{if(!zt(c,a))return a;const d=sa(c,a);if(!d)return t(c.descriptor.id,a),null;const p=F(a,d);return t(c.descriptor.id,p),F(a,p)},i=(c,a,d)=>{if(!c||!Ht(a,d))return d;const p=ia(a,d);if(!p)return n(d),null;const l=F(d,p);return n(l),F(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)}},ua=({scrollDroppable:e,scrollWindow:t,move:n,getAutoScrollerOptions:r})=>{const o=la({scrollWindow:t,scrollDroppable:e,getAutoScrollerOptions:r}),i=da({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`}})(),qt=(()=>{const e=`${ue}-draggable`;return{base:e,contextId:`${e}-context-id`,id:`${e}-id`}})(),pa=(()=>{const e=`${ue}-droppable`;return{base:e,contextId:`${e}-context-id`,id:`${e}-id`}})(),Kr={contextId:`${ue}-scroll-container-context-id`},fa=e=>t=>`[${t}="${e}"]`,_e=(e,t)=>e.map(n=>{const r=n.styles[t];return r?`${n.selector} { ${r} }`:""}).join(" "),ga="pointer-events: none;";var ma=e=>{const t=fa(e),n=(()=>{const c=`
|
|
87
87
|
cursor: -webkit-grab;
|
|
88
88
|
cursor: grab;
|
|
89
89
|
`;return{selector:t(pe.contextId),styles:{always:`
|
|
90
90
|
-webkit-touch-callout: none;
|
|
91
91
|
-webkit-tap-highlight-color: rgba(0,0,0,0);
|
|
92
92
|
touch-action: manipulation;
|
|
93
|
-
`,resting:c,dragging:
|
|
93
|
+
`,resting:c,dragging:ga,dropAnimating:c}}})(),r=(()=>{const c=`
|
|
94
94
|
transition: ${Se.outOfTheWay};
|
|
95
|
-
`;return{selector:t(
|
|
95
|
+
`;return{selector:t(qt.contextId),styles:{dragging:c,dropAnimating:c,userCancel:c}}})(),o={selector:t(pa.contextId),styles:{always:"overflow-anchor: none;"}},s=[r,n,o,{selector:"body",styles:{dragging:`
|
|
96
96
|
cursor: grabbing;
|
|
97
97
|
cursor: -webkit-grabbing;
|
|
98
98
|
user-select: none;
|
|
@@ -100,7 +100,7 @@ ${hn.current.stack}
|
|
|
100
100
|
-moz-user-select: none;
|
|
101
101
|
-ms-user-select: none;
|
|
102
102
|
overflow-anchor: none;
|
|
103
|
-
`}}];return{always:_e(s,"always"),resting:_e(s,"resting"),dragging:_e(s,"dragging"),dropAnimating:_e(s,"dropAnimating"),userCancel:_e(s,"userCancel")}};const U=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?D.useLayoutEffect:D.useEffect,
|
|
103
|
+
`}}];return{always:_e(s,"always"),resting:_e(s,"resting"),dragging:_e(s,"dragging"),dropAnimating:_e(s,"dropAnimating"),userCancel:_e(s,"userCancel")}};const U=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?D.useLayoutEffect:D.useEffect,jt=()=>{const e=document.querySelector("head");return e||(process.env.NODE_ENV!=="production"?f(!1,"Cannot find the head to append a style to"):f()),e},Jr=e=>{const t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.type="text/css",t};function ha(e,t){const n=w(()=>ma(e),[e]),r=D.useRef(null),o=D.useRef(null),i=x(M(l=>{const u=o.current;u||(process.env.NODE_ENV!=="production"?f(!1,"Cannot set dynamic style element if it is not set"):f()),u.textContent=l}),[]),s=x(l=>{const u=r.current;u||(process.env.NODE_ENV!=="production"?f(!1,"Cannot set dynamic style element if it is not set"):f()),u.textContent=l},[]);U(()=>{!r.current&&!o.current||(process.env.NODE_ENV!=="production"?f(!1,"style elements already mounted"):f());const l=Jr(t),u=Jr(t);return r.current=l,o.current=u,l.setAttribute(`${ue}-always`,e),u.setAttribute(`${ue}-dynamic`,e),jt().appendChild(l),jt().appendChild(u),s(n.always),i(n.resting),()=>{const g=h=>{const b=h.current;b||(process.env.NODE_ENV!=="production"?f(!1,"Cannot unmount ref as it is not set"):f()),jt().removeChild(b),h.current=null};g(r),g(o)}},[t,s,i,n.always,n.resting,e]);const c=x(()=>i(n.dragging),[i,n.dragging]),a=x(l=>{if(l==="DROP"){i(n.dropAnimating);return}i(n.userCancel)},[i,n.dropAnimating,n.userCancel]),d=x(()=>{o.current&&i(n.resting)},[i,n.resting]);return w(()=>({dragging:c,dropping:a,resting:d}),[c,a,d])}function Zr(e,t){return Array.from(e.querySelectorAll(t))}var Qr=e=>e&&e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView:window;function Ae(e){return e instanceof Qr(e).HTMLElement}function eo(e,t){const n=`[${pe.contextId}="${e}"]`,r=Zr(document,n);if(!r.length)return process.env.NODE_ENV!=="production"&&B(`Unable to find any drag handles in the context "${e}"`),null;const o=r.find(i=>i.getAttribute(pe.draggableId)===t);return o?Ae(o)?o:(process.env.NODE_ENV!=="production"&&B("drag handle needs to be a HTMLElement"),null):(process.env.NODE_ENV!=="production"&&B(`Unable to find drag handle with id "${t}" as no handle with a matching id was found`),null)}function ba(e){const t=D.useRef({}),n=D.useRef(null),r=D.useRef(null),o=D.useRef(!1),i=x(function(u,g){const h={id:u,focus:g};return t.current[u]=h,function(){const m=t.current;m[u]!==h&&delete m[u]}},[]),s=x(function(u){const g=eo(e,u);g&&g!==document.activeElement&&g.focus()},[e]),c=x(function(u,g){n.current===u&&(n.current=g)},[]),a=x(function(){r.current||o.current&&(r.current=requestAnimationFrame(()=>{r.current=null;const u=n.current;u&&s(u)}))},[s]),d=x(function(u){n.current=null;const g=document.activeElement;g&&g.getAttribute(pe.draggableId)===u&&(n.current=u)},[]);return U(()=>(o.current=!0,function(){o.current=!1;const u=r.current;u&&cancelAnimationFrame(u)}),[]),w(()=>({register:i,tryRecordFocus:d,tryRestoreFocusRecorded:a,tryShiftRecord:c}),[i,d,a,c])}function va(){const e={draggables:{},droppables:{}},t=[];function n(l){return t.push(l),function(){const g=t.indexOf(l);g!==-1&&t.splice(g,1)}}function r(l){t.length&&t.forEach(u=>u(l))}function o(l){return e.draggables[l]||null}function i(l){const u=o(l);return u||(process.env.NODE_ENV!=="production"?f(!1,`Cannot find draggable entry with id [${l}]`):f()),u}const s={register:l=>{e.draggables[l.descriptor.id]=l,r({type:"ADDITION",value:l})},update:(l,u)=>{const g=e.draggables[u.descriptor.id];g&&g.uniqueId===l.uniqueId&&(delete e.draggables[u.descriptor.id],e.draggables[l.descriptor.id]=l)},unregister:l=>{const u=l.descriptor.id,g=o(u);g&&l.uniqueId===g.uniqueId&&(delete e.draggables[u],e.droppables[l.descriptor.droppableId]&&r({type:"REMOVAL",value:l}))},getById:i,findById:o,exists:l=>!!o(l),getAllByType:l=>Object.values(e.draggables).filter(u=>u.descriptor.type===l)};function c(l){return e.droppables[l]||null}function a(l){const u=c(l);return u||(process.env.NODE_ENV!=="production"?f(!1,`Cannot find droppable entry with id [${l}]`):f()),u}const d={register:l=>{e.droppables[l.descriptor.id]=l},unregister:l=>{const u=c(l.descriptor.id);u&&l.uniqueId===u.uniqueId&&delete e.droppables[l.descriptor.id]},getById:a,findById:c,exists:l=>!!c(l),getAllByType:l=>Object.values(e.droppables).filter(u=>u.descriptor.type===l)};function p(){e.draggables={},e.droppables={},t.length=0}return{draggable:s,droppable:d,subscribe:n,clean:p}}function ya(){const e=w(va,[]);return D.useEffect(()=>function(){e.clean()},[e]),e}var Yt=D.createContext(null),Pe=()=>{const e=document.body;return e||(process.env.NODE_ENV!=="production"?f(!1,"Cannot find document.body"):f()),e};const Ea={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},Da=e=>`rfd-announcement-${e}`;function Na(e){const t=w(()=>Da(e),[e]),n=D.useRef(null);return D.useEffect(function(){const i=document.createElement("div");return n.current=i,i.id=t,i.setAttribute("aria-live","assertive"),i.setAttribute("aria-atomic","true"),Fe(i.style,Ea),Pe().appendChild(i),function(){setTimeout(function(){const a=Pe();a.contains(i)&&a.removeChild(i),i===n.current&&(n.current=null)})}},[t]),x(o=>{const i=n.current;if(i){i.textContent=o;return}process.env.NODE_ENV!=="production"&&B(`
|
|
104
104
|
A screen reader message was trying to be announced but it was unable to do so.
|
|
105
105
|
This can occur if you unmount your <DragDropContext /> in your onDragEnd.
|
|
106
106
|
Consider calling provided.announce() before the unmount so that the instruction will
|
|
@@ -109,34 +109,34 @@ ${hn.current.stack}
|
|
|
109
109
|
Message not passed to screen reader:
|
|
110
110
|
|
|
111
111
|
"${o}"
|
|
112
|
-
`)},[])}const
|
|
112
|
+
`)},[])}const xa={separator:"::"};function Xt(e,t=xa){const n=D.useId();return w(()=>`${e}${t.separator}${n}`,[t.separator,e,n])}function Ia({contextId:e,uniqueId:t}){return`rfd-hidden-text-${e}-${t}`}function Ca({contextId:e,text:t}){const n=Xt("hidden-text",{separator:"-"}),r=w(()=>Ia({contextId:e,uniqueId:n}),[n,e]);return D.useEffect(function(){const i=document.createElement("div");return i.id=r,i.textContent=t,i.style.display="none",Pe().appendChild(i),function(){const c=Pe();c.contains(i)&&c.removeChild(i)}},[r,t]),r}var Ke=D.createContext(null),Sa={react:"^18.0.0 || ^19.0.0"};const Oa=/(\d+)\.(\d+)\.(\d+)/,to=e=>{const t=Oa.exec(e);t==null&&(process.env.NODE_ENV!=="production"?f(!1,`Unable to parse React version ${e}`):f());const n=Number(t[1]),r=Number(t[2]),o=Number(t[3]);return{major:n,minor:r,patch:o,raw:e}},wa=(e,t)=>t.major>e.major?!0:t.major<e.major?!1:t.minor>e.minor?!0:t.minor<e.minor?!1:t.patch>=e.patch;var _a=(e,t)=>{const n=to(e),r=to(t);wa(n,r)||process.env.NODE_ENV!=="production"&&B(`
|
|
113
113
|
React version: [${r.raw}]
|
|
114
114
|
does not satisfy expected peer dependency version: [${n.raw}]
|
|
115
115
|
|
|
116
116
|
This can result in run time bugs, and even fatal crashes
|
|
117
|
-
`)};const
|
|
117
|
+
`)};const Kt=`
|
|
118
118
|
We expect a html5 doctype: <!doctype html>
|
|
119
119
|
This is to ensure consistent browser layout and measurement
|
|
120
120
|
|
|
121
121
|
More information: https://github.com/hello-pangea/dnd/blob/main/docs/guides/doctype.md
|
|
122
|
-
`;var
|
|
122
|
+
`;var Aa=e=>{const t=e.doctype;if(!t){process.env.NODE_ENV!=="production"&&B(`
|
|
123
123
|
No <!doctype html> found.
|
|
124
124
|
|
|
125
|
-
${
|
|
125
|
+
${Kt}
|
|
126
126
|
`);return}t.name.toLowerCase()!=="html"&&process.env.NODE_ENV!=="production"&&B(`
|
|
127
127
|
Unexpected <!doctype> found: (${t.name})
|
|
128
128
|
|
|
129
|
-
${
|
|
129
|
+
${Kt}
|
|
130
130
|
`),t.publicId!==""&&process.env.NODE_ENV!=="production"&&B(`
|
|
131
131
|
Unexpected <!doctype> publicId found: (${t.publicId})
|
|
132
132
|
A html5 doctype does not have a publicId
|
|
133
133
|
|
|
134
|
-
${
|
|
135
|
-
`)};function
|
|
134
|
+
${Kt}
|
|
135
|
+
`)};function Jt(e){process.env.NODE_ENV!=="production"&&e()}function Te(e,t){Jt(()=>{D.useEffect(()=>{try{e()}catch(n){xt(`
|
|
136
136
|
A setup problem was encountered.
|
|
137
137
|
|
|
138
138
|
> ${n.message}
|
|
139
|
-
`)}},t)})}function
|
|
139
|
+
`)}},t)})}function Pa(){Te(()=>{_a(Sa.react,D.version),Aa(document)},[])}function Zt(e){const t=D.useRef(e);return D.useEffect(()=>{t.current=e}),t}function Ta(){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 Ba=9,Va=13,Qt=27,no=32,La=33,Ra=34,Ma=35,$a=36,Ga=37,ka=38,Fa=39,Wa=40,Ua={[Va]:!0,[Ba]:!0};var ro=e=>{Ua[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 Ha(e,t){return Math.abs(t.x-e.x)>=io||Math.abs(t.y-e.y)>=io}const so={type:"IDLE"};function za({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(!Ha(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===Qt){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 qa(e){const t=D.useRef(so),n=D.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 h={x:l.clientX,y:l.clientY};n.current(),d(g,h)}}),[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=za({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 Ya={[Ra]:!0,[La]:!0,[$a]:!0,[Ma]:!0};function Xa(e,t){function n(){t(),e.cancel()}function r(){t(),e.drop()}return[{eventName:"keydown",fn:o=>{if(o.keyCode===Qt){o.preventDefault(),n();return}if(o.keyCode===no){o.preventDefault(),r();return}if(o.keyCode===Wa){o.preventDefault(),e.moveDown();return}if(o.keyCode===ka){o.preventDefault(),e.moveUp();return}if(o.keyCode===Fa){o.preventDefault(),e.moveRight();return}if(o.keyCode===Ga){o.preventDefault(),e.moveLeft();return}if(Ya[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 Ka(e){const t=D.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,Xa(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 en={type:"IDLE"},Ja=120,Za=.15;function Qa({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===Qt&&n.preventDefault(),e()}},{eventName:Je,fn:e}]}function el({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>=Za))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 tl(e){const t=D.useRef(en),n=D.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 h=e.findClosestDraggableId(g);if(!h)return;const b=e.tryGetLock(h,c,{sourceEvent:g});if(!b)return;const m=g.touches[0],{clientX:E,clientY:y}=m,S={x:E,y};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(en),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},h={cancel:a,completed:c,getPhase:r},b=Y(window,el(h),g),m=Y(window,Qa(h),g);n.current=function(){b(),m()}},[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 h=g.actions.fluidLift(g.point);o({type:"DRAGGING",actions:h,hasMoved:!1})},[r,o]),l=x(function(g,h){r().type!=="IDLE"&&(process.env.NODE_ENV!=="production"?f(!1,"Expected to move from IDLE to PENDING drag"):f());const b=setTimeout(p,Ja);o({type:"PENDING",point:h,actions:g,longPressTimerId:b}),d()},[d,r,o,p]);U(function(){return s(),function(){n.current();const h=r();h.type==="PENDING"&&(clearTimeout(h.longPressTimerId),o(en))}},[r,s,o]),U(function(){return Y(window,[{eventName:"touchmove",fn:()=>{},options:{capture:!1,passive:!1}}])},[])}function nl(e){Jt(()=>{const t=Zt(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 rl=["input","button","textarea","select","option","optgroup","video","audio"];function co(e,t){if(t==null)return!1;if(rl.includes(t.tagName.toLowerCase()))return!0;const r=t.getAttribute("contenteditable");return r==="true"||r===""?!0:t===e?!1:co(e,t.parentElement)}function ol(e,t){const n=t.target;return Ae(n)?co(e,n):!1}var il=e=>K(e.getBoundingClientRect()).center;function sl(e){return e instanceof Qr(e).Element}const cl=(()=>{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[cl](t)?e:ao(e.parentElement,t)}function al(e,t){return e.closest?e.closest(t):ao(e,t)}function ll(e){return`[${pe.contextId}="${e}"]`}function dl(e,t){const n=t.target;if(!sl(n))return process.env.NODE_ENV!=="production"&&B("event.target must be a Element"),null;const r=ll(e),o=al(n,r);return o?Ae(o)?o:(process.env.NODE_ENV!=="production"&&B("drag handle must be a HTMLElement"),null):null}function ul(e,t){const n=dl(e,t);return n?n.getAttribute(pe.draggableId):null}function pl(e,t){const n=`[${qt.contextId}="${e}"]`,o=Zr(document,n).find(i=>i.getAttribute(qt.id)===t);return o?Ae(o)?o:(process.env.NODE_ENV!=="production"&&B("Draggable element is not a HTMLElement"),null):null}function fl(e){e.preventDefault()}function Ze({expected:e,phase:t,isLockActive:n,shouldWarn:r}){return n()?e!==t?(r&&process.env.NODE_ENV!=="production"&&B(`
|
|
140
140
|
Cannot perform action.
|
|
141
141
|
The actions you used belong to an outdated phase
|
|
142
142
|
|
|
@@ -154,13 +154,13 @@ ${hn.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
|
|
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"&&B(`Unable to find draggable with id: ${r}`),!1)}function gl({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=pl(t,a.descriptor.id);if(!d)return process.env.NODE_ENV!=="production"&&B(`Unable to find draggable element with id: ${o}`),null;if(s&&!a.options.canDragInteractiveElements&&ol(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 h(N,C){Ze({expected:N,phase:l,isLockActive:g,shouldWarn:!0})&&n.dispatch(C())}const b=h.bind(null,"DRAGGING");function m(N){function C(){e.release(),l="COMPLETED"}l!=="PRE_DRAG"&&(C(),process.env.NODE_ENV!=="production"?f(!1,`Cannot lift in phase ${l}`):f()),n.dispatch(ec(N.liftActionArgs)),l="DRAGGING";function A(T,H={shouldBlockNextClick:!1}){if(N.cleanup(),H.shouldBlockNextClick){const V=Y(window,[{eventName:"click",fn:fl,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(V)}C(),n.dispatch(Tr({reason:T}))}return{isActive:()=>Ze({expected:"DRAGGING",phase:l,isLockActive:g,shouldWarn:!1}),shouldRespectForcePress:u,drop:T=>A("DROP",T),cancel:T=>A("CANCEL",T),...N.actions}}function E(N){const C=me(T=>{b(()=>Pr({client:T}))});return{...m({liftActionArgs:{id:o,clientSelection:N,movementMode:"FLUID"},cleanup:()=>C.cancel(),actions:{move:C}}),move:C}}function y(){const N={moveUp:()=>b(lc),moveRight:()=>b(uc),moveDown:()=>b(dc),moveLeft:()=>b(pc)};return m({liftActionArgs:{id:o,clientSelection:il(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:E,snapLift:y,abort:S}}const ml=[qa,Ka,tl];function hl({contextId:e,store:t,registry:n,customSensors:r,enableDefaultSensors:o}){const i=[...o?ml:[],...r||[]],s=D.useState(()=>Ta())[0],c=x(function(m,E){Be(m)&&!Be(E)&&s.tryAbandon()},[s]);U(function(){let m=t.getState();return t.subscribe(()=>{const y=t.getState();c(m,y),m=y})},[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,m,E)=>gl({lockAPI:s,registry:n,contextId:e,store:t,draggableId:b,forceSensorStop:m||null,sourceEvent:E&&E.sourceEvent?E.sourceEvent:null}),[e,s,n,t]),p=x(b=>ul(e,b),[e]),l=x(b=>{const m=n.draggable.findById(b);return m?m.options:null},[n.draggable]),u=x(function(){s.isClaimed()&&(s.tryAbandon(),t.getState().phase!=="IDLE"&&t.dispatch(Lt()))},[s,t]),g=x(()=>s.isClaimed(),[s]),h=w(()=>({canGetLock:a,tryGetLock:d,findClosestDraggableId:p,findOptionsForDraggable:l,tryReleaseLock:u,isLockClaimed:g}),[a,d,p,l,u,g]);nl(i);for(let b=0;b<i.length;b++)i[b](h)}const bl=e=>({onBeforeCapture:t=>{const n=()=>{e.onBeforeCapture&&e.onBeforeCapture(t)};ot.flushSync(n)},onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragEnd:e.onDragEnd,onDragUpdate:e.onDragUpdate}),vl=e=>({...we,...e.autoScrollerOptions,durationDampening:{...we.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 yl(e){const{contextId:t,setCallbacks:n,sensors:r,nonce:o,dragHandleUsageInstructions:i}=e,s=D.useRef(null);Pa();const c=Zt(e),a=x(()=>bl(c.current),[c]),d=x(()=>vl(c.current),[c]),p=Na(t),l=Ca({contextId:t,text:i}),u=ha(t,o),g=x(V=>{Ve(s).dispatch(V)},[]),h=w(()=>Nn({publishWhileDragging:nc,updateDroppableScroll:oc,updateDroppableIsEnabled:ic,updateDroppableIsCombineEnabled:sc,collectionStarting:rc},g),[g]),b=ya(),m=w(()=>Yc(b,h),[b,h]),E=w(()=>ua({scrollWindow:Xc,scrollDroppable:m.scrollDroppable,getAutoScrollerOptions:d,...Nn({move:Pr},g)}),[m.scrollDroppable,g,d]),y=ba(t),S=w(()=>Hc({announce:p,autoScroller:E,dimensionMarshal:m,focusMarshal:y,getResponders:a,styleMarshal:u}),[p,E,m,y,a,u]);process.env.NODE_ENV!=="production"&&s.current&&s.current!==S&&process.env.NODE_ENV!=="production"&&B("unexpected store change"),s.current=S;const I=x(()=>{const V=Ve(s);V.getState().phase!=="IDLE"&&V.dispatch(Lt())},[]),N=x(()=>{const V=Ve(s).getState();return V.phase==="DROP_ANIMATING"?!0:V.phase==="IDLE"?!1:V.isDragging},[]),C=w(()=>({isDragging:N,tryAbort:I}),[N,I]);n(C);const A=x(V=>Ur(Ve(s).getState(),V),[]),T=x(()=>se(Ve(s).getState()),[]),H=w(()=>({marshal:m,focus:y,contextId:t,canLift:A,isMovementAllowed:T,dragHandleUsageInstructionsId:l,registry:b}),[t,m,l,y,A,T,b]);return hl({contextId:t,store:S,registry:b,customSensors:r||null,enableDefaultSensors:e.enableDefaultSensors!==!1}),D.useEffect(()=>I,[I]),D.createElement(Ke.Provider,{value:H},D.createElement(Ti,{context:Yt,store:S},e.children))}function El(){return D.useId()}function Dl(e){const t=El(),n=e.dragHandleUsageInstructions||Ue.dragHandleUsageInstructions;return D.createElement(Hi,null,r=>D.createElement(yl,{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},Nl=(e,t)=>t?Se.drop(t.duration):e?Se.snap:Se.fluid,xl=(e,t)=>{if(e)return t?Ce.opacity.drop:Ce.opacity.combining},Il=e=>e.forceShouldAnimate!=null?e.forceShouldAnimate:e.mode==="SNAP";function Cl(e){const n=e.dimension.client,{offset:r,combineWith:o,dropping:i}=e,s=!!o,c=Il(e),a=!!i,d=a?$t.drop(r,s):$t.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:Nl(c,i),transform:d,opacity:xl(s,a),zIndex:a?uo.dropAnimating:uo.dragging,pointerEvents:"none"}}function Sl(e){return{transform:$t.moveTo(e.offset),transition:e.shouldAnimateDisplacement?void 0:"none"}}function Ol(e){return e.type==="DRAGGING"?Cl(e):Sl(e)}function wl(e,t,n=R){const r=window.getComputedStyle(t),o=t.getBoundingClientRect(),i=Yn(o,r),s=ke(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 _l(e){const t=Xt("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 h=o();return h||(process.env.NODE_ENV!=="production"?f(!1,"Cannot get dimension when no ref is set"):f()),wl(n,h,g)},[n,o]),p=w(()=>({uniqueId:t,descriptor:n,options:a,getDimension:d}),[n,d,a,t]),l=D.useRef(p),u=D.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 tn=D.createContext(null);function po(e){e&&Ae(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
|
-
`):f())}function
|
|
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"&&(
|
|
162
|
+
`):f())}function Al(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 Pl(e){Jt(()=>{const t=D.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=D.useContext(e);return t||(process.env.NODE_ENV!=="production"?f(!1,"Could not find required context"):f()),t}function Tl(e){e.preventDefault()}const Bl=e=>{const t=D.useRef(null),n=x((C=null)=>{t.current=C},[]),r=x(()=>t.current,[]),{contextId:o,dragHandleUsageInstructionsId:i,registry:s}=Qe(Ke),{type:c,droppableId:a}=Qe(tn),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:h,isClone:b,mapped:m,dropAnimationFinished:E}=e;if(Al(e,o,r),Pl(b),!b){const C=w(()=>({descriptor:d,registry:s,getDraggableRef:r,canDragInteractiveElements:h,shouldRespectForcePress:g,isEnabled:u}),[d,s,r,h,g,u]);_l(C)}const y=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:Tl}:null,[o,i,l,u]),S=x(C=>{m.type==="DRAGGING"&&m.dropping&&C.propertyName==="transform"&&ot.flushSync(E)},[E,m]),I=w(()=>{const C=Ol(m),A=m.type==="DRAGGING"&&m.dropping?S:void 0;return{innerRef:n,draggableProps:{"data-rfd-draggable-context-id":o,"data-rfd-draggable-id":l,style:C,onTransitionEnd:A},dragHandleProps:y}},[o,y,l,m,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 D.createElement(D.Fragment,null,p(I,m.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 Vl=e=>e.combine?e.combine.draggableId:null,Ll=e=>e.at&&e.at.type==="COMBINE"?e.at.combine.draggableId:null;function Rl(){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=Ll(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=Vl(d),h={duration:o.dropDuration,curve:Mt.drop,moveTo:o.newHomeClientOffset,opacity:u?Ce.opacity.drop:null,scale:u?Ce.scale.drop:null};return{mapped:{type:"DRAGGING",offset:o.newHomeClientOffset,dimension:a,dropping:h,draggingOver:l,combineWith:u,mode:p,forceShouldAnimate:null,snapshot:t(p,c,l,u,h)}}}return null}}function mo(e=null){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:e,combineWith:null}}const Ml={mapped:{type:"SECONDARY",offset:R,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:mo(null)}};function $l(){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=ze(a),g=u&&u.draggableId===s?c:null;if(!p){if(!l)return r(g);if(a.displaced.invisible[s])return null;const m=ae(d.displacedBy.point),E=e(m.x,m.y);return n(E,g,!0)}if(l)return r(g);const h=a.displacedBy.point,b=e(h.x,h.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 Gl=zn(()=>{const e=Rl(),t=$l();return(r,o)=>e(r,o)||t(r,o)||Ml},{dropAnimationFinished:Br},null,{context:Yt,areStatePropsEqual:fo})(Bl);function ho(e){return Qe(tn).isUsingCloneFor===e.draggableId&&!e.isClone?null:D.createElement(Gl,e)}function kl(e){const t=typeof e.isDragDisabled=="boolean"?!e.isDragDisabled:!0,n=!!e.disableInteractiveElementBlocking,r=!!e.shouldRespectForcePress;return D.createElement(ho,Fe({},e,{isClone:!1,isEnabled:t,canDragInteractiveElements:n,shouldRespectForcePress:r}))}const nn=e=>t=>e===t,Fl=nn("scroll"),Wl=nn("auto"),Ul=nn("visible"),bo=(e,t)=>t(e.overflowX)||t(e.overflowY),Hl=(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,Fl)||bo(n,Wl)},zl=()=>{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 Hl(r,Ul)||process.env.NODE_ENV!=="production"&&B(`
|
|
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)
|
|
@@ -169,16 +169,16 @@ ${hn.current.stack}
|
|
|
169
169
|
we will be treating the <body> as *not* a scroll container
|
|
170
170
|
|
|
171
171
|
More information: https://github.com/hello-pangea/dnd/blob/main/docs/guides/how-we-detect-scroll-containers.md
|
|
172
|
-
`),!1},
|
|
172
|
+
`),!1},rn=e=>e==null?null:e===document.body?zl()?e:null:e===document.documentElement?null:vo(e)?e:rn(e.parentElement);var ql=e=>{!e||!rn(e.parentElement)||process.env.NODE_ENV!=="production"&&B(`
|
|
173
173
|
Droppable: unsupported nested scroll container detected.
|
|
174
174
|
A Droppable can only have one scroll parent (which can be itself)
|
|
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
|
-
`)},
|
|
178
|
+
`)},on=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=rn(e),n=yo(e);return{closestScrollable:t,isFixedOnPage:n}},Yl=({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,h=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:h,diff:{value:R,displacement:R}}}})(),d=o==="vertical"?St: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 Xl=(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=Et({top:r,right:s,bottom:i,left:o},n.border);return Nt({borderBox:a,margin:n.margin,border:n.border,padding:n.padding})};var Kl=({ref:e,descriptor:t,env:n,windowScroll:r,direction:o,isDropDisabled:i,isCombineEnabled:s,shouldClipSubject:c})=>{const a=n.closestScrollable,d=Xl(e,a),p=ke(d,r),l=(()=>{if(!a)return null;const g=Xn(a),h={scrollHeight:a.scrollHeight,scrollWidth:a.scrollWidth};return{client:g,page:ke(g,r),scroll:on(a),scrollSize:h,shouldClipSubject:c}})();return Yl({descriptor:t,isEnabled:!i,isCombineEnabled:s,isFixedOnPage:n.isFixedOnPage,direction:o,client:d,page:p,closest:l})};const Jl={passive:!1},Zl={passive:!0};var Eo=e=>e.shouldPublishImmediately?Jl:Zl;const et=e=>e&&e.env.closestScrollable||null;function Ql(e){const t=D.useRef(null),n=Qe(Ke),r=Xt("droppable"),{registry:o,marshal:i}=n,s=Zt(e),c=w(()=>({id:e.droppableId,type:e.type,mode:e.mode}),[e.droppableId,e.mode,e.type]),a=D.useRef(c),d=w(()=>M((I,N)=>{t.current||(process.env.NODE_ENV!=="production"?f(!1,"Can only update scroll when dragging"):f());const C={x:I,y:N};i.updateDroppableScroll(c.id,C)}),[c.id,i]),p=x(()=>{const I=t.current;return!I||!I.env.closestScrollable?R:on(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]),h=x((I,N)=>{t.current&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot collect a droppable while a drag is occurring"):f());const C=s.current,A=C.getDroppableRef();A||(process.env.NODE_ENV!=="production"?f(!1,"Cannot collect without a droppable ref"):f());const T=jl(A),H={ref:A,descriptor:c,env:T,scrollOptions:N};t.current=H;const V=Kl({ref:A,descriptor:c,env:T,windowScroll:I,direction:C.direction,isDropDisabled:C.isDropDisabled,isCombineEnabled:C.isCombineEnabled,shouldClipSubject:!C.ignoreContainerClipping}),z=T.closestScrollable;return z&&(z.setAttribute(Kr.contextId,n.contextId),z.addEventListener("scroll",g,Eo(H.scrollOptions)),process.env.NODE_ENV!=="production"&&ql(z)),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()),on(N)},[]),m=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]),E=x(I=>{const N=t.current;N||(process.env.NODE_ENV!=="production"?f(!1,"Cannot scroll when there is no drag"):f());const C=et(N);C||(process.env.NODE_ENV!=="production"?f(!1,"Cannot scroll a droppable with no closest scrollable"):f()),C.scrollTop+=I.y,C.scrollLeft+=I.x},[]),y=w(()=>({getDimensionAndWatchScroll:h,getScrollWhileDragging:b,dragStopped:m,scroll:E}),[m,h,b,E]),S=w(()=>({uniqueId:r,descriptor:c,callbacks:y}),[y,c,r]);U(()=>(a.current=S.descriptor,o.droppable.register(S),()=>{t.current&&(process.env.NODE_ENV!=="production"&&B("Unsupported: changing the droppableId or type of a Droppable during a drag"),m()),o.droppable.unregister(S)}),[y,c,m,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 sn(){}const Do={width:0,height:0,margin:Ki},ed=({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>e||n==="close"?Do:{height:t.client.borderBox.height,width:t.client.borderBox.width,margin:t.client.margin},td=({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>{const r=ed({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}},nd=e=>{const t=D.useRef(null),n=x(()=>{t.current&&(clearTimeout(t.current),t.current=null)},[]),{animate:r,onTransitionEnd:o,onClose:i,contextId:s}=e,[c,a]=D.useState(e.animate==="open");D.useEffect(()=>c?r!=="open"?(n(),a(!1),sn):t.current?sn:(t.current=setTimeout(()=>{t.current=null,a(!1)}),n):sn,[r,c,n]);const d=x(l=>{l.propertyName==="height"&&(o(),r==="close"&&i())},[r,i,o]),p=td({isAnimatingOpenOnMount:c,animate:e.animate,placeholder:e.placeholder});return D.createElement(e.placeholder.tagName,{style:p,"data-rfd-placeholder-context-id":s,onTransitionEnd:d,ref:e.innerRef})};var rd=D.memo(nd);function cn(e){return typeof e=="boolean"}function an(e,t){t.forEach(n=>n(e))}const od=[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}){cn(t.isDropDisabled)||(process.env.NODE_ENV!=="production"?f(!1,"isDropDisabled must be a boolean"):f()),cn(t.isCombineEnabled)||(process.env.NODE_ENV!=="production"?f(!1,"isCombineEnabled must be a boolean"):f()),cn(t.ignoreContainerClipping)||(process.env.NODE_ENV!=="production"?f(!1,"ignoreContainerClipping must be a boolean"):f())},function({getDroppableRef:t}){po(t())}],id=[function({props:t,getPlaceholderRef:n}){!t.placeholder||n()||process.env.NODE_ENV!=="production"&&B(`
|
|
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
|
-
`)}],id=[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 sd(e){Te(()=>{ln(e,rd),e.props.mode==="standard"&&ln(e,od),e.props.mode==="virtual"&&ln(e,id)})}class cd extends D.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 ad=e=>{const t=D.useContext(Ke);t||(process.env.NODE_ENV!=="production"?f(!1,"Could not find app context"):f());const{contextId:n,isMovementAllowed:r}=t,o=D.useRef(null),i=D.useRef(null),{children:s,droppableId:c,type:a,mode:d,direction:p,ignoreContainerClipping:l,isDropDisabled:u,isCombineEnabled:g,snapshot:h,useClone:b,updateViewportMaxScroll:m,getContainerForClone:E}=e,y=x(()=>o.current,[]),S=x((L=null)=>{o.current=L},[]),I=x(()=>i.current,[]),N=x((L=null)=>{i.current=L},[]);sd({props:e,getDroppableRef:y,getPlaceholderRef:I});const C=x(()=>{r()&&m({maxScroll:Wr()})},[r,m]);Zl({droppableId:c,type:a,mode:d,direction:p,isDropDisabled:u,isCombineEnabled:g,ignoreContainerClipping:l,getDroppableRef:y});const A=w(()=>D.createElement(cd,{on:e.placeholder,shouldAnimate:e.shouldAnimatePlaceholder},({onClose:L,data:J,animate:fe})=>D.createElement(nd,{placeholder:J,onClose:L,innerRef:N,animate:fe,contextId:n,onTransitionEnd:C})),[n,C,e.placeholder,e.shouldAnimatePlaceholder,N]),T=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 z(){if(!b)return null;const{dragging:L,render:J}=b,fe=D.createElement(bo,{draggableId:L.draggableId,index:L.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},(Z,rt)=>J(Z,rt,L));return it.createPortal(fe,E())}return D.createElement(nn.Provider,{value:V},s(T,h),z())};function ld(){return document.body||(process.env.NODE_ENV!=="production"?f(!1,"document.body is not ready"):f()),document.body}const xo={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:ld},Io=e=>{let t={...e},n;for(n in xo)e[n]===void 0&&(t={...t,[n]:xo[n]});return t},dn=(e,t)=>e===t.droppable.type,Co=(e,t)=>t.draggables[e.draggable.id],dd=qn(()=>{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 h=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:h}}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=Io(s),a=c.droppableId,d=c.type,p=!c.isDropDisabled,l=c.renderClone;if(Be(i)){const u=i.critical;if(!dn(d,u))return t;const g=Co(u,i.dimensions),h=W(i.impact)===a;return r(a,p,h,h,g,l)}if(i.phase==="DROP_ANIMATING"){const u=i.completed;if(!dn(d,u.critical))return t;const g=Co(u.critical,i.dimensions);return r(a,p,mo(u.result)===a,W(u.impact)===a,g,l)}if(i.phase==="IDLE"&&i.completed&&!i.shouldFlush){const u=i.completed;if(!dn(d,u.critical))return t;const g=W(u.impact)===a,h=!!(u.impact.at&&u.impact.at.type==="COMBINE"),b=u.critical.droppable.id===a;return g?h?e:t:b?e:t}return t}},{updateViewportMaxScroll:cc},(e,t,n)=>({...Io(n),...e,...t}),{context:Xt,areStatePropsEqual:go})(ad),ud=()=>v.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[v.jsx("path",{d:"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"}),v.jsx("circle",{cx:"12",cy:"10",r:"3"})]}),So=()=>v.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[v.jsx("circle",{cx:"12",cy:"12",r:"10"}),v.jsx("polyline",{points:"12 6 12 12 16 14"})]}),pd=()=>v.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:[v.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),v.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),v.jsx("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]}),fd=()=>v.jsx("svg",{width:"25",height:"25",viewBox:"0 0 90 90",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:v.jsxs("g",{children:[v.jsx("polygon",{points:"37.95,64.44 23.78,50.27 30.85,43.2 37.95,50.3 59.15,29.1 66.22,36.17",fill:"#009E04"}),v.jsx("path",{d:"M45 90C20.187 90 0 69.813 0 45C0 20.187 20.187 0 45 0C69.813 0 90 20.187 90 45C90 69.813 69.813 90 45 90ZM45 10C25.701 10 10 25.701 10 45C10 64.299 25.701 80 45 80C64.299 80 80 64.299 80 45C80 25.701 64.299 10 45 10Z",fill:"#009E04",strokeLinecap:"round"})]})}),gd=()=>v.jsxs("svg",{width:"25",height:"25",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[v.jsx("polyline",{points:"15 3 21 3 21 9"}),v.jsx("polyline",{points:"9 21 3 21 3 15"}),v.jsx("line",{x1:"21",y1:"3",x2:"14",y2:"10"}),v.jsx("line",{x1:"3",y1:"21",x2:"10",y2:"14"})]}),md=()=>v.jsxs("svg",{width:"25",height:"25",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[v.jsx("polyline",{points:"4 14 10 14 10 20"}),v.jsx("polyline",{points:"20 10 14 10 14 4"}),v.jsx("line",{x1:"14",y1:"10",x2:"21",y2:"3"}),v.jsx("line",{x1:"3",y1:"21",x2:"10",y2:"14"})]}),tt=e=>{if(!e)return"--:--";const t=e.split("T")[1],[n,r]=t.split(":"),o=Number(n),i=o>=12?"PM":"AM";return`${o%12||12}:${r} ${i}`},un=e=>typeof e=="object"&&(e!=null&&e.name)?e.name:e,nt=e=>{var t;return e?typeof e=="string"?e.toLowerCase()==="completed":((t=e==null?void 0:e.code)==null?void 0:t.toLowerCase())==="completed":!1},hd=e=>{const t=[];return[...e].sort((r,o)=>r.sequence_rank-o.sequence_rank).forEach(r=>{const o=t[t.length-1];o&&o.stop_id===r.stop_id?o.orders.push(r):t.push({stop_id:r.stop_id,sequence_rank:r.sequence_rank,orders:[r]})}),t},bd=({order:e,pathPeriod:t,isFirst:n,isDone:r,renderOrderExtraData:o})=>{var a,d,p,l,u,g;const[i,s]=D.useState(!1),c=(d=(a=e.customer)==null?void 0:a.address)!=null&&d.lat&&((l=(p=e.customer)==null?void 0:p.address)!=null&&l.long)?`https://maps.google.com/?q=${e.customer.address.lat},${e.customer.address.long}`:"#";return v.jsxs("div",{style:{...O.orderBlock,borderTop:n?"none":"1px solid #f3f4f6",backgroundColor:r?"#fafafa":"transparent"},children:[v.jsxs("div",{style:O.orderHeader,children:[v.jsxs("div",{style:O.gridItem,children:[v.jsxs("div",{style:O.gridLabel,children:["ORDER"," ",r&&v.jsx("span",{style:{color:"#16a34a",marginLeft:"4px"},children:"✓ DONE"})]}),v.jsxs("div",{style:O.gridValue,children:["#",e.order_id]})]}),o&&v.jsx("button",{onClick:()=>s(!i),style:O.expandButton,children:i?v.jsx(md,{}):v.jsx(gd,{})})]}),v.jsxs("div",{style:O.detailsGrid,children:[v.jsxs("div",{style:O.gridItem,children:[v.jsx("div",{style:O.gridLabel,children:"LOCATION"}),v.jsxs("div",{style:O.gridValueWithIcon,children:[v.jsx(ud,{}),v.jsx("a",{href:c,target:"_blank",rel:"noopener noreferrer",style:O.addressLink,children:((g=(u=e.customer)==null?void 0:u.address)==null?void 0:g.street_area)||"N/A"})]})]}),v.jsxs("div",{style:O.gridItem,children:[v.jsx("div",{style:O.gridLabel,children:"PERIOD"}),v.jsx("div",{style:O.gridValue,children:t})]}),v.jsxs("div",{style:O.gridItem,children:[v.jsx("div",{style:O.gridLabel,children:"TIME WINDOW"}),v.jsxs("div",{style:O.gridValueWithIcon,children:[v.jsx(So,{})," ",v.jsxs("span",{style:O.direction,children:[tt(e.eta_start)," - ",tt(e.eta_end)]})]})]}),e.completed_at&&v.jsxs("div",{style:O.gridItem,children:[v.jsx("div",{style:O.gridLabel,children:"COMPLETED AT"}),v.jsxs("div",{style:O.gridValueWithIcon,children:[v.jsx(So,{})," ",v.jsx("span",{style:O.direction,children:tt(e.completed_at)})]})]})]}),i&&o&&v.jsx("div",{style:O.extraDataContainer,children:o(e)})]})},vd=({stopGroup:e,index:t,pathType:n,pathPeriod:r,canEditPath:o,isPathCompleted:i,renderStopActions:s,renderOrderExtraData:c})=>{const a=e.status?nt(e.status):e.orders.every(g=>nt(g.status)),[d,p]=D.useState(!a),l=e.status?un(e.status):a?"Completed":"Pending",u=!o||i||a;return v.jsx(Gl,{draggableId:e.stop_id.toString(),index:t,isDragDisabled:u,children:g=>{var h,b;return v.jsxs("div",{ref:g.innerRef,...g.draggableProps,style:{...O.timelineItem,...g.draggableProps.style},children:[v.jsx("div",{style:{...O.bubble,...a?O.bubbleCompleted:O.bubblePending},children:t+1}),v.jsxs("div",{style:O.card,children:[v.jsxs("div",{style:O.cardHeader,children:[v.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[v.jsxs("span",{style:O.title,children:[n," #",e.sequence_rank]}),v.jsx("span",{style:a?O.badgeCompleted:O.badgePending,children:l}),e.completed_at&&v.jsxs("span",{style:{fontSize:"12px",color:"#6b7280"},children:["(",tt(e.completed_at),")"]})]}),v.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[v.jsx("button",{onClick:()=>{a&&p(m=>!m)},style:O.expandButton,children:a&&v.jsx(fd,{})}),!u&&v.jsx("div",{...g.dragHandleProps,children:v.jsx(pd,{})})]})]}),d&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{style:O.customerName,children:["Customer: ",(b=(h=e.orders[0])==null?void 0:h.customer)==null?void 0:b.name]}),v.jsx("div",{style:O.ordersList,children:e.orders.map((m,E)=>v.jsx(bd,{order:m,pathPeriod:r,isFirst:E===0,isDone:nt(m.status),renderOrderExtraData:c},m.id))}),s&&v.jsx("div",{style:O.actionsSlot,children:s(e)})]})]})]})}})},yd=({path:e,onReorder:t,renderStopActions:n,renderOrderExtraData:r,canEditPath:o=!0})=>{const[i,s]=D.useState([]);D.useEffect(()=>{if(e)if(e.stops&&e.stops.length>0){const d=e.stops.map(p=>({stop_id:p.id,sequence_rank:p.sequence_rank,status:p.status,completed_at:p.completed_at,orders:(e.path_orders||[]).filter(l=>l.stop_id===p.id).sort((l,u)=>l.sequence_rank-u.sequence_rank)})).sort((p,l)=>p.sequence_rank-l.sequence_rank);s(d)}else e.path_orders&&s(hd(e.path_orders))},[e]);const c=d=>{if(!d.destination)return;const p=Array.from(i),[l]=p.splice(d.source.index,1);p.splice(d.destination.index,0,l),s(p),t&&t(e.id,p.map(u=>u.stop_id))};if(!e||!i.length)return v.jsx("div",{children:"No Path Data"});const a=nt(e.status);return v.jsx("div",{style:O.container,children:v.jsx(El,{onDragEnd:c,children:v.jsx(dd,{droppableId:"path-list",children:d=>v.jsxs("div",{ref:d.innerRef,...d.droppableProps,style:O.timelineWrapper,children:[v.jsx("div",{style:O.verticalLine}),v.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"24px"},children:i.map((p,l)=>v.jsx(vd,{stopGroup:p,index:l,pathType:un(e.type),pathPeriod:un(e.period),canEditPath:o,isPathCompleted:a,renderStopActions:n,renderOrderExtraData:r},p.stop_id))}),d.placeholder]})})})})},O={container:{fontFamily:"sans-serif",maxWidth:"800px",margin:"0 auto"},timelineWrapper:{position:"relative",padding:"20px 0"},verticalLine:{position:"absolute",right:"19px",top:"40px",bottom:"40px",width:"2px",backgroundColor:"#f3f4f6"},direction:{direction:"ltr"},timelineItem:{display:"flex",gap:"16px",marginBottom:"24px",position:"relative",zIndex:1},bubble:{width:"40px",height:"40px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:"bold",backgroundColor:"#fff",border:"2px solid",flexShrink:0},bubblePending:{borderColor:"#f3f4f6",color:"#9ca3af"},bubbleCompleted:{borderColor:"#dcfce7",color:"#16a34a",backgroundColor:"#f0fdf4"},card:{flex:1,backgroundColor:"#fff",border:"1px solid #f3f4f6",borderRadius:"12px",padding:"16px",boxShadow:"0 1px 3px rgba(0,0,0,0.1)",position:"relative"},cardHeader:{display:"flex",justifyContent:"space-between",marginBottom:"8px",alignItems:"center"},title:{fontSize:"16px",fontWeight:"bold"},badgePending:{fontSize:"11px",padding:"2px 8px",borderRadius:"12px",backgroundColor:"#f3f4f6",color:"#4b5563",fontWeight:"600"},badgeCompleted:{fontSize:"11px",padding:"2px 8px",borderRadius:"12px",backgroundColor:"#dcfce7",color:"#16a34a",fontWeight:"600"},customerName:{fontSize:"14px",color:"#6b7280",marginBottom:"12px"},ordersList:{backgroundColor:"#f9fafb",borderRadius:"8px",overflow:"hidden"},orderBlock:{padding:"12px",transition:"background-color 0.2s"},orderHeader:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"8px"},detailsGrid:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"12px"},gridItem:{display:"flex",flexDirection:"column"},gridLabel:{fontSize:"10px",color:"#9ca3af",fontWeight:"bold"},gridValue:{fontSize:"13px",fontWeight:"600"},gridValueWithIcon:{fontSize:"13px",display:"flex",alignItems:"flex-start",gap:"4px",color:"#374151"},addressLink:{color:"#3b82f6",textDecoration:"underline",wordBreak:"break-word",lineHeight:"1.4"},expandButton:{color:"#fff",border:"none",cursor:"pointer",backgroundColor:"#d1d1d1",borderRadius:"5px",padding:"4px",display:"flex",alignItems:"center",justifyContent:"center"},extraDataContainer:{marginTop:"12px",padding:"12px",borderTop:"1px dashed #e5e7eb",backgroundColor:"#fff",borderRadius:"4px"},actionsSlot:{marginTop:"16px"}};Q.LogisticsDashboard=yd,Object.defineProperty(Q,Symbol.toStringTag,{value:"Module"})});
|
|
184
|
+
`)}],sd=[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 cd(e){Te(()=>{an(e,od),e.props.mode==="standard"&&an(e,id),e.props.mode==="virtual"&&an(e,sd)})}class ad extends D.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 ld=e=>{const t=D.useContext(Ke);t||(process.env.NODE_ENV!=="production"?f(!1,"Could not find app context"):f());const{contextId:n,isMovementAllowed:r}=t,o=D.useRef(null),i=D.useRef(null),{children:s,droppableId:c,type:a,mode:d,direction:p,ignoreContainerClipping:l,isDropDisabled:u,isCombineEnabled:g,snapshot:h,useClone:b,updateViewportMaxScroll:m,getContainerForClone:E}=e,y=x(()=>o.current,[]),S=x((L=null)=>{o.current=L},[]),I=x(()=>i.current,[]),N=x((L=null)=>{i.current=L},[]);cd({props:e,getDroppableRef:y,getPlaceholderRef:I});const C=x(()=>{r()&&m({maxScroll:Fr()})},[r,m]);Ql({droppableId:c,type:a,mode:d,direction:p,isDropDisabled:u,isCombineEnabled:g,ignoreContainerClipping:l,getDroppableRef:y});const A=w(()=>D.createElement(ad,{on:e.placeholder,shouldAnimate:e.shouldAnimatePlaceholder},({onClose:L,data:J,animate:fe})=>D.createElement(rd,{placeholder:J,onClose:L,innerRef:N,animate:fe,contextId:n,onTransitionEnd:C})),[n,C,e.placeholder,e.shouldAnimatePlaceholder,N]),T=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 z(){if(!b)return null;const{dragging:L,render:J}=b,fe=D.createElement(ho,{draggableId:L.draggableId,index:L.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},(Z,nt)=>J(Z,nt,L));return ot.createPortal(fe,E())}return D.createElement(tn.Provider,{value:V},s(T,h),z())};function dd(){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:dd},xo=e=>{let t={...e},n;for(n in No)e[n]===void 0&&(t={...t,[n]:No[n]});return t},ln=(e,t)=>e===t.droppable.type,Io=(e,t)=>t.draggables[e.draggable.id],ud=zn(()=>{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 h=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:h}}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(!ln(d,u))return t;const g=Io(u,i.dimensions),h=W(i.impact)===a;return r(a,p,h,h,g,l)}if(i.phase==="DROP_ANIMATING"){const u=i.completed;if(!ln(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(!ln(d,u.critical))return t;const g=W(u.impact)===a,h=!!(u.impact.at&&u.impact.at.type==="COMBINE"),b=u.critical.droppable.id===a;return g?h?e:t:b?e:t}return t}},{updateViewportMaxScroll:ac},(e,t,n)=>({...xo(n),...e,...t}),{context:Yt,areStatePropsEqual:fo})(ld),pd=()=>v.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[v.jsx("path",{d:"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"}),v.jsx("circle",{cx:"12",cy:"10",r:"3"})]}),Co=()=>v.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[v.jsx("circle",{cx:"12",cy:"12",r:"10"}),v.jsx("polyline",{points:"12 6 12 12 16 14"})]}),fd=()=>v.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:[v.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),v.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),v.jsx("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]}),gd=()=>v.jsx("svg",{width:"25",height:"25",viewBox:"0 0 90 90",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:v.jsxs("g",{children:[v.jsx("polygon",{points:"37.95,64.44 23.78,50.27 30.85,43.2 37.95,50.3 59.15,29.1 66.22,36.17",fill:"#009E04"}),v.jsx("path",{d:"M45 90C20.187 90 0 69.813 0 45C0 20.187 20.187 0 45 0C69.813 0 90 20.187 90 45C90 69.813 69.813 90 45 90ZM45 10C25.701 10 10 25.701 10 45C10 64.299 25.701 80 45 80C64.299 80 80 64.299 80 45C80 25.701 64.299 10 45 10Z",fill:"#009E04",strokeLinecap:"round"})]})}),md=()=>v.jsxs("svg",{width:"25",height:"25",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[v.jsx("polyline",{points:"15 3 21 3 21 9"}),v.jsx("polyline",{points:"9 21 3 21 3 15"}),v.jsx("line",{x1:"21",y1:"3",x2:"14",y2:"10"}),v.jsx("line",{x1:"3",y1:"21",x2:"10",y2:"14"})]}),hd=()=>v.jsxs("svg",{width:"25",height:"25",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[v.jsx("polyline",{points:"4 14 10 14 10 20"}),v.jsx("polyline",{points:"20 10 14 10 14 4"}),v.jsx("line",{x1:"14",y1:"10",x2:"21",y2:"3"}),v.jsx("line",{x1:"3",y1:"21",x2:"10",y2:"14"})]}),So=e=>{if(!e)return"--:--";const t=new Date(e),n=t.getHours(),r=t.getMinutes(),o=n>=12?"PM":"AM";return`${n%12||12}:${r.toString().padStart(2,"0")} ${o}`},Oo=e=>{if(!e)return"--:--";const t=e.split("T")[1],[n,r]=t.split(":"),o=Number(n),i=o>=12?"PM":"AM";return`${o%12||12}:${r} ${i}`},dn=e=>typeof e=="object"&&(e!=null&&e.name)?e.name:e,tt=e=>{var t;return e?typeof e=="string"?e.toLowerCase()==="completed":((t=e==null?void 0:e.code)==null?void 0:t.toLowerCase())==="completed":!1},bd=e=>{const t=[];return[...e].sort((r,o)=>r.sequence_rank-o.sequence_rank).forEach(r=>{const o=t[t.length-1];o&&o.stop_id===r.stop_id?o.orders.push(r):t.push({stop_id:r.stop_id,sequence_rank:r.sequence_rank,orders:[r]})}),t},vd=({order:e,pathPeriod:t,isFirst:n,isDone:r,renderOrderExtraData:o})=>{var a,d,p,l,u,g;const[i,s]=D.useState(!1),c=(d=(a=e.customer)==null?void 0:a.address)!=null&&d.lat&&((l=(p=e.customer)==null?void 0:p.address)!=null&&l.long)?`https://maps.google.com/?q=${e.customer.address.lat},${e.customer.address.long}`:"#";return v.jsxs("div",{style:{...O.orderBlock,borderTop:n?"none":"1px solid #f3f4f6",backgroundColor:r?"#fafafa":"transparent"},children:[v.jsxs("div",{style:O.orderHeader,children:[v.jsxs("div",{style:O.gridItem,children:[v.jsxs("div",{style:O.gridLabel,children:["ORDER"," ",r&&v.jsx("span",{style:{color:"#16a34a",marginLeft:"4px"},children:"✓ DONE"})]}),v.jsxs("div",{style:O.gridValue,children:["#",e.order_id]})]}),o&&v.jsx("button",{onClick:()=>s(!i),style:O.expandButton,children:i?v.jsx(hd,{}):v.jsx(md,{})})]}),v.jsxs("div",{style:O.detailsGrid,children:[v.jsxs("div",{style:O.gridItem,children:[v.jsx("div",{style:O.gridLabel,children:"LOCATION"}),v.jsxs("div",{style:O.gridValueWithIcon,children:[v.jsx(pd,{}),v.jsx("a",{href:c,target:"_blank",rel:"noopener noreferrer",style:O.addressLink,children:((g=(u=e.customer)==null?void 0:u.address)==null?void 0:g.street_area)||"N/A"})]})]}),v.jsxs("div",{style:O.gridItem,children:[v.jsx("div",{style:O.gridLabel,children:"PERIOD"}),v.jsx("div",{style:O.gridValue,children:t})]}),v.jsxs("div",{style:O.gridItem,children:[v.jsx("div",{style:O.gridLabel,children:"TIME WINDOW"}),v.jsxs("div",{style:O.gridValueWithIcon,children:[v.jsx(Co,{})," ",v.jsxs("span",{style:O.direction,children:[Oo(e.eta_start)," - ",Oo(e.eta_end)]})]})]}),e.completed_at&&v.jsxs("div",{style:O.gridItem,children:[v.jsx("div",{style:O.gridLabel,children:"COMPLETED AT"}),v.jsxs("div",{style:O.gridValueWithIcon,children:[v.jsx(Co,{})," ",v.jsx("span",{style:O.direction,children:So(e.completed_at)})]})]})]}),i&&o&&v.jsx("div",{style:O.extraDataContainer,children:o(e)})]})},yd=({stopGroup:e,index:t,pathType:n,pathPeriod:r,canEditPath:o,isPathCompleted:i,renderStopActions:s,renderOrderExtraData:c})=>{const a=e.status?tt(e.status):e.orders.every(g=>tt(g.status)),[d,p]=D.useState(c?!a:!0),l=e.status?dn(e.status):a?"Completed":"Pending",u=!o||i||a;return v.jsx(kl,{draggableId:e.stop_id.toString(),index:t,isDragDisabled:u,children:g=>{var h,b;return v.jsxs("div",{ref:g.innerRef,...g.draggableProps,style:{...O.timelineItem,...g.draggableProps.style},children:[v.jsx("div",{style:{...O.bubble,...a?O.bubbleCompleted:O.bubblePending},children:t+1}),v.jsxs("div",{style:O.card,children:[v.jsxs("div",{style:O.cardHeader,children:[v.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[v.jsxs("span",{style:O.title,children:[n," #",e.sequence_rank]}),v.jsx("span",{style:a?O.badgeCompleted:O.badgePending,children:l}),e.completed_at&&v.jsxs("span",{style:{fontSize:"12px",color:"#6b7280"},children:["(",So(e.completed_at),")"]})]}),v.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[v.jsx("button",{onClick:()=>{a&&c&&p(m=>!m)},children:a&&v.jsx(gd,{})}),!u&&v.jsx("div",{...g.dragHandleProps,children:v.jsx(fd,{})})]})]}),d&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{style:O.customerName,children:["Customer: ",(b=(h=e.orders[0])==null?void 0:h.customer)==null?void 0:b.name]}),v.jsx("div",{style:O.ordersList,children:e.orders.map((m,E)=>v.jsx(vd,{order:m,pathPeriod:r,isFirst:E===0,isDone:tt(m.status),renderOrderExtraData:c},m.id))}),s&&v.jsx("div",{style:O.actionsSlot,children:s(e)})]})]})]})}})},Ed=({path:e,onReorder:t,renderStopActions:n,renderOrderExtraData:r,canEditPath:o=!0})=>{const[i,s]=D.useState([]);D.useEffect(()=>{if(e)if(e.stops&&e.stops.length>0){const d=e.stops.map(p=>({stop_id:p.id,sequence_rank:p.sequence_rank,status:p.status,completed_at:p.completed_at,orders:(e.path_orders||[]).filter(l=>l.stop_id===p.id).sort((l,u)=>l.sequence_rank-u.sequence_rank)})).sort((p,l)=>p.sequence_rank-l.sequence_rank);s(d)}else e.path_orders&&s(bd(e.path_orders))},[e]);const c=d=>{if(!d.destination)return;const p=Array.from(i),[l]=p.splice(d.source.index,1);p.splice(d.destination.index,0,l),s(p),t&&t(e.id,p.map(u=>u.stop_id))};if(!e||!i.length)return v.jsx("div",{children:"No Path Data"});const a=tt(e.status);return v.jsx("div",{style:O.container,children:v.jsx(Dl,{onDragEnd:c,children:v.jsx(ud,{droppableId:"path-list",children:d=>v.jsxs("div",{ref:d.innerRef,...d.droppableProps,style:O.timelineWrapper,children:[v.jsx("div",{style:O.verticalLine}),v.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"24px"},children:i.map((p,l)=>v.jsx(yd,{stopGroup:p,index:l,pathType:dn(e.type),pathPeriod:dn(e.period),canEditPath:o,isPathCompleted:a,renderStopActions:n,renderOrderExtraData:r},p.stop_id))}),d.placeholder]})})})})},O={container:{fontFamily:"sans-serif",maxWidth:"800px",margin:"0 auto"},timelineWrapper:{position:"relative",padding:"20px 0"},verticalLine:{position:"absolute",right:"19px",top:"40px",bottom:"40px",width:"2px",backgroundColor:"#f3f4f6"},direction:{direction:"ltr"},timelineItem:{display:"flex",gap:"16px",marginBottom:"24px",position:"relative",zIndex:1},bubble:{width:"40px",height:"40px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:"bold",backgroundColor:"#fff",border:"2px solid",flexShrink:0},bubblePending:{borderColor:"#f3f4f6",color:"#9ca3af"},bubbleCompleted:{borderColor:"#dcfce7",color:"#16a34a",backgroundColor:"#f0fdf4"},card:{flex:1,backgroundColor:"#fff",border:"1px solid #f3f4f6",borderRadius:"12px",padding:"16px",boxShadow:"0 1px 3px rgba(0,0,0,0.1)",position:"relative"},cardHeader:{display:"flex",justifyContent:"space-between",marginBottom:"8px",alignItems:"center"},title:{fontSize:"16px",fontWeight:"bold"},badgePending:{fontSize:"11px",padding:"2px 8px",borderRadius:"12px",backgroundColor:"#f3f4f6",color:"#4b5563",fontWeight:"600"},badgeCompleted:{fontSize:"11px",padding:"2px 8px",borderRadius:"12px",backgroundColor:"#dcfce7",color:"#16a34a",fontWeight:"600"},customerName:{fontSize:"14px",color:"#6b7280",marginBottom:"12px"},ordersList:{backgroundColor:"#f9fafb",borderRadius:"8px",overflow:"hidden"},orderBlock:{padding:"12px",transition:"background-color 0.2s"},orderHeader:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"8px"},detailsGrid:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"12px"},gridItem:{display:"flex",flexDirection:"column"},gridLabel:{fontSize:"10px",color:"#9ca3af",fontWeight:"bold"},gridValue:{fontSize:"13px",fontWeight:"600"},gridValueWithIcon:{fontSize:"13px",display:"flex",alignItems:"flex-start",gap:"4px",color:"#374151"},addressLink:{color:"#3b82f6",textDecoration:"underline",wordBreak:"break-word",lineHeight:"1.4"},expandButton:{color:"#fff",border:"none",cursor:"pointer",backgroundColor:"#d1d1d1",borderRadius:"5px",padding:"4px",display:"flex",alignItems:"center",justifyContent:"center"},extraDataContainer:{marginTop:"12px",padding:"12px",borderTop:"1px dashed #e5e7eb",backgroundColor:"#fff",borderRadius:"4px"},actionsSlot:{marginTop:"16px"}};Q.LogisticsDashboard=Ed,Object.defineProperty(Q,Symbol.toStringTag,{value:"Module"})});
|