mirror of
https://github.com/kristoferssolo/solorice.git
synced 2025-10-21 20:10:34 +00:00
2 lines
7.9 KiB
JavaScript
Executable File
2 lines
7.9 KiB
JavaScript
Executable File
"use strict";(("undefined"!=typeof self?self:global).webpackChunkclient_web=("undefined"!=typeof self?self:global).webpackChunkclient_web||[]).push([[3035],{33672:(e,t,r)=>{r.d(t,{Nz:()=>s,Vp:()=>u,Vv:()=>c,wD:()=>f,xz:()=>i});var n,o=r(52542),l=(r(78551),r(82467),r(26596)),a=r(19127),u=[l.fl.TRACKS,l.fl.LOCAL_TRACKS,l.fl.ALBUMS,l.fl.ARTISTS,l.fl.PLAYLISTS,l.fl.PLAYLISTS_V2,l.fl.FOLDERS,l.fl.EPISODES,l.fl.CHAPTERS,l.fl.SHOWS,l.fl.AUDIOBOOKS,l.fl.PSEUDO_PLAYLISTS],i=(n={},(0,o.A)((0,o.A)((0,o.A)((0,o.A)((0,o.A)((0,o.A)((0,o.A)((0,o.A)((0,o.A)((0,o.A)(n,l.fl.TRACKS,"tracks"),l.fl.ALBUMS,"albums"),l.fl.ARTISTS,"artists"),l.fl.PLAYLISTS,"playlists"),l.fl.FOLDERS,"folders"),l.fl.SHOWS,"shows"),l.fl.EPISODES,"episodes"),l.fl.CHAPTERS,"chapters"),l.fl.LOCAL_TRACKS,"local-tracks"),l.fl.AUDIOBOOKS,"audiobooks"),(0,o.A)(n,l.fl.PSEUDO_PLAYLISTS,"pseudo-playlists")),s=function(e){return e.ON="on",e.BEFORE="before",e.AFTER="after",e}({}),c=(0,a.g)(s);function f(e){return u.includes(e)}},3035:(e,t,r)=>{r.d(t,{A:()=>y});var n=r(12341),o=(r(83234),r(42703),r(30456),r(36497),r(86746),r(78551),r(79024),r(34518),r(25550),r(99722),r(8674),r(5672),r(43379),r(60482),r(2823),r(65594),r(59255),r(85130),r(55636),r(28509),r(97332),r(46555),r(13296),r(24594),r(82467),r(97460),r(34192),r(463),r(88856),r(15342),r(93577),r(60287),r(30758)),l=r(88308),a=r(26596),u=r(33672);function i(e,t,r,n){if(e.defaultPrevented)return null;var o=t.includes(u.Nz.BEFORE),l=t.includes(u.Nz.AFTER),a=u.Nz.ON;if(e.currentTarget instanceof HTMLElement&&(o||l)){var i=e.currentTarget.getBoundingClientRect(),s=i.top,c=i.height,f=i.left,d=i.width,v=i.right,p=t.includes(u.Nz.ON);if("horizontal"===r)if(p&&o)(n?e.clientX>Math.round(v)-d/4:e.clientX<Math.round(f)+d/4)&&(a=u.Nz.BEFORE);else a=(n?e.clientX>Math.round(v)-d/2:e.clientX<Math.round(f)+d/2)?u.Nz.BEFORE:u.Nz.AFTER;else"vertical"===r&&(p&&o?e.clientY<Math.round(s)+c/4&&(a=u.Nz.BEFORE):a=e.clientY<Math.round(s)+c/2?u.Nz.BEFORE:u.Nz.AFTER)}return t.includes(a)?a:null}var s=r(37005),c=r(52542),f=r(85093),d=r(13734),v=(r(7651),r(95268),r(184),r(42486),r(26701),r(97316),r(76588),r(37417),r(11737),r(4129),r(51691),r(702),r(72636),r(51565),r(18316),r(80366));function p(e,t){var r,n;return Array.from(null!==(r=null===(n=e.dataTransfer)||void 0===n?void 0:n.types)&&void 0!==r?r:[]).filter(a._4).filter((function(e){return!!(0,u.wD)(e)&&t.includes(e)})).filter(u.wD)}r(38408),r(34072),r(79210),r(80456);var g=r(71104);function T(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function A(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?T(Object(r),!0).forEach((function(t){(0,c.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):T(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function S(e){var t=function(e,t){if("object"!=(0,s.A)(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=(0,s.A)(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==(0,s.A)(t)?t:t+""}function O(e,t,r){var n,o=p(e,t);if(!o.length)return function(e,t){return e.split(/[\s,;]+/g).map((function(e){return(0,v.o_)(null==e?void 0:e.trim())})).filter(g.P).reduce((function(e,r){var n=a.Ay[r.type];return(0,u.wD)(n)&&t.includes(n)?(e[n]||(e[n]=[]),e[n].push(r.toURI()),e):e}),{})}(null===(n=e.dataTransfer)||void 0===n?void 0:n.getData("text/plain"),t);var l=Object.fromEntries(o.map((function(t){var r,n;return[t,null!==(r=null===(n=e.dataTransfer)||void 0===n||null===(n=n.getData(t))||void 0===n?void 0:n.split("\n").filter(Boolean))&&void 0!==r?r:[]]})));if(r){var i,s,T=a.fl.PLAYLISTS,O=(l[T],(0,d.A)(l,[T].map(S))),m=Array.from(new Set([].concat((0,f.A)(null!==(i=l[a.fl.PLAYLISTS_V2])&&void 0!==i?i:[]),(0,f.A)((null!==(s=l[a.fl.PLAYLISTS])&&void 0!==s?s:[]).map(b)))));return A(A({},O),m.length?(0,c.A)({},a.fl.PLAYLISTS_V2,m):null)}return l}function b(e){var t=(0,v.o_)(e);return(null==t?void 0:t.type)===v.NQ.PLAYLIST?(0,v.Ps)(t.id).toURI():e}var m=r(77228),D=r(69583);const h={droppableMimeTypes:"albums artists episodes chapters folders playlists shows tracks local-tracks audiobooks pseudo-playlists",useDropTarget:"main-useDropTarget-base","useDropTarget--albums":"main-useDropTarget-album","useDropTarget--artists":"main-useDropTarget-artist","useDropTarget--episodes":"main-useDropTarget-episode","useDropTarget--chapters":"OxrHhBsQAggwnv6RmqRy","useDropTarget--folders":"main-useDropTarget-folder","useDropTarget--playlists":"main-useDropTarget-playlist","useDropTarget--shows":"main-useDropTarget-show","useDropTarget--tracks":"main-useDropTarget-track","useDropTarget--local-tracks":"main-useDropTarget-local","useDropTarget--audiobooks":"main-useDropTarget-audiobook","useDropTarget--pseudo-playlists":"main-useDropTarget-pseudoPlaylist"};function y(e){var t=e.uri,r=e.id,s=void 0===r?t:r,c=e.allowedMimeTypesByDropPosition,f=e.onDrop,d=e.onLongDragOver,v=e.longDragOverTimeout,g=void 0===v?1e3:v,T=e.reorderDirection,A=void 0===T?"vertical":T,S=(0,l.lB)((function(){return c}),[c]),b=(0,D.W)(),y=(0,m.wK)(),E=!!s&&1===y.length&&y[0]===s,P=Object.values(S).every((function(e){return e.includes(a.fl.PLAYLISTS_V2)&&!e.includes(a.fl.PLAYLISTS)})),w=(0,o.useState)(null),R=(0,n.A)(w,2),I=R[0],N=R[1],k=(0,o.useCallback)((function(e){return E?[]:Object.entries(S).filter((function(t){var r=(0,n.A)(t,2),o=(r[0],r[1]);return p(e,o).length>0})).map((function(e){return(0,n.A)(e,1)[0]})).filter(u.Vv)}),[E,S]),j=(0,o.useRef)(!0),B=(0,o.useRef)(null),z=(0,o.useRef)(f);z.current=f;var C=(0,o.useRef)(d);C.current=d;var Y=(0,o.useCallback)((function(){j.current=!0,N(null),B.current&&(window.clearTimeout(B.current),B.current=null)}),[]);(0,o.useEffect)((function(){return Y}),[Y]);var F=(0,o.useCallback)((function(e){var t=k(e);t.length&&(N(i(e,t,A,b)),e.dataTransfer&&!e.defaultPrevented&&(e.dataTransfer.dropEffect=t.includes(u.Nz.ON)?"copy":"move"),e.preventDefault())}),[k,b,A]),_=(0,o.useCallback)((function(e){if(k(e).length&&!e.defaultPrevented){if(j.current){j.current=!1;var t=e.currentTarget,r=function(){document.contains(t)||(Y(),document.removeEventListener("dragenter",r))};document.addEventListener("dragenter",r),document.addEventListener("dragend",(function(){document.removeEventListener("dragenter",r),Y()}),{once:!0}),C.current&&(B.current=window.setTimeout((function(){var e;null===(e=C.current)||void 0===e||e.call(C)}),g))}e.preventDefault()}}),[k,g,Y]),x=(0,o.useCallback)((function(e){k(e).length&&(function(e){return null===e.relatedTarget&&L?!document.elementsFromPoint(e.clientX,e.clientY).includes(e.currentTarget):!e.currentTarget.contains(e.relatedTarget instanceof Node?e.relatedTarget:null)}(e)&&Y(),e.preventDefault())}),[k,Y]),M=(0,o.useCallback)((function(e){var t=i(e,k(e),A,b);if(!e.defaultPrevented&&t){var r,n=O(e,null!==(r=S[t])&&void 0!==r?r:[],P),o=function(e){var t,r;return{sectionId:parseInt(e.dataTransfer.getData("text/x-spotify-section"),10)||0,contextUri:e.dataTransfer.getData("text/x-spotify-context"),itemIds:null!==(t=null===(r=e.dataTransfer.getData(a.fl.UIDS))||void 0===r?void 0:r.split("\n").filter(Boolean))&&void 0!==t?t:[]}}(e);Object.keys(n).length&&z.current&&(z.current(n,t,o),e.preventDefault())}Y()}),[k,A,b,Y,S,P]),U=(0,o.useMemo)((function(){var e;return"".concat(h.useDropTarget," ").concat(null===(e=Array.from(new Set(Object.values(S).flat())))||void 0===e?void 0:e.map((function(e){var t;return null!==(t=h["useDropTarget--".concat(u.xz[e])])&&void 0!==t?t:""})).join(" "))}),[S]);return(0,o.useMemo)((function(){return{dropPosition:I,className:U,onDragEnter:_,onDragLeave:x,onDragOver:F,onDrop:M}}),[U,I,_,x,F,M])}var L=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}}]);
|
|
//# sourceMappingURL=3035.js.map
|