diff --git a/client/dist/js/bundle.js b/client/dist/js/bundle.js index 3bb409d9..687d9c12 100644 --- a/client/dist/js/bundle.js +++ b/client/dist/js/bundle.js @@ -1 +1 @@ -!function(){"use strict";var e={6733:function(e,t,n){n.r(t),n.d(t,{AutoScrollActivator:function(){return we},DndContext:function(){return Je},DragOverlay:function(){return vt},KeyboardCode:function(){return ae},KeyboardSensor:function(){return ce},MeasuringFrequency:function(){return Se},MeasuringStrategy:function(){return xe},MouseSensor:function(){return be},PointerSensor:function(){return ge},TouchSensor:function(){return Ee},TraversalOrder:function(){return Ce},applyModifiers:function(){return Xe},closestCenter:function(){return D},closestCorners:function(){return T},defaultAnnouncements:function(){return p},defaultCoordinates:function(){return y},defaultDropAnimation:function(){return pt},defaultDropAnimationSideEffects:function(){return ft},defaultKeyboardCoordinateGetter:function(){return ue},defaultScreenReaderInstructions:function(){return f},getClientRect:function(){return F},getFirstCollision:function(){return x},getScrollableAncestors:function(){return B},pointerWithin:function(){return P},rectIntersection:function(){return M},useDndContext:function(){return nt},useDndMonitor:function(){return d},useDraggable:function(){return tt},useDroppable:function(){return at},useSensor:function(){return v},useSensors:function(){return b}});var r=n(1594),o=n.n(r),a=ReactDom,i=n(4979);const l={display:"none"};function s(e){let{id:t,value:n}=e;return o().createElement("div",{id:t,style:l},n)}function u(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;return o().createElement("div",{id:t,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":r,"aria-atomic":!0},n)}const c=(0,r.createContext)(null);function d(e){const t=(0,r.useContext)(c);(0,r.useEffect)((()=>{if(!t)throw new Error("useDndMonitor must be used within a children of ");return t(e)}),[e,t])}const f={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},p={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function m(e){let{announcements:t=p,container:n,hiddenTextDescribedById:l,screenReaderInstructions:c=f}=e;const{announce:m,announcement:g}=function(){const[e,t]=(0,r.useState)("");return{announce:(0,r.useCallback)((e=>{null!=e&&t(e)}),[]),announcement:e}}(),h=(0,i.useUniqueId)("DndLiveRegion"),[v,b]=(0,r.useState)(!1);if((0,r.useEffect)((()=>{b(!0)}),[]),d((0,r.useMemo)((()=>({onDragStart(e){let{active:n}=e;m(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&m(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;m(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;m(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;m(t.onDragCancel({active:n,over:r}))}})),[m,t])),!v)return null;const y=o().createElement(o().Fragment,null,o().createElement(s,{id:l,value:c.draggable}),o().createElement(u,{id:h,announcement:g}));return n?(0,a.createPortal)(y,n):y}var g;function h(){}function v(e,t){return(0,r.useMemo)((()=>({sensor:e,options:null!=t?t:{}})),[e,t])}function b(){for(var e=arguments.length,t=new Array(e),n=0;n[...t].filter((e=>null!=e))),[...t])}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(g||(g={}));const y=Object.freeze({x:0,y:0});function E(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function w(e,t){const n=(0,i.getEventCoordinates)(e);if(!n)return"0 0";return(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%"}function C(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function _(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function O(e){let{left:t,top:n,height:r,width:o}=e;return[{x:t,y:n},{x:t+o,y:n},{x:t,y:n+r},{x:t+o,y:n+r}]}function x(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}function S(e,t,n){return void 0===t&&(t=e.left),void 0===n&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const D=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=S(t,t.left,t.top),a=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=E(S(r),o);a.push({id:t,data:{droppableContainer:e,value:n}})}}return a.sort(C)},T=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=O(t),a=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=O(r),i=o.reduce(((e,t,r)=>e+E(n[r],t)),0),l=Number((i/4).toFixed(4));a.push({id:t,data:{droppableContainer:e,value:l}})}}return a.sort(C)};function R(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),i=o-r,l=a-n;if(r{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const e of r){const{id:r}=e,a=n.get(r);if(a){const n=R(a,t);n>0&&o.push({id:r,data:{droppableContainer:e,value:n}})}}return o.sort(_)};function k(e,t){const{top:n,left:r,bottom:o,right:a}=t;return n<=e.y&&e.y<=o&&r<=e.x&&e.x<=a}const P=e=>{let{droppableContainers:t,droppableRects:n,pointerCoordinates:r}=e;if(!r)return[];const o=[];for(const e of t){const{id:t}=e,a=n.get(t);if(a&&k(r,a)){const n=O(a).reduce(((e,t)=>e+E(r,t)),0),i=Number((n/4).toFixed(4));o.push({id:t,data:{droppableContainer:e,value:i}})}}return o.sort(C)};function I(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:y}function N(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x})),{...t})}}const A=N(1);function j(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}const L={ignoreTransform:!1};function F(e,t){void 0===t&&(t=L);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=(0,i.getWindow)(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=j(t);if(!r)return e;const{scaleX:o,scaleY:a,x:i,y:l}=r,s=e.left-i-(1-o)*parseFloat(n),u=e.top-l-(1-a)*parseFloat(n.slice(n.indexOf(" ")+1)),c=o?e.width/o:e.width,d=a?e.height/a:e.height;return{width:c,height:d,top:u,right:s+c,bottom:u+d,left:s}}(n,t,r))}const{top:r,left:o,width:a,height:l,bottom:s,right:u}=n;return{top:r,left:o,width:a,height:l,bottom:s,right:u}}function W(e){return F(e,{ignoreTransform:!0})}function B(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if((0,i.isDocument)(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!(0,i.isHTMLElement)(o)||(0,i.isSVGElement)(o))return n;if(n.includes(o))return n;const a=(0,i.getWindow)(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=(0,i.getWindow)(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((e=>{const r=t[e];return"string"==typeof r&&n.test(r)}))}(o,a)&&n.push(o),function(e,t){return void 0===t&&(t=(0,i.getWindow)(e).getComputedStyle(e)),"fixed"===t.position}(o,a)?n:r(o.parentNode)}(e):n}function U(e){const[t]=B(e,1);return null!=t?t:null}function H(e){return i.canUseDOM&&e?(0,i.isWindow)(e)?e:(0,i.isNode)(e)?(0,i.isDocument)(e)||e===(0,i.getOwnerDocument)(e).scrollingElement?window:(0,i.isHTMLElement)(e)?e:null:null:null}function V(e){return(0,i.isWindow)(e)?e.scrollX:e.scrollLeft}function q(e){return(0,i.isWindow)(e)?e.scrollY:e.scrollTop}function $(e){return{x:V(e),y:q(e)}}var K;function z(e){return!(!i.canUseDOM||!e)&&e===document.scrollingElement}function X(e){const t={x:0,y:0},n=z(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(K||(K={}));const Y={x:.2,y:.2};function G(e,t,n,r,o){let{top:a,left:i,right:l,bottom:s}=n;void 0===r&&(r=10),void 0===o&&(o=Y);const{isTop:u,isBottom:c,isLeft:d,isRight:f}=X(e),p={x:0,y:0},m={x:0,y:0},g=t.height*o.y,h=t.width*o.x;return!u&&a<=t.top+g?(p.y=K.Backward,m.y=r*Math.abs((t.top+g-a)/g)):!c&&s>=t.bottom-g&&(p.y=K.Forward,m.y=r*Math.abs((t.bottom-g-s)/g)),!f&&l>=t.right-h?(p.x=K.Forward,m.x=r*Math.abs((t.right-h-l)/h)):!d&&i<=t.left+h&&(p.x=K.Backward,m.x=r*Math.abs((t.left+h-i)/h)),{direction:p,speed:m}}function J(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function Q(e){return e.reduce(((e,t)=>(0,i.add)(e,$(t))),y)}function Z(e,t){if(void 0===t&&(t=F),!e)return;const{top:n,left:r,bottom:o,right:a}=t(e);U(e)&&(o<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const ee=[["x",["left","right"],function(e){return e.reduce(((e,t)=>e+V(t)),0)}],["y",["top","bottom"],function(e){return e.reduce(((e,t)=>e+q(t)),0)}]];class te{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=B(t),r=Q(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of ee)for(const a of t)Object.defineProperty(this,a,{get:()=>{const t=o(n),i=r[e]-t;return this.rect[a]+i},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ne{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach((e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)}))},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function re(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}var oe,ae;function ie(e){e.preventDefault()}function le(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(oe||(oe={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"}(ae||(ae={}));const se={start:[ae.Space,ae.Enter],cancel:[ae.Esc],end:[ae.Space,ae.Enter,ae.Tab]},ue=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case ae.Right:return{...n,x:n.x+25};case ae.Left:return{...n,x:n.x-25};case ae.Down:return{...n,y:n.y+25};case ae.Up:return{...n,y:n.y-25}}};class ce{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new ne((0,i.getOwnerDocument)(t)),this.windowListeners=new ne((0,i.getWindow)(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(oe.Resize,this.handleCancel),this.windowListeners.add(oe.VisibilityChange,this.handleCancel),setTimeout((()=>this.listeners.add(oe.Keydown,this.handleKeyDown)))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&Z(n),t(y)}handleKeyDown(e){if((0,i.isKeyboardEvent)(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=se,coordinateGetter:a=ue,scrollBehavior:l="smooth"}=r,{code:s}=e;if(o.end.includes(s))return void this.handleEnd(e);if(o.cancel.includes(s))return void this.handleCancel(e);const{collisionRect:u}=n.current,c=u?{x:u.left,y:u.top}:y;this.referenceCoordinates||(this.referenceCoordinates=c);const d=a(e,{active:t,context:n.current,currentCoordinates:c});if(d){const t=(0,i.subtract)(d,c),r={x:0,y:0},{scrollableAncestors:o}=n.current;for(const n of o){const o=e.code,{isTop:a,isRight:i,isLeft:s,isBottom:u,maxScroll:c,minScroll:f}=X(n),p=J(n),m={x:Math.min(o===ae.Right?p.right-p.width/2:p.right,Math.max(o===ae.Right?p.left:p.left+p.width/2,d.x)),y:Math.min(o===ae.Down?p.bottom-p.height/2:p.bottom,Math.max(o===ae.Down?p.top:p.top+p.height/2,d.y))},g=o===ae.Right&&!i||o===ae.Left&&!s,h=o===ae.Down&&!u||o===ae.Up&&!a;if(g&&m.x!==d.x){const e=n.scrollLeft+t.x,a=o===ae.Right&&e<=c.x||o===ae.Left&&e>=f.x;if(a&&!t.y)return void n.scrollTo({left:e,behavior:l});r.x=a?n.scrollLeft-e:o===ae.Right?n.scrollLeft-c.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:l});break}if(h&&m.y!==d.y){const e=n.scrollTop+t.y,a=o===ae.Down&&e<=c.y||o===ae.Up&&e>=f.y;if(a&&!t.x)return void n.scrollTo({top:e,behavior:l});r.y=a?n.scrollTop-e:o===ae.Down?n.scrollTop-c.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:l});break}}this.handleMove(e,(0,i.add)((0,i.subtract)(d,this.referenceCoordinates),r))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function de(e){return Boolean(e&&"distance"in e)}function fe(e){return Boolean(e&&"delay"in e)}ce.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=se,onActivation:o}=t,{active:a}=n;const{code:i}=e.nativeEvent;if(r.start.includes(i)){const t=a.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==o||o({event:e.nativeEvent}),!0)}return!1}}];class pe{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=(0,i.getWindow)(e);return e instanceof t?e:(0,i.getOwnerDocument)(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:o}=e,{target:a}=o;this.props=e,this.events=t,this.document=(0,i.getOwnerDocument)(a),this.documentListeners=new ne(this.document),this.listeners=new ne(n),this.windowListeners=new ne((0,i.getWindow)(a)),this.initialCoordinates=null!=(r=(0,i.getEventCoordinates)(o))?r:y,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(oe.Resize,this.handleCancel),this.windowListeners.add(oe.DragStart,ie),this.windowListeners.add(oe.VisibilityChange,this.handleCancel),this.windowListeners.add(oe.ContextMenu,ie),this.documentListeners.add(oe.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(fe(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(de(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){const{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(oe.Click,le,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(oe.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:o}=this,{onMove:a,options:{activationConstraint:l}}=o;if(!r)return;const s=null!=(t=(0,i.getEventCoordinates)(e))?t:y,u=(0,i.subtract)(r,s);if(!n&&l){if(de(l)){if(null!=l.tolerance&&re(u,l.tolerance))return this.handleCancel();if(re(u,l.distance))return this.handleStart()}return fe(l)&&re(u,l.tolerance)?this.handleCancel():void this.handlePending(l,u)}e.cancelable&&e.preventDefault(),a(s)}handleEnd(){const{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){const{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===ae.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const me={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ge extends pe{constructor(e){const{event:t}=e,n=(0,i.getOwnerDocument)(t.target);super(e,me,n)}}ge.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!(!n.isPrimary||0!==n.button)&&(null==r||r({event:n}),!0)}}];const he={move:{name:"mousemove"},end:{name:"mouseup"}};var ve;!function(e){e[e.RightClick=2]="RightClick"}(ve||(ve={}));class be extends pe{constructor(e){super(e,he,(0,i.getOwnerDocument)(e.event.target))}}be.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==ve.RightClick&&(null==r||r({event:n}),!0)}}];const ye={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Ee extends pe{constructor(e){super(e,ye)}static setup(){return window.addEventListener(ye.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(ye.move.name,e)};function e(){}}}var we,Ce;function _e(e){let{acceleration:t,activator:n=we.Pointer,canScroll:o,draggingRect:a,enabled:l,interval:s=5,order:u=Ce.TreeOrder,pointerCoordinates:c,scrollableAncestors:d,scrollableAncestorRects:f,delta:p,threshold:m}=e;const g=function(e){let{delta:t,disabled:n}=e;const r=(0,i.usePrevious)(t);return(0,i.useLazyMemo)((e=>{if(n||!r||!e)return Oe;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[K.Backward]:e.x[K.Backward]||-1===o.x,[K.Forward]:e.x[K.Forward]||1===o.x},y:{[K.Backward]:e.y[K.Backward]||-1===o.y,[K.Forward]:e.y[K.Forward]||1===o.y}}}),[n,t,r])}({delta:p,disabled:!l}),[h,v]=(0,i.useInterval)(),b=(0,r.useRef)({x:0,y:0}),y=(0,r.useRef)({x:0,y:0}),E=(0,r.useMemo)((()=>{switch(n){case we.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case we.DraggableRect:return a}}),[n,a,c]),w=(0,r.useRef)(null),C=(0,r.useCallback)((()=>{const e=w.current;if(!e)return;const t=b.current.x*y.current.x,n=b.current.y*y.current.y;e.scrollBy(t,n)}),[]),_=(0,r.useMemo)((()=>u===Ce.TreeOrder?[...d].reverse():d),[u,d]);(0,r.useEffect)((()=>{if(l&&d.length&&E){for(const e of _){if(!1===(null==o?void 0:o(e)))continue;const n=d.indexOf(e),r=f[n];if(!r)continue;const{direction:a,speed:i}=G(e,r,E,t,m);for(const e of["x","y"])g[e][a[e]]||(i[e]=0,a[e]=0);if(i.x>0||i.y>0)return v(),w.current=e,h(C,s),b.current=i,void(y.current=a)}b.current={x:0,y:0},y.current={x:0,y:0},v()}else v()}),[t,C,o,v,l,s,JSON.stringify(E),JSON.stringify(g),h,d,_,f,JSON.stringify(m)])}Ee.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return!(o.length>1)&&(null==r||r({event:n}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(we||(we={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(Ce||(Ce={}));const Oe={x:{[K.Backward]:!1,[K.Forward]:!1},y:{[K.Backward]:!1,[K.Forward]:!1}};var xe,Se;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(xe||(xe={})),function(e){e.Optimized="optimized"}(Se||(Se={}));const De=new Map;function Te(e,t){return(0,i.useLazyMemo)((n=>e?n||("function"==typeof t?t(e):e):null),[t,e])}function Re(e){let{callback:t,disabled:n}=e;const o=(0,i.useEvent)(t),a=(0,r.useMemo)((()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(o)}),[n]);return(0,r.useEffect)((()=>()=>null==a?void 0:a.disconnect()),[a]),a}function Me(e){return new te(F(e),e)}function ke(e,t,n){void 0===t&&(t=Me);const[o,a]=(0,r.useState)(null);function l(){a((r=>{if(!e)return null;var o;if(!1===e.isConnected)return null!=(o=null!=r?r:n)?o:null;const a=t(e);return JSON.stringify(r)===JSON.stringify(a)?r:a}))}const s=function(e){let{callback:t,disabled:n}=e;const o=(0,i.useEvent)(t),a=(0,r.useMemo)((()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(o)}),[o,n]);return(0,r.useEffect)((()=>()=>null==a?void 0:a.disconnect()),[a]),a}({callback(t){if(e)for(const n of t){const{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){l();break}}}}),u=Re({callback:l});return(0,i.useIsomorphicLayoutEffect)((()=>{l(),e?(null==u||u.observe(e),null==s||s.observe(document.body,{childList:!0,subtree:!0})):(null==u||u.disconnect(),null==s||s.disconnect())}),[e]),o}const Pe=[];function Ie(e,t){void 0===t&&(t=[]);const n=(0,r.useRef)(null);return(0,r.useEffect)((()=>{n.current=null}),t),(0,r.useEffect)((()=>{const t=e!==y;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)}),[e]),n.current?(0,i.subtract)(e,n.current):y}function Ne(e){return(0,r.useMemo)((()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null),[e])}const Ae=[];function je(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return(0,i.isHTMLElement)(t)?t:e}const Le=[{sensor:ge,options:{}},{sensor:ce,options:{}}],Fe={current:{}},We={draggable:{measure:W},droppable:{measure:W,strategy:xe.WhileDragging,frequency:Se.Optimized},dragOverlay:{measure:F}};class Be extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter((e=>{let{disabled:t}=e;return!t}))}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const Ue={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Be,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:h},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:We,measureDroppableContainers:h,windowRect:null,measuringScheduled:!1},He={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:h,draggableNodes:new Map,over:null,measureDroppableContainers:h},Ve=(0,r.createContext)(He),qe=(0,r.createContext)(Ue);function $e(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Be}}}function Ke(e,t){switch(t.type){case g.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case g.DragMove:return null==e.draggable.active?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case g.DragEnd:case g.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case g.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Be(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case g.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;const i=new Be(e.droppable.containers);return i.set(n,{...a,disabled:o}),{...e,droppable:{...e.droppable,containers:i}}}case g.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const a=new Be(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function ze(e){let{disabled:t}=e;const{active:n,activatorEvent:o,draggableNodes:a}=(0,r.useContext)(Ve),l=(0,i.usePrevious)(o),s=(0,i.usePrevious)(null==n?void 0:n.id);return(0,r.useEffect)((()=>{if(!t&&!o&&l&&null!=s){if(!(0,i.isKeyboardEvent)(l))return;if(document.activeElement===l.target)return;const e=a.get(s);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame((()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=(0,i.findFirstFocusableNode)(e);if(t){t.focus();break}}}))}}),[o,t,a,s,l]),null}function Xe(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce(((e,t)=>t({transform:e,...r})),n):n}const Ye=(0,r.createContext)({...y,scaleX:1,scaleY:1});var Ge;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(Ge||(Ge={}));const Je=(0,r.memo)((function(e){var t,n,l,s;let{id:u,accessibility:d,autoScroll:f=!0,children:p,sensors:h=Le,collisionDetection:v=M,measuring:b,modifiers:E,...w}=e;const C=(0,r.useReducer)(Ke,void 0,$e),[_,O]=C,[S,D]=function(){const[e]=(0,r.useState)((()=>new Set)),t=(0,r.useCallback)((t=>(e.add(t),()=>e.delete(t))),[e]);return[(0,r.useCallback)((t=>{let{type:n,event:r}=t;e.forEach((e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)}))}),[e]),t]}(),[T,R]=(0,r.useState)(Ge.Uninitialized),k=T===Ge.Initialized,{draggable:{active:P,nodes:N,translate:j},droppable:{containers:L}}=_,W=null!=P?N.get(P):null,V=(0,r.useRef)({initial:null,translated:null}),q=(0,r.useMemo)((()=>{var e;return null!=P?{id:P,data:null!=(e=null==W?void 0:W.data)?e:Fe,rect:V}:null}),[P,W]),K=(0,r.useRef)(null),[X,Y]=(0,r.useState)(null),[G,J]=(0,r.useState)(null),Z=(0,i.useLatestValue)(w,Object.values(w)),ee=(0,i.useUniqueId)("DndDescribedBy",u),ne=(0,r.useMemo)((()=>L.getEnabled()),[L]),re=(oe=b,(0,r.useMemo)((()=>({draggable:{...We.draggable,...null==oe?void 0:oe.draggable},droppable:{...We.droppable,...null==oe?void 0:oe.droppable},dragOverlay:{...We.dragOverlay,...null==oe?void 0:oe.dragOverlay}})),[null==oe?void 0:oe.draggable,null==oe?void 0:oe.droppable,null==oe?void 0:oe.dragOverlay]));var oe;const{droppableRects:ae,measureDroppableContainers:ie,measuringScheduled:le}=function(e,t){let{dragging:n,dependencies:o,config:a}=t;const[l,s]=(0,r.useState)(null),{frequency:u,measure:c,strategy:d}=a,f=(0,r.useRef)(e),p=function(){switch(d){case xe.Always:return!1;case xe.BeforeDragging:return n;default:return!n}}(),m=(0,i.useLatestValue)(p),g=(0,r.useCallback)((function(e){void 0===e&&(e=[]),m.current||s((t=>null===t?e:t.concat(e.filter((e=>!t.includes(e))))))}),[m]),h=(0,r.useRef)(null),v=(0,i.useLazyMemo)((t=>{if(p&&!n)return De;if(!t||t===De||f.current!==e||null!=l){const t=new Map;for(let n of e){if(!n)continue;if(l&&l.length>0&&!l.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,r=e?new te(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t}),[e,l,n,p,c]);return(0,r.useEffect)((()=>{f.current=e}),[e]),(0,r.useEffect)((()=>{p||g()}),[n,p]),(0,r.useEffect)((()=>{l&&l.length>0&&s(null)}),[JSON.stringify(l)]),(0,r.useEffect)((()=>{p||"number"!=typeof u||null!==h.current||(h.current=setTimeout((()=>{g(),h.current=null}),u))}),[u,p,g,...o]),{droppableRects:v,measureDroppableContainers:g,measuringScheduled:null!=l}}(ne,{dragging:k,dependencies:[j.x,j.y],config:re.droppable}),se=function(e,t){const n=null!=t?e.get(t):void 0,r=n?n.node.current:null;return(0,i.useLazyMemo)((e=>{var n;return null==t?null:null!=(n=null!=r?r:e)?n:null}),[r,t])}(N,P),ue=(0,r.useMemo)((()=>G?(0,i.getEventCoordinates)(G):null),[G]),ce=function(){const e=!1===(null==X?void 0:X.autoScrollEnabled),t="object"==typeof f?!1===f.enabled:!1===f,n=k&&!e&&!t;if("object"==typeof f)return{...f,enabled:n};return{enabled:n}}(),de=function(e,t){return Te(e,t)}(se,re.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:o,config:a=!0}=e;const l=(0,r.useRef)(!1),{x:s,y:u}="boolean"==typeof a?{x:a,y:a}:a;(0,i.useIsomorphicLayoutEffect)((()=>{if(!s&&!u||!t)return void(l.current=!1);if(l.current||!o)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const r=I(n(e),o);if(s||(r.x=0),u||(r.y=0),l.current=!0,Math.abs(r.x)>0||Math.abs(r.y)>0){const t=U(e);t&&t.scrollBy({top:r.y,left:r.x})}}),[t,s,u,o,n])}({activeNode:null!=P?N.get(P):null,config:ce.layoutShiftCompensation,initialRect:de,measure:re.draggable.measure});const fe=ke(se,re.draggable.measure,de),pe=ke(se?se.parentElement:null),me=(0,r.useRef)({activatorEvent:null,active:null,activeNode:se,collisionRect:null,collisions:null,droppableRects:ae,draggableNodes:N,draggingNode:null,draggingNodeRect:null,droppableContainers:L,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ge=L.getNodeFor(null==(t=me.current.over)?void 0:t.id),he=function(e){let{measure:t}=e;const[n,o]=(0,r.useState)(null),a=Re({callback:(0,r.useCallback)((e=>{for(const{target:n}of e)if((0,i.isHTMLElement)(n)){o((e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r}));break}}),[t])}),l=(0,r.useCallback)((e=>{const n=je(e);null==a||a.disconnect(),n&&(null==a||a.observe(n)),o(n?t(n):null)}),[t,a]),[s,u]=(0,i.useNodeRef)(l);return(0,r.useMemo)((()=>({nodeRef:s,rect:n,setRef:u})),[n,s,u])}({measure:re.dragOverlay.measure}),ve=null!=(n=he.nodeRef.current)?n:se,be=k?null!=(l=he.rect)?l:fe:null,ye=Boolean(he.nodeRef.current&&he.rect),Ee=I(we=ye?null:fe,Te(we));var we;const Ce=Ne(ve?(0,i.getWindow)(ve):null),Oe=function(e){const t=(0,r.useRef)(e),n=(0,i.useLazyMemo)((n=>e?n&&n!==Pe&&e&&t.current&&e.parentNode===t.current.parentNode?n:B(e):Pe),[e]);return(0,r.useEffect)((()=>{t.current=e}),[e]),n}(k?null!=ge?ge:se:null),Se=function(e,t){void 0===t&&(t=F);const[n]=e,o=Ne(n?(0,i.getWindow)(n):null),[a,l]=(0,r.useState)(Ae);function s(){l((()=>e.length?e.map((e=>z(e)?o:new te(t(e),e))):Ae))}const u=Re({callback:s});return(0,i.useIsomorphicLayoutEffect)((()=>{null==u||u.disconnect(),s(),e.forEach((e=>null==u?void 0:u.observe(e)))}),[e]),a}(Oe),Me=Xe(E,{transform:{x:j.x-Ee.x,y:j.y-Ee.y,scaleX:1,scaleY:1},activatorEvent:G,active:q,activeNodeRect:fe,containerNodeRect:pe,draggingNodeRect:be,over:me.current.over,overlayNodeRect:he.rect,scrollableAncestors:Oe,scrollableAncestorRects:Se,windowRect:Ce}),Be=ue?(0,i.add)(ue,j):null,Ue=function(e){const[t,n]=(0,r.useState)(null),o=(0,r.useRef)(e),a=(0,r.useCallback)((e=>{const t=H(e.target);t&&n((e=>e?(e.set(t,$(t)),new Map(e)):null))}),[]);return(0,r.useEffect)((()=>{const t=o.current;if(e!==t){r(t);const i=e.map((e=>{const t=H(e);return t?(t.addEventListener("scroll",a,{passive:!0}),[t,$(t)]):null})).filter((e=>null!=e));n(i.length?new Map(i):null),o.current=e}return()=>{r(e),r(t)};function r(e){e.forEach((e=>{const t=H(e);null==t||t.removeEventListener("scroll",a)}))}}),[a,e]),(0,r.useMemo)((()=>e.length?t?Array.from(t.values()).reduce(((e,t)=>(0,i.add)(e,t)),y):Q(e):y),[e,t])}(Oe),He=Ie(Ue),Je=Ie(Ue,[fe]),Qe=(0,i.add)(Me,He),Ze=be?A(be,Me):null,et=q&&Ze?v({active:q,collisionRect:Ze,droppableRects:ae,droppableContainers:ne,pointerCoordinates:Be}):null,tt=x(et,"id"),[nt,rt]=(0,r.useState)(null),ot=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(ye?Me:(0,i.add)(Me,Je),null!=(s=null==nt?void 0:nt.rect)?s:null,fe),at=(0,r.useRef)(null),it=(0,r.useCallback)(((e,t)=>{let{sensor:n,options:r}=t;if(null==K.current)return;const o=N.get(K.current);if(!o)return;const i=e.nativeEvent,l=new n({active:K.current,activeNode:o,event:i,options:r,context:me,onAbort(e){if(!N.get(e))return;const{onDragAbort:t}=Z.current,n={id:e};null==t||t(n),S({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!N.get(e))return;const{onDragPending:o}=Z.current,a={id:e,constraint:t,initialCoordinates:n,offset:r};null==o||o(a),S({type:"onDragPending",event:a})},onStart(e){const t=K.current;if(null==t)return;const n=N.get(t);if(!n)return;const{onDragStart:r}=Z.current,o={activatorEvent:i,active:{id:t,data:n.data,rect:V}};(0,a.unstable_batchedUpdates)((()=>{null==r||r(o),R(Ge.Initializing),O({type:g.DragStart,initialCoordinates:e,active:t}),S({type:"onDragStart",event:o}),Y(at.current),J(i)}))},onMove(e){O({type:g.DragMove,coordinates:e})},onEnd:s(g.DragEnd),onCancel:s(g.DragCancel)});function s(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:o}=me.current;let l=null;if(t&&o){const{cancelDrop:a}=Z.current;if(l={activatorEvent:i,active:t,collisions:n,delta:o,over:r},e===g.DragEnd&&"function"==typeof a){await Promise.resolve(a(l))&&(e=g.DragCancel)}}K.current=null,(0,a.unstable_batchedUpdates)((()=>{O({type:e}),R(Ge.Uninitialized),rt(null),Y(null),J(null),at.current=null;const t=e===g.DragEnd?"onDragEnd":"onDragCancel";if(l){const e=Z.current[t];null==e||e(l),S({type:t,event:l})}}))}}at.current=l}),[N]),lt=(0,r.useCallback)(((e,t)=>(n,r)=>{const o=n.nativeEvent,a=N.get(r);if(null!==K.current||!a||o.dndKit||o.defaultPrevented)return;const i={active:a};!0===e(n,t.options,i)&&(o.dndKit={capturedBy:t.sensor},K.current=r,it(n,t))}),[N,it]),st=function(e,t){return(0,r.useMemo)((()=>e.reduce(((e,n)=>{const{sensor:r}=n;return[...e,...r.activators.map((e=>({eventName:e.eventName,handler:t(e.handler,n)})))]}),[])),[e,t])}(h,lt);!function(e){(0,r.useEffect)((()=>{if(!i.canUseDOM)return;const t=e.map((e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()}));return()=>{for(const e of t)null==e||e()}}),e.map((e=>{let{sensor:t}=e;return t})))}(h),(0,i.useIsomorphicLayoutEffect)((()=>{fe&&T===Ge.Initializing&&R(Ge.Initialized)}),[fe,T]),(0,r.useEffect)((()=>{const{onDragMove:e}=Z.current,{active:t,activatorEvent:n,collisions:r,over:o}=me.current;if(!t||!n)return;const i={active:t,activatorEvent:n,collisions:r,delta:{x:Qe.x,y:Qe.y},over:o};(0,a.unstable_batchedUpdates)((()=>{null==e||e(i),S({type:"onDragMove",event:i})}))}),[Qe.x,Qe.y]),(0,r.useEffect)((()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:o}=me.current;if(!e||null==K.current||!t||!o)return;const{onDragOver:i}=Z.current,l=r.get(tt),s=l&&l.rect.current?{id:l.id,rect:l.rect.current,data:l.data,disabled:l.disabled}:null,u={active:e,activatorEvent:t,collisions:n,delta:{x:o.x,y:o.y},over:s};(0,a.unstable_batchedUpdates)((()=>{rt(s),null==i||i(u),S({type:"onDragOver",event:u})}))}),[tt]),(0,i.useIsomorphicLayoutEffect)((()=>{me.current={activatorEvent:G,active:q,activeNode:se,collisionRect:Ze,collisions:et,droppableRects:ae,draggableNodes:N,draggingNode:ve,draggingNodeRect:be,droppableContainers:L,over:nt,scrollableAncestors:Oe,scrollAdjustedTranslate:Qe},V.current={initial:be,translated:Ze}}),[q,se,et,Ze,N,ve,be,ae,L,nt,Oe,Qe]),_e({...ce,delta:j,draggingRect:Ze,pointerCoordinates:Be,scrollableAncestors:Oe,scrollableAncestorRects:Se});const ut=(0,r.useMemo)((()=>({active:q,activeNode:se,activeNodeRect:fe,activatorEvent:G,collisions:et,containerNodeRect:pe,dragOverlay:he,draggableNodes:N,droppableContainers:L,droppableRects:ae,over:nt,measureDroppableContainers:ie,scrollableAncestors:Oe,scrollableAncestorRects:Se,measuringConfiguration:re,measuringScheduled:le,windowRect:Ce})),[q,se,fe,G,et,pe,he,N,L,ae,nt,ie,Oe,Se,re,le,Ce]),ct=(0,r.useMemo)((()=>({activatorEvent:G,activators:st,active:q,activeNodeRect:fe,ariaDescribedById:{draggable:ee},dispatch:O,draggableNodes:N,over:nt,measureDroppableContainers:ie})),[G,st,q,fe,O,ee,N,nt,ie]);return o().createElement(c.Provider,{value:D},o().createElement(Ve.Provider,{value:ct},o().createElement(qe.Provider,{value:ut},o().createElement(Ye.Provider,{value:ot},p)),o().createElement(ze,{disabled:!1===(null==d?void 0:d.restoreFocus)})),o().createElement(m,{...d,hiddenTextDescribedById:ee}))})),Qe=(0,r.createContext)(null),Ze="button",et="Draggable";function tt(e){let{id:t,data:n,disabled:o=!1,attributes:a}=e;const l=(0,i.useUniqueId)(et),{activators:s,activatorEvent:u,active:c,activeNodeRect:d,ariaDescribedById:f,draggableNodes:p,over:m}=(0,r.useContext)(Ve),{role:g=Ze,roleDescription:h="draggable",tabIndex:v=0}=null!=a?a:{},b=(null==c?void 0:c.id)===t,y=(0,r.useContext)(b?Ye:Qe),[E,w]=(0,i.useNodeRef)(),[C,_]=(0,i.useNodeRef)(),O=function(e,t){return(0,r.useMemo)((()=>e.reduce(((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e}),{})),[e,t])}(s,t),x=(0,i.useLatestValue)(n);(0,i.useIsomorphicLayoutEffect)((()=>(p.set(t,{id:t,key:l,node:E,activatorNode:C,data:x}),()=>{const e=p.get(t);e&&e.key===l&&p.delete(t)})),[p,t]);return{active:c,activatorEvent:u,activeNodeRect:d,attributes:(0,r.useMemo)((()=>({role:g,tabIndex:v,"aria-disabled":o,"aria-pressed":!(!b||g!==Ze)||void 0,"aria-roledescription":h,"aria-describedby":f.draggable})),[o,g,v,b,h,f.draggable]),isDragging:b,listeners:o?void 0:O,node:E,over:m,setNodeRef:w,setActivatorNodeRef:_,transform:y}}function nt(){return(0,r.useContext)(qe)}const rt="Droppable",ot={timeout:25};function at(e){let{data:t,disabled:n=!1,id:o,resizeObserverConfig:a}=e;const l=(0,i.useUniqueId)(rt),{active:s,dispatch:u,over:c,measureDroppableContainers:d}=(0,r.useContext)(Ve),f=(0,r.useRef)({disabled:n}),p=(0,r.useRef)(!1),m=(0,r.useRef)(null),h=(0,r.useRef)(null),{disabled:v,updateMeasurementsFor:b,timeout:y}={...ot,...a},E=(0,i.useLatestValue)(null!=b?b:o),w=Re({callback:(0,r.useCallback)((()=>{p.current?(null!=h.current&&clearTimeout(h.current),h.current=setTimeout((()=>{d(Array.isArray(E.current)?E.current:[E.current]),h.current=null}),y)):p.current=!0}),[y]),disabled:v||!s}),C=(0,r.useCallback)(((e,t)=>{w&&(t&&(w.unobserve(t),p.current=!1),e&&w.observe(e))}),[w]),[_,O]=(0,i.useNodeRef)(C),x=(0,i.useLatestValue)(t);return(0,r.useEffect)((()=>{w&&_.current&&(w.disconnect(),p.current=!1,w.observe(_.current))}),[_,w]),(0,r.useEffect)((()=>(u({type:g.RegisterDroppable,element:{id:o,key:l,disabled:n,node:_,rect:m,data:x}}),()=>u({type:g.UnregisterDroppable,key:l,id:o}))),[o]),(0,r.useEffect)((()=>{n!==f.current.disabled&&(u({type:g.SetDroppableDisabled,id:o,key:l,disabled:n}),f.current.disabled=n)}),[o,l,n,u]),{active:s,rect:m,isOver:(null==c?void 0:c.id)===o,node:_,over:c,setNodeRef:O}}function it(e){let{animation:t,children:n}=e;const[a,l]=(0,r.useState)(null),[s,u]=(0,r.useState)(null),c=(0,i.usePrevious)(n);return n||a||!c||l(c),(0,i.useIsomorphicLayoutEffect)((()=>{if(!s)return;const e=null==a?void 0:a.key,n=null==a?void 0:a.props.id;null!=e&&null!=n?Promise.resolve(t(n,s)).then((()=>{l(null)})):l(null)}),[t,a,s]),o().createElement(o().Fragment,null,n,a?(0,r.cloneElement)(a,{ref:u}):null)}const lt={x:0,y:0,scaleX:1,scaleY:1};function st(e){let{children:t}=e;return o().createElement(Ve.Provider,{value:He},o().createElement(Ye.Provider,{value:lt},t))}const ut={position:"fixed",touchAction:"none"},ct=e=>(0,i.isKeyboardEvent)(e)?"transform 250ms ease":void 0,dt=(0,r.forwardRef)(((e,t)=>{let{as:n,activatorEvent:r,adjustScale:a,children:l,className:s,rect:u,style:c,transform:d,transition:f=ct}=e;if(!u)return null;const p=a?d:{...d,scaleX:1,scaleY:1},m={...ut,width:u.width,height:u.height,top:u.top,left:u.left,transform:i.CSS.Transform.toString(p),transformOrigin:a&&r?w(r,u):void 0,transition:"function"==typeof f?f(r):f,...c};return o().createElement(n,{className:s,style:m,ref:t},l)})),ft=e=>t=>{let{active:n,dragOverlay:r}=t;const o={},{styles:a,className:i}=e;if(null!=a&&a.active)for(const[e,t]of Object.entries(a.active))void 0!==t&&(o[e]=n.node.style.getPropertyValue(e),n.node.style.setProperty(e,t));if(null!=a&&a.dragOverlay)for(const[e,t]of Object.entries(a.dragOverlay))void 0!==t&&r.node.style.setProperty(e,t);return null!=i&&i.active&&n.node.classList.add(i.active),null!=i&&i.dragOverlay&&r.node.classList.add(i.dragOverlay),function(){for(const[e,t]of Object.entries(o))n.node.style.setProperty(e,t);null!=i&&i.active&&n.node.classList.remove(i.active)}},pt={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:i.CSS.Transform.toString(t)},{transform:i.CSS.Transform.toString(n)}]},sideEffects:ft({styles:{active:{opacity:"0"}}})};function mt(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return(0,i.useEvent)(((e,a)=>{if(null===t)return;const l=n.get(e);if(!l)return;const s=l.node.current;if(!s)return;const u=je(a);if(!u)return;const{transform:c}=(0,i.getWindow)(a).getComputedStyle(a),d=j(c);if(!d)return;const f="function"==typeof t?t:function(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...pt,...e};return e=>{let{active:a,dragOverlay:i,transform:l,...s}=e;if(!t)return;const u={x:i.rect.left-a.rect.left,y:i.rect.top-a.rect.top},c={scaleX:1!==l.scaleX?a.rect.width*l.scaleX/i.rect.width:1,scaleY:1!==l.scaleY?a.rect.height*l.scaleY/i.rect.height:1},d={x:l.x-u.x,y:l.y-u.y,...c},f=o({...s,active:a,dragOverlay:i,transform:{initial:l,final:d}}),[p]=f,m=f[f.length-1];if(JSON.stringify(p)===JSON.stringify(m))return;const g=null==r?void 0:r({active:a,dragOverlay:i,...s}),h=i.node.animate(f,{duration:t,easing:n,fill:"forwards"});return new Promise((e=>{h.onfinish=()=>{null==g||g(),e()}}))}}(t);return Z(s,o.draggable.measure),f({active:{id:e,data:l.data,node:s,rect:o.draggable.measure(s)},draggableNodes:n,dragOverlay:{node:a,rect:o.dragOverlay.measure(u)},droppableContainers:r,measuringConfiguration:o,transform:d})}))}let gt=0;function ht(e){return(0,r.useMemo)((()=>{if(null!=e)return gt++,gt}),[e])}const vt=o().memo((e=>{let{adjustScale:t=!1,children:n,dropAnimation:a,style:i,transition:l,modifiers:s,wrapperElement:u="div",className:c,zIndex:d=999}=e;const{activatorEvent:f,active:p,activeNodeRect:m,containerNodeRect:g,draggableNodes:h,droppableContainers:v,dragOverlay:b,over:y,measuringConfiguration:E,scrollableAncestors:w,scrollableAncestorRects:C,windowRect:_}=nt(),O=(0,r.useContext)(Ye),x=ht(null==p?void 0:p.id),S=Xe(s,{activatorEvent:f,active:p,activeNodeRect:m,containerNodeRect:g,draggingNodeRect:b.rect,over:y,overlayNodeRect:b.rect,scrollableAncestors:w,scrollableAncestorRects:C,transform:O,windowRect:_}),D=Te(m),T=mt({config:a,draggableNodes:h,droppableContainers:v,measuringConfiguration:E}),R=D?b.setRef:void 0;return o().createElement(st,null,o().createElement(it,{animation:T},p&&x?o().createElement(dt,{key:x,id:p.id,ref:R,as:u,activatorEvent:f,adjustScale:t,className:c,transition:l,rect:D,style:{zIndex:d,...i},transform:S},n):null))}))},8831:function(e,t,n){n.r(t),n.d(t,{createSnapModifier:function(){return o},restrictToFirstScrollableAncestor:function(){return s},restrictToHorizontalAxis:function(){return a},restrictToParentElement:function(){return l},restrictToVerticalAxis:function(){return u},restrictToWindowEdges:function(){return c},snapCenterToCursor:function(){return d}});var r=n(4979);function o(e){return t=>{let{transform:n}=t;return{...n,x:Math.ceil(n.x/e)*e,y:Math.ceil(n.y/e)*e}}}const a=e=>{let{transform:t}=e;return{...t,y:0}};function i(e,t,n){const r={...e};return t.top+e.y<=n.top?r.y=n.top-t.top:t.bottom+e.y>=n.top+n.height&&(r.y=n.top+n.height-t.bottom),t.left+e.x<=n.left?r.x=n.left-t.left:t.right+e.x>=n.left+n.width&&(r.x=n.left+n.width-t.right),r}const l=e=>{let{containerNodeRect:t,draggingNodeRect:n,transform:r}=e;return n&&t?i(r,n,t):r},s=e=>{let{draggingNodeRect:t,transform:n,scrollableAncestorRects:r}=e;const o=r[0];return t&&o?i(n,t,o):n},u=e=>{let{transform:t}=e;return{...t,x:0}},c=e=>{let{transform:t,draggingNodeRect:n,windowRect:r}=e;return n&&r?i(t,n,r):t},d=e=>{let{activatorEvent:t,draggingNodeRect:n,transform:o}=e;if(n&&t){const e=(0,r.getEventCoordinates)(t);if(!e)return o;const a=e.x-n.left,i=e.y-n.top;return{...o,x:o.x+a-n.width/2,y:o.y+i-n.height/2}}return o}},3627:function(e,t,n){n.r(t),n.d(t,{SortableContext:function(){return y},arrayMove:function(){return l},arraySwap:function(){return s},defaultAnimateLayoutChanges:function(){return w},defaultNewIndexGetter:function(){return E},hasSortableData:function(){return D},horizontalListSortingStrategy:function(){return f},rectSortingStrategy:function(){return p},rectSwappingStrategy:function(){return m},sortableKeyboardCoordinates:function(){return R},useSortable:function(){return S},verticalListSortingStrategy:function(){return h}});var r=n(1594),o=n.n(r),a=n(6733),i=n(4979);function l(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function s(e,t,n){const r=e.slice();return r[t]=e[n],r[n]=e[t],r}function u(e,t){return e.reduce(((e,n,r)=>{const o=t.get(n);return o&&(e[r]=o),e}),Array(e.length))}function c(e){return null!==e&&e>=0}const d={scaleX:1,scaleY:1},f=e=>{var t;let{rects:n,activeNodeRect:r,activeIndex:o,overIndex:a,index:i}=e;const l=null!=(t=n[o])?t:r;if(!l)return null;const s=function(e,t,n){const r=e[t],o=e[t-1],a=e[t+1];if(!r||!o&&!a)return 0;if(no&&i<=a?{x:-l.width-s,y:0,...d}:i=a?{x:l.width+s,y:0,...d}:{x:0,y:0,...d}};const p=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const a=l(t,r,n),i=t[o],s=a[o];return s&&i?{x:s.left-i.left,y:s.top-i.top,scaleX:s.width/i.width,scaleY:s.height/i.height}:null},m=e=>{let t,n,{activeIndex:r,index:o,rects:a,overIndex:i}=e;return o===r&&(t=a[o],n=a[i]),o===i&&(t=a[o],n=a[r]),n&&t?{x:n.left-t.left,y:n.top-t.top,scaleX:n.width/t.width,scaleY:n.height/t.height}:null},g={scaleX:1,scaleY:1},h=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:a,overIndex:i}=e;const l=null!=(t=a[n])?t:r;if(!l)return null;if(o===n){const e=a[i];return e?{x:0,y:nn&&o<=i?{x:0,y:-l.height-s,...g}:o=i?{x:0,y:l.height+s,...g}:{x:0,y:0,...g}};const v="Sortable",b=o().createContext({activeIndex:-1,containerId:v,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:p,disabled:{draggable:!1,droppable:!1}});function y(e){let{children:t,id:n,items:l,strategy:s=p,disabled:c=!1}=e;const{active:d,dragOverlay:f,droppableRects:m,over:g,measureDroppableContainers:h}=(0,a.useDndContext)(),y=(0,i.useUniqueId)(v,n),E=Boolean(null!==f.rect),w=(0,r.useMemo)((()=>l.map((e=>"object"==typeof e&&"id"in e?e.id:e))),[l]),C=null!=d,_=d?w.indexOf(d.id):-1,O=g?w.indexOf(g.id):-1,x=(0,r.useRef)(w),S=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n{S&&C&&h(w)}),[S,w,C,h]),(0,r.useEffect)((()=>{x.current=w}),[w]);const R=(0,r.useMemo)((()=>({activeIndex:_,containerId:y,disabled:T,disableTransforms:D,items:w,overIndex:O,useDragOverlay:E,sortedRects:u(w,m),strategy:s})),[_,y,T.draggable,T.droppable,D,w,O,m,E,s]);return o().createElement(b.Provider,{value:R},t)}const E=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return l(n,r,o).indexOf(t)},w=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:a,newIndex:i,previousItems:l,previousContainerId:s,transition:u}=e;return!(!u||!r)&&((l===a||o!==i)&&(!!n||i!==o&&t===s))},C={duration:200,easing:"ease"},_="transform",O=i.CSS.Transition.toString({property:_,duration:0,easing:"linear"}),x={roleDescription:"sortable"};function S(e){let{animateLayoutChanges:t=w,attributes:n,disabled:o,data:l,getNewIndex:s=E,id:u,strategy:d,resizeObserverConfig:f,transition:p=C}=e;const{items:m,containerId:g,activeIndex:h,disabled:v,disableTransforms:y,sortedRects:S,overIndex:D,useDragOverlay:T,strategy:R}=(0,r.useContext)(b),M=function(e,t){var n,r;if("boolean"==typeof e)return{draggable:e,droppable:!1};return{draggable:null!=(n=null==e?void 0:e.draggable)?n:t.draggable,droppable:null!=(r=null==e?void 0:e.droppable)?r:t.droppable}}(o,v),k=m.indexOf(u),P=(0,r.useMemo)((()=>({sortable:{containerId:g,index:k,items:m},...l})),[g,l,k,m]),I=(0,r.useMemo)((()=>m.slice(m.indexOf(u))),[m,u]),{rect:N,node:A,isOver:j,setNodeRef:L}=(0,a.useDroppable)({id:u,data:P,disabled:M.droppable,resizeObserverConfig:{updateMeasurementsFor:I,...f}}),{active:F,activatorEvent:W,activeNodeRect:B,attributes:U,setNodeRef:H,listeners:V,isDragging:q,over:$,setActivatorNodeRef:K,transform:z}=(0,a.useDraggable)({id:u,data:P,attributes:{...x,...n},disabled:M.draggable}),X=(0,i.useCombinedRefs)(L,H),Y=Boolean(F),G=Y&&!y&&c(h)&&c(D),J=!T&&q,Q=J&&G?z:null,Z=G?null!=Q?Q:(null!=d?d:R)({rects:S,activeNodeRect:B,activeIndex:h,overIndex:D,index:k}):null,ee=c(h)&&c(D)?s({id:u,items:m,activeIndex:h,overIndex:D}):k,te=null==F?void 0:F.id,ne=(0,r.useRef)({activeId:te,items:m,newIndex:ee,containerId:g}),re=m!==ne.current.items,oe=t({active:F,containerId:g,isDragging:q,isSorting:Y,id:u,index:k,items:m,newIndex:ne.current.newIndex,previousItems:ne.current.items,previousContainerId:ne.current.containerId,transition:p,wasDragging:null!=ne.current.activeId}),ae=function(e){let{disabled:t,index:n,node:o,rect:l}=e;const[s,u]=(0,r.useState)(null),c=(0,r.useRef)(n);return(0,i.useIsomorphicLayoutEffect)((()=>{if(!t&&n!==c.current&&o.current){const e=l.current;if(e){const t=(0,a.getClientRect)(o.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&u(n)}}n!==c.current&&(c.current=n)}),[t,n,o,l]),(0,r.useEffect)((()=>{s&&u(null)}),[s]),s}({disabled:!oe,index:k,node:A,rect:N});return(0,r.useEffect)((()=>{Y&&ne.current.newIndex!==ee&&(ne.current.newIndex=ee),g!==ne.current.containerId&&(ne.current.containerId=g),m!==ne.current.items&&(ne.current.items=m)}),[Y,ee,g,m]),(0,r.useEffect)((()=>{if(te===ne.current.activeId)return;if(null!=te&&null==ne.current.activeId)return void(ne.current.activeId=te);const e=setTimeout((()=>{ne.current.activeId=te}),50);return()=>clearTimeout(e)}),[te]),{active:F,activeIndex:h,attributes:U,data:P,rect:N,index:k,newIndex:ee,items:m,isOver:j,isSorting:Y,isDragging:q,listeners:V,node:A,overIndex:D,over:$,setNodeRef:X,setActivatorNodeRef:K,setDroppableNodeRef:L,setDraggableNodeRef:H,transform:null!=ae?ae:Z,transition:function(){if(ae||re&&ne.current.newIndex===k)return O;if(J&&!(0,i.isKeyboardEvent)(W)||!p)return;if(Y||oe)return i.CSS.Transition.toString({...p,property:_});return}()}}function D(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&"object"==typeof t.sortable&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const T=[a.KeyboardCode.Down,a.KeyboardCode.Right,a.KeyboardCode.Up,a.KeyboardCode.Left],R=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:o,droppableContainers:l,over:s,scrollableAncestors:u}}=t;if(T.includes(e.code)){if(e.preventDefault(),!n||!r)return;const t=[];l.getEnabled().forEach((n=>{if(!n||null!=n&&n.disabled)return;const i=o.get(n.id);if(i)switch(e.code){case a.KeyboardCode.Down:r.topi.top&&t.push(n);break;case a.KeyboardCode.Left:r.left>i.left&&t.push(n);break;case a.KeyboardCode.Right:r.left1&&(d=c[1].id),null!=d){const e=l.get(n.id),t=l.get(d),s=t?o.get(t.id):null,c=null==t?void 0:t.node.current;if(c&&s&&e&&t){const n=(0,a.getScrollableAncestors)(c).some(((e,t)=>u[t]!==e)),o=M(e,t),l=function(e,t){if(!D(e)||!D(t))return!1;if(!M(e,t))return!1;return e.data.current.sortable.indexe=>{t.forEach((t=>t(e)))}),t)}const a="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function i(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function l(e){return"nodeType"in e}function s(e){var t,n;return e?i(e)?e:l(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function u(e){const{Document:t}=s(e);return e instanceof t}function c(e){return!i(e)&&e instanceof s(e).HTMLElement}function d(e){return e instanceof s(e).SVGElement}function f(e){return e?i(e)?e.document:l(e)?u(e)?e:c(e)||d(e)?e.ownerDocument:document:document:document}const p=a?r.useLayoutEffect:r.useEffect;function m(e){const t=(0,r.useRef)(e);return p((()=>{t.current=e})),(0,r.useCallback)((function(){for(var e=arguments.length,n=new Array(e),r=0;r{e.current=setInterval(t,n)}),[]),(0,r.useCallback)((()=>{null!==e.current&&(clearInterval(e.current),e.current=null)}),[])]}function h(e,t){void 0===t&&(t=[e]);const n=(0,r.useRef)(e);return p((()=>{n.current!==e&&(n.current=e)}),t),n}function v(e,t){const n=(0,r.useRef)();return(0,r.useMemo)((()=>{const t=e(n.current);return n.current=t,t}),[...t])}function b(e){const t=m(e),n=(0,r.useRef)(null),o=(0,r.useCallback)((e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e}),[]);return[n,o]}function y(e){const t=(0,r.useRef)();return(0,r.useEffect)((()=>{t.current=e}),[e]),t.current}let E={};function w(e,t){return(0,r.useMemo)((()=>{if(t)return t;const n=null==E[e]?0:E[e]+1;return E[e]=n,e+"-"+n}),[e,t])}function C(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o{const r=Object.entries(n);for(const[n,o]of r){const r=t[n];null!=r&&(t[n]=r+e*o)}return t}),{...t})}}const _=C(1),O=C(-1);function x(e){return"clientX"in e&&"clientY"in e}function S(e){if(!e)return!1;const{KeyboardEvent:t}=s(e.target);return t&&e instanceof t}function D(e){if(!e)return!1;const{TouchEvent:t}=s(e.target);return t&&e instanceof t}function T(e){if(D(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return x(e)?{x:e.clientX,y:e.clientY}:null}const R=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[R.Translate.toString(e),R.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),M="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function k(e){return e.matches(M)?e:e.querySelector(M)}},2038:function(e,t,n){var r=a(n(4121)),o=a(n(1240));function a(e){return e&&e.__esModule?e:{default:e}}window.document.addEventListener("DOMContentLoaded",(()=>{(0,r.default)(),(0,o.default)()}))},4121:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=b(n(5207)),o=b(n(584)),a=b(n(7105)),i=b(n(6721)),l=b(n(2512)),s=b(n(5563)),u=b(n(5297)),c=b(n(7651)),d=b(n(1305)),f=b(n(7660)),p=b(n(7333)),m=b(n(2382)),g=b(n(8953)),h=b(n(1950)),v=b(n(6573));function b(e){return e&&e.__esModule?e:{default:e}}t.default=()=>{r.default.component.registerMany({ElementEditor:i.default,ElementToolbar:s.default,ElementAddNewButton:u.default,ElementList:l.default,Element:o.default,ElementActions:a.default,ElementHeader:c.default,ElementContent:d.default,ElementSummary:f.default,ElementInlineEditForm:p.default,AddElementPopover:m.default,HoverBar:g.default,DragPositionIndicator:h.default,TextCheckboxGroupField:v.default})}},1240:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=d(n(5207)),o=d(n(2977)),a=d(n(3337)),i=d(n(4)),l=d(n(9283)),s=d(n(8501)),u=d(n(2221)),c=d(n(5904));function d(e){return e&&e.__esModule?e:{default:e}}t.default=()=>{r.default.transform("elemental-fieldgroup",(e=>{e.component("FieldGroup.HistoryViewer.VersionDetail",o.default,"HistoricElement")}),{after:"field-holders"}),r.default.transform("blocks-history-revert",(e=>{e.component("HistoryViewerToolbar.VersionedAdmin.HistoryViewer.Element.HistoryViewerVersionDetail",a.default,"BlockRevertRequest")})),r.default.transform("element-actions",(e=>{e.component("ElementActions",s.default,"ElementActionsWithSave"),e.component("ElementActions",u.default,"ElementActionsWithPublish"),e.component("ElementActions",c.default,"ElementActionsWithUnpublish"),e.component("ElementActions",l.default,"ElementActionsWithDuplicate"),e.component("ElementActions",i.default,"ElementActionsWithArchive")}))}},26:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=s(n(1594)),o=s(n(6935)),a=s(n(6923)),i=n(3556),l=n(9791);function s(e){return e&&e.__esModule?e:{default:e}}const u=e=>{const{className:t,title:n,label:o}=e,l={className:(0,a.default)(t,"dropdown-item"),...e};return r.default.createElement(i.DropdownItem,l,o||n)};u.propTypes={disabled:o.default.bool,className:o.default.string,onClick:o.default.func,title:o.default.string,name:o.default.string,type:l.elementTypeType,active:o.default.bool,label:o.default.string},u.defaultProps={disabled:!1};t.default=u},4:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=f(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=d(n(26)),a=d(n(5815)),i=n(6721),l=d(n(5609)),s=d(n(6177)),u=n(1135),c=d(n(4014));function d(e){return e&&e.__esModule?e:{default:e}}function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(f=function(e){return e?n:t})(e)}const p=e=>t=>{const{fetchElements:n}=(0,r.useContext)(i.ElementEditorContext),d=void 0!==t.element.canDelete&&!t.element.canDelete,f=a.default._t("ElementArchiveAction.ARCHIVE","Archive"),p={label:f,title:d?a.default._t("ElementArchiveAction.ARCHIVE_PERMISSION_DENY","Archive, insufficient permissions"):f,disabled:d,className:"element-editor__actions-archive",onClick:e=>{e.stopPropagation();const r=t.element.isPublished;let o=a.default._t("ElementArchiveAction.CONFIRM_DELETE","Are you sure you want to send this block to the archive?");if(r&&(o=a.default._t("ElementArchiveAction.CONFIRM_DELETE_AND_UNPUBLISH","Warning: This block will be unpublished before being sent to the archive. Are you sure you want to proceed?")),!window.confirm(o))return;const i=t.element.id,d=`${(0,u.getConfig)().controllerLink.replace(/\/$/,"")}/api/delete`;l.default.post(d,{id:i},{"X-SecurityID":s.default.get("SecurityID")}).then((()=>n())).catch((async e=>{const t=await(0,c.default)(e);window.jQuery.noticeAdd({text:t,stay:!0,type:"error"})}))},toggle:t.toggle};return r.default.createElement(e,t,t.children,r.default.createElement(o.default,p))};t.Component=p;t.default=p},9283:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=f(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=d(n(26)),a=d(n(5815)),i=n(6721),l=d(n(5609)),s=d(n(6177)),u=n(1135),c=d(n(4014));function d(e){return e&&e.__esModule?e:{default:e}}function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(f=function(e){return e?n:t})(e)}const p=e=>t=>{const{fetchElements:n}=(0,r.useContext)(i.ElementEditorContext);if(t.type.broken)return r.default.createElement(e,t);const d=void 0!==t.element.canCreate&&!t.element.canCreate,f=a.default._t("ElementArchiveAction.DUPLICATE","Duplicate"),p={label:f,title:d?a.default._t("ElementArchiveAction.DUPLICATE_PERMISSION_DENY","Duplicate, insufficient permissions"):f,disabled:d,className:"element-editor__actions-duplicate",onClick:e=>{e.stopPropagation();const r=t.element.id,o=`${(0,u.getConfig)().controllerLink.replace(/\/$/,"")}/api/duplicate`;l.default.post(o,{id:r},{"X-SecurityID":s.default.get("SecurityID")}).then((()=>n())).catch((async e=>{const t=await(0,c.default)(e);window.jQuery.noticeAdd({text:t,stay:!0,type:"error"})}))},toggle:t.toggle};return r.default.createElement(e,t,t.children,r.default.createElement(o.default,p))};t.Component=p;t.default=p},2221:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=l(n(26)),a=l(n(5815)),i=n(584);function l(e){return e&&e.__esModule?e:{default:e}}function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}const u=e=>t=>{const{formDirty:n,onPublishButtonClick:l}=(0,r.useContext)(i.ElementContext),{element:s}=t,u=void 0!==t.element.canPublish&&!t.element.canPublish,c=a.default._t("ElementArchiveAction.PUBLISH","Publish"),d={label:c,title:u?a.default._t("ElementArchiveAction.PUBLISH_PERMISSION_DENY","Publish, insufficient permissions"):c,disabled:u,className:"element-editor__actions-publish",onClick:e=>{e.stopPropagation(),l()},toggle:t.toggle};return t.type.broken?r.default.createElement(e,t):r.default.createElement(e,t,t.children,(n||!s.isLiveVersion)&&r.default.createElement(o.default,d))};t.Component=u;t.default=u},8501:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=l(n(26)),a=l(n(5815)),i=n(584);function l(e){return e&&e.__esModule?e:{default:e}}function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}const u=e=>t=>{const{onSaveButtonClick:n,formDirty:l}=(0,r.useContext)(i.ElementContext),s={title:a.default._t("ElementSaveAction.SAVE","Save"),className:"element-editor__actions-save",onClick:e=>{e.stopPropagation(),n()},toggle:t.toggle};return!t.expandable||t.type.broken?r.default.createElement(e,t):r.default.createElement(e,t,t.children,l&&r.default.createElement(o.default,s))};t.Component=u;t.default=u},5904:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=c(n(26)),a=c(n(5815)),i=c(n(5609)),l=n(6721),s=c(n(6177)),u=n(1135);function c(e){return e&&e.__esModule?e:{default:e}}function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}const f=e=>t=>{const{fetchElements:n}=(0,r.useContext)(l.ElementEditorContext);if(t.type.broken)return r.default.createElement(e,t);const c=(e,t,n)=>{const r=a.default.inject(a.default._t("ElementHeader.NOTITLE","Untitled {type} block"),{type:e}),o=a.default.inject(a.default._t("ElementUnpublishAction.SUCCESS_NOTIFICATION","Removed '{title}' from the published page"),{title:t||r}),i=a.default.inject(a.default._t("ElementUnpublishAction.ERROR_NOTIFICATION","Error unpublishing '{title}'"),{title:t||r});window.jQuery.noticeAdd({text:n?o:i,stay:!1,type:n?"success":"error"})},d=void 0!==t.element.canUnpublish&&!t.element.canUnpublish,f=a.default._t("ElementArchiveAction.UNPUBLISH","Unpublish"),p={label:f,title:d?a.default._t("ElementArchiveAction.UNPUBLISH_PERMISSION_DENY","Unpublish, insufficient permissions"):f,disabled:d,className:"element-editor__actions-unpublish",onClick:e=>{e.stopPropagation(),(()=>{const e=t.element.id,r=`${(0,u.getConfig)().controllerLink.replace(/\/$/,"")}/api/unpublish`;i.default.post(r,{id:e},{"X-SecurityID":s.default.get("SecurityID")}).then((()=>n())).then((()=>c(t.type.title,t.element.title,!0))).catch((()=>c(t.type.title,t.element.title,!1)))})()},toggle:t.toggle};return r.default.createElement(e,t,t.children,t.element.isPublished&&r.default.createElement(o.default,p))};t.Component=f;t.default=f},2382:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=b(n(1594)),o=h(n(6935)),a=n(9040),i=n(9367),l=h(n(6923)),s=b(n(8918)),u=n(5207),c=n(9791),d=h(n(5815)),f=h(n(5609)),p=h(n(6177)),m=n(6721),g=h(n(4014));function h(e){return e&&e.__esModule?e:{default:e}}function v(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(v=function(e){return e?n:t})(e)}function b(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=v(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}class y extends r.Component{constructor(e){super(e),this.handleToggle=this.handleToggle.bind(this),y.contextType=m.ElementEditorContext}getElementButtonClickHandler(e){return t=>{t.preventDefault();const n=`${p.default.getSection("DNADesign\\Elemental\\Controllers\\ElementalAreaController").controllerLink}/api/create`;f.default.post(n,{elementClass:e.class,elementalAreaID:this.props.areaId,insertAfterElementID:this.props.insertAfterElement},{"X-SecurityID":p.default.get("SecurityID")}).then((()=>{const{fetchElements:e}=this.context;return e()})).then((()=>{const e=window.jQuery(".cms-preview");e.entwine("ss.preview")._loadUrl(e.find("iframe").attr("src"))})).catch((async e=>{const t=await(0,g.default)(e);this.props.actions.toasts.error(t)})),this.handleToggle()}}handleToggle(){const{toggle:e}=this.props;e()}render(){const{PopoverOptionSetComponent:e,elementTypes:t,container:n,extraClass:o,isOpen:a,placement:i,target:s}=this.props,u=(0,l.default)("element-editor-add-element",o),c=t.map((e=>({content:e.title,key:e.name,className:(0,l.default)(e.icon,"btn--icon-xl","element-editor-add-element__button"),onClick:this.getElementButtonClickHandler(e)})));return r.default.createElement(e,{buttons:c,searchPlaceholder:d.default._t("ElementAddElementPopover.SEARCH_BLOCKS","Search blocks"),extraClass:u,container:n,isOpen:a,placement:i,target:s,toggle:this.handleToggle})}}t.Component=y,y.propTypes={container:o.default.oneOfType([o.default.string,o.default.func,o.default.object]),elementTypes:o.default.arrayOf(c.elementTypeType).isRequired,extraClass:o.default.oneOfType([o.default.string,o.default.array,o.default.object]),isOpen:o.default.bool.isRequired,placement:o.default.string,target:o.default.oneOfType([o.default.string,o.default.func,o.default.object]).isRequired,toggle:o.default.func.isRequired,areaId:o.default.number.isRequired,insertAfterElement:o.default.oneOfType([o.default.number,o.default.string])};const E=(0,u.inject)(["PopoverOptionSet"],(e=>({PopoverOptionSetComponent:e})),(()=>"ElementEditor"))(y);t.default=(0,i.compose)((0,a.connect)(null,(function(e){return{actions:{toasts:(0,i.bindActionCreators)(s,e)}}})))(E)},5297:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=c(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=u(n(6935)),a=n(3556),i=u(n(5815)),l=n(9791),s=n(5207);function u(e){return e&&e.__esModule?e:{default:e}}function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(c=function(e){return e?n:t})(e)}class d extends r.Component{constructor(e){super(e),this.toggle=this.toggle.bind(this),this.state={popoverOpen:!1}}toggle(){this.setState((e=>({popoverOpen:!e.popoverOpen})))}render(){const{AddElementPopoverComponent:e,elementTypes:t,areaId:n}=this.props,o={id:`ElementalArea${n}_AddButton`,color:"primary",onClick:this.toggle,className:"font-icon-plus"};return r.default.createElement("div",null,r.default.createElement(a.Button,o,i.default._t("ElementAddNewButton.ADD_BLOCK","Add block")),r.default.createElement(e,{placement:"bottom-start",target:o.id,isOpen:this.state.popoverOpen,elementTypes:t,toggle:this.toggle,areaId:n,insertAfterElement:0}))}}t.Component=d,d.defaultProps={},d.propTypes={elementTypes:o.default.arrayOf(l.elementTypeType).isRequired,areaId:o.default.number.isRequired};t.default=(0,s.inject)(["AddElementPopover"],(e=>({AddElementPopoverComponent:e})),(()=>"ElementEditor.ElementList.AddNewButton"))(d)},1305:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r,o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),a=(r=n(6935))&&r.__esModule?r:{default:r},i=n(5207),l=n(9367);function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}class u extends o.PureComponent{render(){const{id:e,fileUrl:t,fileTitle:n,content:r,previewExpanded:a,InlineEditFormComponent:i,SummaryComponent:l,activeTab:s,onFormInit:u,handleLoadingError:c,formDirty:d,broken:f,onFormSchemaSubmitResponse:p,ensureFormRendered:m,formHasRendered:g}=this.props,h=!a&&(m||g),v={"element-editor-editform--collapsed":!a,"element-editor-editform--rendered-not-visible":h};return o.default.createElement("div",{className:"element-editor-content"},!a&&o.default.createElement(l,{content:r,fileUrl:t,fileTitle:n,broken:f}),(a||m||g)&&o.default.createElement(i,{extraClass:v,onClick:e=>e.stopPropagation(),elementId:e,activeTab:s,onFormInit:u,handleLoadingError:c,onFormSchemaSubmitResponse:p,notVisible:h}),d&&o.default.createElement("input",{type:"hidden",name:"change-tracker",className:"element-form-dirty-state",value:"1"}))}}t.Component=u,u.propTypes={id:a.default.number,content:a.default.string,fileUrl:a.default.string,fileTitle:a.default.string,previewExpanded:a.default.bool,SummaryComponent:a.default.elementType,InlineEditFormComponent:a.default.elementType,handleLoadingError:a.default.func,broken:a.default.bool,onFormSchemaSubmitResponse:a.default.func,onFormInit:a.default.func,ensureFormRendered:a.default.bool,formHasRendered:a.default.bool,formDirty:a.default.object},u.defaultProps={};t.default=(0,l.compose)((0,i.inject)(["ElementSummary","ElementInlineEditForm"],((e,t)=>({SummaryComponent:e,InlineEditFormComponent:t})),(()=>"ElementEditor.ElementList.Element")))(u)},1950:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=o(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(r,i,l):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(1594));function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(o=function(e){return e?n:t})(e)}class a extends r.PureComponent{render(){return r.default.createElement("div",{className:"elemental-editor-drag-indicator"},r.default.createElement("div",{className:"elemental-editor-drag-indicator__ball"}))}}t.default=a},584:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.ElementContext=t.Component=void 0;var r=S(n(1594)),o=O(n(6935)),a=n(455),i=n(9791),l=n(9367),s=n(5207),u=O(n(5815)),c=O(n(6923)),d=n(9040),f=n(5381),p=n(2153),m=n(7785),g=S(n(5034)),h=n(3627),v=n(4979),b=S(n(8918)),y=n(9077),E=n(6721),w=n(1135),C=O(n(5609)),_=O(n(6177));function O(e){return e&&e.__esModule?e:{default:e}}function x(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(x=function(e){return e?n:t})(e)}function S(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=x(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}function D(){return D=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const[t,n]=(0,r.useState)(!1),[o,a]=(0,r.useState)(""),[i,l]=(0,r.useState)(!1),[s,d]=(0,r.useState)(e.element.title),[f,p]=(0,r.useState)(!1),[m,g]=(0,r.useState)(!1),[b,y]=(0,r.useState)(!1),[O,x]=(0,r.useState)(!1),[S,R]=(0,r.useState)(!1),[M,k]=(0,r.useState)(!1),[P,I]=(0,r.useState)(!1),[N,A]=(0,r.useState)(!1),{fetchElements:j}=(0,r.useContext)(E.ElementEditorContext),{attributes:L,listeners:F,setNodeRef:W,transform:B,transition:U,isDragging:H,isOver:V}=(0,h.useSortable)({id:e.element.id}),q={transform:v.CSS.Transform.toString(B),transition:U};(0,r.useEffect)((()=>{void 0!==e.formDirty&&!N&&A(!0)}),[e.formDirty]),(0,r.useEffect)((()=>{e.onChangeHasUnsavedChanges(N)}),[N]),(0,r.useEffect)((()=>{e.saveElement&&N&&!m&&g(!0)}),[e.saveElement,N,e.increment]),(0,r.useEffect)((()=>{f&&M&&(p(!1),N?(e.submitForm(),x(!0)):y(!0))}),[f,M]),(0,r.useEffect)((()=>{P&&(I(!1),e.dispatchAddFormChanged())}),[P]);const $=()=>u.default.inject(u.default._t("ElementHeader.NOTITLE","Untitled {type} block"),{type:e.type.title}),K=t=>{(t=>{const n=s||$();if(t){const t=u.default.inject(u.default._t("ElementPublishAction.ERROR_NOTIFICATION","Error publishing '{title}'"),{title:n});e.actions.toasts.error(t)}else{const t=u.default.inject(u.default._t("ElementPublishAction.SUCCESS_NOTIFICATION","Published '{title}' successfully"),{title:n});e.actions.toasts.success(t)}})(t),y(!1),x(!1),j().then((()=>{setTimeout((()=>e.dispatchRemoveFormChanged()),250)}))};(0,r.useEffect)((()=>{M&&m&&(e.submitForm(),g(!1))}),[M,m]),(0,r.useEffect)((()=>{if(M&&b){const t=`${(0,w.getConfig)().controllerLink.replace(/\/$/,"")}/api/publish`;C.default.post(t,{id:e.element.id},{"X-SecurityID":_.default.get("SecurityID")}).then((()=>K(!1))).catch((()=>K(!0)))}}),[M,b]);const z=t=>{const{tabSetName:n,onActivateTab:r}=e;if(o||a(t),t||o)r(n,t||o);else{r(n,"Main")}},X=r=>{const{type:o,link:a}=e;o.broken||("button"!==r.target.type?!o.inlineEditable||i?window.location=a:n(!t):r.stopPropagation())},{element:Y,type:G,areaId:J,HeaderComponent:Q,ContentComponent:Z,link:ee,activeTab:te,formDirty:ne}=e;if(!Y.id)return null;const re=(0,c.default)("element-editor__element",{"element-editor__element--broken":G.broken,"element-editor__element--expandable":G.inlineEditable&&!G.broken,"element-editor__element--dragging":H,"element-editor__element--dragged-over":V},(()=>{const{element:t}=e,n="element-editor__element";return t.isPublished?t.isPublished&&!t.isLiveVersion?`${n}--modified`:`${n}--published`:`${n}--draft`})()),oe={formDirty:ne,onPublishButtonClick:()=>{p(!0),R(!0)},onSaveButtonClick:()=>{R(!0),g(!0)}},ae=r.default.createElement("div",D({className:re,onClick:X,onKeyUp:e=>{const{nodeName:t}=e.target;" "!==e.key&&"Enter"!==e.key||["input","textarea"].includes(t.toLowerCase())||X(e)},role:"button",tabIndex:0,title:(e=>e.broken?u.default._t("ElementalElement.ARCHIVE_BROKEN","Archive this block"):u.default.inject(u.default._t("ElementalElement.TITLE","Edit this {type} block"),{type:e.title}))(G),key:Y.id,ref:W},L,F,{style:q}),r.default.createElement(T.Provider,{value:oe},r.default.createElement(Q,{element:Y,type:G,areaId:J,expandable:G.inlineEditable,link:ee,previewExpanded:t,handleEditTabsClick:t=>{const{activeTab:r}=e;t===r||i||(n(!0),z(t))},activeTab:te,disableTooltip:H}),r.default.createElement(Z,{id:Y.id,fileUrl:Y.blockSchema.fileURL,fileTitle:Y.blockSchema.fileTitle,content:((e,t)=>t.broken?e.title?u.default.inject(u.default._t("ElementalElement.BROKEN_DESCRIPTION_TITLE",'This block had the title "{title}". It is broken and will not display on the front-end. You can archive it to remove it from this elemental area.'),{title:e.title}):u.default._t("ElementalElement.BROKEN_DESCRIPTION","This block is broken and will not display on the front-end. You can archive it to remove it from this elemental area."):e.blockSchema.content)(Y,G),previewExpanded:t&&!H,ensureFormRendered:S,formHasRendered:M,activeTab:te,handleLoadingError:()=>{l(!0)},broken:G.broken,onFormSchemaSubmitResponse:(t,r)=>{if(t.id.match(/\/schema\/elemental-area\/([0-9]+)/))return e.type.inlineEditable&&n(!0),I(!0),O&&x(!1),void e.onAfterSubmitResponse(!1);A(!1),d(r),O&&(x(!1),y(!0)),b||O||(t=>{const n=t||$(),r=u.default.inject(u.default._t("ElementSaveAction.SUCCESS_NOTIFICATION","Saved '{title}' successfully"),{title:n});e.actions.toasts.success(r)})(r),e.onAfterSubmitResponse(!0),j()},onFormInit:()=>(e=>{z(e),k(!0)})(te)})));return ae};t.Component=R,R.propTypes={element:a.elementType,type:i.elementTypeType.isRequired,areaId:o.default.number.isRequired,link:o.default.string.isRequired,activeTab:o.default.string,tabSetName:o.default.string,onActivateTab:o.default.func,isOver:o.default.bool.isRequired,saveElement:o.default.bool.isRequired,onBeforeSubmitForm:o.default.func.isRequired,onAfterSubmitResponse:o.default.func.isRequired,increment:o.default.number.isRequired},R.defaultProps={element:null};t.default=(0,l.compose)((0,d.connect)((function(e,t){const n=t.element.id,r=(0,p.loadElementFormStateName)(n),o=(0,m.loadElementSchemaValue)("schemaUrl",n),a=e.form&&e.form.formSchemas[o]&&e.form.formSchemas[o].schema&&e.form.formSchemas[o].schema.fields.find((e=>"Tabs"===e.component)),i=a&&a.id,l=`element.${r}__${i}`,s=e.unsavedForms.find((e=>e.name===`element.${r}`));return{tabSetName:i,activeTab:e.tabs&&e.tabs.fields&&e.tabs.fields[l]&&e.tabs.fields[l].activeTab,formDirty:s}}),(function(e,t){const n=(0,p.loadElementFormStateName)(t.element.id);return{onActivateTab(t,r){e(g.activateTab(`element.${n}__${t}`,r))},submitForm(){t.onBeforeSubmitForm(t.element.id),e((0,f.submit)(`element.${n}`))},dispatchAddFormChanged(){e((0,y.addFormChanged)(`element.${n}`))},dispatchRemoveFormChanged(){e((0,y.removeFormChanged)(`element.${n}`))},actions:{toasts:(0,l.bindActionCreators)(b,e)}}})),(0,s.inject)(["ElementHeader","ElementContent"],((e,t)=>({HeaderComponent:e,ContentComponent:t})),(()=>"ElementEditor.ElementList.Element")))(R)},7105:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=f(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=d(n(6935)),a=n(9367),i=n(3556),l=n(5207),s=n(455),u=n(9791),c=d(n(26));function d(e){return e&&e.__esModule?e:{default:e}}function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(f=function(e){return e?n:t})(e)}class p extends r.Component{constructor(e){super(e),this.handleEditTabsClick=this.handleEditTabsClick.bind(this)}handleEditTabsClick(e){const{handleEditTabsClick:t}=this.props;t(e.target.name)}renderEditTabs(){const{editTabs:e,activeTab:t,type:n,expandable:o}=this.props;return!n.broken&&o&&e&&e.length?e.map((e=>{let{name:o,title:a}=e;return r.default.createElement(c.default,{key:o,name:o,title:a,type:n,onClick:this.handleEditTabsClick,active:o===t})})):null}renderDivider(){const{children:e,editTabs:t,expandable:n}=this.props;return n&&t&&t.length&&0!==r.default.Children.count(e)?r.default.createElement(i.DropdownItem,{divider:!0,role:"separator"}):null}render(){const{children:e,id:t,ActionMenuComponent:n}=this.props;return r.default.createElement(n,{id:`element-editor-actions-${t}`,className:"element-editor-header__actions-dropdown",dropdownMenuProps:{right:!0},dropdownToggleClassNames:["element-editor-header__actions-toggle","btn","btn-sm","btn--no-text","font-icon-dot-3"]},this.renderEditTabs(),this.renderDivider(),e)}}t.Component=p,p.propTypes={element:s.elementType,type:u.elementTypeType.isRequired,areaId:o.default.number.isRequired,activeTab:o.default.string,editTabs:o.default.arrayOf(o.default.shape({title:o.default.string,name:o.default.string})),handleEditTabsClick:o.default.func.isRequired,expandable:o.default.bool},p.defaultProps={editTabs:[],expandable:!0};t.default=(0,a.compose)((0,l.inject)(["ActionMenu"],(e=>({ActionMenuComponent:e})),(()=>"ElementEditor.ElementList.Element")))(p)},6721:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.ElementEditorContext=t.Component=void 0;var r=b(n(1594)),o=h(n(6935)),a=n(9040),i=n(5207),l=n(9367),s=n(9791),u=h(n(5799)),c=h(n(5609)),d=h(n(6177)),f=n(1135),p=b(n(8918)),m=h(n(4014)),g=n(3627);function h(e){return e&&e.__esModule?e:{default:e}}function v(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(v=function(e){return e?n:t})(e)}function b(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=v(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}const y=t.ElementEditorContext=(0,r.createContext)(null);class E extends r.PureComponent{constructor(e){super(e),this.state={dragTargetElementId:null,dragSpot:null,elements:null,isLoading:!0,dragging:!1},this.handleDragStart=this.handleDragStart.bind(this),this.handleDragEnd=this.handleDragEnd.bind(this),this.fetchElements=this.fetchElements.bind(this)}handleDragStart(e){const{active:t}=e;this.setState({dragging:t.id})}handleDragEnd(e){const{active:t,over:n}=e,{elements:r}=this.state;if(t.id===n.id)return void this.setState({dragging:!1});const o=r.map((e=>e.id)),a=o.indexOf(t.id),i=o.indexOf(n.id),l=(0,g.arrayMove)(r,a,i),s=i>0?l[i-1].id:0,u=`${(0,f.getConfig)().controllerLink.replace(/\/$/,"")}/api/sort`;c.default.post(u,{id:t.id,afterBlockID:s},{"X-SecurityID":d.default.get("SecurityID")}).then((()=>this.fetchElements())).catch((async e=>{const t=await(0,m.default)(e);this.props.actions.toasts.error(t)})),this.setState({dragging:!1,elements:l})}fetchElements(){(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&this.setState((e=>({...e,isLoading:!0})));const e=`${(0,f.getConfig)().controllerLink.replace(/\/$/,"")}/api/readElements/${this.props.areaId}`;return c.default.get(e).then((async e=>{const t=await e.json();this.setState((e=>({...e,elements:t,isLoading:!1})));const n=window.jQuery(".cms-preview");n&&n.entwine("ss.preview")._loadUrl(n.find("iframe").attr("src"))})).catch((async e=>{this.setState({elements:[],isLoading:!1});const t=await(0,m.default)(e);this.props.actions.toasts.error(t)}))}render(){const{ToolbarComponent:e,ListComponent:t,areaId:n,elementTypes:o,allowedElements:a,sharedObject:i,isLoading:l}=this.props,{dragging:s,elements:u}=this.state;if(null===u)return this.fetchElements(!1),null;const c=a.map((e=>o.find((t=>t.class===e)))),d={fetchElements:this.fetchElements};return r.default.createElement("div",{className:"element-editor"},r.default.createElement(y.Provider,{value:d},r.default.createElement(e,{elementTypes:c,areaId:n}),r.default.createElement(t,{allowedElementTypes:c,elementTypes:o,areaId:n,onDragStart:this.handleDragStart,onDragEnd:this.handleDragEnd,dragging:s,sharedObject:i,elements:u,isLoading:l})))}}t.Component=E,E.propTypes={elementTypes:o.default.arrayOf(s.elementTypeType).isRequired,allowedElements:o.default.arrayOf(o.default.string).isRequired,areaId:o.default.number.isRequired,actions:o.default.shape({handleSortBlock:o.default.func})};const w=[u.default,(0,i.inject)(["ElementToolbar","ElementList"],((e,t)=>({ToolbarComponent:e,ListComponent:t})),(()=>"ElementEditor"))];t.default=(0,l.compose)((0,a.connect)(null,(function(e){return{actions:{toasts:(0,l.bindActionCreators)(p,e)}}})),...w)(E)},2512:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.Component=v,t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=h(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=g(n(6935)),a=n(455),i=n(9791),l=n(9367),s=n(5207),u=g(n(6923)),c=g(n(5815)),d=n(6733),f=n(3627),p=n(8831),m=n(1135);function g(e){return e&&e.__esModule?e:{default:e}}function h(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(h=function(e){return e?n:t})(e)}function v(e){let{elements:t,sharedObject:n,ElementComponent:o,HoverBarComponent:a,allowedElementTypes:i,elementTypes:l,areaId:s,onDragEnd:g,onDragStart:h,dragging:v,isLoading:b,LoadingComponent:y}=e;const[E,w]=(0,r.useState)(!1),[C,_]=(0,r.useState)(0),[O,x]=(0,r.useState)({}),[S,D]=(0,r.useState)({});n.setIncrement=_,n.setSaveAllElements=w;const T=(e,n)=>{const r={},o={};(t||[]).forEach((t=>{const a=parseInt(t.id,10);n?r[a]=!1:e.hasOwnProperty(a)?r[a]=e[a]:r[a]=!1,o[a]=null})),x(r),D(o)};(0,r.useEffect)((()=>{T({},!0)}),[]),(0,r.useEffect)((()=>{T(O,!1)}),[t]),(0,r.useEffect)((()=>{if(!t)return;if(!E)return;const e=t.map((e=>parseInt(e.id,10))).filter((e=>O[e]));let r=!0;for(let t=0;tS[e])),a={success:o,reason:o?"":"invalid"};n.entwineResolve(a),T(O,o),w(!1)}),[E,O]);const R=(0,d.useSensors)((0,d.useSensor)(d.PointerSensor,{activationConstraint:{distance:10}})),M=(0,u.default)("elemental-editor-list",{"elemental-editor-list--empty":!t||!t.length});return r.default.createElement("div",{className:M},b?r.default.createElement(y,null):null,(()=>{if(0===t.length)return r.default.createElement("div",null,c.default._t("ElementList.ADD_BLOCKS","Add blocks to place your content"));let e=t.map((e=>{const t=E&&O[e.id]&&null===S[e.id];return r.default.createElement(r.default.Fragment,null,r.default.createElement(o,{key:e.id,element:e,areaId:s,type:(0,m.getElementTypeConfig)(e,l),link:e.blockSchema.actions.edit,saveElement:t,onChangeHasUnsavedChanges:t=>((e,t)=>{x({...O,[e]:t})})(e.id,t),onBeforeSubmitForm:()=>{return t=e.id,void D({...S,[t]:null});var t},onAfterSubmitResponse:t=>((e,t)=>{x({...O,[e]:!t}),D({...S,[e]:t})})(e.id,t),increment:C}),!1===v&&r.default.createElement(a,{key:`create-after-${e.id}`,areaId:s,elementId:e.id,elementTypes:i}))}));return!1===v&&(e=[r.default.createElement(a,{key:0,areaId:s,elementId:0,elementTypes:i})].concat(e)),r.default.createElement(d.DndContext,{modifiers:[p.restrictToVerticalAxis,p.restrictToParentElement],sensors:R,collisionDetection:d.closestCenter,onDragStart:h,onDragEnd:g},r.default.createElement(f.SortableContext,{items:t.map((e=>e.id)),strategy:f.verticalListSortingStrategy},e))})())}v.propTypes={elements:o.default.arrayOf(a.elementType).isRequired,elementTypes:o.default.arrayOf(i.elementTypeType).isRequired,allowedElementTypes:o.default.arrayOf(i.elementTypeType).isRequired,areaId:o.default.number.isRequired,onDragStart:o.default.func,onDragEnd:o.default.func,dragging:o.default.oneOf([o.default.bool,o.default.number]),sharedObject:o.default.object.isRequired},v.defaultProps={sharedObject:{entwineResolve:()=>{},setState:null},elements:[],isLoading:!1};t.default=(0,l.compose)((0,s.inject)(["Element","Loading","HoverBar","DragPositionIndicator"],((e,t,n,r)=>({ElementComponent:e,LoadingComponent:t,HoverBarComponent:n,DragIndicatorComponent:r})),(()=>"ElementEditor.ElementList")))(v)},7651:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=p(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=f(n(6935)),a=n(3556),i=n(455),l=n(9791),s=n(9367),u=n(5207),c=f(n(5815)),d=f(n(6923));function f(e){return e&&e.__esModule?e:{default:e}}function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(p=function(e){return e?n:t})(e)}class m extends r.Component{constructor(e){super(e),this.toggle=this.toggle.bind(this),this.state={tooltipOpen:!1}}componentDidUpdate(){const{tooltipOpen:e}=this.state,{disableTooltip:t}=this.props;e&&t&&this.setState({tooltipOpen:!1})}getBlockTitle(e,t){return t.broken?c.default.inject(c.default._t("ElementHeader.BROKEN","This element is of obsolete type {type}."),{type:t.obsoleteClassName}):e.title?e.title:c.default.inject(c.default._t("ElementHeader.NOTITLE","Untitled {type} block"),{type:t.title})}toggle(){this.setState((e=>({tooltipOpen:!e.tooltipOpen})))}renderVersionedStateMessage(){const{element:{isLiveVersion:e,isPublished:t}}=this.props;if(t&&e)return null;let n="";const o=["element-editor-header__version-state"];return t?e||(n=c.default._t("ElementHeader.STATE_MODIFIED","Item has unpublished changes"),o.push("element-editor-header__version-state--modified")):(n=c.default._t("ElementHeader.STATE_DRAFT","Item has not been published yet"),o.push("element-editor-header__version-state--draft")),r.default.createElement("span",{className:(0,d.default)(o),title:n})}renderStatusFlagBadges(){const e=this.props.element.statusFlags;if(!e)return null;const t=[];for(let[n,o]of Object.entries(e))n=`badge status-${n}`,"string"==typeof o&&(o={text:o}),o.title||(o.title=""),t.push(r.default.createElement("span",{key:n,className:n,title:o.title},o.text));return t}render(){const{element:e,type:t,areaId:n,previewExpanded:o,simple:i,disableTooltip:l,activeTab:s,expandable:u,ElementActionsComponent:f,handleEditTabsClick:p}=this.props,m=this.getBlockTitle(e,t),g=(0,d.default)({"element-editor-header__title":!0,"element-editor-header__title--none":!e.title}),h=c.default._t("ElementHeader.EXPAND","Show editable fields"),v=(0,d.default)("element-editor-header",{"element-editor-header--simple":i}),b=(0,d.default)("element-editor-header__icon-container",{"element-editor-header__icon-container--broken":t.broken}),y=(0,d.default)("element-editor-header__expand",{"font-icon-right-open-big":!u,"font-icon-up-open-big":u&&o,"font-icon-down-open-big":u&&!o}),E=`element-icon-${e.id}`;return r.default.createElement("div",{className:v},r.default.createElement("div",{className:"element-editor-header__drag-handle"},r.default.createElement("i",{className:"font-icon-drag-handle"})),r.default.createElement("div",{className:"element-editor-header__info"},r.default.createElement("div",{className:b},r.default.createElement("i",{className:t.icon,id:E}),this.renderVersionedStateMessage(),!t.broken&&!i&&r.default.createElement(a.Tooltip,{placement:"top",isOpen:this.state.tooltipOpen&&!l,target:E,toggle:this.toggle},t.title)),r.default.createElement("h3",{className:g},m),this.renderStatusFlagBadges()),!i&&r.default.createElement("div",{className:"element-editor-header__actions"},r.default.createElement("div",{role:"none",onClick:e=>e.stopPropagation()},r.default.createElement(f,{element:e,type:t,areaId:n,activeTab:s,editTabs:t.editTabs,handleEditTabsClick:p,expandable:u})),!t.broken&&r.default.createElement("i",{className:y,title:h})))}}t.Component=m,m.propTypes={element:i.elementType.isRequired,type:l.elementTypeType.isRequired,areaId:o.default.number,activeTab:o.default.string,simple:o.default.bool,ElementActionsComponent:o.default.elementType,previewExpanded:o.default.bool,disableTooltip:o.default.bool},m.defaultProps={expandable:!0};t.default=(0,s.compose)((0,u.inject)(["ElementActions"],(e=>({ElementActionsComponent:e})),(()=>"ElementEditor.ElementList.Element")))(m)},8953:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=s(n(6935)),a=n(5207),i=n(9791),l=s(n(5815));function s(e){return e&&e.__esModule?e:{default:e}}function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}const c=(0,s(n(7577)).default)("element-editor__hover-bar");function d(e){let{AddElementPopoverComponent:t,elementTypes:n,elementId:o,areaId:a,popoverOpen:i,onToggle:s}=e;const u=`${c("-line")} font-icon-plus-circled`,d=l.default._t("ElementAddNewButton.ADD_BLOCK","Add block"),f={className:c("-area",{"-area--focus":i}),onClick:s,"aria-label":d,title:d,id:`AddBlockHoverBarArea_${a}_${o}`};return r.default.createElement("div",{className:c(""),id:`AddBlockHoverBar_${a}_${o}`},r.default.createElement("button",f,r.default.createElement("span",{className:c("-area-inner")},r.default.createElement("span",{className:u}))),r.default.createElement(t,{placement:"bottom",target:`AddBlockHoverBarArea_${a}_${o}`,isOpen:i,elementTypes:n,toggle:s,container:`#AddBlockHoverBar_${a}_${o}`,areaId:a,insertAfterElement:o}))}class f extends r.Component{constructor(e){super(e),this.toggle=this.toggle.bind(this),this.state={popoverOpen:!1}}toggle(){this.setState((e=>({popoverOpen:!e.popoverOpen})))}render(){const e={...this.state,...this.props,onToggle:this.toggle};return r.default.createElement(d,e)}}t.Component=f,f.propTypes={elementTypes:o.default.arrayOf(i.elementTypeType).isRequired,elementId:o.default.oneOfType([o.default.string,o.default.number]).isRequired,areaId:o.default.oneOfType([o.default.number,o.default.string]).isRequired};t.default=(0,a.inject)(["AddElementPopover"],(e=>({AddElementPopoverComponent:e})),(()=>"ElementEditor.ElementList.HoverBar"))(f)},7333:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=f(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=d(n(6935)),a=d(n(6923)),i=d(n(55)),l=n(7785),s=d(n(5815)),u=n(2153),c=n(9040);function d(e){return e&&e.__esModule?e:{default:e}}function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(f=function(e){return e?n:t})(e)}function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t{t.match(/PageElements_[0-9]+_Title/)&&(r=e[t])})),n().then((e=>this.props.onFormSchemaSubmitResponse(e,r)))}render(){const{elementId:e,extraClass:t,onClick:n,onFormInit:o,formHasState:s,notVisible:u}=this.props,{loadingError:c}=this.state,d=(0,a.default)("element-editor-editform",t),f={formTag:"form",schemaUrl:(0,l.loadElementSchemaValue)("schemaUrl",e),identifier:"element",refetchSchemaOnMount:!s,onLoadingError:this.handleLoadingError,onSubmit:this.handleSubmit};c&&(f.loading=!1),"function"==typeof o&&(f.onReduxFormInit=o);const m={};return u&&(m["aria-hidden"]="true"),r.default.createElement("div",p({className:d,onClick:n,role:"presentation"},m),r.default.createElement(i.default,f))}}m.propTypes={extraClass:o.default.oneOfType([o.default.string,o.default.object]),onClick:o.default.func,elementId:o.default.string,handleLoadingError:o.default.func,onFormSchemaSubmitResponse:o.default.func,notVisible:o.default.bool};t.default=(0,c.connect)((function(e,t){const n=(0,u.loadElementFormStateName)(t.elementId);return{formHasState:e.form.formState&&e.form.formState.element&&!!e.form.formState.element[n]}}))(m)},7660:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=l(n(6935)),a=l(n(6923)),i=l(n(5815));function l(e){return e&&e.__esModule?e:{default:e}}function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}class u extends r.PureComponent{render(){const{fileUrl:e,fileTitle:t,content:n,broken:o}=this.props,l=i.default._t("ElementSummary.NO_PREVIEW","No preview available"),s=(0,a.default)("element-editor-summary__content",{"element-editor-summary__content--broken":o});return r.default.createElement("div",{className:"element-editor-summary"},e&&r.default.createElement("img",{className:"element-editor-summary__thumbnail-image",src:e,alt:t}),(n||!e)&&r.default.createElement("p",{className:s},n||l))}}u.defaultProps={},u.propTypes={content:o.default.string,fileUrl:o.default.string,fileTitle:o.default.string,broken:o.default.bool};t.default=u},5563:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),a=(r=n(6935))&&r.__esModule?r:{default:r},i=n(5207),l=n(9791);function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}class u extends o.PureComponent{render(){const{AddNewButtonComponent:e,elementTypes:t,areaId:n}=this.props;return o.default.createElement("div",{className:"element-editor__toolbar"},o.default.createElement(e,{elementTypes:t,areaId:n}))}}u.defaultProps={},u.propTypes={elementTypes:a.default.arrayOf(l.elementTypeType).isRequired,areaId:a.default.number.isRequired,AddNewButtonComponent:a.default.elementType.isRequired,onDragDrop:a.default.func};t.default=(0,i.inject)(["ElementAddNewButton"],(e=>({AddNewButtonComponent:e})),(()=>"ElementEditor.ElementToolbar"))(u)},2977:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(1594)),o=i(n(5815)),a=i(n(6923));function i(e){return e&&e.__esModule?e:{default:e}}t.default=e=>class extends e{getClassName(){const e=[super.getClassName()];return this.props.data.ElementID&&e.unshift("elemental-area__element--historic-inner"),(0,a.default)(e)}render(){const e=this.getLegend(),t=this.props.data.tag||"div",n=this.getClassName(),{data:a}=this.props;return a.ElementID?r.default.createElement(t,{className:n},e,r.default.createElement("div",{className:"elemental-preview elemental-preview--historic"},a.ElementEditLink&&r.default.createElement("a",{className:"elemental-preview__link",href:a.ElementEditLink},r.default.createElement("span",{className:"elemental-preview__link-text"},o.default._t("HistoricElementView.VIEW_BLOCK_HISTORY","Block history")),r.default.createElement("i",{className:"font-icon-angle-right btn--icon-lg elemental-preview__link-caret"})),r.default.createElement("div",{className:"elemental-preview__icon"},r.default.createElement("i",{className:a.ElementIcon})),r.default.createElement("div",{className:"elemental-preview__detail"},r.default.createElement("h3",null,a.ElementTitle," ",r.default.createElement("small",null,a.ElementType)))),this.props.children):super.render()}}},6573:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(1594)),o=n(3556),a=i(n(2623));function i(e){return e&&e.__esModule?e:{default:e}}t.default=(0,a.default)((e=>{const{children:t}=e,n=r.default.Children.toArray(r.default.Children.map(t,((t,n)=>{const o={};return 0===n?(o.id=e.id,o.title=null):1===n&&(o.noHolder=!0),r.default.cloneElement(t,o)})));return e.readOnly?r.default.createElement("div",{className:"text-checkbox-group-field--read-only"},n):1===n.length?n[0]:r.default.createElement(o.InputGroup,{className:"text-checkbox-group-field"},n[0],r.default.createElement(o.InputGroupAddon,{addonType:"append"},r.default.createElement(o.InputGroupText,null,n[1])))}))},51:function(e,t,n){var r=u(n(1669)),o=u(n(1594)),a=n(5145),i=n(5207),l=n(1135),s=n(5381);function u(e){return e&&e.__esModule?e:{default:e}}const c=()=>{setTimeout((()=>{const{store:e}=window.ss;e&&e.dispatch((0,s.destroy)(...Object.keys(e.getState().form.formState.element||{}).map((e=>`element.${e}`))))}),0)};r.default.entwine("ss",(e=>{e(".js-injector-boot .element-editor__container").entwine({ReactRoot:null,AreaIDsSharedObject:{},Increment:0,onmatch(){const e=(0,i.loadComponent)("ElementEditor",{}),t=this.data("schema"),n=(0,l.getConfig)().elementTypes,r=t["elemental-area-id"],s=this.getAreaIDsSharedObject();s.hasOwnProperty(r)||(s[r]={entwineResolve:null,setIncrement:null,setSaveAllElements:null});const u={areaId:r,allowedElements:t["allowed-elements"],elementTypes:n,sharedObject:s[r]};let c=this.getReactRoot();c||(c=(0,a.createRoot)(this[0]),this.setReactRoot(c)),c.render(o.default.createElement(e,u))},onunmatch(){e(".cms-edit-form").data("hasValidationErrors")||c(),this.unmountComponent()},unmountComponent(){const e=this.getReactRoot();e&&(e.unmount(),this.setReactRoot(null))},"from .cms-edit-form":{onbeforesubmitform(e,t){if(!t||this.is(".elemental-area--read-only"))return;let n;const r=new Promise((e=>{n=e}));t.promises.push(r),t.onAjaxSuccessCallbacks.push(this.unmountComponent.bind(this));const o=this.data("schema")["elemental-area-id"],a=this.getAreaIDsSharedObject()[o],i=this.getIncrement()+1;this.setIncrement(i),a.entwineResolve=n,a.setIncrement(i),a.setSaveAllElements(!0)},onaftersubmitform(t,n){const r=JSON.parse(n.xhr.responseText).ValidationResult;JSON.parse(r.replace(/<\/?script[^>]*?>/g,"")).isValid?(e(".cms-edit-form").data("hasValidationErrors",!1),c()):e(".cms-edit-form").data("hasValidationErrors",!0)}}}),e(".js-injector-boot .element-editor__container .element-form-dirty-state").entwine({onmatch(){e(".cms-edit-form").trigger("change")},onunmatch(){e(".cms-edit-form").trigger("change")}}),e(".cms-edit-form").entwine({getChangeTrackerOptions(){const t=void 0===this.entwineData("ChangeTrackerOptions");let n=this._super();return t&&(n=e.extend({},n),n.ignoreFieldSelector+=", .elementalarea :input:not(.element-form-dirty-state)",this.setChangeTrackerOptions(n)),n}})}))},7577:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=(r=n(6923))&&r.__esModule?r:{default:r};t.default=e=>function(){const t=t=>`${e}${t}`;for(var n=arguments.length,r=new Array(n),a=0;a!(!e&&""!==e)&&("object"==typeof e?Array.isArray(e)?e.map(t):Object.entries(e).reduce(((e,n)=>{let[r,o]=n;return Object.assign({},e,{[t(r)]:o})}),{}):t(e))));return(0,o.default)(...i)}},1135:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.getElementTypeConfig=t.getConfig=void 0;var r,o=(r=n(6177))&&r.__esModule?r:{default:r};const a=()=>o.default.getSection("DNADesign\\Elemental\\Controllers\\ElementalAreaController");t.getConfig=a;t.getElementTypeConfig=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=e.blockSchema.typeName;let r=(Array.isArray(t)?t:a().elementTypes).find((e=>e.class===n||e.name===n));return e.obsoleteClassName&&(r=Object.assign({obsoleteClassName:e.obsoleteClassName},r),Object.preventExtensions(r)),r}},2153:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.loadElementFormStateName=void 0;var r,o=(r=n(6177))&&r.__esModule?r:{default:r};t.loadElementFormStateName=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const t=o.default.getSection("DNADesign\\Elemental\\Controllers\\ElementalAreaController").form.elementForm.formNameTemplate;return e?t.replace("{id}",e):t}},7785:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.loadElementSchemaValue=void 0;var r,o=(r=n(6177))&&r.__esModule?r:{default:r};t.loadElementSchemaValue=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=o.default.getSection("DNADesign\\Elemental\\Controllers\\ElementalAreaController").form.elementForm[e]||"";return t?`${n}/${t}`:n}},3337:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=l(n(1594)),o=l(n(5609)),a=n(1135),i=l(n(6177));function l(e){return e&&e.__esModule?e:{default:e}}t.default=e=>t=>{const n={...t};return n.hasOwnProperty("actions")||(n.actions={}),n.actions.revertToVersion=(e,t,n,r)=>{const l=`${(0,a.getConfig)().controllerLink.replace(/\/$/,"")}/api/revert`;return o.default.post(l,{id:e,fromVersion:t,fromStage:n,toStage:r},{"X-SecurityID":i.default.get("SecurityID")})},r.default.createElement(e,n)}},455:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.elementType=void 0;var r,o=(r=n(6935))&&r.__esModule?r:{default:r};t.elementType=o.default.shape({id:o.default.number,title:o.default.string,blockSchema:o.default.object,inlineEditable:o.default.bool,published:o.default.bool,liveVersion:o.default.bool,version:o.default.number})},9791:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.elementTypeType=void 0;var r,o=(r=n(6935))&&r.__esModule?r:{default:r};t.elementTypeType=o.default.shape({name:o.default.string,title:o.default.string,icon:o.default.string,inlineEditable:o.default.bool,editTabs:o.default.arrayOf(o.default.shape({title:o.default.string,name:o.default.string})),config:o.default.object})},5609:function(e){e.exports=Backend},6177:function(e){e.exports=Config},2623:function(e){e.exports=FieldHolder},55:function(e){e.exports=FormBuilderLoader},5207:function(e){e.exports=Injector},6935:function(e){e.exports=PropTypes},1594:function(e){e.exports=React},5145:function(e){e.exports=ReactDomClient},9040:function(e){e.exports=ReactRedux},3556:function(e){e.exports=Reactstrap},9367:function(e){e.exports=Redux},5381:function(e){e.exports=ReduxForm},5034:function(e){e.exports=TabsActions},8918:function(e){e.exports=ToastsActions},9077:function(e){e.exports=UnsavedFormsActions},6923:function(e){e.exports=classnames},4014:function(e){e.exports=getJsonErrorMessage},5815:function(e){e.exports=i18n},1669:function(e){e.exports=jQuery},5799:function(e){e.exports=withDragDropContext}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(51),n(2038)}(); \ No newline at end of file +!function(){"use strict";var e={6733:function(e,t,n){n.r(t),n.d(t,{AutoScrollActivator:function(){return we},DndContext:function(){return Je},DragOverlay:function(){return vt},KeyboardCode:function(){return ae},KeyboardSensor:function(){return ce},MeasuringFrequency:function(){return Se},MeasuringStrategy:function(){return xe},MouseSensor:function(){return be},PointerSensor:function(){return ge},TouchSensor:function(){return Ee},TraversalOrder:function(){return Ce},applyModifiers:function(){return Xe},closestCenter:function(){return D},closestCorners:function(){return T},defaultAnnouncements:function(){return p},defaultCoordinates:function(){return y},defaultDropAnimation:function(){return pt},defaultDropAnimationSideEffects:function(){return ft},defaultKeyboardCoordinateGetter:function(){return ue},defaultScreenReaderInstructions:function(){return f},getClientRect:function(){return F},getFirstCollision:function(){return x},getScrollableAncestors:function(){return B},pointerWithin:function(){return P},rectIntersection:function(){return M},useDndContext:function(){return nt},useDndMonitor:function(){return d},useDraggable:function(){return tt},useDroppable:function(){return at},useSensor:function(){return v},useSensors:function(){return b}});var r=n(1594),o=n.n(r),a=ReactDom,i=n(4979);const l={display:"none"};function s(e){let{id:t,value:n}=e;return o().createElement("div",{id:t,style:l},n)}function u(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;return o().createElement("div",{id:t,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":r,"aria-atomic":!0},n)}const c=(0,r.createContext)(null);function d(e){const t=(0,r.useContext)(c);(0,r.useEffect)((()=>{if(!t)throw new Error("useDndMonitor must be used within a children of ");return t(e)}),[e,t])}const f={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},p={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function m(e){let{announcements:t=p,container:n,hiddenTextDescribedById:l,screenReaderInstructions:c=f}=e;const{announce:m,announcement:g}=function(){const[e,t]=(0,r.useState)("");return{announce:(0,r.useCallback)((e=>{null!=e&&t(e)}),[]),announcement:e}}(),h=(0,i.useUniqueId)("DndLiveRegion"),[v,b]=(0,r.useState)(!1);if((0,r.useEffect)((()=>{b(!0)}),[]),d((0,r.useMemo)((()=>({onDragStart(e){let{active:n}=e;m(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&m(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;m(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;m(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;m(t.onDragCancel({active:n,over:r}))}})),[m,t])),!v)return null;const y=o().createElement(o().Fragment,null,o().createElement(s,{id:l,value:c.draggable}),o().createElement(u,{id:h,announcement:g}));return n?(0,a.createPortal)(y,n):y}var g;function h(){}function v(e,t){return(0,r.useMemo)((()=>({sensor:e,options:null!=t?t:{}})),[e,t])}function b(){for(var e=arguments.length,t=new Array(e),n=0;n[...t].filter((e=>null!=e))),[...t])}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(g||(g={}));const y=Object.freeze({x:0,y:0});function E(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function w(e,t){const n=(0,i.getEventCoordinates)(e);if(!n)return"0 0";return(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%"}function C(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function _(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function O(e){let{left:t,top:n,height:r,width:o}=e;return[{x:t,y:n},{x:t+o,y:n},{x:t,y:n+r},{x:t+o,y:n+r}]}function x(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}function S(e,t,n){return void 0===t&&(t=e.left),void 0===n&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const D=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=S(t,t.left,t.top),a=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=E(S(r),o);a.push({id:t,data:{droppableContainer:e,value:n}})}}return a.sort(C)},T=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=O(t),a=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=O(r),i=o.reduce(((e,t,r)=>e+E(n[r],t)),0),l=Number((i/4).toFixed(4));a.push({id:t,data:{droppableContainer:e,value:l}})}}return a.sort(C)};function R(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),i=o-r,l=a-n;if(r{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const e of r){const{id:r}=e,a=n.get(r);if(a){const n=R(a,t);n>0&&o.push({id:r,data:{droppableContainer:e,value:n}})}}return o.sort(_)};function k(e,t){const{top:n,left:r,bottom:o,right:a}=t;return n<=e.y&&e.y<=o&&r<=e.x&&e.x<=a}const P=e=>{let{droppableContainers:t,droppableRects:n,pointerCoordinates:r}=e;if(!r)return[];const o=[];for(const e of t){const{id:t}=e,a=n.get(t);if(a&&k(r,a)){const n=O(a).reduce(((e,t)=>e+E(r,t)),0),i=Number((n/4).toFixed(4));o.push({id:t,data:{droppableContainer:e,value:i}})}}return o.sort(C)};function I(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:y}function N(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x})),{...t})}}const A=N(1);function j(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}const L={ignoreTransform:!1};function F(e,t){void 0===t&&(t=L);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=(0,i.getWindow)(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=j(t);if(!r)return e;const{scaleX:o,scaleY:a,x:i,y:l}=r,s=e.left-i-(1-o)*parseFloat(n),u=e.top-l-(1-a)*parseFloat(n.slice(n.indexOf(" ")+1)),c=o?e.width/o:e.width,d=a?e.height/a:e.height;return{width:c,height:d,top:u,right:s+c,bottom:u+d,left:s}}(n,t,r))}const{top:r,left:o,width:a,height:l,bottom:s,right:u}=n;return{top:r,left:o,width:a,height:l,bottom:s,right:u}}function W(e){return F(e,{ignoreTransform:!0})}function B(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if((0,i.isDocument)(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!(0,i.isHTMLElement)(o)||(0,i.isSVGElement)(o))return n;if(n.includes(o))return n;const a=(0,i.getWindow)(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=(0,i.getWindow)(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((e=>{const r=t[e];return"string"==typeof r&&n.test(r)}))}(o,a)&&n.push(o),function(e,t){return void 0===t&&(t=(0,i.getWindow)(e).getComputedStyle(e)),"fixed"===t.position}(o,a)?n:r(o.parentNode)}(e):n}function U(e){const[t]=B(e,1);return null!=t?t:null}function H(e){return i.canUseDOM&&e?(0,i.isWindow)(e)?e:(0,i.isNode)(e)?(0,i.isDocument)(e)||e===(0,i.getOwnerDocument)(e).scrollingElement?window:(0,i.isHTMLElement)(e)?e:null:null:null}function V(e){return(0,i.isWindow)(e)?e.scrollX:e.scrollLeft}function q(e){return(0,i.isWindow)(e)?e.scrollY:e.scrollTop}function $(e){return{x:V(e),y:q(e)}}var K;function z(e){return!(!i.canUseDOM||!e)&&e===document.scrollingElement}function X(e){const t={x:0,y:0},n=z(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(K||(K={}));const Y={x:.2,y:.2};function G(e,t,n,r,o){let{top:a,left:i,right:l,bottom:s}=n;void 0===r&&(r=10),void 0===o&&(o=Y);const{isTop:u,isBottom:c,isLeft:d,isRight:f}=X(e),p={x:0,y:0},m={x:0,y:0},g=t.height*o.y,h=t.width*o.x;return!u&&a<=t.top+g?(p.y=K.Backward,m.y=r*Math.abs((t.top+g-a)/g)):!c&&s>=t.bottom-g&&(p.y=K.Forward,m.y=r*Math.abs((t.bottom-g-s)/g)),!f&&l>=t.right-h?(p.x=K.Forward,m.x=r*Math.abs((t.right-h-l)/h)):!d&&i<=t.left+h&&(p.x=K.Backward,m.x=r*Math.abs((t.left+h-i)/h)),{direction:p,speed:m}}function J(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function Q(e){return e.reduce(((e,t)=>(0,i.add)(e,$(t))),y)}function Z(e,t){if(void 0===t&&(t=F),!e)return;const{top:n,left:r,bottom:o,right:a}=t(e);U(e)&&(o<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const ee=[["x",["left","right"],function(e){return e.reduce(((e,t)=>e+V(t)),0)}],["y",["top","bottom"],function(e){return e.reduce(((e,t)=>e+q(t)),0)}]];class te{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=B(t),r=Q(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of ee)for(const a of t)Object.defineProperty(this,a,{get:()=>{const t=o(n),i=r[e]-t;return this.rect[a]+i},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ne{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach((e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)}))},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function re(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}var oe,ae;function ie(e){e.preventDefault()}function le(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(oe||(oe={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"}(ae||(ae={}));const se={start:[ae.Space,ae.Enter],cancel:[ae.Esc],end:[ae.Space,ae.Enter,ae.Tab]},ue=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case ae.Right:return{...n,x:n.x+25};case ae.Left:return{...n,x:n.x-25};case ae.Down:return{...n,y:n.y+25};case ae.Up:return{...n,y:n.y-25}}};class ce{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new ne((0,i.getOwnerDocument)(t)),this.windowListeners=new ne((0,i.getWindow)(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(oe.Resize,this.handleCancel),this.windowListeners.add(oe.VisibilityChange,this.handleCancel),setTimeout((()=>this.listeners.add(oe.Keydown,this.handleKeyDown)))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&Z(n),t(y)}handleKeyDown(e){if((0,i.isKeyboardEvent)(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=se,coordinateGetter:a=ue,scrollBehavior:l="smooth"}=r,{code:s}=e;if(o.end.includes(s))return void this.handleEnd(e);if(o.cancel.includes(s))return void this.handleCancel(e);const{collisionRect:u}=n.current,c=u?{x:u.left,y:u.top}:y;this.referenceCoordinates||(this.referenceCoordinates=c);const d=a(e,{active:t,context:n.current,currentCoordinates:c});if(d){const t=(0,i.subtract)(d,c),r={x:0,y:0},{scrollableAncestors:o}=n.current;for(const n of o){const o=e.code,{isTop:a,isRight:i,isLeft:s,isBottom:u,maxScroll:c,minScroll:f}=X(n),p=J(n),m={x:Math.min(o===ae.Right?p.right-p.width/2:p.right,Math.max(o===ae.Right?p.left:p.left+p.width/2,d.x)),y:Math.min(o===ae.Down?p.bottom-p.height/2:p.bottom,Math.max(o===ae.Down?p.top:p.top+p.height/2,d.y))},g=o===ae.Right&&!i||o===ae.Left&&!s,h=o===ae.Down&&!u||o===ae.Up&&!a;if(g&&m.x!==d.x){const e=n.scrollLeft+t.x,a=o===ae.Right&&e<=c.x||o===ae.Left&&e>=f.x;if(a&&!t.y)return void n.scrollTo({left:e,behavior:l});r.x=a?n.scrollLeft-e:o===ae.Right?n.scrollLeft-c.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:l});break}if(h&&m.y!==d.y){const e=n.scrollTop+t.y,a=o===ae.Down&&e<=c.y||o===ae.Up&&e>=f.y;if(a&&!t.x)return void n.scrollTo({top:e,behavior:l});r.y=a?n.scrollTop-e:o===ae.Down?n.scrollTop-c.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:l});break}}this.handleMove(e,(0,i.add)((0,i.subtract)(d,this.referenceCoordinates),r))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function de(e){return Boolean(e&&"distance"in e)}function fe(e){return Boolean(e&&"delay"in e)}ce.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=se,onActivation:o}=t,{active:a}=n;const{code:i}=e.nativeEvent;if(r.start.includes(i)){const t=a.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==o||o({event:e.nativeEvent}),!0)}return!1}}];class pe{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=(0,i.getWindow)(e);return e instanceof t?e:(0,i.getOwnerDocument)(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:o}=e,{target:a}=o;this.props=e,this.events=t,this.document=(0,i.getOwnerDocument)(a),this.documentListeners=new ne(this.document),this.listeners=new ne(n),this.windowListeners=new ne((0,i.getWindow)(a)),this.initialCoordinates=null!=(r=(0,i.getEventCoordinates)(o))?r:y,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(oe.Resize,this.handleCancel),this.windowListeners.add(oe.DragStart,ie),this.windowListeners.add(oe.VisibilityChange,this.handleCancel),this.windowListeners.add(oe.ContextMenu,ie),this.documentListeners.add(oe.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(fe(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(de(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){const{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(oe.Click,le,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(oe.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:o}=this,{onMove:a,options:{activationConstraint:l}}=o;if(!r)return;const s=null!=(t=(0,i.getEventCoordinates)(e))?t:y,u=(0,i.subtract)(r,s);if(!n&&l){if(de(l)){if(null!=l.tolerance&&re(u,l.tolerance))return this.handleCancel();if(re(u,l.distance))return this.handleStart()}return fe(l)&&re(u,l.tolerance)?this.handleCancel():void this.handlePending(l,u)}e.cancelable&&e.preventDefault(),a(s)}handleEnd(){const{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){const{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===ae.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const me={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ge extends pe{constructor(e){const{event:t}=e,n=(0,i.getOwnerDocument)(t.target);super(e,me,n)}}ge.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!(!n.isPrimary||0!==n.button)&&(null==r||r({event:n}),!0)}}];const he={move:{name:"mousemove"},end:{name:"mouseup"}};var ve;!function(e){e[e.RightClick=2]="RightClick"}(ve||(ve={}));class be extends pe{constructor(e){super(e,he,(0,i.getOwnerDocument)(e.event.target))}}be.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==ve.RightClick&&(null==r||r({event:n}),!0)}}];const ye={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Ee extends pe{constructor(e){super(e,ye)}static setup(){return window.addEventListener(ye.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(ye.move.name,e)};function e(){}}}var we,Ce;function _e(e){let{acceleration:t,activator:n=we.Pointer,canScroll:o,draggingRect:a,enabled:l,interval:s=5,order:u=Ce.TreeOrder,pointerCoordinates:c,scrollableAncestors:d,scrollableAncestorRects:f,delta:p,threshold:m}=e;const g=function(e){let{delta:t,disabled:n}=e;const r=(0,i.usePrevious)(t);return(0,i.useLazyMemo)((e=>{if(n||!r||!e)return Oe;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[K.Backward]:e.x[K.Backward]||-1===o.x,[K.Forward]:e.x[K.Forward]||1===o.x},y:{[K.Backward]:e.y[K.Backward]||-1===o.y,[K.Forward]:e.y[K.Forward]||1===o.y}}}),[n,t,r])}({delta:p,disabled:!l}),[h,v]=(0,i.useInterval)(),b=(0,r.useRef)({x:0,y:0}),y=(0,r.useRef)({x:0,y:0}),E=(0,r.useMemo)((()=>{switch(n){case we.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case we.DraggableRect:return a}}),[n,a,c]),w=(0,r.useRef)(null),C=(0,r.useCallback)((()=>{const e=w.current;if(!e)return;const t=b.current.x*y.current.x,n=b.current.y*y.current.y;e.scrollBy(t,n)}),[]),_=(0,r.useMemo)((()=>u===Ce.TreeOrder?[...d].reverse():d),[u,d]);(0,r.useEffect)((()=>{if(l&&d.length&&E){for(const e of _){if(!1===(null==o?void 0:o(e)))continue;const n=d.indexOf(e),r=f[n];if(!r)continue;const{direction:a,speed:i}=G(e,r,E,t,m);for(const e of["x","y"])g[e][a[e]]||(i[e]=0,a[e]=0);if(i.x>0||i.y>0)return v(),w.current=e,h(C,s),b.current=i,void(y.current=a)}b.current={x:0,y:0},y.current={x:0,y:0},v()}else v()}),[t,C,o,v,l,s,JSON.stringify(E),JSON.stringify(g),h,d,_,f,JSON.stringify(m)])}Ee.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return!(o.length>1)&&(null==r||r({event:n}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(we||(we={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(Ce||(Ce={}));const Oe={x:{[K.Backward]:!1,[K.Forward]:!1},y:{[K.Backward]:!1,[K.Forward]:!1}};var xe,Se;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(xe||(xe={})),function(e){e.Optimized="optimized"}(Se||(Se={}));const De=new Map;function Te(e,t){return(0,i.useLazyMemo)((n=>e?n||("function"==typeof t?t(e):e):null),[t,e])}function Re(e){let{callback:t,disabled:n}=e;const o=(0,i.useEvent)(t),a=(0,r.useMemo)((()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(o)}),[n]);return(0,r.useEffect)((()=>()=>null==a?void 0:a.disconnect()),[a]),a}function Me(e){return new te(F(e),e)}function ke(e,t,n){void 0===t&&(t=Me);const[o,a]=(0,r.useState)(null);function l(){a((r=>{if(!e)return null;var o;if(!1===e.isConnected)return null!=(o=null!=r?r:n)?o:null;const a=t(e);return JSON.stringify(r)===JSON.stringify(a)?r:a}))}const s=function(e){let{callback:t,disabled:n}=e;const o=(0,i.useEvent)(t),a=(0,r.useMemo)((()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(o)}),[o,n]);return(0,r.useEffect)((()=>()=>null==a?void 0:a.disconnect()),[a]),a}({callback(t){if(e)for(const n of t){const{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){l();break}}}}),u=Re({callback:l});return(0,i.useIsomorphicLayoutEffect)((()=>{l(),e?(null==u||u.observe(e),null==s||s.observe(document.body,{childList:!0,subtree:!0})):(null==u||u.disconnect(),null==s||s.disconnect())}),[e]),o}const Pe=[];function Ie(e,t){void 0===t&&(t=[]);const n=(0,r.useRef)(null);return(0,r.useEffect)((()=>{n.current=null}),t),(0,r.useEffect)((()=>{const t=e!==y;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)}),[e]),n.current?(0,i.subtract)(e,n.current):y}function Ne(e){return(0,r.useMemo)((()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null),[e])}const Ae=[];function je(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return(0,i.isHTMLElement)(t)?t:e}const Le=[{sensor:ge,options:{}},{sensor:ce,options:{}}],Fe={current:{}},We={draggable:{measure:W},droppable:{measure:W,strategy:xe.WhileDragging,frequency:Se.Optimized},dragOverlay:{measure:F}};class Be extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter((e=>{let{disabled:t}=e;return!t}))}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const Ue={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Be,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:h},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:We,measureDroppableContainers:h,windowRect:null,measuringScheduled:!1},He={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:h,draggableNodes:new Map,over:null,measureDroppableContainers:h},Ve=(0,r.createContext)(He),qe=(0,r.createContext)(Ue);function $e(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Be}}}function Ke(e,t){switch(t.type){case g.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case g.DragMove:return null==e.draggable.active?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case g.DragEnd:case g.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case g.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Be(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case g.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;const i=new Be(e.droppable.containers);return i.set(n,{...a,disabled:o}),{...e,droppable:{...e.droppable,containers:i}}}case g.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const a=new Be(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function ze(e){let{disabled:t}=e;const{active:n,activatorEvent:o,draggableNodes:a}=(0,r.useContext)(Ve),l=(0,i.usePrevious)(o),s=(0,i.usePrevious)(null==n?void 0:n.id);return(0,r.useEffect)((()=>{if(!t&&!o&&l&&null!=s){if(!(0,i.isKeyboardEvent)(l))return;if(document.activeElement===l.target)return;const e=a.get(s);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame((()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=(0,i.findFirstFocusableNode)(e);if(t){t.focus();break}}}))}}),[o,t,a,s,l]),null}function Xe(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce(((e,t)=>t({transform:e,...r})),n):n}const Ye=(0,r.createContext)({...y,scaleX:1,scaleY:1});var Ge;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(Ge||(Ge={}));const Je=(0,r.memo)((function(e){var t,n,l,s;let{id:u,accessibility:d,autoScroll:f=!0,children:p,sensors:h=Le,collisionDetection:v=M,measuring:b,modifiers:E,...w}=e;const C=(0,r.useReducer)(Ke,void 0,$e),[_,O]=C,[S,D]=function(){const[e]=(0,r.useState)((()=>new Set)),t=(0,r.useCallback)((t=>(e.add(t),()=>e.delete(t))),[e]);return[(0,r.useCallback)((t=>{let{type:n,event:r}=t;e.forEach((e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)}))}),[e]),t]}(),[T,R]=(0,r.useState)(Ge.Uninitialized),k=T===Ge.Initialized,{draggable:{active:P,nodes:N,translate:j},droppable:{containers:L}}=_,W=null!=P?N.get(P):null,V=(0,r.useRef)({initial:null,translated:null}),q=(0,r.useMemo)((()=>{var e;return null!=P?{id:P,data:null!=(e=null==W?void 0:W.data)?e:Fe,rect:V}:null}),[P,W]),K=(0,r.useRef)(null),[X,Y]=(0,r.useState)(null),[G,J]=(0,r.useState)(null),Z=(0,i.useLatestValue)(w,Object.values(w)),ee=(0,i.useUniqueId)("DndDescribedBy",u),ne=(0,r.useMemo)((()=>L.getEnabled()),[L]),re=(oe=b,(0,r.useMemo)((()=>({draggable:{...We.draggable,...null==oe?void 0:oe.draggable},droppable:{...We.droppable,...null==oe?void 0:oe.droppable},dragOverlay:{...We.dragOverlay,...null==oe?void 0:oe.dragOverlay}})),[null==oe?void 0:oe.draggable,null==oe?void 0:oe.droppable,null==oe?void 0:oe.dragOverlay]));var oe;const{droppableRects:ae,measureDroppableContainers:ie,measuringScheduled:le}=function(e,t){let{dragging:n,dependencies:o,config:a}=t;const[l,s]=(0,r.useState)(null),{frequency:u,measure:c,strategy:d}=a,f=(0,r.useRef)(e),p=function(){switch(d){case xe.Always:return!1;case xe.BeforeDragging:return n;default:return!n}}(),m=(0,i.useLatestValue)(p),g=(0,r.useCallback)((function(e){void 0===e&&(e=[]),m.current||s((t=>null===t?e:t.concat(e.filter((e=>!t.includes(e))))))}),[m]),h=(0,r.useRef)(null),v=(0,i.useLazyMemo)((t=>{if(p&&!n)return De;if(!t||t===De||f.current!==e||null!=l){const t=new Map;for(let n of e){if(!n)continue;if(l&&l.length>0&&!l.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,r=e?new te(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t}),[e,l,n,p,c]);return(0,r.useEffect)((()=>{f.current=e}),[e]),(0,r.useEffect)((()=>{p||g()}),[n,p]),(0,r.useEffect)((()=>{l&&l.length>0&&s(null)}),[JSON.stringify(l)]),(0,r.useEffect)((()=>{p||"number"!=typeof u||null!==h.current||(h.current=setTimeout((()=>{g(),h.current=null}),u))}),[u,p,g,...o]),{droppableRects:v,measureDroppableContainers:g,measuringScheduled:null!=l}}(ne,{dragging:k,dependencies:[j.x,j.y],config:re.droppable}),se=function(e,t){const n=null!=t?e.get(t):void 0,r=n?n.node.current:null;return(0,i.useLazyMemo)((e=>{var n;return null==t?null:null!=(n=null!=r?r:e)?n:null}),[r,t])}(N,P),ue=(0,r.useMemo)((()=>G?(0,i.getEventCoordinates)(G):null),[G]),ce=function(){const e=!1===(null==X?void 0:X.autoScrollEnabled),t="object"==typeof f?!1===f.enabled:!1===f,n=k&&!e&&!t;if("object"==typeof f)return{...f,enabled:n};return{enabled:n}}(),de=function(e,t){return Te(e,t)}(se,re.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:o,config:a=!0}=e;const l=(0,r.useRef)(!1),{x:s,y:u}="boolean"==typeof a?{x:a,y:a}:a;(0,i.useIsomorphicLayoutEffect)((()=>{if(!s&&!u||!t)return void(l.current=!1);if(l.current||!o)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const r=I(n(e),o);if(s||(r.x=0),u||(r.y=0),l.current=!0,Math.abs(r.x)>0||Math.abs(r.y)>0){const t=U(e);t&&t.scrollBy({top:r.y,left:r.x})}}),[t,s,u,o,n])}({activeNode:null!=P?N.get(P):null,config:ce.layoutShiftCompensation,initialRect:de,measure:re.draggable.measure});const fe=ke(se,re.draggable.measure,de),pe=ke(se?se.parentElement:null),me=(0,r.useRef)({activatorEvent:null,active:null,activeNode:se,collisionRect:null,collisions:null,droppableRects:ae,draggableNodes:N,draggingNode:null,draggingNodeRect:null,droppableContainers:L,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ge=L.getNodeFor(null==(t=me.current.over)?void 0:t.id),he=function(e){let{measure:t}=e;const[n,o]=(0,r.useState)(null),a=Re({callback:(0,r.useCallback)((e=>{for(const{target:n}of e)if((0,i.isHTMLElement)(n)){o((e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r}));break}}),[t])}),l=(0,r.useCallback)((e=>{const n=je(e);null==a||a.disconnect(),n&&(null==a||a.observe(n)),o(n?t(n):null)}),[t,a]),[s,u]=(0,i.useNodeRef)(l);return(0,r.useMemo)((()=>({nodeRef:s,rect:n,setRef:u})),[n,s,u])}({measure:re.dragOverlay.measure}),ve=null!=(n=he.nodeRef.current)?n:se,be=k?null!=(l=he.rect)?l:fe:null,ye=Boolean(he.nodeRef.current&&he.rect),Ee=I(we=ye?null:fe,Te(we));var we;const Ce=Ne(ve?(0,i.getWindow)(ve):null),Oe=function(e){const t=(0,r.useRef)(e),n=(0,i.useLazyMemo)((n=>e?n&&n!==Pe&&e&&t.current&&e.parentNode===t.current.parentNode?n:B(e):Pe),[e]);return(0,r.useEffect)((()=>{t.current=e}),[e]),n}(k?null!=ge?ge:se:null),Se=function(e,t){void 0===t&&(t=F);const[n]=e,o=Ne(n?(0,i.getWindow)(n):null),[a,l]=(0,r.useState)(Ae);function s(){l((()=>e.length?e.map((e=>z(e)?o:new te(t(e),e))):Ae))}const u=Re({callback:s});return(0,i.useIsomorphicLayoutEffect)((()=>{null==u||u.disconnect(),s(),e.forEach((e=>null==u?void 0:u.observe(e)))}),[e]),a}(Oe),Me=Xe(E,{transform:{x:j.x-Ee.x,y:j.y-Ee.y,scaleX:1,scaleY:1},activatorEvent:G,active:q,activeNodeRect:fe,containerNodeRect:pe,draggingNodeRect:be,over:me.current.over,overlayNodeRect:he.rect,scrollableAncestors:Oe,scrollableAncestorRects:Se,windowRect:Ce}),Be=ue?(0,i.add)(ue,j):null,Ue=function(e){const[t,n]=(0,r.useState)(null),o=(0,r.useRef)(e),a=(0,r.useCallback)((e=>{const t=H(e.target);t&&n((e=>e?(e.set(t,$(t)),new Map(e)):null))}),[]);return(0,r.useEffect)((()=>{const t=o.current;if(e!==t){r(t);const i=e.map((e=>{const t=H(e);return t?(t.addEventListener("scroll",a,{passive:!0}),[t,$(t)]):null})).filter((e=>null!=e));n(i.length?new Map(i):null),o.current=e}return()=>{r(e),r(t)};function r(e){e.forEach((e=>{const t=H(e);null==t||t.removeEventListener("scroll",a)}))}}),[a,e]),(0,r.useMemo)((()=>e.length?t?Array.from(t.values()).reduce(((e,t)=>(0,i.add)(e,t)),y):Q(e):y),[e,t])}(Oe),He=Ie(Ue),Je=Ie(Ue,[fe]),Qe=(0,i.add)(Me,He),Ze=be?A(be,Me):null,et=q&&Ze?v({active:q,collisionRect:Ze,droppableRects:ae,droppableContainers:ne,pointerCoordinates:Be}):null,tt=x(et,"id"),[nt,rt]=(0,r.useState)(null),ot=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(ye?Me:(0,i.add)(Me,Je),null!=(s=null==nt?void 0:nt.rect)?s:null,fe),at=(0,r.useRef)(null),it=(0,r.useCallback)(((e,t)=>{let{sensor:n,options:r}=t;if(null==K.current)return;const o=N.get(K.current);if(!o)return;const i=e.nativeEvent,l=new n({active:K.current,activeNode:o,event:i,options:r,context:me,onAbort(e){if(!N.get(e))return;const{onDragAbort:t}=Z.current,n={id:e};null==t||t(n),S({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!N.get(e))return;const{onDragPending:o}=Z.current,a={id:e,constraint:t,initialCoordinates:n,offset:r};null==o||o(a),S({type:"onDragPending",event:a})},onStart(e){const t=K.current;if(null==t)return;const n=N.get(t);if(!n)return;const{onDragStart:r}=Z.current,o={activatorEvent:i,active:{id:t,data:n.data,rect:V}};(0,a.unstable_batchedUpdates)((()=>{null==r||r(o),R(Ge.Initializing),O({type:g.DragStart,initialCoordinates:e,active:t}),S({type:"onDragStart",event:o}),Y(at.current),J(i)}))},onMove(e){O({type:g.DragMove,coordinates:e})},onEnd:s(g.DragEnd),onCancel:s(g.DragCancel)});function s(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:o}=me.current;let l=null;if(t&&o){const{cancelDrop:a}=Z.current;if(l={activatorEvent:i,active:t,collisions:n,delta:o,over:r},e===g.DragEnd&&"function"==typeof a){await Promise.resolve(a(l))&&(e=g.DragCancel)}}K.current=null,(0,a.unstable_batchedUpdates)((()=>{O({type:e}),R(Ge.Uninitialized),rt(null),Y(null),J(null),at.current=null;const t=e===g.DragEnd?"onDragEnd":"onDragCancel";if(l){const e=Z.current[t];null==e||e(l),S({type:t,event:l})}}))}}at.current=l}),[N]),lt=(0,r.useCallback)(((e,t)=>(n,r)=>{const o=n.nativeEvent,a=N.get(r);if(null!==K.current||!a||o.dndKit||o.defaultPrevented)return;const i={active:a};!0===e(n,t.options,i)&&(o.dndKit={capturedBy:t.sensor},K.current=r,it(n,t))}),[N,it]),st=function(e,t){return(0,r.useMemo)((()=>e.reduce(((e,n)=>{const{sensor:r}=n;return[...e,...r.activators.map((e=>({eventName:e.eventName,handler:t(e.handler,n)})))]}),[])),[e,t])}(h,lt);!function(e){(0,r.useEffect)((()=>{if(!i.canUseDOM)return;const t=e.map((e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()}));return()=>{for(const e of t)null==e||e()}}),e.map((e=>{let{sensor:t}=e;return t})))}(h),(0,i.useIsomorphicLayoutEffect)((()=>{fe&&T===Ge.Initializing&&R(Ge.Initialized)}),[fe,T]),(0,r.useEffect)((()=>{const{onDragMove:e}=Z.current,{active:t,activatorEvent:n,collisions:r,over:o}=me.current;if(!t||!n)return;const i={active:t,activatorEvent:n,collisions:r,delta:{x:Qe.x,y:Qe.y},over:o};(0,a.unstable_batchedUpdates)((()=>{null==e||e(i),S({type:"onDragMove",event:i})}))}),[Qe.x,Qe.y]),(0,r.useEffect)((()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:o}=me.current;if(!e||null==K.current||!t||!o)return;const{onDragOver:i}=Z.current,l=r.get(tt),s=l&&l.rect.current?{id:l.id,rect:l.rect.current,data:l.data,disabled:l.disabled}:null,u={active:e,activatorEvent:t,collisions:n,delta:{x:o.x,y:o.y},over:s};(0,a.unstable_batchedUpdates)((()=>{rt(s),null==i||i(u),S({type:"onDragOver",event:u})}))}),[tt]),(0,i.useIsomorphicLayoutEffect)((()=>{me.current={activatorEvent:G,active:q,activeNode:se,collisionRect:Ze,collisions:et,droppableRects:ae,draggableNodes:N,draggingNode:ve,draggingNodeRect:be,droppableContainers:L,over:nt,scrollableAncestors:Oe,scrollAdjustedTranslate:Qe},V.current={initial:be,translated:Ze}}),[q,se,et,Ze,N,ve,be,ae,L,nt,Oe,Qe]),_e({...ce,delta:j,draggingRect:Ze,pointerCoordinates:Be,scrollableAncestors:Oe,scrollableAncestorRects:Se});const ut=(0,r.useMemo)((()=>({active:q,activeNode:se,activeNodeRect:fe,activatorEvent:G,collisions:et,containerNodeRect:pe,dragOverlay:he,draggableNodes:N,droppableContainers:L,droppableRects:ae,over:nt,measureDroppableContainers:ie,scrollableAncestors:Oe,scrollableAncestorRects:Se,measuringConfiguration:re,measuringScheduled:le,windowRect:Ce})),[q,se,fe,G,et,pe,he,N,L,ae,nt,ie,Oe,Se,re,le,Ce]),ct=(0,r.useMemo)((()=>({activatorEvent:G,activators:st,active:q,activeNodeRect:fe,ariaDescribedById:{draggable:ee},dispatch:O,draggableNodes:N,over:nt,measureDroppableContainers:ie})),[G,st,q,fe,O,ee,N,nt,ie]);return o().createElement(c.Provider,{value:D},o().createElement(Ve.Provider,{value:ct},o().createElement(qe.Provider,{value:ut},o().createElement(Ye.Provider,{value:ot},p)),o().createElement(ze,{disabled:!1===(null==d?void 0:d.restoreFocus)})),o().createElement(m,{...d,hiddenTextDescribedById:ee}))})),Qe=(0,r.createContext)(null),Ze="button",et="Draggable";function tt(e){let{id:t,data:n,disabled:o=!1,attributes:a}=e;const l=(0,i.useUniqueId)(et),{activators:s,activatorEvent:u,active:c,activeNodeRect:d,ariaDescribedById:f,draggableNodes:p,over:m}=(0,r.useContext)(Ve),{role:g=Ze,roleDescription:h="draggable",tabIndex:v=0}=null!=a?a:{},b=(null==c?void 0:c.id)===t,y=(0,r.useContext)(b?Ye:Qe),[E,w]=(0,i.useNodeRef)(),[C,_]=(0,i.useNodeRef)(),O=function(e,t){return(0,r.useMemo)((()=>e.reduce(((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e}),{})),[e,t])}(s,t),x=(0,i.useLatestValue)(n);(0,i.useIsomorphicLayoutEffect)((()=>(p.set(t,{id:t,key:l,node:E,activatorNode:C,data:x}),()=>{const e=p.get(t);e&&e.key===l&&p.delete(t)})),[p,t]);return{active:c,activatorEvent:u,activeNodeRect:d,attributes:(0,r.useMemo)((()=>({role:g,tabIndex:v,"aria-disabled":o,"aria-pressed":!(!b||g!==Ze)||void 0,"aria-roledescription":h,"aria-describedby":f.draggable})),[o,g,v,b,h,f.draggable]),isDragging:b,listeners:o?void 0:O,node:E,over:m,setNodeRef:w,setActivatorNodeRef:_,transform:y}}function nt(){return(0,r.useContext)(qe)}const rt="Droppable",ot={timeout:25};function at(e){let{data:t,disabled:n=!1,id:o,resizeObserverConfig:a}=e;const l=(0,i.useUniqueId)(rt),{active:s,dispatch:u,over:c,measureDroppableContainers:d}=(0,r.useContext)(Ve),f=(0,r.useRef)({disabled:n}),p=(0,r.useRef)(!1),m=(0,r.useRef)(null),h=(0,r.useRef)(null),{disabled:v,updateMeasurementsFor:b,timeout:y}={...ot,...a},E=(0,i.useLatestValue)(null!=b?b:o),w=Re({callback:(0,r.useCallback)((()=>{p.current?(null!=h.current&&clearTimeout(h.current),h.current=setTimeout((()=>{d(Array.isArray(E.current)?E.current:[E.current]),h.current=null}),y)):p.current=!0}),[y]),disabled:v||!s}),C=(0,r.useCallback)(((e,t)=>{w&&(t&&(w.unobserve(t),p.current=!1),e&&w.observe(e))}),[w]),[_,O]=(0,i.useNodeRef)(C),x=(0,i.useLatestValue)(t);return(0,r.useEffect)((()=>{w&&_.current&&(w.disconnect(),p.current=!1,w.observe(_.current))}),[_,w]),(0,r.useEffect)((()=>(u({type:g.RegisterDroppable,element:{id:o,key:l,disabled:n,node:_,rect:m,data:x}}),()=>u({type:g.UnregisterDroppable,key:l,id:o}))),[o]),(0,r.useEffect)((()=>{n!==f.current.disabled&&(u({type:g.SetDroppableDisabled,id:o,key:l,disabled:n}),f.current.disabled=n)}),[o,l,n,u]),{active:s,rect:m,isOver:(null==c?void 0:c.id)===o,node:_,over:c,setNodeRef:O}}function it(e){let{animation:t,children:n}=e;const[a,l]=(0,r.useState)(null),[s,u]=(0,r.useState)(null),c=(0,i.usePrevious)(n);return n||a||!c||l(c),(0,i.useIsomorphicLayoutEffect)((()=>{if(!s)return;const e=null==a?void 0:a.key,n=null==a?void 0:a.props.id;null!=e&&null!=n?Promise.resolve(t(n,s)).then((()=>{l(null)})):l(null)}),[t,a,s]),o().createElement(o().Fragment,null,n,a?(0,r.cloneElement)(a,{ref:u}):null)}const lt={x:0,y:0,scaleX:1,scaleY:1};function st(e){let{children:t}=e;return o().createElement(Ve.Provider,{value:He},o().createElement(Ye.Provider,{value:lt},t))}const ut={position:"fixed",touchAction:"none"},ct=e=>(0,i.isKeyboardEvent)(e)?"transform 250ms ease":void 0,dt=(0,r.forwardRef)(((e,t)=>{let{as:n,activatorEvent:r,adjustScale:a,children:l,className:s,rect:u,style:c,transform:d,transition:f=ct}=e;if(!u)return null;const p=a?d:{...d,scaleX:1,scaleY:1},m={...ut,width:u.width,height:u.height,top:u.top,left:u.left,transform:i.CSS.Transform.toString(p),transformOrigin:a&&r?w(r,u):void 0,transition:"function"==typeof f?f(r):f,...c};return o().createElement(n,{className:s,style:m,ref:t},l)})),ft=e=>t=>{let{active:n,dragOverlay:r}=t;const o={},{styles:a,className:i}=e;if(null!=a&&a.active)for(const[e,t]of Object.entries(a.active))void 0!==t&&(o[e]=n.node.style.getPropertyValue(e),n.node.style.setProperty(e,t));if(null!=a&&a.dragOverlay)for(const[e,t]of Object.entries(a.dragOverlay))void 0!==t&&r.node.style.setProperty(e,t);return null!=i&&i.active&&n.node.classList.add(i.active),null!=i&&i.dragOverlay&&r.node.classList.add(i.dragOverlay),function(){for(const[e,t]of Object.entries(o))n.node.style.setProperty(e,t);null!=i&&i.active&&n.node.classList.remove(i.active)}},pt={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:i.CSS.Transform.toString(t)},{transform:i.CSS.Transform.toString(n)}]},sideEffects:ft({styles:{active:{opacity:"0"}}})};function mt(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return(0,i.useEvent)(((e,a)=>{if(null===t)return;const l=n.get(e);if(!l)return;const s=l.node.current;if(!s)return;const u=je(a);if(!u)return;const{transform:c}=(0,i.getWindow)(a).getComputedStyle(a),d=j(c);if(!d)return;const f="function"==typeof t?t:function(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...pt,...e};return e=>{let{active:a,dragOverlay:i,transform:l,...s}=e;if(!t)return;const u={x:i.rect.left-a.rect.left,y:i.rect.top-a.rect.top},c={scaleX:1!==l.scaleX?a.rect.width*l.scaleX/i.rect.width:1,scaleY:1!==l.scaleY?a.rect.height*l.scaleY/i.rect.height:1},d={x:l.x-u.x,y:l.y-u.y,...c},f=o({...s,active:a,dragOverlay:i,transform:{initial:l,final:d}}),[p]=f,m=f[f.length-1];if(JSON.stringify(p)===JSON.stringify(m))return;const g=null==r?void 0:r({active:a,dragOverlay:i,...s}),h=i.node.animate(f,{duration:t,easing:n,fill:"forwards"});return new Promise((e=>{h.onfinish=()=>{null==g||g(),e()}}))}}(t);return Z(s,o.draggable.measure),f({active:{id:e,data:l.data,node:s,rect:o.draggable.measure(s)},draggableNodes:n,dragOverlay:{node:a,rect:o.dragOverlay.measure(u)},droppableContainers:r,measuringConfiguration:o,transform:d})}))}let gt=0;function ht(e){return(0,r.useMemo)((()=>{if(null!=e)return gt++,gt}),[e])}const vt=o().memo((e=>{let{adjustScale:t=!1,children:n,dropAnimation:a,style:i,transition:l,modifiers:s,wrapperElement:u="div",className:c,zIndex:d=999}=e;const{activatorEvent:f,active:p,activeNodeRect:m,containerNodeRect:g,draggableNodes:h,droppableContainers:v,dragOverlay:b,over:y,measuringConfiguration:E,scrollableAncestors:w,scrollableAncestorRects:C,windowRect:_}=nt(),O=(0,r.useContext)(Ye),x=ht(null==p?void 0:p.id),S=Xe(s,{activatorEvent:f,active:p,activeNodeRect:m,containerNodeRect:g,draggingNodeRect:b.rect,over:y,overlayNodeRect:b.rect,scrollableAncestors:w,scrollableAncestorRects:C,transform:O,windowRect:_}),D=Te(m),T=mt({config:a,draggableNodes:h,droppableContainers:v,measuringConfiguration:E}),R=D?b.setRef:void 0;return o().createElement(st,null,o().createElement(it,{animation:T},p&&x?o().createElement(dt,{key:x,id:p.id,ref:R,as:u,activatorEvent:f,adjustScale:t,className:c,transition:l,rect:D,style:{zIndex:d,...i},transform:S},n):null))}))},8831:function(e,t,n){n.r(t),n.d(t,{createSnapModifier:function(){return o},restrictToFirstScrollableAncestor:function(){return s},restrictToHorizontalAxis:function(){return a},restrictToParentElement:function(){return l},restrictToVerticalAxis:function(){return u},restrictToWindowEdges:function(){return c},snapCenterToCursor:function(){return d}});var r=n(4979);function o(e){return t=>{let{transform:n}=t;return{...n,x:Math.ceil(n.x/e)*e,y:Math.ceil(n.y/e)*e}}}const a=e=>{let{transform:t}=e;return{...t,y:0}};function i(e,t,n){const r={...e};return t.top+e.y<=n.top?r.y=n.top-t.top:t.bottom+e.y>=n.top+n.height&&(r.y=n.top+n.height-t.bottom),t.left+e.x<=n.left?r.x=n.left-t.left:t.right+e.x>=n.left+n.width&&(r.x=n.left+n.width-t.right),r}const l=e=>{let{containerNodeRect:t,draggingNodeRect:n,transform:r}=e;return n&&t?i(r,n,t):r},s=e=>{let{draggingNodeRect:t,transform:n,scrollableAncestorRects:r}=e;const o=r[0];return t&&o?i(n,t,o):n},u=e=>{let{transform:t}=e;return{...t,x:0}},c=e=>{let{transform:t,draggingNodeRect:n,windowRect:r}=e;return n&&r?i(t,n,r):t},d=e=>{let{activatorEvent:t,draggingNodeRect:n,transform:o}=e;if(n&&t){const e=(0,r.getEventCoordinates)(t);if(!e)return o;const a=e.x-n.left,i=e.y-n.top;return{...o,x:o.x+a-n.width/2,y:o.y+i-n.height/2}}return o}},3627:function(e,t,n){n.r(t),n.d(t,{SortableContext:function(){return y},arrayMove:function(){return l},arraySwap:function(){return s},defaultAnimateLayoutChanges:function(){return w},defaultNewIndexGetter:function(){return E},hasSortableData:function(){return D},horizontalListSortingStrategy:function(){return f},rectSortingStrategy:function(){return p},rectSwappingStrategy:function(){return m},sortableKeyboardCoordinates:function(){return R},useSortable:function(){return S},verticalListSortingStrategy:function(){return h}});var r=n(1594),o=n.n(r),a=n(6733),i=n(4979);function l(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function s(e,t,n){const r=e.slice();return r[t]=e[n],r[n]=e[t],r}function u(e,t){return e.reduce(((e,n,r)=>{const o=t.get(n);return o&&(e[r]=o),e}),Array(e.length))}function c(e){return null!==e&&e>=0}const d={scaleX:1,scaleY:1},f=e=>{var t;let{rects:n,activeNodeRect:r,activeIndex:o,overIndex:a,index:i}=e;const l=null!=(t=n[o])?t:r;if(!l)return null;const s=function(e,t,n){const r=e[t],o=e[t-1],a=e[t+1];if(!r||!o&&!a)return 0;if(no&&i<=a?{x:-l.width-s,y:0,...d}:i=a?{x:l.width+s,y:0,...d}:{x:0,y:0,...d}};const p=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const a=l(t,r,n),i=t[o],s=a[o];return s&&i?{x:s.left-i.left,y:s.top-i.top,scaleX:s.width/i.width,scaleY:s.height/i.height}:null},m=e=>{let t,n,{activeIndex:r,index:o,rects:a,overIndex:i}=e;return o===r&&(t=a[o],n=a[i]),o===i&&(t=a[o],n=a[r]),n&&t?{x:n.left-t.left,y:n.top-t.top,scaleX:n.width/t.width,scaleY:n.height/t.height}:null},g={scaleX:1,scaleY:1},h=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:a,overIndex:i}=e;const l=null!=(t=a[n])?t:r;if(!l)return null;if(o===n){const e=a[i];return e?{x:0,y:nn&&o<=i?{x:0,y:-l.height-s,...g}:o=i?{x:0,y:l.height+s,...g}:{x:0,y:0,...g}};const v="Sortable",b=o().createContext({activeIndex:-1,containerId:v,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:p,disabled:{draggable:!1,droppable:!1}});function y(e){let{children:t,id:n,items:l,strategy:s=p,disabled:c=!1}=e;const{active:d,dragOverlay:f,droppableRects:m,over:g,measureDroppableContainers:h}=(0,a.useDndContext)(),y=(0,i.useUniqueId)(v,n),E=Boolean(null!==f.rect),w=(0,r.useMemo)((()=>l.map((e=>"object"==typeof e&&"id"in e?e.id:e))),[l]),C=null!=d,_=d?w.indexOf(d.id):-1,O=g?w.indexOf(g.id):-1,x=(0,r.useRef)(w),S=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n{S&&C&&h(w)}),[S,w,C,h]),(0,r.useEffect)((()=>{x.current=w}),[w]);const R=(0,r.useMemo)((()=>({activeIndex:_,containerId:y,disabled:T,disableTransforms:D,items:w,overIndex:O,useDragOverlay:E,sortedRects:u(w,m),strategy:s})),[_,y,T.draggable,T.droppable,D,w,O,m,E,s]);return o().createElement(b.Provider,{value:R},t)}const E=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return l(n,r,o).indexOf(t)},w=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:a,newIndex:i,previousItems:l,previousContainerId:s,transition:u}=e;return!(!u||!r)&&((l===a||o!==i)&&(!!n||i!==o&&t===s))},C={duration:200,easing:"ease"},_="transform",O=i.CSS.Transition.toString({property:_,duration:0,easing:"linear"}),x={roleDescription:"sortable"};function S(e){let{animateLayoutChanges:t=w,attributes:n,disabled:o,data:l,getNewIndex:s=E,id:u,strategy:d,resizeObserverConfig:f,transition:p=C}=e;const{items:m,containerId:g,activeIndex:h,disabled:v,disableTransforms:y,sortedRects:S,overIndex:D,useDragOverlay:T,strategy:R}=(0,r.useContext)(b),M=function(e,t){var n,r;if("boolean"==typeof e)return{draggable:e,droppable:!1};return{draggable:null!=(n=null==e?void 0:e.draggable)?n:t.draggable,droppable:null!=(r=null==e?void 0:e.droppable)?r:t.droppable}}(o,v),k=m.indexOf(u),P=(0,r.useMemo)((()=>({sortable:{containerId:g,index:k,items:m},...l})),[g,l,k,m]),I=(0,r.useMemo)((()=>m.slice(m.indexOf(u))),[m,u]),{rect:N,node:A,isOver:j,setNodeRef:L}=(0,a.useDroppable)({id:u,data:P,disabled:M.droppable,resizeObserverConfig:{updateMeasurementsFor:I,...f}}),{active:F,activatorEvent:W,activeNodeRect:B,attributes:U,setNodeRef:H,listeners:V,isDragging:q,over:$,setActivatorNodeRef:K,transform:z}=(0,a.useDraggable)({id:u,data:P,attributes:{...x,...n},disabled:M.draggable}),X=(0,i.useCombinedRefs)(L,H),Y=Boolean(F),G=Y&&!y&&c(h)&&c(D),J=!T&&q,Q=J&&G?z:null,Z=G?null!=Q?Q:(null!=d?d:R)({rects:S,activeNodeRect:B,activeIndex:h,overIndex:D,index:k}):null,ee=c(h)&&c(D)?s({id:u,items:m,activeIndex:h,overIndex:D}):k,te=null==F?void 0:F.id,ne=(0,r.useRef)({activeId:te,items:m,newIndex:ee,containerId:g}),re=m!==ne.current.items,oe=t({active:F,containerId:g,isDragging:q,isSorting:Y,id:u,index:k,items:m,newIndex:ne.current.newIndex,previousItems:ne.current.items,previousContainerId:ne.current.containerId,transition:p,wasDragging:null!=ne.current.activeId}),ae=function(e){let{disabled:t,index:n,node:o,rect:l}=e;const[s,u]=(0,r.useState)(null),c=(0,r.useRef)(n);return(0,i.useIsomorphicLayoutEffect)((()=>{if(!t&&n!==c.current&&o.current){const e=l.current;if(e){const t=(0,a.getClientRect)(o.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&u(n)}}n!==c.current&&(c.current=n)}),[t,n,o,l]),(0,r.useEffect)((()=>{s&&u(null)}),[s]),s}({disabled:!oe,index:k,node:A,rect:N});return(0,r.useEffect)((()=>{Y&&ne.current.newIndex!==ee&&(ne.current.newIndex=ee),g!==ne.current.containerId&&(ne.current.containerId=g),m!==ne.current.items&&(ne.current.items=m)}),[Y,ee,g,m]),(0,r.useEffect)((()=>{if(te===ne.current.activeId)return;if(null!=te&&null==ne.current.activeId)return void(ne.current.activeId=te);const e=setTimeout((()=>{ne.current.activeId=te}),50);return()=>clearTimeout(e)}),[te]),{active:F,activeIndex:h,attributes:U,data:P,rect:N,index:k,newIndex:ee,items:m,isOver:j,isSorting:Y,isDragging:q,listeners:V,node:A,overIndex:D,over:$,setNodeRef:X,setActivatorNodeRef:K,setDroppableNodeRef:L,setDraggableNodeRef:H,transform:null!=ae?ae:Z,transition:function(){if(ae||re&&ne.current.newIndex===k)return O;if(J&&!(0,i.isKeyboardEvent)(W)||!p)return;if(Y||oe)return i.CSS.Transition.toString({...p,property:_});return}()}}function D(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&"object"==typeof t.sortable&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const T=[a.KeyboardCode.Down,a.KeyboardCode.Right,a.KeyboardCode.Up,a.KeyboardCode.Left],R=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:o,droppableContainers:l,over:s,scrollableAncestors:u}}=t;if(T.includes(e.code)){if(e.preventDefault(),!n||!r)return;const t=[];l.getEnabled().forEach((n=>{if(!n||null!=n&&n.disabled)return;const i=o.get(n.id);if(i)switch(e.code){case a.KeyboardCode.Down:r.topi.top&&t.push(n);break;case a.KeyboardCode.Left:r.left>i.left&&t.push(n);break;case a.KeyboardCode.Right:r.left1&&(d=c[1].id),null!=d){const e=l.get(n.id),t=l.get(d),s=t?o.get(t.id):null,c=null==t?void 0:t.node.current;if(c&&s&&e&&t){const n=(0,a.getScrollableAncestors)(c).some(((e,t)=>u[t]!==e)),o=M(e,t),l=function(e,t){if(!D(e)||!D(t))return!1;if(!M(e,t))return!1;return e.data.current.sortable.indexe=>{t.forEach((t=>t(e)))}),t)}const a="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function i(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function l(e){return"nodeType"in e}function s(e){var t,n;return e?i(e)?e:l(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function u(e){const{Document:t}=s(e);return e instanceof t}function c(e){return!i(e)&&e instanceof s(e).HTMLElement}function d(e){return e instanceof s(e).SVGElement}function f(e){return e?i(e)?e.document:l(e)?u(e)?e:c(e)||d(e)?e.ownerDocument:document:document:document}const p=a?r.useLayoutEffect:r.useEffect;function m(e){const t=(0,r.useRef)(e);return p((()=>{t.current=e})),(0,r.useCallback)((function(){for(var e=arguments.length,n=new Array(e),r=0;r{e.current=setInterval(t,n)}),[]),(0,r.useCallback)((()=>{null!==e.current&&(clearInterval(e.current),e.current=null)}),[])]}function h(e,t){void 0===t&&(t=[e]);const n=(0,r.useRef)(e);return p((()=>{n.current!==e&&(n.current=e)}),t),n}function v(e,t){const n=(0,r.useRef)();return(0,r.useMemo)((()=>{const t=e(n.current);return n.current=t,t}),[...t])}function b(e){const t=m(e),n=(0,r.useRef)(null),o=(0,r.useCallback)((e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e}),[]);return[n,o]}function y(e){const t=(0,r.useRef)();return(0,r.useEffect)((()=>{t.current=e}),[e]),t.current}let E={};function w(e,t){return(0,r.useMemo)((()=>{if(t)return t;const n=null==E[e]?0:E[e]+1;return E[e]=n,e+"-"+n}),[e,t])}function C(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o{const r=Object.entries(n);for(const[n,o]of r){const r=t[n];null!=r&&(t[n]=r+e*o)}return t}),{...t})}}const _=C(1),O=C(-1);function x(e){return"clientX"in e&&"clientY"in e}function S(e){if(!e)return!1;const{KeyboardEvent:t}=s(e.target);return t&&e instanceof t}function D(e){if(!e)return!1;const{TouchEvent:t}=s(e.target);return t&&e instanceof t}function T(e){if(D(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return x(e)?{x:e.clientX,y:e.clientY}:null}const R=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[R.Translate.toString(e),R.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),M="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function k(e){return e.matches(M)?e:e.querySelector(M)}},2038:function(e,t,n){var r=a(n(4121)),o=a(n(1240));function a(e){return e&&e.__esModule?e:{default:e}}window.document.addEventListener("DOMContentLoaded",(()=>{(0,r.default)(),(0,o.default)()}))},4121:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=b(n(5207)),o=b(n(584)),a=b(n(7105)),i=b(n(6721)),l=b(n(2512)),s=b(n(5563)),u=b(n(5297)),c=b(n(7651)),d=b(n(1305)),f=b(n(7660)),p=b(n(7333)),m=b(n(2382)),g=b(n(8953)),h=b(n(1950)),v=b(n(6573));function b(e){return e&&e.__esModule?e:{default:e}}t.default=()=>{r.default.component.registerMany({ElementEditor:i.default,ElementToolbar:s.default,ElementAddNewButton:u.default,ElementList:l.default,Element:o.default,ElementActions:a.default,ElementHeader:c.default,ElementContent:d.default,ElementSummary:f.default,ElementInlineEditForm:p.default,AddElementPopover:m.default,HoverBar:g.default,DragPositionIndicator:h.default,TextCheckboxGroupField:v.default})}},1240:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=d(n(5207)),o=d(n(2977)),a=d(n(3337)),i=d(n(4)),l=d(n(9283)),s=d(n(8501)),u=d(n(2221)),c=d(n(5904));function d(e){return e&&e.__esModule?e:{default:e}}t.default=()=>{r.default.transform("elemental-fieldgroup",(e=>{e.component("FieldGroup.HistoryViewer.VersionDetail",o.default,"HistoricElement")}),{after:"field-holders"}),r.default.transform("blocks-history-revert",(e=>{e.component("HistoryViewerToolbar.VersionedAdmin.HistoryViewer.Element.HistoryViewerVersionDetail",a.default,"BlockRevertRequest")})),r.default.transform("element-actions",(e=>{e.component("ElementActions",s.default,"ElementActionsWithSave"),e.component("ElementActions",u.default,"ElementActionsWithPublish"),e.component("ElementActions",c.default,"ElementActionsWithUnpublish"),e.component("ElementActions",l.default,"ElementActionsWithDuplicate"),e.component("ElementActions",i.default,"ElementActionsWithArchive")}))}},26:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=s(n(1594)),o=s(n(6935)),a=s(n(6923)),i=n(3556),l=n(9791);function s(e){return e&&e.__esModule?e:{default:e}}const u=e=>{const{className:t,title:n,label:o}=e,l={className:(0,a.default)(t,"dropdown-item"),...e};return r.default.createElement(i.DropdownItem,l,o||n)};u.propTypes={disabled:o.default.bool,className:o.default.string,onClick:o.default.func,title:o.default.string,name:o.default.string,type:l.elementTypeType,active:o.default.bool,label:o.default.string},u.defaultProps={disabled:!1};t.default=u},4:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=f(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=d(n(26)),a=d(n(5815)),i=n(6721),l=d(n(5609)),s=d(n(6177)),u=n(1135),c=d(n(4014));function d(e){return e&&e.__esModule?e:{default:e}}function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(f=function(e){return e?n:t})(e)}const p=e=>t=>{const{fetchElements:n}=(0,r.useContext)(i.ElementEditorContext),d=void 0!==t.element.canDelete&&!t.element.canDelete,f=a.default._t("ElementArchiveAction.ARCHIVE","Archive"),p={label:f,title:d?a.default._t("ElementArchiveAction.ARCHIVE_PERMISSION_DENY","Archive, insufficient permissions"):f,disabled:d,className:"element-editor__actions-archive",onClick:e=>{e.stopPropagation();const r=t.element.isPublished;let o=a.default._t("ElementArchiveAction.CONFIRM_DELETE","Are you sure you want to send this block to the archive?");if(r&&(o=a.default._t("ElementArchiveAction.CONFIRM_DELETE_AND_UNPUBLISH","Warning: This block will be unpublished before being sent to the archive. Are you sure you want to proceed?")),!window.confirm(o))return;const i=t.element.id,d=`${(0,u.getConfig)().controllerLink.replace(/\/$/,"")}/api/delete`;l.default.post(d,{id:i},{"X-SecurityID":s.default.get("SecurityID")}).then((()=>n())).catch((async e=>{const t=await(0,c.default)(e);window.jQuery.noticeAdd({text:t,stay:!0,type:"error"})}))},toggle:t.toggle};return r.default.createElement(e,t,t.children,r.default.createElement(o.default,p))};t.Component=p;t.default=p},9283:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=f(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=d(n(26)),a=d(n(5815)),i=n(6721),l=d(n(5609)),s=d(n(6177)),u=n(1135),c=d(n(4014));function d(e){return e&&e.__esModule?e:{default:e}}function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(f=function(e){return e?n:t})(e)}const p=e=>t=>{const{fetchElements:n}=(0,r.useContext)(i.ElementEditorContext);if(t.type.broken)return r.default.createElement(e,t);const d=void 0!==t.element.canCreate&&!t.element.canCreate,f=a.default._t("ElementArchiveAction.DUPLICATE","Duplicate"),p={label:f,title:d?a.default._t("ElementArchiveAction.DUPLICATE_PERMISSION_DENY","Duplicate, insufficient permissions"):f,disabled:d,className:"element-editor__actions-duplicate",onClick:e=>{e.stopPropagation();const r=t.element.id,o=`${(0,u.getConfig)().controllerLink.replace(/\/$/,"")}/api/duplicate`;l.default.post(o,{id:r},{"X-SecurityID":s.default.get("SecurityID")}).then((()=>n())).catch((async e=>{const t=await(0,c.default)(e);window.jQuery.noticeAdd({text:t,stay:!0,type:"error"})}))},toggle:t.toggle};return r.default.createElement(e,t,t.children,r.default.createElement(o.default,p))};t.Component=p;t.default=p},2221:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=l(n(26)),a=l(n(5815)),i=n(584);function l(e){return e&&e.__esModule?e:{default:e}}function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}const u=e=>t=>{const{formDirty:n,onPublishButtonClick:l}=(0,r.useContext)(i.ElementContext),{element:s}=t,u=void 0!==t.element.canPublish&&!t.element.canPublish,c=a.default._t("ElementArchiveAction.PUBLISH","Publish"),d={label:c,title:u?a.default._t("ElementArchiveAction.PUBLISH_PERMISSION_DENY","Publish, insufficient permissions"):c,disabled:u,className:"element-editor__actions-publish",onClick:e=>{e.stopPropagation(),l()},toggle:t.toggle};return t.type.broken?r.default.createElement(e,t):r.default.createElement(e,t,t.children,(n||!s.isLiveVersion)&&r.default.createElement(o.default,d))};t.Component=u;t.default=u},8501:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=l(n(26)),a=l(n(5815)),i=n(584);function l(e){return e&&e.__esModule?e:{default:e}}function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}const u=e=>t=>{const{onSaveButtonClick:n,formDirty:l}=(0,r.useContext)(i.ElementContext),s={title:a.default._t("ElementSaveAction.SAVE","Save"),className:"element-editor__actions-save",onClick:e=>{e.stopPropagation(),n()},toggle:t.toggle};return!t.expandable||t.type.broken?r.default.createElement(e,t):r.default.createElement(e,t,t.children,l&&r.default.createElement(o.default,s))};t.Component=u;t.default=u},5904:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=c(n(26)),a=c(n(5815)),i=c(n(5609)),l=n(6721),s=c(n(6177)),u=n(1135);function c(e){return e&&e.__esModule?e:{default:e}}function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}const f=e=>t=>{const{fetchElements:n}=(0,r.useContext)(l.ElementEditorContext);if(t.type.broken)return r.default.createElement(e,t);const c=(e,t,n)=>{const r=a.default.inject(a.default._t("ElementHeader.NOTITLE","Untitled {type} block"),{type:e}),o=a.default.inject(a.default._t("ElementUnpublishAction.SUCCESS_NOTIFICATION","Removed '{title}' from the published page"),{title:t||r}),i=a.default.inject(a.default._t("ElementUnpublishAction.ERROR_NOTIFICATION","Error unpublishing '{title}'"),{title:t||r});window.jQuery.noticeAdd({text:n?o:i,stay:!1,type:n?"success":"error"})},d=void 0!==t.element.canUnpublish&&!t.element.canUnpublish,f=a.default._t("ElementArchiveAction.UNPUBLISH","Unpublish"),p={label:f,title:d?a.default._t("ElementArchiveAction.UNPUBLISH_PERMISSION_DENY","Unpublish, insufficient permissions"):f,disabled:d,className:"element-editor__actions-unpublish",onClick:e=>{e.stopPropagation(),(()=>{const e=t.element.id,r=`${(0,u.getConfig)().controllerLink.replace(/\/$/,"")}/api/unpublish`;i.default.post(r,{id:e},{"X-SecurityID":s.default.get("SecurityID")}).then((()=>n())).then((()=>c(t.type.title,t.element.title,!0))).catch((()=>c(t.type.title,t.element.title,!1)))})()},toggle:t.toggle};return r.default.createElement(e,t,t.children,t.element.isPublished&&r.default.createElement(o.default,p))};t.Component=f;t.default=f},2382:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=b(n(1594)),o=h(n(6935)),a=n(9040),i=n(9367),l=h(n(6923)),s=b(n(8918)),u=n(5207),c=n(9791),d=h(n(5815)),f=h(n(5609)),p=h(n(6177)),m=n(6721),g=h(n(4014));function h(e){return e&&e.__esModule?e:{default:e}}function v(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(v=function(e){return e?n:t})(e)}function b(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=v(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}class y extends r.Component{constructor(e){super(e),this.handleToggle=this.handleToggle.bind(this),y.contextType=m.ElementEditorContext}getElementButtonClickHandler(e){return t=>{t.preventDefault();const n=`${p.default.getSection("DNADesign\\Elemental\\Controllers\\ElementalAreaController").controllerLink}/api/create`;f.default.post(n,{elementClass:e.class,elementalAreaID:this.props.areaId,insertAfterElementID:this.props.insertAfterElement},{"X-SecurityID":p.default.get("SecurityID")}).then((()=>{const{fetchElements:e}=this.context;return e()})).then((()=>{const e=window.jQuery(".cms-preview");e.entwine("ss.preview")._loadUrl(e.find("iframe").attr("src"))})).catch((async e=>{const t=await(0,g.default)(e);this.props.actions.toasts.error(t)})),this.handleToggle()}}handleToggle(){const{toggle:e}=this.props;e()}render(){const{PopoverOptionSetComponent:e,elementTypes:t,container:n,extraClass:o,isOpen:a,placement:i,target:s}=this.props,u=(0,l.default)("element-editor-add-element",o),c=t.map((e=>({content:e.title,key:e.name,className:(0,l.default)(e.icon,"btn--icon-xl","element-editor-add-element__button"),onClick:this.getElementButtonClickHandler(e)})));return r.default.createElement(e,{buttons:c,searchPlaceholder:d.default._t("ElementAddElementPopover.SEARCH_BLOCKS","Search blocks"),extraClass:u,container:n,isOpen:a,placement:i,target:s,toggle:this.handleToggle})}}t.Component=y,y.propTypes={container:o.default.oneOfType([o.default.string,o.default.func,o.default.object]),elementTypes:o.default.arrayOf(c.elementTypeType).isRequired,extraClass:o.default.oneOfType([o.default.string,o.default.array,o.default.object]),isOpen:o.default.bool.isRequired,placement:o.default.string,target:o.default.oneOfType([o.default.string,o.default.func,o.default.object]).isRequired,toggle:o.default.func.isRequired,areaId:o.default.number.isRequired,insertAfterElement:o.default.oneOfType([o.default.number,o.default.string])};const E=(0,u.inject)(["PopoverOptionSet"],(e=>({PopoverOptionSetComponent:e})),(()=>"ElementEditor"))(y);t.default=(0,i.compose)((0,a.connect)(null,(function(e){return{actions:{toasts:(0,i.bindActionCreators)(s,e)}}})))(E)},5297:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=c(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=u(n(6935)),a=n(3556),i=u(n(5815)),l=n(9791),s=n(5207);function u(e){return e&&e.__esModule?e:{default:e}}function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(c=function(e){return e?n:t})(e)}class d extends r.Component{constructor(e){super(e),this.toggle=this.toggle.bind(this),this.state={popoverOpen:!1}}toggle(){this.setState((e=>({popoverOpen:!e.popoverOpen})))}render(){const{AddElementPopoverComponent:e,elementTypes:t,areaId:n}=this.props,o={id:`ElementalArea${n}_AddButton`,color:"primary",onClick:this.toggle,className:"font-icon-plus"};return r.default.createElement("div",null,r.default.createElement(a.Button,o,i.default._t("ElementAddNewButton.ADD_BLOCK","Add block")),r.default.createElement(e,{placement:"bottom-start",target:o.id,isOpen:this.state.popoverOpen,elementTypes:t,toggle:this.toggle,areaId:n,insertAfterElement:0}))}}t.Component=d,d.defaultProps={},d.propTypes={elementTypes:o.default.arrayOf(l.elementTypeType).isRequired,areaId:o.default.number.isRequired};t.default=(0,s.inject)(["AddElementPopover"],(e=>({AddElementPopoverComponent:e})),(()=>"ElementEditor.ElementList.AddNewButton"))(d)},1305:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r,o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),a=(r=n(6935))&&r.__esModule?r:{default:r},i=n(5207),l=n(9367);function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}class u extends o.PureComponent{render(){const{id:e,fileUrl:t,fileTitle:n,content:r,previewExpanded:a,InlineEditFormComponent:i,SummaryComponent:l,activeTab:s,onFormInit:u,handleLoadingError:c,formDirty:d,broken:f,onFormSchemaSubmitResponse:p,ensureFormRendered:m,formHasRendered:g}=this.props,h=!a&&(m||g),v={"element-editor-editform--collapsed":!a,"element-editor-editform--rendered-not-visible":h};return o.default.createElement("div",{className:"element-editor-content"},!a&&o.default.createElement(l,{content:r,fileUrl:t,fileTitle:n,broken:f}),(a||m||g)&&o.default.createElement(i,{extraClass:v,onClick:e=>e.stopPropagation(),elementId:e,activeTab:s,onFormInit:u,handleLoadingError:c,onFormSchemaSubmitResponse:p,notVisible:h}),d&&o.default.createElement("input",{type:"hidden",name:"change-tracker",className:"element-form-dirty-state",value:"1"}))}}t.Component=u,u.propTypes={id:a.default.number,content:a.default.string,fileUrl:a.default.string,fileTitle:a.default.string,previewExpanded:a.default.bool,SummaryComponent:a.default.elementType,InlineEditFormComponent:a.default.elementType,handleLoadingError:a.default.func,broken:a.default.bool,onFormSchemaSubmitResponse:a.default.func,onFormInit:a.default.func,ensureFormRendered:a.default.bool,formHasRendered:a.default.bool,formDirty:a.default.object},u.defaultProps={};t.default=(0,l.compose)((0,i.inject)(["ElementSummary","ElementInlineEditForm"],((e,t)=>({SummaryComponent:e,InlineEditFormComponent:t})),(()=>"ElementEditor.ElementList.Element")))(u)},1950:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=o(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(r,i,l):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(1594));function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(o=function(e){return e?n:t})(e)}class a extends r.PureComponent{render(){return r.default.createElement("div",{className:"elemental-editor-drag-indicator"},r.default.createElement("div",{className:"elemental-editor-drag-indicator__ball"}))}}t.default=a},584:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.ElementContext=t.Component=void 0;var r=S(n(1594)),o=O(n(6935)),a=n(455),i=n(9791),l=n(9367),s=n(5207),u=O(n(5815)),c=O(n(6923)),d=n(9040),f=n(5381),p=n(2153),m=n(7785),g=S(n(5034)),h=n(3627),v=n(4979),b=S(n(8918)),y=n(9077),E=n(6721),w=n(1135),C=O(n(5609)),_=O(n(6177));function O(e){return e&&e.__esModule?e:{default:e}}function x(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(x=function(e){return e?n:t})(e)}function S(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=x(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}function D(){return D=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const[t,n]=(0,r.useState)(!1),[o,a]=(0,r.useState)(""),[i,l]=(0,r.useState)(!1),[s,d]=(0,r.useState)(e.element.title),[f,p]=(0,r.useState)(!1),[m,g]=(0,r.useState)(!1),[b,y]=(0,r.useState)(!1),[O,x]=(0,r.useState)(!1),[S,R]=(0,r.useState)(!1),[M,k]=(0,r.useState)(!1),[P,I]=(0,r.useState)(!1),[N,A]=(0,r.useState)(!1),{fetchElements:j}=(0,r.useContext)(E.ElementEditorContext),{attributes:L,listeners:F,setNodeRef:W,transform:B,transition:U,isDragging:H,isOver:V}=(0,h.useSortable)({id:e.element.id}),q={transform:v.CSS.Transform.toString(B),transition:U};(0,r.useEffect)((()=>{void 0!==e.formDirty&&!N&&A(!0)}),[e.formDirty]),(0,r.useEffect)((()=>{e.onChangeHasUnsavedChanges(N)}),[N]),(0,r.useEffect)((()=>{e.saveElement&&N&&!m&&g(!0)}),[e.saveElement,N,e.increment]),(0,r.useEffect)((()=>{f&&M&&(p(!1),N?(e.submitForm(),x(!0)):y(!0))}),[f,M]),(0,r.useEffect)((()=>{P&&(I(!1),e.dispatchAddFormChanged())}),[P]);const $=()=>u.default.inject(u.default._t("ElementHeader.NOTITLE","Untitled {type} block"),{type:e.type.title}),K=t=>{(t=>{const n=s||$();if(t){const t=u.default.inject(u.default._t("ElementPublishAction.ERROR_NOTIFICATION","Error publishing '{title}'"),{title:n});e.actions.toasts.error(t)}else{const t=u.default.inject(u.default._t("ElementPublishAction.SUCCESS_NOTIFICATION","Published '{title}' successfully"),{title:n});e.actions.toasts.success(t)}})(t),y(!1),x(!1),j().then((()=>{setTimeout((()=>e.dispatchRemoveFormChanged()),250)}))};(0,r.useEffect)((()=>{M&&m&&(e.submitForm(),g(!1))}),[M,m]),(0,r.useEffect)((()=>{if(M&&b){const t=`${(0,w.getConfig)().controllerLink.replace(/\/$/,"")}/api/publish`;C.default.post(t,{id:e.element.id},{"X-SecurityID":_.default.get("SecurityID")}).then((()=>K(!1))).catch((()=>K(!0)))}}),[M,b]);const z=t=>{const{tabSetName:n,onActivateTab:r}=e;if(o||a(t),t||o)r(n,t||o);else{r(n,"Main")}},X=r=>{const{type:o,link:a}=e;o.broken||("button"!==r.target.type?!o.inlineEditable||i?window.location=a:n(!t):r.stopPropagation())},{element:Y,type:G,areaId:J,HeaderComponent:Q,ContentComponent:Z,link:ee,activeTab:te,formDirty:ne}=e;if(!Y.id)return null;const re=(0,c.default)("element-editor__element",{"element-editor__element--broken":G.broken,"element-editor__element--expandable":G.inlineEditable&&!G.broken,"element-editor__element--dragging":H,"element-editor__element--dragged-over":V},(()=>{const{element:t}=e,n="element-editor__element";return t.isPublished?t.isPublished&&!t.isLiveVersion?`${n}--modified`:`${n}--published`:`${n}--draft`})()),oe={formDirty:ne,onPublishButtonClick:()=>{p(!0),R(!0)},onSaveButtonClick:()=>{R(!0),g(!0)}},ae=r.default.createElement("div",D({className:re,onClick:X,onKeyUp:e=>{const{nodeName:t}=e.target;" "!==e.key&&"Enter"!==e.key||["input","textarea"].includes(t.toLowerCase())||X(e)},role:"button",tabIndex:0,title:(e=>e.broken?u.default._t("ElementalElement.ARCHIVE_BROKEN","Archive this block"):u.default.inject(u.default._t("ElementalElement.TITLE","Edit this {type} block"),{type:e.title}))(G),key:Y.id,ref:W},L,F,{style:q}),r.default.createElement(T.Provider,{value:oe},r.default.createElement(Q,{element:Y,type:G,areaId:J,expandable:G.inlineEditable,link:ee,previewExpanded:t,handleEditTabsClick:t=>{const{activeTab:r}=e;t===r||i||(n(!0),z(t))},activeTab:te,disableTooltip:H}),r.default.createElement(Z,{id:Y.id,fileUrl:Y.blockSchema.fileURL,fileTitle:Y.blockSchema.fileTitle,content:((e,t)=>t.broken?e.title?u.default.inject(u.default._t("ElementalElement.BROKEN_DESCRIPTION_TITLE",'This block had the title "{title}". It is broken and will not display on the front-end. You can archive it to remove it from this elemental area.'),{title:e.title}):u.default._t("ElementalElement.BROKEN_DESCRIPTION","This block is broken and will not display on the front-end. You can archive it to remove it from this elemental area."):e.blockSchema.content)(Y,G),previewExpanded:t&&!H,ensureFormRendered:S,formHasRendered:M,activeTab:te,handleLoadingError:()=>{l(!0)},broken:G.broken,onFormSchemaSubmitResponse:(t,r)=>{if(t.id.match(/\/schema\/elemental-area\/([0-9]+)/))return e.type.inlineEditable&&n(!0),I(!0),O&&x(!1),void e.onAfterSubmitResponse(!1);A(!1),d(r),O&&(x(!1),y(!0)),b||O||(t=>{const n=t||$(),r=u.default.inject(u.default._t("ElementSaveAction.SUCCESS_NOTIFICATION","Saved '{title}' successfully"),{title:n});e.actions.toasts.success(r)})(r),e.onAfterSubmitResponse(!0),j()},onFormInit:()=>(e=>{z(e),k(!0)})(te)})));return ae};t.Component=R,R.propTypes={element:a.elementType,type:i.elementTypeType.isRequired,areaId:o.default.number.isRequired,link:o.default.string.isRequired,activeTab:o.default.string,tabSetName:o.default.string,onActivateTab:o.default.func,isOver:o.default.bool.isRequired,saveElement:o.default.bool.isRequired,onBeforeSubmitForm:o.default.func.isRequired,onAfterSubmitResponse:o.default.func.isRequired,increment:o.default.number.isRequired},R.defaultProps={element:null};t.default=(0,l.compose)((0,d.connect)((function(e,t){const n=t.element.id,r=(0,p.loadElementFormStateName)(n),o=(0,m.loadElementSchemaValue)("schemaUrl",n),a=e.form&&e.form.formSchemas[o]&&e.form.formSchemas[o].schema&&e.form.formSchemas[o].schema.fields.find((e=>"Tabs"===e.component)),i=a&&a.id,l=`element.${r}__${i}`,s=e.unsavedForms.find((e=>e.name===`element.${r}`));return{tabSetName:i,activeTab:e.tabs&&e.tabs.fields&&e.tabs.fields[l]&&e.tabs.fields[l].activeTab,formDirty:s}}),(function(e,t){const n=(0,p.loadElementFormStateName)(t.element.id);return{onActivateTab(t,r){e(g.activateTab(`element.${n}__${t}`,r))},submitForm(){t.onBeforeSubmitForm(t.element.id),e((0,f.submit)(`element.${n}`))},dispatchAddFormChanged(){e((0,y.addFormChanged)(`element.${n}`))},dispatchRemoveFormChanged(){e((0,y.removeFormChanged)(`element.${n}`))},actions:{toasts:(0,l.bindActionCreators)(b,e)}}})),(0,s.inject)(["ElementHeader","ElementContent"],((e,t)=>({HeaderComponent:e,ContentComponent:t})),(()=>"ElementEditor.ElementList.Element")))(R)},7105:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=f(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=d(n(6935)),a=n(9367),i=n(3556),l=n(5207),s=n(455),u=n(9791),c=d(n(26));function d(e){return e&&e.__esModule?e:{default:e}}function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(f=function(e){return e?n:t})(e)}class p extends r.Component{constructor(e){super(e),this.handleEditTabsClick=this.handleEditTabsClick.bind(this)}handleEditTabsClick(e){const{handleEditTabsClick:t}=this.props;t(e.target.name)}renderEditTabs(){const{editTabs:e,activeTab:t,type:n,expandable:o}=this.props;return!n.broken&&o&&e&&e.length?e.map((e=>{let{name:o,title:a}=e;return r.default.createElement(c.default,{key:o,name:o,title:a,type:n,onClick:this.handleEditTabsClick,active:o===t})})):null}renderDivider(){const{children:e,editTabs:t,expandable:n}=this.props;return n&&t&&t.length&&0!==r.default.Children.count(e)?r.default.createElement(i.DropdownItem,{divider:!0,role:"separator"}):null}render(){const{children:e,id:t,ActionMenuComponent:n}=this.props;return r.default.createElement(n,{id:`element-editor-actions-${t}`,className:"element-editor-header__actions-dropdown",dropdownMenuProps:{right:!0},dropdownToggleClassNames:["element-editor-header__actions-toggle","btn","btn-sm","btn--no-text","font-icon-dot-3"]},this.renderEditTabs(),this.renderDivider(),e)}}t.Component=p,p.propTypes={element:s.elementType,type:u.elementTypeType.isRequired,areaId:o.default.number.isRequired,activeTab:o.default.string,editTabs:o.default.arrayOf(o.default.shape({title:o.default.string,name:o.default.string})),handleEditTabsClick:o.default.func.isRequired,expandable:o.default.bool},p.defaultProps={editTabs:[],expandable:!0};t.default=(0,a.compose)((0,l.inject)(["ActionMenu"],(e=>({ActionMenuComponent:e})),(()=>"ElementEditor.ElementList.Element")))(p)},6721:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.ElementEditorContext=t.Component=void 0;var r=v(n(1594)),o=g(n(6935)),a=n(9040),i=n(5207),l=n(9367),s=n(9791),u=g(n(5609)),c=g(n(6177)),d=n(1135),f=v(n(8918)),p=g(n(4014)),m=n(3627);function g(e){return e&&e.__esModule?e:{default:e}}function h(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(h=function(e){return e?n:t})(e)}function v(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=h(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}const b=t.ElementEditorContext=(0,r.createContext)(null);class y extends r.PureComponent{constructor(e){super(e),this.state={dragTargetElementId:null,dragSpot:null,elements:null,isLoading:!0,dragging:!1},this.handleDragStart=this.handleDragStart.bind(this),this.handleDragEnd=this.handleDragEnd.bind(this),this.fetchElements=this.fetchElements.bind(this)}handleDragStart(e){const{active:t}=e;this.setState({dragging:t.id})}handleDragEnd(e){const{active:t,over:n}=e,{elements:r}=this.state;if(t.id===n.id)return void this.setState({dragging:!1});const o=r.map((e=>e.id)),a=o.indexOf(t.id),i=o.indexOf(n.id),l=(0,m.arrayMove)(r,a,i),s=i>0?l[i-1].id:0,f=`${(0,d.getConfig)().controllerLink.replace(/\/$/,"")}/api/sort`;u.default.post(f,{id:t.id,afterBlockID:s},{"X-SecurityID":c.default.get("SecurityID")}).then((()=>this.fetchElements())).catch((async e=>{const t=await(0,p.default)(e);this.props.actions.toasts.error(t)})),this.setState({dragging:!1,elements:l})}fetchElements(){(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&this.setState((e=>({...e,isLoading:!0})));const e=`${(0,d.getConfig)().controllerLink.replace(/\/$/,"")}/api/readElements/${this.props.areaId}`;return u.default.get(e).then((async e=>{const t=await e.json();this.setState((e=>({...e,elements:t,isLoading:!1})));const n=window.jQuery(".cms-preview");n&&n.entwine("ss.preview")._loadUrl(n.find("iframe").attr("src"))})).catch((async e=>{this.setState({elements:[],isLoading:!1});const t=await(0,p.default)(e);this.props.actions.toasts.error(t)}))}render(){const{ToolbarComponent:e,ListComponent:t,areaId:n,elementTypes:o,allowedElements:a,sharedObject:i,isLoading:l}=this.props,{dragging:s,elements:u}=this.state;if(null===u)return this.fetchElements(!1),null;const c=a.map((e=>o.find((t=>t.class===e)))),d={fetchElements:this.fetchElements};return r.default.createElement("div",{className:"element-editor"},r.default.createElement(b.Provider,{value:d},r.default.createElement(e,{elementTypes:c,areaId:n}),r.default.createElement(t,{allowedElementTypes:c,elementTypes:o,areaId:n,onDragStart:this.handleDragStart,onDragEnd:this.handleDragEnd,dragging:s,sharedObject:i,elements:u,isLoading:l})))}}t.Component=y,y.propTypes={elementTypes:o.default.arrayOf(s.elementTypeType).isRequired,allowedElements:o.default.arrayOf(o.default.string).isRequired,areaId:o.default.number.isRequired,actions:o.default.shape({handleSortBlock:o.default.func})};const E=[(0,i.inject)(["ElementToolbar","ElementList"],((e,t)=>({ToolbarComponent:e,ListComponent:t})),(()=>"ElementEditor"))];t.default=(0,l.compose)((0,a.connect)(null,(function(e){return{actions:{toasts:(0,l.bindActionCreators)(f,e)}}})),...E)(y)},2512:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.Component=v,t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=h(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=g(n(6935)),a=n(455),i=n(9791),l=n(9367),s=n(5207),u=g(n(6923)),c=g(n(5815)),d=n(6733),f=n(3627),p=n(8831),m=n(1135);function g(e){return e&&e.__esModule?e:{default:e}}function h(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(h=function(e){return e?n:t})(e)}function v(e){let{elements:t,sharedObject:n,ElementComponent:o,HoverBarComponent:a,allowedElementTypes:i,elementTypes:l,areaId:s,onDragEnd:g,onDragStart:h,dragging:v,isLoading:b,LoadingComponent:y}=e;const[E,w]=(0,r.useState)(!1),[C,_]=(0,r.useState)(0),[O,x]=(0,r.useState)({}),[S,D]=(0,r.useState)({});n.setIncrement=_,n.setSaveAllElements=w;const T=(e,n)=>{const r={},o={};(t||[]).forEach((t=>{const a=parseInt(t.id,10);n?r[a]=!1:e.hasOwnProperty(a)?r[a]=e[a]:r[a]=!1,o[a]=null})),x(r),D(o)};(0,r.useEffect)((()=>{T({},!0)}),[]),(0,r.useEffect)((()=>{T(O,!1)}),[t]),(0,r.useEffect)((()=>{if(!t)return;if(!E)return;const e=t.map((e=>parseInt(e.id,10))).filter((e=>O[e]));let r=!0;for(let t=0;tS[e])),a={success:o,reason:o?"":"invalid"};n.entwineResolve(a),T(O,o),w(!1)}),[E,O]);const R=(0,d.useSensors)((0,d.useSensor)(d.PointerSensor,{activationConstraint:{distance:10}})),M=(0,u.default)("elemental-editor-list",{"elemental-editor-list--empty":!t||!t.length});return r.default.createElement("div",{className:M},b?r.default.createElement(y,null):null,(()=>{if(0===t.length)return r.default.createElement("div",null,c.default._t("ElementList.ADD_BLOCKS","Add blocks to place your content"));let e=t.map((e=>{const t=E&&O[e.id]&&null===S[e.id];return r.default.createElement(r.default.Fragment,null,r.default.createElement(o,{key:e.id,element:e,areaId:s,type:(0,m.getElementTypeConfig)(e,l),link:e.blockSchema.actions.edit,saveElement:t,onChangeHasUnsavedChanges:t=>((e,t)=>{x({...O,[e]:t})})(e.id,t),onBeforeSubmitForm:()=>{return t=e.id,void D({...S,[t]:null});var t},onAfterSubmitResponse:t=>((e,t)=>{x({...O,[e]:!t}),D({...S,[e]:t})})(e.id,t),increment:C}),!1===v&&r.default.createElement(a,{key:`create-after-${e.id}`,areaId:s,elementId:e.id,elementTypes:i}))}));return!1===v&&(e=[r.default.createElement(a,{key:0,areaId:s,elementId:0,elementTypes:i})].concat(e)),r.default.createElement(d.DndContext,{modifiers:[p.restrictToVerticalAxis,p.restrictToParentElement],sensors:R,collisionDetection:d.closestCenter,onDragStart:h,onDragEnd:g},r.default.createElement(f.SortableContext,{items:t.map((e=>e.id)),strategy:f.verticalListSortingStrategy},e))})())}v.propTypes={elements:o.default.arrayOf(a.elementType).isRequired,elementTypes:o.default.arrayOf(i.elementTypeType).isRequired,allowedElementTypes:o.default.arrayOf(i.elementTypeType).isRequired,areaId:o.default.number.isRequired,onDragStart:o.default.func,onDragEnd:o.default.func,dragging:o.default.oneOf([o.default.bool,o.default.number]),sharedObject:o.default.object.isRequired},v.defaultProps={sharedObject:{entwineResolve:()=>{},setState:null},elements:[],isLoading:!1};t.default=(0,l.compose)((0,s.inject)(["Element","Loading","HoverBar","DragPositionIndicator"],((e,t,n,r)=>({ElementComponent:e,LoadingComponent:t,HoverBarComponent:n,DragIndicatorComponent:r})),(()=>"ElementEditor.ElementList")))(v)},7651:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=p(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=f(n(6935)),a=n(3556),i=n(455),l=n(9791),s=n(9367),u=n(5207),c=f(n(5815)),d=f(n(6923));function f(e){return e&&e.__esModule?e:{default:e}}function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(p=function(e){return e?n:t})(e)}class m extends r.Component{constructor(e){super(e),this.toggle=this.toggle.bind(this),this.state={tooltipOpen:!1}}componentDidUpdate(){const{tooltipOpen:e}=this.state,{disableTooltip:t}=this.props;e&&t&&this.setState({tooltipOpen:!1})}getBlockTitle(e,t){return t.broken?c.default.inject(c.default._t("ElementHeader.BROKEN","This element is of obsolete type {type}."),{type:t.obsoleteClassName}):e.title?e.title:c.default.inject(c.default._t("ElementHeader.NOTITLE","Untitled {type} block"),{type:t.title})}toggle(){this.setState((e=>({tooltipOpen:!e.tooltipOpen})))}renderVersionedStateMessage(){const{element:{isLiveVersion:e,isPublished:t}}=this.props;if(t&&e)return null;let n="";const o=["element-editor-header__version-state"];return t?e||(n=c.default._t("ElementHeader.STATE_MODIFIED","Item has unpublished changes"),o.push("element-editor-header__version-state--modified")):(n=c.default._t("ElementHeader.STATE_DRAFT","Item has not been published yet"),o.push("element-editor-header__version-state--draft")),r.default.createElement("span",{className:(0,d.default)(o),title:n})}renderStatusFlagBadges(){const e=this.props.element.statusFlags;if(!e)return null;const t=[];for(let[n,o]of Object.entries(e))n=`badge status-${n}`,"string"==typeof o&&(o={text:o}),o.title||(o.title=""),t.push(r.default.createElement("span",{key:n,className:n,title:o.title},o.text));return t}render(){const{element:e,type:t,areaId:n,previewExpanded:o,simple:i,disableTooltip:l,activeTab:s,expandable:u,ElementActionsComponent:f,handleEditTabsClick:p}=this.props,m=this.getBlockTitle(e,t),g=(0,d.default)({"element-editor-header__title":!0,"element-editor-header__title--none":!e.title}),h=c.default._t("ElementHeader.EXPAND","Show editable fields"),v=(0,d.default)("element-editor-header",{"element-editor-header--simple":i}),b=(0,d.default)("element-editor-header__icon-container",{"element-editor-header__icon-container--broken":t.broken}),y=(0,d.default)("element-editor-header__expand",{"font-icon-right-open-big":!u,"font-icon-up-open-big":u&&o,"font-icon-down-open-big":u&&!o}),E=`element-icon-${e.id}`;return r.default.createElement("div",{className:v},r.default.createElement("div",{className:"element-editor-header__drag-handle"},r.default.createElement("i",{className:"font-icon-drag-handle"})),r.default.createElement("div",{className:"element-editor-header__info"},r.default.createElement("div",{className:b},r.default.createElement("i",{className:t.icon,id:E}),this.renderVersionedStateMessage(),!t.broken&&!i&&r.default.createElement(a.Tooltip,{placement:"top",isOpen:this.state.tooltipOpen&&!l,target:E,toggle:this.toggle},t.title)),r.default.createElement("h3",{className:g},m),this.renderStatusFlagBadges()),!i&&r.default.createElement("div",{className:"element-editor-header__actions"},r.default.createElement("div",{role:"none",onClick:e=>e.stopPropagation()},r.default.createElement(f,{element:e,type:t,areaId:n,activeTab:s,editTabs:t.editTabs,handleEditTabsClick:p,expandable:u})),!t.broken&&r.default.createElement("i",{className:y,title:h})))}}t.Component=m,m.propTypes={element:i.elementType.isRequired,type:l.elementTypeType.isRequired,areaId:o.default.number,activeTab:o.default.string,simple:o.default.bool,ElementActionsComponent:o.default.elementType,previewExpanded:o.default.bool,disableTooltip:o.default.bool},m.defaultProps={expandable:!0};t.default=(0,s.compose)((0,u.inject)(["ElementActions"],(e=>({ElementActionsComponent:e})),(()=>"ElementEditor.ElementList.Element")))(m)},8953:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=s(n(6935)),a=n(5207),i=n(9791),l=s(n(5815));function s(e){return e&&e.__esModule?e:{default:e}}function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}const c=(0,s(n(7577)).default)("element-editor__hover-bar");function d(e){let{AddElementPopoverComponent:t,elementTypes:n,elementId:o,areaId:a,popoverOpen:i,onToggle:s}=e;const u=`${c("-line")} font-icon-plus-circled`,d=l.default._t("ElementAddNewButton.ADD_BLOCK","Add block"),f={className:c("-area",{"-area--focus":i}),onClick:s,"aria-label":d,title:d,id:`AddBlockHoverBarArea_${a}_${o}`};return r.default.createElement("div",{className:c(""),id:`AddBlockHoverBar_${a}_${o}`},r.default.createElement("button",f,r.default.createElement("span",{className:c("-area-inner")},r.default.createElement("span",{className:u}))),r.default.createElement(t,{placement:"bottom",target:`AddBlockHoverBarArea_${a}_${o}`,isOpen:i,elementTypes:n,toggle:s,container:`#AddBlockHoverBar_${a}_${o}`,areaId:a,insertAfterElement:o}))}class f extends r.Component{constructor(e){super(e),this.toggle=this.toggle.bind(this),this.state={popoverOpen:!1}}toggle(){this.setState((e=>({popoverOpen:!e.popoverOpen})))}render(){const e={...this.state,...this.props,onToggle:this.toggle};return r.default.createElement(d,e)}}t.Component=f,f.propTypes={elementTypes:o.default.arrayOf(i.elementTypeType).isRequired,elementId:o.default.oneOfType([o.default.string,o.default.number]).isRequired,areaId:o.default.oneOfType([o.default.number,o.default.string]).isRequired};t.default=(0,a.inject)(["AddElementPopover"],(e=>({AddElementPopoverComponent:e})),(()=>"ElementEditor.ElementList.HoverBar"))(f)},7333:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=f(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=d(n(6935)),a=d(n(6923)),i=d(n(55)),l=n(7785),s=d(n(5815)),u=n(2153),c=n(9040);function d(e){return e&&e.__esModule?e:{default:e}}function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(f=function(e){return e?n:t})(e)}function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t{t.match(/PageElements_[0-9]+_Title/)&&(r=e[t])})),n().then((e=>this.props.onFormSchemaSubmitResponse(e,r)))}render(){const{elementId:e,extraClass:t,onClick:n,onFormInit:o,formHasState:s,notVisible:u}=this.props,{loadingError:c}=this.state,d=(0,a.default)("element-editor-editform",t),f={formTag:"form",schemaUrl:(0,l.loadElementSchemaValue)("schemaUrl",e),identifier:"element",refetchSchemaOnMount:!s,onLoadingError:this.handleLoadingError,onSubmit:this.handleSubmit};c&&(f.loading=!1),"function"==typeof o&&(f.onReduxFormInit=o);const m={};return u&&(m["aria-hidden"]="true"),r.default.createElement("div",p({className:d,onClick:n,role:"presentation"},m),r.default.createElement(i.default,f))}}m.propTypes={extraClass:o.default.oneOfType([o.default.string,o.default.object]),onClick:o.default.func,elementId:o.default.string,handleLoadingError:o.default.func,onFormSchemaSubmitResponse:o.default.func,notVisible:o.default.bool};t.default=(0,c.connect)((function(e,t){const n=(0,u.loadElementFormStateName)(t.elementId);return{formHasState:e.form.formState&&e.form.formState.element&&!!e.form.formState.element[n]}}))(m)},7660:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=l(n(6935)),a=l(n(6923)),i=l(n(5815));function l(e){return e&&e.__esModule?e:{default:e}}function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}class u extends r.PureComponent{render(){const{fileUrl:e,fileTitle:t,content:n,broken:o}=this.props,l=i.default._t("ElementSummary.NO_PREVIEW","No preview available"),s=(0,a.default)("element-editor-summary__content",{"element-editor-summary__content--broken":o});return r.default.createElement("div",{className:"element-editor-summary"},e&&r.default.createElement("img",{className:"element-editor-summary__thumbnail-image",src:e,alt:t}),(n||!e)&&r.default.createElement("p",{className:s},n||l))}}u.defaultProps={},u.propTypes={content:o.default.string,fileUrl:o.default.string,fileTitle:o.default.string,broken:o.default.bool};t.default=u},5563:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),a=(r=n(6935))&&r.__esModule?r:{default:r},i=n(5207),l=n(9791);function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}class u extends o.PureComponent{render(){const{AddNewButtonComponent:e,elementTypes:t,areaId:n}=this.props;return o.default.createElement("div",{className:"element-editor__toolbar"},o.default.createElement(e,{elementTypes:t,areaId:n}))}}u.defaultProps={},u.propTypes={elementTypes:a.default.arrayOf(l.elementTypeType).isRequired,areaId:a.default.number.isRequired,AddNewButtonComponent:a.default.elementType.isRequired,onDragDrop:a.default.func};t.default=(0,i.inject)(["ElementAddNewButton"],(e=>({AddNewButtonComponent:e})),(()=>"ElementEditor.ElementToolbar"))(u)},2977:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(1594)),o=i(n(5815)),a=i(n(6923));function i(e){return e&&e.__esModule?e:{default:e}}t.default=e=>class extends e{getClassName(){const e=[super.getClassName()];return this.props.data.ElementID&&e.unshift("elemental-area__element--historic-inner"),(0,a.default)(e)}render(){const e=this.getLegend(),t=this.props.data.tag||"div",n=this.getClassName(),{data:a}=this.props;return a.ElementID?r.default.createElement(t,{className:n},e,r.default.createElement("div",{className:"elemental-preview elemental-preview--historic"},a.ElementEditLink&&r.default.createElement("a",{className:"elemental-preview__link",href:a.ElementEditLink},r.default.createElement("span",{className:"elemental-preview__link-text"},o.default._t("HistoricElementView.VIEW_BLOCK_HISTORY","Block history")),r.default.createElement("i",{className:"font-icon-angle-right btn--icon-lg elemental-preview__link-caret"})),r.default.createElement("div",{className:"elemental-preview__icon"},r.default.createElement("i",{className:a.ElementIcon})),r.default.createElement("div",{className:"elemental-preview__detail"},r.default.createElement("h3",null,a.ElementTitle," ",r.default.createElement("small",null,a.ElementType)))),this.props.children):super.render()}}},6573:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(1594)),o=n(3556),a=i(n(2623));function i(e){return e&&e.__esModule?e:{default:e}}t.default=(0,a.default)((e=>{const{children:t}=e,n=r.default.Children.toArray(r.default.Children.map(t,((t,n)=>{const o={};return 0===n?(o.id=e.id,o.title=null):1===n&&(o.noHolder=!0),r.default.cloneElement(t,o)})));return e.readOnly?r.default.createElement("div",{className:"text-checkbox-group-field--read-only"},n):1===n.length?n[0]:r.default.createElement(o.InputGroup,{className:"text-checkbox-group-field"},n[0],r.default.createElement(o.InputGroupAddon,{addonType:"append"},r.default.createElement(o.InputGroupText,null,n[1])))}))},51:function(e,t,n){var r=u(n(1669)),o=u(n(1594)),a=n(5145),i=n(5207),l=n(1135),s=n(5381);function u(e){return e&&e.__esModule?e:{default:e}}const c=()=>{setTimeout((()=>{const{store:e}=window.ss;e&&e.dispatch((0,s.destroy)(...Object.keys(e.getState().form.formState.element||{}).map((e=>`element.${e}`))))}),0)};r.default.entwine("ss",(e=>{e(".js-injector-boot .element-editor__container").entwine({ReactRoot:null,AreaIDsSharedObject:{},Increment:0,onmatch(){const e=(0,i.loadComponent)("ElementEditor",{}),t=this.data("schema"),n=(0,l.getConfig)().elementTypes,r=t["elemental-area-id"],s=this.getAreaIDsSharedObject();s.hasOwnProperty(r)||(s[r]={entwineResolve:null,setIncrement:null,setSaveAllElements:null});const u={areaId:r,allowedElements:t["allowed-elements"],elementTypes:n,sharedObject:s[r]};let c=this.getReactRoot();c||(c=(0,a.createRoot)(this[0]),this.setReactRoot(c)),c.render(o.default.createElement(e,u))},onunmatch(){e(".cms-edit-form").data("hasValidationErrors")||c(),this.unmountComponent()},unmountComponent(){const e=this.getReactRoot();e&&(e.unmount(),this.setReactRoot(null))},"from .cms-edit-form":{onbeforesubmitform(e,t){if(!t||this.is(".elemental-area--read-only"))return;let n;const r=new Promise((e=>{n=e}));t.promises.push(r),t.onAjaxSuccessCallbacks.push(this.unmountComponent.bind(this));const o=this.data("schema")["elemental-area-id"],a=this.getAreaIDsSharedObject()[o],i=this.getIncrement()+1;this.setIncrement(i),a.entwineResolve=n,a.setIncrement(i),a.setSaveAllElements(!0)},onaftersubmitform(t,n){const r=JSON.parse(n.xhr.responseText).ValidationResult;JSON.parse(r.replace(/<\/?script[^>]*?>/g,"")).isValid?(e(".cms-edit-form").data("hasValidationErrors",!1),c()):e(".cms-edit-form").data("hasValidationErrors",!0)}}}),e(".js-injector-boot .element-editor__container .element-form-dirty-state").entwine({onmatch(){e(".cms-edit-form").trigger("change")},onunmatch(){e(".cms-edit-form").trigger("change")}}),e(".cms-edit-form").entwine({getChangeTrackerOptions(){const t=void 0===this.entwineData("ChangeTrackerOptions");let n=this._super();return t&&(n=e.extend({},n),n.ignoreFieldSelector+=", .elementalarea :input:not(.element-form-dirty-state)",this.setChangeTrackerOptions(n)),n}})}))},7577:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=(r=n(6923))&&r.__esModule?r:{default:r};t.default=e=>function(){const t=t=>`${e}${t}`;for(var n=arguments.length,r=new Array(n),a=0;a!(!e&&""!==e)&&("object"==typeof e?Array.isArray(e)?e.map(t):Object.entries(e).reduce(((e,n)=>{let[r,o]=n;return Object.assign({},e,{[t(r)]:o})}),{}):t(e))));return(0,o.default)(...i)}},1135:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.getElementTypeConfig=t.getConfig=void 0;var r,o=(r=n(6177))&&r.__esModule?r:{default:r};const a=()=>o.default.getSection("DNADesign\\Elemental\\Controllers\\ElementalAreaController");t.getConfig=a;t.getElementTypeConfig=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=e.blockSchema.typeName;let r=(Array.isArray(t)?t:a().elementTypes).find((e=>e.class===n||e.name===n));return e.obsoleteClassName&&(r=Object.assign({obsoleteClassName:e.obsoleteClassName},r),Object.preventExtensions(r)),r}},2153:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.loadElementFormStateName=void 0;var r,o=(r=n(6177))&&r.__esModule?r:{default:r};t.loadElementFormStateName=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const t=o.default.getSection("DNADesign\\Elemental\\Controllers\\ElementalAreaController").form.elementForm.formNameTemplate;return e?t.replace("{id}",e):t}},7785:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.loadElementSchemaValue=void 0;var r,o=(r=n(6177))&&r.__esModule?r:{default:r};t.loadElementSchemaValue=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=o.default.getSection("DNADesign\\Elemental\\Controllers\\ElementalAreaController").form.elementForm[e]||"";return t?`${n}/${t}`:n}},3337:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=l(n(1594)),o=l(n(5609)),a=n(1135),i=l(n(6177));function l(e){return e&&e.__esModule?e:{default:e}}t.default=e=>t=>{const n={...t};return n.hasOwnProperty("actions")||(n.actions={}),n.actions.revertToVersion=(e,t,n,r)=>{const l=`${(0,a.getConfig)().controllerLink.replace(/\/$/,"")}/api/revert`;return o.default.post(l,{id:e,fromVersion:t,fromStage:n,toStage:r},{"X-SecurityID":i.default.get("SecurityID")})},r.default.createElement(e,n)}},455:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.elementType=void 0;var r,o=(r=n(6935))&&r.__esModule?r:{default:r};t.elementType=o.default.shape({id:o.default.number,title:o.default.string,blockSchema:o.default.object,inlineEditable:o.default.bool,published:o.default.bool,liveVersion:o.default.bool,version:o.default.number})},9791:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.elementTypeType=void 0;var r,o=(r=n(6935))&&r.__esModule?r:{default:r};t.elementTypeType=o.default.shape({name:o.default.string,title:o.default.string,icon:o.default.string,inlineEditable:o.default.bool,editTabs:o.default.arrayOf(o.default.shape({title:o.default.string,name:o.default.string})),config:o.default.object})},5609:function(e){e.exports=Backend},6177:function(e){e.exports=Config},2623:function(e){e.exports=FieldHolder},55:function(e){e.exports=FormBuilderLoader},5207:function(e){e.exports=Injector},6935:function(e){e.exports=PropTypes},1594:function(e){e.exports=React},5145:function(e){e.exports=ReactDomClient},9040:function(e){e.exports=ReactRedux},3556:function(e){e.exports=Reactstrap},9367:function(e){e.exports=Redux},5381:function(e){e.exports=ReduxForm},5034:function(e){e.exports=TabsActions},8918:function(e){e.exports=ToastsActions},9077:function(e){e.exports=UnsavedFormsActions},6923:function(e){e.exports=classnames},4014:function(e){e.exports=getJsonErrorMessage},5815:function(e){e.exports=i18n},1669:function(e){e.exports=jQuery}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(51),n(2038)}(); \ No newline at end of file diff --git a/client/src/components/ElementEditor/ElementEditor.js b/client/src/components/ElementEditor/ElementEditor.js index 6bc8e2de..016e30fd 100644 --- a/client/src/components/ElementEditor/ElementEditor.js +++ b/client/src/components/ElementEditor/ElementEditor.js @@ -5,7 +5,6 @@ import { connect } from 'react-redux'; import { inject } from 'lib/Injector'; import { bindActionCreators, compose } from 'redux'; import { elementTypeType } from 'types/elementTypeType'; -import withDragDropContext from 'lib/withDragDropContext'; import backend from 'lib/Backend'; import Config from 'lib/Config'; import { getConfig } from 'state/editor/elementConfig'; @@ -186,7 +185,6 @@ ElementEditor.propTypes = { export { ElementEditor as Component }; const params = [ - withDragDropContext, inject( ['ElementToolbar', 'ElementList'], (ToolbarComponent, ListComponent) => ({