(window.webpackJsonp=window.webpackJsonp||[]).push([[105],{880:function(e,t,o){"use strict";o.r(t);var r=o(7),l=(o(29),o(33),o(27),o(8),{props:{value:Boolean,feeds:{type:Array,default:function(){return[]}}},data:function(){return{processing:!1,selectedFolderId:null,autoDownloadEpisodes:!1}},watch:{show:{immediate:!0,handler:function(e){e&&this.init()}}},computed:{show:{get:function(){return this.value},set:function(e){this.$emit("input",e)}},title:function(){return"OPML Feeds"},currentLibrary:function(){return this.$store.getters["libraries/getCurrentLibrary"]},folders:function(){return this.currentLibrary&&this.currentLibrary.folders||[]},folderItems:function(){return this.folders.map((function(e){return{value:e.id,text:e.fullPath}}))},selectedFolder:function(){var e=this;return this.folders.find((function(t){return t.id===e.selectedFolderId}))},selectedFolderPath:function(){return this.selectedFolder?this.selectedFolder.fullPath:""}},methods:{init:function(){this.folderItems[0]&&(this.selectedFolderId=this.folderItems[0].value)},submit:function(){var e=this;return Object(r.a)(regeneratorRuntime.mark((function t(){var o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.processing=!0,o={feeds:e.feeds.map((function(e){return e.feedUrl})),folderId:e.selectedFolderId,libraryId:e.currentLibrary.id,autoDownloadEpisodes:e.autoDownloadEpisodes},e.$axios.$post("/api/podcasts/opml/create",o).then((function(){e.show=!1})).catch((function(t){var r,l=(null===(r=t.response)||void 0===r?void 0:r.data)||e.$strings.ToastPodcastCreateFailed;console.error("Failed to create podcast",o,t),e.$toast.error(l)})).finally((function(){e.processing=!1}));case 3:case"end":return t.stop()}}),t)})))()}},mounted:function(){}}),n=o(4),component=Object(n.a)(l,(function(){var e=this,t=e._self._c;return t("modals-modal",{attrs:{name:"opml-feeds-modal",width:1e3,height:"unset",processing:e.processing},scopedSlots:e._u([{key:"outer",fn:function(){return[t("div",{staticClass:"absolute top-0 left-0 p-5 w-2/3 overflow-hidden"},[t("p",{staticClass:"text-3xl text-white truncate"},[e._v(e._s(e.title))])])]},proxy:!0}]),model:{value:e.show,callback:function(t){e.show=t},expression:"show"}},[e._v(" "),t("div",{ref:"wrapper",staticClass:"p-4 w-full text-sm py-2 rounded-lg bg-bg shadow-lg border border-black-300 relative overflow-hidden"},[t("div",{staticClass:"w-full p-4"},[t("div",{staticClass:"flex items-center -mx-2 mb-2"},[t("div",{staticClass:"w-full md:w-2/3 p-2"},[t("ui-dropdown",{attrs:{items:e.folderItems,disabled:e.processing,label:e.$strings.LabelFolder},model:{value:e.selectedFolderId,callback:function(t){e.selectedFolderId=t},expression:"selectedFolderId"}})],1),e._v(" "),t("div",{staticClass:"w-full md:w-1/3 p-2 pt-6"},[t("ui-checkbox",{attrs:{label:e.$strings.LabelAutoDownloadEpisodes,"checkbox-bg":"primary","border-color":"gray-600","label-class":"text-sm font-semibold pl-2"},model:{value:e.autoDownloadEpisodes,callback:function(t){e.autoDownloadEpisodes=t},expression:"autoDownloadEpisodes"}})],1)]),e._v(" "),t("p",{staticClass:"text-lg font-semibold mb-1"},[e._v(e._s(e.$strings.HeaderPodcastsToAdd))]),e._v(" "),t("p",{staticClass:"text-sm text-gray-300 mb-4"},[e._v(e._s(e.$strings.MessageOpmlPreviewNote))]),e._v(" "),t("div",{staticClass:"w-full overflow-y-auto",staticStyle:{"max-height":"50vh"}},[e._l(e.feeds,(function(o,r){return[t("div",{key:r,staticClass:"py-1 flex items-center"},[t("p",{staticClass:"text-lg font-semibold"},[e._v(e._s(r+1)+".")]),e._v(" "),t("div",{staticClass:"pl-2"},[o.title?t("p",{staticClass:"text-sm font-semibold"},[e._v(e._s(o.title))]):e._e(),e._v(" "),t("p",{staticClass:"text-xs text-gray-400"},[e._v(e._s(o.feedUrl))])])])]}))],2)]),e._v(" "),t("div",{staticClass:"flex items-center py-4"},[t("div",{staticClass:"grow"}),e._v(" "),t("ui-btn",{attrs:{color:"bg-success"},on:{click:e.submit}},[e._v(e._s(e.$strings.ButtonAddPodcasts))])],1)])])}),[],!1,null,null,null);t.default=component.exports;installComponents(component,{UiDropdown:o(236).default,UiCheckbox:o(184).default,UiBtn:o(42).default,ModalsModal:o(39).default})}}]);