Repository: silverstripe/silverstripe-asset-admin
Pull request #1550: ENH Replace react-selectable with react-drag-to-select
Author: login: emteknetnz
Created: 2025-03-12T04:13:57Z | Merged: 2025-03-19T04:01:06Z

Issue https://github.com/silverstripe/silverstripe-asset-admin/issues/1528


Diff:
diff --git a/client/dist/js/bundle.js b/client/dist/js/bundle.js
index 7d79a1d20..1e97f0e3e 100644
--- a/client/dist/js/bundle.js
+++ b/client/dist/js/bundle.js
@@ -1 +1 @@
-!function(){var e={3375:function(e,t,n){"use strict";n.r(t),n.d(t,{AutoScrollActivator:function(){return Ee},DndContext:function(){return Xe},DragOverlay:function(){return vt},KeyboardCode:function(){return re},KeyboardSensor:function(){return de},MeasuringFrequency:function(){return Ie},MeasuringStrategy:function(){return Fe},MouseSensor:function(){return be},PointerSensor:function(){return ge},TouchSensor:function(){return _e},TraversalOrder:function(){return Se},applyModifiers:function(){return Ke},closestCenter:function(){return A},closestCorners:function(){return O},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 k},getFirstCollision:function(){return F},getScrollableAncestors:function(){return B},pointerWithin:function(){return P},rectIntersection:function(){return M},useDndContext:function(){return nt},useDndMonitor:function(){return c},useDraggable:function(){return tt},useDroppable:function(){return rt},useSensor:function(){return v},useSensors:function(){return b}});var o=n(1594),i=n.n(o),r=n(4518),l=n(4979);const s={display:"none"};function a(e){let{id:t,value:n}=e;return i().createElement("div",{id:t,style:s},n)}function u(e){let{id:t,announcement:n,ariaLiveType:o="assertive"}=e;return i().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":o,"aria-atomic":!0},n)}const d=(0,o.createContext)(null);function c(e){const t=(0,o.useContext)(d);(0,o.useEffect)((()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");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 h(e){let{announcements:t=p,container:n,hiddenTextDescribedById:s,screenReaderInstructions:d=f}=e;const{announce:h,announcement:g}=function(){const[e,t]=(0,o.useState)("");return{announce:(0,o.useCallback)((e=>{null!=e&&t(e)}),[]),announcement:e}}(),m=(0,l.YG)("DndLiveRegion"),[v,b]=(0,o.useState)(!1);if((0,o.useEffect)((()=>{b(!0)}),[]),c((0,o.useMemo)((()=>({onDragStart(e){let{active:n}=e;h(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:o}=e;t.onDragMove&&h(t.onDragMove({active:n,over:o}))},onDragOver(e){let{active:n,over:o}=e;h(t.onDragOver({active:n,over:o}))},onDragEnd(e){let{active:n,over:o}=e;h(t.onDragEnd({active:n,over:o}))},onDragCancel(e){let{active:n,over:o}=e;h(t.onDragCancel({active:n,over:o}))}})),[h,t])),!v)return null;const y=i().createElement(i().Fragment,null,i().createElement(a,{id:s,value:d.draggable}),i().createElement(u,{id:m,announcement:g}));return n?(0,r.createPortal)(y,n):y}var g;function m(){}function v(e,t){return(0,o.useMemo)((()=>({sensor:e,options:null!=t?t:{}})),[e,t])}function b(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,o.useMemo)((()=>[...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,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function E(e,t){const n=(0,l.e_)(e);if(!n)return"0 0";return(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%"}function S(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return n-o}function C(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return o-n}function w(e){let{left:t,top:n,height:o,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+o},{x:t+i,y:n+o}]}function F(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}function I(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 A=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const i=I(t,t.left,t.top),r=[];for(const e of o){const{id:t}=e,o=n.get(t);if(o){const n=_(I(o),i);r.push({id:t,data:{droppableContainer:e,value:n}})}}return r.sort(S)},O=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const i=w(t),r=[];for(const e of o){const{id:t}=e,o=n.get(t);if(o){const n=w(o),l=i.reduce(((e,t,o)=>e+_(n[o],t)),0),s=Number((l/4).toFixed(4));r.push({id:t,data:{droppableContainer:e,value:s}})}}return r.sort(S)};function R(e,t){const n=Math.max(t.top,e.top),o=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),r=Math.min(t.top+t.height,e.top+e.height),l=i-o,s=r-n;if(o<i&&n<r){const n=t.width*t.height,o=e.width*e.height,i=l*s;return Number((i/(n+o-i)).toFixed(4))}return 0}const M=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const i=[];for(const e of o){const{id:o}=e,r=n.get(o);if(r){const n=R(r,t);n>0&&i.push({id:o,data:{droppableContainer:e,value:n}})}}return i.sort(C)};function D(e,t){const{top:n,left:o,bottom:i,right:r}=t;return n<=e.y&&e.y<=i&&o<=e.x&&e.x<=r}const P=e=>{let{droppableContainers:t,droppableRects:n,pointerCoordinates:o}=e;if(!o)return[];const i=[];for(const e of t){const{id:t}=e,r=n.get(t);if(r&&D(o,r)){const n=w(r).reduce(((e,t)=>e+_(o,t)),0),l=Number((n/4).toFixed(4));i.push({id:t,data:{droppableContainer:e,value:l}})}}return i.sort(S)};function x(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:y}function L(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return o.reduce(((t,n)=>({...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 T=L(1);function U(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 N={ignoreTransform:!1};function k(e,t){void 0===t&&(t=N);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:o}=(0,l.zk)(e).getComputedStyle(e);t&&(n=function(e,t,n){const o=U(t);if(!o)return e;const{scaleX:i,scaleY:r,x:l,y:s}=o,a=e.left-l-(1-i)*parseFloat(n),u=e.top-s-(1-r)*parseFloat(n.slice(n.indexOf(" ")+1)),d=i?e.width/i:e.width,c=r?e.height/r:e.height;return{width:d,height:c,top:u,right:a+d,bottom:u+c,left:a}}(n,t,o))}const{top:o,left:i,width:r,height:s,bottom:a,right:u}=n;return{top:o,left:i,width:r,height:s,bottom:a,right:u}}function j(e){return k(e,{ignoreTransform:!0})}function B(e,t){const n=[];return e?function o(i){if(null!=t&&n.length>=t)return n;if(!i)return n;if((0,l.wz)(i)&&null!=i.scrollingElement&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!(0,l.sb)(i)||(0,l.xZ)(i))return n;if(n.includes(i))return n;const r=(0,l.zk)(e).getComputedStyle(i);return i!==e&&function(e,t){void 0===t&&(t=(0,l.zk)(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((e=>{const o=t[e];return"string"==typeof o&&n.test(o)}))}(i,r)&&n.push(i),function(e,t){return void 0===t&&(t=(0,l.zk)(e).getComputedStyle(e)),"fixed"===t.position}(i,r)?n:o(i.parentNode)}(e):n}function z(e){const[t]=B(e,1);return null!=t?t:null}function V(e){return l.Sw&&e?(0,l.l6)(e)?e:(0,l.Ll)(e)?(0,l.wz)(e)||e===(0,l.TW)(e).scrollingElement?window:(0,l.sb)(e)?e:null:null:null}function H(e){return(0,l.l6)(e)?e.scrollX:e.scrollLeft}function q(e){return(0,l.l6)(e)?e.scrollY:e.scrollTop}function G(e){return{x:H(e),y:q(e)}}var W;function $(e){return!(!l.Sw||!e)&&e===document.scrollingElement}function K(e){const t={x:0,y:0},n=$(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},o={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=o.y,isRight:e.scrollLeft>=o.x,maxScroll:o,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(W||(W={}));const Q={x:.2,y:.2};function Y(e,t,n,o,i){let{top:r,left:l,right:s,bottom:a}=n;void 0===o&&(o=10),void 0===i&&(i=Q);const{isTop:u,isBottom:d,isLeft:c,isRight:f}=K(e),p={x:0,y:0},h={x:0,y:0},g=t.height*i.y,m=t.width*i.x;return!u&&r<=t.top+g?(p.y=W.Backward,h.y=o*Math.abs((t.top+g-r)/g)):!d&&a>=t.bottom-g&&(p.y=W.Forward,h.y=o*Math.abs((t.bottom-g-a)/g)),!f&&s>=t.right-m?(p.x=W.Forward,h.x=o*Math.abs((t.right-m-s)/m)):!c&&l<=t.left+m&&(p.x=W.Backward,h.x=o*Math.abs((t.left+m-l)/m)),{direction:p,speed:h}}function X(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:o,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:o,bottom:i,width:e.clientWidth,height:e.clientHeight}}function Z(e){return e.reduce(((e,t)=>(0,l.WQ)(e,G(t))),y)}function J(e,t){if(void 0===t&&(t=k),!e)return;const{top:n,left:o,bottom:i,right:r}=t(e);z(e)&&(i<=0||r<=0||n>=window.innerHeight||o>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const ee=[["x",["left","right"],function(e){return e.reduce(((e,t)=>e+H(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),o=Z(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,i]of ee)for(const r of t)Object.defineProperty(this,r,{get:()=>{const t=i(n),l=o[e]-t;return this.rect[r]+l},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 o;null==(o=this.target)||o.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function oe(e,t){const n=Math.abs(e.x),o=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+o**2)>t:"x"in t&&"y"in t?n>t.x&&o>t.y:"x"in t?n>t.x:"y"in t&&o>t.y}var ie,re;function le(e){e.preventDefault()}function se(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"}(ie||(ie={})),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"}(re||(re={}));const ae={start:[re.Space,re.Enter],cancel:[re.Esc],end:[re.Space,re.Enter,re.Tab]},ue=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case re.Right:return{...n,x:n.x+25};case re.Left:return{...n,x:n.x-25};case re.Down:return{...n,y:n.y+25};case re.Up:return{...n,y:n.y-25}}};class de{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,l.TW)(t)),this.windowListeners=new ne((0,l.zk)(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(ie.Resize,this.handleCancel),this.windowListeners.add(ie.VisibilityChange,this.handleCancel),setTimeout((()=>this.listeners.add(ie.Keydown,this.handleKeyDown)))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&J(n),t(y)}handleKeyDown(e){if((0,l.kx)(e)){const{active:t,context:n,options:o}=this.props,{keyboardCodes:i=ae,coordinateGetter:r=ue,scrollBehavior:s="smooth"}=o,{code:a}=e;if(i.end.includes(a))return void this.handleEnd(e);if(i.cancel.includes(a))return void this.handleCancel(e);const{collisionRect:u}=n.current,d=u?{x:u.left,y:u.top}:y;this.referenceCoordinates||(this.referenceCoordinates=d);const c=r(e,{active:t,context:n.current,currentCoordinates:d});if(c){const t=(0,l.Re)(c,d),o={x:0,y:0},{scrollableAncestors:i}=n.current;for(const n of i){const i=e.code,{isTop:r,isRight:l,isLeft:a,isBottom:u,maxScroll:d,minScroll:f}=K(n),p=X(n),h={x:Math.min(i===re.Right?p.right-p.width/2:p.right,Math.max(i===re.Right?p.left:p.left+p.width/2,c.x)),y:Math.min(i===re.Down?p.bottom-p.height/2:p.bottom,Math.max(i===re.Down?p.top:p.top+p.height/2,c.y))},g=i===re.Right&&!l||i===re.Left&&!a,m=i===re.Down&&!u||i===re.Up&&!r;if(g&&h.x!==c.x){const e=n.scrollLeft+t.x,r=i===re.Right&&e<=d.x||i===re.Left&&e>=f.x;if(r&&!t.y)return void n.scrollTo({left:e,behavior:s});o.x=r?n.scrollLeft-e:i===re.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,o.x&&n.scrollBy({left:-o.x,behavior:s});break}if(m&&h.y!==c.y){const e=n.scrollTop+t.y,r=i===re.Down&&e<=d.y||i===re.Up&&e>=f.y;if(r&&!t.x)return void n.scrollTo({top:e,behavior:s});o.y=r?n.scrollTop-e:i===re.Down?n.scrollTop-d.y:n.scrollTop-f.y,o.y&&n.scrollBy({top:-o.y,behavior:s});break}}this.handleMove(e,(0,l.WQ)((0,l.Re)(c,this.referenceCoordinates),o))}}}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 ce(e){return Boolean(e&&"distance"in e)}function fe(e){return Boolean(e&&"delay"in e)}de.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:o=ae,onActivation:i}=t,{active:r}=n;const{code:l}=e.nativeEvent;if(o.start.includes(l)){const t=r.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==i||i({event:e.nativeEvent}),!0)}return!1}}];class pe{constructor(e,t,n){var o;void 0===n&&(n=function(e){const{EventTarget:t}=(0,l.zk)(e);return e instanceof t?e:(0,l.TW)(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:i}=e,{target:r}=i;this.props=e,this.events=t,this.document=(0,l.TW)(r),this.documentListeners=new ne(this.document),this.listeners=new ne(n),this.windowListeners=new ne((0,l.zk)(r)),this.initialCoordinates=null!=(o=(0,l.e_)(i))?o: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(ie.Resize,this.handleCancel),this.windowListeners.add(ie.DragStart,le),this.windowListeners.add(ie.VisibilityChange,this.handleCancel),this.windowListeners.add(ie.ContextMenu,le),this.documentListeners.add(ie.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(ce(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:o}=this.props;o(n,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(ie.Click,se,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(ie.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:o,props:i}=this,{onMove:r,options:{activationConstraint:s}}=i;if(!o)return;const a=null!=(t=(0,l.e_)(e))?t:y,u=(0,l.Re)(o,a);if(!n&&s){if(ce(s)){if(null!=s.tolerance&&oe(u,s.tolerance))return this.handleCancel();if(oe(u,s.distance))return this.handleStart()}return fe(s)&&oe(u,s.tolerance)?this.handleCancel():void this.handlePending(s,u)}e.cancelable&&e.preventDefault(),r(a)}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===re.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const he={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ge extends pe{constructor(e){const{event:t}=e,n=(0,l.TW)(t.target);super(e,he,n)}}ge.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return!(!n.isPrimary||0!==n.button)&&(null==o||o({event:n}),!0)}}];const me={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,me,(0,l.TW)(e.event.target))}}be.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return n.button!==ve.RightClick&&(null==o||o({event:n}),!0)}}];const ye={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class _e 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 Ee,Se;function Ce(e){let{acceleration:t,activator:n=Ee.Pointer,canScroll:i,draggingRect:r,enabled:s,interval:a=5,order:u=Se.TreeOrder,pointerCoordinates:d,scrollableAncestors:c,scrollableAncestorRects:f,delta:p,threshold:h}=e;const g=function(e){let{delta:t,disabled:n}=e;const o=(0,l.ZC)(t);return(0,l.KG)((e=>{if(n||!o||!e)return we;const i={x:Math.sign(t.x-o.x),y:Math.sign(t.y-o.y)};return{x:{[W.Backward]:e.x[W.Backward]||-1===i.x,[W.Forward]:e.x[W.Forward]||1===i.x},y:{[W.Backward]:e.y[W.Backward]||-1===i.y,[W.Forward]:e.y[W.Forward]||1===i.y}}}),[n,t,o])}({delta:p,disabled:!s}),[m,v]=(0,l.$$)(),b=(0,o.useRef)({x:0,y:0}),y=(0,o.useRef)({x:0,y:0}),_=(0,o.useMemo)((()=>{switch(n){case Ee.Pointer:return d?{top:d.y,bottom:d.y,left:d.x,right:d.x}:null;case Ee.DraggableRect:return r}}),[n,r,d]),E=(0,o.useRef)(null),S=(0,o.useCallback)((()=>{const e=E.current;if(!e)return;const t=b.current.x*y.current.x,n=b.current.y*y.current.y;e.scrollBy(t,n)}),[]),C=(0,o.useMemo)((()=>u===Se.TreeOrder?[...c].reverse():c),[u,c]);(0,o.useEffect)((()=>{if(s&&c.length&&_){for(const e of C){if(!1===(null==i?void 0:i(e)))continue;const n=c.indexOf(e),o=f[n];if(!o)continue;const{direction:r,speed:l}=Y(e,o,_,t,h);for(const e of["x","y"])g[e][r[e]]||(l[e]=0,r[e]=0);if(l.x>0||l.y>0)return v(),E.current=e,m(S,a),b.current=l,void(y.current=r)}b.current={x:0,y:0},y.current={x:0,y:0},v()}else v()}),[t,S,i,v,s,a,JSON.stringify(_),JSON.stringify(g),m,c,C,f,JSON.stringify(h)])}_e.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;const{touches:i}=n;return!(i.length>1)&&(null==o||o({event:n}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(Ee||(Ee={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(Se||(Se={}));const we={x:{[W.Backward]:!1,[W.Forward]:!1},y:{[W.Backward]:!1,[W.Forward]:!1}};var Fe,Ie;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(Fe||(Fe={})),function(e){e.Optimized="optimized"}(Ie||(Ie={}));const Ae=new Map;function Oe(e,t){return(0,l.KG)((n=>e?n||("function"==typeof t?t(e):e):null),[t,e])}function Re(e){let{callback:t,disabled:n}=e;const i=(0,l._q)(t),r=(0,o.useMemo)((()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(i)}),[n]);return(0,o.useEffect)((()=>()=>null==r?void 0:r.disconnect()),[r]),r}function Me(e){return new te(k(e),e)}function De(e,t,n){void 0===t&&(t=Me);const[i,r]=(0,o.useState)(null);function s(){r((o=>{if(!e)return null;var i;if(!1===e.isConnected)return null!=(i=null!=o?o:n)?i:null;const r=t(e);return JSON.stringify(o)===JSON.stringify(r)?o:r}))}const a=function(e){let{callback:t,disabled:n}=e;const i=(0,l._q)(t),r=(0,o.useMemo)((()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(i)}),[i,n]);return(0,o.useEffect)((()=>()=>null==r?void 0:r.disconnect()),[r]),r}({callback(t){if(e)for(const n of t){const{type:t,target:o}=n;if("childList"===t&&o instanceof HTMLElement&&o.contains(e)){s();break}}}}),u=Re({callback:s});return(0,l.Es)((()=>{s(),e?(null==u||u.observe(e),null==a||a.observe(document.body,{childList:!0,subtree:!0})):(null==u||u.disconnect(),null==a||a.disconnect())}),[e]),i}const Pe=[];function xe(e,t){void 0===t&&(t=[]);const n=(0,o.useRef)(null);return(0,o.useEffect)((()=>{n.current=null}),t),(0,o.useEffect)((()=>{const t=e!==y;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)}),[e]),n.current?(0,l.Re)(e,n.current):y}function Le(e){return(0,o.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 Te=[];function Ue(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return(0,l.sb)(t)?t:e}const Ne=[{sensor:ge,options:{}},{sensor:de,options:{}}],ke={current:{}},je={draggable:{measure:j},droppable:{measure:j,strategy:Fe.WhileDragging,frequency:Ie.Optimized},dragOverlay:{measure:k}};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 ze={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:m},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:je,measureDroppableContainers:m,windowRect:null,measuringScheduled:!1},Ve={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:m,draggableNodes:new Map,over:null,measureDroppableContainers:m},He=(0,o.createContext)(Ve),qe=(0,o.createContext)(ze);function Ge(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Be}}}function We(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:o}=n,i=new Be(e.droppable.containers);return i.set(o,n),{...e,droppable:{...e.droppable,containers:i}}}case g.SetDroppableDisabled:{const{id:n,key:o,disabled:i}=t,r=e.droppable.containers.get(n);if(!r||o!==r.key)return e;const l=new Be(e.droppable.containers);return l.set(n,{...r,disabled:i}),{...e,droppable:{...e.droppable,containers:l}}}case g.UnregisterDroppable:{const{id:n,key:o}=t,i=e.droppable.containers.get(n);if(!i||o!==i.key)return e;const r=new Be(e.droppable.containers);return r.delete(n),{...e,droppable:{...e.droppable,containers:r}}}default:return e}}function $e(e){let{disabled:t}=e;const{active:n,activatorEvent:i,draggableNodes:r}=(0,o.useContext)(He),s=(0,l.ZC)(i),a=(0,l.ZC)(null==n?void 0:n.id);return(0,o.useEffect)((()=>{if(!t&&!i&&s&&null!=a){if(!(0,l.kx)(s))return;if(document.activeElement===s.target)return;const e=r.get(a);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,l.ag)(e);if(t){t.focus();break}}}))}}),[i,t,r,a,s]),null}function Ke(e,t){let{transform:n,...o}=t;return null!=e&&e.length?e.reduce(((e,t)=>t({transform:e,...o})),n):n}const Qe=(0,o.createContext)({...y,scaleX:1,scaleY:1});var Ye;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(Ye||(Ye={}));const Xe=(0,o.memo)((function(e){var t,n,s,a;let{id:u,accessibility:c,autoScroll:f=!0,children:p,sensors:m=Ne,collisionDetection:v=M,measuring:b,modifiers:_,...E}=e;const S=(0,o.useReducer)(We,void 0,Ge),[C,w]=S,[I,A]=function(){const[e]=(0,o.useState)((()=>new Set)),t=(0,o.useCallback)((t=>(e.add(t),()=>e.delete(t))),[e]);return[(0,o.useCallback)((t=>{let{type:n,event:o}=t;e.forEach((e=>{var t;return null==(t=e[n])?void 0:t.call(e,o)}))}),[e]),t]}(),[O,R]=(0,o.useState)(Ye.Uninitialized),D=O===Ye.Initialized,{draggable:{active:P,nodes:L,translate:U},droppable:{containers:N}}=C,j=null!=P?L.get(P):null,H=(0,o.useRef)({initial:null,translated:null}),q=(0,o.useMemo)((()=>{var e;return null!=P?{id:P,data:null!=(e=null==j?void 0:j.data)?e:ke,rect:H}:null}),[P,j]),W=(0,o.useRef)(null),[K,Q]=(0,o.useState)(null),[Y,X]=(0,o.useState)(null),J=(0,l.YN)(E,Object.values(E)),ee=(0,l.YG)("DndDescribedBy",u),ne=(0,o.useMemo)((()=>N.getEnabled()),[N]),oe=(ie=b,(0,o.useMemo)((()=>({draggable:{...je.draggable,...null==ie?void 0:ie.draggable},droppable:{...je.droppable,...null==ie?void 0:ie.droppable},dragOverlay:{...je.dragOverlay,...null==ie?void 0:ie.dragOverlay}})),[null==ie?void 0:ie.draggable,null==ie?void 0:ie.droppable,null==ie?void 0:ie.dragOverlay]));var ie;const{droppableRects:re,measureDroppableContainers:le,measuringScheduled:se}=function(e,t){let{dragging:n,dependencies:i,config:r}=t;const[s,a]=(0,o.useState)(null),{frequency:u,measure:d,strategy:c}=r,f=(0,o.useRef)(e),p=function(){switch(c){case Fe.Always:return!1;case Fe.BeforeDragging:return n;default:return!n}}(),h=(0,l.YN)(p),g=(0,o.useCallback)((function(e){void 0===e&&(e=[]),h.current||a((t=>null===t?e:t.concat(e.filter((e=>!t.includes(e))))))}),[h]),m=(0,o.useRef)(null),v=(0,l.KG)((t=>{if(p&&!n)return Ae;if(!t||t===Ae||f.current!==e||null!=s){const t=new Map;for(let n of e){if(!n)continue;if(s&&s.length>0&&!s.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,o=e?new te(d(e),e):null;n.rect.current=o,o&&t.set(n.id,o)}return t}return t}),[e,s,n,p,d]);return(0,o.useEffect)((()=>{f.current=e}),[e]),(0,o.useEffect)((()=>{p||g()}),[n,p]),(0,o.useEffect)((()=>{s&&s.length>0&&a(null)}),[JSON.stringify(s)]),(0,o.useEffect)((()=>{p||"number"!=typeof u||null!==m.current||(m.current=setTimeout((()=>{g(),m.current=null}),u))}),[u,p,g,...i]),{droppableRects:v,measureDroppableContainers:g,measuringScheduled:null!=s}}(ne,{dragging:D,dependencies:[U.x,U.y],config:oe.droppable}),ae=function(e,t){const n=null!=t?e.get(t):void 0,o=n?n.node.current:null;return(0,l.KG)((e=>{var n;return null==t?null:null!=(n=null!=o?o:e)?n:null}),[o,t])}(L,P),ue=(0,o.useMemo)((()=>Y?(0,l.e_)(Y):null),[Y]),de=function(){const e=!1===(null==K?void 0:K.autoScrollEnabled),t="object"==typeof f?!1===f.enabled:!1===f,n=D&&!e&&!t;if("object"==typeof f)return{...f,enabled:n};return{enabled:n}}(),ce=function(e,t){return Oe(e,t)}(ae,oe.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:i,config:r=!0}=e;const s=(0,o.useRef)(!1),{x:a,y:u}="boolean"==typeof r?{x:r,y:r}:r;(0,l.Es)((()=>{if(!a&&!u||!t)return void(s.current=!1);if(s.current||!i)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const o=x(n(e),i);if(a||(o.x=0),u||(o.y=0),s.current=!0,Math.abs(o.x)>0||Math.abs(o.y)>0){const t=z(e);t&&t.scrollBy({top:o.y,left:o.x})}}),[t,a,u,i,n])}({activeNode:null!=P?L.get(P):null,config:de.layoutShiftCompensation,initialRect:ce,measure:oe.draggable.measure});const fe=De(ae,oe.draggable.measure,ce),pe=De(ae?ae.parentElement:null),he=(0,o.useRef)({activatorEvent:null,active:null,activeNode:ae,collisionRect:null,collisions:null,droppableRects:re,draggableNodes:L,draggingNode:null,draggingNodeRect:null,droppableContainers:N,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ge=N.getNodeFor(null==(t=he.current.over)?void 0:t.id),me=function(e){let{measure:t}=e;const[n,i]=(0,o.useState)(null),r=Re({callback:(0,o.useCallback)((e=>{for(const{target:n}of e)if((0,l.sb)(n)){i((e=>{const o=t(n);return e?{...e,width:o.width,height:o.height}:o}));break}}),[t])}),s=(0,o.useCallback)((e=>{const n=Ue(e);null==r||r.disconnect(),n&&(null==r||r.observe(n)),i(n?t(n):null)}),[t,r]),[a,u]=(0,l.lk)(s);return(0,o.useMemo)((()=>({nodeRef:a,rect:n,setRef:u})),[n,a,u])}({measure:oe.dragOverlay.measure}),ve=null!=(n=me.nodeRef.current)?n:ae,be=D?null!=(s=me.rect)?s:fe:null,ye=Boolean(me.nodeRef.current&&me.rect),_e=x(Ee=ye?null:fe,Oe(Ee));var Ee;const Se=Le(ve?(0,l.zk)(ve):null),we=function(e){const t=(0,o.useRef)(e),n=(0,l.KG)((n=>e?n&&n!==Pe&&e&&t.current&&e.parentNode===t.current.parentNode?n:B(e):Pe),[e]);return(0,o.useEffect)((()=>{t.current=e}),[e]),n}(D?null!=ge?ge:ae:null),Ie=function(e,t){void 0===t&&(t=k);const[n]=e,i=Le(n?(0,l.zk)(n):null),[r,s]=(0,o.useState)(Te);function a(){s((()=>e.length?e.map((e=>$(e)?i:new te(t(e),e))):Te))}const u=Re({callback:a});return(0,l.Es)((()=>{null==u||u.disconnect(),a(),e.forEach((e=>null==u?void 0:u.observe(e)))}),[e]),r}(we),Me=Ke(_,{transform:{x:U.x-_e.x,y:U.y-_e.y,scaleX:1,scaleY:1},activatorEvent:Y,active:q,activeNodeRect:fe,containerNodeRect:pe,draggingNodeRect:be,over:he.current.over,overlayNodeRect:me.rect,scrollableAncestors:we,scrollableAncestorRects:Ie,windowRect:Se}),Be=ue?(0,l.WQ)(ue,U):null,ze=function(e){const[t,n]=(0,o.useState)(null),i=(0,o.useRef)(e),r=(0,o.useCallback)((e=>{const t=V(e.target);t&&n((e=>e?(e.set(t,G(t)),new Map(e)):null))}),[]);return(0,o.useEffect)((()=>{const t=i.current;if(e!==t){o(t);const l=e.map((e=>{const t=V(e);return t?(t.addEventListener("scroll",r,{passive:!0}),[t,G(t)]):null})).filter((e=>null!=e));n(l.length?new Map(l):null),i.current=e}return()=>{o(e),o(t)};function o(e){e.forEach((e=>{const t=V(e);null==t||t.removeEventListener("scroll",r)}))}}),[r,e]),(0,o.useMemo)((()=>e.length?t?Array.from(t.values()).reduce(((e,t)=>(0,l.WQ)(e,t)),y):Z(e):y),[e,t])}(we),Ve=xe(ze),Xe=xe(ze,[fe]),Ze=(0,l.WQ)(Me,Ve),Je=be?T(be,Me):null,et=q&&Je?v({active:q,collisionRect:Je,droppableRects:re,droppableContainers:ne,pointerCoordinates:Be}):null,tt=F(et,"id"),[nt,ot]=(0,o.useState)(null),it=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,l.WQ)(Me,Xe),null!=(a=null==nt?void 0:nt.rect)?a:null,fe),rt=(0,o.useRef)(null),lt=(0,o.useCallback)(((e,t)=>{let{sensor:n,options:o}=t;if(null==W.current)return;const i=L.get(W.current);if(!i)return;const l=e.nativeEvent,s=new n({active:W.current,activeNode:i,event:l,options:o,context:he,onAbort(e){if(!L.get(e))return;const{onDragAbort:t}=J.current,n={id:e};null==t||t(n),I({type:"onDragAbort",event:n})},onPending(e,t,n,o){if(!L.get(e))return;const{onDragPending:i}=J.current,r={id:e,constraint:t,initialCoordinates:n,offset:o};null==i||i(r),I({type:"onDragPending",event:r})},onStart(e){const t=W.current;if(null==t)return;const n=L.get(t);if(!n)return;const{onDragStart:o}=J.current,i={activatorEvent:l,active:{id:t,data:n.data,rect:H}};(0,r.unstable_batchedUpdates)((()=>{null==o||o(i),R(Ye.Initializing),w({type:g.DragStart,initialCoordinates:e,active:t}),I({type:"onDragStart",event:i}),Q(rt.current),X(l)}))},onMove(e){w({type:g.DragMove,coordinates:e})},onEnd:a(g.DragEnd),onCancel:a(g.DragCancel)});function a(e){return async function(){const{active:t,collisions:n,over:o,scrollAdjustedTranslate:i}=he.current;let s=null;if(t&&i){const{cancelDrop:r}=J.current;if(s={activatorEvent:l,active:t,collisions:n,delta:i,over:o},e===g.DragEnd&&"function"==typeof r){await Promise.resolve(r(s))&&(e=g.DragCancel)}}W.current=null,(0,r.unstable_batchedUpdates)((()=>{w({type:e}),R(Ye.Uninitialized),ot(null),Q(null),X(null),rt.current=null;const t=e===g.DragEnd?"onDragEnd":"onDragCancel";if(s){const e=J.current[t];null==e||e(s),I({type:t,event:s})}}))}}rt.current=s}),[L]),st=(0,o.useCallback)(((e,t)=>(n,o)=>{const i=n.nativeEvent,r=L.get(o);if(null!==W.current||!r||i.dndKit||i.defaultPrevented)return;const l={active:r};!0===e(n,t.options,l)&&(i.dndKit={capturedBy:t.sensor},W.current=o,lt(n,t))}),[L,lt]),at=function(e,t){return(0,o.useMemo)((()=>e.reduce(((e,n)=>{const{sensor:o}=n;return[...e,...o.activators.map((e=>({eventName:e.eventName,handler:t(e.handler,n)})))]}),[])),[e,t])}(m,st);!function(e){(0,o.useEffect)((()=>{if(!l.Sw)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})))}(m),(0,l.Es)((()=>{fe&&O===Ye.Initializing&&R(Ye.Initialized)}),[fe,O]),(0,o.useEffect)((()=>{const{onDragMove:e}=J.current,{active:t,activatorEvent:n,collisions:o,over:i}=he.current;if(!t||!n)return;const l={active:t,activatorEvent:n,collisions:o,delta:{x:Ze.x,y:Ze.y},over:i};(0,r.unstable_batchedUpdates)((()=>{null==e||e(l),I({type:"onDragMove",event:l})}))}),[Ze.x,Ze.y]),(0,o.useEffect)((()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:o,scrollAdjustedTranslate:i}=he.current;if(!e||null==W.current||!t||!i)return;const{onDragOver:l}=J.current,s=o.get(tt),a=s&&s.rect.current?{id:s.id,rect:s.rect.current,data:s.data,disabled:s.disabled}:null,u={active:e,activatorEvent:t,collisions:n,delta:{x:i.x,y:i.y},over:a};(0,r.unstable_batchedUpdates)((()=>{ot(a),null==l||l(u),I({type:"onDragOver",event:u})}))}),[tt]),(0,l.Es)((()=>{he.current={activatorEvent:Y,active:q,activeNode:ae,collisionRect:Je,collisions:et,droppableRects:re,draggableNodes:L,draggingNode:ve,draggingNodeRect:be,droppableContainers:N,over:nt,scrollableAncestors:we,scrollAdjustedTranslate:Ze},H.current={initial:be,translated:Je}}),[q,ae,et,Je,L,ve,be,re,N,nt,we,Ze]),Ce({...de,delta:U,draggingRect:Je,pointerCoordinates:Be,scrollableAncestors:we,scrollableAncestorRects:Ie});const ut=(0,o.useMemo)((()=>({active:q,activeNode:ae,activeNodeRect:fe,activatorEvent:Y,collisions:et,containerNodeRect:pe,dragOverlay:me,draggableNodes:L,droppableContainers:N,droppableRects:re,over:nt,measureDroppableContainers:le,scrollableAncestors:we,scrollableAncestorRects:Ie,measuringConfiguration:oe,measuringScheduled:se,windowRect:Se})),[q,ae,fe,Y,et,pe,me,L,N,re,nt,le,we,Ie,oe,se,Se]),dt=(0,o.useMemo)((()=>({activatorEvent:Y,activators:at,active:q,activeNodeRect:fe,ariaDescribedById:{draggable:ee},dispatch:w,draggableNodes:L,over:nt,measureDroppableContainers:le})),[Y,at,q,fe,w,ee,L,nt,le]);return i().createElement(d.Provider,{value:A},i().createElement(He.Provider,{value:dt},i().createElement(qe.Provider,{value:ut},i().createElement(Qe.Provider,{value:it},p)),i().createElement($e,{disabled:!1===(null==c?void 0:c.restoreFocus)})),i().createElement(h,{...c,hiddenTextDescribedById:ee}))})),Ze=(0,o.createContext)(null),Je="button",et="Draggable";function tt(e){let{id:t,data:n,disabled:i=!1,attributes:r}=e;const s=(0,l.YG)(et),{activators:a,activatorEvent:u,active:d,activeNodeRect:c,ariaDescribedById:f,draggableNodes:p,over:h}=(0,o.useContext)(He),{role:g=Je,roleDescription:m="draggable",tabIndex:v=0}=null!=r?r:{},b=(null==d?void 0:d.id)===t,y=(0,o.useContext)(b?Qe:Ze),[_,E]=(0,l.lk)(),[S,C]=(0,l.lk)(),w=function(e,t){return(0,o.useMemo)((()=>e.reduce(((e,n)=>{let{eventName:o,handler:i}=n;return e[o]=e=>{i(e,t)},e}),{})),[e,t])}(a,t),F=(0,l.YN)(n);(0,l.Es)((()=>(p.set(t,{id:t,key:s,node:_,activatorNode:S,data:F}),()=>{const e=p.get(t);e&&e.key===s&&p.delete(t)})),[p,t]);return{active:d,activatorEvent:u,activeNodeRect:c,attributes:(0,o.useMemo)((()=>({role:g,tabIndex:v,"aria-disabled":i,"aria-pressed":!(!b||g!==Je)||void 0,"aria-roledescription":m,"aria-describedby":f.draggable})),[i,g,v,b,m,f.draggable]),isDragging:b,listeners:i?void 0:w,node:_,over:h,setNodeRef:E,setActivatorNodeRef:C,transform:y}}function nt(){return(0,o.useContext)(qe)}const ot="Droppable",it={timeout:25};function rt(e){let{data:t,disabled:n=!1,id:i,resizeObserverConfig:r}=e;const s=(0,l.YG)(ot),{active:a,dispatch:u,over:d,measureDroppableContainers:c}=(0,o.useContext)(He),f=(0,o.useRef)({disabled:n}),p=(0,o.useRef)(!1),h=(0,o.useRef)(null),m=(0,o.useRef)(null),{disabled:v,updateMeasurementsFor:b,timeout:y}={...it,...r},_=(0,l.YN)(null!=b?b:i),E=Re({callback:(0,o.useCallback)((()=>{p.current?(null!=m.current&&clearTimeout(m.current),m.current=setTimeout((()=>{c(Array.isArray(_.current)?_.current:[_.current]),m.current=null}),y)):p.current=!0}),[y]),disabled:v||!a}),S=(0,o.useCallback)(((e,t)=>{E&&(t&&(E.unobserve(t),p.current=!1),e&&E.observe(e))}),[E]),[C,w]=(0,l.lk)(S),F=(0,l.YN)(t);return(0,o.useEffect)((()=>{E&&C.current&&(E.disconnect(),p.current=!1,E.observe(C.current))}),[C,E]),(0,o.useEffect)((()=>(u({type:g.RegisterDroppable,element:{id:i,key:s,disabled:n,node:C,rect:h,data:F}}),()=>u({type:g.UnregisterDroppable,key:s,id:i}))),[i]),(0,o.useEffect)((()=>{n!==f.current.disabled&&(u({type:g.SetDroppableDisabled,id:i,key:s,disabled:n}),f.current.disabled=n)}),[i,s,n,u]),{active:a,rect:h,isOver:(null==d?void 0:d.id)===i,node:C,over:d,setNodeRef:w}}function lt(e){let{animation:t,children:n}=e;const[r,s]=(0,o.useState)(null),[a,u]=(0,o.useState)(null),d=(0,l.ZC)(n);return n||r||!d||s(d),(0,l.Es)((()=>{if(!a)return;const e=null==r?void 0:r.key,n=null==r?void 0:r.props.id;null!=e&&null!=n?Promise.resolve(t(n,a)).then((()=>{s(null)})):s(null)}),[t,r,a]),i().createElement(i().Fragment,null,n,r?(0,o.cloneElement)(r,{ref:u}):null)}const st={x:0,y:0,scaleX:1,scaleY:1};function at(e){let{children:t}=e;return i().createElement(He.Provider,{value:Ve},i().createElement(Qe.Provider,{value:st},t))}const ut={position:"fixed",touchAction:"none"},dt=e=>(0,l.kx)(e)?"transform 250ms ease":void 0,ct=(0,o.forwardRef)(((e,t)=>{let{as:n,activatorEvent:o,adjustScale:r,children:s,className:a,rect:u,style:d,transform:c,transition:f=dt}=e;if(!u)return null;const p=r?c:{...c,scaleX:1,scaleY:1},h={...ut,width:u.width,height:u.height,top:u.top,left:u.left,transform:l.Ks.Transform.toString(p),transformOrigin:r&&o?E(o,u):void 0,transition:"function"==typeof f?f(o):f,...d};return i().createElement(n,{className:a,style:h,ref:t},s)})),ft=e=>t=>{let{active:n,dragOverlay:o}=t;const i={},{styles:r,className:l}=e;if(null!=r&&r.active)for(const[e,t]of Object.entries(r.active))void 0!==t&&(i[e]=n.node.style.getPropertyValue(e),n.node.style.setProperty(e,t));if(null!=r&&r.dragOverlay)for(const[e,t]of Object.entries(r.dragOverlay))void 0!==t&&o.node.style.setProperty(e,t);return null!=l&&l.active&&n.node.classList.add(l.active),null!=l&&l.dragOverlay&&o.node.classList.add(l.dragOverlay),function(){for(const[e,t]of Object.entries(i))n.node.style.setProperty(e,t);null!=l&&l.active&&n.node.classList.remove(l.active)}},pt={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:l.Ks.Transform.toString(t)},{transform:l.Ks.Transform.toString(n)}]},sideEffects:ft({styles:{active:{opacity:"0"}}})};function ht(e){let{config:t,draggableNodes:n,droppableContainers:o,measuringConfiguration:i}=e;return(0,l._q)(((e,r)=>{if(null===t)return;const s=n.get(e);if(!s)return;const a=s.node.current;if(!a)return;const u=Ue(r);if(!u)return;const{transform:d}=(0,l.zk)(r).getComputedStyle(r),c=U(d);if(!c)return;const f="function"==typeof t?t:function(e){const{duration:t,easing:n,sideEffects:o,keyframes:i}={...pt,...e};return e=>{let{active:r,dragOverlay:l,transform:s,...a}=e;if(!t)return;const u={x:l.rect.left-r.rect.left,y:l.rect.top-r.rect.top},d={scaleX:1!==s.scaleX?r.rect.width*s.scaleX/l.rect.width:1,scaleY:1!==s.scaleY?r.rect.height*s.scaleY/l.rect.height:1},c={x:s.x-u.x,y:s.y-u.y,...d},f=i({...a,active:r,dragOverlay:l,transform:{initial:s,final:c}}),[p]=f,h=f[f.length-1];if(JSON.stringify(p)===JSON.stringify(h))return;const g=null==o?void 0:o({active:r,dragOverlay:l,...a}),m=l.node.animate(f,{duration:t,easing:n,fill:"forwards"});return new Promise((e=>{m.onfinish=()=>{null==g||g(),e()}}))}}(t);return J(a,i.draggable.measure),f({active:{id:e,data:s.data,node:a,rect:i.draggable.measure(a)},draggableNodes:n,dragOverlay:{node:r,rect:i.dragOverlay.measure(u)},droppableContainers:o,measuringConfiguration:i,transform:c})}))}let gt=0;function mt(e){return(0,o.useMemo)((()=>{if(null!=e)return gt++,gt}),[e])}const vt=i().memo((e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:l,transition:s,modifiers:a,wrapperElement:u="div",className:d,zIndex:c=999}=e;const{activatorEvent:f,active:p,activeNodeRect:h,containerNodeRect:g,draggableNodes:m,droppableContainers:v,dragOverlay:b,over:y,measuringConfiguration:_,scrollableAncestors:E,scrollableAncestorRects:S,windowRect:C}=nt(),w=(0,o.useContext)(Qe),F=mt(null==p?void 0:p.id),I=Ke(a,{activatorEvent:f,active:p,activeNodeRect:h,containerNodeRect:g,draggingNodeRect:b.rect,over:y,overlayNodeRect:b.rect,scrollableAncestors:E,scrollableAncestorRects:S,transform:w,windowRect:C}),A=Oe(h),O=ht({config:r,draggableNodes:m,droppableContainers:v,measuringConfiguration:_}),R=A?b.setRef:void 0;return i().createElement(at,null,i().createElement(lt,{animation:O},p&&F?i().createElement(ct,{key:F,id:p.id,ref:R,as:u,activatorEvent:f,adjustScale:t,className:d,transition:s,rect:A,style:{zIndex:c,...l},transform:I},n):null))}))},8831:function(e,t,n){"use strict";n.r(t),n.d(t,{createSnapModifier:function(){return i},restrictToFirstScrollableAncestor:function(){return a},restrictToHorizontalAxis:function(){return r},restrictToParentElement:function(){return s},restrictToVerticalAxis:function(){return u},restrictToWindowEdges:function(){return d},snapCenterToCursor:function(){return c}});var o=n(4979);function i(e){return t=>{let{transform:n}=t;return{...n,x:Math.ceil(n.x/e)*e,y:Math.ceil(n.y/e)*e}}}const r=e=>{let{transform:t}=e;return{...t,y:0}};function l(e,t,n){const o={...e};return t.top+e.y<=n.top?o.y=n.top-t.top:t.bottom+e.y>=n.top+n.height&&(o.y=n.top+n.height-t.bottom),t.left+e.x<=n.left?o.x=n.left-t.left:t.right+e.x>=n.left+n.width&&(o.x=n.left+n.width-t.right),o}const s=e=>{let{containerNodeRect:t,draggingNodeRect:n,transform:o}=e;return n&&t?l(o,n,t):o},a=e=>{let{draggingNodeRect:t,transform:n,scrollableAncestorRects:o}=e;const i=o[0];return t&&i?l(n,t,i):n},u=e=>{let{transform:t}=e;return{...t,x:0}},d=e=>{let{transform:t,draggingNodeRect:n,windowRect:o}=e;return n&&o?l(t,n,o):t},c=e=>{let{activatorEvent:t,draggingNodeRect:n,transform:i}=e;if(n&&t){const e=(0,o.e_)(t);if(!e)return i;const r=e.x-n.left,l=e.y-n.top;return{...i,x:i.x+r-n.width/2,y:i.y+l-n.height/2}}return i}},4979:function(e,t,n){"use strict";n.d(t,{$$:function(){return h},Es:function(){return f},KG:function(){return m},Ks:function(){return I},Ll:function(){return l},Re:function(){return C},Sw:function(){return i},TW:function(){return c},WQ:function(){return S},YG:function(){return _},YN:function(){return g},ZC:function(){return b},_q:function(){return p},ag:function(){return O},e_:function(){return F},kx:function(){return w},l6:function(){return r},lk:function(){return v},sb:function(){return u},wz:function(){return a},xZ:function(){return d},zk:function(){return s}});var o=n(1594);const i="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function r(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?r(e)?e:l(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function a(e){const{Document:t}=s(e);return e instanceof t}function u(e){return!r(e)&&e instanceof s(e).HTMLElement}function d(e){return e instanceof s(e).SVGElement}function c(e){return e?r(e)?e.document:l(e)?a(e)?e:u(e)||d(e)?e.ownerDocument:document:document:document}const f=i?o.useLayoutEffect:o.useEffect;function p(e){const t=(0,o.useRef)(e);return f((()=>{t.current=e})),(0,o.useCallback)((function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return null==t.current?void 0:t.current(...n)}),[])}function h(){const e=(0,o.useRef)(null);return[(0,o.useCallback)(((t,n)=>{e.current=setInterval(t,n)}),[]),(0,o.useCallback)((()=>{null!==e.current&&(clearInterval(e.current),e.current=null)}),[])]}function g(e,t){void 0===t&&(t=[e]);const n=(0,o.useRef)(e);return f((()=>{n.current!==e&&(n.current=e)}),t),n}function m(e,t){const n=(0,o.useRef)();return(0,o.useMemo)((()=>{const t=e(n.current);return n.current=t,t}),[...t])}function v(e){const t=p(e),n=(0,o.useRef)(null),i=(0,o.useCallback)((e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e}),[]);return[n,i]}function b(e){const t=(0,o.useRef)();return(0,o.useEffect)((()=>{t.current=e}),[e]),t.current}let y={};function _(e,t){return(0,o.useMemo)((()=>{if(t)return t;const n=null==y[e]?0:y[e]+1;return y[e]=n,e+"-"+n}),[e,t])}function E(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return o.reduce(((t,n)=>{const o=Object.entries(n);for(const[n,i]of o){const o=t[n];null!=o&&(t[n]=o+e*i)}return t}),{...t})}}const S=E(1),C=E(-1);function w(e){if(!e)return!1;const{KeyboardEvent:t}=s(e.target);return t&&e instanceof t}function F(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=s(e.target);return t&&e instanceof t}(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 function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const I=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[I.Translate.toString(e),I.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:o}=e;return t+" "+n+"ms "+o}}}),A="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function O(e){return e.matches(A)?e:e.querySelector(A)}},9588:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=l(n(5207)),i=l(n(1991)),r=l(n(315));function l(e){return e&&e.__esModule?e:{default:e}}t.default=()=>{o.default.transform("move-form-disabled",(e=>{e.component("TreeDropdownField.AssetAdmin.MoveForm",r.default)})),o.default.transform("owner-unpublishing",(e=>{e.component("FormAction.AssetAdmin.EditForm.action_unpublish",i.default)}))}},2038:function(e,t,n){"use strict";var o=d(n(6177)),i=d(n(6194)),r=d(n(4736)),l=d(n(9588)),s=d(n(420)),a=d(n(4121)),u=n(5125);function d(e){return e&&e.__esModule?e:{default:e}}document.addEventListener("DOMContentLoaded",(()=>{(0,a.default)(),(0,l.default)();const e=o.default.getSection("SilverStripe\\AssetAdmin\\Controller\\AssetAdmin").reactRoutePath;i.default.add({path:"/",routes:[{path:(0,u.joinUrlPaths)(e,"show/:folderId/:viewAction/:fileId"),component:r.default},{path:(0,u.joinUrlPaths)(e,"show/:folderId/:viewAction"),component:r.default},{path:(0,u.joinUrlPaths)(e,"show/:folderId"),component:r.default},{path:e,component:r.default}]}),(0,s.default)()}))},4121:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=p(n(5207)),i=p(n(9725)),r=p(n(3058)),l=p(n(853)),s=p(n(6931)),a=p(n(3517)),u=p(n(2397)),d=p(n(9005)),c=p(n(6493)),f=n(1037);function p(e){return e&&e.__esModule?e:{default:e}}t.default=()=>{o.default.component.registerMany({UploadField:i.default,UploadFieldItem:r.default,PreviewImageField:a.default,HistoryList:d.default,ProportionConstraintField:u.default,AssetDropzone:l.default,InsertMediaModal:s.default,GalleryToolbar:c.default,GalleryItemFile:f.File,GalleryItemFolder:f.Folder})}},420:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=p(n(5207)),i=n(9367),r=p(n(8518)),l=p(n(8310)),s=p(n(2726)),a=p(n(7668)),u=p(n(5214)),d=p(n(2482)),c=p(n(9266)),f=p(n(8178));function p(e){return e&&e.__esModule?e:{default:e}}t.default=()=>{o.default.reducer.register("assetAdmin",(0,i.combineReducers)({gallery:r.default,queuedFiles:l.default,uploadField:s.default,previewField:a.default,imageLoad:u.default,displaySearch:d.default,confirmDeletion:c.default,modal:f.default}))}},853:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var 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=d(t);if(n&&n.has(e))return n.get(e);var o={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&{}.hasOwnProperty.call(e,r)){var l=i?Object.getOwnPropertyDescriptor(e,r):null;l&&(l.get||l.set)?Object.defineProperty(o,r,l):o[r]=e[r]}return o.default=e,n&&n.set(e,o),o}(n(1594)),i=u(n(5815)),r=u(n(4600)),l=u(n(1669)),s=n(5716),a=u(n(6935));function u(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)}let c=0;class f extends o.Component{constructor(e){super(e),this.dropzone=null,this.dragging=!1,this.handleAccept=this.handleAccept.bind(this),this.handleAddedFile=this.handleAddedFile.bind(this),this.handleDragEnter=this.handleDragEnter.bind(this),this.handleDragLeave=this.handleDragLeave.bind(this),this.handleDrop=this.handleDrop.bind(this),this.handleUploadProgress=this.handleUploadProgress.bind(this),this.handleUploadComplete=this.handleUploadComplete.bind(this),this.handleError=this.handleError.bind(this),this.handleSending=this.handleSending.bind(this),this.handleSuccess=this.handleSuccess.bind(this),this.handleQueueComplete=this.handleQueueComplete.bind(this),this.loadImage=this.loadImage.bind(this),this.handleMaxFilesExceeded=this.handleMaxFilesExceeded.bind(this)}componentDidMount(){this.dropzone=new r.default(this.dropzoneRef,Object.assign({},this.getDefaultOptions(),this.props.options));const{name:e}=this.props;e&&this.dropzone.hiddenFileInput&&this.dropzone.hiddenFileInput.classList.add(`dz-input-${e}`),void 0!==this.props.promptOnRemove&&this.setPromptOnRemove(this.props.promptOnRemove)}componentDidUpdate(e){const{name:t}=this.props;t&&this.dropzone.hiddenFileInput&&this.dropzone.hiddenFileInput.classList.add(`dz-input-${t}`),this.props.canUpload&&e.options!==this.props.options&&this.dropzone&&(this.dropzone.enable(),this.dropzone.options=Object.assign({},this.getDefaultOptions(),this.dropzone.options,this.props.options))}componentWillUnmount(){this.dropzone.files=[],this.dropzone.destroy()}getDefaultOptions(){let e=null,t=this.props.uploadSelector;if(!t&&this.props.uploadButton&&(t=".asset-dropzone__upload-button"),t){const n=(0,l.default)(this.dropzoneRef).find(t);n&&n.length&&(e=n.toArray())}return{accept:this.handleAccept,addedfile:this.handleAddedFile,dragenter:this.handleDragEnter,dragleave:this.handleDragLeave,drop:this.handleDrop,maxfilesexceeded:this.handleMaxFilesExceeded,uploadprogress:this.handleUploadProgress,complete:this.handleUploadComplete,dictDefaultMessage:i.default._t("AssetAdmin.DROPZONE_DEFAULT_MESSAGE","Drop files here to upload"),dictFallbackMessage:i.default._t("AssetAdmin.DROPZONE_FALLBACK_MESSAGE","Your browser does not support drag'n'drop file uploads."),dictFallbackText:i.default._t("AssetAdmin.DROPZONE_FALLBACK_TEXT","Please use the fallback form below to upload your files like in the olden days."),dictInvalidFileType:i.default._t("AssetAdmin.DROPZONE_INVALID_FILE_TYPE","You can't upload files of this type."),dictResponseError:i.default._t("AssetAdmin.DROPZONE_RESPONSE_ERROR","Server responded with an error."),dictCancelUpload:i.default._t("AssetAdmin.DROPZONE_CANCEL_UPLOAD","Cancel upload"),dictCancelUploadConfirmation:i.default._t("AssetAdmin.DROPZONE_CANCEL_UPLOAD_CONFIRMATION","Are you sure you want to cancel this upload?"),dictRemoveFile:i.default._t("AssetAdmin.DROPZONE_REMOVE_FILE","Remove file"),dictMaxFilesExceeded:i.default._t("AssetAdmin.DROPZONE_MAX_FILES_EXCEEDED","You can not upload any more files."),error:this.handleError,sending:this.handleSending,success:this.handleSuccess,queuecomplete:this.handleQueueComplete,thumbnailHeight:150,thumbnailWidth:200,timeout:0,clickable:e}}getFileCategory(e){return e.split("/")[0]}getLoadPreview(e){return new Promise((t=>{const n=new FileReader;n.onload=n=>{if("image"===this.getFileCategory(e.type)){const e=new Image;t(this.loadImage(e,n.target.result))}else t({})},n.readAsDataURL(e)}))}getFileTitle(e){return e.replace(/[.][^.]+$/,"").replace(/-_/," ")}setPromptOnRemove(e){this.dropzone.options.dictRemoveFileConfirmation=e}handleDragEnter(e){this.props.canUpload&&(this.dragging=!0,this.forceUpdate(),"function"==typeof this.props.onDragEnter&&this.props.onDragEnter(e))}handleDragLeave(e){const t=this.dropzoneRef;this.props.canUpload&&e.target===t&&(this.dragging=!1,this.forceUpdate(),"function"==typeof this.props.onDragLeave&&this.props.onDragLeave(e,t))}handleUploadProgress(e,t,n){"function"==typeof this.props.onUploadProgress&&this.props.onUploadProgress(e,t,n)}handleUploadComplete(e){"function"==typeof this.props.onUploadComplete&&this.props.onUploadComplete(e.status)}handleDrop(e){this.dragging=!1,this.forceUpdate(),"function"==typeof this.props.onDrop&&this.props.onDrop(e)}handleSending(e,t,n){"function"==typeof this.props.updateFormData&&this.props.updateFormData(n),n.append("SecurityID",this.props.securityID),n.append("ParentID",this.props.folderId);const o=Object.assign({},t,{abort:()=>{this.dropzone.cancelUpload(e),t.abort()}});"function"==typeof this.props.onSending&&this.props.onSending(e,o,n)}handleMaxFilesExceeded(e){return"function"!=typeof this.props.onMaxFilesExceeded||this.props.onMaxFilesExceeded(e)}generateQueuedId(){return c+=1,c}handleAccept(e,t){return("function"!=typeof this.props.canFileUpload||this.props.canFileUpload(e))&&this.props.canUpload?t():t(i.default._t("AssetAdmin.DROPZONE_CANNOT_UPLOAD","Uploading not permitted."))}handleAddedFile(e){e._queuedId=this.generateQueuedId();const t={category:this.getFileCategory(e.type),filename:e.name,queuedId:e._queuedId,size:e.size,title:this.getFileTitle(e.name),extension:(0,s.getFileExtension)(e.name),type:e.type,uploadedToFolderId:this.props.folderId};this.props.onAddedFile(t);return this.getLoadPreview(e).then((e=>{const n={height:e.height,width:e.width,url:e.thumbnailURL,thumbnail:e.thumbnailURL,smallThumbnail:e.thumbnailURL};return"function"==typeof this.props.onPreviewLoaded&&this.props.onPreviewLoaded(t,n),{...t,...n}}))}loadImage(e,t){return new Promise((n=>{const o=document.createElement("canvas"),i=o.getContext("2d");e.onload=()=>{const t=2*this.props.preview.width,r=2*this.props.preview.height,l=e.naturalWidth/e.naturalHeight;e.naturalWidth<t||e.naturalHeight<r?(o.width=e.naturalWidth,o.height=e.naturalHeight):l<1?(o.width=t,o.height=t/l):(o.width=r*l,o.height=r),i.drawImage(e,0,0,o.width,o.height);const s=o.toDataURL("image/png");n({width:e.naturalWidth,height:e.naturalHeight,thumbnailURL:s})},e.src=t}))}handleError(e,t){this.dropzone.removeFile(e),this.props.onError(e,t)}handleSuccess(e){this.dropzone.removeFile(e),this.props.onSuccess(e)}handleQueueComplete(){this.props.onQueueComplete&&this.props.onQueueComplete()}render(){const e=["asset-dropzone"];this.props.className&&e.push(this.props.className);const t={className:"asset-dropzone__upload-button ss-ui-button font-icon-upload",type:"button"};return this.props.canUpload||(t.disabled=!0),!0===this.dragging&&e.push("dragging"),o.default.createElement("div",{className:e.join(" "),ref:e=>{this.dropzoneRef=e}},this.props.uploadButton&&o.default.createElement("button",t,i.default._t("AssetAdmin.DROPZONE_UPLOAD")),this.props.children)}}f.propTypes={folderId:a.default.number.isRequired,onAccept:a.default.func,onAddedFile:a.default.func.isRequired,onDragEnter:a.default.func,onDragLeave:a.default.func,onDrop:a.default.func,onError:a.default.func.isRequired,onPreviewLoaded:a.default.func,onSending:a.default.func,onSuccess:a.default.func.isRequired,onMaxFilesExceeded:a.default.func,updateFormData:a.default.func,canFileUpload:a.default.func,onQueueComplete:a.default.func,options:a.default.shape({url:a.default.string.isRequired}),promptOnRemove:a.default.string,securityID:a.default.string.isRequired,uploadButton:a.default.bool,uploadSelector:a.default.string,canUpload:a.default.bool.isRequired,preview:a.default.shape({width:a.default.number,height:a.default.number}),className:a.default.string},f.defaultProps={uploadButton:!0};t.default=f},7153:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var 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=u(t);if(n&&n.has(e))return n.get(e);var o={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&{}.hasOwnProperty.call(e,r)){var l=i?Object.getOwnPropertyDescriptor(e,r):null;l&&(l.get||l.set)?Object.defineProperty(o,r,l):o[r]=e[r]}return o.default=e,n&&n.set(e,o),o}(n(1594)),i=a(n(6935)),r=a(n(2932)),l=a(n(2926)),s=a(n(5815));function a(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)}class d extends o.Component{render(){const{isDropping:e,badge:t,onClick:n}=this.props,i=["btn","btn-secondary","btn--no-text","font-icon-level-up","btn--icon-large","gallery__back"];e&&(i.push("z-depth-1"),i.push("gallery__back--droppable-hover"));const r=t?o.default.createElement(l.default,{className:"gallery__back-badge",status:t.status,message:t.message}):null;return o.default.createElement("button",{className:i.join(" "),title:s.default._t("AssetAdmin.BACK_DESCRIPTION","Navigate up a level"),onClick:n},r)}}t.Component=d,d.propTypes={onClick:i.default.func,isDropping:i.default.bool,badge:i.default.shape(l.default.propTypes)};t.default=(0,r.default)(d)},3229:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var o=c(n(5815)),i=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 o={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&{}.hasOwnProperty.call(e,r)){var l=i?Object.getOwnPropertyDescriptor(e,r):null;l&&(l.get||l.set)?Object.defineProperty(o,r,l):o[r]=e[r]}return o.default=e,n&&n.set(e,o),o}(n(1594)),r=n(9040),l=n(5207),s=n(3556),a=c(n(6923)),u=c(n(6935));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)}function c(e){return e&&e.__esModule?e:{default:e}}class f extends i.Component{constructor(e){super(e),this.handleChangeValue=this.handleChangeValue.bind(this),this.renderChild=this.renderChild.bind(this)}getOptionByValue(e){return this.props.actions.find((t=>t.value===e))}handleChangeValue(e){let t=null;const n=this.getOptionByValue(e.target.value);return null===n?null:(t="function"==typeof n.confirm?n.confirm(this.props.items).then((()=>n.callback(e,this.props.items))).catch((e=>{if("cancelled"!==e)throw e})):n.callback(e,this.props.items)||Promise.resolve(),t)}renderChild(e,t){const n=(0,a.default)("bulk-actions__action",e.className||"font-icon-info-circled",{btn:t<2,"bulk-actions__action--more":t>2});return t<2?i.default.createElement(s.Button,{className:n,key:e.value,onClick:this.handleChangeValue,value:e.value,color:e.color},e.label):i.default.createElement(s.DropdownItem,{type:"button",className:n,key:e.value,onClick:this.handleChangeValue,value:e.value},e.label)}render(){if(!this.props.items.length)return null;let e=this.props.actions.filter((e=>!e.canApply||e.canApply(this.props.items)));if(e=e.map(this.renderChild),!e.length)return null;const{ActionMenu:t,showCount:n}=this.props,r=o.default._t("AssetAdmin.BULK_ACTIONS_SELECT_ALL","Select all"),l=o.default.sprintf(o.default._t("AssetAdmin.BULK_ACTIONS_SELECTED","%s selected"),this.props.items.length),a=o.default._t("AssetAdmin.BULK_ACTIONS_CLEAR_SELECTION","Clear selection");return i.default.createElement("div",{className:"bulk-actions fieldholder-small"},n&&i.default.createElement(i.default.Fragment,null,i.default.createElement(s.Button,{className:"bulk-actions-counter font-icon-cross-mark",onClick:this.props.onClearSelection,title:a},l),i.default.createElement("div",{className:"bulk-actions-select-all"},i.default.createElement(s.Button,{onClick:this.props.onSelectAll},r))),e.slice(0,2),e.length>2&&t?i.default.createElement(t,{id:"BulkActions",className:"bulk-actions__more-actions-menu"},e.slice(2)):e.slice(2))}}t.Component=f,f.propTypes={items:u.default.array,actions:u.default.arrayOf(u.default.shape({value:u.default.string.isRequired,label:u.default.string.isRequired,className:u.default.string,destructive:u.default.bool,callback:u.default.func,canApply:u.default.func,confirm:u.default.func})),ActionMenu:u.default.elementType,showCount:u.default.bool,onClearSelection:u.default.func.isRequired,onSelectAll:u.default.func.isRequired},f.defaultProps={items:[],actions:[],ActionMenu:null,total:null,showCount:!0,totalReachedMessage:o.default._t("")};const p=(0,r.connect)((function(e){return{gallery:e.assetAdmin.gallery}}))(f);t.default=(0,l.inject)(["ActionMenu"],(e=>({ActionMenu:e})),(()=>"BulkActions"))(p)},1037:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Folder=t.File=t.Component=void 0;var o=E(n(5815)),i=_(n(1594)),r=E(n(6923)),l=E(n(6379)),s=E(n(6022)),a=E(n(2063)),u=E(n(2932)),d=E(n(2926)),c=E(n(1990)),f=E(n(4350)),p=n(9040),h=n(9367),g=n(4172),m=_(n(769)),v=E(n(1838)),b=E(n(6935));function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(y=function(e){return e?n:t})(e)}function _(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=y(t);if(n&&n.has(e))return n.get(e);var o={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&{}.hasOwnProperty.call(e,r)){var l=i?Object.getOwnPropertyDescriptor(e,r):null;l&&(l.get||l.set)?Object.defineProperty(o,r,l):o[r]=e[r]}return o.default=e,n&&n.set(e,o),o}function E(e){return e&&e.__esModule?e:{default:e}}function S(){return S=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},S.apply(null,arguments)}function C(e){return e.item.thumbnail&&"image"===e.item.category&&e.item.exists&&!e.item.queuedId&&e.sectionConfig.imageRetry.minRetry&&e.sectionConfig.imageRetry.maxRetry}const w=e=>{e.preventDefault()};class F extends i.Component{constructor(e){super(e),this.handleSelect=this.handleSelect.bind(this),this.handleActivate=this.handleActivate.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancelUpload=this.handleCancelUpload.bind(this)}componentDidUpdate(){C(this.props)&&this.props.actions.imageLoad.loadImage(this.props.item.thumbnail,this.props.sectionConfig.imageRetry)}getThumbnailStyles(){const{item:{thumbnail:e,version:t},bustCache:n}=this.props;if(!this.isImage()||!e||this.missing())return{};const o=!1===n||!t||e.startsWith("data:image/")?e:`${e}?vid=${t}`;switch(this.props.loadState){case v.default.SUCCESS:case v.default.DISABLED:return{backgroundImage:`url(${o})`};default:return{}}}getErrorMessage(){let e=null;const{item:t,loadState:n}=this.props;if(this.hasError()?e=t.message.value:this.missing()?e=o.default._t("AssetAdmin.FILE_MISSING","File cannot be found"):n===v.default.FAILED&&(e=o.default._t("AssetAdmin.FILE_LOAD_ERROR","Thumbnail not available")),null!==e){return e=this.getItemFunction("updateErrorMessage")(e,this.props),i.default.createElement("span",{className:"gallery-item__error-message"},e)}return null}getThumbnailClassNames(){const e=["gallery-item__thumbnail"];switch(this.isImageSmallerThanThumbnail()&&e.push("gallery-item__thumbnail--small"),!this.props.item.thumbnail&&this.isImage()&&e.push("gallery-item__thumbnail--no-preview"),"folder"===this.props.item.type&&e.push("gallery-item__thumbnail--folder"),this.props.loadState){case v.default.LOADING:case v.default.WAITING:e.push("gallery-item__thumbnail--loading");break;case v.default.FAILED:e.push("gallery-item__thumbnail--error")}return e.join(" ")}getItemClassNames(){const e=this.props.item.category||"false",t=this.props.selectable&&(this.props.item.selected||this.props.isDragging);return(0,r.default)({"gallery-item":!0,[`gallery-item--${e}`]:!0,"gallery-item--max-selected":this.props.maxSelected&&!t,"gallery-item--missing":this.missing(),"gallery-item--selectable":this.props.selectable,"gallery-item--selected":t,"gallery-item--dropping":this.props.isDropping,"gallery-item--highlighted":this.props.item.highlighted,"gallery-item--error":this.hasError(),"gallery-item--dragging":this.props.isDragging})}getItemFunction(e){const{item:t}=this.props;return"function"==typeof t[e]?t[e]:this.props[e]}getStatusFlags(){let e=[];const{item:t}=this.props;"folder"!==t.type&&(t.draft?e.push({key:"status-draft",title:o.default._t("File.DRAFT","Draft"),className:"gallery-item--draft"}):t.modified&&e.push({key:"status-modified",title:o.default._t("File.MODIFIED","Modified"),className:"gallery-item--modified"}));return e=this.getItemFunction("updateStatusFlags")(e,this.props),i.default.createElement("div",{className:"gallery-item__status-flags"},e.map((e=>i.default.createElement("span",e))))}getStatusIcons(){const{item:e}=this.props,t=[];return e.hasRestrictedAccess&&t.push({key:"status-restricted",fileID:e.id,hasRestrictedAccess:!0,placement:"top",disableTooltip:"folder"===e.type,includeBackground:"folder"!==e.type}),e.isTrackedFormUpload&&"folder"!==e.type&&t.push({key:"status-tracked-form-upload",fileID:e.id,isTrackedFormUpload:!0,hasRestrictedAccess:e.hasRestrictedAccess,placement:"top",includeBackground:!0}),i.default.createElement("div",{className:"gallery-item__status-icons"},t.map((e=>i.default.createElement(c.default,e))))}getProgressBar(){let e=null;const{item:t}=this.props,n={className:"gallery-item__progress-bar",style:{width:`${t.progress}%`}};this.hasError()||!this.uploading()||this.complete()||(e=i.default.createElement("div",{className:"gallery-item__upload-progress"},i.default.createElement("div",n)));return e=this.getItemFunction("updateProgressBar")(e,this.props),e}isImageSmallerThanThumbnail(){if(!this.isImage()||this.missing())return!1;const e=this.props.item.width,t=this.props.item.height;return t&&e&&t<l.default.THUMBNAIL_HEIGHT&&e<l.default.THUMBNAIL_WIDTH}complete(){return this.props.item.queuedId&&this.saved()}saved(){return this.props.item.id>0}missing(){return!this.exists()&&this.saved()}uploading(){return this.props.item.queuedId&&!this.saved()}exists(){return this.props.item.exists}isImage(){return"image"===this.props.item.category}canBatchSelect(){return this.props.selectable&&this.props.item.canEdit}hasError(){let e=!1;return this.props.item.message&&(e="error"===this.props.item.message.type),e}handleActivate(e){e.stopPropagation(),"function"==typeof this.props.onActivate&&this.saved()&&this.props.onActivate(e,this.props.item)}handleSelect(e){e.stopPropagation(),e.preventDefault(),"function"==typeof this.props.onSelect&&this.props.onSelect(e,this.props.item)}handleKeyDown(e){l.default.SPACE_KEY_CODE===e.keyCode&&(e.preventDefault(),this.canBatchSelect()&&this.handleSelect(e)),l.default.RETURN_KEY_CODE===e.keyCode&&this.handleActivate(e)}handleCancelUpload(e){e.stopPropagation(),e.preventDefault(),this.hasError()?this.props.onRemoveErroredUpload(this.props.item):this.props.onCancelUpload&&this.props.onCancelUpload(this.props.item)}render(){let e=null,t=null,n=null;const{id:r,queuedId:l}=this.props.item,s=r?`item-${r}`:`queued-${l}`;if(this.props.selectable&&(this.canBatchSelect()&&(e=this.handleSelect),t="font-icon-tick"),this.uploading())e=this.handleCancelUpload,t="font-icon-cancel";else if(this.exists()){const e=o.default._t("AssetAdmin.VIEW","View");n=i.default.createElement("div",{className:"gallery-item--overlay font-icon-eye"},e)}const a=this.props.badge,u={className:"gallery-item__checkbox",type:"checkbox",title:o.default._t("AssetAdmin.SELECT","Select"),tabIndex:-1,onMouseDown:w,id:s},c=["gallery-item__checkbox-label","form-label",t];this.canBatchSelect()||(u.disabled=!0,c.push("gallery-item__checkbox-label--disabled"));const f={className:c.join(" "),onClick:e};return i.default.createElement("div",{className:this.getItemClassNames(),"data-id":this.props.item.id,tabIndex:0,role:"button",onKeyDown:this.handleKeyDown,onClick:this.handleActivate},!!a&&i.default.createElement(d.default,{className:"gallery-item__badge",status:a.status,message:a.message}),i.default.createElement("div",{ref:e=>{this.thumbnail=e},className:this.getThumbnailClassNames(),style:this.getThumbnailStyles()},n,this.getStatusFlags(),this.getStatusIcons()),this.getProgressBar(),this.getErrorMessage(),this.props.children,i.default.createElement("div",{className:"gallery-item__title",ref:e=>{this.title=e}},i.default.createElement("label",S({},f,{htmlFor:s}),i.default.createElement("input",u)),this.props.item.title))}}t.Component=F,F.propTypes={sectionConfig:f.default,item:s.default,loadState:b.default.oneOf(Object.values(v.default)),bustCache:b.default.bool,highlighted:b.default.bool,selected:b.default.bool,isDropping:b.default.bool,isDragging:b.default.bool,message:b.default.shape({value:b.default.string,type:b.default.string}),selectable:b.default.bool,onActivate:b.default.func,onSelect:b.default.func,onCancelUpload:b.default.func,onRemoveErroredUpload:b.default.func,badge:b.default.shape({status:b.default.string,message:b.default.string}),updateStatusFlags:b.default.func,updateProgressBar:b.default.func,updateErrorMessage:b.default.func},F.defaultProps={item:{},sectionConfig:{imageRetry:{}},updateStatusFlags:e=>e,updateProgressBar:e=>e,updateErrorMessage:e=>e,bustCache:!0};const I=(0,p.connect)((function(e,t){const{bustCache:n}=e.config.sections.find((e=>"SilverStripe\\AssetAdmin\\Controller\\AssetAdmin"===e.name));let o=v.default.DISABLED;if(C(t)){const n=e.assetAdmin.imageLoad.files.find((e=>t.item.thumbnail===e.url));o=n&&n.status||v.default.NONE}return{bustCache:n,loadState:o}}),(function(e){return{actions:{imageLoad:(0,h.bindActionCreators)(m,e)}}}))(F),A=t.File=(0,g.createSelectable)((0,a.default)(I));t.Folder=(0,g.createSelectable)((0,u.default)(A));t.default=I},2914:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=s(n(1594)),i=s(n(6935)),r=s(n(2926)),l=s(n(1037));function s(e){return e&&e.__esModule?e:{default:e}}function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},a.apply(null,arguments)}function u(e){const{draggingItems:t,draggingItemProps:n}=e,i=t.length,s=[i>1?o.default.createElement("div",{key:"1",className:"gallery-item__drag-shadow"}):null,i>2?o.default.createElement("div",{key:"2",className:"gallery-item__drag-shadow gallery-item__drag-shadow--second"}):null];return o.default.createElement("div",{className:"gallery-item__drag-layer"},o.default.createElement("div",{className:"gallery-item__drag-layer-preview"},s,o.default.createElement(l.default,a({},n,{isDragging:!0})),i>1&&o.default.createElement(r.default,{className:"gallery-item__drag-layer-count",status:"info",message:`${i}`})))}u.propTypes={draggingItems:i.default.arrayOf(i.default.number).isRequired,draggingItemProps:i.default.object.isRequired};t.default=u},2063:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){function t(t){const n="boolean"!=typeof t.canDrag||t.canDrag,{attributes:i,listeners:l,setNodeRef:a}=(0,r.useDraggable)({disabled:!n,id:t.item.id,data:{props:t}}),u=o.default.createElement(e,t);return o.default.createElement("div",s({className:"gallery-item__draggable",draggable:!0,ref:a},l,i),u)}return t.propTypes={item:i.default.shape({id:i.default.number.isRequired}).isRequired,canDrag:i.default.bool},t};var o=l(n(1594)),i=l(n(6935)),r=n(3375);function l(e){return e&&e.__esModule?e:{default:e}}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s.apply(null,arguments)}},2932:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){function t(t){const{active:n}=(0,r.useDndContext)(),i=t.item.selected||t.item.id===n?.id,{setNodeRef:l,isOver:a}=(0,r.useDroppable)({id:t.item.id,disabled:i}),u=o.default.createElement(e,s({isDropping:a},t));return o.default.createElement("div",{ref:l,className:"gallery-item__droppable"},u)}return t.propTypes={item:i.default.shape({id:i.default.number.isRequired}).isRequired},t};var o=l(n(1594)),i=l(n(6935)),r=n(3375);function l(e){return e&&e.__esModule?e:{default:e}}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s.apply(null,arguments)}},7847:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var 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 o={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&{}.hasOwnProperty.call(e,r)){var l=i?Object.getOwnPropertyDescriptor(e,r):null;l&&(l.get||l.set)?Object.defineProperty(o,r,l):o[r]=e[r]}return o.default=e,n&&n.set(e,o),o}(n(1594)),i=l(n(6935)),r=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 a extends o.Component{constructor(){super(),this.handleCreateFolder=this.handleCreateFolder.bind(this)}handleCreateFolder(e){const{onCreateFolder:t}=this.props;e.preventDefault(),"function"==typeof t&&t()}render(){const{canEdit:e}=this.props;return o.default.createElement("button",{id:"add-folder-button",className:"btn btn-secondary font-icon-folder-add btn--icon-xl",type:"button",onClick:this.handleCreateFolder,disabled:!e},o.default.createElement("span",{className:"btn__text btn__title"},r.default._t("AssetAdmin.ADD_FOLDER_BUTTON")))}}a.propTypes={canEdit:i.default.bool.isRequired,onCreateFolder:i.default.func.isRequired};t.default=a},3577:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var 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 o={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&{}.hasOwnProperty.call(e,r)){var l=i?Object.getOwnPropertyDescriptor(e,r):null;l&&(l.get||l.set)?Object.defineProperty(o,r,l):o[r]=e[r]}return o.default=e,n&&n.set(e,o),o}(n(1594)),i=l(n(6935)),r=l(n(7153));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 a extends o.Component{constructor(e){super(e),this.handleBackClick=this.handleBackClick.bind(this)}handleBackClick(e){const{onOpenFolder:t,folder:n}=this.props;e.preventDefault(),"function"==typeof t&&t(n.parentId)}render(){const{folder:e,badges:t,BackComponent:n}=this.props,{parentId:i}=e;if(null===i)return null;const r=t.find((e=>e.id===i));return o.default.createElement("div",{className:"gallery__back-container"},o.default.createElement(n,{item:{id:i},onClick:this.handleBackClick,badge:r}))}}a.propTypes={folder:i.default.shape({id:i.default.number,title:i.default.string,parentId:i.default.number,canView:i.default.bool,canEdit:i.default.bool}).isRequired,badges:i.default.arrayOf(i.default.shape({id:i.default.number,message:i.default.node,status:i.default.string})).isRequired,onOpenFolder:i.default.func.isRequired,BackComponent:i.default.oneOfType([i.default.object,i.default.func])},a.defaultProps={BackComponent:r.default};t.default=a},1859:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var 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 o={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&{}.hasOwnProperty.call(e,r)){var l=i?Object.getOwnPropertyDescriptor(e,r):null;l&&(l.get||l.set)?Object.defineProperty(o,r,l):o[r]=e[r]}return o.default=e,n&&n.set(e,o),o}(n(1594)),i=l(n(5815)),r=l(n(6935));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 a extends o.Component{render(){const{canEdit:e}=this.props;return o.default.createElement("button",{id:"upload-button",className:"btn btn-secondary font-icon-upload btn--icon-xl",type:"button",disabled:!e},o.default.createElement("span",{className:"btn__text btn__title"},i.default._t("AssetAdmin.DROPZONE_UPLOAD")))}}a.defaultProps={canEdit:r.default.func.isRequired};t.default=a},6493:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var 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=d(t);if(n&&n.has(e))return n.get(e);var o={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&{}.hasOwnProperty.call(e,r)){var l=i?Object.getOwnPropertyDescriptor(e,r):null;l&&(l.get||l.set)?Object.defineProperty(o,r,l):o[r]=e[r]}return o.default=e,n&&n.set(e,o),o}(n(1594)),i=u(n(6935)),r=n(9040),l=u(n(3577)),s=u(n(1859)),a=u(n(7847));function u(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)}class c extends o.Component{constructor(e){super(e),this.handleSelectSort=this.handleSelectSort.bind(this),this.handleViewChange=this.handleViewChange.bind(this)}handleSelectSort(e){this.props.onSort(e.currentTarget.value)}handleViewChange(e){const t=e.currentTarget.value;this.props.onViewChange(t)}renderSort(){return"tile"!==this.props.view?null:o.default.createElement("div",{className:"gallery__sort fieldholder-small"},o.default.createElement("select",{className:"dropdown no-change-track no-chzn",tabIndex:"0",style:{width:"160px"},defaultValue:this.props.sort},this.props.sorters.map((e=>{const t=e.label.replace(/^\w|[\s\-]+\w/g,(e=>e.toUpperCase()));return o.default.createElement("option",{key:`${e.field}-${e.direction}`,onClick:this.handleSelectSort,"data-field":e.field,"data-direction":e.direction,value:`${e.field},${e.direction}`},t)}))))}renderViewChangeButtons(){return["tile","table"].map((e=>{const t="table"===e?"list":"thumbnails",n=["gallery__view-change-button","btn btn-secondary","btn--icon-sm","btn--no-text"];return e===this.props.view?null:(n.push(`font-icon-${t}`),o.default.createElement("button",{id:`button-view-${e}`,key:e,className:n.join(" "),type:"button",title:"Change view gallery/list",onClick:this.handleViewChange,value:e}))}))}render(){const{badges:e,children:t,folder:n,onOpenFolder:i,onCreateFolder:r,BackButton:l,UploadButton:s,AddFolderButton:a}=this.props,{canEdit:u}=n;return o.default.createElement("div",{className:"toolbar--content toolbar--space-save"},o.default.createElement("div",{className:"fill-width"},o.default.createElement("div",{className:"gallery__btn-toolbar flexbox-area-grow"},o.default.createElement("div",{className:"btn-toolbar"},o.default.createElement(l,{folder:n,badges:e,onOpenFolder:i}),o.default.createElement(s,{canEdit:u}),o.default.createElement(a,{canEdit:u,onCreateFolder:r}),t)),o.default.createElement("div",{className:"gallery__state-buttons"},this.renderSort(),o.default.createElement("div",{className:"btn-group",role:"group","aria-label":"View mode"},this.renderViewChangeButtons()))))}}t.Component=c,c.propTypes={onCreateFolder:i.default.func.isRequired,onViewChange:i.default.func.isRequired,onOpenFolder:i.default.func.isRequired,onSort:i.default.func.isRequired,folder:i.default.shape({id:i.default.number,title:i.default.string,parentId:i.default.number,canView:i.default.bool,canEdit:i.default.bool}).isRequired,view:i.default.oneOf(["tile","table"]),sort:i.default.string,badges:i.default.arrayOf(i.default.shape({id:i.default.number,message:i.default.node,status:i.default.string})),BackButton:i.default.elementType,UploadButton:i.default.elementType,AddFolderButton:i.default.elementType},c.defaultProps={view:"tile",BackButton:l.default,UploadButton:s.default,AddFolderButton:a.default};t.default=(0,r.connect)((function(e,t){let{sort:n}=t;const{badges:o,sorters:i}=e.assetAdmin.gallery;return""===n&&(n=`${i[0].field},${i[0].direction}`),{badges:o,sorters:i,sort:n}}))(c)},4333:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var o=p(n(5815)),i=f(n(1594)),r=n(9367),l=n(9040),s=p(n(8737)),a=f(n(2811)),u=p(n(6935)),d=n(5125);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)}function f(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 o={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&{}.hasOwnProperty.call(e,r)){var l=i?Object.getOwnPropertyDescriptor(e,r):null;l&&(l.get||l.set)?Object.defineProperty(o,r,l):o[r]=e[r]}return o.default=e,n&&n.set(e,o),o}function p(e){return e&&e.__esModule?e:{default:e}}class h extends i.Component{constructor(e){super(e),this.handleSubmit=this.handleSubmit.bind(this)}componentDidMount(){this.setOverrides(this.props)}componentDidUpdate(e){this.props.isOpen&&!e.isOpen&&this.setOverrides(this.props)}componentWillUnmount(){this.clearOverrides()}setOverrides(e){if(this.props.schemaUrl!==e.schemaUrl&&this.clearOverrides(),e.schemaUrl){const t=Object.assign({},e.fileAttributes);delete t.ID;const n={fields:Object.entries(t).map((e=>{const[t,n]=e;return{name:t,value:n}}))};this.props.actions.schema.setSchemaStateOverrides(e.schemaUrl,n)}}getModalProps(){const e=Object.assign({onSubmit:this.handleSubmit,onLoadingError:this.handleLoadingError,showErrorMessage:!0,responseClassBad:"alert alert-danger",identifier:"AssetAdmin.InsertEmbedModal"},this.props,{className:`insert-embed-modal ${this.props.className}`,size:"lg",onClosed:this.props.onClosed,title:this.props.targetUrl?o.default._t("AssetAdmin.EditTitle","Media from the web"):o.default._t("AssetAdmin.CreateTitle","Insert new media from the web")});return delete e.sectionConfig,delete e.onInsert,delete e.fileAttributes,e}clearOverrides(){this.props.actions.schema.setSchemaStateOverrides(this.props.schemaUrl,null)}handleLoadingError(e){"function"==typeof this.props.onLoadingError&&this.props.onLoadingError(e)}handleSubmit(e,t){switch(t){case"action_addmedia":this.props.onCreate(e);break;case"action_insertmedia":this.props.onInsert(e);break;case"action_cancel":this.props.onClosed()}return Promise.resolve()}render(){const{FormBuilderModalComponent:e}=this.props;return i.default.createElement(e,this.getModalProps())}}t.Component=h,h.propTypes={sectionConfig:u.default.shape({url:u.default.string,form:u.default.object}),isOpen:u.default.bool,onInsert:u.default.func.isRequired,onCreate:u.default.func.isRequired,fileAttributes:u.default.shape({Url:u.default.string,CaptionText:u.default.string,PreviewUrl:u.default.string,Placement:u.default.string,Width:u.default.number,Height:u.default.number}),onClosed:u.default.func.isRequired,className:u.default.string,actions:u.default.object,schemaUrl:u.default.string.isRequired,targetUrl:u.default.string,onLoadingError:u.default.func,FormBuilderModalComponent:u.default.oneOfType([u.default.object,u.default.func])},h.defaultProps={className:"",fileAttributes:{},FormBuilderModalComponent:s.default};t.default=(0,l.connect)((function(e,t){const n=e.config.sections.find((e=>"SilverStripe\\AssetAdmin\\Controller\\AssetAdmin"===e.name)),o=t.fileAttributes?t.fileAttributes.Url:"",i=n.form.remoteEditForm.schemaUrl,r=o&&(0,d.joinUrlPaths)(i,`/?embedurl=${encodeURIComponent(o)}`),l=n.form.remoteCreateForm.schemaUrl;return{sectionConfig:n,schemaUrl:r||l,targetUrl:o}}),(function(e){return{actions:{schema:(0,r.bindActionCreators)(a,e)}}}))(h)},3517:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var o=y(n(5815)),i=b(n(1594)),r=y(n(853)),l=y(n(6379)),s=n(9040),a=n(9367),u=n(5381),d=b(n(8795)),c=n(5716),f=y(n(3432)),p=y(n(6923)),h=y(n(6935)),g=y(n(7008)),m=y(n(7675));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 o={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&{}.hasOwnProperty.call(e,r)){var l=i?Object.getOwnPropertyDescriptor(e,r):null;l&&(l.get||l.set)?Object.defineProperty(o,r,l):o[r]=e[r]}return o.default=e,n&&n.set(e,o),o}function y(e){return e&&e.__esModule?e:{default:e}}class _ extends i.Component{constructor(e){super(e),this.handleAddedFile=this.handleAddedFile.bind(this),this.handleFailedUpload=this.handleFailedUpload.bind(this),this.handleSuccessfulUpload=this.handleSuccessfulUpload.bind(this),this.handleSending=this.handleSending.bind(this),this.handleUploadProgress=this.handleUploadProgress.bind(this),this.handleUploadComplete=this.handleUploadComplete.bind(this),this.handleCancelUpload=this.handleCancelUpload.bind(this),this.handleRemoveErroredUpload=this.handleRemoveErroredUpload.bind(this),this.canFileUpload=this.canFileUpload.bind(this),this.updateFormData=this.updateFormData.bind(this),this.cacheBustUrl=this.cacheBustUrl.bind(this)}componentDidUpdate(e){(e.data.url&&this.props.data.url!==e.data.url||e.data.version&&this.props.data.version!==e.data.version)&&this.props.actions.previewField.removeFile(e.id)}componentWillUnmount(){this.props.actions.previewField.removeFile(this.props.id)}getDropzoneProps(){const e=this.props.data.uploadFileEndpoint,t=this.props.name,n={url:e&&e.url,method:e&&e.method,paramName:"Upload",clickable:!0,maxFiles:1},o={height:l.default.THUMBNAIL_HEIGHT,width:l.default.THUMBNAIL_WIDTH},i=this.props.securityID;return{name:t,className:["asset-dropzone--button","preview-image-field__container",this.props.className,this.props.extraClass].join(" "),canUpload:e&&this.canEdit(),preview:o,folderId:this.props.data.parentid,options:n,securityID:i,uploadButton:!1,onAddedFile:this.handleAddedFile,onError:this.handleFailedUpload,onSuccess:this.handleSuccessfulUpload,onSending:this.handleSending,onUploadProgress:this.handleUploadProgress,onUploadComplete:this.handleUploadComplete,canFileUpload:this.canFileUpload,updateFormData:this.updateFormData}}getButtonClasses(e){return(0,p.default)([`preview-image-field__toolbar-button--${e}`,"preview-image-field__toolbar-button"])}updateFormData(e){e.append("ID",this.props.data.id),e.append("Name",this.props.nameValue)}handleSending(e,t){this.props.actions.previewField.updateFile(this.props.id,{xhr:t})}handleSuccessfulUpload(e){const t=JSON.parse(e.xhr.response);"function"==typeof this.props.onAutofill&&(this.props.onAutofill("FileFilename",t.Filename),this.props.onAutofill("FileHash",t.Hash),this.props.onAutofill("FileVariant",t.Variant),t.Name&&this.props.onAutofill(this.props.data.nameField,t.Name))}handleFailedUpload(e,t){this.props.actions.previewField.failUpload(this.props.id,t)}handleAddedFile(e){this.props.actions.previewField.addFile(this.props.id,e)}handleRemoveErroredUpload(){if("function"==typeof this.props.onAutofill){const e=this.props.data.initialValues;this.props.onAutofill("FileFilename",e.FileFilename),this.props.onAutofill("FileHash",e.FileHash),this.props.onAutofill("FileVariant",e.FileVariant)}this.props.actions.previewField.removeFile(this.props.id)}handleCancelUpload(){this.props.upload.xhr&&this.props.upload.xhr.abort(),this.handleRemoveErroredUpload()}canFileUpload(e){const t=this.props.data.initialValues.FileFilename,n=(0,c.getFileExtension)(t),i=(0,c.getFileExtension)(e.name);if(!n||n===i)return!0;const r=o.default._t("AssetAdmin.CONFIRM_CHANGE_EXTENSION","Are you sure you want upload a file with a different extension?");return this.props.confirm(r)}preventDefault(e){e.preventDefault()}canEdit(){return!this.props.readOnly&&!this.props.disabled&&"folder"!==this.props.data.category}handleUploadProgress(e,t){this.props.actions.previewField.updateFile(this.props.id,{progress:t})}handleUploadComplete(e){this.props.actions.previewField.updateStatus(this.props.id,{status:e})}preview(e,t,n){if(e&&"image"!==e)return l.default.DEFAULT_PREVIEW;const o=t.url||n.preview||n.url;if(o){return o.startsWith("data:image/")?o:this.cacheBustUrl(o,n.version)}return null}cacheBustUrl(e){const t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"")||this.props.data.version;if(!1===this.props.bustCache||!t)return e;const n=g.default.parse(e),o={...m.default.parse(n.query),vid:t};return g.default.format({...n,search:m.default.stringify(o)})}renderImage(){const{data:e,upload:t}=this.props;if(!e.mock&&!e.exists&&!t.url)return i.default.createElement("div",{className:"editor__file-preview-message--file-missing"},o.default._t("AssetAdmin.FILE_MISSING","File cannot be found"));const{category:n,progress:r,message:l}=t,s=t.errors?t.errors[0]:null,a=t.status?t.status:null,u=this.preview(n,t,e),d=i.default.createElement("img",{alt:"preview",src:u,className:"editor__thumbnail"}),c=e.url&&!r?i.default.createElement("a",{className:"editor__file-preview-link",href:this.cacheBustUrl(e.url),target:"_blank",rel:"noopener noreferrer"},d):null,f=r>0&&r<100?i.default.createElement("div",{className:"preview-image-field__progress"},i.default.createElement("div",{className:"preview-image-field__progress-bar",style:{width:`${r}%`}})):null;let p=null;if(s||"error"===a){const e=s&&s.value?s.value:o.default._t("AssetAdmin.DROPZONE_RESPONSE_ERROR","Server responded with an error."),t=s&&s.type?s.type:"error";p=i.default.createElement("div",{className:`preview-image-field__message preview-image-field__message--${t}`},e)}else l?p=i.default.createElement("div",{className:`preview-image-field__message preview-image-field__message--${l.type}`},l.value):100===r&&"success"===a&&(p=i.default.createElement("div",{className:"preview-image-field__message preview-image-field__message--success"},o.default._t("AssetAdmin.REPlACE_FILE_SUCCESS","Upload successful, the file will be replaced when you Save."),(r||l)&&i.default.createElement("button",{onClick:this.handleCancelUpload,className:"preview-image-field__message-button btn btn-outline-light",type:"button"},o.default._t("AssetAdmin.REPLACE_FILE_UNDO","Undo"))));return i.default.createElement("div",{className:"editor__thumbnail-container"},c||d,f,p)}render(){const{AssetDropzoneComponent:e}=this.props,t=this.getDropzoneProps();if(this.canEdit())return i.default.createElement(e,t,this.renderImage());const n=["preview-image-field__container",this.props.className,this.props.extraClass];return i.default.createElement("div",{className:n.join(" ")},this.renderImage())}}t.Component=_,_.propTypes={id:h.default.string.isRequired,name:h.default.string,className:h.default.string,extraClass:h.default.string,readOnly:h.default.bool,disabled:h.default.bool,bustCache:h.default.bool,onAutofill:h.default.func,formid:h.default.string,nameValue:h.default.string,data:h.default.shape({id:h.default.number,parentid:h.default.number,version:h.default.number,url:h.default.string,mock:h.default.bool,exists:h.default.bool,preview:h.default.string,category:h.default.string,nameField:h.default.string,uploadFileEndpoint:h.default.shape({url:h.default.string.isRequired,method:h.default.string.isRequired,payloadFormat:h.default.string}),initialValues:h.default.object}).isRequired,upload:h.default.shape({url:h.default.string,progress:h.default.number,xhr:h.default.object,category:h.default.string,message:h.default.shape({type:h.default.string.isRequired,value:h.default.string.isRequired}),status:h.default.string}),actions:h.default.object,securityID:h.default.string,confirm:h.default.func,AssetDropzoneComponent:h.default.oneOfType([h.default.object,h.default.func])},_.defaultProps={extraClass:"",className:"",data:{},upload:{},confirm:e=>window.confirm(e),bustCache:!0,AssetDropzoneComponent:r.default};t.default=(0,s.connect)((function(e,t){const n=e.config.SecurityID,o=t.id,i=e.assetAdmin.previewField[o]||{},r=(0,u.formValueSelector)(t.formid,f.default),{bustCache:l}=e.config.sections.find((e=>"SilverStripe\\AssetAdmin\\Controller\\AssetAdmin"===e.name));return{securityID:n,upload:i,nameValue:r(e,"Name"),bustCache:l}}),(function(e){return{actions:{previewField:(0,a.bindActionCreators)(d,e)}}}))(_)},3965:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=s(n(1594)),i=s(n(6935)),r=n(3556),l=s(n(5815));function s(e){return e&&e.__esModule?e:{default:e}}function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},a.apply(null,arguments)}const u=e=>{let{onSelect:t,currentWidth:n,originalWidth:i,width:s,text:a}=e;return o.default.createElement(r.Button,{color:"link",size:"sm",onClick:()=>t(s||i),disabled:i<s||n===(s||i)},o.default.createElement("span",{className:"visually-hidden"},(e=>l.default.inject(l.default._t("AssetAdmin.SET_IMAGE_SIZE_TO",'Set image size to "{preset}"'),{preset:e}))(a)),o.default.createElement("span",{"aria-hidden":"true"},a))},d=e=>{let{imageSizePresets:t,...n}=e;return t?o.default.createElement("ul",{className:"image-size-preset-list"},t.map((e=>o.default.createElement("li",{key:e.text,className:"image-size-preset-list__list-item"},o.default.createElement(u,a({},e,n)))))):null};d.propTypes={onSelect:i.default.func,imageSizePresets:i.default.arrayOf(i.default.shape({text:i.default.string,width:i.default.number})),currentWidth:i.default.number,originalWidth:i.default.number.isRequired};t.default=d},2397:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var 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=f(t);if(n&&n.has(e))return n.get(e);var o={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&{}.hasOwnProperty.call(e,r)){var l=i?Object.getOwnPropertyDescriptor(e,r):null;l&&(l.get||l.set)?Object.defineProperty(o,r,l):o[r]=e[r]}return o.default=e,n&&n.set(e,o),o}(n(1594)),i=c(n(6935)),r=n(5207),l=n(5381),s=c(n(3432)),a=n(9040),u=n(9367),d=c(n(3965));function c(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<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},p.apply(null,arguments)}class h extends o.Component{constructor(e){super(e);if(2!==o.Children.toArray(e.children).length)throw new Error("ProportionConstraintField must be passed two children -- one field for each value");this.handlePresetSelect=this.handlePresetSelect.bind(this),this.handleBlur=this.handleBlur.bind(this),this.handleFocus=this.handleFocus.bind(this),this.state={hasFocus:!1}}componentDidMount(){this.componentDidUpdate(this.props)}componentDidUpdate(e){if(!this.state.hasFocus){const{current:{width:t}}=e,n=parseInt(t,10);(!n||n<=0)&&this.resetDimensions()}}handleChange(e,t,n){const o=parseInt(n||t.target&&t.target.value,10);o&&o>0&&this.syncFields(e,o)}syncFields(e,t){const{children:n,active:o,onAutofill:i,data:{ratio:r}}=this.props,l=0===e?1:0,s=n[e].props.name,a=n[l].props.name,u=0===e?1/r:r;i(s,t),o&&i(a,Math.round(t*u))}handlePresetSelect(e){this.syncFields(0,e);const{key:t}=this.props.children[0],n=document.getElementById(t);n&&n.focus()}handleBlur(e,t){this.setState({hasFocus:!1});const n=parseInt(t&&t.target&&t.target.value,10);(!n||n<=0)&&(t.preventDefault(),this.resetDimensions())}handleFocus(){this.setState({hasFocus:!0})}defaultWidth(){const{imageSizePresets:e,data:{originalWidth:t}}=this.props,n=e&&e.find((e=>e.default)),o=n&&n.width||t||600;return t&&t<o?t:o}resetDimensions(){const e=this.defaultWidth();this.syncFields(0,e)}render(){const{FieldGroup:e,data:{originalWidth:t,isRemoteFile:n},current:{width:i},imageSizePresets:r}=this.props;return o.default.createElement(e,p({smallholder:!1},this.props),this.props.children.map(((e,t)=>(0,o.cloneElement)(e,{onChange:(e,n)=>this.handleChange(t,e,n),onBlur:e=>this.handleBlur(t,e),onFocus:()=>this.handleFocus(),key:t},e.props.children))),!n&&o.default.createElement(d.default,{originalWidth:parseInt(t,10),currentWidth:i,imageSizePresets:r,onSelect:this.handlePresetSelect}))}}t.Component=h,h.propTypes={children:i.default.array,onAutofill:i.default.func,active:i.default.bool,data:i.default.shape({ratio:i.default.number.isRequired,isRemoteFile:i.default.bool,originalWidth:i.default.number,originalHeight:i.default.number}),current:i.default.shape({width:i.default.oneOfType([i.default.number,i.default.string]),height:i.default.oneOfType([i.default.number,i.default.string])}).isRequired,FieldGroup:i.default.elementType.isRequired,imageSizePresets:i.default.arrayOf(i.default.shape({width:i.default.number,text:i.default.string,default:i.default.bool}))},h.defaultProps={active:!0};t.default=(0,u.compose)((0,a.connect)((function(e,t){let{formid:n}=t;const o=(0,l.formValueSelector)(n,s.default),i=o(e,"Width"),r=o(e,"Height");return{current:{width:i?parseInt(i,10):void 0,heigth:r?parseInt(r,10):void 0},imageSizePresets:e.assetAdmin.modal.imageSizePresets}})),(0,r.inject)(["FieldGroup"]))(h)},9725:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.ConnectedUploadField=t.Component=void 0;var o=b(n(5815)),i=v(n(1594)),r=n(9040),l=n(9367),s=n(5207),a=b(n(6379)),u=b(n(2623)),d=b(n(6022)),c=b(n(9247)),f=v(n(1433)),p=v(n(1021)),h=b(n(6935)),g=b(n(4636));function m(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(m=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=m(t);if(n&&n.has(e))return n.get(e);var o={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&{}.hasOwnProperty.call(e,r)){var l=i?Object.getOwnPropertyDescriptor(e,r):null;l&&(l.get||l.set)?Object.defineProperty(o,r,l):o[r]=e[r]}return o.default=e,n&&n.set(e,o),o}function b(e){return e&&e.__esModule?e:{default:e}}class y extends i.Component{constructor(e){super(e),this.getMaxFiles=this.getMaxFiles.bind(this),this.getFolderId=this.getFolderId.bind(this),this.renderChild=this.renderChild.bind(this),this.handleAddShow=this.handleAddShow.bind(this),this.handleHide=this.handleHide.bind(this),this.handleAddInsert=this.handleAddInsert.bind(this),this.handleInsertMany=this.handleInsertMany.bind(this),this.handleAddedFile=this.handleAddedFile.bind(this),this.handleSending=this.handleSending.bind(this),this.handleUploadProgress=this.handleUploadProgress.bind(this),this.handleFailedUpload=this.handleFailedUpload.bind(this),this.handleSuccessfulUpload=this.handleSuccessfulUpload.bind(this),this.handleItemRemove=this.handleItemRemove.bind(this),this.handleReplaceShow=this.handleReplaceShow.bind(this),this.handleChange=this.handleChange.bind(this),this.handleReplace=this.handleReplace.bind(this),this.canEdit=this.canEdit.bind(this),this.canAttach=this.canAttach.bind(this),this.canUpload=this.canUpload.bind(this),this.state={selecting:!1,selectingItem:null}}componentDidMount(){const{id:e,formSchemaFilesHash:t,data:n,value:o,actions:i,files:r}=this.props,l=(0,g.default)(JSON.stringify(o.Files)).toString();if(t!==l)return i.uploadField.setFormSchemaFilesHash(e,l),void i.uploadField.setFiles(e,n.files);i.uploadField.setFiles(e,r)}componentDidUpdate(e){const{id:t,formSchemaFilesHash:n,data:o,files:i,value:{Files:r},actions:{uploadField:{setFormSchemaFilesHash:l,setFiles:s}}}=this.props;(function(e,t){if(e.length!==t.length)return!0;for(let n=0;n<e.length;n++)if(e[n].id!==t[n].id)return!0;return!1})(e.files||[],i||[])&&this.handleChange(null,this.props);const a=(0,g.default)(JSON.stringify(r.Files)).toString();if(n!==a)return l(t,a),void s(t,o.files);const{value:{Files:u}}=e;if(r.length===u.length&&0===r.filter((e=>!u.includes(e))).length)return;const d=i.map((e=>e.id));d.length===r.length&&0===d.filter((e=>!r.includes(e))).length||s(t,o.files)}getMaxFiles(){const e=this.props.data.multi?this.props.data.maxFiles:1;if(null==e)return null;const t=this.props.files.filter((e=>e.id>0&&(!e.message||"error"!==e.message.type))).length;return Math.max(e-t,0)}getMaxFilesize(){return this.props.data.maxFilesize||null}getFolderId(){const{selectingItem:e}=this.state;return e&&"object"==typeof e?e.parent.id:this.props.data.parentid||0}handleAddedFile(e){const t={...e,uploaded:!0};this.props.actions.uploadField.addFile(this.props.id,t)}handleSending(e,t){this.props.actions.uploadField.updateQueuedFile(this.props.id,e._queuedId,{xhr:t})}handleUploadProgress(e,t){this.props.actions.uploadField.updateQueuedFile(this.props.id,e._queuedId,{progress:t})}handleSuccessfulUpload(e){const t=JSON.parse(e.xhr.response);void 0===t[0].error?this.props.actions.uploadField.succeedUpload(this.props.id,e._queuedId,t[0]):this.handleFailedUpload(e)}handleFailedUpload(e,t){const n=e.xhr&&e.xhr.status?(0,c.default)(e.xhr.status,e.xhr):"";this.props.actions.uploadField.failUpload(this.props.id,e._queuedId,t,n)}handleItemRemove(e,t){this.props.actions.uploadField.removeFile(this.props.id,t)}handleReplaceShow(e,t){this.props.actions.modal.initFormStack("select","admin"),this.setState({selecting:!0,selectingItem:t})}handleChange(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.props;if("function"==typeof t.onChange){const n={Files:t.files.filter((e=>e.id)).map((e=>e.id))};t.onChange(e,{id:t.id,value:n})}}handleUploadButton(e){e.preventDefault()}handleAddShow(e){e.preventDefault(),this.props.actions.modal.initFormStack("select","admin"),this.setState({selecting:!0,selectingItem:null})}handleHide(){this.props.actions.modal.reset(),this.setState({selecting:!1,selectingItem:null})}handleAddInsert(e,t,n){return this.props.actions.uploadField.addFile(this.props.id,n),this.handleHide(),Promise.resolve({})}handleInsertMany(e,t){const{selectingItem:n}=this.state;n?this.handleReplace(e,null,t[0]):t.forEach((t=>{this.handleAddInsert(e,null,t)}))}handleReplace(e,t,n){const{selectingItem:o}=this.state,{id:i,actions:{uploadField:{addFile:r,removeFile:l}}}=this.props;if(!o)throw new Error("Tried to replace a file when none was selected.");return l(i,o),r(i,n),this.handleHide(),Promise.resolve({})}canEdit(){return!this.props.disabled&&!this.props.readOnly&&(this.props.data.canUpload||this.props.data.canAttach)}canUpload(){return this.canEdit()&&this.props.data.canUpload}canAttach(){return this.canEdit()&&this.props.data.canAttach}renderDropzone(){const{AssetDropzone:e}=this.props;if(!this.props.data.endpoints.createFile)return null;const t={height:a.default.SMALL_THUMBNAIL_HEIGHT,width:a.default.SMALL_THUMBNAIL_WIDTH},n=this.getMaxFiles(),r=this.getMaxFilesize(),l={url:this.props.data.endpoints.createFile.url,method:this.props.data.endpoints.createFile.method,paramName:"Upload",parallelUploads:this.props.data.maxParallelUploads,maxFiles:n,maxFilesize:r,thumbnailWidth:a.default.SMALL_THUMBNAIL_WIDTH,thumbnailHeight:a.default.SMALL_THUMBNAIL_HEIGHT},s=["uploadfield__dropzone"];if(0===n&&s.push("uploadfield__dropzone--hidden"),!this.canEdit())return this.props.files.length?null:i.default.createElement("p",null,o.default._t("AssetAdmin.EMPTY","No files"));const u=this.props.securityId,d=[];return this.canUpload()&&d.push(i.default.createElement("button",{key:"uploadbutton",type:"button",onClick:this.handleUploadButton,className:"uploadfield__upload-button"},o.default._t("AssetAdmin.UPLOADFIELD_UPLOAD_NEW","Upload new"))),this.canAttach()&&(d.length&&d.push(i.default.createElement("span",{key:"uploadjoin",className:"uploadfield__join"},o.default._t("AssetAdmin.OR","or"))),d.push(i.default.createElement("button",{key:"attachbutton",type:"button",onClick:this.handleAddShow,className:"uploadfield__add-button"},o.default._t("AssetAdmin.UPLOADFIELD_CHOOSE_EXISTING","Choose existing")))),i.default.createElement(e,{name:this.props.name,canUpload:this.canUpload(),uploadButton:!1,uploadSelector:".uploadfield__upload-button, .uploadfield__backdrop",folderId:this.props.data.parentid,onAddedFile:this.handleAddedFile,onError:this.handleFailedUpload,onSuccess:this.handleSuccessfulUpload,onSending:this.handleSending,onUploadProgress:this.handleUploadProgress,preview:t,options:l,securityID:u,className:s.join(" ")},i.default.createElement("div",{className:"uploadfield__backdrop"}),i.default.createElement("span",{className:"uploadfield__droptext"},d))}renderModal(){const{InsertMediaModal:e}=this.props,{selecting:t,selectingItem:n}=this.state,o=this.getMaxFiles(),r=this.getFolderId();return i.default.createElement(e,{title:!1,isOpen:t,onInsert:n?this.handleReplace:this.handleAddInsert,onClosed:this.handleHide,onInsertMany:this.handleInsertMany,maxFiles:n?1:o,type:"select",bodyClassName:"modal__dialog",className:"insert-media-react__dialog-wrapper",fileAttributes:n?{ID:n.id}:null,folderId:r})}renderChild(e,t){const{UploadFieldItem:n}=this.props,o={key:e.id?`file-${e.id}`:`queued-${e.queuedId}`,item:e,name:this.props.name,onRemove:this.handleItemRemove,canEdit:this.canEdit(),onView:this.handleReplaceShow},r=this.props.getItemProps(o,t,this.props);return i.default.createElement(n,r)}render(){return i.default.createElement("div",{className:"uploadfield"},this.renderDropzone(),this.props.files.map(this.renderChild),this.renderModal())}}t.Component=y,y.propTypes={id:h.default.string.isRequired,name:h.default.string.isRequired,onChange:h.default.func,value:h.default.shape({Files:h.default.arrayOf(h.default.number)}),files:h.default.arrayOf(d.default),formSchemaFilesHash:h.default.string,readOnly:h.default.bool,disabled:h.default.bool,data:h.default.shape({files:h.default.arrayOf(d.default),multi:h.default.bool,parentid:h.default.number,canUpload:h.default.bool,canAttach:h.default.bool,maxFiles:h.default.number,endpoints:h.default.object}),UploadFieldItem:h.default.elementType,AssetDropzone:h.default.elementType,InsertMediaModal:h.default.elementType,getItemProps:h.default.func},y.defaultProps={value:{Files:[]},className:"",getItemProps:e=>e};const _=t.ConnectedUploadField=(0,r.connect)((function(e,t){const n=t.id;let o=[],i=null;return e.assetAdmin&&e.assetAdmin.uploadField&&e.assetAdmin.uploadField.fields&&e.assetAdmin.uploadField.fields[n]&&(o=e.assetAdmin.uploadField.fields[n].files||[],i=e.assetAdmin.uploadField.fields[n].formSchemaFilesHash||null),{files:o,securityId:e.config.SecurityID,formSchemaFilesHash:i}}),(function(e){return{actions:{uploadField:(0,l.bindActionCreators)(f,e),modal:(0,l.bindActionCreators)(p,e)}}}))(y);t.default=(0,l.compose)((0,s.inject)(["UploadFieldItem","AssetDropzone","InsertMediaModal"]),u.default)(_)},3058:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=c(n(5815)),i=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 o={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&{}.hasOwnProperty.call(e,r)){var l=i?Object.getOwnPropertyDescriptor(e,r):null;l&&(l.get||l.set)?Object.defineProperty(o,r,l):o[r]=e[r]}return o.default=e,n&&n.set(e,o),o}(n(1594)),r=c(n(6379)),l=c(n(6022)),s=n(5716),a=c(n(6935)),u=c(n(1990));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)}function c(e){return e&&e.__esModule?e:{default:e}}class f extends i.Component{constructor(e){super(e),this.handleRemove=this.handleRemove.bind(this),this.handleItemClick=this.handleItemClick.bind(this),this.handleView=this.handleView.bind(this)}getThumbnailStyles(){if(this.isImage()&&(this.exists()||this.uploading())){return{backgroundImage:`url(${this.props.item.smallThumbnail||this.props.item.url||""})`}}return{}}getThumbnailClassNames(){const e=["uploadfield-item__thumbnail"];return this.isImageSmallerThanThumbnail()&&e.push("uploadfield-item__thumbnail--small"),e.join(" ")}getItemClassNames(){const e=["fill-width","uploadfield-item",`uploadfield-item--${this.props.item.category||"none"}`];return this.missing()&&e.push("uploadfield-item--missing"),this.hasError()&&e.push("uploadfield-item--error"),e.join(" ")}hasError(){return!!this.props.item.message&&"error"===this.props.item.message.type}isImage(){return"image"===this.props.item.category}exists(){return this.props.item.exists}uploading(){return this.props.item.queuedId&&!this.saved()}complete(){return this.props.item.queuedId&&this.saved()}saved(){return this.props.item.id>0}missing(){return!this.exists()&&this.saved()}isImageSmallerThanThumbnail(){if(!this.isImage()||this.missing())return!1;const e=this.props.item.width,t=this.props.item.height;return t&&e&&t<r.default.SMALL_THUMBNAIL_HEIGHT&&e<r.default.SMALL_THUMBNAIL_WIDTH}handleRemove(e){e.preventDefault(),this.props.onRemove&&this.props.onRemove(e,this.props.item)}handleView(e){e.preventDefault(),this.props.onView&&this.props.onView(e,this.props.item)}handleItemClick(e){e.preventDefault(),this.props.onItemClick&&this.props.onItemClick(e,this.props.item)}renderStatus(){return this.props.item.draft?i.default.createElement("span",{className:"uploadfield-item__status"},o.default._t("File.DRAFT","Draft")):this.props.item.modified?i.default.createElement("span",{className:"uploadfield-item__status"},o.default._t("File.MODIFIED","Modified")):null}renderErrorMessage(){let e=null;return this.hasError()?e=this.props.item.message.value:this.missing()&&(e=o.default._t("AssetAdmin.FILE_MISSING","File cannot be found")),null!==e?i.default.createElement("div",{className:"uploadfield-item__error-message",title:e},e):null}renderProgressBar(){const e={className:"uploadfield-item__progress-bar",style:{width:`${this.props.item.progress}%`}};return!this.hasError()&&this.props.item.queuedId?this.complete()?i.default.createElement("div",{className:"uploadfield-item__complete-icon"}):i.default.createElement("div",{className:"uploadfield-item__upload-progress"},i.default.createElement("div",e)):null}renderRemoveButton(){if(!this.props.canEdit)return null;const e=["btn","uploadfield-item__remove-btn","btn-secondary","btn--no-text","font-icon-cancel","btn--icon-md"].join(" ");return i.default.createElement("button",{className:e,onClick:this.handleRemove})}renderViewButton(){if(!this.props.canEdit||!this.props.item.id)return null;const e=["btn","uploadfield-item__view-btn","btn-secondary","btn--no-text","font-icon-eye","btn--icon-md"].join(" ");return i.default.createElement("button",{className:e,onClick:this.handleView})}renderRestrictedAccess(e){const{id:t,hasRestrictedAccess:n}=e,o={fileID:t,placement:"top",hasRestrictedAccess:n};return i.default.createElement(u.default,o)}renderTrackedFormUpload(e){const{id:t,isTrackedFormUpload:n,hasRestrictedAccess:o}=e,r={fileID:t,placement:"top",isTrackedFormUpload:n,hasRestrictedAccess:o};return i.default.createElement(u.default,r)}renderFileDetails(){const e=this.props.item;let t="";return e.size&&(t=`, ${(0,s.fileSize)(e.size)}`),i.default.createElement("div",{className:"uploadfield-item__details fill-height flexbox-area-grow"},i.default.createElement("div",{className:"fill-width"},i.default.createElement("span",{className:"uploadfield-item__title flexbox-area-grow"},e.title)),i.default.createElement("div",{className:"fill-width uploadfield-item__meta"},i.default.createElement("span",{className:"uploadfield-item__specs"},e.extension,t),this.renderStatus(),e.hasRestrictedAccess&&this.renderRestrictedAccess(e),e.isTrackedFormUpload&&this.renderTrackedFormUpload(e)))}renderThumbnail(){return i.default.createElement("div",{className:this.getThumbnailClassNames(),style:this.getThumbnailStyles(),onClick:this.handleItemClick,role:"button",tabIndex:this.props.onItemClick?0:-1})}render(){const e=`${this.props.name}[Files][]`;return i.default.createElement("div",{className:this.getItemClassNames()},i.default.createElement("input",{type:"hidden",value:this.props.item.id,name:e}),this.renderThumbnail(),this.renderFileDetails(),this.renderProgressBar(),this.renderErrorMessage(),this.renderViewButton(),this.renderRemoveButton())}}f.propTypes={canEdit:a.default.bool,name:a.default.string.isRequired,item:l.default,onRemove:a.default.func,onItemClick:a.default.func,onView:a.default.func};t.default=f},6379:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o,i=(o=n(5815))&&o.__esModule?o:{default:o};t.default={ACTIONS:{CREATE_FOLDER:"create-folder",EDIT_FILE:"edit"},MOVE_SUCCESS_DURATION:3e3,CSS_TRANSITION_TIME:300,SMALL_THUMBNAIL_HEIGHT:60,SMALL_THUMBNAIL_WIDTH:60,THUMBNAIL_HEIGHT:150,THUMBNAIL_WIDTH:200,BULK_ACTIONS:[{value:"delete",label:i.default._t("AssetAdmin.BULK_ACTIONS_DELETE","Delete"),className:"font-icon-trash",destructive:!0,callback:null,canApply:e=>e.every((e=>e&&e.canDelete))},{value:"archive",label:i.default._t("AssetAdmin.BULK_ACTIONS_ARCHIVE","Archive"),className:"font-icon-box",destructive:!0,callback:null,canApply:e=>e.every((e=>e&&e.canDelete))},{value:"edit",label:i.default._t("AssetAdmin.BULK_ACTIONS_EDIT","Edit"),className:"font-icon-edit",destructive:!1,canApply:e=>1===e.length,callback:null},{value:"move",label:i.default._t("AssetAdmin.BULK_ACTIONS_MOVE","Move"),className:"font-icon-folder-move",canApply:e=>e.every((e=>e&&e.canEdit)),destructive:!1,callback:null},{value:"publish",label:i.default._t("AssetAdmin.BULK_ACTIONS_PUBLISH","Publish"),className:"font-icon-rocket",destructive:!1,callback:null,canApply:e=>e.some((e=>e&&e.modified))&&e.every((e=>e.canEdit&&"folder"!==e.type)),confirm:null},{value:"unpublish",label:i.default._t("AssetAdmin.BULK_ACTIONS_UNPUBLISH","Unpublish"),className:"font-icon-cancel-circled",destructive:!1,callback:null,canApply:e=>e.some((e=>e.published))&&e.every((e=>e.canEdit&&"folder"!==e.type)),confirm:null},{value:"insert",label:i.default._t("AssetAdmin.BULK_ACTIONS_INSERT","Insert"),className:"font-icon-plus-circled btn-primary",destructive:!1,callback:null,canApply:e=>e.length,confirm:null}],BULK_ACTIONS_PLACEHOLDER:i.default._t("AssetAdmin.BULK_ACTIONS_PLACEHOLDER"),SPACE_KEY_CODE:32,RETURN_KEY_CODE:13,DEFAULT_PREVIEW:"framework/client/dist/images/app_icons/generic_92.png",MODAL_MOVE:"MODAL_MOVE"}},7917:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var o=R(n(1594)),i=A(n(6935)),r=n(9040),l=n(9367),s=A(n(5609)),a=A(n(5815)),u=A(n(6923)),d=R(n(4201)),c=R(n(8918)),f=R(n(1369)),p=R(n(9517)),h=A(n(1869)),g=A(n(5789)),m=A(n(2294)),v=R(n(6303)),b=A(n(6175)),y=A(n(6379)),_=A(n(4350)),E=A(n(6177)),S=R(n(4461)),C=A(n(8268)),w=A(n(4014)),F=A(n(175)),I=A(n(2308));function A(e){return e&&e.__esModule?e:{default:e}}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)}function R(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 o={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&{}.hasOwnProperty.call(e,r)){var l=i?Object.getOwnPropertyDescriptor(e,r):null;l&&(l.get||l.set)?Object.defineProperty(o,r,l):o[r]=e[r]}return o.default=e,n&&n.set(e,o),o}class M extends o.Component{constructor(e){super(e),this.handleOpenFile=this.handleOpenFile.bind(this),this.handleCloseFile=this.handleCloseFile.bind(this),this.handleDelete=this.handleDelete.bind(this),this.doPublish=this.doPublish.bind(this),this.doUnpublish=this.doUnpublish.bind(this),this.handleUnpublish=this.handleUnpublish.bind(this),this.handleDoSearch=this.handleDoSearch.bind(this),this.handleClearSearch=this.handleClearSearch.bind(this),this.handleSubmitEditor=this.handleSubmitEditor.bind(this),this.handleOpenFolder=this.handleOpenFolder.bind(this),this.handleSort=this.handleSort.bind(this),this.handleSetPage=this.handleSetPage.bind(this),this.createEndpoint=this.createEndpoint.bind(this),this.handleBackButtonClick=this.handleBackButtonClick.bind(this),this.handleFolderIcon=this.handleFolderIcon.bind(this),this.handleBrowse=this.handleBrowse.bind(this),this.handleViewChange=this.handleViewChange.bind(this),this.handleUpload=this.handleUpload.bind(this),this.handleUploadQueue=this.handleUploadQueue.bind(this),this.handleCreateFolder=this.handleCreateFolder.bind(this),this.handleMoveFilesSuccess=this.handleMoveFilesSuccess.bind(this),this.refetchFolder=this.refetchFolder.bind(this),this.state={loading:!1,folder:null,files:[],totalCount:0,forceRefetch:!1}}componentDidMount(){this.refetchFolder()}componentDidUpdate(e){(this.props.folderId!==e.folderId||this.props.fileId!==e.fileId&&0!==this.props.fileId||this.state.forceRefetch)&&this.refetchFolder(),this.state.forceRefetch&&this.setState({forceRefetch:!1})}getFolderId(){return null!==this.props.folderId?this.props.folderId:this.state.folder?this.state.folder.id:0}refetchFolder(){const e=this.getFolderId(),t=new URLSearchParams(window.location.search),n=[];t.forEach(((e,t)=>{"page"!==t&&"filter"!==t.substring(0,6)&&"sort"!==t.substring(0,4)||n.push(`${t}=${e}`)}));let o="";n.length&&(o=`?${n.join("&")}`);const i=`${E.default.getSection("SilverStripe\\AssetAdmin\\Controller\\AssetAdminOpen").endpoints.read.url}/${e}${o}`;s.default.get(i).then((async e=>{const t=await e.json();this.setState({loading:!1,folder:t,files:t.children.nodes,totalCount:t.children.pageInfo.totalCount})})).catch((async e=>{this.setState({loading:!1,folder:null,files:[],totalCount:0});const t=await(0,w.default)(e);this.props.actions.toasts.error(t)}))}getFiles(){const{queuedFiles:e,folderId:t}=this.props,n=this.state.files,o=[...e.items.filter((e=>!(e.id&&n.find((t=>t.id===e.id))||e.hasOwnProperty("uploadedToFolderId")&&e.uploadedToFolderId!==t))),...n],i=o.filter((e=>"folder"===e.type)),r=o.filter((e=>"folder"!==e.type));return i.concat(r)}handleBrowse(e,t,n){"function"==typeof this.props.onBrowse&&(this.props.onBrowse(e,t,n),this.setState({forceRefetch:!0})),e!==this.getFolderId()&&this.props.actions.gallery.deselectFiles()}handleSetPage(e){this.handleBrowse(this.getFolderId(),this.props.fileId,Object.assign({},this.props.query,{page:e})),this.setState({forceRefetch:!0})}handleDoSearch(e){this.props.actions.gallery.deselectFiles(),this.props.actions.queuedFiles.purgeUploadQueue(),this.handleBrowse(e.currentFolderOnly?this.getFolderId():0,null,{filter:e,view:this.props.query.view})}handleClearSearch(e){this.props.actions.displaySearch.closeSearch(),this.props.actions.gallery.deselectFiles(),this.props.actions.queuedFiles.purgeUploadQueue(),this.refetchFolder();const t=this.state.folder;this.handleOpenFolder(e,t)}handleSort(e){this.handleBrowse(this.getFolderId(),this.props.fileId,{...this.props.query,sort:e,limit:void 0,page:void 0}),this.setState({forceRefetch:!0})}handleViewChange(e){this.handleBrowse(this.getFolderId(),this.props.fileId,Object.assign({},this.props.query,{view:e}))}createEndpoint(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return s.default.createEndpointFetcher(Object.assign({},e,t?{defaultData:{SecurityID:this.props.securityId}}:{}))}handleBackButtonClick(e){e.preventDefault(),this.props.actions.gallery.deselectFiles();const t=this.state.folder;t?this.handleOpenFolder(t.parentId||0):this.handleOpenFolder(0)}resetFile(e){e.queuedId&&this.props.actions.queuedFiles.removeQueuedFile(e.queuedId),this.props.fileId===e.id&&this.props.resetFileDetails(this.getFolderId(),e.id,this.props.query)}handleFolderIcon(){this.handleOpenFile(this.getFolderId())}handleOpenFile(e){this.handleBrowse(this.getFolderId(),e,this.props.query)}handleSubmitEditor(e,t,n){let o=null;if("action_insert"===t&&"select"===this.props.type){const t=this.getFiles().find((t=>t.id===parseInt(e.ID,10)));return this.props.onInsertMany(null,[t]),this.setState({forceRefetch:!0}),Promise.resolve()}if("function"==typeof this.props.onSubmitEditor){const i=this.findFile(this.props.fileId);o=this.props.onSubmitEditor(e,t,n,i)}else o=n();if(!o)throw new Error("Promise was not returned for submitting");return this.setState({forceRefetch:!0}),o.then((e=>("action_createfolder"===t?"admin"===this.props.type?this.handleOpenFile(e.record.id):this.handleOpenFolder(this.getFolderId()):"action_save"!==t&&"action_publish"!==t||this.getFolderId()===e.record.parent.id||this.handleBrowse(e.record.parent.id,e.record.id,null),e)))}handleCloseFile(){this.handleBrowse(this.getFolderId(),null,this.props.query)}handleOpenFolder(e){const{page:t,filter:n,...o}=this.props.query;this.handleBrowse(e,null,o)}handleDelete(e){this.props.actions.confirmDeletion.deleting();const t=e.map((e=>{const t=this.findFile(e);if(!t)throw new Error(`File selected for deletion cannot be found: ${e}`);return t.queuedId&&this.props.actions.queuedFiles.removeQueuedFile(t.queuedId),t})).map((e=>e.id)),n=this.state.folder,o=n?n.id:0,i=this.props.sectionConfig.endpoints.delete.url;return s.default.post(i,{ids:t},{"X-SecurityID":E.default.get("SecurityID")}).then((()=>{this.handleBrowse(o,null,this.props.query);this.props.queuedFiles.items.filter((e=>t.includes(e.id))).forEach((e=>{e.queuedId&&this.props.actions.queuedFiles.removeQueuedFile(e.queuedId)}));let e="AssetAdmin.BULK_ACTIONS_DELETE_SUCCESS_02",n="%s folders/files were successfully deleted.";this.props.sectionConfig.filesAreVersioned&&this.props.sectionConfig.archiveFiles&&(e="AssetAdmin.BULK_ACTIONS_ARCHIVE_SUCCESS_02",n="%s folders/files were successfully archived."),this.props.actions.toasts.success(a.default.sprintf(a.default._t(e,n),t.length)),this.props.actions.gallery.deselectFiles(),this.refetchFolder()})).catch((async e=>{const t=await(0,w.default)(e);this.props.actions.toasts.error(t)})).finally((()=>this.props.actions.confirmDeletion.reset()))}doUnpublish(e){const t=e.map((e=>{const t=this.findFile(e);if(!t)throw new Error(`File selected for unpublishing cannot be found: ${e}`);if("folder"===t.type)throw new Error("Cannot unpublish folders");return t})),n=t.map((e=>e.id)),o=n.map((e=>`ids[]=${e}`)).join("&");let i=`${this.props.sectionConfig.endpoints.readLiveOwnerCounts.url}?${o}`;return s.default.get(i).then((async e=>{const t=(await e.json()).filter((e=>e.count>0)),n=t.slice(0,4).map((e=>e.message)),o=t.slice(5).length;let i="";if(o>0&&(i=a.default.inject(a.default._t("AssetAdmin.BULK_OWNED_WARNING_REMAINING","And {count} other file(s)"),{count:o})),n.length){const e=[a.default.inject(a.default._t("AssetAdmin.BULK_OWNED_WARNING_HEADING","{count} file(s) are being used by other published content."),{count:n.length}),...n,i,a.default._t("AssetAdmin.BULK_OWNED_WARNING_FOOTER","Unpublishing will only remove files from the published version of the content. They will remain on the draft version. Unpublish anyway?")].filter((e=>e)).join("\n\n");if(!confirm(e))return Promise.reject()}return Promise.resolve()})).then((()=>(i=this.props.sectionConfig.endpoints.unpublish.url,s.default.post(i,{ids:n},{"X-SecurityID":E.default.get("SecurityID")}).catch((async e=>{const t=await(0,w.default)(e);this.props.actions.toasts.error(t)}))))).then((()=>(this.refetchFolder(),t))).catch((async e=>{const t=await(0,w.default)(e);return this.props.actions.toasts.error(t),[]}))}handleUnpublish(e){return this.doUnpublish(e).then((e=>{const{fileId:t}=this.props;this.refetchFolder().then((()=>{t&&e.find((e=>e.id===t))&&this.props.resetFileDetails(this.getFolderId(),t,this.props.query)}))}))}doPublish(e){const t=e.map((e=>{const t=this.findFile(e);if(!t)throw new Error(`File selected for publishing cannot be found: ${e}`);if("folder"===t.type)throw new Error("Cannot publish folders");return t})),n=t.map((e=>e.id)),o=this.props.sectionConfig.endpoints.publish.url;return s.default.post(o,{ids:n},{"X-SecurityID":E.default.get("SecurityID")}).then((()=>(t.forEach((e=>this.resetFile(e))),this.refetchFolder(),t))).catch((async e=>{const t=await(0,w.default)(e);this.props.actions.toasts.error(t)}))}findFile(e){return this.getFiles().find((t=>t.id===parseInt(e,10)))}handleUpload(){}handleUploadQueue(){this.props.fileId&&this.refetchFolder()}handleCreateFolder(){this.props.onBrowse(this.getFolderId(),null,this.props.query,y.default.ACTIONS.CREATE_FOLDER)}handleMoveFilesSuccess(e,t){this.props.queuedFiles.items.filter((e=>t.includes(e.id))).forEach((e=>{e.queuedId&&this.props.actions.queuedFiles.removeQueuedFile(e.queuedId)})),this.props.actions.gallery.deselectFiles(),this.refetchFolder()}renderGallery(){const{GalleryComponent:e}=this.props,t=this.props.sectionConfig,n=t.endpoints.createFile.url,i=t.endpoints.createFile.method,r=this.props.query&&parseInt(this.props.query.limit||t.limit,10),l=this.props.query&&parseInt(this.props.query.page||1,10),s=this.props.query&&this.props.query.sort,a=this.props.query&&this.props.query.view,u=this.props.query.filter||{},d=this.state.folder,c=this.state.loading;return o.default.createElement(e,{files:this.getFiles(),fileId:this.props.fileId,folderId:this.getFolderId(),folder:d,type:this.props.type,limit:r,page:l,totalCount:this.state.totalCount,view:a,filters:u,createFileApiUrl:n,createFileApiMethod:i,onInsertMany:this.props.onInsertMany,onPublish:this.doPublish,onUnpublish:this.doUnpublish,onOpenFile:this.handleOpenFile,onOpenFolder:this.handleOpenFolder,onSuccessfulUpload:this.handleUpload,onSuccessfulUploadQueue:this.handleUploadQueue,onCreateFolder:this.handleCreateFolder,onMoveFilesSuccess:this.handleMoveFilesSuccess,onClearSearch:this.handleClearSearch,onSort:this.handleSort,onSetPage:this.handleSetPage,onViewChange:this.handleViewChange,sort:s,sectionConfig:t,loading:c,maxFilesSelect:this.props.maxFiles,dialog:this.props.dialog})}renderEditor(){const{sectionConfig:e,viewAction:t,type:n,fileId:i,dialog:r,requireLinkText:l,fileSelected:s,EditorComponent:a}=this.props,{schemaUrl:u,targetId:d}=(0,C.default)({config:e,viewAction:t,folderId:this.getFolderId(),type:n,fileId:i});if(!u)return null;const c=[];l&&c.push({name:"requireLinkText",value:!0}),s&&c.push({name:"fileSelected",value:!0});const f={dialog:r,fileId:d,schemaUrl:u,schemaUrlQueries:c,onClose:this.handleCloseFile,onSubmit:this.handleSubmitEditor,onUnpublish:this.handleUnpublish,addToCampaignSchemaUrl:e.form.addToCampaignForm?.schemaUrl};return o.default.createElement(a,f)}render(){const{folderId:e,query:t,getUrl:n,type:i,maxFiles:r,toolbarChildren:l,SearchComponent:s,BulkDeleteConfirmationComponent:a}=this.props;if(null===this.state.folder)return null;const d=Boolean(e||(0,v.hasFilters)(t.filter)),c=this.props.sectionConfig.form.fileSearchForm.schemaUrl,f=t.filter||{},p=(0,u.default)("fill-height asset-admin","select"===i&&{"asset-admin--single-select":1===r,"asset-admin--multi-select":1!==r}),h=(0,v.hasFilters)(t.filter)||this.props.showSearch,g=this.props.actions.displaySearch?this.props.actions.displaySearch.toggleSearch:void 0,y=this.state.folder,_={folder:y,query:t,getUrl:n,onBrowse:this.handleBrowse,onFolderIcon:this.handleFolderIcon};return o.default.createElement("div",{className:p},o.default.createElement(m.default,{showBackButton:d,onBackButtonClick:this.handleBackButtonClick},y&&o.default.createElement(I.default,_),o.default.createElement("div",{className:"asset-admin__toolbar-extra pull-xs-right fill-width vertical-align-items"},o.default.createElement(b.default,{toggled:h,onToggle:g}),l)),h&&o.default.createElement(s,{onSearch:this.handleDoSearch,id:"AssetSearchForm",formSchemaUrl:c,onHide:this.handleClearSearch,displayBehavior:"HIDEABLE",filters:f,name:"name"}),o.default.createElement("div",{className:"flexbox-area-grow fill-width fill-height gallery"},this.renderGallery(),this.renderEditor()),o.default.createElement(a,{onConfirm:this.handleDelete,filesAreVersioned:this.props.sectionConfig.filesAreVersioned,archiveFiles:this.props.sectionConfig.archiveFiles}))}}t.Component=M,M.propTypes={dialog:i.default.bool,sectionConfig:_.default,fileId:i.default.number,folderId:i.default.number,resetFileDetails:i.default.func,onBrowse:i.default.func,onReplaceUrl:i.default.func,onInsertMany:i.default.func,getUrl:i.default.func,query:i.default.shape({sort:i.default.string,limit:i.default.oneOfType([i.default.number,i.default.string]),page:i.default.oneOfType([i.default.number,i.default.string]),filter:i.default.object}),onSubmitEditor:i.default.func,type:i.default.oneOf(["insert-media","insert-link","select","admin"]),queuedFiles:i.default.shape({items:i.default.array.isRequired}),filesTotalCount:i.default.number,loading:i.default.bool,actions:i.default.object,maxFiles:i.default.number,fileSelected:i.default.bool,EditorComponent:i.default.oneOfType([i.default.object,i.default.func]),GalleryComponent:i.default.oneOfType([i.default.object,i.default.func]),SearchComponent:i.default.oneOfType([i.default.object,i.default.func]),BulkDeleteConfirmationComponent:i.default.oneOfType([i.default.object,i.default.func])},M.defaultProps={type:"admin",query:{sort:"",limit:null,page:0,filter:{}},maxFiles:null,EditorComponent:h.default,GalleryComponent:g.default,SearchComponent:v.default,BulkDeleteConfirmationComponent:F.default};t.default=(0,l.compose)((0,r.connect)((function(e,t){const{formSchema:n}=e.assetAdmin.modal;return{securityId:e.config.SecurityID,queuedFiles:e.assetAdmin.queuedFiles,showSearch:e.assetAdmin.displaySearch.isOpen,type:n&&n.type||t.type}}),(function(e){return{actions:{gallery:(0,l.bindActionCreators)(d,e),toasts:(0,l.bindActionCreators)(c,e),displaySearch:(0,l.bindActionCreators)(p,e),queuedFiles:(0,l.bindActionCreators)(f,e),confirmDeletion:(0,l.bindActionCreators)(S,e)}}})))(M)},2308:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(1594)),i=a(n(6935)),r=a(n(5815)),l=n(6418),s=n(6303);function a(e){return e&&e.__esModule?e:{default:e}}const u=e=>{let{folder:t,query:n,getUrl:i,onBrowse:l,onFolderIcon:a,PlainBreadcrumbComponent:u}=e;const d=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return e=>{e.preventDefault(),l(...t)}},c=function(){return i&&i(...arguments)},f=[{text:r.default._t("AssetAdmin.FILES","Files"),href:c(0,null,n),onClick:d(0,null,n)}];if(t&&t.id){t.ancestors&&t.ancestors.forEach((e=>{f.push({text:e.title,href:c(e.id,null,n),onClick:d(e.id,null,n)})}));const e=[{className:"icon font-icon-edit-list",onClick:e=>{e.preventDefault(),a()}}];t.hasRestrictedAccess&&e.push({nodeName:"FileStatusIcon",hasRestrictedAccess:!0}),f.push({text:t.title,href:c(t.id,null,n),onClick:d(t.id,null,n),icons:e})}return(0,s.hasFilters)(n.filter)&&f.push({text:r.default._t("LeftAndMain.SEARCHRESULTS","Search results")}),o.default.createElement(u,{multiline:!0,crumbs:f})};u.propTypes={onBrowse:i.default.func,onFolderIcon:i.default.func,getUrl:i.default.func,query:i.default.shape({sort:i.default.string,limit:i.default.oneOfType([i.default.number,i.default.string]),page:i.default.oneOfType([i.default.number,i.default.string]),filter:i.default.object,view:i.default.string}),folder:i.default.shape({id:i.default.number,title:i.default.string,ancestors:i.default.array,parentId:i.default.number,canView:i.default.bool,canEdit:i.default.bool}),PlainBreadcrumbComponent:i.default.oneOfType([i.default.object,i.default.func])},u.defaultProps={PlainBreadcrumbComponent:l.Component};t.default=u},4736:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0,t.buildUrl=b,t.default=void 0;var o=m(n(1594)),i=n(6545),r=n(9040),l=m(n(6478)),s=h(n(7917)),a=n(5716),u=h(n(7675)),d=h(n(6379)),c=h(n(4350)),f=n(5125),p=h(n(6935));function h(e){return e&&e.__esModule?e:{default:e}}function g(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(g=function(e){return e?n:t})(e)}function m(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=g(t);if(n&&n.has(e))return n.get(e);var o={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&{}.hasOwnProperty.call(e,r)){var l=i?Object.getOwnPropertyDescriptor(e,r):null;l&&(l.get||l.set)?Object.defineProperty(o,r,l):o[r]=e[r]}return o.default=e,n&&n.set(e,o),o}const v=Object.keys(d.default.ACTIONS).map((e=>d.default.ACTIONS[e]));function b(e){let{base:t,folderId:n,fileId:o,query:i,action:r}=e;if(r&&-1===v.indexOf(r))throw new Error(`Invalid action provided: ${r}`);let l=null;l=o?(0,f.joinUrlPaths)(t,`show/${n}/${d.default.ACTIONS.EDIT_FILE}/${o}`):n?(0,f.joinUrlPaths)(t,`show/${n}`):t,r===d.default.ACTIONS.CREATE_FOLDER&&(l=(0,f.joinUrlPaths)(t,`show/${n||0}/${r}`));return i&&Object.keys(i).length>0&&(l=`${l}?${u.default.stringify(i)}`),l}class y extends o.Component{constructor(e){super(e),this.handleBrowse=this.handleBrowse.bind(this),this.handleReplaceUrl=this.handleReplaceUrl.bind(this),this.handleResetDetails=this.handleResetDetails.bind(this),this.getUrl=this.getUrl.bind(this)}getUrl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:d.default.ACTIONS.EDIT_FILE;const i=parseInt(e||0,10),r=parseInt(t||0,10),l=i!==this.getFolderId(),s=Object.assign({},n);return(l||s.page<=1)&&delete s.page,b({base:`/${this.props.sectionConfig.reactRoutePath}`,folderId:i,fileId:r,query:s,action:o})}getFolderId(){return this.props.router.params&&this.props.router.params.folderId?parseInt(this.props.router.params.folderId,10):0}getFileId(){return this.props.router.params&&this.props.router.params.fileId?parseInt(this.props.router.params.fileId,10):0}getViewAction(){return this.props.router.params&&this.props.router.params.viewAction?this.props.router.params.viewAction:d.default.ACTIONS.EDIT_FILE}getSectionProps(){return{sectionConfig:this.props.sectionConfig,type:"admin",folderId:this.getFolderId(),viewAction:this.getViewAction(),fileId:this.getFileId(),query:this.getQuery(),getUrl:this.getUrl,onBrowse:this.handleBrowse,onReplaceUrl:this.handleReplaceUrl,resetFileDetails:this.handleResetDetails}}getQuery(){return(0,a.decodeQuery)(this.props.router.location.search)}handleBrowse(e,t,n,o){const i=this.getUrl(e,t,n,o);this.props.router.navigate(i)}handleReplaceUrl(e,t,n,o){const i=this.getUrl(e,t,n,o);this.props.router.navigate(i,{replace:!0})}handleResetDetails(e,t,n){const o=this.getUrl(e,t,n),i=this.getUrl(e,null,n);this.props.router.navigate(i,{replace:!0,state:{reset:!0,resetPath:o}})}render(){const{AssetAdminComponent:e}=this.props,t=this.props.router.location.state;return t&&t&&t.reset?o.default.createElement(i.Navigate,{to:t.resetPath,replace:!0}):this.props.sectionConfig?o.default.createElement(e,this.getSectionProps()):null}}t.Component=y,y.propTypes={sectionConfig:c.default,router:l.routerPropTypes,AssetAdminComponent:p.default.oneOfType([p.default.object,p.default.func])},y.defaultProps={AssetAdminComponent:s.default};t.default=(0,l.default)((0,r.connect)((function(e){return{sectionConfig:e.config.sections.find((e=>"SilverStripe\\AssetAdmin\\Controller\\AssetAdmin"===e.name))}}))(y))},2908:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.AssetAdminStateRouter=void 0;var 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=d(t);if(n&&n.has(e))return n.get(e);var o={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&{}.hasOwnProperty.call(e,r)){var l=i?Object.getOwnPropertyDescriptor(e,r):null;l&&(l.get||l.set)?Object.defineProperty(o,r,l):o[r]=e[r]}return o.default=e,n&&n.set(e,o),o}(n(1594)),i=u(n(6935)),r=n(9040),l=n(4736),s=u(n(6379)),a=n(1021);function u(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 c={folderId:null,fileId:null,query:{},action:s.default.ACTIONS.EDIT_FILE};class f extends o.Component{constructor(e){super(e),this.handleBrowse=this.handleBrowse.bind(this),this.getUrl=this.getUrl.bind(this),this.state=Object.assign({},c,{folderId:e.folderId})}getUrl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:s.default.ACTIONS.EDIT_FILE;const i=parseInt(e||0,10),r=parseInt(t||0,10),a=this.getFolderId(),u=i!==a&&null!==a,d=Object.assign({},n);return(u||d.page<=1)&&delete d.page,(0,l.buildUrl)({base:this.props.sectionConfig.reactRoutePath,folderId:i,fileId:r,query:d,action:o})}getFolderId(){return null===this.state.folderId?null:parseInt(this.state.folderId||0,10)}getFileId(){return parseInt(this.state.fileId||this.props.fileId||0,10)}getViewAction(){return this.state.action||s.default.ACTIONS.EDIT_FILE}getSectionProps(){const e=Object.assign({},this.props,{folderId:this.getFolderId(),fileId:this.getFileId(),viewAction:this.getViewAction(),query:this.state.query,getUrl:this.getUrl,onBrowse:this.handleBrowse});return delete e.Component,e}handleBrowse(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:s.default.ACTIONS.EDIT_FILE;if(o&&-1===Object.values(s.default.ACTIONS).indexOf(o))throw new Error(`Invalid action provided: ${o}`);this.state.fileId!==t&&this.props.actions.resetFormStack(),this.setState({folderId:e,fileId:t,query:n,action:o})}render(){const e=this.getSectionProps(),t=this.props.Component;return o.default.createElement(t,e)}}function p(e){return{actions:{resetFormStack:()=>e((0,a.resetFormStack)())}}}t.AssetAdminStateRouter=f,f.propTypes={Component:i.default.elementType,sectionConfig:i.default.shape({url:i.default.string.isRequired}).isRequired,fileId:i.default.number};t.default=function(e){return(0,r.connect)((function(t){const n=t.config.sections.find((e=>"SilverStripe\\AssetAdmin\\Controller\\AssetAdmin"===e.name));return{Component:e,sectionConfig:n}}),p)(f)}},175:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var o=_(n(1594)),i=n(9367),r=n(9040),l=b(n(6935)),s=n(5207),a=_(n(4461)),u=_(n(762)),d=_(n(8918)),c=b(n(5815)),f=b(n(6022)),p=b(n(5609)),h=b(n(6177)),g=b(n(4014)),m=b(n(134)),v=b(n(7871));function b(e){return e&&e.__esModule?e:{default:e}}function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(y=function(e){return e?n:t})(e)}function _(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=y(t);if(n&&n.has(e))return n.get(e);var o={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&{}.hasOwnProperty.call(e,r)){var l=i?Object.getOwnPropertyDescriptor(e,r):null;l&&(l.get||l.set)?Object.defineProperty(o,r,l):o[r]=e[r]}return o.default=e,n&&n.set(e,o),o}function E(){return E=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},E.apply(null,arguments)}const S=e=>{let{LoadingComponent:t,transition:n,files:i,onModalClose:r,onCancel:l,onConfirm:s,filesAreVersioned:a,archiveFiles:d,actions:f}=e;const[b,y]=(0,o.useState)(!0),[_,E]=(0,o.useState)({});(0,o.useEffect)((()=>{const e=h.default.getSection("SilverStripe\\AssetAdmin\\Controller\\AssetAdmin"),t=i.map((e=>e.id)).map((e=>`ids[]=${e}`)).join("&"),n=`${e.endpoints.readDescendantCounts.url}?${t}`;y(!0),p.default.get(n).then((async e=>{const t=await e.json();y(!1),E(t)})).catch((async e=>{const t=await(0,g.default)(e);f.toasts.error(t)}))}),[i]);let S=null;const C=a&&d?"AssetAdmin.ARCHIVE":"AssetAdmin.DELETE",w=a&&d?"Archive":"Delete";let F=[{label:c.default._t(C,w),handler:()=>s(i.map((e=>{let{id:t}=e;return t}))),color:"danger"},{label:c.default._t("AssetAdmin.CANCEL","Cancel"),handler:l}];if(b)S=o.default.createElement(t,null);else{const e=_.filter((e=>"folder"===e.type)).length,t=_.filter((e=>"file"===e.type)).length,n=_.reduce(((e,t)=>e+t.count),0),r={topLevelFolderCount:e,topLevelFileCount:t,descendantFileCount:n,filesAreVersioned:a,archiveFiles:d};S=o.default.createElement(v.default,r),t+n>0&&(F=[{label:c.default._t("AssetAdmin.CANCEL","Cancel"),handler:l,color:"primary"},{label:c.default._t(C,w),handler:()=>s(i.map((e=>{let{id:t}=e;return t}))),color:"danger"}])}const I=![u.CANCELING,u.DELETING].includes(n);return o.default.createElement(m.default,{body:S,isOpen:I,actions:F,onCancel:l,onClosed:r,filesAreVersioned:a,archiveFiles:d})};t.Component=S,S.propTypes={LoadingComponent:l.default.elementType,transition:l.default.oneOf(["canceling","deleting",!1]),files:l.default.arrayOf(f.default),descendantFileCounts:l.default.object,onCancel:l.default.func.isRequired,onModalClose:l.default.func.isRequired,onConfirm:l.default.func.isRequired,filesAreVersioned:l.default.bool.isRequired,archiveFiles:l.default.bool.isRequired,actions:l.default.object.isRequired};const C=(0,i.compose)((0,s.inject)(["Loading"],(e=>({LoadingComponent:e}))))(S);t.default=(0,i.compose)((0,r.connect)((e=>{let{assetAdmin:{confirmDeletion:t}}=e;return t}),(e=>({onCancel:()=>e(a.cancel()),onModalClose:()=>e(a.modalClose()),actions:{toasts:(0,i.bindActionCreators)(d,e),confirmation:(0,i.bindActionCreators)(a,e)}}))))((e=>{let{showConfirmation:t,files:n,...i}=e;return t&&n.length>0?o.default.createElement(C,E({},i,{files:n})):null}))},7871:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=l(n(5815)),i=l(n(1594)),r=l(n(6935));function l(e){return e&&e.__esModule?e:{default:e}}const s=e=>{let{topLevelFolderCount:t,topLevelFileCount:n,descendantFileCount:r,filesAreVersioned:l,archiveFiles:s}=e,a="AssetAdmin.BULK_ACTIONS_DELETE_WARNING",u="Ensure files are removed from content areas prior to deleting them, otherwise they will appear as broken links.";l&&s&&(a="AssetAdmin.BULK_ACTIONS_ARCHIVE_WARNING",u="Ensure files are removed from content areas prior to archiving them, otherwise they will appear as broken links.");const d=((e,t,n,i,r)=>{const l=t+n;if(l>0){let e="AssetAdmin.BULK_ACTIONS_DELETE_ITEMS_CONFIRM",t=["You're about to delete %s file(s) which may be used in your site's content.","Carefully check the file usage on the files before deleting the file(s)."].join(" ");return i&&r&&(e="AssetAdmin.BULK_ACTIONS_ARCHIVE_ITEMS_CONFIRM",t=["You're about to archive %s file(s) which may be used in your site's content.","Carefully check the file usage on the files before archiving the file(s)."].join(" ")),o.default.sprintf(o.default._t(e,t),l)}if(1===e){let e="AssetAdmin.BULK_ACTIONS_DELETE_FOLDER_CONFIRM",t="Are you sure you want to delete this folder?";return i&&r&&(e="AssetAdmin.BULK_ACTIONS_ARCHIVE_FOLDER_CONFIRM",t="Are you sure you want to archive this folder?"),o.default._t(e,t)}let s="AssetAdmin.BULK_ACTIONS_DELETE_FOLDERS_CONFIRM",a="Are you sure you want to delete these folders?";return i&&r&&(s="AssetAdmin.BULK_ACTIONS_ARCHIVE_FOLDERS_CONFIRM",a="Are you sure you want to archive these folders?"),o.default._t(s,a)})(t,n,r,l,s);return i.default.createElement(i.default.Fragment,null,i.default.createElement("p",null,d),n+r>0&&i.default.createElement("p",null,o.default._t(a,u)))};s.propTypes={topLevelFolderCount:r.default.number,topLevelFileCount:r.default.number,descendantFileCount:r.default.number},s.defaultProps={topLevelFolderCount:0,topLevelFileCount:0,descendantFileCount:0};t.default=s},134:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=s(n(5815)),i=s(n(1594)),r=s(n(6935)),l=n(3556);function s(e){return e&&e.__esModule?e:{default:e}}const a=e=>{let{isOpen:t,body:n,onCancel:r,actions:s,filesAreVersioned:a,archiveFiles:u}=e,d="AssetAdmin.CONFIRM_FILE_DELETION",c="Confirm deletion";return a&&u&&(d="AssetAdmin.CONFIRM_FILE_ARCHIVE",c="Confirm archive"),i.default.createElement(l.Modal,{isOpen:t,toggle:r},i.default.createElement(l.ModalHeader,{toggle:r},o.default._t(d,c)),i.default.createElement(l.ModalBody,null,n),i.default.createElement(l.ModalFooter,null,s.map((e=>{let{label:t,handler:n,color:o}=e;return i.default.createElement(l.Button,{key:t,color:o,onClick:n},t)}))))};a.propTypes={isOpen:r.default.bool.isRequired,body:r.default.node.isRequired,onCancel:r.default.func.isRequired,actions:r.default.arrayOf(r.default.shape({label:r.default.string.isRequired,handler:r.default.func,color:r.default.string})),filesAreVersioned:r.default.bool.isRequired,archiveFiles:r.default.bool.isRequired};t.default=a},1869:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var o=C(n(5815)),i=n(9040),r=n(9367),l=S(n(1594)),s=C(n(6379)),a=C(n(55)),u=C(n(8737)),d=S(n(9077)),c=C(n(6935)),f=n(5207),p=C(n(6177)),h=C(n(5609)),g=S(n(4461)),m=S(n(1021)),v=C(n(6923)),b=C(n(7008)),y=C(n(7675)),_=S(n(1584));function E(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(E=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=E(t);if(n&&n.has(e))return n.get(e);var o={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&{}.hasOwnProperty.call(e,r)){var l=i?Object.getOwnPropertyDescriptor(e,r):null;l&&(l.get||l.set)?Object.defineProperty(o,r,l):o[r]=e[r]}return o.default=e,n&&n.set(e,o),o}function C(e){return e&&e.__esModule?e:{default:e}}function w(){return w=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},w.apply(null,arguments)}class F extends l.Component{constructor(e){super(e),this.getFormSchemaUrl=this.getFormSchemaUrl.bind(this),this.handleCancelKeyDown=this.handleCancelKeyDown.bind(this),this.handleClose=this.handleClose.bind(this),this.handleSubmit=this.handleSubmit.bind(this),this.handleAction=this.handleAction.bind(this),this.handleLoadingSuccess=this.handleLoadingSuccess.bind(this),this.handleLoadingError=this.handleLoadingError.bind(this),this.handleFetchingSchema=this.handleFetchingSchema.bind(this),this.closeModal=this.closeModal.bind(this),this.openModal=this.openModal.bind(this),this.createFn=this.createFn.bind(this),this.editorHeader=this.editorHeader.bind(this),this.state={openModal:!1,loadingForm:!1,loadingError:null,file:null}}componentDidMount(){this.refetchFile()}componentDidUpdate(e){e.fileId!==this.props.fileId&&null!==e.fileId&&this.refetchFile()}refetchFile(){const e=`${p.default.getSection("SilverStripe\\AssetAdmin\\Controller\\AssetAdminOpen").endpoints.read.url}/${this.props.fileId}`;h.default.get(e).then((e=>e.json())).then((e=>{this.setState({file:e})}))}getFormSchemaUrl(){const{schemaUrlQueries:e,schemaUrl:t,fileId:n}=this.props,o=b.default.parse(t),i=e.reduce(((e,t)=>{let{name:n,value:o}=t;return{...e,[n]:o}}),{});return b.default.format({...o,pathname:`${o.path}/${n}`,search:y.default.stringify(i)})}handleAction(e){const t=this.state.file;switch(e.currentTarget.name){case"action_addtocampaign":this.openModal(),e.preventDefault();break;case"action_replacefile":this.replaceFile(),e.preventDefault();break;case"action_downloadfile":this.downloadFile(),e.preventDefault();break;case"action_delete":this.props.actions.confirmDeletion.confirm([t]),e.preventDefault()}}handleCancelKeyDown(e){e.keyCode!==s.default.SPACE_KEY_CODE&&e.keyCode!==s.default.RETURN_KEY_CODE||this.handleClose(e)}handleSubmit(e,t,n){const{showingSubForm:o,actions:i}=this.props;return"function"==typeof this.props.onSubmit?this.props.onSubmit(e,t,n).finally((()=>{o&&-1!==["action_save","action_publish"].indexOf(t)&&i.modal.popFormStackEntry()})):n()}handleClose(e){const{showingSubForm:t,onClose:n,actions:o}=this.props;t?o.modal.popFormStackEntry():(n(),this.closeModal()),e&&e.preventDefault()}openModal(){this.setState({openModal:!0})}closeModal(){this.setState({openModal:!1})}replaceFile(){const e=document.querySelector(".dz-input-PreviewImage");e&&e.click()}downloadFile(){const e=this.state.file;!function(e,t){const n=document.createElement("a");n.download=t,n.href=e,document.body.appendChild(n),n.click(),document.body.removeChild(n)}(e.url,e.name),document.getElementById("Form_fileEditForm_PopoverActions").focus()}handleLoadingError(e){this.setState({loadingForm:!1,loadingError:e.errors[0]})}handleLoadingSuccess(){this.setState({loadingForm:!1,loadingError:null})}handleFetchingSchema(){this.setState({loadingForm:!0})}editorHeader(e){let{SchemaComponent:t,...n}=e;const{dialog:o,nextType:i,showingSubForm:r,actions:s,EditorHeaderComponent:a}=this.props,u=this.getFormSchemaUrl(),d=this.state.file;let c=_.buttonStates.SWITCH;o&&d&&"folder"!==d.type&&(c=r?_.buttonStates.ALWAYS_BACK:_.buttonStates.ONLY_BACK);const{formid:f}=n,p=i&&d&&"folder"!==d.type?()=>{s.modal.stashFormValues(f,u),s.modal.pushFormStackEntry(i)}:void 0,h={onCancel:this.handleClose,showButton:c,onDetails:p};return l.default.createElement(a,h,l.default.createElement(t,n))}createFn(e,t){if("AssetEditorHeaderFieldGroup"===t.name){const n=this.editorHeader,o={key:t.id,SchemaComponent:e,...t};return l.default.createElement(n,o)}return l.default.createElement(e,w({key:t.id},t))}render(){if(!this.state.file)return null;const{FormBuilderLoaderComponent:e,FormBuilderModalComponent:t}=this.props,n=this.getFormSchemaUrl(),i=`${this.props.addToCampaignSchemaUrl}/${this.props.fileId}`,r=(0,v.default)("panel","form--no-dividers","editor",{"editor--asset-dropzone--disable":!this.props.enableDropzone},this.props.className);let s=null;if(this.state.loadingError){let e=this.state.loadingError.value;404===this.state.loadingError.code&&(e=o.default._t("AssetAdmin.FILE_MISSING","File cannot be found")),e||(e=o.default._t("Admin.UNKNOWN_ERROR","An unknown error has occurred")),s=l.default.createElement("div",{className:"editor__file-preview-message--file-missing"},e)}const a=o.default._t("Admin.ADD_TO_CAMPAIGN","Add to campaign"),u=this.props.loadingComponent;return l.default.createElement("div",{className:r},l.default.createElement("div",{className:"editor__details fill-height"},l.default.createElement(e,{identifier:"AssetAdmin.EditForm",schemaUrl:n,onSubmit:this.handleSubmit,onAction:this.handleAction,onLoadingSuccess:this.handleLoadingSuccess,onLoadingError:this.handleLoadingError,onFetchingSchema:this.handleFetchingSchema,createFn:this.createFn,file:this.state.file}),s,l.default.createElement(t,{title:a,identifier:"AssetAdmin.AddToCampaign",isOpen:this.state.openModal,onClosed:this.closeModal,schemaUrl:i,bodyClassName:"modal__dialog",responseClassBad:"modal__response modal__response--error",responseClassGood:"modal__response modal__response--good"}),this.state.loadingForm&&l.default.createElement(u,null)))}}t.Component=F,F.propTypes={className:c.default.string,fileId:c.default.number.isRequired,enableDropzone:c.default.bool,dialog:c.default.bool,onClose:c.default.func.isRequired,onSubmit:c.default.func.isRequired,schemaUrl:c.default.string.isRequired,schemaUrlQueries:c.default.arrayOf(c.default.shape({name:c.default.string,value:c.default.any})),addToCampaignSchemaUrl:c.default.string,actions:c.default.object,showingSubForm:c.default.bool,nextType:c.default.string,EditorHeaderComponent:c.default.oneOfType([c.default.object,c.default.func]),FormBuilderLoaderComponent:c.default.oneOfType([c.default.object,c.default.func]),FormBuilderModalComponent:c.default.oneOfType([c.default.object,c.default.func])},F.defaultProps={EditorHeaderComponent:_.default,FormBuilderLoaderComponent:a.default,FormBuilderModalComponent:u.default};t.default=(0,r.compose)((0,f.inject)(["Loading"],(e=>({loadingComponent:e})),(()=>"AssetAdmin.Editor")),(0,i.connect)((function(e){let{assetAdmin:{gallery:t,modal:n}}=e;return{enableDropzone:t.enableDropzone,nextType:n.formSchema&&n.formSchema.nextType,showingSubForm:n.formSchemaStack&&n.formSchemaStack.length>1}}),(function(e){return{actions:{unsavedForms:(0,r.bindActionCreators)(d,e),confirmDeletion:(0,r.bindActionCreators)(g,e),modal:(0,r.bindActionCreators)(m,e)}}})))(F)},1584:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.buttonStates=void 0;var o=u(n(1594)),i=u(n(5815)),r=u(n(551)),l=u(n(2164)),s=u(n(6935)),a=u(n(6923));function u(e){return e&&e.__esModule?e:{default:e}}const d=e=>t=>{t.preventDefault(),e&&e()},c="ALWAYS_BACK",f="ALWAYS_CANCEL",p="SWITCH",h="ONLY_BACK",g="ONLY_CANCEL",m=t.buttonStates={ALWAYS_BACK:c,ALWAYS_CANCEL:f,SWITCH:p,ONLY_BACK:h,ONLY_CANCEL:g,NONE:"NONE"},v=e=>{let{onCancel:t,onDetails:n,showButton:s,children:u}=e;const m=d(t),v=[c,p,h].indexOf(s)>=0,b=[f,p,g].indexOf(s)>=0,y=(0,a.default)("editor-header__back-button","btn--icon-xl",{"editor-header__back-button--md-below":[p,h].indexOf(s)>=0}),_=(0,a.default)("editor-header__cancel-button","btn--icon-xl",{"editor-header__cancel-button--lg-above":[p,g].indexOf(s)>=0});return o.default.createElement("div",{className:"editor-header"},v&&o.default.createElement(l.default,{className:y,onClick:m}),o.default.createElement("div",{className:"editor-header__field"},u),n&&o.default.createElement(r.default,{onClick:d(n),icon:"edit-list",className:"editor-header__edit",outline:!0},i.default._t("AssetAdmin.DETAILS","Details")),b&&o.default.createElement("div",null,o.default.createElement(r.default,{icon:"cancel",className:_,noText:!0,onClick:m},i.default._t("AssetAdmin.CANCEL"))))};v.propTypes={onCancel:s.default.func,onDetails:s.default.func,showButton:s.default.oneOf(Object.keys(m).map((e=>m[e]))),children:s.default.node};t.default=v},5789:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.galleryViewPropTypes=t.galleryViewDefaultProps=t.default=t.Component=void 0;var o=R(n(1669)),i=R(n(5815)),r=O(n(1594)),l=n(9040),s=n(9367),a=R(n(853)),u=R(n(3229)),d=R(n(2853)),c=R(n(6609)),f=R(n(6379)),p=R(n(6621)),h=O(n(4201)),g=O(n(8918)),m=O(n(1369)),v=O(n(4461)),b=n(4172),y=R(n(4350)),_=R(n(6177)),E=R(n(9247)),S=n(5207),C=R(n(6935)),w=R(n(5609)),F=R(n(5769)),I=R(n(3863));function A(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(A=function(e){return e?n:t})(e)}function O(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=A(t);if(n&&n.has(e))return n.get(e);var o={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&{}.hasOwnProperty.call(e,r)){var l=i?Object.getOwnPropertyDescriptor(e,r):null;l&&(l.get||l.set)?Object.defineProperty(o,r,l):o[r]=e[r]}return o.default=e,n&&n.set(e,o),o}function R(e){return e&&e.__esModule?e:{default:e}}const M={DELETE:"delete",ARCHIVE:"archive",EDIT:"edit",MOVE:"move",PUBLISH:"publish",UNPUBLISH:"unpublish",INSERT:"insert",ADMIN:"admin",SELECT:"select"};class D extends r.Component{constructor(e){super(e),this.handleOpenFolder=this.handleOpenFolder.bind(this),this.handleOpenFile=this.handleOpenFile.bind(this),this.handleSelect=this.handleSelect.bind(this),this.handleAddedFile=this.handleAddedFile.bind(this),this.handlePreviewLoaded=this.handlePreviewLoaded.bind(this),this.handleCancelUpload=this.handleCancelUpload.bind(this),this.handleRemoveErroredUpload=this.handleRemoveErroredUpload.bind(this),this.handleUploadProgress=this.handleUploadProgress.bind(this),this.handleSending=this.handleSending.bind(this),this.handleSort=this.handleSort.bind(this),this.handleSetPage=this.handleSetPage.bind(this),this.handleSuccessfulUpload=this.handleSuccessfulUpload.bind(this),this.handleQueueComplete=this.handleQueueComplete.bind(this),this.handleFailedUpload=this.handleFailedUpload.bind(this),this.handleClearSearch=this.handleClearSearch.bind(this),this.handleEnableDropzone=this.handleEnableDropzone.bind(this),this.handleMoveFiles=this.handleMoveFiles.bind(this),this.handleBulkEdit=this.handleBulkEdit.bind(this),this.handleBulkPublish=this.handleBulkPublish.bind(this),this.handleBulkUnpublish=this.handleBulkUnpublish.bind(this),this.handleBulkMove=this.handleBulkMove.bind(this),this.handleBulkInsert=this.handleBulkInsert.bind(this),this.handleBeginSelection=this.handleBeginSelection.bind(this),this.handleGroupSelect=this.handleGroupSelect.bind(this),this.handleClearSelection=this.handleClearSelection.bind(this),this.handleSelectAll=this.handleSelectAll.bind(this),this.toggleSelectConcat=this.toggleSelectConcat.bind(this),this.getSelectableFiles=this.getSelectableFiles.bind(this)}componentDidMount(){this.initSortDropdown(),window.addEventListener("keydown",this.toggleSelectConcat),window.addEventListener("keyup",this.toggleSelectConcat)}componentDidUpdate(e){this.initSortDropdown(),this.initFlushUploadFiles(e)}componentWillUnmount(){window.removeEventListener("keydown",this.toggleSelectConcat),window.removeEventListener("keyup",this.toggleSelectConcat)}initFlushUploadFiles(e){if("tile"!==this.props.view){this.getSortElement().off("change")}e.folderId!==this.props.folderId&&this.props.actions.queuedFiles.purgeUploadQueue()}getSortElement(){return(0,o.default)(this.gallery).find(".gallery__sort .dropdown")}getSearchMessage(e){const t=[];e.name&&t.push(i.default._t("AssetAdmin.SEARCHRESULTSMESSAGEKEYWORDS","with keywords '{name}'")),e.lastEditedFrom&&e.lastEditedTo?t.push(i.default._t("AssetAdmin.SEARCHRESULTSMESSAGEEDITEDBETWEEN","last edited between '{lastEditedFrom}' and '{lastEditedTo}'")):e.lastEditedFrom?t.push(i.default._t("AssetAdmin.SEARCHRESULTSMESSAGEEDITEDFROM","last edited after '{lastEditedFrom}'")):e.lastEditedTo&&t.push(i.default._t("AssetAdmin.SEARCHRESULTSMESSAGEEDITEDTO","last edited before '{lastEditedTo}'")),e.appCategory&&t.push(i.default._t("AssetAdmin.SEARCHRESULTSMESSAGECATEGORY","categorised as '{appCategory}'")),e.currentFolderOnly&&this.props.folder.title&&t.push(i.default._t("AssetAdmin.SEARCHRESULTSMESSAGELIMIT","limited to the folder '{folder}'"));const n=[t.slice(0,-1).join(`${i.default._t("AssetAdmin.JOIN",",")} `),t.slice(-1)].filter((e=>e)).join(` ${i.default._t("AssetAdmin.JOINLAST","and")} `);if(""===n)return"";const o={parts:i.default.inject(n,Object.assign({folder:this.props.folder.title},e,{appCategory:e.appCategory?e.appCategory.toLowerCase():void 0}))};return i.default.inject(i.default._t("AssetAdmin.SEARCHRESULTSMESSAGE","Search results {parts}"),o)}getSelection(e,t){const n=this.getSelectableFiles(),o=[e,t].map((e=>n.findIndex((t=>t.id===e)))).filter((e=>-1!==e)).sort(((e,t)=>e-t));if(2!==o.length)return o.map((e=>n[e].id));const[i,r]=o;return n.filter(((e,t)=>t>=i&&t<=r)).map((e=>e.id))}getSelectableFiles(){const e=this.props.files.filter((e=>e.id));return this.props.type===M.SELECT?e.filter((e=>"folder"!==e.type)):e}handleBulkInsert(e,t){this.props.onInsertMany(e,t)}handleBulkPublish(e,t){const n=t.map((e=>e.id));return n.length?(this.props.actions.gallery.setLoading(!0),this.props.onPublish(n).then((e=>{this.props.actions.gallery.setLoading(!1),this.props.actions.toasts.success(i.default.sprintf(i.default._t("AssetAdmin.BULK_ACTIONS_PUBLISH_SUCCESS","%s folders/files were successfully published."),e.length)),this.props.actions.gallery.deselectFiles()}))):(this.props.actions.gallery.deselectFiles(),Promise.resolve(!0))}handleBulkUnpublish(e,t){const n=t.filter((e=>e.published)).map((e=>e.id));return n.length?(this.props.actions.gallery.setLoading(!0),this.props.onUnpublish(n).then((e=>{this.props.actions.gallery.setLoading(!1),this.props.actions.toasts.success(i.default.sprintf(i.default._t("AssetAdmin.BULK_ACTIONS_UNPUBLISH_SUCCESS","%s folders/files were successfully unpublished."),e.length)),this.props.actions.gallery.deselectFiles()}))):(this.props.actions.gallery.deselectFiles(),Promise.resolve(!0))}initSortDropdown(){if("tile"===this.props.view){const e=this.getSortElement();e.chosen({allow_single_deselect:!0,disable_search_threshold:20}),e.off("change"),e.on("change",(()=>e.find(":selected")[0].click()))}}handleSort(e){this.props.actions.queuedFiles.purgeUploadQueue(),this.props.onSort(e)}handleSetPage(e){this.props.onSetPage(e)}handleCancelUpload(e){e.xhr.abort(),this.props.actions.queuedFiles.removeQueuedFile(e.queuedId)}handleRemoveErroredUpload(e){this.props.actions.queuedFiles.removeQueuedFile(e.queuedId)}handleAddedFile(e){this.props.actions.queuedFiles.addQueuedFile(e)}handlePreviewLoaded(e,t){this.props.actions.queuedFiles.updateQueuedFile(e.queuedId,t)}handleSending(e,t){this.props.actions.queuedFiles.updateQueuedFile(e._queuedId,{xhr:t})}handleUploadProgress(e,t){this.props.actions.queuedFiles.updateQueuedFile(e._queuedId,{progress:t})}handleSuccessfulUpload(e){const t=JSON.parse(e.xhr.response);if(void 0!==t[0].error)return void this.handleFailedUpload(e);this.props.actions.queuedFiles.succeedUpload(e._queuedId,t[0]),this.props.onSuccessfulUpload&&this.props.onSuccessfulUpload(t);const n=this.props.queuedFiles.items.reduce(((e,t)=>100!==t.progress?e+1:e),0);if(!this.props.fileId&&!this.props.selectedFiles.length&&0===n){const e=t.pop();this.props.onOpenFile(e.id)}}handleQueueComplete(){this.props.onSuccessfulUploadQueue&&this.props.onSuccessfulUploadQueue()}handleFailedUpload(e,t){const n=e.xhr&&e.xhr.status?(0,E.default)(e.xhr.status,e.xhr):"";this.props.actions.queuedFiles.failUpload(e._queuedId,t,n)}itemIsSelected(e){return this.props.selectedFiles.indexOf(e)>-1}toggleSelectConcat(e){this.props.actions.gallery.setConcatenateSelect(this.isConcat(e))}isConcat(e){return e.metaKey||e.ctrlKey||e.shiftKey}itemIsHighlighted(e){return this.props.fileId===e}hasOpenedItem(){return!!this.props.fileId}handleClearSearch(e){this.props.onClearSearch(e)}handleGroupSelect(e,t){const{setSelectedFiles:n,selectFiles:o}=this.props.actions.gallery,i=this.getSelectableFiles(),r=e.filter(((t,n)=>e.indexOf(t)===n&&i.find((e=>e.id===t)))),l=this.props.concatenateSelect||this.isConcat(t);if(null!==this.props.maxFilesSelect){let e=r.length;if(l){e=this.props.selectedFiles.filter((e=>!this.props.selectedFiles.includes(e))).concat(this.props.selectedFiles).length}if(e>=this.props.maxFilesSelect)return}l?o(r):n(r)}handleClearSelection(){this.props.actions.gallery.deselectFiles()}handleSelectAll(){const e=this.props.files.map((e=>e.id));this.handleGroupSelect(e,new Event("na"))}handleBeginSelection(e){let t=e.target;for(;t;){if(t.classList.contains("paginator-footer"))return!1;if(t.classList.contains("gallery__main--selectable"))break;t=t.parentNode}return!0}handleOpenFolder(e,t){e.preventDefault(),this.props.onOpenFolder(t.id)}handleOpenFile(e,t){e.preventDefault(),null!==t.created&&(this.props.selectedFiles.length&&1!==this.props.maxFilesSelect||this.props.type!==M.SELECT||this.handleSelect(e,t),this.props.onOpenFile(t.id,t))}handleSelect(e,t){const n=this.props.maxFilesSelect;let o=this.getSelectableFiles().filter((e=>e.id===t.id)).map((e=>e.id));if(1!==n)if(-1===this.props.selectedFiles.indexOf(t.id)){e.shiftKey&&(o=this.getSelection(this.props.lastSelected,t.id));if(this.props.selectedFiles.filter((e=>!o.includes(e))).concat(o).length>n&&null!==n)return;this.props.actions.gallery.selectFiles(o),this.props.actions.gallery.setLastSelected(t.id)}else this.props.actions.gallery.deselectFiles([t.id]),e.shiftKey&&this.props.actions.gallery.setLastSelected(null);else this.props.actions.gallery.setSelectedFiles(o)}handleEnableDropzone(e){this.props.actions.gallery.setEnableDropzone(e)}handleMoveFiles(e,t){const n=this.props.sectionConfig.endpoints.move.url;return w.default.post(n,{ids:t,folderID:e},{"X-SecurityID":_.default.get("SecurityID")}).then((()=>{const n=f.default.MOVE_SUCCESS_DURATION,o=`+${t.length}`;this.props.actions.gallery.setFileBadge(e,o,"success",n),"function"==typeof this.props.onMoveFilesSuccess&&this.props.onMoveFilesSuccess(e,t)})).catch((()=>{this.props.actions.toasts.error(i.default._t("AssetAdmin.FAILED_MOVE","There was an error moving the selected items."))}))}handleBulkEdit(e,t){this.handleOpenFile(e,t[0])}handleBulkMove(){this.props.actions.gallery.activateModal(f.default.MODAL_MOVE)}renderTransitionBulkActions(){return this.renderBulkActions()}renderBulkActions(){const{type:e,dialog:t,maxFilesSelect:n,files:o,selectedFiles:i,BulkActionsComponent:l,sectionConfig:s}=this.props,a=e===M.SELECT||t?e=>e.value===M.INSERT:e=>e.value!==M.INSERT,u=s.filesAreVersioned&&s.archiveFiles?e=>e.value!==M.DELETE:e=>e.value!==M.ARCHIVE,d=f.default.BULK_ACTIONS.filter(a).filter(u).map((e=>{if(e.callback)return e;switch(e.value){case M.DELETE:case M.ARCHIVE:return{...e,callback:(e,t)=>{this.props.actions.confirmDeletion.confirm(t)},confirm:void 0};case M.EDIT:return{...e,callback:this.handleBulkEdit};case M.MOVE:return{...e,callback:this.handleBulkMove};case M.PUBLISH:return{...e,callback:this.handleBulkPublish};case M.UNPUBLISH:return{...e,callback:this.handleBulkUnpublish};case M.INSERT:return{...e,callback:this.handleBulkInsert,color:"primary"};default:return e}})),c=i.map((e=>o.find((t=>t&&e===t.id)))).filter((e=>e));return c.length>0&&[M.ADMIN,M.SELECT].includes(e)?r.default.createElement(l,{actions:d,items:c,total:n,key:c.length>0,container:this.gallery,showCount:1!==n,onClearSelection:this.handleClearSelection,onSelectAll:this.handleSelectAll}):null}renderGalleryView(){const e="table"===this.props.view?c.default:d.default,t=this.props.files.map((e=>{const t=this.itemIsSelected(e.id),n=this.itemIsHighlighted(e.id),o=(e.queuedId?`queueId${e.queuedId}`:`id${e.id}`)+(t?"--selected":"");return{...e,selected:t,highlighted:n,key:o}})),{type:n,loading:o,dialog:i,page:l,totalCount:s,limit:a,sort:u,selectedFiles:f,badges:p,maxFilesSelect:h,sectionConfig:g}=this.props,m={selectableItems:n===M.SELECT||n===M.ADMIN&&(!h||h>1),selectableFolders:n!==M.SELECT&&!i,files:t,loading:o,page:l,totalCount:s,limit:a,sort:u,selectedFiles:f,badges:p,onSort:this.handleSort,onSetPage:this.handleSetPage,onOpenFile:this.handleOpenFile,onOpenFolder:this.handleOpenFolder,onSelect:this.handleSelect,onCancelUpload:this.handleCancelUpload,onDropFiles:this.handleMoveFiles,onRemoveErroredUpload:this.handleRemoveErroredUpload,sectionConfig:g,canDrag:n===M.ADMIN,maxFilesSelect:h};return r.default.createElement(e,m)}renderToolbar(){const{GalleryToolbar:e,sort:t,view:n,folder:o,onCreateFolder:i,onOpenFolder:l,onViewChange:s}=this.props,a={onSort:this.handleSort,onCreateFolder:i,onOpenFolder:l,onViewChange:s,view:n,sort:t,folder:o};return r.default.createElement(e,a)}render(){const{folder:e,loading:t,errorMessage:n,noticeMessage:o}=this.props,l=this.props.LoadingComponent;if(!e)return n?r.default.createElement("div",{className:"gallery__error flexbox-area-grow"},r.default.createElement("div",{className:"gallery__error-message"},r.default.createElement("h3",null,i.default._t("AssetAdmin.DROPZONE_RESPONSE_ERROR","Server responded with an error.")),n&&r.default.createElement("p",null,n))):t?r.default.createElement("div",{className:"flexbox-area-grow"},r.default.createElement(l,null)):r.default.createElement("div",{className:"flexbox-area-grow"},r.default.createElement("div",{className:"editor__file-preview-message--file-missing m-t-3"},i.default._t("Admin.UNKNOWN_ERROR","An unknown error has occurred")));const s=r.default.createElement("div",{className:"gallery_messages"},n&&r.default.createElement(p.default,{value:n,type:"danger"}),o&&r.default.createElement(p.default,{value:o,type:"success"})),u={height:f.default.THUMBNAIL_HEIGHT,width:f.default.THUMBNAIL_WIDTH},d={url:this.props.createFileApiUrl,method:this.props.createFileApiMethod,paramName:"Upload",clickable:"#upload-button",...this.props.sectionConfig.dropzoneOptions},c=this.props.securityId,h=this.props.folder.canEdit&&this.props.enableDropzone,g=["panel","panel--padded","panel--scrollable","gallery__main","fill-height"];this.props.type===M.INSERT&&g.push("insert-media-modal__main");const m=g;return this.hasOpenedItem()&&m.push("gallery__main--has-opened-item"),r.default.createElement("div",{className:"flexbox-area-grow gallery__outer",ref:e=>{this.gallery=e}},this.renderTransitionBulkActions(),r.default.createElement(I.default,{onDragStartEnd:e=>this.handleEnableDropzone(!e),onDropFiles:this.handleMoveFiles,selectedFiles:this.props.selectedFiles,className:g.join(" ")},this.renderToolbar(),r.default.createElement(b.SelectableGroup,{enabled:"tile"===this.props.view&&this.props.type===M.ADMIN,className:"flexbox-area-grow fill-height gallery__main--selectable",onSelection:this.handleGroupSelect,onNonItemClick:this.handleClearSelection,onBeginSelection:this.handleBeginSelection,preventDefault:!1,fixedPosition:!0},r.default.createElement(a.default,{name:"gallery-container",className:"flexbox-area-grow",canUpload:h,onAddedFile:this.handleAddedFile,onPreviewLoaded:this.handlePreviewLoaded,onError:this.handleFailedUpload,onSuccess:this.handleSuccessfulUpload,onQueueComplete:this.handleQueueComplete,onSending:this.handleSending,onUploadProgress:this.handleUploadProgress,preview:u,folderId:this.props.folderId,options:d,securityID:c,uploadButton:!1},s,this.renderGalleryView()))),this.props.loading&&r.default.createElement(l,null),r.default.createElement(F.default,{sectionConfig:this.props.sectionConfig,folderId:this.props.folderId,onSuccess:this.props.onMoveFilesSuccess,onOpenFolder:this.props.onOpenFolder}))}}t.Component=D;const P={page:1,limit:15},x={sectionConfig:y.default,loading:C.default.bool,sort:C.default.string,files:C.default.arrayOf(C.default.shape({id:C.default.number,parent:C.default.shape({id:C.default.number})})).isRequired,selectedFiles:C.default.arrayOf(C.default.number),totalCount:C.default.number,page:C.default.number,limit:C.default.number,badges:C.default.arrayOf(C.default.shape({id:C.default.number,message:C.default.node,status:C.default.string})),onOpenFile:C.default.func.isRequired,onOpenFolder:C.default.func.isRequired,onSort:C.default.func.isRequired,onSetPage:C.default.func.isRequired,maxFilesSelect:C.default.number};t.galleryViewDefaultProps=Object.assign({},P,{selectableItems:!1}),t.galleryViewPropTypes=Object.assign({},x,{selectableItems:C.default.bool,selectableFolders:C.default.bool,onSelect:C.default.func,onCancelUpload:C.default.func,onRemoveErroredUpload:C.default.func});D.defaultProps=Object.assign({},P,{type:M.ADMIN,view:"tile",enableDropzone:!0,dialog:!1,BulkActionsComponent:u.default}),D.propTypes=Object.assign({},x,{onSuccessfulUpload:C.default.func,onSuccessfulUploadQueue:C.default.func,onCreateFolder:C.default.func,onMoveFilesSuccess:C.default.func,onPublish:C.default.func,onUnpublish:C.default.func,type:C.default.oneOf(["insert-media","insert-link",M.SELECT,M.ADMIN]),view:C.default.oneOf(["tile","table"]),lastSelected:C.default.number,dialog:C.default.bool,fileId:C.default.number,folderId:C.default.number.isRequired,folder:C.default.shape({id:C.default.number,title:C.default.string,parentId:C.default.number,canView:C.default.bool,canEdit:C.default.bool}),files:C.default.array,errorMessage:C.default.string,actions:C.default.object,securityId:C.default.string,onViewChange:C.default.func.isRequired,createFileApiUrl:C.default.string,createFileApiMethod:C.default.string,search:C.default.object,enableDropzone:C.default.bool,concatenateSelect:C.default.bool,GalleryToolbar:C.default.elementType,sorters:C.default.arrayOf(C.default.shape({field:C.default.string.isRequired,direction:C.default.oneOf(["asc","desc"]).isRequired,label:C.default.string.isRequired})).isRequired,BulkActionsComponent:C.default.oneOfType([C.default.object,C.default.func])});t.default=(0,s.compose)((0,S.inject)(["GalleryToolbar","Loading"],((e,t)=>({GalleryToolbar:e,LoadingComponent:t})),(()=>"AssetAdmin.Gallery")),(0,l.connect)((function(e,t){let{sort:n}=t;const{selectedFiles:o,errorMessage:i,noticeMessage:r,enableDropzone:l,badges:s,concatenateSelect:a,loading:u,sorters:d,lastSelected:c}=e.assetAdmin.gallery;return!n&&d&&d[0]&&(n=`${d[0].field},${d[0].direction}`),{lastSelected:c,selectedFiles:o,errorMessage:i,noticeMessage:r,enableDropzone:l,badges:s,concatenateSelect:a,loading:t.loading||u,queuedFiles:e.assetAdmin.queuedFiles,securityId:e.config.SecurityID,sorters:d,sort:n}}),(function(e){return{actions:{gallery:(0,s.bindActionCreators)(h,e),toasts:(0,s.bindActionCreators)(g,e),queuedFiles:(0,s.bindActionCreators)(m,e),confirmDeletion:(0,s.bindActionCreators)(v,e)}}})))(D)},3863:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var 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=d(t);if(n&&n.has(e))return n.get(e);var o={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&{}.hasOwnProperty.call(e,r)){var l=i?Object.getOwnPropertyDescriptor(e,r):null;l&&(l.get||l.set)?Object.defineProperty(o,r,l):o[r]=e[r]}return o.default=e,n&&n.set(e,o),o}(n(1594)),i=u(n(6923)),r=u(n(2914)),l=u(n(6935)),s=n(3375),a=n(8831);function u(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)}function c(e){let{className:t,selectedFiles:n,onDragStartEnd:l,onDropFiles:u,children:d}=e;const[c,f]=(0,o.useState)(!1),[p,h]=(0,o.useState)(null),[g,m]=(0,o.useState)(null),[v,b]=(0,o.useState)(!1),y=(0,s.useSensors)((0,s.useSensor)(s.PointerSensor,{activationConstraint:{distance:10}})),_=[...n];_.includes(p)||_.push(p);const E=(0,o.useCallback)((e=>{"function"==typeof l&&l(!0),f(!0),h(e.active.id),m(e.active.data.current.props),b(!1)})),S=(0,o.useCallback)((e=>{"function"==typeof l&&l(!1),e.over&&"function"==typeof u&&(b(!0),u(e.over.id,_)),f(!1),h(null),m(null)})),C=v?0:250;return o.default.createElement("div",{className:(0,i.default)(t,{"gallery__main--dragging":c})},o.default.createElement(s.DndContext,{sensors:y,onDragStart:E,onDragEnd:S,modifiers:[a.snapCenterToCursor]},d,o.default.createElement(s.DragOverlay,{dropAnimation:{duration:C}},c&&o.default.createElement(r.default,{draggingItemProps:g,draggingItems:_}))))}c.contextTypes={dragDropManager:l.default.object},c.propTypes={selectedFiles:l.default.arrayOf(l.default.number).isRequired,className:l.default.string,onDropFiles:l.default.func,onDragStartEnd:l.default.func,children:l.default.oneOfType([l.default.arrayOf(l.default.node),l.default.node])};t.default=c},9478:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o,i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=l(t);if(n&&n.has(e))return n.get(e);var o={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&{}.hasOwnProperty.call(e,r)){var s=i?Object.getOwnPropertyDescriptor(e,r):null;s&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r]}return o.default=e,n&&n.set(e,o),o}(n(1594)),r=(o=n(6935))&&o.__esModule?o:{default:o};function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(l=function(e){return e?n:t})(e)}class s extends i.Component{constructor(e){super(e),this.handleClick=this.handleClick.bind(this)}handleClick(e){e.preventDefault(),"function"==typeof this.props.onClick&&this.props.onClick(this.props.versionid)}render(){let e=null;return"Published"===this.props.status&&(e=i.default.createElement("p",null,i.default.createElement("span",{className:"history-item__status-flag"},this.props.status)," at ",this.props.date_formatted)),i.default.createElement("li",{className:"list-group-item history-item",onClick:this.handleClick},i.default.createElement("p",null,i.default.createElement("span",{className:"history-item__version"},"v.",this.props.versionid),i.default.createElement("span",{className:"history-item__date"},this.props.date_ago," ",this.props.author),this.props.summary),e)}}s.propTypes={versionid:r.default.number.isRequired,summary:r.default.oneOfType([r.default.bool,r.default.string]).isRequired,status:r.default.string,author:r.default.string,date_formatted:r.default.string,date_ago:r.default.string,onClick:r.default.func};t.default=s},9005:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var 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=c(t);if(n&&n.has(e))return n.get(e);var o={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&{}.hasOwnProperty.call(e,r)){var l=i?Object.getOwnPropertyDescriptor(e,r):null;l&&(l.get||l.set)?Object.defineProperty(o,r,l):o[r]=e[r]}return o.default=e,n&&n.set(e,o),o}(n(1594)),i=n(9040),r=d(n(5609)),l=d(n(6177)),s=d(n(9478)),a=d(n(55)),u=d(n(6935));function d(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)}function f(){return f=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},f.apply(null,arguments)}class p extends o.Component{constructor(e){super(e),this.state={history:[],loadedDetails:!1},this.handleClick=this.handleClick.bind(this),this.handleBack=this.handleBack.bind(this),this.timer=null,this.api=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return r.default.createEndpointFetcher(Object.assign({},e,t?{defaultData:{SecurityID:l.default.get("SecurityID")}}:{}))}(e.sectionConfig.endpoints.history)}componentDidMount(){this.refreshHistoryIfNeeded()}componentDidUpdate(e){this.refreshHistoryIfNeeded(e)}componentWillUnmount(){clearTimeout(this.timer),this.timer=null}refreshHistoryIfNeeded(e){if(!e&&!this.state.loadedDetails||this.props.data.fileId!==e.data.fileId||this.props.data.latestVersionId!==e.data.latestVersionId){this.setState({loadedDetails:!1});const t=this.props?this.props.data.fileId:e.data.fileId;clearTimeout(this.timer),this.timer=setTimeout((()=>{this.api({fileId:t}).then((e=>{this.timer&&this.setState({history:e,loadedDetails:!0})}))}),250)}}handleClick(e){this.setState({viewDetails:e})}handleBack(e){e.preventDefault(),this.setState({viewDetails:null})}render(){if(!this.state.loadedDetails)return o.default.createElement("div",{className:"history-list history-list--loading"},"Loading...");if(this.state.viewDetails){const e=[this.props.historySchemaUrl,this.props.data.fileId,this.state.viewDetails].join("/"),t=["btn","btn-secondary","btn--icon-xl","btn--no-text","font-icon-left-open-big","history-list__back"].join(" ");return o.default.createElement("div",{className:"history-list"},o.default.createElement("a",{href:"#",className:t,onClick:this.handleBack}),o.default.createElement(a.default,{identifier:"AssetAdmin.HistoryList",schemaUrl:e,formTag:"div"}))}const e=this.state.history||[];return o.default.createElement("div",{className:"history-list"},o.default.createElement("ul",{className:"list-group list-group-flush history-list__list"},e.map((e=>o.default.createElement(s.default,f({key:e.versionid},e,{onClick:this.handleClick}))))))}}t.Component=p,p.propTypes={sectionConfig:u.default.shape({form:u.default.object,historyEndpoint:u.default.shape({url:u.default.string,method:u.default.string,responseFormat:u.default.string})}),historySchemaUrl:u.default.string,data:u.default.object},p.defaultProps={data:{fieldId:0}};t.default=(0,i.connect)((function(e){const t=e.config.sections.find((e=>"SilverStripe\\AssetAdmin\\Controller\\AssetAdmin"===e.name));return{sectionConfig:t,historySchemaUrl:t.form.fileHistoryForm.schemaUrl}}))(p)},6931:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var o=y(n(5815)),i=b(n(1594)),r=n(9367),l=n(9040),s=y(n(7917)),a=y(n(2908)),u=y(n(1957)),d=b(n(4201)),c=b(n(1021)),f=y(n(8737)),p=y(n(6923)),h=y(n(6935)),g=y(n(8268)),m=y(n(7675));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 o={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&{}.hasOwnProperty.call(e,r)){var l=i?Object.getOwnPropertyDescriptor(e,r):null;l&&(l.get||l.set)?Object.defineProperty(o,r,l):o[r]=e[r]}return o.default=e,n&&n.set(e,o),o}function y(e){return e&&e.__esModule?e:{default:e}}class _ extends i.Component{constructor(e){super(e),this.handleSubmit=this.handleSubmit.bind(this)}componentDidMount(){const{isOpen:e,onBrowse:t,setOverrides:n,fileAttributes:o,folderId:i}=this.props;e?"function"==typeof n&&o.ID&&(n(this.props),t(i,o.ID)):t(i||0)}componentDidUpdate(e){!this.props.isOpen&&e.isOpen&&(this.props.onBrowse(this.props.folderId),this.props.actions.gallery.deselectFiles()),"function"==typeof e.setOverrides&&this.props.isOpen&&!e.isOpen&&(e.setOverrides(this.props),this.props.onBrowse(this.props.folderId,this.props.fileAttributes?this.props.fileAttributes.ID:null))}getSectionProps(){return{...this.props,dialog:!0,toolbarChildren:this.renderToolbarChildren(),onSubmitEditor:this.handleSubmit,onReplaceUrl:this.props.onBrowse}}getModalProps(){const{onHide:e,onInsert:t,sectionConfig:n,schemaUrl:o,className:i,...r}=this.props;return{...r,className:(0,p.default)("insert-media-modal",i),size:"lg",showCloseButton:!1}}handleSubmit(e,t,n,o){return"action_insert"===t?this.props.onInsert(e,o):n()}renderToolbarChildren(){return i.default.createElement("button",{type:"button",className:"close btn-close modal__close-button insert-media-modal__close-button",onClick:this.props.onClosed,"aria-label":o.default._t("FormBuilderModal.CLOSE","Close")})}render(){const e=this.getModalProps(),t=this.getSectionProps(),n=this.props.isOpen?i.default.createElement(s.default,t):null;return i.default.createElement(f.default,e,n)}}t.Component=_,_.propTypes={sectionConfig:h.default.shape({url:h.default.string,form:h.default.object}),type:h.default.oneOf(["insert-media","insert-link","select","admin"]),schemaUrl:h.default.string,isOpen:h.default.bool,setOverrides:h.default.func,onInsert:h.default.func.isRequired,fileAttributes:h.default.shape({ID:h.default.number,AltText:h.default.string,Width:h.default.number,Height:h.default.number,Loading:h.default.string,TitleTooltip:h.default.string,Alignment:h.default.string,Description:h.default.string,TargetBlank:h.default.bool}),requireLinkText:h.default.bool,folderId:h.default.number,fileId:h.default.number,viewAction:h.default.string,query:h.default.object,getUrl:h.default.func,onBrowse:h.default.func.isRequired,onClosed:h.default.func,className:h.default.string,actions:h.default.object,maxFiles:h.default.number,fileSelected:h.default.bool},_.defaultProps={className:"",fileAttributes:{},type:"insert-media",folderId:0,maxFiles:1};t.default=(0,r.compose)(a.default,(0,l.connect)((function(e,t){const n=t.sectionConfig;if(!n)return{};let o=0;null!==t.folderId?o=t.folderId:t.folder&&(o=t.folder.id);const i=t.fileAttributes?t.fileAttributes.ID:t.fileId,r=e.assetAdmin.modal.formSchema,l={config:n,viewAction:t.viewAction,folderId:o,type:r&&r.type,fileId:i},{schemaUrl:s,targetId:a}=(0,g.default)(l);if(!s)return{};const u={};t.requireLinkText&&(u.requireLinkText=!0),t.fileSelected&&(u.fileSelected=!0);let d=m.default.stringify(u);return d=d?`?${d}`:"",{schemaUrl:`${s}/${a}${d}`,type:r&&r.type}}),(function(e){return{actions:{gallery:(0,r.bindActionCreators)(d,e),modal:(0,r.bindActionCreators)(c,e)}}})),u.default)(_)},5769:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=g(n(1594)),i=n(9040),r=n(9367),l=g(n(5815)),s=g(n(6379)),a=g(n(6935)),u=n(4201),d=n(8918),c=g(n(8737)),f=g(n(4350)),p=g(n(6177)),h=g(n(5609));function g(e){return e&&e.__esModule?e:{default:e}}class m extends o.default.Component{constructor(e){super(e),this.handleSubmit=this.handleSubmit.bind(this),this.timeout=null}handleSubmit(e){let{FolderID:t}=e;const{selectedFiles:n,onSuccess:o,onClosed:i,setNotice:r,setError:a,setBadge:u}=this.props;let d=this.props.sectionConfig.endpoints.move.url;return h.default.post(d,{ids:n,folderID:t},{"X-SecurityID":p.default.get("SecurityID")}).then((()=>(d=`${this.props.sectionConfig.endpoints.read.url}/${t}`,h.default.get(d)))).then((e=>e.json())).then((e=>{"function"==typeof o&&o(e.id,n),u(e.id,`${n.length}`,"success",s.default.MOVE_SUCCESS_DURATION),r(l.default.sprintf(l.default._t("AssetAdmin.MOVED_ITEMS_TO","Moved %s item(s) to %s"),n.length,e.name),[{label:l.default._t("AssetAdmin.GO_TO_FOLDER","Go to folder"),onClick:()=>this.props.onOpenFolder(e.id)}]),i()})).catch((()=>{a(l.default._t("AssetAdmin.FAILED_MOVE","There was an error moving the selected items."))}))}render(){const{isOpen:e,onClosed:t,title:n,folderId:i,sectionConfig:r}=this.props,{schemaUrl:l}=r.form.moveForm;return o.default.createElement(c.default,{title:n,isOpen:e,onClosed:t,onSubmit:this.handleSubmit,identifier:"AssetAdmin.MoveForm",schemaUrl:`${l}/${i}`})}}m.propTypes={sectionConfig:f.default,folderId:a.default.number.isRequired,isOpen:a.default.bool,onClosed:a.default.func,setNotice:a.default.func,setBadge:a.default.func,setError:a.default.func,title:a.default.string,onSuccess:a.default.func,onOpenFolder:a.default.func.isRequired,selectedFiles:a.default.array.isRequired},m.defaultProps={isOpen:!1};t.default=(0,r.compose)((0,i.connect)((function(e){const{modal:t,selectedFiles:n}=e.assetAdmin.gallery;return{isOpen:t===s.default.MODAL_MOVE,selectedFiles:n,title:l.default.sprintf(l.default._t("AssetAdmin.MOVE_ITEMS_TO","Move %s item(s) to..."),n.length)}}),(function(e){return{onClosed(){e((0,u.deactivateModal)())},setNotice(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];e((0,d.display)({text:t,type:"success",actions:n}))},setError(t){e((0,d.display)({text:t,type:"error"}))},setBadge(){e((0,u.setFileBadge)(...arguments))}}})))(m)},6609:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Component=h,t.default=void 0;var o=p(n(1594)),i=p(n(6935)),r=p(n(5815)),l=p(n(8123)),s=p(n(5950)),a=p(n(1990)),u=p(n(131)),d=n(5789),c=n(5716),f=n(1845);function p(e){return e&&e.__esModule?e:{default:e}}function h(e){const t={...d.galleryViewDefaultProps,...e};function n(e){return["title","lastEdited"].includes(e)}function i(e){const t=function(e){if(!e.queuedId||e.message&&"error"===e.message.type)return null;if(e.id>0)return o.default.createElement("div",{className:"gallery__progress-bar--complete"});const t={className:"gallery__progress-bar-progress",style:{width:`${e.progress}%`}};return o.default.createElement("div",{className:"gallery__progress-bar"},o.default.createElement("div",t))}(e);return o.default.createElement("div",{className:"fill-width"},o.default.createElement("div",{className:"flexbox-area-grow"},o.default.createElement("span",null,e.title),e.hasRestrictedAccess&&function(e){const{hasRestrictedAccess:t}=e,n={fileID:e.id,placement:"top",hasRestrictedAccess:t};return o.default.createElement(a.default,n)}(e),e.isTrackedFormUpload&&function(e){const{isTrackedFormUpload:t,hasRestrictedAccess:n}=e,i={fileID:e.id,placement:"top",isTrackedFormUpload:t,hasRestrictedAccess:n};return o.default.createElement(a.default,i)}(e)),t)}function p(e){return"gallery__table-row "+(e.original.highlighted?"gallery__table-row--highlighted":"")}function h(e,n){const o=[],i=e.column.id;if(n){const[e,n]=t.sort.split(",");e===i&&o.push("asc"===n?"sort-ascending":"sort-descending")}return"selected"===i?o.push("gallery__table-column--select"):"thumbnail"===i?o.push("gallery__table-column--image"):"title"===i&&o.push("gallery__table-column--title"),o.join(" ")}const g=[{id:"thumbnail",header:"",cell:e=>function(e){const t=e.url,n=e.queuedId&&!e.id,i=e.category||"false",r="gallery__table-image",l=[r],s={};return l.push(`${r}--${i}`),"image"===i&&t&&(s.backgroundImage=`url("${t}")`),n||t||"folder"===i||l.push(`${r}--error`),o.default.createElement("div",{className:l.join(" "),style:s})}(e.getValue())},{id:"title",header:r.default._t("File.TITLE","Title"),cell:e=>i(e.getValue())},{id:"status",header:r.default._t("File.STATUS","Status"),cell:e=>function(e){let t=[];return"folder"!==e.type&&(e.draft?t.push({key:"status-draft",status:"draft"}):e.modified&&t.push({key:"status-modified",status:"modified"})),t=t.map((e=>{let{...t}=e;return o.default.createElement(u.default,t)})),t?o.default.createElement("span",null,t):null}(e.getValue())},{id:"size",header:r.default._t("File.SIZE","Size"),cell:e=>function(e){if("folder"===e.type)return null;const t=(0,c.fileSize)(e.size);return o.default.createElement("span",null,t)}(e.getValue())},{id:"lastEdited",header:r.default._t("File.MODIFIED","Modified"),cell:e=>{return"folder"===(t=e.getValue()).type?null:(l.default.locale(r.default.detectLocale()),o.default.createElement("span",null,(0,l.default)(t.lastEdited).format("L LT")));var t}}];t.selectableItems&&g.unshift({id:"selected",header:"",cell:e=>function(e){if(t.selectableItems&&(t.selectableFolders||"folder"!==e.type)){const n={type:"checkbox",title:r.default._t("AssetAdmin.SELECT"),defaultChecked:e.selected,tabIndex:-1,onMouseDown:e=>function(e){e.preventDefault()}(e)};return![null,1].includes(t.maxFilesSelect)&&t.selectedFiles.length>=t.maxFilesSelect&&!e.selected&&(n.disabled=!0),o.default.createElement("input",n)}return null}(e.getValue())});const m=(0,f.createColumnHelper)(),v=(0,f.useReactTable)({data:t.files,columns:g.map((e=>m.accessor((e=>e),e))),getCoreRowModel:(0,f.getCoreRowModel)()});return 0!==t.files.length?o.default.createElement("table",{className:"gallery__table table table-hover"},o.default.createElement("thead",null,v.getHeaderGroups().map((e=>o.default.createElement("tr",{key:e.id},e.headers.map((e=>o.default.createElement("th",{key:e.id,onClick:()=>function(e){const o=e.column.id;if(!n(o))return;const i=t.sort!==`${o},asc`?"asc":"desc";t.onSort(`${o},${i}`)}(e),className:h(e,!0)},function(e){const t=e.column.columnDef.header;return n(e.column.id)?o.default.createElement("span",null,t):t}(e)))))))),o.default.createElement("tbody",null,v.getRowModel().rows.map((e=>o.default.createElement("tr",{key:e.id,className:p(e)},e.getVisibleCells().map((n=>o.default.createElement("td",{key:n.id,onClick:o=>function(e,n,o){const i=e.original;"selected"!==n.column.id||(o.stopPropagation(),o.preventDefault(),"function"!=typeof t.onSelect)?"folder"===i.type?t.onOpenFolder(o,i):t.onOpenFile(o,i):t.onSelect(o,i)}(e,n,o),className:h(n,!1)},function(e){return(0,f.flexRender)(e.column.columnDef.cell,e.getContext())}(n)))))))),o.default.createElement("tfoot",null,o.default.createElement("tr",null,o.default.createElement("td",{colSpan:g.length},o.default.createElement(s.default,{totalItems:t.totalCount,maxItemsPerPage:t.limit,currentPage:t.page,onChangePage:e=>function(e){t.onSetPage(e)}(e)}))))):t.loading?void 0:o.default.createElement("p",{className:"gallery__no-item-notice"},r.default._t("AssetAdmin.NOITEMSFOUND"))}h.propTypes={...d.galleryViewPropTypes,sort:i.default.string.isRequired};t.default=h},2853:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var o=d(n(5815)),i=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 o={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&{}.hasOwnProperty.call(e,r)){var l=i?Object.getOwnPropertyDescriptor(e,r):null;l&&(l.get||l.set)?Object.defineProperty(o,r,l):o[r]=e[r]}return o.default=e,n&&n.set(e,o),o}(n(1594)),r=n(5207),l=n(5789),s=d(n(5950)),a=d(n(6935));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)}function d(e){return e&&e.__esModule?e:{default:e}}class c extends i.Component{constructor(e){super(e),this.renderItem=this.renderItem.bind(this),this.handleSetPage=this.handleSetPage.bind(this)}handleSetPage(e){this.props.onSetPage(e)}folderFilter(e){return"folder"===e.type}fileFilter(e){return"folder"!==e.type}renderPagination(){if(this.props.totalCount<=this.props.limit)return null;const e={totalItems:this.props.totalCount,maxItemsPerPage:this.props.limit,currentPage:this.props.page,onChangePage:this.handleSetPage};return i.default.createElement(s.default,e)}renderItem(e){const{File:t,Folder:n,badges:o,sectionConfig:r,selectedFiles:l,selectableItems:s,selectableFolders:a}=this.props,u=o.find((t=>t.id===e.id));let d={sectionConfig:r,key:e.key,selectableKey:e.id,item:e,selectedFiles:l,badge:u,canDrag:this.props.canDrag};if(e.queuedId&&!e.id){const{onCancelUpload:e,onRemoveErroredUpload:t}=this.props;d={...d,onCancelUpload:e,onRemoveErroredUpload:t}}else{const{onOpenFolder:t,onOpenFile:n}=this.props;d={...d,onActivate:"folder"===e.type?t:n}}if(s&&(a||"folder"!==e.type)){const e=![null,1].includes(this.props.maxFilesSelect)&&this.props.selectedFiles.length>=this.props.maxFilesSelect,t=1===this.props.maxFilesSelect?d.onActivate:this.props.onSelect;d={...d,selectable:!0,onSelect:t,maxSelected:e}}return"folder"===e.type?i.default.createElement(n,d):i.default.createElement(t,d)}render(){return i.default.createElement("div",{className:"gallery__main-view--tile"},i.default.createElement("div",{className:"gallery__folders"},this.props.files.filter(this.folderFilter).map(this.renderItem)),i.default.createElement("div",{className:"gallery__files"},this.props.files.filter(this.fileFilter).map(this.renderItem)),0===this.props.files.length&&!this.props.loading&&i.default.createElement("p",{className:"gallery__no-item-notice"},o.default._t("AssetAdmin.NOITEMSFOUND")),i.default.createElement("div",{className:"gallery__load"},this.renderPagination()))}}t.Component=c,c.defaultProps=l.galleryViewDefaultProps,c.propTypes={...l.galleryViewPropTypes,File:a.default.elementType.isRequired,Folder:a.default.elementType.isRequired};const f=(0,r.inject)(["GalleryItemFile","GalleryItemFolder"],((e,t)=>({File:e,Folder:t})),(()=>"AssetAdmin.Gallery.ThumbnailView"));t.default=f(c)},9329:function(e,t,n){"use strict";var o=a(n(1669)),i=a(n(1594)),r=n(5145),l=n(3398),s=n(5207);function a(e){return e&&e.__esModule?e:{default:e}}function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},u.apply(null,arguments)}o.default.entwine("ss",(e=>{e(".js-injector-boot input.entwine-uploadfield").entwine({Component:null,ReactRoot:null,getContainer(){let t=this.siblings(".uploadfield-holder")[0];if(!t){const n=e('<div class="uploadfield-holder"></div>');this.before(n),t=n[0]}return t},onunmatch(){this._super();const e=this.getReactRoot();e&&(e.unmount(),this.setReactRoot(null))},onmatch(){const e=this.closest(".cms-content").attr("id"),t=e?{context:e}:{},n=(0,s.loadComponent)("UploadField",t);this.setComponent(n),this._super(),this.hide(),this.refresh()},onclick(e){e.preventDefault()},refresh(){const t=this.getAttributes(),n=e(this).closest("form"),o=this.getComponent();let l=this.getReactRoot();l||(l=(0,r.createRoot)(this.getContainer()),this.setReactRoot(l)),l.render(i.default.createElement(o,u({},t,{onChange:()=>{setTimeout((()=>{n.trigger("change")}),0)},noHolder:!0})))},getAttributes(){const t=e(this).data("state"),n=e(this).data("schema");return(0,l.schemaMerge)(n,t)}})}))},4350:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o,i=(o=n(6935))&&o.__esModule?o:{default:o};const r=i.default.shape({url:i.default.string,limit:i.default.number,imageRetry:i.default.shape({minRetry:i.default.number,maxRetry:i.default.number,expiry:i.default.number}),form:i.default.object,dropzoneOptions:i.default.object});t.default=r},6022:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o,i=(o=n(6935))&&o.__esModule?o:{default:o};const r=i.default.shape({canEdit:i.default.bool,canDelete:i.default.bool,canView:i.default.bool,exists:i.default.bool,type:i.default.string,smallThumbnail:i.default.string,thumbnail:i.default.string,width:i.default.number,height:i.default.number,category:i.default.oneOfType([i.default.bool,i.default.string]),id:i.default.number,url:i.default.string,title:i.default.string,progress:i.default.number,visibility:i.default.string,hasRestrictedAccess:i.default.bool,isTrackedFormUpload:i.default.bool});t.default=r},4886:function(e,t,n){"use strict";var o;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;const i=(0,((o=n(2923))&&o.__esModule?o:{default:o}).default)({name:null,canDelete:!1,canEdit:!1,category:null,created:null,extension:null,filename:null,id:0,lastEdited:null,messages:null,owner:{id:0,title:null},parent:{filename:null,id:0,title:null},queuedId:null,size:null,title:null,type:null,url:null,xhr:null,thumbnail:null,smallThumbnail:null,height:null,width:null});t.default=i},8268:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let{config:{form:t},viewAction:n,folderId:o,fileId:i,type:s}=e,a=null,u=null;if(n===r)return a=t.folderCreateForm.schemaUrl,u=o,{schemaUrl:a,targetId:u};if(n===l&&i){switch(s){case"insert-media":a=t.fileInsertForm.schemaUrl;break;case"insert-link":a=t.fileEditorLinkForm.schemaUrl;break;case"select":a=t.fileSelectForm.schemaUrl;break;default:a=t.fileEditForm.schemaUrl}return u=i,{schemaUrl:a,targetId:u}}return{}};var o,i=(o=n(6379))&&o.__esModule?o:{default:o};const{CREATE_FOLDER:r,EDIT_FILE:l}=i.default.ACTIONS},9247:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(413===e)return i.default._t("AssetAdmin.ERROR_FILE_SIZE","File size limit exceeded");if(403===e&&t&&"string"==typeof t.response)return t.response;return i.default._t("AssetAdmin.ERROR_DEFAULT","Something went wrong, please try again")};var o,i=(o=n(5815))&&o.__esModule?o:{default:o}},6405:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={CONFIRM_DELETION_ASK:"CONFIRM_DELETION_ASK",CONFIRM_DELETION_CONFIRM:"CONFIRM_DELETION_CONFIRM",CONFIRM_DELETION_CANCEL:"CONFIRM_DELETION_CANCEL",CONFIRM_DELETION_RESET:"CONFIRM_DELETION_RESET",CONFIRM_DELETION_MODAL_CLOSE:"CONFIRM_DELETION_MODAL_CLOSE"}},4461:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cancel=function(){return{type:i.default.CONFIRM_DELETION_CANCEL,payload:{}}},t.confirm=function(e){return{type:i.default.CONFIRM_DELETION_ASK,payload:{files:e}}},t.deleting=function(){return{type:i.default.CONFIRM_DELETION_CONFIRM,payload:{}}},t.modalClose=function(){return{type:i.default.CONFIRM_DELETION_MODAL_CLOSE,payload:{}}},t.reset=function(){return{type:i.default.CONFIRM_DELETION_RESET,payload:{}}};var o,i=(o=n(6405))&&o.__esModule?o:{default:o}},9266:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initialState=t.default=void 0;var o,i=(o=n(6405))&&o.__esModule?o:{default:o},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=l(t);if(n&&n.has(e))return n.get(e);var o={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&{}.hasOwnProperty.call(e,r)){var s=i?Object.getOwnPropertyDescriptor(e,r):null;s&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r]}return o.default=e,n&&n.set(e,o),o}(n(762));function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(l=function(e){return e?n:t})(e)}const s=t.initialState={showConfirmation:!1,files:[],transition:r.NO_TRANSITION};t.default=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case i.default.CONFIRM_DELETION_ASK:return{...s,showConfirmation:!0,files:t.payload.files};case i.default.CONFIRM_DELETION_CANCEL:if(e.showConfirmation)return{...e,transition:r.CANCELING};break;case i.default.CONFIRM_DELETION_CONFIRM:if(e.showConfirmation)return{...e,transition:r.DELETING};break;case i.default.CONFIRM_DELETION_MODAL_CLOSE:return{...e,showConfirmation:!1,transition:r.NO_TRANSITION};case i.default.CONFIRM_DELETION_RESET:return s}return e}},762:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NO_TRANSITION=t.DELETING=t.CANCELING=void 0;t.NO_TRANSITION=!1,t.CANCELING="canceling",t.DELETING="deleting"},6533:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={TOGGLE_SEARCH:"TOGGLE_SEARCH",OPEN_SEARCH:"OPEN_SEARCH",CLOSE_SEARCH:"CLOSE_SEARCH"}},9517:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.closeSearch=function(){return{type:i.default.CLOSE_SEARCH,payload:null}},t.openSearch=function(){return{type:i.default.OPEN_SEARCH,payload:null}},t.toggleSearch=function(){return{type:i.default.TOGGLE_SEARCH,payload:null}};var o,i=(o=n(6533))&&o.__esModule?o:{default:o}},2482:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(2923)),i=r(n(6533));function r(e){return e&&e.__esModule?e:{default:e}}const l={isOpen:!1};t.default=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l;switch((arguments.length>1?arguments[1]:void 0).type){case i.default.TOGGLE_SEARCH:return(0,o.default)({...e,isOpen:!e.isOpen});case i.default.OPEN_SEARCH:return(0,o.default)({...e,isOpen:!0});case i.default.CLOSE_SEARCH:return(0,o.default)({...e,isOpen:!1});default:return e}}},4913:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=["SET_LAST_SELECTED","SET_SELECTED_FILES","DESELECT_FILES","SELECT_FILES","LOAD_FILE_REQUEST","LOAD_FILE_SUCCESS","HIGHLIGHT_FILES","UPDATE_BATCH_ACTIONS","SET_NOTICE_MESSAGE","SET_ERROR_MESSAGE","SET_ENABLE_DROPZONE","SET_FILE_BADGE","CLEAR_FILE_BADGE","ACTIVATE_MODAL","DEACTIVATE_MODAL","CONCATENATE_SELECT","SET_LOADING"].reduce(((e,t)=>Object.assign(e,{[t]:`GALLERY.${t}`})),{})},4201:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.activateModal=function(e){return t=>{t({type:i.default.ACTIVATE_MODAL,payload:e})}},t.clearFileBadge=r,t.deactivateModal=function(){return e=>{e({type:i.default.DEACTIVATE_MODAL})}},t.deselectFiles=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t=>t({type:i.default.DESELECT_FILES,payload:{ids:e}})},t.loadFile=function(e,t){return n=>{n({type:i.default.LOAD_FILE_SUCCESS,payload:{id:e,file:t}})}},t.selectFiles=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t=>t({type:i.default.SELECT_FILES,payload:{ids:e}})},t.setConcatenateSelect=function(e){return t=>t({type:i.default.CONCATENATE_SELECT,payload:!!e})},t.setEnableDropzone=function(e){return t=>t({type:i.default.SET_ENABLE_DROPZONE,payload:{enableDropzone:e}})},t.setErrorMessage=function(e){return t=>t({type:i.default.SET_ERROR_MESSAGE,payload:{message:e}})},t.setFileBadge=function(e,t,n,o){return(l,s)=>{const{assetAdmin:a}=s(),u=a.gallery.badges.find((t=>t.id===e));u&&u.timer&&clearTimeout(u.timer);const d=o>0?setTimeout((()=>r(e)(l)),o):null;l({type:i.default.SET_FILE_BADGE,payload:{id:e,message:t,status:n,timer:d}})}},t.setLastSelected=function(e){return t=>{t({type:i.default.SET_LAST_SELECTED,payload:{id:e}})}},t.setLoading=function(e){return t=>{t({type:i.default.SET_LOADING,payload:!!e})}},t.setNoticeMessage=function(e){return t=>t({type:i.default.SET_NOTICE_MESSAGE,payload:{message:e}})},t.setSelectedFiles=function(e){return t=>{t({type:i.default.SET_SELECTED_FILES,payload:{files:e}})}};var o,i=(o=n(4913))&&o.__esModule?o:{default:o};function r(e){return t=>{t({type:i.default.CLEAR_FILE_BADGE,payload:{id:e}})}}},8518:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s,{type:t,payload:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(t){case r.default.SET_LAST_SELECTED:return{...e,lastSelected:n.id};case r.default.SET_FILE_BADGE:return{...e,badges:e.badges.filter((e=>e.id!==n.id)).concat([n])};case r.default.CLEAR_FILE_BADGE:return{...e,badges:e.badges.filter((e=>e.id!==n.id))};case r.default.SET_ENABLE_DROPZONE:return{...e,enableDropzone:n.enableDropzone};case r.default.SET_NOTICE_MESSAGE:return{...e,noticeMessage:n.message};case r.default.SET_ERROR_MESSAGE:return{...e,errorMessage:n.message};case r.default.LOAD_FILE_SUCCESS:{const t=e.files.find((e=>e.id===n.id));if(t){const i={...t,...n.file};return(0,o.default)({...e,files:e.files.map((e=>e.id===i.id?i:e))})}return e.folder.id===n.id?(0,o.default)({...e,folder:{...e.folder,...n.file}}):e}case r.default.SET_SELECTED_FILES:return(0,o.default)({...e,selectedFiles:Array.isArray(n.files)?n.files:[]});case r.default.SELECT_FILES:{let t=null;return t=null===n.ids?e.files.map((e=>e.id)):e.selectedFiles.concat(n.ids.filter((t=>-1===e.selectedFiles.indexOf(t)))),(0,o.default)({...e,selectedFiles:t})}case r.default.DESELECT_FILES:{let t=null;return t=null===n.ids?[]:e.selectedFiles.filter((e=>-1===n.ids.indexOf(e))),(0,o.default)({...e,selectedFiles:t})}case r.default.ACTIVATE_MODAL:return(0,o.default)({...e,modal:n});case r.default.DEACTIVATE_MODAL:return(0,o.default)({...e,modal:null});case r.default.CONCATENATE_SELECT:return(0,o.default)({...e,concatenateSelect:n});case r.default.SET_LOADING:return(0,o.default)({...e,loading:n});default:return e}};var o=l(n(2923)),i=l(n(5815)),r=l(n(4913));function l(e){return e&&e.__esModule?e:{default:e}}const s={selectedFiles:[],errorMessage:null,noticeMessage:null,enableDropzone:!0,modal:null,badges:[],concatenateSelect:!1,loading:!1,sorters:[{field:"title",direction:"asc",label:i.default._t("AssetAdmin.FILTER_TITLE_ASC","title a-z")},{field:"title",direction:"desc",label:i.default._t("AssetAdmin.FILTER_TITLE_DESC","title z-a")},{field:"lastEdited",direction:"desc",label:i.default._t("AssetAdmin.FILTER_DATE_DESC","newest")},{field:"lastEdited",direction:"asc",label:i.default._t("AssetAdmin.FILTER_DATE_ASC","oldest")}],lastSelected:null}},2804:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultImageFactory=t.default=void 0;var o=r(n(1838)),i=r(n(8632));function r(e){return e&&e.__esModule?e:{default:e}}const l={minRetry:0,maxRetry:0,expiry:0,onStatusChange:()=>null,onRetry:()=>null,onReset:()=>null,onTimeout:()=>null},s=(e,t,n)=>{const o=new Image;o.onload=t,o.onerror=n,o.src=e};t.defaultImageFactory=s;t.default=class{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;this.options={...l,...e},this.factory=t}loadImage(e){return this.options.minRetry&&i.default.lock(e)?this.loadImageLoop(e,this.options.minRetry):null}loadImageLoop(e,t){return this.options.onStatusChange(e,o.default.LOADING),new Promise(((t,n)=>this.factory(e,t,n))).then((()=>this.handleSuccess(e))).catch((()=>this.handleError(e,t)))}handleReset(e,t){this.options.onReset(e),t()}handleTimeout(e,t){const n=setTimeout(e,t);return this.options.onTimeout(n,t),n}handleSuccess(e){i.default.unlock(e),this.options.onStatusChange(e,o.default.SUCCESS)}handleFailure(e){return i.default.unlock(e),this.options.onStatusChange(e,o.default.FAILED),this.options.expiry?new Promise((t=>{this.handleTimeout((()=>this.handleReset(e,t)),1e3*this.options.expiry)})):null}handleError(e,t){return t>this.options.maxRetry?this.handleFailure(e):(this.options.onStatusChange(e,o.default.WAITING),this.handleRetry(e,t))}handleRetry(e,t){const n=new Promise((n=>{this.handleTimeout((()=>n(this.loadImageLoop(e,2*t))),1e3*t)}));return this.options.onRetry(e,t,n),n}setOnRetry(e){this.options.onRetry=e}setOnReset(e){this.options.onReset=e}setOnStatusChange(e){this.options.onStatusChange=e}setOnTimeout(e){this.options.onTimeout=e}}},2153:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={SET_STATUS:"IMAGE_LOAD_SET_STATUS",RESET:"IMAGE_LOAD_RESET"}},769:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadImage=function(e,t){return(n,r)=>{if(!e)return null;if(r().assetAdmin.imageLoad.files.find((t=>t.url===e)))return null;const l={...t,onStatusChange:(e,t)=>n({type:o.default.SET_STATUS,payload:{status:t,url:e}}),onReset:e=>n({type:o.default.RESET,payload:{url:e}})};return new i.default(l).loadImage(e)}};var o=r(n(2153)),i=r(n(2804));function r(e){return e&&e.__esModule?e:{default:e}}},8632:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;class n{constructor(){this.urls=[]}lock(e){return!(this.urls.indexOf(e)>=0)&&(this.urls=[...this.urls,e],!0)}unlock(e){this.urls=this.urls.filter((t=>t!==e))}}t.Component=n,window.ss=window.ss||{},window.ss.imagelocker=window.ss.imagelocker||new n;t.default=window.ss.imagelocker},5214:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r,{type:t,payload:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(t){case i.default.SET_STATUS:return{...e,files:[...e.files.filter((e=>e.url!==n.url)),n]};case i.default.RESET:return{...e,files:[...e.files.filter((e=>e.url!==n.url))]};default:return e}};var o,i=(o=n(2153))&&o.__esModule?o:{default:o};const r={files:[]}},1838:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={DISABLED:"DISABLED",NONE:"NONE",SUCCESS:"SUCCESS",LOADING:"LOADING",WAITING:"WAITING",FAILED:"FAILED"}},2613:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={DEFINE_IMAGE_SIZE_PRESETS:"DEFINE_IMAGE_SIZE_PRESETS",INIT_FORM_SCHEMA_STACK:"INIT_FORM_SCHEMA_STACK",POP_FORM_SCHEMA:"POP_FORM_SCHEMA",PUSH_FORM_SCHEMA:"PUSH_FORM_SCHEMA",RESET:"RESET",RESET_FORM_STACK:"RESET_FORM_STACK"}},1021:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defineImageSizePresets=function(e){return{type:r.default.DEFINE_IMAGE_SIZE_PRESETS,payload:{imageSizePresets:e}}},t.initFormStack=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return{type:r.default.INIT_FORM_SCHEMA_STACK,payload:{formSchema:{type:e,nextType:t}}}},t.popFormStackEntry=function(){return{type:r.default.POP_FORM_SCHEMA}},t.pushFormStackEntry=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return{type:r.default.PUSH_FORM_SCHEMA,payload:{formSchema:{type:e,nextType:t}}}},t.reset=function(){return{type:r.default.RESET}},t.resetFormStack=function(){return{type:r.default.RESET_FORM_STACK}},t.stashFormValues=function(e,t){return(n,r)=>{const s=r(),a=(0,o.default)(s.form.formState,`${e}.values`),u=(0,o.default)(s.form.formSchemas,`${t}.schema.fields`);if(a){const e=Object.keys(a).filter((e=>null!==a[e]&&(0,l.default)(e,u))).map((e=>({name:e,value:a[e]})));n((0,i.setSchemaStateOverrides)(t,{fields:e}))}}};var o=s(n(6104)),i=n(2811),r=s(n(2613)),l=s(n(8896));function s(e){return e&&e.__esModule?e:{default:e}}},8178:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initialState=t.default=void 0;var o,i=(o=n(2613))&&o.__esModule?o:{default:o};const r=t.initialState={imageSizePresets:[],formSchemaStack:[],formSchema:void 0};t.default=function(){return e=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r,{type:t,payload:n}=arguments.length>1?arguments[1]:void 0;const{formSchemaStack:o}=e;switch(t){case i.default.DEFINE_IMAGE_SIZE_PRESETS:return{...e,imageSizePresets:n.imageSizePresets};case i.default.PUSH_FORM_SCHEMA:return{...e,formSchemaStack:[...o,n.formSchema]};case i.default.INIT_FORM_SCHEMA_STACK:return{...e,formSchemaStack:[n.formSchema]};case i.default.POP_FORM_SCHEMA:return{...e,formSchemaStack:o.slice(0,-1)};case i.default.RESET:return r;case i.default.RESET_FORM_STACK:return{...e,formSchemaStack:o.slice(0,1)};default:return e}}(...arguments),{...e,formSchema:e.formSchemaStack.slice(-1).pop()};var e}},8896:function(e,t){"use strict";function n(e,t){let o;for(o=0;o<t.length;o++){const i=t[o];if(i.name===e)return i;if(i.children){const t=n(e,i.children);if(t)return t}}return!1}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){const o=n(e,t);return o&&"hidden"!==o.type&&"Structural"!==o.schemaType&&!o.readOnly&&!o.disabled},t.findField=n},8419:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={PREVIEWFIELD_ADD_FILE:"PREVIEWFIELD_ADD_FILE",PREVIEWFIELD_REMOVE_FILE:"PREVIEWFIELD_REMOVE_FILE",PREVIEWFIELD_UPDATE_FILE:"PREVIEWFIELD_UPDATE_FILE",PREVIEWFIELD_FAIL_UPLOAD:"PREVIEWFIELD_FAIL_UPLOAD",PREVIEWFIELD_UPDATE_STATUS:"PREVIEWFIELD_UPDATE_STATUS"}},8795:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addFile=function(e,t){return{type:i.default.PREVIEWFIELD_ADD_FILE,payload:{id:e,file:t}}},t.failUpload=function(e,t){return{type:i.default.PREVIEWFIELD_FAIL_UPLOAD,payload:{id:e,message:t}}},t.removeFile=function(e){return{type:i.default.PREVIEWFIELD_REMOVE_FILE,payload:{id:e}}},t.updateFile=function(e,t){return{type:i.default.PREVIEWFIELD_UPDATE_FILE,payload:{id:e,data:t}}},t.updateStatus=function(e,t){return{type:i.default.PREVIEWFIELD_UPDATE_STATUS,payload:{id:e,status:t}}};var o,i=(o=n(8419))&&o.__esModule?o:{default:o}},7668:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(2923)),i=r(n(8419));function r(e){return e&&e.__esModule?e:{default:e}}const l={};t.default=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case i.default.PREVIEWFIELD_ADD_FILE:return(0,o.default)(Object.assign({},e,{[t.payload.id]:t.payload.file}));case i.default.PREVIEWFIELD_FAIL_UPLOAD:return(0,o.default)(Object.assign({},e,{[t.payload.id]:Object.assign({},e[t.payload.id],t.payload.message)}));case i.default.PREVIEWFIELD_REMOVE_FILE:return(0,o.default)(Object.assign({},e,{[t.payload.id]:void 0}));case i.default.PREVIEWFIELD_UPDATE_FILE:return(0,o.default)(Object.assign({},e,{[t.payload.id]:Object.assign({},e[t.payload.id],t.payload.data)}));case i.default.PREVIEWFIELD_UPDATE_STATUS:return(0,o.default)(Object.assign({},e,{[t.payload.id]:Object.assign({},e[t.payload.id],t.payload.status)}));default:return e}}},5793:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={ADD_QUEUED_FILE:"ADD_QUEUED_FILE",FAIL_UPLOAD:"FAIL_UPLOAD",PURGE_UPLOAD_QUEUE:"PURGE_UPLOAD_QUEUE",REMOVE_QUEUED_FILE:"REMOVE_QUEUED_FILE",SUCCEED_UPLOAD:"SUCCEED_UPLOAD",UPDATE_QUEUED_FILE:"UPDATE_QUEUED_FILE"}},1369:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addQueuedFile=function(e){return t=>t({type:i.default.ADD_QUEUED_FILE,payload:{file:e}})},t.failUpload=function(e,t,n){return o=>{let r=t.message;return t.errors&&t.errors.length&&(r=t.errors[0]),"string"==typeof t&&(r={value:n||t,type:"error"}),o({type:i.default.FAIL_UPLOAD,payload:{queuedId:e,message:r}})}},t.purgeUploadQueue=function(){return e=>e({type:i.default.PURGE_UPLOAD_QUEUE,payload:null})},t.removeQueuedFile=function(e){return t=>t({type:i.default.REMOVE_QUEUED_FILE,payload:{queuedId:e}})},t.succeedUpload=function(e,t){return n=>n({type:i.default.SUCCEED_UPLOAD,payload:{queuedId:e,json:t}})},t.updateQueuedFile=function(e,t){return n=>n({type:i.default.UPDATE_QUEUED_FILE,payload:{queuedId:e,updates:t}})};var o,i=(o=n(5793))&&o.__esModule?o:{default:o}},8310:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=s(n(2923)),i=s(n(4886)),r=s(n(5815)),l=s(n(5793));function s(e){return e&&e.__esModule?e:{default:e}}const a={items:[]};t.default=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case l.default.ADD_QUEUED_FILE:return(0,o.default)({...e,items:[...e.items,{...i.default,...t.payload.file}]});case l.default.FAIL_UPLOAD:return(0,o.default)({...e,items:e.items.map((e=>e.queuedId===t.payload.queuedId?{...e,message:t.payload.message}:e))});case l.default.PURGE_UPLOAD_QUEUE:return(0,o.default)({...e,items:e.items.filter((e=>!e.id))});case l.default.REMOVE_QUEUED_FILE:return(0,o.default)({...e,items:e.items.filter((e=>e.queuedId!==t.payload.queuedId))});case l.default.SUCCEED_UPLOAD:return(0,o.default)({...e,items:e.items.map((e=>e.queuedId===t.payload.queuedId?{...e,...t.payload.json,messages:[{value:r.default._t("AssetAdmin.DROPZONE_SUCCESS_UPLOAD"),type:"success",extraClass:"success"}]}:e))});case l.default.UPDATE_QUEUED_FILE:return(0,o.default)({...e,items:e.items.map((e=>e.queuedId===t.payload.queuedId?{...e,...t.payload.updates}:e))});default:return e}}},7537:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={UPLOADFIELD_SET_FORM_SCHEMA_FILES_HASH:"UPLOADFIELD_SET_FORM_SCHEMA_FILES_HASH",UPLOADFIELD_ADD_FILE:"UPLOADFIELD_ADD_FILE",UPLOADFIELD_SET_FILES:"UPLOADFIELD_SET_FILES",UPLOADFIELD_REMOVE_FILE:"UPLOADFIELD_REMOVE_FILE",UPLOADFIELD_UPLOAD_FAILURE:"UPLOADFIELD_UPLOAD_FAILURE",UPLOADFIELD_UPLOAD_SUCCESS:"UPLOADFIELD_UPLOAD_SUCCESS",UPLOADFIELD_UPDATE_QUEUED_FILE:"UPLOADFIELD_UPDATE_QUEUED_FILE"}},1433:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addFile=function(e,t){return n=>n({type:i.default.UPLOADFIELD_ADD_FILE,payload:{fieldId:e,file:t}})},t.failUpload=function(e,t,n,o){return r=>{let l=n.message;return"string"==typeof n&&(l={value:o||n,type:"error"}),r({type:i.default.UPLOADFIELD_UPLOAD_FAILURE,payload:{fieldId:e,queuedId:t,message:l}})}},t.removeFile=function(e,t){return n=>n({type:i.default.UPLOADFIELD_REMOVE_FILE,payload:{fieldId:e,file:t}})},t.setFiles=function(e,t){return n=>n({type:i.default.UPLOADFIELD_SET_FILES,payload:{fieldId:e,files:t}})},t.setFormSchemaFilesHash=function(e,t){return n=>n({type:i.default.UPLOADFIELD_SET_FORM_SCHEMA_FILES_HASH,payload:{fieldId:e,hash:t}})},t.succeedUpload=function(e,t,n){return o=>o({type:i.default.UPLOADFIELD_UPLOAD_SUCCESS,payload:{fieldId:e,queuedId:t,json:n}})},t.updateQueuedFile=function(e,t,n){return o=>o({type:i.default.UPLOADFIELD_UPDATE_QUEUED_FILE,payload:{fieldId:e,queuedId:t,updates:n}})};var o,i=(o=n(7537))&&o.__esModule?o:{default:o}},2726:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=l(n(4886)),i=l(n(6595)),r=l(n(7537));function l(e){return e&&e.__esModule?e:{default:e}}const s={fields:{}},a={formSchemaFilesHash:null,files:[]};t.default=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s,t=arguments.length>1?arguments[1]:void 0;const n=(0,i.default)(e,t,a);switch(t.type){case r.default.UPLOADFIELD_SET_FORM_SCHEMA_FILES_HASH:return n((()=>({formSchemaFilesHash:t.payload.hash})));case r.default.UPLOADFIELD_ADD_FILE:return n((e=>e.files.find((e=>e.id===t.payload.file.id))?e:{...e,files:[...e.files,{...o.default,...t.payload.file}]}));case r.default.UPLOADFIELD_SET_FILES:return n((()=>({files:t.payload.files})));case r.default.UPLOADFIELD_UPLOAD_FAILURE:return n((e=>({files:e.files.map((e=>e.queuedId===t.payload.queuedId?Object.assign({},e,{message:t.payload.message}):e))})));case r.default.UPLOADFIELD_REMOVE_FILE:return n((e=>({files:e.files.filter((e=>!(t.payload.file.queuedId&&e.queuedId===t.payload.file.queuedId||t.payload.file.id&&e.id===t.payload.file.id)))})));case r.default.UPLOADFIELD_UPLOAD_SUCCESS:return n((e=>({files:e.files.map((e=>e.queuedId===t.payload.queuedId?Object.assign({},e,t.payload.json):e))})));case r.default.UPLOADFIELD_UPDATE_QUEUED_FILE:return n((e=>({files:e.files.map((e=>e.queuedId===t.payload.queuedId?Object.assign({},e,t.payload.updates):e))})));default:return e}}},1991:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(1594)),i=r(n(5815));function r(e){return e&&e.__esModule?e:{default:e}}t.default=e=>t=>{const n=t.onClick,r={...t,onClick(e,o){const{owners:r}=t.data;let l=null;l=r&&parseInt(r,10)>0?[i.default.inject(i.default._t("AssetAdmin.SINGLE_OWNED_WARNING_1","This file is being used in {count} other published section(s)."),{count:r}),i.default._t("AssetAdmin.SINGLE_OWNED_WARNING_2","Ensure files are removed from content areas prior to unpublishing them. Otherwise, they will appear as broken links."),i.default._t("AssetAdmin.SINGLE_OWNED_WARNING_3","Do you want to unpublish this file anyway?")].join("\n\n"):i.default._t("AssetAdmin.CONFIRMUNPUBLISH","Are you sure you want to unpublish this record?"),confirm(l)?n(e,o):e.preventDefault()}};return o.default.createElement(e,r)}},315:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.disabledTreeDropdownField=t.default=void 0;var o,i=(o=n(1594))&&o.__esModule?o:{default:o},r=n(9040),l=n(9367),s=n(7818);const a=e=>t=>{const{disabledIDs:n}=t,o=t.findTreeByPath||s.findTreeByPath,r={...t,findTreeByPath(e,t){const i=o(e,t),r=t.some((e=>n.includes(e)));return i?{...i,children:i.children.map((e=>({...e,disabled:r||n.includes(e.id)})))}:null}};return i.default.createElement(e,r)};t.disabledTreeDropdownField=a;const u=(0,l.compose)((0,r.connect)((e=>({disabledIDs:e.assetAdmin.gallery.selectedFiles}))),a);t.default=u},9021:function(e,t,n){var o;e.exports=(o=o||function(e,t){var o;if("undefined"!=typeof window&&window.crypto&&(o=window.crypto),"undefined"!=typeof self&&self.crypto&&(o=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(o=globalThis.crypto),!o&&"undefined"!=typeof window&&window.msCrypto&&(o=window.msCrypto),!o&&void 0!==n.g&&n.g.crypto&&(o=n.g.crypto),!o)try{o=n(477)}catch(e){}var i=function(){if(o){if("function"==typeof o.getRandomValues)try{return o.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof o.randomBytes)try{return o.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},r=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),l={},s=l.lib={},a=s.Base={extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},u=s.WordArray=a.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:4*e.length},toString:function(e){return(e||c).stringify(this)},concat:function(e){var t=this.words,n=e.words,o=this.sigBytes,i=e.sigBytes;if(this.clamp(),o%4)for(var r=0;r<i;r++){var l=n[r>>>2]>>>24-r%4*8&255;t[o+r>>>2]|=l<<24-(o+r)%4*8}else for(var s=0;s<i;s+=4)t[o+s>>>2]=n[s>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push(i());return new u.init(t,e)}}),d=l.enc={},c=d.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,o=[],i=0;i<n;i++){var r=t[i>>>2]>>>24-i%4*8&255;o.push((r>>>4).toString(16)),o.push((15&r).toString(16))}return o.join("")},parse:function(e){for(var t=e.length,n=[],o=0;o<t;o+=2)n[o>>>3]|=parseInt(e.substr(o,2),16)<<24-o%8*4;return new u.init(n,t/2)}},f=d.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,o=[],i=0;i<n;i++){var r=t[i>>>2]>>>24-i%4*8&255;o.push(String.fromCharCode(r))}return o.join("")},parse:function(e){for(var t=e.length,n=[],o=0;o<t;o++)n[o>>>2]|=(255&e.charCodeAt(o))<<24-o%4*8;return new u.init(n,t)}},p=d.Utf8={stringify:function(e){try{return decodeURIComponent(escape(f.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return f.parse(unescape(encodeURIComponent(e)))}},h=s.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,o=this._data,i=o.words,r=o.sigBytes,l=this.blockSize,s=r/(4*l),a=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*l,d=e.min(4*a,r);if(a){for(var c=0;c<a;c+=l)this._doProcessBlock(i,c);n=i.splice(0,a),o.sigBytes-=d}return new u.init(n,d)},clone:function(){var e=a.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),g=(s.Hasher=h.extend({cfg:a.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){h.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new g.HMAC.init(e,n).finalize(t)}}}),l.algo={});return l}(Math),o)},4636:function(e,t,n){var o;e.exports=(o=n(9021),function(e){var t=o,n=t.lib,i=n.WordArray,r=n.Hasher,l=t.algo,s=[];!function(){for(var t=0;t<64;t++)s[t]=4294967296*e.abs(e.sin(t+1))|0}();var a=l.MD5=r.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var o=t+n,i=e[o];e[o]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var r=this._hash.words,l=e[t+0],a=e[t+1],p=e[t+2],h=e[t+3],g=e[t+4],m=e[t+5],v=e[t+6],b=e[t+7],y=e[t+8],_=e[t+9],E=e[t+10],S=e[t+11],C=e[t+12],w=e[t+13],F=e[t+14],I=e[t+15],A=r[0],O=r[1],R=r[2],M=r[3];A=u(A,O,R,M,l,7,s[0]),M=u(M,A,O,R,a,12,s[1]),R=u(R,M,A,O,p,17,s[2]),O=u(O,R,M,A,h,22,s[3]),A=u(A,O,R,M,g,7,s[4]),M=u(M,A,O,R,m,12,s[5]),R=u(R,M,A,O,v,17,s[6]),O=u(O,R,M,A,b,22,s[7]),A=u(A,O,R,M,y,7,s[8]),M=u(M,A,O,R,_,12,s[9]),R=u(R,M,A,O,E,17,s[10]),O=u(O,R,M,A,S,22,s[11]),A=u(A,O,R,M,C,7,s[12]),M=u(M,A,O,R,w,12,s[13]),R=u(R,M,A,O,F,17,s[14]),A=d(A,O=u(O,R,M,A,I,22,s[15]),R,M,a,5,s[16]),M=d(M,A,O,R,v,9,s[17]),R=d(R,M,A,O,S,14,s[18]),O=d(O,R,M,A,l,20,s[19]),A=d(A,O,R,M,m,5,s[20]),M=d(M,A,O,R,E,9,s[21]),R=d(R,M,A,O,I,14,s[22]),O=d(O,R,M,A,g,20,s[23]),A=d(A,O,R,M,_,5,s[24]),M=d(M,A,O,R,F,9,s[25]),R=d(R,M,A,O,h,14,s[26]),O=d(O,R,M,A,y,20,s[27]),A=d(A,O,R,M,w,5,s[28]),M=d(M,A,O,R,p,9,s[29]),R=d(R,M,A,O,b,14,s[30]),A=c(A,O=d(O,R,M,A,C,20,s[31]),R,M,m,4,s[32]),M=c(M,A,O,R,y,11,s[33]),R=c(R,M,A,O,S,16,s[34]),O=c(O,R,M,A,F,23,s[35]),A=c(A,O,R,M,a,4,s[36]),M=c(M,A,O,R,g,11,s[37]),R=c(R,M,A,O,b,16,s[38]),O=c(O,R,M,A,E,23,s[39]),A=c(A,O,R,M,w,4,s[40]),M=c(M,A,O,R,l,11,s[41]),R=c(R,M,A,O,h,16,s[42]),O=c(O,R,M,A,v,23,s[43]),A=c(A,O,R,M,_,4,s[44]),M=c(M,A,O,R,C,11,s[45]),R=c(R,M,A,O,I,16,s[46]),A=f(A,O=c(O,R,M,A,p,23,s[47]),R,M,l,6,s[48]),M=f(M,A,O,R,b,10,s[49]),R=f(R,M,A,O,F,15,s[50]),O=f(O,R,M,A,m,21,s[51]),A=f(A,O,R,M,C,6,s[52]),M=f(M,A,O,R,h,10,s[53]),R=f(R,M,A,O,E,15,s[54]),O=f(O,R,M,A,a,21,s[55]),A=f(A,O,R,M,y,6,s[56]),M=f(M,A,O,R,I,10,s[57]),R=f(R,M,A,O,v,15,s[58]),O=f(O,R,M,A,w,21,s[59]),A=f(A,O,R,M,g,6,s[60]),M=f(M,A,O,R,S,10,s[61]),R=f(R,M,A,O,p,15,s[62]),O=f(O,R,M,A,_,21,s[63]),r[0]=r[0]+A|0,r[1]=r[1]+O|0,r[2]=r[2]+R|0,r[3]=r[3]+M|0},_doFinalize:function(){var t=this._data,n=t.words,o=8*this._nDataBytes,i=8*t.sigBytes;n[i>>>5]|=128<<24-i%32;var r=e.floor(o/4294967296),l=o;n[15+(i+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),n[14+(i+64>>>9<<4)]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8),t.sigBytes=4*(n.length+1),this._process();for(var s=this._hash,a=s.words,u=0;u<4;u++){var d=a[u];a[u]=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8)}return s},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}});function u(e,t,n,o,i,r,l){var s=e+(t&n|~t&o)+i+l;return(s<<r|s>>>32-r)+t}function d(e,t,n,o,i,r,l){var s=e+(t&o|n&~o)+i+l;return(s<<r|s>>>32-r)+t}function c(e,t,n,o,i,r,l){var s=e+(t^n^o)+i+l;return(s<<r|s>>>32-r)+t}function f(e,t,n,o,i,r,l){var s=e+(n^(t|~o))+i+l;return(s<<r|s>>>32-r)+t}t.MD5=r._createHelper(a),t.HmacMD5=r._createHmacHelper(a)}(Math),o.MD5)},871:function(e,t,n){var o=n(1021),i=n(4160);void 0===i.AssetAdminModalActions&&(i.AssetAdminModalActions=o),e.exports=o},4639:function(e,t,n){var o=n(4333),i=n(4160);void 0===i.InsertEmbedModal&&(i.InsertEmbedModal=o),e.exports=o},6166:function(e,t,n){var o=n(6931),i=n(4160);void 0===i.InsertMediaModal&&(i.InsertMediaModal=o),e.exports=o},4160:function(e,t,n){"use strict";e.exports=function(){if("object"==typeof globalThis)return globalThis;var e;try{e=this||new Function("return this")()}catch(e){if("object"==typeof window)return window;if("object"==typeof self)return self;if(void 0!==n.g)return n.g}return e}()},1549:function(e,t,n){var o=n(2032),i=n(3862),r=n(6721),l=n(2749),s=n(5749);function a(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}a.prototype.clear=o,a.prototype.delete=i,a.prototype.get=r,a.prototype.has=l,a.prototype.set=s,e.exports=a},79:function(e,t,n){var o=n(3702),i=n(80),r=n(4739),l=n(8655),s=n(1175);function a(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}a.prototype.clear=o,a.prototype.delete=i,a.prototype.get=r,a.prototype.has=l,a.prototype.set=s,e.exports=a},8223:function(e,t,n){var o=n(6110)(n(9325),"Map");e.exports=o},3661:function(e,t,n){var o=n(3040),i=n(7670),r=n(289),l=n(4509),s=n(2949);function a(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}a.prototype.clear=o,a.prototype.delete=i,a.prototype.get=r,a.prototype.has=l,a.prototype.set=s,e.exports=a},1873:function(e,t,n){var o=n(9325).Symbol;e.exports=o},4932:function(e){e.exports=function(e,t){for(var n=-1,o=null==e?0:e.length,i=Array(o);++n<o;)i[n]=t(e[n],n,e);return i}},6025:function(e,t,n){var o=n(5288);e.exports=function(e,t){for(var n=e.length;n--;)if(o(e[n][0],t))return n;return-1}},2552:function(e,t,n){var o=n(1873),i=n(659),r=n(9350),l=o?o.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":l&&l in Object(e)?i(e):r(e)}},5083:function(e,t,n){var o=n(1882),i=n(7296),r=n(3805),l=n(7473),s=/^\[object .+?Constructor\]$/,a=Function.prototype,u=Object.prototype,d=a.toString,c=u.hasOwnProperty,f=RegExp("^"+d.call(c).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!r(e)||i(e))&&(o(e)?f:s).test(l(e))}},7556:function(e,t,n){var o=n(1873),i=n(4932),r=n(6449),l=n(4394),s=o?o.prototype:void 0,a=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(r(t))return i(t,e)+"";if(l(t))return a?a.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}},3007:function(e){e.exports=function(e,t){var n=-1,o=e.length;for(t||(t=Array(o));++n<o;)t[n]=e[n];return t}},5481:function(e,t,n){var o=n(9325)["__core-js_shared__"];e.exports=o},4840:function(e,t,n){var o="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=o},2651:function(e,t,n){var o=n(4218);e.exports=function(e,t){var n=e.__data__;return o(t)?n["string"==typeof t?"string":"hash"]:n.map}},6110:function(e,t,n){var o=n(5083),i=n(392);e.exports=function(e,t){var n=i(e,t);return o(n)?n:void 0}},659:function(e,t,n){var o=n(1873),i=Object.prototype,r=i.hasOwnProperty,l=i.toString,s=o?o.toStringTag:void 0;e.exports=function(e){var t=r.call(e,s),n=e[s];try{e[s]=void 0;var o=!0}catch(e){}var i=l.call(e);return o&&(t?e[s]=n:delete e[s]),i}},392:function(e){e.exports=function(e,t){return null==e?void 0:e[t]}},2032:function(e,t,n){var o=n(1042);e.exports=function(){this.__data__=o?o(null):{},this.size=0}},3862:function(e){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},6721:function(e,t,n){var o=n(1042),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(o){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return i.call(t,e)?t[e]:void 0}},2749:function(e,t,n){var o=n(1042),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return o?void 0!==t[e]:i.call(t,e)}},5749:function(e,t,n){var o=n(1042);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=o&&void 0===t?"__lodash_hash_undefined__":t,this}},4218:function(e){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},7296:function(e,t,n){var o,i=n(5481),r=(o=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+o:"";e.exports=function(e){return!!r&&r in e}},3702:function(e){e.exports=function(){this.__data__=[],this.size=0}},80:function(e,t,n){var o=n(6025),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=o(t,e);return!(n<0)&&(n==t.length-1?t.pop():i.call(t,n,1),--this.size,!0)}},4739:function(e,t,n){var o=n(6025);e.exports=function(e){var t=this.__data__,n=o(t,e);return n<0?void 0:t[n][1]}},8655:function(e,t,n){var o=n(6025);e.exports=function(e){return o(this.__data__,e)>-1}},1175:function(e,t,n){var o=n(6025);e.exports=function(e,t){var n=this.__data__,i=o(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},3040:function(e,t,n){var o=n(1549),i=n(79),r=n(8223);e.exports=function(){this.size=0,this.__data__={hash:new o,map:new(r||i),string:new o}}},7670:function(e,t,n){var o=n(2651);e.exports=function(e){var t=o(this,e).delete(e);return this.size-=t?1:0,t}},289:function(e,t,n){var o=n(2651);e.exports=function(e){return o(this,e).get(e)}},4509:function(e,t,n){var o=n(2651);e.exports=function(e){return o(this,e).has(e)}},2949:function(e,t,n){var o=n(2651);e.exports=function(e,t){var n=o(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}},2224:function(e,t,n){var o=n(104);e.exports=function(e){var t=o(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},1042:function(e,t,n){var o=n(6110)(Object,"create");e.exports=o},9350:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},9325:function(e,t,n){var o=n(4840),i="object"==typeof self&&self&&self.Object===Object&&self,r=o||i||Function("return this")();e.exports=r},1802:function(e,t,n){var o=n(2224),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,l=o((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,(function(e,n,o,i){t.push(o?i.replace(r,"$1"):n||e)})),t}));e.exports=l},7797:function(e,t,n){var o=n(4394);e.exports=function(e){if("string"==typeof e||o(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},7473:function(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},5288:function(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},6449:function(e){var t=Array.isArray;e.exports=t},1882:function(e,t,n){var o=n(2552),i=n(3805);e.exports=function(e){if(!i(e))return!1;var t=o(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},3805:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},346:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},4394:function(e,t,n){var o=n(2552),i=n(346);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==o(e)}},104:function(e,t,n){var o=n(3661);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var o=arguments,i=t?t.apply(this,o):o[0],r=n.cache;if(r.has(i))return r.get(i);var l=e.apply(this,o);return n.cache=r.set(i,l)||r,l};return n.cache=new(i.Cache||o),n}i.Cache=o,e.exports=i},2072:function(e,t,n){var o=n(4932),i=n(3007),r=n(6449),l=n(4394),s=n(1802),a=n(7797),u=n(3222);e.exports=function(e){return r(e)?o(e,a):l(e)?[e]:i(s(u(e)))}},3222:function(e,t,n){var o=n(7556);e.exports=function(e){return null==e?"":o(e)}},4172:function(e,t,n){var o,i;e.exports=(o=n(1594),i=n(4518),function(e){function t(o){if(n[o])return n[o].exports;var i=n[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=12)}([function(e,t,n){"use strict";function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function r(e){if(c===setTimeout)return setTimeout(e,0);if((c===o||!c)&&setTimeout)return c=setTimeout,setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function l(e){if(f===clearTimeout)return clearTimeout(e);if((f===i||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(e);try{return f(e)}catch(t){try{return f.call(null,e)}catch(t){return f.call(this,e)}}}function s(){m&&h&&(m=!1,h.length?g=h.concat(g):v=-1,g.length&&a())}function a(){if(!m){var e=r(s);m=!0;for(var t=g.length;t;){for(h=g,g=[];++v<t;)h&&h[v].run();v=-1,t=g.length}h=null,m=!1,l(e)}}function u(e,t){this.fun=e,this.array=t}function d(){}var c,f,p=e.exports={};!function(){try{c="function"==typeof setTimeout?setTimeout:o}catch(e){c=o}try{f="function"==typeof clearTimeout?clearTimeout:i}catch(e){f=i}}();var h,g=[],m=!1,v=-1;p.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];g.push(new u(e,t)),1!==g.length||m||r(a)},u.prototype.run=function(){this.fun.apply(null,this.array)},p.title="browser",p.browser=!0,p.env={},p.argv=[],p.version="",p.versions={},p.on=d,p.addListener=d,p.once=d,p.off=d,p.removeListener=d,p.removeAllListeners=d,p.emit=d,p.prependListener=d,p.prependOnceListener=d,p.listeners=function(e){return[]},p.binding=function(e){throw new Error("process.binding is not supported")},p.cwd=function(){return"/"},p.chdir=function(e){throw new Error("process.chdir is not supported")},p.umask=function(){return 0}},function(e,t,n){"use strict";function o(e){return function(){return e}}var i=function(){};i.thatReturns=o,i.thatReturnsFalse=o(!1),i.thatReturnsTrue=o(!0),i.thatReturnsNull=o(null),i.thatReturnsThis=function(){return this},i.thatReturnsArgument=function(e){return e},e.exports=i},function(e,t,n){"use strict";(function(t){function n(e,t,n,i,r,l,s,a){if(o(t),!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var d=[n,i,r,l,s,a],c=0;(u=new Error(t.replace(/%s/g,(function(){return d[c++]})))).name="Invariant Violation"}throw u.framesToPop=1,u}}var o=function(e){};"production"!==t.env.NODE_ENV&&(o=function(e){if(void 0===e)throw new Error("invariant requires an error message argument")}),e.exports=n}).call(t,n(0))},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(e,t){if("function"!=typeof t)throw new Error("isNodeIn second parameter must be a function");for(var n=e;n;){if(t(n))return!0;n=n.parentNode}return!1};t.default=o},function(e,t){e.exports=o},function(e,t){e.exports=i},function(e,t,n){"use strict";(function(t){var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};if("production"!==t.env.NODE_ENV){var i="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,r=function(e){return"object"===(void 0===e?"undefined":o(e))&&null!==e&&e.$$typeof===i};e.exports=n(14)(r,!0)}else e.exports=n(17)()}).call(t,n(0))},function(e,t,n){"use strict";(function(t){var o=n(1);if("production"!==t.env.NODE_ENV){var i=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];var i=0,r="Warning: "+e.replace(/%s/g,(function(){return n[i++]}));"undefined"!=typeof console&&console.error(r);try{throw new Error(r)}catch(e){}};o=function(e,t){if(void 0===t)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(0!==t.indexOf("Failed Composite propType: ")&&!e){for(var n=arguments.length,o=Array(n>2?n-2:0),r=2;r<n;r++)o[r-2]=arguments[r];i.apply(void 0,[t].concat(o))}}}e.exports=o}).call(t,n(0))},function(e,t){(function(t){e.exports=t}).call(t,{})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){return e&&e.__esModule?e:{default:e}}(n(4)),i=function(e,t){return(0,o.default)(e,(function(e){return e===t}))};t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.getBoundingClientRect();return{top:t.top+document.body.scrollTop,left:t.left+document.body.scrollLeft,offsetWidth:e.offsetWidth,offsetHeight:e.offsetHeight}}},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.nodeInRoot=t.isNodeIn=t.createSelectable=t.SelectableGroup=void 0;var i=o(n(13)),r=o(n(22)),l=o(n(4)),s=o(n(10));t.SelectableGroup=i.default,t.createSelectable=r.default,t.isNodeIn=l.default,t.nodeInRoot=s.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),a=n(5),u=o(a),d=n(6),c=o(n(7)),f=o(n(18)),p=o(n(10)),h=o(n(4)),g=o(n(11)),m=o(n(19)),v=o(n(20)),b=function(e){function t(e){i(this,t);var n=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={isBoxSelecting:!1,boxWidth:0,boxHeight:0},n._mouseDownData=null,n._rect=null,n._registry=[],n._openSelector=n._openSelector.bind(n),n._mouseDown=n._mouseDown.bind(n),n._mouseUp=n._mouseUp.bind(n),n._selectElements=n._selectElements.bind(n),n._registerSelectable=n._registerSelectable.bind(n),n._unregisterSelectable=n._unregisterSelectable.bind(n),n._throttledSelect=(0,v.default)(n._selectElements,50),n}return l(t,e),s(t,[{key:"getChildContext",value:function(){return{selectable:{register:this._registerSelectable,unregister:this._unregisterSelectable}}}},{key:"componentDidMount",value:function(){this._applyMousedown(this.props.enabled),this._rect=this._getInitialCoordinates()}},{key:"componentWillUnmount",value:function(){this._applyMousedown(!1)}},{key:"componentWillReceiveProps",value:function(e){e.enabled!==this.props.enabled&&this._applyMousedown(e.enabled)}},{key:"_registerSelectable",value:function(e,t){this._registry.push({key:e,domNode:t})}},{key:"_unregisterSelectable",value:function(e){this._registry=this._registry.filter((function(t){return t.key!==e}))}},{key:"_applyMousedown",value:function(e){var t=e?"addEventListener":"removeEventListener";(0,d.findDOMNode)(this)[t]("mousedown",this._mouseDown)}},{key:"_openSelector",value:function(e){var t=Math.abs(this._mouseDownData.initialW-e.pageX+this._rect.x),n=Math.abs(this._mouseDownData.initialH-e.pageY+this._rect.y);this.setState({isBoxSelecting:!0,boxWidth:t,boxHeight:n,boxLeft:Math.min(e.pageX-this._rect.x,this._mouseDownData.initialW),boxTop:Math.min(e.pageY-this._rect.y,this._mouseDownData.initialH)}),this._throttledSelect(e)}},{key:"_getInitialCoordinates",value:function(){if(this.props.fixedPosition)return{x:0,y:0};var e=window.getComputedStyle(document.body),t=e.getPropertyValue("margin-top"),n=e.getPropertyValue("margin-left"),o=parseInt(n.slice(0,n.length-2),10),i=parseInt(t.slice(0,t.length-2),10),r=document.body.getBoundingClientRect(),l=(0,d.findDOMNode)(this).getBoundingClientRect();return{x:Math.round(l.left-r.left+o),y:Math.round(l.top-r.top+i)}}},{key:"_mouseDown",value:function(e){var t=this.props,n=t.onBeginSelection,o=t.preventDefault;if(!(0,h.default)(e.target,(function(e){return!!e.draggable}))&&("function"!=typeof n||!1!==n(e))){var i=(0,d.findDOMNode)(this),r=void 0;window.addEventListener("mouseup",this._mouseUp),3!==e.which&&2!==e.button&&((0,p.default)(e.target,i)||(r=(0,g.default)(i),(0,m.default)({top:r.top,left:r.left,bottom:r.offsetHeight,right:r.offsetWidth},{top:e.pageY-this._rect.y,left:e.pageX-this._rect.x,offsetWidth:0,offsetHeight:0})))&&(this._rect=this._getInitialCoordinates(),this._mouseDownData={boxLeft:e.pageX-this._rect.x,boxTop:e.pageY-this._rect.y,initialW:e.pageX-this._rect.x,initialH:e.pageY-this._rect.y},o&&e.preventDefault(),window.addEventListener("mousemove",this._openSelector))}}},{key:"_mouseUp",value:function(e){var t=this.props.onNonItemClick,n=this.state.isBoxSelecting;e.stopPropagation(),window.removeEventListener("mousemove",this._openSelector),window.removeEventListener("mouseup",this._mouseUp),this._mouseDownData&&(t&&!n&&(this._registry.some((function(t){var n=t.domNode;return(0,p.default)(e.target,n)}))||t(e)),this._selectElements(e,!0),this._mouseDownData=null,this.setState({isBoxSelecting:!1,boxWidth:0,boxHeight:0}))}},{key:"_selectElements",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.props,o=n.tolerance,i=n.onSelection,r=n.onEndSelection,l=[],s=(0,d.findDOMNode)(this.refs.selectbox);s&&(this._registry.forEach((function(e){e.domNode&&(0,m.default)(s,e.domNode,o)&&!l.includes(e.key)&&l.push(e.key)})),t?"function"==typeof r&&r(l,e):"function"==typeof i&&i(l,e))}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.enabled,o=e.fixedPosition,i=e.className,r=e.selectingClassName,l=this.state,s=l.isBoxSelecting,a=l.boxLeft,d=l.boxTop,c=l.boxWidth,p=l.boxHeight,h=this.props.component;if(!n)return u.default.createElement(h,{className:i},t);var g={left:a,top:d,width:c,height:p,zIndex:9e3,position:o?"fixed":"absolute",cursor:"default"},m={backgroundColor:"transparent",border:"1px dashed #999",width:"100%",height:"100%",float:"left"},v={position:"relative",overflow:"visible"};return u.default.createElement(h,{className:(0,f.default)(i,s?r:null),style:v},s?u.default.createElement("div",{style:g,ref:"selectbox"},u.default.createElement("span",{style:m})):null,t)}}]),t}(a.Component);b.propTypes={children:c.default.node,onBeginSelection:c.default.func,onEndSelection:c.default.func,onSelection:c.default.func,component:c.default.node,tolerance:c.default.number,fixedPosition:c.default.bool,preventDefault:c.default.bool,onNonItemClick:c.default.func,enabled:c.default.bool,className:c.default.string,selectingClassName:c.default.string},b.defaultProps={component:"div",tolerance:0,fixedPosition:!1,preventDefault:!0,enabled:!0},b.childContextTypes={selectable:c.default.object},t.default=b},function(e,t,n){"use strict";(function(t){var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=n(1),r=n(2),l=n(8),s=n(15),a=n(3),u=n(16);e.exports=function(e,n){function d(e){var t=e&&(O&&e[O]||e[R]);if("function"==typeof t)return t}function c(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function f(e){this.message=e,this.stack=""}function p(e){function o(o,u,d,c,p,h,g){if(c=c||M,h=h||d,g!==a)if(n)r(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");else if("production"!==t.env.NODE_ENV&&"undefined"!=typeof console){var m=c+":"+d;!i[m]&&s<3&&(l(!1,"You are manually calling a React.PropTypes validation function for the `%s` prop on `%s`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details.",h,c),i[m]=!0,s++)}return null==u[d]?o?new f(null===u[d]?"The "+p+" `"+h+"` is marked as required in `"+c+"`, but its value is `null`.":"The "+p+" `"+h+"` is marked as required in `"+c+"`, but its value is `undefined`."):null:e(u,d,c,p,h)}if("production"!==t.env.NODE_ENV)var i={},s=0;var u=o.bind(null,!1);return u.isRequired=o.bind(null,!0),u}function h(e){function t(t,n,o,i,r,l){var s=t[n];return w(s)!==e?new f("Invalid "+i+" `"+r+"` of type `"+F(s)+"` supplied to `"+o+"`, expected `"+e+"`."):null}return p(t)}function g(e){function t(t,n,o,i,r){if("function"!=typeof e)return new f("Property `"+r+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var l=t[n];if(!Array.isArray(l))return new f("Invalid "+i+" `"+r+"` of type `"+w(l)+"` supplied to `"+o+"`, expected an array.");for(var s=0;s<l.length;s++){var u=e(l,s,o,i,r+"["+s+"]",a);if(u instanceof Error)return u}return null}return p(t)}function m(e){function t(t,n,o,i,r){if(!(t[n]instanceof e)){var l=e.name||M;return new f("Invalid "+i+" `"+r+"` of type `"+A(t[n])+"` supplied to `"+o+"`, expected instance of `"+l+"`.")}return null}return p(t)}function v(e){function n(t,n,o,i,r){for(var l=t[n],s=0;s<e.length;s++)if(c(l,e[s]))return null;return new f("Invalid "+i+" `"+r+"` of value `"+l+"` supplied to `"+o+"`, expected one of "+JSON.stringify(e)+".")}return Array.isArray(e)?p(n):("production"!==t.env.NODE_ENV&&l(!1,"Invalid argument supplied to oneOf, expected an instance of array."),i.thatReturnsNull)}function b(e){function t(t,n,o,i,r){if("function"!=typeof e)return new f("Property `"+r+"` of component `"+o+"` has invalid PropType notation inside objectOf.");var l=t[n],s=w(l);if("object"!==s)return new f("Invalid "+i+" `"+r+"` of type `"+s+"` supplied to `"+o+"`, expected an object.");for(var u in l)if(l.hasOwnProperty(u)){var d=e(l,u,o,i,r+"."+u,a);if(d instanceof Error)return d}return null}return p(t)}function y(e){function n(t,n,o,i,r){for(var l=0;l<e.length;l++)if(null==(0,e[l])(t,n,o,i,r,a))return null;return new f("Invalid "+i+" `"+r+"` supplied to `"+o+"`.")}if(!Array.isArray(e))return"production"!==t.env.NODE_ENV&&l(!1,"Invalid argument supplied to oneOfType, expected an instance of array."),i.thatReturnsNull;for(var o=0;o<e.length;o++){var r=e[o];if("function"!=typeof r)return l(!1,"Invalid argument supplied to oneOfType. Expected an array of check functions, but received %s at index %s.",I(r),o),i.thatReturnsNull}return p(n)}function _(e){function t(t,n,o,i,r){var l=t[n],s=w(l);if("object"!==s)return new f("Invalid "+i+" `"+r+"` of type `"+s+"` supplied to `"+o+"`, expected `object`.");for(var u in e){var d=e[u];if(d){var c=d(l,u,o,i,r+"."+u,a);if(c)return c}}return null}return p(t)}function E(e){function t(t,n,o,i,r){var l=t[n],u=w(l);if("object"!==u)return new f("Invalid "+i+" `"+r+"` of type `"+u+"` supplied to `"+o+"`, expected `object`.");var d=s({},t[n],e);for(var c in d){var p=e[c];if(!p)return new f("Invalid "+i+" `"+r+"` key `"+c+"` supplied to `"+o+"`.\nBad object: "+JSON.stringify(t[n],null,"  ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null,"  "));var h=p(l,c,o,i,r+"."+c,a);if(h)return h}return null}return p(t)}function S(t){switch(void 0===t?"undefined":o(t)){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(S);if(null===t||e(t))return!0;var n=d(t);if(!n)return!1;var i,r=n.call(t);if(n!==t.entries){for(;!(i=r.next()).done;)if(!S(i.value))return!1}else for(;!(i=r.next()).done;){var l=i.value;if(l&&!S(l[1]))return!1}return!0;default:return!1}}function C(e,t){return"symbol"===e||"Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol}function w(e){var t=void 0===e?"undefined":o(e);return Array.isArray(e)?"array":e instanceof RegExp?"object":C(t,e)?"symbol":t}function F(e){if(null==e)return""+e;var t=w(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function I(e){var t=F(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}function A(e){return e.constructor&&e.constructor.name?e.constructor.name:M}var O="function"==typeof Symbol&&Symbol.iterator,R="@@iterator",M="<<anonymous>>",D={array:h("array"),bool:h("boolean"),func:h("function"),number:h("number"),object:h("object"),string:h("string"),symbol:h("symbol"),any:p(i.thatReturnsNull),arrayOf:g,element:function(){function t(t,n,o,i,r){var l=t[n];return e(l)?null:new f("Invalid "+i+" `"+r+"` of type `"+w(l)+"` supplied to `"+o+"`, expected a single ReactElement.")}return p(t)}(),instanceOf:m,node:function(){function e(e,t,n,o,i){return S(e[t])?null:new f("Invalid "+o+" `"+i+"` supplied to `"+n+"`, expected a ReactNode.")}return p(e)}(),objectOf:b,oneOf:v,oneOfType:y,shape:_,exact:E};return f.prototype=Error.prototype,D.checkPropTypes=u,D.PropTypes=D,D}}).call(t,n(0))},function(e,t,n){"use strict";function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var i=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach((function(e){o[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,s,a=o(e),u=1;u<arguments.length;u++){for(var d in n=Object(arguments[u]))r.call(n,d)&&(a[d]=n[d]);if(i){s=i(n);for(var c=0;c<s.length;c++)l.call(n,s[c])&&(a[s[c]]=n[s[c]])}}return a}},function(e,t,n){"use strict";(function(t){function o(e,n,o,u,d){if("production"!==t.env.NODE_ENV)for(var c in e)if(e.hasOwnProperty(c)){var f;try{r("function"==typeof e[c],"%s: %s type `%s` is invalid; it must be a function, usually from the `prop-types` package, but received `%s`.",u||"React class",o,c,i(e[c])),f=e[c](n,c,u,o,null,s)}catch(e){f=e}if(l(!f||f instanceof Error,"%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",u||"React class",o,c,void 0===f?"undefined":i(f)),f instanceof Error&&!(f.message in a)){a[f.message]=!0;var p=d?d():"";l(!1,"Failed %s type: %s%s",o,f.message,null!=p?p:"")}}}var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};if("production"!==t.env.NODE_ENV)var r=n(2),l=n(8),s=n(3),a={};e.exports=o}).call(t,n(0))},function(e,t,n){"use strict";var o=n(1),i=n(2),r=n(3);e.exports=function(){function e(e,t,n,o,l,s){s!==r&&i(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=o,n.PropTypes=n,n}},function(e,t,n){"use strict";var o,i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(){function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var o=void 0===n?"undefined":i(n);if("string"===o||"number"===o)e.push(n);else if(Array.isArray(n)&&n.length){var s=r.apply(null,n);s&&e.push(s)}else if("object"===o)for(var a in n)l.call(n,a)&&n[a]&&e.push(a)}}return e.join(" ")}var l={}.hasOwnProperty;void 0!==e&&e.exports?(r.default=r,e.exports=r):"object"===i(n(9))&&n(9)?void 0!==(o=function(){return r}.apply(t,[]))&&(e.exports=o):window.classNames=r}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){return e&&e.__esModule?e:{default:e}}(n(11)),i=function(e,t,n,o,i,r,l,s,a){return!(e+r-a<n||e+a>n+s||t+i-a<o||t+a>o+l)};t.default=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=e instanceof HTMLElement?(0,o.default)(e):e,l=t instanceof HTMLElement?(0,o.default)(t):t;return i(r.top,r.left,l.top,l.left,r.offsetWidth,r.offsetHeight,l.offsetWidth,l.offsetHeight,n)}},function(e,t,n){"use strict";(function(t){function n(e,t,n){function o(t){var n=g,o=m;return g=m=void 0,w=t,b=e.apply(o,n)}function r(e){return w=e,y=setTimeout(d,t),F?o(e):b}function l(e){var n=t-(e-_);return I?S(n,v-(e-w)):n}function a(e){var n=e-_;return void 0===_||n>=t||n<0||I&&e-w>=v}function d(){var e=C();if(a(e))return c(e);y=setTimeout(d,l(e))}function c(e){return y=void 0,A&&g?o(e):(g=m=void 0,b)}function f(){void 0!==y&&clearTimeout(y),w=0,g=_=m=y=void 0}function p(){return void 0===y?b:c(C())}function h(){var e=C(),n=a(e);if(g=arguments,m=this,_=e,n){if(void 0===y)return r(_);if(I)return y=setTimeout(d,t),o(_)}return void 0===y&&(y=setTimeout(d,t)),b}var g,m,v,b,y,_,w=0,F=!1,I=!1,A=!0;if("function"!=typeof e)throw new TypeError(u);return t=s(t)||0,i(n)&&(F=!!n.leading,v=(I="maxWait"in n)?E(s(n.maxWait)||0,t):v,A="trailing"in n?!!n.trailing:A),h.cancel=f,h.flush=p,h}function o(e,t,o){var r=!0,l=!0;if("function"!=typeof e)throw new TypeError(u);return i(o)&&(r="leading"in o?!!o.leading:r,l="trailing"in o?!!o.trailing:l),n(e,t,{leading:r,maxWait:t,trailing:l})}function i(e){var t=void 0===e?"undefined":a(e);return!!e&&("object"==t||"function"==t)}function r(e){return!!e&&"object"==(void 0===e?"undefined":a(e))}function l(e){return"symbol"==(void 0===e?"undefined":a(e))||r(e)&&_.call(e)==c}function s(e){if("number"==typeof e)return e;if(l(e))return d;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(f,"");var n=h.test(e);return n||g.test(e)?m(e.slice(2),n?2:8):p.test(e)?d:+e}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u="Expected a function",d=NaN,c="[object Symbol]",f=/^\s+|\s+$/g,p=/^[-+]0x[0-9a-f]+$/i,h=/^0b[01]+$/i,g=/^0o[0-7]+$/i,m=parseInt,v="object"==(void 0===t?"undefined":a(t))&&t&&t.Object===Object&&t,b="object"==("undefined"==typeof self?"undefined":a(self))&&self&&self.Object===Object&&self,y=v||b||Function("return this")(),_=Object.prototype.toString,E=Math.max,S=Math.min,C=function(){return y.Date.now()};e.exports=o}).call(t,n(21))},function(e,t,n){"use strict";var o,i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};o=function(){return this}();try{o=o||Function("return this")()||(0,eval)("this")}catch(e){"object"===("undefined"==typeof window?"undefined":i(window))&&(o=window)}e.exports=o},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),a=o(n(5)),u=n(6),d=o(n(7)),c=function(e){var t=function(t){function n(){return i(this,n),r(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return l(n,t),s(n,[{key:"componentDidMount",value:function(){this.context.selectable.register(this.props.selectableKey,(0,u.findDOMNode)(this))}},{key:"componentWillUnmount",value:function(){this.context.selectable.unregister(this.props.selectableKey)}},{key:"render",value:function(){return a.default.createElement("div",{id:"selectableItem-"+this.props.selectableKey},a.default.createElement(e,this.props,this.props.children))}}]),n}(a.default.Component);return t.contextTypes={selectable:d.default.object},t.propTypes={children:d.default.node,selectableKey:d.default.any.isRequired},t};t.default=c}]))},6104:function(e,t,n){"use strict";var o=n(4994);t.__esModule=!0,t.default=void 0;var i=o(n(2072)),r=function(e,t){if(!e)return e;var n=(0,i.default)(t),o=n.length;if(o){for(var r=e,l=0;l<o&&r;++l)r=r[n[l]];return r}};t.default=r},2164:function(e){"use strict";e.exports=BackButton},5609:function(e){"use strict";e.exports=Backend},2926:function(e){"use strict";e.exports=Badge},6418:function(e){"use strict";e.exports=Breadcrumb},551:function(e){"use strict";e.exports=Button},6177:function(e){"use strict";e.exports=Config},5716:function(e){"use strict";e.exports=DataFormat},2923:function(e){"use strict";e.exports=DeepFreezeStrict},2623:function(e){"use strict";e.exports=FieldHolder},1957:function(e){"use strict";e.exports=FileSchemaModalHandler},1990:function(e){"use strict";e.exports=FileStatusIcon},6621:function(e){"use strict";e.exports=FormAlert},55:function(e){"use strict";e.exports=FormBuilderLoader},8737:function(e){"use strict";e.exports=FormBuilderModal},5207:function(e){"use strict";e.exports=Injector},7008:function(e){"use strict";e.exports=NodeUrl},5950:function(e){"use strict";e.exports=Paginator},6935:function(e){"use strict";e.exports=PropTypes},1594:function(e){"use strict";e.exports=React},4518:function(e){"use strict";e.exports=ReactDom},5145:function(e){"use strict";e.exports=ReactDomClient},9040:function(e){"use strict";e.exports=ReactRedux},6194:function(e){"use strict";e.exports=ReactRouteRegister},6545:function(e){"use strict";e.exports=ReactRouterDom},3556:function(e){"use strict";e.exports=Reactstrap},9367:function(e){"use strict";e.exports=Redux},5381:function(e){"use strict";e.exports=ReduxForm},2811:function(e){"use strict";e.exports=SchemaActions},6303:function(e){"use strict";e.exports=Search},6175:function(e){"use strict";e.exports=SearchToggle},8918:function(e){"use strict";e.exports=ToastsActions},2294:function(e){"use strict";e.exports=Toolbar},7818:function(e){"use strict";e.exports=TreeDropdownField},9077:function(e){"use strict";e.exports=UnsavedFormsActions},131:function(e){"use strict";e.exports=VersionedBadge},6923:function(e){"use strict";e.exports=classnames},3432:function(e){"use strict";e.exports=getFormState},4014:function(e){"use strict";e.exports=getJsonErrorMessage},5815:function(e){"use strict";e.exports=i18n},1669:function(e){"use strict";e.exports=jQuery},8123:function(e){"use strict";e.exports=moment},7675:function(e){"use strict";e.exports=qs},6595:function(e){"use strict";e.exports=reduxFieldReducer},3398:function(e){"use strict";e.exports=schemaFieldValues},5125:function(e){"use strict";e.exports=ssUrlLib},6478:function(e){"use strict";e.exports=withRouter},477:function(){},4994:function(e){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},1845:function(e,t,n){"use strict";var o=n(1594),i=n(3767);function r(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var l=r(o);t.flexRender=function(e,t){return e?function(e){return"function"==typeof e&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}(n=e)||"function"==typeof n||function(e){return"object"==typeof e&&"symbol"==typeof e.$$typeof&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}(n)?l.createElement(e,t):e:null;var n},t.useReactTable=function(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=l.useState((()=>({current:i.createTable(t)}))),[o,r]=l.useState((()=>n.current.initialState));return n.current.setOptions((t=>({...t,...e,state:{...o,...e.state},onStateChange:t=>{r(t),null==e.onStateChange||e.onStateChange(t)}}))),n.current},Object.keys(i).forEach((function(e){"default"===e||Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})}))},9360:function(e,t,n){"use strict";var o=n(9090);const i={sum:(e,t,n)=>n.reduce(((t,n)=>{const o=n.getValue(e);return t+("number"==typeof o?o:0)}),0),min:(e,t,n)=>{let o;return n.forEach((t=>{const n=t.getValue(e);null!=n&&(o>n||void 0===o&&n>=n)&&(o=n)})),o},max:(e,t,n)=>{let o;return n.forEach((t=>{const n=t.getValue(e);null!=n&&(o<n||void 0===o&&n>=n)&&(o=n)})),o},extent:(e,t,n)=>{let o,i;return n.forEach((t=>{const n=t.getValue(e);null!=n&&(void 0===o?n>=n&&(o=i=n):(o>n&&(o=n),i<n&&(i=n)))})),[o,i]},mean:(e,t)=>{let n=0,o=0;if(t.forEach((t=>{let i=t.getValue(e);null!=i&&(i=+i)>=i&&(++n,o+=i)})),n)return o/n},median:(e,t)=>{if(!t.length)return;const n=t.map((t=>t.getValue(e)));if(!o.isNumberArray(n))return;if(1===n.length)return n[0];const i=Math.floor(n.length/2),r=n.sort(((e,t)=>e-t));return n.length%2!=0?r[i]:(r[i-1]+r[i])/2},unique:(e,t)=>Array.from(new Set(t.map((t=>t.getValue(e)))).values()),uniqueCount:(e,t)=>new Set(t.map((t=>t.getValue(e)))).size,count:(e,t)=>t.length};t.aggregationFns=i},5613:function(e,t){"use strict";t.createColumnHelper=function(){return{accessor:(e,t)=>"function"==typeof e?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e}}},4151:function(e,t,n){"use strict";var o=n(9090);t.createCell=function(e,t,n,i){const r={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(i),renderValue:()=>{var t;return null!=(t=r.getValue())?t:e.options.renderFallbackValue},getContext:o.memo((()=>[e,n,t,r]),((e,t,n,o)=>({table:e,column:t,row:n,cell:o,getValue:o.getValue,renderValue:o.renderValue})),o.getMemoOptions(e.options,"debugCells","cell.getContext"))};return e._features.forEach((o=>{null==o.createCell||o.createCell(r,n,t,e)}),{}),r}},481:function(e,t,n){"use strict";var o=n(9090);t.createColumn=function(e,t,n,i){var r,l;const s={...e._getDefaultColumnDef(),...t},a=s.accessorKey;let u,d=null!=(r=null!=(l=s.id)?l:a?"function"==typeof String.prototype.replaceAll?a.replaceAll(".","_"):a.replace(/\./g,"_"):void 0)?r:"string"==typeof s.header?s.header:void 0;if(s.accessorFn?u=s.accessorFn:a&&(u=a.includes(".")?e=>{let t=e;for(const e of a.split(".")){var n;t=null==(n=t)?void 0:n[e]}return t}:e=>e[s.accessorKey]),!d)throw new Error;let c={id:`${String(d)}`,accessorFn:u,parent:i,depth:n,columnDef:s,columns:[],getFlatColumns:o.memo((()=>[!0]),(()=>{var e;return[c,...null==(e=c.columns)?void 0:e.flatMap((e=>e.getFlatColumns()))]}),o.getMemoOptions(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:o.memo((()=>[e._getOrderColumnsFn()]),(e=>{var t;if(null!=(t=c.columns)&&t.length){let t=c.columns.flatMap((e=>e.getLeafColumns()));return e(t)}return[c]}),o.getMemoOptions(e.options,"debugColumns","column.getLeafColumns"))};for(const t of e._features)null==t.createColumn||t.createColumn(c,e);return c}},8937:function(e,t,n){"use strict";var o=n(9090);const i="debugHeaders";function r(e,t,n){var o;let i={id:null!=(o=n.id)?o:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const e=[],t=n=>{n.subHeaders&&n.subHeaders.length&&n.subHeaders.map(t),e.push(n)};return t(i),e},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach((t=>{null==t.createHeader||t.createHeader(i,e)})),i}const l={createTable:e=>{e.getHeaderGroups=o.memo((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((t,n,o,i)=>{var r,l;const a=null!=(r=null==o?void 0:o.map((e=>n.find((t=>t.id===e)))).filter(Boolean))?r:[],u=null!=(l=null==i?void 0:i.map((e=>n.find((t=>t.id===e)))).filter(Boolean))?l:[];return s(t,[...a,...n.filter((e=>!(null!=o&&o.includes(e.id)||null!=i&&i.includes(e.id)))),...u],e)}),o.getMemoOptions(e.options,i,"getHeaderGroups")),e.getCenterHeaderGroups=o.memo((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((t,n,o,i)=>s(t,n=n.filter((e=>!(null!=o&&o.includes(e.id)||null!=i&&i.includes(e.id)))),e,"center")),o.getMemoOptions(e.options,i,"getCenterHeaderGroups")),e.getLeftHeaderGroups=o.memo((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left]),((t,n,o)=>{var i;return s(t,null!=(i=null==o?void 0:o.map((e=>n.find((t=>t.id===e)))).filter(Boolean))?i:[],e,"left")}),o.getMemoOptions(e.options,i,"getLeftHeaderGroups")),e.getRightHeaderGroups=o.memo((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right]),((t,n,o)=>{var i;return s(t,null!=(i=null==o?void 0:o.map((e=>n.find((t=>t.id===e)))).filter(Boolean))?i:[],e,"right")}),o.getMemoOptions(e.options,i,"getRightHeaderGroups")),e.getFooterGroups=o.memo((()=>[e.getHeaderGroups()]),(e=>[...e].reverse()),o.getMemoOptions(e.options,i,"getFooterGroups")),e.getLeftFooterGroups=o.memo((()=>[e.getLeftHeaderGroups()]),(e=>[...e].reverse()),o.getMemoOptions(e.options,i,"getLeftFooterGroups")),e.getCenterFooterGroups=o.memo((()=>[e.getCenterHeaderGroups()]),(e=>[...e].reverse()),o.getMemoOptions(e.options,i,"getCenterFooterGroups")),e.getRightFooterGroups=o.memo((()=>[e.getRightHeaderGroups()]),(e=>[...e].reverse()),o.getMemoOptions(e.options,i,"getRightFooterGroups")),e.getFlatHeaders=o.memo((()=>[e.getHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),o.getMemoOptions(e.options,i,"getFlatHeaders")),e.getLeftFlatHeaders=o.memo((()=>[e.getLeftHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),o.getMemoOptions(e.options,i,"getLeftFlatHeaders")),e.getCenterFlatHeaders=o.memo((()=>[e.getCenterHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),o.getMemoOptions(e.options,i,"getCenterFlatHeaders")),e.getRightFlatHeaders=o.memo((()=>[e.getRightHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),o.getMemoOptions(e.options,i,"getRightFlatHeaders")),e.getCenterLeafHeaders=o.memo((()=>[e.getCenterFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),o.getMemoOptions(e.options,i,"getCenterLeafHeaders")),e.getLeftLeafHeaders=o.memo((()=>[e.getLeftFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),o.getMemoOptions(e.options,i,"getLeftLeafHeaders")),e.getRightLeafHeaders=o.memo((()=>[e.getRightFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),o.getMemoOptions(e.options,i,"getRightLeafHeaders")),e.getLeafHeaders=o.memo((()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()]),((e,t,n)=>{var o,i,r,l,s,a;return[...null!=(o=null==(i=e[0])?void 0:i.headers)?o:[],...null!=(r=null==(l=t[0])?void 0:l.headers)?r:[],...null!=(s=null==(a=n[0])?void 0:a.headers)?s:[]].map((e=>e.getLeafHeaders())).flat()}),o.getMemoOptions(e.options,i,"getLeafHeaders"))}};function s(e,t,n,o){var i,l;let s=0;const a=function(e,t){void 0===t&&(t=1),s=Math.max(s,t),e.filter((e=>e.getIsVisible())).forEach((e=>{var n;null!=(n=e.columns)&&n.length&&a(e.columns,t+1)}),0)};a(e);let u=[];const d=(e,t)=>{const i={depth:t,id:[o,`${t}`].filter(Boolean).join("_"),headers:[]},l=[];e.forEach((e=>{const s=[...l].reverse()[0];let a,u=!1;if(e.column.depth===i.depth&&e.column.parent?a=e.column.parent:(a=e.column,u=!0),s&&(null==s?void 0:s.column)===a)s.subHeaders.push(e);else{const i=r(n,a,{id:[o,t,a.id,null==e?void 0:e.id].filter(Boolean).join("_"),isPlaceholder:u,placeholderId:u?`${l.filter((e=>e.column===a)).length}`:void 0,depth:t,index:l.length});i.subHeaders.push(e),l.push(i)}i.headers.push(e),e.headerGroup=i})),u.push(i),t>0&&d(l,t-1)},c=t.map(((e,t)=>r(n,e,{depth:s,index:t})));d(c,s-1),u.reverse();const f=e=>e.filter((e=>e.column.getIsVisible())).map((e=>{let t=0,n=0,o=[0];e.subHeaders&&e.subHeaders.length?(o=[],f(e.subHeaders).forEach((e=>{let{colSpan:n,rowSpan:i}=e;t+=n,o.push(i)}))):t=1;return n+=Math.min(...o),e.colSpan=t,e.rowSpan=n,{colSpan:t,rowSpan:n}}));return f(null!=(i=null==(l=u[0])?void 0:l.headers)?i:[]),u}t.Headers=l,t.buildHeaderGroups=s},1151:function(e,t,n){"use strict";var o=n(9090),i=n(4151);t.createRow=(e,t,n,r,l,s,a)=>{let u={id:t,index:r,original:n,depth:l,parentId:a,_valuesCache:{},_uniqueValuesCache:{},getValue:t=>{if(u._valuesCache.hasOwnProperty(t))return u._valuesCache[t];const n=e.getColumn(t);return null!=n&&n.accessorFn?(u._valuesCache[t]=n.accessorFn(u.original,r),u._valuesCache[t]):void 0},getUniqueValues:t=>{if(u._uniqueValuesCache.hasOwnProperty(t))return u._uniqueValuesCache[t];const n=e.getColumn(t);return null!=n&&n.accessorFn?n.columnDef.getUniqueValues?(u._uniqueValuesCache[t]=n.columnDef.getUniqueValues(u.original,r),u._uniqueValuesCache[t]):(u._uniqueValuesCache[t]=[u.getValue(t)],u._uniqueValuesCache[t]):void 0},renderValue:t=>{var n;return null!=(n=u.getValue(t))?n:e.options.renderFallbackValue},subRows:null!=s?s:[],getLeafRows:()=>o.flattenBy(u.subRows,(e=>e.subRows)),getParentRow:()=>u.parentId?e.getRow(u.parentId,!0):void 0,getParentRows:()=>{let e=[],t=u;for(;;){const n=t.getParentRow();if(!n)break;e.push(n),t=n}return e.reverse()},getAllCells:o.memo((()=>[e.getAllLeafColumns()]),(t=>t.map((t=>i.createCell(e,u,t,t.id)))),o.getMemoOptions(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:o.memo((()=>[u.getAllCells()]),(e=>e.reduce(((e,t)=>(e[t.column.id]=t,e)),{})),o.getMemoOptions(e.options,"debugRows","getAllCellsByColumnId"))};for(let t=0;t<e._features.length;t++){const n=e._features[t];null==n||null==n.createRow||n.createRow(u,e)}return u}},2559:function(e,t,n){"use strict";var o=n(9090),i=n(481),r=n(8937),l=n(7932),s=n(7367),a=n(2724),u=n(6085),d=n(3748),c=n(1319),f=n(3185),p=n(8993),h=n(2888),g=n(3527),m=n(5575),v=n(3030),b=n(4489),y=n(5107);const _=[r.Headers,f.ColumnVisibility,u.ColumnOrdering,d.ColumnPinning,l.ColumnFaceting,s.ColumnFiltering,p.GlobalFaceting,h.GlobalFiltering,y.RowSorting,a.ColumnGrouping,g.RowExpanding,m.RowPagination,v.RowPinning,b.RowSelection,c.ColumnSizing];t.createTable=function(e){var t,n;const r=[..._,...null!=(t=e._features)?t:[]];let l={_features:r};const s=l._features.reduce(((e,t)=>Object.assign(e,null==t.getDefaultOptions?void 0:t.getDefaultOptions(l))),{});let a={...null!=(n=e.initialState)?n:{}};l._features.forEach((e=>{var t;a=null!=(t=null==e.getInitialState?void 0:e.getInitialState(a))?t:a}));const u=[];let d=!1;const c={_features:r,options:{...s,...e},initialState:a,_queue:e=>{u.push(e),d||(d=!0,Promise.resolve().then((()=>{for(;u.length;)u.shift()();d=!1})).catch((e=>setTimeout((()=>{throw e})))))},reset:()=>{l.setState(l.initialState)},setOptions:e=>{const t=o.functionalUpdate(e,l.options);l.options=(e=>l.options.mergeOptions?l.options.mergeOptions(s,e):{...s,...e})(t)},getState:()=>l.options.state,setState:e=>{null==l.options.onStateChange||l.options.onStateChange(e)},_getRowId:(e,t,n)=>{var o;return null!=(o=null==l.options.getRowId?void 0:l.options.getRowId(e,t,n))?o:`${n?[n.id,t].join("."):t}`},getCoreRowModel:()=>(l._getCoreRowModel||(l._getCoreRowModel=l.options.getCoreRowModel(l)),l._getCoreRowModel()),getRowModel:()=>l.getPaginationRowModel(),getRow:(e,t)=>{let n=(t?l.getPrePaginationRowModel():l.getRowModel()).rowsById[e];if(!n&&(n=l.getCoreRowModel().rowsById[e],!n))throw new Error;return n},_getDefaultColumnDef:o.memo((()=>[l.options.defaultColumn]),(e=>{var t;return e=null!=(t=e)?t:{},{header:e=>{const t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>{var t,n;return null!=(t=null==(n=e.renderValue())||null==n.toString?void 0:n.toString())?t:null},...l._features.reduce(((e,t)=>Object.assign(e,null==t.getDefaultColumnDef?void 0:t.getDefaultColumnDef())),{}),...e}}),o.getMemoOptions(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>l.options.columns,getAllColumns:o.memo((()=>[l._getColumnDefs()]),(e=>{const t=function(e,n,o){return void 0===o&&(o=0),e.map((e=>{const r=i.createColumn(l,e,o,n),s=e;return r.columns=s.columns?t(s.columns,r,o+1):[],r}))};return t(e)}),o.getMemoOptions(e,"debugColumns","getAllColumns")),getAllFlatColumns:o.memo((()=>[l.getAllColumns()]),(e=>e.flatMap((e=>e.getFlatColumns()))),o.getMemoOptions(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:o.memo((()=>[l.getAllFlatColumns()]),(e=>e.reduce(((e,t)=>(e[t.id]=t,e)),{})),o.getMemoOptions(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:o.memo((()=>[l.getAllColumns(),l._getOrderColumnsFn()]),((e,t)=>{let n=e.flatMap((e=>e.getLeafColumns()));return t(n)}),o.getMemoOptions(e,"debugColumns","getAllLeafColumns")),getColumn:e=>l._getAllFlatColumnsById()[e]};Object.assign(l,c);for(let e=0;e<l._features.length;e++){const t=l._features[e];null==t||null==t.createTable||t.createTable(l)}return l}},7932:function(e,t){"use strict";const n={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}};t.ColumnFaceting=n},7367:function(e,t,n){"use strict";var o=n(5232),i=n(9090);const r={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:i.makeStateUpdater("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],i=null==n?void 0:n.getValue(e.id);return"string"==typeof i?o.filterFns.includesString:"number"==typeof i?o.filterFns.inNumberRange:"boolean"==typeof i||null!==i&&"object"==typeof i?o.filterFns.equals:Array.isArray(i)?o.filterFns.arrIncludes:o.filterFns.weakEquals},e.getFilterFn=()=>{var n,r;return i.isFunction(e.columnDef.filterFn)?e.columnDef.filterFn:"auto"===e.columnDef.filterFn?e.getAutoFilterFn():null!=(n=null==(r=t.options.filterFns)?void 0:r[e.columnDef.filterFn])?n:o.filterFns[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,o,i;return(null==(n=e.columnDef.enableColumnFilter)||n)&&(null==(o=t.options.enableColumnFilters)||o)&&(null==(i=t.options.enableFilters)||i)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return null==(n=t.getState().columnFilters)||null==(n=n.find((t=>t.id===e.id)))?void 0:n.value},e.getFilterIndex=()=>{var n,o;return null!=(n=null==(o=t.getState().columnFilters)?void 0:o.findIndex((t=>t.id===e.id)))?n:-1},e.setFilterValue=n=>{t.setColumnFilters((t=>{const o=e.getFilterFn(),r=null==t?void 0:t.find((t=>t.id===e.id)),s=i.functionalUpdate(n,r?r.value:void 0);var a;if(l(o,s,e))return null!=(a=null==t?void 0:t.filter((t=>t.id!==e.id)))?a:[];const u={id:e.id,value:s};var d;return r?null!=(d=null==t?void 0:t.map((t=>t.id===e.id?u:t)))?d:[]:null!=t&&t.length?[...t,u]:[u]}))}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns();null==e.options.onColumnFiltersChange||e.options.onColumnFiltersChange((e=>{var o;return null==(o=i.functionalUpdate(t,e))?void 0:o.filter((e=>{const t=n.find((t=>t.id===e.id));if(t){if(l(t.getFilterFn(),e.value,t))return!1}return!0}))}))},e.resetColumnFilters=t=>{var n,o;e.setColumnFilters(t?[]:null!=(n=null==(o=e.initialState)?void 0:o.columnFilters)?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function l(e,t,n){return!(!e||!e.autoRemove)&&e.autoRemove(t,n)||void 0===t||"string"==typeof t&&!t}t.ColumnFiltering=r,t.shouldAutoRemoveFilter=l},2724:function(e,t,n){"use strict";var o=n(9360),i=n(9090);const r={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return null!=(t=null==(n=e.getValue())||null==n.toString?void 0:n.toString())?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:i.makeStateUpdater("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping((t=>null!=t&&t.includes(e.id)?t.filter((t=>t!==e.id)):[...null!=t?t:[],e.id]))},e.getCanGroup=()=>{var n,o;return(null==(n=e.columnDef.enableGrouping)||n)&&(null==(o=t.options.enableGrouping)||o)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return null==(n=t.getState().grouping)?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return null==(n=t.getState().grouping)?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],i=null==n?void 0:n.getValue(e.id);return"number"==typeof i?o.aggregationFns.sum:"[object Date]"===Object.prototype.toString.call(i)?o.aggregationFns.extent:void 0},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return i.isFunction(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:"auto"===e.columnDef.aggregationFn?e.getAutoAggregationFn():null!=(n=null==(r=t.options.aggregationFns)?void 0:r[e.columnDef.aggregationFn])?n:o.aggregationFns[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>null==e.options.onGroupingChange?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,o;e.setGrouping(t?[]:null!=(n=null==(o=e.initialState)?void 0:o.grouping)?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const o=t.getColumn(n);return null!=o&&o.columnDef.getGroupingValue?(e._groupingValuesCache[n]=o.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,o)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var t;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!(null==(t=n.subRows)||!t.length)}}};t.ColumnGrouping=r,t.orderColumns=function(e,t,n){if(null==t||!t.length||!n)return e;const o=e.filter((e=>!t.includes(e.id)));return"remove"===n?o:[...t.map((t=>e.find((e=>e.id===t)))).filter(Boolean),...o]}},6085:function(e,t,n){"use strict";var o=n(9090),i=n(2724),r=n(3185);const l={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:o.makeStateUpdater("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=o.memo((e=>[r._getVisibleLeafColumns(t,e)]),(t=>t.findIndex((t=>t.id===e.id))),o.getMemoOptions(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var o;return(null==(o=r._getVisibleLeafColumns(t,n)[0])?void 0:o.id)===e.id},e.getIsLastColumn=n=>{var o;const i=r._getVisibleLeafColumns(t,n);return(null==(o=i[i.length-1])?void 0:o.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>null==e.options.onColumnOrderChange?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:null!=(n=e.initialState.columnOrder)?n:[])},e._getOrderColumnsFn=o.memo((()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode]),((e,t,n)=>o=>{let r=[];if(null!=e&&e.length){const t=[...e],n=[...o];for(;n.length&&t.length;){const e=t.shift(),o=n.findIndex((t=>t.id===e));o>-1&&r.push(n.splice(o,1)[0])}r=[...r,...n]}else r=o;return i.orderColumns(r,t,n)}),o.getMemoOptions(e.options,"debugTable","_getOrderColumnsFn"))}};t.ColumnOrdering=l},3748:function(e,t,n){"use strict";var o=n(9090);const i={getInitialState:e=>({columnPinning:{left:[],right:[]},...e}),getDefaultOptions:e=>({onColumnPinningChange:o.makeStateUpdater("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const o=e.getLeafColumns().map((e=>e.id)).filter(Boolean);t.setColumnPinning((e=>{var t,i,r,l,s,a;return"right"===n?{left:(null!=(r=null==e?void 0:e.left)?r:[]).filter((e=>!(null!=o&&o.includes(e)))),right:[...(null!=(l=null==e?void 0:e.right)?l:[]).filter((e=>!(null!=o&&o.includes(e)))),...o]}:"left"===n?{left:[...(null!=(s=null==e?void 0:e.left)?s:[]).filter((e=>!(null!=o&&o.includes(e)))),...o],right:(null!=(a=null==e?void 0:e.right)?a:[]).filter((e=>!(null!=o&&o.includes(e))))}:{left:(null!=(t=null==e?void 0:e.left)?t:[]).filter((e=>!(null!=o&&o.includes(e)))),right:(null!=(i=null==e?void 0:e.right)?i:[]).filter((e=>!(null!=o&&o.includes(e))))}}))},e.getCanPin=()=>e.getLeafColumns().some((e=>{var n,o,i;return(null==(n=e.columnDef.enablePinning)||n)&&(null==(o=null!=(i=t.options.enableColumnPinning)?i:t.options.enablePinning)||o)})),e.getIsPinned=()=>{const n=e.getLeafColumns().map((e=>e.id)),{left:o,right:i}=t.getState().columnPinning,r=n.some((e=>null==o?void 0:o.includes(e))),l=n.some((e=>null==i?void 0:i.includes(e)));return r?"left":!!l&&"right"},e.getPinnedIndex=()=>{var n,o;const i=e.getIsPinned();return i?null!=(n=null==(o=t.getState().columnPinning)||null==(o=o[i])?void 0:o.indexOf(e.id))?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=o.memo((()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right]),((e,t,n)=>{const o=[...null!=t?t:[],...null!=n?n:[]];return e.filter((e=>!o.includes(e.column.id)))}),o.getMemoOptions(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=o.memo((()=>[e._getAllVisibleCells(),t.getState().columnPinning.left]),((e,t)=>(null!=t?t:[]).map((t=>e.find((e=>e.column.id===t)))).filter(Boolean).map((e=>({...e,position:"left"})))),o.getMemoOptions(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=o.memo((()=>[e._getAllVisibleCells(),t.getState().columnPinning.right]),((e,t)=>(null!=t?t:[]).map((t=>e.find((e=>e.column.id===t)))).filter(Boolean).map((e=>({...e,position:"right"})))),o.getMemoOptions(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>null==e.options.onColumnPinningChange?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,o;return e.setColumnPinning(t?{left:[],right:[]}:null!=(n=null==(o=e.initialState)?void 0:o.columnPinning)?n:{left:[],right:[]})},e.getIsSomeColumnsPinned=t=>{var n;const o=e.getState().columnPinning;var i,r;return t?Boolean(null==(n=o[t])?void 0:n.length):Boolean((null==(i=o.left)?void 0:i.length)||(null==(r=o.right)?void 0:r.length))},e.getLeftLeafColumns=o.memo((()=>[e.getAllLeafColumns(),e.getState().columnPinning.left]),((e,t)=>(null!=t?t:[]).map((t=>e.find((e=>e.id===t)))).filter(Boolean)),o.getMemoOptions(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=o.memo((()=>[e.getAllLeafColumns(),e.getState().columnPinning.right]),((e,t)=>(null!=t?t:[]).map((t=>e.find((e=>e.id===t)))).filter(Boolean)),o.getMemoOptions(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=o.memo((()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((e,t,n)=>{const o=[...null!=t?t:[],...null!=n?n:[]];return e.filter((e=>!o.includes(e.id)))}),o.getMemoOptions(e.options,"debugColumns","getCenterLeafColumns"))}};t.ColumnPinning=i},1319:function(e,t,n){"use strict";var o=n(9090),i=n(3185);const r={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},l={getDefaultColumnDef:()=>r,getInitialState:e=>({columnSizing:{},columnSizingInfo:{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]},...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:o.makeStateUpdater("columnSizing",e),onColumnSizingInfoChange:o.makeStateUpdater("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,o,i;const l=t.getState().columnSizing[e.id];return Math.min(Math.max(null!=(n=e.columnDef.minSize)?n:r.minSize,null!=(o=null!=l?l:e.columnDef.size)?o:r.size),null!=(i=e.columnDef.maxSize)?i:r.maxSize)},e.getStart=o.memo((e=>[e,i._getVisibleLeafColumns(t,e),t.getState().columnSizing]),((t,n)=>n.slice(0,e.getIndex(t)).reduce(((e,t)=>e+t.getSize()),0)),o.getMemoOptions(t.options,"debugColumns","getStart")),e.getAfter=o.memo((e=>[e,i._getVisibleLeafColumns(t,e),t.getState().columnSizing]),((t,n)=>n.slice(e.getIndex(t)+1).reduce(((e,t)=>e+t.getSize()),0)),o.getMemoOptions(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing((t=>{let{[e.id]:n,...o}=t;return o}))},e.getCanResize=()=>{var n,o;return(null==(n=e.columnDef.enableResizing)||n)&&(null==(o=t.options.enableColumnResizing)||o)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let t=0;const n=e=>{var o;e.subHeaders.length?e.subHeaders.forEach(n):t+=null!=(o=e.column.getSize())?o:0};return n(e),t},e.getStart=()=>{if(e.index>0){const t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=n=>{const o=t.getColumn(e.column.id),i=null==o?void 0:o.getCanResize();return r=>{if(!o||!i)return;if(null==r.persist||r.persist(),u(r)&&r.touches&&r.touches.length>1)return;const l=e.getSize(),s=e?e.getLeafHeaders().map((e=>[e.column.id,e.column.getSize()])):[[o.id,o.getSize()]],d=u(r)?Math.round(r.touches[0].clientX):r.clientX,c={},f=(e,n)=>{"number"==typeof n&&(t.setColumnSizingInfo((e=>{var o,i;const r="rtl"===t.options.columnResizeDirection?-1:1,l=(n-(null!=(o=null==e?void 0:e.startOffset)?o:0))*r,s=Math.max(l/(null!=(i=null==e?void 0:e.startSize)?i:0),-.999999);return e.columnSizingStart.forEach((e=>{let[t,n]=e;c[t]=Math.round(100*Math.max(n+n*s,0))/100})),{...e,deltaOffset:l,deltaPercentage:s}})),"onChange"!==t.options.columnResizeMode&&"end"!==e||t.setColumnSizing((e=>({...e,...c}))))},p=e=>f("move",e),h=e=>{f("end",e),t.setColumnSizingInfo((e=>({...e,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]})))},g=n||"undefined"!=typeof document?document:null,m={moveHandler:e=>p(e.clientX),upHandler:e=>{null==g||g.removeEventListener("mousemove",m.moveHandler),null==g||g.removeEventListener("mouseup",m.upHandler),h(e.clientX)}},v={moveHandler:e=>(e.cancelable&&(e.preventDefault(),e.stopPropagation()),p(e.touches[0].clientX),!1),upHandler:e=>{var t;null==g||g.removeEventListener("touchmove",v.moveHandler),null==g||g.removeEventListener("touchend",v.upHandler),e.cancelable&&(e.preventDefault(),e.stopPropagation()),h(null==(t=e.touches[0])?void 0:t.clientX)}},b=!!a()&&{passive:!1};u(r)?(null==g||g.addEventListener("touchmove",v.moveHandler,b),null==g||g.addEventListener("touchend",v.upHandler,b)):(null==g||g.addEventListener("mousemove",m.moveHandler,b),null==g||g.addEventListener("mouseup",m.upHandler,b)),t.setColumnSizingInfo((e=>({...e,startOffset:d,startSize:l,deltaOffset:0,deltaPercentage:0,columnSizingStart:s,isResizingColumn:o.id})))}}},createTable:e=>{e.setColumnSizing=t=>null==e.options.onColumnSizingChange?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>null==e.options.onColumnSizingInfoChange?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:null!=(n=e.initialState.columnSizing)?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}:null!=(n=e.initialState.columnSizingInfo)?n:{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]})},e.getTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getHeaderGroups()[0])?void 0:n.headers.reduce(((e,t)=>e+t.getSize()),0))?t:0},e.getLeftTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getLeftHeaderGroups()[0])?void 0:n.headers.reduce(((e,t)=>e+t.getSize()),0))?t:0},e.getCenterTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getCenterHeaderGroups()[0])?void 0:n.headers.reduce(((e,t)=>e+t.getSize()),0))?t:0},e.getRightTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getRightHeaderGroups()[0])?void 0:n.headers.reduce(((e,t)=>e+t.getSize()),0))?t:0}}};let s=null;function a(){if("boolean"==typeof s)return s;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch(t){e=!1}return s=e,s}function u(e){return"touchstart"===e.type}t.ColumnSizing=l,t.defaultColumnSizing=r,t.passiveEventSupported=a},3185:function(e,t,n){"use strict";var o=n(9090);const i={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:o.makeStateUpdater("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility((t=>({...t,[e.id]:null!=n?n:!e.getIsVisible()})))},e.getIsVisible=()=>{var n,o;const i=e.columns;return null==(n=i.length?i.some((e=>e.getIsVisible())):null==(o=t.getState().columnVisibility)?void 0:o[e.id])||n},e.getCanHide=()=>{var n,o;return(null==(n=e.columnDef.enableHiding)||n)&&(null==(o=t.options.enableHiding)||o)},e.getToggleVisibilityHandler=()=>t=>{null==e.toggleVisibility||e.toggleVisibility(t.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=o.memo((()=>[e.getAllCells(),t.getState().columnVisibility]),(e=>e.filter((e=>e.column.getIsVisible()))),o.getMemoOptions(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=o.memo((()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()]),((e,t,n)=>[...e,...t,...n]),o.getMemoOptions(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(t,n)=>o.memo((()=>[n(),n().filter((e=>e.getIsVisible())).map((e=>e.id)).join("_")]),(e=>e.filter((e=>null==e.getIsVisible?void 0:e.getIsVisible()))),o.getMemoOptions(e.options,"debugColumns",t));e.getVisibleFlatColumns=t("getVisibleFlatColumns",(()=>e.getAllFlatColumns())),e.getVisibleLeafColumns=t("getVisibleLeafColumns",(()=>e.getAllLeafColumns())),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",(()=>e.getLeftLeafColumns())),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",(()=>e.getRightLeafColumns())),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",(()=>e.getCenterLeafColumns())),e.setColumnVisibility=t=>null==e.options.onColumnVisibilityChange?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{var n;e.setColumnVisibility(t?{}:null!=(n=e.initialState.columnVisibility)?n:{})},e.toggleAllColumnsVisible=t=>{var n;t=null!=(n=t)?n:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce(((e,n)=>({...e,[n.id]:t||!(null!=n.getCanHide&&n.getCanHide())})),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some((e=>!(null!=e.getIsVisible&&e.getIsVisible()))),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some((e=>null==e.getIsVisible?void 0:e.getIsVisible())),e.getToggleAllColumnsVisibilityHandler=()=>t=>{var n;e.toggleAllColumnsVisible(null==(n=t.target)?void 0:n.checked)}}};t.ColumnVisibility=i,t._getVisibleLeafColumns=function(e,t){return t?"center"===t?e.getCenterVisibleLeafColumns():"left"===t?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}},8993:function(e,t){"use strict";const n={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}};t.GlobalFaceting=n},2888:function(e,t,n){"use strict";var o=n(5232),i=n(9090);const r={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:i.makeStateUpdater("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const o=null==(n=e.getCoreRowModel().flatRows[0])||null==(n=n._getAllCellsByColumnId()[t.id])?void 0:n.getValue();return"string"==typeof o||"number"==typeof o}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,o,i,r;return(null==(n=e.columnDef.enableGlobalFilter)||n)&&(null==(o=t.options.enableGlobalFilter)||o)&&(null==(i=t.options.enableFilters)||i)&&(null==(r=null==t.options.getColumnCanGlobalFilter?void 0:t.options.getColumnCanGlobalFilter(e))||r)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>o.filterFns.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return i.isFunction(r)?r:"auto"===r?e.getGlobalAutoFilterFn():null!=(t=null==(n=e.options.filterFns)?void 0:n[r])?t:o.filterFns[r]},e.setGlobalFilter=t=>{null==e.options.onGlobalFilterChange||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}};t.GlobalFiltering=r},3527:function(e,t,n){"use strict";var o=n(9090);const i={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:o.makeStateUpdater("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var o,i;if(t){if(null!=(o=null!=(i=e.options.autoResetAll)?i:e.options.autoResetExpanded)?o:!e.options.manualExpanding){if(n)return;n=!0,e._queue((()=>{e.resetExpanded(),n=!1}))}}else e._queue((()=>{t=!0}))},e.setExpanded=t=>null==e.options.onExpandedChange?void 0:e.options.onExpandedChange(t),e.toggleAllRowsExpanded=t=>{(null!=t?t:!e.getIsAllRowsExpanded())?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=t=>{var n,o;e.setExpanded(t?{}:null!=(n=null==(o=e.initialState)?void 0:o.expanded)?n:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some((e=>e.getCanExpand())),e.getToggleAllRowsExpandedHandler=()=>t=>{null==t.persist||t.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const t=e.getState().expanded;return!0===t||Object.values(t).some(Boolean)},e.getIsAllRowsExpanded=()=>{const t=e.getState().expanded;return"boolean"==typeof t?!0===t:!!Object.keys(t).length&&!e.getRowModel().flatRows.some((e=>!e.getIsExpanded()))},e.getExpandedDepth=()=>{let t=0;return(!0===e.getState().expanded?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach((e=>{const n=e.split(".");t=Math.max(t,n.length)})),t},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded((o=>{var i;const r=!0===o||!(null==o||!o[e.id]);let l={};if(!0===o?Object.keys(t.getRowModel().rowsById).forEach((e=>{l[e]=!0})):l=o,n=null!=(i=n)?i:!r,!r&&n)return{...l,[e.id]:!0};if(r&&!n){const{[e.id]:t,...n}=l;return n}return o}))},e.getIsExpanded=()=>{var n;const o=t.getState().expanded;return!!(null!=(n=null==t.options.getIsRowExpanded?void 0:t.options.getIsRowExpanded(e))?n:!0===o||(null==o?void 0:o[e.id]))},e.getCanExpand=()=>{var n,o,i;return null!=(n=null==t.options.getRowCanExpand?void 0:t.options.getRowCanExpand(e))?n:(null==(o=t.options.enableExpanding)||o)&&!(null==(i=e.subRows)||!i.length)},e.getIsAllParentsExpanded=()=>{let n=!0,o=e;for(;n&&o.parentId;)o=t.getRow(o.parentId,!0),n=o.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}};t.RowExpanding=i},5575:function(e,t,n){"use strict";var o=n(9090);const i={getInitialState:e=>({...e,pagination:{pageIndex:0,pageSize:10,...null==e?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:o.makeStateUpdater("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var o,i;if(t){if(null!=(o=null!=(i=e.options.autoResetAll)?i:e.options.autoResetPageIndex)?o:!e.options.manualPagination){if(n)return;n=!0,e._queue((()=>{e.resetPageIndex(),n=!1}))}}else e._queue((()=>{t=!0}))},e.setPagination=t=>null==e.options.onPaginationChange?void 0:e.options.onPaginationChange((e=>o.functionalUpdate(t,e))),e.resetPagination=t=>{var n;e.setPagination(t?{pageIndex:0,pageSize:10}:null!=(n=e.initialState.pagination)?n:{pageIndex:0,pageSize:10})},e.setPageIndex=t=>{e.setPagination((n=>{let i=o.functionalUpdate(t,n.pageIndex);const r=void 0===e.options.pageCount||-1===e.options.pageCount?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,r)),{...n,pageIndex:i}}))},e.resetPageIndex=t=>{var n,o;e.setPageIndex(t?0:null!=(n=null==(o=e.initialState)||null==(o=o.pagination)?void 0:o.pageIndex)?n:0)},e.resetPageSize=t=>{var n,o;e.setPageSize(t?10:null!=(n=null==(o=e.initialState)||null==(o=o.pagination)?void 0:o.pageSize)?n:10)},e.setPageSize=t=>{e.setPagination((e=>{const n=Math.max(1,o.functionalUpdate(t,e.pageSize)),i=e.pageSize*e.pageIndex,r=Math.floor(i/n);return{...e,pageIndex:r,pageSize:n}}))},e.setPageCount=t=>e.setPagination((n=>{var i;let r=o.functionalUpdate(t,null!=(i=e.options.pageCount)?i:-1);return"number"==typeof r&&(r=Math.max(-1,r)),{...n,pageCount:r}})),e.getPageOptions=o.memo((()=>[e.getPageCount()]),(e=>{let t=[];return e&&e>0&&(t=[...new Array(e)].fill(null).map(((e,t)=>t))),t}),o.getMemoOptions(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:t}=e.getState().pagination,n=e.getPageCount();return-1===n||0!==n&&t<n-1},e.previousPage=()=>e.setPageIndex((e=>e-1)),e.nextPage=()=>e.setPageIndex((e=>e+1)),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var t;return null!=(t=e.options.pageCount)?t:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var t;return null!=(t=e.options.rowCount)?t:e.getPrePaginationRowModel().rows.length}}};t.RowPagination=i},3030:function(e,t,n){"use strict";var o=n(9090);const i={getInitialState:e=>({rowPinning:{top:[],bottom:[]},...e}),getDefaultOptions:e=>({onRowPinningChange:o.makeStateUpdater("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,o,i)=>{const r=o?e.getLeafRows().map((e=>{let{id:t}=e;return t})):[],l=i?e.getParentRows().map((e=>{let{id:t}=e;return t})):[],s=new Set([...l,e.id,...r]);t.setRowPinning((e=>{var t,o,i,r,l,a;return"bottom"===n?{top:(null!=(i=null==e?void 0:e.top)?i:[]).filter((e=>!(null!=s&&s.has(e)))),bottom:[...(null!=(r=null==e?void 0:e.bottom)?r:[]).filter((e=>!(null!=s&&s.has(e)))),...Array.from(s)]}:"top"===n?{top:[...(null!=(l=null==e?void 0:e.top)?l:[]).filter((e=>!(null!=s&&s.has(e)))),...Array.from(s)],bottom:(null!=(a=null==e?void 0:e.bottom)?a:[]).filter((e=>!(null!=s&&s.has(e))))}:{top:(null!=(t=null==e?void 0:e.top)?t:[]).filter((e=>!(null!=s&&s.has(e)))),bottom:(null!=(o=null==e?void 0:e.bottom)?o:[]).filter((e=>!(null!=s&&s.has(e))))}}))},e.getCanPin=()=>{var n;const{enableRowPinning:o,enablePinning:i}=t.options;return"function"==typeof o?o(e):null==(n=null!=o?o:i)||n},e.getIsPinned=()=>{const n=[e.id],{top:o,bottom:i}=t.getState().rowPinning,r=n.some((e=>null==o?void 0:o.includes(e))),l=n.some((e=>null==i?void 0:i.includes(e)));return r?"top":!!l&&"bottom"},e.getPinnedIndex=()=>{var n,o;const i=e.getIsPinned();if(!i)return-1;const r=null==(n="top"===i?t.getTopRows():t.getBottomRows())?void 0:n.map((e=>{let{id:t}=e;return t}));return null!=(o=null==r?void 0:r.indexOf(e.id))?o:-1}},createTable:e=>{e.setRowPinning=t=>null==e.options.onRowPinningChange?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,o;return e.setRowPinning(t?{top:[],bottom:[]}:null!=(n=null==(o=e.initialState)?void 0:o.rowPinning)?n:{top:[],bottom:[]})},e.getIsSomeRowsPinned=t=>{var n;const o=e.getState().rowPinning;var i,r;return t?Boolean(null==(n=o[t])?void 0:n.length):Boolean((null==(i=o.top)?void 0:i.length)||(null==(r=o.bottom)?void 0:r.length))},e._getPinnedRows=(t,n,o)=>{var i;return(null==(i=e.options.keepPinnedRows)||i?(null!=n?n:[]).map((t=>{const n=e.getRow(t,!0);return n.getIsAllParentsExpanded()?n:null})):(null!=n?n:[]).map((e=>t.find((t=>t.id===e))))).filter(Boolean).map((e=>({...e,position:o})))},e.getTopRows=o.memo((()=>[e.getRowModel().rows,e.getState().rowPinning.top]),((t,n)=>e._getPinnedRows(t,n,"top")),o.getMemoOptions(e.options,"debugRows","getTopRows")),e.getBottomRows=o.memo((()=>[e.getRowModel().rows,e.getState().rowPinning.bottom]),((t,n)=>e._getPinnedRows(t,n,"bottom")),o.getMemoOptions(e.options,"debugRows","getBottomRows")),e.getCenterRows=o.memo((()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom]),((e,t,n)=>{const o=new Set([...null!=t?t:[],...null!=n?n:[]]);return e.filter((e=>!o.has(e.id)))}),o.getMemoOptions(e.options,"debugRows","getCenterRows"))}};t.RowPinning=i},4489:function(e,t,n){"use strict";var o=n(9090);const i={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:o.makeStateUpdater("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>null==e.options.onRowSelectionChange?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:null!=(n=e.initialState.rowSelection)?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection((n=>{t=void 0!==t?t:!e.getIsAllRowsSelected();const o={...n},i=e.getPreGroupedRowModel().flatRows;return t?i.forEach((e=>{e.getCanSelect()&&(o[e.id]=!0)})):i.forEach((e=>{delete o[e.id]})),o}))},e.toggleAllPageRowsSelected=t=>e.setRowSelection((n=>{const o=void 0!==t?t:!e.getIsAllPageRowsSelected(),i={...n};return e.getRowModel().rows.forEach((t=>{r(i,t.id,o,!0,e)})),i})),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=o.memo((()=>[e.getState().rowSelection,e.getCoreRowModel()]),((t,n)=>Object.keys(t).length?l(e,n):{rows:[],flatRows:[],rowsById:{}}),o.getMemoOptions(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=o.memo((()=>[e.getState().rowSelection,e.getFilteredRowModel()]),((t,n)=>Object.keys(t).length?l(e,n):{rows:[],flatRows:[],rowsById:{}}),o.getMemoOptions(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=o.memo((()=>[e.getState().rowSelection,e.getSortedRowModel()]),((t,n)=>Object.keys(t).length?l(e,n):{rows:[],flatRows:[],rowsById:{}}),o.getMemoOptions(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let o=Boolean(t.length&&Object.keys(n).length);return o&&t.some((e=>e.getCanSelect()&&!n[e.id]))&&(o=!1),o},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter((e=>e.getCanSelect())),{rowSelection:n}=e.getState();let o=!!t.length;return o&&t.some((e=>!n[e.id]))&&(o=!1),o},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys(null!=(t=e.getState().rowSelection)?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return!e.getIsAllPageRowsSelected()&&t.filter((e=>e.getCanSelect())).some((e=>e.getIsSelected()||e.getIsSomeSelected()))},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,o)=>{const i=e.getIsSelected();t.setRowSelection((l=>{var s;if(n=void 0!==n?n:!i,e.getCanSelect()&&i===n)return l;const a={...l};return r(a,e.id,n,null==(s=null==o?void 0:o.selectChildren)||s,t),a}))},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return s(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return"some"===a(e,n)},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return"all"===a(e,n)},e.getCanSelect=()=>{var n;return"function"==typeof t.options.enableRowSelection?t.options.enableRowSelection(e):null==(n=t.options.enableRowSelection)||n},e.getCanSelectSubRows=()=>{var n;return"function"==typeof t.options.enableSubRowSelection?t.options.enableSubRowSelection(e):null==(n=t.options.enableSubRowSelection)||n},e.getCanMultiSelect=()=>{var n;return"function"==typeof t.options.enableMultiRowSelection?t.options.enableMultiRowSelection(e):null==(n=t.options.enableMultiRowSelection)||n},e.getToggleSelectedHandler=()=>{const t=e.getCanSelect();return n=>{var o;t&&e.toggleSelected(null==(o=n.target)?void 0:o.checked)}}}},r=(e,t,n,o,i)=>{var l;const s=i.getRow(t,!0);n?(s.getCanMultiSelect()||Object.keys(e).forEach((t=>delete e[t])),s.getCanSelect()&&(e[t]=!0)):delete e[t],o&&null!=(l=s.subRows)&&l.length&&s.getCanSelectSubRows()&&s.subRows.forEach((t=>r(e,t.id,n,o,i)))};function l(e,t){const n=e.getState().rowSelection,o=[],i={},r=function(e,t){return e.map((e=>{var t;const l=s(e,n);if(l&&(o.push(e),i[e.id]=e),null!=(t=e.subRows)&&t.length&&(e={...e,subRows:r(e.subRows)}),l)return e})).filter(Boolean)};return{rows:r(t.rows),flatRows:o,rowsById:i}}function s(e,t){var n;return null!=(n=t[e.id])&&n}function a(e,t,n){var o;if(null==(o=e.subRows)||!o.length)return!1;let i=!0,r=!1;return e.subRows.forEach((e=>{if((!r||i)&&(e.getCanSelect()&&(s(e,t)?r=!0:i=!1),e.subRows&&e.subRows.length)){const n=a(e,t);"all"===n?r=!0:"some"===n?(r=!0,i=!1):i=!1}})),i?"all":!!r&&"some"}t.RowSelection=i,t.isRowSelected=s,t.isSubRowSelected=a,t.selectRowsFn=l},5107:function(e,t,n){"use strict";var o=n(5702),i=n(9090);const r={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:i.makeStateUpdater("sorting",e),isMultiSortEvent:e=>e.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let i=!1;for(const t of n){const n=null==t?void 0:t.getValue(e.id);if("[object Date]"===Object.prototype.toString.call(n))return o.sortingFns.datetime;if("string"==typeof n&&(i=!0,n.split(o.reSplitAlphaNumeric).length>1))return o.sortingFns.alphanumeric}return i?o.sortingFns.text:o.sortingFns.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return"string"==typeof(null==n?void 0:n.getValue(e.id))?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return i.isFunction(e.columnDef.sortingFn)?e.columnDef.sortingFn:"auto"===e.columnDef.sortingFn?e.getAutoSortingFn():null!=(n=null==(r=t.options.sortingFns)?void 0:r[e.columnDef.sortingFn])?n:o.sortingFns[e.columnDef.sortingFn]},e.toggleSorting=(n,o)=>{const i=e.getNextSortingOrder(),r=null!=n;t.setSorting((l=>{const s=null==l?void 0:l.find((t=>t.id===e.id)),a=null==l?void 0:l.findIndex((t=>t.id===e.id));let u,d=[],c=r?n:"desc"===i;var f;(u=null!=l&&l.length&&e.getCanMultiSort()&&o?s?"toggle":"add":null!=l&&l.length&&a!==l.length-1?"replace":s?"toggle":"replace","toggle"===u&&(r||i||(u="remove")),"add"===u)?(d=[...l,{id:e.id,desc:c}],d.splice(0,d.length-(null!=(f=t.options.maxMultiSortColCount)?f:Number.MAX_SAFE_INTEGER))):d="toggle"===u?l.map((t=>t.id===e.id?{...t,desc:c}:t)):"remove"===u?l.filter((t=>t.id!==e.id)):[{id:e.id,desc:c}];return d}))},e.getFirstSortDir=()=>{var n,o;return(null!=(n=null!=(o=e.columnDef.sortDescFirst)?o:t.options.sortDescFirst)?n:"desc"===e.getAutoSortDir())?"desc":"asc"},e.getNextSortingOrder=n=>{var o,i;const r=e.getFirstSortDir(),l=e.getIsSorted();return l?!!(l===r||null!=(o=t.options.enableSortingRemoval)&&!o||n&&null!=(i=t.options.enableMultiRemove)&&!i)&&("desc"===l?"asc":"desc"):r},e.getCanSort=()=>{var n,o;return(null==(n=e.columnDef.enableSorting)||n)&&(null==(o=t.options.enableSorting)||o)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,o;return null!=(n=null!=(o=e.columnDef.enableMultiSort)?o:t.options.enableMultiSort)?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const o=null==(n=t.getState().sorting)?void 0:n.find((t=>t.id===e.id));return!!o&&(o.desc?"desc":"asc")},e.getSortIndex=()=>{var n,o;return null!=(n=null==(o=t.getState().sorting)?void 0:o.findIndex((t=>t.id===e.id)))?n:-1},e.clearSorting=()=>{t.setSorting((t=>null!=t&&t.length?t.filter((t=>t.id!==e.id)):[]))},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return o=>{n&&(null==o.persist||o.persist(),null==e.toggleSorting||e.toggleSorting(void 0,!!e.getCanMultiSort()&&(null==t.options.isMultiSortEvent?void 0:t.options.isMultiSortEvent(o))))}}},createTable:e=>{e.setSorting=t=>null==e.options.onSortingChange?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,o;e.setSorting(t?[]:null!=(n=null==(o=e.initialState)?void 0:o.sorting)?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}};t.RowSorting=r},5232:function(e,t){"use strict";const n=(e,t,n)=>{var o,i;const r=null==n||null==(o=n.toString())?void 0:o.toLowerCase();return Boolean(null==(i=e.getValue(t))||null==(i=i.toString())||null==(i=i.toLowerCase())?void 0:i.includes(r))};n.autoRemove=e=>f(e);const o=(e,t,n)=>{var o;return Boolean(null==(o=e.getValue(t))||null==(o=o.toString())?void 0:o.includes(n))};o.autoRemove=e=>f(e);const i=(e,t,n)=>{var o;return(null==(o=e.getValue(t))||null==(o=o.toString())?void 0:o.toLowerCase())===(null==n?void 0:n.toLowerCase())};i.autoRemove=e=>f(e);const r=(e,t,n)=>{var o;return null==(o=e.getValue(t))?void 0:o.includes(n)};r.autoRemove=e=>f(e);const l=(e,t,n)=>!n.some((n=>{var o;return!(null!=(o=e.getValue(t))&&o.includes(n))}));l.autoRemove=e=>f(e)||!(null!=e&&e.length);const s=(e,t,n)=>n.some((n=>{var o;return null==(o=e.getValue(t))?void 0:o.includes(n)}));s.autoRemove=e=>f(e)||!(null!=e&&e.length);const a=(e,t,n)=>e.getValue(t)===n;a.autoRemove=e=>f(e);const u=(e,t,n)=>e.getValue(t)==n;u.autoRemove=e=>f(e);const d=(e,t,n)=>{let[o,i]=n;const r=e.getValue(t);return r>=o&&r<=i};d.resolveFilterValue=e=>{let[t,n]=e,o="number"!=typeof t?parseFloat(t):t,i="number"!=typeof n?parseFloat(n):n,r=null===t||Number.isNaN(o)?-1/0:o,l=null===n||Number.isNaN(i)?1/0:i;if(r>l){const e=r;r=l,l=e}return[r,l]},d.autoRemove=e=>f(e)||f(e[0])&&f(e[1]);const c={includesString:n,includesStringSensitive:o,equalsString:i,arrIncludes:r,arrIncludesAll:l,arrIncludesSome:s,equals:a,weakEquals:u,inNumberRange:d};function f(e){return null==e||""===e}t.filterFns=c},3767:function(e,t,n){"use strict";var o=n(5613),i=n(4151),r=n(481),l=n(8937),s=n(1151),a=n(2559),u=n(7932),d=n(7367),c=n(2724),f=n(6085),p=n(3748),h=n(1319),g=n(3185),m=n(8993),v=n(2888),b=n(3527),y=n(5575),_=n(3030),E=n(4489),S=n(5107),C=n(9090),w=n(6187),F=n(8449),I=n(215),A=n(6690),O=n(9854),R=n(707),M=n(8010),D=n(3508),P=n(6685),x=n(9360),L=n(5232),T=n(5702);t.createColumnHelper=o.createColumnHelper,t.createCell=i.createCell,t.createColumn=r.createColumn,t.Headers=l.Headers,t.buildHeaderGroups=l.buildHeaderGroups,t.createRow=s.createRow,t.createTable=a.createTable,t.ColumnFaceting=u.ColumnFaceting,t.ColumnFiltering=d.ColumnFiltering,t.shouldAutoRemoveFilter=d.shouldAutoRemoveFilter,t.ColumnGrouping=c.ColumnGrouping,t.orderColumns=c.orderColumns,t.ColumnOrdering=f.ColumnOrdering,t.ColumnPinning=p.ColumnPinning,t.ColumnSizing=h.ColumnSizing,t.defaultColumnSizing=h.defaultColumnSizing,t.passiveEventSupported=h.passiveEventSupported,t.ColumnVisibility=g.ColumnVisibility,t._getVisibleLeafColumns=g._getVisibleLeafColumns,t.GlobalFaceting=m.GlobalFaceting,t.GlobalFiltering=v.GlobalFiltering,t.RowExpanding=b.RowExpanding,t.RowPagination=y.RowPagination,t.RowPinning=_.RowPinning,t.RowSelection=E.RowSelection,t.isRowSelected=E.isRowSelected,t.isSubRowSelected=E.isSubRowSelected,t.selectRowsFn=E.selectRowsFn,t.RowSorting=S.RowSorting,t.flattenBy=C.flattenBy,t.functionalUpdate=C.functionalUpdate,t.getMemoOptions=C.getMemoOptions,t.isFunction=C.isFunction,t.isNumberArray=C.isNumberArray,t.makeStateUpdater=C.makeStateUpdater,t.memo=C.memo,t.noop=C.noop,t.getCoreRowModel=w.getCoreRowModel,t.expandRows=F.expandRows,t.getExpandedRowModel=F.getExpandedRowModel,t.getFacetedMinMaxValues=I.getFacetedMinMaxValues,t.getFacetedRowModel=A.getFacetedRowModel,t.getFacetedUniqueValues=O.getFacetedUniqueValues,t.getFilteredRowModel=R.getFilteredRowModel,t.getGroupedRowModel=M.getGroupedRowModel,t.getPaginationRowModel=D.getPaginationRowModel,t.getSortedRowModel=P.getSortedRowModel,t.aggregationFns=x.aggregationFns,t.filterFns=L.filterFns,t.reSplitAlphaNumeric=T.reSplitAlphaNumeric,t.sortingFns=T.sortingFns},5702:function(e,t){"use strict";const n=/([0-9]+)/gm;function o(e,t){return e===t?0:e>t?1:-1}function i(e){return"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?"":String(e):"string"==typeof e?e:""}function r(e,t){const o=e.split(n).filter(Boolean),i=t.split(n).filter(Boolean);for(;o.length&&i.length;){const e=o.shift(),t=i.shift(),n=parseInt(e,10),r=parseInt(t,10),l=[n,r].sort();if(isNaN(l[0])){if(e>t)return 1;if(t>e)return-1}else{if(isNaN(l[1]))return isNaN(n)?-1:1;if(n>r)return 1;if(r>n)return-1}}return o.length-i.length}const l={alphanumeric:(e,t,n)=>r(i(e.getValue(n)).toLowerCase(),i(t.getValue(n)).toLowerCase()),alphanumericCaseSensitive:(e,t,n)=>r(i(e.getValue(n)),i(t.getValue(n))),text:(e,t,n)=>o(i(e.getValue(n)).toLowerCase(),i(t.getValue(n)).toLowerCase()),textCaseSensitive:(e,t,n)=>o(i(e.getValue(n)),i(t.getValue(n))),datetime:(e,t,n)=>{const o=e.getValue(n),i=t.getValue(n);return o>i?1:o<i?-1:0},basic:(e,t,n)=>o(e.getValue(n),t.getValue(n))};t.reSplitAlphaNumeric=n,t.sortingFns=l},9090:function(e,t){"use strict";function n(e,t){return"function"==typeof e?e(t):e}t.flattenBy=function(e,t){const n=[],o=e=>{e.forEach((e=>{n.push(e);const i=t(e);null!=i&&i.length&&o(i)}))};return o(e),n},t.functionalUpdate=n,t.getMemoOptions=function(e,t,n,o){return{debug:()=>{var n;return null!=(n=null==e?void 0:e.debugAll)?n:e[t]},key:!1,onChange:o}},t.isFunction=function(e){return e instanceof Function},t.isNumberArray=function(e){return Array.isArray(e)&&e.every((e=>"number"==typeof e))},t.makeStateUpdater=function(e,t){return o=>{t.setState((t=>({...t,[e]:n(o,t[e])})))}},t.memo=function(e,t,n){let o,i=[];return r=>{let l;n.key&&n.debug&&(l=Date.now());const s=e(r);if(!(s.length!==i.length||s.some(((e,t)=>i[t]!==e))))return o;let a;if(i=s,n.key&&n.debug&&(a=Date.now()),o=t(...s),null==n||null==n.onChange||n.onChange(o),n.key&&n.debug&&null!=n&&n.debug()){const e=Math.round(100*(Date.now()-l))/100,t=Math.round(100*(Date.now()-a))/100,o=t/16,i=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${i(t,5)} /${i(e,5)} ms`,`\n            font-size: .6rem;\n            font-weight: bold;\n            color: hsl(${Math.max(0,Math.min(120-120*o,120))}deg 100% 31%);`,null==n?void 0:n.key)}return o}},t.noop=function(){}},3581:function(e,t,n){"use strict";var o=n(1151);t.filterRows=function(e,t,n){return n.options.filterFromLeafRows?function(e,t,n){var i;const r=[],l={},s=null!=(i=n.options.maxLeafRowFilterDepth)?i:100,a=function(e,i){void 0===i&&(i=0);const u=[];for(let c=0;c<e.length;c++){var d;let f=e[c];const p=o.createRow(n,f.id,f.original,f.index,f.depth,void 0,f.parentId);if(p.columnFilters=f.columnFilters,null!=(d=f.subRows)&&d.length&&i<s){if(p.subRows=a(f.subRows,i+1),f=p,t(f)&&!p.subRows.length){u.push(f),l[f.id]=f,r.push(f);continue}if(t(f)||p.subRows.length){u.push(f),l[f.id]=f,r.push(f);continue}}else f=p,t(f)&&(u.push(f),l[f.id]=f,r.push(f))}return u};return{rows:a(e),flatRows:r,rowsById:l}}(e,t,n):function(e,t,n){var i;const r=[],l={},s=null!=(i=n.options.maxLeafRowFilterDepth)?i:100,a=function(e,i){void 0===i&&(i=0);const u=[];for(let c=0;c<e.length;c++){let f=e[c];if(t(f)){var d;if(null!=(d=f.subRows)&&d.length&&i<s){const e=o.createRow(n,f.id,f.original,f.index,f.depth,void 0,f.parentId);e.subRows=a(f.subRows,i+1),f=e}u.push(f),r.push(f),l[f.id]=f}}return u};return{rows:a(e),flatRows:r,rowsById:l}}(e,t,n)}},6187:function(e,t,n){"use strict";var o=n(1151),i=n(9090);t.getCoreRowModel=function(){return e=>i.memo((()=>[e.options.data]),(t=>{const n={rows:[],flatRows:[],rowsById:{}},i=function(t,r,l){void 0===r&&(r=0);const s=[];for(let u=0;u<t.length;u++){const d=o.createRow(e,e._getRowId(t[u],u,l),t[u],u,r,void 0,null==l?void 0:l.id);var a;if(n.flatRows.push(d),n.rowsById[d.id]=d,s.push(d),e.options.getSubRows)d.originalSubRows=e.options.getSubRows(t[u],u),null!=(a=d.originalSubRows)&&a.length&&(d.subRows=i(d.originalSubRows,r+1,d))}return s};return n.rows=i(t),n}),i.getMemoOptions(e.options,"debugTable","getRowModel",(()=>e._autoResetPageIndex())))}},8449:function(e,t,n){"use strict";var o=n(9090);function i(e){const t=[],n=e=>{var o;t.push(e),null!=(o=e.subRows)&&o.length&&e.getIsExpanded()&&e.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}t.expandRows=i,t.getExpandedRowModel=function(){return e=>o.memo((()=>[e.getState().expanded,e.getPreExpandedRowModel(),e.options.paginateExpandedRows]),((e,t,n)=>!t.rows.length||!0!==e&&!Object.keys(null!=e?e:{}).length?t:n?i(t):t),o.getMemoOptions(e.options,"debugTable","getExpandedRowModel"))}},215:function(e,t,n){"use strict";var o=n(9090);t.getFacetedMinMaxValues=function(){return(e,t)=>o.memo((()=>{var n;return[null==(n=e.getColumn(t))?void 0:n.getFacetedRowModel()]}),(e=>{if(!e)return;const n=e.flatRows.flatMap((e=>{var n;return null!=(n=e.getUniqueValues(t))?n:[]})).map(Number).filter((e=>!Number.isNaN(e)));if(!n.length)return;let o=n[0],i=n[n.length-1];for(const e of n)e<o?o=e:e>i&&(i=e);return[o,i]}),o.getMemoOptions(e.options,"debugTable","getFacetedMinMaxValues"))}},6690:function(e,t,n){"use strict";var o=n(9090),i=n(3581);t.getFacetedRowModel=function(){return(e,t)=>o.memo((()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter,e.getFilteredRowModel()]),((n,o,r)=>{if(!n.rows.length||(null==o||!o.length)&&!r)return n;const l=[...o.map((e=>e.id)).filter((e=>e!==t)),r?"__global__":void 0].filter(Boolean);return i.filterRows(n.rows,(e=>{for(let t=0;t<l.length;t++)if(!1===e.columnFilters[l[t]])return!1;return!0}),e)}),o.getMemoOptions(e.options,"debugTable","getFacetedRowModel"))}},9854:function(e,t,n){"use strict";var o=n(9090);t.getFacetedUniqueValues=function(){return(e,t)=>o.memo((()=>{var n;return[null==(n=e.getColumn(t))?void 0:n.getFacetedRowModel()]}),(e=>{if(!e)return new Map;let n=new Map;for(let i=0;i<e.flatRows.length;i++){const r=e.flatRows[i].getUniqueValues(t);for(let e=0;e<r.length;e++){const t=r[e];var o;if(n.has(t))n.set(t,(null!=(o=n.get(t))?o:0)+1);else n.set(t,1)}}return n}),o.getMemoOptions(e.options,"debugTable",`getFacetedUniqueValues_${t}`))}},707:function(e,t,n){"use strict";var o=n(9090),i=n(3581);t.getFilteredRowModel=function(){return e=>o.memo((()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter]),((t,n,o)=>{if(!t.rows.length||(null==n||!n.length)&&!o){for(let e=0;e<t.flatRows.length;e++)t.flatRows[e].columnFilters={},t.flatRows[e].columnFiltersMeta={};return t}const r=[],l=[];(null!=n?n:[]).forEach((t=>{var n;const o=e.getColumn(t.id);if(!o)return;const i=o.getFilterFn();i&&r.push({id:t.id,filterFn:i,resolvedValue:null!=(n=null==i.resolveFilterValue?void 0:i.resolveFilterValue(t.value))?n:t.value})}));const s=(null!=n?n:[]).map((e=>e.id)),a=e.getGlobalFilterFn(),u=e.getAllLeafColumns().filter((e=>e.getCanGlobalFilter()));let d,c;o&&a&&u.length&&(s.push("__global__"),u.forEach((e=>{var t;l.push({id:e.id,filterFn:a,resolvedValue:null!=(t=null==a.resolveFilterValue?void 0:a.resolveFilterValue(o))?t:o})})));for(let e=0;e<t.flatRows.length;e++){const n=t.flatRows[e];if(n.columnFilters={},r.length)for(let e=0;e<r.length;e++){d=r[e];const t=d.id;n.columnFilters[t]=d.filterFn(n,t,d.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))}if(l.length){for(let e=0;e<l.length;e++){c=l[e];const t=c.id;if(c.filterFn(n,t,c.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))){n.columnFilters.__global__=!0;break}}!0!==n.columnFilters.__global__&&(n.columnFilters.__global__=!1)}}return i.filterRows(t.rows,(e=>{for(let t=0;t<s.length;t++)if(!1===e.columnFilters[s[t]])return!1;return!0}),e)}),o.getMemoOptions(e.options,"debugTable","getFilteredRowModel",(()=>e._autoResetPageIndex())))}},8010:function(e,t,n){"use strict";var o=n(1151),i=n(9090);t.getGroupedRowModel=function(){return e=>i.memo((()=>[e.getState().grouping,e.getPreGroupedRowModel()]),((t,n)=>{if(!n.rows.length||!t.length)return n.rows.forEach((e=>{e.depth=0,e.parentId=void 0})),n;const r=t.filter((t=>e.getColumn(t))),l=[],s={},a=function(t,n,u){if(void 0===n&&(n=0),n>=r.length)return t.map((e=>(e.depth=n,l.push(e),s[e.id]=e,e.subRows&&(e.subRows=a(e.subRows,n+1,e.id)),e)));const d=r[n],c=function(e,t){const n=new Map;return e.reduce(((e,n)=>{const o=`${n.getGroupingValue(t)}`,i=e.get(o);return i?i.push(n):e.set(o,[n]),e}),n)}(t,d),f=Array.from(c.entries()).map(((t,c)=>{let[f,p]=t,h=`${d}:${f}`;h=u?`${u}>${h}`:h;const g=a(p,n+1,h);g.forEach((e=>{e.parentId=h}));const m=n?i.flattenBy(p,(e=>e.subRows)):p,v=o.createRow(e,h,m[0].original,c,n,void 0,u);return Object.assign(v,{groupingColumnId:d,groupingValue:f,subRows:g,leafRows:m,getValue:t=>{if(r.includes(t)){if(v._valuesCache.hasOwnProperty(t))return v._valuesCache[t];var n;if(p[0])v._valuesCache[t]=null!=(n=p[0].getValue(t))?n:void 0;return v._valuesCache[t]}if(v._groupingValuesCache.hasOwnProperty(t))return v._groupingValuesCache[t];const o=e.getColumn(t),i=null==o?void 0:o.getAggregationFn();return i?(v._groupingValuesCache[t]=i(t,m,p),v._groupingValuesCache[t]):void 0}}),g.forEach((e=>{l.push(e),s[e.id]=e})),v}));return f},u=a(n.rows,0);return u.forEach((e=>{l.push(e),s[e.id]=e})),{rows:u,flatRows:l,rowsById:s}}),i.getMemoOptions(e.options,"debugTable","getGroupedRowModel",(()=>{e._queue((()=>{e._autoResetExpanded(),e._autoResetPageIndex()}))})))}},3508:function(e,t,n){"use strict";var o=n(9090),i=n(8449);t.getPaginationRowModel=function(e){return e=>o.memo((()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded]),((t,n)=>{if(!n.rows.length)return n;const{pageSize:o,pageIndex:r}=t;let{rows:l,flatRows:s,rowsById:a}=n;const u=o*r,d=u+o;let c;l=l.slice(u,d),c=e.options.paginateExpandedRows?{rows:l,flatRows:s,rowsById:a}:i.expandRows({rows:l,flatRows:s,rowsById:a}),c.flatRows=[];const f=e=>{c.flatRows.push(e),e.subRows.length&&e.subRows.forEach(f)};return c.rows.forEach(f),c}),o.getMemoOptions(e.options,"debugTable","getPaginationRowModel"))}},6685:function(e,t,n){"use strict";var o=n(9090);t.getSortedRowModel=function(){return e=>o.memo((()=>[e.getState().sorting,e.getPreSortedRowModel()]),((t,n)=>{if(!n.rows.length||null==t||!t.length)return n;const o=e.getState().sorting,i=[],r=o.filter((t=>{var n;return null==(n=e.getColumn(t.id))?void 0:n.getCanSort()})),l={};r.forEach((t=>{const n=e.getColumn(t.id);n&&(l[t.id]={sortUndefined:n.columnDef.sortUndefined,invertSorting:n.columnDef.invertSorting,sortingFn:n.getSortingFn()})}));const s=e=>{const t=e.map((e=>({...e})));return t.sort(((e,t)=>{for(let o=0;o<r.length;o+=1){var n;const i=r[o],s=l[i.id],a=s.sortUndefined,u=null!=(n=null==i?void 0:i.desc)&&n;let d=0;if(a){const n=void 0===e.getValue(i.id),o=void 0===t.getValue(i.id);if(n||o){if("first"===a)return n?-1:1;if("last"===a)return n?1:-1;d=n&&o?0:n?a:-a}}if(0===d&&(d=s.sortingFn(e,t,i.id)),0!==d)return u&&(d*=-1),s.invertSorting&&(d*=-1),d}return e.index-t.index})),t.forEach((e=>{var t;i.push(e),null!=(t=e.subRows)&&t.length&&(e.subRows=s(e.subRows))})),t};return{rows:s(n.rows),flatRows:i,rowsById:n.rowsById}}),o.getMemoOptions(e.options,"debugTable","getSortedRowModel",(()=>e._autoResetPageIndex())))}},4600:function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e.default:e}n.r(t),n.d(t,{Dropzone:function(){return l},default:function(){return l}});class i{on(e,t){return this._callbacks=this._callbacks||{},this._callbacks[e]||(this._callbacks[e]=[]),this._callbacks[e].push(t),this}emit(e,...t){this._callbacks=this._callbacks||{};let n=this._callbacks[e];if(n)for(let e of n)e.apply(this,t);return this.element&&this.element.dispatchEvent(this.makeEvent("dropzone:"+e,{args:t})),this}makeEvent(e,t){let n={bubbles:!0,cancelable:!0,detail:t};if("function"==typeof window.CustomEvent)return new CustomEvent(e,n);var o=document.createEvent("CustomEvent");return o.initCustomEvent(e,n.bubbles,n.cancelable,n.detail),o}off(e,t){if(!this._callbacks||0===arguments.length)return this._callbacks={},this;let n=this._callbacks[e];if(!n)return this;if(1===arguments.length)return delete this._callbacks[e],this;for(let e=0;e<n.length;e++){if(n[e]===t){n.splice(e,1);break}}return this}}var r={url:null,method:"post",withCredentials:!1,timeout:null,parallelUploads:2,uploadMultiple:!1,chunking:!1,forceChunking:!1,chunkSize:2097152,parallelChunkUploads:!1,retryChunks:!1,retryChunksLimit:3,maxFilesize:256,paramName:"file",createImageThumbnails:!0,maxThumbnailFilesize:10,thumbnailWidth:120,thumbnailHeight:120,thumbnailMethod:"crop",resizeWidth:null,resizeHeight:null,resizeMimeType:null,resizeQuality:.8,resizeMethod:"contain",filesizeBase:1e3,maxFiles:null,headers:null,defaultHeaders:!0,clickable:!0,ignoreHiddenFiles:!0,acceptedFiles:null,autoProcessQueue:!0,autoQueue:!0,addRemoveLinks:!1,previewsContainer:null,disablePreviews:!1,hiddenInputContainer:"body",capture:null,renameFilename:null,renameFile:null,forceFallback:!1,dictDefaultMessage:"Drop files here to upload",dictFallbackMessage:"Your browser does not support drag'n'drop file uploads.",dictFallbackText:"Please use the fallback form below to upload your files like in the olden days.",dictFileTooBig:"File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.",dictInvalidFileType:"You can't upload files of this type.",dictResponseError:"Server responded with {{statusCode}} code.",dictCancelUpload:"Cancel upload",dictUploadCanceled:"Upload canceled.",dictCancelUploadConfirmation:"Are you sure you want to cancel this upload?",dictRemoveFile:"Remove file",dictRemoveFileConfirmation:null,dictMaxFilesExceeded:"You cannot upload any more files.",dictFileSizeUnits:{tb:"TB",gb:"GB",mb:"MB",kb:"KB",b:"b"},init(){},params(e,t,n){if(n)return{dzuuid:n.file.upload.uuid,dzchunkindex:n.index,dztotalfilesize:n.file.size,dzchunksize:this.options.chunkSize,dztotalchunkcount:n.file.upload.totalChunkCount,dzchunkbyteoffset:n.index*this.options.chunkSize}},accept(e,t){return t()},chunksUploaded:function(e,t){t()},binaryBody:!1,fallback(){let e;this.element.className=`${this.element.className} dz-browser-not-supported`;for(let t of this.element.getElementsByTagName("div"))if(/(^| )dz-message($| )/.test(t.className)){e=t,t.className="dz-message";break}e||(e=l.createElement('<div class="dz-message"><span></span></div>'),this.element.appendChild(e));let t=e.getElementsByTagName("span")[0];return t&&(null!=t.textContent?t.textContent=this.options.dictFallbackMessage:null!=t.innerText&&(t.innerText=this.options.dictFallbackMessage)),this.element.appendChild(this.getFallbackForm())},resize(e,t,n,o){let i={srcX:0,srcY:0,srcWidth:e.width,srcHeight:e.height},r=e.width/e.height;null==t&&null==n?(t=i.srcWidth,n=i.srcHeight):null==t?t=n*r:null==n&&(n=t/r);let l=(t=Math.min(t,i.srcWidth))/(n=Math.min(n,i.srcHeight));if(i.srcWidth>t||i.srcHeight>n)if("crop"===o)r>l?(i.srcHeight=e.height,i.srcWidth=i.srcHeight*l):(i.srcWidth=e.width,i.srcHeight=i.srcWidth/l);else{if("contain"!==o)throw new Error(`Unknown resizeMethod '${o}'`);r>l?n=t/r:t=n*r}return i.srcX=(e.width-i.srcWidth)/2,i.srcY=(e.height-i.srcHeight)/2,i.trgWidth=t,i.trgHeight=n,i},transformFile(e,t){return(this.options.resizeWidth||this.options.resizeHeight)&&e.type.match(/image.*/)?this.resizeImage(e,this.options.resizeWidth,this.options.resizeHeight,this.options.resizeMethod,t):t(e)},previewTemplate:o('<div class="dz-preview dz-file-preview">\n  <div class="dz-image"><img data-dz-thumbnail=""></div>\n  <div class="dz-details">\n    <div class="dz-size"><span data-dz-size=""></span></div>\n    <div class="dz-filename"><span data-dz-name=""></span></div>\n  </div>\n  <div class="dz-progress">\n    <span class="dz-upload" data-dz-uploadprogress=""></span>\n  </div>\n  <div class="dz-error-message"><span data-dz-errormessage=""></span></div>\n  <div class="dz-success-mark">\n    <svg width="54" height="54" viewBox="0 0 54 54" fill="white" xmlns="http://www.w3.org/2000/svg">\n      <path d="M10.2071 29.7929L14.2929 25.7071C14.6834 25.3166 15.3166 25.3166 15.7071 25.7071L21.2929 31.2929C21.6834 31.6834 22.3166 31.6834 22.7071 31.2929L38.2929 15.7071C38.6834 15.3166 39.3166 15.3166 39.7071 15.7071L43.7929 19.7929C44.1834 20.1834 44.1834 20.8166 43.7929 21.2071L22.7071 42.2929C22.3166 42.6834 21.6834 42.6834 21.2929 42.2929L10.2071 31.2071C9.81658 30.8166 9.81658 30.1834 10.2071 29.7929Z"></path>\n    </svg>\n  </div>\n  <div class="dz-error-mark">\n    <svg width="54" height="54" viewBox="0 0 54 54" fill="white" xmlns="http://www.w3.org/2000/svg">\n      <path d="M26.2929 20.2929L19.2071 13.2071C18.8166 12.8166 18.1834 12.8166 17.7929 13.2071L13.2071 17.7929C12.8166 18.1834 12.8166 18.8166 13.2071 19.2071L20.2929 26.2929C20.6834 26.6834 20.6834 27.3166 20.2929 27.7071L13.2071 34.7929C12.8166 35.1834 12.8166 35.8166 13.2071 36.2071L17.7929 40.7929C18.1834 41.1834 18.8166 41.1834 19.2071 40.7929L26.2929 33.7071C26.6834 33.3166 27.3166 33.3166 27.7071 33.7071L34.7929 40.7929C35.1834 41.1834 35.8166 41.1834 36.2071 40.7929L40.7929 36.2071C41.1834 35.8166 41.1834 35.1834 40.7929 34.7929L33.7071 27.7071C33.3166 27.3166 33.3166 26.6834 33.7071 26.2929L40.7929 19.2071C41.1834 18.8166 41.1834 18.1834 40.7929 17.7929L36.2071 13.2071C35.8166 12.8166 35.1834 12.8166 34.7929 13.2071L27.7071 20.2929C27.3166 20.6834 26.6834 20.6834 26.2929 20.2929Z"></path>\n    </svg>\n  </div>\n</div>\n'),drop(e){return this.element.classList.remove("dz-drag-hover")},dragstart(e){},dragend(e){return this.element.classList.remove("dz-drag-hover")},dragenter(e){return this.element.classList.add("dz-drag-hover")},dragover(e){return this.element.classList.add("dz-drag-hover")},dragleave(e){return this.element.classList.remove("dz-drag-hover")},paste(e){},reset(){return this.element.classList.remove("dz-started")},addedfile(e){if(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),this.previewsContainer&&!this.options.disablePreviews){for(var t of(e.previewElement=l.createElement(this.options.previewTemplate.trim()),e.previewTemplate=e.previewElement,this.previewsContainer.appendChild(e.previewElement),e.previewElement.querySelectorAll("[data-dz-name]")))t.textContent=e.name;for(t of e.previewElement.querySelectorAll("[data-dz-size]"))t.innerHTML=this.filesize(e.size);this.options.addRemoveLinks&&(e._removeLink=l.createElement(`<a class="dz-remove" href="javascript:undefined;" data-dz-remove>${this.options.dictRemoveFile}</a>`),e.previewElement.appendChild(e._removeLink));let n=t=>(t.preventDefault(),t.stopPropagation(),e.status===l.UPLOADING?l.confirm(this.options.dictCancelUploadConfirmation,(()=>this.removeFile(e))):this.options.dictRemoveFileConfirmation?l.confirm(this.options.dictRemoveFileConfirmation,(()=>this.removeFile(e))):this.removeFile(e));for(let t of e.previewElement.querySelectorAll("[data-dz-remove]"))t.addEventListener("click",n)}},removedfile(e){return null!=e.previewElement&&null!=e.previewElement.parentNode&&e.previewElement.parentNode.removeChild(e.previewElement),this._updateMaxFilesReachedClass()},thumbnail(e,t){if(e.previewElement){e.previewElement.classList.remove("dz-file-preview");for(let n of e.previewElement.querySelectorAll("[data-dz-thumbnail]"))n.alt=e.name,n.src=t;return setTimeout((()=>e.previewElement.classList.add("dz-image-preview")),1)}},error(e,t){if(e.previewElement){e.previewElement.classList.add("dz-error"),"string"!=typeof t&&t.error&&(t=t.error);for(let n of e.previewElement.querySelectorAll("[data-dz-errormessage]"))n.textContent=t}},errormultiple(){},processing(e){if(e.previewElement&&(e.previewElement.classList.add("dz-processing"),e._removeLink))return e._removeLink.innerHTML=this.options.dictCancelUpload},processingmultiple(){},uploadprogress(e,t,n){if(e.previewElement)for(let n of e.previewElement.querySelectorAll("[data-dz-uploadprogress]"))"PROGRESS"===n.nodeName?n.value=t:n.style.width=`${t}%`},totaluploadprogress(){},sending(){},sendingmultiple(){},success(e){if(e.previewElement)return e.previewElement.classList.add("dz-success")},successmultiple(){},canceled(e){return this.emit("error",e,this.options.dictUploadCanceled)},canceledmultiple(){},complete(e){if(e._removeLink&&(e._removeLink.innerHTML=this.options.dictRemoveFile),e.previewElement)return e.previewElement.classList.add("dz-complete")},completemultiple(){},maxfilesexceeded(){},maxfilesreached(){},queuecomplete(){},addedfiles(){}};class l extends i{static initClass(){this.prototype.Emitter=i,this.prototype.events=["drop","dragstart","dragend","dragenter","dragover","dragleave","addedfile","addedfiles","removedfile","thumbnail","error","errormultiple","processing","processingmultiple","uploadprogress","totaluploadprogress","sending","sendingmultiple","success","successmultiple","canceled","canceledmultiple","complete","completemultiple","reset","maxfilesexceeded","maxfilesreached","queuecomplete"],this.prototype._thumbnailQueue=[],this.prototype._processingThumbnail=!1}constructor(e,t){let n,o;if(super(),this.element=e,this.clickableElements=[],this.listeners=[],this.files=[],"string"==typeof this.element&&(this.element=document.querySelector(this.element)),null===this.element||!this.element instanceof HTMLElement)throw new Error("Invalid dropzone element: not an instance of HTMLElement.");if(this.element.dropzone)throw new Error("Dropzone already attached.");l.instances.push(this),this.element.dropzone=this;let i=null!=(o=l.optionsForElement(this.element))?o:{};if(this.options=Object.assign({},r,i,null!=t?t:{}),this.options.previewTemplate=this.options.previewTemplate.replace(/\n*/g,""),this.options.forceFallback||!l.isBrowserSupported())return this.options.fallback.call(this);if(null==this.options.url&&(this.options.url=this.element.getAttribute("action")),!this.options.url)throw new Error("No URL provided.");if(this.options.uploadMultiple&&this.options.chunking)throw new Error("You cannot set both: uploadMultiple and chunking.");if(this.options.binaryBody&&this.options.uploadMultiple)throw new Error("You cannot set both: binaryBody and uploadMultiple.");"string"==typeof this.options.method&&(this.options.method=this.options.method.toUpperCase()),(n=this.getExistingFallback())&&n.parentNode&&n.parentNode.removeChild(n),!1!==this.options.previewsContainer&&(this.options.previewsContainer?this.previewsContainer=l.getElement(this.options.previewsContainer,"previewsContainer"):this.previewsContainer=this.element),this.options.clickable&&(!0===this.options.clickable?this.clickableElements=[this.element]:this.clickableElements=l.getElements(this.options.clickable,"clickable")),this.init()}getAcceptedFiles(){return this.files.filter((e=>e.accepted)).map((e=>e))}getRejectedFiles(){return this.files.filter((e=>!e.accepted)).map((e=>e))}getFilesWithStatus(e){return this.files.filter((t=>t.status===e)).map((e=>e))}getQueuedFiles(){return this.getFilesWithStatus(l.QUEUED)}getUploadingFiles(){return this.getFilesWithStatus(l.UPLOADING)}getAddedFiles(){return this.getFilesWithStatus(l.ADDED)}getActiveFiles(){return this.files.filter((e=>e.status===l.UPLOADING||e.status===l.QUEUED)).map((e=>e))}init(){if("form"===this.element.tagName&&this.element.setAttribute("enctype","multipart/form-data"),this.element.classList.contains("dropzone")&&!this.element.querySelector(".dz-message")&&this.element.appendChild(l.createElement(`<div class="dz-default dz-message"><button class="dz-button" type="button">${this.options.dictDefaultMessage}</button></div>`)),this.clickableElements.length){let e=()=>{this.hiddenFileInput&&this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=document.createElement("input"),this.hiddenFileInput.setAttribute("type","file"),this.hiddenFileInput.setAttribute("form",this.element.id),(null===this.options.maxFiles||this.options.maxFiles>1)&&this.hiddenFileInput.setAttribute("multiple","multiple"),this.hiddenFileInput.className="dz-hidden-input",null!==this.options.acceptedFiles&&this.hiddenFileInput.setAttribute("accept",this.options.acceptedFiles),null!==this.options.capture&&this.hiddenFileInput.setAttribute("capture",this.options.capture),this.hiddenFileInput.setAttribute("tabindex","-1"),this.hiddenFileInput.setAttribute("aria-label","dropzone hidden input"),this.hiddenFileInput.style.visibility="hidden",this.hiddenFileInput.style.position="absolute",this.hiddenFileInput.style.top="0",this.hiddenFileInput.style.left="0",this.hiddenFileInput.style.height="0",this.hiddenFileInput.style.width="0",l.getElement(this.options.hiddenInputContainer,"hiddenInputContainer").appendChild(this.hiddenFileInput),this.hiddenFileInput.addEventListener("change",(()=>{let{files:t}=this.hiddenFileInput;if(t.length)for(let e of t)this.addFile(e);this.emit("addedfiles",t),e()}))};e()}this.URL=null!==window.URL?window.URL:window.webkitURL;for(let e of this.events)this.on(e,this.options[e]);this.on("uploadprogress",(()=>this.updateTotalUploadProgress())),this.on("removedfile",(()=>this.updateTotalUploadProgress())),this.on("canceled",(e=>this.emit("complete",e))),this.on("complete",(e=>{if(0===this.getAddedFiles().length&&0===this.getUploadingFiles().length&&0===this.getQueuedFiles().length)return setTimeout((()=>this.emit("queuecomplete")),0)}));let e=function(e){if(function(e){return e.dataTransfer.types&&e.dataTransfer.types.includes("Files")}(e))return e.stopPropagation(),e.preventDefault()};return this.listeners=[{element:this.element,events:{dragstart:e=>this.emit("dragstart",e),dragenter:t=>(e(t),this.emit("dragenter",t)),dragover:t=>{const n=t.dataTransfer.effectAllowed;return t.dataTransfer.dropEffect="move"===n||"linkMove"===n?"move":"copy",e(t),this.emit("dragover",t)},dragleave:e=>this.emit("dragleave",e),drop:t=>(e(t),this.drop(t)),dragend:e=>this.emit("dragend",e)}}],this.clickableElements.forEach((e=>this.listeners.push({element:e,events:{click:t=>((e!==this.element||t.target===this.element||l.elementInside(t.target,this.element.querySelector(".dz-message")))&&this.hiddenFileInput.click(),!0)}}))),this.enable(),this.options.init.call(this)}destroy(){return this.disable(),this.removeAllFiles(!0),(null!=this.hiddenFileInput?this.hiddenFileInput.parentNode:void 0)&&(this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=null),delete this.element.dropzone,l.instances.splice(l.instances.indexOf(this),1)}updateTotalUploadProgress(){let e,t=0,n=0;if(this.getActiveFiles().length){for(let e of this.getActiveFiles())t+=e.upload.bytesSent,n+=e.upload.total;e=100*t/n}else e=100;return this.emit("totaluploadprogress",e,n,t)}_getParamName(e){return"function"==typeof this.options.paramName?this.options.paramName(e):`${this.options.paramName}${this.options.uploadMultiple?`[${e}]`:""}`}_renameFile(e){const t={...e,name:e.name.replace(/\u202F/g," ")};return"function"!=typeof this.options.renameFile?t.name:this.options.renameFile(t)}getFallbackForm(){let e,t;if(e=this.getExistingFallback())return e;let n='<div class="dz-fallback">';this.options.dictFallbackText&&(n+=`<p>${this.options.dictFallbackText}</p>`),n+=`<input type="file" name="${this._getParamName(0)}" ${this.options.uploadMultiple?'multiple="multiple"':void 0} /><input type="submit" value="Upload!"></div>`;let o=l.createElement(n);return"FORM"!==this.element.tagName?(t=l.createElement(`<form action="${this.options.url}" enctype="multipart/form-data" method="${this.options.method}"></form>`),t.appendChild(o)):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),null!=t?t:o}getExistingFallback(){let e=function(e){for(let t of e)if(/(^| )fallback($| )/.test(t.className))return t};for(let n of["div","form"]){var t;if(t=e(this.element.getElementsByTagName(n)))return t}}setupEventListeners(){return this.listeners.map((e=>(()=>{let t=[];for(let n in e.events){let o=e.events[n];t.push(e.element.addEventListener(n,o,!1))}return t})()))}removeEventListeners(){return this.listeners.map((e=>(()=>{let t=[];for(let n in e.events){let o=e.events[n];t.push(e.element.removeEventListener(n,o,!1))}return t})()))}disable(){return this.clickableElements.forEach((e=>e.classList.remove("dz-clickable"))),this.removeEventListeners(),this.disabled=!0,this.files.map((e=>this.cancelUpload(e)))}enable(){return delete this.disabled,this.clickableElements.forEach((e=>e.classList.add("dz-clickable"))),this.setupEventListeners()}filesize(e){let t=0,n="b";if(e>0){let o=["tb","gb","mb","kb","b"];for(let i=0;i<o.length;i++){let r=o[i];if(e>=Math.pow(this.options.filesizeBase,4-i)/10){t=e/Math.pow(this.options.filesizeBase,4-i),n=r;break}}t=Math.round(10*t)/10}return`<strong>${t}</strong> ${this.options.dictFileSizeUnits[n]}`}_updateMaxFilesReachedClass(){return null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(this.getAcceptedFiles().length===this.options.maxFiles&&this.emit("maxfilesreached",this.files),this.element.classList.add("dz-max-files-reached")):this.element.classList.remove("dz-max-files-reached")}drop(e){if(!e.dataTransfer)return;this.emit("drop",e);let t=[];for(let n=0;n<e.dataTransfer.files.length;n++)t[n]=e.dataTransfer.files[n];if(t.length){let{items:n}=e.dataTransfer;n&&n.length&&null!=n[0].webkitGetAsEntry?this._addFilesFromItems(n):this.handleFiles(t)}this.emit("addedfiles",t)}paste(e){if(null==(t=null!=e?e.clipboardData:void 0,n=e=>e.items,null!=t?n(t):void 0))return;var t,n;this.emit("paste",e);let{items:o}=e.clipboardData;return o.length?this._addFilesFromItems(o):void 0}handleFiles(e){for(let t of e)this.addFile(t)}_addFilesFromItems(e){return(()=>{let t=[];for(let o of e){var n;null!=o.webkitGetAsEntry&&(n=o.webkitGetAsEntry())?n.isFile?t.push(this.addFile(o.getAsFile())):n.isDirectory?t.push(this._addFilesFromDirectory(n,n.name)):t.push(void 0):null!=o.getAsFile&&(null==o.kind||"file"===o.kind)?t.push(this.addFile(o.getAsFile())):t.push(void 0)}return t})()}_addFilesFromDirectory(e,t){let n=e.createReader(),o=e=>{return t=console,n="log",o=t=>t.log(e),null!=t&&"function"==typeof t[n]?o(t,n):void 0;var t,n,o};var i=()=>n.readEntries((e=>{if(e.length>0){for(let n of e)n.isFile?n.file((e=>{if(!this.options.ignoreHiddenFiles||"."!==e.name.substring(0,1))return e.fullPath=`${t}/${e.name}`,this.addFile(e)})):n.isDirectory&&this._addFilesFromDirectory(n,`${t}/${n.name}`);i()}return null}),o);return i()}accept(e,t){this.options.maxFilesize&&e.size>1048576*this.options.maxFilesize?t(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(e.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):l.isValidFile(e,this.options.acceptedFiles)?null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(t(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",e)):this.options.accept.call(this,e,t):t(this.options.dictInvalidFileType)}addFile(e){e.upload={uuid:window.isSecureContext?self.crypto.randomUUID():l.uuidv4(),progress:0,total:e.size,bytesSent:0,filename:this._renameFile(e)},this.files.push(e),e.status=l.ADDED,this.emit("addedfile",e),this._enqueueThumbnail(e),this.accept(e,(t=>{t?(e.accepted=!1,this._errorProcessing([e],t)):(e.accepted=!0,this.options.autoQueue&&this.enqueueFile(e)),this._updateMaxFilesReachedClass()}))}enqueueFiles(e){for(let t of e)this.enqueueFile(t);return null}enqueueFile(e){if(e.status!==l.ADDED||!0!==e.accepted)throw new Error("This file can't be queued because it has already been processed or was rejected.");if(e.status=l.QUEUED,this.options.autoProcessQueue)return setTimeout((()=>this.processQueue()),0)}_enqueueThumbnail(e){if(this.options.createImageThumbnails&&e.type.match(/image.*/)&&e.size<=1048576*this.options.maxThumbnailFilesize)return this._thumbnailQueue.push(e),setTimeout((()=>this._processThumbnailQueue()),0)}_processThumbnailQueue(){if(this._processingThumbnail||0===this._thumbnailQueue.length)return;this._processingThumbnail=!0;let e=this._thumbnailQueue.shift();return this.createThumbnail(e,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,!0,(t=>(this.emit("thumbnail",e,t),this._processingThumbnail=!1,this._processThumbnailQueue())))}removeFile(e){if(e.status===l.UPLOADING&&this.cancelUpload(e),this.files=s(this.files,e),this.emit("removedfile",e),0===this.files.length)return this.emit("reset")}removeAllFiles(e){null==e&&(e=!1);for(let t of this.files.slice())(t.status!==l.UPLOADING||e)&&this.removeFile(t);return null}resizeImage(e,t,n,o,i){return this.createThumbnail(e,t,n,o,!0,((t,n)=>{if(null==n)return i(e);{let{resizeMimeType:t}=this.options;null==t&&(t=e.type);let o=n.toDataURL(t,this.options.resizeQuality);return"image/jpeg"!==t&&"image/jpg"!==t||(o=function(e,t){var n="data:image/jpeg;base64,";if(!e.startsWith(n)||!t.startsWith(n))return t;var o=window.atob(e.slice(n.length));if(!o.startsWith("ÿØÿ"))return t;var i=0,r="";for(;i<o.length&&"ÿÚ"!=o.slice(i,i+2);)if("ÿØ"==o.slice(i,i+2))i+=2;else{var l=i+(256*o.charCodeAt(i+2)+o.charCodeAt(i+3))+2,s=o.slice(i,l);s.startsWith("ÿá")&&(r+=s),i=l}if(""==r)return t;var a=window.atob(t.slice(n.length));if(!a.startsWith("ÿØÿ"))return t;var u=4+256*a.charCodeAt(4)+a.charCodeAt(5);return a=a.slice(0,u)+r+a.slice(u),n+window.btoa(a)}(e.dataURL,o)),i(l.dataURItoBlob(o))}}),!0)}createThumbnail(e,t,n,o,i,r,l=!1){let s=new FileReader;s.onload=()=>{e.dataURL=s.result,"image/svg+xml"!==e.type?this.createThumbnailFromUrl(e,t,n,o,i,r,void 0,l):null!=r&&r(s.result)},s.readAsDataURL(e)}displayExistingFile(e,t,n,o,i=!0){if(this.emit("addedfile",e),this.emit("complete",e),i){let i=t=>{this.emit("thumbnail",e,t),n&&n()};e.dataURL=t,this.createThumbnailFromUrl(e,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,this.options.fixOrientation,i,o)}else this.emit("thumbnail",e,t),n&&n()}createThumbnailFromUrl(e,t,n,o,i,r,l,s=!1){let a=document.createElement("img");l&&(a.crossOrigin=l),i="from-image"!=getComputedStyle(document.body).imageOrientation&&i,a.onload=()=>{let l=e=>e(1);return"undefined"!=typeof EXIF&&null!==EXIF&&i&&(l=e=>EXIF.getData(a,(function(){return e(EXIF.getTag(this,"Orientation"))}))),l((i=>{e.width=a.width,e.height=a.height;let l=this.options.resize.call(this,e,t,n,o),s=document.createElement("canvas"),d=s.getContext("2d");switch(s.width=l.trgWidth,s.height=l.trgHeight,i>4&&(s.width=l.trgHeight,s.height=l.trgWidth),i){case 2:d.translate(s.width,0),d.scale(-1,1);break;case 3:d.translate(s.width,s.height),d.rotate(Math.PI);break;case 4:d.translate(0,s.height),d.scale(1,-1);break;case 5:d.rotate(.5*Math.PI),d.scale(1,-1);break;case 6:d.rotate(.5*Math.PI),d.translate(0,-s.width);break;case 7:d.rotate(.5*Math.PI),d.translate(s.height,-s.width),d.scale(-1,1);break;case 8:d.rotate(-.5*Math.PI),d.translate(-s.height,0)}u(d,a,null!=l.srcX?l.srcX:0,null!=l.srcY?l.srcY:0,l.srcWidth,l.srcHeight,null!=l.trgX?l.trgX:0,null!=l.trgY?l.trgY:0,l.trgWidth,l.trgHeight);let c=s.toDataURL("image/png");if(null!=r)return r(c,s)}))},null!=r&&(a.onerror=r);var d=e.dataURL;return s&&(d=function(e){var t="data:image/jpeg;base64,";if(!e.startsWith(t))return e;var n=window.atob(e.slice(t.length));if(!n.startsWith("ÿØÿ"))return e;var o=0,i="";for(;o<n.length;){if("ÿÚ"==n.slice(o,o+2)){i+=n.slice(o);break}if("ÿØ"==n.slice(o,o+2))i+=n.slice(o,o+2),o+=2;else{var r=o+(256*n.charCodeAt(o+2)+n.charCodeAt(o+3))+2,l=n.slice(o,r);l.startsWith("ÿá")||(i+=l),o=r}}return t+window.btoa(i)}(d)),a.src=d}processQueue(){let{parallelUploads:e}=this.options,t=this.getUploadingFiles().length,n=t;if(t>=e)return;let o=this.getQueuedFiles();if(o.length>0){if(this.options.uploadMultiple)return this.processFiles(o.slice(0,e-t));for(;n<e;){if(!o.length)return;this.processFile(o.shift()),n++}}}processFile(e){return this.processFiles([e])}processFiles(e){for(let t of e)t.processing=!0,t.status=l.UPLOADING,this.emit("processing",t);return this.options.uploadMultiple&&this.emit("processingmultiple",e),this.uploadFiles(e)}_getFilesWithXhr(e){return this.files.filter((t=>t.xhr===e)).map((e=>e))}cancelUpload(e){if(e.status===l.UPLOADING){let t=this._getFilesWithXhr(e.xhr);for(let e of t)e.status=l.CANCELED;void 0!==e.xhr&&e.xhr.abort();for(let e of t)this.emit("canceled",e);this.options.uploadMultiple&&this.emit("canceledmultiple",t)}else e.status!==l.ADDED&&e.status!==l.QUEUED||(e.status=l.CANCELED,this.emit("canceled",e),this.options.uploadMultiple&&this.emit("canceledmultiple",[e]));if(this.options.autoProcessQueue)return this.processQueue()}resolveOption(e,...t){return"function"==typeof e?e.apply(this,t):e}uploadFile(e){return this.uploadFiles([e])}uploadFiles(e){this._transformFiles(e,(t=>{if(this.options.chunking){let n=t[0];e[0].upload.chunked=this.options.chunking&&(this.options.forceChunking||n.size>this.options.chunkSize),e[0].upload.totalChunkCount=Math.ceil(n.size/this.options.chunkSize),0===n.size&&(e[0].upload.totalChunkCount=1)}if(e[0].upload.chunked){let n=e[0],o=t[0];n.upload.chunks=[];let i=()=>{let t=0;for(;void 0!==n.upload.chunks[t];)t++;if(t>=n.upload.totalChunkCount)return;let i=t*this.options.chunkSize,r=Math.min(i+this.options.chunkSize,o.size),s={name:this._getParamName(0),data:o.webkitSlice?o.webkitSlice(i,r):o.slice(i,r),filename:n.upload.filename,chunkIndex:t};n.upload.chunks[t]={file:n,index:t,dataBlock:s,status:l.UPLOADING,progress:0,retries:0},this._uploadData(e,[s])};if(n.upload.finishedChunkUpload=(t,o)=>{let r=!0;t.status=l.SUCCESS,t.dataBlock=null,t.response=t.xhr.responseText,t.responseHeaders=t.xhr.getAllResponseHeaders(),t.xhr=null;for(let e=0;e<n.upload.totalChunkCount;e++){if(void 0===n.upload.chunks[e])return i();n.upload.chunks[e].status!==l.SUCCESS&&(r=!1)}r&&this.options.chunksUploaded(n,(()=>{this._finished(e,o,null)}))},this.options.parallelChunkUploads){const e=Math.min(!0===this.options.parallelChunkUploads?this.options.parallelUploads:this.options.parallelChunkUploads,n.upload.totalChunkCount);for(let t=0;t<e;t++)i()}else i()}else{let n=[];for(let o=0;o<e.length;o++)n[o]={name:this._getParamName(o),data:t[o],filename:e[o].upload.filename};this._uploadData(e,n)}}))}_getChunk(e,t){for(let n=0;n<e.upload.totalChunkCount;n++)if(void 0!==e.upload.chunks[n]&&e.upload.chunks[n].xhr===t)return e.upload.chunks[n]}_uploadData(e,t){let n=new XMLHttpRequest;for(let t of e)t.xhr=n;e[0].upload.chunked&&(e[0].upload.chunks[t[0].chunkIndex].xhr=n);let o=this.resolveOption(this.options.method,e,t),i=this.resolveOption(this.options.url,e,t);n.open(o,i,!0),this.resolveOption(this.options.timeout,e)&&(n.timeout=this.resolveOption(this.options.timeout,e)),n.withCredentials=!!this.options.withCredentials,n.onload=t=>{this._finishedUploading(e,n,t)},n.ontimeout=()=>{this._handleUploadError(e,n,`Request timedout after ${this.options.timeout/1e3} seconds`)},n.onerror=()=>{this._handleUploadError(e,n)},(null!=n.upload?n.upload:n).onprogress=t=>this._updateFilesUploadProgress(e,n,t);let r=this.options.defaultHeaders?{Accept:"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"}:{};this.options.binaryBody&&(r["Content-Type"]=e[0].type),this.options.headers&&Object.assign(r,this.options.headers);for(let e in r){let t=r[e];t&&n.setRequestHeader(e,t)}if(this.options.binaryBody){for(let t of e)this.emit("sending",t,n);this.options.uploadMultiple&&this.emit("sendingmultiple",e,n),this.submitRequest(n,null,e)}else{let o=new FormData;if(this.options.params){let t=this.options.params;"function"==typeof t&&(t=t.call(this,e,n,e[0].upload.chunked?this._getChunk(e[0],n):null));for(let e in t){let n=t[e];if(Array.isArray(n))for(let t=0;t<n.length;t++)o.append(e,n[t]);else o.append(e,n)}}for(let t of e)this.emit("sending",t,n,o);this.options.uploadMultiple&&this.emit("sendingmultiple",e,n,o),this._addFormElementData(o);for(let e=0;e<t.length;e++){let n=t[e];o.append(n.name,n.data,n.filename)}this.submitRequest(n,o,e)}}_transformFiles(e,t){let n=[],o=0;for(let i=0;i<e.length;i++)this.options.transformFile.call(this,e[i],(r=>{n[i]=r,++o===e.length&&t(n)}))}_addFormElementData(e){if("FORM"===this.element.tagName)for(let t of this.element.querySelectorAll("input, textarea, select, button")){let n=t.getAttribute("name"),o=t.getAttribute("type");if(o&&(o=o.toLowerCase()),null!=n)if("SELECT"===t.tagName&&t.hasAttribute("multiple"))for(let o of t.options)o.selected&&e.append(n,o.value);else(!o||"checkbox"!==o&&"radio"!==o||t.checked)&&e.append(n,t.value)}}_updateFilesUploadProgress(e,t,n){if(e[0].upload.chunked){let o=e[0],i=this._getChunk(o,t);n?(i.progress=100*n.loaded/n.total,i.total=n.total,i.bytesSent=n.loaded):(i.progress=100,i.bytesSent=i.total),o.upload.progress=0,o.upload.total=0,o.upload.bytesSent=0;for(let e=0;e<o.upload.totalChunkCount;e++)o.upload.chunks[e]&&void 0!==o.upload.chunks[e].progress&&(o.upload.progress+=o.upload.chunks[e].progress,o.upload.total+=o.upload.chunks[e].total,o.upload.bytesSent+=o.upload.chunks[e].bytesSent);o.upload.progress=o.upload.progress/o.upload.totalChunkCount,this.emit("uploadprogress",o,o.upload.progress,o.upload.bytesSent)}else for(let t of e)t.upload.total&&t.upload.bytesSent&&t.upload.bytesSent==t.upload.total||(n?(t.upload.progress=100*n.loaded/n.total,t.upload.total=n.total,t.upload.bytesSent=n.loaded):(t.upload.progress=100,t.upload.bytesSent=t.upload.total),this.emit("uploadprogress",t,t.upload.progress,t.upload.bytesSent))}_finishedUploading(e,t,n){let o;if(e[0].status!==l.CANCELED&&4===t.readyState){if("arraybuffer"!==t.responseType&&"blob"!==t.responseType&&(o=t.responseText,t.getResponseHeader("content-type")&&~t.getResponseHeader("content-type").indexOf("application/json")))try{o=JSON.parse(o)}catch(e){n=e,o="Invalid JSON response from server."}this._updateFilesUploadProgress(e,t),200<=t.status&&t.status<300?e[0].upload.chunked?e[0].upload.finishedChunkUpload(this._getChunk(e[0],t),o):this._finished(e,o,n):this._handleUploadError(e,t,o)}}_handleUploadError(e,t,n){if(e[0].status!==l.CANCELED){if(e[0].upload.chunked&&this.options.retryChunks){let n=this._getChunk(e[0],t);if(n.retries++<this.options.retryChunksLimit)return void this._uploadData(e,[n.dataBlock]);console.warn("Retried this chunk too often. Giving up.")}this._errorProcessing(e,n||this.options.dictResponseError.replace("{{statusCode}}",t.status),t)}}submitRequest(e,t,n){if(1==e.readyState)if(this.options.binaryBody)if(n[0].upload.chunked){const t=this._getChunk(n[0],e);e.send(t.dataBlock.data)}else e.send(n[0]);else e.send(t);else console.warn("Cannot send this request because the XMLHttpRequest.readyState is not OPENED.")}_finished(e,t,n){for(let o of e)o.status=l.SUCCESS,this.emit("success",o,t,n),this.emit("complete",o);if(this.options.uploadMultiple&&(this.emit("successmultiple",e,t,n),this.emit("completemultiple",e)),this.options.autoProcessQueue)return this.processQueue()}_errorProcessing(e,t,n){for(let o of e)o.status=l.ERROR,this.emit("error",o,t,n),this.emit("complete",o);if(this.options.uploadMultiple&&(this.emit("errormultiple",e,t,n),this.emit("completemultiple",e)),this.options.autoProcessQueue)return this.processQueue()}static uuidv4(){return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(e=>(+e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+e/4).toString(16)))}}l.initClass(),l.options={},l.optionsForElement=function(e){return e.getAttribute("id")&&void 0!==l.options?l.options[a(e.getAttribute("id"))]:void 0},l.instances=[],l.forElement=function(e){if("string"==typeof e&&(e=document.querySelector(e)),null==(null!=e?e.dropzone:void 0))throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");return e.dropzone},l.discover=function(){let e;if(document.querySelectorAll)e=document.querySelectorAll(".dropzone");else{e=[];let t=t=>(()=>{let n=[];for(let o of t)/(^| )dropzone($| )/.test(o.className)?n.push(e.push(o)):n.push(void 0);return n})();t(document.getElementsByTagName("div")),t(document.getElementsByTagName("form"))}return(()=>{let t=[];for(let n of e)!1!==l.optionsForElement(n)?t.push(new l(n)):t.push(void 0);return t})()},l.isBrowserSupported=function(){return"undefined"!=typeof Promise},l.dataURItoBlob=function(e){let t=atob(e.split(",")[1]),n=e.split(",")[0].split(":")[1].split(";")[0],o=new ArrayBuffer(t.length),i=new Uint8Array(o);for(let e=0,n=t.length,o=0<=n;o?e<=n:e>=n;o?e++:e--)i[e]=t.charCodeAt(e);return new Blob([o],{type:n})};const s=(e,t)=>e.filter((e=>e!==t)).map((e=>e)),a=e=>e.replace(/[\-_](\w)/g,(e=>e.charAt(1).toUpperCase()));l.createElement=function(e){let t=document.createElement("div");return t.innerHTML=e,t.childNodes[0]},l.elementInside=function(e,t){if(e===t)return!0;for(;e=e.parentNode;)if(e===t)return!0;return!1},l.getElement=function(e,t){let n;if("string"==typeof e?n=document.querySelector(e):null!=e.nodeType&&(n=e),null==n)throw new Error(`Invalid \`${t}\` option provided. Please provide a CSS selector or a plain HTML element.`);return n},l.getElements=function(e,t){let n,o;if(e instanceof Array){o=[];try{for(n of e)o.push(this.getElement(n,t))}catch(e){o=null}}else if("string"==typeof e)for(n of(o=[],document.querySelectorAll(e)))o.push(n);else null!=e.nodeType&&(o=[e]);if(null==o||!o.length)throw new Error(`Invalid \`${t}\` option provided. Please provide a CSS selector, a plain HTML element or a list of those.`);return o},l.confirm=function(e,t,n){return window.confirm(e)?t():null!=n?n():void 0},l.isValidFile=function(e,t){if(!t)return!0;t=t.split(",");let n=e.type,o=n.replace(/\/.*$/,"");for(let i of t)if(i=i.trim(),"."===i.charAt(0)){if(-1!==e.name.toLowerCase().indexOf(i.toLowerCase(),e.name.length-i.length))return!0}else if(/\/\*$/.test(i)){if(o===i.replace(/\/.*$/,""))return!0}else if(n===i)return!0;return!1},"undefined"!=typeof jQuery&&null!==jQuery&&(jQuery.fn.dropzone=function(e){return this.each((function(){return new l(this,e)}))}),l.ADDED="added",l.QUEUED="queued",l.ACCEPTED=l.QUEUED,l.UPLOADING="uploading",l.PROCESSING=l.UPLOADING,l.CANCELED="canceled",l.ERROR="error",l.SUCCESS="success";var u=function(e,t,n,o,i,r,l,s,a,u){let d=function(e){let t=e.naturalHeight,n=document.createElement("canvas");n.width=1,n.height=t;let o=n.getContext("2d");o.drawImage(e,0,0);let{data:i}=o.getImageData(1,0,1,t),r=0,l=t,s=t;for(;s>r;)0===i[4*(s-1)+3]?l=s:r=s,s=l+r>>1;let a=s/t;return 0===a?1:a}(t);return e.drawImage(t,n,o,i,r,l,s,a,u/d)}}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var r=t[o]={exports:{}};return e[o].call(r.exports,r,r.exports,n),r.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 o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),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})},function(){"use strict";n(6166),n(4639),n(871),n(2038),n(9329)}()}();
\ No newline at end of file
+!function(){var e={3375:function(e,t,n){"use strict";n.r(t),n.d(t,{AutoScrollActivator:function(){return _e},DndContext:function(){return Xe},DragOverlay:function(){return vt},KeyboardCode:function(){return le},KeyboardSensor:function(){return de},MeasuringFrequency:function(){return Ie},MeasuringStrategy:function(){return Fe},MouseSensor:function(){return be},PointerSensor:function(){return ge},TouchSensor:function(){return Ee},TraversalOrder:function(){return Se},applyModifiers:function(){return Qe},closestCenter:function(){return A},closestCorners:function(){return R},defaultAnnouncements:function(){return f},defaultCoordinates:function(){return y},defaultDropAnimation:function(){return ft},defaultDropAnimationSideEffects:function(){return pt},defaultKeyboardCoordinateGetter:function(){return ue},defaultScreenReaderInstructions:function(){return p},getClientRect:function(){return N},getFirstCollision:function(){return F},getScrollableAncestors:function(){return B},pointerWithin:function(){return P},rectIntersection:function(){return M},useDndContext:function(){return nt},useDndMonitor:function(){return c},useDraggable:function(){return tt},useDroppable:function(){return lt},useSensor:function(){return v},useSensors:function(){return b}});var i=n(1594),o=n.n(i),l=n(4518),r=n(4979);const s={display:"none"};function a(e){let{id:t,value:n}=e;return o().createElement("div",{id:t,style:s},n)}function u(e){let{id:t,announcement:n,ariaLiveType:i="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":i,"aria-atomic":!0},n)}const d=(0,i.createContext)(null);function c(e){const t=(0,i.useContext)(d);(0,i.useEffect)((()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)}),[e,t])}const p={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  "},f={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 h(e){let{announcements:t=f,container:n,hiddenTextDescribedById:s,screenReaderInstructions:d=p}=e;const{announce:h,announcement:g}=function(){const[e,t]=(0,i.useState)("");return{announce:(0,i.useCallback)((e=>{null!=e&&t(e)}),[]),announcement:e}}(),m=(0,r.YG)("DndLiveRegion"),[v,b]=(0,i.useState)(!1);if((0,i.useEffect)((()=>{b(!0)}),[]),c((0,i.useMemo)((()=>({onDragStart(e){let{active:n}=e;h(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:i}=e;t.onDragMove&&h(t.onDragMove({active:n,over:i}))},onDragOver(e){let{active:n,over:i}=e;h(t.onDragOver({active:n,over:i}))},onDragEnd(e){let{active:n,over:i}=e;h(t.onDragEnd({active:n,over:i}))},onDragCancel(e){let{active:n,over:i}=e;h(t.onDragCancel({active:n,over:i}))}})),[h,t])),!v)return null;const y=o().createElement(o().Fragment,null,o().createElement(a,{id:s,value:d.draggable}),o().createElement(u,{id:m,announcement:g}));return n?(0,l.createPortal)(y,n):y}var g;function m(){}function v(e,t){return(0,i.useMemo)((()=>({sensor:e,options:null!=t?t:{}})),[e,t])}function b(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,i.useMemo)((()=>[...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 _(e,t){const n=(0,r.e_)(e);if(!n)return"0 0";return(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%"}function S(e,t){let{data:{value:n}}=e,{data:{value:i}}=t;return n-i}function C(e,t){let{data:{value:n}}=e,{data:{value:i}}=t;return i-n}function w(e){let{left:t,top:n,height:i,width:o}=e;return[{x:t,y:n},{x:t+o,y:n},{x:t,y:n+i},{x:t+o,y:n+i}]}function F(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}function I(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 A=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:i}=e;const o=I(t,t.left,t.top),l=[];for(const e of i){const{id:t}=e,i=n.get(t);if(i){const n=E(I(i),o);l.push({id:t,data:{droppableContainer:e,value:n}})}}return l.sort(S)},R=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:i}=e;const o=w(t),l=[];for(const e of i){const{id:t}=e,i=n.get(t);if(i){const n=w(i),r=o.reduce(((e,t,i)=>e+E(n[i],t)),0),s=Number((r/4).toFixed(4));l.push({id:t,data:{droppableContainer:e,value:s}})}}return l.sort(S)};function O(e,t){const n=Math.max(t.top,e.top),i=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),l=Math.min(t.top+t.height,e.top+e.height),r=o-i,s=l-n;if(i<o&&n<l){const n=t.width*t.height,i=e.width*e.height,o=r*s;return Number((o/(n+i-o)).toFixed(4))}return 0}const M=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:i}=e;const o=[];for(const e of i){const{id:i}=e,l=n.get(i);if(l){const n=O(l,t);n>0&&o.push({id:i,data:{droppableContainer:e,value:n}})}}return o.sort(C)};function D(e,t){const{top:n,left:i,bottom:o,right:l}=t;return n<=e.y&&e.y<=o&&i<=e.x&&e.x<=l}const P=e=>{let{droppableContainers:t,droppableRects:n,pointerCoordinates:i}=e;if(!i)return[];const o=[];for(const e of t){const{id:t}=e,l=n.get(t);if(l&&D(i,l)){const n=w(l).reduce(((e,t)=>e+E(i,t)),0),r=Number((n/4).toFixed(4));o.push({id:t,data:{droppableContainer:e,value:r}})}}return o.sort(S)};function L(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:y}function x(e){return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return i.reduce(((t,n)=>({...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 T=x(1);function U(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 k={ignoreTransform:!1};function N(e,t){void 0===t&&(t=k);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:i}=(0,r.zk)(e).getComputedStyle(e);t&&(n=function(e,t,n){const i=U(t);if(!i)return e;const{scaleX:o,scaleY:l,x:r,y:s}=i,a=e.left-r-(1-o)*parseFloat(n),u=e.top-s-(1-l)*parseFloat(n.slice(n.indexOf(" ")+1)),d=o?e.width/o:e.width,c=l?e.height/l:e.height;return{width:d,height:c,top:u,right:a+d,bottom:u+c,left:a}}(n,t,i))}const{top:i,left:o,width:l,height:s,bottom:a,right:u}=n;return{top:i,left:o,width:l,height:s,bottom:a,right:u}}function j(e){return N(e,{ignoreTransform:!0})}function B(e,t){const n=[];return e?function i(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if((0,r.wz)(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!(0,r.sb)(o)||(0,r.xZ)(o))return n;if(n.includes(o))return n;const l=(0,r.zk)(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=(0,r.zk)(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((e=>{const i=t[e];return"string"==typeof i&&n.test(i)}))}(o,l)&&n.push(o),function(e,t){return void 0===t&&(t=(0,r.zk)(e).getComputedStyle(e)),"fixed"===t.position}(o,l)?n:i(o.parentNode)}(e):n}function z(e){const[t]=B(e,1);return null!=t?t:null}function V(e){return r.Sw&&e?(0,r.l6)(e)?e:(0,r.Ll)(e)?(0,r.wz)(e)||e===(0,r.TW)(e).scrollingElement?window:(0,r.sb)(e)?e:null:null:null}function H(e){return(0,r.l6)(e)?e.scrollX:e.scrollLeft}function q(e){return(0,r.l6)(e)?e.scrollY:e.scrollTop}function G(e){return{x:H(e),y:q(e)}}var W;function $(e){return!(!r.Sw||!e)&&e===document.scrollingElement}function Q(e){const t={x:0,y:0},n=$(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},i={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=i.y,isRight:e.scrollLeft>=i.x,maxScroll:i,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(W||(W={}));const K={x:.2,y:.2};function Y(e,t,n,i,o){let{top:l,left:r,right:s,bottom:a}=n;void 0===i&&(i=10),void 0===o&&(o=K);const{isTop:u,isBottom:d,isLeft:c,isRight:p}=Q(e),f={x:0,y:0},h={x:0,y:0},g=t.height*o.y,m=t.width*o.x;return!u&&l<=t.top+g?(f.y=W.Backward,h.y=i*Math.abs((t.top+g-l)/g)):!d&&a>=t.bottom-g&&(f.y=W.Forward,h.y=i*Math.abs((t.bottom-g-a)/g)),!p&&s>=t.right-m?(f.x=W.Forward,h.x=i*Math.abs((t.right-m-s)/m)):!c&&r<=t.left+m&&(f.x=W.Backward,h.x=i*Math.abs((t.left+m-r)/m)),{direction:f,speed:h}}function X(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:i,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:i,bottom:o,width:e.clientWidth,height:e.clientHeight}}function Z(e){return e.reduce(((e,t)=>(0,r.WQ)(e,G(t))),y)}function J(e,t){if(void 0===t&&(t=N),!e)return;const{top:n,left:i,bottom:o,right:l}=t(e);z(e)&&(o<=0||l<=0||n>=window.innerHeight||i>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const ee=[["x",["left","right"],function(e){return e.reduce(((e,t)=>e+H(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),i=Z(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of ee)for(const l of t)Object.defineProperty(this,l,{get:()=>{const t=o(n),r=i[e]-t;return this.rect[l]+r},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 i;null==(i=this.target)||i.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function ie(e,t){const n=Math.abs(e.x),i=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+i**2)>t:"x"in t&&"y"in t?n>t.x&&i>t.y:"x"in t?n>t.x:"y"in t&&i>t.y}var oe,le;function re(e){e.preventDefault()}function se(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"}(le||(le={}));const ae={start:[le.Space,le.Enter],cancel:[le.Esc],end:[le.Space,le.Enter,le.Tab]},ue=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case le.Right:return{...n,x:n.x+25};case le.Left:return{...n,x:n.x-25};case le.Down:return{...n,y:n.y+25};case le.Up:return{...n,y:n.y-25}}};class de{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,r.TW)(t)),this.windowListeners=new ne((0,r.zk)(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&&J(n),t(y)}handleKeyDown(e){if((0,r.kx)(e)){const{active:t,context:n,options:i}=this.props,{keyboardCodes:o=ae,coordinateGetter:l=ue,scrollBehavior:s="smooth"}=i,{code:a}=e;if(o.end.includes(a))return void this.handleEnd(e);if(o.cancel.includes(a))return void this.handleCancel(e);const{collisionRect:u}=n.current,d=u?{x:u.left,y:u.top}:y;this.referenceCoordinates||(this.referenceCoordinates=d);const c=l(e,{active:t,context:n.current,currentCoordinates:d});if(c){const t=(0,r.Re)(c,d),i={x:0,y:0},{scrollableAncestors:o}=n.current;for(const n of o){const o=e.code,{isTop:l,isRight:r,isLeft:a,isBottom:u,maxScroll:d,minScroll:p}=Q(n),f=X(n),h={x:Math.min(o===le.Right?f.right-f.width/2:f.right,Math.max(o===le.Right?f.left:f.left+f.width/2,c.x)),y:Math.min(o===le.Down?f.bottom-f.height/2:f.bottom,Math.max(o===le.Down?f.top:f.top+f.height/2,c.y))},g=o===le.Right&&!r||o===le.Left&&!a,m=o===le.Down&&!u||o===le.Up&&!l;if(g&&h.x!==c.x){const e=n.scrollLeft+t.x,l=o===le.Right&&e<=d.x||o===le.Left&&e>=p.x;if(l&&!t.y)return void n.scrollTo({left:e,behavior:s});i.x=l?n.scrollLeft-e:o===le.Right?n.scrollLeft-d.x:n.scrollLeft-p.x,i.x&&n.scrollBy({left:-i.x,behavior:s});break}if(m&&h.y!==c.y){const e=n.scrollTop+t.y,l=o===le.Down&&e<=d.y||o===le.Up&&e>=p.y;if(l&&!t.x)return void n.scrollTo({top:e,behavior:s});i.y=l?n.scrollTop-e:o===le.Down?n.scrollTop-d.y:n.scrollTop-p.y,i.y&&n.scrollBy({top:-i.y,behavior:s});break}}this.handleMove(e,(0,r.WQ)((0,r.Re)(c,this.referenceCoordinates),i))}}}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 ce(e){return Boolean(e&&"distance"in e)}function pe(e){return Boolean(e&&"delay"in e)}de.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:i=ae,onActivation:o}=t,{active:l}=n;const{code:r}=e.nativeEvent;if(i.start.includes(r)){const t=l.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==o||o({event:e.nativeEvent}),!0)}return!1}}];class fe{constructor(e,t,n){var i;void 0===n&&(n=function(e){const{EventTarget:t}=(0,r.zk)(e);return e instanceof t?e:(0,r.TW)(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:l}=o;this.props=e,this.events=t,this.document=(0,r.TW)(l),this.documentListeners=new ne(this.document),this.listeners=new ne(n),this.windowListeners=new ne((0,r.zk)(l)),this.initialCoordinates=null!=(i=(0,r.e_)(o))?i: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,re),this.windowListeners.add(oe.VisibilityChange,this.handleCancel),this.windowListeners.add(oe.ContextMenu,re),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(pe(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(ce(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:i}=this.props;i(n,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(oe.Click,se,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(oe.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:i,props:o}=this,{onMove:l,options:{activationConstraint:s}}=o;if(!i)return;const a=null!=(t=(0,r.e_)(e))?t:y,u=(0,r.Re)(i,a);if(!n&&s){if(ce(s)){if(null!=s.tolerance&&ie(u,s.tolerance))return this.handleCancel();if(ie(u,s.distance))return this.handleStart()}return pe(s)&&ie(u,s.tolerance)?this.handleCancel():void this.handlePending(s,u)}e.cancelable&&e.preventDefault(),l(a)}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===le.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const he={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ge extends fe{constructor(e){const{event:t}=e,n=(0,r.TW)(t.target);super(e,he,n)}}ge.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;return!(!n.isPrimary||0!==n.button)&&(null==i||i({event:n}),!0)}}];const me={move:{name:"mousemove"},end:{name:"mouseup"}};var ve;!function(e){e[e.RightClick=2]="RightClick"}(ve||(ve={}));class be extends fe{constructor(e){super(e,me,(0,r.TW)(e.event.target))}}be.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;return n.button!==ve.RightClick&&(null==i||i({event:n}),!0)}}];const ye={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Ee extends fe{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 _e,Se;function Ce(e){let{acceleration:t,activator:n=_e.Pointer,canScroll:o,draggingRect:l,enabled:s,interval:a=5,order:u=Se.TreeOrder,pointerCoordinates:d,scrollableAncestors:c,scrollableAncestorRects:p,delta:f,threshold:h}=e;const g=function(e){let{delta:t,disabled:n}=e;const i=(0,r.ZC)(t);return(0,r.KG)((e=>{if(n||!i||!e)return we;const o={x:Math.sign(t.x-i.x),y:Math.sign(t.y-i.y)};return{x:{[W.Backward]:e.x[W.Backward]||-1===o.x,[W.Forward]:e.x[W.Forward]||1===o.x},y:{[W.Backward]:e.y[W.Backward]||-1===o.y,[W.Forward]:e.y[W.Forward]||1===o.y}}}),[n,t,i])}({delta:f,disabled:!s}),[m,v]=(0,r.$$)(),b=(0,i.useRef)({x:0,y:0}),y=(0,i.useRef)({x:0,y:0}),E=(0,i.useMemo)((()=>{switch(n){case _e.Pointer:return d?{top:d.y,bottom:d.y,left:d.x,right:d.x}:null;case _e.DraggableRect:return l}}),[n,l,d]),_=(0,i.useRef)(null),S=(0,i.useCallback)((()=>{const e=_.current;if(!e)return;const t=b.current.x*y.current.x,n=b.current.y*y.current.y;e.scrollBy(t,n)}),[]),C=(0,i.useMemo)((()=>u===Se.TreeOrder?[...c].reverse():c),[u,c]);(0,i.useEffect)((()=>{if(s&&c.length&&E){for(const e of C){if(!1===(null==o?void 0:o(e)))continue;const n=c.indexOf(e),i=p[n];if(!i)continue;const{direction:l,speed:r}=Y(e,i,E,t,h);for(const e of["x","y"])g[e][l[e]]||(r[e]=0,l[e]=0);if(r.x>0||r.y>0)return v(),_.current=e,m(S,a),b.current=r,void(y.current=l)}b.current={x:0,y:0},y.current={x:0,y:0},v()}else v()}),[t,S,o,v,s,a,JSON.stringify(E),JSON.stringify(g),m,c,C,p,JSON.stringify(h)])}Ee.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;const{touches:o}=n;return!(o.length>1)&&(null==i||i({event:n}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(_e||(_e={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(Se||(Se={}));const we={x:{[W.Backward]:!1,[W.Forward]:!1},y:{[W.Backward]:!1,[W.Forward]:!1}};var Fe,Ie;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(Fe||(Fe={})),function(e){e.Optimized="optimized"}(Ie||(Ie={}));const Ae=new Map;function Re(e,t){return(0,r.KG)((n=>e?n||("function"==typeof t?t(e):e):null),[t,e])}function Oe(e){let{callback:t,disabled:n}=e;const o=(0,r._q)(t),l=(0,i.useMemo)((()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(o)}),[n]);return(0,i.useEffect)((()=>()=>null==l?void 0:l.disconnect()),[l]),l}function Me(e){return new te(N(e),e)}function De(e,t,n){void 0===t&&(t=Me);const[o,l]=(0,i.useState)(null);function s(){l((i=>{if(!e)return null;var o;if(!1===e.isConnected)return null!=(o=null!=i?i:n)?o:null;const l=t(e);return JSON.stringify(i)===JSON.stringify(l)?i:l}))}const a=function(e){let{callback:t,disabled:n}=e;const o=(0,r._q)(t),l=(0,i.useMemo)((()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(o)}),[o,n]);return(0,i.useEffect)((()=>()=>null==l?void 0:l.disconnect()),[l]),l}({callback(t){if(e)for(const n of t){const{type:t,target:i}=n;if("childList"===t&&i instanceof HTMLElement&&i.contains(e)){s();break}}}}),u=Oe({callback:s});return(0,r.Es)((()=>{s(),e?(null==u||u.observe(e),null==a||a.observe(document.body,{childList:!0,subtree:!0})):(null==u||u.disconnect(),null==a||a.disconnect())}),[e]),o}const Pe=[];function Le(e,t){void 0===t&&(t=[]);const n=(0,i.useRef)(null);return(0,i.useEffect)((()=>{n.current=null}),t),(0,i.useEffect)((()=>{const t=e!==y;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)}),[e]),n.current?(0,r.Re)(e,n.current):y}function xe(e){return(0,i.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 Te=[];function Ue(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return(0,r.sb)(t)?t:e}const ke=[{sensor:ge,options:{}},{sensor:de,options:{}}],Ne={current:{}},je={draggable:{measure:j},droppable:{measure:j,strategy:Fe.WhileDragging,frequency:Ie.Optimized},dragOverlay:{measure:N}};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 ze={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:m},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:je,measureDroppableContainers:m,windowRect:null,measuringScheduled:!1},Ve={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:m,draggableNodes:new Map,over:null,measureDroppableContainers:m},He=(0,i.createContext)(Ve),qe=(0,i.createContext)(ze);function Ge(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Be}}}function We(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:i}=n,o=new Be(e.droppable.containers);return o.set(i,n),{...e,droppable:{...e.droppable,containers:o}}}case g.SetDroppableDisabled:{const{id:n,key:i,disabled:o}=t,l=e.droppable.containers.get(n);if(!l||i!==l.key)return e;const r=new Be(e.droppable.containers);return r.set(n,{...l,disabled:o}),{...e,droppable:{...e.droppable,containers:r}}}case g.UnregisterDroppable:{const{id:n,key:i}=t,o=e.droppable.containers.get(n);if(!o||i!==o.key)return e;const l=new Be(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function $e(e){let{disabled:t}=e;const{active:n,activatorEvent:o,draggableNodes:l}=(0,i.useContext)(He),s=(0,r.ZC)(o),a=(0,r.ZC)(null==n?void 0:n.id);return(0,i.useEffect)((()=>{if(!t&&!o&&s&&null!=a){if(!(0,r.kx)(s))return;if(document.activeElement===s.target)return;const e=l.get(a);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,r.ag)(e);if(t){t.focus();break}}}))}}),[o,t,l,a,s]),null}function Qe(e,t){let{transform:n,...i}=t;return null!=e&&e.length?e.reduce(((e,t)=>t({transform:e,...i})),n):n}const Ke=(0,i.createContext)({...y,scaleX:1,scaleY:1});var Ye;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(Ye||(Ye={}));const Xe=(0,i.memo)((function(e){var t,n,s,a;let{id:u,accessibility:c,autoScroll:p=!0,children:f,sensors:m=ke,collisionDetection:v=M,measuring:b,modifiers:E,..._}=e;const S=(0,i.useReducer)(We,void 0,Ge),[C,w]=S,[I,A]=function(){const[e]=(0,i.useState)((()=>new Set)),t=(0,i.useCallback)((t=>(e.add(t),()=>e.delete(t))),[e]);return[(0,i.useCallback)((t=>{let{type:n,event:i}=t;e.forEach((e=>{var t;return null==(t=e[n])?void 0:t.call(e,i)}))}),[e]),t]}(),[R,O]=(0,i.useState)(Ye.Uninitialized),D=R===Ye.Initialized,{draggable:{active:P,nodes:x,translate:U},droppable:{containers:k}}=C,j=null!=P?x.get(P):null,H=(0,i.useRef)({initial:null,translated:null}),q=(0,i.useMemo)((()=>{var e;return null!=P?{id:P,data:null!=(e=null==j?void 0:j.data)?e:Ne,rect:H}:null}),[P,j]),W=(0,i.useRef)(null),[Q,K]=(0,i.useState)(null),[Y,X]=(0,i.useState)(null),J=(0,r.YN)(_,Object.values(_)),ee=(0,r.YG)("DndDescribedBy",u),ne=(0,i.useMemo)((()=>k.getEnabled()),[k]),ie=(oe=b,(0,i.useMemo)((()=>({draggable:{...je.draggable,...null==oe?void 0:oe.draggable},droppable:{...je.droppable,...null==oe?void 0:oe.droppable},dragOverlay:{...je.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:le,measureDroppableContainers:re,measuringScheduled:se}=function(e,t){let{dragging:n,dependencies:o,config:l}=t;const[s,a]=(0,i.useState)(null),{frequency:u,measure:d,strategy:c}=l,p=(0,i.useRef)(e),f=function(){switch(c){case Fe.Always:return!1;case Fe.BeforeDragging:return n;default:return!n}}(),h=(0,r.YN)(f),g=(0,i.useCallback)((function(e){void 0===e&&(e=[]),h.current||a((t=>null===t?e:t.concat(e.filter((e=>!t.includes(e))))))}),[h]),m=(0,i.useRef)(null),v=(0,r.KG)((t=>{if(f&&!n)return Ae;if(!t||t===Ae||p.current!==e||null!=s){const t=new Map;for(let n of e){if(!n)continue;if(s&&s.length>0&&!s.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,i=e?new te(d(e),e):null;n.rect.current=i,i&&t.set(n.id,i)}return t}return t}),[e,s,n,f,d]);return(0,i.useEffect)((()=>{p.current=e}),[e]),(0,i.useEffect)((()=>{f||g()}),[n,f]),(0,i.useEffect)((()=>{s&&s.length>0&&a(null)}),[JSON.stringify(s)]),(0,i.useEffect)((()=>{f||"number"!=typeof u||null!==m.current||(m.current=setTimeout((()=>{g(),m.current=null}),u))}),[u,f,g,...o]),{droppableRects:v,measureDroppableContainers:g,measuringScheduled:null!=s}}(ne,{dragging:D,dependencies:[U.x,U.y],config:ie.droppable}),ae=function(e,t){const n=null!=t?e.get(t):void 0,i=n?n.node.current:null;return(0,r.KG)((e=>{var n;return null==t?null:null!=(n=null!=i?i:e)?n:null}),[i,t])}(x,P),ue=(0,i.useMemo)((()=>Y?(0,r.e_)(Y):null),[Y]),de=function(){const e=!1===(null==Q?void 0:Q.autoScrollEnabled),t="object"==typeof p?!1===p.enabled:!1===p,n=D&&!e&&!t;if("object"==typeof p)return{...p,enabled:n};return{enabled:n}}(),ce=function(e,t){return Re(e,t)}(ae,ie.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:o,config:l=!0}=e;const s=(0,i.useRef)(!1),{x:a,y:u}="boolean"==typeof l?{x:l,y:l}:l;(0,r.Es)((()=>{if(!a&&!u||!t)return void(s.current=!1);if(s.current||!o)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const i=L(n(e),o);if(a||(i.x=0),u||(i.y=0),s.current=!0,Math.abs(i.x)>0||Math.abs(i.y)>0){const t=z(e);t&&t.scrollBy({top:i.y,left:i.x})}}),[t,a,u,o,n])}({activeNode:null!=P?x.get(P):null,config:de.layoutShiftCompensation,initialRect:ce,measure:ie.draggable.measure});const pe=De(ae,ie.draggable.measure,ce),fe=De(ae?ae.parentElement:null),he=(0,i.useRef)({activatorEvent:null,active:null,activeNode:ae,collisionRect:null,collisions:null,droppableRects:le,draggableNodes:x,draggingNode:null,draggingNodeRect:null,droppableContainers:k,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ge=k.getNodeFor(null==(t=he.current.over)?void 0:t.id),me=function(e){let{measure:t}=e;const[n,o]=(0,i.useState)(null),l=Oe({callback:(0,i.useCallback)((e=>{for(const{target:n}of e)if((0,r.sb)(n)){o((e=>{const i=t(n);return e?{...e,width:i.width,height:i.height}:i}));break}}),[t])}),s=(0,i.useCallback)((e=>{const n=Ue(e);null==l||l.disconnect(),n&&(null==l||l.observe(n)),o(n?t(n):null)}),[t,l]),[a,u]=(0,r.lk)(s);return(0,i.useMemo)((()=>({nodeRef:a,rect:n,setRef:u})),[n,a,u])}({measure:ie.dragOverlay.measure}),ve=null!=(n=me.nodeRef.current)?n:ae,be=D?null!=(s=me.rect)?s:pe:null,ye=Boolean(me.nodeRef.current&&me.rect),Ee=L(_e=ye?null:pe,Re(_e));var _e;const Se=xe(ve?(0,r.zk)(ve):null),we=function(e){const t=(0,i.useRef)(e),n=(0,r.KG)((n=>e?n&&n!==Pe&&e&&t.current&&e.parentNode===t.current.parentNode?n:B(e):Pe),[e]);return(0,i.useEffect)((()=>{t.current=e}),[e]),n}(D?null!=ge?ge:ae:null),Ie=function(e,t){void 0===t&&(t=N);const[n]=e,o=xe(n?(0,r.zk)(n):null),[l,s]=(0,i.useState)(Te);function a(){s((()=>e.length?e.map((e=>$(e)?o:new te(t(e),e))):Te))}const u=Oe({callback:a});return(0,r.Es)((()=>{null==u||u.disconnect(),a(),e.forEach((e=>null==u?void 0:u.observe(e)))}),[e]),l}(we),Me=Qe(E,{transform:{x:U.x-Ee.x,y:U.y-Ee.y,scaleX:1,scaleY:1},activatorEvent:Y,active:q,activeNodeRect:pe,containerNodeRect:fe,draggingNodeRect:be,over:he.current.over,overlayNodeRect:me.rect,scrollableAncestors:we,scrollableAncestorRects:Ie,windowRect:Se}),Be=ue?(0,r.WQ)(ue,U):null,ze=function(e){const[t,n]=(0,i.useState)(null),o=(0,i.useRef)(e),l=(0,i.useCallback)((e=>{const t=V(e.target);t&&n((e=>e?(e.set(t,G(t)),new Map(e)):null))}),[]);return(0,i.useEffect)((()=>{const t=o.current;if(e!==t){i(t);const r=e.map((e=>{const t=V(e);return t?(t.addEventListener("scroll",l,{passive:!0}),[t,G(t)]):null})).filter((e=>null!=e));n(r.length?new Map(r):null),o.current=e}return()=>{i(e),i(t)};function i(e){e.forEach((e=>{const t=V(e);null==t||t.removeEventListener("scroll",l)}))}}),[l,e]),(0,i.useMemo)((()=>e.length?t?Array.from(t.values()).reduce(((e,t)=>(0,r.WQ)(e,t)),y):Z(e):y),[e,t])}(we),Ve=Le(ze),Xe=Le(ze,[pe]),Ze=(0,r.WQ)(Me,Ve),Je=be?T(be,Me):null,et=q&&Je?v({active:q,collisionRect:Je,droppableRects:le,droppableContainers:ne,pointerCoordinates:Be}):null,tt=F(et,"id"),[nt,it]=(0,i.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,r.WQ)(Me,Xe),null!=(a=null==nt?void 0:nt.rect)?a:null,pe),lt=(0,i.useRef)(null),rt=(0,i.useCallback)(((e,t)=>{let{sensor:n,options:i}=t;if(null==W.current)return;const o=x.get(W.current);if(!o)return;const r=e.nativeEvent,s=new n({active:W.current,activeNode:o,event:r,options:i,context:he,onAbort(e){if(!x.get(e))return;const{onDragAbort:t}=J.current,n={id:e};null==t||t(n),I({type:"onDragAbort",event:n})},onPending(e,t,n,i){if(!x.get(e))return;const{onDragPending:o}=J.current,l={id:e,constraint:t,initialCoordinates:n,offset:i};null==o||o(l),I({type:"onDragPending",event:l})},onStart(e){const t=W.current;if(null==t)return;const n=x.get(t);if(!n)return;const{onDragStart:i}=J.current,o={activatorEvent:r,active:{id:t,data:n.data,rect:H}};(0,l.unstable_batchedUpdates)((()=>{null==i||i(o),O(Ye.Initializing),w({type:g.DragStart,initialCoordinates:e,active:t}),I({type:"onDragStart",event:o}),K(lt.current),X(r)}))},onMove(e){w({type:g.DragMove,coordinates:e})},onEnd:a(g.DragEnd),onCancel:a(g.DragCancel)});function a(e){return async function(){const{active:t,collisions:n,over:i,scrollAdjustedTranslate:o}=he.current;let s=null;if(t&&o){const{cancelDrop:l}=J.current;if(s={activatorEvent:r,active:t,collisions:n,delta:o,over:i},e===g.DragEnd&&"function"==typeof l){await Promise.resolve(l(s))&&(e=g.DragCancel)}}W.current=null,(0,l.unstable_batchedUpdates)((()=>{w({type:e}),O(Ye.Uninitialized),it(null),K(null),X(null),lt.current=null;const t=e===g.DragEnd?"onDragEnd":"onDragCancel";if(s){const e=J.current[t];null==e||e(s),I({type:t,event:s})}}))}}lt.current=s}),[x]),st=(0,i.useCallback)(((e,t)=>(n,i)=>{const o=n.nativeEvent,l=x.get(i);if(null!==W.current||!l||o.dndKit||o.defaultPrevented)return;const r={active:l};!0===e(n,t.options,r)&&(o.dndKit={capturedBy:t.sensor},W.current=i,rt(n,t))}),[x,rt]),at=function(e,t){return(0,i.useMemo)((()=>e.reduce(((e,n)=>{const{sensor:i}=n;return[...e,...i.activators.map((e=>({eventName:e.eventName,handler:t(e.handler,n)})))]}),[])),[e,t])}(m,st);!function(e){(0,i.useEffect)((()=>{if(!r.Sw)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})))}(m),(0,r.Es)((()=>{pe&&R===Ye.Initializing&&O(Ye.Initialized)}),[pe,R]),(0,i.useEffect)((()=>{const{onDragMove:e}=J.current,{active:t,activatorEvent:n,collisions:i,over:o}=he.current;if(!t||!n)return;const r={active:t,activatorEvent:n,collisions:i,delta:{x:Ze.x,y:Ze.y},over:o};(0,l.unstable_batchedUpdates)((()=>{null==e||e(r),I({type:"onDragMove",event:r})}))}),[Ze.x,Ze.y]),(0,i.useEffect)((()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:i,scrollAdjustedTranslate:o}=he.current;if(!e||null==W.current||!t||!o)return;const{onDragOver:r}=J.current,s=i.get(tt),a=s&&s.rect.current?{id:s.id,rect:s.rect.current,data:s.data,disabled:s.disabled}:null,u={active:e,activatorEvent:t,collisions:n,delta:{x:o.x,y:o.y},over:a};(0,l.unstable_batchedUpdates)((()=>{it(a),null==r||r(u),I({type:"onDragOver",event:u})}))}),[tt]),(0,r.Es)((()=>{he.current={activatorEvent:Y,active:q,activeNode:ae,collisionRect:Je,collisions:et,droppableRects:le,draggableNodes:x,draggingNode:ve,draggingNodeRect:be,droppableContainers:k,over:nt,scrollableAncestors:we,scrollAdjustedTranslate:Ze},H.current={initial:be,translated:Je}}),[q,ae,et,Je,x,ve,be,le,k,nt,we,Ze]),Ce({...de,delta:U,draggingRect:Je,pointerCoordinates:Be,scrollableAncestors:we,scrollableAncestorRects:Ie});const ut=(0,i.useMemo)((()=>({active:q,activeNode:ae,activeNodeRect:pe,activatorEvent:Y,collisions:et,containerNodeRect:fe,dragOverlay:me,draggableNodes:x,droppableContainers:k,droppableRects:le,over:nt,measureDroppableContainers:re,scrollableAncestors:we,scrollableAncestorRects:Ie,measuringConfiguration:ie,measuringScheduled:se,windowRect:Se})),[q,ae,pe,Y,et,fe,me,x,k,le,nt,re,we,Ie,ie,se,Se]),dt=(0,i.useMemo)((()=>({activatorEvent:Y,activators:at,active:q,activeNodeRect:pe,ariaDescribedById:{draggable:ee},dispatch:w,draggableNodes:x,over:nt,measureDroppableContainers:re})),[Y,at,q,pe,w,ee,x,nt,re]);return o().createElement(d.Provider,{value:A},o().createElement(He.Provider,{value:dt},o().createElement(qe.Provider,{value:ut},o().createElement(Ke.Provider,{value:ot},f)),o().createElement($e,{disabled:!1===(null==c?void 0:c.restoreFocus)})),o().createElement(h,{...c,hiddenTextDescribedById:ee}))})),Ze=(0,i.createContext)(null),Je="button",et="Draggable";function tt(e){let{id:t,data:n,disabled:o=!1,attributes:l}=e;const s=(0,r.YG)(et),{activators:a,activatorEvent:u,active:d,activeNodeRect:c,ariaDescribedById:p,draggableNodes:f,over:h}=(0,i.useContext)(He),{role:g=Je,roleDescription:m="draggable",tabIndex:v=0}=null!=l?l:{},b=(null==d?void 0:d.id)===t,y=(0,i.useContext)(b?Ke:Ze),[E,_]=(0,r.lk)(),[S,C]=(0,r.lk)(),w=function(e,t){return(0,i.useMemo)((()=>e.reduce(((e,n)=>{let{eventName:i,handler:o}=n;return e[i]=e=>{o(e,t)},e}),{})),[e,t])}(a,t),F=(0,r.YN)(n);(0,r.Es)((()=>(f.set(t,{id:t,key:s,node:E,activatorNode:S,data:F}),()=>{const e=f.get(t);e&&e.key===s&&f.delete(t)})),[f,t]);return{active:d,activatorEvent:u,activeNodeRect:c,attributes:(0,i.useMemo)((()=>({role:g,tabIndex:v,"aria-disabled":o,"aria-pressed":!(!b||g!==Je)||void 0,"aria-roledescription":m,"aria-describedby":p.draggable})),[o,g,v,b,m,p.draggable]),isDragging:b,listeners:o?void 0:w,node:E,over:h,setNodeRef:_,setActivatorNodeRef:C,transform:y}}function nt(){return(0,i.useContext)(qe)}const it="Droppable",ot={timeout:25};function lt(e){let{data:t,disabled:n=!1,id:o,resizeObserverConfig:l}=e;const s=(0,r.YG)(it),{active:a,dispatch:u,over:d,measureDroppableContainers:c}=(0,i.useContext)(He),p=(0,i.useRef)({disabled:n}),f=(0,i.useRef)(!1),h=(0,i.useRef)(null),m=(0,i.useRef)(null),{disabled:v,updateMeasurementsFor:b,timeout:y}={...ot,...l},E=(0,r.YN)(null!=b?b:o),_=Oe({callback:(0,i.useCallback)((()=>{f.current?(null!=m.current&&clearTimeout(m.current),m.current=setTimeout((()=>{c(Array.isArray(E.current)?E.current:[E.current]),m.current=null}),y)):f.current=!0}),[y]),disabled:v||!a}),S=(0,i.useCallback)(((e,t)=>{_&&(t&&(_.unobserve(t),f.current=!1),e&&_.observe(e))}),[_]),[C,w]=(0,r.lk)(S),F=(0,r.YN)(t);return(0,i.useEffect)((()=>{_&&C.current&&(_.disconnect(),f.current=!1,_.observe(C.current))}),[C,_]),(0,i.useEffect)((()=>(u({type:g.RegisterDroppable,element:{id:o,key:s,disabled:n,node:C,rect:h,data:F}}),()=>u({type:g.UnregisterDroppable,key:s,id:o}))),[o]),(0,i.useEffect)((()=>{n!==p.current.disabled&&(u({type:g.SetDroppableDisabled,id:o,key:s,disabled:n}),p.current.disabled=n)}),[o,s,n,u]),{active:a,rect:h,isOver:(null==d?void 0:d.id)===o,node:C,over:d,setNodeRef:w}}function rt(e){let{animation:t,children:n}=e;const[l,s]=(0,i.useState)(null),[a,u]=(0,i.useState)(null),d=(0,r.ZC)(n);return n||l||!d||s(d),(0,r.Es)((()=>{if(!a)return;const e=null==l?void 0:l.key,n=null==l?void 0:l.props.id;null!=e&&null!=n?Promise.resolve(t(n,a)).then((()=>{s(null)})):s(null)}),[t,l,a]),o().createElement(o().Fragment,null,n,l?(0,i.cloneElement)(l,{ref:u}):null)}const st={x:0,y:0,scaleX:1,scaleY:1};function at(e){let{children:t}=e;return o().createElement(He.Provider,{value:Ve},o().createElement(Ke.Provider,{value:st},t))}const ut={position:"fixed",touchAction:"none"},dt=e=>(0,r.kx)(e)?"transform 250ms ease":void 0,ct=(0,i.forwardRef)(((e,t)=>{let{as:n,activatorEvent:i,adjustScale:l,children:s,className:a,rect:u,style:d,transform:c,transition:p=dt}=e;if(!u)return null;const f=l?c:{...c,scaleX:1,scaleY:1},h={...ut,width:u.width,height:u.height,top:u.top,left:u.left,transform:r.Ks.Transform.toString(f),transformOrigin:l&&i?_(i,u):void 0,transition:"function"==typeof p?p(i):p,...d};return o().createElement(n,{className:a,style:h,ref:t},s)})),pt=e=>t=>{let{active:n,dragOverlay:i}=t;const o={},{styles:l,className:r}=e;if(null!=l&&l.active)for(const[e,t]of Object.entries(l.active))void 0!==t&&(o[e]=n.node.style.getPropertyValue(e),n.node.style.setProperty(e,t));if(null!=l&&l.dragOverlay)for(const[e,t]of Object.entries(l.dragOverlay))void 0!==t&&i.node.style.setProperty(e,t);return null!=r&&r.active&&n.node.classList.add(r.active),null!=r&&r.dragOverlay&&i.node.classList.add(r.dragOverlay),function(){for(const[e,t]of Object.entries(o))n.node.style.setProperty(e,t);null!=r&&r.active&&n.node.classList.remove(r.active)}},ft={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:r.Ks.Transform.toString(t)},{transform:r.Ks.Transform.toString(n)}]},sideEffects:pt({styles:{active:{opacity:"0"}}})};function ht(e){let{config:t,draggableNodes:n,droppableContainers:i,measuringConfiguration:o}=e;return(0,r._q)(((e,l)=>{if(null===t)return;const s=n.get(e);if(!s)return;const a=s.node.current;if(!a)return;const u=Ue(l);if(!u)return;const{transform:d}=(0,r.zk)(l).getComputedStyle(l),c=U(d);if(!c)return;const p="function"==typeof t?t:function(e){const{duration:t,easing:n,sideEffects:i,keyframes:o}={...ft,...e};return e=>{let{active:l,dragOverlay:r,transform:s,...a}=e;if(!t)return;const u={x:r.rect.left-l.rect.left,y:r.rect.top-l.rect.top},d={scaleX:1!==s.scaleX?l.rect.width*s.scaleX/r.rect.width:1,scaleY:1!==s.scaleY?l.rect.height*s.scaleY/r.rect.height:1},c={x:s.x-u.x,y:s.y-u.y,...d},p=o({...a,active:l,dragOverlay:r,transform:{initial:s,final:c}}),[f]=p,h=p[p.length-1];if(JSON.stringify(f)===JSON.stringify(h))return;const g=null==i?void 0:i({active:l,dragOverlay:r,...a}),m=r.node.animate(p,{duration:t,easing:n,fill:"forwards"});return new Promise((e=>{m.onfinish=()=>{null==g||g(),e()}}))}}(t);return J(a,o.draggable.measure),p({active:{id:e,data:s.data,node:a,rect:o.draggable.measure(a)},draggableNodes:n,dragOverlay:{node:l,rect:o.dragOverlay.measure(u)},droppableContainers:i,measuringConfiguration:o,transform:c})}))}let gt=0;function mt(e){return(0,i.useMemo)((()=>{if(null!=e)return gt++,gt}),[e])}const vt=o().memo((e=>{let{adjustScale:t=!1,children:n,dropAnimation:l,style:r,transition:s,modifiers:a,wrapperElement:u="div",className:d,zIndex:c=999}=e;const{activatorEvent:p,active:f,activeNodeRect:h,containerNodeRect:g,draggableNodes:m,droppableContainers:v,dragOverlay:b,over:y,measuringConfiguration:E,scrollableAncestors:_,scrollableAncestorRects:S,windowRect:C}=nt(),w=(0,i.useContext)(Ke),F=mt(null==f?void 0:f.id),I=Qe(a,{activatorEvent:p,active:f,activeNodeRect:h,containerNodeRect:g,draggingNodeRect:b.rect,over:y,overlayNodeRect:b.rect,scrollableAncestors:_,scrollableAncestorRects:S,transform:w,windowRect:C}),A=Re(h),R=ht({config:l,draggableNodes:m,droppableContainers:v,measuringConfiguration:E}),O=A?b.setRef:void 0;return o().createElement(at,null,o().createElement(rt,{animation:R},f&&F?o().createElement(ct,{key:F,id:f.id,ref:O,as:u,activatorEvent:p,adjustScale:t,className:d,transition:s,rect:A,style:{zIndex:c,...r},transform:I},n):null))}))},8831:function(e,t,n){"use strict";n.r(t),n.d(t,{createSnapModifier:function(){return o},restrictToFirstScrollableAncestor:function(){return a},restrictToHorizontalAxis:function(){return l},restrictToParentElement:function(){return s},restrictToVerticalAxis:function(){return u},restrictToWindowEdges:function(){return d},snapCenterToCursor:function(){return c}});var i=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 l=e=>{let{transform:t}=e;return{...t,y:0}};function r(e,t,n){const i={...e};return t.top+e.y<=n.top?i.y=n.top-t.top:t.bottom+e.y>=n.top+n.height&&(i.y=n.top+n.height-t.bottom),t.left+e.x<=n.left?i.x=n.left-t.left:t.right+e.x>=n.left+n.width&&(i.x=n.left+n.width-t.right),i}const s=e=>{let{containerNodeRect:t,draggingNodeRect:n,transform:i}=e;return n&&t?r(i,n,t):i},a=e=>{let{draggingNodeRect:t,transform:n,scrollableAncestorRects:i}=e;const o=i[0];return t&&o?r(n,t,o):n},u=e=>{let{transform:t}=e;return{...t,x:0}},d=e=>{let{transform:t,draggingNodeRect:n,windowRect:i}=e;return n&&i?r(t,n,i):t},c=e=>{let{activatorEvent:t,draggingNodeRect:n,transform:o}=e;if(n&&t){const e=(0,i.e_)(t);if(!e)return o;const l=e.x-n.left,r=e.y-n.top;return{...o,x:o.x+l-n.width/2,y:o.y+r-n.height/2}}return o}},4979:function(e,t,n){"use strict";n.d(t,{$$:function(){return h},Es:function(){return p},KG:function(){return m},Ks:function(){return I},Ll:function(){return r},Re:function(){return C},Sw:function(){return o},TW:function(){return c},WQ:function(){return S},YG:function(){return E},YN:function(){return g},ZC:function(){return b},_q:function(){return f},ag:function(){return R},e_:function(){return F},kx:function(){return w},l6:function(){return l},lk:function(){return v},sb:function(){return u},wz:function(){return a},xZ:function(){return d},zk:function(){return s}});var i=n(1594);const o="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function l(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function r(e){return"nodeType"in e}function s(e){var t,n;return e?l(e)?e:r(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function a(e){const{Document:t}=s(e);return e instanceof t}function u(e){return!l(e)&&e instanceof s(e).HTMLElement}function d(e){return e instanceof s(e).SVGElement}function c(e){return e?l(e)?e.document:r(e)?a(e)?e:u(e)||d(e)?e.ownerDocument:document:document:document}const p=o?i.useLayoutEffect:i.useEffect;function f(e){const t=(0,i.useRef)(e);return p((()=>{t.current=e})),(0,i.useCallback)((function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return null==t.current?void 0:t.current(...n)}),[])}function h(){const e=(0,i.useRef)(null);return[(0,i.useCallback)(((t,n)=>{e.current=setInterval(t,n)}),[]),(0,i.useCallback)((()=>{null!==e.current&&(clearInterval(e.current),e.current=null)}),[])]}function g(e,t){void 0===t&&(t=[e]);const n=(0,i.useRef)(e);return p((()=>{n.current!==e&&(n.current=e)}),t),n}function m(e,t){const n=(0,i.useRef)();return(0,i.useMemo)((()=>{const t=e(n.current);return n.current=t,t}),[...t])}function v(e){const t=f(e),n=(0,i.useRef)(null),o=(0,i.useCallback)((e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e}),[]);return[n,o]}function b(e){const t=(0,i.useRef)();return(0,i.useEffect)((()=>{t.current=e}),[e]),t.current}let y={};function E(e,t){return(0,i.useMemo)((()=>{if(t)return t;const n=null==y[e]?0:y[e]+1;return y[e]=n,e+"-"+n}),[e,t])}function _(e){return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return i.reduce(((t,n)=>{const i=Object.entries(n);for(const[n,o]of i){const i=t[n];null!=i&&(t[n]=i+e*o)}return t}),{...t})}}const S=_(1),C=_(-1);function w(e){if(!e)return!1;const{KeyboardEvent:t}=s(e.target);return t&&e instanceof t}function F(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=s(e.target);return t&&e instanceof t}(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 function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const I=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[I.Translate.toString(e),I.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:i}=e;return t+" "+n+"ms "+i}}}),A="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function R(e){return e.matches(A)?e:e.querySelector(A)}},9588:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(5207)),o=r(n(1991)),l=r(n(315));function r(e){return e&&e.__esModule?e:{default:e}}t.default=()=>{i.default.transform("move-form-disabled",(e=>{e.component("TreeDropdownField.AssetAdmin.MoveForm",l.default)})),i.default.transform("owner-unpublishing",(e=>{e.component("FormAction.AssetAdmin.EditForm.action_unpublish",o.default)}))}},2038:function(e,t,n){"use strict";var i=d(n(6177)),o=d(n(6194)),l=d(n(4736)),r=d(n(9588)),s=d(n(420)),a=d(n(4121)),u=n(5125);function d(e){return e&&e.__esModule?e:{default:e}}document.addEventListener("DOMContentLoaded",(()=>{(0,a.default)(),(0,r.default)();const e=i.default.getSection("SilverStripe\\AssetAdmin\\Controller\\AssetAdmin").reactRoutePath;o.default.add({path:"/",routes:[{path:(0,u.joinUrlPaths)(e,"show/:folderId/:viewAction/:fileId"),component:l.default},{path:(0,u.joinUrlPaths)(e,"show/:folderId/:viewAction"),component:l.default},{path:(0,u.joinUrlPaths)(e,"show/:folderId"),component:l.default},{path:e,component:l.default}]}),(0,s.default)()}))},4121:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=f(n(5207)),o=f(n(9725)),l=f(n(3058)),r=f(n(853)),s=f(n(6931)),a=f(n(3517)),u=f(n(2397)),d=f(n(9005)),c=f(n(6493)),p=n(1037);function f(e){return e&&e.__esModule?e:{default:e}}t.default=()=>{i.default.component.registerMany({UploadField:o.default,UploadFieldItem:l.default,PreviewImageField:a.default,HistoryList:d.default,ProportionConstraintField:u.default,AssetDropzone:r.default,InsertMediaModal:s.default,GalleryToolbar:c.default,GalleryItemFile:p.File,GalleryItemFolder:p.Folder})}},420:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=f(n(5207)),o=n(9367),l=f(n(8518)),r=f(n(8310)),s=f(n(2726)),a=f(n(7668)),u=f(n(5214)),d=f(n(2482)),c=f(n(9266)),p=f(n(8178));function f(e){return e&&e.__esModule?e:{default:e}}t.default=()=>{i.default.reducer.register("assetAdmin",(0,o.combineReducers)({gallery:l.default,queuedFiles:r.default,uploadField:s.default,previewField:a.default,imageLoad:u.default,displaySearch:d.default,confirmDeletion:c.default,modal:p.default}))}},853:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=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 i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&{}.hasOwnProperty.call(e,l)){var r=o?Object.getOwnPropertyDescriptor(e,l):null;r&&(r.get||r.set)?Object.defineProperty(i,l,r):i[l]=e[l]}return i.default=e,n&&n.set(e,i),i}(n(1594)),o=u(n(5815)),l=u(n(4600)),r=u(n(1669)),s=n(5716),a=u(n(6935));function u(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)}let c=0;class p extends i.Component{constructor(e){super(e),this.dropzone=null,this.dragging=!1,this.handleAccept=this.handleAccept.bind(this),this.handleAddedFile=this.handleAddedFile.bind(this),this.handleDragEnter=this.handleDragEnter.bind(this),this.handleDragLeave=this.handleDragLeave.bind(this),this.handleDrop=this.handleDrop.bind(this),this.handleUploadProgress=this.handleUploadProgress.bind(this),this.handleUploadComplete=this.handleUploadComplete.bind(this),this.handleError=this.handleError.bind(this),this.handleSending=this.handleSending.bind(this),this.handleSuccess=this.handleSuccess.bind(this),this.handleQueueComplete=this.handleQueueComplete.bind(this),this.loadImage=this.loadImage.bind(this),this.handleMaxFilesExceeded=this.handleMaxFilesExceeded.bind(this)}componentDidMount(){this.dropzone=new l.default(this.dropzoneRef,Object.assign({},this.getDefaultOptions(),this.props.options));const{name:e}=this.props;e&&this.dropzone.hiddenFileInput&&this.dropzone.hiddenFileInput.classList.add(`dz-input-${e}`),void 0!==this.props.promptOnRemove&&this.setPromptOnRemove(this.props.promptOnRemove)}componentDidUpdate(e){const{name:t}=this.props;t&&this.dropzone.hiddenFileInput&&this.dropzone.hiddenFileInput.classList.add(`dz-input-${t}`),this.props.canUpload&&e.options!==this.props.options&&this.dropzone&&(this.dropzone.enable(),this.dropzone.options=Object.assign({},this.getDefaultOptions(),this.dropzone.options,this.props.options))}componentWillUnmount(){this.dropzone.files=[],this.dropzone.destroy()}getDefaultOptions(){let e=null,t=this.props.uploadSelector;if(!t&&this.props.uploadButton&&(t=".asset-dropzone__upload-button"),t){const n=(0,r.default)(this.dropzoneRef).find(t);n&&n.length&&(e=n.toArray())}return{accept:this.handleAccept,addedfile:this.handleAddedFile,dragenter:this.handleDragEnter,dragleave:this.handleDragLeave,drop:this.handleDrop,maxfilesexceeded:this.handleMaxFilesExceeded,uploadprogress:this.handleUploadProgress,complete:this.handleUploadComplete,dictDefaultMessage:o.default._t("AssetAdmin.DROPZONE_DEFAULT_MESSAGE","Drop files here to upload"),dictFallbackMessage:o.default._t("AssetAdmin.DROPZONE_FALLBACK_MESSAGE","Your browser does not support drag'n'drop file uploads."),dictFallbackText:o.default._t("AssetAdmin.DROPZONE_FALLBACK_TEXT","Please use the fallback form below to upload your files like in the olden days."),dictInvalidFileType:o.default._t("AssetAdmin.DROPZONE_INVALID_FILE_TYPE","You can't upload files of this type."),dictResponseError:o.default._t("AssetAdmin.DROPZONE_RESPONSE_ERROR","Server responded with an error."),dictCancelUpload:o.default._t("AssetAdmin.DROPZONE_CANCEL_UPLOAD","Cancel upload"),dictCancelUploadConfirmation:o.default._t("AssetAdmin.DROPZONE_CANCEL_UPLOAD_CONFIRMATION","Are you sure you want to cancel this upload?"),dictRemoveFile:o.default._t("AssetAdmin.DROPZONE_REMOVE_FILE","Remove file"),dictMaxFilesExceeded:o.default._t("AssetAdmin.DROPZONE_MAX_FILES_EXCEEDED","You can not upload any more files."),error:this.handleError,sending:this.handleSending,success:this.handleSuccess,queuecomplete:this.handleQueueComplete,thumbnailHeight:150,thumbnailWidth:200,timeout:0,clickable:e}}getFileCategory(e){return e.split("/")[0]}getLoadPreview(e){return new Promise((t=>{const n=new FileReader;n.onload=n=>{if("image"===this.getFileCategory(e.type)){const e=new Image;t(this.loadImage(e,n.target.result))}else t({})},n.readAsDataURL(e)}))}getFileTitle(e){return e.replace(/[.][^.]+$/,"").replace(/-_/," ")}setPromptOnRemove(e){this.dropzone.options.dictRemoveFileConfirmation=e}handleDragEnter(e){this.props.canUpload&&(this.dragging=!0,this.forceUpdate(),"function"==typeof this.props.onDragEnter&&this.props.onDragEnter(e))}handleDragLeave(e){const t=this.dropzoneRef;this.props.canUpload&&e.target===t&&(this.dragging=!1,this.forceUpdate(),"function"==typeof this.props.onDragLeave&&this.props.onDragLeave(e,t))}handleUploadProgress(e,t,n){"function"==typeof this.props.onUploadProgress&&this.props.onUploadProgress(e,t,n)}handleUploadComplete(e){"function"==typeof this.props.onUploadComplete&&this.props.onUploadComplete(e.status)}handleDrop(e){this.dragging=!1,this.forceUpdate(),"function"==typeof this.props.onDrop&&this.props.onDrop(e)}handleSending(e,t,n){"function"==typeof this.props.updateFormData&&this.props.updateFormData(n),n.append("SecurityID",this.props.securityID),n.append("ParentID",this.props.folderId);const i=Object.assign({},t,{abort:()=>{this.dropzone.cancelUpload(e),t.abort()}});"function"==typeof this.props.onSending&&this.props.onSending(e,i,n)}handleMaxFilesExceeded(e){return"function"!=typeof this.props.onMaxFilesExceeded||this.props.onMaxFilesExceeded(e)}generateQueuedId(){return c+=1,c}handleAccept(e,t){return("function"!=typeof this.props.canFileUpload||this.props.canFileUpload(e))&&this.props.canUpload?t():t(o.default._t("AssetAdmin.DROPZONE_CANNOT_UPLOAD","Uploading not permitted."))}handleAddedFile(e){e._queuedId=this.generateQueuedId();const t={category:this.getFileCategory(e.type),filename:e.name,queuedId:e._queuedId,size:e.size,title:this.getFileTitle(e.name),extension:(0,s.getFileExtension)(e.name),type:e.type,uploadedToFolderId:this.props.folderId};this.props.onAddedFile(t);return this.getLoadPreview(e).then((e=>{const n={height:e.height,width:e.width,url:e.thumbnailURL,thumbnail:e.thumbnailURL,smallThumbnail:e.thumbnailURL};return"function"==typeof this.props.onPreviewLoaded&&this.props.onPreviewLoaded(t,n),{...t,...n}}))}loadImage(e,t){return new Promise((n=>{const i=document.createElement("canvas"),o=i.getContext("2d");e.onload=()=>{const t=2*this.props.preview.width,l=2*this.props.preview.height,r=e.naturalWidth/e.naturalHeight;e.naturalWidth<t||e.naturalHeight<l?(i.width=e.naturalWidth,i.height=e.naturalHeight):r<1?(i.width=t,i.height=t/r):(i.width=l*r,i.height=l),o.drawImage(e,0,0,i.width,i.height);const s=i.toDataURL("image/png");n({width:e.naturalWidth,height:e.naturalHeight,thumbnailURL:s})},e.src=t}))}handleError(e,t){this.dropzone.removeFile(e),this.props.onError(e,t)}handleSuccess(e){this.dropzone.removeFile(e),this.props.onSuccess(e)}handleQueueComplete(){this.props.onQueueComplete&&this.props.onQueueComplete()}render(){const e=["asset-dropzone"];this.props.className&&e.push(this.props.className);const t={className:"asset-dropzone__upload-button ss-ui-button font-icon-upload",type:"button"};return this.props.canUpload||(t.disabled=!0),!0===this.dragging&&e.push("dragging"),i.default.createElement("div",{className:e.join(" "),ref:e=>{this.dropzoneRef=e}},this.props.uploadButton&&i.default.createElement("button",t,o.default._t("AssetAdmin.DROPZONE_UPLOAD")),this.props.children)}}p.propTypes={folderId:a.default.number.isRequired,onAccept:a.default.func,onAddedFile:a.default.func.isRequired,onDragEnter:a.default.func,onDragLeave:a.default.func,onDrop:a.default.func,onError:a.default.func.isRequired,onPreviewLoaded:a.default.func,onSending:a.default.func,onSuccess:a.default.func.isRequired,onMaxFilesExceeded:a.default.func,updateFormData:a.default.func,canFileUpload:a.default.func,onQueueComplete:a.default.func,options:a.default.shape({url:a.default.string.isRequired}),promptOnRemove:a.default.string,securityID:a.default.string.isRequired,uploadButton:a.default.bool,uploadSelector:a.default.string,canUpload:a.default.bool.isRequired,preview:a.default.shape({width:a.default.number,height:a.default.number}),className:a.default.string},p.defaultProps={uploadButton:!0};t.default=p},7153:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var i=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 i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&{}.hasOwnProperty.call(e,l)){var r=o?Object.getOwnPropertyDescriptor(e,l):null;r&&(r.get||r.set)?Object.defineProperty(i,l,r):i[l]=e[l]}return i.default=e,n&&n.set(e,i),i}(n(1594)),o=a(n(6935)),l=a(n(2932)),r=a(n(2926)),s=a(n(5815));function a(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)}class d extends i.Component{render(){const{isDropping:e,badge:t,onClick:n}=this.props,o=["btn","btn-secondary","btn--no-text","font-icon-level-up","btn--icon-large","gallery__back"];e&&(o.push("z-depth-1"),o.push("gallery__back--droppable-hover"));const l=t?i.default.createElement(r.default,{className:"gallery__back-badge",status:t.status,message:t.message}):null;return i.default.createElement("button",{className:o.join(" "),title:s.default._t("AssetAdmin.BACK_DESCRIPTION","Navigate up a level"),onClick:n},l)}}t.Component=d,d.propTypes={onClick:o.default.func,isDropping:o.default.bool,badge:o.default.shape(r.default.propTypes)};t.default=(0,l.default)(d)},3229:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var i=c(n(5815)),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=d(t);if(n&&n.has(e))return n.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&{}.hasOwnProperty.call(e,l)){var r=o?Object.getOwnPropertyDescriptor(e,l):null;r&&(r.get||r.set)?Object.defineProperty(i,l,r):i[l]=e[l]}return i.default=e,n&&n.set(e,i),i}(n(1594)),l=n(9040),r=n(5207),s=n(3556),a=c(n(6923)),u=c(n(6935));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)}function c(e){return e&&e.__esModule?e:{default:e}}class p extends o.Component{constructor(e){super(e),this.handleChangeValue=this.handleChangeValue.bind(this),this.renderChild=this.renderChild.bind(this)}getOptionByValue(e){return this.props.actions.find((t=>t.value===e))}handleChangeValue(e){let t=null;const n=this.getOptionByValue(e.target.value);return null===n?null:(t="function"==typeof n.confirm?n.confirm(this.props.items).then((()=>n.callback(e,this.props.items))).catch((e=>{if("cancelled"!==e)throw e})):n.callback(e,this.props.items)||Promise.resolve(),t)}renderChild(e,t){const n=(0,a.default)("bulk-actions__action",e.className||"font-icon-info-circled",{btn:t<2,"bulk-actions__action--more":t>2});return t<2?o.default.createElement(s.Button,{className:n,key:e.value,onClick:this.handleChangeValue,value:e.value,color:e.color},e.label):o.default.createElement(s.DropdownItem,{type:"button",className:n,key:e.value,onClick:this.handleChangeValue,value:e.value},e.label)}render(){if(!this.props.items.length)return null;let e=this.props.actions.filter((e=>!e.canApply||e.canApply(this.props.items)));if(e=e.map(this.renderChild),!e.length)return null;const{ActionMenu:t,showCount:n}=this.props,l=i.default._t("AssetAdmin.BULK_ACTIONS_SELECT_ALL","Select all"),r=i.default.sprintf(i.default._t("AssetAdmin.BULK_ACTIONS_SELECTED","%s selected"),this.props.items.length),a=i.default._t("AssetAdmin.BULK_ACTIONS_CLEAR_SELECTION","Clear selection");return o.default.createElement("div",{className:"bulk-actions fieldholder-small"},n&&o.default.createElement(o.default.Fragment,null,o.default.createElement(s.Button,{className:"bulk-actions-counter font-icon-cross-mark",onClick:this.props.onClearSelection,title:a},r),o.default.createElement("div",{className:"bulk-actions-select-all"},o.default.createElement(s.Button,{onClick:this.props.onSelectAll},l))),e.slice(0,2),e.length>2&&t?o.default.createElement(t,{id:"BulkActions",className:"bulk-actions__more-actions-menu"},e.slice(2)):e.slice(2))}}t.Component=p,p.propTypes={items:u.default.array,actions:u.default.arrayOf(u.default.shape({value:u.default.string.isRequired,label:u.default.string.isRequired,className:u.default.string,destructive:u.default.bool,callback:u.default.func,canApply:u.default.func,confirm:u.default.func})),ActionMenu:u.default.elementType,showCount:u.default.bool,onClearSelection:u.default.func.isRequired,onSelectAll:u.default.func.isRequired},p.defaultProps={items:[],actions:[],ActionMenu:null,total:null,showCount:!0,totalReachedMessage:i.default._t("")};const f=(0,l.connect)((function(e){return{gallery:e.assetAdmin.gallery}}))(p);t.default=(0,r.inject)(["ActionMenu"],(e=>({ActionMenu:e})),(()=>"BulkActions"))(f)},1037:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Folder=t.File=t.Component=void 0;var i=E(n(5815)),o=y(n(1594)),l=E(n(6923)),r=E(n(6379)),s=E(n(6022)),a=E(n(2063)),u=E(n(2932)),d=E(n(2926)),c=E(n(1990)),p=E(n(4350)),f=n(9040),h=n(9367),g=y(n(769)),m=E(n(1838)),v=E(n(6935));function b(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(b=function(e){return e?n:t})(e)}function y(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=b(t);if(n&&n.has(e))return n.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&{}.hasOwnProperty.call(e,l)){var r=o?Object.getOwnPropertyDescriptor(e,l):null;r&&(r.get||r.set)?Object.defineProperty(i,l,r):i[l]=e[l]}return i.default=e,n&&n.set(e,i),i}function E(e){return e&&e.__esModule?e:{default:e}}function _(){return _=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},_.apply(null,arguments)}function S(e){return e.item.thumbnail&&"image"===e.item.category&&e.item.exists&&!e.item.queuedId&&e.sectionConfig.imageRetry.minRetry&&e.sectionConfig.imageRetry.maxRetry}const C=e=>{e.preventDefault()};class w extends o.Component{constructor(e){super(e),this.handleSelect=this.handleSelect.bind(this),this.handleActivate=this.handleActivate.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancelUpload=this.handleCancelUpload.bind(this)}componentDidUpdate(){S(this.props)&&this.props.actions.imageLoad.loadImage(this.props.item.thumbnail,this.props.sectionConfig.imageRetry)}getThumbnailStyles(){const{item:{thumbnail:e,version:t},bustCache:n}=this.props;if(!this.isImage()||!e||this.missing())return{};const i=!1===n||!t||e.startsWith("data:image/")?e:`${e}?vid=${t}`;switch(this.props.loadState){case m.default.SUCCESS:case m.default.DISABLED:return{backgroundImage:`url(${i})`};default:return{}}}getErrorMessage(){let e=null;const{item:t,loadState:n}=this.props;if(this.hasError()?e=t.message.value:this.missing()?e=i.default._t("AssetAdmin.FILE_MISSING","File cannot be found"):n===m.default.FAILED&&(e=i.default._t("AssetAdmin.FILE_LOAD_ERROR","Thumbnail not available")),null!==e){return e=this.getItemFunction("updateErrorMessage")(e,this.props),o.default.createElement("span",{className:"gallery-item__error-message"},e)}return null}getThumbnailClassNames(){const e=["gallery-item__thumbnail"];switch(this.isImageSmallerThanThumbnail()&&e.push("gallery-item__thumbnail--small"),!this.props.item.thumbnail&&this.isImage()&&e.push("gallery-item__thumbnail--no-preview"),"folder"===this.props.item.type&&e.push("gallery-item__thumbnail--folder"),this.props.loadState){case m.default.LOADING:case m.default.WAITING:e.push("gallery-item__thumbnail--loading");break;case m.default.FAILED:e.push("gallery-item__thumbnail--error")}return e.join(" ")}getItemClassNames(){const e=this.props.item.category||"false",t=this.props.selectable&&(this.props.item.selected||this.props.isDragging);return(0,l.default)({"gallery-item":!0,[`gallery-item--${e}`]:!0,"gallery-item--max-selected":this.props.maxSelected&&!t,"gallery-item--missing":this.missing(),"gallery-item--selectable":this.props.selectable,"gallery-item--selected":t,"gallery-item--dropping":this.props.isDropping,"gallery-item--highlighted":this.props.item.highlighted,"gallery-item--error":this.hasError(),"gallery-item--dragging":this.props.isDragging})}getItemFunction(e){const{item:t}=this.props;return"function"==typeof t[e]?t[e]:this.props[e]}getStatusFlags(){let e=[];const{item:t}=this.props;"folder"!==t.type&&(t.draft?e.push({key:"status-draft",title:i.default._t("File.DRAFT","Draft"),className:"gallery-item--draft"}):t.modified&&e.push({key:"status-modified",title:i.default._t("File.MODIFIED","Modified"),className:"gallery-item--modified"}));return e=this.getItemFunction("updateStatusFlags")(e,this.props),o.default.createElement("div",{className:"gallery-item__status-flags"},e.map((e=>o.default.createElement("span",e))))}getStatusIcons(){const{item:e}=this.props,t=[];return e.hasRestrictedAccess&&t.push({key:"status-restricted",fileID:e.id,hasRestrictedAccess:!0,placement:"top",disableTooltip:"folder"===e.type,includeBackground:"folder"!==e.type}),e.isTrackedFormUpload&&"folder"!==e.type&&t.push({key:"status-tracked-form-upload",fileID:e.id,isTrackedFormUpload:!0,hasRestrictedAccess:e.hasRestrictedAccess,placement:"top",includeBackground:!0}),o.default.createElement("div",{className:"gallery-item__status-icons"},t.map((e=>o.default.createElement(c.default,e))))}getProgressBar(){let e=null;const{item:t}=this.props,n={className:"gallery-item__progress-bar",style:{width:`${t.progress}%`}};this.hasError()||!this.uploading()||this.complete()||(e=o.default.createElement("div",{className:"gallery-item__upload-progress"},o.default.createElement("div",n)));return e=this.getItemFunction("updateProgressBar")(e,this.props),e}isImageSmallerThanThumbnail(){if(!this.isImage()||this.missing())return!1;const e=this.props.item.width,t=this.props.item.height;return t&&e&&t<r.default.THUMBNAIL_HEIGHT&&e<r.default.THUMBNAIL_WIDTH}complete(){return this.props.item.queuedId&&this.saved()}saved(){return this.props.item.id>0}missing(){return!this.exists()&&this.saved()}uploading(){return this.props.item.queuedId&&!this.saved()}exists(){return this.props.item.exists}isImage(){return"image"===this.props.item.category}canBatchSelect(){return this.props.selectable&&this.props.item.canEdit}hasError(){let e=!1;return this.props.item.message&&(e="error"===this.props.item.message.type),e}handleActivate(e){e.stopPropagation(),"function"==typeof this.props.onActivate&&this.saved()&&this.props.onActivate(e,this.props.item)}handleSelect(e){e.stopPropagation(),e.preventDefault(),"function"==typeof this.props.onSelect&&this.props.onSelect(e,this.props.item)}handleKeyDown(e){r.default.SPACE_KEY_CODE===e.keyCode&&(e.preventDefault(),this.canBatchSelect()&&this.handleSelect(e)),r.default.RETURN_KEY_CODE===e.keyCode&&this.handleActivate(e)}handleCancelUpload(e){e.stopPropagation(),e.preventDefault(),this.hasError()?this.props.onRemoveErroredUpload(this.props.item):this.props.onCancelUpload&&this.props.onCancelUpload(this.props.item)}render(){let e=null,t=null,n=null;const{id:l,queuedId:r}=this.props.item,s=l?`item-${l}`:`queued-${r}`;if(this.props.selectable&&(this.canBatchSelect()&&(e=this.handleSelect),t="font-icon-tick"),this.uploading())e=this.handleCancelUpload,t="font-icon-cancel";else if(this.exists()){const e=i.default._t("AssetAdmin.VIEW","View");n=o.default.createElement("div",{className:"gallery-item--overlay font-icon-eye"},e)}const a=this.props.badge,u={className:"gallery-item__checkbox",type:"checkbox",title:i.default._t("AssetAdmin.SELECT","Select"),tabIndex:-1,onMouseDown:C,id:s},c=["gallery-item__checkbox-label","form-label",t];this.canBatchSelect()||(u.disabled=!0,c.push("gallery-item__checkbox-label--disabled"));const p={className:c.join(" "),onClick:e};return o.default.createElement("div",{className:this.getItemClassNames(),"data-id":this.props.item.id,tabIndex:0,role:"button",onKeyDown:this.handleKeyDown,onClick:this.handleActivate},!!a&&o.default.createElement(d.default,{className:"gallery-item__badge",status:a.status,message:a.message}),o.default.createElement("div",{ref:e=>{this.thumbnail=e},className:this.getThumbnailClassNames(),style:this.getThumbnailStyles()},n,this.getStatusFlags(),this.getStatusIcons()),this.getProgressBar(),this.getErrorMessage(),this.props.children,o.default.createElement("div",{className:"gallery-item__title","data-draggable":"true",ref:e=>{this.title=e}},o.default.createElement("label",_({},p,{htmlFor:s}),o.default.createElement("input",u)),this.props.item.title))}}t.Component=w,w.propTypes={sectionConfig:p.default,item:s.default,loadState:v.default.oneOf(Object.values(m.default)),bustCache:v.default.bool,highlighted:v.default.bool,selected:v.default.bool,isDropping:v.default.bool,isDragging:v.default.bool,message:v.default.shape({value:v.default.string,type:v.default.string}),selectable:v.default.bool,onActivate:v.default.func,onSelect:v.default.func,onCancelUpload:v.default.func,onRemoveErroredUpload:v.default.func,badge:v.default.shape({status:v.default.string,message:v.default.string}),updateStatusFlags:v.default.func,updateProgressBar:v.default.func,updateErrorMessage:v.default.func},w.defaultProps={item:{},sectionConfig:{imageRetry:{}},updateStatusFlags:e=>e,updateProgressBar:e=>e,updateErrorMessage:e=>e,bustCache:!0};const F=(0,f.connect)((function(e,t){const{bustCache:n}=e.config.sections.find((e=>"SilverStripe\\AssetAdmin\\Controller\\AssetAdmin"===e.name));let i=m.default.DISABLED;if(S(t)){const n=e.assetAdmin.imageLoad.files.find((e=>t.item.thumbnail===e.url));i=n&&n.status||m.default.NONE}return{bustCache:n,loadState:i}}),(function(e){return{actions:{imageLoad:(0,h.bindActionCreators)(g,e)}}}))(w),I=t.File=(0,a.default)(F);t.Folder=(0,u.default)(I);t.default=F},2914:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=s(n(1594)),o=s(n(6935)),l=s(n(2926)),r=s(n(1037));function s(e){return e&&e.__esModule?e:{default:e}}function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},a.apply(null,arguments)}function u(e){const{draggingItems:t,draggingItemProps:n}=e,o=t.length,s=[o>1?i.default.createElement("div",{key:"1",className:"gallery-item__drag-shadow"}):null,o>2?i.default.createElement("div",{key:"2",className:"gallery-item__drag-shadow gallery-item__drag-shadow--second"}):null];return i.default.createElement("div",{className:"gallery-item__drag-layer"},i.default.createElement("div",{className:"gallery-item__drag-layer-preview"},s,i.default.createElement(r.default,a({},n,{isDragging:!0})),o>1&&i.default.createElement(l.default,{className:"gallery-item__drag-layer-count",status:"info",message:`${o}`})))}u.propTypes={draggingItems:o.default.arrayOf(o.default.number).isRequired,draggingItemProps:o.default.object.isRequired};t.default=u},2063:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){function t(t){const n="boolean"!=typeof t.canDrag||t.canDrag,{attributes:o,listeners:r,setNodeRef:a}=(0,l.useDraggable)({disabled:!n,id:t.item.id,data:{props:t}}),u=i.default.createElement(e,t);return i.default.createElement("div",s({className:"gallery-item__draggable","data-draggable":"true",ref:a},r,o),u)}return t.propTypes={item:o.default.shape({id:o.default.number.isRequired}).isRequired,canDrag:o.default.bool},t};var i=r(n(1594)),o=r(n(6935)),l=n(3375);function r(e){return e&&e.__esModule?e:{default:e}}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},s.apply(null,arguments)}},2932:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){function t(t){const{active:n}=(0,l.useDndContext)(),o=t.item.selected||t.item.id===n?.id,{setNodeRef:r,isOver:a}=(0,l.useDroppable)({id:t.item.id,disabled:o}),u=i.default.createElement(e,s({isDropping:a},t));return i.default.createElement("div",{ref:r,className:"gallery-item__droppable"},u)}return t.propTypes={item:o.default.shape({id:o.default.number.isRequired}).isRequired},t};var i=r(n(1594)),o=r(n(6935)),l=n(3375);function r(e){return e&&e.__esModule?e:{default:e}}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},s.apply(null,arguments)}},7847:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=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 i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&{}.hasOwnProperty.call(e,l)){var r=o?Object.getOwnPropertyDescriptor(e,l):null;r&&(r.get||r.set)?Object.defineProperty(i,l,r):i[l]=e[l]}return i.default=e,n&&n.set(e,i),i}(n(1594)),o=r(n(6935)),l=r(n(5815));function r(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 a extends i.Component{constructor(){super(),this.handleCreateFolder=this.handleCreateFolder.bind(this)}handleCreateFolder(e){const{onCreateFolder:t}=this.props;e.preventDefault(),"function"==typeof t&&t()}render(){const{canEdit:e}=this.props;return i.default.createElement("button",{id:"add-folder-button",className:"btn btn-secondary font-icon-folder-add btn--icon-xl",type:"button",onClick:this.handleCreateFolder,disabled:!e},i.default.createElement("span",{className:"btn__text btn__title"},l.default._t("AssetAdmin.ADD_FOLDER_BUTTON")))}}a.propTypes={canEdit:o.default.bool.isRequired,onCreateFolder:o.default.func.isRequired};t.default=a},3577:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=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 i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&{}.hasOwnProperty.call(e,l)){var r=o?Object.getOwnPropertyDescriptor(e,l):null;r&&(r.get||r.set)?Object.defineProperty(i,l,r):i[l]=e[l]}return i.default=e,n&&n.set(e,i),i}(n(1594)),o=r(n(6935)),l=r(n(7153));function r(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 a extends i.Component{constructor(e){super(e),this.handleBackClick=this.handleBackClick.bind(this)}handleBackClick(e){const{onOpenFolder:t,folder:n}=this.props;e.preventDefault(),"function"==typeof t&&t(n.parentId)}render(){const{folder:e,badges:t,BackComponent:n}=this.props,{parentId:o}=e;if(null===o)return null;const l=t.find((e=>e.id===o));return i.default.createElement("div",{className:"gallery__back-container"},i.default.createElement(n,{item:{id:o},onClick:this.handleBackClick,badge:l}))}}a.propTypes={folder:o.default.shape({id:o.default.number,title:o.default.string,parentId:o.default.number,canView:o.default.bool,canEdit:o.default.bool}).isRequired,badges:o.default.arrayOf(o.default.shape({id:o.default.number,message:o.default.node,status:o.default.string})).isRequired,onOpenFolder:o.default.func.isRequired,BackComponent:o.default.oneOfType([o.default.object,o.default.func])},a.defaultProps={BackComponent:l.default};t.default=a},1859:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=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 i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&{}.hasOwnProperty.call(e,l)){var r=o?Object.getOwnPropertyDescriptor(e,l):null;r&&(r.get||r.set)?Object.defineProperty(i,l,r):i[l]=e[l]}return i.default=e,n&&n.set(e,i),i}(n(1594)),o=r(n(5815)),l=r(n(6935));function r(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 a extends i.Component{render(){const{canEdit:e}=this.props;return i.default.createElement("button",{id:"upload-button",className:"btn btn-secondary font-icon-upload btn--icon-xl",type:"button",disabled:!e},i.default.createElement("span",{className:"btn__text btn__title"},o.default._t("AssetAdmin.DROPZONE_UPLOAD")))}}a.defaultProps={canEdit:l.default.func.isRequired};t.default=a},6493:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var i=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 i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&{}.hasOwnProperty.call(e,l)){var r=o?Object.getOwnPropertyDescriptor(e,l):null;r&&(r.get||r.set)?Object.defineProperty(i,l,r):i[l]=e[l]}return i.default=e,n&&n.set(e,i),i}(n(1594)),o=u(n(6935)),l=n(9040),r=u(n(3577)),s=u(n(1859)),a=u(n(7847));function u(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)}class c extends i.Component{constructor(e){super(e),this.handleSelectSort=this.handleSelectSort.bind(this),this.handleViewChange=this.handleViewChange.bind(this)}handleSelectSort(e){this.props.onSort(e.currentTarget.value)}handleViewChange(e){const t=e.currentTarget.value;this.props.onViewChange(t)}renderSort(){return"tile"!==this.props.view?null:i.default.createElement("div",{className:"gallery__sort fieldholder-small"},i.default.createElement("select",{className:"dropdown no-change-track no-chzn",tabIndex:"0",style:{width:"160px"},defaultValue:this.props.sort},this.props.sorters.map((e=>{const t=e.label.replace(/^\w|[\s\-]+\w/g,(e=>e.toUpperCase()));return i.default.createElement("option",{key:`${e.field}-${e.direction}`,onClick:this.handleSelectSort,"data-field":e.field,"data-direction":e.direction,value:`${e.field},${e.direction}`},t)}))))}renderViewChangeButtons(){return["tile","table"].map((e=>{const t="table"===e?"list":"thumbnails",n=["gallery__view-change-button","btn btn-secondary","btn--icon-sm","btn--no-text"];return e===this.props.view?null:(n.push(`font-icon-${t}`),i.default.createElement("button",{id:`button-view-${e}`,key:e,className:n.join(" "),type:"button",title:"Change view gallery/list",onClick:this.handleViewChange,value:e}))}))}render(){const{badges:e,children:t,folder:n,onOpenFolder:o,onCreateFolder:l,BackButton:r,UploadButton:s,AddFolderButton:a}=this.props,{canEdit:u}=n;return i.default.createElement("div",{className:"toolbar--content toolbar--space-save"},i.default.createElement("div",{className:"fill-width"},i.default.createElement("div",{className:"gallery__btn-toolbar flexbox-area-grow"},i.default.createElement("div",{className:"btn-toolbar"},i.default.createElement(r,{folder:n,badges:e,onOpenFolder:o}),i.default.createElement(s,{canEdit:u}),i.default.createElement(a,{canEdit:u,onCreateFolder:l}),t)),i.default.createElement("div",{className:"gallery__state-buttons"},this.renderSort(),i.default.createElement("div",{className:"btn-group",role:"group","aria-label":"View mode"},this.renderViewChangeButtons()))))}}t.Component=c,c.propTypes={onCreateFolder:o.default.func.isRequired,onViewChange:o.default.func.isRequired,onOpenFolder:o.default.func.isRequired,onSort:o.default.func.isRequired,folder:o.default.shape({id:o.default.number,title:o.default.string,parentId:o.default.number,canView:o.default.bool,canEdit:o.default.bool}).isRequired,view:o.default.oneOf(["tile","table"]),sort:o.default.string,badges:o.default.arrayOf(o.default.shape({id:o.default.number,message:o.default.node,status:o.default.string})),BackButton:o.default.elementType,UploadButton:o.default.elementType,AddFolderButton:o.default.elementType},c.defaultProps={view:"tile",BackButton:r.default,UploadButton:s.default,AddFolderButton:a.default};t.default=(0,l.connect)((function(e,t){let{sort:n}=t;const{badges:i,sorters:o}=e.assetAdmin.gallery;return""===n&&(n=`${o[0].field},${o[0].direction}`),{badges:i,sorters:o,sort:n}}))(c)},4333:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var i=f(n(5815)),o=p(n(1594)),l=n(9367),r=n(9040),s=f(n(8737)),a=p(n(2811)),u=f(n(6935)),d=n(5125);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)}function p(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 i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&{}.hasOwnProperty.call(e,l)){var r=o?Object.getOwnPropertyDescriptor(e,l):null;r&&(r.get||r.set)?Object.defineProperty(i,l,r):i[l]=e[l]}return i.default=e,n&&n.set(e,i),i}function f(e){return e&&e.__esModule?e:{default:e}}class h extends o.Component{constructor(e){super(e),this.handleSubmit=this.handleSubmit.bind(this)}componentDidMount(){this.setOverrides(this.props)}componentDidUpdate(e){this.props.isOpen&&!e.isOpen&&this.setOverrides(this.props)}componentWillUnmount(){this.clearOverrides()}setOverrides(e){if(this.props.schemaUrl!==e.schemaUrl&&this.clearOverrides(),e.schemaUrl){const t=Object.assign({},e.fileAttributes);delete t.ID;const n={fields:Object.entries(t).map((e=>{const[t,n]=e;return{name:t,value:n}}))};this.props.actions.schema.setSchemaStateOverrides(e.schemaUrl,n)}}getModalProps(){const e=Object.assign({onSubmit:this.handleSubmit,onLoadingError:this.handleLoadingError,showErrorMessage:!0,responseClassBad:"alert alert-danger",identifier:"AssetAdmin.InsertEmbedModal"},this.props,{className:`insert-embed-modal ${this.props.className}`,size:"lg",onClosed:this.props.onClosed,title:this.props.targetUrl?i.default._t("AssetAdmin.EditTitle","Media from the web"):i.default._t("AssetAdmin.CreateTitle","Insert new media from the web")});return delete e.sectionConfig,delete e.onInsert,delete e.fileAttributes,e}clearOverrides(){this.props.actions.schema.setSchemaStateOverrides(this.props.schemaUrl,null)}handleLoadingError(e){"function"==typeof this.props.onLoadingError&&this.props.onLoadingError(e)}handleSubmit(e,t){switch(t){case"action_addmedia":this.props.onCreate(e);break;case"action_insertmedia":this.props.onInsert(e);break;case"action_cancel":this.props.onClosed()}return Promise.resolve()}render(){const{FormBuilderModalComponent:e}=this.props;return o.default.createElement(e,this.getModalProps())}}t.Component=h,h.propTypes={sectionConfig:u.default.shape({url:u.default.string,form:u.default.object}),isOpen:u.default.bool,onInsert:u.default.func.isRequired,onCreate:u.default.func.isRequired,fileAttributes:u.default.shape({Url:u.default.string,CaptionText:u.default.string,PreviewUrl:u.default.string,Placement:u.default.string,Width:u.default.number,Height:u.default.number}),onClosed:u.default.func.isRequired,className:u.default.string,actions:u.default.object,schemaUrl:u.default.string.isRequired,targetUrl:u.default.string,onLoadingError:u.default.func,FormBuilderModalComponent:u.default.oneOfType([u.default.object,u.default.func])},h.defaultProps={className:"",fileAttributes:{},FormBuilderModalComponent:s.default};t.default=(0,r.connect)((function(e,t){const n=e.config.sections.find((e=>"SilverStripe\\AssetAdmin\\Controller\\AssetAdmin"===e.name)),i=t.fileAttributes?t.fileAttributes.Url:"",o=n.form.remoteEditForm.schemaUrl,l=i&&(0,d.joinUrlPaths)(o,`/?embedurl=${encodeURIComponent(i)}`),r=n.form.remoteCreateForm.schemaUrl;return{sectionConfig:n,schemaUrl:l||r,targetUrl:i}}),(function(e){return{actions:{schema:(0,l.bindActionCreators)(a,e)}}}))(h)},3517:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var i=y(n(5815)),o=b(n(1594)),l=y(n(853)),r=y(n(6379)),s=n(9040),a=n(9367),u=n(5381),d=b(n(8795)),c=n(5716),p=y(n(3432)),f=y(n(6923)),h=y(n(6935)),g=y(n(7008)),m=y(n(7675));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 i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&{}.hasOwnProperty.call(e,l)){var r=o?Object.getOwnPropertyDescriptor(e,l):null;r&&(r.get||r.set)?Object.defineProperty(i,l,r):i[l]=e[l]}return i.default=e,n&&n.set(e,i),i}function y(e){return e&&e.__esModule?e:{default:e}}class E extends o.Component{constructor(e){super(e),this.handleAddedFile=this.handleAddedFile.bind(this),this.handleFailedUpload=this.handleFailedUpload.bind(this),this.handleSuccessfulUpload=this.handleSuccessfulUpload.bind(this),this.handleSending=this.handleSending.bind(this),this.handleUploadProgress=this.handleUploadProgress.bind(this),this.handleUploadComplete=this.handleUploadComplete.bind(this),this.handleCancelUpload=this.handleCancelUpload.bind(this),this.handleRemoveErroredUpload=this.handleRemoveErroredUpload.bind(this),this.canFileUpload=this.canFileUpload.bind(this),this.updateFormData=this.updateFormData.bind(this),this.cacheBustUrl=this.cacheBustUrl.bind(this)}componentDidUpdate(e){(e.data.url&&this.props.data.url!==e.data.url||e.data.version&&this.props.data.version!==e.data.version)&&this.props.actions.previewField.removeFile(e.id)}componentWillUnmount(){this.props.actions.previewField.removeFile(this.props.id)}getDropzoneProps(){const e=this.props.data.uploadFileEndpoint,t=this.props.name,n={url:e&&e.url,method:e&&e.method,paramName:"Upload",clickable:!0,maxFiles:1},i={height:r.default.THUMBNAIL_HEIGHT,width:r.default.THUMBNAIL_WIDTH},o=this.props.securityID;return{name:t,className:["asset-dropzone--button","preview-image-field__container",this.props.className,this.props.extraClass].join(" "),canUpload:e&&this.canEdit(),preview:i,folderId:this.props.data.parentid,options:n,securityID:o,uploadButton:!1,onAddedFile:this.handleAddedFile,onError:this.handleFailedUpload,onSuccess:this.handleSuccessfulUpload,onSending:this.handleSending,onUploadProgress:this.handleUploadProgress,onUploadComplete:this.handleUploadComplete,canFileUpload:this.canFileUpload,updateFormData:this.updateFormData}}getButtonClasses(e){return(0,f.default)([`preview-image-field__toolbar-button--${e}`,"preview-image-field__toolbar-button"])}updateFormData(e){e.append("ID",this.props.data.id),e.append("Name",this.props.nameValue)}handleSending(e,t){this.props.actions.previewField.updateFile(this.props.id,{xhr:t})}handleSuccessfulUpload(e){const t=JSON.parse(e.xhr.response);"function"==typeof this.props.onAutofill&&(this.props.onAutofill("FileFilename",t.Filename),this.props.onAutofill("FileHash",t.Hash),this.props.onAutofill("FileVariant",t.Variant),t.Name&&this.props.onAutofill(this.props.data.nameField,t.Name))}handleFailedUpload(e,t){this.props.actions.previewField.failUpload(this.props.id,t)}handleAddedFile(e){this.props.actions.previewField.addFile(this.props.id,e)}handleRemoveErroredUpload(){if("function"==typeof this.props.onAutofill){const e=this.props.data.initialValues;this.props.onAutofill("FileFilename",e.FileFilename),this.props.onAutofill("FileHash",e.FileHash),this.props.onAutofill("FileVariant",e.FileVariant)}this.props.actions.previewField.removeFile(this.props.id)}handleCancelUpload(){this.props.upload.xhr&&this.props.upload.xhr.abort(),this.handleRemoveErroredUpload()}canFileUpload(e){const t=this.props.data.initialValues.FileFilename,n=(0,c.getFileExtension)(t),o=(0,c.getFileExtension)(e.name);if(!n||n===o)return!0;const l=i.default._t("AssetAdmin.CONFIRM_CHANGE_EXTENSION","Are you sure you want upload a file with a different extension?");return this.props.confirm(l)}preventDefault(e){e.preventDefault()}canEdit(){return!this.props.readOnly&&!this.props.disabled&&"folder"!==this.props.data.category}handleUploadProgress(e,t){this.props.actions.previewField.updateFile(this.props.id,{progress:t})}handleUploadComplete(e){this.props.actions.previewField.updateStatus(this.props.id,{status:e})}preview(e,t,n){if(e&&"image"!==e)return r.default.DEFAULT_PREVIEW;const i=t.url||n.preview||n.url;if(i){return i.startsWith("data:image/")?i:this.cacheBustUrl(i,n.version)}return null}cacheBustUrl(e){const t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"")||this.props.data.version;if(!1===this.props.bustCache||!t)return e;const n=g.default.parse(e),i={...m.default.parse(n.query),vid:t};return g.default.format({...n,search:m.default.stringify(i)})}renderImage(){const{data:e,upload:t}=this.props;if(!e.mock&&!e.exists&&!t.url)return o.default.createElement("div",{className:"editor__file-preview-message--file-missing"},i.default._t("AssetAdmin.FILE_MISSING","File cannot be found"));const{category:n,progress:l,message:r}=t,s=t.errors?t.errors[0]:null,a=t.status?t.status:null,u=this.preview(n,t,e),d=o.default.createElement("img",{alt:"preview",src:u,className:"editor__thumbnail"}),c=e.url&&!l?o.default.createElement("a",{className:"editor__file-preview-link",href:this.cacheBustUrl(e.url),target:"_blank",rel:"noopener noreferrer"},d):null,p=l>0&&l<100?o.default.createElement("div",{className:"preview-image-field__progress"},o.default.createElement("div",{className:"preview-image-field__progress-bar",style:{width:`${l}%`}})):null;let f=null;if(s||"error"===a){const e=s&&s.value?s.value:i.default._t("AssetAdmin.DROPZONE_RESPONSE_ERROR","Server responded with an error."),t=s&&s.type?s.type:"error";f=o.default.createElement("div",{className:`preview-image-field__message preview-image-field__message--${t}`},e)}else r?f=o.default.createElement("div",{className:`preview-image-field__message preview-image-field__message--${r.type}`},r.value):100===l&&"success"===a&&(f=o.default.createElement("div",{className:"preview-image-field__message preview-image-field__message--success"},i.default._t("AssetAdmin.REPlACE_FILE_SUCCESS","Upload successful, the file will be replaced when you Save."),(l||r)&&o.default.createElement("button",{onClick:this.handleCancelUpload,className:"preview-image-field__message-button btn btn-outline-light",type:"button"},i.default._t("AssetAdmin.REPLACE_FILE_UNDO","Undo"))));return o.default.createElement("div",{className:"editor__thumbnail-container"},c||d,p,f)}render(){const{AssetDropzoneComponent:e}=this.props,t=this.getDropzoneProps();if(this.canEdit())return o.default.createElement(e,t,this.renderImage());const n=["preview-image-field__container",this.props.className,this.props.extraClass];return o.default.createElement("div",{className:n.join(" ")},this.renderImage())}}t.Component=E,E.propTypes={id:h.default.string.isRequired,name:h.default.string,className:h.default.string,extraClass:h.default.string,readOnly:h.default.bool,disabled:h.default.bool,bustCache:h.default.bool,onAutofill:h.default.func,formid:h.default.string,nameValue:h.default.string,data:h.default.shape({id:h.default.number,parentid:h.default.number,version:h.default.number,url:h.default.string,mock:h.default.bool,exists:h.default.bool,preview:h.default.string,category:h.default.string,nameField:h.default.string,uploadFileEndpoint:h.default.shape({url:h.default.string.isRequired,method:h.default.string.isRequired,payloadFormat:h.default.string}),initialValues:h.default.object}).isRequired,upload:h.default.shape({url:h.default.string,progress:h.default.number,xhr:h.default.object,category:h.default.string,message:h.default.shape({type:h.default.string.isRequired,value:h.default.string.isRequired}),status:h.default.string}),actions:h.default.object,securityID:h.default.string,confirm:h.default.func,AssetDropzoneComponent:h.default.oneOfType([h.default.object,h.default.func])},E.defaultProps={extraClass:"",className:"",data:{},upload:{},confirm:e=>window.confirm(e),bustCache:!0,AssetDropzoneComponent:l.default};t.default=(0,s.connect)((function(e,t){const n=e.config.SecurityID,i=t.id,o=e.assetAdmin.previewField[i]||{},l=(0,u.formValueSelector)(t.formid,p.default),{bustCache:r}=e.config.sections.find((e=>"SilverStripe\\AssetAdmin\\Controller\\AssetAdmin"===e.name));return{securityID:n,upload:o,nameValue:l(e,"Name"),bustCache:r}}),(function(e){return{actions:{previewField:(0,a.bindActionCreators)(d,e)}}}))(E)},3965:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=s(n(1594)),o=s(n(6935)),l=n(3556),r=s(n(5815));function s(e){return e&&e.__esModule?e:{default:e}}function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},a.apply(null,arguments)}const u=e=>{let{onSelect:t,currentWidth:n,originalWidth:o,width:s,text:a}=e;return i.default.createElement(l.Button,{color:"link",size:"sm",onClick:()=>t(s||o),disabled:o<s||n===(s||o)},i.default.createElement("span",{className:"visually-hidden"},(e=>r.default.inject(r.default._t("AssetAdmin.SET_IMAGE_SIZE_TO",'Set image size to "{preset}"'),{preset:e}))(a)),i.default.createElement("span",{"aria-hidden":"true"},a))},d=e=>{let{imageSizePresets:t,...n}=e;return t?i.default.createElement("ul",{className:"image-size-preset-list"},t.map((e=>i.default.createElement("li",{key:e.text,className:"image-size-preset-list__list-item"},i.default.createElement(u,a({},e,n)))))):null};d.propTypes={onSelect:o.default.func,imageSizePresets:o.default.arrayOf(o.default.shape({text:o.default.string,width:o.default.number})),currentWidth:o.default.number,originalWidth:o.default.number.isRequired};t.default=d},2397:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var i=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 i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&{}.hasOwnProperty.call(e,l)){var r=o?Object.getOwnPropertyDescriptor(e,l):null;r&&(r.get||r.set)?Object.defineProperty(i,l,r):i[l]=e[l]}return i.default=e,n&&n.set(e,i),i}(n(1594)),o=c(n(6935)),l=n(5207),r=n(5381),s=c(n(3432)),a=n(9040),u=n(9367),d=c(n(3965));function c(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)}function f(){return f=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},f.apply(null,arguments)}class h extends i.Component{constructor(e){super(e);if(2!==i.Children.toArray(e.children).length)throw new Error("ProportionConstraintField must be passed two children -- one field for each value");this.handlePresetSelect=this.handlePresetSelect.bind(this),this.handleBlur=this.handleBlur.bind(this),this.handleFocus=this.handleFocus.bind(this),this.state={hasFocus:!1}}componentDidMount(){this.componentDidUpdate(this.props)}componentDidUpdate(e){if(!this.state.hasFocus){const{current:{width:t}}=e,n=parseInt(t,10);(!n||n<=0)&&this.resetDimensions()}}handleChange(e,t,n){const i=parseInt(n||t.target&&t.target.value,10);i&&i>0&&this.syncFields(e,i)}syncFields(e,t){const{children:n,active:i,onAutofill:o,data:{ratio:l}}=this.props,r=0===e?1:0,s=n[e].props.name,a=n[r].props.name,u=0===e?1/l:l;o(s,t),i&&o(a,Math.round(t*u))}handlePresetSelect(e){this.syncFields(0,e);const{key:t}=this.props.children[0],n=document.getElementById(t);n&&n.focus()}handleBlur(e,t){this.setState({hasFocus:!1});const n=parseInt(t&&t.target&&t.target.value,10);(!n||n<=0)&&(t.preventDefault(),this.resetDimensions())}handleFocus(){this.setState({hasFocus:!0})}defaultWidth(){const{imageSizePresets:e,data:{originalWidth:t}}=this.props,n=e&&e.find((e=>e.default)),i=n&&n.width||t||600;return t&&t<i?t:i}resetDimensions(){const e=this.defaultWidth();this.syncFields(0,e)}render(){const{FieldGroup:e,data:{originalWidth:t,isRemoteFile:n},current:{width:o},imageSizePresets:l}=this.props;return i.default.createElement(e,f({smallholder:!1},this.props),this.props.children.map(((e,t)=>(0,i.cloneElement)(e,{onChange:(e,n)=>this.handleChange(t,e,n),onBlur:e=>this.handleBlur(t,e),onFocus:()=>this.handleFocus(),key:t},e.props.children))),!n&&i.default.createElement(d.default,{originalWidth:parseInt(t,10),currentWidth:o,imageSizePresets:l,onSelect:this.handlePresetSelect}))}}t.Component=h,h.propTypes={children:o.default.array,onAutofill:o.default.func,active:o.default.bool,data:o.default.shape({ratio:o.default.number.isRequired,isRemoteFile:o.default.bool,originalWidth:o.default.number,originalHeight:o.default.number}),current:o.default.shape({width:o.default.oneOfType([o.default.number,o.default.string]),height:o.default.oneOfType([o.default.number,o.default.string])}).isRequired,FieldGroup:o.default.elementType.isRequired,imageSizePresets:o.default.arrayOf(o.default.shape({width:o.default.number,text:o.default.string,default:o.default.bool}))},h.defaultProps={active:!0};t.default=(0,u.compose)((0,a.connect)((function(e,t){let{formid:n}=t;const i=(0,r.formValueSelector)(n,s.default),o=i(e,"Width"),l=i(e,"Height");return{current:{width:o?parseInt(o,10):void 0,heigth:l?parseInt(l,10):void 0},imageSizePresets:e.assetAdmin.modal.imageSizePresets}})),(0,l.inject)(["FieldGroup"]))(h)},9725:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.ConnectedUploadField=t.Component=void 0;var i=b(n(5815)),o=v(n(1594)),l=n(9040),r=n(9367),s=n(5207),a=b(n(6379)),u=b(n(2623)),d=b(n(6022)),c=b(n(9247)),p=v(n(1433)),f=v(n(1021)),h=b(n(6935)),g=b(n(4636));function m(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(m=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=m(t);if(n&&n.has(e))return n.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&{}.hasOwnProperty.call(e,l)){var r=o?Object.getOwnPropertyDescriptor(e,l):null;r&&(r.get||r.set)?Object.defineProperty(i,l,r):i[l]=e[l]}return i.default=e,n&&n.set(e,i),i}function b(e){return e&&e.__esModule?e:{default:e}}class y extends o.Component{constructor(e){super(e),this.getMaxFiles=this.getMaxFiles.bind(this),this.getFolderId=this.getFolderId.bind(this),this.renderChild=this.renderChild.bind(this),this.handleAddShow=this.handleAddShow.bind(this),this.handleHide=this.handleHide.bind(this),this.handleAddInsert=this.handleAddInsert.bind(this),this.handleInsertMany=this.handleInsertMany.bind(this),this.handleAddedFile=this.handleAddedFile.bind(this),this.handleSending=this.handleSending.bind(this),this.handleUploadProgress=this.handleUploadProgress.bind(this),this.handleFailedUpload=this.handleFailedUpload.bind(this),this.handleSuccessfulUpload=this.handleSuccessfulUpload.bind(this),this.handleItemRemove=this.handleItemRemove.bind(this),this.handleReplaceShow=this.handleReplaceShow.bind(this),this.handleChange=this.handleChange.bind(this),this.handleReplace=this.handleReplace.bind(this),this.canEdit=this.canEdit.bind(this),this.canAttach=this.canAttach.bind(this),this.canUpload=this.canUpload.bind(this),this.state={selecting:!1,selectingItem:null}}componentDidMount(){const{id:e,formSchemaFilesHash:t,data:n,value:i,actions:o,files:l}=this.props,r=(0,g.default)(JSON.stringify(i.Files)).toString();if(t!==r)return o.uploadField.setFormSchemaFilesHash(e,r),void o.uploadField.setFiles(e,n.files);o.uploadField.setFiles(e,l)}componentDidUpdate(e){const{id:t,formSchemaFilesHash:n,data:i,files:o,value:{Files:l},actions:{uploadField:{setFormSchemaFilesHash:r,setFiles:s}}}=this.props;(function(e,t){if(e.length!==t.length)return!0;for(let n=0;n<e.length;n++)if(e[n].id!==t[n].id)return!0;return!1})(e.files||[],o||[])&&this.handleChange(null,this.props);const a=(0,g.default)(JSON.stringify(l.Files)).toString();if(n!==a)return r(t,a),void s(t,i.files);const{value:{Files:u}}=e;if(l.length===u.length&&0===l.filter((e=>!u.includes(e))).length)return;const d=o.map((e=>e.id));d.length===l.length&&0===d.filter((e=>!l.includes(e))).length||s(t,i.files)}getMaxFiles(){const e=this.props.data.multi?this.props.data.maxFiles:1;if(null==e)return null;const t=this.props.files.filter((e=>e.id>0&&(!e.message||"error"!==e.message.type))).length;return Math.max(e-t,0)}getMaxFilesize(){return this.props.data.maxFilesize||null}getFolderId(){const{selectingItem:e}=this.state;return e&&"object"==typeof e?e.parent.id:this.props.data.parentid||0}handleAddedFile(e){const t={...e,uploaded:!0};this.props.actions.uploadField.addFile(this.props.id,t)}handleSending(e,t){this.props.actions.uploadField.updateQueuedFile(this.props.id,e._queuedId,{xhr:t})}handleUploadProgress(e,t){this.props.actions.uploadField.updateQueuedFile(this.props.id,e._queuedId,{progress:t})}handleSuccessfulUpload(e){const t=JSON.parse(e.xhr.response);void 0===t[0].error?this.props.actions.uploadField.succeedUpload(this.props.id,e._queuedId,t[0]):this.handleFailedUpload(e)}handleFailedUpload(e,t){const n=e.xhr&&e.xhr.status?(0,c.default)(e.xhr.status,e.xhr):"";this.props.actions.uploadField.failUpload(this.props.id,e._queuedId,t,n)}handleItemRemove(e,t){this.props.actions.uploadField.removeFile(this.props.id,t)}handleReplaceShow(e,t){this.props.actions.modal.initFormStack("select","admin"),this.setState({selecting:!0,selectingItem:t})}handleChange(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.props;if("function"==typeof t.onChange){const n={Files:t.files.filter((e=>e.id)).map((e=>e.id))};t.onChange(e,{id:t.id,value:n})}}handleUploadButton(e){e.preventDefault()}handleAddShow(e){e.preventDefault(),this.props.actions.modal.initFormStack("select","admin"),this.setState({selecting:!0,selectingItem:null})}handleHide(){this.props.actions.modal.reset(),this.setState({selecting:!1,selectingItem:null})}handleAddInsert(e,t,n){return this.props.actions.uploadField.addFile(this.props.id,n),this.handleHide(),Promise.resolve({})}handleInsertMany(e,t){const{selectingItem:n}=this.state;n?this.handleReplace(e,null,t[0]):t.forEach((t=>{this.handleAddInsert(e,null,t)}))}handleReplace(e,t,n){const{selectingItem:i}=this.state,{id:o,actions:{uploadField:{addFile:l,removeFile:r}}}=this.props;if(!i)throw new Error("Tried to replace a file when none was selected.");return r(o,i),l(o,n),this.handleHide(),Promise.resolve({})}canEdit(){return!this.props.disabled&&!this.props.readOnly&&(this.props.data.canUpload||this.props.data.canAttach)}canUpload(){return this.canEdit()&&this.props.data.canUpload}canAttach(){return this.canEdit()&&this.props.data.canAttach}renderDropzone(){const{AssetDropzone:e}=this.props;if(!this.props.data.endpoints.createFile)return null;const t={height:a.default.SMALL_THUMBNAIL_HEIGHT,width:a.default.SMALL_THUMBNAIL_WIDTH},n=this.getMaxFiles(),l=this.getMaxFilesize(),r={url:this.props.data.endpoints.createFile.url,method:this.props.data.endpoints.createFile.method,paramName:"Upload",parallelUploads:this.props.data.maxParallelUploads,maxFiles:n,maxFilesize:l,thumbnailWidth:a.default.SMALL_THUMBNAIL_WIDTH,thumbnailHeight:a.default.SMALL_THUMBNAIL_HEIGHT},s=["uploadfield__dropzone"];if(0===n&&s.push("uploadfield__dropzone--hidden"),!this.canEdit())return this.props.files.length?null:o.default.createElement("p",null,i.default._t("AssetAdmin.EMPTY","No files"));const u=this.props.securityId,d=[];return this.canUpload()&&d.push(o.default.createElement("button",{key:"uploadbutton",type:"button",onClick:this.handleUploadButton,className:"uploadfield__upload-button"},i.default._t("AssetAdmin.UPLOADFIELD_UPLOAD_NEW","Upload new"))),this.canAttach()&&(d.length&&d.push(o.default.createElement("span",{key:"uploadjoin",className:"uploadfield__join"},i.default._t("AssetAdmin.OR","or"))),d.push(o.default.createElement("button",{key:"attachbutton",type:"button",onClick:this.handleAddShow,className:"uploadfield__add-button"},i.default._t("AssetAdmin.UPLOADFIELD_CHOOSE_EXISTING","Choose existing")))),o.default.createElement(e,{name:this.props.name,canUpload:this.canUpload(),uploadButton:!1,uploadSelector:".uploadfield__upload-button, .uploadfield__backdrop",folderId:this.props.data.parentid,onAddedFile:this.handleAddedFile,onError:this.handleFailedUpload,onSuccess:this.handleSuccessfulUpload,onSending:this.handleSending,onUploadProgress:this.handleUploadProgress,preview:t,options:r,securityID:u,className:s.join(" ")},o.default.createElement("div",{className:"uploadfield__backdrop"}),o.default.createElement("span",{className:"uploadfield__droptext"},d))}renderModal(){const{InsertMediaModal:e}=this.props,{selecting:t,selectingItem:n}=this.state,i=this.getMaxFiles(),l=this.getFolderId();return o.default.createElement(e,{title:!1,isOpen:t,onInsert:n?this.handleReplace:this.handleAddInsert,onClosed:this.handleHide,onInsertMany:this.handleInsertMany,maxFiles:n?1:i,type:"select",bodyClassName:"modal__dialog",className:"insert-media-react__dialog-wrapper",fileAttributes:n?{ID:n.id}:null,folderId:l})}renderChild(e,t){const{UploadFieldItem:n}=this.props,i={key:e.id?`file-${e.id}`:`queued-${e.queuedId}`,item:e,name:this.props.name,onRemove:this.handleItemRemove,canEdit:this.canEdit(),onView:this.handleReplaceShow},l=this.props.getItemProps(i,t,this.props);return o.default.createElement(n,l)}render(){return o.default.createElement("div",{className:"uploadfield"},this.renderDropzone(),this.props.files.map(this.renderChild),this.renderModal())}}t.Component=y,y.propTypes={id:h.default.string.isRequired,name:h.default.string.isRequired,onChange:h.default.func,value:h.default.shape({Files:h.default.arrayOf(h.default.number)}),files:h.default.arrayOf(d.default),formSchemaFilesHash:h.default.string,readOnly:h.default.bool,disabled:h.default.bool,data:h.default.shape({files:h.default.arrayOf(d.default),multi:h.default.bool,parentid:h.default.number,canUpload:h.default.bool,canAttach:h.default.bool,maxFiles:h.default.number,endpoints:h.default.object}),UploadFieldItem:h.default.elementType,AssetDropzone:h.default.elementType,InsertMediaModal:h.default.elementType,getItemProps:h.default.func},y.defaultProps={value:{Files:[]},className:"",getItemProps:e=>e};const E=t.ConnectedUploadField=(0,l.connect)((function(e,t){const n=t.id;let i=[],o=null;return e.assetAdmin&&e.assetAdmin.uploadField&&e.assetAdmin.uploadField.fields&&e.assetAdmin.uploadField.fields[n]&&(i=e.assetAdmin.uploadField.fields[n].files||[],o=e.assetAdmin.uploadField.fields[n].formSchemaFilesHash||null),{files:i,securityId:e.config.SecurityID,formSchemaFilesHash:o}}),(function(e){return{actions:{uploadField:(0,r.bindActionCreators)(p,e),modal:(0,r.bindActionCreators)(f,e)}}}))(y);t.default=(0,r.compose)((0,s.inject)(["UploadFieldItem","AssetDropzone","InsertMediaModal"]),u.default)(E)},3058:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=c(n(5815)),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=d(t);if(n&&n.has(e))return n.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&{}.hasOwnProperty.call(e,l)){var r=o?Object.getOwnPropertyDescriptor(e,l):null;r&&(r.get||r.set)?Object.defineProperty(i,l,r):i[l]=e[l]}return i.default=e,n&&n.set(e,i),i}(n(1594)),l=c(n(6379)),r=c(n(6022)),s=n(5716),a=c(n(6935)),u=c(n(1990));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)}function c(e){return e&&e.__esModule?e:{default:e}}class p extends o.Component{constructor(e){super(e),this.handleRemove=this.handleRemove.bind(this),this.handleItemClick=this.handleItemClick.bind(this),this.handleView=this.handleView.bind(this)}getThumbnailStyles(){if(this.isImage()&&(this.exists()||this.uploading())){return{backgroundImage:`url(${this.props.item.smallThumbnail||this.props.item.url||""})`}}return{}}getThumbnailClassNames(){const e=["uploadfield-item__thumbnail"];return this.isImageSmallerThanThumbnail()&&e.push("uploadfield-item__thumbnail--small"),e.join(" ")}getItemClassNames(){const e=["fill-width","uploadfield-item",`uploadfield-item--${this.props.item.category||"none"}`];return this.missing()&&e.push("uploadfield-item--missing"),this.hasError()&&e.push("uploadfield-item--error"),e.join(" ")}hasError(){return!!this.props.item.message&&"error"===this.props.item.message.type}isImage(){return"image"===this.props.item.category}exists(){return this.props.item.exists}uploading(){return this.props.item.queuedId&&!this.saved()}complete(){return this.props.item.queuedId&&this.saved()}saved(){return this.props.item.id>0}missing(){return!this.exists()&&this.saved()}isImageSmallerThanThumbnail(){if(!this.isImage()||this.missing())return!1;const e=this.props.item.width,t=this.props.item.height;return t&&e&&t<l.default.SMALL_THUMBNAIL_HEIGHT&&e<l.default.SMALL_THUMBNAIL_WIDTH}handleRemove(e){e.preventDefault(),this.props.onRemove&&this.props.onRemove(e,this.props.item)}handleView(e){e.preventDefault(),this.props.onView&&this.props.onView(e,this.props.item)}handleItemClick(e){e.preventDefault(),this.props.onItemClick&&this.props.onItemClick(e,this.props.item)}renderStatus(){return this.props.item.draft?o.default.createElement("span",{className:"uploadfield-item__status"},i.default._t("File.DRAFT","Draft")):this.props.item.modified?o.default.createElement("span",{className:"uploadfield-item__status"},i.default._t("File.MODIFIED","Modified")):null}renderErrorMessage(){let e=null;return this.hasError()?e=this.props.item.message.value:this.missing()&&(e=i.default._t("AssetAdmin.FILE_MISSING","File cannot be found")),null!==e?o.default.createElement("div",{className:"uploadfield-item__error-message",title:e},e):null}renderProgressBar(){const e={className:"uploadfield-item__progress-bar",style:{width:`${this.props.item.progress}%`}};return!this.hasError()&&this.props.item.queuedId?this.complete()?o.default.createElement("div",{className:"uploadfield-item__complete-icon"}):o.default.createElement("div",{className:"uploadfield-item__upload-progress"},o.default.createElement("div",e)):null}renderRemoveButton(){if(!this.props.canEdit)return null;const e=["btn","uploadfield-item__remove-btn","btn-secondary","btn--no-text","font-icon-cancel","btn--icon-md"].join(" ");return o.default.createElement("button",{className:e,onClick:this.handleRemove})}renderViewButton(){if(!this.props.canEdit||!this.props.item.id)return null;const e=["btn","uploadfield-item__view-btn","btn-secondary","btn--no-text","font-icon-eye","btn--icon-md"].join(" ");return o.default.createElement("button",{className:e,onClick:this.handleView})}renderRestrictedAccess(e){const{id:t,hasRestrictedAccess:n}=e,i={fileID:t,placement:"top",hasRestrictedAccess:n};return o.default.createElement(u.default,i)}renderTrackedFormUpload(e){const{id:t,isTrackedFormUpload:n,hasRestrictedAccess:i}=e,l={fileID:t,placement:"top",isTrackedFormUpload:n,hasRestrictedAccess:i};return o.default.createElement(u.default,l)}renderFileDetails(){const e=this.props.item;let t="";return e.size&&(t=`, ${(0,s.fileSize)(e.size)}`),o.default.createElement("div",{className:"uploadfield-item__details fill-height flexbox-area-grow"},o.default.createElement("div",{className:"fill-width"},o.default.createElement("span",{className:"uploadfield-item__title flexbox-area-grow"},e.title)),o.default.createElement("div",{className:"fill-width uploadfield-item__meta"},o.default.createElement("span",{className:"uploadfield-item__specs"},e.extension,t),this.renderStatus(),e.hasRestrictedAccess&&this.renderRestrictedAccess(e),e.isTrackedFormUpload&&this.renderTrackedFormUpload(e)))}renderThumbnail(){return o.default.createElement("div",{className:this.getThumbnailClassNames(),style:this.getThumbnailStyles(),onClick:this.handleItemClick,role:"button",tabIndex:this.props.onItemClick?0:-1})}render(){const e=`${this.props.name}[Files][]`;return o.default.createElement("div",{className:this.getItemClassNames()},o.default.createElement("input",{type:"hidden",value:this.props.item.id,name:e}),this.renderThumbnail(),this.renderFileDetails(),this.renderProgressBar(),this.renderErrorMessage(),this.renderViewButton(),this.renderRemoveButton())}}p.propTypes={canEdit:a.default.bool,name:a.default.string.isRequired,item:r.default,onRemove:a.default.func,onItemClick:a.default.func,onView:a.default.func};t.default=p},6379:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,o=(i=n(5815))&&i.__esModule?i:{default:i};t.default={ACTIONS:{CREATE_FOLDER:"create-folder",EDIT_FILE:"edit"},MOVE_SUCCESS_DURATION:3e3,CSS_TRANSITION_TIME:300,SMALL_THUMBNAIL_HEIGHT:60,SMALL_THUMBNAIL_WIDTH:60,THUMBNAIL_HEIGHT:150,THUMBNAIL_WIDTH:200,BULK_ACTIONS:[{value:"delete",label:o.default._t("AssetAdmin.BULK_ACTIONS_DELETE","Delete"),className:"font-icon-trash",destructive:!0,callback:null,canApply:e=>e.every((e=>e&&e.canDelete))},{value:"archive",label:o.default._t("AssetAdmin.BULK_ACTIONS_ARCHIVE","Archive"),className:"font-icon-box",destructive:!0,callback:null,canApply:e=>e.every((e=>e&&e.canDelete))},{value:"edit",label:o.default._t("AssetAdmin.BULK_ACTIONS_EDIT","Edit"),className:"font-icon-edit",destructive:!1,canApply:e=>1===e.length,callback:null},{value:"move",label:o.default._t("AssetAdmin.BULK_ACTIONS_MOVE","Move"),className:"font-icon-folder-move",canApply:e=>e.every((e=>e&&e.canEdit)),destructive:!1,callback:null},{value:"publish",label:o.default._t("AssetAdmin.BULK_ACTIONS_PUBLISH","Publish"),className:"font-icon-rocket",destructive:!1,callback:null,canApply:e=>e.some((e=>e&&e.modified))&&e.every((e=>e.canEdit&&"folder"!==e.type)),confirm:null},{value:"unpublish",label:o.default._t("AssetAdmin.BULK_ACTIONS_UNPUBLISH","Unpublish"),className:"font-icon-cancel-circled",destructive:!1,callback:null,canApply:e=>e.some((e=>e.published))&&e.every((e=>e.canEdit&&"folder"!==e.type)),confirm:null},{value:"insert",label:o.default._t("AssetAdmin.BULK_ACTIONS_INSERT","Insert"),className:"font-icon-plus-circled btn-primary",destructive:!1,callback:null,canApply:e=>e.length,confirm:null}],BULK_ACTIONS_PLACEHOLDER:o.default._t("AssetAdmin.BULK_ACTIONS_PLACEHOLDER"),SPACE_KEY_CODE:32,RETURN_KEY_CODE:13,DEFAULT_PREVIEW:"framework/client/dist/images/app_icons/generic_92.png",MODAL_MOVE:"MODAL_MOVE"}},7917:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var i=O(n(1594)),o=A(n(6935)),l=n(9040),r=n(9367),s=A(n(5609)),a=A(n(5815)),u=A(n(6923)),d=O(n(4201)),c=O(n(8918)),p=O(n(1369)),f=O(n(9517)),h=A(n(1869)),g=A(n(5789)),m=A(n(2294)),v=O(n(6303)),b=A(n(6175)),y=A(n(6379)),E=A(n(4350)),_=A(n(6177)),S=O(n(4461)),C=A(n(8268)),w=A(n(4014)),F=A(n(175)),I=A(n(2308));function A(e){return e&&e.__esModule?e:{default:e}}function R(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(R=function(e){return e?n:t})(e)}function O(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=R(t);if(n&&n.has(e))return n.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&{}.hasOwnProperty.call(e,l)){var r=o?Object.getOwnPropertyDescriptor(e,l):null;r&&(r.get||r.set)?Object.defineProperty(i,l,r):i[l]=e[l]}return i.default=e,n&&n.set(e,i),i}class M extends i.Component{constructor(e){super(e),this.handleOpenFile=this.handleOpenFile.bind(this),this.handleCloseFile=this.handleCloseFile.bind(this),this.handleDelete=this.handleDelete.bind(this),this.doPublish=this.doPublish.bind(this),this.doUnpublish=this.doUnpublish.bind(this),this.handleUnpublish=this.handleUnpublish.bind(this),this.handleDoSearch=this.handleDoSearch.bind(this),this.handleClearSearch=this.handleClearSearch.bind(this),this.handleSubmitEditor=this.handleSubmitEditor.bind(this),this.handleOpenFolder=this.handleOpenFolder.bind(this),this.handleSort=this.handleSort.bind(this),this.handleSetPage=this.handleSetPage.bind(this),this.createEndpoint=this.createEndpoint.bind(this),this.handleBackButtonClick=this.handleBackButtonClick.bind(this),this.handleFolderIcon=this.handleFolderIcon.bind(this),this.handleBrowse=this.handleBrowse.bind(this),this.handleViewChange=this.handleViewChange.bind(this),this.handleUpload=this.handleUpload.bind(this),this.handleUploadQueue=this.handleUploadQueue.bind(this),this.handleCreateFolder=this.handleCreateFolder.bind(this),this.handleMoveFilesSuccess=this.handleMoveFilesSuccess.bind(this),this.refetchFolder=this.refetchFolder.bind(this),this.state={loading:!1,folder:null,files:[],totalCount:0,forceRefetch:!1}}componentDidMount(){this.refetchFolder()}componentDidUpdate(e){(this.props.folderId!==e.folderId||this.props.fileId!==e.fileId&&0!==this.props.fileId||this.state.forceRefetch)&&this.refetchFolder(),this.state.forceRefetch&&this.setState({forceRefetch:!1})}getFolderId(){return null!==this.props.folderId?this.props.folderId:this.state.folder?this.state.folder.id:0}refetchFolder(){const e=this.getFolderId(),t=new URLSearchParams(window.location.search),n=[];t.forEach(((e,t)=>{"page"!==t&&"filter"!==t.substring(0,6)&&"sort"!==t.substring(0,4)||n.push(`${t}=${e}`)}));let i="";n.length&&(i=`?${n.join("&")}`);const o=`${_.default.getSection("SilverStripe\\AssetAdmin\\Controller\\AssetAdminOpen").endpoints.read.url}/${e}${i}`;s.default.get(o).then((async e=>{const t=await e.json();this.setState({loading:!1,folder:t,files:t.children.nodes,totalCount:t.children.pageInfo.totalCount})})).catch((async e=>{this.setState({loading:!1,folder:null,files:[],totalCount:0});const t=await(0,w.default)(e);this.props.actions.toasts.error(t)}))}getFiles(){const{queuedFiles:e,folderId:t}=this.props,n=this.state.files,i=[...e.items.filter((e=>!(e.id&&n.find((t=>t.id===e.id))||e.hasOwnProperty("uploadedToFolderId")&&e.uploadedToFolderId!==t))),...n],o=i.filter((e=>"folder"===e.type)),l=i.filter((e=>"folder"!==e.type));return o.concat(l)}handleBrowse(e,t,n){"function"==typeof this.props.onBrowse&&(this.props.onBrowse(e,t,n),this.setState({forceRefetch:!0})),e!==this.getFolderId()&&this.props.actions.gallery.deselectFiles()}handleSetPage(e){this.handleBrowse(this.getFolderId(),this.props.fileId,Object.assign({},this.props.query,{page:e})),this.setState({forceRefetch:!0})}handleDoSearch(e){this.props.actions.gallery.deselectFiles(),this.props.actions.queuedFiles.purgeUploadQueue(),this.handleBrowse(e.currentFolderOnly?this.getFolderId():0,null,{filter:e,view:this.props.query.view})}handleClearSearch(e){this.props.actions.displaySearch.closeSearch(),this.props.actions.gallery.deselectFiles(),this.props.actions.queuedFiles.purgeUploadQueue(),this.refetchFolder();const t=this.state.folder;this.handleOpenFolder(e,t)}handleSort(e){this.handleBrowse(this.getFolderId(),this.props.fileId,{...this.props.query,sort:e,limit:void 0,page:void 0}),this.setState({forceRefetch:!0})}handleViewChange(e){this.handleBrowse(this.getFolderId(),this.props.fileId,Object.assign({},this.props.query,{view:e}))}createEndpoint(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return s.default.createEndpointFetcher(Object.assign({},e,t?{defaultData:{SecurityID:this.props.securityId}}:{}))}handleBackButtonClick(e){e.preventDefault(),this.props.actions.gallery.deselectFiles();const t=this.state.folder;t?this.handleOpenFolder(t.parentId||0):this.handleOpenFolder(0)}resetFile(e){e.queuedId&&this.props.actions.queuedFiles.removeQueuedFile(e.queuedId),this.props.fileId===e.id&&this.props.resetFileDetails(this.getFolderId(),e.id,this.props.query)}handleFolderIcon(){this.handleOpenFile(this.getFolderId())}handleOpenFile(e){this.handleBrowse(this.getFolderId(),e,this.props.query)}handleSubmitEditor(e,t,n){let i=null;if("action_insert"===t&&"select"===this.props.type){const t=this.getFiles().find((t=>t.id===parseInt(e.ID,10)));return this.props.onInsertMany(null,[t]),this.setState({forceRefetch:!0}),Promise.resolve()}if("function"==typeof this.props.onSubmitEditor){const o=this.findFile(this.props.fileId);i=this.props.onSubmitEditor(e,t,n,o)}else i=n();if(!i)throw new Error("Promise was not returned for submitting");return this.setState({forceRefetch:!0}),i.then((e=>("action_createfolder"===t?"admin"===this.props.type?this.handleOpenFile(e.record.id):this.handleOpenFolder(this.getFolderId()):"action_save"!==t&&"action_publish"!==t||this.getFolderId()===e.record.parent.id||this.handleBrowse(e.record.parent.id,e.record.id,null),e)))}handleCloseFile(){this.handleBrowse(this.getFolderId(),null,this.props.query)}handleOpenFolder(e){const{page:t,filter:n,...i}=this.props.query;this.handleBrowse(e,null,i)}handleDelete(e){this.props.actions.confirmDeletion.deleting();const t=e.map((e=>{const t=this.findFile(e);if(!t)throw new Error(`File selected for deletion cannot be found: ${e}`);return t.queuedId&&this.props.actions.queuedFiles.removeQueuedFile(t.queuedId),t})).map((e=>e.id)),n=this.state.folder,i=n?n.id:0,o=this.props.sectionConfig.endpoints.delete.url;return s.default.post(o,{ids:t},{"X-SecurityID":_.default.get("SecurityID")}).then((()=>{this.handleBrowse(i,null,this.props.query);this.props.queuedFiles.items.filter((e=>t.includes(e.id))).forEach((e=>{e.queuedId&&this.props.actions.queuedFiles.removeQueuedFile(e.queuedId)}));let e="AssetAdmin.BULK_ACTIONS_DELETE_SUCCESS_02",n="%s folders/files were successfully deleted.";this.props.sectionConfig.filesAreVersioned&&this.props.sectionConfig.archiveFiles&&(e="AssetAdmin.BULK_ACTIONS_ARCHIVE_SUCCESS_02",n="%s folders/files were successfully archived."),this.props.actions.toasts.success(a.default.sprintf(a.default._t(e,n),t.length)),this.props.actions.gallery.deselectFiles(),this.refetchFolder()})).catch((async e=>{const t=await(0,w.default)(e);this.props.actions.toasts.error(t)})).finally((()=>this.props.actions.confirmDeletion.reset()))}doUnpublish(e){const t=e.map((e=>{const t=this.findFile(e);if(!t)throw new Error(`File selected for unpublishing cannot be found: ${e}`);if("folder"===t.type)throw new Error("Cannot unpublish folders");return t})),n=t.map((e=>e.id)),i=n.map((e=>`ids[]=${e}`)).join("&");let o=`${this.props.sectionConfig.endpoints.readLiveOwnerCounts.url}?${i}`;return s.default.get(o).then((async e=>{const t=(await e.json()).filter((e=>e.count>0)),n=t.slice(0,4).map((e=>e.message)),i=t.slice(5).length;let o="";if(i>0&&(o=a.default.inject(a.default._t("AssetAdmin.BULK_OWNED_WARNING_REMAINING","And {count} other file(s)"),{count:i})),n.length){const e=[a.default.inject(a.default._t("AssetAdmin.BULK_OWNED_WARNING_HEADING","{count} file(s) are being used by other published content."),{count:n.length}),...n,o,a.default._t("AssetAdmin.BULK_OWNED_WARNING_FOOTER","Unpublishing will only remove files from the published version of the content. They will remain on the draft version. Unpublish anyway?")].filter((e=>e)).join("\n\n");if(!confirm(e))return Promise.reject()}return Promise.resolve()})).then((()=>(o=this.props.sectionConfig.endpoints.unpublish.url,s.default.post(o,{ids:n},{"X-SecurityID":_.default.get("SecurityID")}).catch((async e=>{const t=await(0,w.default)(e);this.props.actions.toasts.error(t)}))))).then((()=>(this.refetchFolder(),t))).catch((async e=>{const t=await(0,w.default)(e);return this.props.actions.toasts.error(t),[]}))}handleUnpublish(e){return this.doUnpublish(e).then((e=>{const{fileId:t}=this.props;this.refetchFolder().then((()=>{t&&e.find((e=>e.id===t))&&this.props.resetFileDetails(this.getFolderId(),t,this.props.query)}))}))}doPublish(e){const t=e.map((e=>{const t=this.findFile(e);if(!t)throw new Error(`File selected for publishing cannot be found: ${e}`);if("folder"===t.type)throw new Error("Cannot publish folders");return t})),n=t.map((e=>e.id)),i=this.props.sectionConfig.endpoints.publish.url;return s.default.post(i,{ids:n},{"X-SecurityID":_.default.get("SecurityID")}).then((()=>(t.forEach((e=>this.resetFile(e))),this.refetchFolder(),t))).catch((async e=>{const t=await(0,w.default)(e);this.props.actions.toasts.error(t)}))}findFile(e){return this.getFiles().find((t=>t.id===parseInt(e,10)))}handleUpload(){}handleUploadQueue(){this.props.fileId&&this.refetchFolder()}handleCreateFolder(){this.props.onBrowse(this.getFolderId(),null,this.props.query,y.default.ACTIONS.CREATE_FOLDER)}handleMoveFilesSuccess(e,t){this.props.queuedFiles.items.filter((e=>t.includes(e.id))).forEach((e=>{e.queuedId&&this.props.actions.queuedFiles.removeQueuedFile(e.queuedId)})),this.props.actions.gallery.deselectFiles(),this.refetchFolder()}renderGallery(){const{GalleryComponent:e}=this.props,t=this.props.sectionConfig,n=t.endpoints.createFile.url,o=t.endpoints.createFile.method,l=this.props.query&&parseInt(this.props.query.limit||t.limit,10),r=this.props.query&&parseInt(this.props.query.page||1,10),s=this.props.query&&this.props.query.sort,a=this.props.query&&this.props.query.view,u=this.props.query.filter||{},d=this.state.folder,c=this.state.loading;return i.default.createElement(e,{files:this.getFiles(),fileId:this.props.fileId,folderId:this.getFolderId(),folder:d,type:this.props.type,limit:l,page:r,totalCount:this.state.totalCount,view:a,filters:u,createFileApiUrl:n,createFileApiMethod:o,onInsertMany:this.props.onInsertMany,onPublish:this.doPublish,onUnpublish:this.doUnpublish,onOpenFile:this.handleOpenFile,onOpenFolder:this.handleOpenFolder,onSuccessfulUpload:this.handleUpload,onSuccessfulUploadQueue:this.handleUploadQueue,onCreateFolder:this.handleCreateFolder,onMoveFilesSuccess:this.handleMoveFilesSuccess,onClearSearch:this.handleClearSearch,onSort:this.handleSort,onSetPage:this.handleSetPage,onViewChange:this.handleViewChange,sort:s,sectionConfig:t,loading:c,maxFilesSelect:this.props.maxFiles,dialog:this.props.dialog})}renderEditor(){const{sectionConfig:e,viewAction:t,type:n,fileId:o,dialog:l,requireLinkText:r,fileSelected:s,EditorComponent:a}=this.props,{schemaUrl:u,targetId:d}=(0,C.default)({config:e,viewAction:t,folderId:this.getFolderId(),type:n,fileId:o});if(!u)return null;const c=[];r&&c.push({name:"requireLinkText",value:!0}),s&&c.push({name:"fileSelected",value:!0});const p={dialog:l,fileId:d,schemaUrl:u,schemaUrlQueries:c,onClose:this.handleCloseFile,onSubmit:this.handleSubmitEditor,onUnpublish:this.handleUnpublish,addToCampaignSchemaUrl:e.form.addToCampaignForm?.schemaUrl};return i.default.createElement(a,p)}render(){const{folderId:e,query:t,getUrl:n,type:o,maxFiles:l,toolbarChildren:r,SearchComponent:s,BulkDeleteConfirmationComponent:a}=this.props;if(null===this.state.folder)return null;const d=Boolean(e||(0,v.hasFilters)(t.filter)),c=this.props.sectionConfig.form.fileSearchForm.schemaUrl,p=t.filter||{},f=(0,u.default)("fill-height asset-admin","select"===o&&{"asset-admin--single-select":1===l,"asset-admin--multi-select":1!==l}),h=(0,v.hasFilters)(t.filter)||this.props.showSearch,g=this.props.actions.displaySearch?this.props.actions.displaySearch.toggleSearch:void 0,y=this.state.folder,E={folder:y,query:t,getUrl:n,onBrowse:this.handleBrowse,onFolderIcon:this.handleFolderIcon};return i.default.createElement("div",{className:f},i.default.createElement(m.default,{showBackButton:d,onBackButtonClick:this.handleBackButtonClick},y&&i.default.createElement(I.default,E),i.default.createElement("div",{className:"asset-admin__toolbar-extra pull-xs-right fill-width vertical-align-items"},i.default.createElement(b.default,{toggled:h,onToggle:g}),r)),h&&i.default.createElement(s,{onSearch:this.handleDoSearch,id:"AssetSearchForm",formSchemaUrl:c,onHide:this.handleClearSearch,displayBehavior:"HIDEABLE",filters:p,name:"name"}),i.default.createElement("div",{className:"flexbox-area-grow fill-width fill-height gallery"},this.renderGallery(),this.renderEditor()),i.default.createElement(a,{onConfirm:this.handleDelete,filesAreVersioned:this.props.sectionConfig.filesAreVersioned,archiveFiles:this.props.sectionConfig.archiveFiles}))}}t.Component=M,M.propTypes={dialog:o.default.bool,sectionConfig:E.default,fileId:o.default.number,folderId:o.default.number,resetFileDetails:o.default.func,onBrowse:o.default.func,onReplaceUrl:o.default.func,onInsertMany:o.default.func,getUrl:o.default.func,query:o.default.shape({sort:o.default.string,limit:o.default.oneOfType([o.default.number,o.default.string]),page:o.default.oneOfType([o.default.number,o.default.string]),filter:o.default.object}),onSubmitEditor:o.default.func,type:o.default.oneOf(["insert-media","insert-link","select","admin"]),queuedFiles:o.default.shape({items:o.default.array.isRequired}),filesTotalCount:o.default.number,loading:o.default.bool,actions:o.default.object,maxFiles:o.default.number,fileSelected:o.default.bool,EditorComponent:o.default.oneOfType([o.default.object,o.default.func]),GalleryComponent:o.default.oneOfType([o.default.object,o.default.func]),SearchComponent:o.default.oneOfType([o.default.object,o.default.func]),BulkDeleteConfirmationComponent:o.default.oneOfType([o.default.object,o.default.func])},M.defaultProps={type:"admin",query:{sort:"",limit:null,page:0,filter:{}},maxFiles:null,EditorComponent:h.default,GalleryComponent:g.default,SearchComponent:v.default,BulkDeleteConfirmationComponent:F.default};t.default=(0,r.compose)((0,l.connect)((function(e,t){const{formSchema:n}=e.assetAdmin.modal;return{securityId:e.config.SecurityID,queuedFiles:e.assetAdmin.queuedFiles,showSearch:e.assetAdmin.displaySearch.isOpen,type:n&&n.type||t.type}}),(function(e){return{actions:{gallery:(0,r.bindActionCreators)(d,e),toasts:(0,r.bindActionCreators)(c,e),displaySearch:(0,r.bindActionCreators)(f,e),queuedFiles:(0,r.bindActionCreators)(p,e),confirmDeletion:(0,r.bindActionCreators)(S,e)}}})))(M)},2308:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=a(n(1594)),o=a(n(6935)),l=a(n(5815)),r=n(6418),s=n(6303);function a(e){return e&&e.__esModule?e:{default:e}}const u=e=>{let{folder:t,query:n,getUrl:o,onBrowse:r,onFolderIcon:a,PlainBreadcrumbComponent:u}=e;const d=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return e=>{e.preventDefault(),r(...t)}},c=function(){return o&&o(...arguments)},p=[{text:l.default._t("AssetAdmin.FILES","Files"),href:c(0,null,n),onClick:d(0,null,n)}];if(t&&t.id){t.ancestors&&t.ancestors.forEach((e=>{p.push({text:e.title,href:c(e.id,null,n),onClick:d(e.id,null,n)})}));const e=[{className:"icon font-icon-edit-list",onClick:e=>{e.preventDefault(),a()}}];t.hasRestrictedAccess&&e.push({nodeName:"FileStatusIcon",hasRestrictedAccess:!0}),p.push({text:t.title,href:c(t.id,null,n),onClick:d(t.id,null,n),icons:e})}return(0,s.hasFilters)(n.filter)&&p.push({text:l.default._t("LeftAndMain.SEARCHRESULTS","Search results")}),i.default.createElement(u,{multiline:!0,crumbs:p})};u.propTypes={onBrowse:o.default.func,onFolderIcon:o.default.func,getUrl:o.default.func,query:o.default.shape({sort:o.default.string,limit:o.default.oneOfType([o.default.number,o.default.string]),page:o.default.oneOfType([o.default.number,o.default.string]),filter:o.default.object,view:o.default.string}),folder:o.default.shape({id:o.default.number,title:o.default.string,ancestors:o.default.array,parentId:o.default.number,canView:o.default.bool,canEdit:o.default.bool}),PlainBreadcrumbComponent:o.default.oneOfType([o.default.object,o.default.func])},u.defaultProps={PlainBreadcrumbComponent:r.Component};t.default=u},4736:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0,t.buildUrl=b,t.default=void 0;var i=m(n(1594)),o=n(6545),l=n(9040),r=m(n(6478)),s=h(n(7917)),a=n(5716),u=h(n(7675)),d=h(n(6379)),c=h(n(4350)),p=n(5125),f=h(n(6935));function h(e){return e&&e.__esModule?e:{default:e}}function g(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(g=function(e){return e?n:t})(e)}function m(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=g(t);if(n&&n.has(e))return n.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&{}.hasOwnProperty.call(e,l)){var r=o?Object.getOwnPropertyDescriptor(e,l):null;r&&(r.get||r.set)?Object.defineProperty(i,l,r):i[l]=e[l]}return i.default=e,n&&n.set(e,i),i}const v=Object.keys(d.default.ACTIONS).map((e=>d.default.ACTIONS[e]));function b(e){let{base:t,folderId:n,fileId:i,query:o,action:l}=e;if(l&&-1===v.indexOf(l))throw new Error(`Invalid action provided: ${l}`);let r=null;r=i?(0,p.joinUrlPaths)(t,`show/${n}/${d.default.ACTIONS.EDIT_FILE}/${i}`):n?(0,p.joinUrlPaths)(t,`show/${n}`):t,l===d.default.ACTIONS.CREATE_FOLDER&&(r=(0,p.joinUrlPaths)(t,`show/${n||0}/${l}`));return o&&Object.keys(o).length>0&&(r=`${r}?${u.default.stringify(o)}`),r}class y extends i.Component{constructor(e){super(e),this.handleBrowse=this.handleBrowse.bind(this),this.handleReplaceUrl=this.handleReplaceUrl.bind(this),this.handleResetDetails=this.handleResetDetails.bind(this),this.getUrl=this.getUrl.bind(this)}getUrl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:d.default.ACTIONS.EDIT_FILE;const o=parseInt(e||0,10),l=parseInt(t||0,10),r=o!==this.getFolderId(),s=Object.assign({},n);return(r||s.page<=1)&&delete s.page,b({base:`/${this.props.sectionConfig.reactRoutePath}`,folderId:o,fileId:l,query:s,action:i})}getFolderId(){return this.props.router.params&&this.props.router.params.folderId?parseInt(this.props.router.params.folderId,10):0}getFileId(){return this.props.router.params&&this.props.router.params.fileId?parseInt(this.props.router.params.fileId,10):0}getViewAction(){return this.props.router.params&&this.props.router.params.viewAction?this.props.router.params.viewAction:d.default.ACTIONS.EDIT_FILE}getSectionProps(){return{sectionConfig:this.props.sectionConfig,type:"admin",folderId:this.getFolderId(),viewAction:this.getViewAction(),fileId:this.getFileId(),query:this.getQuery(),getUrl:this.getUrl,onBrowse:this.handleBrowse,onReplaceUrl:this.handleReplaceUrl,resetFileDetails:this.handleResetDetails}}getQuery(){return(0,a.decodeQuery)(this.props.router.location.search)}handleBrowse(e,t,n,i){const o=this.getUrl(e,t,n,i);this.props.router.navigate(o)}handleReplaceUrl(e,t,n,i){const o=this.getUrl(e,t,n,i);this.props.router.navigate(o,{replace:!0})}handleResetDetails(e,t,n){const i=this.getUrl(e,t,n),o=this.getUrl(e,null,n);this.props.router.navigate(o,{replace:!0,state:{reset:!0,resetPath:i}})}render(){const{AssetAdminComponent:e}=this.props,t=this.props.router.location.state;return t&&t&&t.reset?i.default.createElement(o.Navigate,{to:t.resetPath,replace:!0}):this.props.sectionConfig?i.default.createElement(e,this.getSectionProps()):null}}t.Component=y,y.propTypes={sectionConfig:c.default,router:r.routerPropTypes,AssetAdminComponent:f.default.oneOfType([f.default.object,f.default.func])},y.defaultProps={AssetAdminComponent:s.default};t.default=(0,r.default)((0,l.connect)((function(e){return{sectionConfig:e.config.sections.find((e=>"SilverStripe\\AssetAdmin\\Controller\\AssetAdmin"===e.name))}}))(y))},2908:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.AssetAdminStateRouter=void 0;var i=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 i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&{}.hasOwnProperty.call(e,l)){var r=o?Object.getOwnPropertyDescriptor(e,l):null;r&&(r.get||r.set)?Object.defineProperty(i,l,r):i[l]=e[l]}return i.default=e,n&&n.set(e,i),i}(n(1594)),o=u(n(6935)),l=n(9040),r=n(4736),s=u(n(6379)),a=n(1021);function u(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 c={folderId:null,fileId:null,query:{},action:s.default.ACTIONS.EDIT_FILE};class p extends i.Component{constructor(e){super(e),this.handleBrowse=this.handleBrowse.bind(this),this.getUrl=this.getUrl.bind(this),this.state=Object.assign({},c,{folderId:e.folderId})}getUrl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:s.default.ACTIONS.EDIT_FILE;const o=parseInt(e||0,10),l=parseInt(t||0,10),a=this.getFolderId(),u=o!==a&&null!==a,d=Object.assign({},n);return(u||d.page<=1)&&delete d.page,(0,r.buildUrl)({base:this.props.sectionConfig.reactRoutePath,folderId:o,fileId:l,query:d,action:i})}getFolderId(){return null===this.state.folderId?null:parseInt(this.state.folderId||0,10)}getFileId(){return parseInt(this.state.fileId||this.props.fileId||0,10)}getViewAction(){return this.state.action||s.default.ACTIONS.EDIT_FILE}getSectionProps(){const e=Object.assign({},this.props,{folderId:this.getFolderId(),fileId:this.getFileId(),viewAction:this.getViewAction(),query:this.state.query,getUrl:this.getUrl,onBrowse:this.handleBrowse});return delete e.Component,e}handleBrowse(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:s.default.ACTIONS.EDIT_FILE;if(i&&-1===Object.values(s.default.ACTIONS).indexOf(i))throw new Error(`Invalid action provided: ${i}`);this.state.fileId!==t&&this.props.actions.resetFormStack(),this.setState({folderId:e,fileId:t,query:n,action:i})}render(){const e=this.getSectionProps(),t=this.props.Component;return i.default.createElement(t,e)}}function f(e){return{actions:{resetFormStack:()=>e((0,a.resetFormStack)())}}}t.AssetAdminStateRouter=p,p.propTypes={Component:o.default.elementType,sectionConfig:o.default.shape({url:o.default.string.isRequired}).isRequired,fileId:o.default.number};t.default=function(e){return(0,l.connect)((function(t){const n=t.config.sections.find((e=>"SilverStripe\\AssetAdmin\\Controller\\AssetAdmin"===e.name));return{Component:e,sectionConfig:n}}),f)(p)}},175:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var i=E(n(1594)),o=n(9367),l=n(9040),r=b(n(6935)),s=n(5207),a=E(n(4461)),u=E(n(762)),d=E(n(8918)),c=b(n(5815)),p=b(n(6022)),f=b(n(5609)),h=b(n(6177)),g=b(n(4014)),m=b(n(134)),v=b(n(7871));function b(e){return e&&e.__esModule?e:{default:e}}function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(y=function(e){return e?n:t})(e)}function E(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=y(t);if(n&&n.has(e))return n.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&{}.hasOwnProperty.call(e,l)){var r=o?Object.getOwnPropertyDescriptor(e,l):null;r&&(r.get||r.set)?Object.defineProperty(i,l,r):i[l]=e[l]}return i.default=e,n&&n.set(e,i),i}function _(){return _=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},_.apply(null,arguments)}const S=e=>{let{LoadingComponent:t,transition:n,files:o,onModalClose:l,onCancel:r,onConfirm:s,filesAreVersioned:a,archiveFiles:d,actions:p}=e;const[b,y]=(0,i.useState)(!0),[E,_]=(0,i.useState)({});(0,i.useEffect)((()=>{const e=h.default.getSection("SilverStripe\\AssetAdmin\\Controller\\AssetAdmin"),t=o.map((e=>e.id)).map((e=>`ids[]=${e}`)).join("&"),n=`${e.endpoints.readDescendantCounts.url}?${t}`;y(!0),f.default.get(n).then((async e=>{const t=await e.json();y(!1),_(t)})).catch((async e=>{const t=await(0,g.default)(e);p.toasts.error(t)}))}),[o]);let S=null;const C=a&&d?"AssetAdmin.ARCHIVE":"AssetAdmin.DELETE",w=a&&d?"Archive":"Delete";let F=[{label:c.default._t(C,w),handler:()=>s(o.map((e=>{let{id:t}=e;return t}))),color:"danger"},{label:c.default._t("AssetAdmin.CANCEL","Cancel"),handler:r}];if(b)S=i.default.createElement(t,null);else{const e=E.filter((e=>"folder"===e.type)).length,t=E.filter((e=>"file"===e.type)).length,n=E.reduce(((e,t)=>e+t.count),0),l={topLevelFolderCount:e,topLevelFileCount:t,descendantFileCount:n,filesAreVersioned:a,archiveFiles:d};S=i.default.createElement(v.default,l),t+n>0&&(F=[{label:c.default._t("AssetAdmin.CANCEL","Cancel"),handler:r,color:"primary"},{label:c.default._t(C,w),handler:()=>s(o.map((e=>{let{id:t}=e;return t}))),color:"danger"}])}const I=![u.CANCELING,u.DELETING].includes(n);return i.default.createElement(m.default,{body:S,isOpen:I,actions:F,onCancel:r,onClosed:l,filesAreVersioned:a,archiveFiles:d})};t.Component=S,S.propTypes={LoadingComponent:r.default.elementType,transition:r.default.oneOf(["canceling","deleting",!1]),files:r.default.arrayOf(p.default),descendantFileCounts:r.default.object,onCancel:r.default.func.isRequired,onModalClose:r.default.func.isRequired,onConfirm:r.default.func.isRequired,filesAreVersioned:r.default.bool.isRequired,archiveFiles:r.default.bool.isRequired,actions:r.default.object.isRequired};const C=(0,o.compose)((0,s.inject)(["Loading"],(e=>({LoadingComponent:e}))))(S);t.default=(0,o.compose)((0,l.connect)((e=>{let{assetAdmin:{confirmDeletion:t}}=e;return t}),(e=>({onCancel:()=>e(a.cancel()),onModalClose:()=>e(a.modalClose()),actions:{toasts:(0,o.bindActionCreators)(d,e),confirmation:(0,o.bindActionCreators)(a,e)}}))))((e=>{let{showConfirmation:t,files:n,...o}=e;return t&&n.length>0?i.default.createElement(C,_({},o,{files:n})):null}))},7871:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(5815)),o=r(n(1594)),l=r(n(6935));function r(e){return e&&e.__esModule?e:{default:e}}const s=e=>{let{topLevelFolderCount:t,topLevelFileCount:n,descendantFileCount:l,filesAreVersioned:r,archiveFiles:s}=e,a="AssetAdmin.BULK_ACTIONS_DELETE_WARNING",u="Ensure files are removed from content areas prior to deleting them, otherwise they will appear as broken links.";r&&s&&(a="AssetAdmin.BULK_ACTIONS_ARCHIVE_WARNING",u="Ensure files are removed from content areas prior to archiving them, otherwise they will appear as broken links.");const d=((e,t,n,o,l)=>{const r=t+n;if(r>0){let e="AssetAdmin.BULK_ACTIONS_DELETE_ITEMS_CONFIRM",t=["You're about to delete %s file(s) which may be used in your site's content.","Carefully check the file usage on the files before deleting the file(s)."].join(" ");return o&&l&&(e="AssetAdmin.BULK_ACTIONS_ARCHIVE_ITEMS_CONFIRM",t=["You're about to archive %s file(s) which may be used in your site's content.","Carefully check the file usage on the files before archiving the file(s)."].join(" ")),i.default.sprintf(i.default._t(e,t),r)}if(1===e){let e="AssetAdmin.BULK_ACTIONS_DELETE_FOLDER_CONFIRM",t="Are you sure you want to delete this folder?";return o&&l&&(e="AssetAdmin.BULK_ACTIONS_ARCHIVE_FOLDER_CONFIRM",t="Are you sure you want to archive this folder?"),i.default._t(e,t)}let s="AssetAdmin.BULK_ACTIONS_DELETE_FOLDERS_CONFIRM",a="Are you sure you want to delete these folders?";return o&&l&&(s="AssetAdmin.BULK_ACTIONS_ARCHIVE_FOLDERS_CONFIRM",a="Are you sure you want to archive these folders?"),i.default._t(s,a)})(t,n,l,r,s);return o.default.createElement(o.default.Fragment,null,o.default.createElement("p",null,d),n+l>0&&o.default.createElement("p",null,i.default._t(a,u)))};s.propTypes={topLevelFolderCount:l.default.number,topLevelFileCount:l.default.number,descendantFileCount:l.default.number},s.defaultProps={topLevelFolderCount:0,topLevelFileCount:0,descendantFileCount:0};t.default=s},134:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=s(n(5815)),o=s(n(1594)),l=s(n(6935)),r=n(3556);function s(e){return e&&e.__esModule?e:{default:e}}const a=e=>{let{isOpen:t,body:n,onCancel:l,actions:s,filesAreVersioned:a,archiveFiles:u}=e,d="AssetAdmin.CONFIRM_FILE_DELETION",c="Confirm deletion";return a&&u&&(d="AssetAdmin.CONFIRM_FILE_ARCHIVE",c="Confirm archive"),o.default.createElement(r.Modal,{isOpen:t,toggle:l},o.default.createElement(r.ModalHeader,{toggle:l},i.default._t(d,c)),o.default.createElement(r.ModalBody,null,n),o.default.createElement(r.ModalFooter,null,s.map((e=>{let{label:t,handler:n,color:i}=e;return o.default.createElement(r.Button,{key:t,color:i,onClick:n},t)}))))};a.propTypes={isOpen:l.default.bool.isRequired,body:l.default.node.isRequired,onCancel:l.default.func.isRequired,actions:l.default.arrayOf(l.default.shape({label:l.default.string.isRequired,handler:l.default.func,color:l.default.string})),filesAreVersioned:l.default.bool.isRequired,archiveFiles:l.default.bool.isRequired};t.default=a},1869:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var i=C(n(5815)),o=n(9040),l=n(9367),r=S(n(1594)),s=C(n(6379)),a=C(n(55)),u=C(n(8737)),d=S(n(9077)),c=C(n(6935)),p=n(5207),f=C(n(6177)),h=C(n(5609)),g=S(n(4461)),m=S(n(1021)),v=C(n(6923)),b=C(n(7008)),y=C(n(7675)),E=S(n(1584));function _(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(_=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=_(t);if(n&&n.has(e))return n.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&{}.hasOwnProperty.call(e,l)){var r=o?Object.getOwnPropertyDescriptor(e,l):null;r&&(r.get||r.set)?Object.defineProperty(i,l,r):i[l]=e[l]}return i.default=e,n&&n.set(e,i),i}function C(e){return e&&e.__esModule?e:{default:e}}function w(){return w=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},w.apply(null,arguments)}class F extends r.Component{constructor(e){super(e),this.getFormSchemaUrl=this.getFormSchemaUrl.bind(this),this.handleCancelKeyDown=this.handleCancelKeyDown.bind(this),this.handleClose=this.handleClose.bind(this),this.handleSubmit=this.handleSubmit.bind(this),this.handleAction=this.handleAction.bind(this),this.handleLoadingSuccess=this.handleLoadingSuccess.bind(this),this.handleLoadingError=this.handleLoadingError.bind(this),this.handleFetchingSchema=this.handleFetchingSchema.bind(this),this.closeModal=this.closeModal.bind(this),this.openModal=this.openModal.bind(this),this.createFn=this.createFn.bind(this),this.editorHeader=this.editorHeader.bind(this),this.state={openModal:!1,loadingForm:!1,loadingError:null,file:null}}componentDidMount(){this.refetchFile()}componentDidUpdate(e){e.fileId!==this.props.fileId&&null!==e.fileId&&this.refetchFile()}refetchFile(){const e=`${f.default.getSection("SilverStripe\\AssetAdmin\\Controller\\AssetAdminOpen").endpoints.read.url}/${this.props.fileId}`;h.default.get(e).then((e=>e.json())).then((e=>{this.setState({file:e})}))}getFormSchemaUrl(){const{schemaUrlQueries:e,schemaUrl:t,fileId:n}=this.props,i=b.default.parse(t),o=e.reduce(((e,t)=>{let{name:n,value:i}=t;return{...e,[n]:i}}),{});return b.default.format({...i,pathname:`${i.path}/${n}`,search:y.default.stringify(o)})}handleAction(e){const t=this.state.file;switch(e.currentTarget.name){case"action_addtocampaign":this.openModal(),e.preventDefault();break;case"action_replacefile":this.replaceFile(),e.preventDefault();break;case"action_downloadfile":this.downloadFile(),e.preventDefault();break;case"action_delete":this.props.actions.confirmDeletion.confirm([t]),e.preventDefault()}}handleCancelKeyDown(e){e.keyCode!==s.default.SPACE_KEY_CODE&&e.keyCode!==s.default.RETURN_KEY_CODE||this.handleClose(e)}handleSubmit(e,t,n){const{showingSubForm:i,actions:o}=this.props;return"function"==typeof this.props.onSubmit?this.props.onSubmit(e,t,n).finally((()=>{i&&-1!==["action_save","action_publish"].indexOf(t)&&o.modal.popFormStackEntry()})):n()}handleClose(e){const{showingSubForm:t,onClose:n,actions:i}=this.props;t?i.modal.popFormStackEntry():(n(),this.closeModal()),e&&e.preventDefault()}openModal(){this.setState({openModal:!0})}closeModal(){this.setState({openModal:!1})}replaceFile(){const e=document.querySelector(".dz-input-PreviewImage");e&&e.click()}downloadFile(){const e=this.state.file;!function(e,t){const n=document.createElement("a");n.download=t,n.href=e,document.body.appendChild(n),n.click(),document.body.removeChild(n)}(e.url,e.name),document.getElementById("Form_fileEditForm_PopoverActions").focus()}handleLoadingError(e){this.setState({loadingForm:!1,loadingError:e.errors[0]})}handleLoadingSuccess(){this.setState({loadingForm:!1,loadingError:null})}handleFetchingSchema(){this.setState({loadingForm:!0})}editorHeader(e){let{SchemaComponent:t,...n}=e;const{dialog:i,nextType:o,showingSubForm:l,actions:s,EditorHeaderComponent:a}=this.props,u=this.getFormSchemaUrl(),d=this.state.file;let c=E.buttonStates.SWITCH;i&&d&&"folder"!==d.type&&(c=l?E.buttonStates.ALWAYS_BACK:E.buttonStates.ONLY_BACK);const{formid:p}=n,f=o&&d&&"folder"!==d.type?()=>{s.modal.stashFormValues(p,u),s.modal.pushFormStackEntry(o)}:void 0,h={onCancel:this.handleClose,showButton:c,onDetails:f};return r.default.createElement(a,h,r.default.createElement(t,n))}createFn(e,t){if("AssetEditorHeaderFieldGroup"===t.name){const n=this.editorHeader,i={key:t.id,SchemaComponent:e,...t};return r.default.createElement(n,i)}return r.default.createElement(e,w({key:t.id},t))}render(){if(!this.state.file)return null;const{FormBuilderLoaderComponent:e,FormBuilderModalComponent:t}=this.props,n=this.getFormSchemaUrl(),o=`${this.props.addToCampaignSchemaUrl}/${this.props.fileId}`,l=(0,v.default)("panel","form--no-dividers","editor",{"editor--asset-dropzone--disable":!this.props.enableDropzone},this.props.className);let s=null;if(this.state.loadingError){let e=this.state.loadingError.value;404===this.state.loadingError.code&&(e=i.default._t("AssetAdmin.FILE_MISSING","File cannot be found")),e||(e=i.default._t("Admin.UNKNOWN_ERROR","An unknown error has occurred")),s=r.default.createElement("div",{className:"editor__file-preview-message--file-missing"},e)}const a=i.default._t("Admin.ADD_TO_CAMPAIGN","Add to campaign"),u=this.props.loadingComponent;return r.default.createElement("div",{className:l},r.default.createElement("div",{className:"editor__details fill-height"},r.default.createElement(e,{identifier:"AssetAdmin.EditForm",schemaUrl:n,onSubmit:this.handleSubmit,onAction:this.handleAction,onLoadingSuccess:this.handleLoadingSuccess,onLoadingError:this.handleLoadingError,onFetchingSchema:this.handleFetchingSchema,createFn:this.createFn,file:this.state.file}),s,r.default.createElement(t,{title:a,identifier:"AssetAdmin.AddToCampaign",isOpen:this.state.openModal,onClosed:this.closeModal,schemaUrl:o,bodyClassName:"modal__dialog",responseClassBad:"modal__response modal__response--error",responseClassGood:"modal__response modal__response--good"}),this.state.loadingForm&&r.default.createElement(u,null)))}}t.Component=F,F.propTypes={className:c.default.string,fileId:c.default.number.isRequired,enableDropzone:c.default.bool,dialog:c.default.bool,onClose:c.default.func.isRequired,onSubmit:c.default.func.isRequired,schemaUrl:c.default.string.isRequired,schemaUrlQueries:c.default.arrayOf(c.default.shape({name:c.default.string,value:c.default.any})),addToCampaignSchemaUrl:c.default.string,actions:c.default.object,showingSubForm:c.default.bool,nextType:c.default.string,EditorHeaderComponent:c.default.oneOfType([c.default.object,c.default.func]),FormBuilderLoaderComponent:c.default.oneOfType([c.default.object,c.default.func]),FormBuilderModalComponent:c.default.oneOfType([c.default.object,c.default.func])},F.defaultProps={EditorHeaderComponent:E.default,FormBuilderLoaderComponent:a.default,FormBuilderModalComponent:u.default};t.default=(0,l.compose)((0,p.inject)(["Loading"],(e=>({loadingComponent:e})),(()=>"AssetAdmin.Editor")),(0,o.connect)((function(e){let{assetAdmin:{gallery:t,modal:n}}=e;return{enableDropzone:t.enableDropzone,nextType:n.formSchema&&n.formSchema.nextType,showingSubForm:n.formSchemaStack&&n.formSchemaStack.length>1}}),(function(e){return{actions:{unsavedForms:(0,l.bindActionCreators)(d,e),confirmDeletion:(0,l.bindActionCreators)(g,e),modal:(0,l.bindActionCreators)(m,e)}}})))(F)},1584:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.buttonStates=void 0;var i=u(n(1594)),o=u(n(5815)),l=u(n(551)),r=u(n(2164)),s=u(n(6935)),a=u(n(6923));function u(e){return e&&e.__esModule?e:{default:e}}const d=e=>t=>{t.preventDefault(),e&&e()},c="ALWAYS_BACK",p="ALWAYS_CANCEL",f="SWITCH",h="ONLY_BACK",g="ONLY_CANCEL",m=t.buttonStates={ALWAYS_BACK:c,ALWAYS_CANCEL:p,SWITCH:f,ONLY_BACK:h,ONLY_CANCEL:g,NONE:"NONE"},v=e=>{let{onCancel:t,onDetails:n,showButton:s,children:u}=e;const m=d(t),v=[c,f,h].indexOf(s)>=0,b=[p,f,g].indexOf(s)>=0,y=(0,a.default)("editor-header__back-button","btn--icon-xl",{"editor-header__back-button--md-below":[f,h].indexOf(s)>=0}),E=(0,a.default)("editor-header__cancel-button","btn--icon-xl",{"editor-header__cancel-button--lg-above":[f,g].indexOf(s)>=0});return i.default.createElement("div",{className:"editor-header"},v&&i.default.createElement(r.default,{className:y,onClick:m}),i.default.createElement("div",{className:"editor-header__field"},u),n&&i.default.createElement(l.default,{onClick:d(n),icon:"edit-list",className:"editor-header__edit",outline:!0},o.default._t("AssetAdmin.DETAILS","Details")),b&&i.default.createElement("div",null,i.default.createElement(l.default,{icon:"cancel",className:E,noText:!0,onClick:m},o.default._t("AssetAdmin.CANCEL"))))};v.propTypes={onCancel:s.default.func,onDetails:s.default.func,showButton:s.default.oneOf(Object.keys(m).map((e=>m[e]))),children:s.default.node};t.default=v},5789:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.galleryViewPropTypes=t.galleryViewDefaultProps=t.default=t.Component=void 0;var i=O(n(1669)),o=O(n(5815)),l=R(n(1594)),r=n(9040),s=n(9367),a=O(n(853)),u=O(n(3229)),d=O(n(2853)),c=O(n(6609)),p=O(n(6379)),f=O(n(6621)),h=R(n(4201)),g=R(n(8918)),m=R(n(1369)),v=R(n(4461)),b=O(n(4350)),y=O(n(6177)),E=O(n(9247)),_=n(5207),S=O(n(6935)),C=O(n(5609)),w=O(n(7667)),F=O(n(5769)),I=O(n(3863));function A(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(A=function(e){return e?n:t})(e)}function R(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=A(t);if(n&&n.has(e))return n.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&{}.hasOwnProperty.call(e,l)){var r=o?Object.getOwnPropertyDescriptor(e,l):null;r&&(r.get||r.set)?Object.defineProperty(i,l,r):i[l]=e[l]}return i.default=e,n&&n.set(e,i),i}function O(e){return e&&e.__esModule?e:{default:e}}const M={DELETE:"delete",ARCHIVE:"archive",EDIT:"edit",MOVE:"move",PUBLISH:"publish",UNPUBLISH:"unpublish",INSERT:"insert",ADMIN:"admin",SELECT:"select"};class D extends l.Component{constructor(e){super(e),this.handleOpenFolder=this.handleOpenFolder.bind(this),this.handleOpenFile=this.handleOpenFile.bind(this),this.handleSelect=this.handleSelect.bind(this),this.handleAddedFile=this.handleAddedFile.bind(this),this.handlePreviewLoaded=this.handlePreviewLoaded.bind(this),this.handleCancelUpload=this.handleCancelUpload.bind(this),this.handleRemoveErroredUpload=this.handleRemoveErroredUpload.bind(this),this.handleUploadProgress=this.handleUploadProgress.bind(this),this.handleSending=this.handleSending.bind(this),this.handleSort=this.handleSort.bind(this),this.handleSetPage=this.handleSetPage.bind(this),this.handleSuccessfulUpload=this.handleSuccessfulUpload.bind(this),this.handleQueueComplete=this.handleQueueComplete.bind(this),this.handleFailedUpload=this.handleFailedUpload.bind(this),this.handleClearSearch=this.handleClearSearch.bind(this),this.handleEnableDropzone=this.handleEnableDropzone.bind(this),this.handleMoveFiles=this.handleMoveFiles.bind(this),this.handleBulkEdit=this.handleBulkEdit.bind(this),this.handleBulkPublish=this.handleBulkPublish.bind(this),this.handleBulkUnpublish=this.handleBulkUnpublish.bind(this),this.handleBulkMove=this.handleBulkMove.bind(this),this.handleBulkInsert=this.handleBulkInsert.bind(this),this.handleGroupSelect=this.handleGroupSelect.bind(this),this.handleClearSelection=this.handleClearSelection.bind(this),this.handleSelectAll=this.handleSelectAll.bind(this),this.toggleSelectConcat=this.toggleSelectConcat.bind(this),this.getSelectableFiles=this.getSelectableFiles.bind(this)}componentDidMount(){this.initSortDropdown(),window.addEventListener("keydown",this.toggleSelectConcat),window.addEventListener("keyup",this.toggleSelectConcat)}componentDidUpdate(e){this.initSortDropdown(),this.initFlushUploadFiles(e)}componentWillUnmount(){window.removeEventListener("keydown",this.toggleSelectConcat),window.removeEventListener("keyup",this.toggleSelectConcat)}initFlushUploadFiles(e){if("tile"!==this.props.view){this.getSortElement().off("change")}e.folderId!==this.props.folderId&&this.props.actions.queuedFiles.purgeUploadQueue()}getSortElement(){return(0,i.default)(this.gallery).find(".gallery__sort .dropdown")}getSearchMessage(e){const t=[];e.name&&t.push(o.default._t("AssetAdmin.SEARCHRESULTSMESSAGEKEYWORDS","with keywords '{name}'")),e.lastEditedFrom&&e.lastEditedTo?t.push(o.default._t("AssetAdmin.SEARCHRESULTSMESSAGEEDITEDBETWEEN","last edited between '{lastEditedFrom}' and '{lastEditedTo}'")):e.lastEditedFrom?t.push(o.default._t("AssetAdmin.SEARCHRESULTSMESSAGEEDITEDFROM","last edited after '{lastEditedFrom}'")):e.lastEditedTo&&t.push(o.default._t("AssetAdmin.SEARCHRESULTSMESSAGEEDITEDTO","last edited before '{lastEditedTo}'")),e.appCategory&&t.push(o.default._t("AssetAdmin.SEARCHRESULTSMESSAGECATEGORY","categorised as '{appCategory}'")),e.currentFolderOnly&&this.props.folder.title&&t.push(o.default._t("AssetAdmin.SEARCHRESULTSMESSAGELIMIT","limited to the folder '{folder}'"));const n=[t.slice(0,-1).join(`${o.default._t("AssetAdmin.JOIN",",")} `),t.slice(-1)].filter((e=>e)).join(` ${o.default._t("AssetAdmin.JOINLAST","and")} `);if(""===n)return"";const i={parts:o.default.inject(n,Object.assign({folder:this.props.folder.title},e,{appCategory:e.appCategory?e.appCategory.toLowerCase():void 0}))};return o.default.inject(o.default._t("AssetAdmin.SEARCHRESULTSMESSAGE","Search results {parts}"),i)}getSelection(e,t){const n=this.getSelectableFiles(),i=[e,t].map((e=>n.findIndex((t=>t.id===e)))).filter((e=>-1!==e)).sort(((e,t)=>e-t));if(2!==i.length)return i.map((e=>n[e].id));const[o,l]=i;return n.filter(((e,t)=>t>=o&&t<=l)).map((e=>e.id))}getSelectableFiles(){const e=this.props.files.filter((e=>e.id));return this.props.type===M.SELECT?e.filter((e=>"folder"!==e.type)):e}handleBulkInsert(e,t){this.props.onInsertMany(e,t)}handleBulkPublish(e,t){const n=t.map((e=>e.id));return n.length?(this.props.actions.gallery.setLoading(!0),this.props.onPublish(n).then((e=>{this.props.actions.gallery.setLoading(!1),this.props.actions.toasts.success(o.default.sprintf(o.default._t("AssetAdmin.BULK_ACTIONS_PUBLISH_SUCCESS","%s folders/files were successfully published."),e.length)),this.props.actions.gallery.deselectFiles()}))):(this.props.actions.gallery.deselectFiles(),Promise.resolve(!0))}handleBulkUnpublish(e,t){const n=t.filter((e=>e.published)).map((e=>e.id));return n.length?(this.props.actions.gallery.setLoading(!0),this.props.onUnpublish(n).then((e=>{this.props.actions.gallery.setLoading(!1),this.props.actions.toasts.success(o.default.sprintf(o.default._t("AssetAdmin.BULK_ACTIONS_UNPUBLISH_SUCCESS","%s folders/files were successfully unpublished."),e.length)),this.props.actions.gallery.deselectFiles()}))):(this.props.actions.gallery.deselectFiles(),Promise.resolve(!0))}initSortDropdown(){if("tile"===this.props.view){const e=this.getSortElement();e.chosen({allow_single_deselect:!0,disable_search_threshold:20}),e.off("change"),e.on("change",(()=>e.find(":selected")[0].click()))}}handleSort(e){this.props.actions.queuedFiles.purgeUploadQueue(),this.props.onSort(e)}handleSetPage(e){this.props.onSetPage(e)}handleCancelUpload(e){e.xhr.abort(),this.props.actions.queuedFiles.removeQueuedFile(e.queuedId)}handleRemoveErroredUpload(e){this.props.actions.queuedFiles.removeQueuedFile(e.queuedId)}handleAddedFile(e){this.props.actions.queuedFiles.addQueuedFile(e)}handlePreviewLoaded(e,t){this.props.actions.queuedFiles.updateQueuedFile(e.queuedId,t)}handleSending(e,t){this.props.actions.queuedFiles.updateQueuedFile(e._queuedId,{xhr:t})}handleUploadProgress(e,t){this.props.actions.queuedFiles.updateQueuedFile(e._queuedId,{progress:t})}handleSuccessfulUpload(e){const t=JSON.parse(e.xhr.response);if(void 0!==t[0].error)return void this.handleFailedUpload(e);this.props.actions.queuedFiles.succeedUpload(e._queuedId,t[0]),this.props.onSuccessfulUpload&&this.props.onSuccessfulUpload(t);const n=this.props.queuedFiles.items.reduce(((e,t)=>100!==t.progress?e+1:e),0);if(!this.props.fileId&&!this.props.selectedFiles.length&&0===n){const e=t.pop();this.props.onOpenFile(e.id)}}handleQueueComplete(){this.props.onSuccessfulUploadQueue&&this.props.onSuccessfulUploadQueue()}handleFailedUpload(e,t){const n=e.xhr&&e.xhr.status?(0,E.default)(e.xhr.status,e.xhr):"";this.props.actions.queuedFiles.failUpload(e._queuedId,t,n)}itemIsSelected(e){return this.props.selectedFiles.indexOf(e)>-1}toggleSelectConcat(e){this.props.actions.gallery.setConcatenateSelect(this.isConcat(e))}isConcat(e){return e.metaKey||e.ctrlKey||e.shiftKey}itemIsHighlighted(e){return this.props.fileId===e}hasOpenedItem(){return!!this.props.fileId}handleClearSearch(e){this.props.onClearSearch(e)}handleGroupSelect(e,t){const{setSelectedFiles:n,selectFiles:i}=this.props.actions.gallery,o=this.getSelectableFiles(),l=e.filter(((t,n)=>e.indexOf(t)===n&&o.find((e=>e.id===t)))),r=this.props.concatenateSelect||this.isConcat(t);if(null!==this.props.maxFilesSelect){let e=l.length;if(r){e=this.props.selectedFiles.filter((e=>!this.props.selectedFiles.includes(e))).concat(this.props.selectedFiles).length}if(e>=this.props.maxFilesSelect)return}r?i(l):n(l)}handleClearSelection(){this.props.actions.gallery.deselectFiles()}handleSelectAll(){const e=this.props.files.map((e=>e.id));this.handleGroupSelect(e,new Event("na"))}handleShouldStartSelecting(e){let t=e;for(;t&&t instanceof Element;){if(t.classList.contains("paginator-footer"))return!1;if(t.classList.contains("gallery__main--selectable"))break;t=t.parentNode}return!0}handleOpenFolder(e,t){e.preventDefault(),this.props.onOpenFolder(t.id)}handleOpenFile(e,t){e.preventDefault(),null!==t.created&&(this.props.selectedFiles.length&&1!==this.props.maxFilesSelect||this.props.type!==M.SELECT||this.handleSelect(e,t),this.props.onOpenFile(t.id,t))}handleSelect(e,t){const n=this.props.maxFilesSelect;let i=this.getSelectableFiles().filter((e=>e.id===t.id)).map((e=>e.id));if(1!==n)if(-1===this.props.selectedFiles.indexOf(t.id)){e.shiftKey&&(i=this.getSelection(this.props.lastSelected,t.id));if(this.props.selectedFiles.filter((e=>!i.includes(e))).concat(i).length>n&&null!==n)return;this.props.actions.gallery.selectFiles(i),this.props.actions.gallery.setLastSelected(t.id)}else this.props.actions.gallery.deselectFiles([t.id]),e.shiftKey&&this.props.actions.gallery.setLastSelected(null);else this.props.actions.gallery.setSelectedFiles(i)}handleEnableDropzone(e){this.props.actions.gallery.setEnableDropzone(e)}handleMoveFiles(e,t){const n=this.props.sectionConfig.endpoints.move.url;return C.default.post(n,{ids:t,folderID:e},{"X-SecurityID":y.default.get("SecurityID")}).then((()=>{const n=p.default.MOVE_SUCCESS_DURATION,i=`+${t.length}`;this.props.actions.gallery.setFileBadge(e,i,"success",n),"function"==typeof this.props.onMoveFilesSuccess&&this.props.onMoveFilesSuccess(e,t)})).catch((()=>{this.props.actions.toasts.error(o.default._t("AssetAdmin.FAILED_MOVE","There was an error moving the selected items."))}))}handleBulkEdit(e,t){this.handleOpenFile(e,t[0])}handleBulkMove(){this.props.actions.gallery.activateModal(p.default.MODAL_MOVE)}renderTransitionBulkActions(){return this.renderBulkActions()}renderBulkActions(){const{type:e,dialog:t,maxFilesSelect:n,files:i,selectedFiles:o,BulkActionsComponent:r,sectionConfig:s}=this.props,a=e===M.SELECT||t?e=>e.value===M.INSERT:e=>e.value!==M.INSERT,u=s.filesAreVersioned&&s.archiveFiles?e=>e.value!==M.DELETE:e=>e.value!==M.ARCHIVE,d=p.default.BULK_ACTIONS.filter(a).filter(u).map((e=>{if(e.callback)return e;switch(e.value){case M.DELETE:case M.ARCHIVE:return{...e,callback:(e,t)=>{this.props.actions.confirmDeletion.confirm(t)},confirm:void 0};case M.EDIT:return{...e,callback:this.handleBulkEdit};case M.MOVE:return{...e,callback:this.handleBulkMove};case M.PUBLISH:return{...e,callback:this.handleBulkPublish};case M.UNPUBLISH:return{...e,callback:this.handleBulkUnpublish};case M.INSERT:return{...e,callback:this.handleBulkInsert,color:"primary"};default:return e}})),c=o.map((e=>i.find((t=>t&&e===t.id)))).filter((e=>e));return c.length>0&&[M.ADMIN,M.SELECT].includes(e)?l.default.createElement(r,{actions:d,items:c,total:n,key:c.length>0,container:this.gallery,showCount:1!==n,onClearSelection:this.handleClearSelection,onSelectAll:this.handleSelectAll}):null}renderGalleryView(){const e="table"===this.props.view?c.default:d.default,t=this.props.files.map((e=>{const t=this.itemIsSelected(e.id),n=this.itemIsHighlighted(e.id),i=(e.queuedId?`queueId${e.queuedId}`:`id${e.id}`)+(t?"--selected":"");return{...e,selected:t,highlighted:n,key:i}})),{type:n,loading:i,dialog:o,page:r,totalCount:s,limit:a,sort:u,selectedFiles:p,badges:f,maxFilesSelect:h,sectionConfig:g}=this.props,m={selectableItems:n===M.SELECT||n===M.ADMIN&&(!h||h>1),selectableFolders:n!==M.SELECT&&!o,files:t,loading:i,page:r,totalCount:s,limit:a,sort:u,selectedFiles:p,badges:f,onSort:this.handleSort,onSetPage:this.handleSetPage,onOpenFile:this.handleOpenFile,onOpenFolder:this.handleOpenFolder,onSelect:this.handleSelect,onCancelUpload:this.handleCancelUpload,onDropFiles:this.handleMoveFiles,onRemoveErroredUpload:this.handleRemoveErroredUpload,sectionConfig:g,canDrag:n===M.ADMIN,maxFilesSelect:h};return l.default.createElement(e,m)}renderToolbar(){const{GalleryToolbar:e,sort:t,view:n,folder:i,onCreateFolder:o,onOpenFolder:r,onViewChange:s}=this.props,a={onSort:this.handleSort,onCreateFolder:o,onOpenFolder:r,onViewChange:s,view:n,sort:t,folder:i};return l.default.createElement(e,a)}render(){const{folder:e,loading:t,errorMessage:n,noticeMessage:i}=this.props,r=this.props.LoadingComponent;if(!e)return n?l.default.createElement("div",{className:"gallery__error flexbox-area-grow"},l.default.createElement("div",{className:"gallery__error-message"},l.default.createElement("h3",null,o.default._t("AssetAdmin.DROPZONE_RESPONSE_ERROR","Server responded with an error.")),n&&l.default.createElement("p",null,n))):t?l.default.createElement("div",{className:"flexbox-area-grow"},l.default.createElement(r,null)):l.default.createElement("div",{className:"flexbox-area-grow"},l.default.createElement("div",{className:"editor__file-preview-message--file-missing m-t-3"},o.default._t("Admin.UNKNOWN_ERROR","An unknown error has occurred")));const s=l.default.createElement("div",{className:"gallery_messages"},n&&l.default.createElement(f.default,{value:n,type:"danger"}),i&&l.default.createElement(f.default,{value:i,type:"success"})),u={height:p.default.THUMBNAIL_HEIGHT,width:p.default.THUMBNAIL_WIDTH},d={url:this.props.createFileApiUrl,method:this.props.createFileApiMethod,paramName:"Upload",clickable:"#upload-button",...this.props.sectionConfig.dropzoneOptions},c=this.props.securityId,h=this.props.folder.canEdit&&this.props.enableDropzone,g=["panel","panel--padded","panel--scrollable","gallery__main","fill-height"];this.props.type===M.INSERT&&g.push("insert-media-modal__main");const m=g;this.hasOpenedItem()&&m.push("gallery__main--has-opened-item");const v="tile"===this.props.view&&this.props.type===M.ADMIN;return l.default.createElement("div",{className:"flexbox-area-grow gallery__outer",ref:e=>{this.gallery=e}},this.renderTransitionBulkActions(),l.default.createElement(w.default,{isEnabled:v,onMouseDownOverNonDraggable:this.handleClearSelection,onSelectionChange:this.handleGroupSelect,onShouldStartSelecting:this.handleShouldStartSelecting},l.default.createElement(I.default,{onDragStartEnd:e=>this.handleEnableDropzone(!e),onDropFiles:this.handleMoveFiles,selectedFiles:this.props.selectedFiles,className:g.join(" ")},this.renderToolbar(),l.default.createElement(a.default,{name:"gallery-container",className:"flexbox-area-grow",canUpload:h,onAddedFile:this.handleAddedFile,onPreviewLoaded:this.handlePreviewLoaded,onError:this.handleFailedUpload,onSuccess:this.handleSuccessfulUpload,onQueueComplete:this.handleQueueComplete,onSending:this.handleSending,onUploadProgress:this.handleUploadProgress,preview:u,folderId:this.props.folderId,options:d,securityID:c,uploadButton:!1},s,this.renderGalleryView())),this.props.loading&&l.default.createElement(r,null),l.default.createElement(F.default,{sectionConfig:this.props.sectionConfig,folderId:this.props.folderId,onSuccess:this.props.onMoveFilesSuccess,onOpenFolder:this.props.onOpenFolder})))}}t.Component=D;const P={page:1,limit:15},L={sectionConfig:b.default,loading:S.default.bool,sort:S.default.string,files:S.default.arrayOf(S.default.shape({id:S.default.number,parent:S.default.shape({id:S.default.number})})).isRequired,selectedFiles:S.default.arrayOf(S.default.number),totalCount:S.default.number,page:S.default.number,limit:S.default.number,badges:S.default.arrayOf(S.default.shape({id:S.default.number,message:S.default.node,status:S.default.string})),onOpenFile:S.default.func.isRequired,onOpenFolder:S.default.func.isRequired,onSort:S.default.func.isRequired,onSetPage:S.default.func.isRequired,maxFilesSelect:S.default.number};t.galleryViewDefaultProps=Object.assign({},P,{selectableItems:!1}),t.galleryViewPropTypes=Object.assign({},L,{selectableItems:S.default.bool,selectableFolders:S.default.bool,onSelect:S.default.func,onCancelUpload:S.default.func,onRemoveErroredUpload:S.default.func});D.defaultProps=Object.assign({},P,{type:M.ADMIN,view:"tile",enableDropzone:!0,dialog:!1,BulkActionsComponent:u.default}),D.propTypes=Object.assign({},L,{onSuccessfulUpload:S.default.func,onSuccessfulUploadQueue:S.default.func,onCreateFolder:S.default.func,onMoveFilesSuccess:S.default.func,onPublish:S.default.func,onUnpublish:S.default.func,type:S.default.oneOf(["insert-media","insert-link",M.SELECT,M.ADMIN]),view:S.default.oneOf(["tile","table"]),lastSelected:S.default.number,dialog:S.default.bool,fileId:S.default.number,folderId:S.default.number.isRequired,folder:S.default.shape({id:S.default.number,title:S.default.string,parentId:S.default.number,canView:S.default.bool,canEdit:S.default.bool}),files:S.default.array,errorMessage:S.default.string,actions:S.default.object,securityId:S.default.string,onViewChange:S.default.func.isRequired,createFileApiUrl:S.default.string,createFileApiMethod:S.default.string,search:S.default.object,enableDropzone:S.default.bool,concatenateSelect:S.default.bool,GalleryToolbar:S.default.elementType,sorters:S.default.arrayOf(S.default.shape({field:S.default.string.isRequired,direction:S.default.oneOf(["asc","desc"]).isRequired,label:S.default.string.isRequired})).isRequired,BulkActionsComponent:S.default.oneOfType([S.default.object,S.default.func])});t.default=(0,s.compose)((0,_.inject)(["GalleryToolbar","Loading"],((e,t)=>({GalleryToolbar:e,LoadingComponent:t})),(()=>"AssetAdmin.Gallery")),(0,r.connect)((function(e,t){let{sort:n}=t;const{selectedFiles:i,errorMessage:o,noticeMessage:l,enableDropzone:r,badges:s,concatenateSelect:a,loading:u,sorters:d,lastSelected:c}=e.assetAdmin.gallery;return!n&&d&&d[0]&&(n=`${d[0].field},${d[0].direction}`),{lastSelected:c,selectedFiles:i,errorMessage:o,noticeMessage:l,enableDropzone:r,badges:s,concatenateSelect:a,loading:t.loading||u,queuedFiles:e.assetAdmin.queuedFiles,securityId:e.config.SecurityID,sorters:d,sort:n}}),(function(e){return{actions:{gallery:(0,s.bindActionCreators)(h,e),toasts:(0,s.bindActionCreators)(g,e),queuedFiles:(0,s.bindActionCreators)(m,e),confirmDeletion:(0,s.bindActionCreators)(v,e)}}})))(D)},3863:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=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 i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&{}.hasOwnProperty.call(e,l)){var r=o?Object.getOwnPropertyDescriptor(e,l):null;r&&(r.get||r.set)?Object.defineProperty(i,l,r):i[l]=e[l]}return i.default=e,n&&n.set(e,i),i}(n(1594)),o=u(n(6923)),l=u(n(2914)),r=u(n(6935)),s=n(3375),a=n(8831);function u(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)}function c(e){let{className:t,selectedFiles:n,onDragStartEnd:r,onDropFiles:u,children:d}=e;const[c,p]=(0,i.useState)(!1),[f,h]=(0,i.useState)(null),[g,m]=(0,i.useState)(null),[v,b]=(0,i.useState)(!1),y=(0,s.useSensors)((0,s.useSensor)(s.PointerSensor,{activationConstraint:{distance:10}})),E=[...n];E.includes(f)||E.push(f);const _=(0,i.useCallback)((e=>{"function"==typeof r&&r(!0),p(!0),h(e.active.id),m(e.active.data.current.props),b(!1)})),S=(0,i.useCallback)((e=>{"function"==typeof r&&r(!1),e.over&&"function"==typeof u&&(b(!0),u(e.over.id,E)),p(!1),h(null),m(null)})),C=v?0:250;return i.default.createElement("div",{className:(0,o.default)(t,{"gallery__main--dragging":c})},i.default.createElement(s.DndContext,{sensors:y,onDragStart:_,onDragEnd:S,modifiers:[a.snapCenterToCursor]},d,i.default.createElement(s.DragOverlay,{dropAnimation:{duration:C}},c&&i.default.createElement(l.default,{draggingItemProps:g,draggingItems:E}))))}c.contextTypes={dragDropManager:r.default.object},c.propTypes={selectedFiles:r.default.arrayOf(r.default.number).isRequired,className:r.default.string,onDropFiles:r.default.func,onDragStartEnd:r.default.func,children:r.default.oneOfType([r.default.arrayOf(r.default.node),r.default.node])};t.default=c},9478:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,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=r(t);if(n&&n.has(e))return n.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&{}.hasOwnProperty.call(e,l)){var s=o?Object.getOwnPropertyDescriptor(e,l):null;s&&(s.get||s.set)?Object.defineProperty(i,l,s):i[l]=e[l]}return i.default=e,n&&n.set(e,i),i}(n(1594)),l=(i=n(6935))&&i.__esModule?i:{default:i};function r(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(r=function(e){return e?n:t})(e)}class s extends o.Component{constructor(e){super(e),this.handleClick=this.handleClick.bind(this)}handleClick(e){e.preventDefault(),"function"==typeof this.props.onClick&&this.props.onClick(this.props.versionid)}render(){let e=null;return"Published"===this.props.status&&(e=o.default.createElement("p",null,o.default.createElement("span",{className:"history-item__status-flag"},this.props.status)," at ",this.props.date_formatted)),o.default.createElement("li",{className:"list-group-item history-item",onClick:this.handleClick},o.default.createElement("p",null,o.default.createElement("span",{className:"history-item__version"},"v.",this.props.versionid),o.default.createElement("span",{className:"history-item__date"},this.props.date_ago," ",this.props.author),this.props.summary),e)}}s.propTypes={versionid:l.default.number.isRequired,summary:l.default.oneOfType([l.default.bool,l.default.string]).isRequired,status:l.default.string,author:l.default.string,date_formatted:l.default.string,date_ago:l.default.string,onClick:l.default.func};t.default=s},9005:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var i=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 i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&{}.hasOwnProperty.call(e,l)){var r=o?Object.getOwnPropertyDescriptor(e,l):null;r&&(r.get||r.set)?Object.defineProperty(i,l,r):i[l]=e[l]}return i.default=e,n&&n.set(e,i),i}(n(1594)),o=n(9040),l=d(n(5609)),r=d(n(6177)),s=d(n(9478)),a=d(n(55)),u=d(n(6935));function d(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)}function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},p.apply(null,arguments)}class f extends i.Component{constructor(e){super(e),this.state={history:[],loadedDetails:!1},this.handleClick=this.handleClick.bind(this),this.handleBack=this.handleBack.bind(this),this.timer=null,this.api=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return l.default.createEndpointFetcher(Object.assign({},e,t?{defaultData:{SecurityID:r.default.get("SecurityID")}}:{}))}(e.sectionConfig.endpoints.history)}componentDidMount(){this.refreshHistoryIfNeeded()}componentDidUpdate(e){this.refreshHistoryIfNeeded(e)}componentWillUnmount(){clearTimeout(this.timer),this.timer=null}refreshHistoryIfNeeded(e){if(!e&&!this.state.loadedDetails||this.props.data.fileId!==e.data.fileId||this.props.data.latestVersionId!==e.data.latestVersionId){this.setState({loadedDetails:!1});const t=this.props?this.props.data.fileId:e.data.fileId;clearTimeout(this.timer),this.timer=setTimeout((()=>{this.api({fileId:t}).then((e=>{this.timer&&this.setState({history:e,loadedDetails:!0})}))}),250)}}handleClick(e){this.setState({viewDetails:e})}handleBack(e){e.preventDefault(),this.setState({viewDetails:null})}render(){if(!this.state.loadedDetails)return i.default.createElement("div",{className:"history-list history-list--loading"},"Loading...");if(this.state.viewDetails){const e=[this.props.historySchemaUrl,this.props.data.fileId,this.state.viewDetails].join("/"),t=["btn","btn-secondary","btn--icon-xl","btn--no-text","font-icon-left-open-big","history-list__back"].join(" ");return i.default.createElement("div",{className:"history-list"},i.default.createElement("a",{href:"#",className:t,onClick:this.handleBack}),i.default.createElement(a.default,{identifier:"AssetAdmin.HistoryList",schemaUrl:e,formTag:"div"}))}const e=this.state.history||[];return i.default.createElement("div",{className:"history-list"},i.default.createElement("ul",{className:"list-group list-group-flush history-list__list"},e.map((e=>i.default.createElement(s.default,p({key:e.versionid},e,{onClick:this.handleClick}))))))}}t.Component=f,f.propTypes={sectionConfig:u.default.shape({form:u.default.object,historyEndpoint:u.default.shape({url:u.default.string,method:u.default.string,responseFormat:u.default.string})}),historySchemaUrl:u.default.string,data:u.default.object},f.defaultProps={data:{fieldId:0}};t.default=(0,o.connect)((function(e){const t=e.config.sections.find((e=>"SilverStripe\\AssetAdmin\\Controller\\AssetAdmin"===e.name));return{sectionConfig:t,historySchemaUrl:t.form.fileHistoryForm.schemaUrl}}))(f)},6931:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var i=y(n(5815)),o=b(n(1594)),l=n(9367),r=n(9040),s=y(n(7917)),a=y(n(2908)),u=y(n(1957)),d=b(n(4201)),c=b(n(1021)),p=y(n(8737)),f=y(n(6923)),h=y(n(6935)),g=y(n(8268)),m=y(n(7675));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 i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&{}.hasOwnProperty.call(e,l)){var r=o?Object.getOwnPropertyDescriptor(e,l):null;r&&(r.get||r.set)?Object.defineProperty(i,l,r):i[l]=e[l]}return i.default=e,n&&n.set(e,i),i}function y(e){return e&&e.__esModule?e:{default:e}}class E extends o.Component{constructor(e){super(e),this.handleSubmit=this.handleSubmit.bind(this)}componentDidMount(){const{isOpen:e,onBrowse:t,setOverrides:n,fileAttributes:i,folderId:o}=this.props;e?"function"==typeof n&&i.ID&&(n(this.props),t(o,i.ID)):t(o||0)}componentDidUpdate(e){!this.props.isOpen&&e.isOpen&&(this.props.onBrowse(this.props.folderId),this.props.actions.gallery.deselectFiles()),"function"==typeof e.setOverrides&&this.props.isOpen&&!e.isOpen&&(e.setOverrides(this.props),this.props.onBrowse(this.props.folderId,this.props.fileAttributes?this.props.fileAttributes.ID:null))}getSectionProps(){return{...this.props,dialog:!0,toolbarChildren:this.renderToolbarChildren(),onSubmitEditor:this.handleSubmit,onReplaceUrl:this.props.onBrowse}}getModalProps(){const{onHide:e,onInsert:t,sectionConfig:n,schemaUrl:i,className:o,...l}=this.props;return{...l,className:(0,f.default)("insert-media-modal",o),size:"lg",showCloseButton:!1}}handleSubmit(e,t,n,i){return"action_insert"===t?this.props.onInsert(e,i):n()}renderToolbarChildren(){return o.default.createElement("button",{type:"button",className:"close btn-close modal__close-button insert-media-modal__close-button",onClick:this.props.onClosed,"aria-label":i.default._t("FormBuilderModal.CLOSE","Close")})}render(){const e=this.getModalProps(),t=this.getSectionProps(),n=this.props.isOpen?o.default.createElement(s.default,t):null;return o.default.createElement(p.default,e,n)}}t.Component=E,E.propTypes={sectionConfig:h.default.shape({url:h.default.string,form:h.default.object}),type:h.default.oneOf(["insert-media","insert-link","select","admin"]),schemaUrl:h.default.string,isOpen:h.default.bool,setOverrides:h.default.func,onInsert:h.default.func.isRequired,fileAttributes:h.default.shape({ID:h.default.number,AltText:h.default.string,Width:h.default.number,Height:h.default.number,Loading:h.default.string,TitleTooltip:h.default.string,Alignment:h.default.string,Description:h.default.string,TargetBlank:h.default.bool}),requireLinkText:h.default.bool,folderId:h.default.number,fileId:h.default.number,viewAction:h.default.string,query:h.default.object,getUrl:h.default.func,onBrowse:h.default.func.isRequired,onClosed:h.default.func,className:h.default.string,actions:h.default.object,maxFiles:h.default.number,fileSelected:h.default.bool},E.defaultProps={className:"",fileAttributes:{},type:"insert-media",folderId:0,maxFiles:1};t.default=(0,l.compose)(a.default,(0,r.connect)((function(e,t){const n=t.sectionConfig;if(!n)return{};let i=0;null!==t.folderId?i=t.folderId:t.folder&&(i=t.folder.id);const o=t.fileAttributes?t.fileAttributes.ID:t.fileId,l=e.assetAdmin.modal.formSchema,r={config:n,viewAction:t.viewAction,folderId:i,type:l&&l.type,fileId:o},{schemaUrl:s,targetId:a}=(0,g.default)(r);if(!s)return{};const u={};t.requireLinkText&&(u.requireLinkText=!0),t.fileSelected&&(u.fileSelected=!0);let d=m.default.stringify(u);return d=d?`?${d}`:"",{schemaUrl:`${s}/${a}${d}`,type:l&&l.type}}),(function(e){return{actions:{gallery:(0,l.bindActionCreators)(d,e),modal:(0,l.bindActionCreators)(c,e)}}})),u.default)(E)},5769:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=g(n(1594)),o=n(9040),l=n(9367),r=g(n(5815)),s=g(n(6379)),a=g(n(6935)),u=n(4201),d=n(8918),c=g(n(8737)),p=g(n(4350)),f=g(n(6177)),h=g(n(5609));function g(e){return e&&e.__esModule?e:{default:e}}class m extends i.default.Component{constructor(e){super(e),this.handleSubmit=this.handleSubmit.bind(this),this.timeout=null}handleSubmit(e){let{FolderID:t}=e;const{selectedFiles:n,onSuccess:i,onClosed:o,setNotice:l,setError:a,setBadge:u}=this.props;let d=this.props.sectionConfig.endpoints.move.url;return h.default.post(d,{ids:n,folderID:t},{"X-SecurityID":f.default.get("SecurityID")}).then((()=>(d=`${this.props.sectionConfig.endpoints.read.url}/${t}`,h.default.get(d)))).then((e=>e.json())).then((e=>{"function"==typeof i&&i(e.id,n),u(e.id,`${n.length}`,"success",s.default.MOVE_SUCCESS_DURATION),l(r.default.sprintf(r.default._t("AssetAdmin.MOVED_ITEMS_TO","Moved %s item(s) to %s"),n.length,e.name),[{label:r.default._t("AssetAdmin.GO_TO_FOLDER","Go to folder"),onClick:()=>this.props.onOpenFolder(e.id)}]),o()})).catch((()=>{a(r.default._t("AssetAdmin.FAILED_MOVE","There was an error moving the selected items."))}))}render(){const{isOpen:e,onClosed:t,title:n,folderId:o,sectionConfig:l}=this.props,{schemaUrl:r}=l.form.moveForm;return i.default.createElement(c.default,{title:n,isOpen:e,onClosed:t,onSubmit:this.handleSubmit,identifier:"AssetAdmin.MoveForm",schemaUrl:`${r}/${o}`})}}m.propTypes={sectionConfig:p.default,folderId:a.default.number.isRequired,isOpen:a.default.bool,onClosed:a.default.func,setNotice:a.default.func,setBadge:a.default.func,setError:a.default.func,title:a.default.string,onSuccess:a.default.func,onOpenFolder:a.default.func.isRequired,selectedFiles:a.default.array.isRequired},m.defaultProps={isOpen:!1};t.default=(0,l.compose)((0,o.connect)((function(e){const{modal:t,selectedFiles:n}=e.assetAdmin.gallery;return{isOpen:t===s.default.MODAL_MOVE,selectedFiles:n,title:r.default.sprintf(r.default._t("AssetAdmin.MOVE_ITEMS_TO","Move %s item(s) to..."),n.length)}}),(function(e){return{onClosed(){e((0,u.deactivateModal)())},setNotice(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];e((0,d.display)({text:t,type:"success",actions:n}))},setError(t){e((0,d.display)({text:t,type:"error"}))},setBadge(){e((0,u.setFileBadge)(...arguments))}}})))(m)},7667:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,o=n(7200),l=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 i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&{}.hasOwnProperty.call(e,l)){var r=o?Object.getOwnPropertyDescriptor(e,l):null;r&&(r.get||r.set)?Object.defineProperty(i,l,r):i[l]=e[l]}return i.default=e,n&&n.set(e,i),i}(n(1594)),r=(i=n(6935))&&i.__esModule?i:{default:i};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)}function a(e){const[t,n]=(0,l.useState)(null),[i,r]=(0,l.useState)([]),s=(0,l.useRef)([]),a=(0,l.useRef)([]),u=(0,l.useRef)(null),d=(0,l.useRef)(null),c=(0,l.useRef)({y:0,x:0});function p(e){if(e instanceof HTMLElement){let t=e;for(;t.parentElement&&!t.dataset.draggable;)t=t.parentElement;if("true"===t.dataset.draggable)return!0}return!1}function f(e){if(e instanceof HTMLElement){let t=e;for(;t.parentElement&&t!==d.current;)t=t.parentElement;if(t===d.current)return!1}return!0}const{DragSelection:h}=(0,o.useSelectionContainer)({onSelectionStart:e=>{n(e),s.current=u.current.querySelectorAll(".gallery-item"),a.current=[],Array.from(s.current).forEach((e=>{const{left:t,top:n,width:i,height:o}=e.getBoundingClientRect();a.current.push({left:t,top:n,width:i,height:o,item:e})})),c.current.y=d.current.scrollTop,c.current.x=d.current.scrollLeft},onSelectionChange:n=>{const l={...n,top:n.top-c.current.y+d.current.scrollTop,left:n.left-c.current.x+d.current.scrollLeft},u=[];a.current.forEach(((e,t)=>{(0,o.boxesIntersect)(l,e)&&u.push(t)}));const p=[];s.current.forEach(((e,t)=>{u.includes(t)&&p.push(1*e.getAttribute("data-id"))})),t&&p.length!==i.length&&("function"==typeof e.onSelectionChange&&e.onSelectionChange(p,t),r(p))},selectionProps:{style:{border:"1px dashed #999",backgroundColor:"transparent",zIndex:9e3}},shouldStartSelecting:t=>!p(t)&&!f(t)&&("function"!=typeof e.onShouldStartSelecting||e.onShouldStartSelecting(t)),isEnabled:e.isEnabled});return l.default.createElement("div",{onMouseDown:t=>function(t){const n=t.target;e.isEnabled&&!f(n)&&(p(n)||"function"==typeof e.onMouseDownOverNonDraggable&&e.onMouseDownOverNonDraggable())}(t),ref:d,style:{overflowY:"auto",overflowX:"clip",position:"relative",height:"100%"}},l.default.createElement("div",{style:{height:"100%"}},l.default.createElement(h,null),l.default.createElement("div",{ref:u,style:{height:"100%"}},e.children)))}a.propTypes={isEnabled:r.default.bool.isRequired,onMouseDownOverNonDraggable:r.default.func,onSelectionChange:r.default.func,onShouldStartSelecting:r.default.func};t.default=a},6609:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Component=h,t.default=void 0;var i=f(n(1594)),o=f(n(6935)),l=f(n(5815)),r=f(n(8123)),s=f(n(5950)),a=f(n(1990)),u=f(n(131)),d=n(5789),c=n(5716),p=n(1845);function f(e){return e&&e.__esModule?e:{default:e}}function h(e){const t={...d.galleryViewDefaultProps,...e};function n(e){return["title","lastEdited"].includes(e)}function o(e){const t=function(e){if(!e.queuedId||e.message&&"error"===e.message.type)return null;if(e.id>0)return i.default.createElement("div",{className:"gallery__progress-bar--complete"});const t={className:"gallery__progress-bar-progress",style:{width:`${e.progress}%`}};return i.default.createElement("div",{className:"gallery__progress-bar"},i.default.createElement("div",t))}(e);return i.default.createElement("div",{className:"fill-width"},i.default.createElement("div",{className:"flexbox-area-grow"},i.default.createElement("span",null,e.title),e.hasRestrictedAccess&&function(e){const{hasRestrictedAccess:t}=e,n={fileID:e.id,placement:"top",hasRestrictedAccess:t};return i.default.createElement(a.default,n)}(e),e.isTrackedFormUpload&&function(e){const{isTrackedFormUpload:t,hasRestrictedAccess:n}=e,o={fileID:e.id,placement:"top",isTrackedFormUpload:t,hasRestrictedAccess:n};return i.default.createElement(a.default,o)}(e)),t)}function f(e){return"gallery__table-row "+(e.original.highlighted?"gallery__table-row--highlighted":"")}function h(e,n){const i=[],o=e.column.id;if(n){const[e,n]=t.sort.split(",");e===o&&i.push("asc"===n?"sort-ascending":"sort-descending")}return"selected"===o?i.push("gallery__table-column--select"):"thumbnail"===o?i.push("gallery__table-column--image"):"title"===o&&i.push("gallery__table-column--title"),i.join(" ")}const g=[{id:"thumbnail",header:"",cell:e=>function(e){const t=e.url,n=e.queuedId&&!e.id,o=e.category||"false",l="gallery__table-image",r=[l],s={};return r.push(`${l}--${o}`),"image"===o&&t&&(s.backgroundImage=`url("${t}")`),n||t||"folder"===o||r.push(`${l}--error`),i.default.createElement("div",{className:r.join(" "),style:s})}(e.getValue())},{id:"title",header:l.default._t("File.TITLE","Title"),cell:e=>o(e.getValue())},{id:"status",header:l.default._t("File.STATUS","Status"),cell:e=>function(e){let t=[];return"folder"!==e.type&&(e.draft?t.push({key:"status-draft",status:"draft"}):e.modified&&t.push({key:"status-modified",status:"modified"})),t=t.map((e=>{let{...t}=e;return i.default.createElement(u.default,t)})),t?i.default.createElement("span",null,t):null}(e.getValue())},{id:"size",header:l.default._t("File.SIZE","Size"),cell:e=>function(e){if("folder"===e.type)return null;const t=(0,c.fileSize)(e.size);return i.default.createElement("span",null,t)}(e.getValue())},{id:"lastEdited",header:l.default._t("File.MODIFIED","Modified"),cell:e=>{return"folder"===(t=e.getValue()).type?null:(r.default.locale(l.default.detectLocale()),i.default.createElement("span",null,(0,r.default)(t.lastEdited).format("L LT")));var t}}];t.selectableItems&&g.unshift({id:"selected",header:"",cell:e=>function(e){if(t.selectableItems&&(t.selectableFolders||"folder"!==e.type)){const n={type:"checkbox",title:l.default._t("AssetAdmin.SELECT"),defaultChecked:e.selected,tabIndex:-1,onMouseDown:e=>function(e){e.preventDefault()}(e)};return![null,1].includes(t.maxFilesSelect)&&t.selectedFiles.length>=t.maxFilesSelect&&!e.selected&&(n.disabled=!0),i.default.createElement("input",n)}return null}(e.getValue())});const m=(0,p.createColumnHelper)(),v=(0,p.useReactTable)({data:t.files,columns:g.map((e=>m.accessor((e=>e),e))),getCoreRowModel:(0,p.getCoreRowModel)()});return 0!==t.files.length?i.default.createElement("table",{className:"gallery__table table table-hover"},i.default.createElement("thead",null,v.getHeaderGroups().map((e=>i.default.createElement("tr",{key:e.id},e.headers.map((e=>i.default.createElement("th",{key:e.id,onClick:()=>function(e){const i=e.column.id;if(!n(i))return;const o=t.sort!==`${i},asc`?"asc":"desc";t.onSort(`${i},${o}`)}(e),className:h(e,!0)},function(e){const t=e.column.columnDef.header;return n(e.column.id)?i.default.createElement("span",null,t):t}(e)))))))),i.default.createElement("tbody",null,v.getRowModel().rows.map((e=>i.default.createElement("tr",{key:e.id,className:f(e)},e.getVisibleCells().map((n=>i.default.createElement("td",{key:n.id,onClick:i=>function(e,n,i){const o=e.original;"selected"!==n.column.id||(i.stopPropagation(),i.preventDefault(),"function"!=typeof t.onSelect)?"folder"===o.type?t.onOpenFolder(i,o):t.onOpenFile(i,o):t.onSelect(i,o)}(e,n,i),className:h(n,!1)},function(e){return(0,p.flexRender)(e.column.columnDef.cell,e.getContext())}(n)))))))),i.default.createElement("tfoot",null,i.default.createElement("tr",null,i.default.createElement("td",{colSpan:g.length},i.default.createElement(s.default,{totalItems:t.totalCount,maxItemsPerPage:t.limit,currentPage:t.page,onChangePage:e=>function(e){t.onSetPage(e)}(e)}))))):t.loading?void 0:i.default.createElement("p",{className:"gallery__no-item-notice"},l.default._t("AssetAdmin.NOITEMSFOUND"))}h.propTypes={...d.galleryViewPropTypes,sort:o.default.string.isRequired};t.default=h},2853:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var i=d(n(5815)),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=u(t);if(n&&n.has(e))return n.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&{}.hasOwnProperty.call(e,l)){var r=o?Object.getOwnPropertyDescriptor(e,l):null;r&&(r.get||r.set)?Object.defineProperty(i,l,r):i[l]=e[l]}return i.default=e,n&&n.set(e,i),i}(n(1594)),l=n(5207),r=n(5789),s=d(n(5950)),a=d(n(6935));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)}function d(e){return e&&e.__esModule?e:{default:e}}class c extends o.Component{constructor(e){super(e),this.renderItem=this.renderItem.bind(this),this.handleSetPage=this.handleSetPage.bind(this)}handleSetPage(e){this.props.onSetPage(e)}folderFilter(e){return"folder"===e.type}fileFilter(e){return"folder"!==e.type}renderPagination(){if(this.props.totalCount<=this.props.limit)return null;const e={totalItems:this.props.totalCount,maxItemsPerPage:this.props.limit,currentPage:this.props.page,onChangePage:this.handleSetPage};return o.default.createElement(s.default,e)}renderItem(e){const{File:t,Folder:n,badges:i,sectionConfig:l,selectedFiles:r,selectableItems:s,selectableFolders:a}=this.props,u=i.find((t=>t.id===e.id));let d={sectionConfig:l,key:e.key,selectableKey:e.id,item:e,selectedFiles:r,badge:u,canDrag:this.props.canDrag};if(e.queuedId&&!e.id){const{onCancelUpload:e,onRemoveErroredUpload:t}=this.props;d={...d,onCancelUpload:e,onRemoveErroredUpload:t}}else{const{onOpenFolder:t,onOpenFile:n}=this.props;d={...d,onActivate:"folder"===e.type?t:n}}if(s&&(a||"folder"!==e.type)){const e=![null,1].includes(this.props.maxFilesSelect)&&this.props.selectedFiles.length>=this.props.maxFilesSelect,t=1===this.props.maxFilesSelect?d.onActivate:this.props.onSelect;d={...d,selectable:!0,onSelect:t,maxSelected:e}}return"folder"===e.type?o.default.createElement(n,d):o.default.createElement(t,d)}render(){return o.default.createElement("div",{className:"gallery__main-view--tile"},o.default.createElement("div",{className:"gallery__folders"},this.props.files.filter(this.folderFilter).map(this.renderItem)),o.default.createElement("div",{className:"gallery__files"},this.props.files.filter(this.fileFilter).map(this.renderItem)),0===this.props.files.length&&!this.props.loading&&o.default.createElement("p",{className:"gallery__no-item-notice"},i.default._t("AssetAdmin.NOITEMSFOUND")),o.default.createElement("div",{className:"gallery__load"},this.renderPagination()))}}t.Component=c,c.defaultProps=r.galleryViewDefaultProps,c.propTypes={...r.galleryViewPropTypes,File:a.default.elementType.isRequired,Folder:a.default.elementType.isRequired};const p=(0,l.inject)(["GalleryItemFile","GalleryItemFolder"],((e,t)=>({File:e,Folder:t})),(()=>"AssetAdmin.Gallery.ThumbnailView"));t.default=p(c)},9329:function(e,t,n){"use strict";var i=a(n(1669)),o=a(n(1594)),l=n(5145),r=n(3398),s=n(5207);function a(e){return e&&e.__esModule?e:{default:e}}function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},u.apply(null,arguments)}i.default.entwine("ss",(e=>{e(".js-injector-boot input.entwine-uploadfield").entwine({Component:null,ReactRoot:null,getContainer(){let t=this.siblings(".uploadfield-holder")[0];if(!t){const n=e('<div class="uploadfield-holder"></div>');this.before(n),t=n[0]}return t},onunmatch(){this._super();const e=this.getReactRoot();e&&(e.unmount(),this.setReactRoot(null))},onmatch(){const e=this.closest(".cms-content").attr("id"),t=e?{context:e}:{},n=(0,s.loadComponent)("UploadField",t);this.setComponent(n),this._super(),this.hide(),this.refresh()},onclick(e){e.preventDefault()},refresh(){const t=this.getAttributes(),n=e(this).closest("form"),i=this.getComponent();let r=this.getReactRoot();r||(r=(0,l.createRoot)(this.getContainer()),this.setReactRoot(r)),r.render(o.default.createElement(i,u({},t,{onChange:()=>{setTimeout((()=>{n.trigger("change")}),0)},noHolder:!0})))},getAttributes(){const t=e(this).data("state"),n=e(this).data("schema");return(0,r.schemaMerge)(n,t)}})}))},4350:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,o=(i=n(6935))&&i.__esModule?i:{default:i};const l=o.default.shape({url:o.default.string,limit:o.default.number,imageRetry:o.default.shape({minRetry:o.default.number,maxRetry:o.default.number,expiry:o.default.number}),form:o.default.object,dropzoneOptions:o.default.object});t.default=l},6022:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,o=(i=n(6935))&&i.__esModule?i:{default:i};const l=o.default.shape({canEdit:o.default.bool,canDelete:o.default.bool,canView:o.default.bool,exists:o.default.bool,type:o.default.string,smallThumbnail:o.default.string,thumbnail:o.default.string,width:o.default.number,height:o.default.number,category:o.default.oneOfType([o.default.bool,o.default.string]),id:o.default.number,url:o.default.string,title:o.default.string,progress:o.default.number,visibility:o.default.string,hasRestrictedAccess:o.default.bool,isTrackedFormUpload:o.default.bool});t.default=l},4886:function(e,t,n){"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;const o=(0,((i=n(2923))&&i.__esModule?i:{default:i}).default)({name:null,canDelete:!1,canEdit:!1,category:null,created:null,extension:null,filename:null,id:0,lastEdited:null,messages:null,owner:{id:0,title:null},parent:{filename:null,id:0,title:null},queuedId:null,size:null,title:null,type:null,url:null,xhr:null,thumbnail:null,smallThumbnail:null,height:null,width:null});t.default=o},8268:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let{config:{form:t},viewAction:n,folderId:i,fileId:o,type:s}=e,a=null,u=null;if(n===l)return a=t.folderCreateForm.schemaUrl,u=i,{schemaUrl:a,targetId:u};if(n===r&&o){switch(s){case"insert-media":a=t.fileInsertForm.schemaUrl;break;case"insert-link":a=t.fileEditorLinkForm.schemaUrl;break;case"select":a=t.fileSelectForm.schemaUrl;break;default:a=t.fileEditForm.schemaUrl}return u=o,{schemaUrl:a,targetId:u}}return{}};var i,o=(i=n(6379))&&i.__esModule?i:{default:i};const{CREATE_FOLDER:l,EDIT_FILE:r}=o.default.ACTIONS},9247:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(413===e)return o.default._t("AssetAdmin.ERROR_FILE_SIZE","File size limit exceeded");if(403===e&&t&&"string"==typeof t.response)return t.response;return o.default._t("AssetAdmin.ERROR_DEFAULT","Something went wrong, please try again")};var i,o=(i=n(5815))&&i.__esModule?i:{default:i}},6405:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={CONFIRM_DELETION_ASK:"CONFIRM_DELETION_ASK",CONFIRM_DELETION_CONFIRM:"CONFIRM_DELETION_CONFIRM",CONFIRM_DELETION_CANCEL:"CONFIRM_DELETION_CANCEL",CONFIRM_DELETION_RESET:"CONFIRM_DELETION_RESET",CONFIRM_DELETION_MODAL_CLOSE:"CONFIRM_DELETION_MODAL_CLOSE"}},4461:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cancel=function(){return{type:o.default.CONFIRM_DELETION_CANCEL,payload:{}}},t.confirm=function(e){return{type:o.default.CONFIRM_DELETION_ASK,payload:{files:e}}},t.deleting=function(){return{type:o.default.CONFIRM_DELETION_CONFIRM,payload:{}}},t.modalClose=function(){return{type:o.default.CONFIRM_DELETION_MODAL_CLOSE,payload:{}}},t.reset=function(){return{type:o.default.CONFIRM_DELETION_RESET,payload:{}}};var i,o=(i=n(6405))&&i.__esModule?i:{default:i}},9266:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initialState=t.default=void 0;var i,o=(i=n(6405))&&i.__esModule?i:{default:i},l=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=r(t);if(n&&n.has(e))return n.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&{}.hasOwnProperty.call(e,l)){var s=o?Object.getOwnPropertyDescriptor(e,l):null;s&&(s.get||s.set)?Object.defineProperty(i,l,s):i[l]=e[l]}return i.default=e,n&&n.set(e,i),i}(n(762));function r(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(r=function(e){return e?n:t})(e)}const s=t.initialState={showConfirmation:!1,files:[],transition:l.NO_TRANSITION};t.default=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case o.default.CONFIRM_DELETION_ASK:return{...s,showConfirmation:!0,files:t.payload.files};case o.default.CONFIRM_DELETION_CANCEL:if(e.showConfirmation)return{...e,transition:l.CANCELING};break;case o.default.CONFIRM_DELETION_CONFIRM:if(e.showConfirmation)return{...e,transition:l.DELETING};break;case o.default.CONFIRM_DELETION_MODAL_CLOSE:return{...e,showConfirmation:!1,transition:l.NO_TRANSITION};case o.default.CONFIRM_DELETION_RESET:return s}return e}},762:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NO_TRANSITION=t.DELETING=t.CANCELING=void 0;t.NO_TRANSITION=!1,t.CANCELING="canceling",t.DELETING="deleting"},6533:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={TOGGLE_SEARCH:"TOGGLE_SEARCH",OPEN_SEARCH:"OPEN_SEARCH",CLOSE_SEARCH:"CLOSE_SEARCH"}},9517:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.closeSearch=function(){return{type:o.default.CLOSE_SEARCH,payload:null}},t.openSearch=function(){return{type:o.default.OPEN_SEARCH,payload:null}},t.toggleSearch=function(){return{type:o.default.TOGGLE_SEARCH,payload:null}};var i,o=(i=n(6533))&&i.__esModule?i:{default:i}},2482:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=l(n(2923)),o=l(n(6533));function l(e){return e&&e.__esModule?e:{default:e}}const r={isOpen:!1};t.default=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r;switch((arguments.length>1?arguments[1]:void 0).type){case o.default.TOGGLE_SEARCH:return(0,i.default)({...e,isOpen:!e.isOpen});case o.default.OPEN_SEARCH:return(0,i.default)({...e,isOpen:!0});case o.default.CLOSE_SEARCH:return(0,i.default)({...e,isOpen:!1});default:return e}}},4913:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=["SET_LAST_SELECTED","SET_SELECTED_FILES","DESELECT_FILES","SELECT_FILES","LOAD_FILE_REQUEST","LOAD_FILE_SUCCESS","HIGHLIGHT_FILES","UPDATE_BATCH_ACTIONS","SET_NOTICE_MESSAGE","SET_ERROR_MESSAGE","SET_ENABLE_DROPZONE","SET_FILE_BADGE","CLEAR_FILE_BADGE","ACTIVATE_MODAL","DEACTIVATE_MODAL","CONCATENATE_SELECT","SET_LOADING"].reduce(((e,t)=>Object.assign(e,{[t]:`GALLERY.${t}`})),{})},4201:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.activateModal=function(e){return t=>{t({type:o.default.ACTIVATE_MODAL,payload:e})}},t.clearFileBadge=l,t.deactivateModal=function(){return e=>{e({type:o.default.DEACTIVATE_MODAL})}},t.deselectFiles=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t=>t({type:o.default.DESELECT_FILES,payload:{ids:e}})},t.loadFile=function(e,t){return n=>{n({type:o.default.LOAD_FILE_SUCCESS,payload:{id:e,file:t}})}},t.selectFiles=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t=>t({type:o.default.SELECT_FILES,payload:{ids:e}})},t.setConcatenateSelect=function(e){return t=>t({type:o.default.CONCATENATE_SELECT,payload:!!e})},t.setEnableDropzone=function(e){return t=>t({type:o.default.SET_ENABLE_DROPZONE,payload:{enableDropzone:e}})},t.setErrorMessage=function(e){return t=>t({type:o.default.SET_ERROR_MESSAGE,payload:{message:e}})},t.setFileBadge=function(e,t,n,i){return(r,s)=>{const{assetAdmin:a}=s(),u=a.gallery.badges.find((t=>t.id===e));u&&u.timer&&clearTimeout(u.timer);const d=i>0?setTimeout((()=>l(e)(r)),i):null;r({type:o.default.SET_FILE_BADGE,payload:{id:e,message:t,status:n,timer:d}})}},t.setLastSelected=function(e){return t=>{t({type:o.default.SET_LAST_SELECTED,payload:{id:e}})}},t.setLoading=function(e){return t=>{t({type:o.default.SET_LOADING,payload:!!e})}},t.setNoticeMessage=function(e){return t=>t({type:o.default.SET_NOTICE_MESSAGE,payload:{message:e}})},t.setSelectedFiles=function(e){return t=>{t({type:o.default.SET_SELECTED_FILES,payload:{files:e}})}};var i,o=(i=n(4913))&&i.__esModule?i:{default:i};function l(e){return t=>{t({type:o.default.CLEAR_FILE_BADGE,payload:{id:e}})}}},8518:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s,{type:t,payload:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(t){case l.default.SET_LAST_SELECTED:return{...e,lastSelected:n.id};case l.default.SET_FILE_BADGE:return{...e,badges:e.badges.filter((e=>e.id!==n.id)).concat([n])};case l.default.CLEAR_FILE_BADGE:return{...e,badges:e.badges.filter((e=>e.id!==n.id))};case l.default.SET_ENABLE_DROPZONE:return{...e,enableDropzone:n.enableDropzone};case l.default.SET_NOTICE_MESSAGE:return{...e,noticeMessage:n.message};case l.default.SET_ERROR_MESSAGE:return{...e,errorMessage:n.message};case l.default.LOAD_FILE_SUCCESS:{const t=e.files.find((e=>e.id===n.id));if(t){const o={...t,...n.file};return(0,i.default)({...e,files:e.files.map((e=>e.id===o.id?o:e))})}return e.folder.id===n.id?(0,i.default)({...e,folder:{...e.folder,...n.file}}):e}case l.default.SET_SELECTED_FILES:return(0,i.default)({...e,selectedFiles:Array.isArray(n.files)?n.files:[]});case l.default.SELECT_FILES:{let t=null;return t=null===n.ids?e.files.map((e=>e.id)):e.selectedFiles.concat(n.ids.filter((t=>-1===e.selectedFiles.indexOf(t)))),(0,i.default)({...e,selectedFiles:t})}case l.default.DESELECT_FILES:{let t=null;return t=null===n.ids?[]:e.selectedFiles.filter((e=>-1===n.ids.indexOf(e))),(0,i.default)({...e,selectedFiles:t})}case l.default.ACTIVATE_MODAL:return(0,i.default)({...e,modal:n});case l.default.DEACTIVATE_MODAL:return(0,i.default)({...e,modal:null});case l.default.CONCATENATE_SELECT:return(0,i.default)({...e,concatenateSelect:n});case l.default.SET_LOADING:return(0,i.default)({...e,loading:n});default:return e}};var i=r(n(2923)),o=r(n(5815)),l=r(n(4913));function r(e){return e&&e.__esModule?e:{default:e}}const s={selectedFiles:[],errorMessage:null,noticeMessage:null,enableDropzone:!0,modal:null,badges:[],concatenateSelect:!1,loading:!1,sorters:[{field:"title",direction:"asc",label:o.default._t("AssetAdmin.FILTER_TITLE_ASC","title a-z")},{field:"title",direction:"desc",label:o.default._t("AssetAdmin.FILTER_TITLE_DESC","title z-a")},{field:"lastEdited",direction:"desc",label:o.default._t("AssetAdmin.FILTER_DATE_DESC","newest")},{field:"lastEdited",direction:"asc",label:o.default._t("AssetAdmin.FILTER_DATE_ASC","oldest")}],lastSelected:null}},2804:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultImageFactory=t.default=void 0;var i=l(n(1838)),o=l(n(8632));function l(e){return e&&e.__esModule?e:{default:e}}const r={minRetry:0,maxRetry:0,expiry:0,onStatusChange:()=>null,onRetry:()=>null,onReset:()=>null,onTimeout:()=>null},s=(e,t,n)=>{const i=new Image;i.onload=t,i.onerror=n,i.src=e};t.defaultImageFactory=s;t.default=class{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;this.options={...r,...e},this.factory=t}loadImage(e){return this.options.minRetry&&o.default.lock(e)?this.loadImageLoop(e,this.options.minRetry):null}loadImageLoop(e,t){return this.options.onStatusChange(e,i.default.LOADING),new Promise(((t,n)=>this.factory(e,t,n))).then((()=>this.handleSuccess(e))).catch((()=>this.handleError(e,t)))}handleReset(e,t){this.options.onReset(e),t()}handleTimeout(e,t){const n=setTimeout(e,t);return this.options.onTimeout(n,t),n}handleSuccess(e){o.default.unlock(e),this.options.onStatusChange(e,i.default.SUCCESS)}handleFailure(e){return o.default.unlock(e),this.options.onStatusChange(e,i.default.FAILED),this.options.expiry?new Promise((t=>{this.handleTimeout((()=>this.handleReset(e,t)),1e3*this.options.expiry)})):null}handleError(e,t){return t>this.options.maxRetry?this.handleFailure(e):(this.options.onStatusChange(e,i.default.WAITING),this.handleRetry(e,t))}handleRetry(e,t){const n=new Promise((n=>{this.handleTimeout((()=>n(this.loadImageLoop(e,2*t))),1e3*t)}));return this.options.onRetry(e,t,n),n}setOnRetry(e){this.options.onRetry=e}setOnReset(e){this.options.onReset=e}setOnStatusChange(e){this.options.onStatusChange=e}setOnTimeout(e){this.options.onTimeout=e}}},2153:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={SET_STATUS:"IMAGE_LOAD_SET_STATUS",RESET:"IMAGE_LOAD_RESET"}},769:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadImage=function(e,t){return(n,l)=>{if(!e)return null;if(l().assetAdmin.imageLoad.files.find((t=>t.url===e)))return null;const r={...t,onStatusChange:(e,t)=>n({type:i.default.SET_STATUS,payload:{status:t,url:e}}),onReset:e=>n({type:i.default.RESET,payload:{url:e}})};return new o.default(r).loadImage(e)}};var i=l(n(2153)),o=l(n(2804));function l(e){return e&&e.__esModule?e:{default:e}}},8632:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;class n{constructor(){this.urls=[]}lock(e){return!(this.urls.indexOf(e)>=0)&&(this.urls=[...this.urls,e],!0)}unlock(e){this.urls=this.urls.filter((t=>t!==e))}}t.Component=n,window.ss=window.ss||{},window.ss.imagelocker=window.ss.imagelocker||new n;t.default=window.ss.imagelocker},5214:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,{type:t,payload:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(t){case o.default.SET_STATUS:return{...e,files:[...e.files.filter((e=>e.url!==n.url)),n]};case o.default.RESET:return{...e,files:[...e.files.filter((e=>e.url!==n.url))]};default:return e}};var i,o=(i=n(2153))&&i.__esModule?i:{default:i};const l={files:[]}},1838:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={DISABLED:"DISABLED",NONE:"NONE",SUCCESS:"SUCCESS",LOADING:"LOADING",WAITING:"WAITING",FAILED:"FAILED"}},2613:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={DEFINE_IMAGE_SIZE_PRESETS:"DEFINE_IMAGE_SIZE_PRESETS",INIT_FORM_SCHEMA_STACK:"INIT_FORM_SCHEMA_STACK",POP_FORM_SCHEMA:"POP_FORM_SCHEMA",PUSH_FORM_SCHEMA:"PUSH_FORM_SCHEMA",RESET:"RESET",RESET_FORM_STACK:"RESET_FORM_STACK"}},1021:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defineImageSizePresets=function(e){return{type:l.default.DEFINE_IMAGE_SIZE_PRESETS,payload:{imageSizePresets:e}}},t.initFormStack=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return{type:l.default.INIT_FORM_SCHEMA_STACK,payload:{formSchema:{type:e,nextType:t}}}},t.popFormStackEntry=function(){return{type:l.default.POP_FORM_SCHEMA}},t.pushFormStackEntry=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return{type:l.default.PUSH_FORM_SCHEMA,payload:{formSchema:{type:e,nextType:t}}}},t.reset=function(){return{type:l.default.RESET}},t.resetFormStack=function(){return{type:l.default.RESET_FORM_STACK}},t.stashFormValues=function(e,t){return(n,l)=>{const s=l(),a=(0,i.default)(s.form.formState,`${e}.values`),u=(0,i.default)(s.form.formSchemas,`${t}.schema.fields`);if(a){const e=Object.keys(a).filter((e=>null!==a[e]&&(0,r.default)(e,u))).map((e=>({name:e,value:a[e]})));n((0,o.setSchemaStateOverrides)(t,{fields:e}))}}};var i=s(n(6104)),o=n(2811),l=s(n(2613)),r=s(n(8896));function s(e){return e&&e.__esModule?e:{default:e}}},8178:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initialState=t.default=void 0;var i,o=(i=n(2613))&&i.__esModule?i:{default:i};const l=t.initialState={imageSizePresets:[],formSchemaStack:[],formSchema:void 0};t.default=function(){return e=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,{type:t,payload:n}=arguments.length>1?arguments[1]:void 0;const{formSchemaStack:i}=e;switch(t){case o.default.DEFINE_IMAGE_SIZE_PRESETS:return{...e,imageSizePresets:n.imageSizePresets};case o.default.PUSH_FORM_SCHEMA:return{...e,formSchemaStack:[...i,n.formSchema]};case o.default.INIT_FORM_SCHEMA_STACK:return{...e,formSchemaStack:[n.formSchema]};case o.default.POP_FORM_SCHEMA:return{...e,formSchemaStack:i.slice(0,-1)};case o.default.RESET:return l;case o.default.RESET_FORM_STACK:return{...e,formSchemaStack:i.slice(0,1)};default:return e}}(...arguments),{...e,formSchema:e.formSchemaStack.slice(-1).pop()};var e}},8896:function(e,t){"use strict";function n(e,t){let i;for(i=0;i<t.length;i++){const o=t[i];if(o.name===e)return o;if(o.children){const t=n(e,o.children);if(t)return t}}return!1}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){const i=n(e,t);return i&&"hidden"!==i.type&&"Structural"!==i.schemaType&&!i.readOnly&&!i.disabled},t.findField=n},8419:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={PREVIEWFIELD_ADD_FILE:"PREVIEWFIELD_ADD_FILE",PREVIEWFIELD_REMOVE_FILE:"PREVIEWFIELD_REMOVE_FILE",PREVIEWFIELD_UPDATE_FILE:"PREVIEWFIELD_UPDATE_FILE",PREVIEWFIELD_FAIL_UPLOAD:"PREVIEWFIELD_FAIL_UPLOAD",PREVIEWFIELD_UPDATE_STATUS:"PREVIEWFIELD_UPDATE_STATUS"}},8795:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addFile=function(e,t){return{type:o.default.PREVIEWFIELD_ADD_FILE,payload:{id:e,file:t}}},t.failUpload=function(e,t){return{type:o.default.PREVIEWFIELD_FAIL_UPLOAD,payload:{id:e,message:t}}},t.removeFile=function(e){return{type:o.default.PREVIEWFIELD_REMOVE_FILE,payload:{id:e}}},t.updateFile=function(e,t){return{type:o.default.PREVIEWFIELD_UPDATE_FILE,payload:{id:e,data:t}}},t.updateStatus=function(e,t){return{type:o.default.PREVIEWFIELD_UPDATE_STATUS,payload:{id:e,status:t}}};var i,o=(i=n(8419))&&i.__esModule?i:{default:i}},7668:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=l(n(2923)),o=l(n(8419));function l(e){return e&&e.__esModule?e:{default:e}}const r={};t.default=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case o.default.PREVIEWFIELD_ADD_FILE:return(0,i.default)(Object.assign({},e,{[t.payload.id]:t.payload.file}));case o.default.PREVIEWFIELD_FAIL_UPLOAD:return(0,i.default)(Object.assign({},e,{[t.payload.id]:Object.assign({},e[t.payload.id],t.payload.message)}));case o.default.PREVIEWFIELD_REMOVE_FILE:return(0,i.default)(Object.assign({},e,{[t.payload.id]:void 0}));case o.default.PREVIEWFIELD_UPDATE_FILE:return(0,i.default)(Object.assign({},e,{[t.payload.id]:Object.assign({},e[t.payload.id],t.payload.data)}));case o.default.PREVIEWFIELD_UPDATE_STATUS:return(0,i.default)(Object.assign({},e,{[t.payload.id]:Object.assign({},e[t.payload.id],t.payload.status)}));default:return e}}},5793:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={ADD_QUEUED_FILE:"ADD_QUEUED_FILE",FAIL_UPLOAD:"FAIL_UPLOAD",PURGE_UPLOAD_QUEUE:"PURGE_UPLOAD_QUEUE",REMOVE_QUEUED_FILE:"REMOVE_QUEUED_FILE",SUCCEED_UPLOAD:"SUCCEED_UPLOAD",UPDATE_QUEUED_FILE:"UPDATE_QUEUED_FILE"}},1369:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addQueuedFile=function(e){return t=>t({type:o.default.ADD_QUEUED_FILE,payload:{file:e}})},t.failUpload=function(e,t,n){return i=>{let l=t.message;return t.errors&&t.errors.length&&(l=t.errors[0]),"string"==typeof t&&(l={value:n||t,type:"error"}),i({type:o.default.FAIL_UPLOAD,payload:{queuedId:e,message:l}})}},t.purgeUploadQueue=function(){return e=>e({type:o.default.PURGE_UPLOAD_QUEUE,payload:null})},t.removeQueuedFile=function(e){return t=>t({type:o.default.REMOVE_QUEUED_FILE,payload:{queuedId:e}})},t.succeedUpload=function(e,t){return n=>n({type:o.default.SUCCEED_UPLOAD,payload:{queuedId:e,json:t}})},t.updateQueuedFile=function(e,t){return n=>n({type:o.default.UPDATE_QUEUED_FILE,payload:{queuedId:e,updates:t}})};var i,o=(i=n(5793))&&i.__esModule?i:{default:i}},8310:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=s(n(2923)),o=s(n(4886)),l=s(n(5815)),r=s(n(5793));function s(e){return e&&e.__esModule?e:{default:e}}const a={items:[]};t.default=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case r.default.ADD_QUEUED_FILE:return(0,i.default)({...e,items:[...e.items,{...o.default,...t.payload.file}]});case r.default.FAIL_UPLOAD:return(0,i.default)({...e,items:e.items.map((e=>e.queuedId===t.payload.queuedId?{...e,message:t.payload.message}:e))});case r.default.PURGE_UPLOAD_QUEUE:return(0,i.default)({...e,items:e.items.filter((e=>!e.id))});case r.default.REMOVE_QUEUED_FILE:return(0,i.default)({...e,items:e.items.filter((e=>e.queuedId!==t.payload.queuedId))});case r.default.SUCCEED_UPLOAD:return(0,i.default)({...e,items:e.items.map((e=>e.queuedId===t.payload.queuedId?{...e,...t.payload.json,messages:[{value:l.default._t("AssetAdmin.DROPZONE_SUCCESS_UPLOAD"),type:"success",extraClass:"success"}]}:e))});case r.default.UPDATE_QUEUED_FILE:return(0,i.default)({...e,items:e.items.map((e=>e.queuedId===t.payload.queuedId?{...e,...t.payload.updates}:e))});default:return e}}},7537:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={UPLOADFIELD_SET_FORM_SCHEMA_FILES_HASH:"UPLOADFIELD_SET_FORM_SCHEMA_FILES_HASH",UPLOADFIELD_ADD_FILE:"UPLOADFIELD_ADD_FILE",UPLOADFIELD_SET_FILES:"UPLOADFIELD_SET_FILES",UPLOADFIELD_REMOVE_FILE:"UPLOADFIELD_REMOVE_FILE",UPLOADFIELD_UPLOAD_FAILURE:"UPLOADFIELD_UPLOAD_FAILURE",UPLOADFIELD_UPLOAD_SUCCESS:"UPLOADFIELD_UPLOAD_SUCCESS",UPLOADFIELD_UPDATE_QUEUED_FILE:"UPLOADFIELD_UPDATE_QUEUED_FILE"}},1433:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addFile=function(e,t){return n=>n({type:o.default.UPLOADFIELD_ADD_FILE,payload:{fieldId:e,file:t}})},t.failUpload=function(e,t,n,i){return l=>{let r=n.message;return"string"==typeof n&&(r={value:i||n,type:"error"}),l({type:o.default.UPLOADFIELD_UPLOAD_FAILURE,payload:{fieldId:e,queuedId:t,message:r}})}},t.removeFile=function(e,t){return n=>n({type:o.default.UPLOADFIELD_REMOVE_FILE,payload:{fieldId:e,file:t}})},t.setFiles=function(e,t){return n=>n({type:o.default.UPLOADFIELD_SET_FILES,payload:{fieldId:e,files:t}})},t.setFormSchemaFilesHash=function(e,t){return n=>n({type:o.default.UPLOADFIELD_SET_FORM_SCHEMA_FILES_HASH,payload:{fieldId:e,hash:t}})},t.succeedUpload=function(e,t,n){return i=>i({type:o.default.UPLOADFIELD_UPLOAD_SUCCESS,payload:{fieldId:e,queuedId:t,json:n}})},t.updateQueuedFile=function(e,t,n){return i=>i({type:o.default.UPLOADFIELD_UPDATE_QUEUED_FILE,payload:{fieldId:e,queuedId:t,updates:n}})};var i,o=(i=n(7537))&&i.__esModule?i:{default:i}},2726:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(4886)),o=r(n(6595)),l=r(n(7537));function r(e){return e&&e.__esModule?e:{default:e}}const s={fields:{}},a={formSchemaFilesHash:null,files:[]};t.default=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s,t=arguments.length>1?arguments[1]:void 0;const n=(0,o.default)(e,t,a);switch(t.type){case l.default.UPLOADFIELD_SET_FORM_SCHEMA_FILES_HASH:return n((()=>({formSchemaFilesHash:t.payload.hash})));case l.default.UPLOADFIELD_ADD_FILE:return n((e=>e.files.find((e=>e.id===t.payload.file.id))?e:{...e,files:[...e.files,{...i.default,...t.payload.file}]}));case l.default.UPLOADFIELD_SET_FILES:return n((()=>({files:t.payload.files})));case l.default.UPLOADFIELD_UPLOAD_FAILURE:return n((e=>({files:e.files.map((e=>e.queuedId===t.payload.queuedId?Object.assign({},e,{message:t.payload.message}):e))})));case l.default.UPLOADFIELD_REMOVE_FILE:return n((e=>({files:e.files.filter((e=>!(t.payload.file.queuedId&&e.queuedId===t.payload.file.queuedId||t.payload.file.id&&e.id===t.payload.file.id)))})));case l.default.UPLOADFIELD_UPLOAD_SUCCESS:return n((e=>({files:e.files.map((e=>e.queuedId===t.payload.queuedId?Object.assign({},e,t.payload.json):e))})));case l.default.UPLOADFIELD_UPDATE_QUEUED_FILE:return n((e=>({files:e.files.map((e=>e.queuedId===t.payload.queuedId?Object.assign({},e,t.payload.updates):e))})));default:return e}}},1991:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=l(n(1594)),o=l(n(5815));function l(e){return e&&e.__esModule?e:{default:e}}t.default=e=>t=>{const n=t.onClick,l={...t,onClick(e,i){const{owners:l}=t.data;let r=null;r=l&&parseInt(l,10)>0?[o.default.inject(o.default._t("AssetAdmin.SINGLE_OWNED_WARNING_1","This file is being used in {count} other published section(s)."),{count:l}),o.default._t("AssetAdmin.SINGLE_OWNED_WARNING_2","Ensure files are removed from content areas prior to unpublishing them. Otherwise, they will appear as broken links."),o.default._t("AssetAdmin.SINGLE_OWNED_WARNING_3","Do you want to unpublish this file anyway?")].join("\n\n"):o.default._t("AssetAdmin.CONFIRMUNPUBLISH","Are you sure you want to unpublish this record?"),confirm(r)?n(e,i):e.preventDefault()}};return i.default.createElement(e,l)}},315:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.disabledTreeDropdownField=t.default=void 0;var i,o=(i=n(1594))&&i.__esModule?i:{default:i},l=n(9040),r=n(9367),s=n(7818);const a=e=>t=>{const{disabledIDs:n}=t,i=t.findTreeByPath||s.findTreeByPath,l={...t,findTreeByPath(e,t){const o=i(e,t),l=t.some((e=>n.includes(e)));return o?{...o,children:o.children.map((e=>({...e,disabled:l||n.includes(e.id)})))}:null}};return o.default.createElement(e,l)};t.disabledTreeDropdownField=a;const u=(0,r.compose)((0,l.connect)((e=>({disabledIDs:e.assetAdmin.gallery.selectedFiles}))),a);t.default=u},9021:function(e,t,n){var i;e.exports=(i=i||function(e,t){var i;if("undefined"!=typeof window&&window.crypto&&(i=window.crypto),"undefined"!=typeof self&&self.crypto&&(i=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(i=globalThis.crypto),!i&&"undefined"!=typeof window&&window.msCrypto&&(i=window.msCrypto),!i&&void 0!==n.g&&n.g.crypto&&(i=n.g.crypto),!i)try{i=n(477)}catch(e){}var o=function(){if(i){if("function"==typeof i.getRandomValues)try{return i.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof i.randomBytes)try{return i.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},l=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),r={},s=r.lib={},a=s.Base={extend:function(e){var t=l(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},u=s.WordArray=a.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:4*e.length},toString:function(e){return(e||c).stringify(this)},concat:function(e){var t=this.words,n=e.words,i=this.sigBytes,o=e.sigBytes;if(this.clamp(),i%4)for(var l=0;l<o;l++){var r=n[l>>>2]>>>24-l%4*8&255;t[i+l>>>2]|=r<<24-(i+l)%4*8}else for(var s=0;s<o;s+=4)t[i+s>>>2]=n[s>>>2];return this.sigBytes+=o,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push(o());return new u.init(t,e)}}),d=r.enc={},c=d.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,i=[],o=0;o<n;o++){var l=t[o>>>2]>>>24-o%4*8&255;i.push((l>>>4).toString(16)),i.push((15&l).toString(16))}return i.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i<t;i+=2)n[i>>>3]|=parseInt(e.substr(i,2),16)<<24-i%8*4;return new u.init(n,t/2)}},p=d.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,i=[],o=0;o<n;o++){var l=t[o>>>2]>>>24-o%4*8&255;i.push(String.fromCharCode(l))}return i.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i<t;i++)n[i>>>2]|=(255&e.charCodeAt(i))<<24-i%4*8;return new u.init(n,t)}},f=d.Utf8={stringify:function(e){try{return decodeURIComponent(escape(p.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return p.parse(unescape(encodeURIComponent(e)))}},h=s.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=f.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,i=this._data,o=i.words,l=i.sigBytes,r=this.blockSize,s=l/(4*r),a=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*r,d=e.min(4*a,l);if(a){for(var c=0;c<a;c+=r)this._doProcessBlock(o,c);n=o.splice(0,a),i.sigBytes-=d}return new u.init(n,d)},clone:function(){var e=a.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),g=(s.Hasher=h.extend({cfg:a.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){h.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new g.HMAC.init(e,n).finalize(t)}}}),r.algo={});return r}(Math),i)},4636:function(e,t,n){var i;e.exports=(i=n(9021),function(e){var t=i,n=t.lib,o=n.WordArray,l=n.Hasher,r=t.algo,s=[];!function(){for(var t=0;t<64;t++)s[t]=4294967296*e.abs(e.sin(t+1))|0}();var a=r.MD5=l.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var i=t+n,o=e[i];e[i]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}var l=this._hash.words,r=e[t+0],a=e[t+1],f=e[t+2],h=e[t+3],g=e[t+4],m=e[t+5],v=e[t+6],b=e[t+7],y=e[t+8],E=e[t+9],_=e[t+10],S=e[t+11],C=e[t+12],w=e[t+13],F=e[t+14],I=e[t+15],A=l[0],R=l[1],O=l[2],M=l[3];A=u(A,R,O,M,r,7,s[0]),M=u(M,A,R,O,a,12,s[1]),O=u(O,M,A,R,f,17,s[2]),R=u(R,O,M,A,h,22,s[3]),A=u(A,R,O,M,g,7,s[4]),M=u(M,A,R,O,m,12,s[5]),O=u(O,M,A,R,v,17,s[6]),R=u(R,O,M,A,b,22,s[7]),A=u(A,R,O,M,y,7,s[8]),M=u(M,A,R,O,E,12,s[9]),O=u(O,M,A,R,_,17,s[10]),R=u(R,O,M,A,S,22,s[11]),A=u(A,R,O,M,C,7,s[12]),M=u(M,A,R,O,w,12,s[13]),O=u(O,M,A,R,F,17,s[14]),A=d(A,R=u(R,O,M,A,I,22,s[15]),O,M,a,5,s[16]),M=d(M,A,R,O,v,9,s[17]),O=d(O,M,A,R,S,14,s[18]),R=d(R,O,M,A,r,20,s[19]),A=d(A,R,O,M,m,5,s[20]),M=d(M,A,R,O,_,9,s[21]),O=d(O,M,A,R,I,14,s[22]),R=d(R,O,M,A,g,20,s[23]),A=d(A,R,O,M,E,5,s[24]),M=d(M,A,R,O,F,9,s[25]),O=d(O,M,A,R,h,14,s[26]),R=d(R,O,M,A,y,20,s[27]),A=d(A,R,O,M,w,5,s[28]),M=d(M,A,R,O,f,9,s[29]),O=d(O,M,A,R,b,14,s[30]),A=c(A,R=d(R,O,M,A,C,20,s[31]),O,M,m,4,s[32]),M=c(M,A,R,O,y,11,s[33]),O=c(O,M,A,R,S,16,s[34]),R=c(R,O,M,A,F,23,s[35]),A=c(A,R,O,M,a,4,s[36]),M=c(M,A,R,O,g,11,s[37]),O=c(O,M,A,R,b,16,s[38]),R=c(R,O,M,A,_,23,s[39]),A=c(A,R,O,M,w,4,s[40]),M=c(M,A,R,O,r,11,s[41]),O=c(O,M,A,R,h,16,s[42]),R=c(R,O,M,A,v,23,s[43]),A=c(A,R,O,M,E,4,s[44]),M=c(M,A,R,O,C,11,s[45]),O=c(O,M,A,R,I,16,s[46]),A=p(A,R=c(R,O,M,A,f,23,s[47]),O,M,r,6,s[48]),M=p(M,A,R,O,b,10,s[49]),O=p(O,M,A,R,F,15,s[50]),R=p(R,O,M,A,m,21,s[51]),A=p(A,R,O,M,C,6,s[52]),M=p(M,A,R,O,h,10,s[53]),O=p(O,M,A,R,_,15,s[54]),R=p(R,O,M,A,a,21,s[55]),A=p(A,R,O,M,y,6,s[56]),M=p(M,A,R,O,I,10,s[57]),O=p(O,M,A,R,v,15,s[58]),R=p(R,O,M,A,w,21,s[59]),A=p(A,R,O,M,g,6,s[60]),M=p(M,A,R,O,S,10,s[61]),O=p(O,M,A,R,f,15,s[62]),R=p(R,O,M,A,E,21,s[63]),l[0]=l[0]+A|0,l[1]=l[1]+R|0,l[2]=l[2]+O|0,l[3]=l[3]+M|0},_doFinalize:function(){var t=this._data,n=t.words,i=8*this._nDataBytes,o=8*t.sigBytes;n[o>>>5]|=128<<24-o%32;var l=e.floor(i/4294967296),r=i;n[15+(o+64>>>9<<4)]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8),n[14+(o+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t.sigBytes=4*(n.length+1),this._process();for(var s=this._hash,a=s.words,u=0;u<4;u++){var d=a[u];a[u]=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8)}return s},clone:function(){var e=l.clone.call(this);return e._hash=this._hash.clone(),e}});function u(e,t,n,i,o,l,r){var s=e+(t&n|~t&i)+o+r;return(s<<l|s>>>32-l)+t}function d(e,t,n,i,o,l,r){var s=e+(t&i|n&~i)+o+r;return(s<<l|s>>>32-l)+t}function c(e,t,n,i,o,l,r){var s=e+(t^n^i)+o+r;return(s<<l|s>>>32-l)+t}function p(e,t,n,i,o,l,r){var s=e+(n^(t|~i))+o+r;return(s<<l|s>>>32-l)+t}t.MD5=l._createHelper(a),t.HmacMD5=l._createHmacHelper(a)}(Math),i.MD5)},871:function(e,t,n){var i=n(1021),o=n(4160);void 0===o.AssetAdminModalActions&&(o.AssetAdminModalActions=i),e.exports=i},4639:function(e,t,n){var i=n(4333),o=n(4160);void 0===o.InsertEmbedModal&&(o.InsertEmbedModal=i),e.exports=i},6166:function(e,t,n){var i=n(6931),o=n(4160);void 0===o.InsertMediaModal&&(o.InsertMediaModal=i),e.exports=i},4160:function(e,t,n){"use strict";e.exports=function(){if("object"==typeof globalThis)return globalThis;var e;try{e=this||new Function("return this")()}catch(e){if("object"==typeof window)return window;if("object"==typeof self)return self;if(void 0!==n.g)return n.g}return e}()},1549:function(e,t,n){var i=n(2032),o=n(3862),l=n(6721),r=n(2749),s=n(5749);function a(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}a.prototype.clear=i,a.prototype.delete=o,a.prototype.get=l,a.prototype.has=r,a.prototype.set=s,e.exports=a},79:function(e,t,n){var i=n(3702),o=n(80),l=n(4739),r=n(8655),s=n(1175);function a(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}a.prototype.clear=i,a.prototype.delete=o,a.prototype.get=l,a.prototype.has=r,a.prototype.set=s,e.exports=a},8223:function(e,t,n){var i=n(6110)(n(9325),"Map");e.exports=i},3661:function(e,t,n){var i=n(3040),o=n(7670),l=n(289),r=n(4509),s=n(2949);function a(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}a.prototype.clear=i,a.prototype.delete=o,a.prototype.get=l,a.prototype.has=r,a.prototype.set=s,e.exports=a},1873:function(e,t,n){var i=n(9325).Symbol;e.exports=i},4932:function(e){e.exports=function(e,t){for(var n=-1,i=null==e?0:e.length,o=Array(i);++n<i;)o[n]=t(e[n],n,e);return o}},6025:function(e,t,n){var i=n(5288);e.exports=function(e,t){for(var n=e.length;n--;)if(i(e[n][0],t))return n;return-1}},2552:function(e,t,n){var i=n(1873),o=n(659),l=n(9350),r=i?i.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":r&&r in Object(e)?o(e):l(e)}},5083:function(e,t,n){var i=n(1882),o=n(7296),l=n(3805),r=n(7473),s=/^\[object .+?Constructor\]$/,a=Function.prototype,u=Object.prototype,d=a.toString,c=u.hasOwnProperty,p=RegExp("^"+d.call(c).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!l(e)||o(e))&&(i(e)?p:s).test(r(e))}},7556:function(e,t,n){var i=n(1873),o=n(4932),l=n(6449),r=n(4394),s=i?i.prototype:void 0,a=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(l(t))return o(t,e)+"";if(r(t))return a?a.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}},3007:function(e){e.exports=function(e,t){var n=-1,i=e.length;for(t||(t=Array(i));++n<i;)t[n]=e[n];return t}},5481:function(e,t,n){var i=n(9325)["__core-js_shared__"];e.exports=i},4840:function(e,t,n){var i="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=i},2651:function(e,t,n){var i=n(4218);e.exports=function(e,t){var n=e.__data__;return i(t)?n["string"==typeof t?"string":"hash"]:n.map}},6110:function(e,t,n){var i=n(5083),o=n(392);e.exports=function(e,t){var n=o(e,t);return i(n)?n:void 0}},659:function(e,t,n){var i=n(1873),o=Object.prototype,l=o.hasOwnProperty,r=o.toString,s=i?i.toStringTag:void 0;e.exports=function(e){var t=l.call(e,s),n=e[s];try{e[s]=void 0;var i=!0}catch(e){}var o=r.call(e);return i&&(t?e[s]=n:delete e[s]),o}},392:function(e){e.exports=function(e,t){return null==e?void 0:e[t]}},2032:function(e,t,n){var i=n(1042);e.exports=function(){this.__data__=i?i(null):{},this.size=0}},3862:function(e){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},6721:function(e,t,n){var i=n(1042),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(i){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return o.call(t,e)?t[e]:void 0}},2749:function(e,t,n){var i=n(1042),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return i?void 0!==t[e]:o.call(t,e)}},5749:function(e,t,n){var i=n(1042);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=i&&void 0===t?"__lodash_hash_undefined__":t,this}},4218:function(e){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},7296:function(e,t,n){var i,o=n(5481),l=(i=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+i:"";e.exports=function(e){return!!l&&l in e}},3702:function(e){e.exports=function(){this.__data__=[],this.size=0}},80:function(e,t,n){var i=n(6025),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=i(t,e);return!(n<0)&&(n==t.length-1?t.pop():o.call(t,n,1),--this.size,!0)}},4739:function(e,t,n){var i=n(6025);e.exports=function(e){var t=this.__data__,n=i(t,e);return n<0?void 0:t[n][1]}},8655:function(e,t,n){var i=n(6025);e.exports=function(e){return i(this.__data__,e)>-1}},1175:function(e,t,n){var i=n(6025);e.exports=function(e,t){var n=this.__data__,o=i(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},3040:function(e,t,n){var i=n(1549),o=n(79),l=n(8223);e.exports=function(){this.size=0,this.__data__={hash:new i,map:new(l||o),string:new i}}},7670:function(e,t,n){var i=n(2651);e.exports=function(e){var t=i(this,e).delete(e);return this.size-=t?1:0,t}},289:function(e,t,n){var i=n(2651);e.exports=function(e){return i(this,e).get(e)}},4509:function(e,t,n){var i=n(2651);e.exports=function(e){return i(this,e).has(e)}},2949:function(e,t,n){var i=n(2651);e.exports=function(e,t){var n=i(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}},2224:function(e,t,n){var i=n(104);e.exports=function(e){var t=i(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},1042:function(e,t,n){var i=n(6110)(Object,"create");e.exports=i},9350:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},9325:function(e,t,n){var i=n(4840),o="object"==typeof self&&self&&self.Object===Object&&self,l=i||o||Function("return this")();e.exports=l},1802:function(e,t,n){var i=n(2224),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,l=/\\(\\)?/g,r=i((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(o,(function(e,n,i,o){t.push(i?o.replace(l,"$1"):n||e)})),t}));e.exports=r},7797:function(e,t,n){var i=n(4394);e.exports=function(e){if("string"==typeof e||i(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},7473:function(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},5288:function(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},6449:function(e){var t=Array.isArray;e.exports=t},1882:function(e,t,n){var i=n(2552),o=n(3805);e.exports=function(e){if(!o(e))return!1;var t=i(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},3805:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},346:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},4394:function(e,t,n){var i=n(2552),o=n(346);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==i(e)}},104:function(e,t,n){var i=n(3661);function o(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var i=arguments,o=t?t.apply(this,i):i[0],l=n.cache;if(l.has(o))return l.get(o);var r=e.apply(this,i);return n.cache=l.set(o,r)||l,r};return n.cache=new(o.Cache||i),n}o.Cache=i,e.exports=o},2072:function(e,t,n){var i=n(4932),o=n(3007),l=n(6449),r=n(4394),s=n(1802),a=n(7797),u=n(3222);e.exports=function(e){return l(e)?i(e,a):r(e)?[e]:o(s(u(e)))}},3222:function(e,t,n){var i=n(7556);e.exports=function(e){return null==e?"":i(e)}},896:function(e,t,n){"use strict";var i=n(9230).isUnitlessNumber,o=n(624),l=Array.isArray,r=Object.keys,s=/^(normal|none|(\b(url\([^)]*\)|chapter_counter|attr\([^)]*\)|(no-)?(open|close)-quote|inherit)((\b\s*)|$|\s+))+)$/;function a(e,t){return i[e]||"number"!=typeof t?"content"!==e||s.test(t)||(t="'"+t.replace(/'/g,"\\'")+"'"):t+="px",o(e)+": "+t+";  "}e.exports=function(e){var t="";if(!e||0===r(e).length)return t;for(var n=r(e),i=0,o=n.length;i<o;i++){var s=n[i],u=e[s];if(l(u))for(var d=0,c=u.length;d<c;d++)t+=a(s,u[d]);else t+=a(s,u)}return t}},9230:function(e){"use strict";var t={boxFlex:!0,boxFlexGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,strokeDashoffset:!0,strokeOpacity:!0,strokeWidth:!0};var n=["Webkit","ms","Moz","O"];Object.keys(t).forEach((function(e){n.forEach((function(n){t[function(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}(n,e)]=t[e]}))}));var i={isUnitlessNumber:t,shorthandPropertyExpansions:{background:{backgroundImage:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundColor:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0}}};e.exports=i},624:function(e){"use strict";var t=/^ms-/,n=/([A-Z])/g;e.exports=function(e){return function(e){return e.replace(n,"-$1").toLowerCase()}(e).replace(t,"-ms-")}},6104:function(e,t,n){"use strict";var i=n(4994);t.__esModule=!0,t.default=void 0;var o=i(n(2072)),l=function(e,t){if(!e)return e;var n=(0,o.default)(t),i=n.length;if(i){for(var l=e,r=0;r<i&&l;++r)l=l[n[r]];return l}};t.default=l},2164:function(e){"use strict";e.exports=BackButton},5609:function(e){"use strict";e.exports=Backend},2926:function(e){"use strict";e.exports=Badge},6418:function(e){"use strict";e.exports=Breadcrumb},551:function(e){"use strict";e.exports=Button},6177:function(e){"use strict";e.exports=Config},5716:function(e){"use strict";e.exports=DataFormat},2923:function(e){"use strict";e.exports=DeepFreezeStrict},2623:function(e){"use strict";e.exports=FieldHolder},1957:function(e){"use strict";e.exports=FileSchemaModalHandler},1990:function(e){"use strict";e.exports=FileStatusIcon},6621:function(e){"use strict";e.exports=FormAlert},55:function(e){"use strict";e.exports=FormBuilderLoader},8737:function(e){"use strict";e.exports=FormBuilderModal},5207:function(e){"use strict";e.exports=Injector},7008:function(e){"use strict";e.exports=NodeUrl},5950:function(e){"use strict";e.exports=Paginator},6935:function(e){"use strict";e.exports=PropTypes},1594:function(e){"use strict";e.exports=React},4518:function(e){"use strict";e.exports=ReactDom},5145:function(e){"use strict";e.exports=ReactDomClient},9040:function(e){"use strict";e.exports=ReactRedux},6194:function(e){"use strict";e.exports=ReactRouteRegister},6545:function(e){"use strict";e.exports=ReactRouterDom},3556:function(e){"use strict";e.exports=Reactstrap},9367:function(e){"use strict";e.exports=Redux},5381:function(e){"use strict";e.exports=ReduxForm},2811:function(e){"use strict";e.exports=SchemaActions},6303:function(e){"use strict";e.exports=Search},6175:function(e){"use strict";e.exports=SearchToggle},8918:function(e){"use strict";e.exports=ToastsActions},2294:function(e){"use strict";e.exports=Toolbar},7818:function(e){"use strict";e.exports=TreeDropdownField},9077:function(e){"use strict";e.exports=UnsavedFormsActions},131:function(e){"use strict";e.exports=VersionedBadge},6923:function(e){"use strict";e.exports=classnames},3432:function(e){"use strict";e.exports=getFormState},4014:function(e){"use strict";e.exports=getJsonErrorMessage},5815:function(e){"use strict";e.exports=i18n},1669:function(e){"use strict";e.exports=jQuery},8123:function(e){"use strict";e.exports=moment},7675:function(e){"use strict";e.exports=qs},6595:function(e){"use strict";e.exports=reduxFieldReducer},3398:function(e){"use strict";e.exports=schemaFieldValues},5125:function(e){"use strict";e.exports=ssUrlLib},6478:function(e){"use strict";e.exports=withRouter},477:function(){},7200:function(e,t,n){var i=n(1594),o=n(4518),l=n(896);function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=r(i),a=r(o),u=r(l);function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},d.apply(this,arguments)}var c=["style"],p=i.forwardRef((function(e,t){var n=e.style,o=void 0===n?{}:n,l=function(e,t){if(null==e)return{};var n,i,o={},l=Object.keys(e);for(i=0;i<l.length;i++)t.indexOf(n=l[i])>=0||(o[n]=e[n]);return o}(e,c),r=i.useRef(null),p=i.useRef(null),f=i.useState(0)[1];return i.useImperativeHandle(t,(function(){return{getBoundingClientRect:function(){var e;return null==(e=r.current)?void 0:e.getBoundingClientRect()},getParentBoundingClientRect:function(){var e,t;return null==r||null==(e=r.current)||null==(t=e.parentElement)?void 0:t.getBoundingClientRect()},drawSelectionBox:function(e){requestAnimationFrame((function(){if(p.current){var t=d({border:"1px solid #4C85D8",background:"rgba(155, 193, 239, 0.4)",position:"absolute",pointerEvents:"none"},o,{top:e.top,left:e.left,width:e.width,height:e.height});p.current.style.cssText=u.default(t)}}))},clearSelectionBox:function(){requestAnimationFrame((function(){p.current&&(p.current.style.cssText=u.default({top:0,left:0,width:0,height:0}))}))}}})),i.useEffect((function(){f((function(e){return e+1}))}),[]),s.default.createElement("div",{ref:r},r.current?a.default.createPortal(s.default.createElement("div",d({ref:p},l)),r.current):null)}));function f(e){var t=e.containerRef,n=e.onSelectionChange,o=e.onSelectionStart,l=e.onSelectionEnd,r=e.isEnabled,s=void 0===r||r,a=e.eventsElement,u=e.shouldStartSelecting,c=e.isValidSelectionStart,p=void 0===c?h:c,f=i.useRef(null),g=i.useRef(null),m=i.useRef(!1),v=i.useRef(n),b=i.useRef(o),y=i.useRef(l),E=i.useRef(),_=i.useRef(s);v.current=i.useCallback((function(e){E.current=n?requestAnimationFrame((function(){n(e)})):void 0}),[n]),b.current=o,y.current=l,_.current=s;var S=i.useCallback((function(){var e;f.current=null,g.current=null,m.current=!1,null==(e=t.current)||e.clearSelectionBox(),"number"==typeof E.current&&cancelAnimationFrame(E.current)}),[t]),C=i.useCallback((function(e,n){var i,o,l;return n||(n=null==(l=t.current)?void 0:l.getParentBoundingClientRect()),{x:e.clientX-("number"==typeof(null==(i=n)?void 0:i.left)?n.left:0),y:e.clientY-("number"==typeof(null==(o=n)?void 0:o.top)?n.top:0)}}),[t]),w=i.useCallback((function(e,n){if(f.current&&g.current){if(!n)return;var i,o=function(e){var t=e.startPoint,n=e.endPoint;return{left:Math.min(t.x,n.x),top:Math.min(t.y,n.y),width:Math.abs(t.x-n.x),height:Math.abs(t.y-n.y)}}({startPoint:f.current,endPoint:g.current}),l=d({},o,{top:o.top+((null==n?void 0:n.top)||0),left:o.left+((null==n?void 0:n.left)||0)});p(o)?(m.current||(null!=b&&b.current&&b.current(e),m.current=!0),null==(i=t.current)||i.drawSelectionBox(o),null==v.current||v.current(l)):m.current&&(null==v.current||v.current(l))}else S()}),[S,t]),F=i.useCallback((function(e){var n;if(f.current){var i=null==(n=t.current)?void 0:n.getParentBoundingClientRect();g.current=C(e,i),w(e,i)}}),[w,C,t]),I=i.useCallback((function(e){var t;0===e.button&&(g.current&&(null==y.current||y.current(e)),S(),document.body.style.removeProperty("user-select"),document.body.style.removeProperty("-webkit-user-select"),(a||document.body).removeEventListener("mousemove",F),null==(t=window)||t.removeEventListener("mouseup",I))}),[a,S,F]),A=i.useCallback((function(e){if(0===e.button&&_.current){var t;if("function"==typeof u&&!u(e.target))return;document.body.style.userSelect="none",document.body.style.webkitUserSelect="none",f.current=C(e),(a||document.body).addEventListener("mousemove",F),null==(t=window)||t.addEventListener("mouseup",I)}}),[a,C,F,I]);return i.useEffect((function(){return(a||document.body).addEventListener("mousedown",A),function(){(a||document.body).removeEventListener("mousedown",A),(a||document.body).removeEventListener("mousemove",F),window.removeEventListener("mouseup",I)}}),[a,A,F,I]),{cancelCurrentSelection:S}}function h(e){return function(e){return e.width*e.height}(e)>10}t.boxesIntersect=function(e,t){return e.left<=t.left+t.width&&e.left+e.width>=t.left&&e.top<=t.top+t.height&&e.top+e.height>=t.top},t.useSelectionContainer=function(e){var t=e||{},n=t.onSelectionChange,o=t.onSelectionEnd,l=t.onSelectionStart,r=t.isEnabled,a=void 0===r||r,u=t.selectionProps,c=void 0===u?{}:u,h=t.eventsElement,g=t.shouldStartSelecting,m=t.isValidSelectionStart,v=i.useRef(null);return{cancelCurrentSelection:f({containerRef:v,onSelectionEnd:o,onSelectionStart:l,onSelectionChange:n,isEnabled:a,eventsElement:h,shouldStartSelecting:g,isValidSelectionStart:m}).cancelCurrentSelection,DragSelection:i.useCallback((function(){return s.default.createElement(p,d({ref:v},c))}),[])}}},4994:function(e){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},1845:function(e,t,n){"use strict";var i=n(1594),o=n(3767);function l(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var r=l(i);t.flexRender=function(e,t){return e?function(e){return"function"==typeof e&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}(n=e)||"function"==typeof n||function(e){return"object"==typeof e&&"symbol"==typeof e.$$typeof&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}(n)?r.createElement(e,t):e:null;var n},t.useReactTable=function(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=r.useState((()=>({current:o.createTable(t)}))),[i,l]=r.useState((()=>n.current.initialState));return n.current.setOptions((t=>({...t,...e,state:{...i,...e.state},onStateChange:t=>{l(t),null==e.onStateChange||e.onStateChange(t)}}))),n.current},Object.keys(o).forEach((function(e){"default"===e||Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}})}))},9360:function(e,t,n){"use strict";var i=n(9090);const o={sum:(e,t,n)=>n.reduce(((t,n)=>{const i=n.getValue(e);return t+("number"==typeof i?i:0)}),0),min:(e,t,n)=>{let i;return n.forEach((t=>{const n=t.getValue(e);null!=n&&(i>n||void 0===i&&n>=n)&&(i=n)})),i},max:(e,t,n)=>{let i;return n.forEach((t=>{const n=t.getValue(e);null!=n&&(i<n||void 0===i&&n>=n)&&(i=n)})),i},extent:(e,t,n)=>{let i,o;return n.forEach((t=>{const n=t.getValue(e);null!=n&&(void 0===i?n>=n&&(i=o=n):(i>n&&(i=n),o<n&&(o=n)))})),[i,o]},mean:(e,t)=>{let n=0,i=0;if(t.forEach((t=>{let o=t.getValue(e);null!=o&&(o=+o)>=o&&(++n,i+=o)})),n)return i/n},median:(e,t)=>{if(!t.length)return;const n=t.map((t=>t.getValue(e)));if(!i.isNumberArray(n))return;if(1===n.length)return n[0];const o=Math.floor(n.length/2),l=n.sort(((e,t)=>e-t));return n.length%2!=0?l[o]:(l[o-1]+l[o])/2},unique:(e,t)=>Array.from(new Set(t.map((t=>t.getValue(e)))).values()),uniqueCount:(e,t)=>new Set(t.map((t=>t.getValue(e)))).size,count:(e,t)=>t.length};t.aggregationFns=o},5613:function(e,t){"use strict";t.createColumnHelper=function(){return{accessor:(e,t)=>"function"==typeof e?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e}}},4151:function(e,t,n){"use strict";var i=n(9090);t.createCell=function(e,t,n,o){const l={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(o),renderValue:()=>{var t;return null!=(t=l.getValue())?t:e.options.renderFallbackValue},getContext:i.memo((()=>[e,n,t,l]),((e,t,n,i)=>({table:e,column:t,row:n,cell:i,getValue:i.getValue,renderValue:i.renderValue})),i.getMemoOptions(e.options,"debugCells","cell.getContext"))};return e._features.forEach((i=>{null==i.createCell||i.createCell(l,n,t,e)}),{}),l}},481:function(e,t,n){"use strict";var i=n(9090);t.createColumn=function(e,t,n,o){var l,r;const s={...e._getDefaultColumnDef(),...t},a=s.accessorKey;let u,d=null!=(l=null!=(r=s.id)?r:a?"function"==typeof String.prototype.replaceAll?a.replaceAll(".","_"):a.replace(/\./g,"_"):void 0)?l:"string"==typeof s.header?s.header:void 0;if(s.accessorFn?u=s.accessorFn:a&&(u=a.includes(".")?e=>{let t=e;for(const e of a.split(".")){var n;t=null==(n=t)?void 0:n[e]}return t}:e=>e[s.accessorKey]),!d)throw new Error;let c={id:`${String(d)}`,accessorFn:u,parent:o,depth:n,columnDef:s,columns:[],getFlatColumns:i.memo((()=>[!0]),(()=>{var e;return[c,...null==(e=c.columns)?void 0:e.flatMap((e=>e.getFlatColumns()))]}),i.getMemoOptions(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:i.memo((()=>[e._getOrderColumnsFn()]),(e=>{var t;if(null!=(t=c.columns)&&t.length){let t=c.columns.flatMap((e=>e.getLeafColumns()));return e(t)}return[c]}),i.getMemoOptions(e.options,"debugColumns","column.getLeafColumns"))};for(const t of e._features)null==t.createColumn||t.createColumn(c,e);return c}},8937:function(e,t,n){"use strict";var i=n(9090);const o="debugHeaders";function l(e,t,n){var i;let o={id:null!=(i=n.id)?i:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const e=[],t=n=>{n.subHeaders&&n.subHeaders.length&&n.subHeaders.map(t),e.push(n)};return t(o),e},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach((t=>{null==t.createHeader||t.createHeader(o,e)})),o}const r={createTable:e=>{e.getHeaderGroups=i.memo((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((t,n,i,o)=>{var l,r;const a=null!=(l=null==i?void 0:i.map((e=>n.find((t=>t.id===e)))).filter(Boolean))?l:[],u=null!=(r=null==o?void 0:o.map((e=>n.find((t=>t.id===e)))).filter(Boolean))?r:[];return s(t,[...a,...n.filter((e=>!(null!=i&&i.includes(e.id)||null!=o&&o.includes(e.id)))),...u],e)}),i.getMemoOptions(e.options,o,"getHeaderGroups")),e.getCenterHeaderGroups=i.memo((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((t,n,i,o)=>s(t,n=n.filter((e=>!(null!=i&&i.includes(e.id)||null!=o&&o.includes(e.id)))),e,"center")),i.getMemoOptions(e.options,o,"getCenterHeaderGroups")),e.getLeftHeaderGroups=i.memo((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left]),((t,n,i)=>{var o;return s(t,null!=(o=null==i?void 0:i.map((e=>n.find((t=>t.id===e)))).filter(Boolean))?o:[],e,"left")}),i.getMemoOptions(e.options,o,"getLeftHeaderGroups")),e.getRightHeaderGroups=i.memo((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right]),((t,n,i)=>{var o;return s(t,null!=(o=null==i?void 0:i.map((e=>n.find((t=>t.id===e)))).filter(Boolean))?o:[],e,"right")}),i.getMemoOptions(e.options,o,"getRightHeaderGroups")),e.getFooterGroups=i.memo((()=>[e.getHeaderGroups()]),(e=>[...e].reverse()),i.getMemoOptions(e.options,o,"getFooterGroups")),e.getLeftFooterGroups=i.memo((()=>[e.getLeftHeaderGroups()]),(e=>[...e].reverse()),i.getMemoOptions(e.options,o,"getLeftFooterGroups")),e.getCenterFooterGroups=i.memo((()=>[e.getCenterHeaderGroups()]),(e=>[...e].reverse()),i.getMemoOptions(e.options,o,"getCenterFooterGroups")),e.getRightFooterGroups=i.memo((()=>[e.getRightHeaderGroups()]),(e=>[...e].reverse()),i.getMemoOptions(e.options,o,"getRightFooterGroups")),e.getFlatHeaders=i.memo((()=>[e.getHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),i.getMemoOptions(e.options,o,"getFlatHeaders")),e.getLeftFlatHeaders=i.memo((()=>[e.getLeftHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),i.getMemoOptions(e.options,o,"getLeftFlatHeaders")),e.getCenterFlatHeaders=i.memo((()=>[e.getCenterHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),i.getMemoOptions(e.options,o,"getCenterFlatHeaders")),e.getRightFlatHeaders=i.memo((()=>[e.getRightHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),i.getMemoOptions(e.options,o,"getRightFlatHeaders")),e.getCenterLeafHeaders=i.memo((()=>[e.getCenterFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),i.getMemoOptions(e.options,o,"getCenterLeafHeaders")),e.getLeftLeafHeaders=i.memo((()=>[e.getLeftFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),i.getMemoOptions(e.options,o,"getLeftLeafHeaders")),e.getRightLeafHeaders=i.memo((()=>[e.getRightFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),i.getMemoOptions(e.options,o,"getRightLeafHeaders")),e.getLeafHeaders=i.memo((()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()]),((e,t,n)=>{var i,o,l,r,s,a;return[...null!=(i=null==(o=e[0])?void 0:o.headers)?i:[],...null!=(l=null==(r=t[0])?void 0:r.headers)?l:[],...null!=(s=null==(a=n[0])?void 0:a.headers)?s:[]].map((e=>e.getLeafHeaders())).flat()}),i.getMemoOptions(e.options,o,"getLeafHeaders"))}};function s(e,t,n,i){var o,r;let s=0;const a=function(e,t){void 0===t&&(t=1),s=Math.max(s,t),e.filter((e=>e.getIsVisible())).forEach((e=>{var n;null!=(n=e.columns)&&n.length&&a(e.columns,t+1)}),0)};a(e);let u=[];const d=(e,t)=>{const o={depth:t,id:[i,`${t}`].filter(Boolean).join("_"),headers:[]},r=[];e.forEach((e=>{const s=[...r].reverse()[0];let a,u=!1;if(e.column.depth===o.depth&&e.column.parent?a=e.column.parent:(a=e.column,u=!0),s&&(null==s?void 0:s.column)===a)s.subHeaders.push(e);else{const o=l(n,a,{id:[i,t,a.id,null==e?void 0:e.id].filter(Boolean).join("_"),isPlaceholder:u,placeholderId:u?`${r.filter((e=>e.column===a)).length}`:void 0,depth:t,index:r.length});o.subHeaders.push(e),r.push(o)}o.headers.push(e),e.headerGroup=o})),u.push(o),t>0&&d(r,t-1)},c=t.map(((e,t)=>l(n,e,{depth:s,index:t})));d(c,s-1),u.reverse();const p=e=>e.filter((e=>e.column.getIsVisible())).map((e=>{let t=0,n=0,i=[0];e.subHeaders&&e.subHeaders.length?(i=[],p(e.subHeaders).forEach((e=>{let{colSpan:n,rowSpan:o}=e;t+=n,i.push(o)}))):t=1;return n+=Math.min(...i),e.colSpan=t,e.rowSpan=n,{colSpan:t,rowSpan:n}}));return p(null!=(o=null==(r=u[0])?void 0:r.headers)?o:[]),u}t.Headers=r,t.buildHeaderGroups=s},1151:function(e,t,n){"use strict";var i=n(9090),o=n(4151);t.createRow=(e,t,n,l,r,s,a)=>{let u={id:t,index:l,original:n,depth:r,parentId:a,_valuesCache:{},_uniqueValuesCache:{},getValue:t=>{if(u._valuesCache.hasOwnProperty(t))return u._valuesCache[t];const n=e.getColumn(t);return null!=n&&n.accessorFn?(u._valuesCache[t]=n.accessorFn(u.original,l),u._valuesCache[t]):void 0},getUniqueValues:t=>{if(u._uniqueValuesCache.hasOwnProperty(t))return u._uniqueValuesCache[t];const n=e.getColumn(t);return null!=n&&n.accessorFn?n.columnDef.getUniqueValues?(u._uniqueValuesCache[t]=n.columnDef.getUniqueValues(u.original,l),u._uniqueValuesCache[t]):(u._uniqueValuesCache[t]=[u.getValue(t)],u._uniqueValuesCache[t]):void 0},renderValue:t=>{var n;return null!=(n=u.getValue(t))?n:e.options.renderFallbackValue},subRows:null!=s?s:[],getLeafRows:()=>i.flattenBy(u.subRows,(e=>e.subRows)),getParentRow:()=>u.parentId?e.getRow(u.parentId,!0):void 0,getParentRows:()=>{let e=[],t=u;for(;;){const n=t.getParentRow();if(!n)break;e.push(n),t=n}return e.reverse()},getAllCells:i.memo((()=>[e.getAllLeafColumns()]),(t=>t.map((t=>o.createCell(e,u,t,t.id)))),i.getMemoOptions(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:i.memo((()=>[u.getAllCells()]),(e=>e.reduce(((e,t)=>(e[t.column.id]=t,e)),{})),i.getMemoOptions(e.options,"debugRows","getAllCellsByColumnId"))};for(let t=0;t<e._features.length;t++){const n=e._features[t];null==n||null==n.createRow||n.createRow(u,e)}return u}},2559:function(e,t,n){"use strict";var i=n(9090),o=n(481),l=n(8937),r=n(7932),s=n(7367),a=n(2724),u=n(6085),d=n(3748),c=n(1319),p=n(3185),f=n(8993),h=n(2888),g=n(3527),m=n(5575),v=n(3030),b=n(4489),y=n(5107);const E=[l.Headers,p.ColumnVisibility,u.ColumnOrdering,d.ColumnPinning,r.ColumnFaceting,s.ColumnFiltering,f.GlobalFaceting,h.GlobalFiltering,y.RowSorting,a.ColumnGrouping,g.RowExpanding,m.RowPagination,v.RowPinning,b.RowSelection,c.ColumnSizing];t.createTable=function(e){var t,n;const l=[...E,...null!=(t=e._features)?t:[]];let r={_features:l};const s=r._features.reduce(((e,t)=>Object.assign(e,null==t.getDefaultOptions?void 0:t.getDefaultOptions(r))),{});let a={...null!=(n=e.initialState)?n:{}};r._features.forEach((e=>{var t;a=null!=(t=null==e.getInitialState?void 0:e.getInitialState(a))?t:a}));const u=[];let d=!1;const c={_features:l,options:{...s,...e},initialState:a,_queue:e=>{u.push(e),d||(d=!0,Promise.resolve().then((()=>{for(;u.length;)u.shift()();d=!1})).catch((e=>setTimeout((()=>{throw e})))))},reset:()=>{r.setState(r.initialState)},setOptions:e=>{const t=i.functionalUpdate(e,r.options);r.options=(e=>r.options.mergeOptions?r.options.mergeOptions(s,e):{...s,...e})(t)},getState:()=>r.options.state,setState:e=>{null==r.options.onStateChange||r.options.onStateChange(e)},_getRowId:(e,t,n)=>{var i;return null!=(i=null==r.options.getRowId?void 0:r.options.getRowId(e,t,n))?i:`${n?[n.id,t].join("."):t}`},getCoreRowModel:()=>(r._getCoreRowModel||(r._getCoreRowModel=r.options.getCoreRowModel(r)),r._getCoreRowModel()),getRowModel:()=>r.getPaginationRowModel(),getRow:(e,t)=>{let n=(t?r.getPrePaginationRowModel():r.getRowModel()).rowsById[e];if(!n&&(n=r.getCoreRowModel().rowsById[e],!n))throw new Error;return n},_getDefaultColumnDef:i.memo((()=>[r.options.defaultColumn]),(e=>{var t;return e=null!=(t=e)?t:{},{header:e=>{const t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>{var t,n;return null!=(t=null==(n=e.renderValue())||null==n.toString?void 0:n.toString())?t:null},...r._features.reduce(((e,t)=>Object.assign(e,null==t.getDefaultColumnDef?void 0:t.getDefaultColumnDef())),{}),...e}}),i.getMemoOptions(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>r.options.columns,getAllColumns:i.memo((()=>[r._getColumnDefs()]),(e=>{const t=function(e,n,i){return void 0===i&&(i=0),e.map((e=>{const l=o.createColumn(r,e,i,n),s=e;return l.columns=s.columns?t(s.columns,l,i+1):[],l}))};return t(e)}),i.getMemoOptions(e,"debugColumns","getAllColumns")),getAllFlatColumns:i.memo((()=>[r.getAllColumns()]),(e=>e.flatMap((e=>e.getFlatColumns()))),i.getMemoOptions(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:i.memo((()=>[r.getAllFlatColumns()]),(e=>e.reduce(((e,t)=>(e[t.id]=t,e)),{})),i.getMemoOptions(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:i.memo((()=>[r.getAllColumns(),r._getOrderColumnsFn()]),((e,t)=>{let n=e.flatMap((e=>e.getLeafColumns()));return t(n)}),i.getMemoOptions(e,"debugColumns","getAllLeafColumns")),getColumn:e=>r._getAllFlatColumnsById()[e]};Object.assign(r,c);for(let e=0;e<r._features.length;e++){const t=r._features[e];null==t||null==t.createTable||t.createTable(r)}return r}},7932:function(e,t){"use strict";const n={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}};t.ColumnFaceting=n},7367:function(e,t,n){"use strict";var i=n(5232),o=n(9090);const l={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:o.makeStateUpdater("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],o=null==n?void 0:n.getValue(e.id);return"string"==typeof o?i.filterFns.includesString:"number"==typeof o?i.filterFns.inNumberRange:"boolean"==typeof o||null!==o&&"object"==typeof o?i.filterFns.equals:Array.isArray(o)?i.filterFns.arrIncludes:i.filterFns.weakEquals},e.getFilterFn=()=>{var n,l;return o.isFunction(e.columnDef.filterFn)?e.columnDef.filterFn:"auto"===e.columnDef.filterFn?e.getAutoFilterFn():null!=(n=null==(l=t.options.filterFns)?void 0:l[e.columnDef.filterFn])?n:i.filterFns[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,i,o;return(null==(n=e.columnDef.enableColumnFilter)||n)&&(null==(i=t.options.enableColumnFilters)||i)&&(null==(o=t.options.enableFilters)||o)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return null==(n=t.getState().columnFilters)||null==(n=n.find((t=>t.id===e.id)))?void 0:n.value},e.getFilterIndex=()=>{var n,i;return null!=(n=null==(i=t.getState().columnFilters)?void 0:i.findIndex((t=>t.id===e.id)))?n:-1},e.setFilterValue=n=>{t.setColumnFilters((t=>{const i=e.getFilterFn(),l=null==t?void 0:t.find((t=>t.id===e.id)),s=o.functionalUpdate(n,l?l.value:void 0);var a;if(r(i,s,e))return null!=(a=null==t?void 0:t.filter((t=>t.id!==e.id)))?a:[];const u={id:e.id,value:s};var d;return l?null!=(d=null==t?void 0:t.map((t=>t.id===e.id?u:t)))?d:[]:null!=t&&t.length?[...t,u]:[u]}))}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns();null==e.options.onColumnFiltersChange||e.options.onColumnFiltersChange((e=>{var i;return null==(i=o.functionalUpdate(t,e))?void 0:i.filter((e=>{const t=n.find((t=>t.id===e.id));if(t){if(r(t.getFilterFn(),e.value,t))return!1}return!0}))}))},e.resetColumnFilters=t=>{var n,i;e.setColumnFilters(t?[]:null!=(n=null==(i=e.initialState)?void 0:i.columnFilters)?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function r(e,t,n){return!(!e||!e.autoRemove)&&e.autoRemove(t,n)||void 0===t||"string"==typeof t&&!t}t.ColumnFiltering=l,t.shouldAutoRemoveFilter=r},2724:function(e,t,n){"use strict";var i=n(9360),o=n(9090);const l={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return null!=(t=null==(n=e.getValue())||null==n.toString?void 0:n.toString())?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:o.makeStateUpdater("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping((t=>null!=t&&t.includes(e.id)?t.filter((t=>t!==e.id)):[...null!=t?t:[],e.id]))},e.getCanGroup=()=>{var n,i;return(null==(n=e.columnDef.enableGrouping)||n)&&(null==(i=t.options.enableGrouping)||i)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return null==(n=t.getState().grouping)?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return null==(n=t.getState().grouping)?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],o=null==n?void 0:n.getValue(e.id);return"number"==typeof o?i.aggregationFns.sum:"[object Date]"===Object.prototype.toString.call(o)?i.aggregationFns.extent:void 0},e.getAggregationFn=()=>{var n,l;if(!e)throw new Error;return o.isFunction(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:"auto"===e.columnDef.aggregationFn?e.getAutoAggregationFn():null!=(n=null==(l=t.options.aggregationFns)?void 0:l[e.columnDef.aggregationFn])?n:i.aggregationFns[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>null==e.options.onGroupingChange?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,i;e.setGrouping(t?[]:null!=(n=null==(i=e.initialState)?void 0:i.grouping)?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const i=t.getColumn(n);return null!=i&&i.columnDef.getGroupingValue?(e._groupingValuesCache[n]=i.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,i)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var t;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!(null==(t=n.subRows)||!t.length)}}};t.ColumnGrouping=l,t.orderColumns=function(e,t,n){if(null==t||!t.length||!n)return e;const i=e.filter((e=>!t.includes(e.id)));return"remove"===n?i:[...t.map((t=>e.find((e=>e.id===t)))).filter(Boolean),...i]}},6085:function(e,t,n){"use strict";var i=n(9090),o=n(2724),l=n(3185);const r={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:i.makeStateUpdater("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=i.memo((e=>[l._getVisibleLeafColumns(t,e)]),(t=>t.findIndex((t=>t.id===e.id))),i.getMemoOptions(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var i;return(null==(i=l._getVisibleLeafColumns(t,n)[0])?void 0:i.id)===e.id},e.getIsLastColumn=n=>{var i;const o=l._getVisibleLeafColumns(t,n);return(null==(i=o[o.length-1])?void 0:i.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>null==e.options.onColumnOrderChange?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:null!=(n=e.initialState.columnOrder)?n:[])},e._getOrderColumnsFn=i.memo((()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode]),((e,t,n)=>i=>{let l=[];if(null!=e&&e.length){const t=[...e],n=[...i];for(;n.length&&t.length;){const e=t.shift(),i=n.findIndex((t=>t.id===e));i>-1&&l.push(n.splice(i,1)[0])}l=[...l,...n]}else l=i;return o.orderColumns(l,t,n)}),i.getMemoOptions(e.options,"debugTable","_getOrderColumnsFn"))}};t.ColumnOrdering=r},3748:function(e,t,n){"use strict";var i=n(9090);const o={getInitialState:e=>({columnPinning:{left:[],right:[]},...e}),getDefaultOptions:e=>({onColumnPinningChange:i.makeStateUpdater("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const i=e.getLeafColumns().map((e=>e.id)).filter(Boolean);t.setColumnPinning((e=>{var t,o,l,r,s,a;return"right"===n?{left:(null!=(l=null==e?void 0:e.left)?l:[]).filter((e=>!(null!=i&&i.includes(e)))),right:[...(null!=(r=null==e?void 0:e.right)?r:[]).filter((e=>!(null!=i&&i.includes(e)))),...i]}:"left"===n?{left:[...(null!=(s=null==e?void 0:e.left)?s:[]).filter((e=>!(null!=i&&i.includes(e)))),...i],right:(null!=(a=null==e?void 0:e.right)?a:[]).filter((e=>!(null!=i&&i.includes(e))))}:{left:(null!=(t=null==e?void 0:e.left)?t:[]).filter((e=>!(null!=i&&i.includes(e)))),right:(null!=(o=null==e?void 0:e.right)?o:[]).filter((e=>!(null!=i&&i.includes(e))))}}))},e.getCanPin=()=>e.getLeafColumns().some((e=>{var n,i,o;return(null==(n=e.columnDef.enablePinning)||n)&&(null==(i=null!=(o=t.options.enableColumnPinning)?o:t.options.enablePinning)||i)})),e.getIsPinned=()=>{const n=e.getLeafColumns().map((e=>e.id)),{left:i,right:o}=t.getState().columnPinning,l=n.some((e=>null==i?void 0:i.includes(e))),r=n.some((e=>null==o?void 0:o.includes(e)));return l?"left":!!r&&"right"},e.getPinnedIndex=()=>{var n,i;const o=e.getIsPinned();return o?null!=(n=null==(i=t.getState().columnPinning)||null==(i=i[o])?void 0:i.indexOf(e.id))?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=i.memo((()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right]),((e,t,n)=>{const i=[...null!=t?t:[],...null!=n?n:[]];return e.filter((e=>!i.includes(e.column.id)))}),i.getMemoOptions(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=i.memo((()=>[e._getAllVisibleCells(),t.getState().columnPinning.left]),((e,t)=>(null!=t?t:[]).map((t=>e.find((e=>e.column.id===t)))).filter(Boolean).map((e=>({...e,position:"left"})))),i.getMemoOptions(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=i.memo((()=>[e._getAllVisibleCells(),t.getState().columnPinning.right]),((e,t)=>(null!=t?t:[]).map((t=>e.find((e=>e.column.id===t)))).filter(Boolean).map((e=>({...e,position:"right"})))),i.getMemoOptions(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>null==e.options.onColumnPinningChange?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,i;return e.setColumnPinning(t?{left:[],right:[]}:null!=(n=null==(i=e.initialState)?void 0:i.columnPinning)?n:{left:[],right:[]})},e.getIsSomeColumnsPinned=t=>{var n;const i=e.getState().columnPinning;var o,l;return t?Boolean(null==(n=i[t])?void 0:n.length):Boolean((null==(o=i.left)?void 0:o.length)||(null==(l=i.right)?void 0:l.length))},e.getLeftLeafColumns=i.memo((()=>[e.getAllLeafColumns(),e.getState().columnPinning.left]),((e,t)=>(null!=t?t:[]).map((t=>e.find((e=>e.id===t)))).filter(Boolean)),i.getMemoOptions(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=i.memo((()=>[e.getAllLeafColumns(),e.getState().columnPinning.right]),((e,t)=>(null!=t?t:[]).map((t=>e.find((e=>e.id===t)))).filter(Boolean)),i.getMemoOptions(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=i.memo((()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((e,t,n)=>{const i=[...null!=t?t:[],...null!=n?n:[]];return e.filter((e=>!i.includes(e.id)))}),i.getMemoOptions(e.options,"debugColumns","getCenterLeafColumns"))}};t.ColumnPinning=o},1319:function(e,t,n){"use strict";var i=n(9090),o=n(3185);const l={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},r={getDefaultColumnDef:()=>l,getInitialState:e=>({columnSizing:{},columnSizingInfo:{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]},...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:i.makeStateUpdater("columnSizing",e),onColumnSizingInfoChange:i.makeStateUpdater("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,i,o;const r=t.getState().columnSizing[e.id];return Math.min(Math.max(null!=(n=e.columnDef.minSize)?n:l.minSize,null!=(i=null!=r?r:e.columnDef.size)?i:l.size),null!=(o=e.columnDef.maxSize)?o:l.maxSize)},e.getStart=i.memo((e=>[e,o._getVisibleLeafColumns(t,e),t.getState().columnSizing]),((t,n)=>n.slice(0,e.getIndex(t)).reduce(((e,t)=>e+t.getSize()),0)),i.getMemoOptions(t.options,"debugColumns","getStart")),e.getAfter=i.memo((e=>[e,o._getVisibleLeafColumns(t,e),t.getState().columnSizing]),((t,n)=>n.slice(e.getIndex(t)+1).reduce(((e,t)=>e+t.getSize()),0)),i.getMemoOptions(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing((t=>{let{[e.id]:n,...i}=t;return i}))},e.getCanResize=()=>{var n,i;return(null==(n=e.columnDef.enableResizing)||n)&&(null==(i=t.options.enableColumnResizing)||i)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let t=0;const n=e=>{var i;e.subHeaders.length?e.subHeaders.forEach(n):t+=null!=(i=e.column.getSize())?i:0};return n(e),t},e.getStart=()=>{if(e.index>0){const t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=n=>{const i=t.getColumn(e.column.id),o=null==i?void 0:i.getCanResize();return l=>{if(!i||!o)return;if(null==l.persist||l.persist(),u(l)&&l.touches&&l.touches.length>1)return;const r=e.getSize(),s=e?e.getLeafHeaders().map((e=>[e.column.id,e.column.getSize()])):[[i.id,i.getSize()]],d=u(l)?Math.round(l.touches[0].clientX):l.clientX,c={},p=(e,n)=>{"number"==typeof n&&(t.setColumnSizingInfo((e=>{var i,o;const l="rtl"===t.options.columnResizeDirection?-1:1,r=(n-(null!=(i=null==e?void 0:e.startOffset)?i:0))*l,s=Math.max(r/(null!=(o=null==e?void 0:e.startSize)?o:0),-.999999);return e.columnSizingStart.forEach((e=>{let[t,n]=e;c[t]=Math.round(100*Math.max(n+n*s,0))/100})),{...e,deltaOffset:r,deltaPercentage:s}})),"onChange"!==t.options.columnResizeMode&&"end"!==e||t.setColumnSizing((e=>({...e,...c}))))},f=e=>p("move",e),h=e=>{p("end",e),t.setColumnSizingInfo((e=>({...e,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]})))},g=n||"undefined"!=typeof document?document:null,m={moveHandler:e=>f(e.clientX),upHandler:e=>{null==g||g.removeEventListener("mousemove",m.moveHandler),null==g||g.removeEventListener("mouseup",m.upHandler),h(e.clientX)}},v={moveHandler:e=>(e.cancelable&&(e.preventDefault(),e.stopPropagation()),f(e.touches[0].clientX),!1),upHandler:e=>{var t;null==g||g.removeEventListener("touchmove",v.moveHandler),null==g||g.removeEventListener("touchend",v.upHandler),e.cancelable&&(e.preventDefault(),e.stopPropagation()),h(null==(t=e.touches[0])?void 0:t.clientX)}},b=!!a()&&{passive:!1};u(l)?(null==g||g.addEventListener("touchmove",v.moveHandler,b),null==g||g.addEventListener("touchend",v.upHandler,b)):(null==g||g.addEventListener("mousemove",m.moveHandler,b),null==g||g.addEventListener("mouseup",m.upHandler,b)),t.setColumnSizingInfo((e=>({...e,startOffset:d,startSize:r,deltaOffset:0,deltaPercentage:0,columnSizingStart:s,isResizingColumn:i.id})))}}},createTable:e=>{e.setColumnSizing=t=>null==e.options.onColumnSizingChange?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>null==e.options.onColumnSizingInfoChange?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:null!=(n=e.initialState.columnSizing)?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}:null!=(n=e.initialState.columnSizingInfo)?n:{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]})},e.getTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getHeaderGroups()[0])?void 0:n.headers.reduce(((e,t)=>e+t.getSize()),0))?t:0},e.getLeftTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getLeftHeaderGroups()[0])?void 0:n.headers.reduce(((e,t)=>e+t.getSize()),0))?t:0},e.getCenterTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getCenterHeaderGroups()[0])?void 0:n.headers.reduce(((e,t)=>e+t.getSize()),0))?t:0},e.getRightTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getRightHeaderGroups()[0])?void 0:n.headers.reduce(((e,t)=>e+t.getSize()),0))?t:0}}};let s=null;function a(){if("boolean"==typeof s)return s;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch(t){e=!1}return s=e,s}function u(e){return"touchstart"===e.type}t.ColumnSizing=r,t.defaultColumnSizing=l,t.passiveEventSupported=a},3185:function(e,t,n){"use strict";var i=n(9090);const o={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:i.makeStateUpdater("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility((t=>({...t,[e.id]:null!=n?n:!e.getIsVisible()})))},e.getIsVisible=()=>{var n,i;const o=e.columns;return null==(n=o.length?o.some((e=>e.getIsVisible())):null==(i=t.getState().columnVisibility)?void 0:i[e.id])||n},e.getCanHide=()=>{var n,i;return(null==(n=e.columnDef.enableHiding)||n)&&(null==(i=t.options.enableHiding)||i)},e.getToggleVisibilityHandler=()=>t=>{null==e.toggleVisibility||e.toggleVisibility(t.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=i.memo((()=>[e.getAllCells(),t.getState().columnVisibility]),(e=>e.filter((e=>e.column.getIsVisible()))),i.getMemoOptions(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=i.memo((()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()]),((e,t,n)=>[...e,...t,...n]),i.getMemoOptions(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(t,n)=>i.memo((()=>[n(),n().filter((e=>e.getIsVisible())).map((e=>e.id)).join("_")]),(e=>e.filter((e=>null==e.getIsVisible?void 0:e.getIsVisible()))),i.getMemoOptions(e.options,"debugColumns",t));e.getVisibleFlatColumns=t("getVisibleFlatColumns",(()=>e.getAllFlatColumns())),e.getVisibleLeafColumns=t("getVisibleLeafColumns",(()=>e.getAllLeafColumns())),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",(()=>e.getLeftLeafColumns())),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",(()=>e.getRightLeafColumns())),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",(()=>e.getCenterLeafColumns())),e.setColumnVisibility=t=>null==e.options.onColumnVisibilityChange?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{var n;e.setColumnVisibility(t?{}:null!=(n=e.initialState.columnVisibility)?n:{})},e.toggleAllColumnsVisible=t=>{var n;t=null!=(n=t)?n:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce(((e,n)=>({...e,[n.id]:t||!(null!=n.getCanHide&&n.getCanHide())})),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some((e=>!(null!=e.getIsVisible&&e.getIsVisible()))),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some((e=>null==e.getIsVisible?void 0:e.getIsVisible())),e.getToggleAllColumnsVisibilityHandler=()=>t=>{var n;e.toggleAllColumnsVisible(null==(n=t.target)?void 0:n.checked)}}};t.ColumnVisibility=o,t._getVisibleLeafColumns=function(e,t){return t?"center"===t?e.getCenterVisibleLeafColumns():"left"===t?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}},8993:function(e,t){"use strict";const n={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}};t.GlobalFaceting=n},2888:function(e,t,n){"use strict";var i=n(5232),o=n(9090);const l={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:o.makeStateUpdater("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const i=null==(n=e.getCoreRowModel().flatRows[0])||null==(n=n._getAllCellsByColumnId()[t.id])?void 0:n.getValue();return"string"==typeof i||"number"==typeof i}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,i,o,l;return(null==(n=e.columnDef.enableGlobalFilter)||n)&&(null==(i=t.options.enableGlobalFilter)||i)&&(null==(o=t.options.enableFilters)||o)&&(null==(l=null==t.options.getColumnCanGlobalFilter?void 0:t.options.getColumnCanGlobalFilter(e))||l)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>i.filterFns.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:l}=e.options;return o.isFunction(l)?l:"auto"===l?e.getGlobalAutoFilterFn():null!=(t=null==(n=e.options.filterFns)?void 0:n[l])?t:i.filterFns[l]},e.setGlobalFilter=t=>{null==e.options.onGlobalFilterChange||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}};t.GlobalFiltering=l},3527:function(e,t,n){"use strict";var i=n(9090);const o={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:i.makeStateUpdater("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var i,o;if(t){if(null!=(i=null!=(o=e.options.autoResetAll)?o:e.options.autoResetExpanded)?i:!e.options.manualExpanding){if(n)return;n=!0,e._queue((()=>{e.resetExpanded(),n=!1}))}}else e._queue((()=>{t=!0}))},e.setExpanded=t=>null==e.options.onExpandedChange?void 0:e.options.onExpandedChange(t),e.toggleAllRowsExpanded=t=>{(null!=t?t:!e.getIsAllRowsExpanded())?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=t=>{var n,i;e.setExpanded(t?{}:null!=(n=null==(i=e.initialState)?void 0:i.expanded)?n:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some((e=>e.getCanExpand())),e.getToggleAllRowsExpandedHandler=()=>t=>{null==t.persist||t.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const t=e.getState().expanded;return!0===t||Object.values(t).some(Boolean)},e.getIsAllRowsExpanded=()=>{const t=e.getState().expanded;return"boolean"==typeof t?!0===t:!!Object.keys(t).length&&!e.getRowModel().flatRows.some((e=>!e.getIsExpanded()))},e.getExpandedDepth=()=>{let t=0;return(!0===e.getState().expanded?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach((e=>{const n=e.split(".");t=Math.max(t,n.length)})),t},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded((i=>{var o;const l=!0===i||!(null==i||!i[e.id]);let r={};if(!0===i?Object.keys(t.getRowModel().rowsById).forEach((e=>{r[e]=!0})):r=i,n=null!=(o=n)?o:!l,!l&&n)return{...r,[e.id]:!0};if(l&&!n){const{[e.id]:t,...n}=r;return n}return i}))},e.getIsExpanded=()=>{var n;const i=t.getState().expanded;return!!(null!=(n=null==t.options.getIsRowExpanded?void 0:t.options.getIsRowExpanded(e))?n:!0===i||(null==i?void 0:i[e.id]))},e.getCanExpand=()=>{var n,i,o;return null!=(n=null==t.options.getRowCanExpand?void 0:t.options.getRowCanExpand(e))?n:(null==(i=t.options.enableExpanding)||i)&&!(null==(o=e.subRows)||!o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,i=e;for(;n&&i.parentId;)i=t.getRow(i.parentId,!0),n=i.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}};t.RowExpanding=o},5575:function(e,t,n){"use strict";var i=n(9090);const o={getInitialState:e=>({...e,pagination:{pageIndex:0,pageSize:10,...null==e?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:i.makeStateUpdater("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var i,o;if(t){if(null!=(i=null!=(o=e.options.autoResetAll)?o:e.options.autoResetPageIndex)?i:!e.options.manualPagination){if(n)return;n=!0,e._queue((()=>{e.resetPageIndex(),n=!1}))}}else e._queue((()=>{t=!0}))},e.setPagination=t=>null==e.options.onPaginationChange?void 0:e.options.onPaginationChange((e=>i.functionalUpdate(t,e))),e.resetPagination=t=>{var n;e.setPagination(t?{pageIndex:0,pageSize:10}:null!=(n=e.initialState.pagination)?n:{pageIndex:0,pageSize:10})},e.setPageIndex=t=>{e.setPagination((n=>{let o=i.functionalUpdate(t,n.pageIndex);const l=void 0===e.options.pageCount||-1===e.options.pageCount?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return o=Math.max(0,Math.min(o,l)),{...n,pageIndex:o}}))},e.resetPageIndex=t=>{var n,i;e.setPageIndex(t?0:null!=(n=null==(i=e.initialState)||null==(i=i.pagination)?void 0:i.pageIndex)?n:0)},e.resetPageSize=t=>{var n,i;e.setPageSize(t?10:null!=(n=null==(i=e.initialState)||null==(i=i.pagination)?void 0:i.pageSize)?n:10)},e.setPageSize=t=>{e.setPagination((e=>{const n=Math.max(1,i.functionalUpdate(t,e.pageSize)),o=e.pageSize*e.pageIndex,l=Math.floor(o/n);return{...e,pageIndex:l,pageSize:n}}))},e.setPageCount=t=>e.setPagination((n=>{var o;let l=i.functionalUpdate(t,null!=(o=e.options.pageCount)?o:-1);return"number"==typeof l&&(l=Math.max(-1,l)),{...n,pageCount:l}})),e.getPageOptions=i.memo((()=>[e.getPageCount()]),(e=>{let t=[];return e&&e>0&&(t=[...new Array(e)].fill(null).map(((e,t)=>t))),t}),i.getMemoOptions(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:t}=e.getState().pagination,n=e.getPageCount();return-1===n||0!==n&&t<n-1},e.previousPage=()=>e.setPageIndex((e=>e-1)),e.nextPage=()=>e.setPageIndex((e=>e+1)),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var t;return null!=(t=e.options.pageCount)?t:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var t;return null!=(t=e.options.rowCount)?t:e.getPrePaginationRowModel().rows.length}}};t.RowPagination=o},3030:function(e,t,n){"use strict";var i=n(9090);const o={getInitialState:e=>({rowPinning:{top:[],bottom:[]},...e}),getDefaultOptions:e=>({onRowPinningChange:i.makeStateUpdater("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,i,o)=>{const l=i?e.getLeafRows().map((e=>{let{id:t}=e;return t})):[],r=o?e.getParentRows().map((e=>{let{id:t}=e;return t})):[],s=new Set([...r,e.id,...l]);t.setRowPinning((e=>{var t,i,o,l,r,a;return"bottom"===n?{top:(null!=(o=null==e?void 0:e.top)?o:[]).filter((e=>!(null!=s&&s.has(e)))),bottom:[...(null!=(l=null==e?void 0:e.bottom)?l:[]).filter((e=>!(null!=s&&s.has(e)))),...Array.from(s)]}:"top"===n?{top:[...(null!=(r=null==e?void 0:e.top)?r:[]).filter((e=>!(null!=s&&s.has(e)))),...Array.from(s)],bottom:(null!=(a=null==e?void 0:e.bottom)?a:[]).filter((e=>!(null!=s&&s.has(e))))}:{top:(null!=(t=null==e?void 0:e.top)?t:[]).filter((e=>!(null!=s&&s.has(e)))),bottom:(null!=(i=null==e?void 0:e.bottom)?i:[]).filter((e=>!(null!=s&&s.has(e))))}}))},e.getCanPin=()=>{var n;const{enableRowPinning:i,enablePinning:o}=t.options;return"function"==typeof i?i(e):null==(n=null!=i?i:o)||n},e.getIsPinned=()=>{const n=[e.id],{top:i,bottom:o}=t.getState().rowPinning,l=n.some((e=>null==i?void 0:i.includes(e))),r=n.some((e=>null==o?void 0:o.includes(e)));return l?"top":!!r&&"bottom"},e.getPinnedIndex=()=>{var n,i;const o=e.getIsPinned();if(!o)return-1;const l=null==(n="top"===o?t.getTopRows():t.getBottomRows())?void 0:n.map((e=>{let{id:t}=e;return t}));return null!=(i=null==l?void 0:l.indexOf(e.id))?i:-1}},createTable:e=>{e.setRowPinning=t=>null==e.options.onRowPinningChange?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,i;return e.setRowPinning(t?{top:[],bottom:[]}:null!=(n=null==(i=e.initialState)?void 0:i.rowPinning)?n:{top:[],bottom:[]})},e.getIsSomeRowsPinned=t=>{var n;const i=e.getState().rowPinning;var o,l;return t?Boolean(null==(n=i[t])?void 0:n.length):Boolean((null==(o=i.top)?void 0:o.length)||(null==(l=i.bottom)?void 0:l.length))},e._getPinnedRows=(t,n,i)=>{var o;return(null==(o=e.options.keepPinnedRows)||o?(null!=n?n:[]).map((t=>{const n=e.getRow(t,!0);return n.getIsAllParentsExpanded()?n:null})):(null!=n?n:[]).map((e=>t.find((t=>t.id===e))))).filter(Boolean).map((e=>({...e,position:i})))},e.getTopRows=i.memo((()=>[e.getRowModel().rows,e.getState().rowPinning.top]),((t,n)=>e._getPinnedRows(t,n,"top")),i.getMemoOptions(e.options,"debugRows","getTopRows")),e.getBottomRows=i.memo((()=>[e.getRowModel().rows,e.getState().rowPinning.bottom]),((t,n)=>e._getPinnedRows(t,n,"bottom")),i.getMemoOptions(e.options,"debugRows","getBottomRows")),e.getCenterRows=i.memo((()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom]),((e,t,n)=>{const i=new Set([...null!=t?t:[],...null!=n?n:[]]);return e.filter((e=>!i.has(e.id)))}),i.getMemoOptions(e.options,"debugRows","getCenterRows"))}};t.RowPinning=o},4489:function(e,t,n){"use strict";var i=n(9090);const o={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:i.makeStateUpdater("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>null==e.options.onRowSelectionChange?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:null!=(n=e.initialState.rowSelection)?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection((n=>{t=void 0!==t?t:!e.getIsAllRowsSelected();const i={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach((e=>{e.getCanSelect()&&(i[e.id]=!0)})):o.forEach((e=>{delete i[e.id]})),i}))},e.toggleAllPageRowsSelected=t=>e.setRowSelection((n=>{const i=void 0!==t?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach((t=>{l(o,t.id,i,!0,e)})),o})),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=i.memo((()=>[e.getState().rowSelection,e.getCoreRowModel()]),((t,n)=>Object.keys(t).length?r(e,n):{rows:[],flatRows:[],rowsById:{}}),i.getMemoOptions(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=i.memo((()=>[e.getState().rowSelection,e.getFilteredRowModel()]),((t,n)=>Object.keys(t).length?r(e,n):{rows:[],flatRows:[],rowsById:{}}),i.getMemoOptions(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=i.memo((()=>[e.getState().rowSelection,e.getSortedRowModel()]),((t,n)=>Object.keys(t).length?r(e,n):{rows:[],flatRows:[],rowsById:{}}),i.getMemoOptions(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let i=Boolean(t.length&&Object.keys(n).length);return i&&t.some((e=>e.getCanSelect()&&!n[e.id]))&&(i=!1),i},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter((e=>e.getCanSelect())),{rowSelection:n}=e.getState();let i=!!t.length;return i&&t.some((e=>!n[e.id]))&&(i=!1),i},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys(null!=(t=e.getState().rowSelection)?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return!e.getIsAllPageRowsSelected()&&t.filter((e=>e.getCanSelect())).some((e=>e.getIsSelected()||e.getIsSomeSelected()))},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,i)=>{const o=e.getIsSelected();t.setRowSelection((r=>{var s;if(n=void 0!==n?n:!o,e.getCanSelect()&&o===n)return r;const a={...r};return l(a,e.id,n,null==(s=null==i?void 0:i.selectChildren)||s,t),a}))},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return s(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return"some"===a(e,n)},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return"all"===a(e,n)},e.getCanSelect=()=>{var n;return"function"==typeof t.options.enableRowSelection?t.options.enableRowSelection(e):null==(n=t.options.enableRowSelection)||n},e.getCanSelectSubRows=()=>{var n;return"function"==typeof t.options.enableSubRowSelection?t.options.enableSubRowSelection(e):null==(n=t.options.enableSubRowSelection)||n},e.getCanMultiSelect=()=>{var n;return"function"==typeof t.options.enableMultiRowSelection?t.options.enableMultiRowSelection(e):null==(n=t.options.enableMultiRowSelection)||n},e.getToggleSelectedHandler=()=>{const t=e.getCanSelect();return n=>{var i;t&&e.toggleSelected(null==(i=n.target)?void 0:i.checked)}}}},l=(e,t,n,i,o)=>{var r;const s=o.getRow(t,!0);n?(s.getCanMultiSelect()||Object.keys(e).forEach((t=>delete e[t])),s.getCanSelect()&&(e[t]=!0)):delete e[t],i&&null!=(r=s.subRows)&&r.length&&s.getCanSelectSubRows()&&s.subRows.forEach((t=>l(e,t.id,n,i,o)))};function r(e,t){const n=e.getState().rowSelection,i=[],o={},l=function(e,t){return e.map((e=>{var t;const r=s(e,n);if(r&&(i.push(e),o[e.id]=e),null!=(t=e.subRows)&&t.length&&(e={...e,subRows:l(e.subRows)}),r)return e})).filter(Boolean)};return{rows:l(t.rows),flatRows:i,rowsById:o}}function s(e,t){var n;return null!=(n=t[e.id])&&n}function a(e,t,n){var i;if(null==(i=e.subRows)||!i.length)return!1;let o=!0,l=!1;return e.subRows.forEach((e=>{if((!l||o)&&(e.getCanSelect()&&(s(e,t)?l=!0:o=!1),e.subRows&&e.subRows.length)){const n=a(e,t);"all"===n?l=!0:"some"===n?(l=!0,o=!1):o=!1}})),o?"all":!!l&&"some"}t.RowSelection=o,t.isRowSelected=s,t.isSubRowSelected=a,t.selectRowsFn=r},5107:function(e,t,n){"use strict";var i=n(5702),o=n(9090);const l={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:o.makeStateUpdater("sorting",e),isMultiSortEvent:e=>e.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let o=!1;for(const t of n){const n=null==t?void 0:t.getValue(e.id);if("[object Date]"===Object.prototype.toString.call(n))return i.sortingFns.datetime;if("string"==typeof n&&(o=!0,n.split(i.reSplitAlphaNumeric).length>1))return i.sortingFns.alphanumeric}return o?i.sortingFns.text:i.sortingFns.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return"string"==typeof(null==n?void 0:n.getValue(e.id))?"asc":"desc"},e.getSortingFn=()=>{var n,l;if(!e)throw new Error;return o.isFunction(e.columnDef.sortingFn)?e.columnDef.sortingFn:"auto"===e.columnDef.sortingFn?e.getAutoSortingFn():null!=(n=null==(l=t.options.sortingFns)?void 0:l[e.columnDef.sortingFn])?n:i.sortingFns[e.columnDef.sortingFn]},e.toggleSorting=(n,i)=>{const o=e.getNextSortingOrder(),l=null!=n;t.setSorting((r=>{const s=null==r?void 0:r.find((t=>t.id===e.id)),a=null==r?void 0:r.findIndex((t=>t.id===e.id));let u,d=[],c=l?n:"desc"===o;var p;(u=null!=r&&r.length&&e.getCanMultiSort()&&i?s?"toggle":"add":null!=r&&r.length&&a!==r.length-1?"replace":s?"toggle":"replace","toggle"===u&&(l||o||(u="remove")),"add"===u)?(d=[...r,{id:e.id,desc:c}],d.splice(0,d.length-(null!=(p=t.options.maxMultiSortColCount)?p:Number.MAX_SAFE_INTEGER))):d="toggle"===u?r.map((t=>t.id===e.id?{...t,desc:c}:t)):"remove"===u?r.filter((t=>t.id!==e.id)):[{id:e.id,desc:c}];return d}))},e.getFirstSortDir=()=>{var n,i;return(null!=(n=null!=(i=e.columnDef.sortDescFirst)?i:t.options.sortDescFirst)?n:"desc"===e.getAutoSortDir())?"desc":"asc"},e.getNextSortingOrder=n=>{var i,o;const l=e.getFirstSortDir(),r=e.getIsSorted();return r?!!(r===l||null!=(i=t.options.enableSortingRemoval)&&!i||n&&null!=(o=t.options.enableMultiRemove)&&!o)&&("desc"===r?"asc":"desc"):l},e.getCanSort=()=>{var n,i;return(null==(n=e.columnDef.enableSorting)||n)&&(null==(i=t.options.enableSorting)||i)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,i;return null!=(n=null!=(i=e.columnDef.enableMultiSort)?i:t.options.enableMultiSort)?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const i=null==(n=t.getState().sorting)?void 0:n.find((t=>t.id===e.id));return!!i&&(i.desc?"desc":"asc")},e.getSortIndex=()=>{var n,i;return null!=(n=null==(i=t.getState().sorting)?void 0:i.findIndex((t=>t.id===e.id)))?n:-1},e.clearSorting=()=>{t.setSorting((t=>null!=t&&t.length?t.filter((t=>t.id!==e.id)):[]))},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return i=>{n&&(null==i.persist||i.persist(),null==e.toggleSorting||e.toggleSorting(void 0,!!e.getCanMultiSort()&&(null==t.options.isMultiSortEvent?void 0:t.options.isMultiSortEvent(i))))}}},createTable:e=>{e.setSorting=t=>null==e.options.onSortingChange?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,i;e.setSorting(t?[]:null!=(n=null==(i=e.initialState)?void 0:i.sorting)?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}};t.RowSorting=l},5232:function(e,t){"use strict";const n=(e,t,n)=>{var i,o;const l=null==n||null==(i=n.toString())?void 0:i.toLowerCase();return Boolean(null==(o=e.getValue(t))||null==(o=o.toString())||null==(o=o.toLowerCase())?void 0:o.includes(l))};n.autoRemove=e=>p(e);const i=(e,t,n)=>{var i;return Boolean(null==(i=e.getValue(t))||null==(i=i.toString())?void 0:i.includes(n))};i.autoRemove=e=>p(e);const o=(e,t,n)=>{var i;return(null==(i=e.getValue(t))||null==(i=i.toString())?void 0:i.toLowerCase())===(null==n?void 0:n.toLowerCase())};o.autoRemove=e=>p(e);const l=(e,t,n)=>{var i;return null==(i=e.getValue(t))?void 0:i.includes(n)};l.autoRemove=e=>p(e);const r=(e,t,n)=>!n.some((n=>{var i;return!(null!=(i=e.getValue(t))&&i.includes(n))}));r.autoRemove=e=>p(e)||!(null!=e&&e.length);const s=(e,t,n)=>n.some((n=>{var i;return null==(i=e.getValue(t))?void 0:i.includes(n)}));s.autoRemove=e=>p(e)||!(null!=e&&e.length);const a=(e,t,n)=>e.getValue(t)===n;a.autoRemove=e=>p(e);const u=(e,t,n)=>e.getValue(t)==n;u.autoRemove=e=>p(e);const d=(e,t,n)=>{let[i,o]=n;const l=e.getValue(t);return l>=i&&l<=o};d.resolveFilterValue=e=>{let[t,n]=e,i="number"!=typeof t?parseFloat(t):t,o="number"!=typeof n?parseFloat(n):n,l=null===t||Number.isNaN(i)?-1/0:i,r=null===n||Number.isNaN(o)?1/0:o;if(l>r){const e=l;l=r,r=e}return[l,r]},d.autoRemove=e=>p(e)||p(e[0])&&p(e[1]);const c={includesString:n,includesStringSensitive:i,equalsString:o,arrIncludes:l,arrIncludesAll:r,arrIncludesSome:s,equals:a,weakEquals:u,inNumberRange:d};function p(e){return null==e||""===e}t.filterFns=c},3767:function(e,t,n){"use strict";var i=n(5613),o=n(4151),l=n(481),r=n(8937),s=n(1151),a=n(2559),u=n(7932),d=n(7367),c=n(2724),p=n(6085),f=n(3748),h=n(1319),g=n(3185),m=n(8993),v=n(2888),b=n(3527),y=n(5575),E=n(3030),_=n(4489),S=n(5107),C=n(9090),w=n(6187),F=n(8449),I=n(215),A=n(6690),R=n(9854),O=n(707),M=n(8010),D=n(3508),P=n(6685),L=n(9360),x=n(5232),T=n(5702);t.createColumnHelper=i.createColumnHelper,t.createCell=o.createCell,t.createColumn=l.createColumn,t.Headers=r.Headers,t.buildHeaderGroups=r.buildHeaderGroups,t.createRow=s.createRow,t.createTable=a.createTable,t.ColumnFaceting=u.ColumnFaceting,t.ColumnFiltering=d.ColumnFiltering,t.shouldAutoRemoveFilter=d.shouldAutoRemoveFilter,t.ColumnGrouping=c.ColumnGrouping,t.orderColumns=c.orderColumns,t.ColumnOrdering=p.ColumnOrdering,t.ColumnPinning=f.ColumnPinning,t.ColumnSizing=h.ColumnSizing,t.defaultColumnSizing=h.defaultColumnSizing,t.passiveEventSupported=h.passiveEventSupported,t.ColumnVisibility=g.ColumnVisibility,t._getVisibleLeafColumns=g._getVisibleLeafColumns,t.GlobalFaceting=m.GlobalFaceting,t.GlobalFiltering=v.GlobalFiltering,t.RowExpanding=b.RowExpanding,t.RowPagination=y.RowPagination,t.RowPinning=E.RowPinning,t.RowSelection=_.RowSelection,t.isRowSelected=_.isRowSelected,t.isSubRowSelected=_.isSubRowSelected,t.selectRowsFn=_.selectRowsFn,t.RowSorting=S.RowSorting,t.flattenBy=C.flattenBy,t.functionalUpdate=C.functionalUpdate,t.getMemoOptions=C.getMemoOptions,t.isFunction=C.isFunction,t.isNumberArray=C.isNumberArray,t.makeStateUpdater=C.makeStateUpdater,t.memo=C.memo,t.noop=C.noop,t.getCoreRowModel=w.getCoreRowModel,t.expandRows=F.expandRows,t.getExpandedRowModel=F.getExpandedRowModel,t.getFacetedMinMaxValues=I.getFacetedMinMaxValues,t.getFacetedRowModel=A.getFacetedRowModel,t.getFacetedUniqueValues=R.getFacetedUniqueValues,t.getFilteredRowModel=O.getFilteredRowModel,t.getGroupedRowModel=M.getGroupedRowModel,t.getPaginationRowModel=D.getPaginationRowModel,t.getSortedRowModel=P.getSortedRowModel,t.aggregationFns=L.aggregationFns,t.filterFns=x.filterFns,t.reSplitAlphaNumeric=T.reSplitAlphaNumeric,t.sortingFns=T.sortingFns},5702:function(e,t){"use strict";const n=/([0-9]+)/gm;function i(e,t){return e===t?0:e>t?1:-1}function o(e){return"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?"":String(e):"string"==typeof e?e:""}function l(e,t){const i=e.split(n).filter(Boolean),o=t.split(n).filter(Boolean);for(;i.length&&o.length;){const e=i.shift(),t=o.shift(),n=parseInt(e,10),l=parseInt(t,10),r=[n,l].sort();if(isNaN(r[0])){if(e>t)return 1;if(t>e)return-1}else{if(isNaN(r[1]))return isNaN(n)?-1:1;if(n>l)return 1;if(l>n)return-1}}return i.length-o.length}const r={alphanumeric:(e,t,n)=>l(o(e.getValue(n)).toLowerCase(),o(t.getValue(n)).toLowerCase()),alphanumericCaseSensitive:(e,t,n)=>l(o(e.getValue(n)),o(t.getValue(n))),text:(e,t,n)=>i(o(e.getValue(n)).toLowerCase(),o(t.getValue(n)).toLowerCase()),textCaseSensitive:(e,t,n)=>i(o(e.getValue(n)),o(t.getValue(n))),datetime:(e,t,n)=>{const i=e.getValue(n),o=t.getValue(n);return i>o?1:i<o?-1:0},basic:(e,t,n)=>i(e.getValue(n),t.getValue(n))};t.reSplitAlphaNumeric=n,t.sortingFns=r},9090:function(e,t){"use strict";function n(e,t){return"function"==typeof e?e(t):e}t.flattenBy=function(e,t){const n=[],i=e=>{e.forEach((e=>{n.push(e);const o=t(e);null!=o&&o.length&&i(o)}))};return i(e),n},t.functionalUpdate=n,t.getMemoOptions=function(e,t,n,i){return{debug:()=>{var n;return null!=(n=null==e?void 0:e.debugAll)?n:e[t]},key:!1,onChange:i}},t.isFunction=function(e){return e instanceof Function},t.isNumberArray=function(e){return Array.isArray(e)&&e.every((e=>"number"==typeof e))},t.makeStateUpdater=function(e,t){return i=>{t.setState((t=>({...t,[e]:n(i,t[e])})))}},t.memo=function(e,t,n){let i,o=[];return l=>{let r;n.key&&n.debug&&(r=Date.now());const s=e(l);if(!(s.length!==o.length||s.some(((e,t)=>o[t]!==e))))return i;let a;if(o=s,n.key&&n.debug&&(a=Date.now()),i=t(...s),null==n||null==n.onChange||n.onChange(i),n.key&&n.debug&&null!=n&&n.debug()){const e=Math.round(100*(Date.now()-r))/100,t=Math.round(100*(Date.now()-a))/100,i=t/16,o=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${o(t,5)} /${o(e,5)} ms`,`\n            font-size: .6rem;\n            font-weight: bold;\n            color: hsl(${Math.max(0,Math.min(120-120*i,120))}deg 100% 31%);`,null==n?void 0:n.key)}return i}},t.noop=function(){}},3581:function(e,t,n){"use strict";var i=n(1151);t.filterRows=function(e,t,n){return n.options.filterFromLeafRows?function(e,t,n){var o;const l=[],r={},s=null!=(o=n.options.maxLeafRowFilterDepth)?o:100,a=function(e,o){void 0===o&&(o=0);const u=[];for(let c=0;c<e.length;c++){var d;let p=e[c];const f=i.createRow(n,p.id,p.original,p.index,p.depth,void 0,p.parentId);if(f.columnFilters=p.columnFilters,null!=(d=p.subRows)&&d.length&&o<s){if(f.subRows=a(p.subRows,o+1),p=f,t(p)&&!f.subRows.length){u.push(p),r[p.id]=p,l.push(p);continue}if(t(p)||f.subRows.length){u.push(p),r[p.id]=p,l.push(p);continue}}else p=f,t(p)&&(u.push(p),r[p.id]=p,l.push(p))}return u};return{rows:a(e),flatRows:l,rowsById:r}}(e,t,n):function(e,t,n){var o;const l=[],r={},s=null!=(o=n.options.maxLeafRowFilterDepth)?o:100,a=function(e,o){void 0===o&&(o=0);const u=[];for(let c=0;c<e.length;c++){let p=e[c];if(t(p)){var d;if(null!=(d=p.subRows)&&d.length&&o<s){const e=i.createRow(n,p.id,p.original,p.index,p.depth,void 0,p.parentId);e.subRows=a(p.subRows,o+1),p=e}u.push(p),l.push(p),r[p.id]=p}}return u};return{rows:a(e),flatRows:l,rowsById:r}}(e,t,n)}},6187:function(e,t,n){"use strict";var i=n(1151),o=n(9090);t.getCoreRowModel=function(){return e=>o.memo((()=>[e.options.data]),(t=>{const n={rows:[],flatRows:[],rowsById:{}},o=function(t,l,r){void 0===l&&(l=0);const s=[];for(let u=0;u<t.length;u++){const d=i.createRow(e,e._getRowId(t[u],u,r),t[u],u,l,void 0,null==r?void 0:r.id);var a;if(n.flatRows.push(d),n.rowsById[d.id]=d,s.push(d),e.options.getSubRows)d.originalSubRows=e.options.getSubRows(t[u],u),null!=(a=d.originalSubRows)&&a.length&&(d.subRows=o(d.originalSubRows,l+1,d))}return s};return n.rows=o(t),n}),o.getMemoOptions(e.options,"debugTable","getRowModel",(()=>e._autoResetPageIndex())))}},8449:function(e,t,n){"use strict";var i=n(9090);function o(e){const t=[],n=e=>{var i;t.push(e),null!=(i=e.subRows)&&i.length&&e.getIsExpanded()&&e.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}t.expandRows=o,t.getExpandedRowModel=function(){return e=>i.memo((()=>[e.getState().expanded,e.getPreExpandedRowModel(),e.options.paginateExpandedRows]),((e,t,n)=>!t.rows.length||!0!==e&&!Object.keys(null!=e?e:{}).length?t:n?o(t):t),i.getMemoOptions(e.options,"debugTable","getExpandedRowModel"))}},215:function(e,t,n){"use strict";var i=n(9090);t.getFacetedMinMaxValues=function(){return(e,t)=>i.memo((()=>{var n;return[null==(n=e.getColumn(t))?void 0:n.getFacetedRowModel()]}),(e=>{if(!e)return;const n=e.flatRows.flatMap((e=>{var n;return null!=(n=e.getUniqueValues(t))?n:[]})).map(Number).filter((e=>!Number.isNaN(e)));if(!n.length)return;let i=n[0],o=n[n.length-1];for(const e of n)e<i?i=e:e>o&&(o=e);return[i,o]}),i.getMemoOptions(e.options,"debugTable","getFacetedMinMaxValues"))}},6690:function(e,t,n){"use strict";var i=n(9090),o=n(3581);t.getFacetedRowModel=function(){return(e,t)=>i.memo((()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter,e.getFilteredRowModel()]),((n,i,l)=>{if(!n.rows.length||(null==i||!i.length)&&!l)return n;const r=[...i.map((e=>e.id)).filter((e=>e!==t)),l?"__global__":void 0].filter(Boolean);return o.filterRows(n.rows,(e=>{for(let t=0;t<r.length;t++)if(!1===e.columnFilters[r[t]])return!1;return!0}),e)}),i.getMemoOptions(e.options,"debugTable","getFacetedRowModel"))}},9854:function(e,t,n){"use strict";var i=n(9090);t.getFacetedUniqueValues=function(){return(e,t)=>i.memo((()=>{var n;return[null==(n=e.getColumn(t))?void 0:n.getFacetedRowModel()]}),(e=>{if(!e)return new Map;let n=new Map;for(let o=0;o<e.flatRows.length;o++){const l=e.flatRows[o].getUniqueValues(t);for(let e=0;e<l.length;e++){const t=l[e];var i;if(n.has(t))n.set(t,(null!=(i=n.get(t))?i:0)+1);else n.set(t,1)}}return n}),i.getMemoOptions(e.options,"debugTable",`getFacetedUniqueValues_${t}`))}},707:function(e,t,n){"use strict";var i=n(9090),o=n(3581);t.getFilteredRowModel=function(){return e=>i.memo((()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter]),((t,n,i)=>{if(!t.rows.length||(null==n||!n.length)&&!i){for(let e=0;e<t.flatRows.length;e++)t.flatRows[e].columnFilters={},t.flatRows[e].columnFiltersMeta={};return t}const l=[],r=[];(null!=n?n:[]).forEach((t=>{var n;const i=e.getColumn(t.id);if(!i)return;const o=i.getFilterFn();o&&l.push({id:t.id,filterFn:o,resolvedValue:null!=(n=null==o.resolveFilterValue?void 0:o.resolveFilterValue(t.value))?n:t.value})}));const s=(null!=n?n:[]).map((e=>e.id)),a=e.getGlobalFilterFn(),u=e.getAllLeafColumns().filter((e=>e.getCanGlobalFilter()));let d,c;i&&a&&u.length&&(s.push("__global__"),u.forEach((e=>{var t;r.push({id:e.id,filterFn:a,resolvedValue:null!=(t=null==a.resolveFilterValue?void 0:a.resolveFilterValue(i))?t:i})})));for(let e=0;e<t.flatRows.length;e++){const n=t.flatRows[e];if(n.columnFilters={},l.length)for(let e=0;e<l.length;e++){d=l[e];const t=d.id;n.columnFilters[t]=d.filterFn(n,t,d.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))}if(r.length){for(let e=0;e<r.length;e++){c=r[e];const t=c.id;if(c.filterFn(n,t,c.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))){n.columnFilters.__global__=!0;break}}!0!==n.columnFilters.__global__&&(n.columnFilters.__global__=!1)}}return o.filterRows(t.rows,(e=>{for(let t=0;t<s.length;t++)if(!1===e.columnFilters[s[t]])return!1;return!0}),e)}),i.getMemoOptions(e.options,"debugTable","getFilteredRowModel",(()=>e._autoResetPageIndex())))}},8010:function(e,t,n){"use strict";var i=n(1151),o=n(9090);t.getGroupedRowModel=function(){return e=>o.memo((()=>[e.getState().grouping,e.getPreGroupedRowModel()]),((t,n)=>{if(!n.rows.length||!t.length)return n.rows.forEach((e=>{e.depth=0,e.parentId=void 0})),n;const l=t.filter((t=>e.getColumn(t))),r=[],s={},a=function(t,n,u){if(void 0===n&&(n=0),n>=l.length)return t.map((e=>(e.depth=n,r.push(e),s[e.id]=e,e.subRows&&(e.subRows=a(e.subRows,n+1,e.id)),e)));const d=l[n],c=function(e,t){const n=new Map;return e.reduce(((e,n)=>{const i=`${n.getGroupingValue(t)}`,o=e.get(i);return o?o.push(n):e.set(i,[n]),e}),n)}(t,d),p=Array.from(c.entries()).map(((t,c)=>{let[p,f]=t,h=`${d}:${p}`;h=u?`${u}>${h}`:h;const g=a(f,n+1,h);g.forEach((e=>{e.parentId=h}));const m=n?o.flattenBy(f,(e=>e.subRows)):f,v=i.createRow(e,h,m[0].original,c,n,void 0,u);return Object.assign(v,{groupingColumnId:d,groupingValue:p,subRows:g,leafRows:m,getValue:t=>{if(l.includes(t)){if(v._valuesCache.hasOwnProperty(t))return v._valuesCache[t];var n;if(f[0])v._valuesCache[t]=null!=(n=f[0].getValue(t))?n:void 0;return v._valuesCache[t]}if(v._groupingValuesCache.hasOwnProperty(t))return v._groupingValuesCache[t];const i=e.getColumn(t),o=null==i?void 0:i.getAggregationFn();return o?(v._groupingValuesCache[t]=o(t,m,f),v._groupingValuesCache[t]):void 0}}),g.forEach((e=>{r.push(e),s[e.id]=e})),v}));return p},u=a(n.rows,0);return u.forEach((e=>{r.push(e),s[e.id]=e})),{rows:u,flatRows:r,rowsById:s}}),o.getMemoOptions(e.options,"debugTable","getGroupedRowModel",(()=>{e._queue((()=>{e._autoResetExpanded(),e._autoResetPageIndex()}))})))}},3508:function(e,t,n){"use strict";var i=n(9090),o=n(8449);t.getPaginationRowModel=function(e){return e=>i.memo((()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded]),((t,n)=>{if(!n.rows.length)return n;const{pageSize:i,pageIndex:l}=t;let{rows:r,flatRows:s,rowsById:a}=n;const u=i*l,d=u+i;let c;r=r.slice(u,d),c=e.options.paginateExpandedRows?{rows:r,flatRows:s,rowsById:a}:o.expandRows({rows:r,flatRows:s,rowsById:a}),c.flatRows=[];const p=e=>{c.flatRows.push(e),e.subRows.length&&e.subRows.forEach(p)};return c.rows.forEach(p),c}),i.getMemoOptions(e.options,"debugTable","getPaginationRowModel"))}},6685:function(e,t,n){"use strict";var i=n(9090);t.getSortedRowModel=function(){return e=>i.memo((()=>[e.getState().sorting,e.getPreSortedRowModel()]),((t,n)=>{if(!n.rows.length||null==t||!t.length)return n;const i=e.getState().sorting,o=[],l=i.filter((t=>{var n;return null==(n=e.getColumn(t.id))?void 0:n.getCanSort()})),r={};l.forEach((t=>{const n=e.getColumn(t.id);n&&(r[t.id]={sortUndefined:n.columnDef.sortUndefined,invertSorting:n.columnDef.invertSorting,sortingFn:n.getSortingFn()})}));const s=e=>{const t=e.map((e=>({...e})));return t.sort(((e,t)=>{for(let i=0;i<l.length;i+=1){var n;const o=l[i],s=r[o.id],a=s.sortUndefined,u=null!=(n=null==o?void 0:o.desc)&&n;let d=0;if(a){const n=void 0===e.getValue(o.id),i=void 0===t.getValue(o.id);if(n||i){if("first"===a)return n?-1:1;if("last"===a)return n?1:-1;d=n&&i?0:n?a:-a}}if(0===d&&(d=s.sortingFn(e,t,o.id)),0!==d)return u&&(d*=-1),s.invertSorting&&(d*=-1),d}return e.index-t.index})),t.forEach((e=>{var t;o.push(e),null!=(t=e.subRows)&&t.length&&(e.subRows=s(e.subRows))})),t};return{rows:s(n.rows),flatRows:o,rowsById:n.rowsById}}),i.getMemoOptions(e.options,"debugTable","getSortedRowModel",(()=>e._autoResetPageIndex())))}},4600:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e.default:e}n.r(t),n.d(t,{Dropzone:function(){return r},default:function(){return r}});class o{on(e,t){return this._callbacks=this._callbacks||{},this._callbacks[e]||(this._callbacks[e]=[]),this._callbacks[e].push(t),this}emit(e,...t){this._callbacks=this._callbacks||{};let n=this._callbacks[e];if(n)for(let e of n)e.apply(this,t);return this.element&&this.element.dispatchEvent(this.makeEvent("dropzone:"+e,{args:t})),this}makeEvent(e,t){let n={bubbles:!0,cancelable:!0,detail:t};if("function"==typeof window.CustomEvent)return new CustomEvent(e,n);var i=document.createEvent("CustomEvent");return i.initCustomEvent(e,n.bubbles,n.cancelable,n.detail),i}off(e,t){if(!this._callbacks||0===arguments.length)return this._callbacks={},this;let n=this._callbacks[e];if(!n)return this;if(1===arguments.length)return delete this._callbacks[e],this;for(let e=0;e<n.length;e++){if(n[e]===t){n.splice(e,1);break}}return this}}var l={url:null,method:"post",withCredentials:!1,timeout:null,parallelUploads:2,uploadMultiple:!1,chunking:!1,forceChunking:!1,chunkSize:2097152,parallelChunkUploads:!1,retryChunks:!1,retryChunksLimit:3,maxFilesize:256,paramName:"file",createImageThumbnails:!0,maxThumbnailFilesize:10,thumbnailWidth:120,thumbnailHeight:120,thumbnailMethod:"crop",resizeWidth:null,resizeHeight:null,resizeMimeType:null,resizeQuality:.8,resizeMethod:"contain",filesizeBase:1e3,maxFiles:null,headers:null,defaultHeaders:!0,clickable:!0,ignoreHiddenFiles:!0,acceptedFiles:null,autoProcessQueue:!0,autoQueue:!0,addRemoveLinks:!1,previewsContainer:null,disablePreviews:!1,hiddenInputContainer:"body",capture:null,renameFilename:null,renameFile:null,forceFallback:!1,dictDefaultMessage:"Drop files here to upload",dictFallbackMessage:"Your browser does not support drag'n'drop file uploads.",dictFallbackText:"Please use the fallback form below to upload your files like in the olden days.",dictFileTooBig:"File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.",dictInvalidFileType:"You can't upload files of this type.",dictResponseError:"Server responded with {{statusCode}} code.",dictCancelUpload:"Cancel upload",dictUploadCanceled:"Upload canceled.",dictCancelUploadConfirmation:"Are you sure you want to cancel this upload?",dictRemoveFile:"Remove file",dictRemoveFileConfirmation:null,dictMaxFilesExceeded:"You cannot upload any more files.",dictFileSizeUnits:{tb:"TB",gb:"GB",mb:"MB",kb:"KB",b:"b"},init(){},params(e,t,n){if(n)return{dzuuid:n.file.upload.uuid,dzchunkindex:n.index,dztotalfilesize:n.file.size,dzchunksize:this.options.chunkSize,dztotalchunkcount:n.file.upload.totalChunkCount,dzchunkbyteoffset:n.index*this.options.chunkSize}},accept(e,t){return t()},chunksUploaded:function(e,t){t()},binaryBody:!1,fallback(){let e;this.element.className=`${this.element.className} dz-browser-not-supported`;for(let t of this.element.getElementsByTagName("div"))if(/(^| )dz-message($| )/.test(t.className)){e=t,t.className="dz-message";break}e||(e=r.createElement('<div class="dz-message"><span></span></div>'),this.element.appendChild(e));let t=e.getElementsByTagName("span")[0];return t&&(null!=t.textContent?t.textContent=this.options.dictFallbackMessage:null!=t.innerText&&(t.innerText=this.options.dictFallbackMessage)),this.element.appendChild(this.getFallbackForm())},resize(e,t,n,i){let o={srcX:0,srcY:0,srcWidth:e.width,srcHeight:e.height},l=e.width/e.height;null==t&&null==n?(t=o.srcWidth,n=o.srcHeight):null==t?t=n*l:null==n&&(n=t/l);let r=(t=Math.min(t,o.srcWidth))/(n=Math.min(n,o.srcHeight));if(o.srcWidth>t||o.srcHeight>n)if("crop"===i)l>r?(o.srcHeight=e.height,o.srcWidth=o.srcHeight*r):(o.srcWidth=e.width,o.srcHeight=o.srcWidth/r);else{if("contain"!==i)throw new Error(`Unknown resizeMethod '${i}'`);l>r?n=t/l:t=n*l}return o.srcX=(e.width-o.srcWidth)/2,o.srcY=(e.height-o.srcHeight)/2,o.trgWidth=t,o.trgHeight=n,o},transformFile(e,t){return(this.options.resizeWidth||this.options.resizeHeight)&&e.type.match(/image.*/)?this.resizeImage(e,this.options.resizeWidth,this.options.resizeHeight,this.options.resizeMethod,t):t(e)},previewTemplate:i('<div class="dz-preview dz-file-preview">\n  <div class="dz-image"><img data-dz-thumbnail=""></div>\n  <div class="dz-details">\n    <div class="dz-size"><span data-dz-size=""></span></div>\n    <div class="dz-filename"><span data-dz-name=""></span></div>\n  </div>\n  <div class="dz-progress">\n    <span class="dz-upload" data-dz-uploadprogress=""></span>\n  </div>\n  <div class="dz-error-message"><span data-dz-errormessage=""></span></div>\n  <div class="dz-success-mark">\n    <svg width="54" height="54" viewBox="0 0 54 54" fill="white" xmlns="http://www.w3.org/2000/svg">\n      <path d="M10.2071 29.7929L14.2929 25.7071C14.6834 25.3166 15.3166 25.3166 15.7071 25.7071L21.2929 31.2929C21.6834 31.6834 22.3166 31.6834 22.7071 31.2929L38.2929 15.7071C38.6834 15.3166 39.3166 15.3166 39.7071 15.7071L43.7929 19.7929C44.1834 20.1834 44.1834 20.8166 43.7929 21.2071L22.7071 42.2929C22.3166 42.6834 21.6834 42.6834 21.2929 42.2929L10.2071 31.2071C9.81658 30.8166 9.81658 30.1834 10.2071 29.7929Z"></path>\n    </svg>\n  </div>\n  <div class="dz-error-mark">\n    <svg width="54" height="54" viewBox="0 0 54 54" fill="white" xmlns="http://www.w3.org/2000/svg">\n      <path d="M26.2929 20.2929L19.2071 13.2071C18.8166 12.8166 18.1834 12.8166 17.7929 13.2071L13.2071 17.7929C12.8166 18.1834 12.8166 18.8166 13.2071 19.2071L20.2929 26.2929C20.6834 26.6834 20.6834 27.3166 20.2929 27.7071L13.2071 34.7929C12.8166 35.1834 12.8166 35.8166 13.2071 36.2071L17.7929 40.7929C18.1834 41.1834 18.8166 41.1834 19.2071 40.7929L26.2929 33.7071C26.6834 33.3166 27.3166 33.3166 27.7071 33.7071L34.7929 40.7929C35.1834 41.1834 35.8166 41.1834 36.2071 40.7929L40.7929 36.2071C41.1834 35.8166 41.1834 35.1834 40.7929 34.7929L33.7071 27.7071C33.3166 27.3166 33.3166 26.6834 33.7071 26.2929L40.7929 19.2071C41.1834 18.8166 41.1834 18.1834 40.7929 17.7929L36.2071 13.2071C35.8166 12.8166 35.1834 12.8166 34.7929 13.2071L27.7071 20.2929C27.3166 20.6834 26.6834 20.6834 26.2929 20.2929Z"></path>\n    </svg>\n  </div>\n</div>\n'),drop(e){return this.element.classList.remove("dz-drag-hover")},dragstart(e){},dragend(e){return this.element.classList.remove("dz-drag-hover")},dragenter(e){return this.element.classList.add("dz-drag-hover")},dragover(e){return this.element.classList.add("dz-drag-hover")},dragleave(e){return this.element.classList.remove("dz-drag-hover")},paste(e){},reset(){return this.element.classList.remove("dz-started")},addedfile(e){if(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),this.previewsContainer&&!this.options.disablePreviews){for(var t of(e.previewElement=r.createElement(this.options.previewTemplate.trim()),e.previewTemplate=e.previewElement,this.previewsContainer.appendChild(e.previewElement),e.previewElement.querySelectorAll("[data-dz-name]")))t.textContent=e.name;for(t of e.previewElement.querySelectorAll("[data-dz-size]"))t.innerHTML=this.filesize(e.size);this.options.addRemoveLinks&&(e._removeLink=r.createElement(`<a class="dz-remove" href="javascript:undefined;" data-dz-remove>${this.options.dictRemoveFile}</a>`),e.previewElement.appendChild(e._removeLink));let n=t=>(t.preventDefault(),t.stopPropagation(),e.status===r.UPLOADING?r.confirm(this.options.dictCancelUploadConfirmation,(()=>this.removeFile(e))):this.options.dictRemoveFileConfirmation?r.confirm(this.options.dictRemoveFileConfirmation,(()=>this.removeFile(e))):this.removeFile(e));for(let t of e.previewElement.querySelectorAll("[data-dz-remove]"))t.addEventListener("click",n)}},removedfile(e){return null!=e.previewElement&&null!=e.previewElement.parentNode&&e.previewElement.parentNode.removeChild(e.previewElement),this._updateMaxFilesReachedClass()},thumbnail(e,t){if(e.previewElement){e.previewElement.classList.remove("dz-file-preview");for(let n of e.previewElement.querySelectorAll("[data-dz-thumbnail]"))n.alt=e.name,n.src=t;return setTimeout((()=>e.previewElement.classList.add("dz-image-preview")),1)}},error(e,t){if(e.previewElement){e.previewElement.classList.add("dz-error"),"string"!=typeof t&&t.error&&(t=t.error);for(let n of e.previewElement.querySelectorAll("[data-dz-errormessage]"))n.textContent=t}},errormultiple(){},processing(e){if(e.previewElement&&(e.previewElement.classList.add("dz-processing"),e._removeLink))return e._removeLink.innerHTML=this.options.dictCancelUpload},processingmultiple(){},uploadprogress(e,t,n){if(e.previewElement)for(let n of e.previewElement.querySelectorAll("[data-dz-uploadprogress]"))"PROGRESS"===n.nodeName?n.value=t:n.style.width=`${t}%`},totaluploadprogress(){},sending(){},sendingmultiple(){},success(e){if(e.previewElement)return e.previewElement.classList.add("dz-success")},successmultiple(){},canceled(e){return this.emit("error",e,this.options.dictUploadCanceled)},canceledmultiple(){},complete(e){if(e._removeLink&&(e._removeLink.innerHTML=this.options.dictRemoveFile),e.previewElement)return e.previewElement.classList.add("dz-complete")},completemultiple(){},maxfilesexceeded(){},maxfilesreached(){},queuecomplete(){},addedfiles(){}};class r extends o{static initClass(){this.prototype.Emitter=o,this.prototype.events=["drop","dragstart","dragend","dragenter","dragover","dragleave","addedfile","addedfiles","removedfile","thumbnail","error","errormultiple","processing","processingmultiple","uploadprogress","totaluploadprogress","sending","sendingmultiple","success","successmultiple","canceled","canceledmultiple","complete","completemultiple","reset","maxfilesexceeded","maxfilesreached","queuecomplete"],this.prototype._thumbnailQueue=[],this.prototype._processingThumbnail=!1}constructor(e,t){let n,i;if(super(),this.element=e,this.clickableElements=[],this.listeners=[],this.files=[],"string"==typeof this.element&&(this.element=document.querySelector(this.element)),null===this.element||!this.element instanceof HTMLElement)throw new Error("Invalid dropzone element: not an instance of HTMLElement.");if(this.element.dropzone)throw new Error("Dropzone already attached.");r.instances.push(this),this.element.dropzone=this;let o=null!=(i=r.optionsForElement(this.element))?i:{};if(this.options=Object.assign({},l,o,null!=t?t:{}),this.options.previewTemplate=this.options.previewTemplate.replace(/\n*/g,""),this.options.forceFallback||!r.isBrowserSupported())return this.options.fallback.call(this);if(null==this.options.url&&(this.options.url=this.element.getAttribute("action")),!this.options.url)throw new Error("No URL provided.");if(this.options.uploadMultiple&&this.options.chunking)throw new Error("You cannot set both: uploadMultiple and chunking.");if(this.options.binaryBody&&this.options.uploadMultiple)throw new Error("You cannot set both: binaryBody and uploadMultiple.");"string"==typeof this.options.method&&(this.options.method=this.options.method.toUpperCase()),(n=this.getExistingFallback())&&n.parentNode&&n.parentNode.removeChild(n),!1!==this.options.previewsContainer&&(this.options.previewsContainer?this.previewsContainer=r.getElement(this.options.previewsContainer,"previewsContainer"):this.previewsContainer=this.element),this.options.clickable&&(!0===this.options.clickable?this.clickableElements=[this.element]:this.clickableElements=r.getElements(this.options.clickable,"clickable")),this.init()}getAcceptedFiles(){return this.files.filter((e=>e.accepted)).map((e=>e))}getRejectedFiles(){return this.files.filter((e=>!e.accepted)).map((e=>e))}getFilesWithStatus(e){return this.files.filter((t=>t.status===e)).map((e=>e))}getQueuedFiles(){return this.getFilesWithStatus(r.QUEUED)}getUploadingFiles(){return this.getFilesWithStatus(r.UPLOADING)}getAddedFiles(){return this.getFilesWithStatus(r.ADDED)}getActiveFiles(){return this.files.filter((e=>e.status===r.UPLOADING||e.status===r.QUEUED)).map((e=>e))}init(){if("form"===this.element.tagName&&this.element.setAttribute("enctype","multipart/form-data"),this.element.classList.contains("dropzone")&&!this.element.querySelector(".dz-message")&&this.element.appendChild(r.createElement(`<div class="dz-default dz-message"><button class="dz-button" type="button">${this.options.dictDefaultMessage}</button></div>`)),this.clickableElements.length){let e=()=>{this.hiddenFileInput&&this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=document.createElement("input"),this.hiddenFileInput.setAttribute("type","file"),this.hiddenFileInput.setAttribute("form",this.element.id),(null===this.options.maxFiles||this.options.maxFiles>1)&&this.hiddenFileInput.setAttribute("multiple","multiple"),this.hiddenFileInput.className="dz-hidden-input",null!==this.options.acceptedFiles&&this.hiddenFileInput.setAttribute("accept",this.options.acceptedFiles),null!==this.options.capture&&this.hiddenFileInput.setAttribute("capture",this.options.capture),this.hiddenFileInput.setAttribute("tabindex","-1"),this.hiddenFileInput.setAttribute("aria-label","dropzone hidden input"),this.hiddenFileInput.style.visibility="hidden",this.hiddenFileInput.style.position="absolute",this.hiddenFileInput.style.top="0",this.hiddenFileInput.style.left="0",this.hiddenFileInput.style.height="0",this.hiddenFileInput.style.width="0",r.getElement(this.options.hiddenInputContainer,"hiddenInputContainer").appendChild(this.hiddenFileInput),this.hiddenFileInput.addEventListener("change",(()=>{let{files:t}=this.hiddenFileInput;if(t.length)for(let e of t)this.addFile(e);this.emit("addedfiles",t),e()}))};e()}this.URL=null!==window.URL?window.URL:window.webkitURL;for(let e of this.events)this.on(e,this.options[e]);this.on("uploadprogress",(()=>this.updateTotalUploadProgress())),this.on("removedfile",(()=>this.updateTotalUploadProgress())),this.on("canceled",(e=>this.emit("complete",e))),this.on("complete",(e=>{if(0===this.getAddedFiles().length&&0===this.getUploadingFiles().length&&0===this.getQueuedFiles().length)return setTimeout((()=>this.emit("queuecomplete")),0)}));let e=function(e){if(function(e){return e.dataTransfer.types&&e.dataTransfer.types.includes("Files")}(e))return e.stopPropagation(),e.preventDefault()};return this.listeners=[{element:this.element,events:{dragstart:e=>this.emit("dragstart",e),dragenter:t=>(e(t),this.emit("dragenter",t)),dragover:t=>{const n=t.dataTransfer.effectAllowed;return t.dataTransfer.dropEffect="move"===n||"linkMove"===n?"move":"copy",e(t),this.emit("dragover",t)},dragleave:e=>this.emit("dragleave",e),drop:t=>(e(t),this.drop(t)),dragend:e=>this.emit("dragend",e)}}],this.clickableElements.forEach((e=>this.listeners.push({element:e,events:{click:t=>((e!==this.element||t.target===this.element||r.elementInside(t.target,this.element.querySelector(".dz-message")))&&this.hiddenFileInput.click(),!0)}}))),this.enable(),this.options.init.call(this)}destroy(){return this.disable(),this.removeAllFiles(!0),(null!=this.hiddenFileInput?this.hiddenFileInput.parentNode:void 0)&&(this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=null),delete this.element.dropzone,r.instances.splice(r.instances.indexOf(this),1)}updateTotalUploadProgress(){let e,t=0,n=0;if(this.getActiveFiles().length){for(let e of this.getActiveFiles())t+=e.upload.bytesSent,n+=e.upload.total;e=100*t/n}else e=100;return this.emit("totaluploadprogress",e,n,t)}_getParamName(e){return"function"==typeof this.options.paramName?this.options.paramName(e):`${this.options.paramName}${this.options.uploadMultiple?`[${e}]`:""}`}_renameFile(e){const t={...e,name:e.name.replace(/\u202F/g," ")};return"function"!=typeof this.options.renameFile?t.name:this.options.renameFile(t)}getFallbackForm(){let e,t;if(e=this.getExistingFallback())return e;let n='<div class="dz-fallback">';this.options.dictFallbackText&&(n+=`<p>${this.options.dictFallbackText}</p>`),n+=`<input type="file" name="${this._getParamName(0)}" ${this.options.uploadMultiple?'multiple="multiple"':void 0} /><input type="submit" value="Upload!"></div>`;let i=r.createElement(n);return"FORM"!==this.element.tagName?(t=r.createElement(`<form action="${this.options.url}" enctype="multipart/form-data" method="${this.options.method}"></form>`),t.appendChild(i)):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),null!=t?t:i}getExistingFallback(){let e=function(e){for(let t of e)if(/(^| )fallback($| )/.test(t.className))return t};for(let n of["div","form"]){var t;if(t=e(this.element.getElementsByTagName(n)))return t}}setupEventListeners(){return this.listeners.map((e=>(()=>{let t=[];for(let n in e.events){let i=e.events[n];t.push(e.element.addEventListener(n,i,!1))}return t})()))}removeEventListeners(){return this.listeners.map((e=>(()=>{let t=[];for(let n in e.events){let i=e.events[n];t.push(e.element.removeEventListener(n,i,!1))}return t})()))}disable(){return this.clickableElements.forEach((e=>e.classList.remove("dz-clickable"))),this.removeEventListeners(),this.disabled=!0,this.files.map((e=>this.cancelUpload(e)))}enable(){return delete this.disabled,this.clickableElements.forEach((e=>e.classList.add("dz-clickable"))),this.setupEventListeners()}filesize(e){let t=0,n="b";if(e>0){let i=["tb","gb","mb","kb","b"];for(let o=0;o<i.length;o++){let l=i[o];if(e>=Math.pow(this.options.filesizeBase,4-o)/10){t=e/Math.pow(this.options.filesizeBase,4-o),n=l;break}}t=Math.round(10*t)/10}return`<strong>${t}</strong> ${this.options.dictFileSizeUnits[n]}`}_updateMaxFilesReachedClass(){return null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(this.getAcceptedFiles().length===this.options.maxFiles&&this.emit("maxfilesreached",this.files),this.element.classList.add("dz-max-files-reached")):this.element.classList.remove("dz-max-files-reached")}drop(e){if(!e.dataTransfer)return;this.emit("drop",e);let t=[];for(let n=0;n<e.dataTransfer.files.length;n++)t[n]=e.dataTransfer.files[n];if(t.length){let{items:n}=e.dataTransfer;n&&n.length&&null!=n[0].webkitGetAsEntry?this._addFilesFromItems(n):this.handleFiles(t)}this.emit("addedfiles",t)}paste(e){if(null==(t=null!=e?e.clipboardData:void 0,n=e=>e.items,null!=t?n(t):void 0))return;var t,n;this.emit("paste",e);let{items:i}=e.clipboardData;return i.length?this._addFilesFromItems(i):void 0}handleFiles(e){for(let t of e)this.addFile(t)}_addFilesFromItems(e){return(()=>{let t=[];for(let i of e){var n;null!=i.webkitGetAsEntry&&(n=i.webkitGetAsEntry())?n.isFile?t.push(this.addFile(i.getAsFile())):n.isDirectory?t.push(this._addFilesFromDirectory(n,n.name)):t.push(void 0):null!=i.getAsFile&&(null==i.kind||"file"===i.kind)?t.push(this.addFile(i.getAsFile())):t.push(void 0)}return t})()}_addFilesFromDirectory(e,t){let n=e.createReader(),i=e=>{return t=console,n="log",i=t=>t.log(e),null!=t&&"function"==typeof t[n]?i(t,n):void 0;var t,n,i};var o=()=>n.readEntries((e=>{if(e.length>0){for(let n of e)n.isFile?n.file((e=>{if(!this.options.ignoreHiddenFiles||"."!==e.name.substring(0,1))return e.fullPath=`${t}/${e.name}`,this.addFile(e)})):n.isDirectory&&this._addFilesFromDirectory(n,`${t}/${n.name}`);o()}return null}),i);return o()}accept(e,t){this.options.maxFilesize&&e.size>1048576*this.options.maxFilesize?t(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(e.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):r.isValidFile(e,this.options.acceptedFiles)?null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(t(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",e)):this.options.accept.call(this,e,t):t(this.options.dictInvalidFileType)}addFile(e){e.upload={uuid:window.isSecureContext?self.crypto.randomUUID():r.uuidv4(),progress:0,total:e.size,bytesSent:0,filename:this._renameFile(e)},this.files.push(e),e.status=r.ADDED,this.emit("addedfile",e),this._enqueueThumbnail(e),this.accept(e,(t=>{t?(e.accepted=!1,this._errorProcessing([e],t)):(e.accepted=!0,this.options.autoQueue&&this.enqueueFile(e)),this._updateMaxFilesReachedClass()}))}enqueueFiles(e){for(let t of e)this.enqueueFile(t);return null}enqueueFile(e){if(e.status!==r.ADDED||!0!==e.accepted)throw new Error("This file can't be queued because it has already been processed or was rejected.");if(e.status=r.QUEUED,this.options.autoProcessQueue)return setTimeout((()=>this.processQueue()),0)}_enqueueThumbnail(e){if(this.options.createImageThumbnails&&e.type.match(/image.*/)&&e.size<=1048576*this.options.maxThumbnailFilesize)return this._thumbnailQueue.push(e),setTimeout((()=>this._processThumbnailQueue()),0)}_processThumbnailQueue(){if(this._processingThumbnail||0===this._thumbnailQueue.length)return;this._processingThumbnail=!0;let e=this._thumbnailQueue.shift();return this.createThumbnail(e,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,!0,(t=>(this.emit("thumbnail",e,t),this._processingThumbnail=!1,this._processThumbnailQueue())))}removeFile(e){if(e.status===r.UPLOADING&&this.cancelUpload(e),this.files=s(this.files,e),this.emit("removedfile",e),0===this.files.length)return this.emit("reset")}removeAllFiles(e){null==e&&(e=!1);for(let t of this.files.slice())(t.status!==r.UPLOADING||e)&&this.removeFile(t);return null}resizeImage(e,t,n,i,o){return this.createThumbnail(e,t,n,i,!0,((t,n)=>{if(null==n)return o(e);{let{resizeMimeType:t}=this.options;null==t&&(t=e.type);let i=n.toDataURL(t,this.options.resizeQuality);return"image/jpeg"!==t&&"image/jpg"!==t||(i=function(e,t){var n="data:image/jpeg;base64,";if(!e.startsWith(n)||!t.startsWith(n))return t;var i=window.atob(e.slice(n.length));if(!i.startsWith("ÿØÿ"))return t;var o=0,l="";for(;o<i.length&&"ÿÚ"!=i.slice(o,o+2);)if("ÿØ"==i.slice(o,o+2))o+=2;else{var r=o+(256*i.charCodeAt(o+2)+i.charCodeAt(o+3))+2,s=i.slice(o,r);s.startsWith("ÿá")&&(l+=s),o=r}if(""==l)return t;var a=window.atob(t.slice(n.length));if(!a.startsWith("ÿØÿ"))return t;var u=4+256*a.charCodeAt(4)+a.charCodeAt(5);return a=a.slice(0,u)+l+a.slice(u),n+window.btoa(a)}(e.dataURL,i)),o(r.dataURItoBlob(i))}}),!0)}createThumbnail(e,t,n,i,o,l,r=!1){let s=new FileReader;s.onload=()=>{e.dataURL=s.result,"image/svg+xml"!==e.type?this.createThumbnailFromUrl(e,t,n,i,o,l,void 0,r):null!=l&&l(s.result)},s.readAsDataURL(e)}displayExistingFile(e,t,n,i,o=!0){if(this.emit("addedfile",e),this.emit("complete",e),o){let o=t=>{this.emit("thumbnail",e,t),n&&n()};e.dataURL=t,this.createThumbnailFromUrl(e,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,this.options.fixOrientation,o,i)}else this.emit("thumbnail",e,t),n&&n()}createThumbnailFromUrl(e,t,n,i,o,l,r,s=!1){let a=document.createElement("img");r&&(a.crossOrigin=r),o="from-image"!=getComputedStyle(document.body).imageOrientation&&o,a.onload=()=>{let r=e=>e(1);return"undefined"!=typeof EXIF&&null!==EXIF&&o&&(r=e=>EXIF.getData(a,(function(){return e(EXIF.getTag(this,"Orientation"))}))),r((o=>{e.width=a.width,e.height=a.height;let r=this.options.resize.call(this,e,t,n,i),s=document.createElement("canvas"),d=s.getContext("2d");switch(s.width=r.trgWidth,s.height=r.trgHeight,o>4&&(s.width=r.trgHeight,s.height=r.trgWidth),o){case 2:d.translate(s.width,0),d.scale(-1,1);break;case 3:d.translate(s.width,s.height),d.rotate(Math.PI);break;case 4:d.translate(0,s.height),d.scale(1,-1);break;case 5:d.rotate(.5*Math.PI),d.scale(1,-1);break;case 6:d.rotate(.5*Math.PI),d.translate(0,-s.width);break;case 7:d.rotate(.5*Math.PI),d.translate(s.height,-s.width),d.scale(-1,1);break;case 8:d.rotate(-.5*Math.PI),d.translate(-s.height,0)}u(d,a,null!=r.srcX?r.srcX:0,null!=r.srcY?r.srcY:0,r.srcWidth,r.srcHeight,null!=r.trgX?r.trgX:0,null!=r.trgY?r.trgY:0,r.trgWidth,r.trgHeight);let c=s.toDataURL("image/png");if(null!=l)return l(c,s)}))},null!=l&&(a.onerror=l);var d=e.dataURL;return s&&(d=function(e){var t="data:image/jpeg;base64,";if(!e.startsWith(t))return e;var n=window.atob(e.slice(t.length));if(!n.startsWith("ÿØÿ"))return e;var i=0,o="";for(;i<n.length;){if("ÿÚ"==n.slice(i,i+2)){o+=n.slice(i);break}if("ÿØ"==n.slice(i,i+2))o+=n.slice(i,i+2),i+=2;else{var l=i+(256*n.charCodeAt(i+2)+n.charCodeAt(i+3))+2,r=n.slice(i,l);r.startsWith("ÿá")||(o+=r),i=l}}return t+window.btoa(o)}(d)),a.src=d}processQueue(){let{parallelUploads:e}=this.options,t=this.getUploadingFiles().length,n=t;if(t>=e)return;let i=this.getQueuedFiles();if(i.length>0){if(this.options.uploadMultiple)return this.processFiles(i.slice(0,e-t));for(;n<e;){if(!i.length)return;this.processFile(i.shift()),n++}}}processFile(e){return this.processFiles([e])}processFiles(e){for(let t of e)t.processing=!0,t.status=r.UPLOADING,this.emit("processing",t);return this.options.uploadMultiple&&this.emit("processingmultiple",e),this.uploadFiles(e)}_getFilesWithXhr(e){return this.files.filter((t=>t.xhr===e)).map((e=>e))}cancelUpload(e){if(e.status===r.UPLOADING){let t=this._getFilesWithXhr(e.xhr);for(let e of t)e.status=r.CANCELED;void 0!==e.xhr&&e.xhr.abort();for(let e of t)this.emit("canceled",e);this.options.uploadMultiple&&this.emit("canceledmultiple",t)}else e.status!==r.ADDED&&e.status!==r.QUEUED||(e.status=r.CANCELED,this.emit("canceled",e),this.options.uploadMultiple&&this.emit("canceledmultiple",[e]));if(this.options.autoProcessQueue)return this.processQueue()}resolveOption(e,...t){return"function"==typeof e?e.apply(this,t):e}uploadFile(e){return this.uploadFiles([e])}uploadFiles(e){this._transformFiles(e,(t=>{if(this.options.chunking){let n=t[0];e[0].upload.chunked=this.options.chunking&&(this.options.forceChunking||n.size>this.options.chunkSize),e[0].upload.totalChunkCount=Math.ceil(n.size/this.options.chunkSize),0===n.size&&(e[0].upload.totalChunkCount=1)}if(e[0].upload.chunked){let n=e[0],i=t[0];n.upload.chunks=[];let o=()=>{let t=0;for(;void 0!==n.upload.chunks[t];)t++;if(t>=n.upload.totalChunkCount)return;let o=t*this.options.chunkSize,l=Math.min(o+this.options.chunkSize,i.size),s={name:this._getParamName(0),data:i.webkitSlice?i.webkitSlice(o,l):i.slice(o,l),filename:n.upload.filename,chunkIndex:t};n.upload.chunks[t]={file:n,index:t,dataBlock:s,status:r.UPLOADING,progress:0,retries:0},this._uploadData(e,[s])};if(n.upload.finishedChunkUpload=(t,i)=>{let l=!0;t.status=r.SUCCESS,t.dataBlock=null,t.response=t.xhr.responseText,t.responseHeaders=t.xhr.getAllResponseHeaders(),t.xhr=null;for(let e=0;e<n.upload.totalChunkCount;e++){if(void 0===n.upload.chunks[e])return o();n.upload.chunks[e].status!==r.SUCCESS&&(l=!1)}l&&this.options.chunksUploaded(n,(()=>{this._finished(e,i,null)}))},this.options.parallelChunkUploads){const e=Math.min(!0===this.options.parallelChunkUploads?this.options.parallelUploads:this.options.parallelChunkUploads,n.upload.totalChunkCount);for(let t=0;t<e;t++)o()}else o()}else{let n=[];for(let i=0;i<e.length;i++)n[i]={name:this._getParamName(i),data:t[i],filename:e[i].upload.filename};this._uploadData(e,n)}}))}_getChunk(e,t){for(let n=0;n<e.upload.totalChunkCount;n++)if(void 0!==e.upload.chunks[n]&&e.upload.chunks[n].xhr===t)return e.upload.chunks[n]}_uploadData(e,t){let n=new XMLHttpRequest;for(let t of e)t.xhr=n;e[0].upload.chunked&&(e[0].upload.chunks[t[0].chunkIndex].xhr=n);let i=this.resolveOption(this.options.method,e,t),o=this.resolveOption(this.options.url,e,t);n.open(i,o,!0),this.resolveOption(this.options.timeout,e)&&(n.timeout=this.resolveOption(this.options.timeout,e)),n.withCredentials=!!this.options.withCredentials,n.onload=t=>{this._finishedUploading(e,n,t)},n.ontimeout=()=>{this._handleUploadError(e,n,`Request timedout after ${this.options.timeout/1e3} seconds`)},n.onerror=()=>{this._handleUploadError(e,n)},(null!=n.upload?n.upload:n).onprogress=t=>this._updateFilesUploadProgress(e,n,t);let l=this.options.defaultHeaders?{Accept:"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"}:{};this.options.binaryBody&&(l["Content-Type"]=e[0].type),this.options.headers&&Object.assign(l,this.options.headers);for(let e in l){let t=l[e];t&&n.setRequestHeader(e,t)}if(this.options.binaryBody){for(let t of e)this.emit("sending",t,n);this.options.uploadMultiple&&this.emit("sendingmultiple",e,n),this.submitRequest(n,null,e)}else{let i=new FormData;if(this.options.params){let t=this.options.params;"function"==typeof t&&(t=t.call(this,e,n,e[0].upload.chunked?this._getChunk(e[0],n):null));for(let e in t){let n=t[e];if(Array.isArray(n))for(let t=0;t<n.length;t++)i.append(e,n[t]);else i.append(e,n)}}for(let t of e)this.emit("sending",t,n,i);this.options.uploadMultiple&&this.emit("sendingmultiple",e,n,i),this._addFormElementData(i);for(let e=0;e<t.length;e++){let n=t[e];i.append(n.name,n.data,n.filename)}this.submitRequest(n,i,e)}}_transformFiles(e,t){let n=[],i=0;for(let o=0;o<e.length;o++)this.options.transformFile.call(this,e[o],(l=>{n[o]=l,++i===e.length&&t(n)}))}_addFormElementData(e){if("FORM"===this.element.tagName)for(let t of this.element.querySelectorAll("input, textarea, select, button")){let n=t.getAttribute("name"),i=t.getAttribute("type");if(i&&(i=i.toLowerCase()),null!=n)if("SELECT"===t.tagName&&t.hasAttribute("multiple"))for(let i of t.options)i.selected&&e.append(n,i.value);else(!i||"checkbox"!==i&&"radio"!==i||t.checked)&&e.append(n,t.value)}}_updateFilesUploadProgress(e,t,n){if(e[0].upload.chunked){let i=e[0],o=this._getChunk(i,t);n?(o.progress=100*n.loaded/n.total,o.total=n.total,o.bytesSent=n.loaded):(o.progress=100,o.bytesSent=o.total),i.upload.progress=0,i.upload.total=0,i.upload.bytesSent=0;for(let e=0;e<i.upload.totalChunkCount;e++)i.upload.chunks[e]&&void 0!==i.upload.chunks[e].progress&&(i.upload.progress+=i.upload.chunks[e].progress,i.upload.total+=i.upload.chunks[e].total,i.upload.bytesSent+=i.upload.chunks[e].bytesSent);i.upload.progress=i.upload.progress/i.upload.totalChunkCount,this.emit("uploadprogress",i,i.upload.progress,i.upload.bytesSent)}else for(let t of e)t.upload.total&&t.upload.bytesSent&&t.upload.bytesSent==t.upload.total||(n?(t.upload.progress=100*n.loaded/n.total,t.upload.total=n.total,t.upload.bytesSent=n.loaded):(t.upload.progress=100,t.upload.bytesSent=t.upload.total),this.emit("uploadprogress",t,t.upload.progress,t.upload.bytesSent))}_finishedUploading(e,t,n){let i;if(e[0].status!==r.CANCELED&&4===t.readyState){if("arraybuffer"!==t.responseType&&"blob"!==t.responseType&&(i=t.responseText,t.getResponseHeader("content-type")&&~t.getResponseHeader("content-type").indexOf("application/json")))try{i=JSON.parse(i)}catch(e){n=e,i="Invalid JSON response from server."}this._updateFilesUploadProgress(e,t),200<=t.status&&t.status<300?e[0].upload.chunked?e[0].upload.finishedChunkUpload(this._getChunk(e[0],t),i):this._finished(e,i,n):this._handleUploadError(e,t,i)}}_handleUploadError(e,t,n){if(e[0].status!==r.CANCELED){if(e[0].upload.chunked&&this.options.retryChunks){let n=this._getChunk(e[0],t);if(n.retries++<this.options.retryChunksLimit)return void this._uploadData(e,[n.dataBlock]);console.warn("Retried this chunk too often. Giving up.")}this._errorProcessing(e,n||this.options.dictResponseError.replace("{{statusCode}}",t.status),t)}}submitRequest(e,t,n){if(1==e.readyState)if(this.options.binaryBody)if(n[0].upload.chunked){const t=this._getChunk(n[0],e);e.send(t.dataBlock.data)}else e.send(n[0]);else e.send(t);else console.warn("Cannot send this request because the XMLHttpRequest.readyState is not OPENED.")}_finished(e,t,n){for(let i of e)i.status=r.SUCCESS,this.emit("success",i,t,n),this.emit("complete",i);if(this.options.uploadMultiple&&(this.emit("successmultiple",e,t,n),this.emit("completemultiple",e)),this.options.autoProcessQueue)return this.processQueue()}_errorProcessing(e,t,n){for(let i of e)i.status=r.ERROR,this.emit("error",i,t,n),this.emit("complete",i);if(this.options.uploadMultiple&&(this.emit("errormultiple",e,t,n),this.emit("completemultiple",e)),this.options.autoProcessQueue)return this.processQueue()}static uuidv4(){return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(e=>(+e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+e/4).toString(16)))}}r.initClass(),r.options={},r.optionsForElement=function(e){return e.getAttribute("id")&&void 0!==r.options?r.options[a(e.getAttribute("id"))]:void 0},r.instances=[],r.forElement=function(e){if("string"==typeof e&&(e=document.querySelector(e)),null==(null!=e?e.dropzone:void 0))throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");return e.dropzone},r.discover=function(){let e;if(document.querySelectorAll)e=document.querySelectorAll(".dropzone");else{e=[];let t=t=>(()=>{let n=[];for(let i of t)/(^| )dropzone($| )/.test(i.className)?n.push(e.push(i)):n.push(void 0);return n})();t(document.getElementsByTagName("div")),t(document.getElementsByTagName("form"))}return(()=>{let t=[];for(let n of e)!1!==r.optionsForElement(n)?t.push(new r(n)):t.push(void 0);return t})()},r.isBrowserSupported=function(){return"undefined"!=typeof Promise},r.dataURItoBlob=function(e){let t=atob(e.split(",")[1]),n=e.split(",")[0].split(":")[1].split(";")[0],i=new ArrayBuffer(t.length),o=new Uint8Array(i);for(let e=0,n=t.length,i=0<=n;i?e<=n:e>=n;i?e++:e--)o[e]=t.charCodeAt(e);return new Blob([i],{type:n})};const s=(e,t)=>e.filter((e=>e!==t)).map((e=>e)),a=e=>e.replace(/[\-_](\w)/g,(e=>e.charAt(1).toUpperCase()));r.createElement=function(e){let t=document.createElement("div");return t.innerHTML=e,t.childNodes[0]},r.elementInside=function(e,t){if(e===t)return!0;for(;e=e.parentNode;)if(e===t)return!0;return!1},r.getElement=function(e,t){let n;if("string"==typeof e?n=document.querySelector(e):null!=e.nodeType&&(n=e),null==n)throw new Error(`Invalid \`${t}\` option provided. Please provide a CSS selector or a plain HTML element.`);return n},r.getElements=function(e,t){let n,i;if(e instanceof Array){i=[];try{for(n of e)i.push(this.getElement(n,t))}catch(e){i=null}}else if("string"==typeof e)for(n of(i=[],document.querySelectorAll(e)))i.push(n);else null!=e.nodeType&&(i=[e]);if(null==i||!i.length)throw new Error(`Invalid \`${t}\` option provided. Please provide a CSS selector, a plain HTML element or a list of those.`);return i},r.confirm=function(e,t,n){return window.confirm(e)?t():null!=n?n():void 0},r.isValidFile=function(e,t){if(!t)return!0;t=t.split(",");let n=e.type,i=n.replace(/\/.*$/,"");for(let o of t)if(o=o.trim(),"."===o.charAt(0)){if(-1!==e.name.toLowerCase().indexOf(o.toLowerCase(),e.name.length-o.length))return!0}else if(/\/\*$/.test(o)){if(i===o.replace(/\/.*$/,""))return!0}else if(n===o)return!0;return!1},"undefined"!=typeof jQuery&&null!==jQuery&&(jQuery.fn.dropzone=function(e){return this.each((function(){return new r(this,e)}))}),r.ADDED="added",r.QUEUED="queued",r.ACCEPTED=r.QUEUED,r.UPLOADING="uploading",r.PROCESSING=r.UPLOADING,r.CANCELED="canceled",r.ERROR="error",r.SUCCESS="success";var u=function(e,t,n,i,o,l,r,s,a,u){let d=function(e){let t=e.naturalHeight,n=document.createElement("canvas");n.width=1,n.height=t;let i=n.getContext("2d");i.drawImage(e,0,0);let{data:o}=i.getImageData(1,0,1,t),l=0,r=t,s=t;for(;s>l;)0===o[4*(s-1)+3]?r=s:l=s,s=r+l>>1;let a=s/t;return 0===a?1:a}(t);return e.drawImage(t,n,i,o,l,r,s,a,u/d)}}},t={};function n(i){var o=t[i];if(void 0!==o)return o.exports;var l=t[i]={exports:{}};return e[i].call(l.exports,l,l.exports,n),l.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 i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),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})},function(){"use strict";n(6166),n(4639),n(871),n(2038),n(9329)}()}();
\ No newline at end of file
diff --git a/client/src/components/GalleryItem/GalleryItem.js b/client/src/components/GalleryItem/GalleryItem.js
index ce82703af..72ef39582 100644
--- a/client/src/components/GalleryItem/GalleryItem.js
+++ b/client/src/components/GalleryItem/GalleryItem.js
@@ -10,7 +10,6 @@ import FileStatusIcon from 'components/FileStatusIcon/FileStatusIcon';
 import configShape from 'lib/configShape';
 import { connect } from 'react-redux';
 import { bindActionCreators } from 'redux';
-import { createSelectable } from 'react-selectable';
 import * as imageLoadActions from 'state/imageLoad/ImageLoadActions';
 import IMAGE_STATUS from 'state/imageLoad/ImageLoadStatus';
 import PropTypes from 'prop-types';
@@ -526,6 +525,7 @@ class GalleryItem extends Component {
         {this.props.children}
         <div
           className="gallery-item__title"
+          data-draggable="true"
           ref={(title) => { this.title = title; }}
         >
           <label {...inputLabelProps} htmlFor={htmlID}>
@@ -609,8 +609,8 @@ function mapDispatchToProps(dispatch) {
 
 const ConnectedGalleryItem = connect(mapStateToProps, mapDispatchToProps)(GalleryItem);
 
-const File = createSelectable(draggable(ConnectedGalleryItem));
-const Folder = createSelectable(droppable(File));
+const File = draggable(ConnectedGalleryItem);
+const Folder = droppable(File);
 export {
   GalleryItem as Component,
   Folder,
diff --git a/client/src/components/GalleryItem/draggable.js b/client/src/components/GalleryItem/draggable.js
index 2c9904651..70aecf432 100644
--- a/client/src/components/GalleryItem/draggable.js
+++ b/client/src/components/GalleryItem/draggable.js
@@ -10,8 +10,9 @@ export default function draggable(Item) {
 
     return <div
       className="gallery-item__draggable"
-      // The `draggable` attribute is needed to tell react-selectable to not start selecting on mousedown
-      draggable
+      // The `data-draggable` attribute is used to denote to that as this is a "draggable" element
+      // you should not start selecting on mousedown in Selectable.shouldStartSelecting()
+      data-draggable="true"
       ref={setNodeRef}
       {...listeners}
       {...attributes}
diff --git a/client/src/containers/Gallery/Gallery.js b/client/src/containers/Gallery/Gallery.js
index 00bc337a3..26db5bbbd 100644
--- a/client/src/containers/Gallery/Gallery.js
+++ b/client/src/containers/Gallery/Gallery.js
@@ -14,13 +14,13 @@ import * as galleryActions from 'state/gallery/GalleryActions';
 import * as toastsActions from 'state/toasts/ToastsActions';
 import * as queuedFilesActions from 'state/queuedFiles/QueuedFilesActions';
 import * as confirmDeletionActions from 'state/confirmDeletion/ConfirmDeletionActions';
-import { SelectableGroup } from 'react-selectable';
 import configShape from 'lib/configShape';
 import Config from 'lib/Config';
 import getStatusCodeMessage from 'lib/getStatusCodeMessage';
 import { inject } from 'lib/Injector';
 import PropTypes from 'prop-types';
 import backend from 'lib/Backend';
+import Selectable from 'containers/Selectable/Selectable';
 import MoveModal from '../MoveModal/MoveModal';
 import GalleryDND from './GalleryDND';
 
@@ -65,7 +65,6 @@ class Gallery extends Component {
     this.handleBulkUnpublish = this.handleBulkUnpublish.bind(this);
     this.handleBulkMove = this.handleBulkMove.bind(this);
     this.handleBulkInsert = this.handleBulkInsert.bind(this);
-    this.handleBeginSelection = this.handleBeginSelection.bind(this);
     this.handleGroupSelect = this.handleGroupSelect.bind(this);
     this.handleClearSelection = this.handleClearSelection.bind(this);
     this.handleSelectAll = this.handleSelectAll.bind(this);
@@ -551,14 +550,14 @@ class Gallery extends Component {
   /**
    * Pick if the selection started from inside the pagination. If it started from inside the
    * pagination, cancel it to prevent inteference with the normal pagination.
-   * @param Event e
+   * @param Element target
    * @returns {boolean}
    */
-  handleBeginSelection(e) {
+  handleShouldStartSelecting(target) {
     /** @type Node */
-    let node = e.target;
+    let node = target;
     // Loop the nodes until we find the root of the pagination or the root of the selectable area
-    while (node) {
+    while (node && (node instanceof Element)) {
       if (node.classList.contains('paginator-footer')) {
         return false;
       }
@@ -944,28 +943,27 @@ class Gallery extends Component {
       cssClasses.push('gallery__main--has-opened-item');
     }
 
+    const canSelect = this.props.view === 'tile' && this.props.type === ACTION_TYPES.ADMIN;
+
     return (
       <div
         className="flexbox-area-grow gallery__outer"
         ref={gallery => { this.gallery = gallery; }}
       >
         {this.renderTransitionBulkActions()}
-        <GalleryDND
-          onDragStartEnd={(dragging) => this.handleEnableDropzone(!dragging)}
-          onDropFiles={this.handleMoveFiles}
-          selectedFiles={this.props.selectedFiles}
-          className={galleryClasses.join(' ')}
+        <Selectable
+          isEnabled={canSelect}
+          onMouseDownOverNonDraggable={this.handleClearSelection}
+          onSelectionChange={this.handleGroupSelect}
+          onShouldStartSelecting={this.handleShouldStartSelecting}
         >
-          {this.renderToolbar()}
-          <SelectableGroup
-            enabled={this.props.view === 'tile' && this.props.type === ACTION_TYPES.ADMIN}
-            className="flexbox-area-grow fill-height gallery__main--selectable"
-            onSelection={this.handleGroupSelect}
-            onNonItemClick={this.handleClearSelection}
-            onBeginSelection={this.handleBeginSelection}
-            preventDefault={false}
-            fixedPosition
+          <GalleryDND
+            onDragStartEnd={(dragging) => this.handleEnableDropzone(!dragging)}
+            onDropFiles={this.handleMoveFiles}
+            selectedFiles={this.props.selectedFiles}
+            className={galleryClasses.join(' ')}
           >
+            {this.renderToolbar()}
             <AssetDropzone
               name="gallery-container"
               className="flexbox-area-grow"
@@ -986,15 +984,15 @@ class Gallery extends Component {
               {messages}
               {this.renderGalleryView()}
             </AssetDropzone>
-          </SelectableGroup>
-        </GalleryDND>
-        {this.props.loading && <Loading />}
-        <MoveModal
-          sectionConfig={this.props.sectionConfig}
-          folderId={this.props.folderId}
-          onSuccess={this.props.onMoveFilesSuccess}
-          onOpenFolder={this.props.onOpenFolder}
-        />
+          </GalleryDND>
+          {this.props.loading && <Loading />}
+          <MoveModal
+            sectionConfig={this.props.sectionConfig}
+            folderId={this.props.folderId}
+            onSuccess={this.props.onMoveFilesSuccess}
+            onOpenFolder={this.props.onOpenFolder}
+          />
+        </Selectable>
       </div>
     );
   }
diff --git a/client/src/containers/Gallery/Gallery.scss b/client/src/containers/Gallery/Gallery.scss
index 181caa7af..4e79d2aba 100644
--- a/client/src/containers/Gallery/Gallery.scss
+++ b/client/src/containers/Gallery/Gallery.scss
@@ -68,7 +68,6 @@
   flex-flow: row wrap;
 }
 
-
 // leave space at bottom for bulk-actions on smaller screens
 @include media-breakpoint-down(lg) {
   .gallery__files {
diff --git a/client/src/containers/Selectable/Selectable.js b/client/src/containers/Selectable/Selectable.js
new file mode 100644
index 000000000..4aa83e598
--- /dev/null
+++ b/client/src/containers/Selectable/Selectable.js
@@ -0,0 +1,191 @@
+import { boxesIntersect, useSelectionContainer } from '@air/react-drag-to-select';
+import React, { useState, useRef } from 'react';
+import PropTypes from 'prop-types';
+
+/**
+ * Component that wraps around a list of items to make them selectable by dragging a box around them
+ * and calls a callback when the selection changes
+ * Uses the @air/react-drag-to-select library
+ */
+function Selectable(props) {
+  const [mouseEvent, setMouseEvent] = useState(null);
+  const [lastFileIDs, setLastFileIDs] = useState([]);
+
+  const selectableItems = useRef([]);
+  const selectableItemCoords = useRef([]);
+  const itemContainerRef = useRef(null);
+  const scrollableRef = useRef(null);
+  // Using ref rather than state to store the offset so as to not to trigger re-render
+  const offset = useRef({ y: 0, x: 0 });
+
+  /**
+   * Check if the target or any of its ancestors have the data-draggable attribute
+   */
+  function targetIsDraggable(target) {
+    if (target instanceof HTMLElement) {
+      let el = target;
+      while (el.parentElement && !el.dataset.draggable) {
+        el = el.parentElement;
+      }
+      if (el.dataset.draggable === 'true') {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  /**
+   * Check if the target in an element outside the selectable, such as a modal
+   */
+  function targetIsOutside(target) {
+    if (target instanceof HTMLElement) {
+      let el = target;
+      while (el.parentElement && el !== scrollableRef.current) {
+        el = el.parentElement;
+      }
+      if (el === scrollableRef.current) {
+        return false;
+      }
+    }
+    return true;
+  }
+
+  /**
+   * Handle mouse down event
+   */
+  function handleMouseDown(evt) {
+    const target = evt.target;
+    if (!props.isEnabled || targetIsOutside(target)) {
+      return;
+    }
+    if (!targetIsDraggable(target)) {
+      if (typeof props.onMouseDownOverNonDraggable === 'function') {
+        props.onMouseDownOverNonDraggable();
+      }
+    }
+  }
+
+  // Selection container setup
+  const { DragSelection } = useSelectionContainer({
+    /**
+     * Callback when selection starts
+     */
+    onSelectionStart: (evt) => {
+      setMouseEvent(evt);
+      // Update seletable items and their coordinates
+      // This needs to called on selection start to update the selectable items
+      // in case items have been added or removed, or the viewport
+      // has been resized
+      selectableItems.current = itemContainerRef.current.querySelectorAll('.gallery-item');
+      selectableItemCoords.current = [];
+      Array.from(selectableItems.current).forEach(item => {
+        const { left, top, width, height } = item.getBoundingClientRect();
+        selectableItemCoords.current.push({ left, top, width, height, item });
+      });
+      // Get the offset of the scrollable panel
+      offset.current.y = scrollableRef.current.scrollTop;
+      offset.current.x = scrollableRef.current.scrollLeft;
+    },
+
+    /**
+     * Callback when selection changes
+     */
+    onSelectionChange: (boxCoords) => {
+      const scrollAwareBoxCoords = {
+        ...boxCoords,
+        top: boxCoords.top - offset.current.y + scrollableRef.current.scrollTop,
+        left: boxCoords.left - offset.current.x + scrollableRef.current.scrollLeft,
+      };
+      const selectedIndexes = [];
+      selectableItemCoords.current.forEach((itemCoords, index) => {
+        if (boxesIntersect(scrollAwareBoxCoords, itemCoords)) {
+          selectedIndexes.push(index);
+        }
+      });
+      const fileIDs = [];
+      selectableItems.current.forEach((item, index) => {
+        if (selectedIndexes.includes(index)) {
+          // Multiply by one to convert string to int
+          fileIDs.push(item.getAttribute('data-id') * 1);
+        }
+      });
+      // Check if the selection has changed before calling the onSelectionChange callback to prevent
+      // a very large number of unnecessary calls
+      if (mouseEvent && fileIDs.length !== lastFileIDs.length) {
+        if (typeof props.onSelectionChange === 'function') {
+          props.onSelectionChange(fileIDs, mouseEvent);
+        }
+        setLastFileIDs(fileIDs);
+      }
+    },
+
+    /**
+     * Props to pass to the selection box
+     */
+    selectionProps: {
+      // CSS need to be defined as inline styles to override the default styles
+      // Setting these in scss with !important does not work as there will be an ugly empty dashed box
+      // before anything is selected
+      style: {
+        border: '1px dashed #999',
+        backgroundColor: 'transparent',
+        zIndex: 9000,
+      },
+    },
+
+    /**
+     * Whether to start selecting
+     */
+    shouldStartSelecting: (target) => {
+      // Prevent start selecting if currently over an element or ancestor element with the data-draggable attribute
+      // Will stop at the first element with the data-draggable attribute
+      // Also prevent selecting if the target is outside the selectable area
+      if (targetIsDraggable(target) || targetIsOutside(target)) {
+        return false;
+      }
+      // Allow ancestor components to prevent selection
+      if (typeof props.onShouldStartSelecting === 'function') {
+        return props.onShouldStartSelecting(target);
+      }
+      return true;
+    },
+
+    isEnabled: props.isEnabled,
+  });
+
+  // Render
+  // Note all of these divs are required for the drag selection to work properly when drag selecting
+  // a large list of items which is scrollable
+  // The css styles are required for functionality, rather than simply appearance, so they are
+  // defined inline here, rather than in an scss file
+  const scrollableStyle = {
+    overflowY: 'auto',
+    overflowX: 'clip',
+    position: 'relative',
+    height: '100%',
+  };
+  return <div
+    onMouseDown={(evt) => handleMouseDown(evt)}
+    ref={scrollableRef}
+    style={{ ...scrollableStyle }}
+  >
+    <div style={{ height: '100%' }}>
+      <DragSelection />
+      <div
+        ref={itemContainerRef}
+        style={{ height: '100%' }}
+      >
+        { props.children }
+      </div>
+    </div>
+  </div>;
+}
+
+Selectable.propTypes = {
+  isEnabled: PropTypes.bool.isRequired,
+  onMouseDownOverNonDraggable: PropTypes.func,
+  onSelectionChange: PropTypes.func,
+  onShouldStartSelecting: PropTypes.func,
+};
+
+export default Selectable;
diff --git a/package.json b/package.json
index 6bf840f17..e8c1fd566 100644
--- a/package.json
+++ b/package.json
@@ -64,6 +64,7 @@
     "webpack-cli": "^5.0.0"
   },
   "dependencies": {
+    "@air/react-drag-to-select": "^5.0.10",
     "@deltablot/dropzone": "^7.2.0",
     "@dnd-kit/core": "^6.3.1",
     "@dnd-kit/modifiers": "^9.0.0",
@@ -83,7 +84,6 @@
     "react-dom": "^18.2.0",
     "react-redux": "^9.2.0",
     "react-router-dom": "^6.4.3",
-    "react-selectable": "^2.1.1",
     "reactstrap": "^9.2.0",
     "redux": "^5.0.1",
     "redux-form": "^8.3.10",
diff --git a/yarn.lock b/yarn.lock
index 34057d4df..b036a036c 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2,6 +2,13 @@
 # yarn lockfile v1
 
 
+"@air/react-drag-to-select@^5.0.10":
+  version "5.0.10"
+  resolved "https://registry.yarnpkg.com/@air/react-drag-to-select/-/react-drag-to-select-5.0.10.tgz#c80c748bc06e6abac00f4a352c6917f80405140d"
+  integrity sha512-KP0HaYoGvVinDwl0K4hv54CAyvbmN/7Z9ZRhOwZvJsgBjfAwWEHYIoJ5k3VLk3D4dp6XIU1FXnBbKO/IoF4S7g==
+  dependencies:
+    react-style-object-to-css "^1.1.2"
+
 "@ampproject/remapping@^2.2.0":
   version "2.3.0"
   resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.3.0.tgz#ed441b6fa600072520ce18b43d2c8cc8caecc7f4"
@@ -6856,10 +6863,10 @@ react-router@6.28.1:
   dependencies:
     "@remix-run/router" "1.21.0"
 
-react-selectable@^2.1.1:
-  version "2.1.1"
-  resolved "https://registry.yarnpkg.com/react-selectable/-/react-selectable-2.1.1.tgz#21272e613929991e248570cc98a9266aa10eeecb"
-  integrity sha512-5W7WrC+TCchIwE8wDQhV5F1iJXNZJN09RsIa7kgl8P8tcG7UOYSkK6M3Jundec90mB7iN+KOLeLivSRdf9WrxQ==
+react-style-object-to-css@^1.1.2:
+  version "1.1.2"
+  resolved "https://registry.yarnpkg.com/react-style-object-to-css/-/react-style-object-to-css-1.1.2.tgz#3e97da92c9edf8190e30f4b27026e74285940498"
+  integrity sha512-+5MFULqCCj7wwJJ/ISKFP91ZlHVF1Rv8o0neiTKvt21XDTU5e34tc8hy+XPLeYWYOupdHt25HxxwocvYm3HM6A==
 
 react-transition-group@^4.4.2:
   version "4.4.5"


Reviews:
user: login: emteknetnz
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-18T00:29:08Z
user: login: GuySartorelli
body: This has broken drag-and-drop to upload. This video shows me dragging a folder over the asset admin, but the display is completely wrong.

[Screencast from 18-03-25 16:59:34.webm](https://github.com/user-attachments/assets/c5f24222-1ef5-4a2b-9c13-1e13d0c1ebcc)

Compare with CMS 6 which allows me to drop the file(s) anywhere.

https://github.com/user-attachments/assets/04917149-4019-44f1-bba2-76dadd8d712c


state: CHANGES_REQUESTED
author_association: MEMBER
submitted_at: 2025-03-18T04:12:35Z
user: login: GuySartorelli
body: Just noticed as well that if I have only a few files, and I start dragging from _below_ them, the dotted box isn't actually displayed until I drag up and my cursor reaches where the files are.
state: CHANGES_REQUESTED
author_association: MEMBER
submitted_at: 2025-03-18T04:21:19Z
user: login: GuySartorelli
state: CHANGES_REQUESTED
author_association: MEMBER
submitted_at: 2025-03-18T04:26:06Z
user: login: emteknetnz
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-18T05:24:32Z
user: login: emteknetnz
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-18T05:27:59Z
user: login: emteknetnz
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-18T05:45:17Z
user: login: emteknetnz
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-18T05:45:47Z
user: login: emteknetnz
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-18T05:47:19Z
user: login: emteknetnz
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-18T05:47:58Z
user: login: GuySartorelli
body: ## Actual regressions

These are bugs that this PR introduces that definitely need fixing.

1. After selecting some items, clicking in an empty space doesn't clear the selection.

## Minor bugs

These are all things that are clearly bugs, but I'm not sure if it's buggy enough to worry about.

1. This PR creates a horizontal scrolling area if you scroll off to the side - BUT that disappears as soon as you let go of the mouse.
![image](https://github.com/user-attachments/assets/e0b28ffa-0189-424a-b715-aa67a23ea5b4)
1. This PR also makes it so that if you click and drag from the pagination number it starts selecting text which it didn't do before. Clicking in a blank area _does not clear the text selection_. Clicking and dragging to select files after that _also selects their text_.
1. It is a _little_ weird that the selection display gets cut off on the left earlier than the left menu, and earlier going upwards than the breadcrumb section.
state: CHANGES_REQUESTED
author_association: MEMBER
submitted_at: 2025-03-18T20:46:54Z
user: login: emteknetnz
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-18T22:35:32Z
user: login: GuySartorelli
body: LGTM, works as expected
state: APPROVED
author_association: MEMBER
submitted_at: 2025-03-19T04:00:57Z

Review comments:
diff_hunk: @@ -548,28 +547,6 @@ class Gallery extends Component {
     this.handleGroupSelect(ids, new Event('na'));
   }
 
-  /**
-   * Pick if the selection started from inside the pagination. If it started from inside the
-   * pagination, cancel it to prevent inteference with the normal pagination.
-   * @param Event e
-   * @returns {boolean}
-   */
-  handleBeginSelection(e) {
path: client/src/containers/Gallery/Gallery.js
user: login: emteknetnz
body: I'm not sure what these actually did, from what i can tell it didn't actually do anything. It doesn't appear to be necessary going forward.
created_at: 2025-03-18T00:29:08Z
author_association: MEMBER
diff_hunk: @@ -957,14 +934,9 @@ class Gallery extends Component {
           className={galleryClasses.join(' ')}
         >
           {this.renderToolbar()}
-          <SelectableGroup
-            enabled={this.props.view === 'tile' && this.props.type === ACTION_TYPES.ADMIN}
-            className="flexbox-area-grow fill-height gallery__main--selectable"
-            onSelection={this.handleGroupSelect}
-            onNonItemClick={this.handleClearSelection}
-            onBeginSelection={this.handleBeginSelection}
-            preventDefault={false}
-            fixedPosition
+          <Selectable
+            isEnabled={this.props.view === 'tile'}
+            onSelectionChange={this.handleGroupSelect}
path: client/src/containers/Gallery/Gallery.js
user: login: GuySartorelli
body: Why was `&& this.props.type === ACTION_TYPES.ADMIN` dropped from the enabled condition?
created_at: 2025-03-18T03:57:18Z
author_association: MEMBER
diff_hunk: @@ -65,7 +65,6 @@ class Gallery extends Component {
     this.handleBulkUnpublish = this.handleBulkUnpublish.bind(this);
     this.handleBulkMove = this.handleBulkMove.bind(this);
     this.handleBulkInsert = this.handleBulkInsert.bind(this);
-    this.handleBeginSelection = this.handleBeginSelection.bind(this);
     this.handleGroupSelect = this.handleGroupSelect.bind(this);
     this.handleClearSelection = this.handleClearSelection.bind(this);
path: client/src/containers/Gallery/Gallery.js
user: login: GuySartorelli
body: `handleClearSelection` still exists, but it isn't passed into the new `<Selectable>` component. Is it still used?
created_at: 2025-03-18T03:58:06Z
author_association: MEMBER
diff_hunk: @@ -548,28 +547,6 @@ class Gallery extends Component {
     this.handleGroupSelect(ids, new Event('na'));
   }
 
-  /**
-   * Pick if the selection started from inside the pagination. If it started from inside the
-   * pagination, cancel it to prevent inteference with the normal pagination.
-   * @param Event e
-   * @returns {boolean}
-   */
-  handleBeginSelection(e) {
path: client/src/containers/Gallery/Gallery.js
user: login: GuySartorelli
body: This did exactly what it said it did in the comment - if you try to click-and-drag from the "next" or "previous" page button at the bottom of the gallery, without this PR it doesn't start a selection, but with this PR it does.

_Very_ minor difference, but it is a little cleaner if it doesn't try selecting when your click starts on another interactive element.
created_at: 2025-03-18T04:18:19Z
author_association: MEMBER
diff_hunk: @@ -0,0 +1,127 @@
+import { boxesIntersect, useSelectionContainer } from '@air/react-drag-to-select';
+import React, { useState, useRef } from 'react';
+import PropTypes from 'prop-types';
+
+/**
+ * Component that wraps around a list of items to make them selectable by dragging a box around them
+ * and calls a callback when the selection changes
+ * Uses the react-drag-to-select library
+ */
+function Selectable(props) {
+  // State hooks
+  const [mouseEvent, setMouseEvent] = useState(null);
+  const [lastFileIDs, setLastFileIDs] = useState([]);
+
+  // Ref hooks
path: client/src/containers/Selectable/Selectable.js
user: login: GuySartorelli
body: ```suggestion
  const [mouseEvent, setMouseEvent] = useState(null);
  const [lastFileIDs, setLastFileIDs] = useState([]);

```
Those are self-explanatory
created_at: 2025-03-18T04:22:08Z
author_association: MEMBER
diff_hunk: @@ -0,0 +1,127 @@
+import { boxesIntersect, useSelectionContainer } from '@air/react-drag-to-select';
+import React, { useState, useRef } from 'react';
+import PropTypes from 'prop-types';
+
+/**
+ * Component that wraps around a list of items to make them selectable by dragging a box around them
+ * and calls a callback when the selection changes
+ * Uses the react-drag-to-select library
path: client/src/containers/Selectable/Selectable.js
user: login: GuySartorelli
body: ```suggestion
 * Uses the @air/react-drag-to-select library
```
When I first looked that up I found https://www.npmjs.com/package/react-drag-to-select and was worried because that's abandoned.

With any comments referencing this, can you please add the full reference i.e. `@air/react-drag-to-select` to avoid that confusion
created_at: 2025-03-18T04:23:04Z
author_association: MEMBER
diff_hunk: @@ -10,8 +10,8 @@ export default function draggable(Item) {
 
     return <div
       className="gallery-item__draggable"
-      // The `draggable` attribute is needed to tell react-selectable to not start selecting on mousedown
-      draggable
+      // The `data-draggable` attribute is needed to tell react-drag-to-select to not start selecting on mousedown
+      data-draggable="true"
path: client/src/components/GalleryItem/draggable.js
user: login: GuySartorelli
body: Does the library actually handle that at all or is it just our custom `Selectable` component?
created_at: 2025-03-18T04:25:35Z
author_association: MEMBER
diff_hunk: @@ -10,8 +10,8 @@ export default function draggable(Item) {
 
     return <div
       className="gallery-item__draggable"
-      // The `draggable` attribute is needed to tell react-selectable to not start selecting on mousedown
-      draggable
+      // The `data-draggable` attribute is needed to tell react-drag-to-select to not start selecting on mousedown
+      data-draggable="true"
path: client/src/components/GalleryItem/draggable.js
user: login: emteknetnz
body: In theory it's the library https://github.com/AirLabsTeam/react-drag-to-select/blob/main/src/hooks/useSelectionContainer.tsx#L34

But in practice it didn't seem to work, so I manually implemented this in Selectable.shouldStartSelecting()

I'll update the comment
created_at: 2025-03-18T05:24:32Z
author_association: MEMBER
diff_hunk: @@ -65,7 +65,6 @@ class Gallery extends Component {
     this.handleBulkUnpublish = this.handleBulkUnpublish.bind(this);
     this.handleBulkMove = this.handleBulkMove.bind(this);
     this.handleBulkInsert = this.handleBulkInsert.bind(this);
-    this.handleBeginSelection = this.handleBeginSelection.bind(this);
     this.handleGroupSelect = this.handleGroupSelect.bind(this);
     this.handleClearSelection = this.handleClearSelection.bind(this);
path: client/src/containers/Gallery/Gallery.js
user: login: emteknetnz
body: Yeah, it's passed into `<BulkActionsComponent>` in `Gallery.renderBulkActions()`
created_at: 2025-03-18T05:27:59Z
author_association: MEMBER
diff_hunk: @@ -548,28 +547,6 @@ class Gallery extends Component {
     this.handleGroupSelect(ids, new Event('na'));
   }
 
-  /**
-   * Pick if the selection started from inside the pagination. If it started from inside the
-   * pagination, cancel it to prevent inteference with the normal pagination.
-   * @param Event e
-   * @returns {boolean}
-   */
-  handleBeginSelection(e) {
path: client/src/containers/Gallery/Gallery.js
user: login: emteknetnz
body: Have added back in though changed name to `handleShouldStartSelecting` to reflect what it's used on in `<Selectable>`
created_at: 2025-03-18T05:45:17Z
author_association: MEMBER
diff_hunk: @@ -957,14 +934,9 @@ class Gallery extends Component {
           className={galleryClasses.join(' ')}
         >
           {this.renderToolbar()}
-          <SelectableGroup
-            enabled={this.props.view === 'tile' && this.props.type === ACTION_TYPES.ADMIN}
-            className="flexbox-area-grow fill-height gallery__main--selectable"
-            onSelection={this.handleGroupSelect}
-            onNonItemClick={this.handleClearSelection}
-            onBeginSelection={this.handleBeginSelection}
-            preventDefault={false}
-            fixedPosition
+          <Selectable
+            isEnabled={this.props.view === 'tile'}
+            onSelectionChange={this.handleGroupSelect}
path: client/src/containers/Gallery/Gallery.js
user: login: emteknetnz
body: Didn't realise I had, added in
created_at: 2025-03-18T05:45:47Z
author_association: MEMBER
diff_hunk: @@ -0,0 +1,127 @@
+import { boxesIntersect, useSelectionContainer } from '@air/react-drag-to-select';
+import React, { useState, useRef } from 'react';
+import PropTypes from 'prop-types';
+
+/**
+ * Component that wraps around a list of items to make them selectable by dragging a box around them
+ * and calls a callback when the selection changes
+ * Uses the react-drag-to-select library
path: client/src/containers/Selectable/Selectable.js
user: login: emteknetnz
body: Updated
created_at: 2025-03-18T05:47:19Z
author_association: MEMBER
diff_hunk: @@ -0,0 +1,127 @@
+import { boxesIntersect, useSelectionContainer } from '@air/react-drag-to-select';
+import React, { useState, useRef } from 'react';
+import PropTypes from 'prop-types';
+
+/**
+ * Component that wraps around a list of items to make them selectable by dragging a box around them
+ * and calls a callback when the selection changes
+ * Uses the react-drag-to-select library
+ */
+function Selectable(props) {
+  // State hooks
+  const [mouseEvent, setMouseEvent] = useState(null);
+  const [lastFileIDs, setLastFileIDs] = useState([]);
+
+  // Ref hooks
path: client/src/containers/Selectable/Selectable.js
user: login: emteknetnz
body: Updated
created_at: 2025-03-18T05:47:58Z
author_association: MEMBER
diff_hunk: @@ -944,6 +943,8 @@ class Gallery extends Component {
       cssClasses.push('gallery__main--has-opened-item');
     }
 
+    const isEnabled = this.props.view === 'tile' && this.props.type === ACTION_TYPES.ADMIN;
path: client/src/containers/Gallery/Gallery.js
user: login: GuySartorelli
body: ```suggestion
    const canSelect = this.props.view === 'tile' && this.props.type === ACTION_TYPES.ADMIN;
```
`isEnabled` out here looks like it's talking about the enabled state of the gallery
created_at: 2025-03-18T20:25:36Z
author_association: MEMBER
diff_hunk: @@ -944,6 +943,8 @@ class Gallery extends Component {
       cssClasses.push('gallery__main--has-opened-item');
     }
 
+    const isEnabled = this.props.view === 'tile' && this.props.type === ACTION_TYPES.ADMIN;
path: client/src/containers/Gallery/Gallery.js
user: login: emteknetnz
body: Updated
created_at: 2025-03-18T22:35:32Z
author_association: MEMBER

PR comments:
user: login: emteknetnz
created_at: 2025-03-18T06:04:03Z
body: @GuySartorelli Have added a height: '100%' style to some of the div's, and adding 'display: flex' via a scss on another.  that resolved both the 'drop in file' and 'drag from below' issues

There is one issue, though probably very minor in practice, where the dashed box will get cut off if you drag to panel to the left where the links to model admins are (or above the gallery).  This has no functional impact though and most people probably wouldn't even drag their mouse there, or if they did notice the issue.  I don't see any easy fix to this so I think we should just live with this minor limitation
author_association: MEMBER
user: login: emteknetnz
created_at: 2025-03-18T23:11:41Z
body: > After selecting some items, clicking in an empty space doesn't clear the selection.

Fixed

> This PR creates a horizontal scrolling area if you scroll off to the side - BUT that disappears as soon as you let go of the mouse.

Fixed

> This PR also makes it so that if you click and drag from the pagination number it starts selecting text which it didn't do before.

Kind of weird how this started. I've created a [new PR](https://github.com/silverstripe/silverstripe-admin/pull/1913) to fix this.

> Clicking in a blank area does not clear the text selection. Clicking and dragging to select files after that also selects their text.

Fixed

> It is a little weird that the selection display gets cut off on the left earlier than the left menu, and earlier going upwards than the breadcrumb section.

I think we'll need to leave this as is as I don't know how to resolve this. IMO it's a pretty minor aesthetic issue that doesn't affect actual functionality at all.

author_association: MEMBER
user: login: GuySartorelli
created_at: 2025-03-19T00:55:19Z
body: >> It is a little weird that the selection display gets cut off on the left earlier than the left menu, and earlier going upwards than the breadcrumb section.
>
> I think we'll need to leave this as is as I don't know how to resolve this. IMO it's a pretty minor aesthetic issue that doesn't affect actual functionality at all.

It is quite disorienting for me - but if there's not much we can do then there's not much we can do.

My one thought is - what if we made the `.gallery__outer` element the parent of the scrollable? 
![image](https://github.com/user-attachments/assets/a765201c-eb88-49cb-bb77-a62205d55560)
If that's doable without much effort, I think it would resolve it, because then the boundaries for where it stops rendering are marked with clear lines rather than invisible ones.

If that's not doable or is considerable effort, I'm okay with not doing it.
author_association: MEMBER
user: login: emteknetnz
created_at: 2025-03-19T02:03:15Z
body: Yeah that seemed to work by simply moving where the `<Selectable>` component in in the hieracrchy, the top and left boundaries aren't dotted lines unfortunately, though there's less "cutting off" when you drag above the area

I also removed the item list classname prop in the component as its direct children are no longer items
author_association: MEMBER
user: login: GuySartorelli
created_at: 2025-03-19T04:00:46Z
body: That's way better🎉
author_association: MEMBER