From 54ff03a7cb3a348dc78e1b76ed51c9e4d034d812 Mon Sep 17 00:00:00 2001 From: Alec Geatches Date: Wed, 3 Jul 2024 14:41:11 -0600 Subject: [PATCH] Add semi-mocked workflow management page --- .../custom-status-block.asset.php | 2 +- .../custom-status/custom-status-block.js | 2 +- .../custom-status-configure.asset.php | 2 +- .../custom-status/custom-status-configure.js | 2 +- modules/custom-status/custom-status.php | 7 +- .../lib/custom-status-configure.js | 187 +++++++++++++++++- .../custom-status/views/manage-workflow.php | 7 + package-lock.json | 102 ++++++++++ package.json | 1 + 9 files changed, 304 insertions(+), 8 deletions(-) create mode 100644 modules/custom-status/views/manage-workflow.php diff --git a/dist/modules/custom-status/custom-status-block.asset.php b/dist/modules/custom-status/custom-status-block.asset.php index f9a0e676..bf06fe4b 100644 --- a/dist/modules/custom-status/custom-status-block.asset.php +++ b/dist/modules/custom-status/custom-status-block.asset.php @@ -1 +1 @@ - array('react', 'wp-components', 'wp-compose', 'wp-data', 'wp-edit-post', 'wp-i18n', 'wp-plugins'), 'version' => 'ea64731158fa7ffea83e'); + array('react', 'wp-components', 'wp-compose', 'wp-data', 'wp-edit-post', 'wp-i18n', 'wp-plugins'), 'version' => '3d1784c9873e9e5f2739'); diff --git a/dist/modules/custom-status/custom-status-block.js b/dist/modules/custom-status/custom-status-block.js index fb490cf9..e3e0810f 100644 --- a/dist/modules/custom-status/custom-status-block.js +++ b/dist/modules/custom-status/custom-status-block.js @@ -1,2 +1,2 @@ -(()=>{"use strict";var t={609:t=>{t.exports=window.React},427:t=>{t.exports=window.wp.components},491:t=>{t.exports=window.wp.compose},143:t=>{t.exports=window.wp.data},309:t=>{t.exports=window.wp.editPost},723:t=>{t.exports=window.wp.i18n},279:t=>{t.exports=window.wp.plugins}},e={};function r(o){var n=e[o];if(void 0!==n)return n.exports;var s=e[o]={exports:{}};return t[o](s,s.exports,r),s.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var o in e)r.o(e,o)&&!r.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{var t=r(609),e=r.n(t),o=r(427),n=r(491),s=r(143),i=r(309),a=r(723),u=r(279);function l(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return c(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var o=0,n=function(){};return{s:n,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,i=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){a=!0,s=t},f:function(){try{i||null==r.return||r.return()}finally{if(a)throw s}}}}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,o=new Array(e);r{"use strict";var t={1609:t=>{t.exports=window.React},6427:t=>{t.exports=window.wp.components},9491:t=>{t.exports=window.wp.compose},7143:t=>{t.exports=window.wp.data},4309:t=>{t.exports=window.wp.editPost},7723:t=>{t.exports=window.wp.i18n},2279:t=>{t.exports=window.wp.plugins}},e={};function r(o){var n=e[o];if(void 0!==n)return n.exports;var s=e[o]={exports:{}};return t[o](s,s.exports,r),s.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var o in e)r.o(e,o)&&!r.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{var t=r(1609),e=r.n(t),o=r(6427),n=r(9491),s=r(7143),i=r(4309),a=r(7723),u=r(2279);function l(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return c(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var o=0,n=function(){};return{s:n,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,i=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){a=!0,s=t},f:function(){try{i||null==r.return||r.return()}finally{if(a)throw s}}}}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,o=new Array(e);r array(), 'version' => '2dec9e62a483d5e2cf81'); + array('react', 'react-dom', 'wp-dom-ready', 'wp-element', 'wp-i18n'), 'version' => '287848d1493ebf33e6ae'); diff --git a/dist/modules/custom-status/custom-status-configure.js b/dist/modules/custom-status/custom-status-configure.js index 485ddd61..45ee98da 100644 --- a/dist/modules/custom-status/custom-status-configure.js +++ b/dist/modules/custom-status/custom-status-configure.js @@ -1,2 +1,2 @@ -(()=>{function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}var e;e=jQuery,inlineEditCustomStatus={init:function(){var t=e("#inline-edit");this.what="#term-",e(document).on("click",".editinline",(function(){return inlineEditCustomStatus.edit(this),!1})),t.on("keyup",(function(t){if(27==t.which)return inlineEditCustomStatus.revert()})),e("a.cancel",t).on("click",(function(){return inlineEditCustomStatus.revert()})),e("a.save",t).on("click",(function(){return inlineEditCustomStatus.save(this)})),e("input, select",t).on("keydown",(function(t){if(13==t.which)return inlineEditCustomStatus.save(this)}))},toggle:function(t){var i=this;"none"==e(i.what+i.getId(t)).css("display")?i.revert():i.edit(t)},edit:function(i){var n,a=this;a.revert(),"object"===t(i)&&(i=a.getId(i)),n=e("#inline-edit").clone(!0),rowData=e("#inline_"+i),e("td",n).attr("colspan",e(".widefat:first thead th:visible").length),e(a.what+i).hasClass("alternate")&&e(n).addClass("alternate"),e(a.what+i).hide().after(n);var r=e(".name",rowData).text();e(':input[name="name"]',n).val(r),e(':input[name="description"]',n).val(e(".description",rowData).text()),e(n).attr("id","edit-"+i).addClass("inline-editor").show();var o=e(".ptitle",n).eq(0);return"draft"===r.trim().toLowerCase()?o.attr("readonly","readonly"):o.focus(),!1},save:function(i){var n;return e('input[name="taxonomy"]').val(),"object"===t(i)&&(i=this.getId(i)),e("table.widefat .inline-edit-save .waiting").show(),n={action:"inline_save_status",status_id:i},n=e("#edit-"+i+" :input").serialize()+"&"+e.param(n),e.post(ajaxurl,n,(function(t){var n;e("table.widefat .inline-edit-save .waiting").hide(),t?-1!=t.indexOf("{"use strict";var e={1815:(e,t,r)=>{r.d(t,{JY:()=>rn,gL:()=>kn,sx:()=>vn});var n=r(1609),o=r.n(n),i=r(5795),a=r.n(i),s=r(2960),l=r(9924),c=r(2737),d=r(6795),u=r(1811),p=r(629),f=r(8168);function g(e,t){}function m(){}function b(e,t,r){const n=t.map((t=>{const n=(o=r,i=t.options,{...o,...i});var o,i;return e.addEventListener(t.eventName,t.fn,n),function(){e.removeEventListener(t.eventName,t.fn,n)}}));return function(){n.forEach((e=>{e()}))}}g.bind(null,"warn"),g.bind(null,"error");const h=!0,y="Invariant failed";class v extends Error{}function x(e,t){if(!e)throw new v(h?y:`${y}: ${t||""}`)}v.prototype.toString=function(){return this.message};class I extends o().Component{constructor(...e){super(...e),this.callbacks=null,this.unbind=m,this.onWindowError=e=>{const t=this.getCallbacks();t.isDragging()&&t.tryAbort(),e.error instanceof v&&e.preventDefault()},this.getCallbacks=()=>{if(!this.callbacks)throw new Error("Unable to find AppCallbacks in ");return this.callbacks},this.setCallbacks=e=>{this.callbacks=e}}componentDidMount(){this.unbind=b(window,[{eventName:"error",fn:this.onWindowError}])}componentDidCatch(e){if(!(e instanceof v))throw e;this.setState({})}componentWillUnmount(){this.unbind()}render(){return this.props.children(this.setCallbacks)}}const w=e=>e+1,D=(e,t)=>{const r=e.droppableId===t.droppableId,n=w(e.index),o=w(t.index);return r?`\n You have moved the item from position ${n}\n to position ${o}\n `:`\n You have moved the item from position ${n}\n in list ${e.droppableId}\n to list ${t.droppableId}\n in position ${o}\n `},S=(e,t,r)=>t.droppableId===r.droppableId?`\n The item ${e}\n has been combined with ${r.draggableId}`:`\n The item ${e}\n in list ${t.droppableId}\n has been combined with ${r.draggableId}\n in list ${r.droppableId}\n `,E=e=>`\n The item has returned to its starting position\n of ${w(e.index)}\n`,A={dragHandleUsageInstructions:"\n Press space bar to start a drag.\n When dragging you can use the arrow keys to move the item around and escape to cancel.\n Some screen readers may require you to be in focus mode or to use your pass through key\n",onDragStart:e=>`\n You have lifted an item in position ${w(e.source.index)}\n`,onDragUpdate:e=>{const t=e.destination;if(t)return D(e.source,t);const r=e.combine;return r?S(e.draggableId,e.source,r):"You are over an area that cannot be dropped on"},onDragEnd:e=>{if("CANCEL"===e.reason)return`\n Movement cancelled.\n ${E(e.source)}\n `;const t=e.destination,r=e.combine;return t?`\n You have dropped the item.\n ${D(e.source,t)}\n `:r?`\n You have dropped the item.\n ${S(e.draggableId,e.source,r)}\n `:`\n The item has been dropped while not over a drop area.\n ${E(e.source)}\n `}};var O=A;const C={x:0,y:0},P=(e,t)=>({x:e.x+t.x,y:e.y+t.y}),R=(e,t)=>({x:e.x-t.x,y:e.y-t.y}),N=(e,t)=>e.x===t.x&&e.y===t.y,B=e=>({x:0!==e.x?-e.x:0,y:0!==e.y?-e.y:0}),T=(e,t,r=0)=>"x"===e?{x:t,y:r}:{x:r,y:t},M=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2),L=(e,t)=>Math.min(...t.map((t=>M(e,t)))),G=e=>t=>({x:e(t.x),y:e(t.y)}),_=(e,t)=>({top:e.top+t.y,left:e.left+t.x,bottom:e.bottom+t.y,right:e.right+t.x}),j=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}],F=(e,t)=>t&&t.shouldClipSubject?((e,t)=>{const r=(0,d.l)({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 r.width<=0||r.height<=0?null:r})(t.pageMarginBox,e):(0,d.l)(e);var $=({page:e,withPlaceholder:t,axis:r,frame:n})=>{const o=((e,t)=>t?_(e,t.scroll.diff.displacement):e)(e.marginBox,n),i=((e,t,r)=>r&&r.increasedBy?{...e,[t.end]:e[t.end]+r.increasedBy[t.line]}:e)(o,r,t);return{page:e,withPlaceholder:t,active:F(i,n)}},k=(e,t)=>{e.frame||x(!1);const r=e.frame,n=R(t,r.scroll.initial),o=B(n),i={...r,scroll:{initial:r.scroll.initial,current:t,diff:{value:n,displacement:o},max:r.scroll.max}},a=$({page:e.subject.page,withPlaceholder:e.subject.withPlaceholder,axis:e.axis,frame:i});return{...e,frame:i,subject:a}};const W=(0,u.A)((e=>e.reduce(((e,t)=>(e[t.descriptor.id]=t,e)),{}))),U=(0,u.A)((e=>e.reduce(((e,t)=>(e[t.descriptor.id]=t,e)),{}))),H=(0,u.A)((e=>Object.values(e))),q=(0,u.A)((e=>Object.values(e)));var V=(0,u.A)(((e,t)=>{const r=q(t).filter((t=>e===t.descriptor.droppableId)).sort(((e,t)=>e.descriptor.index-t.descriptor.index));return r}));function K(e){return e.at&&"REORDER"===e.at.type?e.at.destination:null}function z(e){return e.at&&"COMBINE"===e.at.type?e.at.combine:null}var Y=(0,u.A)(((e,t)=>t.filter((t=>t.descriptor.id!==e.descriptor.id)))),J=(e,t)=>e.descriptor.droppableId===t.descriptor.id;const Q={point:C,value:0},X={invisible:{},visible:{},all:[]};var Z={displaced:X,displacedBy:Q,at:null},ee=(e,t)=>r=>e<=r&&r<=t,te=e=>{const t=ee(e.top,e.bottom),r=ee(e.left,e.right);return n=>{if(t(n.top)&&t(n.bottom)&&r(n.left)&&r(n.right))return!0;const o=t(n.top)||t(n.bottom),i=r(n.left)||r(n.right);if(o&&i)return!0;const a=n.tope.bottom,s=n.lefte.right;return!(!a||!s)||(a&&i||s&&o)}},re=e=>{const t=ee(e.top,e.bottom),r=ee(e.left,e.right);return e=>t(e.top)&&t(e.bottom)&&r(e.left)&&r(e.right)};const ne={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},oe={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"},ie=({target:e,destination:t,viewport:r,withDroppableDisplacement:n,isVisibleThroughFrameFn:o})=>{const i=n?((e,t)=>{const r=t.frame?t.frame.scroll.diff.displacement:C;return _(e,r)})(e,t):e;return((e,t,r)=>!!t.subject.active&&r(t.subject.active)(e))(i,t,o)&&((e,t,r)=>r(t)(e))(i,r,o)},ae=e=>ie({...e,isVisibleThroughFrameFn:te}),se=e=>ie({...e,isVisibleThroughFrameFn:re}),le=(e,t,r)=>{if("boolean"==typeof r)return r;if(!t)return!0;const{invisible:n,visible:o}=t;if(n[e])return!1;const i=o[e];return!i||i.shouldAnimate};function ce({afterDragging:e,destination:t,displacedBy:r,viewport:n,forceShouldAnimate:o,last:i}){return e.reduce((function(e,a){const s=function(e,t){const r=e.page.marginBox,n={top:t.point.y,right:0,bottom:0,left:t.point.x};return(0,d.l)((0,d.fT)(r,n))}(a,r),l=a.descriptor.id;if(e.all.push(l),!ae({target:s,destination:t,viewport:n,withDroppableDisplacement:!0}))return e.invisible[a.descriptor.id]=!0,e;const c={draggableId:l,shouldAnimate:le(l,i,o)};return e.visible[l]=c,e}),{all:[],visible:{},invisible:{}})}function de({insideDestination:e,inHomeList:t,displacedBy:r,destination:n}){const o=function(e,t){if(!e.length)return 0;const r=e[e.length-1].descriptor.index;return t.inHomeList?r:r+1}(e,{inHomeList:t});return{displaced:X,displacedBy:r,at:{type:"REORDER",destination:{droppableId:n.descriptor.id,index:o}}}}function ue({draggable:e,insideDestination:t,destination:r,viewport:n,displacedBy:o,last:i,index:a,forceShouldAnimate:s}){const l=J(e,r);if(null==a)return de({insideDestination:t,inHomeList:l,displacedBy:o,destination:r});const c=t.find((e=>e.descriptor.index===a));if(!c)return de({insideDestination:t,inHomeList:l,displacedBy:o,destination:r});const d=Y(e,t),u=t.indexOf(c);return{displaced:ce({afterDragging:d.slice(u),destination:r,displacedBy:o,last:i,viewport:n.frame,forceShouldAnimate:s}),displacedBy:o,at:{type:"REORDER",destination:{droppableId:r.descriptor.id,index:a}}}}function pe(e,t){return Boolean(t.effected[e])}const fe=(e,t)=>t.margin[e.start]+t.borderBox[e.size]/2,ge=(e,t,r)=>t[e.crossAxisStart]+r.margin[e.crossAxisStart]+r.borderBox[e.crossAxisSize]/2,me=({axis:e,moveRelativeTo:t,isMoving:r})=>T(e.line,t.marginBox[e.end]+fe(e,r),ge(e,t.marginBox,r)),be=({axis:e,moveRelativeTo:t,isMoving:r})=>T(e.line,t.marginBox[e.start]-((e,t)=>t.margin[e.end]+t.borderBox[e.size]/2)(e,r),ge(e,t.marginBox,r));var he=(e,t)=>{const r=e.frame;return r?P(t,r.scroll.diff.displacement):t},ye=e=>{const t=(({impact:e,draggable:t,droppable:r,draggables:n,afterCritical:o})=>{const i=t.page.borderBox.center,a=e.at;return r&&a?"REORDER"===a.type?(({impact:e,draggable:t,draggables:r,droppable:n,afterCritical:o})=>{const i=V(n.descriptor.id,r),a=t.page,s=n.axis;if(!i.length)return(({axis:e,moveInto:t,isMoving:r})=>T(e.line,t.contentBox[e.start]+fe(e,r),ge(e,t.contentBox,r)))({axis:s,moveInto:n.page,isMoving:a});const{displaced:l,displacedBy:c}=e,u=l.all[0];if(u){const e=r[u];if(pe(u,o))return be({axis:s,moveRelativeTo:e.page,isMoving:a});const t=(0,d.cY)(e.page,c.point);return be({axis:s,moveRelativeTo:t,isMoving:a})}const p=i[i.length-1];if(p.descriptor.id===t.descriptor.id)return a.borderBox.center;if(pe(p.descriptor.id,o)){const e=(0,d.cY)(p.page,B(o.displacedBy.point));return me({axis:s,moveRelativeTo:e,isMoving:a})}return me({axis:s,moveRelativeTo:p.page,isMoving:a})})({impact:e,draggable:t,draggables:n,droppable:r,afterCritical:o}):(({afterCritical:e,impact:t,draggables:r})=>{const n=z(t);n||x(!1);const o=n.draggableId,i=r[o].page.borderBox.center,a=(({displaced:e,afterCritical:t,combineWith:r,displacedBy:n})=>{const o=Boolean(e.visible[r]||e.invisible[r]);return pe(r,t)?o?C:B(n.point):o?n.point:C})({displaced:t.displaced,afterCritical:e,combineWith:o,displacedBy:t.displacedBy});return P(i,a)})({impact:e,draggables:n,afterCritical:o}):i})(e),r=e.droppable;return r?he(r,t):t},ve=(e,t)=>{const r=R(t,e.scroll.initial),n=B(r);return{frame:(0,d.l)({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:r,displacement:n}}}};function xe(e,t){return e.map((e=>t[e]))}var Ie=({pageBorderBoxCenter:e,draggable:t,viewport:r})=>{const n=((e,t)=>P(e.scroll.diff.displacement,t))(r,e),o=R(n,t.page.borderBox.center);return P(t.client.borderBox.center,o)},we=({draggable:e,destination:t,newPageBorderBoxCenter:r,viewport:n,withDroppableDisplacement:o,onlyOnMainAxis:i=!1})=>{const a=R(r,e.page.borderBox.center),s={target:_(e.page.borderBox,a),destination:t,withDroppableDisplacement:o,viewport:n};return i?(e=>{return ie({...e,isVisibleThroughFrameFn:(t=e.destination.axis,e=>{const r=ee(e.top,e.bottom),n=ee(e.left,e.right);return e=>t===ne?r(e.top)&&r(e.bottom):n(e.left)&&n(e.right)})});var t})(s):se(s)},De=({isMovingForward:e,draggable:t,destination:r,draggables:n,previousImpact:o,viewport:i,previousPageBorderBoxCenter:a,previousClientSelection:s,afterCritical:l})=>{if(!r.isEnabled)return null;const c=V(r.descriptor.id,n),d=J(t,r),u=(({isMovingForward:e,draggable:t,destination:r,insideDestination:n,previousImpact:o})=>{if(!r.isCombineEnabled)return null;if(!K(o))return null;function i(e){const t={type:"COMBINE",combine:{draggableId:e,droppableId:r.descriptor.id}};return{...o,at:t}}const a=o.displaced.all,s=a.length?a[0]:null;if(e)return s?i(s):null;const l=Y(t,n);if(!s)return l.length?i(l[l.length-1].descriptor.id):null;const c=l.findIndex((e=>e.descriptor.id===s));-1===c&&x(!1);const d=c-1;return d<0?null:i(l[d].descriptor.id)})({isMovingForward:e,draggable:t,destination:r,insideDestination:c,previousImpact:o})||(({isMovingForward:e,isInHomeList:t,draggable:r,draggables:n,destination:o,insideDestination:i,previousImpact:a,viewport:s,afterCritical:l})=>{const c=a.at;if(c||x(!1),"REORDER"===c.type){const n=(({isMovingForward:e,isInHomeList:t,insideDestination:r,location:n})=>{if(!r.length)return null;const o=n.index,i=e?o+1:o-1,a=r[0].descriptor.index,s=r[r.length-1].descriptor.index;return i(t?s:s+1)?null:i})({isMovingForward:e,isInHomeList:t,location:c.destination,insideDestination:i});return null==n?null:ue({draggable:r,insideDestination:i,destination:o,viewport:s,last:a.displaced,displacedBy:a.displacedBy,index:n})}const d=(({isMovingForward:e,destination:t,draggables:r,combine:n,afterCritical:o})=>{if(!t.isCombineEnabled)return null;const i=n.draggableId,a=r[i].descriptor.index;return pe(i,o)?e?a:a-1:e?a+1:a})({isMovingForward:e,destination:o,displaced:a.displaced,draggables:n,combine:c.combine,afterCritical:l});return null==d?null:ue({draggable:r,insideDestination:i,destination:o,viewport:s,last:a.displaced,displacedBy:a.displacedBy,index:d})})({isMovingForward:e,isInHomeList:d,draggable:t,draggables:n,destination:r,insideDestination:c,previousImpact:o,viewport:i,afterCritical:l});if(!u)return null;const p=ye({impact:u,draggable:t,droppable:r,draggables:n,afterCritical:l});if(we({draggable:t,destination:r,newPageBorderBoxCenter:p,viewport:i.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0}))return{clientSelection:Ie({pageBorderBoxCenter:p,draggable:t,viewport:i}),impact:u,scrollJumpRequest:null};const f=R(p,a),g=(({impact:e,viewport:t,destination:r,draggables:n,maxScrollChange:o})=>{const i=ve(t,P(t.scroll.current,o)),a=r.frame?k(r,P(r.frame.scroll.current,o)):r,s=e.displaced,l=ce({afterDragging:xe(s.all,n),destination:r,displacedBy:e.displacedBy,viewport:i.frame,last:s,forceShouldAnimate:!1}),c=ce({afterDragging:xe(s.all,n),destination:a,displacedBy:e.displacedBy,viewport:t.frame,last:s,forceShouldAnimate:!1}),d={},u={},p=[s,l,c];return s.all.forEach((e=>{const t=function(e,t){for(let r=0;r{const t=e.subject.active;return t||x(!1),t},Ee=(e,t)=>{const r=e.page.borderBox.center;return pe(e.descriptor.id,t)?R(r,t.displacedBy.point):r},Ae=(e,t)=>{const r=e.page.borderBox;return pe(e.descriptor.id,t)?_(r,B(t.displacedBy.point)):r};var Oe=(0,u.A)((function(e,t){const r=t[e.line];return{value:r,point:T(e.line,r)}}));const Ce=(e,t)=>({...e,scroll:{...e.scroll,max:t}}),Pe=(e,t,r)=>{const n=e.frame;J(t,e)&&x(!1),e.subject.withPlaceholder&&x(!1);const o=Oe(e.axis,t.displaceBy).point,i=((e,t,r)=>{const n=e.axis;if("virtual"===e.descriptor.mode)return T(n.line,t[n.line]);const o=e.subject.page.contentBox[n.size],i=V(e.descriptor.id,r).reduce(((e,t)=>e+t.client.marginBox[n.size]),0)+t[n.line]-o;return i<=0?null:T(n.line,i)})(e,o,r),a={placeholderSize:o,increasedBy:i,oldFrameMaxScroll:e.frame?e.frame.scroll.max:null};if(!n){const t=$({page:e.subject.page,withPlaceholder:a,axis:e.axis,frame:e.frame});return{...e,subject:t}}const s=i?P(n.scroll.max,i):n.scroll.max,l=Ce(n,s),c=$({page:e.subject.page,withPlaceholder:a,axis:e.axis,frame:l});return{...e,subject:c,frame:l}};var Re=e=>{const t=e.at;return t?"REORDER"===t.type?t.destination.droppableId:t.combine.droppableId:null},Ne=({state:e,type:t})=>{const r=((e,t)=>{const r=Re(e);return r?t[r]:null})(e.impact,e.dimensions.droppables),n=Boolean(r),o=e.dimensions.droppables[e.critical.droppable.id],i=r||o,a=i.axis.direction,s="vertical"===a&&("MOVE_UP"===t||"MOVE_DOWN"===t)||"horizontal"===a&&("MOVE_LEFT"===t||"MOVE_RIGHT"===t);if(s&&!n)return null;const l="MOVE_DOWN"===t||"MOVE_RIGHT"===t,c=e.dimensions.draggables[e.critical.draggable.id],d=e.current.page.borderBoxCenter,{draggables:u,droppables:p}=e.dimensions;return s?De({isMovingForward:l,previousPageBorderBoxCenter:d,draggable:c,destination:i,draggables:u,viewport:e.viewport,previousClientSelection:e.current.client.selection,previousImpact:e.impact,afterCritical:e.afterCritical}):(({isMovingForward:e,previousPageBorderBoxCenter:t,draggable:r,isOver:n,draggables:o,droppables:i,viewport:a,afterCritical:s})=>{const l=(({isMovingForward:e,pageBorderBoxCenter:t,source:r,droppables:n,viewport:o})=>{const i=r.subject.active;if(!i)return null;const a=r.axis,s=ee(i[a.start],i[a.end]),l=H(n).filter((e=>e!==r)).filter((e=>e.isEnabled)).filter((e=>Boolean(e.subject.active))).filter((e=>te(o.frame)(Se(e)))).filter((t=>{const r=Se(t);return e?i[a.crossAxisEnd]{const t=Se(e),r=ee(t[a.start],t[a.end]);return s(t[a.start])||s(t[a.end])||r(i[a.start])||r(i[a.end])})).sort(((t,r)=>{const n=Se(t)[a.crossAxisStart],o=Se(r)[a.crossAxisStart];return e?n-o:o-n})).filter(((e,t,r)=>Se(e)[a.crossAxisStart]===Se(r[0])[a.crossAxisStart]));if(!l.length)return null;if(1===l.length)return l[0];const c=l.filter((e=>ee(Se(e)[a.start],Se(e)[a.end])(t[a.line])));return 1===c.length?c[0]:c.length>1?c.sort(((e,t)=>Se(e)[a.start]-Se(t)[a.start]))[0]:l.sort(((e,r)=>{const n=L(t,j(Se(e))),o=L(t,j(Se(r)));return n!==o?n-o:Se(e)[a.start]-Se(r)[a.start]}))[0]})({isMovingForward:e,pageBorderBoxCenter:t,source:n,droppables:i,viewport:a});if(!l)return null;const c=V(l.descriptor.id,o),d=(({pageBorderBoxCenter:e,viewport:t,destination:r,insideDestination:n,afterCritical:o})=>{const i=n.filter((e=>se({target:Ae(e,o),destination:r,viewport:t.frame,withDroppableDisplacement:!0}))).sort(((t,n)=>{const i=M(e,he(r,Ee(t,o))),a=M(e,he(r,Ee(n,o)));return i{if(!t){if(r.length)return null;const e={displaced:X,displacedBy:Q,at:{type:"REORDER",destination:{droppableId:i.descriptor.id,index:0}}},t=ye({impact:e,draggable:n,droppable:i,draggables:o,afterCritical:s}),l=J(n,i)?i:Pe(i,n,o);return we({draggable:n,destination:l,newPageBorderBoxCenter:t,viewport:a.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0})?e:null}const l=Boolean(e[i.axis.line]<=t.page.borderBox.center[i.axis.line]),c=(()=>{const e=t.descriptor.index;return t.descriptor.id===n.descriptor.id||l?e:e+1})(),d=Oe(i.axis,n.displaceBy);return ue({draggable:n,insideDestination:r,destination:i,viewport:a,displacedBy:d,last:X,index:c})})({previousPageBorderBoxCenter:t,destination:l,draggable:r,draggables:o,moveRelativeTo:d,insideDestination:c,viewport:a,afterCritical:s});if(!u)return null;const p=ye({impact:u,draggable:r,droppable:l,draggables:o,afterCritical:s});return{clientSelection:Ie({pageBorderBoxCenter:p,draggable:r,viewport:a}),impact:u,scrollJumpRequest:null}})({isMovingForward:l,previousPageBorderBoxCenter:d,draggable:c,isOver:i,draggables:u,droppables:p,viewport:e.viewport,afterCritical:e.afterCritical})};function Be(e){return"DRAGGING"===e.phase||"COLLECTING"===e.phase}function Te(e){const t=ee(e.top,e.bottom),r=ee(e.left,e.right);return function(e){return t(e.y)&&r(e.x)}}const Me=(e,t)=>(0,d.l)(_(e,t));function Le({displaced:e,id:t}){return Boolean(e.visible[t]||e.invisible[t])}var Ge=({pageOffset:e,draggable:t,draggables:r,droppables:n,previousImpact:o,viewport:i,afterCritical:a})=>{const s=Me(t.page.borderBox,e),l=function({pageBorderBox:e,draggable:t,droppables:r}){const n=H(r).filter((t=>{if(!t.isEnabled)return!1;const r=t.subject.active;if(!r)return!1;if(o=r,!((n=e).lefto.left&&n.topo.top))return!1;var n,o;if(Te(r)(e.center))return!0;const i=t.axis,a=r.center[i.crossAxisLine],s=e[i.crossAxisStart],l=e[i.crossAxisEnd],c=ee(r[i.crossAxisStart],r[i.crossAxisEnd]),d=c(s),u=c(l);return!d&&!u||(d?sa)}));return n.length?1===n.length?n[0].descriptor.id:function({pageBorderBox:e,draggable:t,candidates:r}){const n=t.page.borderBox.center,o=r.map((t=>{const r=t.axis,o=T(t.axis.line,e.center[r.line],t.page.borderBox.center[r.crossAxisLine]);return{id:t.descriptor.id,distance:M(n,o)}})).sort(((e,t)=>t.distance-e.distance));return o[0]?o[0].id:null}({pageBorderBox:e,draggable:t,candidates:n}):null}({pageBorderBox:s,draggable:t,droppables:n});if(!l)return Z;const c=n[l],d=V(c.descriptor.id,r),u=((e,t)=>{const r=e.frame;return r?Me(t,r.scroll.diff.value):t})(c,s);return(({draggable:e,pageBorderBoxWithDroppableScroll:t,previousImpact:r,destination:n,insideDestination:o,afterCritical:i})=>{if(!n.isCombineEnabled)return null;const a=n.axis,s=Oe(n.axis,e.displaceBy),l=s.value,c=t[a.start],d=t[a.end],u=Y(e,o).find((e=>{const t=e.descriptor.id,n=e.page.borderBox,o=n[a.size]/4,s=pe(t,i),u=Le({displaced:r.displaced,id:t});return s?u?d>n[a.start]+o&&dn[a.start]-l+o&&cn[a.start]+l+o&&dn[a.start]+o&&c{const s=r.axis,l=Oe(r.axis,t.displaceBy),c=l.value,d=e[s.start],u=e[s.end],p=function({draggable:e,closest:t,inHomeList:r}){return t?r&&t.descriptor.index>e.descriptor.index?t.descriptor.index-1:t.descriptor.index:null}({draggable:t,closest:Y(t,n).find((e=>{const t=e.descriptor.id,r=e.page.borderBox.center[s.line],n=pe(t,a),i=Le({displaced:o,id:t});return n?i?u<=r:d({...e,[t.descriptor.id]:t});var je=({state:e,clientSelection:t,dimensions:r,viewport:n,impact:o,scrollJumpRequest:i})=>{const a=n||e.viewport,s=r||e.dimensions,l=t||e.current.client.selection,c=R(l,e.initial.client.selection),d={offset:c,selection:l,borderBoxCenter:P(e.initial.client.borderBoxCenter,c)},u={selection:P(d.selection,a.scroll.current),borderBoxCenter:P(d.borderBoxCenter,a.scroll.current),offset:P(d.offset,a.scroll.diff.value)},p={client:d,page:u};if("COLLECTING"===e.phase)return{...e,dimensions:s,viewport:a,current:p};const f=s.draggables[e.critical.draggable.id],g=o||Ge({pageOffset:u.offset,draggable:f,draggables:s.draggables,droppables:s.droppables,previousImpact:e.impact,viewport:a,afterCritical:e.afterCritical}),m=(({draggable:e,draggables:t,droppables:r,previousImpact:n,impact:o})=>{const i=(({previousImpact:e,impact:t,droppables:r})=>{const n=Re(e),o=Re(t);if(!n)return r;if(n===o)return r;const i=r[n];if(!i.subject.withPlaceholder)return r;const a=(e=>{const t=e.subject.withPlaceholder;t||x(!1);const r=e.frame;if(!r){const t=$({page:e.subject.page,axis:e.axis,frame:null,withPlaceholder:null});return{...e,subject:t}}const n=t.oldFrameMaxScroll;n||x(!1);const o=Ce(r,n),i=$({page:e.subject.page,axis:e.axis,frame:o,withPlaceholder:null});return{...e,subject:i,frame:o}})(i);return _e(r,a)})({previousImpact:n,impact:o,droppables:r}),a=Re(o);if(!a)return i;const s=r[a];if(J(e,s))return i;if(s.subject.withPlaceholder)return i;const l=Pe(s,e,t);return _e(i,l)})({draggable:f,impact:g,previousImpact:e.impact,draggables:s.draggables,droppables:s.droppables});return{...e,current:p,dimensions:{draggables:s.draggables,droppables:m},impact:g,viewport:a,scrollJumpRequest:i||null,forceShouldAnimate:!i&&null}},Fe=({impact:e,viewport:t,draggables:r,destination:n,forceShouldAnimate:o})=>{const i=e.displaced,a=function(e,t){return e.map((e=>t[e]))}(i.all,r),s=ce({afterDragging:a,destination:n,displacedBy:e.displacedBy,viewport:t.frame,forceShouldAnimate:o,last:i});return{...e,displaced:s}},$e=({impact:e,draggable:t,droppable:r,draggables:n,viewport:o,afterCritical:i})=>{const a=ye({impact:e,draggable:t,draggables:n,droppable:r,afterCritical:i});return Ie({pageBorderBoxCenter:a,draggable:t,viewport:o})},ke=({state:e,dimensions:t,viewport:r})=>{"SNAP"!==e.movementMode&&x(!1);const n=e.impact,o=r||e.viewport,i=t||e.dimensions,{draggables:a,droppables:s}=i,l=a[e.critical.draggable.id],c=Re(n);c||x(!1);const d=s[c],u=Fe({impact:n,viewport:o,destination:d,draggables:a}),p=$e({impact:u,draggable:l,droppable:d,draggables:a,viewport:o,afterCritical:e.afterCritical});return je({impact:u,clientSelection:p,state:e,dimensions:i,viewport:o})},We=({draggable:e,home:t,draggables:r,viewport:n})=>{const o=Oe(t.axis,e.displaceBy),i=V(t.descriptor.id,r),a=i.indexOf(e);-1===a&&x(!1);const s=i.slice(a+1),l=s.reduce(((e,t)=>(e[t.descriptor.id]=!0,e)),{}),c={inVirtualList:"virtual"===t.descriptor.mode,displacedBy:o,effected:l};var d;return{impact:{displaced:ce({afterDragging:s,destination:t,displacedBy:o,last:null,viewport:n.frame,forceShouldAnimate:!1}),displacedBy:o,at:{type:"REORDER",destination:(d=e.descriptor,{index:d.index,droppableId:d.droppableId})}},afterCritical:c}};const Ue=e=>"SNAP"===e.movementMode,He=(e,t,r)=>{const n=((e,t)=>({draggables:e.draggables,droppables:_e(e.droppables,t)}))(e.dimensions,t);return!Ue(e)||r?je({state:e,dimensions:n}):ke({state:e,dimensions:n})};function qe(e){return e.isDragging&&"SNAP"===e.movementMode?{...e,scrollJumpRequest:null}:e}const Ve={phase:"IDLE",completed:null,shouldFlush:!1};var Ke=(e=Ve,t)=>{if("FLUSH"===t.type)return{...Ve,shouldFlush:!0};if("INITIAL_PUBLISH"===t.type){"IDLE"!==e.phase&&x(!1);const{critical:r,clientSelection:n,viewport:o,dimensions:i,movementMode:a}=t.payload,s=i.draggables[r.draggable.id],l=i.droppables[r.droppable.id],c={selection:n,borderBoxCenter:s.client.borderBox.center,offset:C},d={client:c,page:{selection:P(c.selection,o.scroll.initial),borderBoxCenter:P(c.selection,o.scroll.initial),offset:P(c.selection,o.scroll.diff.value)}},u=H(i.droppables).every((e=>!e.isFixedOnPage)),{impact:p,afterCritical:f}=We({draggable:s,home:l,draggables:i.draggables,viewport:o});return{phase:"DRAGGING",isDragging:!0,critical:r,movementMode:a,dimensions:i,initial:d,current:d,isWindowScrollAllowed:u,impact:p,afterCritical:f,onLiftImpact:p,viewport:o,scrollJumpRequest:null,forceShouldAnimate:null}}if("COLLECTION_STARTING"===t.type)return"COLLECTING"===e.phase||"DROP_PENDING"===e.phase?e:("DRAGGING"!==e.phase&&x(!1),{...e,phase:"COLLECTING"});if("PUBLISH_WHILE_DRAGGING"===t.type)return"COLLECTING"!==e.phase&&"DROP_PENDING"!==e.phase&&x(!1),(({state:e,published:t})=>{const r=t.modified.map((t=>{const r=e.dimensions.droppables[t.droppableId];return k(r,t.scroll)})),n={...e.dimensions.droppables,...W(r)},o=U((({additions:e,updatedDroppables:t,viewport:r})=>{const n=r.scroll.diff.value;return e.map((e=>{const o=e.descriptor.droppableId,i=(e=>{const t=e.frame;return t||x(!1),t})(t[o]),a=i.scroll.diff.value,s=(({draggable:e,offset:t,initialWindowScroll:r})=>{const n=(0,d.cY)(e.client,t),o=(0,d.SQ)(n,r);return{...e,placeholder:{...e.placeholder,client:n},client:n,page:o}})({draggable:e,offset:P(n,a),initialWindowScroll:r.scroll.initial});return s}))})({additions:t.additions,updatedDroppables:n,viewport:e.viewport})),i={...e.dimensions.draggables,...o};t.removals.forEach((e=>{delete i[e]}));const a={droppables:n,draggables:i},s=Re(e.impact),l=s?a.droppables[s]:null,c=a.draggables[e.critical.draggable.id],u=a.droppables[e.critical.droppable.id],{impact:p,afterCritical:f}=We({draggable:c,home:u,draggables:i,viewport:e.viewport}),g=l&&l.isCombineEnabled?e.impact:p,m=Ge({pageOffset:e.current.page.offset,draggable:a.draggables[e.critical.draggable.id],draggables:a.draggables,droppables:a.droppables,previousImpact:g,viewport:e.viewport,afterCritical:f}),b={...e,phase:"DRAGGING",impact:m,onLiftImpact:p,dimensions:a,afterCritical:f,forceShouldAnimate:!1};return"COLLECTING"===e.phase?b:{...b,phase:"DROP_PENDING",reason:e.reason,isWaiting:!1}})({state:e,published:t.payload});if("MOVE"===t.type){if("DROP_PENDING"===e.phase)return e;Be(e)||x(!1);const{client:r}=t.payload;return N(r,e.current.client.selection)?e:je({state:e,clientSelection:r,impact:Ue(e)?e.impact:null})}if("UPDATE_DROPPABLE_SCROLL"===t.type){if("DROP_PENDING"===e.phase)return qe(e);if("COLLECTING"===e.phase)return qe(e);Be(e)||x(!1);const{id:r,newScroll:n}=t.payload,o=e.dimensions.droppables[r];if(!o)return e;const i=k(o,n);return He(e,i,!1)}if("UPDATE_DROPPABLE_IS_ENABLED"===t.type){if("DROP_PENDING"===e.phase)return e;Be(e)||x(!1);const{id:r,isEnabled:n}=t.payload,o=e.dimensions.droppables[r];o||x(!1),o.isEnabled===n&&x(!1);const i={...o,isEnabled:n};return He(e,i,!0)}if("UPDATE_DROPPABLE_IS_COMBINE_ENABLED"===t.type){if("DROP_PENDING"===e.phase)return e;Be(e)||x(!1);const{id:r,isCombineEnabled:n}=t.payload,o=e.dimensions.droppables[r];o||x(!1),o.isCombineEnabled===n&&x(!1);const i={...o,isCombineEnabled:n};return He(e,i,!0)}if("MOVE_BY_WINDOW_SCROLL"===t.type){if("DROP_PENDING"===e.phase||"DROP_ANIMATING"===e.phase)return e;Be(e)||x(!1),e.isWindowScrollAllowed||x(!1);const r=t.payload.newScroll;if(N(e.viewport.scroll.current,r))return qe(e);const n=ve(e.viewport,r);return Ue(e)?ke({state:e,viewport:n}):je({state:e,viewport:n})}if("UPDATE_VIEWPORT_MAX_SCROLL"===t.type){if(!Be(e))return e;const r=t.payload.maxScroll;if(N(r,e.viewport.scroll.max))return e;const n={...e.viewport,scroll:{...e.viewport.scroll,max:r}};return{...e,viewport:n}}if("MOVE_UP"===t.type||"MOVE_DOWN"===t.type||"MOVE_LEFT"===t.type||"MOVE_RIGHT"===t.type){if("COLLECTING"===e.phase||"DROP_PENDING"===e.phase)return e;"DRAGGING"!==e.phase&&x(!1);const r=Ne({state:e,type:t.type});return r?je({state:e,impact:r.impact,clientSelection:r.clientSelection,scrollJumpRequest:r.scrollJumpRequest}):e}if("DROP_PENDING"===t.type){const r=t.payload.reason;return"COLLECTING"!==e.phase&&x(!1),{...e,phase:"DROP_PENDING",isWaiting:!0,reason:r}}if("DROP_ANIMATE"===t.type){const{completed:r,dropDuration:n,newHomeClientOffset:o}=t.payload;return"DRAGGING"!==e.phase&&"DROP_PENDING"!==e.phase&&x(!1),{phase:"DROP_ANIMATING",completed:r,dropDuration:n,newHomeClientOffset:o,dimensions:e.dimensions}}if("DROP_COMPLETE"===t.type){const{completed:e}=t.payload;return{phase:"IDLE",completed:e,shouldFlush:!1}}return e};const ze=e=>({type:"LIFT",payload:e}),Ye=e=>({type:"PUBLISH_WHILE_DRAGGING",payload:e}),Je=()=>({type:"COLLECTION_STARTING",payload:null}),Qe=e=>({type:"UPDATE_DROPPABLE_SCROLL",payload:e}),Xe=e=>({type:"UPDATE_DROPPABLE_IS_ENABLED",payload:e}),Ze=e=>({type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:e}),et=e=>({type:"MOVE",payload:e}),tt=()=>({type:"MOVE_UP",payload:null}),rt=()=>({type:"MOVE_DOWN",payload:null}),nt=()=>({type:"MOVE_RIGHT",payload:null}),ot=()=>({type:"MOVE_LEFT",payload:null}),it=()=>({type:"FLUSH",payload:null}),at=e=>({type:"DROP_COMPLETE",payload:e}),st=e=>({type:"DROP",payload:e}),lt="cubic-bezier(.2,1,.1,1)",ct=0,dt=.7,ut=.75,pt={outOfTheWay:.2,minDropTime:.33,maxDropTime:.55},ft=`${pt.outOfTheWay}s cubic-bezier(0.2, 0, 0, 1)`,gt={fluid:`opacity ${ft}`,snap:`transform ${ft}, opacity ${ft}`,drop:e=>{const t=`${e}s ${lt}`;return`transform ${t}, opacity ${t}`},outOfTheWay:`transform ${ft}`,placeholder:`height ${ft}, width ${ft}, margin ${ft}`},mt=e=>N(e,C)?void 0:`translate(${e.x}px, ${e.y}px)`,bt=mt,ht=(e,t)=>{const r=mt(e);if(r)return t?`${r} scale(${ut})`:r},{minDropTime:yt,maxDropTime:vt}=pt,xt=vt-yt;var It=({getState:e,dispatch:t})=>r=>n=>{if("DROP"!==n.type)return void r(n);const o=e(),i=n.payload.reason;if("COLLECTING"===o.phase)return void t((a={reason:i},{type:"DROP_PENDING",payload:a}));var a;if("IDLE"===o.phase)return;"DROP_PENDING"===o.phase&&o.isWaiting&&x(!1),"DRAGGING"!==o.phase&&"DROP_PENDING"!==o.phase&&x(!1);const s=o.critical,l=o.dimensions,c=l.draggables[o.critical.draggable.id],{impact:d,didDropInsideDroppable:u}=(({draggables:e,reason:t,lastImpact:r,home:n,viewport:o,onLiftImpact:i})=>r.at&&"DROP"===t?"REORDER"===r.at.type?{impact:r,didDropInsideDroppable:!0}:{impact:{...r,displaced:X},didDropInsideDroppable:!0}:{impact:Fe({draggables:e,impact:i,destination:n,viewport:o,forceShouldAnimate:!0}),didDropInsideDroppable:!1})({reason:i,lastImpact:o.impact,afterCritical:o.afterCritical,onLiftImpact:o.onLiftImpact,home:o.dimensions.droppables[o.critical.droppable.id],viewport:o.viewport,draggables:o.dimensions.draggables}),p=u?K(d):null,f=u?z(d):null,g={index:s.draggable.index,droppableId:s.droppable.id},m={draggableId:c.descriptor.id,type:c.descriptor.type,source:g,reason:i,mode:o.movementMode,destination:p,combine:f},b=(({impact:e,draggable:t,dimensions:r,viewport:n,afterCritical:o})=>{const{draggables:i,droppables:a}=r,s=Re(e),l=s?a[s]:null,c=a[t.descriptor.droppableId],d=$e({impact:e,draggable:t,draggables:i,afterCritical:o,droppable:l||c,viewport:n});return R(d,t.client.borderBox.center)})({impact:d,draggable:c,dimensions:l,viewport:o.viewport,afterCritical:o.afterCritical}),h={critical:o.critical,afterCritical:o.afterCritical,result:m,impact:d};if(N(o.current.client.offset,b)&&!Boolean(m.combine))return void t(at({completed:h}));const y=(({current:e,destination:t,reason:r})=>{const n=M(e,t);if(n<=0)return yt;if(n>=1500)return vt;const o=yt+xt*(n/1500);return Number(("CANCEL"===r?.6*o:o).toFixed(2))})({current:o.current.client.offset,destination:b,reason:i});t((e=>({type:"DROP_ANIMATE",payload:e}))({newHomeClientOffset:b,dropDuration:y,completed:h}))},wt=()=>({x:window.pageXOffset,y:window.pageYOffset});var Dt=e=>{const t=function({onWindowScroll:e}){const t=(0,p.A)((function(){e(wt())})),r=function(e){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:t=>{t.target!==window&&t.target!==window.document||e()}}}(t);let n=m;function o(){return n!==m}return{start:function(){o()&&x(!1),n=b(window,[r])},stop:function(){o()||x(!1),t.cancel(),n(),n=m},isActive:o}}({onWindowScroll:t=>{e.dispatch({type:"MOVE_BY_WINDOW_SCROLL",payload:{newScroll:t}})}});return e=>r=>{t.isActive()||"INITIAL_PUBLISH"!==r.type||t.start(),t.isActive()&&(e=>"DROP_COMPLETE"===e.type||"DROP_ANIMATE"===e.type||"FLUSH"===e.type)(r)&&t.stop(),e(r)}};const St=(e,t)=>{t()},Et=(e,t)=>({draggableId:e.draggable.id,type:e.droppable.type,source:{droppableId:e.droppable.id,index:e.draggable.index},mode:t});function At(e,t,r,n){if(!e)return void r(n(t));const o=(e=>{let t=!1,r=!1;const n=setTimeout((()=>{r=!0})),o=o=>{t||r||(t=!0,e(o),clearTimeout(n))};return o.wasCalled=()=>t,o})(r);e(t,{announce:o}),o.wasCalled()||r(n(t))}var Ot=(e,t)=>{const r=((e,t)=>{const r=(()=>{const e=[];return{add:t=>{const r=setTimeout((()=>(t=>{const r=e.findIndex((e=>e.timerId===t));-1===r&&x(!1);const[n]=e.splice(r,1);n.callback()})(r))),n={timerId:r,callback:t};e.push(n)},flush:()=>{if(!e.length)return;const t=[...e];e.length=0,t.forEach((e=>{clearTimeout(e.timerId),e.callback()}))}}})();let n=null;const o=r=>{n||x(!1),n=null,St(0,(()=>At(e().onDragEnd,r,t,O.onDragEnd)))};return{beforeCapture:(t,r)=>{n&&x(!1),St(0,(()=>{const n=e().onBeforeCapture;n&&n({draggableId:t,mode:r})}))},beforeStart:(t,r)=>{n&&x(!1),St(0,(()=>{const n=e().onBeforeDragStart;n&&n(Et(t,r))}))},start:(o,i)=>{n&&x(!1);const a=Et(o,i);n={mode:i,lastCritical:o,lastLocation:a.source,lastCombine:null},r.add((()=>{St(0,(()=>At(e().onDragStart,a,t,O.onDragStart)))}))},update:(o,i)=>{const a=K(i),s=z(i);n||x(!1);const l=!((e,t)=>{if(e===t)return!0;const r=e.draggable.id===t.draggable.id&&e.draggable.droppableId===t.draggable.droppableId&&e.draggable.type===t.draggable.type&&e.draggable.index===t.draggable.index,n=e.droppable.id===t.droppable.id&&e.droppable.type===t.droppable.type;return r&&n})(o,n.lastCritical);l&&(n.lastCritical=o);const c=(u=a,!(null==(d=n.lastLocation)&&null==u||null!=d&&null!=u&&d.droppableId===u.droppableId&&d.index===u.index));var d,u;c&&(n.lastLocation=a);const p=!((e,t)=>null==e&&null==t||null!=e&&null!=t&&e.draggableId===t.draggableId&&e.droppableId===t.droppableId)(n.lastCombine,s);if(p&&(n.lastCombine=s),!l&&!c&&!p)return;const f={...Et(o,n.mode),combine:s,destination:a};r.add((()=>{St(0,(()=>At(e().onDragUpdate,f,t,O.onDragUpdate)))}))},flush:()=>{n||x(!1),r.flush()},drop:o,abort:()=>{if(!n)return;const e={...Et(n.lastCritical,n.mode),combine:null,destination:null,reason:"CANCEL"};o(e)}}})(e,t);return e=>t=>n=>{if("BEFORE_INITIAL_CAPTURE"===n.type)return void r.beforeCapture(n.payload.draggableId,n.payload.movementMode);if("INITIAL_PUBLISH"===n.type){const e=n.payload.critical;return r.beforeStart(e,n.payload.movementMode),t(n),void r.start(e,n.payload.movementMode)}if("DROP_COMPLETE"===n.type){const e=n.payload.completed.result;return r.flush(),t(n),void r.drop(e)}if(t(n),"FLUSH"===n.type)return void r.abort();const o=e.getState();"DRAGGING"===o.phase&&r.update(o.critical,o.impact)}},Ct=e=>t=>r=>{if("DROP_ANIMATION_FINISHED"!==r.type)return void t(r);const n=e.getState();"DROP_ANIMATING"!==n.phase&&x(!1),e.dispatch(at({completed:n.completed}))},Pt=e=>{let t=null,r=null;return n=>o=>{if("FLUSH"!==o.type&&"DROP_COMPLETE"!==o.type&&"DROP_ANIMATION_FINISHED"!==o.type||(r&&(cancelAnimationFrame(r),r=null),t&&(t(),t=null)),n(o),"DROP_ANIMATE"!==o.type)return;const i={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){"DROP_ANIMATING"===e.getState().phase&&e.dispatch({type:"DROP_ANIMATION_FINISHED",payload:null})}};r=requestAnimationFrame((()=>{r=null,t=b(window,[i])}))}},Rt=e=>t=>r=>{if(t(r),"PUBLISH_WHILE_DRAGGING"!==r.type)return;const n=e.getState();"DROP_PENDING"===n.phase&&(n.isWaiting||e.dispatch(st({reason:n.reason})))};const Nt=s.Zz;var Bt=({dimensionMarshal:e,focusMarshal:t,styleMarshal:r,getResponders:n,announce:o,autoScroller:i})=>{return(0,s.y$)(Ke,Nt((0,s.Tw)((a=r,()=>e=>t=>{"INITIAL_PUBLISH"===t.type&&a.dragging(),"DROP_ANIMATE"===t.type&&a.dropping(t.payload.completed.result.reason),"FLUSH"!==t.type&&"DROP_COMPLETE"!==t.type||a.resting(),e(t)}),(e=>()=>t=>r=>{"DROP_COMPLETE"!==r.type&&"FLUSH"!==r.type&&"DROP_ANIMATE"!==r.type||e.stopPublishing(),t(r)})(e),(e=>({getState:t,dispatch:r})=>n=>o=>{if("LIFT"!==o.type)return void n(o);const{id:i,clientSelection:a,movementMode:s}=o.payload,l=t();"DROP_ANIMATING"===l.phase&&r(at({completed:l.completed})),"IDLE"!==t().phase&&x(!1),r(it()),r({type:"BEFORE_INITIAL_CAPTURE",payload:{draggableId:i,movementMode:s}});const c={draggableId:i,scrollOptions:{shouldPublishImmediately:"SNAP"===s}},{critical:d,dimensions:u,viewport:p}=e.startPublishing(c);r({type:"INITIAL_PUBLISH",payload:{critical:d,dimensions:u,clientSelection:a,movementMode:s,viewport:p}})})(e),It,Ct,Pt,Rt,(e=>t=>r=>n=>{if((e=>"DROP_COMPLETE"===e.type||"DROP_ANIMATE"===e.type||"FLUSH"===e.type)(n))return e.stop(),void r(n);if("INITIAL_PUBLISH"===n.type){r(n);const o=t.getState();return"DRAGGING"!==o.phase&&x(!1),void e.start(o)}r(n),e.scroll(t.getState())})(i),Dt,(e=>{let t=!1;return()=>r=>n=>{if("INITIAL_PUBLISH"===n.type)return t=!0,e.tryRecordFocus(n.payload.critical.draggable.id),r(n),void e.tryRestoreFocusRecorded();if(r(n),t){if("FLUSH"===n.type)return t=!1,void e.tryRestoreFocusRecorded();if("DROP_COMPLETE"===n.type){t=!1;const r=n.payload.completed.result;r.combine&&e.tryShiftRecord(r.draggableId,r.combine.draggableId),e.tryRestoreFocusRecorded()}}}})(t),Ot(n,o))));var a},Tt=({scrollHeight:e,scrollWidth:t,height:r,width:n})=>{const o=R({x:t,y:e},{x:n,y:r});return{x:Math.max(0,o.x),y:Math.max(0,o.y)}},Mt=()=>{const e=document.documentElement;return e||x(!1),e},Lt=()=>{const e=Mt();return Tt({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,width:e.clientWidth,height:e.clientHeight})};function Gt(e,t,r){return r.descriptor.id!==t.id&&(r.descriptor.type===t.type&&"virtual"===e.droppable.getById(r.descriptor.droppableId).descriptor.mode)}var _t=(e,t)=>{let r=null;const n=function({registry:e,callbacks:t}){let r={additions:{},removals:{},modified:{}},n=null;const o=()=>{n||(t.collectionStarting(),n=requestAnimationFrame((()=>{n=null;const{additions:o,removals:i,modified:a}=r,s=Object.keys(o).map((t=>e.draggable.getById(t).getDimension(C))).sort(((e,t)=>e.descriptor.index-t.descriptor.index)),l=Object.keys(a).map((t=>({droppableId:t,scroll:e.droppable.getById(t).callbacks.getScrollWhileDragging()}))),c={additions:s,removals:Object.keys(i),modified:l};r={additions:{},removals:{},modified:{}},t.publish(c)})))};return{add:e=>{const t=e.descriptor.id;r.additions[t]=e,r.modified[e.descriptor.droppableId]=!0,r.removals[t]&&delete r.removals[t],o()},remove:e=>{const t=e.descriptor;r.removals[t.id]=!0,r.modified[t.droppableId]=!0,r.additions[t.id]&&delete r.additions[t.id],o()},stop:()=>{n&&(cancelAnimationFrame(n),n=null,r={additions:{},removals:{},modified:{}})}}}({callbacks:{publish:t.publishWhileDragging,collectionStarting:t.collectionStarting},registry:e}),o=t=>{r||x(!1);const o=r.critical.draggable;"ADDITION"===t.type&&Gt(e,o,t.value)&&n.add(t.value),"REMOVAL"===t.type&&Gt(e,o,t.value)&&n.remove(t.value)},i={updateDroppableIsEnabled:(n,o)=>{e.droppable.exists(n)||x(!1),r&&t.updateDroppableIsEnabled({id:n,isEnabled:o})},updateDroppableIsCombineEnabled:(n,o)=>{r&&(e.droppable.exists(n)||x(!1),t.updateDroppableIsCombineEnabled({id:n,isCombineEnabled:o}))},scrollDroppable:(t,n)=>{r&&e.droppable.getById(t).callbacks.scroll(n)},updateDroppableScroll:(n,o)=>{r&&(e.droppable.exists(n)||x(!1),t.updateDroppableScroll({id:n,newScroll:o}))},startPublishing:t=>{r&&x(!1);const n=e.draggable.getById(t.draggableId),i=e.droppable.getById(n.descriptor.droppableId),a={draggable:n.descriptor,droppable:i.descriptor},s=e.subscribe(o);return r={critical:a,unsubscribe:s},(({critical:e,scrollOptions:t,registry:r})=>{const n=(()=>{const e=wt(),t=Lt(),r=e.y,n=e.x,o=Mt(),i=n+o.clientWidth,a=r+o.clientHeight;return{frame:(0,d.l)({top:r,left:n,right:i,bottom:a}),scroll:{initial:e,current:e,max:t,diff:{value:C,displacement:C}}}})(),o=n.scroll.current,i=e.droppable,a=r.droppable.getAllByType(i.type).map((e=>e.callbacks.getDimensionAndWatchScroll(o,t))),s=r.draggable.getAllByType(e.draggable.type).map((e=>e.getDimension(o)));return{dimensions:{draggables:U(s),droppables:W(a)},critical:e,viewport:n}})({critical:a,registry:e,scrollOptions:t.scrollOptions})},stopPublishing:()=>{if(!r)return;n.stop();const t=r.critical.droppable;e.droppable.getAllByType(t.type).forEach((e=>e.callbacks.dragStopped())),r.unsubscribe(),r=null}};return i},jt=(e,t)=>"IDLE"===e.phase||"DROP_ANIMATING"===e.phase&&e.completed.result.draggableId!==t&&"DROP"===e.completed.result.reason,Ft=e=>{window.scrollBy(e.x,e.y)};const $t=(0,u.A)((e=>H(e).filter((e=>!!e.isEnabled&&!!e.frame))));const kt={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:e=>e**2,durationDampening:{stopDampeningAt:1200,accelerateAt:360},disabled:!1};var Wt=({startOfRange:e,endOfRange:t,current:r})=>{const n=t-e;return 0===n?0:(r-e)/n},Ut=({distanceToEdge:e,thresholds:t,dragStartTime:r,shouldUseTimeDampening:n,getAutoScrollerOptions:o})=>{const i=((e,t,r=(()=>kt))=>{const n=r();if(e>t.startScrollingFrom)return 0;if(e<=t.maxScrollValueAt)return n.maxPixelScroll;if(e===t.startScrollingFrom)return 1;const o=1-Wt({startOfRange:t.maxScrollValueAt,endOfRange:t.startScrollingFrom,current:e}),i=n.maxPixelScroll*n.ease(o);return Math.ceil(i)})(e,t,o);return 0===i?0:n?Math.max(((e,t,r)=>{const n=r(),o=n.durationDampening.accelerateAt,i=n.durationDampening.stopDampeningAt,a=t,s=i,l=Date.now()-a;if(l>=i)return e;if(l{const a=((e,t,r=(()=>kt))=>{const n=r();return{startScrollingFrom:e[t.size]*n.startFromPercentage,maxScrollValueAt:e[t.size]*n.maxScrollAtPercentage}})(e,n,i);return t[n.end]0===e?0:e));var Vt=({dragStartTime:e,container:t,subject:r,center:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const a={top:n.y-t.top,right:t.right-n.x,bottom:t.bottom-n.y,left:n.x-t.left},s=Ht({container:t,distanceToEdges:a,dragStartTime:e,axis:ne,shouldUseTimeDampening:o,getAutoScrollerOptions:i}),l=Ht({container:t,distanceToEdges:a,dragStartTime:e,axis:oe,shouldUseTimeDampening:o,getAutoScrollerOptions:i}),c=qt({x:l,y:s});if(N(c,C))return null;const d=(({container:e,subject:t,proposedScroll:r})=>{const n=t.height>e.height,o=t.width>e.width;return o||n?o&&n?null:{x:o?0:r.x,y:n?0:r.y}:r})({container:t,subject:r,proposedScroll:c});return d?N(d,C)?null:d:null};const Kt=G((e=>0===e?0:e>0?1:-1)),zt=(()=>{const e=(e,t)=>e<0?e:e>t?e-t:0;return({current:t,max:r,change:n})=>{const o=P(t,n),i={x:e(o.x,r.x),y:e(o.y,r.y)};return N(i,C)?null:i}})(),Yt=({max:e,current:t,change:r})=>{const n={x:Math.max(t.x,e.x),y:Math.max(t.y,e.y)},o=Kt(r),i=zt({max:n,current:t,change:o});return!i||0!==o.x&&0===i.x||0!==o.y&&0===i.y},Jt=(e,t)=>Yt({current:e.scroll.current,max:e.scroll.max,change:t}),Qt=(e,t)=>{const r=e.frame;return!!r&&Yt({current:r.scroll.current,max:r.scroll.max,change:t})};var Xt=({state:e,dragStartTime:t,shouldUseTimeDampening:r,scrollWindow:n,scrollDroppable:o,getAutoScrollerOptions:i})=>{const a=e.current.page.borderBoxCenter,s=e.dimensions.draggables[e.critical.draggable.id].page.marginBox;if(e.isWindowScrollAllowed){const o=(({viewport:e,subject:t,center:r,dragStartTime:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const a=Vt({dragStartTime:n,container:e.frame,subject:t,center:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i});return a&&Jt(e,a)?a:null})({dragStartTime:t,viewport:e.viewport,subject:s,center:a,shouldUseTimeDampening:r,getAutoScrollerOptions:i});if(o)return void n(o)}const l=(({center:e,destination:t,droppables:r})=>{if(t){const e=r[t];return e.frame?e:null}const n=((e,t)=>{const r=$t(t).find((t=>(t.frame||x(!1),Te(t.frame.pageMarginBox)(e))))||null;return r})(e,r);return n})({center:a,destination:Re(e.impact),droppables:e.dimensions.droppables});if(!l)return;const c=(({droppable:e,subject:t,center:r,dragStartTime:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const a=e.frame;if(!a)return null;const s=Vt({dragStartTime:n,container:a.pageMarginBox,subject:t,center:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i});return s&&Qt(e,s)?s:null})({dragStartTime:t,droppable:l,subject:s,center:a,shouldUseTimeDampening:r,getAutoScrollerOptions:i});c&&o(l.descriptor.id,c)},Zt=({move:e,scrollDroppable:t,scrollWindow:r})=>n=>{const o=n.scrollJumpRequest;if(!o)return;const i=Re(n.impact);i||x(!1);const a=((e,r)=>{if(!Qt(e,r))return r;const n=((e,t)=>{const r=e.frame;return r&&Qt(e,t)?zt({current:r.scroll.current,max:r.scroll.max,change:t}):null})(e,r);if(!n)return t(e.descriptor.id,r),null;const o=R(r,n);return t(e.descriptor.id,o),R(r,o)})(n.dimensions.droppables[i],o);if(!a)return;const s=n.viewport,l=((e,t,n)=>{if(!e)return n;if(!Jt(t,n))return n;const o=((e,t)=>{if(!Jt(e,t))return null;const r=e.scroll.max,n=e.scroll.current;return zt({current:n,max:r,change:t})})(t,n);if(!o)return r(n),null;const i=R(n,o);return r(i),R(n,i)})(n.isWindowScrollAllowed,s,a);l&&((t,r)=>{const n=P(t.current.client.selection,r);e({client:n})})(n,l)},er=({scrollDroppable:e,scrollWindow:t,move:r,getAutoScrollerOptions:n})=>{const o=(({scrollWindow:e,scrollDroppable:t,getAutoScrollerOptions:r=(()=>kt)})=>{const n=(0,p.A)(e),o=(0,p.A)(t);let i=null;const a=e=>{i||x(!1);const{shouldUseTimeDampening:t,dragStartTime:a}=i;Xt({state:e,scrollWindow:n,scrollDroppable:o,dragStartTime:a,shouldUseTimeDampening:t,getAutoScrollerOptions:r})};return{start:e=>{i&&x(!1);const t=Date.now();let n=!1;const o=()=>{n=!0};Xt({state:e,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:o,scrollDroppable:o,getAutoScrollerOptions:r}),i={dragStartTime:t,shouldUseTimeDampening:n},n&&a(e)},stop:()=>{i&&(n.cancel(),o.cancel(),i=null)},scroll:a}})({scrollWindow:t,scrollDroppable:e,getAutoScrollerOptions:n}),i=Zt({move:r,scrollWindow:t,scrollDroppable:e});return{scroll:e=>{n().disabled||"DRAGGING"!==e.phase||("FLUID"!==e.movementMode?e.scrollJumpRequest&&i(e):o.scroll(e))},start:o.start,stop:o.stop}};const tr="data-rfd",rr=(()=>{const e=`${tr}-drag-handle`;return{base:e,draggableId:`${e}-draggable-id`,contextId:`${e}-context-id`}})(),nr=(()=>{const e=`${tr}-draggable`;return{base:e,contextId:`${e}-context-id`,id:`${e}-id`}})(),or=(()=>{const e=`${tr}-droppable`;return{base:e,contextId:`${e}-context-id`,id:`${e}-id`}})(),ir={contextId:`${tr}-scroll-container-context-id`},ar=(e,t)=>e.map((e=>{const r=e.styles[t];return r?`${e.selector} { ${r} }`:""})).join(" ");var sr=e=>{const t=(r=e,e=>`[${e}="${r}"]`);var r;const n=(()=>{const e="\n cursor: -webkit-grab;\n cursor: grab;\n ";return{selector:t(rr.contextId),styles:{always:"\n -webkit-touch-callout: none;\n -webkit-tap-highlight-color: rgba(0,0,0,0);\n touch-action: manipulation;\n ",resting:e,dragging:"pointer-events: none;",dropAnimating:e}}})(),o=[(()=>{const e=`\n transition: ${gt.outOfTheWay};\n `;return{selector:t(nr.contextId),styles:{dragging:e,dropAnimating:e,userCancel:e}}})(),n,{selector:t(or.contextId),styles:{always:"overflow-anchor: none;"}},{selector:"body",styles:{dragging:"\n cursor: grabbing;\n cursor: -webkit-grabbing;\n user-select: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n overflow-anchor: none;\n "}}];return{always:ar(o,"always"),resting:ar(o,"resting"),dragging:ar(o,"dragging"),dropAnimating:ar(o,"dropAnimating"),userCancel:ar(o,"userCancel")}},lr="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?n.useLayoutEffect:n.useEffect;const cr=()=>{const e=document.querySelector("head");return e||x(!1),e},dr=e=>{const t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.type="text/css",t};function ur(e,t){return Array.from(e.querySelectorAll(t))}var pr=e=>e&&e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView:window;function fr(e){return e instanceof pr(e).HTMLElement}function gr(){const e={draggables:{},droppables:{}},t=[];function r(e){t.length&&t.forEach((t=>t(e)))}function n(t){return e.draggables[t]||null}function o(t){return e.droppables[t]||null}return{draggable:{register:t=>{e.draggables[t.descriptor.id]=t,r({type:"ADDITION",value:t})},update:(t,r)=>{const n=e.draggables[r.descriptor.id];n&&n.uniqueId===t.uniqueId&&(delete e.draggables[r.descriptor.id],e.draggables[t.descriptor.id]=t)},unregister:t=>{const o=t.descriptor.id,i=n(o);i&&t.uniqueId===i.uniqueId&&(delete e.draggables[o],e.droppables[t.descriptor.droppableId]&&r({type:"REMOVAL",value:t}))},getById:function(e){const t=n(e);return t||x(!1),t},findById:n,exists:e=>Boolean(n(e)),getAllByType:t=>Object.values(e.draggables).filter((e=>e.descriptor.type===t))},droppable:{register:t=>{e.droppables[t.descriptor.id]=t},unregister:t=>{const r=o(t.descriptor.id);r&&t.uniqueId===r.uniqueId&&delete e.droppables[t.descriptor.id]},getById:function(e){const t=o(e);return t||x(!1),t},findById:o,exists:e=>Boolean(o(e)),getAllByType:t=>Object.values(e.droppables).filter((e=>e.descriptor.type===t))},subscribe:function(e){return t.push(e),function(){const r=t.indexOf(e);-1!==r&&t.splice(r,1)}},clean:function(){e.draggables={},e.droppables={},t.length=0}}}var mr=o().createContext(null),br=()=>{const e=document.body;return e||x(!1),e},hr={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"};const yr=e=>`rfd-announcement-${e}`;let vr=0;const xr={separator:"::"};var Ir="useId"in o()?function(e,t=xr){const r=o().useId();return(0,c.Kr)((()=>`${e}${t.separator}${r}`),[t.separator,e,r])}:function(e,t=xr){return(0,c.Kr)((()=>`${e}${t.separator}${vr++}`),[t.separator,e])},wr=o().createContext(null);function Dr(e){const t=(0,n.useRef)(e);return(0,n.useEffect)((()=>{t.current=e})),t}function Sr(e){return"IDLE"!==e.phase&&"DROP_ANIMATING"!==e.phase&&e.isDragging}const Er=9,Ar=13,Or=33,Cr=34,Pr=35,Rr=36,Nr={[Ar]:!0,[Er]:!0};var Br=e=>{Nr[e.keyCode]&&e.preventDefault()},Tr=(()=>{const e="visibilitychange";return"undefined"==typeof document?e:[e,`ms${e}`,`webkit${e}`,`moz${e}`,`o${e}`].find((e=>`on${e}`in document))||e})();const Mr={type:"IDLE"};function Lr(){}const Gr={[Cr]:!0,[Or]:!0,[Rr]:!0,[Pr]:!0};const _r={type:"IDLE"},jr=["input","button","textarea","select","option","optgroup","video","audio"];function Fr(e,t){if(null==t)return!1;if(jr.includes(t.tagName.toLowerCase()))return!0;const r=t.getAttribute("contenteditable");return"true"===r||""===r||t!==e&&Fr(e,t.parentElement)}function $r(e,t){const r=t.target;return!!fr(r)&&Fr(e,r)}var kr=e=>(0,d.l)(e.getBoundingClientRect()).center;const Wr=(()=>{const e="matches";return"undefined"==typeof document?e:[e,"msMatchesSelector","webkitMatchesSelector"].find((e=>e in Element.prototype))||e})();function Ur(e,t){return null==e?null:e[Wr](t)?e:Ur(e.parentElement,t)}function Hr(e,t){return e.closest?e.closest(t):Ur(e,t)}function qr(e){e.preventDefault()}function Vr({expected:e,phase:t,isLockActive:r,shouldWarn:n}){return!!r()&&e===t}function Kr({lockAPI:e,store:t,registry:r,draggableId:n}){if(e.isClaimed())return!1;const o=r.draggable.findById(n);return!!o&&!!o.options.isEnabled&&!!jt(t.getState(),n)}const zr=[function(e){const t=(0,n.useRef)(Mr),r=(0,n.useRef)(m),o=(0,c.Kr)((()=>({eventName:"mousedown",fn:function(t){if(t.defaultPrevented)return;if(0!==t.button)return;if(t.ctrlKey||t.metaKey||t.shiftKey||t.altKey)return;const n=e.findClosestDraggableId(t);if(!n)return;const o=e.tryGetLock(n,s,{sourceEvent:t});if(!o)return;t.preventDefault();const i={x:t.clientX,y:t.clientY};r.current(),u(o,i)}})),[e]),i=(0,c.Kr)((()=>({eventName:"webkitmouseforcewillbegin",fn:t=>{if(t.defaultPrevented)return;const r=e.findClosestDraggableId(t);if(!r)return;const n=e.findOptionsForDraggable(r);n&&(n.shouldRespectForcePress||e.canGetLock(r)&&t.preventDefault())}})),[e]),a=(0,c.hb)((function(){r.current=b(window,[i,o],{passive:!1,capture:!0})}),[i,o]),s=(0,c.hb)((()=>{"IDLE"!==t.current.type&&(t.current=Mr,r.current(),a())}),[a]),l=(0,c.hb)((()=>{const e=t.current;s(),"DRAGGING"===e.type&&e.actions.cancel({shouldBlockNextClick:!0}),"PENDING"===e.type&&e.actions.abort()}),[s]),d=(0,c.hb)((function(){const e=function({cancel:e,completed:t,getPhase:r,setPhase:n}){return[{eventName:"mousemove",fn:e=>{const{button:t,clientX:o,clientY:i}=e;if(0!==t)return;const a={x:o,y:i},s=r();if("DRAGGING"===s.type)return e.preventDefault(),void s.actions.move(a);if("PENDING"!==s.type&&x(!1),l=s.point,c=a,!(Math.abs(c.x-l.x)>=5||Math.abs(c.y-l.y)>=5))return;var l,c;e.preventDefault();const d=s.actions.fluidLift(a);n({type:"DRAGGING",actions:d})}},{eventName:"mouseup",fn:n=>{const o=r();"DRAGGING"===o.type?(n.preventDefault(),o.actions.drop({shouldBlockNextClick:!0}),t()):e()}},{eventName:"mousedown",fn:t=>{"DRAGGING"===r().type&&t.preventDefault(),e()}},{eventName:"keydown",fn:t=>{if("PENDING"!==r().type)return 27===t.keyCode?(t.preventDefault(),void e()):void Br(t);e()}},{eventName:"resize",fn:e},{eventName:"scroll",options:{passive:!0,capture:!1},fn:()=>{"PENDING"===r().type&&e()}},{eventName:"webkitmouseforcedown",fn:t=>{const n=r();"IDLE"===n.type&&x(!1),n.actions.shouldRespectForcePress()?e():t.preventDefault()}},{eventName:Tr,fn:e}]}({cancel:l,completed:s,getPhase:()=>t.current,setPhase:e=>{t.current=e}});r.current=b(window,e,{capture:!0,passive:!1})}),[l,s]),u=(0,c.hb)((function(e,r){"IDLE"!==t.current.type&&x(!1),t.current={type:"PENDING",point:r,actions:e},d()}),[d]);lr((function(){return a(),function(){r.current()}}),[a])},function(e){const t=(0,n.useRef)(Lr),r=(0,c.Kr)((()=>({eventName:"keydown",fn:function(r){if(r.defaultPrevented)return;if(32!==r.keyCode)return;const n=e.findClosestDraggableId(r);if(!n)return;const i=e.tryGetLock(n,l,{sourceEvent:r});if(!i)return;r.preventDefault();let a=!0;const s=i.snapLift();function l(){a||x(!1),a=!1,t.current(),o()}t.current(),t.current=b(window,function(e,t){function r(){t(),e.cancel()}return[{eventName:"keydown",fn:n=>27===n.keyCode?(n.preventDefault(),void r()):32===n.keyCode?(n.preventDefault(),t(),void e.drop()):40===n.keyCode?(n.preventDefault(),void e.moveDown()):38===n.keyCode?(n.preventDefault(),void e.moveUp()):39===n.keyCode?(n.preventDefault(),void e.moveRight()):37===n.keyCode?(n.preventDefault(),void e.moveLeft()):void(Gr[n.keyCode]?n.preventDefault():Br(n))},{eventName:"mousedown",fn:r},{eventName:"mouseup",fn:r},{eventName:"click",fn:r},{eventName:"touchstart",fn:r},{eventName:"resize",fn:r},{eventName:"wheel",fn:r,options:{passive:!0}},{eventName:Tr,fn:r}]}(s,l),{capture:!0,passive:!1})}})),[e]),o=(0,c.hb)((function(){t.current=b(window,[r],{passive:!1,capture:!0})}),[r]);lr((function(){return o(),function(){t.current()}}),[o])},function(e){const t=(0,n.useRef)(_r),r=(0,n.useRef)(m),o=(0,c.hb)((function(){return t.current}),[]),i=(0,c.hb)((function(e){t.current=e}),[]),a=(0,c.Kr)((()=>({eventName:"touchstart",fn:function(t){if(t.defaultPrevented)return;const n=e.findClosestDraggableId(t);if(!n)return;const o=e.tryGetLock(n,l,{sourceEvent:t});if(!o)return;const i=t.touches[0],{clientX:a,clientY:s}=i,c={x:a,y:s};r.current(),f(o,c)}})),[e]),s=(0,c.hb)((function(){r.current=b(window,[a],{capture:!0,passive:!1})}),[a]),l=(0,c.hb)((()=>{const e=t.current;"IDLE"!==e.type&&("PENDING"===e.type&&clearTimeout(e.longPressTimerId),i(_r),r.current(),s())}),[s,i]),d=(0,c.hb)((()=>{const e=t.current;l(),"DRAGGING"===e.type&&e.actions.cancel({shouldBlockNextClick:!0}),"PENDING"===e.type&&e.actions.abort()}),[l]),u=(0,c.hb)((function(){const e={capture:!0,passive:!1},t={cancel:d,completed:l,getPhase:o},n=b(window,function({cancel:e,completed:t,getPhase:r}){return[{eventName:"touchmove",options:{capture:!1},fn:t=>{const n=r();if("DRAGGING"!==n.type)return void e();n.hasMoved=!0;const{clientX:o,clientY:i}=t.touches[0],a={x:o,y:i};t.preventDefault(),n.actions.move(a)}},{eventName:"touchend",fn:n=>{const o=r();"DRAGGING"===o.type?(n.preventDefault(),o.actions.drop({shouldBlockNextClick:!0}),t()):e()}},{eventName:"touchcancel",fn:t=>{"DRAGGING"===r().type?(t.preventDefault(),e()):e()}},{eventName:"touchforcechange",fn:t=>{const n=r();"IDLE"===n.type&&x(!1);const o=t.touches[0];if(!o)return;if(!(o.force>=.15))return;const i=n.actions.shouldRespectForcePress();if("PENDING"!==n.type)return i?n.hasMoved?void t.preventDefault():void e():void t.preventDefault();i&&e()}},{eventName:Tr,fn:e}]}(t),e),i=b(window,function({cancel:e,getPhase:t}){return[{eventName:"orientationchange",fn:e},{eventName:"resize",fn:e},{eventName:"contextmenu",fn:e=>{e.preventDefault()}},{eventName:"keydown",fn:r=>{"DRAGGING"===t().type?(27===r.keyCode&&r.preventDefault(),e()):e()}},{eventName:Tr,fn:e}]}(t),e);r.current=function(){n(),i()}}),[d,o,l]),p=(0,c.hb)((function(){const e=o();"PENDING"!==e.type&&x(!1);const t=e.actions.fluidLift(e.point);i({type:"DRAGGING",actions:t,hasMoved:!1})}),[o,i]),f=(0,c.hb)((function(e,t){"IDLE"!==o().type&&x(!1);const r=setTimeout(p,120);i({type:"PENDING",point:t,actions:e,longPressTimerId:r}),u()}),[u,o,i,p]);lr((function(){return s(),function(){r.current();const e=o();"PENDING"===e.type&&(clearTimeout(e.longPressTimerId),i(_r))}}),[o,s,i]),lr((function(){return b(window,[{eventName:"touchmove",fn:()=>{},options:{capture:!1,passive:!1}}])}),[])}];function Yr({contextId:e,store:t,registry:r,customSensors:o,enableDefaultSensors:i}){const a=[...i?zr:[],...o||[]],s=(0,n.useState)((()=>function(){let e=null;function t(){e||x(!1),e=null}return{isClaimed:function(){return Boolean(e)},isActive:function(t){return t===e},claim:function(t){e&&x(!1);const r={abandon:t};return e=r,r},release:t,tryAbandon:function(){e&&(e.abandon(),t())}}}()))[0],l=(0,c.hb)((function(e,t){Sr(e)&&!Sr(t)&&s.tryAbandon()}),[s]);lr((function(){let e=t.getState();return t.subscribe((()=>{const r=t.getState();l(e,r),e=r}))}),[s,t,l]),lr((()=>s.tryAbandon),[s.tryAbandon]);const d=(0,c.hb)((e=>Kr({lockAPI:s,registry:r,store:t,draggableId:e})),[s,r,t]),u=(0,c.hb)(((n,o,i)=>function({lockAPI:e,contextId:t,store:r,registry:n,draggableId:o,forceSensorStop:i,sourceEvent:a}){if(!Kr({lockAPI:e,store:r,registry:n,draggableId:o}))return null;const s=n.draggable.getById(o),l=function(e,t){const r=`[${nr.contextId}="${e}"]`,n=ur(document,r).find((e=>e.getAttribute(nr.id)===t));return n&&fr(n)?n:null}(t,s.descriptor.id);if(!l)return null;if(a&&!s.options.canDragInteractiveElements&&$r(l,a))return null;const c=e.claim(i||m);let d="PRE_DRAG";function u(){return s.options.shouldRespectForcePress}function f(){return e.isActive(c)}const g=function(e,t){Vr({expected:e,phase:d,isLockActive:f,shouldWarn:!0})&&r.dispatch(t())}.bind(null,"DRAGGING");function h(t){function n(){e.release(),d="COMPLETED"}function o(e,o={shouldBlockNextClick:!1}){if(t.cleanup(),o.shouldBlockNextClick){const e=b(window,[{eventName:"click",fn:qr,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(e)}n(),r.dispatch(st({reason:e}))}return"PRE_DRAG"!==d&&(n(),x(!1)),r.dispatch(ze(t.liftActionArgs)),d="DRAGGING",{isActive:()=>Vr({expected:"DRAGGING",phase:d,isLockActive:f,shouldWarn:!1}),shouldRespectForcePress:u,drop:e=>o("DROP",e),cancel:e=>o("CANCEL",e),...t.actions}}return{isActive:()=>Vr({expected:"PRE_DRAG",phase:d,isLockActive:f,shouldWarn:!1}),shouldRespectForcePress:u,fluidLift:function(e){const t=(0,p.A)((e=>{g((()=>et({client:e})))}));return{...h({liftActionArgs:{id:o,clientSelection:e,movementMode:"FLUID"},cleanup:()=>t.cancel(),actions:{move:t}}),move:t}},snapLift:function(){const e={moveUp:()=>g(tt),moveRight:()=>g(nt),moveDown:()=>g(rt),moveLeft:()=>g(ot)};return h({liftActionArgs:{id:o,clientSelection:kr(l),movementMode:"SNAP"},cleanup:m,actions:e})},abort:function(){Vr({expected:"PRE_DRAG",phase:d,isLockActive:f,shouldWarn:!0})&&e.release()}}}({lockAPI:s,registry:r,contextId:e,store:t,draggableId:n,forceSensorStop:o||null,sourceEvent:i&&i.sourceEvent?i.sourceEvent:null})),[e,s,r,t]),f=(0,c.hb)((t=>function(e,t){const r=function(e,t){const r=t.target;if(!((n=r)instanceof pr(n).Element))return null;var n;const o=function(e){return`[${rr.contextId}="${e}"]`}(e),i=Hr(r,o);return i&&fr(i)?i:null}(e,t);return r?r.getAttribute(rr.draggableId):null}(e,t)),[e]),g=(0,c.hb)((e=>{const t=r.draggable.findById(e);return t?t.options:null}),[r.draggable]),h=(0,c.hb)((function(){s.isClaimed()&&(s.tryAbandon(),"IDLE"!==t.getState().phase&&t.dispatch(it()))}),[s,t]),y=(0,c.hb)((()=>s.isClaimed()),[s]),v=(0,c.Kr)((()=>({canGetLock:d,tryGetLock:u,findClosestDraggableId:f,findOptionsForDraggable:g,tryReleaseLock:h,isLockClaimed:y})),[d,u,f,g,h,y]);for(let e=0;e({onBeforeCapture:t=>{const r=()=>{e.onBeforeCapture&&e.onBeforeCapture(t)};o().version.startsWith("16")||o().version.startsWith("17")?r():(0,i.flushSync)(r)},onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragEnd:e.onDragEnd,onDragUpdate:e.onDragUpdate}),Qr=e=>({...kt,...e.autoScrollerOptions,durationDampening:{...kt.durationDampening,...e.autoScrollerOptions}});function Xr(e){return e.current||x(!1),e.current}function Zr(e){const{contextId:t,setCallbacks:r,sensors:i,nonce:a,dragHandleUsageInstructions:d}=e,p=(0,n.useRef)(null),g=Dr(e),m=(0,c.hb)((()=>Jr(g.current)),[g]),b=(0,c.hb)((()=>Qr(g.current)),[g]),h=function(e){const t=(0,c.Kr)((()=>yr(e)),[e]),r=(0,n.useRef)(null);return(0,n.useEffect)((function(){const e=document.createElement("div");return r.current=e,e.id=t,e.setAttribute("aria-live","assertive"),e.setAttribute("aria-atomic","true"),(0,f.A)(e.style,hr),br().appendChild(e),function(){setTimeout((function(){const t=br();t.contains(e)&&t.removeChild(e),e===r.current&&(r.current=null)}))}}),[t]),(0,c.hb)((e=>{const t=r.current;t&&(t.textContent=e)}),[])}(t),y=function({contextId:e,text:t}){const r=Ir("hidden-text",{separator:"-"}),o=(0,c.Kr)((()=>function({contextId:e,uniqueId:t}){return`rfd-hidden-text-${e}-${t}`}({contextId:e,uniqueId:r})),[r,e]);return(0,n.useEffect)((function(){const e=document.createElement("div");return e.id=o,e.textContent=t,e.style.display="none",br().appendChild(e),function(){const t=br();t.contains(e)&&t.removeChild(e)}}),[o,t]),o}({contextId:t,text:d}),v=function(e,t){const r=(0,c.Kr)((()=>sr(e)),[e]),o=(0,n.useRef)(null),i=(0,n.useRef)(null),a=(0,c.hb)((0,u.A)((e=>{const t=i.current;t||x(!1),t.textContent=e})),[]),s=(0,c.hb)((e=>{const t=o.current;t||x(!1),t.textContent=e}),[]);lr((()=>{(o.current||i.current)&&x(!1);const n=dr(t),l=dr(t);return o.current=n,i.current=l,n.setAttribute(`${tr}-always`,e),l.setAttribute(`${tr}-dynamic`,e),cr().appendChild(n),cr().appendChild(l),s(r.always),a(r.resting),()=>{const e=e=>{const t=e.current;t||x(!1),cr().removeChild(t),e.current=null};e(o),e(i)}}),[t,s,a,r.always,r.resting,e]);const l=(0,c.hb)((()=>a(r.dragging)),[a,r.dragging]),d=(0,c.hb)((e=>{a("DROP"!==e?r.userCancel:r.dropAnimating)}),[a,r.dropAnimating,r.userCancel]),p=(0,c.hb)((()=>{i.current&&a(r.resting)}),[a,r.resting]);return(0,c.Kr)((()=>({dragging:l,dropping:d,resting:p})),[l,d,p])}(t,a),I=(0,c.hb)((e=>{Xr(p).dispatch(e)}),[]),w=(0,c.Kr)((()=>(0,s.zH)({publishWhileDragging:Ye,updateDroppableScroll:Qe,updateDroppableIsEnabled:Xe,updateDroppableIsCombineEnabled:Ze,collectionStarting:Je},I)),[I]),D=function(){const e=(0,c.Kr)(gr,[]);return(0,n.useEffect)((()=>function(){o().version.startsWith("16")||o().version.startsWith("17")?requestAnimationFrame(e.clean):e.clean()}),[e]),e}(),S=(0,c.Kr)((()=>_t(D,w)),[D,w]),E=(0,c.Kr)((()=>er({scrollWindow:Ft,scrollDroppable:S.scrollDroppable,getAutoScrollerOptions:b,...(0,s.zH)({move:et},I)})),[S.scrollDroppable,I,b]),A=function(e){const t=(0,n.useRef)({}),r=(0,n.useRef)(null),o=(0,n.useRef)(null),i=(0,n.useRef)(!1),a=(0,c.hb)((function(e,r){const n={id:e,focus:r};return t.current[e]=n,function(){const r=t.current;r[e]!==n&&delete r[e]}}),[]),s=(0,c.hb)((function(t){const r=function(e,t){const r=`[${rr.contextId}="${e}"]`,n=ur(document,r);if(!n.length)return null;const o=n.find((e=>e.getAttribute(rr.draggableId)===t));return o&&fr(o)?o:null}(e,t);r&&r!==document.activeElement&&r.focus()}),[e]),l=(0,c.hb)((function(e,t){r.current===e&&(r.current=t)}),[]),d=(0,c.hb)((function(){o.current||i.current&&(o.current=requestAnimationFrame((()=>{o.current=null;const e=r.current;e&&s(e)})))}),[s]),u=(0,c.hb)((function(e){r.current=null;const t=document.activeElement;t&&t.getAttribute(rr.draggableId)===e&&(r.current=e)}),[]);return lr((()=>(i.current=!0,function(){i.current=!1;const e=o.current;e&&cancelAnimationFrame(e)})),[]),(0,c.Kr)((()=>({register:a,tryRecordFocus:u,tryRestoreFocusRecorded:d,tryShiftRecord:l})),[a,u,d,l])}(t),O=(0,c.Kr)((()=>Bt({announce:h,autoScroller:E,dimensionMarshal:S,focusMarshal:A,getResponders:m,styleMarshal:v})),[h,E,S,A,m,v]);p.current=O;const C=(0,c.hb)((()=>{const e=Xr(p);"IDLE"!==e.getState().phase&&e.dispatch(it())}),[]),P=(0,c.hb)((()=>{const e=Xr(p).getState();return"DROP_ANIMATING"===e.phase||"IDLE"!==e.phase&&e.isDragging}),[]);r((0,c.Kr)((()=>({isDragging:P,tryAbort:C})),[P,C]));const R=(0,c.hb)((e=>jt(Xr(p).getState(),e)),[]),N=(0,c.hb)((()=>Be(Xr(p).getState())),[]),B=(0,c.Kr)((()=>({marshal:S,focus:A,contextId:t,canLift:R,isMovementAllowed:N,dragHandleUsageInstructionsId:y,registry:D})),[t,S,y,A,R,N,D]);return Yr({contextId:t,store:O,registry:D,customSensors:i||null,enableDefaultSensors:!1!==e.enableDefaultSensors}),(0,n.useEffect)((()=>C),[C]),o().createElement(wr.Provider,{value:B},o().createElement(l.Kq,{context:mr,store:O},e.children))}let en=0;var tn="useId"in o()?function(){return o().useId()}:function(){return(0,c.Kr)((()=>""+en++),[])};function rn(e){const t=tn(),r=e.dragHandleUsageInstructions||O.dragHandleUsageInstructions;return o().createElement(I,null,(n=>o().createElement(Zr,{nonce:e.nonce,contextId:t,setCallbacks:n,dragHandleUsageInstructions:r,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 nn=5e3,on=4500,an=(e,t)=>t?gt.drop(t.duration):e?gt.snap:gt.fluid,sn=(e,t)=>{if(e)return t?ct:dt};var ln=o().createContext(null);function cn(e){const t=(0,n.useContext)(e);return t||x(!1),t}function dn(e){e.preventDefault()}var un=(e,t)=>e===t,pn=e=>{const{combine:t,destination:r}=e;return r?r.droppableId:t?t.droppableId:null};function fn(e=null){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:e,combineWith:null}}const gn={mapped:{type:"SECONDARY",offset:C,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:fn(null)}},mn={dropAnimationFinished:()=>({type:"DROP_ANIMATION_FINISHED",payload:null})},bn=(0,l.Ng)((()=>{const e=function(){const e=(0,u.A)(((e,t)=>({x:e,y:t}))),t=(0,u.A)(((e,t,r=null,n=null,o=null)=>({isDragging:!0,isClone:t,isDropAnimating:Boolean(o),dropAnimation:o,mode:e,draggingOver:r,combineWith:n,combineTargetFor:null}))),r=(0,u.A)(((e,r,n,o,i=null,a=null,s=null)=>({mapped:{type:"DRAGGING",dropping:null,draggingOver:i,combineWith:a,mode:r,offset:e,dimension:n,forceShouldAnimate:s,snapshot:t(r,o,i,a,null)}})));return(n,o)=>{if(Sr(n)){if(n.critical.draggable.id!==o.draggableId)return null;const t=n.current.client.offset,a=n.dimensions.draggables[o.draggableId],s=Re(n.impact),l=(i=n.impact).at&&"COMBINE"===i.at.type?i.at.combine.draggableId:null,c=n.forceShouldAnimate;return r(e(t.x,t.y),n.movementMode,a,o.isClone,s,l,c)}var i;if("DROP_ANIMATING"===n.phase){const e=n.completed;if(e.result.draggableId!==o.draggableId)return null;const r=o.isClone,i=n.dimensions.draggables[o.draggableId],a=e.result,s=a.mode,l=pn(a),c=(e=>e.combine?e.combine.draggableId:null)(a),d={duration:n.dropDuration,curve:lt,moveTo:n.newHomeClientOffset,opacity:c?ct:null,scale:c?ut:null};return{mapped:{type:"DRAGGING",offset:n.newHomeClientOffset,dimension:i,dropping:d,draggingOver:l,combineWith:c,mode:s,forceShouldAnimate:null,snapshot:t(s,r,l,c,d)}}}return null}}(),t=function(){const e=(0,u.A)(((e,t)=>({x:e,y:t}))),t=(0,u.A)(fn),r=(0,u.A)(((e,r=null,n)=>({mapped:{type:"SECONDARY",offset:e,combineTargetFor:r,shouldAnimateDisplacement:n,snapshot:t(r)}}))),n=e=>e?r(C,e,!0):null,o=(t,o,i,a)=>{const s=i.displaced.visible[t],l=Boolean(a.inVirtualList&&a.effected[t]),c=z(i),d=c&&c.draggableId===t?o:null;if(!s){if(!l)return n(d);if(i.displaced.invisible[t])return null;const o=B(a.displacedBy.point),s=e(o.x,o.y);return r(s,d,!0)}if(l)return n(d);const u=i.displacedBy.point,p=e(u.x,u.y);return r(p,d,s.shouldAnimate)};return(e,t)=>{if(Sr(e))return e.critical.draggable.id===t.draggableId?null:o(t.draggableId,e.critical.draggable.id,e.impact,e.afterCritical);if("DROP_ANIMATING"===e.phase){const r=e.completed;return r.result.draggableId===t.draggableId?null:o(t.draggableId,r.result.draggableId,r.impact,r.afterCritical)}return null}}();return(r,n)=>e(r,n)||t(r,n)||gn}),mn,null,{context:mr,areStatePropsEqual:un})((e=>{const t=(0,n.useRef)(null),r=(0,c.hb)(((e=null)=>{t.current=e}),[]),a=(0,c.hb)((()=>t.current),[]),{contextId:s,dragHandleUsageInstructionsId:l,registry:u}=cn(wr),{type:p,droppableId:f}=cn(ln),g=(0,c.Kr)((()=>({id:e.draggableId,index:e.index,type:p,droppableId:f})),[e.draggableId,e.index,p,f]),{children:m,draggableId:b,isEnabled:h,shouldRespectForcePress:y,canDragInteractiveElements:v,isClone:I,mapped:w,dropAnimationFinished:D}=e;I||function(e){const t=Ir("draggable"),{descriptor:r,registry:o,getDraggableRef:i,canDragInteractiveElements:a,shouldRespectForcePress:s,isEnabled:l}=e,u=(0,c.Kr)((()=>({canDragInteractiveElements:a,shouldRespectForcePress:s,isEnabled:l})),[a,l,s]),p=(0,c.hb)((e=>{const t=i();return t||x(!1),function(e,t,r=C){const n=window.getComputedStyle(t),o=t.getBoundingClientRect(),i=(0,d.a)(o,n),a=(0,d.SQ)(i,r);return{descriptor:e,placeholder:{client:i,tagName:t.tagName.toLowerCase(),display:n.display},displaceBy:{x:i.marginBox.width,y:i.marginBox.height},client:i,page:a}}(r,t,e)}),[r,i]),f=(0,c.Kr)((()=>({uniqueId:t,descriptor:r,options:u,getDimension:p})),[r,p,u,t]),g=(0,n.useRef)(f),m=(0,n.useRef)(!0);lr((()=>(o.draggable.register(g.current),()=>o.draggable.unregister(g.current))),[o.draggable]),lr((()=>{if(m.current)return void(m.current=!1);const e=g.current;g.current=f,o.draggable.update(f,e)}),[f,o.draggable])}((0,c.Kr)((()=>({descriptor:g,registry:u,getDraggableRef:a,canDragInteractiveElements:v,shouldRespectForcePress:y,isEnabled:h})),[g,u,a,v,y,h]));const S=(0,c.Kr)((()=>h?{tabIndex:0,role:"button","aria-describedby":l,"data-rfd-drag-handle-draggable-id":b,"data-rfd-drag-handle-context-id":s,draggable:!1,onDragStart:dn}:null),[s,l,b,h]),E=(0,c.hb)((e=>{"DRAGGING"===w.type&&w.dropping&&"transform"===e.propertyName&&(o().version.startsWith("16")||o().version.startsWith("17")?D():(0,i.flushSync)(D))}),[D,w]),A=(0,c.Kr)((()=>{const e=function(e){return"DRAGGING"===e.type?function(e){const t=e.dimension.client,{offset:r,combineWith:n,dropping:o}=e,i=Boolean(n),a=(e=>null!=e.forceShouldAnimate?e.forceShouldAnimate:"SNAP"===e.mode)(e),s=Boolean(o),l=s?ht(r,i):bt(r);return{position:"fixed",top:t.marginBox.top,left:t.marginBox.left,boxSizing:"border-box",width:t.borderBox.width,height:t.borderBox.height,transition:an(a,o),transform:l,opacity:sn(i,s),zIndex:s?on:nn,pointerEvents:"none"}}(e):{transform:bt((t=e).offset),transition:t.shouldAnimateDisplacement?void 0:"none"};var t}(w),t="DRAGGING"===w.type&&w.dropping?E:void 0;return{innerRef:r,draggableProps:{"data-rfd-draggable-context-id":s,"data-rfd-draggable-id":b,style:e,onTransitionEnd:t},dragHandleProps:S}}),[s,S,b,w,E,r]),O=(0,c.Kr)((()=>({draggableId:g.id,type:g.type,source:{index:g.index,droppableId:g.droppableId}})),[g.droppableId,g.id,g.index,g.type]);return o().createElement(o().Fragment,null,m(A,w.snapshot,O))}));var hn=bn;function yn(e){return cn(ln).isUsingCloneFor!==e.draggableId||e.isClone?o().createElement(hn,e):null}function vn(e){const t="boolean"!=typeof e.isDragDisabled||!e.isDragDisabled,r=Boolean(e.disableInteractiveElementBlocking),n=Boolean(e.shouldRespectForcePress);return o().createElement(yn,(0,f.A)({},e,{isClone:!1,isEnabled:t,canDragInteractiveElements:r,shouldRespectForcePress:n}))}const xn=e=>t=>e===t,In=xn("scroll"),wn=xn("auto"),Dn=(xn("visible"),(e,t)=>t(e.overflowX)||t(e.overflowY)),Sn=e=>null==e||e===document.body||e===document.documentElement?null:(e=>{const t=window.getComputedStyle(e),r={overflowX:t.overflowX,overflowY:t.overflowY};return Dn(r,In)||Dn(r,wn)})(e)?e:Sn(e.parentElement);var En=e=>({x:e.scrollLeft,y:e.scrollTop});const An=e=>!!e&&("fixed"===window.getComputedStyle(e).position||An(e.parentElement));const On={passive:!1},Cn={passive:!0};var Pn=e=>e.shouldPublishImmediately?On:Cn;const Rn=e=>e&&e.env.closestScrollable||null;function Nn(e){const t=(0,n.useRef)(null),r=cn(wr),o=Ir("droppable"),{registry:i,marshal:a}=r,s=Dr(e),l=(0,c.Kr)((()=>({id:e.droppableId,type:e.type,mode:e.mode})),[e.droppableId,e.mode,e.type]),f=(0,n.useRef)(l),g=(0,c.Kr)((()=>(0,u.A)(((e,r)=>{t.current||x(!1);const n={x:e,y:r};a.updateDroppableScroll(l.id,n)}))),[l.id,a]),m=(0,c.hb)((()=>{const e=t.current;return e&&e.env.closestScrollable?En(e.env.closestScrollable):C}),[]),b=(0,c.hb)((()=>{const e=m();g(e.x,e.y)}),[m,g]),h=(0,c.Kr)((()=>(0,p.A)(b)),[b]),y=(0,c.hb)((()=>{const e=t.current,r=Rn(e);e&&r||x(!1),e.scrollOptions.shouldPublishImmediately?b():h()}),[h,b]),v=(0,c.hb)(((e,n)=>{t.current&&x(!1);const o=s.current,i=o.getDroppableRef();i||x(!1);const a=(e=>({closestScrollable:Sn(e),isFixedOnPage:An(e)}))(i),c={ref:i,descriptor:l,env:a,scrollOptions:n};t.current=c;const u=(({ref:e,descriptor:t,env:r,windowScroll:n,direction:o,isDropDisabled:i,isCombineEnabled:a,shouldClipSubject:s})=>{const l=r.closestScrollable,c=((e,t)=>{const r=(0,d.YH)(e);if(!t)return r;if(e!==t)return r;const n=r.paddingBox.top-t.scrollTop,o=r.paddingBox.left-t.scrollLeft,i=n+t.scrollHeight,a={top:n,right:o+t.scrollWidth,bottom:i,left:o},s=(0,d.fT)(a,r.border);return(0,d.ge)({borderBox:s,margin:r.margin,border:r.border,padding:r.padding})})(e,l),u=(0,d.SQ)(c,n),p=(()=>{if(!l)return null;const e=(0,d.YH)(l),t={scrollHeight:l.scrollHeight,scrollWidth:l.scrollWidth};return{client:e,page:(0,d.SQ)(e,n),scroll:En(l),scrollSize:t,shouldClipSubject:s}})(),f=(({descriptor:e,isEnabled:t,isCombineEnabled:r,isFixedOnPage:n,direction:o,client:i,page:a,closest:s})=>{const l=(()=>{if(!s)return null;const{scrollSize:e,client:t}=s,r=Tt({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,height:t.paddingBox.height,width:t.paddingBox.width});return{pageMarginBox:s.page.marginBox,frameClient:t,scrollSize:e,shouldClipSubject:s.shouldClipSubject,scroll:{initial:s.scroll,current:s.scroll,max:r,diff:{value:C,displacement:C}}}})(),c="vertical"===o?ne:oe;return{descriptor:e,isCombineEnabled:r,isFixedOnPage:n,axis:c,isEnabled:t,client:i,page:a,frame:l,subject:$({page:a,withPlaceholder:null,axis:c,frame:l})}})({descriptor:t,isEnabled:!i,isCombineEnabled:a,isFixedOnPage:r.isFixedOnPage,direction:o,client:c,page:u,closest:p});return f})({ref:i,descriptor:l,env:a,windowScroll:e,direction:o.direction,isDropDisabled:o.isDropDisabled,isCombineEnabled:o.isCombineEnabled,shouldClipSubject:!o.ignoreContainerClipping}),p=a.closestScrollable;return p&&(p.setAttribute(ir.contextId,r.contextId),p.addEventListener("scroll",y,Pn(c.scrollOptions))),u}),[r.contextId,l,y,s]),I=(0,c.hb)((()=>{const e=t.current,r=Rn(e);return e&&r||x(!1),En(r)}),[]),w=(0,c.hb)((()=>{const e=t.current;e||x(!1);const r=Rn(e);t.current=null,r&&(h.cancel(),r.removeAttribute(ir.contextId),r.removeEventListener("scroll",y,Pn(e.scrollOptions)))}),[y,h]),D=(0,c.hb)((e=>{const r=t.current;r||x(!1);const n=Rn(r);n||x(!1),n.scrollTop+=e.y,n.scrollLeft+=e.x}),[]),S=(0,c.Kr)((()=>({getDimensionAndWatchScroll:v,getScrollWhileDragging:I,dragStopped:w,scroll:D})),[w,v,I,D]),E=(0,c.Kr)((()=>({uniqueId:o,descriptor:l,callbacks:S})),[S,l,o]);lr((()=>(f.current=E.descriptor,i.droppable.register(E),()=>{t.current&&w(),i.droppable.unregister(E)})),[S,l,w,E,a,i.droppable]),lr((()=>{t.current&&a.updateDroppableIsEnabled(f.current.id,!e.isDropDisabled)}),[e.isDropDisabled,a]),lr((()=>{t.current&&a.updateDroppableIsCombineEnabled(f.current.id,e.isCombineEnabled)}),[e.isCombineEnabled,a])}function Bn(){}const Tn={width:0,height:0,margin:{top:0,right:0,bottom:0,left:0}};var Mn=o().memo((e=>{const t=(0,n.useRef)(null),r=(0,c.hb)((()=>{t.current&&(clearTimeout(t.current),t.current=null)}),[]),{animate:i,onTransitionEnd:a,onClose:s,contextId:l}=e,[d,u]=(0,n.useState)("open"===e.animate);(0,n.useEffect)((()=>d?"open"!==i?(r(),u(!1),Bn):t.current?Bn:(t.current=setTimeout((()=>{t.current=null,u(!1)})),r):Bn),[i,d,r]);const p=(0,c.hb)((e=>{"height"===e.propertyName&&(a(),"close"===i&&s())}),[i,s,a]),f=(({isAnimatingOpenOnMount:e,placeholder:t,animate:r})=>{const n=(({isAnimatingOpenOnMount:e,placeholder:t,animate:r})=>e||"close"===r?Tn:{height:t.client.borderBox.height,width:t.client.borderBox.width,margin:t.client.margin})({isAnimatingOpenOnMount:e,placeholder:t,animate:r});return{display:t.display,boxSizing:"border-box",width:n.width,height:n.height,marginTop:n.margin.top,marginRight:n.margin.right,marginBottom:n.margin.bottom,marginLeft:n.margin.left,flexShrink:"0",flexGrow:"0",pointerEvents:"none",transition:"none"!==r?gt.placeholder:null}})({isAnimatingOpenOnMount:d,animate:e.animate,placeholder:e.placeholder});return o().createElement(e.placeholder.tagName,{style:f,"data-rfd-placeholder-context-id":l,onTransitionEnd:p,ref:e.innerRef})}));class Ln extends o().PureComponent{constructor(...e){super(...e),this.state={isVisible:Boolean(this.props.on),data:this.props.on,animate:this.props.shouldAnimate&&this.props.on?"open":"none"},this.onClose=()=>{"close"===this.state.animate&&this.setState({isVisible:!1})}}static getDerivedStateFromProps(e,t){return e.shouldAnimate?e.on?{isVisible:!0,data:e.on,animate:"open"}:t.isVisible?{isVisible:!0,data:t.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:Boolean(e.on),data:e.on,animate:"none"}}render(){if(!this.state.isVisible)return null;const e={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(e)}}const Gn={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:function(){return document.body||x(!1),document.body}},jn=e=>{let t,r={...e};for(t in Gn)void 0===e[t]&&(r={...r,[t]:Gn[t]});return r},Fn=(e,t)=>e===t.droppable.type,$n=(e,t)=>t.draggables[e.draggable.id];var kn=(0,l.Ng)((()=>{const e={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},t={...e,shouldAnimatePlaceholder:!1},r=(0,u.A)((e=>({draggableId:e.id,type:e.type,source:{index:e.index,droppableId:e.droppableId}}))),n=(0,u.A)(((n,o,i,a,s,l)=>{const c=s.descriptor.id;if(s.descriptor.droppableId===n){const e=l?{render:l,dragging:r(s.descriptor)}:null,t={isDraggingOver:i,draggingOverWith:i?c:null,draggingFromThisWith:c,isUsingPlaceholder:!0};return{placeholder:s.placeholder,shouldAnimatePlaceholder:!1,snapshot:t,useClone:e}}if(!o)return t;if(!a)return e;const d={isDraggingOver:i,draggingOverWith:c,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:s.placeholder,shouldAnimatePlaceholder:!0,snapshot:d,useClone:null}}));return(r,o)=>{const i=jn(o),a=i.droppableId,s=i.type,l=!i.isDropDisabled,c=i.renderClone;if(Sr(r)){const e=r.critical;if(!Fn(s,e))return t;const o=$n(e,r.dimensions),i=Re(r.impact)===a;return n(a,l,i,i,o,c)}if("DROP_ANIMATING"===r.phase){const e=r.completed;if(!Fn(s,e.critical))return t;const o=$n(e.critical,r.dimensions);return n(a,l,pn(e.result)===a,Re(e.impact)===a,o,c)}if("IDLE"===r.phase&&r.completed&&!r.shouldFlush){const n=r.completed;if(!Fn(s,n.critical))return t;const o=Re(n.impact)===a,i=Boolean(n.impact.at&&"COMBINE"===n.impact.at.type),l=n.critical.droppable.id===a;return o?i?e:t:l?e:t}return t}}),{updateViewportMaxScroll:e=>({type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:e})},((e,t,r)=>({...jn(r),...e,...t})),{context:mr,areStatePropsEqual:un})((e=>{const t=(0,n.useContext)(wr);t||x(!1);const{contextId:r,isMovementAllowed:i}=t,s=(0,n.useRef)(null),l=(0,n.useRef)(null),{children:d,droppableId:u,type:p,mode:f,direction:g,ignoreContainerClipping:m,isDropDisabled:b,isCombineEnabled:h,snapshot:y,useClone:v,updateViewportMaxScroll:I,getContainerForClone:w}=e,D=(0,c.hb)((()=>s.current),[]),S=(0,c.hb)(((e=null)=>{s.current=e}),[]),E=((0,c.hb)((()=>l.current),[]),(0,c.hb)(((e=null)=>{l.current=e}),[])),A=(0,c.hb)((()=>{i()&&I({maxScroll:Lt()})}),[i,I]);Nn({droppableId:u,type:p,mode:f,direction:g,isDropDisabled:b,isCombineEnabled:h,ignoreContainerClipping:m,getDroppableRef:D});const O=(0,c.Kr)((()=>o().createElement(Ln,{on:e.placeholder,shouldAnimate:e.shouldAnimatePlaceholder},(({onClose:e,data:t,animate:n})=>o().createElement(Mn,{placeholder:t,onClose:e,innerRef:E,animate:n,contextId:r,onTransitionEnd:A})))),[r,A,e.placeholder,e.shouldAnimatePlaceholder,E]),C=(0,c.Kr)((()=>({innerRef:S,placeholder:O,droppableProps:{"data-rfd-droppable-id":u,"data-rfd-droppable-context-id":r}})),[r,u,O,S]),P=v?v.dragging.draggableId:null,R=(0,c.Kr)((()=>({droppableId:u,type:p,isUsingCloneFor:P})),[u,P,p]);return o().createElement(ln.Provider,{value:R},d(C,y),function(){if(!v)return null;const{dragging:e,render:t}=v,r=o().createElement(yn,{draggableId:e.draggableId,index:e.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},((r,n)=>t(r,n,e)));return a().createPortal(r,w())}())}))},6795:(e,t,r)=>{r.d(t,{SQ:()=>u,YH:()=>f,a:()=>p,cY:()=>d,fT:()=>i,ge:()=>l,l:()=>o});var n=r(1561),o=function(e){var t=e.top,r=e.right,n=e.bottom,o=e.left;return{top:t,right:r,bottom:n,left:o,width:r-o,height:n-t,x:o,y:t,center:{x:(r+o)/2,y:(n+t)/2}}},i=function(e,t){return{top:e.top-t.top,left:e.left-t.left,bottom:e.bottom+t.bottom,right:e.right+t.right}},a=function(e,t){return{top:e.top+t.top,left:e.left+t.left,bottom:e.bottom-t.bottom,right:e.right-t.right}},s={top:0,right:0,bottom:0,left:0},l=function(e){var t=e.borderBox,r=e.margin,n=void 0===r?s:r,l=e.border,c=void 0===l?s:l,d=e.padding,u=void 0===d?s:d,p=o(i(t,n)),f=o(a(t,c)),g=o(a(f,u));return{marginBox:p,borderBox:o(t),paddingBox:f,contentBox:g,margin:n,border:c,padding:u}},c=function(e){var t=e.slice(0,-2);if("px"!==e.slice(-2))return 0;var r=Number(t);return isNaN(r)&&(0,n.A)(!1),r},d=function(e,t){var r,n,o=e.borderBox,i=e.border,a=e.margin,s=e.padding,c=(n=t,{top:(r=o).top+n.y,left:r.left+n.x,bottom:r.bottom+n.y,right:r.right+n.x});return l({borderBox:c,border:i,margin:a,padding:s})},u=function(e,t){return void 0===t&&(t={x:window.pageXOffset,y:window.pageYOffset}),d(e,t)},p=function(e,t){var r={top:c(t.marginTop),right:c(t.marginRight),bottom:c(t.marginBottom),left:c(t.marginLeft)},n={top:c(t.paddingTop),right:c(t.paddingRight),bottom:c(t.paddingBottom),left:c(t.paddingLeft)},o={top:c(t.borderTopWidth),right:c(t.borderRightWidth),bottom:c(t.borderBottomWidth),left:c(t.borderLeftWidth)};return l({borderBox:e,margin:r,padding:n,border:o})},f=function(e){var t=e.getBoundingClientRect(),r=window.getComputedStyle(e);return p(t,r)}},4146:(e,t,r)=>{var n=r(3404),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return n.isMemo(e)?a:s[e.$$typeof]||o}s[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[n.Memo]=a;var c=Object.defineProperty,d=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,g=Object.prototype;e.exports=function e(t,r,n){if("string"!=typeof r){if(g){var o=f(r);o&&o!==g&&e(t,o,n)}var a=d(r);u&&(a=a.concat(u(r)));for(var s=l(t),m=l(r),b=0;b{var r="function"==typeof Symbol&&Symbol.for,n=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,i=r?Symbol.for("react.fragment"):60107,a=r?Symbol.for("react.strict_mode"):60108,s=r?Symbol.for("react.profiler"):60114,l=r?Symbol.for("react.provider"):60109,c=r?Symbol.for("react.context"):60110,d=r?Symbol.for("react.async_mode"):60111,u=r?Symbol.for("react.concurrent_mode"):60111,p=r?Symbol.for("react.forward_ref"):60112,f=r?Symbol.for("react.suspense"):60113,g=r?Symbol.for("react.suspense_list"):60120,m=r?Symbol.for("react.memo"):60115,b=r?Symbol.for("react.lazy"):60116,h=r?Symbol.for("react.block"):60121,y=r?Symbol.for("react.fundamental"):60117,v=r?Symbol.for("react.responder"):60118,x=r?Symbol.for("react.scope"):60119;function I(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case d:case u:case i:case s:case a:case f:return e;default:switch(e=e&&e.$$typeof){case c:case p:case b:case m:case l:return e;default:return t}}case o:return t}}}function w(e){return I(e)===u}t.AsyncMode=d,t.ConcurrentMode=u,t.ContextConsumer=c,t.ContextProvider=l,t.Element=n,t.ForwardRef=p,t.Fragment=i,t.Lazy=b,t.Memo=m,t.Portal=o,t.Profiler=s,t.StrictMode=a,t.Suspense=f,t.isAsyncMode=function(e){return w(e)||I(e)===d},t.isConcurrentMode=w,t.isContextConsumer=function(e){return I(e)===c},t.isContextProvider=function(e){return I(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return I(e)===p},t.isFragment=function(e){return I(e)===i},t.isLazy=function(e){return I(e)===b},t.isMemo=function(e){return I(e)===m},t.isPortal=function(e){return I(e)===o},t.isProfiler=function(e){return I(e)===s},t.isStrictMode=function(e){return I(e)===a},t.isSuspense=function(e){return I(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===u||e===s||e===a||e===f||e===g||"object"==typeof e&&null!==e&&(e.$$typeof===b||e.$$typeof===m||e.$$typeof===l||e.$$typeof===c||e.$$typeof===p||e.$$typeof===y||e.$$typeof===v||e.$$typeof===x||e.$$typeof===h)},t.typeOf=I},3404:(e,t,r)=>{e.exports=r(3072)},1811:(e,t,r)=>{r.d(t,{A:()=>i});var n=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function o(e,t){if(e.length!==t.length)return!1;for(var r=0;r{r.d(t,{A:()=>n});const n=function(e){var t=[],r=null,n=function(){for(var n=arguments.length,o=new Array(n),i=0;i{var r=Symbol.for("react.element"),n=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.server_context"),d=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),g=Symbol.for("react.lazy");Symbol.for("react.offscreen");Symbol.for("react.module.reference"),t.isContextConsumer=function(e){return function(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case o:case a:case i:case u:case p:return e;default:switch(e=e&&e.$$typeof){case c:case l:case d:case g:case f:case s:return e;default:return t}}case n:return t}}}(e)===l}},4363:(e,t,r)=>{e.exports=r(2799)},1458:(e,t,r)=>{r.d(t,{t:()=>s});var n=r(1609);const o=Symbol.for("react-redux-context"),i="undefined"!=typeof globalThis?globalThis:{};function a(){var e;if(!n.createContext)return{};const t=null!=(e=i[o])?e:i[o]=new Map;let r=t.get(n.createContext);return r||(r=n.createContext(null),t.set(n.createContext,r)),r}const s=a()},9904:(e,t,r)=>{r.d(t,{A:()=>s});var n=r(1609),o=r(1458),i=r(8661),a=r(4595);const s=function({store:e,context:t,children:r,serverState:s,stabilityCheck:l="once",noopCheck:c="once"}){const d=n.useMemo((()=>{const t=(0,i.K)(e);return{store:e,subscription:t,getServerState:s?()=>s:void 0,stabilityCheck:l,noopCheck:c}}),[e,s,l,c]),u=n.useMemo((()=>e.getState()),[e]);(0,a.E)((()=>{const{subscription:t}=d;return t.onStateChange=t.notifyNestedSubs,t.trySubscribe(),u!==e.getState()&&t.notifyNestedSubs(),()=>{t.tryUnsubscribe(),t.onStateChange=void 0}}),[d,u]);const p=t||o.t;return n.createElement(p.Provider,{value:d},r)}},451:(e,t,r)=>{r.d(t,{A:()=>S,T:()=>x});var n=r(8168),o=r(8587),i=r(4146),a=r.n(i),s=r(1609),l=r(4363),c=r(9820),d=r(456),u=r(8869),p=r(7587),f=r(8661),g=r(4595),m=r(9124),b=r(1458),h=r(6344);const y=["reactReduxForwardedRef"];let v=h.w;const x=e=>{v=e},I=[null,null];function w(e,t,r,n,o,i){e.current=n,r.current=!1,o.current&&(o.current=null,i())}function D(e,t){return e===t}const S=function(e,t,r,{pure:i,areStatesEqual:h=D,areOwnPropsEqual:x=m.A,areStatePropsEqual:S=m.A,areMergedPropsEqual:E=m.A,forwardRef:A=!1,context:O=b.t}={}){const C=O,P=(0,u.J)(e),R=(0,d.q)(t),N=(0,p.ne)(r),B=Boolean(e);return e=>{const t=e.displayName||e.name||"Component",r=`Connect(${t})`,i={shouldHandleStateChanges:B,displayName:r,wrappedComponentName:t,WrappedComponent:e,initMapStateToProps:P,initMapDispatchToProps:R,initMergeProps:N,areStatesEqual:h,areStatePropsEqual:S,areOwnPropsEqual:x,areMergedPropsEqual:E};function d(t){const[r,a,d]=s.useMemo((()=>{const{reactReduxForwardedRef:e}=t,r=(0,o.A)(t,y);return[t.context,e,r]}),[t]),u=s.useMemo((()=>r&&r.Consumer&&(0,l.isContextConsumer)(s.createElement(r.Consumer,null))?r:C),[r,C]),p=s.useContext(u),m=Boolean(t.store)&&Boolean(t.store.getState)&&Boolean(t.store.dispatch),b=Boolean(p)&&Boolean(p.store),h=m?t.store:p.store,x=b?p.getServerState:h.getState,D=s.useMemo((()=>(0,c.A)(h.dispatch,i)),[h]),[S,E]=s.useMemo((()=>{if(!B)return I;const e=(0,f.K)(h,m?void 0:p.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]}),[h,m,p]),A=s.useMemo((()=>m?p:(0,n.A)({},p,{subscription:S})),[m,p,S]),O=s.useRef(),P=s.useRef(d),R=s.useRef(),N=s.useRef(!1),T=(s.useRef(!1),s.useRef(!1)),M=s.useRef();(0,g.E)((()=>(T.current=!0,()=>{T.current=!1})),[]);const L=s.useMemo((()=>()=>R.current&&d===P.current?R.current:D(h.getState(),d)),[h,d]),G=s.useMemo((()=>e=>S?function(e,t,r,n,o,i,a,s,l,c,d){if(!e)return()=>{};let u=!1,p=null;const f=()=>{if(u||!s.current)return;const e=t.getState();let r,f;try{r=n(e,o.current)}catch(e){f=e,p=e}f||(p=null),r===i.current?a.current||c():(i.current=r,l.current=r,a.current=!0,d())};return r.onStateChange=f,r.trySubscribe(),f(),()=>{if(u=!0,r.tryUnsubscribe(),r.onStateChange=null,p)throw p}}(B,h,S,D,P,O,N,T,R,E,e):()=>{}),[S]);var _,j;let F;_=w,j=[P,O,N,d,R,E],(0,g.E)((()=>_(...j)),undefined);try{F=v(G,L,x?()=>D(x(),d):L)}catch(e){throw M.current&&(e.message+=`\nThe error may be correlated with this previous error:\n${M.current.stack}\n\n`),e}(0,g.E)((()=>{M.current=void 0,R.current=void 0,O.current=F}));const $=s.useMemo((()=>s.createElement(e,(0,n.A)({},F,{ref:a}))),[a,e,F]);return s.useMemo((()=>B?s.createElement(u.Provider,{value:A},$):$),[u,$,A])}const u=s.memo(d);if(u.WrappedComponent=e,u.displayName=d.displayName=r,A){const t=s.forwardRef((function(e,t){return s.createElement(u,(0,n.A)({},e,{reactReduxForwardedRef:t}))}));return t.displayName=r,t.WrappedComponent=e,a()(t,e)}return a()(u,e)}}},3944:(e,t,r)=>{function n(e,t){return(r,n)=>{throw new Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${n.wrappedComponentName}.`)}}r.d(t,{i:()=>n})},456:(e,t,r)=>{r.d(t,{q:()=>a});var n=r(7684),o=r(6778),i=r(3944);function a(e){return e&&"object"==typeof e?(0,o.o6)((t=>(0,n.A)(e,t))):e?"function"==typeof e?(0,o.Qb)(e,"mapDispatchToProps"):(0,i.i)(e,"mapDispatchToProps"):(0,o.o6)((e=>({dispatch:e})))}},8869:(e,t,r)=>{r.d(t,{J:()=>i});var n=r(6778),o=r(3944);function i(e){return e?"function"==typeof e?(0,n.Qb)(e,"mapStateToProps"):(0,o.i)(e,"mapStateToProps"):(0,n.o6)((()=>({})))}},7587:(e,t,r)=>{r.d(t,{ne:()=>a});var n=r(8168),o=r(3944);function i(e,t,r){return(0,n.A)({},r,e,t)}function a(e){return e?"function"==typeof e?function(e){return function(t,{displayName:r,areMergedPropsEqual:n}){let o,i=!1;return function(t,r,a){const s=e(t,r,a);return i?n(s,o)||(o=s):(i=!0,o=s),o}}}(e):(0,o.i)(e,"mergeProps"):()=>i}},9820:(e,t,r)=>{r.d(t,{A:()=>a});var n=r(8587);const o=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function i(e,t,r,n,{areStatesEqual:o,areOwnPropsEqual:i,areStatePropsEqual:a}){let s,l,c,d,u,p=!1;return function(f,g){return p?function(p,f){const g=!i(f,l),m=!o(p,s,f,l);return s=p,l=f,g&&m?(c=e(s,l),t.dependsOnOwnProps&&(d=t(n,l)),u=r(c,d,l),u):g?(e.dependsOnOwnProps&&(c=e(s,l)),t.dependsOnOwnProps&&(d=t(n,l)),u=r(c,d,l),u):m?function(){const t=e(s,l),n=!a(t,c);return c=t,n&&(u=r(c,d,l)),u}():u}(f,g):(s=f,l=g,c=e(s,l),d=t(n,l),u=r(c,d,l),p=!0,u)}}function a(e,t){let{initMapStateToProps:r,initMapDispatchToProps:a,initMergeProps:s}=t,l=(0,n.A)(t,o);return i(r(e,l),a(e,l),s(e,l),e,l)}},6778:(e,t,r)=>{function n(e){return function(t){const r=e(t);function n(){return r}return n.dependsOnOwnProps=!1,n}}function o(e){return e.dependsOnOwnProps?Boolean(e.dependsOnOwnProps):1!==e.length}function i(e,t){return function(t,{displayName:r}){const n=function(e,t){return n.dependsOnOwnProps?n.mapToProps(e,t):n.mapToProps(e,void 0)};return n.dependsOnOwnProps=!0,n.mapToProps=function(t,r){n.mapToProps=e,n.dependsOnOwnProps=o(e);let i=n(t,r);return"function"==typeof i&&(n.mapToProps=i,n.dependsOnOwnProps=o(i),i=n(t,r)),i},n}}r.d(t,{Qb:()=>i,o6:()=>n})},2179:(e,t,r)=>{r.d(t,{Kq:()=>n.A,Ng:()=>o.A});var n=r(9904),o=r(451);r(1458),r(6338),r(125),r(387)},6338:(e,t,r)=>{r(1458),r(387)},3769:(e,t,r)=>{r(1609),r(1458)},125:(e,t,r)=>{r.d(t,{ld:()=>o}),r(1609),r(3769),r(1458);let n=null;const o=e=>{n=e}},387:(e,t,r)=>{r(1458),r(3769)},9924:(e,t,r)=>{r.d(t,{Kq:()=>c.Kq,Ng:()=>c.Ng});var n=r(9888),o=r(9242),i=r(2724),a=r(8298),s=r(125),l=r(451),c=r(2179);(0,s.ld)(o.useSyncExternalStoreWithSelector),(0,l.T)(n.useSyncExternalStore),(0,a.d)(i.r)},8661:(e,t,r)=>{r.d(t,{K:()=>i});var n=r(8298);const o={notify(){},get:()=>[]};function i(e,t){let r,i=o,a=0,s=!1;function l(){u.onStateChange&&u.onStateChange()}function c(){a++,r||(r=t?t.addNestedSub(l):e.subscribe(l),i=function(){const e=(0,n.f)();let t=null,r=null;return{clear(){t=null,r=null},notify(){e((()=>{let e=t;for(;e;)e.callback(),e=e.next}))},get(){let e=[],r=t;for(;r;)e.push(r),r=r.next;return e},subscribe(e){let n=!0,o=r={callback:e,next:null,prev:r};return o.prev?o.prev.next=o:t=o,function(){n&&null!==t&&(n=!1,o.next?o.next.prev=o.prev:r=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}())}function d(){a--,r&&0===a&&(r(),r=void 0,i.clear(),i=o)}const u={addNestedSub:function(e){c();const t=i.subscribe(e);let r=!1;return()=>{r||(r=!0,t(),d())}},notifyNestedSubs:function(){i.notify()},handleChangeWrapper:l,isSubscribed:function(){return s},trySubscribe:function(){s||(s=!0,c())},tryUnsubscribe:function(){s&&(s=!1,d())},getListeners:()=>i};return u}},8298:(e,t,r)=>{r.d(t,{d:()=>o,f:()=>i});let n=function(e){e()};const o=e=>n=e,i=()=>n},7684:(e,t,r)=>{function n(e,t){const r={};for(const n in e){const o=e[n];"function"==typeof o&&(r[n]=(...e)=>t(o(...e)))}return r}r.d(t,{A:()=>n})},2724:(e,t,r)=>{r.d(t,{r:()=>n.unstable_batchedUpdates});var n=r(5795)},9124:(e,t,r)=>{function n(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function o(e,t){if(n(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const r=Object.keys(e),o=Object.keys(t);if(r.length!==o.length)return!1;for(let o=0;oo})},4595:(e,t,r)=>{r.d(t,{E:()=>o});var n=r(1609);const o="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?n.useLayoutEffect:n.useEffect},6344:(e,t,r)=>{r.d(t,{w:()=>n});const n=()=>{throw new Error("uSES not initialized!")}},2960:(e,t,r)=>{r.d(t,{Tw:()=>p,Zz:()=>u,y$:()=>l,zH:()=>d});var n=r(9379);function o(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 i="function"==typeof Symbol&&Symbol.observable||"@@observable",a=function(){return Math.random().toString(36).substring(7).split("").join(".")},s={INIT:"@@redux/INIT"+a(),REPLACE:"@@redux/REPLACE"+a(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+a()}};function l(e,t,r){var n;if("function"==typeof t&&"function"==typeof r||"function"==typeof r&&"function"==typeof arguments[3])throw new Error(o(0));if("function"==typeof t&&void 0===r&&(r=t,t=void 0),void 0!==r){if("function"!=typeof r)throw new Error(o(1));return r(l)(e,t)}if("function"!=typeof e)throw new Error(o(2));var a=e,c=t,d=[],u=d,p=!1;function f(){u===d&&(u=d.slice())}function g(){if(p)throw new Error(o(3));return c}function m(e){if("function"!=typeof e)throw new Error(o(4));if(p)throw new Error(o(5));var t=!0;return f(),u.push(e),function(){if(t){if(p)throw new Error(o(6));t=!1,f();var r=u.indexOf(e);u.splice(r,1),d=null}}}function b(e){if(!function(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}(e))throw new Error(o(7));if(void 0===e.type)throw new Error(o(8));if(p)throw new Error(o(9));try{p=!0,c=a(c,e)}finally{p=!1}for(var t=d=u,r=0;r{r.d(t,{Kr:()=>i,hb:()=>a});var n=r(1609);function o(e,t){var r=(0,n.useState)((function(){return{inputs:t,result:e()}}))[0],o=(0,n.useRef)(!0),i=(0,n.useRef)(r),a=o.current||Boolean(t&&i.current.inputs&&function(e,t){if(e.length!==t.length)return!1;for(var r=0;r{var n=r(1609),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=n.useState,a=n.useEffect,s=n.useLayoutEffect,l=n.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!o(e,r)}catch(e){return!0}}var d="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var r=t(),n=i({inst:{value:r,getSnapshot:t}}),o=n[0].inst,d=n[1];return s((function(){o.value=r,o.getSnapshot=t,c(o)&&d({inst:o})}),[e,r,t]),a((function(){return c(o)&&d({inst:o}),e((function(){c(o)&&d({inst:o})}))}),[e]),l(r),r};t.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:d},8940:(e,t,r)=>{var n=r(1609),o=r(9888),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=o.useSyncExternalStore,s=n.useRef,l=n.useEffect,c=n.useMemo,d=n.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,r,n,o){var u=s(null);if(null===u.current){var p={hasValue:!1,value:null};u.current=p}else p=u.current;u=c((function(){function e(e){if(!l){if(l=!0,a=e,e=n(e),void 0!==o&&p.hasValue){var t=p.value;if(o(t,e))return s=t}return s=e}if(t=s,i(a,e))return t;var r=n(e);return void 0!==o&&o(t,r)?t:(a=e,s=r)}var a,s,l=!1,c=void 0===r?null:r;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]}),[t,r,n,o]);var f=a(e,u[0],u[1]);return l((function(){p.hasValue=!0,p.value=f}),[f]),d(f),f}},9888:(e,t,r)=>{e.exports=r(1063)},9242:(e,t,r)=>{e.exports=r(8940)},1609:e=>{e.exports=window.React},5795:e=>{e.exports=window.ReactDOM},8490:e=>{e.exports=window.wp.domReady},6087:e=>{e.exports=window.wp.element},7723:e=>{e.exports=window.wp.i18n},4467:(e,t,r)=>{r.d(t,{A:()=>o});var n=r(9922);function o(e,t,r){return(t=(0,n.A)(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},8168:(e,t,r)=>{function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;tn})},9379:(e,t,r)=>{r.d(t,{A:()=>i});var n=r(4467);function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t{function n(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}r.d(t,{A:()=>n})},2327:(e,t,r)=>{r.d(t,{A:()=>o});var n=r(2284);function o(e,t){if("object"!=(0,n.A)(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=(0,n.A)(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}},9922:(e,t,r)=>{r.d(t,{A:()=>i});var n=r(2284),o=r(2327);function i(e){var t=(0,o.A)(e,"string");return"symbol"==(0,n.A)(t)?t:t+""}},2284:(e,t,r)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}r.d(t,{A:()=>n})},1561:(e,t,r)=>{r.d(t,{A:()=>i});var n=!0,o="Invariant failed";function i(e,t){if(!e){if(n)throw new Error(o);var r="function"==typeof t?t():t,i=r?"".concat(o,": ").concat(r):o;throw new Error(i)}}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e=r(1609),t=r.n(e),n=r(1815),o=r(8490),i=r.n(o),a=r(6087),s=r(7723);function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r __( 'Are you sure you want to delete the post status? All posts with this status will be assigned to the default status.', 'vip-workflow' ), + 'custom_statuses' => array_values( $this->get_custom_statuses() ), ] ); } @@ -1210,12 +1211,12 @@ public function print_configure_view() { } include_once __DIR__ . '/views/edit-status.php'; - } elseif ( 'change-options' === $action ) { + } elseif ( 'manage-workflow' === $action ) { + include_once __DIR__ . '/views/manage-workflow.php'; + } else { $custom_status_list_table = new VW_Custom_Status_List_Table(); $custom_status_list_table->prepare_items(); include_once __DIR__ . '/views/configure.php'; - } elseif ( 'manage-workflow' === $action ) { - echo '

Manage Workflow

'; } } diff --git a/modules/custom-status/lib/custom-status-configure.js b/modules/custom-status/lib/custom-status-configure.js index d642795e..0e85deb3 100644 --- a/modules/custom-status/lib/custom-status-configure.js +++ b/modules/custom-status/lib/custom-status-configure.js @@ -1,5 +1,190 @@ +import { DragDropContext, Droppable, Draggable } from '@hello-pangea/dnd'; +import domReady from '@wordpress/dom-ready'; +import { createRoot, useState, useRef, useEffect } from '@wordpress/element'; +import { __ } from '@wordpress/i18n'; + +const WorkflowArrow = ( { start, end } ) => { + const canvasRef = useRef( null ); + const width = 40; + const height = 350; + + useEffect( () => { + const canvas = canvasRef.current; + const context = canvas?.getContext( '2d' ); + + if ( ! canvas || ! context ) { + return; + } + + const ratio = window.devicePixelRatio; + canvas.width = width * ratio; + canvas.height = height * ratio; + canvas.style.width = `${ width }px`; + canvas.style.height = `${ height }px`; + context.scale( ratio, ratio ); + + context.fillStyle = 'rgba(0, 0, 0, 0)'; + context.fillRect( 0, 0, canvas.width, canvas.height ); + + drawArrow( context, width, height ); + }, [ width, height ] ); + + return ( +
+

{ start }

+ +

{ end }

+
+ ); +}; + +function drawArrow( context, width, height ) { + const x0 = width / 2; + const y0 = 20; + let x1 = width / 2; + let y1 = height - 20; + + context.beginPath(); + const arrowWidth = 3; + const headLength = 6; + const headAngle = Math.PI / 6; + const angle = Math.atan2( y1 - y0, x1 - x0 ); + + context.lineWidth = arrowWidth; + + /* Adjust the point */ + x1 -= arrowWidth * Math.cos( angle ); + y1 -= arrowWidth * Math.sin( angle ); + + context.beginPath(); + context.moveTo( x0, y0 ); + context.lineTo( x1, y1 ); + context.stroke(); + + context.beginPath(); + context.lineTo( x1, y1 ); + context.lineTo( + x1 - headLength * Math.cos( angle - headAngle ), + y1 - headLength * Math.sin( angle - headAngle ) + ); + context.lineTo( + x1 - headLength * Math.cos( angle + headAngle ), + y1 - headLength * Math.sin( angle + headAngle ) + ); + context.closePath(); + context.stroke(); + context.fill(); +} + +function WorkflowManager() { + const [ items, setItems ] = useState( VW_CUSTOM_STATUS_CONFIGURE.custom_statuses ); + console.log( 'Custom statuses:', items ); + + const onDragEnd = result => { + // dropped outside the list + if ( ! result.destination ) { + return; + } + + const reorderedItems = reorder( items, result.source.index, result.destination.index ); + setItems( reorderedItems ); + }; + + return ( +
+ + + + + { ( provided, snapshot ) => ( +
+ { items.map( ( item, index ) => ( + + { ( provided, snapshot ) => ( +
+ { item.name } +
+ ) } +
+ ) ) } + { provided.placeholder } +
+ ) } +
+
+
+ ); +} + +domReady( () => { + const root = createRoot( document.getElementById( 'workflow-manager' ) ); + root.render( ); +} ); + +// a little function to help us with reordering the result +const reorder = ( list, startIndex, endIndex ) => { + const result = Array.from( list ); + const [ removed ] = result.splice( startIndex, 1 ); + result.splice( endIndex, 0, removed ); + + return result; +}; + +const grid = 8; + +const getItemStyle = ( index, isDragging, draggableStyle ) => { + const defaultBackgroundColor = index % 2 ? 'white' : '#f6f7f7'; + + return { + // some basic styles to make the items look a bit nicer + userSelect: 'none', + padding: grid * 2, + margin: `0 0 ${ grid }px 0`, + // change background colour if dragging + background: isDragging ? 'lightgreen' : defaultBackgroundColor, + border: '1px solid #c3c4c7', + + // styles we need to apply on draggables + ...draggableStyle, + }; +}; + +const getListStyle = isDraggingOver => ( { + background: isDraggingOver ? 'lightblue' : 'white', + padding: grid, + width: 250, + height: 'fit-content', + alignSelf: 'center', + border: '1px solid #c3c4c7', + boxShadow: '0 1px 1px rgba(0,0,0,.04)', +} ); + ( function ( $ ) { - inlineEditCustomStatus = { + const inlineEditCustomStatus = { init() { const t = this; const row = $( '#inline-edit' ); diff --git a/modules/custom-status/views/manage-workflow.php b/modules/custom-status/views/manage-workflow.php new file mode 100644 index 00000000..900de00c --- /dev/null +++ b/modules/custom-status/views/manage-workflow.php @@ -0,0 +1,7 @@ + + +
diff --git a/package-lock.json b/package-lock.json index 7ee12bc5..2db48d6a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,6 +21,7 @@ "@automattic/eslint-plugin-wpvip": "0.11.0", "@babel/core": "^7.24.5", "@babel/preset-env": "^7.24.5", + "@hello-pangea/dnd": "^16.6.0", "@testing-library/jest-dom": "^6.4.5", "@testing-library/react": "^15.0.7", "@testing-library/user-event": "^14.5.2", @@ -2495,6 +2496,25 @@ "@hapi/hoek": "^9.0.0" } }, + "node_modules/@hello-pangea/dnd": { + "version": "16.6.0", + "resolved": "https://registry.npmjs.org/@hello-pangea/dnd/-/dnd-16.6.0.tgz", + "integrity": "sha512-vfZ4GydqbtUPXSLfAvKvXQ6xwRzIjUSjVU0Sx+70VOhc2xx6CdmJXJ8YhH70RpbTUGjxctslQTHul9sIOxCfFQ==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.24.1", + "css-box-model": "^1.2.1", + "memoize-one": "^6.0.0", + "raf-schd": "^4.0.3", + "react-redux": "^8.1.3", + "redux": "^4.2.1", + "use-memo-one": "^1.1.3" + }, + "peerDependencies": { + "react": "^16.8.5 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.5 || ^17.0.0 || ^18.0.0" + } + }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.14", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", @@ -4938,6 +4958,16 @@ "integrity": "sha512-9VZUA5omXBfn+hDxFjUDu1FOJTBM3LmvqfDey+Z6Aa8B8/JmF5SMj6FBrjfgJ/Q3YXOZd3qyTDfJyMZSs/wCUA==", "dev": true }, + "node_modules/@types/hoist-non-react-statics": { + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.5.tgz", + "integrity": "sha512-SbcrWzkKBw2cdwRTwQAswfpB9g9LJWfjtUeW/jvNwbhC8cpmmNYVePa+ncbUe0rGTQ7G3Ff6mYUN2VMfLVr+Sg==", + "dev": true, + "dependencies": { + "@types/react": "*", + "hoist-non-react-statics": "^3.3.0" + } + }, "node_modules/@types/http-cache-semantics": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.4.tgz", @@ -5217,6 +5247,12 @@ "node": ">=0.10.0" } }, + "node_modules/@types/use-sync-external-store": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/@types/use-sync-external-store/-/use-sync-external-store-0.0.3.tgz", + "integrity": "sha512-EwmlvuaxPNej9+T4v5AuBPJa2x2UOJVdjCtDHgcDqitUeOtjnJKJ+apYjVcAoBEMjKW1VVFGZLUb5+qqa09XFA==", + "dev": true + }, "node_modules/@types/webpack": { "version": "4.41.38", "resolved": "https://registry.npmjs.org/@types/webpack/-/webpack-4.41.38.tgz", @@ -16967,6 +17003,15 @@ "integrity": "sha512-N3ASg0C4kNPUaNxt1XAvzHIVuzdtr8KLgfk1O8WDyimp1GisPAHESupArO2ieHk9QWbrJ/WkQODyh21Ps/xhxw==", "dev": true }, + "node_modules/css-box-model": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/css-box-model/-/css-box-model-1.2.1.tgz", + "integrity": "sha512-a7Vr4Q/kd/aw96bnJG332W9V9LkJO69JRcaCYDUqjp6/z0w6VcZjgAcTbgFxEPfBgdnAwlh3iwu+hLopa+flJw==", + "dev": true, + "dependencies": { + "tiny-invariant": "^1.0.6" + } + }, "node_modules/css-declaration-sorter": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/css-declaration-sorter/-/css-declaration-sorter-7.2.0.tgz", @@ -25264,6 +25309,12 @@ "integrity": "sha512-yywVJy8ctVlN5lNPxsep5urnZ6TTclwPEyigM9M3Bi8vseJBOfqNrGWN/r8NzuIt3PovM323W04blJfGQfQSVg==", "dev": true }, + "node_modules/memoize-one": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-6.0.0.tgz", + "integrity": "sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw==", + "dev": true + }, "node_modules/meow": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/meow/-/meow-9.0.0.tgz", @@ -28176,6 +28227,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/raf-schd": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/raf-schd/-/raf-schd-4.0.3.tgz", + "integrity": "sha512-tQkJl2GRWh83ui2DiPTJz9wEiMN20syf+5oKfB03yYP7ioZcJwsIK8FjrtLwH1m7C7e+Tt2yYBlrOpdT+dyeIQ==", + "dev": true + }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -28308,6 +28365,45 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==" }, + "node_modules/react-redux": { + "version": "8.1.3", + "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-8.1.3.tgz", + "integrity": "sha512-n0ZrutD7DaX/j9VscF+uTALI3oUPa/pO4Z3soOBIjuRn/FzVu6aehhysxZCLi6y7duMf52WNZGMl7CtuK5EnRw==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.12.1", + "@types/hoist-non-react-statics": "^3.3.1", + "@types/use-sync-external-store": "^0.0.3", + "hoist-non-react-statics": "^3.3.2", + "react-is": "^18.0.0", + "use-sync-external-store": "^1.0.0" + }, + "peerDependencies": { + "@types/react": "^16.8 || ^17.0 || ^18.0", + "@types/react-dom": "^16.8 || ^17.0 || ^18.0", + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0", + "react-native": ">=0.59", + "redux": "^4 || ^5.0.0-beta.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + }, + "react-dom": { + "optional": true + }, + "react-native": { + "optional": true + }, + "redux": { + "optional": true + } + } + }, "node_modules/react-refresh": { "version": "0.14.2", "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.14.2.tgz", @@ -31118,6 +31214,12 @@ "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==", "dev": true }, + "node_modules/tiny-invariant": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz", + "integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==", + "dev": true + }, "node_modules/tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", diff --git a/package.json b/package.json index 8c7cae7e..c4b16bd3 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "@automattic/eslint-plugin-wpvip": "0.11.0", "@babel/core": "^7.24.5", "@babel/preset-env": "^7.24.5", + "@hello-pangea/dnd": "^16.6.0", "@testing-library/jest-dom": "^6.4.5", "@testing-library/react": "^15.0.7", "@testing-library/user-event": "^14.5.2",