@clickview/library-editor 1.3.1-dev.1 → 1.4.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundles.json +3 -3
- package/dist/css/{library-editor-app-070c979de9.css → library-editor-app-bc12f8ea16.css} +1 -1
- package/dist/en.json +1 -1
- package/dist/scripts/{0-aa50fa9da5.chunk.js → 0-bb8d151788.chunk.js} +1 -1
- package/dist/scripts/{1-fd3e4736ec.chunk.js → 1-8da41f8348.chunk.js} +1 -1
- package/dist/scripts/{10-7591f02932.chunk.js → 10-228d8c45fe.chunk.js} +1 -1
- package/dist/scripts/{11-02eba260f6.chunk.js → 11-9b1312be2e.chunk.js} +1 -1
- package/dist/scripts/{12-6d82741731.chunk.js → 12-25fd567bfa.chunk.js} +1 -1
- package/dist/scripts/{13-724a96f11e.chunk.js → 13-5594f01c32.chunk.js} +1 -1
- package/dist/scripts/{14-f0e8d0ad52.chunk.js → 14-d3e9f7ac99.chunk.js} +1 -1
- package/dist/scripts/{15-0dc89981e2.chunk.js → 15-9c2702f643.chunk.js} +1 -1
- package/dist/scripts/{16-28fbb0fbe5.chunk.js → 16-35ac442692.chunk.js} +1 -1
- package/dist/scripts/{17-3c94d08d78.chunk.js → 17-229a9e354b.chunk.js} +1 -1
- package/dist/scripts/{18-3fadb1f394.chunk.js → 18-71ca059d9a.chunk.js} +1 -1
- package/dist/scripts/{19-8e572002ab.chunk.js → 19-b229508fdd.chunk.js} +1 -1
- package/dist/scripts/{2-7a78d29f44.chunk.js → 2-3ae9732722.chunk.js} +1 -1
- package/dist/scripts/{22-9a3adda6ad.chunk.js → 22-ac521a0096.chunk.js} +1 -1
- package/dist/scripts/{23-be4588004c.chunk.js → 23-c697c32cec.chunk.js} +1 -1
- package/dist/scripts/{24-ab5d254e7f.chunk.js → 24-6eb3e57e82.chunk.js} +1 -1
- package/dist/scripts/{25-4df309effa.chunk.js → 25-6b696e6ef2.chunk.js} +1 -1
- package/dist/scripts/{26-e6e5871cfd.chunk.js → 26-ee7f9d7fd1.chunk.js} +1 -1
- package/dist/scripts/{27-5e3aeba07e.chunk.js → 27-87b1e6230a.chunk.js} +1 -1
- package/dist/scripts/{28-cc856d5e95.chunk.js → 28-c605108bb7.chunk.js} +1 -1
- package/dist/scripts/{29-9f77baca01.chunk.js → 29-8efdbc6583.chunk.js} +1 -1
- package/dist/scripts/{3-79f80333be.chunk.js → 3-55457ff399.chunk.js} +1 -1
- package/dist/scripts/{30-68fb832db0.chunk.js → 30-f3bf572703.chunk.js} +1 -1
- package/dist/scripts/{31-d80dd32cc1.chunk.js → 31-c1ce0f719e.chunk.js} +1 -1
- package/dist/scripts/{32-cfb32aaa08.chunk.js → 32-f5db4cacf9.chunk.js} +1 -1
- package/dist/scripts/{33-8c76b774b6.chunk.js → 33-17b481dedb.chunk.js} +1 -1
- package/dist/scripts/{34-9e83c63cb8.chunk.js → 34-918d865f34.chunk.js} +1 -1
- package/dist/scripts/{35-2a9acc8597.chunk.js → 35-de8b68b764.chunk.js} +1 -1
- package/dist/scripts/{36-d6d7b848e2.chunk.js → 36-23d5a73fbf.chunk.js} +1 -1
- package/dist/scripts/{37-ad8e6f67c5.chunk.js → 37-c08483de1b.chunk.js} +1 -1
- package/dist/scripts/{38-f681bc9e2e.chunk.js → 38-288855b754.chunk.js} +1 -1
- package/dist/scripts/{39-19eec511f5.chunk.js → 39-4d0f862a76.chunk.js} +1 -1
- package/dist/scripts/{4-2a82a84056.chunk.js → 4-0eb5ce96d3.chunk.js} +1 -1
- package/dist/scripts/{40-cca507ba93.chunk.js → 40-adec67fce9.chunk.js} +1 -1
- package/dist/scripts/{41-fc6a0fe7e4.chunk.js → 41-305ec13d1c.chunk.js} +1 -1
- package/dist/scripts/{42-5452d6de34.chunk.js → 42-7227e7bd2c.chunk.js} +1 -1
- package/dist/scripts/{43-fb162a1122.chunk.js → 43-e38791d4a7.chunk.js} +1 -1
- package/dist/scripts/{44-b3b4565828.chunk.js → 44-bd0a532d8e.chunk.js} +1 -1
- package/dist/scripts/{45-8412ccea6c.chunk.js → 45-0e2409cd60.chunk.js} +1 -1
- package/dist/scripts/{46-372fa93c13.chunk.js → 46-912320ce94.chunk.js} +1 -1
- package/dist/scripts/{47-56c363e4a6.chunk.js → 47-3cbfd2a2ac.chunk.js} +1 -1
- package/dist/scripts/{48-f0403bcb83.chunk.js → 48-8d42e561b1.chunk.js} +1 -1
- package/dist/scripts/{49-13b2893542.chunk.js → 49-1ba48a0e60.chunk.js} +1 -1
- package/dist/scripts/{5-b2986c85d0.chunk.js → 5-f3d75e93a6.chunk.js} +1 -1
- package/dist/scripts/{50-8c3fb5c1c4.chunk.js → 50-3b7b3dc488.chunk.js} +1 -1
- package/dist/scripts/{51-ec94176992.chunk.js → 51-2f0874d3b6.chunk.js} +1 -1
- package/dist/scripts/{52-f541d887ed.chunk.js → 52-38139e2d72.chunk.js} +1 -1
- package/dist/scripts/{53-f827f8b6e0.chunk.js → 53-8bf2c662ed.chunk.js} +1 -1
- package/dist/scripts/{54-1ebcc9fcaf.chunk.js → 54-2010b7d990.chunk.js} +1 -1
- package/dist/scripts/{55-4c0d184ca3.chunk.js → 55-ac90e52766.chunk.js} +1 -1
- package/dist/scripts/{56-de18389621.chunk.js → 56-556404b07f.chunk.js} +1 -1
- package/dist/scripts/{57-a85e67a482.chunk.js → 57-0e77443044.chunk.js} +1 -1
- package/dist/scripts/{58-be172a6ca4.chunk.js → 58-b52ecfb254.chunk.js} +1 -1
- package/dist/scripts/{59-4bf5baafed.chunk.js → 59-3e7a2e50d2.chunk.js} +1 -1
- package/dist/scripts/{6-53d64f6a85.chunk.js → 6-e2b6f0a280.chunk.js} +1 -1
- package/dist/scripts/{60-03e44d916c.chunk.js → 60-48d410eac3.chunk.js} +1 -1
- package/dist/scripts/{61-11a1a5f41c.chunk.js → 61-de1dca97c1.chunk.js} +1 -1
- package/dist/scripts/{62-78089903fa.chunk.js → 62-b68b548732.chunk.js} +1 -1
- package/dist/scripts/{63-fe138e1f54.chunk.js → 63-f863898f45.chunk.js} +1 -1
- package/dist/scripts/{64-1460024bea.chunk.js → 64-440e44bd4c.chunk.js} +1 -1
- package/dist/scripts/{65-81c6f0a1d0.chunk.js → 65-1cd1a11fd2.chunk.js} +1 -1
- package/dist/scripts/{66-469cc41ce6.chunk.js → 66-8580a8395b.chunk.js} +1 -1
- package/dist/scripts/{67-dd181df1c4.chunk.js → 67-7c04f32d25.chunk.js} +1 -1
- package/dist/scripts/{68-bf1905261e.chunk.js → 68-a8c262b62d.chunk.js} +1 -1
- package/dist/scripts/{69-c77da01389.chunk.js → 69-e24052e605.chunk.js} +1 -1
- package/dist/scripts/{7-f2452d62fd.chunk.js → 7-7fcaf2b89f.chunk.js} +1 -1
- package/dist/scripts/{70-e79d42e859.chunk.js → 70-fa3e9a9a9d.chunk.js} +1 -1
- package/dist/scripts/{71-8bee00418c.chunk.js → 71-822760c520.chunk.js} +1 -1
- package/dist/scripts/{72-c9c79df587.chunk.js → 72-39aa9e9fc7.chunk.js} +1 -1
- package/dist/scripts/{73-172b46004e.chunk.js → 73-77a89058bc.chunk.js} +1 -1
- package/dist/scripts/{74-3a572e4113.chunk.js → 74-bf5fd5de31.chunk.js} +1 -1
- package/dist/scripts/{8-223910870f.chunk.js → 8-4674a9a713.chunk.js} +1 -1
- package/dist/scripts/{9-1e67205927.chunk.js → 9-f2dd265540.chunk.js} +1 -1
- package/dist/scripts/{bundle-108691b784.min.js → bundle-39a40aaa3e.min.js} +3 -3
- package/dist/scripts/polyfills-fba7714a3a.min.js +1 -0
- package/package.json +2 -2
- package/dist/scripts/bundle-81edf9131b.min.js +0 -10
- package/dist/scripts/polyfills-afb66ec8cc.min.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(window.webpackJsonp_clickview_library_editor=window.webpackJsonp_clickview_library_editor||[]).push([[25],{1051:function(e,t,n){"use strict";var r=n(1055),o=n(1052),i=(n(1053),n(3),n(1056)),a=(n(1058),n(1054));n.d(t,"a",(function(){return r.a})),n.d(t,"d",(function(){return o.g})),n.d(t,"g",(function(){return o.j})),n.d(t,"f",(function(){return o.i})),n.d(t,"c",(function(){return o.f})),n.d(t,"e",(function(){return o.h})),n.d(t,"b",(function(){return i.a})),n.d(t,"h",(function(){return a.a}))},1052:function(e,t,n){"use strict";n.d(t,"a",(function(){return f})),n.d(t,"k",(function(){return d})),n.d(t,"g",(function(){return m})),n.d(t,"e",(function(){return y})),n.d(t,"j",(function(){return b})),n.d(t,"i",(function(){return v})),n.d(t,"c",(function(){return w})),n.d(t,"b",(function(){return O})),n.d(t,"d",(function(){return C})),n.d(t,"f",(function(){return k})),n.d(t,"h",(function(){return g}));var r=n(2),o=n(1),i=n(19),a=n(29),s=n(3),l="libraryEditor.utils",u=["tags","thumbnail","chapters","resources","subtitles","disabled","links","restrictions","categories"];function c(e,t){if(e){var n=o.reduce(e,(function(e,n,r){var i=t[r];return n||i?o.isObject(n)&&o.isObject(i)&&!o.isUndefined(n.id)&&n.id===i.id?e:o.isArray(n)?p(n,i).length?e.concat(r):e:o.isEqual(n,i)?e:e.concat(r):e}),[]);if(n.length)return o.object(o.map(n,(function(n){return o.isArray(t[n])?[n,p(e[n],t[n])]:[n,t[n]]})))}}function p(e,t){var n=[];return o.each(t,(function(t){var r=o.findWhere(e,{id:t.id});if(!o.isUndefined(r)||0!==Object.keys(t).length){var i=o.isUndefined(r)?t:c(r,t);i&&(t.id<0&&!t.value||(!r||t.id<0?n.push(t):(i.id=t.id,n.push(i))))}})),n}var f={getChanges:function(e,t){var n=c(o.omit(e.toJSON(),u),o.omit(t.toJSON(),u));if(n)return o.object(o.map(o.keys(n),(function(e){return[e,f.formatChanges(e,n[e])]})))},formatChanges:function(e,t){if(!t)return null;if(o.isObject(t)&&o.isEmpty(t))return null;switch(e){case"name":case"description":case"productionYear":case"dateBroadcast":case"fields":case"episodeNumber":return t;case"channel":case"series":case"rating":case"season":return{id:t.id};case"distributors":case"producers":case"directors":case"productionCompanies":return o.map(t,(function(e){return e.id}));case"dateModified":case"hasBroadcast":case"seriesSort":return;default:r.a.ErrorHelper.throw(new i.a("There are no formatting settings for ".concat(e)))}},updateModelState:function(e,t,n){var i=["distributors","producers","directors","productionCompanies"];for(var a in o.each(o.keys(n),(function(e){i.includes(e)&&(n[e]=t.get(e).toJSON())})),t.set(o.clone(n),{silent:!0}),e.set(t.toJSON(),{silent:!0}),n){if(!n[a]&&e.associations[a]){var s=e.get(a);(s instanceof r.a.Model||s instanceof r.a.NestedModel)&&s.clear()}}},getRemovedObjectIds:function(e,t){var n=["distributors","productionCompanies","producers","directors"],r={};return o.each(o.keys(e.toJSON()),(function(i){if(o.contains(n,i)){var a=e.get(i).map((function(e){return e.id})),s=t.get(i).map((function(e){return e.id})),l=o.filter(a,(function(e){return e&&!o.contains(s,e)}));l.length&&(r[i]=l)}})),r}},d={name:[{required:!0,msg:function(){return s.a.getPhrase(l,"videoTitleRequired")}},{maxLength:255,msg:function(){return s.a.getPhrase(l,"videoTitleExceeds")}}],description:[{required:!1},{maxLength:16e3,msg:function(){return s.a.getPhrase(l,"videoDescriptionExceeds")}}],episodeNumber:function(e,t,n){return e&&e<1?s.a.getPhrase(l,"episodeNumberLessThanOne"):e&&e>2147483647?s.a.getPhrase(l,"episodeNumberExceeds"):e%1!=0?s.a.getPhrase(l,"episodeNumberNotWhole"):n.season&&n.season.get("number")>=0&&null===e?s.a.getPhrase(l,"episodeNumberNoSeason"):""},season:function(e,t,n){return n.season&&n.season.get("number")||e&&e.number||!n.episodeNumber?"":s.a.getPhrase(l,"seasonNoEpisodeNumber")}},h=a().year(),y={productionYear:function(e){return e||0===e?(e=+e,isNaN(e)?"Production year must be a number.":e<1900||e>h?s.a.getPhrase(l,"validProductionYears",{currentYear:h}):void 0):""}},m={name:[{required:!0,msg:function(){return s.a.getPhrase(l,"resourceNameRequired")}}]},b={suggestion:[{required:!0,msg:function(){return s.a.getPhrase(l,"suggestEditRequired")}},{maxLength:16e3,msg:function(){return s.a.getPhrase(l,"suggestEditExceeds")}}],reason:[{required:!0,msg:function(){return s.a.getPhrase(l,"suggestEditReasonRequired")}},{maxLength:16e3,msg:function(){return s.a.getPhrase(l,"suggestEditReasonExceeds")}}]},g={number:function(e){return e?+e<1?s.a.getPhrase(l,"seasonLessThanOne"):+e>3e3?s.a.getPhrase(l,"seasonExceeds"):+e%1!=0?s.a.getPhrase(l,"seasonNotWhole"):"":s.a.getPhrase(l,"seasonRequired")}},v={empty:function(){return s.a.getPhrase(l,"suggestEditRatingRequired")},original:function(){return s.a.getPhrase(l,"suggestEditRatingInvalid")}},k={url:[{required:!0,pattern:"url",msg:function(){return s.a.getPhrase(l,"linkUrlRequired")}},{maxLength:16e3,msg:function(){return s.a.getPhrase(l,"linkUrlExceeds")}}],name:[{required:!0,msg:function(){return s.a.getPhrase(l,"linkNameRequired")}},{maxLength:255,msg:function(){return s.a.getPhrase(l,"linkNameExceeds")}}]},w={name:[{maxLength:128,msg:function(){return s.a.getPhrase(l,"fieldNameExceeds")}}],value:[{maxLength:16e3,msg:function(){return s.a.getPhrase(l,"fieldValueExceeds")}}]},O={fields:function(e){return e&&e.length?e.all((function(e){return!1!==e.isValid()}))?"":s.a.getPhrase(l,"fieldsInvalid"):""}};function C(){return[{id:-1,name:"Admin Notes",value:"",placeholder:"Notes that only admins will see"}]}},1053:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(1),o=n(48),i=n(169),a=n(3),s="libraryEditor.utils",l={name:[{required:!0,msg:function(){return a.a.getPhrase(s,"folderNameRequired")}},{maxLength:255,msg:function(){return a.a.getPhrase(s,"folderNameExceeds")}}]},u=function(e,t){return{parentId:function(n){return n?o.a.calculateDestinationFolderDepth(e,n,t)>i.a.MAX_FOLDER_DEPTH?a.a.getPhrase(s,"maxFolderDepth",{maxDepth:i.a.MAX_FOLDER_DEPTH}):"":a.a.getPhrase(s,"selectParentFolder")}}},c=function(e){var t=e.validateName,n=e.validateParent,o=e.folder,i=e.collection;return t&&n?r.extend({},l,u(o,i)):t?l:n?u(o,i):void 0}},1054:function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var r=n(16),o=n(3),i=n(200),a=n(1071),s=n(62);function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var u,c="libraryEditor.utils";!function(e){e.Pdf="pdf",e.Image="image",e.PowerPoint="powerpoint",e.Document="document",e.Excel="excel",e.Zip="archive",e.File="text"}(u||(u={}));var p={mapRatingToClass:function(e){if(!e)return"";return function(e){switch(!0){case e<32:return"bg-purple";case e<48:return"bg-green";case e<80:return"bg-info";case e<96:return"bg-red";case e<128:return"bg-pink";case e>=128:return"bg-yellow";default:return""}}(e)},mapSourceToDisplayName:function(e){switch(e.get("type")){case s.a.HostedLibrary:case s.a.CustomLibrary:return e.get("name");case s.a.Exchange:return o.a.getPhrase(c,"exchange");case s.a.Workspace:return o.a.getPhrase(c,"workspace");default:return""}},mapSourceToClass:function(e){switch(e){case s.a.HostedLibrary:case s.a.CustomLibrary:return"bg-info";case s.a.Exchange:return"bg-green";case s.a.Workspace:default:return"bg-red"}},isInteractive:function(e){return!(!e||!e.interactives)&&!!e.interactives.length},mapTypeToSvg:function(e){var t,n=(l(t={},u.Pdf,r.b.FilePDF),l(t,u.Image,r.b.FileImg),l(t,u.PowerPoint,r.b.FilePowerpoint),l(t,u.Document,r.b.FileWord),l(t,u.Excel,r.b.FileExcel),l(t,u.Zip,r.b.FileZip),l(t,u.File,r.b.File),t)[e];return n||(n=r.b.Folder),r.a.getSvg(n)},mapTypeToClass:function(e){switch(e){case u.Pdf:return"icon-red";case u.Image:return"icon-purple";case u.Document:return"icon-blue";case u.Excel:return"icon-green";case u.PowerPoint:return"icon-orange";case u.Zip:return"icon-teal";case u.File:return"icon-gray";default:return""}},mapTypeToExtension:function(e){if(!e)return"";return{pdf:"pdf",image:"png",powerpoint:"pptx"}[e.toLowerCase()]},mapTypeToName:function(e){if(!e)return"";switch(e){case u.Pdf:return o.a.getPhrase(c,"pdf");case u.Image:return o.a.getPhrase(c,"image");case u.Document:return o.a.getPhrase(c,"document");case u.Excel:return o.a.getPhrase(c,"spreadsheet");case u.PowerPoint:return o.a.getPhrase(c,"presentation");case u.Zip:return o.a.getPhrase(c,"zipArchive");case u.File:return o.a.getPhrase(c,"file");default:return""}},translateMetadataCollectionNames:function(e){return new a.a(e.map((function(e){return Object.assign(Object.assign({},e.toJSON()),{name:p.translateMetadataName(e.get("name"))})})))},translateMetadataName:function(e){var t="suggestEdit";switch(e){case i.MetadataType.VideoTitle:t+="VideoTitle";break;case i.MetadataType.Description:t+="Description";break;case i.MetadataType.Rating:t+="Rating";break;case i.MetadataType.SeriesTitle:t+="SeriesTitle";break;case i.MetadataType.Season:t+="SeasonNumber";break;case i.MetadataType.EpisodeNumber:t+="EpisodeNumber";break;case i.MetadataType.BroadcastDate:t+="BroadcastDate";break;case i.MetadataType.Channel:t+="Channel";break;case i.MetadataType.ProductionYear:t+="ProductionYear";break;case i.MetadataType.Distributors:t+="Distributors";break;case i.MetadataType.ProductionCompanies:t+="ProductionCompanies";break;case i.MetadataType.Directors:t+="Directors";break;case i.MetadataType.Producers:t+="Producers";break;case i.MetadataType.Other:t+="Other"}return o.a.getPhrase(c,t)}}},1055:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(1),o=n(12),i=n(3),a="libraryEditor.utils",s={isValidChapterTime:function(e,t,n,i){if(i){if(!r.isNumber(t))return l.StartTime.Invalid();if(t<0)return l.StartTime.Invalid();if(t>o.x.millisecondsToSeconds(n))return l.StartTime.Exceeds();if(i.some((function(n){return!(n.id&&n.id===e.id||n.cid===e.cid)&&n.get("startTime")===t})))return l.StartTime.Exists()}},isValidChapterName:function(e,t,n){return t?t.length>255?l.Name.MaxLength():n.some((function(n){return!(n.id&&n.id===e.id||n.cid===e.cid)&&n.get("name").trim()===t.trim()}))?l.Name.Exists():r.isEmpty(t.trim())?l.Name.Invalid():void 0:l.Name.Invalid()},mapPhysicalChapters:function(e){var t=0;return r.map(e,(function(e,n){var r={name:e.title,startTime:t,index:n,isPhysicalChapter:!0};return t+=e.duration,r}))}},l={Name:{Invalid:function(){return i.a.getPhrase(a,"chapterNameInvalid")},Exists:function(){return i.a.getPhrase(a,"chapterNameExists")},MaxLength:function(){return i.a.getPhrase(a,"chapterNameExceeds")}},StartTime:{Invalid:function(){return i.a.getPhrase(a,"chapterStartTimeInvalid")},Exists:function(){return i.a.getPhrase(a,"chapterStartTimeExists")},Exceeds:function(){return i.a.getPhrase(a,"chapterStartTimeExceeds")}}}},1056:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(3),o="libraryEditor.utils",i={name:[{required:!0,msg:function(){return r.a.getPhrase(o,"libraryNameRequired")}},{maxLength:255,msg:function(){return r.a.getPhrase(o,"libraryNameExceeds")}}]}},1058:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(3),o=n(1052),i=r.a.encloseNamespace("libraryEditor.utils"),a={name:[{required:!0,msg:function(){return i("videoTitleRequired")}}],folderId:[{required:!0,msg:function(){return i("uploadFolderRequired")}}],libraryId:[{required:!0,msg:function(){return i("uploadLibraryRequired")}}],episodeNumber:function(e,t,n){return e&&e<1?i("episodeNumberLessThanOne"):e&&e>255?i("episodeNumberExceeds"):e&&e%1!=0?i("episodeNumberNotWhole"):n.season&&n.season.get("number")>=0&&null===e?i("episodeNumberNoSeason"):""},season:function(e,t,n){return n.season&&n.season.get("number")||e&&e.number||!n.episodeNumber?"":i("seasonNoEpisodeNumber")},productionYear:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return o.e.productionYear.apply(null,t)}}},1071:function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){return(a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function s(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=u(e);if(t){var o=u(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return l(this,n)}}function l(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"a",(function(){return c}));var c=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a(e,t)}(u,e);var t,n,r,l=s(u);function u(){return i(this,u),l.apply(this,arguments)}return t=u,n&&o(t.prototype,n),r&&o(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}(n(2).a.Collection)},1098:function(e,t,n){"use strict";n.d(t,"a",(function(){return y}));var r=n(1),o=n(2),i=n(1099),a=n.n(i),s=n(1100),l=n.n(s);function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function p(e,t){return(p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function f(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h(e);if(t){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return d(this,n)}}function d(e,t){if(t&&("object"===u(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var y=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&p(e,t)}(s,e);var t,n,o,i=f(s);function s(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),i.call(this,e)}return t=s,(n=[{key:"name",get:function(){return"TabsView"}},{key:"className",get:function(){var e="bg-white py-2 border-bottom";return this.options.className&&(e+=" ".concat(this.options.className)),e}},{key:"template",get:function(){return l.a}},{key:"appLinks",get:function(){var e={};return this.options.tabs.forEach((function(t){return e[t.link.selector]=t.link.appLink})),e}},{key:"viewOptions",value:function(){var e=this.options.tabs.map((function(e){return Object.assign(Object.assign({},e),{link:e.link.selector.replace(".","")})}));return{styles:a.a,tabs:e}}},{key:"setActiveTab",value:function(){var e=this,t=!1;if(this.options.tabs.forEach((function(n){n.active=!1,n.link.selector===e.options.activeTab&&(n.active=!0,t=!0)})),!t){var n=r.first(this.options.tabs);n&&(n.active=!0)}}},{key:"onBeforeRender",value:function(){this.setActiveTab()}}])&&c(t.prototype,n),o&&c(t,o),Object.defineProperty(t,"prototype",{writable:!1}),s}(o.a.Component)},1099:function(e,t,n){e.exports={link:"_5idZs",active:"_3Ty4M"}},1100:function(e,t,n){var r=n(10);e.exports=(r.default||r).template({1:function(e,t,n,r,o,i,a){var s;e.propertyIsEnumerable;return null!=(s=n.unless.call(null!=t?t:e.nullContext||{},null!=t?t.hide:t,{name:"unless",hash:{},fn:e.program(2,o,0,i,a),inverse:e.noop,data:o}))?s:""},2:function(e,t,n,r,o,i,a){e.propertyIsEnumerable;var s,l=e.lambda,u=e.escapeExpression;return' <a class="'+u(l(null!=(s=null!=(s=null!=a[1]?a[1].options:a[1])?s.styles:s)?s.link:s,t))+" p-2 "+u(l(null!=t?t.link:t,t))+" "+(null!=(s=n.if.call(null!=t?t:e.nullContext||{},null!=t?t.active:t,{name:"if",hash:{},fn:e.program(3,o,0,i,a),inverse:e.noop,data:o}))?s:"")+'">'+u(l(null!=t?t.name:t,t))+"</a>\r\n"},3:function(e,t,n,r,o,i,a){var s;e.propertyIsEnumerable;return e.escapeExpression(e.lambda(null!=(s=null!=(s=null!=a[1]?a[1].options:a[1])?s.styles:s)?s.active:s,t))+" border-bottom border-primary text-primary"},compiler:[8,">= 4.3.0"],main:function(e,t,n,r,o,i,a){var s;e.propertyIsEnumerable;return null!=(s=n.each.call(null!=t?t:e.nullContext||{},null!=(s=null!=t?t.options:t)?s.tabs:s,{name:"each",hash:{},fn:e.program(1,o,0,i,a),inverse:e.noop,data:o}))?s:""},useData:!0,useDepths:!0})},1112:function(e,t,n){"use strict";n.d(t,"a",(function(){return k}));var r=n(1),o=n(6),i=n(2),a=n(19),s=n(16),l=n(99),u=n(12),c=n(1160),p=n.n(c),f=n(1161),d=n.n(f);function h(e){return(h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function y(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function m(e,t){return(m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function b(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=v(e);if(t){var o=v(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return g(this,n)}}function g(e,t){if(t&&("object"===h(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var k=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&m(e,t)}(h,e);var t,n,c,f=b(h);function h(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,h),f.call(this,e)}return t=h,(n=[{key:"name",get:function(){return"SearchTypeaheadComponent"}},{key:"template",get:function(){return p.a}},{key:"className",get:function(){return"search-container ".concat(d.a.typeaheadContainer," mb-2")}},{key:"channelName",get:function(){return u.k.generateUniqueChannelName(this)}},{key:"elements",get:function(){return{input:"#".concat(this.options.inputId)}}},{key:"defaults",get:function(){return{inputId:"search-typeahead",placeholderText:"Search",stickItProperty:"name",selectEvent:"select:result",additionalClasses:"",editable:!0}}},{key:"events",value:function(){return{submit:"onSubmit","click .remove":"onClickRemove"}}},{key:"initialize",value:function(){this.model||this.options.parentChannelName||i.a.ErrorHelper.throw(new a.a("Either pass a model or a channelName to access the typeahead selection")),this.model||(this.model=new i.a.Model),this.options.inputName||(this.options.inputName=this.options.inputId),this.bindListeners()}},{key:"bindListeners",value:function(){this.options.parentChannelName&&(this.parentChannel=o.Radio.channel(this.options.parentChannelName)),this.listenTo(this.channelName,"typeahead:set:input",this.setInput),this.listenTo(this.channelName,"typeahead:clear:input",this.clearInput)}},{key:"bindings",get:function(){var e,t,n,r="[name=".concat(this.options.inputName,"]");return e={},t=r,n={observe:this.options.stickItProperty,setOptions:{validate:!0}},t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},{key:"clearInput",value:function(){this.getUI("input").typeahead("val",null)}},{key:"setInput",value:function(e){this.getUI("input").typeahead("val",e)}},{key:"onTypeaheadSelect",value:function(e,t){var n;e.preventDefault(),n="string"==typeof t?t:t.title||t.name||t.query,this.model.set(this.options.stickItProperty,n),this.parentChannel&&this.options.selectEvent&&this.parentChannel.trigger(this.options.selectEvent,t),this.onSubmit(e),this.toggleRemove()}},{key:"onSubmit",value:function(e){var t=this;if(e.preventDefault(),!this.isDestroyed()&&this.getTypeaheadActionOptions().clearOnSelect)return this.getUI("input").typeahead("close"),setTimeout((function(){t.model.clear(),t.clearInput()}),0),!1}},{key:"onClickRemove",value:function(){this.model.clear(),this.parentChannel.trigger(this.options.removeEvent,this.model),this.toggleRemove()}},{key:"getSources",value:function(){return r.isArray(this.options.typeaheadConfigs)?l.a.getSearchSources(this.options.typeaheadConfigs):l.a.getSearchSources([this.options.typeaheadConfigs])}},{key:"getTypeaheadOptions",value:function(){var e={minLength:1,highlight:!0};return this.options.typeaheadOptions?r.extend({},e,this.options.typeaheadOptions):e}},{key:"getTypeaheadActionOptions",value:function(){var e={clearOnSelect:!1};return r.isObject(this.options.actionOptions)?r.extend({},e,this.options.actionOptions):e}},{key:"bindOptionalCallbacks",value:function(){r.isObject(this.options.callbacks)&&(r.isFunction(this.options.callbacks.onRender)&&this.getUI("input").on("typeahead:render",r.bind(this.options.callbacks.onRender,this)),r.isFunction(this.options.callbacks.onInput)&&this.listenTo(this.model,"change:".concat(this.options.stickItProperty),this.options.callbacks.onInput),r.isFunction(this.options.callbacks.onBlur)&&this.getUI("input").on("blur",r.bind(this.options.callbacks.onBlur,this,this.channelName,this.options.stickItProperty)))}},{key:"initTypeahead",value:function(){this.getUI("input").typeahead(this.getTypeaheadOptions(),this.getSources())}},{key:"initTypeaheadListeners",value:function(){this.getUI("input").on("typeahead:select",r.bind(this.onTypeaheadSelect,this)),this.bindOptionalCallbacks()}},{key:"toggleRemove",value:function(){this.shouldShowRemove()?this.$el.find(".remove").show():this.$el.find(".remove").hide()}},{key:"shouldShowRemove",value:function(){return!!this.options.editable&&(!!this.options.forceShowRemoveButton||this.options.removeEvent&&!!this.model.get(this.options.stickItProperty))}},{key:"viewOptions",value:function(){return Object.assign(Object.assign({styles:d.a},this.options),{showRemove:this.shouldShowRemove(),svgRemove:s.a.getSvg(s.b.Close)})}},{key:"onRender",value:function(){var e=this;this.stickit(),this.initTypeahead(),this.initTypeaheadListeners(),o.Validation.bind(this),this.toggleRemove(),this.options.autofocus&&window.requestAnimationFrame((function(){e.getUI("input").focus()}))}},{key:"onClose",value:function(){this.getUI("input").off(),this.unstickit(),o.Validation.unbind(this)}}])&&y(t.prototype,n),c&&y(t,c),Object.defineProperty(t,"prototype",{writable:!1}),h}(i.a.Component)},1118:function(e,t,n){"use strict";n.d(t,"a",(function(){return g}));var r=n(6),o=n(2),i=n(16),a=n(1119),s=n.n(a),l=n(1120),u=n.n(l),c=n(0),p=n(1098);function f(e){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function d(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function h(e,t){return(h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=b(e);if(t){var o=b(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return m(this,n)}}function m(e,t){if(t&&("object"===f(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var g=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}(l,e);var t,n,o,a=y(l);function l(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),a.call(this,e)}return t=l,(n=[{key:"name",get:function(){return"EditVideoTabsComponent"}},{key:"className",get:function(){return"bg-white"}},{key:"regions",value:function(){return{tabs:{el:".tabs-region",replaceElement:!0}}}},{key:"template",get:function(){return u.a}},{key:"appLinks",get:function(){var e,t,n,r=this.options.goBackTab.link;return e={},t=r.selector,n=r.appLink,t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},{key:"viewOptions",value:function(){var e=Object.assign(Object.assign({},this.options.goBackTab),{link:this.options.goBackTab.link.selector.replace(".","")});return{styles:s.a,backTab:e,backArrow:i.a.getSvg(i.b.ArrowLeft)}}},{key:"onSave",value:function(){r.Radio.channel(c.b.LIBRARY_EDITOR).trigger(c.a.LibraryEditor.SAVE_VIDEO)}},{key:"onRender",value:function(){this.showChildView("tabs",new p.a({tabs:this.options.tabs,activeTab:this.options.activeTab}))}}])&&d(t.prototype,n),o&&d(t,o),Object.defineProperty(t,"prototype",{writable:!1}),l}(o.a.Component)},1119:function(e,t,n){e.exports={svgContainer:"_27gR6"}},1120:function(e,t,n){var r=n(10);e.exports=(r.default||r).template({compiler:[8,">= 4.3.0"],main:function(e,t,n,r,o){e.propertyIsEnumerable;var i,a=e.lambda,s=e.escapeExpression;return'<div class="row">\r\n <h4>\r\n <a class="d-inline-flex align-items-center '+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.link:i,t))+" "+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.backTab:i)?i.link:i,t))+'">\r\n <span class="'+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svgContainer:i,t))+' d-inline-block mx-2">'+(null!=(i=a(null!=(i=null!=t?t.options:t)?i.backArrow:i,t))?i:"")+"</span>\r\n "+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.backTab:i)?i.name:i,t))+'\r\n </a>\r\n </h4>\r\n</div>\r\n<div class="tabs-region pl-2"></div>'},useData:!0})},1134:function(e,t,n){"use strict";var r=n(2),o=n(6),i=n(1147),a=n.n(i),s=n(111),l=n(4),u=n(42),c=n(16),p=n(1135),f=n(1148),d=n.n(f),h=n(1149),y=n.n(h);function m(e){return(m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function b(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function g(e,t){return(g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function v(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=w(e);if(t){var o=w(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return k(this,n)}}function k(e,t){if(t&&("object"===m(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function w(e){return(w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var O=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&g(e,t)}(i,e);var t,n,r,o=v(i);function i(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),o.call(this,e)}return t=i,(n=[{key:"name",get:function(){return"ResourceItemComponent"}},{key:"template",get:function(){return d.a}},{key:"className",get:function(){return"".concat(y.a.container," rounded p-2 mb-2")}},{key:"events",value:function(){return{"click .delete":"onClickDelete","click .edit":"onClickEdit"}}},{key:"appLinks",get:function(){return{".edit":this.options.getEditAppLink(this.model.get("id"))}}},{key:"onClickEdit",value:function(){var e=u.a.mergeOptions(this.options.analyticsOptions,{actionType:l.UserAction.Edit,entity:l.EntityType.Resource,workflowPhase:l.WorkflowPhase.Start}),t={id:this.model.get("id"),parentId:+this.options.videoId};u.a.logUserAction(t,e)}},{key:"onClickDelete",value:function(){s.a.isFunction(this.options.onClickDelete)&&this.options.onClickDelete(this.model)}},{key:"viewOptions",value:function(){var e=this.model.get("metadata"),t=e?e.type:"";return{editable:this.options.editable,extension:p.a.mapTypeToExtension(t),svg:c.a.getSvg(p.a.mapTypeToSvg(t)),iconClass:p.a.mapTypeToClass(t),resourceType:p.a.mapTypeToName(t),editSvg:c.a.getSvg(c.b.Edit),trashSvg:c.a.getSvg(c.b.Delete)}}}])&&b(t.prototype,n),r&&b(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(r.a.Component),C=n(3),P=n(120),S=n(153),E=n(207);function T(e){return(T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function x(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function R(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function j(e,t,n){return t&&R(e.prototype,t),n&&R(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function N(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_(e,t)}function _(e,t){return(_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function I(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=D(e);if(t){var o=D(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return L(this,n)}}function L(e,t){if(t&&("object"===T(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function D(e){return(D=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"b",(function(){return V})),n.d(t,"a",(function(){return U}));var V=function(e){N(n,e);var t=I(n);function n(e){return x(this,n),t.call(this,e)}return j(n,[{key:"name",get:function(){return"VideoResourcesComponentCollection"}},{key:"className",get:function(){return"mt-3"}},{key:"lang",get:function(){return"libraryEditor.videoResources"}},{key:"childView",get:function(){return O}},{key:"childViewOptions",get:function(){var e=this;return{editable:this.options.editable,videoId:this.options.videoId,analyticsOptions:this.options.analyticsOptions,onClickDelete:function(t){return e.onClickDelete(t)},getEditAppLink:function(t){return{application:P.a.LIBRARY_EDITOR,action:S.a.LibraryEditor.EDIT_RESOURCE,args:[e.options.videoId,t]}}}}},{key:"onClickDelete",value:function(e){var t=this;new E.a({title:C.a.getPhrase(this.lang,"removeHeading"),text:C.a.getPhrase(this.lang,"removeBody",{resourceName:e.get("name")}),buttons:[{text:C.a.getPhrase(this.lang,"remove"),className:"btn btn-danger",success:!0},{text:C.a.getPhrase(this.lang,"cancel"),className:"btn btn-secondary",close:!0}],channelName:"".concat(this.name).concat(this.cid)}).render().done((function(){o.Radio.channel(t.options.channelName).trigger("delete:resource",e.get("id"))}))}}]),n}(r.a.ComponentCollection),U=function(e){N(n,e);var t=I(n);function n(e){return x(this,n),t.call(this,e)}return j(n,[{key:"name",get:function(){return"VideoResourcesComponent"}},{key:"template",get:function(){return a.a}},{key:"lang",get:function(){return"libraryEditor.videoResources"}},{key:"channelName",get:function(){return"".concat(this.name).concat(this.cid)}},{key:"className",get:function(){return this.options.customCollection?"":"py-3 border-top"}},{key:"regions",value:function(){return{resources:{replaceElement:!0,el:".resource-list-region"}}}},{key:"renderResources",value:function(){var e=new V({collection:this.options.customCollection||this.model.resources,editable:this.options.editable||!1,videoId:this.options.videoId||this.model.get("id"),channelName:this.options.parentChannelName||this.channelName});this.showChildView("resources",e)}},{key:"viewOptions",value:function(){return{resourcesHeadingText:this.options.headerText||C.a.getPhrase(this.lang,"heading"),emptyStateText:this.options.emptyStateText}}},{key:"onRender",value:function(){this.renderResources()}}]),n}(r.a.Component)},1135:function(e,t,n){"use strict";var r,o=n(3),i=n(16),a=n(62);function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}!function(e){e.Pdf="pdf",e.Image="image",e.PowerPoint="powerpoint",e.Document="document",e.Excel="excel",e.Zip="archive",e.File="text"}(r||(r={})),n.d(t,"a",(function(){return u}));var l="shared.shared-utils",u={mapRatingToClass:function(e){if(!e)return"";return function(e){switch(!0){case e<32:return"bg-purple";case e<48:return"bg-green";case e<80:return"bg-info";case e<96:return"bg-red";case e<128:return"bg-pink";case e>=128:return"bg-yellow";default:return""}}(e)},mapSourceToDisplayName:function(e){switch(e.type){case a.a.HostedLibrary:case a.a.CustomLibrary:return e.name;case a.a.Exchange:return o.a.getPhrase(l,"exchange");case a.a.Workspace:return o.a.getPhrase(l,"workspace");default:return""}},mapSourceToClass:function(e){switch(e){case a.a.HostedLibrary:case a.a.CustomLibrary:return"bg-info";case a.a.Exchange:return"bg-green";case a.a.Workspace:default:return"bg-red"}},isInteractive:function(e){var t,n;return!!(null===(n=null===(t=null==e?void 0:e.interactives)||void 0===t?void 0:t.data)||void 0===n?void 0:n.length)},mapTypeToSvg:function(e){var t,n=(s(t={},r.Pdf,i.b.FilePDF),s(t,r.Image,i.b.FileImg),s(t,r.PowerPoint,i.b.FilePowerpoint),s(t,r.Document,i.b.FileWord),s(t,r.Excel,i.b.FileExcel),s(t,r.Zip,i.b.FileZip),s(t,r.File,i.b.File),t)[e];return n||(n=i.b.Folder),n},mapTypeToClass:function(e){switch(e){case r.Pdf:return"icon-red";case r.Image:return"icon-purple";case r.Document:return"icon-blue";case r.Excel:return"icon-green";case r.PowerPoint:return"icon-orange";case r.Zip:return"icon-teal";case r.File:return"icon-gray";default:return""}},mapTypeToExtension:function(e){if(!e)return"";return{pdf:"pdf",image:"png",powerpoint:"pptx"}[e.toLowerCase()]},mapTypeToName:function(e){if(!e)return"";switch(e){case r.Pdf:return o.a.getPhrase(l,"pdf");case r.Image:return o.a.getPhrase(l,"image");case r.Document:return o.a.getPhrase(l,"document");case r.Excel:return o.a.getPhrase(l,"spreadsheet");case r.PowerPoint:return o.a.getPhrase(l,"presentation");case r.Zip:return o.a.getPhrase(l,"zipArchive");case r.File:return o.a.getPhrase(l,"file");default:return""}}}},1147:function(e,t,n){var r=n(10);e.exports=(r.default||r).template({1:function(e,t,n,r,o){var i;e.propertyIsEnumerable;return"<p>"+e.escapeExpression(e.lambda(null!=(i=null!=t?t.options:t)?i.emptyStateText:i,t))+"</p>"},compiler:[8,">= 4.3.0"],main:function(e,t,n,r,o){var i;e.propertyIsEnumerable;return"<h5>"+e.escapeExpression(e.lambda(null!=(i=null!=t?t.options:t)?i.resourcesHeadingText:i,t))+"</h5>\r\n"+(null!=(i=n.if.call(null!=t?t:e.nullContext||{},null!=(i=null!=t?t.options:t)?i.emptyStateText:i,{name:"if",hash:{},fn:e.program(1,o,0),inverse:e.noop,data:o}))?i:"")+'\r\n<div class="resource-list-region"></div>'},useData:!0})},1148:function(e,t,n){var r=n(10);e.exports=(r.default||r).template({1:function(e,t,n,r,o){e.propertyIsEnumerable;var i,a=e.lambda;return'<a class="float-right svg-container cursor-pointer text-muted delete">'+(null!=(i=a(null!=(i=null!=t?t.options:t)?i.trashSvg:i,t))?i:"")+'</a>\r\n<a class="float-right svg-container cursor-pointer text-muted edit">'+(null!=(i=a(null!=(i=null!=t?t.options:t)?i.editSvg:i,t))?i:"")+"</a>\r\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,r,o){e.propertyIsEnumerable;var i,a,s=e.lambda,l=e.escapeExpression,u=null!=t?t:e.nullContext||{},c=e.hooks.helperMissing;return'<span title="'+l(s(null!=(i=null!=t?t.options:t)?i.resourceType:i,t))+'" class="d-inline-block align-middle mr-2 svg-container '+l(s(null!=(i=null!=t?t.options:t)?i.iconClass:i,t))+'">'+(null!=(i=s(null!=(i=null!=t?t.options:t)?i.svg:i,t))?i:"")+'</span>\r\n<a href="'+l("function"==typeof(a=null!=(a=n.url||(null!=t?t.url:t))?a:c)?a.call(u,{name:"url",hash:{},data:o}):a)+"?name="+l("function"==typeof(a=null!=(a=n.name||(null!=t?t.name:t))?a:c)?a.call(u,{name:"name",hash:{},data:o}):a)+'" class="align-middle">\r\n '+l("function"==typeof(a=null!=(a=n.name||(null!=t?t.name:t))?a:c)?a.call(u,{name:"name",hash:{},data:o}):a)+"\r\n</a>\r\n"+(null!=(i=n.if.call(u,null!=(i=null!=t?t.options:t)?i.editable:i,{name:"if",hash:{},fn:e.program(1,o,0),inverse:e.noop,data:o}))?i:"")},useData:!0})},1149:function(e,t,n){e.exports={container:"f6lVD"}},1154:function(e,t,n){var r=n(10);e.exports=(r.default||r).template({1:function(e,t,n,r,o){e.propertyIsEnumerable;var i,a=e.lambda,s=e.escapeExpression;return'<a class="float-right '+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svgContainer:i,t))+" "+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.actionSvg:i,t))+' text-muted delete">'+(null!=(i=a(null!=(i=null!=t?t.options:t)?i.trashSvg:i,t))?i:"")+'</a>\r\n<a class="float-right '+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svgContainer:i,t))+" "+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.actionSvg:i,t))+' text-muted edit">'+(null!=(i=a(null!=(i=null!=t?t.options:t)?i.editSvg:i,t))?i:"")+"</a>\r\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,r,o){e.propertyIsEnumerable;var i,a,s=e.lambda,l=e.escapeExpression,u=null!=t?t:e.nullContext||{},c=e.hooks.helperMissing;return'<span class="d-inline-block align-middle mr-2 icon-blue '+l(s(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svgContainer:i,t))+'">'+(null!=(i=s(null!=(i=null!=t?t.options:t)?i.linkSvg:i,t))?i:"")+'</span>\r\n<a href="'+l("function"==typeof(a=null!=(a=n.url||(null!=t?t.url:t))?a:c)?a.call(u,{name:"url",hash:{},data:o}):a)+'" target="_blank" class="align-middle">\r\n '+l("function"==typeof(a=null!=(a=n.name||(null!=t?t.name:t))?a:c)?a.call(u,{name:"name",hash:{},data:o}):a)+"\r\n</a>\r\n"+(null!=(i=n.if.call(u,null!=(i=null!=t?t.options:t)?i.editable:i,{name:"if",hash:{},fn:e.program(1,o,0),inverse:e.noop,data:o}))?i:"")},useData:!0})},1155:function(e,t,n){e.exports={container:"_3Qewt",svgContainer:"_3T40U",actionSvg:"_3FRzz"}},1156:function(e,t,n){var r=n(10);e.exports=(r.default||r).template({1:function(e,t,n,r,o){var i;e.propertyIsEnumerable;return"<p>"+e.escapeExpression(e.lambda(null!=(i=null!=t?t.options:t)?i.emptyStateText:i,t))+"</p>"},compiler:[8,">= 4.3.0"],main:function(e,t,n,r,o){var i;e.propertyIsEnumerable;return"<h5>"+e.escapeExpression(e.lambda(null!=(i=null!=t?t.options:t)?i.headingText:i,t))+"</h5>\r\n"+(null!=(i=n.if.call(null!=t?t:e.nullContext||{},null!=(i=null!=t?t.options:t)?i.emptyStateText:i,{name:"if",hash:{},fn:e.program(1,o,0),inverse:e.noop,data:o}))?i:"")+'\r\n<div class="links-region"></div>'},useData:!0})},1160:function(e,t,n){var r=n(10);e.exports=(r.default||r).template({1:function(e,t,n,r,o){var i;e.propertyIsEnumerable;return e.escapeExpression(e.lambda(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.disabled:i,t))},3:function(e,t,n,r,o){return"autofocus"},5:function(e,t,n,r,o){return"disabled"},compiler:[8,">= 4.3.0"],main:function(e,t,n,r,o){e.propertyIsEnumerable;var i,a=e.lambda,s=e.escapeExpression,l=null!=t?t:e.nullContext||{};return'<input\r\n name="'+s(a(null!=(i=null!=t?t.options:t)?i.inputName:i,t))+'"\r\n type="text"\r\n class="form-control '+(null!=(i=n.unless.call(l,null!=(i=null!=t?t.options:t)?i.editable:i,{name:"unless",hash:{},fn:e.program(1,o,0),inverse:e.noop,data:o}))?i:"")+" "+s(a(null!=(i=null!=t?t.options:t)?i.additionalClasses:i,t))+'"\r\n id="'+s(a(null!=(i=null!=t?t.options:t)?i.inputId:i,t))+'"\r\n autocomplete="off"\r\n placeholder="'+s(a(null!=(i=null!=t?t.options:t)?i.placeholderText:i,t))+'"\r\n '+(null!=(i=n.if.call(l,null!=(i=null!=t?t.options:t)?i.autofocus:i,{name:"if",hash:{},fn:e.program(3,o,0),inverse:e.noop,data:o}))?i:"")+"\r\n "+(null!=(i=n.unless.call(l,null!=(i=null!=t?t.options:t)?i.editable:i,{name:"unless",hash:{},fn:e.program(5,o,0),inverse:e.noop,data:o}))?i:"")+'\r\n></input>\r\n<span class="svg-container mb-2 '+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svg:i,t))+' remove" style="display: none;">'+(null!=(i=a(null!=(i=null!=t?t.options:t)?i.svgRemove:i,t))?i:"")+"</span>"},useData:!0})},1161:function(e,t,n){e.exports={svg:"_1iL3O",typeaheadContainer:"_1SWXc",disabled:"_3C2O8"}},1162:function(e,t,n){"use strict";n.d(t,"a",(function(){return v}));var r=n(2),o=n(265),i=n(12),a=n(3),s=n(306),l=n(200),u=n(1163),c=n.n(u),p=n(1164),f=n.n(p);function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function h(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function y(e,t){return(y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=g(e);if(t){var o=g(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return b(this,n)}}function b(e,t){if(t&&("object"===d(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var v=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&y(e,t)}(d,e);var t,n,u,p=m(d);function d(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,d),p.call(this,e)}return t=d,(n=[{key:"initialize",value:function(){this.spinnerModel=new r.a.Model({showSpinner:this.isProcessing()}),this.listenTo(this.options.channelName,l.LibraryEditorActions.MergeChapters,this.onClickMergeChapters)}},{key:"name",get:function(){return"ConcatenateRequestComponent"}},{key:"template",get:function(){return c.a}},{key:"lang",get:function(){return"libraryEditor.concatenateRequest"}},{key:"className",get:function(){return"mt-3"}},{key:"regions",value:function(){return{button:{el:".btn-region",replaceElement:!0}}}},{key:"onClickMergeChapters",value:function(){this.spinnerModel.set(o.c.ShowSpinner,!0),this.render()}},{key:"isProcessing",value:function(){return!(!this.model||!this.model.get("status")||this.model.get("status")!==s.a.New&&this.model.get("status")!==s.a.Concatenating)}},{key:"renderButton",value:function(){var e={chapters:a.a.getPhrase(this.lang,"mergeChapters"),subtitles:a.a.getPhrase(this.lang,"mergeChapters"),clickViewSubtitles:a.a.getPhrase(this.lang,"enabledCustomSubtitles")},t=new o.a({buttonText:e[this.options.type],extraButtonClass:"btn-primary ".concat(f.a.btn),model:this.spinnerModel,spinnerOptions:{size:i.s.Small,type:i.t.Light,extraClasses:"mx-auto"},channelName:this.options.channelName,saveEvent:l.LibraryEditorActions.MergeChapters});this.showChildView("button",t)}},{key:"viewOptions",value:function(){var e={chapters:{heading:a.a.getPhrase(this.lang,"chaptersHeading"),line1:a.a.getPhrase(this.lang,"chaptersInfo1"),line2:a.a.getPhrase(this.lang,"chaptersInfo2")},subtitles:{heading:a.a.getPhrase(this.lang,"subtitlesHeading"),line1:a.a.getPhrase(this.lang,"subtitlesInfo1"),line2:a.a.getPhrase(this.lang,"subtitlesInfo2")},clickViewSubtitles:{heading:a.a.getPhrase(this.lang,"cvSubtitlesHeading"),line1:a.a.getPhrase(this.lang,"cvSubtitlesInfo1"),line2:a.a.getPhrase(this.lang,"cvSubtitlesInfo2")}};return{progress:this.model&&this.model.get("progress")&&a.a.getPhrase(this.lang,"progress",{progress:this.model.get("progress")}),componentOptions:e[this.options.type],processing:this.spinnerModel.get(o.c.ShowSpinner),failed:this.model&&this.model.get("status")&&this.model.get("status")===s.a.ConcatenationFailed}}},{key:"onRender",value:function(){this.renderButton()}}])&&h(t.prototype,n),u&&h(t,u),Object.defineProperty(t,"prototype",{writable:!1}),d}(r.a.Component)},1163:function(e,t,n){var r=n(10);e.exports=(r.default||r).template({1:function(e,t,n,r,o){var i;e.propertyIsEnumerable;return null!=(i=n.if.call(null!=t?t:e.nullContext||{},null!=(i=null!=t?t.options:t)?i.progress:i,{name:"if",hash:{},fn:e.program(2,o,0),inverse:e.noop,data:o}))?i:""},2:function(e,t,n,r,o){e.propertyIsEnumerable;var i,a=e.escapeExpression;return' <span class="m-3 text-muted">'+a(e.lambda(null!=(i=null!=t?t.options:t)?i.progress:i,t))+'</span>\r\n <p class="pt-2">'+a((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"processing",{name:"lang",hash:{},data:o}))+"</p>\r\n"},4:function(e,t,n,r,o){var i;e.propertyIsEnumerable;return null!=(i=n.if.call(null!=t?t:e.nullContext||{},null!=(i=null!=t?t.options:t)?i.failed:i,{name:"if",hash:{},fn:e.program(5,o,0),inverse:e.noop,data:o}))?i:""},5:function(e,t,n,r,o){e.propertyIsEnumerable;return'<p class="pt-2 text-danger">'+e.escapeExpression((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"failed",{name:"lang",hash:{},data:o}))+"</p>\r\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,r,o){e.propertyIsEnumerable;var i,a=e.lambda,s=e.escapeExpression;return"<h4>"+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.componentOptions:i)?i.heading:i,t))+"</h4>\r\n<p>"+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.componentOptions:i)?i.line1:i,t))+"</p>\r\n<p>"+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.componentOptions:i)?i.line2:i,t))+'</p>\r\n<div class="btn-region"></div>\r\n'+(null!=(i=n.if.call(null!=t?t:e.nullContext||{},null!=(i=null!=t?t.options:t)?i.processing:i,{name:"if",hash:{},fn:e.program(1,o,0),inverse:e.program(4,o,0),data:o}))?i:"")},useData:!0})},1164:function(e,t,n){e.exports={btn:"_59zg9"}},1200:function(e,t,n){"use strict";var r=n(2),o=n(6),i=n(16),a=n(4),s=n(42),l=n(12),u=n(0),c=n(1154),p=n.n(c),f=n(1155),d=n.n(f),h=n(3);function y(e){return(y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function m(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function b(e,t){return(b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function g(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=k(e);if(t){var o=k(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return v(this,n)}}function v(e,t){if(t&&("object"===y(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function k(e){return(k=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var w=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&b(e,t)}(f,e);var t,n,r,c=g(f);function f(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,f),c.call(this,e)}return t=f,(n=[{key:"name",get:function(){return"LinkItemComponent"}},{key:"template",get:function(){return p.a}},{key:"className",get:function(){return"".concat(d.a.container," rounded p-2 mb-2")}},{key:"lang",get:function(){return"libraryEditor.editLinks"}},{key:"events",value:function(){return{"click .delete":"onClickDelete","click .edit":"onClickEdit"}}},{key:"appLinks",get:function(){return{".edit":{application:u.b.LIBRARY_EDITOR,action:u.a.LibraryEditor.EDIT_LINK,args:[this.options.videoId,this.model.get("id")]}}}},{key:"onClickEdit",value:function(){var e=s.a.mergeOptions(this.options.analyticsOptions,{actionType:a.UserAction.Edit,entity:a.EntityType.Resource,workflowPhase:a.WorkflowPhase.Start}),t={id:this.model.get("id"),parentId:+this.options.videoId};s.a.logUserAction(t,e)}},{key:"onClickDelete",value:function(){var e=this;new l.d({title:h.a.getPhrase(this.lang,"removeHeading"),text:h.a.getPhrase(this.lang,"removeConfirm",{name:l.w.escapeExpression(this.model.get("name"))}),buttons:[{text:h.a.getPhrase(this.lang,"remove"),className:"btn btn-danger",success:!0},{text:h.a.getPhrase(this.lang,"cancel"),className:"btn btn-secondary",close:!0}],channelName:l.k.generateUniqueChannelName(this)}).render().done((function(){o.Radio.channel(e.options.channelName).trigger("delete:link",e.model.get("id"))}))}},{key:"viewOptions",value:function(){return{styles:d.a,editable:this.options.editable,linkSvg:i.a.getSvg(i.b.Link),editSvg:i.a.getSvg(i.b.Edit),trashSvg:i.a.getSvg(i.b.Delete)}}}])&&m(t.prototype,n),r&&m(t,r),Object.defineProperty(t,"prototype",{writable:!1}),f}(r.a.Component),O=n(1156),C=n.n(O);function P(e){return(P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function S(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function E(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function T(e,t,n){return t&&E(e.prototype,t),n&&E(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function x(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&R(e,t)}function R(e,t){return(R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function j(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=_(e);if(t){var o=_(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return N(this,n)}}function N(e,t){if(t&&("object"===P(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function _(e){return(_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"a",(function(){return I}));var I=function(e){x(n,e);var t=j(n);function n(e){return S(this,n),t.call(this,e)}return T(n,[{key:"name",get:function(){return"VideoLinksComponent"}},{key:"template",get:function(){return C.a}},{key:"className",get:function(){return this.options.customCollection?"":"py-3 border-top"}},{key:"regions",value:function(){return{links:{el:".links-region",replaceElement:!0}}}},{key:"viewOptions",value:function(){return this.options}},{key:"onRender",value:function(){this.showChildView("links",new L({collection:this.options.customCollection||this.model.get("links"),channelName:this.options.channelName,analyticsOptions:this.options.analyticsOptions,editable:this.options.editable,videoId:this.options.videoId,headingText:this.options.headingText,emptyStateText:this.options.emptyStateText}))}}]),n}(r.a.Component),L=function(e){x(n,e);var t=j(n);function n(e){return S(this,n),t.call(this,e)}return T(n,[{key:"name",get:function(){return"LinkItemComponentCollection"}},{key:"childViewOptions",get:function(){return this.options}},{key:"childView",get:function(){return w}}]),n}(r.a.ComponentCollection)},1294:function(e,t,n){e.exports={fileDrop:"_3-Sp5",dropMask:"TuDHp",dragOver:"_3Dz1H"}},1295:function(e,t,n){var r=n(10);e.exports=(r.default||r).template({compiler:[8,">= 4.3.0"],main:function(e,t,n,r,o){e.propertyIsEnumerable;var i,a,s=e.escapeExpression;return'<div class="'+s("function"==typeof(a=null!=(a=n.dropMask||(null!=t?t.dropMask:t))?a:e.hooks.helperMissing)?a.call(null!=t?t:e.nullContext||{},{name:"dropMask",hash:{},data:o}):a)+'">\r\n <h3>'+s(e.lambda(null!=(i=null!=t?t.options:t)?i.fileDropText:i,t))+"</h3>\r\n</div>"},useData:!0})},1296:function(e,t,n){var r=n(10);e.exports=(r.default||r).template({1:function(e,t,n,r,o){var i;e.propertyIsEnumerable;return'<p class="alert alert-warning mb-0">'+e.escapeExpression(e.lambda(null!=(i=null!=t?t.options:t)?i.limitText:i,t))+"</p>\r\n"},3:function(e,t,n,r,o){e.propertyIsEnumerable;var i,a=e.lambda,s=e.escapeExpression,l=null!=t?t:e.nullContext||{};return'<div class="file-drop '+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.fileDrop:i,t))+" p-2"+(null!=(i=n.if.call(l,null!=(i=null!=t?t.options:t)?i.limitText:i,{name:"if",hash:{},fn:e.program(4,o,0),inverse:e.noop,data:o}))?i:"")+'">\r\n <button class="browse btn btn-light mr-2">'+s((n.lang||t&&t.lang||e.hooks.helperMissing).call(l,"browse",{name:"lang",hash:{},data:o}))+'</button>\r\n <span class="text-muted align-middle">'+s(a(null!=(i=null!=t?t.options:t)?i.alternateText:i,t))+"</span>\r\n</div>\r\n"},4:function(e,t,n,r,o){return" col-6 "},compiler:[8,">= 4.3.0"],main:function(e,t,n,r,o){e.propertyIsEnumerable;var i,a=e.lambda;return"<h5>"+e.escapeExpression(a(null!=(i=null!=t?t.options:t)?i.title:i,t))+"</h5>\r\n<p>"+(null!=(i=a(null!=(i=null!=t?t.options:t)?i.description:i,t))?i:"")+"</p>\r\n"+(null!=(i=n.if.call(null!=t?t:e.nullContext||{},null!=(i=null!=t?t.options:t)?i.limitText:i,{name:"if",hash:{},fn:e.program(1,o,0),inverse:e.program(3,o,0),data:o}))?i:"")},useData:!0})},1297:function(e,t,n){var r=n(10);e.exports=(r.default||r).template({1:function(e,t,n,r,o){e.propertyIsEnumerable;var i,a=e.lambda;return'<span class="d-inline-block align-middle mr-2 '+e.escapeExpression(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svgContainer:i,t))+' float-right text-success">'+(null!=(i=a(null!=(i=null!=t?t.options:t)?i.tickSvg:i,t))?i:"")+"</span>\r\n"},3:function(e,t,n,r,o){var i;e.propertyIsEnumerable;return'<span class="d-inline-block align-middle mr-2 '+e.escapeExpression(e.lambda(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svgContainer:i,t))+' cursor-pointer cancel-upload close float-right">×</span>\r\n'},compiler:[8,">= 4.3.0"],main:function(e,t,n,r,o){e.propertyIsEnumerable;var i,a,s=e.lambda,l=e.escapeExpression,u=null!=t?t:e.nullContext||{},c=e.hooks.helperMissing;return'<span class="d-inline-block align-middle mr-2 '+l(s(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svgContainer:i,t))+'">'+(null!=(i=s(null!=(i=null!=t?t.options:t)?i.svg:i,t))?i:"")+'</span>\r\n<span class="align-middle">\r\n '+l("function"==typeof(a=null!=(a=n.name||(null!=t?t.name:t))?a:c)?a.call(u,{name:"name",hash:{},data:o}):a)+"\r\n</span>\r\n"+(null!=(i=n.if.call(u,null!=(i=null!=t?t.options:t)?i.finished:i,{name:"if",hash:{},fn:e.program(1,o,0),inverse:e.program(3,o,0),data:o}))?i:"")+'\r\n<div class="progress my-2 '+l(s(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.progress:i,t))+' mt-2">\r\n <div class="progress-bar bg-info" style="width: '+l("function"==typeof(a=null!=(a=n.progress||(null!=t?t.progress:t))?a:c)?a.call(u,{name:"progress",hash:{},data:o}):a)+'%" aria-valuenow="'+l("function"==typeof(a=null!=(a=n.progress||(null!=t?t.progress:t))?a:c)?a.call(u,{name:"progress",hash:{},data:o}):a)+'" aria-valuemin="0" aria-valuemax="100"></div>\r\n</div>'},useData:!0})},1298:function(e,t,n){e.exports={svgContainer:"QNFLR",progress:"_1q_ig"}},1299:function(e,t,n){var r=n(10);e.exports=(r.default||r).template({compiler:[8,">= 4.3.0"],main:function(e,t,n,r,o){e.propertyIsEnumerable;return'<form>\r\n <div class="form-group">\r\n <label for="language">'+e.escapeExpression((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"label",{name:"lang",hash:{},data:o}))+'</label>\r\n <div class="typahead-region"></div>\r\n </div>\r\n</form>'},useData:!0})},1300:function(e,t,n){var r=n(10);e.exports=(r.default||r).template({1:function(e,t,n,r,o){e.propertyIsEnumerable;var i,a=e.lambda,s=e.escapeExpression;return'<a class="float-right '+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svgContainer:i,t))+" "+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.actionSvg:i,t))+' text-muted delete">'+(null!=(i=a(null!=(i=null!=t?t.options:t)?i.trashSvg:i,t))?i:"")+"</a>\r\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,r,o){e.propertyIsEnumerable;var i,a,s=e.lambda,l=e.escapeExpression,u=null!=t?t:e.nullContext||{};return'<span class="d-inline-block align-middle mr-2 '+l(s(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svgContainer:i,t))+'">'+(null!=(i=s(null!=(i=null!=t?t.options:t)?i.svg:i,t))?i:"")+'</span>\r\n<a href="'+l("function"==typeof(a=null!=(a=n.url||(null!=t?t.url:t))?a:e.hooks.helperMissing)?a.call(u,{name:"url",hash:{},data:o}):a)+"?name="+l(s(null!=(i=null!=t?t.options:t)?i.name:i,t))+'" class="align-middle">\r\n '+l(s(null!=(i=null!=t?t.options:t)?i.name:i,t))+"\r\n</a>\r\n"+(null!=(i=n.unless.call(u,null!=(i=null!=t?t.options:t)?i.isClickViewContent:i,{name:"unless",hash:{},fn:e.program(1,o,0),inverse:e.noop,data:o}))?i:"")},useData:!0})},1301:function(e,t,n){e.exports={container:"_2GdEa",svgContainer:"_186X3",actionSvg:"_3_l1b"}},1302:function(e,t,n){var r=n(10);e.exports=(r.default||r).template({1:function(e,t,n,r,o){var i;e.propertyIsEnumerable;return e.escapeExpression(e.lambda(null!=(i=null!=t?t.options:t)?i.emptyStateText:i,t))},compiler:[8,">= 4.3.0"],main:function(e,t,n,r,o){var i;e.propertyIsEnumerable;return"<h5>"+e.escapeExpression(e.lambda(null!=(i=null!=t?t.options:t)?i.headerText:i,t))+"</h5>\r\n"+(null!=(i=n.if.call(null!=t?t:e.nullContext||{},null!=(i=null!=t?t.options:t)?i.emptyStateText:i,{name:"if",hash:{},fn:e.program(1,o,0),inverse:e.noop,data:o}))?i:"")+'\r\n<div class="subtitles-list-region"></div>'},useData:!0})},1303:function(e,t,n){var r=n(10);e.exports=(r.default||r).template({1:function(e,t,n,r,o){var i;e.propertyIsEnumerable;return'<p class="alert alert-warning col-8">'+e.escapeExpression((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"limit",{name:"lang",hash:{limit:null!=(i=null!=t?t.options:t)?i.limit:i},data:o}))+"</p>\r\n"},3:function(e,t,n,r,o){e.propertyIsEnumerable;var i=null!=t?t:e.nullContext||{},a=e.hooks.helperMissing,s=e.escapeExpression;return"<p>"+s((n.lang||t&&t.lang||a).call(i,"subheading",{name:"lang",hash:{},data:o}))+'</p>\r\n<div class="form-group mb-1">\r\n <label for="url">'+s((n.lang||t&&t.lang||a).call(i,"urlLabel",{name:"lang",hash:{},data:o}))+'</label>\r\n <input name="url" id="url" class="form-control" type="text" placeholder="'+s((n.lang||t&&t.lang||a).call(i,"urlPlaceholder",{name:"lang",hash:{},data:o}))+'">\r\n <div class="form-feedback"></div>\r\n</div>\r\n<div class="form-group mb-1" id="name-container" style="display: none;">\r\n <input type="text" class="form-control" name="name" placeholder="'+s((n.lang||t&&t.lang||a).call(i,"namePlaceholder",{name:"lang",hash:{},data:o}))+'">\r\n <div class="form-feedback"></div>\r\n</div>\r\n<div class="attach-btn-region"></div>\r\n'},compiler:[8,">= 4.3.0"],main:function(e,t,n,r,o){var i;e.propertyIsEnumerable;return'<h5 class="pt-2">Resource Links</h5>\r\n'+(null!=(i=n.if.call(null!=t?t:e.nullContext||{},null!=(i=null!=t?t.options:t)?i.hide:i,{name:"if",hash:{},fn:e.program(1,o,0),inverse:e.program(3,o,0),data:o}))?i:"")},useData:!0})},1304:function(e,t,n){var r=n(10);e.exports=(r.default||r).template({1:function(e,t,n,r,o){return"col-5"},compiler:[8,">= 4.3.0"],main:function(e,t,n,r,o){e.propertyIsEnumerable;var i,a=null!=t?t:e.nullContext||{};return'<div class="tab-region"></div>\r\n\r\n<div class="row py-3">\r\n <div class="'+(null!=(i=n.if.call(a,null!=(i=null!=t?t.options:t)?i.isClickViewContent:i,{name:"if",hash:{},fn:e.program(1,o,0),inverse:e.noop,data:o}))?i:"")+'">\r\n <div class="clickview-subtitles-list-region"></div>\r\n </div>\r\n <div class="col-7">\r\n <div class="subtitles-upload-region"></div>\r\n <div class="subtitles-upload-list-region p-0 col-8"></div>\r\n <div class="customer-subtitles-list-region p-0 col-8"></div>\r\n </div>\r\n</div>\r\n\r\n<div class="row border-top py-3">\r\n <div class="'+(null!=(i=n.if.call(a,null!=(i=null!=t?t.options:t)?i.isClickViewContent:i,{name:"if",hash:{},fn:e.program(1,o,0),inverse:e.noop,data:o}))?i:"")+'">\r\n <div class="clickview-resources-list-region"></div>\r\n </div>\r\n <div class="col-7">\r\n <div class="resources-upload-region"></div>\r\n <div class="resources-upload-list-region p-0 col-8"></div>\r\n <div class="customer-resources-list-region p-0 col-8"></div>\r\n </div>\r\n</div>\r\n\r\n<div class="row border-top py-3">\r\n <div class="'+(null!=(i=n.if.call(a,null!=(i=null!=t?t.options:t)?i.isClickViewContent:i,{name:"if",hash:{},fn:e.program(1,o,0),inverse:e.noop,data:o}))?i:"")+'">\r\n <div class="clickview-link-list-region"></div>\r\n </div>\r\n <div class="col-7">\r\n <div class="add-links-region mb-2"></div>\r\n <div class="customer-link-list-region p-0 col-8"></div>\r\n </div>\r\n</div>'},useData:!0})},1472:function(e,t,n){"use strict";n.r(t);var r=n(1),o=n(6),i=n(2),a=n(5),s=n(3),l=n(15),u=n(121),c=n(325),p=n(45),f=n(189),d=n(317),h=n(700),y=n(1294),m=n.n(y),b=n(1295),g=n.n(b),v=n(1296),k=n.n(v);function w(e){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function O(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function C(e,t){return(C=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function P(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=E(e);if(t){var o=E(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return S(this,n)}}function S(e,t){if(t&&("object"===w(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function E(e){return(E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var T=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&C(e,t)}(i,e);var t,n,r,o=P(i);function i(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),o.call(this,e)}return t=i,(n=[{key:"name",get:function(){return"FileSelectComponent"}},{key:"template",get:function(){return k.a}},{key:"lang",get:function(){return"shared._fileSelect"}},{key:"elements",get:function(){return{dropArea:".file-drop"}}},{key:"defaults",get:function(){return{acceptMultiple:!0}}},{key:"behaviors",get:function(){return[{behaviorClass:d.a,buttonSelector:".browse",channelName:this.options.channelName,acceptMultiple:this.options.acceptMultiple,mimeType:this.options.mimeType},{behaviorClass:h.a,channelName:this.options.channelName,acceptMultiple:this.options.acceptMultiple}]}},{key:"events",value:function(){var e,t,n,r="dragleave .".concat(m.a.dropMask);return n="onDragLeave",(t=r)in(e={"drop .file-drop":"onDrop","dragover .file-drop":"onDragOver"})?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},{key:"onDrop",value:function(){this.$el.removeClass(m.a.dragOver)}},{key:"onDragOver",value:function(e){this.$el.addClass(m.a.dragOver),e.preventDefault()}},{key:"onDragLeave",value:function(){this.$el.removeClass(m.a.dragOver)}},{key:"viewOptions",value:function(){return Object.assign(Object.assign({},this.options),{styles:m.a,limitText:this.options.limitText,isClickViewContent:this.options.isClickViewContent})}},{key:"onRender",value:function(){this.getUI("dropArea").append(g()({dropMask:m.a.dropMask,fileDropText:s.a.getPhrase(this.lang,"drop")}))}}])&&O(t.prototype,n),r&&O(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(i.a.Component),x=n(0),R=n(12),j=n(185),N=n(9),_=n(305),I=n(145),L=n(1134),D=n(1162),V=n(16),U=n(1297),B=n.n(U),F=n(1298),M=n.n(F),A=n(111);function q(e){return(q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function H(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function z(e,t){return(z=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function J(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Y(e);if(t){var o=Y(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return W(this,n)}}function W(e,t){if(t&&("object"===q(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Y(e){return(Y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Z=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&z(e,t)}(i,e);var t,n,r,o=J(i);function i(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),o.call(this,e)}return t=i,(n=[{key:"initialize",value:function(){this.listenTo(this.model,"change:progress",this.render)}},{key:"name",get:function(){return"FileUploadComponent"}},{key:"template",get:function(){return B.a}},{key:"events",value:function(){return{"click .cancel-upload":"onClickCancelUpload"}}},{key:"onClickCancelUpload",value:function(){A.a.isFunction(this.options.onClickCancelUpload)&&this.options.onClickCancelUpload(this.model.get("id"))}},{key:"viewOptions",value:function(){return{styles:M.a,svg:V.a.getSvg(V.b.Folder),tickSvg:V.a.getSvg(V.b.Check),finished:this.model.get("progress")>=100}}}])&&H(t.prototype,n),r&&H(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(i.a.Component);function Q(e){return(Q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function X(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function G(e,t){return(G=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function K(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=te(e);if(t){var o=te(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return ee(this,n)}}function ee(e,t){if(t&&("object"===Q(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function te(e){return(te=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ne=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&G(e,t)}(a,e);var t,n,r,i=K(a);function a(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.call(this,e)}return t=a,(n=[{key:"name",get:function(){return"FileUploadsComponentCollection"}},{key:"childView",get:function(){return Z}},{key:"childViewOptions",get:function(){var e=this;return{onClickCancelUpload:function(t){o.Radio.channel(e.options.channelName).trigger("cancel:upload",t)}}}}])&&X(t.prototype,n),r&&X(t,r),Object.defineProperty(t,"prototype",{writable:!1}),a}(i.a.ComponentCollection),re=n(30),oe=n(1112),ie=n(140),ae={handleQuery:function(){return function(e,t){var n=[];if(e){var o=CVLanguages.getEnglishNameContains(e);return r.each(o,(function(e,t){n.push({key:t,name:e.englishName})})),t(n)}t()}},getTypeaheadConfig:function(){return function(){return{name:"languages",source:ae.handleQuery(),limit:5,display:function(e){return e.name},templates:{suggestion:ie.d,pending:ie.b,notFound:ie.c}}}}},se=n(1299),le=n.n(se);function ue(e){return(ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ce(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function pe(e,t){return(pe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function fe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=he(e);if(t){var o=he(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return de(this,n)}}function de(e,t){if(t&&("object"===ue(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function he(e){return(he=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ye=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&pe(e,t)}(i,e);var t,n,r,o=fe(i);function i(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),o.call(this,e)}return t=i,(n=[{key:"initialize",value:function(e){this.model=re.a.get("subtitle:language",e.defaultLanguage),this.model.addValidation(R.u),this.listenTo(this.channelName,"select:language",this.onLanguageSelected)}},{key:"template",get:function(){return le.a}},{key:"name",get:function(){return"LanguageSelectComponent"}},{key:"lang",get:function(){return"libraryEditor.languageSelect"}},{key:"events",value:function(){return{"click .submit":"onClickSubmit",submit:"onClickSubmit"}}},{key:"behaviors",get:function(){return[{behaviorClass:_.e,title:s.a.getPhrase(this.lang,"heading"),buttons:[{text:s.a.getPhrase(this.lang,"submit"),type:"submit",className:"btn btn-primary submit"}]},{behaviorClass:_.a}]}},{key:"regions",value:function(){return{typeahead:".typahead-region"}}},{key:"channelName",get:function(){return"".concat(this.name).concat(this.cid)}},{key:"getTypeaheadConfigs",value:function(){return[{name:"languages",typeaheadConfig:ae.getTypeaheadConfig()}]}},{key:"renderTypeahead",value:function(){this.showChildView("typeahead",new oe.a({model:this.model,parentChannelName:this.channelName,inputId:"language",selectEvent:"select:language",typeaheadConfigs:this.getTypeaheadConfigs()}))}},{key:"onLanguageSelected",value:function(e){this.model.set("code",e.key)}},{key:"onClickSubmit",value:function(){this.model.validate(),this.model.isValid()&&(this.options.promise.resolve(this.model.toJSON()),this.triggerMethod("hide"))}},{key:"onBeforeDestroy",value:function(){"pending"===this.options.promise.state()&&this.options.promise.reject()}},{key:"onRender",value:function(){this.renderTypeahead()}}])&&ce(t.prototype,n),r&&ce(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(i.a.Component),me=n(1118),be=n(1135),ge=function(e,t){var n,r,o=e.language;return r=(null==t?void 0:t.filter((function(e){return e.language!==o}))).length>0?CVLanguages.getFullEnglishName(o):CVLanguages.getEnglishName(o),(null===(n=e.metadata)||void 0===n?void 0:n.autoGenerated)?s.a.getPhrase("shared.shared-utils","autoGeneratedSubtitle",{name:r}):r},ve=n(1300),ke=n.n(ve),we=n(1301),Oe=n.n(we);function Ce(e){return(Ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Pe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Se(e,t){return(Se=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Ee(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=xe(e);if(t){var o=xe(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Te(this,n)}}function Te(e,t){if(t&&("object"===Ce(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function xe(e){return(xe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Re=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Se(e,t)}(i,e);var t,n,r,o=Ee(i);function i(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),o.call(this,e)}return t=i,(n=[{key:"name",get:function(){return"SubtitleItemComponent"}},{key:"template",get:function(){return ke.a}},{key:"className",get:function(){return"".concat(Oe.a.container," rounded p-2 mb-2")}},{key:"events",value:function(){return{"click .delete":"onClickDelete"}}},{key:"getEnglishName",value:function(){return ge(this.model.toJSON(),this.model.collection.toJSON())}},{key:"onClickDelete",value:function(){!this.options.isClickViewContent&&A.a.isFunction(this.options.onClickDelete)&&this.options.onClickDelete(this.model)}},{key:"viewOptions",value:function(){return{styles:Oe.a,svg:V.a.getSvg(be.a.mapTypeToSvg("subtitle")),trashSvg:V.a.getSvg(V.b.Delete),name:this.getEnglishName(),isClickViewContent:this.options.isClickViewContent}}}])&&Pe(t.prototype,n),r&&Pe(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(i.a.Component),je=n(207),Ne=n(1302),_e=n.n(Ne);function Ie(e){return(Ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Le(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function De(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ve(e,t,n){return t&&De(e.prototype,t),n&&De(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ue(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Be(e,t)}function Be(e,t){return(Be=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Fe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ae(e);if(t){var o=Ae(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Me(this,n)}}function Me(e,t){if(t&&("object"===Ie(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Ae(e){return(Ae=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var qe=function(e){Ue(n,e);var t=Fe(n);function n(e){return Le(this,n),t.call(this,e)}return Ve(n,[{key:"name",get:function(){return"VideoSubtitlesComponent"}},{key:"template",get:function(){return _e.a}},{key:"regions",value:function(){return{subtitles:{el:".subtitles-list-region",replaceElement:!0}}}},{key:"viewOptions",value:function(){return{headerText:this.options.headerText,emptyStateText:this.options.emptyStateText}}},{key:"onRender",value:function(){this.showChildView("subtitles",new He({collection:this.collection,channelName:this.options.channelName,isClickViewContent:this.options.isClickViewContent}))}}]),n}(i.a.Component),He=function(e){Ue(n,e);var t=Fe(n);function n(e){return Le(this,n),t.call(this,e)}return Ve(n,[{key:"name",get:function(){return"VideoSubtitlesComponentCollection"}},{key:"lang",get:function(){return"libraryEditor.videoSubtitles"}},{key:"childView",get:function(){return Re}},{key:"childViewOptions",get:function(){var e=this;return{isClickViewContent:this.options.isClickViewContent,onClickDelete:function(t){return e.onClickDelete(t)}}}},{key:"onClickDelete",value:function(e){var t=this;this.options.isClickViewContent||new je.a({title:s.a.getPhrase(this.lang,"removeHeading"),text:s.a.getPhrase(this.lang,"removeBody",{language:this.getEnglishName(e)}),buttons:[{text:s.a.getPhrase(this.lang,"remove"),className:"btn btn-danger",success:!0},{text:s.a.getPhrase(this.lang,"cancel"),className:"btn btn-secondary",close:!0}],channelName:"".concat(this.name).concat(this.cid)}).render().done((function(){o.Radio.channel(t.options.channelName).trigger("delete:subtitle",e.get("id"))}))}},{key:"getEnglishName",value:function(e){return ge(e.toJSON(),e.collection.toJSON())}}]),n}(i.a.ComponentCollection),ze=n(265),Je=n(1051),We=n(1303),Ye=n.n(We);function Ze(e){return(Ze="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Qe(e,t){return(Qe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Xe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ke(e);if(t){var o=Ke(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ge(this,n)}}function Ge(e,t){if(t&&("object"===Ze(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Ke(e){return(Ke=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var et=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Qe(e,t)}(a,e);var t,n,r,i=Xe(a);function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).showNameField=!1,t.disableBtn=!0,t}return t=a,(n=[{key:"initialize",value:function(){this.model=re.a.get(this.viewModelName),this.model.addValidation(Je.c),this.bindListeners()}},{key:"name",get:function(){return"AddLinksComponent"}},{key:"template",get:function(){return Ye.a}},{key:"lang",get:function(){return"libraryEditor.addLinks"}},{key:"tagName",get:function(){return"form"}},{key:"bindings",get:function(){return{"[name=url]":{observe:"url",setOptions:{validate:!0}},"[name=name]":{observe:"name",setOptions:{validate:!0}}}}},{key:"regions",value:function(){return{attachBtn:".attach-btn-region"}}},{key:"behaviors",get:function(){return[{behaviorClass:_.f},{behaviorClass:_.a}]}},{key:"elements",get:function(){return{nameField:"#name-container"}}},{key:"viewModelName",get:function(){return"".concat(this.name,":").concat(this.cid)}},{key:"bindListeners",value:function(){this.listenTo(this.model,"change:url",this.onChangeUrl),this.listenTo(this.model,"change:name",this.onChangeName),this.listenTo(this.options.channelName,"attach:link",this.onClickAttach)}},{key:"onChangeUrl",value:function(){this.showNameField&&!this.model.isValid("url")?(this.getUI("nameField").hide(),this.model.set("name",""),this.showNameField=!1):!this.showNameField&&this.model.isValid("url")&&(this.getUI("nameField").show(),this.showNameField=!0)}},{key:"onChangeName",value:function(){this.model.validate("name"),this.disableBtn=!this.model.isValid(),this.renderAttachButton()}},{key:"onClickAttach",value:function(){var e=this.model.toJSON();this.model.clear(),o.Radio.channel(this.options.channelName).trigger("add:link",e),this.render()}},{key:"renderAttachButton",value:function(){this.options.hide||this.showChildView("attachBtn",new ze.a({saveEvent:"attach:link",channelName:this.options.channelName,buttonText:s.a.getPhrase(this.lang,"attach"),extraButtonClass:"btn-light attach",disabled:this.disableBtn,buttonType:"submit",spinnerOptions:{size:R.s.Medium,type:R.t.Light,extraClasses:"mx-auto"}}))}},{key:"viewOptions",value:function(){return{limit:this.options.limit,hide:this.options.hide}}},{key:"onRender",value:function(){this.renderAttachButton(),this.stickit(),o.Validation.bind(this)}},{key:"onClose",value:function(){this.unstickit(),o.Validation.unbind(this)}}])&&$e(t.prototype,n),r&&$e(t,r),Object.defineProperty(t,"prototype",{writable:!1}),a}(i.a.Component),tt=n(1200),nt=n(37);function rt(e){return(rt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ot(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function it(e,t){return(it=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function at(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=lt(e);if(t){var o=lt(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return st(this,n)}}function st(e,t){if(t&&("object"===rt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function lt(e){return(lt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ut="shared.errors.tooManyResources",ct=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&it(e,t)}(i,e);var t,n,r,o=at(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=o.call(this,"Cannot add that many resources")).resourceLimit=e,t}return t=i,(n=[{key:"name",get:function(){return"TooManyResourcesError"}},{key:"dialogOptions",get:function(){return{title:s.a.getPhrase(ut,"heading"),text:s.a.getPhrase(ut,"body",{resourceLimit:this.resourceLimit}),buttons:[{text:s.a.getPhrase(ut,"okay"),className:"btn btn-primary",success:!0}]}}}])&&ot(t.prototype,n),r&&ot(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(nt.a);function pt(e){return(pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ft(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function dt(e,t){return(dt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function ht(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=mt(e);if(t){var o=mt(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return yt(this,n)}}function yt(e,t){if(t&&("object"===pt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function mt(e){return(mt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var bt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&dt(e,t)}(i,e);var t,n,r,o=ht(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=o.call(this,"Cannot add that many subtitles")).subtileLimit=e,t}return t=i,(n=[{key:"name",get:function(){return"TooManySubtitlesError"}},{key:"dialogOptions",get:function(){return{title:s.a.getPhrase("shared.errors.tooManySubtitles","heading"),text:s.a.getPhrase("shared.errors.tooManySubtitles","body",{subtitleLimit:this.subtileLimit}),buttons:[{text:s.a.getPhrase("shared.errors.tooManySubtitles","okay"),className:"btn btn-primary",success:!0}]}}}])&&ft(t.prototype,n),r&&ft(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(nt.a),gt=n(206),vt=n(200),kt=n(306),wt=n(266),Ot=n(4),Ct=n(42),Pt=n(1304),St=n.n(Pt);function Et(e){return(Et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Tt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function xt(e,t){return(xt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Rt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Nt(e);if(t){var o=Nt(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return jt(this,n)}}function jt(e,t){if(t&&("object"===Et(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Nt(e){return(Nt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"EditResourcesView",(function(){return _t}));var _t=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xt(e,t)}(y,e);var t,n,d,h=Rt(y);function y(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,y),h.call(this,e)}return t=y,(n=[{key:"initialize",value:function(){this.initializeUploadServices(),this.bindDataListeners(),this.bindViewListeners(),this.bindFileSelectListeners(),R.v.initBackButton(),this.chapterDataService=a.a.getInstance(x.g.Chapter,this),this.videoDataService=a.a.getInstance(x.g.Video,this),this.linkDataService=a.a.getInstance(x.g.Link,this),this.resourceDataService=a.a.getInstance(x.g.Resource,this),this.subtitleDataService=a.a.getInstance(x.g.Subtitle,this),this.resourceUploads=[],this.resourceUploadCount=0}},{key:"name",get:function(){return"EditResourcesView"}},{key:"lang",get:function(){return"libraryEditor.editResources"}},{key:"title",get:function(){return this.model&&this.model.get("name")||"Edit Resources"}},{key:"template",get:function(){return St.a}},{key:"props",get:function(){return["videoDataService"]}},{key:"className",get:function(){return"bg-white p-3"}},{key:"channelName",get:function(){return R.k.generateUniqueChannelName(this)}},{key:"behaviors",get:function(){return[{behaviorClass:_.d}]}},{key:"requiredResources",get:function(){return{currentUser:I.b.currentUser}}},{key:"initializeUploadServices",value:function(){this.resourceUploadService=new c.b,this.listenTo(x.w.RESOURCE_UPLOAD,p.a.UPLOAD_COMPLETE,this.onResourceUploadComplete),this.subtitleUploadService=new c.c,this.listenTo(x.w.SUBTITLE_UPLOAD,p.a.UPLOAD_COMPLETE,this.onSubtitleUploadComplete)}},{key:"bindDataListeners",value:function(){this.listenTo(x.e.VIDEO,"".concat(x.f.VIDEOS,":").concat(this.options.videoId,":sync"),this.render),this.listenTo(x.e.VIDEO,"".concat(x.f.VIDEOS,":").concat(this.options.videoId,":error"),this.onVideoDataError),this.listenTo(x.e.VIDEO,"".concat(x.f.VIDEO_HAS_PHYSICAL_CHAPTERS,":").concat(this.options.videoId,":sync"),this.render),this.listenTo(x.e.CHAPTER,"".concat(x.f.CONCATENATE_STATUS,":").concat(this.options.videoId,":error"),this.onConcatenateDataError)}},{key:"bindViewListeners",value:function(){this.listenTo(this.channelName,"add:link",this.onAddLink),this.listenTo(this.channelName,"delete:subtitle",this.onDeleteSubtitle),this.listenTo(this.channelName,"delete:resource",this.onDeleteResource),this.listenTo(this.channelName,"delete:link",this.onDeleteLink),this.listenTo(this.channelName,"cancel:upload",this.onCancelUpload),this.listenTo(this.channelName,vt.LibraryEditorActions.MergeChapters,this.onMergeChapters)}},{key:"bindFileSelectListeners",value:function(){this.listenTo(this.getSubtitleSelectChannelName(),p.a.FILES_SELECTED,this.onSubtitleFilesAdded),this.listenTo(this.getResourceSelectChannelName(),p.a.FILES_SELECTED,this.onResourceFilesAdded)}},{key:"getSubtitleSelectChannelName",value:function(){return"".concat(this.name).concat(this.cid,"subtitles")}},{key:"getResourceSelectChannelName",value:function(){return"".concat(this.name).concat(this.cid,"resources")}},{key:"onVideoDataError",value:function(e){switch(e.type){case u.a.NotFound:i.a.ErrorHelper.throw(new gt.l);break;case u.a.Forbidden:i.a.ErrorHelper.throw(new gt.f)}}},{key:"onConcatenateDataError",value:function(e){e.type===u.a.NotFound&&(this.concatenateRequestNotFound=!0,this.render())}},{key:"onSubtitleFilesAdded",value:function(e,t){e.length>5-this.model.subtitles.length?i.a.ErrorHelper.throw(new bt(5)):(t&&(this.interactionType=t),this.subtitleUploadService.addFiles(e))}},{key:"onResourceFilesAdded",value:function(e,t){e.length>25-this.model.resources.length?i.a.ErrorHelper.throw(new ct(25)):(this.resourceUploadCount+=e.length,t&&(this.interactionType=t),this.resourceUploadService.addFiles(e))}},{key:"onAddLink",value:function(e){var t=this;25!==this.model.links.length&&(this.model.links.length+1===25&&this.renderAddLinks(!0),this.linkDataService.addLink(this.model.get("id"),e,(function(e){t.model.links.add(e),t.render()})))}},{key:"regions",value:function(){return{tabs:{el:".tab-region",partialLoading:N.h.EditVideoTabs},subtitlesUpload:{el:".subtitles-upload-region",partialLoading:N.h.EditVideoUploadArea},subtitlesUploadList:".subtitles-upload-list-region",customerSubtitlesList:".customer-subtitles-list-region",clickViewSubtitlesList:".clickview-subtitles-list-region",resourcesUpload:{el:".resources-upload-region",partialLoading:N.h.EditVideoUploadArea},resourcesUploadList:".resources-upload-list-region",customerResourcesList:".customer-resources-list-region",clickViewResourcesList:".clickview-resources-list-region",addLinks:{el:".add-links-region",partialLoading:N.h.EditVideoUploadArea},customerLinkList:".customer-link-list-region",clickViewLinkList:".clickview-link-list-region"}}},{key:"startPollingConcatenation",value:function(){if(this.concatenateRequest){var e=[kt.a.SingleFile,kt.a.ConcatenationFailed];r.contains(e,this.concatenateRequest.get("status"))||this.pollConcatenation()}}},{key:"pollConcatenation",value:function(){var e=this;this.isDestroyed()||this.chapterDataService.getConcatenateRequest(this.options.videoId,(function(t){if(e.concatenateRequest=t,e.concatenateRequest.get("status")!==kt.a.SingleFile)return setTimeout((function(){return e.pollConcatenation()}),5e3),void e.renderConcatenationRequest();e.videoDataService.clearPhysicialChaptersCache(),e.videoDataService.hasPhysicalChapters(e.options.videoId,(function(t){e.hasPhysicalChapters=t,e.renderSubtitleFileSelect()}))}))}},{key:"onDeleteResource",value:function(e){var t=this;this.resourceDataService.deleteResource(this.options.videoId,e,(function(){t.logDeleteAction(Ot.EntityType.Resource,e),t.render()}))}},{key:"onDeleteSubtitle",value:function(e){var t=this;this.subtitleDataService.deleteSubtitle(this.options.videoId,e,(function(){t.logDeleteAction(Ot.EntityType.Subtitle,e),t.render()}))}},{key:"onDeleteLink",value:function(e){var t=this;this.linkDataService.deleteLink(this.options.videoId,e,(function(){t.logDeleteAction(Ot.EntityType.Link,e),t.render()}))}},{key:"onCancelUpload",value:function(e){this.resourceUploadService.cancelUpload(e),this.subtitleUploadService.cancelUpload(e)}},{key:"onResourceUploadComplete",value:function(e){var t=this,n=e.toJSON(),r={fileId:n.fileInfo.id,uploadId:n.file.cvUpload.uploadId,name:n.fileInfo.name,type:f.a.getResourceType(n.fileInfo.extension),extension:n.fileInfo.extension,fileSize:n.fileInfo.size,fileUrl:n.fileInfo.url,ingestUrl:n.file.cvUpload.ingestUrl,metaData:{type:f.a.getResourceType(n.fileInfo.extension)},contribution:!1,url:n.fileInfo.url,fileIdType:2};this.resourceUploads.push(r),this.resourceUploadCount--,this.resourceUploadCount>0||(this.resourceDataService.addResource(this.options.videoId,this.resourceUploads,(function(e){t.model.resources.add(e);var n=t.resourceUploadService.getCollection().filter((function(t){return t.get("fileInfo").id===e.get("fileId")}));t.resourceUploadService.getCollection().remove(n),t.logUploadAction(e),t.render()})),this.resourceUploads=[])}},{key:"onSubtitleUploadComplete",value:function(e){var t=this,n=$.Deferred(),r=new ye({defaultLanguage:{code:"en",name:"English"},promise:n});n.done((function(n){var r=e.toJSON(),o={fileId:r.fileInfo.id,name:n.name,language:n.code,type:f.a.getResourceType(r.fileInfo.extension),fileIdType:2};t.subtitleDataService.addSubtitle(t.options.videoId,o,(function(n){t.model.subtitles.add(n),t.subtitleUploadService.getCollection().remove(e),t.logUploadAction(n),t.render()}))})).fail((function(){t.subtitleUploadService.cancelUpload(e.get("id"))})),o.Radio.channel(l.a.POPUP).trigger(i.a.EventNames.SHOW_POPUP,r)}},{key:"logUploadAction",value:function(e){var t=e instanceof j.a?Ot.EntityType.Resource:Ot.EntityType.Subtitle,n=Ct.a.mapInteractionType(this.interactionType),r={location:Ot.LocationContext.EditVideoResources,actionType:Ot.UserAction.Upload,entity:t,descriptor:n};Ct.a.logUserAction(e,r)}},{key:"logDeleteAction",value:function(e,t){var n={location:Ot.LocationContext.EditVideoResources,actionType:Ot.UserAction.Delete,entity:e},r={id:t,parentId:+this.options.videoId};Ct.a.logUserAction(r,n)}},{key:"onMergeChapters",value:function(){var e=this;this.chapterDataService.addConcatenateRequest(this.options.videoId,(function(){e.pollConcatenation()}))}},{key:"renderTabs",value:function(){var e=!R.j.canEditVideo(this.model);this.showChildView("tabs",new me.a({tabs:R.v.getEditVideoTabs(this.options.videoId,{hideChaptersTab:e}),activeTab:".edit-resources-subtitles-applink",goBackTab:R.v.getBackButton(this.options.videoId)}))}},{key:"renderSubtitleFileSelect",value:function(){if(this.hasPhysicalChapters.get("value"))this.renderConcatenationRequest();else{var e=s.a.getPhrase(this.lang,"subtitlesLimit",{limit:5});this.showChildView("subtitlesUpload",new T({title:this.isClickViewContent?s.a.getPhrase(this.lang,"customerSubtitles"):s.a.getPhrase(this.lang,"subtitles"),description:s.a.getPhrase(this.lang,"subtitlesInfo"),alternateText:s.a.getPhrase(this.lang,"subtitlesAlternative"),mimeType:f.b.SUBTITLES,channelName:this.getSubtitleSelectChannelName(),acceptMultiple:!1,limitText:this.model.subtitles.length>=5?e:null,isClickViewContent:this.isClickViewContent}))}}},{key:"renderSubtitleUploadList",value:function(){var e=this.subtitleUploadService.getCollection();this.showChildView("subtitlesUploadList",new ne({collection:e,channelName:this.channelName}))}},{key:"renderSubtitlesLists",value:function(){this.renderClickViewSubtitlesList(),this.renderCustomerSubtitlesList()}},{key:"renderClickViewSubtitlesList",value:function(){if(this.isClickViewContent){var e=R.j.filterObjectsByOwnerType(this.model.subtitles,wt.a.ClickView);this.showChildView("clickViewSubtitlesList",new qe({collection:e,channelName:this.channelName,isClickViewContent:!0,headerText:s.a.getPhrase(this.lang,"clickViewSubtitles"),emptyStateText:e.models.length?"":s.a.getPhrase(this.lang,"clickViewSubtitlesEmpty")}))}}},{key:"renderCustomerSubtitlesList",value:function(){this.showChildView("customerSubtitlesList",new qe({collection:R.j.filterObjectsByOwnerType(this.model.subtitles,wt.a.Customer,this.currentUser.get("customerId")),channelName:this.channelName}))}},{key:"renderConcatenationRequest",value:function(){this.isRendered()&&this.showChildView("subtitlesUpload",new D.a({type:this.isClickViewContent?"clickViewSubtitles":"subtitles",channelName:this.channelName,model:this.concatenateRequest}))}},{key:"renderResourcesFileSelect",value:function(){var e=s.a.getPhrase(this.lang,"resourcesLimit",{limit:25});this.showChildView("resourcesUpload",new T({title:this.isClickViewContent?s.a.getPhrase(this.lang,"customerResources"):s.a.getPhrase(this.lang,"resources"),description:s.a.getPhrase(this.lang,"resourcesDescription"),alternateText:s.a.getPhrase(this.lang,"resourcesAlternative"),mimeType:f.b.RESOURCES,channelName:this.getResourceSelectChannelName(),limitText:this.model.resources.length>=25?e:null,isClickViewContent:this.isClickViewContent}))}},{key:"renderResourcesUploadList",value:function(){var e=this.resourceUploadService.getCollection();this.showChildView("resourcesUploadList",new ne({collection:e,channelName:this.channelName}))}},{key:"renderResourcesLists",value:function(){this.renderClickViewResourcesList(),this.renderCustomerResourcesList()}},{key:"renderClickViewResourcesList",value:function(){if(this.isClickViewContent){var e=R.j.filterObjectsByOwnerType(this.model.resources,wt.a.ClickView);this.showChildView("clickViewResourcesList",new L.a({model:this.model,customCollection:e,editable:!1,videoId:this.options.videoId,parentChannelName:this.channelName,headerText:s.a.getPhrase(this.lang,"clickViewResources"),emptyStateText:e.models.length?"":s.a.getPhrase(this.lang,"clickViewResourcesEmpty"),analyticsOptions:{location:Ot.LocationContext.EditVideoResources}}))}}},{key:"renderCustomerResourcesList",value:function(){this.showChildView("customerResourcesList",new L.b({collection:R.j.filterObjectsByOwnerType(this.model.resources,wt.a.Customer,this.currentUser.get("customerId")),editable:!0,videoId:this.options.videoId,channelName:this.channelName,analyticsOptions:{location:Ot.LocationContext.EditVideoResources}}))}},{key:"renderAddLinks",value:function(e){this.showChildView("addLinks",new et({collection:this.model.get("links"),channelName:this.channelName,hide:e||25===this.model.get("links").length,limit:25}))}},{key:"renderLinkLists",value:function(){var e={channelName:this.channelName,analyticsOptions:{location:Ot.LocationContext.EditVideoResources},videoId:this.options.videoId};this.renderClickViewLinkList(e),this.renderCustomerLinkList(e)}},{key:"renderClickViewLinkList",value:function(e){if(this.isClickViewContent){var t=R.j.filterObjectsByOwnerType(this.model.links,wt.a.ClickView);this.showChildView("clickViewLinkList",new tt.a(Object.assign(Object.assign({},e),{headingText:"Resource Links by ClickView",emptyStateText:t.models.length?"":"There are no ClickView links for this video",customCollection:t,editable:!1})))}}},{key:"renderCustomerLinkList",value:function(e){this.showChildView("customerLinkList",new tt.a(Object.assign(Object.assign({},e),{customCollection:R.j.filterObjectsByOwnerType(this.model.links,wt.a.Customer,this.currentUser.get("customerId")),editable:!0})))}},{key:"fetchData",value:function(){var e=this;this.model=this.videoDataService.getVideo(this.options.videoId),this.hasPhysicalChapters=this.videoDataService.hasPhysicalChapters(this.options.videoId),this.isClickViewContent=this.model&&!R.j.canEditVideo(this.model),this.hasPhysicalChapters&&this.hasPhysicalChapters.get("value")&&!this.getConcatenateRequestSent&&(this.chapterDataService.getConcatenateRequest(this.options.videoId,(function(t){e.concatenateRequest=t,e.render()})),this.getConcatenateRequestSent=!0)}},{key:"shouldRender",value:function(){return!(!this.model||!this.hasPhysicalChapters||this.hasPhysicalChapters.get("value")&&!this.concatenateRequest&&!this.concatenateRequestNotFound)}},{key:"onBeforeRender",value:function(){return this.fetchData(),this.shouldRender()}},{key:"viewOptions",value:function(){return{isClickViewContent:this.isClickViewContent}}},{key:"onRender",value:function(){this.renderTabs(),this.renderSubtitleFileSelect(),this.renderSubtitleUploadList(),this.renderSubtitlesLists(),this.renderResourcesFileSelect(),this.renderResourcesUploadList(),this.renderResourcesLists(),this.renderAddLinks(),this.renderLinkLists(),this.startPollingConcatenation()}},{key:"onDestroy",value:function(){this.subtitleUploadService.destroy(),this.resourceUploadService.destroy()}}])&&Tt(t.prototype,n),d&&Tt(t,d),Object.defineProperty(t,"prototype",{writable:!1}),y}(i.a.View)}}]);
|
|
1
|
+
(window.webpackJsonp_clickview_library_editor=window.webpackJsonp_clickview_library_editor||[]).push([[25],{1055:function(e,t,n){"use strict";var r=n(1059),o=n(1056),i=(n(1057),n(3),n(1060)),a=(n(1062),n(1058));n.d(t,"a",(function(){return r.a})),n.d(t,"d",(function(){return o.g})),n.d(t,"g",(function(){return o.j})),n.d(t,"f",(function(){return o.i})),n.d(t,"c",(function(){return o.f})),n.d(t,"e",(function(){return o.h})),n.d(t,"b",(function(){return i.a})),n.d(t,"h",(function(){return a.a}))},1056:function(e,t,n){"use strict";n.d(t,"a",(function(){return f})),n.d(t,"k",(function(){return d})),n.d(t,"g",(function(){return m})),n.d(t,"e",(function(){return y})),n.d(t,"j",(function(){return b})),n.d(t,"i",(function(){return v})),n.d(t,"c",(function(){return w})),n.d(t,"b",(function(){return O})),n.d(t,"d",(function(){return C})),n.d(t,"f",(function(){return k})),n.d(t,"h",(function(){return g}));var r=n(2),o=n(1),i=n(19),a=n(29),s=n(3),l="libraryEditor.utils",u=["tags","thumbnail","chapters","resources","subtitles","disabled","links","restrictions","categories"];function c(e,t){if(e){var n=o.reduce(e,(function(e,n,r){var i=t[r];return n||i?o.isObject(n)&&o.isObject(i)&&!o.isUndefined(n.id)&&n.id===i.id?e:o.isArray(n)?p(n,i).length?e.concat(r):e:o.isEqual(n,i)?e:e.concat(r):e}),[]);if(n.length)return o.object(o.map(n,(function(n){return o.isArray(t[n])?[n,p(e[n],t[n])]:[n,t[n]]})))}}function p(e,t){var n=[];return o.each(t,(function(t){var r=o.findWhere(e,{id:t.id});if(!o.isUndefined(r)||0!==Object.keys(t).length){var i=o.isUndefined(r)?t:c(r,t);i&&(t.id<0&&!t.value||(!r||t.id<0?n.push(t):(i.id=t.id,n.push(i))))}})),n}var f={getChanges:function(e,t){var n=c(o.omit(e.toJSON(),u),o.omit(t.toJSON(),u));if(n)return o.object(o.map(o.keys(n),(function(e){return[e,f.formatChanges(e,n[e])]})))},formatChanges:function(e,t){if(!t)return null;if(o.isObject(t)&&o.isEmpty(t))return null;switch(e){case"name":case"description":case"productionYear":case"dateBroadcast":case"fields":case"episodeNumber":return t;case"channel":case"series":case"rating":case"season":return{id:t.id};case"distributors":case"producers":case"directors":case"productionCompanies":return o.map(t,(function(e){return e.id}));case"dateModified":case"hasBroadcast":case"seriesSort":return;default:r.a.ErrorHelper.throw(new i.a("There are no formatting settings for ".concat(e)))}},updateModelState:function(e,t,n){var i=["distributors","producers","directors","productionCompanies"];for(var a in o.each(o.keys(n),(function(e){i.includes(e)&&(n[e]=t.get(e).toJSON())})),t.set(o.clone(n),{silent:!0}),e.set(t.toJSON(),{silent:!0}),n){if(!n[a]&&e.associations[a]){var s=e.get(a);(s instanceof r.a.Model||s instanceof r.a.NestedModel)&&s.clear()}}},getRemovedObjectIds:function(e,t){var n=["distributors","productionCompanies","producers","directors"],r={};return o.each(o.keys(e.toJSON()),(function(i){if(o.contains(n,i)){var a=e.get(i).map((function(e){return e.id})),s=t.get(i).map((function(e){return e.id})),l=o.filter(a,(function(e){return e&&!o.contains(s,e)}));l.length&&(r[i]=l)}})),r}},d={name:[{required:!0,msg:function(){return s.a.getPhrase(l,"videoTitleRequired")}},{maxLength:255,msg:function(){return s.a.getPhrase(l,"videoTitleExceeds")}}],description:[{required:!1},{maxLength:16e3,msg:function(){return s.a.getPhrase(l,"videoDescriptionExceeds")}}],episodeNumber:function(e,t,n){return e&&e<1?s.a.getPhrase(l,"episodeNumberLessThanOne"):e&&e>2147483647?s.a.getPhrase(l,"episodeNumberExceeds"):e%1!=0?s.a.getPhrase(l,"episodeNumberNotWhole"):n.season&&n.season.get("number")>=0&&null===e?s.a.getPhrase(l,"episodeNumberNoSeason"):""},season:function(e,t,n){return n.season&&n.season.get("number")||e&&e.number||!n.episodeNumber?"":s.a.getPhrase(l,"seasonNoEpisodeNumber")}},h=a().year(),y={productionYear:function(e){return e||0===e?(e=+e,isNaN(e)?"Production year must be a number.":e<1900||e>h?s.a.getPhrase(l,"validProductionYears",{currentYear:h}):void 0):""}},m={name:[{required:!0,msg:function(){return s.a.getPhrase(l,"resourceNameRequired")}}]},b={suggestion:[{required:!0,msg:function(){return s.a.getPhrase(l,"suggestEditRequired")}},{maxLength:16e3,msg:function(){return s.a.getPhrase(l,"suggestEditExceeds")}}],reason:[{required:!0,msg:function(){return s.a.getPhrase(l,"suggestEditReasonRequired")}},{maxLength:16e3,msg:function(){return s.a.getPhrase(l,"suggestEditReasonExceeds")}}]},g={number:function(e){return e?+e<1?s.a.getPhrase(l,"seasonLessThanOne"):+e>3e3?s.a.getPhrase(l,"seasonExceeds"):+e%1!=0?s.a.getPhrase(l,"seasonNotWhole"):"":s.a.getPhrase(l,"seasonRequired")}},v={empty:function(){return s.a.getPhrase(l,"suggestEditRatingRequired")},original:function(){return s.a.getPhrase(l,"suggestEditRatingInvalid")}},k={url:[{required:!0,pattern:"url",msg:function(){return s.a.getPhrase(l,"linkUrlRequired")}},{maxLength:16e3,msg:function(){return s.a.getPhrase(l,"linkUrlExceeds")}}],name:[{required:!0,msg:function(){return s.a.getPhrase(l,"linkNameRequired")}},{maxLength:255,msg:function(){return s.a.getPhrase(l,"linkNameExceeds")}}]},w={name:[{maxLength:128,msg:function(){return s.a.getPhrase(l,"fieldNameExceeds")}}],value:[{maxLength:16e3,msg:function(){return s.a.getPhrase(l,"fieldValueExceeds")}}]},O={fields:function(e){return e&&e.length?e.all((function(e){return!1!==e.isValid()}))?"":s.a.getPhrase(l,"fieldsInvalid"):""}};function C(){return[{id:-1,name:"Admin Notes",value:"",placeholder:"Notes that only admins will see"}]}},1057:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(1),o=n(48),i=n(169),a=n(3),s="libraryEditor.utils",l={name:[{required:!0,msg:function(){return a.a.getPhrase(s,"folderNameRequired")}},{maxLength:255,msg:function(){return a.a.getPhrase(s,"folderNameExceeds")}}]},u=function(e,t){return{parentId:function(n){return n?o.a.calculateDestinationFolderDepth(e,n,t)>i.a.MAX_FOLDER_DEPTH?a.a.getPhrase(s,"maxFolderDepth",{maxDepth:i.a.MAX_FOLDER_DEPTH}):"":a.a.getPhrase(s,"selectParentFolder")}}},c=function(e){var t=e.validateName,n=e.validateParent,o=e.folder,i=e.collection;return t&&n?r.extend({},l,u(o,i)):t?l:n?u(o,i):void 0}},1058:function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var r=n(16),o=n(3),i=n(201),a=n(1075),s=n(62);function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var u,c="libraryEditor.utils";!function(e){e.Pdf="pdf",e.Image="image",e.PowerPoint="powerpoint",e.Document="document",e.Excel="excel",e.Zip="archive",e.File="text"}(u||(u={}));var p={mapRatingToClass:function(e){if(!e)return"";return function(e){switch(!0){case e<32:return"bg-purple";case e<48:return"bg-green";case e<80:return"bg-info";case e<96:return"bg-red";case e<128:return"bg-pink";case e>=128:return"bg-yellow";default:return""}}(e)},mapSourceToDisplayName:function(e){switch(e.get("type")){case s.a.HostedLibrary:case s.a.CustomLibrary:return e.get("name");case s.a.Exchange:return o.a.getPhrase(c,"exchange");case s.a.Workspace:return o.a.getPhrase(c,"workspace");default:return""}},mapSourceToClass:function(e){switch(e){case s.a.HostedLibrary:case s.a.CustomLibrary:return"bg-info";case s.a.Exchange:return"bg-green";case s.a.Workspace:default:return"bg-red"}},isInteractive:function(e){return!(!e||!e.interactives)&&!!e.interactives.length},mapTypeToSvg:function(e){var t,n=(l(t={},u.Pdf,r.b.FilePDF),l(t,u.Image,r.b.FileImg),l(t,u.PowerPoint,r.b.FilePowerpoint),l(t,u.Document,r.b.FileWord),l(t,u.Excel,r.b.FileExcel),l(t,u.Zip,r.b.FileZip),l(t,u.File,r.b.File),t)[e];return n||(n=r.b.Folder),r.a.getSvg(n)},mapTypeToClass:function(e){switch(e){case u.Pdf:return"icon-red";case u.Image:return"icon-purple";case u.Document:return"icon-blue";case u.Excel:return"icon-green";case u.PowerPoint:return"icon-orange";case u.Zip:return"icon-teal";case u.File:return"icon-gray";default:return""}},mapTypeToExtension:function(e){if(!e)return"";return{pdf:"pdf",image:"png",powerpoint:"pptx"}[e.toLowerCase()]},mapTypeToName:function(e){if(!e)return"";switch(e){case u.Pdf:return o.a.getPhrase(c,"pdf");case u.Image:return o.a.getPhrase(c,"image");case u.Document:return o.a.getPhrase(c,"document");case u.Excel:return o.a.getPhrase(c,"spreadsheet");case u.PowerPoint:return o.a.getPhrase(c,"presentation");case u.Zip:return o.a.getPhrase(c,"zipArchive");case u.File:return o.a.getPhrase(c,"file");default:return""}},translateMetadataCollectionNames:function(e){return new a.a(e.map((function(e){return Object.assign(Object.assign({},e.toJSON()),{name:p.translateMetadataName(e.get("name"))})})))},translateMetadataName:function(e){var t="suggestEdit";switch(e){case i.MetadataType.VideoTitle:t+="VideoTitle";break;case i.MetadataType.Description:t+="Description";break;case i.MetadataType.Rating:t+="Rating";break;case i.MetadataType.SeriesTitle:t+="SeriesTitle";break;case i.MetadataType.Season:t+="SeasonNumber";break;case i.MetadataType.EpisodeNumber:t+="EpisodeNumber";break;case i.MetadataType.BroadcastDate:t+="BroadcastDate";break;case i.MetadataType.Channel:t+="Channel";break;case i.MetadataType.ProductionYear:t+="ProductionYear";break;case i.MetadataType.Distributors:t+="Distributors";break;case i.MetadataType.ProductionCompanies:t+="ProductionCompanies";break;case i.MetadataType.Directors:t+="Directors";break;case i.MetadataType.Producers:t+="Producers";break;case i.MetadataType.Other:t+="Other"}return o.a.getPhrase(c,t)}}},1059:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(1),o=n(12),i=n(3),a="libraryEditor.utils",s={isValidChapterTime:function(e,t,n,i){if(i){if(!r.isNumber(t))return l.StartTime.Invalid();if(t<0)return l.StartTime.Invalid();if(t>o.x.millisecondsToSeconds(n))return l.StartTime.Exceeds();if(i.some((function(n){return!(n.id&&n.id===e.id||n.cid===e.cid)&&n.get("startTime")===t})))return l.StartTime.Exists()}},isValidChapterName:function(e,t,n){return t?t.length>255?l.Name.MaxLength():n.some((function(n){return!(n.id&&n.id===e.id||n.cid===e.cid)&&n.get("name").trim()===t.trim()}))?l.Name.Exists():r.isEmpty(t.trim())?l.Name.Invalid():void 0:l.Name.Invalid()},mapPhysicalChapters:function(e){var t=0;return r.map(e,(function(e,n){var r={name:e.title,startTime:t,index:n,isPhysicalChapter:!0};return t+=e.duration,r}))}},l={Name:{Invalid:function(){return i.a.getPhrase(a,"chapterNameInvalid")},Exists:function(){return i.a.getPhrase(a,"chapterNameExists")},MaxLength:function(){return i.a.getPhrase(a,"chapterNameExceeds")}},StartTime:{Invalid:function(){return i.a.getPhrase(a,"chapterStartTimeInvalid")},Exists:function(){return i.a.getPhrase(a,"chapterStartTimeExists")},Exceeds:function(){return i.a.getPhrase(a,"chapterStartTimeExceeds")}}}},1060:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(3),o="libraryEditor.utils",i={name:[{required:!0,msg:function(){return r.a.getPhrase(o,"libraryNameRequired")}},{maxLength:255,msg:function(){return r.a.getPhrase(o,"libraryNameExceeds")}}]}},1062:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(3),o=n(1056),i=r.a.encloseNamespace("libraryEditor.utils"),a={name:[{required:!0,msg:function(){return i("videoTitleRequired")}}],folderId:[{required:!0,msg:function(){return i("uploadFolderRequired")}}],libraryId:[{required:!0,msg:function(){return i("uploadLibraryRequired")}}],episodeNumber:function(e,t,n){return e&&e<1?i("episodeNumberLessThanOne"):e&&e>255?i("episodeNumberExceeds"):e&&e%1!=0?i("episodeNumberNotWhole"):n.season&&n.season.get("number")>=0&&null===e?i("episodeNumberNoSeason"):""},season:function(e,t,n){return n.season&&n.season.get("number")||e&&e.number||!n.episodeNumber?"":i("seasonNoEpisodeNumber")},productionYear:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return o.e.productionYear.apply(null,t)}}},1075:function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){return(a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function s(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=u(e);if(t){var o=u(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return l(this,n)}}function l(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"a",(function(){return c}));var c=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a(e,t)}(u,e);var t,n,r,l=s(u);function u(){return i(this,u),l.apply(this,arguments)}return t=u,n&&o(t.prototype,n),r&&o(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}(n(2).a.Collection)},1102:function(e,t,n){"use strict";n.d(t,"a",(function(){return y}));var r=n(1),o=n(2),i=n(1103),a=n.n(i),s=n(1104),l=n.n(s);function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function p(e,t){return(p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function f(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h(e);if(t){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return d(this,n)}}function d(e,t){if(t&&("object"===u(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var y=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&p(e,t)}(s,e);var t,n,o,i=f(s);function s(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),i.call(this,e)}return t=s,(n=[{key:"name",get:function(){return"TabsView"}},{key:"className",get:function(){var e="bg-white py-2 border-bottom";return this.options.className&&(e+=" ".concat(this.options.className)),e}},{key:"template",get:function(){return l.a}},{key:"appLinks",get:function(){var e={};return this.options.tabs.forEach((function(t){return e[t.link.selector]=t.link.appLink})),e}},{key:"viewOptions",value:function(){var e=this.options.tabs.map((function(e){return Object.assign(Object.assign({},e),{link:e.link.selector.replace(".","")})}));return{styles:a.a,tabs:e}}},{key:"setActiveTab",value:function(){var e=this,t=!1;if(this.options.tabs.forEach((function(n){n.active=!1,n.link.selector===e.options.activeTab&&(n.active=!0,t=!0)})),!t){var n=r.first(this.options.tabs);n&&(n.active=!0)}}},{key:"onBeforeRender",value:function(){this.setActiveTab()}}])&&c(t.prototype,n),o&&c(t,o),Object.defineProperty(t,"prototype",{writable:!1}),s}(o.a.Component)},1103:function(e,t,n){e.exports={link:"_5idZs",active:"_3Ty4M"}},1104:function(e,t,n){var r=n(10);e.exports=(r.default||r).template({1:function(e,t,n,r,o,i,a){var s;e.propertyIsEnumerable;return null!=(s=n.unless.call(null!=t?t:e.nullContext||{},null!=t?t.hide:t,{name:"unless",hash:{},fn:e.program(2,o,0,i,a),inverse:e.noop,data:o}))?s:""},2:function(e,t,n,r,o,i,a){e.propertyIsEnumerable;var s,l=e.lambda,u=e.escapeExpression;return' <a class="'+u(l(null!=(s=null!=(s=null!=a[1]?a[1].options:a[1])?s.styles:s)?s.link:s,t))+" p-2 "+u(l(null!=t?t.link:t,t))+" "+(null!=(s=n.if.call(null!=t?t:e.nullContext||{},null!=t?t.active:t,{name:"if",hash:{},fn:e.program(3,o,0,i,a),inverse:e.noop,data:o}))?s:"")+'">'+u(l(null!=t?t.name:t,t))+"</a>\r\n"},3:function(e,t,n,r,o,i,a){var s;e.propertyIsEnumerable;return e.escapeExpression(e.lambda(null!=(s=null!=(s=null!=a[1]?a[1].options:a[1])?s.styles:s)?s.active:s,t))+" border-bottom border-primary text-primary"},compiler:[8,">= 4.3.0"],main:function(e,t,n,r,o,i,a){var s;e.propertyIsEnumerable;return null!=(s=n.each.call(null!=t?t:e.nullContext||{},null!=(s=null!=t?t.options:t)?s.tabs:s,{name:"each",hash:{},fn:e.program(1,o,0,i,a),inverse:e.noop,data:o}))?s:""},useData:!0,useDepths:!0})},1116:function(e,t,n){"use strict";n.d(t,"a",(function(){return k}));var r=n(1),o=n(6),i=n(2),a=n(19),s=n(16),l=n(99),u=n(12),c=n(1164),p=n.n(c),f=n(1165),d=n.n(f);function h(e){return(h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function y(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function m(e,t){return(m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function b(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=v(e);if(t){var o=v(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return g(this,n)}}function g(e,t){if(t&&("object"===h(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var k=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&m(e,t)}(h,e);var t,n,c,f=b(h);function h(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,h),f.call(this,e)}return t=h,(n=[{key:"name",get:function(){return"SearchTypeaheadComponent"}},{key:"template",get:function(){return p.a}},{key:"className",get:function(){return"search-container ".concat(d.a.typeaheadContainer," mb-2")}},{key:"channelName",get:function(){return u.k.generateUniqueChannelName(this)}},{key:"elements",get:function(){return{input:"#".concat(this.options.inputId)}}},{key:"defaults",get:function(){return{inputId:"search-typeahead",placeholderText:"Search",stickItProperty:"name",selectEvent:"select:result",additionalClasses:"",editable:!0}}},{key:"events",value:function(){return{submit:"onSubmit","click .remove":"onClickRemove"}}},{key:"initialize",value:function(){this.model||this.options.parentChannelName||i.a.ErrorHelper.throw(new a.a("Either pass a model or a channelName to access the typeahead selection")),this.model||(this.model=new i.a.Model),this.options.inputName||(this.options.inputName=this.options.inputId),this.bindListeners()}},{key:"bindListeners",value:function(){this.options.parentChannelName&&(this.parentChannel=o.Radio.channel(this.options.parentChannelName)),this.listenTo(this.channelName,"typeahead:set:input",this.setInput),this.listenTo(this.channelName,"typeahead:clear:input",this.clearInput)}},{key:"bindings",get:function(){var e,t,n,r="[name=".concat(this.options.inputName,"]");return e={},t=r,n={observe:this.options.stickItProperty,setOptions:{validate:!0}},t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},{key:"clearInput",value:function(){this.getUI("input").typeahead("val",null)}},{key:"setInput",value:function(e){this.getUI("input").typeahead("val",e)}},{key:"onTypeaheadSelect",value:function(e,t){var n;e.preventDefault(),n="string"==typeof t?t:t.title||t.name||t.query,this.model.set(this.options.stickItProperty,n),this.parentChannel&&this.options.selectEvent&&this.parentChannel.trigger(this.options.selectEvent,t),this.onSubmit(e),this.toggleRemove()}},{key:"onSubmit",value:function(e){var t=this;if(e.preventDefault(),!this.isDestroyed()&&this.getTypeaheadActionOptions().clearOnSelect)return this.getUI("input").typeahead("close"),setTimeout((function(){t.model.clear(),t.clearInput()}),0),!1}},{key:"onClickRemove",value:function(){this.model.clear(),this.parentChannel.trigger(this.options.removeEvent,this.model),this.toggleRemove()}},{key:"getSources",value:function(){return r.isArray(this.options.typeaheadConfigs)?l.a.getSearchSources(this.options.typeaheadConfigs):l.a.getSearchSources([this.options.typeaheadConfigs])}},{key:"getTypeaheadOptions",value:function(){var e={minLength:1,highlight:!0};return this.options.typeaheadOptions?r.extend({},e,this.options.typeaheadOptions):e}},{key:"getTypeaheadActionOptions",value:function(){var e={clearOnSelect:!1};return r.isObject(this.options.actionOptions)?r.extend({},e,this.options.actionOptions):e}},{key:"bindOptionalCallbacks",value:function(){r.isObject(this.options.callbacks)&&(r.isFunction(this.options.callbacks.onRender)&&this.getUI("input").on("typeahead:render",r.bind(this.options.callbacks.onRender,this)),r.isFunction(this.options.callbacks.onInput)&&this.listenTo(this.model,"change:".concat(this.options.stickItProperty),this.options.callbacks.onInput),r.isFunction(this.options.callbacks.onBlur)&&this.getUI("input").on("blur",r.bind(this.options.callbacks.onBlur,this,this.channelName,this.options.stickItProperty)))}},{key:"initTypeahead",value:function(){this.getUI("input").typeahead(this.getTypeaheadOptions(),this.getSources())}},{key:"initTypeaheadListeners",value:function(){this.getUI("input").on("typeahead:select",r.bind(this.onTypeaheadSelect,this)),this.bindOptionalCallbacks()}},{key:"toggleRemove",value:function(){this.shouldShowRemove()?this.$el.find(".remove").show():this.$el.find(".remove").hide()}},{key:"shouldShowRemove",value:function(){return!!this.options.editable&&(!!this.options.forceShowRemoveButton||this.options.removeEvent&&!!this.model.get(this.options.stickItProperty))}},{key:"viewOptions",value:function(){return Object.assign(Object.assign({styles:d.a},this.options),{showRemove:this.shouldShowRemove(),svgRemove:s.a.getSvg(s.b.Close)})}},{key:"onRender",value:function(){var e=this;this.stickit(),this.initTypeahead(),this.initTypeaheadListeners(),o.Validation.bind(this),this.toggleRemove(),this.options.autofocus&&window.requestAnimationFrame((function(){e.getUI("input").focus()}))}},{key:"onClose",value:function(){this.getUI("input").off(),this.unstickit(),o.Validation.unbind(this)}}])&&y(t.prototype,n),c&&y(t,c),Object.defineProperty(t,"prototype",{writable:!1}),h}(i.a.Component)},1122:function(e,t,n){"use strict";n.d(t,"a",(function(){return g}));var r=n(6),o=n(2),i=n(16),a=n(1123),s=n.n(a),l=n(1124),u=n.n(l),c=n(0),p=n(1102);function f(e){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function d(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function h(e,t){return(h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=b(e);if(t){var o=b(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return m(this,n)}}function m(e,t){if(t&&("object"===f(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var g=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}(l,e);var t,n,o,a=y(l);function l(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),a.call(this,e)}return t=l,(n=[{key:"name",get:function(){return"EditVideoTabsComponent"}},{key:"className",get:function(){return"bg-white"}},{key:"regions",value:function(){return{tabs:{el:".tabs-region",replaceElement:!0}}}},{key:"template",get:function(){return u.a}},{key:"appLinks",get:function(){var e,t,n,r=this.options.goBackTab.link;return e={},t=r.selector,n=r.appLink,t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},{key:"viewOptions",value:function(){var e=Object.assign(Object.assign({},this.options.goBackTab),{link:this.options.goBackTab.link.selector.replace(".","")});return{styles:s.a,backTab:e,backArrow:i.a.getSvg(i.b.ArrowLeft)}}},{key:"onSave",value:function(){r.Radio.channel(c.b.LIBRARY_EDITOR).trigger(c.a.LibraryEditor.SAVE_VIDEO)}},{key:"onRender",value:function(){this.showChildView("tabs",new p.a({tabs:this.options.tabs,activeTab:this.options.activeTab}))}}])&&d(t.prototype,n),o&&d(t,o),Object.defineProperty(t,"prototype",{writable:!1}),l}(o.a.Component)},1123:function(e,t,n){e.exports={svgContainer:"_27gR6"}},1124:function(e,t,n){var r=n(10);e.exports=(r.default||r).template({compiler:[8,">= 4.3.0"],main:function(e,t,n,r,o){e.propertyIsEnumerable;var i,a=e.lambda,s=e.escapeExpression;return'<div class="row">\r\n <h4>\r\n <a class="d-inline-flex align-items-center '+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.link:i,t))+" "+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.backTab:i)?i.link:i,t))+'">\r\n <span class="'+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svgContainer:i,t))+' d-inline-block mx-2">'+(null!=(i=a(null!=(i=null!=t?t.options:t)?i.backArrow:i,t))?i:"")+"</span>\r\n "+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.backTab:i)?i.name:i,t))+'\r\n </a>\r\n </h4>\r\n</div>\r\n<div class="tabs-region pl-2"></div>'},useData:!0})},1138:function(e,t,n){"use strict";var r=n(2),o=n(6),i=n(1151),a=n.n(i),s=n(111),l=n(4),u=n(42),c=n(16),p=n(1139),f=n(1152),d=n.n(f),h=n(1153),y=n.n(h);function m(e){return(m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function b(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function g(e,t){return(g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function v(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=w(e);if(t){var o=w(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return k(this,n)}}function k(e,t){if(t&&("object"===m(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function w(e){return(w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var O=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&g(e,t)}(i,e);var t,n,r,o=v(i);function i(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),o.call(this,e)}return t=i,(n=[{key:"name",get:function(){return"ResourceItemComponent"}},{key:"template",get:function(){return d.a}},{key:"className",get:function(){return"".concat(y.a.container," rounded p-2 mb-2")}},{key:"events",value:function(){return{"click .delete":"onClickDelete","click .edit":"onClickEdit"}}},{key:"appLinks",get:function(){return{".edit":this.options.getEditAppLink(this.model.get("id"))}}},{key:"onClickEdit",value:function(){var e=u.a.mergeOptions(this.options.analyticsOptions,{actionType:l.UserAction.Edit,entity:l.EntityType.Resource,workflowPhase:l.WorkflowPhase.Start}),t={id:this.model.get("id"),parentId:+this.options.videoId};u.a.logUserAction(t,e)}},{key:"onClickDelete",value:function(){s.a.isFunction(this.options.onClickDelete)&&this.options.onClickDelete(this.model)}},{key:"viewOptions",value:function(){var e=this.model.get("metadata"),t=e?e.type:"";return{editable:this.options.editable,extension:p.a.mapTypeToExtension(t),svg:c.a.getSvg(p.a.mapTypeToSvg(t)),iconClass:p.a.mapTypeToClass(t),resourceType:p.a.mapTypeToName(t),editSvg:c.a.getSvg(c.b.Edit),trashSvg:c.a.getSvg(c.b.Delete)}}}])&&b(t.prototype,n),r&&b(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(r.a.Component),C=n(3),P=n(120),S=n(153),E=n(208);function T(e){return(T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function x(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function R(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function j(e,t,n){return t&&R(e.prototype,t),n&&R(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function N(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_(e,t)}function _(e,t){return(_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function I(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=D(e);if(t){var o=D(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return L(this,n)}}function L(e,t){if(t&&("object"===T(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function D(e){return(D=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"b",(function(){return V})),n.d(t,"a",(function(){return U}));var V=function(e){N(n,e);var t=I(n);function n(e){return x(this,n),t.call(this,e)}return j(n,[{key:"name",get:function(){return"VideoResourcesComponentCollection"}},{key:"className",get:function(){return"mt-3"}},{key:"lang",get:function(){return"libraryEditor.videoResources"}},{key:"childView",get:function(){return O}},{key:"childViewOptions",get:function(){var e=this;return{editable:this.options.editable,videoId:this.options.videoId,analyticsOptions:this.options.analyticsOptions,onClickDelete:function(t){return e.onClickDelete(t)},getEditAppLink:function(t){return{application:P.a.LIBRARY_EDITOR,action:S.a.LibraryEditor.EDIT_RESOURCE,args:[e.options.videoId,t]}}}}},{key:"onClickDelete",value:function(e){var t=this;new E.a({title:C.a.getPhrase(this.lang,"removeHeading"),text:C.a.getPhrase(this.lang,"removeBody",{resourceName:e.get("name")}),buttons:[{text:C.a.getPhrase(this.lang,"remove"),className:"btn btn-danger",success:!0},{text:C.a.getPhrase(this.lang,"cancel"),className:"btn btn-secondary",close:!0}],channelName:"".concat(this.name).concat(this.cid)}).render().done((function(){o.Radio.channel(t.options.channelName).trigger("delete:resource",e.get("id"))}))}}]),n}(r.a.ComponentCollection),U=function(e){N(n,e);var t=I(n);function n(e){return x(this,n),t.call(this,e)}return j(n,[{key:"name",get:function(){return"VideoResourcesComponent"}},{key:"template",get:function(){return a.a}},{key:"lang",get:function(){return"libraryEditor.videoResources"}},{key:"channelName",get:function(){return"".concat(this.name).concat(this.cid)}},{key:"className",get:function(){return this.options.customCollection?"":"py-3 border-top"}},{key:"regions",value:function(){return{resources:{replaceElement:!0,el:".resource-list-region"}}}},{key:"renderResources",value:function(){var e=new V({collection:this.options.customCollection||this.model.resources,editable:this.options.editable||!1,videoId:this.options.videoId||this.model.get("id"),channelName:this.options.parentChannelName||this.channelName});this.showChildView("resources",e)}},{key:"viewOptions",value:function(){return{resourcesHeadingText:this.options.headerText||C.a.getPhrase(this.lang,"heading"),emptyStateText:this.options.emptyStateText}}},{key:"onRender",value:function(){this.renderResources()}}]),n}(r.a.Component)},1139:function(e,t,n){"use strict";var r,o=n(3),i=n(16),a=n(62);function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}!function(e){e.Pdf="pdf",e.Image="image",e.PowerPoint="powerpoint",e.Document="document",e.Excel="excel",e.Zip="archive",e.File="text"}(r||(r={})),n.d(t,"a",(function(){return u}));var l="shared.shared-utils",u={mapRatingToClass:function(e){if(!e)return"";return function(e){switch(!0){case e<32:return"bg-purple";case e<48:return"bg-green";case e<80:return"bg-info";case e<96:return"bg-red";case e<128:return"bg-pink";case e>=128:return"bg-yellow";default:return""}}(e)},mapSourceToDisplayName:function(e){switch(e.type){case a.a.HostedLibrary:case a.a.CustomLibrary:return e.name;case a.a.Exchange:return o.a.getPhrase(l,"exchange");case a.a.Workspace:return o.a.getPhrase(l,"workspace");default:return""}},mapSourceToClass:function(e){switch(e){case a.a.HostedLibrary:case a.a.CustomLibrary:return"bg-info";case a.a.Exchange:return"bg-green";case a.a.Workspace:default:return"bg-red"}},isInteractive:function(e){var t,n;return!!(null===(n=null===(t=null==e?void 0:e.interactives)||void 0===t?void 0:t.data)||void 0===n?void 0:n.length)},mapTypeToSvg:function(e){var t,n=(s(t={},r.Pdf,i.b.FilePDF),s(t,r.Image,i.b.FileImg),s(t,r.PowerPoint,i.b.FilePowerpoint),s(t,r.Document,i.b.FileWord),s(t,r.Excel,i.b.FileExcel),s(t,r.Zip,i.b.FileZip),s(t,r.File,i.b.File),t)[e];return n||(n=i.b.Folder),n},mapTypeToClass:function(e){switch(e){case r.Pdf:return"icon-red";case r.Image:return"icon-purple";case r.Document:return"icon-blue";case r.Excel:return"icon-green";case r.PowerPoint:return"icon-orange";case r.Zip:return"icon-teal";case r.File:return"icon-gray";default:return""}},mapTypeToExtension:function(e){if(!e)return"";return{pdf:"pdf",image:"png",powerpoint:"pptx"}[e.toLowerCase()]},mapTypeToName:function(e){if(!e)return"";switch(e){case r.Pdf:return o.a.getPhrase(l,"pdf");case r.Image:return o.a.getPhrase(l,"image");case r.Document:return o.a.getPhrase(l,"document");case r.Excel:return o.a.getPhrase(l,"spreadsheet");case r.PowerPoint:return o.a.getPhrase(l,"presentation");case r.Zip:return o.a.getPhrase(l,"zipArchive");case r.File:return o.a.getPhrase(l,"file");default:return""}}}},1151:function(e,t,n){var r=n(10);e.exports=(r.default||r).template({1:function(e,t,n,r,o){var i;e.propertyIsEnumerable;return"<p>"+e.escapeExpression(e.lambda(null!=(i=null!=t?t.options:t)?i.emptyStateText:i,t))+"</p>"},compiler:[8,">= 4.3.0"],main:function(e,t,n,r,o){var i;e.propertyIsEnumerable;return"<h5>"+e.escapeExpression(e.lambda(null!=(i=null!=t?t.options:t)?i.resourcesHeadingText:i,t))+"</h5>\r\n"+(null!=(i=n.if.call(null!=t?t:e.nullContext||{},null!=(i=null!=t?t.options:t)?i.emptyStateText:i,{name:"if",hash:{},fn:e.program(1,o,0),inverse:e.noop,data:o}))?i:"")+'\r\n<div class="resource-list-region"></div>'},useData:!0})},1152:function(e,t,n){var r=n(10);e.exports=(r.default||r).template({1:function(e,t,n,r,o){e.propertyIsEnumerable;var i,a=e.lambda;return'<a class="float-right svg-container cursor-pointer text-muted delete">'+(null!=(i=a(null!=(i=null!=t?t.options:t)?i.trashSvg:i,t))?i:"")+'</a>\r\n<a class="float-right svg-container cursor-pointer text-muted edit">'+(null!=(i=a(null!=(i=null!=t?t.options:t)?i.editSvg:i,t))?i:"")+"</a>\r\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,r,o){e.propertyIsEnumerable;var i,a,s=e.lambda,l=e.escapeExpression,u=null!=t?t:e.nullContext||{},c=e.hooks.helperMissing;return'<span title="'+l(s(null!=(i=null!=t?t.options:t)?i.resourceType:i,t))+'" class="d-inline-block align-middle mr-2 svg-container '+l(s(null!=(i=null!=t?t.options:t)?i.iconClass:i,t))+'">'+(null!=(i=s(null!=(i=null!=t?t.options:t)?i.svg:i,t))?i:"")+'</span>\r\n<a href="'+l("function"==typeof(a=null!=(a=n.url||(null!=t?t.url:t))?a:c)?a.call(u,{name:"url",hash:{},data:o}):a)+"?name="+l("function"==typeof(a=null!=(a=n.name||(null!=t?t.name:t))?a:c)?a.call(u,{name:"name",hash:{},data:o}):a)+'" class="align-middle">\r\n '+l("function"==typeof(a=null!=(a=n.name||(null!=t?t.name:t))?a:c)?a.call(u,{name:"name",hash:{},data:o}):a)+"\r\n</a>\r\n"+(null!=(i=n.if.call(u,null!=(i=null!=t?t.options:t)?i.editable:i,{name:"if",hash:{},fn:e.program(1,o,0),inverse:e.noop,data:o}))?i:"")},useData:!0})},1153:function(e,t,n){e.exports={container:"f6lVD"}},1158:function(e,t,n){var r=n(10);e.exports=(r.default||r).template({1:function(e,t,n,r,o){e.propertyIsEnumerable;var i,a=e.lambda,s=e.escapeExpression;return'<a class="float-right '+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svgContainer:i,t))+" "+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.actionSvg:i,t))+' text-muted delete">'+(null!=(i=a(null!=(i=null!=t?t.options:t)?i.trashSvg:i,t))?i:"")+'</a>\r\n<a class="float-right '+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svgContainer:i,t))+" "+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.actionSvg:i,t))+' text-muted edit">'+(null!=(i=a(null!=(i=null!=t?t.options:t)?i.editSvg:i,t))?i:"")+"</a>\r\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,r,o){e.propertyIsEnumerable;var i,a,s=e.lambda,l=e.escapeExpression,u=null!=t?t:e.nullContext||{},c=e.hooks.helperMissing;return'<span class="d-inline-block align-middle mr-2 icon-blue '+l(s(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svgContainer:i,t))+'">'+(null!=(i=s(null!=(i=null!=t?t.options:t)?i.linkSvg:i,t))?i:"")+'</span>\r\n<a href="'+l("function"==typeof(a=null!=(a=n.url||(null!=t?t.url:t))?a:c)?a.call(u,{name:"url",hash:{},data:o}):a)+'" target="_blank" class="align-middle">\r\n '+l("function"==typeof(a=null!=(a=n.name||(null!=t?t.name:t))?a:c)?a.call(u,{name:"name",hash:{},data:o}):a)+"\r\n</a>\r\n"+(null!=(i=n.if.call(u,null!=(i=null!=t?t.options:t)?i.editable:i,{name:"if",hash:{},fn:e.program(1,o,0),inverse:e.noop,data:o}))?i:"")},useData:!0})},1159:function(e,t,n){e.exports={container:"_3Qewt",svgContainer:"_3T40U",actionSvg:"_3FRzz"}},1160:function(e,t,n){var r=n(10);e.exports=(r.default||r).template({1:function(e,t,n,r,o){var i;e.propertyIsEnumerable;return"<p>"+e.escapeExpression(e.lambda(null!=(i=null!=t?t.options:t)?i.emptyStateText:i,t))+"</p>"},compiler:[8,">= 4.3.0"],main:function(e,t,n,r,o){var i;e.propertyIsEnumerable;return"<h5>"+e.escapeExpression(e.lambda(null!=(i=null!=t?t.options:t)?i.headingText:i,t))+"</h5>\r\n"+(null!=(i=n.if.call(null!=t?t:e.nullContext||{},null!=(i=null!=t?t.options:t)?i.emptyStateText:i,{name:"if",hash:{},fn:e.program(1,o,0),inverse:e.noop,data:o}))?i:"")+'\r\n<div class="links-region"></div>'},useData:!0})},1164:function(e,t,n){var r=n(10);e.exports=(r.default||r).template({1:function(e,t,n,r,o){var i;e.propertyIsEnumerable;return e.escapeExpression(e.lambda(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.disabled:i,t))},3:function(e,t,n,r,o){return"autofocus"},5:function(e,t,n,r,o){return"disabled"},compiler:[8,">= 4.3.0"],main:function(e,t,n,r,o){e.propertyIsEnumerable;var i,a=e.lambda,s=e.escapeExpression,l=null!=t?t:e.nullContext||{};return'<input\r\n name="'+s(a(null!=(i=null!=t?t.options:t)?i.inputName:i,t))+'"\r\n type="text"\r\n class="form-control '+(null!=(i=n.unless.call(l,null!=(i=null!=t?t.options:t)?i.editable:i,{name:"unless",hash:{},fn:e.program(1,o,0),inverse:e.noop,data:o}))?i:"")+" "+s(a(null!=(i=null!=t?t.options:t)?i.additionalClasses:i,t))+'"\r\n id="'+s(a(null!=(i=null!=t?t.options:t)?i.inputId:i,t))+'"\r\n autocomplete="off"\r\n placeholder="'+s(a(null!=(i=null!=t?t.options:t)?i.placeholderText:i,t))+'"\r\n '+(null!=(i=n.if.call(l,null!=(i=null!=t?t.options:t)?i.autofocus:i,{name:"if",hash:{},fn:e.program(3,o,0),inverse:e.noop,data:o}))?i:"")+"\r\n "+(null!=(i=n.unless.call(l,null!=(i=null!=t?t.options:t)?i.editable:i,{name:"unless",hash:{},fn:e.program(5,o,0),inverse:e.noop,data:o}))?i:"")+'\r\n></input>\r\n<span class="svg-container mb-2 '+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svg:i,t))+' remove" style="display: none;">'+(null!=(i=a(null!=(i=null!=t?t.options:t)?i.svgRemove:i,t))?i:"")+"</span>"},useData:!0})},1165:function(e,t,n){e.exports={svg:"_1iL3O",typeaheadContainer:"_1SWXc",disabled:"_3C2O8"}},1166:function(e,t,n){"use strict";n.d(t,"a",(function(){return v}));var r=n(2),o=n(265),i=n(12),a=n(3),s=n(306),l=n(201),u=n(1167),c=n.n(u),p=n(1168),f=n.n(p);function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function h(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function y(e,t){return(y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=g(e);if(t){var o=g(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return b(this,n)}}function b(e,t){if(t&&("object"===d(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var v=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&y(e,t)}(d,e);var t,n,u,p=m(d);function d(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,d),p.call(this,e)}return t=d,(n=[{key:"initialize",value:function(){this.spinnerModel=new r.a.Model({showSpinner:this.isProcessing()}),this.listenTo(this.options.channelName,l.LibraryEditorActions.MergeChapters,this.onClickMergeChapters)}},{key:"name",get:function(){return"ConcatenateRequestComponent"}},{key:"template",get:function(){return c.a}},{key:"lang",get:function(){return"libraryEditor.concatenateRequest"}},{key:"className",get:function(){return"mt-3"}},{key:"regions",value:function(){return{button:{el:".btn-region",replaceElement:!0}}}},{key:"onClickMergeChapters",value:function(){this.spinnerModel.set(o.c.ShowSpinner,!0),this.render()}},{key:"isProcessing",value:function(){return!(!this.model||!this.model.get("status")||this.model.get("status")!==s.a.New&&this.model.get("status")!==s.a.Concatenating)}},{key:"renderButton",value:function(){var e={chapters:a.a.getPhrase(this.lang,"mergeChapters"),subtitles:a.a.getPhrase(this.lang,"mergeChapters"),clickViewSubtitles:a.a.getPhrase(this.lang,"enabledCustomSubtitles")},t=new o.a({buttonText:e[this.options.type],extraButtonClass:"btn-primary ".concat(f.a.btn),model:this.spinnerModel,spinnerOptions:{size:i.s.Small,type:i.t.Light,extraClasses:"mx-auto"},channelName:this.options.channelName,saveEvent:l.LibraryEditorActions.MergeChapters});this.showChildView("button",t)}},{key:"viewOptions",value:function(){var e={chapters:{heading:a.a.getPhrase(this.lang,"chaptersHeading"),line1:a.a.getPhrase(this.lang,"chaptersInfo1"),line2:a.a.getPhrase(this.lang,"chaptersInfo2")},subtitles:{heading:a.a.getPhrase(this.lang,"subtitlesHeading"),line1:a.a.getPhrase(this.lang,"subtitlesInfo1"),line2:a.a.getPhrase(this.lang,"subtitlesInfo2")},clickViewSubtitles:{heading:a.a.getPhrase(this.lang,"cvSubtitlesHeading"),line1:a.a.getPhrase(this.lang,"cvSubtitlesInfo1"),line2:a.a.getPhrase(this.lang,"cvSubtitlesInfo2")}};return{progress:this.model&&this.model.get("progress")&&a.a.getPhrase(this.lang,"progress",{progress:this.model.get("progress")}),componentOptions:e[this.options.type],processing:this.spinnerModel.get(o.c.ShowSpinner),failed:this.model&&this.model.get("status")&&this.model.get("status")===s.a.ConcatenationFailed}}},{key:"onRender",value:function(){this.renderButton()}}])&&h(t.prototype,n),u&&h(t,u),Object.defineProperty(t,"prototype",{writable:!1}),d}(r.a.Component)},1167:function(e,t,n){var r=n(10);e.exports=(r.default||r).template({1:function(e,t,n,r,o){var i;e.propertyIsEnumerable;return null!=(i=n.if.call(null!=t?t:e.nullContext||{},null!=(i=null!=t?t.options:t)?i.progress:i,{name:"if",hash:{},fn:e.program(2,o,0),inverse:e.noop,data:o}))?i:""},2:function(e,t,n,r,o){e.propertyIsEnumerable;var i,a=e.escapeExpression;return' <span class="m-3 text-muted">'+a(e.lambda(null!=(i=null!=t?t.options:t)?i.progress:i,t))+'</span>\r\n <p class="pt-2">'+a((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"processing",{name:"lang",hash:{},data:o}))+"</p>\r\n"},4:function(e,t,n,r,o){var i;e.propertyIsEnumerable;return null!=(i=n.if.call(null!=t?t:e.nullContext||{},null!=(i=null!=t?t.options:t)?i.failed:i,{name:"if",hash:{},fn:e.program(5,o,0),inverse:e.noop,data:o}))?i:""},5:function(e,t,n,r,o){e.propertyIsEnumerable;return'<p class="pt-2 text-danger">'+e.escapeExpression((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"failed",{name:"lang",hash:{},data:o}))+"</p>\r\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,r,o){e.propertyIsEnumerable;var i,a=e.lambda,s=e.escapeExpression;return"<h4>"+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.componentOptions:i)?i.heading:i,t))+"</h4>\r\n<p>"+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.componentOptions:i)?i.line1:i,t))+"</p>\r\n<p>"+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.componentOptions:i)?i.line2:i,t))+'</p>\r\n<div class="btn-region"></div>\r\n'+(null!=(i=n.if.call(null!=t?t:e.nullContext||{},null!=(i=null!=t?t.options:t)?i.processing:i,{name:"if",hash:{},fn:e.program(1,o,0),inverse:e.program(4,o,0),data:o}))?i:"")},useData:!0})},1168:function(e,t,n){e.exports={btn:"_59zg9"}},1204:function(e,t,n){"use strict";var r=n(2),o=n(6),i=n(16),a=n(4),s=n(42),l=n(12),u=n(0),c=n(1158),p=n.n(c),f=n(1159),d=n.n(f),h=n(3);function y(e){return(y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function m(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function b(e,t){return(b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function g(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=k(e);if(t){var o=k(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return v(this,n)}}function v(e,t){if(t&&("object"===y(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function k(e){return(k=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var w=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&b(e,t)}(f,e);var t,n,r,c=g(f);function f(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,f),c.call(this,e)}return t=f,(n=[{key:"name",get:function(){return"LinkItemComponent"}},{key:"template",get:function(){return p.a}},{key:"className",get:function(){return"".concat(d.a.container," rounded p-2 mb-2")}},{key:"lang",get:function(){return"libraryEditor.editLinks"}},{key:"events",value:function(){return{"click .delete":"onClickDelete","click .edit":"onClickEdit"}}},{key:"appLinks",get:function(){return{".edit":{application:u.b.LIBRARY_EDITOR,action:u.a.LibraryEditor.EDIT_LINK,args:[this.options.videoId,this.model.get("id")]}}}},{key:"onClickEdit",value:function(){var e=s.a.mergeOptions(this.options.analyticsOptions,{actionType:a.UserAction.Edit,entity:a.EntityType.Resource,workflowPhase:a.WorkflowPhase.Start}),t={id:this.model.get("id"),parentId:+this.options.videoId};s.a.logUserAction(t,e)}},{key:"onClickDelete",value:function(){var e=this;new l.d({title:h.a.getPhrase(this.lang,"removeHeading"),text:h.a.getPhrase(this.lang,"removeConfirm",{name:l.w.escapeExpression(this.model.get("name"))}),buttons:[{text:h.a.getPhrase(this.lang,"remove"),className:"btn btn-danger",success:!0},{text:h.a.getPhrase(this.lang,"cancel"),className:"btn btn-secondary",close:!0}],channelName:l.k.generateUniqueChannelName(this)}).render().done((function(){o.Radio.channel(e.options.channelName).trigger("delete:link",e.model.get("id"))}))}},{key:"viewOptions",value:function(){return{styles:d.a,editable:this.options.editable,linkSvg:i.a.getSvg(i.b.Link),editSvg:i.a.getSvg(i.b.Edit),trashSvg:i.a.getSvg(i.b.Delete)}}}])&&m(t.prototype,n),r&&m(t,r),Object.defineProperty(t,"prototype",{writable:!1}),f}(r.a.Component),O=n(1160),C=n.n(O);function P(e){return(P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function S(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function E(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function T(e,t,n){return t&&E(e.prototype,t),n&&E(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function x(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&R(e,t)}function R(e,t){return(R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function j(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=_(e);if(t){var o=_(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return N(this,n)}}function N(e,t){if(t&&("object"===P(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function _(e){return(_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"a",(function(){return I}));var I=function(e){x(n,e);var t=j(n);function n(e){return S(this,n),t.call(this,e)}return T(n,[{key:"name",get:function(){return"VideoLinksComponent"}},{key:"template",get:function(){return C.a}},{key:"className",get:function(){return this.options.customCollection?"":"py-3 border-top"}},{key:"regions",value:function(){return{links:{el:".links-region",replaceElement:!0}}}},{key:"viewOptions",value:function(){return this.options}},{key:"onRender",value:function(){this.showChildView("links",new L({collection:this.options.customCollection||this.model.get("links"),channelName:this.options.channelName,analyticsOptions:this.options.analyticsOptions,editable:this.options.editable,videoId:this.options.videoId,headingText:this.options.headingText,emptyStateText:this.options.emptyStateText}))}}]),n}(r.a.Component),L=function(e){x(n,e);var t=j(n);function n(e){return S(this,n),t.call(this,e)}return T(n,[{key:"name",get:function(){return"LinkItemComponentCollection"}},{key:"childViewOptions",get:function(){return this.options}},{key:"childView",get:function(){return w}}]),n}(r.a.ComponentCollection)},1298:function(e,t,n){e.exports={fileDrop:"_3-Sp5",dropMask:"TuDHp",dragOver:"_3Dz1H"}},1299:function(e,t,n){var r=n(10);e.exports=(r.default||r).template({compiler:[8,">= 4.3.0"],main:function(e,t,n,r,o){e.propertyIsEnumerable;var i,a,s=e.escapeExpression;return'<div class="'+s("function"==typeof(a=null!=(a=n.dropMask||(null!=t?t.dropMask:t))?a:e.hooks.helperMissing)?a.call(null!=t?t:e.nullContext||{},{name:"dropMask",hash:{},data:o}):a)+'">\r\n <h3>'+s(e.lambda(null!=(i=null!=t?t.options:t)?i.fileDropText:i,t))+"</h3>\r\n</div>"},useData:!0})},1300:function(e,t,n){var r=n(10);e.exports=(r.default||r).template({1:function(e,t,n,r,o){var i;e.propertyIsEnumerable;return'<p class="alert alert-warning mb-0">'+e.escapeExpression(e.lambda(null!=(i=null!=t?t.options:t)?i.limitText:i,t))+"</p>\r\n"},3:function(e,t,n,r,o){e.propertyIsEnumerable;var i,a=e.lambda,s=e.escapeExpression,l=null!=t?t:e.nullContext||{};return'<div class="file-drop '+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.fileDrop:i,t))+" p-2"+(null!=(i=n.if.call(l,null!=(i=null!=t?t.options:t)?i.limitText:i,{name:"if",hash:{},fn:e.program(4,o,0),inverse:e.noop,data:o}))?i:"")+'">\r\n <button class="browse btn btn-light mr-2">'+s((n.lang||t&&t.lang||e.hooks.helperMissing).call(l,"browse",{name:"lang",hash:{},data:o}))+'</button>\r\n <span class="text-muted align-middle">'+s(a(null!=(i=null!=t?t.options:t)?i.alternateText:i,t))+"</span>\r\n</div>\r\n"},4:function(e,t,n,r,o){return" col-6 "},compiler:[8,">= 4.3.0"],main:function(e,t,n,r,o){e.propertyIsEnumerable;var i,a=e.lambda;return"<h5>"+e.escapeExpression(a(null!=(i=null!=t?t.options:t)?i.title:i,t))+"</h5>\r\n<p>"+(null!=(i=a(null!=(i=null!=t?t.options:t)?i.description:i,t))?i:"")+"</p>\r\n"+(null!=(i=n.if.call(null!=t?t:e.nullContext||{},null!=(i=null!=t?t.options:t)?i.limitText:i,{name:"if",hash:{},fn:e.program(1,o,0),inverse:e.program(3,o,0),data:o}))?i:"")},useData:!0})},1301:function(e,t,n){var r=n(10);e.exports=(r.default||r).template({1:function(e,t,n,r,o){e.propertyIsEnumerable;var i,a=e.lambda;return'<span class="d-inline-block align-middle mr-2 '+e.escapeExpression(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svgContainer:i,t))+' float-right text-success">'+(null!=(i=a(null!=(i=null!=t?t.options:t)?i.tickSvg:i,t))?i:"")+"</span>\r\n"},3:function(e,t,n,r,o){var i;e.propertyIsEnumerable;return'<span class="d-inline-block align-middle mr-2 '+e.escapeExpression(e.lambda(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svgContainer:i,t))+' cursor-pointer cancel-upload close float-right">×</span>\r\n'},compiler:[8,">= 4.3.0"],main:function(e,t,n,r,o){e.propertyIsEnumerable;var i,a,s=e.lambda,l=e.escapeExpression,u=null!=t?t:e.nullContext||{},c=e.hooks.helperMissing;return'<span class="d-inline-block align-middle mr-2 '+l(s(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svgContainer:i,t))+'">'+(null!=(i=s(null!=(i=null!=t?t.options:t)?i.svg:i,t))?i:"")+'</span>\r\n<span class="align-middle">\r\n '+l("function"==typeof(a=null!=(a=n.name||(null!=t?t.name:t))?a:c)?a.call(u,{name:"name",hash:{},data:o}):a)+"\r\n</span>\r\n"+(null!=(i=n.if.call(u,null!=(i=null!=t?t.options:t)?i.finished:i,{name:"if",hash:{},fn:e.program(1,o,0),inverse:e.program(3,o,0),data:o}))?i:"")+'\r\n<div class="progress my-2 '+l(s(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.progress:i,t))+' mt-2">\r\n <div class="progress-bar bg-info" style="width: '+l("function"==typeof(a=null!=(a=n.progress||(null!=t?t.progress:t))?a:c)?a.call(u,{name:"progress",hash:{},data:o}):a)+'%" aria-valuenow="'+l("function"==typeof(a=null!=(a=n.progress||(null!=t?t.progress:t))?a:c)?a.call(u,{name:"progress",hash:{},data:o}):a)+'" aria-valuemin="0" aria-valuemax="100"></div>\r\n</div>'},useData:!0})},1302:function(e,t,n){e.exports={svgContainer:"QNFLR",progress:"_1q_ig"}},1303:function(e,t,n){var r=n(10);e.exports=(r.default||r).template({compiler:[8,">= 4.3.0"],main:function(e,t,n,r,o){e.propertyIsEnumerable;return'<form>\r\n <div class="form-group">\r\n <label for="language">'+e.escapeExpression((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"label",{name:"lang",hash:{},data:o}))+'</label>\r\n <div class="typahead-region"></div>\r\n </div>\r\n</form>'},useData:!0})},1304:function(e,t,n){var r=n(10);e.exports=(r.default||r).template({1:function(e,t,n,r,o){e.propertyIsEnumerable;var i,a=e.lambda,s=e.escapeExpression;return'<a class="float-right '+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svgContainer:i,t))+" "+s(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.actionSvg:i,t))+' text-muted delete">'+(null!=(i=a(null!=(i=null!=t?t.options:t)?i.trashSvg:i,t))?i:"")+"</a>\r\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,r,o){e.propertyIsEnumerable;var i,a,s=e.lambda,l=e.escapeExpression,u=null!=t?t:e.nullContext||{};return'<span class="d-inline-block align-middle mr-2 '+l(s(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svgContainer:i,t))+'">'+(null!=(i=s(null!=(i=null!=t?t.options:t)?i.svg:i,t))?i:"")+'</span>\r\n<a href="'+l("function"==typeof(a=null!=(a=n.url||(null!=t?t.url:t))?a:e.hooks.helperMissing)?a.call(u,{name:"url",hash:{},data:o}):a)+"?name="+l(s(null!=(i=null!=t?t.options:t)?i.name:i,t))+'" class="align-middle">\r\n '+l(s(null!=(i=null!=t?t.options:t)?i.name:i,t))+"\r\n</a>\r\n"+(null!=(i=n.unless.call(u,null!=(i=null!=t?t.options:t)?i.isClickViewContent:i,{name:"unless",hash:{},fn:e.program(1,o,0),inverse:e.noop,data:o}))?i:"")},useData:!0})},1305:function(e,t,n){e.exports={container:"_2GdEa",svgContainer:"_186X3",actionSvg:"_3_l1b"}},1306:function(e,t,n){var r=n(10);e.exports=(r.default||r).template({1:function(e,t,n,r,o){var i;e.propertyIsEnumerable;return e.escapeExpression(e.lambda(null!=(i=null!=t?t.options:t)?i.emptyStateText:i,t))},compiler:[8,">= 4.3.0"],main:function(e,t,n,r,o){var i;e.propertyIsEnumerable;return"<h5>"+e.escapeExpression(e.lambda(null!=(i=null!=t?t.options:t)?i.headerText:i,t))+"</h5>\r\n"+(null!=(i=n.if.call(null!=t?t:e.nullContext||{},null!=(i=null!=t?t.options:t)?i.emptyStateText:i,{name:"if",hash:{},fn:e.program(1,o,0),inverse:e.noop,data:o}))?i:"")+'\r\n<div class="subtitles-list-region"></div>'},useData:!0})},1307:function(e,t,n){var r=n(10);e.exports=(r.default||r).template({1:function(e,t,n,r,o){var i;e.propertyIsEnumerable;return'<p class="alert alert-warning col-8">'+e.escapeExpression((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"limit",{name:"lang",hash:{limit:null!=(i=null!=t?t.options:t)?i.limit:i},data:o}))+"</p>\r\n"},3:function(e,t,n,r,o){e.propertyIsEnumerable;var i=null!=t?t:e.nullContext||{},a=e.hooks.helperMissing,s=e.escapeExpression;return"<p>"+s((n.lang||t&&t.lang||a).call(i,"subheading",{name:"lang",hash:{},data:o}))+'</p>\r\n<div class="form-group mb-1">\r\n <label for="url">'+s((n.lang||t&&t.lang||a).call(i,"urlLabel",{name:"lang",hash:{},data:o}))+'</label>\r\n <input name="url" id="url" class="form-control" type="text" placeholder="'+s((n.lang||t&&t.lang||a).call(i,"urlPlaceholder",{name:"lang",hash:{},data:o}))+'">\r\n <div class="form-feedback"></div>\r\n</div>\r\n<div class="form-group mb-1" id="name-container" style="display: none;">\r\n <input type="text" class="form-control" name="name" placeholder="'+s((n.lang||t&&t.lang||a).call(i,"namePlaceholder",{name:"lang",hash:{},data:o}))+'">\r\n <div class="form-feedback"></div>\r\n</div>\r\n<div class="attach-btn-region"></div>\r\n'},compiler:[8,">= 4.3.0"],main:function(e,t,n,r,o){var i;e.propertyIsEnumerable;return'<h5 class="pt-2">Resource Links</h5>\r\n'+(null!=(i=n.if.call(null!=t?t:e.nullContext||{},null!=(i=null!=t?t.options:t)?i.hide:i,{name:"if",hash:{},fn:e.program(1,o,0),inverse:e.program(3,o,0),data:o}))?i:"")},useData:!0})},1308:function(e,t,n){var r=n(10);e.exports=(r.default||r).template({1:function(e,t,n,r,o){return"col-5"},compiler:[8,">= 4.3.0"],main:function(e,t,n,r,o){e.propertyIsEnumerable;var i,a=null!=t?t:e.nullContext||{};return'<div class="tab-region"></div>\r\n\r\n<div class="row py-3">\r\n <div class="'+(null!=(i=n.if.call(a,null!=(i=null!=t?t.options:t)?i.isClickViewContent:i,{name:"if",hash:{},fn:e.program(1,o,0),inverse:e.noop,data:o}))?i:"")+'">\r\n <div class="clickview-subtitles-list-region"></div>\r\n </div>\r\n <div class="col-7">\r\n <div class="subtitles-upload-region"></div>\r\n <div class="subtitles-upload-list-region p-0 col-8"></div>\r\n <div class="customer-subtitles-list-region p-0 col-8"></div>\r\n </div>\r\n</div>\r\n\r\n<div class="row border-top py-3">\r\n <div class="'+(null!=(i=n.if.call(a,null!=(i=null!=t?t.options:t)?i.isClickViewContent:i,{name:"if",hash:{},fn:e.program(1,o,0),inverse:e.noop,data:o}))?i:"")+'">\r\n <div class="clickview-resources-list-region"></div>\r\n </div>\r\n <div class="col-7">\r\n <div class="resources-upload-region"></div>\r\n <div class="resources-upload-list-region p-0 col-8"></div>\r\n <div class="customer-resources-list-region p-0 col-8"></div>\r\n </div>\r\n</div>\r\n\r\n<div class="row border-top py-3">\r\n <div class="'+(null!=(i=n.if.call(a,null!=(i=null!=t?t.options:t)?i.isClickViewContent:i,{name:"if",hash:{},fn:e.program(1,o,0),inverse:e.noop,data:o}))?i:"")+'">\r\n <div class="clickview-link-list-region"></div>\r\n </div>\r\n <div class="col-7">\r\n <div class="add-links-region mb-2"></div>\r\n <div class="customer-link-list-region p-0 col-8"></div>\r\n </div>\r\n</div>'},useData:!0})},1476:function(e,t,n){"use strict";n.r(t);var r=n(1),o=n(6),i=n(2),a=n(5),s=n(3),l=n(15),u=n(121),c=n(325),p=n(45),f=n(189),d=n(317),h=n(704),y=n(1298),m=n.n(y),b=n(1299),g=n.n(b),v=n(1300),k=n.n(v);function w(e){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function O(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function C(e,t){return(C=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function P(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=E(e);if(t){var o=E(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return S(this,n)}}function S(e,t){if(t&&("object"===w(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function E(e){return(E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var T=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&C(e,t)}(i,e);var t,n,r,o=P(i);function i(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),o.call(this,e)}return t=i,(n=[{key:"name",get:function(){return"FileSelectComponent"}},{key:"template",get:function(){return k.a}},{key:"lang",get:function(){return"shared._fileSelect"}},{key:"elements",get:function(){return{dropArea:".file-drop"}}},{key:"defaults",get:function(){return{acceptMultiple:!0}}},{key:"behaviors",get:function(){return[{behaviorClass:d.a,buttonSelector:".browse",channelName:this.options.channelName,acceptMultiple:this.options.acceptMultiple,mimeType:this.options.mimeType},{behaviorClass:h.a,channelName:this.options.channelName,acceptMultiple:this.options.acceptMultiple}]}},{key:"events",value:function(){var e,t,n,r="dragleave .".concat(m.a.dropMask);return n="onDragLeave",(t=r)in(e={"drop .file-drop":"onDrop","dragover .file-drop":"onDragOver"})?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},{key:"onDrop",value:function(){this.$el.removeClass(m.a.dragOver)}},{key:"onDragOver",value:function(e){this.$el.addClass(m.a.dragOver),e.preventDefault()}},{key:"onDragLeave",value:function(){this.$el.removeClass(m.a.dragOver)}},{key:"viewOptions",value:function(){return Object.assign(Object.assign({},this.options),{styles:m.a,limitText:this.options.limitText,isClickViewContent:this.options.isClickViewContent})}},{key:"onRender",value:function(){this.getUI("dropArea").append(g()({dropMask:m.a.dropMask,fileDropText:s.a.getPhrase(this.lang,"drop")}))}}])&&O(t.prototype,n),r&&O(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(i.a.Component),x=n(0),R=n(12),j=n(185),N=n(9),_=n(305),I=n(145),L=n(1138),D=n(1166),V=n(16),U=n(1301),B=n.n(U),F=n(1302),M=n.n(F),A=n(111);function q(e){return(q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function H(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function z(e,t){return(z=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function J(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Y(e);if(t){var o=Y(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return W(this,n)}}function W(e,t){if(t&&("object"===q(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Y(e){return(Y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Z=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&z(e,t)}(i,e);var t,n,r,o=J(i);function i(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),o.call(this,e)}return t=i,(n=[{key:"initialize",value:function(){this.listenTo(this.model,"change:progress",this.render)}},{key:"name",get:function(){return"FileUploadComponent"}},{key:"template",get:function(){return B.a}},{key:"events",value:function(){return{"click .cancel-upload":"onClickCancelUpload"}}},{key:"onClickCancelUpload",value:function(){A.a.isFunction(this.options.onClickCancelUpload)&&this.options.onClickCancelUpload(this.model.get("id"))}},{key:"viewOptions",value:function(){return{styles:M.a,svg:V.a.getSvg(V.b.Folder),tickSvg:V.a.getSvg(V.b.Check),finished:this.model.get("progress")>=100}}}])&&H(t.prototype,n),r&&H(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(i.a.Component);function Q(e){return(Q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function X(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function G(e,t){return(G=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function K(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=te(e);if(t){var o=te(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return ee(this,n)}}function ee(e,t){if(t&&("object"===Q(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function te(e){return(te=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ne=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&G(e,t)}(a,e);var t,n,r,i=K(a);function a(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.call(this,e)}return t=a,(n=[{key:"name",get:function(){return"FileUploadsComponentCollection"}},{key:"childView",get:function(){return Z}},{key:"childViewOptions",get:function(){var e=this;return{onClickCancelUpload:function(t){o.Radio.channel(e.options.channelName).trigger("cancel:upload",t)}}}}])&&X(t.prototype,n),r&&X(t,r),Object.defineProperty(t,"prototype",{writable:!1}),a}(i.a.ComponentCollection),re=n(30),oe=n(1116),ie=n(140),ae={handleQuery:function(){return function(e,t){var n=[];if(e){var o=CVLanguages.getEnglishNameContains(e);return r.each(o,(function(e,t){n.push({key:t,name:e.englishName})})),t(n)}t()}},getTypeaheadConfig:function(){return function(){return{name:"languages",source:ae.handleQuery(),limit:5,display:function(e){return e.name},templates:{suggestion:ie.d,pending:ie.b,notFound:ie.c}}}}},se=n(1303),le=n.n(se);function ue(e){return(ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ce(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function pe(e,t){return(pe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function fe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=he(e);if(t){var o=he(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return de(this,n)}}function de(e,t){if(t&&("object"===ue(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function he(e){return(he=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ye=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&pe(e,t)}(i,e);var t,n,r,o=fe(i);function i(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),o.call(this,e)}return t=i,(n=[{key:"initialize",value:function(e){this.model=re.a.get("subtitle:language",e.defaultLanguage),this.model.addValidation(R.u),this.listenTo(this.channelName,"select:language",this.onLanguageSelected)}},{key:"template",get:function(){return le.a}},{key:"name",get:function(){return"LanguageSelectComponent"}},{key:"lang",get:function(){return"libraryEditor.languageSelect"}},{key:"events",value:function(){return{"click .submit":"onClickSubmit",submit:"onClickSubmit"}}},{key:"behaviors",get:function(){return[{behaviorClass:_.e,title:s.a.getPhrase(this.lang,"heading"),buttons:[{text:s.a.getPhrase(this.lang,"submit"),type:"submit",className:"btn btn-primary submit"}]},{behaviorClass:_.a}]}},{key:"regions",value:function(){return{typeahead:".typahead-region"}}},{key:"channelName",get:function(){return"".concat(this.name).concat(this.cid)}},{key:"getTypeaheadConfigs",value:function(){return[{name:"languages",typeaheadConfig:ae.getTypeaheadConfig()}]}},{key:"renderTypeahead",value:function(){this.showChildView("typeahead",new oe.a({model:this.model,parentChannelName:this.channelName,inputId:"language",selectEvent:"select:language",typeaheadConfigs:this.getTypeaheadConfigs()}))}},{key:"onLanguageSelected",value:function(e){this.model.set("code",e.key)}},{key:"onClickSubmit",value:function(){this.model.validate(),this.model.isValid()&&(this.options.promise.resolve(this.model.toJSON()),this.triggerMethod("hide"))}},{key:"onBeforeDestroy",value:function(){"pending"===this.options.promise.state()&&this.options.promise.reject()}},{key:"onRender",value:function(){this.renderTypeahead()}}])&&ce(t.prototype,n),r&&ce(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(i.a.Component),me=n(1122),be=n(1139),ge=function(e,t){var n,r,o=e.language;return r=(null==t?void 0:t.filter((function(e){return e.language!==o}))).length>0?CVLanguages.getFullEnglishName(o):CVLanguages.getEnglishName(o),(null===(n=e.metadata)||void 0===n?void 0:n.autoGenerated)?s.a.getPhrase("shared.shared-utils","autoGeneratedSubtitle",{name:r}):r},ve=n(1304),ke=n.n(ve),we=n(1305),Oe=n.n(we);function Ce(e){return(Ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Pe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Se(e,t){return(Se=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Ee(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=xe(e);if(t){var o=xe(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Te(this,n)}}function Te(e,t){if(t&&("object"===Ce(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function xe(e){return(xe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Re=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Se(e,t)}(i,e);var t,n,r,o=Ee(i);function i(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),o.call(this,e)}return t=i,(n=[{key:"name",get:function(){return"SubtitleItemComponent"}},{key:"template",get:function(){return ke.a}},{key:"className",get:function(){return"".concat(Oe.a.container," rounded p-2 mb-2")}},{key:"events",value:function(){return{"click .delete":"onClickDelete"}}},{key:"getEnglishName",value:function(){return ge(this.model.toJSON(),this.model.collection.toJSON())}},{key:"onClickDelete",value:function(){!this.options.isClickViewContent&&A.a.isFunction(this.options.onClickDelete)&&this.options.onClickDelete(this.model)}},{key:"viewOptions",value:function(){return{styles:Oe.a,svg:V.a.getSvg(be.a.mapTypeToSvg("subtitle")),trashSvg:V.a.getSvg(V.b.Delete),name:this.getEnglishName(),isClickViewContent:this.options.isClickViewContent}}}])&&Pe(t.prototype,n),r&&Pe(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(i.a.Component),je=n(208),Ne=n(1306),_e=n.n(Ne);function Ie(e){return(Ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Le(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function De(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ve(e,t,n){return t&&De(e.prototype,t),n&&De(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ue(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Be(e,t)}function Be(e,t){return(Be=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Fe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ae(e);if(t){var o=Ae(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Me(this,n)}}function Me(e,t){if(t&&("object"===Ie(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Ae(e){return(Ae=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var qe=function(e){Ue(n,e);var t=Fe(n);function n(e){return Le(this,n),t.call(this,e)}return Ve(n,[{key:"name",get:function(){return"VideoSubtitlesComponent"}},{key:"template",get:function(){return _e.a}},{key:"regions",value:function(){return{subtitles:{el:".subtitles-list-region",replaceElement:!0}}}},{key:"viewOptions",value:function(){return{headerText:this.options.headerText,emptyStateText:this.options.emptyStateText}}},{key:"onRender",value:function(){this.showChildView("subtitles",new He({collection:this.collection,channelName:this.options.channelName,isClickViewContent:this.options.isClickViewContent}))}}]),n}(i.a.Component),He=function(e){Ue(n,e);var t=Fe(n);function n(e){return Le(this,n),t.call(this,e)}return Ve(n,[{key:"name",get:function(){return"VideoSubtitlesComponentCollection"}},{key:"lang",get:function(){return"libraryEditor.videoSubtitles"}},{key:"childView",get:function(){return Re}},{key:"childViewOptions",get:function(){var e=this;return{isClickViewContent:this.options.isClickViewContent,onClickDelete:function(t){return e.onClickDelete(t)}}}},{key:"onClickDelete",value:function(e){var t=this;this.options.isClickViewContent||new je.a({title:s.a.getPhrase(this.lang,"removeHeading"),text:s.a.getPhrase(this.lang,"removeBody",{language:this.getEnglishName(e)}),buttons:[{text:s.a.getPhrase(this.lang,"remove"),className:"btn btn-danger",success:!0},{text:s.a.getPhrase(this.lang,"cancel"),className:"btn btn-secondary",close:!0}],channelName:"".concat(this.name).concat(this.cid)}).render().done((function(){o.Radio.channel(t.options.channelName).trigger("delete:subtitle",e.get("id"))}))}},{key:"getEnglishName",value:function(e){return ge(e.toJSON(),e.collection.toJSON())}}]),n}(i.a.ComponentCollection),ze=n(265),Je=n(1055),We=n(1307),Ye=n.n(We);function Ze(e){return(Ze="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Qe(e,t){return(Qe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Xe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ke(e);if(t){var o=Ke(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ge(this,n)}}function Ge(e,t){if(t&&("object"===Ze(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Ke(e){return(Ke=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var et=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Qe(e,t)}(a,e);var t,n,r,i=Xe(a);function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).showNameField=!1,t.disableBtn=!0,t}return t=a,(n=[{key:"initialize",value:function(){this.model=re.a.get(this.viewModelName),this.model.addValidation(Je.c),this.bindListeners()}},{key:"name",get:function(){return"AddLinksComponent"}},{key:"template",get:function(){return Ye.a}},{key:"lang",get:function(){return"libraryEditor.addLinks"}},{key:"tagName",get:function(){return"form"}},{key:"bindings",get:function(){return{"[name=url]":{observe:"url",setOptions:{validate:!0}},"[name=name]":{observe:"name",setOptions:{validate:!0}}}}},{key:"regions",value:function(){return{attachBtn:".attach-btn-region"}}},{key:"behaviors",get:function(){return[{behaviorClass:_.f},{behaviorClass:_.a}]}},{key:"elements",get:function(){return{nameField:"#name-container"}}},{key:"viewModelName",get:function(){return"".concat(this.name,":").concat(this.cid)}},{key:"bindListeners",value:function(){this.listenTo(this.model,"change:url",this.onChangeUrl),this.listenTo(this.model,"change:name",this.onChangeName),this.listenTo(this.options.channelName,"attach:link",this.onClickAttach)}},{key:"onChangeUrl",value:function(){this.showNameField&&!this.model.isValid("url")?(this.getUI("nameField").hide(),this.model.set("name",""),this.showNameField=!1):!this.showNameField&&this.model.isValid("url")&&(this.getUI("nameField").show(),this.showNameField=!0)}},{key:"onChangeName",value:function(){this.model.validate("name"),this.disableBtn=!this.model.isValid(),this.renderAttachButton()}},{key:"onClickAttach",value:function(){var e=this.model.toJSON();this.model.clear(),o.Radio.channel(this.options.channelName).trigger("add:link",e),this.render()}},{key:"renderAttachButton",value:function(){this.options.hide||this.showChildView("attachBtn",new ze.a({saveEvent:"attach:link",channelName:this.options.channelName,buttonText:s.a.getPhrase(this.lang,"attach"),extraButtonClass:"btn-light attach",disabled:this.disableBtn,buttonType:"submit",spinnerOptions:{size:R.s.Medium,type:R.t.Light,extraClasses:"mx-auto"}}))}},{key:"viewOptions",value:function(){return{limit:this.options.limit,hide:this.options.hide}}},{key:"onRender",value:function(){this.renderAttachButton(),this.stickit(),o.Validation.bind(this)}},{key:"onClose",value:function(){this.unstickit(),o.Validation.unbind(this)}}])&&$e(t.prototype,n),r&&$e(t,r),Object.defineProperty(t,"prototype",{writable:!1}),a}(i.a.Component),tt=n(1204),nt=n(37);function rt(e){return(rt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ot(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function it(e,t){return(it=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function at(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=lt(e);if(t){var o=lt(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return st(this,n)}}function st(e,t){if(t&&("object"===rt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function lt(e){return(lt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ut="shared.errors.tooManyResources",ct=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&it(e,t)}(i,e);var t,n,r,o=at(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=o.call(this,"Cannot add that many resources")).resourceLimit=e,t}return t=i,(n=[{key:"name",get:function(){return"TooManyResourcesError"}},{key:"dialogOptions",get:function(){return{title:s.a.getPhrase(ut,"heading"),text:s.a.getPhrase(ut,"body",{resourceLimit:this.resourceLimit}),buttons:[{text:s.a.getPhrase(ut,"okay"),className:"btn btn-primary",success:!0}]}}}])&&ot(t.prototype,n),r&&ot(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(nt.a);function pt(e){return(pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ft(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function dt(e,t){return(dt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function ht(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=mt(e);if(t){var o=mt(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return yt(this,n)}}function yt(e,t){if(t&&("object"===pt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function mt(e){return(mt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var bt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&dt(e,t)}(i,e);var t,n,r,o=ht(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=o.call(this,"Cannot add that many subtitles")).subtileLimit=e,t}return t=i,(n=[{key:"name",get:function(){return"TooManySubtitlesError"}},{key:"dialogOptions",get:function(){return{title:s.a.getPhrase("shared.errors.tooManySubtitles","heading"),text:s.a.getPhrase("shared.errors.tooManySubtitles","body",{subtitleLimit:this.subtileLimit}),buttons:[{text:s.a.getPhrase("shared.errors.tooManySubtitles","okay"),className:"btn btn-primary",success:!0}]}}}])&&ft(t.prototype,n),r&&ft(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(nt.a),gt=n(207),vt=n(201),kt=n(306),wt=n(266),Ot=n(4),Ct=n(42),Pt=n(1308),St=n.n(Pt);function Et(e){return(Et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Tt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function xt(e,t){return(xt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Rt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Nt(e);if(t){var o=Nt(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return jt(this,n)}}function jt(e,t){if(t&&("object"===Et(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Nt(e){return(Nt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"EditResourcesView",(function(){return _t}));var _t=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xt(e,t)}(y,e);var t,n,d,h=Rt(y);function y(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,y),h.call(this,e)}return t=y,(n=[{key:"initialize",value:function(){this.initializeUploadServices(),this.bindDataListeners(),this.bindViewListeners(),this.bindFileSelectListeners(),R.v.initBackButton(),this.chapterDataService=a.a.getInstance(x.g.Chapter,this),this.videoDataService=a.a.getInstance(x.g.Video,this),this.linkDataService=a.a.getInstance(x.g.Link,this),this.resourceDataService=a.a.getInstance(x.g.Resource,this),this.subtitleDataService=a.a.getInstance(x.g.Subtitle,this),this.resourceUploads=[],this.resourceUploadCount=0}},{key:"name",get:function(){return"EditResourcesView"}},{key:"lang",get:function(){return"libraryEditor.editResources"}},{key:"title",get:function(){return this.model&&this.model.get("name")||"Edit Resources"}},{key:"template",get:function(){return St.a}},{key:"props",get:function(){return["videoDataService"]}},{key:"className",get:function(){return"bg-white p-3"}},{key:"channelName",get:function(){return R.k.generateUniqueChannelName(this)}},{key:"behaviors",get:function(){return[{behaviorClass:_.d}]}},{key:"requiredResources",get:function(){return{currentUser:I.b.currentUser}}},{key:"initializeUploadServices",value:function(){this.resourceUploadService=new c.b,this.listenTo(x.w.RESOURCE_UPLOAD,p.a.UPLOAD_COMPLETE,this.onResourceUploadComplete),this.subtitleUploadService=new c.c,this.listenTo(x.w.SUBTITLE_UPLOAD,p.a.UPLOAD_COMPLETE,this.onSubtitleUploadComplete)}},{key:"bindDataListeners",value:function(){this.listenTo(x.e.VIDEO,"".concat(x.f.VIDEOS,":").concat(this.options.videoId,":sync"),this.render),this.listenTo(x.e.VIDEO,"".concat(x.f.VIDEOS,":").concat(this.options.videoId,":error"),this.onVideoDataError),this.listenTo(x.e.VIDEO,"".concat(x.f.VIDEO_HAS_PHYSICAL_CHAPTERS,":").concat(this.options.videoId,":sync"),this.render),this.listenTo(x.e.CHAPTER,"".concat(x.f.CONCATENATE_STATUS,":").concat(this.options.videoId,":error"),this.onConcatenateDataError)}},{key:"bindViewListeners",value:function(){this.listenTo(this.channelName,"add:link",this.onAddLink),this.listenTo(this.channelName,"delete:subtitle",this.onDeleteSubtitle),this.listenTo(this.channelName,"delete:resource",this.onDeleteResource),this.listenTo(this.channelName,"delete:link",this.onDeleteLink),this.listenTo(this.channelName,"cancel:upload",this.onCancelUpload),this.listenTo(this.channelName,vt.LibraryEditorActions.MergeChapters,this.onMergeChapters)}},{key:"bindFileSelectListeners",value:function(){this.listenTo(this.getSubtitleSelectChannelName(),p.a.FILES_SELECTED,this.onSubtitleFilesAdded),this.listenTo(this.getResourceSelectChannelName(),p.a.FILES_SELECTED,this.onResourceFilesAdded)}},{key:"getSubtitleSelectChannelName",value:function(){return"".concat(this.name).concat(this.cid,"subtitles")}},{key:"getResourceSelectChannelName",value:function(){return"".concat(this.name).concat(this.cid,"resources")}},{key:"onVideoDataError",value:function(e){switch(e.type){case u.a.NotFound:i.a.ErrorHelper.throw(new gt.l);break;case u.a.Forbidden:i.a.ErrorHelper.throw(new gt.f)}}},{key:"onConcatenateDataError",value:function(e){e.type===u.a.NotFound&&(this.concatenateRequestNotFound=!0,this.render())}},{key:"onSubtitleFilesAdded",value:function(e,t){e.length>5-this.model.subtitles.length?i.a.ErrorHelper.throw(new bt(5)):(t&&(this.interactionType=t),this.subtitleUploadService.addFiles(e))}},{key:"onResourceFilesAdded",value:function(e,t){e.length>25-this.model.resources.length?i.a.ErrorHelper.throw(new ct(25)):(this.resourceUploadCount+=e.length,t&&(this.interactionType=t),this.resourceUploadService.addFiles(e))}},{key:"onAddLink",value:function(e){var t=this;25!==this.model.links.length&&(this.model.links.length+1===25&&this.renderAddLinks(!0),this.linkDataService.addLink(this.model.get("id"),e,(function(e){t.model.links.add(e),t.render()})))}},{key:"regions",value:function(){return{tabs:{el:".tab-region",partialLoading:N.h.EditVideoTabs},subtitlesUpload:{el:".subtitles-upload-region",partialLoading:N.h.EditVideoUploadArea},subtitlesUploadList:".subtitles-upload-list-region",customerSubtitlesList:".customer-subtitles-list-region",clickViewSubtitlesList:".clickview-subtitles-list-region",resourcesUpload:{el:".resources-upload-region",partialLoading:N.h.EditVideoUploadArea},resourcesUploadList:".resources-upload-list-region",customerResourcesList:".customer-resources-list-region",clickViewResourcesList:".clickview-resources-list-region",addLinks:{el:".add-links-region",partialLoading:N.h.EditVideoUploadArea},customerLinkList:".customer-link-list-region",clickViewLinkList:".clickview-link-list-region"}}},{key:"startPollingConcatenation",value:function(){if(this.concatenateRequest){var e=[kt.a.SingleFile,kt.a.ConcatenationFailed];r.contains(e,this.concatenateRequest.get("status"))||this.pollConcatenation()}}},{key:"pollConcatenation",value:function(){var e=this;this.isDestroyed()||this.chapterDataService.getConcatenateRequest(this.options.videoId,(function(t){if(e.concatenateRequest=t,e.concatenateRequest.get("status")!==kt.a.SingleFile)return setTimeout((function(){return e.pollConcatenation()}),5e3),void e.renderConcatenationRequest();e.videoDataService.clearPhysicialChaptersCache(),e.videoDataService.hasPhysicalChapters(e.options.videoId,(function(t){e.hasPhysicalChapters=t,e.renderSubtitleFileSelect()}))}))}},{key:"onDeleteResource",value:function(e){var t=this;this.resourceDataService.deleteResource(this.options.videoId,e,(function(){t.logDeleteAction(Ot.EntityType.Resource,e),t.render()}))}},{key:"onDeleteSubtitle",value:function(e){var t=this;this.subtitleDataService.deleteSubtitle(this.options.videoId,e,(function(){t.logDeleteAction(Ot.EntityType.Subtitle,e),t.render()}))}},{key:"onDeleteLink",value:function(e){var t=this;this.linkDataService.deleteLink(this.options.videoId,e,(function(){t.logDeleteAction(Ot.EntityType.Link,e),t.render()}))}},{key:"onCancelUpload",value:function(e){this.resourceUploadService.cancelUpload(e),this.subtitleUploadService.cancelUpload(e)}},{key:"onResourceUploadComplete",value:function(e){var t=this,n=e.toJSON(),r={fileId:n.fileInfo.id,uploadId:n.file.cvUpload.uploadId,name:n.fileInfo.name,type:f.a.getResourceType(n.fileInfo.extension),extension:n.fileInfo.extension,fileSize:n.fileInfo.size,fileUrl:n.fileInfo.url,ingestUrl:n.file.cvUpload.ingestUrl,metaData:{type:f.a.getResourceType(n.fileInfo.extension)},contribution:!1,url:n.fileInfo.url,fileIdType:2};this.resourceUploads.push(r),this.resourceUploadCount--,this.resourceUploadCount>0||(this.resourceDataService.addResource(this.options.videoId,this.resourceUploads,(function(e){t.model.resources.add(e);var n=t.resourceUploadService.getCollection().filter((function(t){return t.get("fileInfo").id===e.get("fileId")}));t.resourceUploadService.getCollection().remove(n),t.logUploadAction(e),t.render()})),this.resourceUploads=[])}},{key:"onSubtitleUploadComplete",value:function(e){var t=this,n=$.Deferred(),r=new ye({defaultLanguage:{code:"en",name:"English"},promise:n});n.done((function(n){var r=e.toJSON(),o={fileId:r.fileInfo.id,name:n.name,language:n.code,type:f.a.getResourceType(r.fileInfo.extension),fileIdType:2};t.subtitleDataService.addSubtitle(t.options.videoId,o,(function(n){t.model.subtitles.add(n),t.subtitleUploadService.getCollection().remove(e),t.logUploadAction(n),t.render()}))})).fail((function(){t.subtitleUploadService.cancelUpload(e.get("id"))})),o.Radio.channel(l.a.POPUP).trigger(i.a.EventNames.SHOW_POPUP,r)}},{key:"logUploadAction",value:function(e){var t=e instanceof j.a?Ot.EntityType.Resource:Ot.EntityType.Subtitle,n=Ct.a.mapInteractionType(this.interactionType),r={location:Ot.LocationContext.EditVideoResources,actionType:Ot.UserAction.Upload,entity:t,descriptor:n};Ct.a.logUserAction(e,r)}},{key:"logDeleteAction",value:function(e,t){var n={location:Ot.LocationContext.EditVideoResources,actionType:Ot.UserAction.Delete,entity:e},r={id:t,parentId:+this.options.videoId};Ct.a.logUserAction(r,n)}},{key:"onMergeChapters",value:function(){var e=this;this.chapterDataService.addConcatenateRequest(this.options.videoId,(function(){e.pollConcatenation()}))}},{key:"renderTabs",value:function(){var e=!R.j.canEditVideo(this.model);this.showChildView("tabs",new me.a({tabs:R.v.getEditVideoTabs(this.options.videoId,{hideChaptersTab:e}),activeTab:".edit-resources-subtitles-applink",goBackTab:R.v.getBackButton(this.options.videoId)}))}},{key:"renderSubtitleFileSelect",value:function(){if(this.hasPhysicalChapters.get("value"))this.renderConcatenationRequest();else{var e=s.a.getPhrase(this.lang,"subtitlesLimit",{limit:5});this.showChildView("subtitlesUpload",new T({title:this.isClickViewContent?s.a.getPhrase(this.lang,"customerSubtitles"):s.a.getPhrase(this.lang,"subtitles"),description:s.a.getPhrase(this.lang,"subtitlesInfo"),alternateText:s.a.getPhrase(this.lang,"subtitlesAlternative"),mimeType:f.b.SUBTITLES,channelName:this.getSubtitleSelectChannelName(),acceptMultiple:!1,limitText:this.model.subtitles.length>=5?e:null,isClickViewContent:this.isClickViewContent}))}}},{key:"renderSubtitleUploadList",value:function(){var e=this.subtitleUploadService.getCollection();this.showChildView("subtitlesUploadList",new ne({collection:e,channelName:this.channelName}))}},{key:"renderSubtitlesLists",value:function(){this.renderClickViewSubtitlesList(),this.renderCustomerSubtitlesList()}},{key:"renderClickViewSubtitlesList",value:function(){if(this.isClickViewContent){var e=R.j.filterObjectsByOwnerType(this.model.subtitles,wt.a.ClickView);this.showChildView("clickViewSubtitlesList",new qe({collection:e,channelName:this.channelName,isClickViewContent:!0,headerText:s.a.getPhrase(this.lang,"clickViewSubtitles"),emptyStateText:e.models.length?"":s.a.getPhrase(this.lang,"clickViewSubtitlesEmpty")}))}}},{key:"renderCustomerSubtitlesList",value:function(){this.showChildView("customerSubtitlesList",new qe({collection:R.j.filterObjectsByOwnerType(this.model.subtitles,wt.a.Customer,this.currentUser.get("customerId")),channelName:this.channelName}))}},{key:"renderConcatenationRequest",value:function(){this.isRendered()&&this.showChildView("subtitlesUpload",new D.a({type:this.isClickViewContent?"clickViewSubtitles":"subtitles",channelName:this.channelName,model:this.concatenateRequest}))}},{key:"renderResourcesFileSelect",value:function(){var e=s.a.getPhrase(this.lang,"resourcesLimit",{limit:25});this.showChildView("resourcesUpload",new T({title:this.isClickViewContent?s.a.getPhrase(this.lang,"customerResources"):s.a.getPhrase(this.lang,"resources"),description:s.a.getPhrase(this.lang,"resourcesDescription"),alternateText:s.a.getPhrase(this.lang,"resourcesAlternative"),mimeType:f.b.RESOURCES,channelName:this.getResourceSelectChannelName(),limitText:this.model.resources.length>=25?e:null,isClickViewContent:this.isClickViewContent}))}},{key:"renderResourcesUploadList",value:function(){var e=this.resourceUploadService.getCollection();this.showChildView("resourcesUploadList",new ne({collection:e,channelName:this.channelName}))}},{key:"renderResourcesLists",value:function(){this.renderClickViewResourcesList(),this.renderCustomerResourcesList()}},{key:"renderClickViewResourcesList",value:function(){if(this.isClickViewContent){var e=R.j.filterObjectsByOwnerType(this.model.resources,wt.a.ClickView);this.showChildView("clickViewResourcesList",new L.a({model:this.model,customCollection:e,editable:!1,videoId:this.options.videoId,parentChannelName:this.channelName,headerText:s.a.getPhrase(this.lang,"clickViewResources"),emptyStateText:e.models.length?"":s.a.getPhrase(this.lang,"clickViewResourcesEmpty"),analyticsOptions:{location:Ot.LocationContext.EditVideoResources}}))}}},{key:"renderCustomerResourcesList",value:function(){this.showChildView("customerResourcesList",new L.b({collection:R.j.filterObjectsByOwnerType(this.model.resources,wt.a.Customer,this.currentUser.get("customerId")),editable:!0,videoId:this.options.videoId,channelName:this.channelName,analyticsOptions:{location:Ot.LocationContext.EditVideoResources}}))}},{key:"renderAddLinks",value:function(e){this.showChildView("addLinks",new et({collection:this.model.get("links"),channelName:this.channelName,hide:e||25===this.model.get("links").length,limit:25}))}},{key:"renderLinkLists",value:function(){var e={channelName:this.channelName,analyticsOptions:{location:Ot.LocationContext.EditVideoResources},videoId:this.options.videoId};this.renderClickViewLinkList(e),this.renderCustomerLinkList(e)}},{key:"renderClickViewLinkList",value:function(e){if(this.isClickViewContent){var t=R.j.filterObjectsByOwnerType(this.model.links,wt.a.ClickView);this.showChildView("clickViewLinkList",new tt.a(Object.assign(Object.assign({},e),{headingText:"Resource Links by ClickView",emptyStateText:t.models.length?"":"There are no ClickView links for this video",customCollection:t,editable:!1})))}}},{key:"renderCustomerLinkList",value:function(e){this.showChildView("customerLinkList",new tt.a(Object.assign(Object.assign({},e),{customCollection:R.j.filterObjectsByOwnerType(this.model.links,wt.a.Customer,this.currentUser.get("customerId")),editable:!0})))}},{key:"fetchData",value:function(){var e=this;this.model=this.videoDataService.getVideo(this.options.videoId),this.hasPhysicalChapters=this.videoDataService.hasPhysicalChapters(this.options.videoId),this.isClickViewContent=this.model&&!R.j.canEditVideo(this.model),this.hasPhysicalChapters&&this.hasPhysicalChapters.get("value")&&!this.getConcatenateRequestSent&&(this.chapterDataService.getConcatenateRequest(this.options.videoId,(function(t){e.concatenateRequest=t,e.render()})),this.getConcatenateRequestSent=!0)}},{key:"shouldRender",value:function(){return!(!this.model||!this.hasPhysicalChapters||this.hasPhysicalChapters.get("value")&&!this.concatenateRequest&&!this.concatenateRequestNotFound)}},{key:"onBeforeRender",value:function(){return this.fetchData(),this.shouldRender()}},{key:"viewOptions",value:function(){return{isClickViewContent:this.isClickViewContent}}},{key:"onRender",value:function(){this.renderTabs(),this.renderSubtitleFileSelect(),this.renderSubtitleUploadList(),this.renderSubtitlesLists(),this.renderResourcesFileSelect(),this.renderResourcesUploadList(),this.renderResourcesLists(),this.renderAddLinks(),this.renderLinkLists(),this.startPollingConcatenation()}},{key:"onDestroy",value:function(){this.subtitleUploadService.destroy(),this.resourceUploadService.destroy()}}])&&Tt(t.prototype,n),d&&Tt(t,d),Object.defineProperty(t,"prototype",{writable:!1}),y}(i.a.View)}}]);
|