Module 451395

1,649 characters · in dac8e9260d225fc0.js, e93c6f08dc433058.js
Dependencies
Lazily required by (0)none
Lazily requires (0)none
Source Raw
function(e,l,t){t.d(l,{gY:()=>h,jV:()=>x,mG:()=>A});var n=t(627968),s=t(64700),i=t(503698),a=t.n(i),r=t(312742),o=t(295868),c=t(352944),d=t(459192),u=t(939249),p=t(772838),m=t(375708);function h(e){let{dragRef:l,dropRef:t,index:n,listType:i,itemId:a,itemType:d,itemPreviewProps:u,onReorder:p,onEnd:m,disableDefaultPreview:h=!0}=e,A=`${d}_${i}`,x=s.useCallback((e,l)=>{p?.(e,l)},[p]),[{isDragging:g},f,y]=(0,r.i)({type:A,item:{id:a,index:n,itemType:d,itemPreviewProps:u},collect:e=>({isDragging:e.isDragging()}),end:m});s.useEffect(()=>{h&&y((0,c.n)(),{captureDraggingState:!0})},[y,h]);let[{dragSourcePosition:j},I]=(0,o.H)({accept:A,drop:e=>{let l=e.index;l!==n&&(x(l,n),e.index=n)},collect:e=>{let l=e.getItem(),t=null;return null!=l&&e.isOver({shallow:!0})&&e.canDrop()&&(t=l.index),{dragSourcePosition:t}}});return s.useLayoutEffect(()=>(f(l),I(t),()=>{I(null),f(null)}),[f,l,I,t]),{isDragging:g,dragSourcePosition:j}}let A=s.memo(function(e){let{index:l,className:t,draggingClassName:i,dropBeforeClassName:r,dropAfterClassName:o,"aria-label":c,children:d,...u}=e,p=s.useRef(null),{isDragging:m,dragSourcePosition:A}=h({dragRef:p,dropRef:p,index:l,...u}),x=null!=A,g=x&&l<A,f=x&&l>A;return(0,n.jsx)("div",{ref:p,className:a()(t,m&&i,g&&r,f&&o),"aria-label":c,children:d})});function x(e){let{buttonRef:l,"aria-label":t,iconSize:s="sm",...i}=e;return(0,n.jsx)(d.u,{body:m.intl.format(m.t["zvln/l"],{emphasizeHook:e=>(0,n.jsx)("strong",{children:e})}),ariaHidden:!0,children:(0,n.jsx)(u.D,{innerRef:l,"aria-label":t??m.intl.string(m.t.n9T3Hi),"aria-keyshortcuts":"Control+D, Meta+D",...i,children:(0,n.jsx)(p.W,{size:s,color:"currentColor"})})})}}