/*! For license information please see 39469.ecb9e7873ce7fbb4c4db.chunk.js.LICENSE.txt */
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[39469],{39469:function(t,e,r){r(29305),r(32733),r(36947),r(26437),r(52697),r(78557),r(90076),r(45309);var n=r(35045),o=r(6940),i=r(67430);function a(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var a=n&&n.prototype instanceof l?n:l,s=Object.create(a.prototype);return c(s,"_invoke",function(r,n,o){var i,a,c,l=0,s=o||[],f=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,r){return i=e,a=0,c=t,p.n=r,u}};function d(r,n){for(a=r,c=n,e=0;!f&&l&&!o&&e<s.length;e++){var o,i=s[e],d=p.p,y=i[2];r>3?(o=y===n)&&(c=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=t):i[0]<=d&&((o=r<2&&d<i[1])?(a=0,p.v=n,p.n=i[1]):d<y&&(o=r<3||i[0]>n||n>y)&&(i[4]=r,i[5]=n,p.n=y,a=0))}if(o||r>1)return u;throw f=!0,n}return function(o,s,y){if(l>1)throw TypeError("Generator is already running");for(f&&1===s&&d(s,y),a=s,c=y;(e=a<2?t:c)||!f;){i||(a?a<3?(a>1&&(p.n=-1),d(a,c)):p.n=c:p.v=c);try{if(l=2,i){if(a||(o="next"),e=i[o]){if(!(e=e.call(i,c)))throw TypeError("iterator result is not an object");if(!e.done)return e;c=e.value,a<2&&(a=0)}else 1===a&&(e=i.return)&&e.call(i),a<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=t}else if((e=(f=p.n<0)?c:r.call(n,p))!==u)break}catch(e){i=t,a=1,c=e}finally{l=1}}return{value:e,done:f}}}(r,o,i),!0),s}var u={};function l(){}function s(){}function f(){}e=Object.getPrototypeOf;var p=[][n]?e(e([][n]())):(c(e={},n,(function(){return this})),e),d=f.prototype=l.prototype=Object.create(p);function y(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,c(t,o,"GeneratorFunction")),t.prototype=Object.create(d),t}return s.prototype=f,c(d,"constructor",f),c(f,"constructor",s),s.displayName="GeneratorFunction",c(f,o,"GeneratorFunction"),c(d),c(d,o,"Generator"),c(d,n,(function(){return this})),c(d,"toString",(function(){return"[object Generator]"})),(a=function(){return{w:i,m:y}})()}function c(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}c=function(t,e,r,n){function i(e,r){c(t,e,(function(t){return this._invoke(e,r,t)}))}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))},c(t,e,r,n)}function u(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function l(t,e){return function(){var r={Fields:"PrimaryImageAspectRatio,MediaSourceCount,Chapters,Trickplay",EnableImageTypes:"Primary,Backdrop,Banner,Thumb",UserId:t.getCurrentUserId()};return t.getJSON(t.getUrl("Playlists/".concat(e,"/Items"),r))}}function s(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return function(r){return o.A.getListViewHtml({items:r,showIndex:!1,playFromHere:!0,action:"playallfromhere",smallIcon:!0,dragHandle:e,playlistId:t,showParentTitle:!0})}}function f(){var t;return t=a().m((function t(e,r){var o,c,u,f,p,d;return a().w((function(t){for(;;)switch(t.n){case 0:if(o=i.tF.getApi(r.ServerId),c=i.tF.getApiClient(r.ServerId),o&&c){t.n=1;break}return console.error("[PlaylistViewer] No Api or ApiClient instance is available",{api:o,apiClient:c}),t.a(2);case 1:return u=!1,t.n=2,(0,n.V)(o).getPlaylistUser({playlistId:r.Id,userId:c.getCurrentUserId()}).catch((function(t){return console.info("[PlaylistViewer] Failed to fetch playlist permissions",t),{data:{}}}));case 2:f=t.v,p=f.data,u=!!p.CanEdit,(d=e.querySelector("#childrenContent .itemsContainer")).classList.add("vertical-list"),d.classList.remove("vertical-wrap"),d.enableDragReordering(u),d.fetchData=l(c,r.Id),d.getItemsHtml=s(r.Id,u);case 3:return t.a(2)}}),t)})),f=function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){u(i,n,o,a,c,"next",t)}function c(t){u(i,n,o,a,c,"throw",t)}a(void 0)}))},f.apply(this,arguments)}function p(t){t.querySelector("#childrenContent").classList.add("verticalSection-extrabottompadding"),t.querySelector("#childrenContent .itemsContainer").refreshItems()}var d={render:function(t,e){t.playlistInit?p(t):(t.playlistInit=!0,function(t,e){return f.apply(this,arguments)}(t,e).finally((function(){p(t)})))}};e.default=d}}]);