1import{I as s,R as F,b4 as pe,a9 as u,ao as I,ag as J,aH as xn,b6 as Wt,aG as yn,ab as Cn,aI as Dn,ar as tt,aJ as re,aR as $e,am as _,aQ as Rn,ad as ge,b8 as ve,b9 as zt,aK as le,aX as Sn,aY as En}from"./index-51c884ce.js";const Ke=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function me(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function ft(e){return"nodeType"in e}function N(e){var t,n;return e?me(e)?e:ft(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function ht(e){const{Document:t}=N(e);return e instanceof t}function Te(e){return me(e)?!1:e instanceof N(e).HTMLElement}function Mn(e){return e instanceof N(e).SVGElement}function we(e){return e?me(e)?e.document:ft(e)?ht(e)?e:Te(e)?e.ownerDocument:document:document:document}const Q=Ke?s.useLayoutEffect:s.useEffect;function gt(e){const t=s.useRef(e);return Q(()=>{t.current=e}),s.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function kn(){const e=s.useRef(null),t=s.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=s.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Oe(e,t){t===void 0&&(t=[e]);const n=s.useRef(e);return Q(()=>{n.current!==e&&(n.current=e)},t),n}function Le(e,t){const n=s.useRef();return s.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Xe(e){const t=gt(e),n=s.useRef(null),r=s.useCallback(o=>{o!==n.current&&(t==null||t(o,n.current)),n.current=o},[]);return[n,r]}function at(e){const t=s.useRef();return s.useEffect(()=>{t.current=e},[e]),t.current}let nt={};function Ge(e,t){return s.useMemo(()=>{if(t)return t;const n=nt[e]==null?0:nt[e]+1;return nt[e]=n,e+"-"+n},[e,t])}function Gt(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((i,a)=>{const l=Object.entries(a);for(const[c,d]of l){const h=i[c];h!=null&&(i[c]=h+e*d)}return i},{...t})}}const be=Gt(1),He=Gt(-1);function jn(e){return"clientX"in e&&"clientY"in e}function Vt(e){if(!e)return!1;const{KeyboardEvent:t}=N(e.target);return t&&e instanceof t}function On(e){if(!e)return!1;const{TouchEvent:t}=N(e.target);return t&&e instanceof t}function lt(e){if(On(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return jn(e)?{x:e.clientX,y:e.clientY}:null}const Pt="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function An(e){return e.matches(Pt)?e:e.querySelector(Pt)}const Tn={display:"none"};function Ln(e){let{id:t,value:n}=e;return F.createElement("div",{id:t,style:Tn},n)}const In={position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};function Nn(e){let{id:t,announcement:n}=e;return F.createElement("div",{id:t,style:In,role:"status","aria-live":"assertive","aria-atomic":!0},n)}function Wn(){const[e,t]=s.useState("");return{announce:s.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const qt=s.createContext(null);function zn(e){const t=s.useContext(qt);s.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Pn(){const[e]=s.useState(()=>new Set),t=s.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[s.useCallback(r=>{let{type:o,event:i}=r;e.forEach(a=>{var l;return(l=a[o])==null?void 0:l.call(a,i)})},[e]),t]}const Bn={draggable:` 2 To pick up a draggable item, press the space bar. 3 While dragging, use the arrow keys to move the item. 4 Press space again to drop the item in its new position, or press escape to cancel. 5 `},Fn={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 $n(e){let{announcements:t=Fn,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=Bn}=e;const{announce:i,announcement:a}=Wn(),l=Ge("DndLiveRegion"),[c,d]=s.useState(!1);if(s.useEffect(()=>{d(!0)},[]),zn(s.useMemo(()=>({onDragStart(f){let{active:b}=f;i(t.onDragStart({active:b}))},onDragMove(f){let{active:b,over:v}=f;t.onDragMove&&i(t.onDragMove({active:b,over:v}))},onDragOver(f){let{active:b,over:v}=f;i(t.onDragOver({active:b,over:v}))},onDragEnd(f){let{active:b,over:v}=f;i(t.onDragEnd({active:b,over:v}))},onDragCancel(f){let{active:b,over:v}=f;
5i(t.onDragCancel({active:b,over:v}))}}),[i,t])),!c)return null;const h=F.createElement(F.Fragment,null,F.createElement(Ln,{id:r,value:o.draggable}),F.createElement(Nn,{id:l,announcement:a}));return n?pe.createPortal(h,n):h}var O;(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"})(O||(O={}));function _e(){}const Y=Object.freeze({x:0,y:0});function Un(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Xn(e,t){if(!e||e.length===0)return null;const[n]=e;return t?n[t]:n}function Hn(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),a=o-r,l=i-n;if(r<o&&n<i){const c=t.width*t.height,d=e.width*e.height,h=a*l,f=h/(c+d-h);return Number(f.toFixed(4))}return 0}const _n=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const i of r){const{id:a}=i,l=n.get(a);if(l){const c=Hn(l,t);c>0&&o.push({id:a,data:{droppableContainer:i,value:c}})}}return o.sort(Un)};function Yn(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function Jt(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Y}function Kn(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return o.reduce((a,l)=>({...a,top:a.top+e*l.y,bottom:a.bottom+e*l.y,left:a.left+e*l.x,right:a.right+e*l.x}),{...n})}}const Gn=Kn(1);function Vn(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]}}else 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}function qn(e,t,n){const r=Vn(t);if(!r)return e;const{scaleX:o,scaleY:i,x:a,y:l}=r,c=e.left-a-(1-o)*parseFloat(n),d=e.top-l-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),h=o?e.width/o:e.width,f=i?e.height/i:e.height;return{width:h,height:f,top:d,right:c+h,bottom:d+f,left:c}}const Jn={ignoreTransform:!1};function Ie(e,t){t===void 0&&(t=Jn);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:h}=N(e).getComputedStyle(e);d&&(n=qn(n,d,h))}const{top:r,left:o,width:i,height:a,bottom:l,right:c}=n;return{top:r,left:o,width:i,height:a,bottom:l,right:c}}function Bt(e){return Ie(e,{ignoreTransform:!0})}function Qn(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Zn(e,t){return t===void 0&&(t=N(e).getComputedStyle(e)),t.position==="fixed"}function er(e,t){t===void 0&&(t=N(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const i=t[o];return typeof i=="string"?n.test(i):!1})}function vt(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(ht(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Te(o)||Mn(o)||n.includes(o))return n;const i=N(e).getComputedStyle(o);return o!==e&&er(o,i)&&n.push(o),Zn(o,i)?n:r(o.parentNode)}return e?r(e):n}function Qt(e){const[t]=vt(e,1);return t??null}function rt(e){return!Ke||!e?null:me(e)?e:ft(e)?ht(e)||e===we(e).scrollingElement?window:Te(e)?e:null:null}function Zt(e){return me(e)?e.scrollX:e.scrollLeft}function en(e){return me(e)?e.scrollY:e.scrollTop}function ct(e){return{x:Zt(e),y:en(e)}}var T;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(T||(T={}));function tn(e){return!Ke||!e?!1:e===document.scrollingElement}function nn(e){const t={x:0,y:0},n=tn(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,a=e.scrollTop>=r.y,l=e.scrollLeft>=r.x;return{isTop:o,isLeft:i,isBottom:a,isRight:l,maxScroll:r,minScroll:t}}const tr={x:.2,y:.2};function nr(e,t,n,r,o){let{top:i,left:a,right:l,bottom:c}=n;r===void 0&&(r=10),o===void 0&&(o=tr);const{isTop:d,isBottom:h,isLeft:f,isRight:b}=nn(e),v={x:0,y:0},R={x:0,y:0},p={height:t.height*o.y,width:t.width*o.x};return!d&&i<=t.top+p.height?(v.y=T.Backward,R.y=r*Math.abs((t.top+p.height-i)/p.height)):!h&&c>=t.bottom-p.height&&(v.y=T.Forward,R.y=r*Math.abs((t.bottom-p.height-c)/p.height)),!b&&l>=t.right-p.width?(v.x=T.Forward,R.x=r*Math.abs((t.right-p.width-l)/p.width)):!f&&a<=t.left+p.width&&(v.x=T.Backward,R.x=r*Math.abs((t.left+p.width-a)/p.width)),{direction:v,speed:R}}function rr(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:a}=window;return{top:0,left:0,right:i,bottom:a,width:i,height:a}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function rn(e){return e.reduce((t,n)=>be(t,ct(n)),Y)}function or(e){return e.reduce((t,n)=>t+Zt(n),0)}function ir(e){return e.reduce((t,n)=>t+en(n),0)}function sr(e,t){if(t===void 0&&(t=Ie),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);Qt(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const ar=[["x",["left","right"],or],["y",["top","bottom"],ir]];class pt{constructor(t,n){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 r=vt(n),o=rn(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,a,l]of ar)for(const c of a)Object.defineProperty(this,c,{get:()=>{const d=l(r),h=o[i]-d;return this.rect[c]+h},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Me{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>
5{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function lr(e){const{EventTarget:t}=N(e);return e instanceof t?e:we(e)}function ot(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var B;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(B||(B={}));function Ft(e){e.preventDefault()}function cr(e){e.stopPropagation()}var E;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"})(E||(E={}));const on={start:[E.Space,E.Enter],cancel:[E.Esc],end:[E.Space,E.Enter]},ur=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case E.Right:return{...n,x:n.x+25};case E.Left:return{...n,x:n.x-25};case E.Down:return{...n,y:n.y+25};case E.Up:return{...n,y:n.y-25}}};class sn{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Me(we(n)),this.windowListeners=new Me(N(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(B.Resize,this.handleCancel),this.windowListeners.add(B.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(B.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&sr(r),n(Y)}handleKeyDown(t){if(Vt(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:i=on,coordinateGetter:a=ur,scrollBehavior:l="smooth"}=o,{code:c}=t;if(i.end.includes(c)){this.handleEnd(t);return}if(i.cancel.includes(c)){this.handleCancel(t);return}const{collisionRect:d}=r.current,h=d?{x:d.left,y:d.top}:Y;this.referenceCoordinates||(this.referenceCoordinates=h);const f=a(t,{active:n,context:r.current,currentCoordinates:h});if(f){const b=He(f,h),v={x:0,y:0},{scrollableAncestors:R}=r.current;for(const p of R){const w=t.code,{isTop:y,isRight:S,isLeft:g,isBottom:D,maxScroll:x,minScroll:k}=nn(p),m=rr(p),C={x:Math.min(w===E.Right?m.right-m.width/2:m.right,Math.max(w===E.Right?m.left:m.left+m.width/2,f.x)),y:Math.min(w===E.Down?m.bottom-m.height/2:m.bottom,Math.max(w===E.Down?m.top:m.top+m.height/2,f.y))},M=w===E.Right&&!S||w===E.Left&&!g,A=w===E.Down&&!D||w===E.Up&&!y;if(M&&C.x!==f.x){const j=p.scrollLeft+b.x,G=w===E.Right&&j<=x.x||w===E.Left&&j>=k.x;if(G&&!b.y){p.scrollTo({left:j,behavior:l});return}G?v.x=p.scrollLeft-j:v.x=w===E.Right?p.scrollLeft-x.x:p.scrollLeft-k.x,v.x&&p.scrollBy({left:-v.x,behavior:l});break}else if(A&&C.y!==f.y){const j=p.scrollTop+b.y,G=w===E.Down&&j<=x.y||w===E.Up&&j>=k.y;if(G&&!b.x){p.scrollTo({top:j,behavior:l});return}G?v.y=p.scrollTop-j:v.y=w===E.Down?p.scrollTop-x.y:p.scrollTop-k.y,v.y&&p.scrollBy({top:-v.y,behavior:l});break}}this.handleMove(t,be(He(f,this.referenceCoordinates),v))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}sn.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=on,onActivation:o}=t,{active:i}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const l=i.activatorNode.current;return l&&e.target!==l?!1:(e.preventDefault(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function $t(e){return!!(e&&"distance"in e)}function Ut(e){return!!(e&&"delay"in e)}class bt{constructor(t,n,r){var o;r===void 0&&(r=lr(t.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=t,this.events=n;const{event:i}=t,{target:a}=i;this.props=t,this.events=n,this.document=we(a),this.documentListeners=new Me(this.document),this.listeners=new Me(r),this.windowListeners=new Me(N(a)),this.initialCoordinates=(o=lt(i))!=null?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:t,props:{options:{activationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),this.windowListeners.add(B.Resize,this.handleCancel),this.windowListeners.add(B.DragStart,Ft),this.windowListeners.add(B.VisibilityChange,this.handleCancel),this.windowListeners.add(B.ContextMenu,Ft),this.documentListeners.add(B.Keydown,this.handleKeydown),n){if($t(n))return;if(Ut(n)){this.timeoutId=setTimeout(this.handleStart,n.delay);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(B.Click,cr,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(B.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:i}=this,{onMove:a,options:{activationConstraint:l}}=i;if(!o)return;const c=(n=lt(t))!=null?n:Y,d=He(o,c);if(!r&&l){if(Ut(l))return ot(d,l.tolerance)?this.handleCancel():void 0;if($t(l))return l.tolerance!=null&&ot(d,l.tolerance)?this.handleCancel():ot(d,l.distance)?this.handleStart():void 0}t.cancelable&&t.preventDefault(),a(c)}handleEnd(){const{onEnd:t}=this.props;this.detach(),t()}handleCancel(){const{onCancel:t}=this.props;this.detach(),t()}handleKeydown(t){t.code===E.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const dr={move:{name:"pointermove"},end:{name:"pointerup"}};class an extends bt{constructor(t){const{event:n}=t,r=we(n.target);super(t,dr,r)}}an.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const fr={move:{name:"mousemove"},end:{name:"mouseup"}};var ut;(function(e){e[e.RightClick=2]="RightClick"})(ut||(ut={}));class hr extends bt{constructor(t){super(t,fr,we(t.event.target))}}hr.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===ut.RightClick?!1:(r==null||r({event:n}),!0)}}];const it={move:{name:"touchmove"},end:{name:"touchend"}};class gr extends bt{constructor(t){super(t,it)}static setup(){return window.addEventListener(it.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(it.move.name,t)};function t(){}}}gr.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return o.length>1?!1:(r==null||r({event:n}),!0)}}];var ke;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(ke||(ke={}));var Ye;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="Rever
5sedTreeOrder"})(Ye||(Ye={}));function vr(e){let{acceleration:t,activator:n=ke.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:a=5,order:l=Ye.TreeOrder,pointerCoordinates:c,scrollableAncestors:d,scrollableAncestorRects:h,delta:f,threshold:b}=e;const v=br({delta:f,disabled:!i}),[R,p]=kn(),w=s.useRef({x:0,y:0}),y=s.useRef({x:0,y:0}),S=s.useMemo(()=>{switch(n){case ke.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case ke.DraggableRect:return o}},[n,o,c]),g=s.useRef(null),D=s.useCallback(()=>{const k=g.current;if(!k)return;const m=w.current.x*y.current.x,C=w.current.y*y.current.y;k.scrollBy(m,C)},[]),x=s.useMemo(()=>l===Ye.TreeOrder?[...d].reverse():d,[l,d]);s.useEffect(()=>{if(!i||!d.length||!S){p();return}for(const k of x){if((r==null?void 0:r(k))===!1)continue;const m=d.indexOf(k),C=h[m];if(!C)continue;const{direction:M,speed:A}=nr(k,C,S,t,b);for(const j of["x","y"])v[j][M[j]]||(A[j]=0,M[j]=0);if(A.x>0||A.y>0){p(),g.current=k,R(D,a),w.current=A,y.current=M;return}}w.current={x:0,y:0},y.current={x:0,y:0},p()},[t,D,r,p,i,a,JSON.stringify(S),JSON.stringify(v),R,d,x,h,JSON.stringify(b)])}const pr={x:{[T.Backward]:!1,[T.Forward]:!1},y:{[T.Backward]:!1,[T.Forward]:!1}};function br(e){let{delta:t,disabled:n}=e;const r=at(t);return Le(o=>{if(n||!r||!o)return pr;const i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[T.Backward]:o.x[T.Backward]||i.x===-1,[T.Forward]:o.x[T.Forward]||i.x===1},y:{[T.Backward]:o.y[T.Backward]||i.y===-1,[T.Forward]:o.y[T.Forward]||i.y===1}}},[n,t,r])}function mr(e,t){const n=t!==null?e.get(t):void 0,r=n?n.node.current:null;return Le(o=>{var i;return t===null?null:(i=r??o)!=null?i:null},[r,t])}function wr(e,t){return s.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,i=o.activators.map(a=>({eventName:a.eventName,handler:t(a.handler,r)}));return[...n,...i]},[]),[e,t])}var Ae;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Ae||(Ae={}));var dt;(function(e){e.Optimized="optimized"})(dt||(dt={}));const Xt=new Map;function xr(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,a]=s.useState(null),{frequency:l,measure:c,strategy:d}=o,h=s.useRef(e),f=w(),b=Oe(f),v=s.useCallback(function(y){y===void 0&&(y=[]),!b.current&&a(S=>S===null?y:S.concat(y.filter(g=>!S.includes(g))))},[b]),R=s.useRef(null),p=Le(y=>{if(f&&!n)return Xt;if(!y||y===Xt||h.current!==e||i!=null){const S=new Map;for(let g of e){if(!g)continue;if(i&&i.length>0&&!i.includes(g.id)&&g.rect.current){S.set(g.id,g.rect.current);continue}const D=g.node.current,x=D?new pt(c(D),D):null;g.rect.current=x,x&&S.set(g.id,x)}return S}return y},[e,i,n,f,c]);return s.useEffect(()=>{h.current=e},[e]),s.useEffect(()=>{f||v()},[n,f]),s.useEffect(()=>{i&&i.length>0&&a(null)},[JSON.stringify(i)]),s.useEffect(()=>{f||typeof l!="number"||R.current!==null||(R.current=setTimeout(()=>{v(),R.current=null},l))},[l,f,v,...r]),{droppableRects:p,measureDroppableContainers:v,measuringScheduled:i!=null};function w(){switch(d){case Ae.Always:return!1;case Ae.BeforeDragging:return n;default:return!n}}}function ln(e,t){return Le(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function yr(e,t){return ln(e,t)}function Cr(e){let{callback:t,disabled:n}=e;const r=gt(t),o=s.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return s.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Ve(e){let{callback:t,disabled:n}=e;const r=gt(t),o=s.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return s.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Dr(e){return new pt(Ie(e),e)}function Ht(e,t,n){t===void 0&&(t=Dr);const[r,o]=s.useReducer(l,null),i=Cr({callback(c){if(e)for(const d of c){const{type:h,target:f}=d;if(h==="childList"&&f instanceof HTMLElement&&f.contains(e)){o();break}}}}),a=Ve({callback:o});return Q(()=>{o(),e?(a==null||a.observe(e),i==null||i.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),i==null||i.disconnect())},[e]),r;function l(c){if(!e)return null;if(e.isConnected===!1){var d;return(d=c??n)!=null?d:null}const h=t(e);return JSON.stringify(c)===JSON.stringify(h)?c:h}}function Rr(e){const t=ln(e);return Jt(e,t)}const _t=[];function Sr(e){const t=s.useRef(e),n=Le(r=>e?r&&r!==_t&&e&&t.current&&e.parentNode===t.current.parentNode?r:vt(e):_t,[e]);return s.useEffect(()=>{t.current=e},[e]),n}function Er(e){const[t,n]=s.useState(null),r=s.useRef(e),o=s.useCallback(i=>{const a=rt(i.target);a&&n(l=>l?(l.set(a,ct(a)),new Map(l)):null)},[]);return s.useEffect(()=>{const i=r.current;if(e!==i){a(i);const l=e.map(c=>{const d=rt(c);return d?(d.addEventListener("scroll",o,{passive:!0}),[d,ct(d)]):null}).filter(c=>c!=null);n(l.length?new Map(l):null),r.current=e}return()=>{a(e),a(i)};function a(l){l.forEach(c=>{const d=rt(c);d==null||d.removeEventListener("scroll",o)})}},[o,e]),s.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,a)=>be(i,a),Y):rn(e):Y,[e,t])}function Yt(e,t){t===void 0&&(t=[]);const n=s.useRef(null);return s.useEffect(()=>{n.current=null},t),s.useEffect(()=>{const r=e!==Y;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?He(e,n.current):Y}function Mr(e){s.useEffect(()=>{if(!Ke)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function kr(e,t){return s.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:i}=r;return n[o]=a=>{i(a,t)},n},{}),[e,t])}function cn(e){return s.useMemo(()=>e?Qn(e):null,[e])}const st=[];function jr(e,t){t===void 0&&(t=Ie);const[n]=e,r=cn(n?N(n):null),[o,i]=s.useReducer(l,st),a=Ve({callback:i});return e.length>0&&o===st&&i(),Q(()=>{e.length?e.forEach(c=>a==null?void 0:a.observe(c)):(a==null||a.disconnect(),i())},[e]),o;function l(){return e.length?e.map(c=>tn(c)?r:new pt(t(c),c)):st}}function Or(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Te(t)?t:e}function Ar(e){let{measure:t}=e;const[n,r]=s.useState(null),o=s.useCallback(d=>{for(const{target:h}of d)if(Te(h)){r(f=>{const b=t(h);
5return f?{...f,width:b.width,height:b.height}:b});break}},[t]),i=Ve({callback:o}),a=s.useCallback(d=>{const h=Or(d);i==null||i.disconnect(),h&&(i==null||i.observe(h)),r(h?t(h):null)},[t,i]),[l,c]=Xe(a);return s.useMemo(()=>({nodeRef:l,rect:n,setRef:c}),[n,l,c])}const Tr=[{sensor:an,options:{}},{sensor:sn,options:{}}],Lr={current:{}},Ue={draggable:{measure:Bt},droppable:{measure:Bt,strategy:Ae.WhileDragging,frequency:dt.Optimized},dragOverlay:{measure:Ie}};class je extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const Ir={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new je,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:_e},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ue,measureDroppableContainers:_e,windowRect:null,measuringScheduled:!1},Nr={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:_e,draggableNodes:new Map,over:null,measureDroppableContainers:_e},qe=s.createContext(Nr),Wr=s.createContext(Ir);function zr(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new je}}}function Pr(e,t){switch(t.type){case O.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case O.DragMove:return e.draggable.active?{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}}:e;case O.DragEnd:case O.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case O.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new je(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case O.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const a=new je(e.droppable.containers);return a.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case O.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new je(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function Br(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=s.useContext(qe),i=at(r),a=at(n==null?void 0:n.id);return s.useEffect(()=>{if(!t&&!r&&i&&a!=null){if(!Vt(i)||document.activeElement===i.target)return;const l=o.get(a);if(!l)return;const{activatorNode:c,node:d}=l;if(!c.current&&!d.current)return;requestAnimationFrame(()=>{for(const h of[c.current,d.current]){if(!h)continue;const f=An(h);if(f){f.focus();break}}})}},[r,t,o,a,i]),null}function Fr(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,i)=>i({transform:o,...r}),n):n}function $r(e){return s.useMemo(()=>({draggable:{...Ue.draggable,...e==null?void 0:e.draggable},droppable:{...Ue.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Ue.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function Ur(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=s.useRef(!1),{x:a,y:l}=typeof o=="boolean"?{x:o,y:o}:o;Q(()=>{if(!a&&!l||!t){i.current=!1;return}if(i.current||!r)return;const d=t==null?void 0:t.node.current;if(!d||d.isConnected===!1)return;const h=n(d),f=Jt(h,r);if(a||(f.x=0),l||(f.y=0),i.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const b=Qt(d);b&&b.scrollBy({top:f.y,left:f.x})}},[t,a,l,r,n])}const un=s.createContext({...Y,scaleX:1,scaleY:1});var oe;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(oe||(oe={}));const Xr=s.memo(function(t){var n,r,o,i;let{id:a,accessibility:l,autoScroll:c=!0,children:d,sensors:h=Tr,collisionDetection:f=_n,measuring:b,modifiers:v,...R}=t;const p=s.useReducer(Pr,void 0,zr),[w,y]=p,[S,g]=Pn(),[D,x]=s.useState(oe.Uninitialized),k=D===oe.Initialized,{draggable:{active:m,n
5odes:C,translate:M},droppable:{containers:A}}=w,j=m?C.get(m):null,G=s.useRef({initial:null,translated:null}),V=s.useMemo(()=>{var L;return m!=null?{id:m,data:(L=j==null?void 0:j.data)!=null?L:Lr,rect:G}:null},[m,j]),Z=s.useRef(null),[mt,wt]=s.useState(null),[q,xt]=s.useState(null),xe=Oe(R,Object.values(R)),Je=Ge("DndDescribedBy",a),yt=s.useMemo(()=>A.getEnabled(),[A]),ie=$r(b),{droppableRects:ce,measureDroppableContainers:Ne,measuringScheduled:Ct}=xr(yt,{dragging:k,dependencies:[M.x,M.y],config:ie.droppable}),$=mr(C,m),Dt=s.useMemo(()=>q?lt(q):null,[q]),Rt=wn(),St=yr($,ie.draggable.measure);Ur({activeNode:m?C.get(m):null,config:Rt.layoutShiftCompensation,initialRect:St,measure:ie.draggable.measure});const U=Ht($,ie.draggable.measure,St),Qe=Ht($?$.parentElement:null),se=s.useRef({activatorEvent:null,active:null,activeNode:$,collisionRect:null,collisions:null,droppableRects:ce,draggableNodes:C,draggingNode:null,draggingNodeRect:null,droppableContainers:A,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Et=A.getNodeFor((n=se.current.over)==null?void 0:n.id),ae=Ar({measure:ie.dragOverlay.measure}),We=(r=ae.nodeRef.current)!=null?r:$,ue=k?(o=ae.rect)!=null?o:U:null,Mt=!!(ae.nodeRef.current&&ae.rect),kt=Rr(Mt?null:U),Ze=cn(We?N(We):null),ee=Sr(k?Et??$:null),ze=jr(ee),Pe=Fr(v,{transform:{x:M.x-kt.x,y:M.y-kt.y,scaleX:1,scaleY:1},activatorEvent:q,active:V,activeNodeRect:U,containerNodeRect:Qe,draggingNodeRect:ue,over:se.current.over,overlayNodeRect:ae.rect,scrollableAncestors:ee,scrollableAncestorRects:ze,windowRect:Ze}),jt=Dt?be(Dt,M):null,Ot=Er(ee),fn=Yt(Ot),hn=Yt(Ot,[U]),de=be(Pe,fn),fe=ue?Gn(ue,Pe):null,ye=V&&fe?f({active:V,collisionRect:fe,droppableRects:ce,droppableContainers:yt,pointerCoordinates:jt}):null,At=Xn(ye,"id"),[te,Tt]=s.useState(null),gn=Mt?Pe:be(Pe,hn),vn=Yn(gn,(i=te==null?void 0:te.rect)!=null?i:null,U),Lt=s.useCallback((L,W)=>{let{sensor:z,options:ne}=W;if(Z.current==null)return;const P=C.get(Z.current);if(!P)return;const X=L.nativeEvent,K=new z({active:Z.current,activeNode:P,event:X,options:ne,context:se,onStart(H){const Ce=Z.current;if(Ce==null)return;const De=C.get(Ce);if(!De)return;const{onDragStart:Be}=xe.current,Fe={active:{id:Ce,data:De.data,rect:G}};pe.unstable_batchedUpdates(()=>{Be==null||Be(Fe),x(oe.Initializing),y({type:O.DragStart,initialCoordinates:H,active:Ce}),S({type:"onDragStart",event:Fe})})},onMove(H){y({type:O.DragMove,coordinates:H})},onEnd:he(O.DragEnd),onCancel:he(O.DragCancel)});pe.unstable_batchedUpdates(()=>{wt(K),xt(L.nativeEvent)});function he(H){return async function(){const{active:De,collisions:Be,over:Fe,scrollAdjustedTranslate:Nt}=se.current;let Re=null;if(De&&Nt){const{cancelDrop:Se}=xe.current;Re={activatorEvent:X,active:De,collisions:Be,delta:Nt,over:Fe},H===O.DragEnd&&typeof Se=="function"&&await Promise.resolve(Se(Re))&&(H=O.DragCancel)}Z.current=null,pe.unstable_batchedUpdates(()=>{y({type:H}),x(oe.Uninitialized),Tt(null),wt(null),xt(null);const Se=H===O.DragEnd?"onDragEnd":"onDragCancel";if(Re){const et=xe.current[Se];et==null||et(Re),S({type:Se,event:Re})}})}}},[C]),pn=s.useCallback((L,W)=>(z,ne)=>{const P=z.nativeEvent,X=C.get(ne);if(Z.current!==null||!X||P.dndKit||P.defaultPrevented)return;const K={active:X};L(z,W.options,K)===!0&&(P.dndKit={capturedBy:W.sensor},Z.current=ne,Lt(z,W))},[C,Lt]),It=wr(h,pn);Mr(h),Q(()=>{U&&D===oe.Initializing&&x(oe.Initialized)},[U,D]),s.useEffect(()=>{const{onDragMove:L}=xe.current,{active:W,activatorEvent:z,collisions:ne,over:P}=se.current;if(!W||!z)return;const X={active:W,activatorEvent:z,collisions:ne,delta:{x:de.x,y:de.y},over:P};pe.unstable_batchedUpdates(()=>{L==null||L(X),S({type:"onDragMove",event:X})})},[de.x,de.y]),s.useEffect(()=>{const{active:L,activatorEvent:W,collisions:z,droppableContainers:ne,scrollAdjustedTranslate:P}=se.current;if(!L||Z.current==null||!W||!P)return;const{onDragOver:X}=xe.current,K=ne.get(At),he=K&&K.rect.current?{id:K.id,rect:K.rect.current,data:K.data,disabled:K.disabled}:null,H={active:L,activatorEvent:W,collisions:z,delta:{x:P.x,y:P.y},over:he};pe.unstable_batchedUpdates(()=>{Tt(he),X==null||X(H),S({type:"onDragOver",event:H})})},[At]),Q(()=>{se.current={activatorEvent:q,active:V,activeNode:$,collisionRect:fe,collisions:ye,droppableRects:ce,draggableNodes:C,draggingNode:We,draggingNodeRect:ue,droppableContainers:A,over:te,scrollableAncestors:ee,scrollAdjustedTranslate:de},G.current={initial:ue,translated:fe}},[V,$,ye,fe,C,We,ue,ce,A,te,ee,de]),vr({...Rt,delta:M,draggingRect:fe,pointerCoordinates:jt,scrollableAncestors:ee,scrollableAncestorRects:ze});const bn=s.useMemo(()=>({active:V,activeNode:$,activeNodeRect:U,activatorEvent:q,collisions:ye,containerNodeRect:Qe,dragOverlay:ae,draggableNodes:C,droppableContainers:A,droppableRects:ce,over:te,measureDroppableContainers:Ne,scrollableAncestors:ee,scrollableAncestorRects:ze,measuringConfiguration:ie,measuringScheduled:Ct,windowRect:Ze}),[V,$,U,q,ye,Qe,ae,C,A,ce,te,Ne,ee,ze,ie,Ct,Ze]),mn=s.useMemo(()=>({activatorEvent:q,activators:It,active:V,activeNodeRect:U,ariaDescribedById:{draggable:Je},dispatch:y,draggableNodes:C,over:te,measureDroppableContainers:Ne}),[q,It,V,U,y,Je,C,te,Ne]);return F.createElement(qt.Provider,{value:g},F.createElement(qe.Provider,{value:mn},F.createElement(Wr.Provider,{value:bn},F.createElement(un.Provider,{value:vn},d)),F.createElement(Br,{disabled:(l==null?void 0:l.restoreFocus)===!1})),F.createElement($n,{...l,hiddenTextDescribedById:Je}));function wn(){const L=(mt==null?void 0:mt.autoScrollEnabled)===!1,W=typeof c=="object"?c.enabled===!1:c===!1,z=k&&!L&&!W;return typeof c=="object"?{...c,enabled:z}:{enabled:z}}}),Hr=s.createContext(null),Kt="button",_r="Droppable";function Yr(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=Ge(_r),{activators:a,activatorEvent:l,active:c,activeNodeRect:d,ariaDescribedById:h,draggableNodes:f,over:b}=s.useContext(qe),{role:v=Kt,roleDescription:R="draggable",tabIndex:p=0}=o??{},w=(c==null?void 0:c.id)===t,y=s.useContext(w?un:Hr),[S,g]=Xe(),[D,x]=Xe(),k=kr(a,t),m=Oe(n);Q(()=>(f.set(t,{id:t,key:i,node:S,activatorNode:D,data:m}),()=>{const M=f.get(t);M&&M.key===i&&f.delete(t)}),[f,t]);const C=s.useMemo(()=>({role:v,tabIndex:p,"aria-disabled":r,"aria-pressed":w&&v===Kt?!0:void 0,"aria-roledescription":R,"aria-describedby":h.draggable}),[r,v,p,w,R,h.draggable]);return{active:c,activatorEvent:l,activeNodeRect:d,attributes:C,isDragging:w,listeners:r?void 0:k,node:S,over:b,setNodeRef:g,setActivatorNodeRef:x,transform:y}}const Kr="Droppable",Gr={timeout:25};function Vr(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=Ge(Kr),{active:a,dispatch:l,over:c,measureDroppableContainers:d}=s.useContext(qe),h=s.useRef({disabled:n}),f=s.useRef(!1),b=s.useRef(null),v=s.useRef(null),{disabled:R,updateMeasurementsFor:p,timeout:w}={...Gr,...o},y=Oe(p??r),S=s.useCallback(()=>
5{if(!f.current){f.current=!0;return}v.current!=null&&clearTimeout(v.current),v.current=setTimeout(()=>{d(Array.isArray(y.current)?y.current:[y.current]),v.current=null},w)},[w]),g=Ve({callback:S,disabled:R||!a}),D=s.useCallback((C,M)=>{g&&(M&&(g.unobserve(M),f.current=!1),C&&g.observe(C))},[g]),[x,k]=Xe(D),m=Oe(t);return s.useEffect(()=>{!g||!x.current||(g.disconnect(),f.current=!1,g.observe(x.current))},[x,g]),Q(()=>(l({type:O.RegisterDroppable,element:{id:r,key:i,disabled:n,node:x,rect:b,data:m}}),()=>l({type:O.UnregisterDroppable,key:i,id:r})),[r]),s.useEffect(()=>{n!==h.current.disabled&&(l({type:O.SetDroppableDisabled,id:r,key:i,disabled:n}),h.current.disabled=n)},[r,i,n,l]),{active:a,rect:b,isOver:(c==null?void 0:c.id)===r,node:x,over:c,setNodeRef:k}}function dn(e){const{attributes:t,listeners:n,setNodeRef:r,transform:o}=Yr({id:e.id}),i=o?{transform:`translate3d(${o.x}px, ${o.y}px, 0)`}:void 0;return u.jsx("div",{ref:r,style:i,...n,...t,children:e.children})}function qr(e){const{isOver:t,setNodeRef:n}=Vr({id:e.id});return u.jsx(I,{ref:n,sx:{border:r=>e.word?"none":`2px dashed ${r.palette.info.main}`,borderRadius:1,minWidth:80,cursor:"pointer",backgroundColor:t?"info.lighter":"transparent","&:hover":{backgroundColor:r=>r.palette.info.lighter}},children:e.word&&u.jsx(dn,{id:e.word,children:u.jsx(J,{variant:"outlined",color:e.result==="correct"?"success":e.result==="incorrect"?"error":"info",size:"small",sx:{textTransform:"none",borderRadius:1,cursor:"move",px:1,borderWidth:2,fontSize:"1rem",minWidth:100,"&:hover":{borderWidth:2}},children:e.word})})})}const Jr=["breadwinner","homemaker","groceries","housework","heavy lifting"],Ee=[{content:"My mother is a [], she doesn't go to work, but stays at home to look after the family.",answer:"homemaker"},{content:"When I lived in this city, I used to shop for [] at this supermarket.",answer:"groceries"},{content:"My eldest son is strong enough to do the [] for the family.",answer:"heavy lifting"},{content:"Hanna hates doing [] except cooking.",answer:"housework"},{content:"Mr Lewis is the [] of the family, but he still helps his wife with the housework whenever he has time.",answer:"breadwinner"}];function Zr(){const{themeStretch:e}=xn(),[t,n]=s.useState({}),[r]=Wt("/assets/e-book/show_score_win.mp3"),[o]=Wt("/assets/e-book/show_score_lose.mp3"),[i,a]=s.useState(!1),[l,c]=s.useState(null),d=g=>{c(g.currentTarget)},h=()=>{c(null)},[f,b]=s.useState(null),v=g=>{b(g.currentTarget)},R=()=>{b(null)},p=Jr.filter(g=>(t==null?void 0:t[g])===void 0),w=Object.keys(t).reduce((g,D)=>{const x=Ee[t[D]];return(x==null?void 0:x.answer)===D?g+1:g},0),y=Math.round(w/Ee.length*100),S=Object.keys(t).length===Ee.length;return s.useEffect(()=>{S&&(y>50?r():o())},[y,r,o,S]),u.jsx(Xr,{onDragEnd:g=>{const{active:D,over:x}=g;if(!x)return;const k=D.id,m=x.id;n(C=>{const M={...C||{}};if(Object.values(M).includes(m)){const A=Object.keys(M).find(j=>M[j]===m);A&&delete M[A]}return M[k]=m,M})},children:u.jsxs(I,{sx:{position:"relative",overflow:"hidden",height:"100vh"},children:[u.jsx(yn,{children:u.jsx("title",{children:"Complete Sentences | E-Learning"})}),u.jsxs(Cn,{sx:{py:1.5,zIndex:2},maxWidth:e?!1:"xl",children:[u.jsx(Dn,{sx:{...tt({color:"#fff",opacity:.5}),pl:2,pr:.5,py:.5,borderRadius:1,zIndex:1},links:[{name:"E-Learning",href:re.root},{name:"Thư Viá»n",href:re.library},{name:"E-Book Prototype",href:re["e-book"]},{name:"Complete Sentences",href:re["complete-sentences"]}],action:u.jsx(J,{component:$e,to:re["e-book"],startIcon:u.jsx(_,{icon:"typcn:arrow-back-outline"}),color:"secondary",children:"Quay lại"})}),u.jsxs(Rn,{sx:{p:3,...tt({color:"#FFF",opacity:.9}),minHeight:400},children:[u.jsxs(I,{spacing:4,children:[u.jsx(ge,{color:"secondary",variant:"h5",fontFamily:g=>g.typography.fontFamilySecondary,children:"Complete the sentences using the words in the box:"}),u.jsx(I,{direction:"row",spacing:2,children:p.map((g,D)=>u.jsx(dn,{id:g,children:u.jsx(J,{variant:"outlined",color:"info",sx:{textTransform:"none",borderRadius:1,cursor:"move",px:1,borderWidth:2,fontSize:"1rem",minWidth:100,"&:hover":{borderWidth:2}},children:g})},D))}),u.jsx(I,{spacing:2,children:Ee.map((g,D)=>{var x;return u.jsxs(I,{direction:"row",spacing:2,children:[u.jsxs(ge,{variant:"h6",color:"secondary",children:[D+1,"."]}
5),u.jsx(ge,{variant:"h6",children:g.content.split("[]")[0]}),u.jsx(qr,{id:D,word:(x=Object.entries(t).find(([k,m])=>m===D))==null?void 0:x[0],result:S?(t==null?void 0:t[g.answer])===D?"correct":"incorrect":void 0}),u.jsx(ge,{variant:"h6",children:g.content.split("[]")[1]})]},D)})})]}),S&&u.jsx(I,{sx:{position:"absolute",top:16,right:16,zIndex:1,borderRadius:2,px:3,py:2,background:"linear-gradient(135deg, #f16522 0%, #FF9800 100%)",animation:"pulse 2s infinite","@keyframes pulse":{"0%":{transform:"scale(1)",boxShadow:"0 0 0 0 rgba(255, 152, 0, 0.4)"},"70%":{transform:"scale(1)",boxShadow:"0 0 0 10px rgba(255, 152, 0, 0)"}}},children:u.jsxs(ge,{variant:"h2",color:"white",children:[w,"/",Ee.length," = ",y,"%"]})})]})]}),u.jsx(I,{sx:{backgroundImage:"url('/assets/e-book/grade_61_background.png')",backgroundSize:"cover",backgroundPosition:"50%",position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:-1}}),u.jsxs(I,{direction:"row",sx:{...tt({color:"#fff",opacity:.5}),position:"absolute",bottom:0,left:0,right:0,zIndex:3},p:1,spacing:2,alignItems:"space-between",children:[u.jsxs(I,{direction:"row",spacing:1,children:[u.jsx(ve,{title:"Menu",children:u.jsx(J,{variant:"soft",color:"secondary",sx:{minWidth:35,maxWidth:35,paddingLeft:0,paddingRight:0},onClick:d,children:u.jsx(_,{icon:"mingcute:menu-fill"})})}),u.jsx(zt,{arrow:"bottom-left",disabledArrow:!0,open:l,onClose:h,children:u.jsxs(I,{spacing:.75,children:[u.jsxs(le,{onClick:()=>h(),sx:{fontWeight:"bold !important"},children:[u.jsx(_,{icon:"mingcute:quill-pen-fill"}),"Open Note"]}),u.jsxs(le,{onClick:()=>h(),sx:{fontWeight:"bold !important"},children:[u.jsx(_,{icon:"mingcute:drawing-board-fill"}),"Open Drawing Board"]}),u.jsxs(le,{onClick:()=>h(),sx:{fontWeight:"bold !important"},children:[u.jsx(_,{icon:"mingcute:flashlight-fill"}),"Spotlight"]})]})}),u.jsx(ve,{title:"Timer",children:u.jsx(J,{variant:"soft",color:"secondary",sx:{minWidth:35,maxWidth:35,paddingLeft:0,paddingRight:0},children:u.jsx(_,{icon:"mingcute:time-line"})})}),u.jsx(ve,{title:"Report",children:u.jsx(J,{variant:"soft",color:"secondary",sx:{minWidth:35,maxWidth:35,paddingLeft:0,paddingRight:0},children:u.jsx(_,{icon:"mingcute:bug-line"})})})]}),u.jsx(I,{direction:"row",spacing:1,flexGrow:1,justifyContent:"center"}),u.jsxs(I,{direction:"row",spacing:1,alignItems:"center",children:[u.jsx(ve,{title:"Previous page",children:u.jsx(J,{variant:"soft",color:"secondary",sx:{minWidth:35,maxWidth:35,paddingLeft:0,paddingRight:0},component:$e,to:re["conversation-page"],children:u.jsx(_,{icon:"mingcute:arrow-left-fill"})})}),u.jsx(ge,{variant:"body2",color:"secondary",fontWeight:"bold",children:"3/3"}),u.jsx(ve,{title:"Next page",children:u.jsx(J,{variant:"soft",color:"secondary",sx:{minWidth:35,maxWidth:35,paddingLeft:0,paddingRight:0},disabled:!0,children:u.jsx(_,{icon:"mingcute:arrow-right-fill"})})}),u.jsx(ve,{title:"Contents",children:u.jsx(J,{variant:"soft",color:"secondary",sx:{minWidth:35,maxWidth:35,paddingLeft:0,paddingRight:0},onClick:v,children:u.jsx(_,{icon:"mingcute:list-ordered-line"})})}),u.jsx(zt,{arrow:"bottom-right",disabledArrow:!0,open:f,onClose:R,children:u.jsxs(I,{spacing:.75,children:[u.jsx(le,{onClick:()=>R(),sx:{fontWeight:"bold !important"},component:$e,to:re["interactive-page"],children:"Prototype 1. Interactive Page"}),u.jsx(le,{onClick:()=>R(),sx:{fontWeight:"bold !important"},component:$e,to:re["conversation-page"],children:"Prototype 2. Conversation Page"}),u.jsx(le,{onClick:()=>R(),sx:{fontWeight:"bold !important"},selected:!0,children:"Prototype 3. Complete Sentences"}),u.jsxs(le,{sx:{fontWeight:"bold !important"},onClick:()=>{R(),a(!0)},children:[u.jsx(_,{icon:"mingcute:translate-2-line"}),"Glossary"]})]})})]})]}),u.jsx(Sn,{data:En,open:i,onClose:()=>a(!1)})]})})}export{Zr as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.