@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.
Files changed (81) hide show
  1. package/dist/bundles.json +3 -3
  2. package/dist/css/{library-editor-app-070c979de9.css → library-editor-app-bc12f8ea16.css} +1 -1
  3. package/dist/en.json +1 -1
  4. package/dist/scripts/{0-aa50fa9da5.chunk.js → 0-bb8d151788.chunk.js} +1 -1
  5. package/dist/scripts/{1-fd3e4736ec.chunk.js → 1-8da41f8348.chunk.js} +1 -1
  6. package/dist/scripts/{10-7591f02932.chunk.js → 10-228d8c45fe.chunk.js} +1 -1
  7. package/dist/scripts/{11-02eba260f6.chunk.js → 11-9b1312be2e.chunk.js} +1 -1
  8. package/dist/scripts/{12-6d82741731.chunk.js → 12-25fd567bfa.chunk.js} +1 -1
  9. package/dist/scripts/{13-724a96f11e.chunk.js → 13-5594f01c32.chunk.js} +1 -1
  10. package/dist/scripts/{14-f0e8d0ad52.chunk.js → 14-d3e9f7ac99.chunk.js} +1 -1
  11. package/dist/scripts/{15-0dc89981e2.chunk.js → 15-9c2702f643.chunk.js} +1 -1
  12. package/dist/scripts/{16-28fbb0fbe5.chunk.js → 16-35ac442692.chunk.js} +1 -1
  13. package/dist/scripts/{17-3c94d08d78.chunk.js → 17-229a9e354b.chunk.js} +1 -1
  14. package/dist/scripts/{18-3fadb1f394.chunk.js → 18-71ca059d9a.chunk.js} +1 -1
  15. package/dist/scripts/{19-8e572002ab.chunk.js → 19-b229508fdd.chunk.js} +1 -1
  16. package/dist/scripts/{2-7a78d29f44.chunk.js → 2-3ae9732722.chunk.js} +1 -1
  17. package/dist/scripts/{22-9a3adda6ad.chunk.js → 22-ac521a0096.chunk.js} +1 -1
  18. package/dist/scripts/{23-be4588004c.chunk.js → 23-c697c32cec.chunk.js} +1 -1
  19. package/dist/scripts/{24-ab5d254e7f.chunk.js → 24-6eb3e57e82.chunk.js} +1 -1
  20. package/dist/scripts/{25-4df309effa.chunk.js → 25-6b696e6ef2.chunk.js} +1 -1
  21. package/dist/scripts/{26-e6e5871cfd.chunk.js → 26-ee7f9d7fd1.chunk.js} +1 -1
  22. package/dist/scripts/{27-5e3aeba07e.chunk.js → 27-87b1e6230a.chunk.js} +1 -1
  23. package/dist/scripts/{28-cc856d5e95.chunk.js → 28-c605108bb7.chunk.js} +1 -1
  24. package/dist/scripts/{29-9f77baca01.chunk.js → 29-8efdbc6583.chunk.js} +1 -1
  25. package/dist/scripts/{3-79f80333be.chunk.js → 3-55457ff399.chunk.js} +1 -1
  26. package/dist/scripts/{30-68fb832db0.chunk.js → 30-f3bf572703.chunk.js} +1 -1
  27. package/dist/scripts/{31-d80dd32cc1.chunk.js → 31-c1ce0f719e.chunk.js} +1 -1
  28. package/dist/scripts/{32-cfb32aaa08.chunk.js → 32-f5db4cacf9.chunk.js} +1 -1
  29. package/dist/scripts/{33-8c76b774b6.chunk.js → 33-17b481dedb.chunk.js} +1 -1
  30. package/dist/scripts/{34-9e83c63cb8.chunk.js → 34-918d865f34.chunk.js} +1 -1
  31. package/dist/scripts/{35-2a9acc8597.chunk.js → 35-de8b68b764.chunk.js} +1 -1
  32. package/dist/scripts/{36-d6d7b848e2.chunk.js → 36-23d5a73fbf.chunk.js} +1 -1
  33. package/dist/scripts/{37-ad8e6f67c5.chunk.js → 37-c08483de1b.chunk.js} +1 -1
  34. package/dist/scripts/{38-f681bc9e2e.chunk.js → 38-288855b754.chunk.js} +1 -1
  35. package/dist/scripts/{39-19eec511f5.chunk.js → 39-4d0f862a76.chunk.js} +1 -1
  36. package/dist/scripts/{4-2a82a84056.chunk.js → 4-0eb5ce96d3.chunk.js} +1 -1
  37. package/dist/scripts/{40-cca507ba93.chunk.js → 40-adec67fce9.chunk.js} +1 -1
  38. package/dist/scripts/{41-fc6a0fe7e4.chunk.js → 41-305ec13d1c.chunk.js} +1 -1
  39. package/dist/scripts/{42-5452d6de34.chunk.js → 42-7227e7bd2c.chunk.js} +1 -1
  40. package/dist/scripts/{43-fb162a1122.chunk.js → 43-e38791d4a7.chunk.js} +1 -1
  41. package/dist/scripts/{44-b3b4565828.chunk.js → 44-bd0a532d8e.chunk.js} +1 -1
  42. package/dist/scripts/{45-8412ccea6c.chunk.js → 45-0e2409cd60.chunk.js} +1 -1
  43. package/dist/scripts/{46-372fa93c13.chunk.js → 46-912320ce94.chunk.js} +1 -1
  44. package/dist/scripts/{47-56c363e4a6.chunk.js → 47-3cbfd2a2ac.chunk.js} +1 -1
  45. package/dist/scripts/{48-f0403bcb83.chunk.js → 48-8d42e561b1.chunk.js} +1 -1
  46. package/dist/scripts/{49-13b2893542.chunk.js → 49-1ba48a0e60.chunk.js} +1 -1
  47. package/dist/scripts/{5-b2986c85d0.chunk.js → 5-f3d75e93a6.chunk.js} +1 -1
  48. package/dist/scripts/{50-8c3fb5c1c4.chunk.js → 50-3b7b3dc488.chunk.js} +1 -1
  49. package/dist/scripts/{51-ec94176992.chunk.js → 51-2f0874d3b6.chunk.js} +1 -1
  50. package/dist/scripts/{52-f541d887ed.chunk.js → 52-38139e2d72.chunk.js} +1 -1
  51. package/dist/scripts/{53-f827f8b6e0.chunk.js → 53-8bf2c662ed.chunk.js} +1 -1
  52. package/dist/scripts/{54-1ebcc9fcaf.chunk.js → 54-2010b7d990.chunk.js} +1 -1
  53. package/dist/scripts/{55-4c0d184ca3.chunk.js → 55-ac90e52766.chunk.js} +1 -1
  54. package/dist/scripts/{56-de18389621.chunk.js → 56-556404b07f.chunk.js} +1 -1
  55. package/dist/scripts/{57-a85e67a482.chunk.js → 57-0e77443044.chunk.js} +1 -1
  56. package/dist/scripts/{58-be172a6ca4.chunk.js → 58-b52ecfb254.chunk.js} +1 -1
  57. package/dist/scripts/{59-4bf5baafed.chunk.js → 59-3e7a2e50d2.chunk.js} +1 -1
  58. package/dist/scripts/{6-53d64f6a85.chunk.js → 6-e2b6f0a280.chunk.js} +1 -1
  59. package/dist/scripts/{60-03e44d916c.chunk.js → 60-48d410eac3.chunk.js} +1 -1
  60. package/dist/scripts/{61-11a1a5f41c.chunk.js → 61-de1dca97c1.chunk.js} +1 -1
  61. package/dist/scripts/{62-78089903fa.chunk.js → 62-b68b548732.chunk.js} +1 -1
  62. package/dist/scripts/{63-fe138e1f54.chunk.js → 63-f863898f45.chunk.js} +1 -1
  63. package/dist/scripts/{64-1460024bea.chunk.js → 64-440e44bd4c.chunk.js} +1 -1
  64. package/dist/scripts/{65-81c6f0a1d0.chunk.js → 65-1cd1a11fd2.chunk.js} +1 -1
  65. package/dist/scripts/{66-469cc41ce6.chunk.js → 66-8580a8395b.chunk.js} +1 -1
  66. package/dist/scripts/{67-dd181df1c4.chunk.js → 67-7c04f32d25.chunk.js} +1 -1
  67. package/dist/scripts/{68-bf1905261e.chunk.js → 68-a8c262b62d.chunk.js} +1 -1
  68. package/dist/scripts/{69-c77da01389.chunk.js → 69-e24052e605.chunk.js} +1 -1
  69. package/dist/scripts/{7-f2452d62fd.chunk.js → 7-7fcaf2b89f.chunk.js} +1 -1
  70. package/dist/scripts/{70-e79d42e859.chunk.js → 70-fa3e9a9a9d.chunk.js} +1 -1
  71. package/dist/scripts/{71-8bee00418c.chunk.js → 71-822760c520.chunk.js} +1 -1
  72. package/dist/scripts/{72-c9c79df587.chunk.js → 72-39aa9e9fc7.chunk.js} +1 -1
  73. package/dist/scripts/{73-172b46004e.chunk.js → 73-77a89058bc.chunk.js} +1 -1
  74. package/dist/scripts/{74-3a572e4113.chunk.js → 74-bf5fd5de31.chunk.js} +1 -1
  75. package/dist/scripts/{8-223910870f.chunk.js → 8-4674a9a713.chunk.js} +1 -1
  76. package/dist/scripts/{9-1e67205927.chunk.js → 9-f2dd265540.chunk.js} +1 -1
  77. package/dist/scripts/{bundle-108691b784.min.js → bundle-39a40aaa3e.min.js} +3 -3
  78. package/dist/scripts/polyfills-fba7714a3a.min.js +1 -0
  79. package/package.json +2 -2
  80. package/dist/scripts/bundle-81edf9131b.min.js +0 -10
  81. package/dist/scripts/polyfills-afb66ec8cc.min.js +0 -1
@@ -1 +1 @@
1
- (window.webpackJsonp_clickview_library_editor=window.webpackJsonp_clickview_library_editor||[]).push([[31],{1098:function(e,t,n){"use strict";n.d(t,"a",(function(){return y}));var o=n(1),r=n(2),i=n(1099),a=n.n(i),l=n(1100),s=n.n(l);function c(e){return(c="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 u(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function p(e,t){return(p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function h(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,o=d(e);if(t){var r=d(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return f(this,n)}}function f(e,t){if(t&&("object"===c(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)}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)}(l,e);var t,n,r,i=h(l);function l(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),i.call(this,e)}return t=l,(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 s.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=o.first(this.options.tabs);n&&(n.active=!0)}}},{key:"onBeforeRender",value:function(){this.setActiveTab()}}])&&u(t.prototype,n),r&&u(t,r),Object.defineProperty(t,"prototype",{writable:!1}),l}(r.a.Component)},1099:function(e,t,n){e.exports={link:"_5idZs",active:"_3Ty4M"}},1100:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({1:function(e,t,n,o,r,i,a){var l;e.propertyIsEnumerable;return null!=(l=n.unless.call(null!=t?t:e.nullContext||{},null!=t?t.hide:t,{name:"unless",hash:{},fn:e.program(2,r,0,i,a),inverse:e.noop,data:r}))?l:""},2:function(e,t,n,o,r,i,a){e.propertyIsEnumerable;var l,s=e.lambda,c=e.escapeExpression;return' <a class="'+c(s(null!=(l=null!=(l=null!=a[1]?a[1].options:a[1])?l.styles:l)?l.link:l,t))+" p-2 "+c(s(null!=t?t.link:t,t))+" "+(null!=(l=n.if.call(null!=t?t:e.nullContext||{},null!=t?t.active:t,{name:"if",hash:{},fn:e.program(3,r,0,i,a),inverse:e.noop,data:r}))?l:"")+'">'+c(s(null!=t?t.name:t,t))+"</a>\r\n"},3:function(e,t,n,o,r,i,a){var l;e.propertyIsEnumerable;return e.escapeExpression(e.lambda(null!=(l=null!=(l=null!=a[1]?a[1].options:a[1])?l.styles:l)?l.active:l,t))+" border-bottom border-primary text-primary"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r,i,a){var l;e.propertyIsEnumerable;return null!=(l=n.each.call(null!=t?t:e.nullContext||{},null!=(l=null!=t?t.options:t)?l.tabs:l,{name:"each",hash:{},fn:e.program(1,r,0,i,a),inverse:e.noop,data:r}))?l:""},useData:!0,useDepths:!0})},1118:function(e,t,n){"use strict";n.d(t,"a",(function(){return v}));var o=n(6),r=n(2),i=n(16),a=n(1119),l=n.n(a),s=n(1120),c=n.n(s),u=n(0),p=n(1098);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 f(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function d(e,t){return(d=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,o=b(e);if(t){var r=b(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return m(this,n)}}function m(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 b(e){return(b=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&&d(e,t)}(s,e);var t,n,r,a=y(s);function s(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),a.call(this,e)}return t=s,(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 c.a}},{key:"appLinks",get:function(){var e,t,n,o=this.options.goBackTab.link;return e={},t=o.selector,n=o.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:l.a,backTab:e,backArrow:i.a.getSvg(i.b.ArrowLeft)}}},{key:"onSave",value:function(){o.Radio.channel(u.b.LIBRARY_EDITOR).trigger(u.a.LibraryEditor.SAVE_VIDEO)}},{key:"onRender",value:function(){this.showChildView("tabs",new p.a({tabs:this.options.tabs,activeTab:this.options.activeTab}))}}])&&f(t.prototype,n),r&&f(t,r),Object.defineProperty(t,"prototype",{writable:!1}),s}(r.a.Component)},1119:function(e,t,n){e.exports={svgContainer:"_27gR6"}},1120:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a=e.lambda,l=e.escapeExpression;return'<div class="row">\r\n <h4>\r\n <a class="d-inline-flex align-items-center '+l(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.link:i,t))+" "+l(a(null!=(i=null!=(i=null!=t?t.options:t)?i.backTab:i)?i.link:i,t))+'">\r\n <span class="'+l(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 "+l(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})},1126:function(e,t,n){"use strict";n.d(t,"a",(function(){return g}));var o=n(6),r=n(2),i=n(30),a=n(16),l=n(305),s=n(12),c=n(1055),u=n(200),p=n(1150),h=n.n(p);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 o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}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,o=v(e);if(t){var r=v(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return b(this,n)}}function b(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 v(e){return(v=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&&y(e,t)}(f,e);var t,n,r,p=m(f);function f(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,f),p.call(this,e)}return t=f,(n=[{key:"initialize",value:function(){this.options.playerViewModelKey&&this.listenToPlayerViewModel(),this.initViewModel(),this.options.editing&&this.syncTime()}},{key:"name",get:function(){return"ChapterFormComponent"}},{key:"lang",get:function(){return"libraryEditor.chapterForm"}},{key:"tagName",get:function(){return"form"}},{key:"viewModelName",get:function(){return"".concat(this.name,":").concat(this.cid)}},{key:"template",get:function(){return h.a}},{key:"className",get:function(){return this.options.creating?"py-3":"border-top p-2"}},{key:"behaviors",get:function(){return[{behaviorClass:l.a,bindViewModel:!0},{behaviorClass:l.f,bindViewModel:!0}]}},{key:"events",value:function(){return{submit:"onSubmit","change .chapter-name":"validateName","keyup .chapter-name":"validateName","change .time-input":"onTimeInputUpdate","click .time-input":"onTimeInputUpdate","keyup .time-input":"onTimeInputUpdate","click .cancel":"destroyView"}}},{key:"bindings",get:function(){return{"[name=name]":{observe:"name",setOptions:{validate:!0}},"[name=hours]":{observe:"hours",setOptions:{validate:!0}},"[name=minutes]":{observe:"minutes",setOptions:{validate:!0}},"[name=seconds]":{observe:"seconds",setOptions:{validate:!0}}}}},{key:"initViewModel",value:function(){this.viewModel=i.a.get(this.viewModelName,this.model.toJSON())}},{key:"listenToPlayerViewModel",value:function(){var e=i.a.get(this.options.playerViewModelKey);this.listenTo(e,"change:currenttime",this.updateTime)}},{key:"updateTime",value:function(e){this.webPlayerTime=e.get("currenttime"),this.syncTime()}},{key:"syncTime",value:function(){var e=this.viewModel.get("startTime")||this.webPlayerTime;this.viewModel.set({hours:s.x.getHoursComponent(e),minutes:s.x.getMinutesComponent(e),seconds:s.x.getSecondsComponent(e)})}},{key:"getNewTime",value:function(){return this.enabled()?s.x.parseTime(this.viewModel.pick("hours","minutes","seconds")):0}},{key:"enabled",value:function(){return this.options.creating||0!==this.model.collection.indexOf(this.model)}},{key:"maxTimes",value:function(){var e=s.x.millisecondsToSeconds(this.options.duration),t=s.x.getHoursComponent(e),n=t>0?59:s.x.getMinutesComponent(e);return{maxHr:t,maxMin:n,maxSec:n>0?59:s.x.getSecondsComponent(e)}}},{key:"onTimeInputUpdate",value:function(){o.Radio.channel(this.options.channelName).trigger(u.LibraryEditorActions.UpdateChapterTime,this.getNewTime()),this.validateStartTime()}},{key:"destroyView",value:function(){o.Radio.channel(this.options.channelName).trigger(u.LibraryEditorActions.CancelChapterEdit),this.destroy()}},{key:"onSubmit",value:function(e){if(e.preventDefault(),!this.validate())return!1;var t={id:this.viewModel.get("id"),name:this.viewModel.get("name"),startTime:this.getNewTime()},n=o.Radio.channel(this.options.channelName),r=u.LibraryEditorActions.CreateChapter;this.options.editing&&(r=u.LibraryEditorActions.UpdateChapter),n.trigger(r,t),this.stopListening(this.viewModel),i.a.clear(this.viewModelName)}},{key:"validate",value:function(){this.viewModel.validate();var e=this.validateStartTime(),t=this.validateName();return this.viewModel.isValid()&&e&&t}},{key:"validateStartTime",value:function(){var e=this,t=o.Validation.callbacks,n=t.valid,r=t.invalid,i=this.model.collection||this.options.collection,a=this.getNewTime(),l=c.a.isValidChapterTime(this.model,a,this.options.duration,i),s=[],u=["seconds","minutes","hours"];return a<0?s=u:l&&(s.push("seconds"),a>59&&s.push("minutes"),a>3540&&s.push("hours")),u.forEach((function(t){return n(e,t,null)})),s.forEach((function(t){return r(e,t,l,null)})),!l}},{key:"validateName",value:function(e){if(!e||13!==e.keyCode){var t=o.Validation.callbacks,n=t.valid,r=t.invalid,i=this.model.collection||this.options.collection,a=c.a.isValidChapterName(this.model,this.viewModel.get("name"),i);return a?r(this,"name",a,null):n(this,"name",null),!a}}},{key:"viewOptions",value:function(){var e=this.maxTimes(),t=e.maxHr,n=e.maxMin,o=0===e.maxSec,r=0===n,i=0===t;return Object.assign(Object.assign({},this.options),{enabled:this.enabled(),timeId:"".concat(this.cid,"-time"),chapterId:"".concat(this.cid,"-chapter-name"),plusSvg:a.a.getSvg(a.b.Plus),secDisabled:o,minDisabled:r,hrDisabled:i})}}])&&d(t.prototype,n),r&&d(t,r),Object.defineProperty(t,"prototype",{writable:!1}),f}(r.a.Component)},1150:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({1:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a=e.lambda,l=e.escapeExpression,s=null!=t?t:e.nullContext||{},c=e.hooks.helperMissing;return' <div class="col-6 form-group">\r\n <label class="d-block" for="'+l(a(null!=(i=null!=t?t.options:t)?i.timeId:i,t))+'">'+l((n.lang||t&&t.lang||c).call(s,"startTimeLabel",{name:"lang",hash:{},data:r}))+'</label>\r\n <input\r\n class="form-control d-inline-block col-3 time-input hour-input"\r\n type="number"\r\n placeholder="'+l((n.lang||t&&t.lang||c).call(s,"hoursPlaceholder",{name:"lang",hash:{},data:r}))+'"\r\n name="hours"\r\n autocomplete="off"\r\n '+(null!=(i=n.if.call(s,null!=(i=null!=t?t.options:t)?i.hrDisabled:i,{name:"if",hash:{},fn:e.program(2,r,0),inverse:e.noop,data:r}))?i:"")+'> <b>:</b>\r\n <input\r\n class="form-control d-inline-block col-3 time-input minute-input"\r\n type="number"\r\n placeholder="'+l((n.lang||t&&t.lang||c).call(s,"minutesPlaceholder",{name:"lang",hash:{},data:r}))+'"\r\n name="minutes"\r\n autocomplete="off"\r\n '+(null!=(i=n.if.call(s,null!=(i=null!=t?t.options:t)?i.minDisabled:i,{name:"if",hash:{},fn:e.program(2,r,0),inverse:e.noop,data:r}))?i:"")+'> <b>:</b>\r\n <input\r\n class="form-control d-inline-block col-3 time-input second-input"\r\n type="number"\r\n placeholder="'+l((n.lang||t&&t.lang||c).call(s,"secondsPlaceholder",{name:"lang",hash:{},data:r}))+'"\r\n name="seconds"\r\n id="'+l(a(null!=(i=null!=t?t.options:t)?i.timeId:i,t))+'"\r\n autocomplete="off"\r\n '+(null!=(i=n.if.call(s,null!=(i=null!=t?t.options:t)?i.secDisabled:i,{name:"if",hash:{},fn:e.program(2,r,0),inverse:e.noop,data:r}))?i:"")+'>\r\n <div class="form-feedback"></div>\r\n </div>\r\n'},2:function(e,t,n,o,r){return"disabled"},4:function(e,t,n,o,r){var i;e.propertyIsEnumerable;return' <button type="submit" class="btn btn-primary btn-sm ml-2">\r\n <span class="d-inline-block align-middle svg-container">'+(null!=(i=e.lambda(null!=(i=null!=t?t.options:t)?i.plusSvg:i,t))?i:"")+'</span>\r\n <span class="align-middle">'+e.escapeExpression((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"add",{name:"lang",hash:{},data:r}))+"</span>\r\n </button>\r\n"},6:function(e,t,n,o,r){e.propertyIsEnumerable;var i=null!=t?t:e.nullContext||{},a=e.hooks.helperMissing,l=e.escapeExpression;return' <button type="submit" class="btn btn-primary btn-sm ml-2">'+l((n.lang||t&&t.lang||a).call(i,"save",{name:"lang",hash:{},data:r}))+'</button>\r\n <button type="button" class="btn btn-secondary btn-sm cancel ml-2">'+l((n.lang||t&&t.lang||a).call(i,"cancel",{name:"lang",hash:{},data:r}))+"</button>\r\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a=e.lambda,l=e.escapeExpression,s=null!=t?t:e.nullContext||{},c=e.hooks.helperMissing;return'<div class="row">\r\n <div class="col-6 form-group">\r\n <label for="'+l(a(null!=(i=null!=t?t.options:t)?i.chapterId:i,t))+'">'+l((n.lang||t&&t.lang||c).call(s,"nameLabel",{name:"lang",hash:{},data:r}))+'</label>\r\n <input type="text" class="form-control chapter-name" name="name" id="'+l(a(null!=(i=null!=t?t.options:t)?i.chapterId:i,t))+'" placeholder="'+l((n.lang||t&&t.lang||c).call(s,"namePlaceholder",{name:"lang",hash:{},data:r}))+'" autofocus autocomplete="off">\r\n <div class="form-feedback"></div>\r\n </div>\r\n'+(null!=(i=n.if.call(s,null!=(i=null!=t?t.options:t)?i.enabled:i,{name:"if",hash:{},fn:e.program(1,r,0),inverse:e.noop,data:r}))?i:"")+'</div>\r\n\r\n<div class="row">\r\n'+(null!=(i=n.if.call(s,null!=(i=null!=t?t.options:t)?i.creating:i,{name:"if",hash:{},fn:e.program(4,r,0),inverse:e.noop,data:r}))?i:"")+"\r\n"+(null!=(i=n.if.call(s,null!=(i=null!=t?t.options:t)?i.editing:i,{name:"if",hash:{},fn:e.program(6,r,0),inverse:e.noop,data:r}))?i:"")+"</div>"},useData:!0})},1151:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({1:function(e,t,n,o,r){var i;e.propertyIsEnumerable;return e.escapeExpression(e.lambda(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.loading:i,t))},3:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a=e.lambda,l=e.escapeExpression,s=null!=t?t:e.nullContext||{};return' <div class="col-2 text-right">\r\n <a class="action edit-chapter my-2 svg-container '+l(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svgContainer:i,t))+' d-inline-block text-muted"\r\n title="'+l((n.lang||t&&t.lang||e.hooks.helperMissing).call(s,"edit",{name:"lang",hash:{},data:r}))+'">'+(null!=(i=a(null!=(i=null!=t?t.options:t)?i.editSvg:i,t))?i:"")+"</a>\r\n"+(null!=(i=n.if.call(s,null!=(i=null!=t?t.options:t)?i.allowDelete:i,{name:"if",hash:{},fn:e.program(4,r,0),inverse:e.noop,data:r}))?i:"")+" </div>\r\n"},4:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a=e.lambda,l=e.escapeExpression;return' <a class="action delete-chapter my-2 svg-container '+l(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svgContainer:i,t))+' d-inline-block text-muted"\r\n title="'+l((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"delete",{name:"lang",hash:{},data:r}))+'">'+(null!=(i=a(null!=(i=null!=t?t.options:t)?i.deleteSvg:i,t))?i:"")+"</a>\r\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a,l=null!=t?t:e.nullContext||{},s=e.lambda,c=e.escapeExpression;return'<div class="row mx-0 border-top chapter-item '+(null!=(i=n.if.call(l,null!=(i=null!=t?t.options:t)?i.loading:i,{name:"if",hash:{},fn:e.program(1,r,0),inverse:e.noop,data:r}))?i:"")+'">\r\n <div class="clickable-seek col-1">\r\n <p class="m-0 py-2">'+c(s(null!=(i=null!=t?t.options:t)?i.index:i,t))+'</p>\r\n </div>\r\n <div class="clickable-seek col-6">\r\n <p class="m-0 py-2">'+c("function"==typeof(a=null!=(a=n.name||(null!=t?t.name:t))?a:e.hooks.helperMissing)?a.call(l,{name:"name",hash:{},data:r}):a)+'</p>\r\n </div>\r\n <div class="clickable-seek col-3 text-right">\r\n <p class="m-0 py-2">'+c(s(null!=(i=null!=t?t.options:t)?i.time:i,t))+"</p>\r\n </div>\r\n"+(null!=(i=n.if.call(l,null!=(i=null!=t?t.options:t)?i.showActions:i,{name:"if",hash:{},fn:e.program(3,r,0),inverse:e.noop,data:r}))?i:"")+'</div>\r\n<div class="edit-form-region"></div>\r\n'},useData:!0})},1152:function(e,t,n){e.exports={darkBackground:"_2jtQl",loading:"_152ia",svgContainer:"xdD5o",chapterItem:"_3G38c"}},1153:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){e.propertyIsEnumerable;var i=null!=t?t:e.nullContext||{},a=e.hooks.helperMissing,l=e.escapeExpression;return"<h5>"+l((n.lang||t&&t.lang||a).call(i,"chapters",{name:"lang",hash:{},data:r}))+'</h5>\r\n<div class="row mt-3 m-0 border-bottom">\r\n <div class="col-1">\r\n <label>#</label>\r\n </div>\r\n <div class="col-6">\r\n <label>'+l((n.lang||t&&t.lang||a).call(i,"nameLabel",{name:"lang",hash:{},data:r}))+'</label>\r\n </div>\r\n <div class="col-3 text-right">\r\n <label>'+l((n.lang||t&&t.lang||a).call(i,"startLabel",{name:"lang",hash:{},data:r}))+'</>\r\n </div>\r\n</div>\r\n<div class="chapter-list-region"></div>'},useData:!0})},1162:function(e,t,n){"use strict";n.d(t,"a",(function(){return g}));var o=n(2),r=n(265),i=n(12),a=n(3),l=n(306),s=n(200),c=n(1163),u=n.n(c),p=n(1164),h=n.n(p);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 o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}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,o=v(e);if(t){var r=v(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return b(this,n)}}function b(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 v(e){return(v=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&&y(e,t)}(f,e);var t,n,c,p=m(f);function f(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,f),p.call(this,e)}return t=f,(n=[{key:"initialize",value:function(){this.spinnerModel=new o.a.Model({showSpinner:this.isProcessing()}),this.listenTo(this.options.channelName,s.LibraryEditorActions.MergeChapters,this.onClickMergeChapters)}},{key:"name",get:function(){return"ConcatenateRequestComponent"}},{key:"template",get:function(){return u.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(r.c.ShowSpinner,!0),this.render()}},{key:"isProcessing",value:function(){return!(!this.model||!this.model.get("status")||this.model.get("status")!==l.a.New&&this.model.get("status")!==l.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 r.a({buttonText:e[this.options.type],extraButtonClass:"btn-primary ".concat(h.a.btn),model:this.spinnerModel,spinnerOptions:{size:i.s.Small,type:i.t.Light,extraClasses:"mx-auto"},channelName:this.options.channelName,saveEvent:s.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(r.c.ShowSpinner),failed:this.model&&this.model.get("status")&&this.model.get("status")===l.a.ConcatenationFailed}}},{key:"onRender",value:function(){this.renderButton()}}])&&d(t.prototype,n),c&&d(t,c),Object.defineProperty(t,"prototype",{writable:!1}),f}(o.a.Component)},1163:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({1:function(e,t,n,o,r){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,r,0),inverse:e.noop,data:r}))?i:""},2:function(e,t,n,o,r){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:r}))+"</p>\r\n"},4:function(e,t,n,o,r){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,r,0),inverse:e.noop,data:r}))?i:""},5:function(e,t,n,o,r){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:r}))+"</p>\r\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a=e.lambda,l=e.escapeExpression;return"<h4>"+l(a(null!=(i=null!=(i=null!=t?t.options:t)?i.componentOptions:i)?i.heading:i,t))+"</h4>\r\n<p>"+l(a(null!=(i=null!=(i=null!=t?t.options:t)?i.componentOptions:i)?i.line1:i,t))+"</p>\r\n<p>"+l(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,r,0),inverse:e.program(4,r,0),data:r}))?i:"")},useData:!0})},1164:function(e,t,n){e.exports={btn:"_59zg9"}},1197:function(e,t,n){"use strict";var o=n(2),r=n(6),i=n(16),a=n(144),l=n(12),s=n(1126),c=n(200),u=n(1151),p=n.n(u),h=n(1152),f=n.n(h);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 y(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}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,o=g(e);if(t){var r=g(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return v(this,n)}}function v(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 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&&m(e,t)}(h,e);var t,n,o,u=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),u.call(this,e)}return t=h,(n=[{key:"initialize",value:function(){this.bindListeners()}},{key:"name",get:function(){return"ChapterItemComponent"}},{key:"lang",get:function(){return"libraryEditor.chapterItem"}},{key:"instanceChannelName",get:function(){return"".concat(this.name).concat(this.cid)}},{key:"template",get:function(){return p.a}},{key:"className",get:function(){return"chapter ".concat(f.a.chapterItem)}},{key:"behaviors",get:function(){return[{behaviorClass:a.a,selector:".action"}]}},{key:"regions",value:function(){return{editForm:{replaceElement:!1,el:".edit-form-region"}}}},{key:"elements",get:function(){return{chapterItem:".chapter-item",editChapter:".edit-chapter",deleteChapter:".delete-chapter"}}},{key:"events",value:function(){return{"click @ui.editChapter":"onEditChapter","click @ui.deleteChapter":"onDeleteChapter","click .clickable-seek":"onClick"}}},{key:"bindListeners",value:function(){this.listenTo(this.instanceChannelName,c.LibraryEditorActions.CancelChapterEdit,this.onCancelEdit),this.listenTo(this.instanceChannelName,c.LibraryEditorActions.UpdateChapter,this.onUpdateChapter),this.listenTo(this.instanceChannelName,c.LibraryEditorActions.UpdateChapterTime,this.onUpdateChapterTime),this.listenTo(this.model,"change:showEditor",this.onShowEditorChange),this.listenTo(this.model,"change:loading",this.onLoadingChange);var e=this.model.collection.first();this.model!==e?this.listenTo(this.model.collection,"sort",this.render):this.listenTo(this.model.collection,"add remove sort",this.render)}},{key:"onClick",value:function(){var e=r.Radio.channel(this.options.channelName);this.model.get("isPhysicalChapter")?e.trigger(c.LibraryEditorActions.SeekToChapter,this.model.get("index")):e.trigger(c.LibraryEditorActions.UpdateChapterTime,this.model.get("startTime"))}},{key:"onLoadingChange",value:function(){var e=this.model.get("loading")?"disable":"enable";this.getUI("editChapter").tooltip(e),this.getUI("deleteChapter").tooltip(e),this.model.set("showEditor",!1,{silent:!0}),this.render()}},{key:"onShowEditorChange",value:function(){this.model.get("loading")||(this.model.get("showEditor")?this.showEditView():this.hideEditView())}},{key:"showEditView",value:function(){this.renderEditForm(),this.getUI("chapterItem").addClass(f.a.darkBackground)}},{key:"hideEditView",value:function(){this.model.set("showEditor",!1,{silent:!0}),this.getUI("chapterItem").removeClass(f.a.darkBackground),this.detachChildView("editForm")}},{key:"onCancelEdit",value:function(){this.hideEditView()}},{key:"onDeleteChapter",value:function(){this.model.get("loading")||r.Radio.channel(this.options.channelName).trigger(c.LibraryEditorActions.DeleteChapter,this.model)}},{key:"onUpdateChapter",value:function(e){r.Radio.channel(this.options.channelName).trigger(c.LibraryEditorActions.UpdateChapter,e),this.render()}},{key:"onUpdateChapterTime",value:function(e){r.Radio.channel(this.options.channelName).trigger(c.LibraryEditorActions.UpdateChapterTime,e)}},{key:"onEditChapter",value:function(){r.Radio.channel(this.options.channelName).trigger(c.LibraryEditorActions.ToggleEdit,this.model)}},{key:"canDelete",value:function(e){var t=this.model.collection.length;return 1===e&&1===t||!(1===e&&t>1)}},{key:"viewOptions",value:function(){var e=this.model.collection.indexOf(this.model)+1,t=l.x.trimToMinutes(l.x.secondsToHoursFormatted(this.model.get("startTime")));return Object.assign(Object.assign({},this.options),{styles:f.a,time:t,index:e,loading:this.model.get("loading"),allowDelete:this.canDelete(e),editSvg:i.a.getSvg(i.b.Edit),deleteSvg:i.a.getSvg(i.b.Delete)})}},{key:"renderEditForm",value:function(){this.showChildView("editForm",new s.a({model:this.model,editing:!0,channelName:this.instanceChannelName,duration:this.options.duration}))}},{key:"onBeforeDetach",value:function(){$(".tooltip").remove()}}])&&y(t.prototype,n),o&&y(t,o),Object.defineProperty(t,"prototype",{writable:!1}),h}(o.a.Component);function k(e){return(k="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 o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function E(e,t){return(E=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function O(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,o=P(e);if(t){var r=P(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return T(this,n)}}function T(e,t){if(t&&("object"===k(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 P(e){return(P=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var S=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&&E(e,t)}(i,e);var t,n,o,r=O(i);function i(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),r.call(this,e)}return t=i,(n=[{key:"initialize",value:function(){this.bindEditorListeners()}},{key:"name",get:function(){return"ChapterComponentCollection"}},{key:"className",get:function(){return"chapters"}},{key:"childView",get:function(){return w}},{key:"bindEditorListeners",value:function(){this.options.editable&&this.listenTo(this.options.channelName,c.LibraryEditorActions.ToggleEdit,this.toggleEditForm)}},{key:"toggleEditForm",value:function(e){this.collection.each((function(t){return t!==e&&t.set("showEditor",!1)})),e.set("showEditor",!e.get("showEditor"))}},{key:"childViewOptions",get:function(){return{showActions:this.options.showActions,duration:this.options.duration,channelName:this.options.channelName}}}])&&C(t.prototype,n),o&&C(t,o),Object.defineProperty(t,"prototype",{writable:!1}),i}(o.a.ComponentCollection),j=n(1153),x=n.n(j);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 _(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function I(e,t){return(I=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function D(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,o=L(e);if(t){var r=L(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return N(this,n)}}function N(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 L(e){return(L=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"a",(function(){return V}));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&&I(e,t)}(i,e);var t,n,o,r=D(i);function i(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),r.call(this,e)}return t=i,(n=[{key:"name",get:function(){return"ChaptersComponent"}},{key:"template",get:function(){return x.a}},{key:"lang",get:function(){return"libraryEditor.chapters"}},{key:"className",get:function(){return"chapters ".concat(!this.options.editable&&"py-3 border-top")}},{key:"regions",value:function(){return{chapterList:{replaceElement:!0,el:".chapter-list-region"}}}},{key:"viewOptions",value:function(){return{showHeader:this.options.showHeader}}},{key:"onRender",value:function(){this.showChildView("chapterList",new S({collection:this.collection,duration:this.options.duration,channelName:this.options.channelName,showActions:this.options.showActions,editable:this.options.editable}))}}])&&_(t.prototype,n),o&&_(t,o),Object.defineProperty(t,"prototype",{writable:!1}),i}(o.a.Component)},1293:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){return'<div class="tab-region w-100"></div>\r\n<div class="row">\r\n <div class="col-6 pt-3">\r\n <div class="webplayer-region"></div>\r\n <div class="add-chapter-region"></div>\r\n </div>\r\n <div class="col-6 mb-2 pt-3">\r\n <div class="chapter-list-region"></div>\r\n </div>\r\n</div>'},useData:!0})},1438:function(e,t,n){"use strict";n.r(t),n.d(t,"EditChaptersView",(function(){return L}));var o=n(1),r=n(2),i=n(5),a=n(3),l=n(121),s=n(371),c=n(191),u=n(12),p=n(0),h=n(201),f=n(9),d=n(4),y=n(42),m=n(1196),b=n(318),v=n(1118),g=n(1162),w=n(1126),k=n(1197),C=n(206),E=n(200),O=n(1051),T=n(1293),P=n.n(T),S=n(306),j=n(145);function x(e){return(x="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 R(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}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,o=N(e);if(t){var r=N(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return D(this,n)}}function D(e,t){if(t&&("object"===x(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 N(e){return(N=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var L=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&&_(e,t)}(D,e);var t,n,T,x=I(D);function D(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,D),x.call(this,e)}return t=D,(n=[{key:"initialize",value:function(){this.bindListeners(),this.initializeDataServices(),u.v.initBackButton()}},{key:"name",get:function(){return"EditVideoChaptersView"}},{key:"title",get:function(){return!!this.model&&this.model.get("name")}},{key:"lang",get:function(){return"libraryEditor.editChapters"}},{key:"channelName",get:function(){return"".concat(this.name).concat(this.cid)}},{key:"className",get:function(){return"bg-white p-3"}},{key:"template",get:function(){return P.a}},{key:"regions",value:function(){return{tabs:{el:".tab-region",partialLoading:f.h.EditVideoTabs},webplayer:{replaceElement:!0,el:".webplayer-region",partialLoading:f.h.WebPlayer},addChapter:{replaceElement:!0,el:".add-chapter-region",partialLoading:f.h.EditVideoChaptersForm},chapterList:{replaceElement:!0,el:".chapter-list-region",partialLoading:f.h.EditVideoChapterList}}}},{key:"bindListeners",value:function(){this.listenTo(p.e.VIDEO,"".concat(p.f.VIDEOS,":").concat(this.options.videoId,":sync"),this.render),this.listenTo(p.e.VIDEO,"".concat(p.f.VIDEOS,":").concat(this.options.videoId,":error"),this.onVideoDataError),this.listenTo(p.e.VIDEO,"".concat(p.f.VIDEO_HAS_PHYSICAL_CHAPTERS,":").concat(this.options.videoId,":sync"),this.render),this.listenTo(p.e.CHAPTER,"".concat(p.f.CONCATENATE_STATUS,":").concat(this.options.videoId,":error"),this.onConcatenateDataError),this.listenTo(this.channelName,E.LibraryEditorActions.CreateChapter,this.onCreateChapter),this.listenTo(this.channelName,E.LibraryEditorActions.UpdateChapter,this.onUpdateChapter),this.listenTo(this.channelName,E.LibraryEditorActions.DeleteChapter,this.onDeleteChapter),this.listenTo(this.channelName,E.LibraryEditorActions.UpdateChapterTime,this.onTimeInputUpdate),this.listenTo(this.channelName,E.LibraryEditorActions.SeekToChapter,this.onSeekToChapter),this.listenTo(this.channelName,E.LibraryEditorActions.MergeChapters,this.onMergeChapters)}},{key:"initializeDataServices",value:function(){this.videoDataService=i.a.getInstance(p.g.Video,this),this.chapterDataService=i.a.getInstance(p.g.Chapter,this)}},{key:"onVideoDataError",value:function(e){switch(e.type){case l.a.NotFound:r.a.ErrorHelper.throw(new C.l);break;case l.a.Forbidden:r.a.ErrorHelper.throw(new C.f)}}},{key:"onConcatenateDataError",value:function(e){e.type===l.a.NotFound&&(this.concatenateRequestNotFound=!0,this.render())}},{key:"onCreateChapter",value:function(e){0===this.chapters.length&&0!==e.startTime&&this.createChapter({name:a.a.getPhrase(this.lang,"intro"),startTime:0}),this.createChapter(e)}},{key:"createChapter",value:function(e){var t=this,n=new c.a(e);this.chapters.add(n),n.set("loading",!0),this.chapterDataService.createChapter(this.model.get("id"),e.name,e.startTime,(function(e){n.set(e.toJSON(),{silent:!0}),n.set("loading",!1),t.chapters.sort(),t.renderChapterForm(),t.logAction(e,d.UserAction.Create)}))}},{key:"onUpdateChapter",value:function(e){var t=this,n=this.chapters.find((function(t){return t.get("id")===e.id}));n.set("loading",!0);var o=b.a.updatedChaptersAlert(this.model.get("name"));this.chapterDataService.updateChapter(n.id,e.name,e.startTime,(function(e){n.set(e.toJSON(),{silent:!0}),n.set("loading",!1),t.chapters.sort(),t.logAction(e,d.UserAction.Edit)}),o)}},{key:"onDeleteChapter",value:function(e){var t=this;e.set("loading",!0),this.chapterDataService.deleteChapter(e.id,(function(){t.logAction(e,d.UserAction.Delete),t.chapters.remove(e)}))}},{key:"onMergeChapters",value:function(){var e=this;this.chapterDataService.addConcatenateRequest(this.options.videoId,(function(){e.pollConcatenation()}))}},{key:"onTimeInputUpdate",value:function(e){e>=0&&e<=u.x.millisecondsToSeconds(this.model.get("duration"))&&this.player.seekTo(e)}},{key:"logAction",value:function(e,t){var n=Object.assign({videoId:this.model.get("id")},e.pick("id","name","startTime"));y.a.logUserAction(n,{actionType:t,entity:d.EntityType.Chapter,location:d.LocationContext.EditVideoChapters})}},{key:"onSeekToChapter",value:function(e){e<0||this.player.seekToChapter(e)}},{key:"startPollingConcatenation",value:function(){if(this.concatenateRequest){var e=[S.a.SingleFile,S.a.ConcatenationFailed];o.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")!==S.a.SingleFile)return setTimeout((function(){return e.pollConcatenation()}),5e3),void e.renderConcatenationRequest();e.videoDataService.clearPhysicialChaptersCache(),e.render()}))}},{key:"renderChapterList",value:function(){this.showChildView("chapterList",new k.a({collection:this.chapters,duration:this.model.get("duration"),channelName:this.channelName,showActions:!this.hasPhysicalChapters.get("value"),editable:!this.hasPhysicalChapters.get("value"),showHeader:!0}))}},{key:"renderChapterForm",value:function(){this.showChildView("addChapter",new w.a({model:new c.a,collection:this.chapters,creating:!0,duration:this.model.get("duration"),channelName:this.channelName,playerViewModelKey:"".concat(p.y.NAME,"-").concat(this.model.get("id"))}))}},{key:"renderConcatenationRequest",value:function(){this.isRendered()&&this.showChildView("addChapter",new g.a({type:"chapters",channelName:this.channelName,model:this.concatenateRequest}))}},{key:"renderEditComponents",value:function(){if(this.hasPhysicalChapters.get("value"))return this.renderConcatenationRequest(),void this.mapPhysicalChapters();this.renderChapterForm(),this.renderChapterList()}},{key:"renderTabs",value:function(){this.showChildView("tabs",new v.a({tabs:u.v.getEditVideoTabs(this.options.videoId),activeTab:".edit-chapters-applink",goBackTab:u.v.getBackButton(this.options.videoId)}))}},{key:"renderWebPlayer",value:function(){this.player=new m.a({model:this.model,webPlayerUrl:this.config.get("webPlayerUrl"),captureAnalytics:!1,currentUser:this.currentUser}),this.showChildView("webplayer",this.player)}},{key:"mapPhysicalChapters",value:function(){var e=this;this.renderPartialLoading("chapterList"),this.player.query("getChapters",(function(t){e.chapters=new s.a(O.a.mapPhysicalChapters(t)),e.renderChapterList()}))}},{key:"redirectToVideoDetails",value:function(){r.a.AppLinkHelper.trigger({application:p.b.LIBRARY_EDITOR,action:p.a.LibraryEditor.VIDEO_DETAILS,args:[this.model.get("id")]},{replace:!0})}},{key:"fetchData",value:function(){var e=this;if(this.model=this.videoDataService.getVideo(this.options.videoId),this.model){if(!u.j.canEditVideo(this.model))return void this.redirectToVideoDetails();this.chapters=this.model.chapters}this.hasPhysicalChapters=this.videoDataService.hasPhysicalChapters(this.options.videoId),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:"requiredResources",get:function(){return{config:h.b.config,currentUser:j.b.currentUser}}},{key:"onBeforeRender",value:function(){return this.fetchData(),this.shouldRender()}},{key:"onRender",value:function(){this.renderTabs(),this.renderWebPlayer(),this.renderEditComponents(),this.startPollingConcatenation()}}])&&R(t.prototype,n),T&&R(t,T),Object.defineProperty(t,"prototype",{writable:!1}),D}(r.a.View)}}]);
1
+ (window.webpackJsonp_clickview_library_editor=window.webpackJsonp_clickview_library_editor||[]).push([[31],{1102:function(e,t,n){"use strict";n.d(t,"a",(function(){return y}));var o=n(1),r=n(2),i=n(1103),a=n.n(i),l=n(1104),s=n.n(l);function c(e){return(c="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 u(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function p(e,t){return(p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function h(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,o=d(e);if(t){var r=d(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return f(this,n)}}function f(e,t){if(t&&("object"===c(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)}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)}(l,e);var t,n,r,i=h(l);function l(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),i.call(this,e)}return t=l,(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 s.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=o.first(this.options.tabs);n&&(n.active=!0)}}},{key:"onBeforeRender",value:function(){this.setActiveTab()}}])&&u(t.prototype,n),r&&u(t,r),Object.defineProperty(t,"prototype",{writable:!1}),l}(r.a.Component)},1103:function(e,t,n){e.exports={link:"_5idZs",active:"_3Ty4M"}},1104:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({1:function(e,t,n,o,r,i,a){var l;e.propertyIsEnumerable;return null!=(l=n.unless.call(null!=t?t:e.nullContext||{},null!=t?t.hide:t,{name:"unless",hash:{},fn:e.program(2,r,0,i,a),inverse:e.noop,data:r}))?l:""},2:function(e,t,n,o,r,i,a){e.propertyIsEnumerable;var l,s=e.lambda,c=e.escapeExpression;return' <a class="'+c(s(null!=(l=null!=(l=null!=a[1]?a[1].options:a[1])?l.styles:l)?l.link:l,t))+" p-2 "+c(s(null!=t?t.link:t,t))+" "+(null!=(l=n.if.call(null!=t?t:e.nullContext||{},null!=t?t.active:t,{name:"if",hash:{},fn:e.program(3,r,0,i,a),inverse:e.noop,data:r}))?l:"")+'">'+c(s(null!=t?t.name:t,t))+"</a>\r\n"},3:function(e,t,n,o,r,i,a){var l;e.propertyIsEnumerable;return e.escapeExpression(e.lambda(null!=(l=null!=(l=null!=a[1]?a[1].options:a[1])?l.styles:l)?l.active:l,t))+" border-bottom border-primary text-primary"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r,i,a){var l;e.propertyIsEnumerable;return null!=(l=n.each.call(null!=t?t:e.nullContext||{},null!=(l=null!=t?t.options:t)?l.tabs:l,{name:"each",hash:{},fn:e.program(1,r,0,i,a),inverse:e.noop,data:r}))?l:""},useData:!0,useDepths:!0})},1122:function(e,t,n){"use strict";n.d(t,"a",(function(){return v}));var o=n(6),r=n(2),i=n(16),a=n(1123),l=n.n(a),s=n(1124),c=n.n(s),u=n(0),p=n(1102);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 f(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function d(e,t){return(d=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,o=b(e);if(t){var r=b(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return m(this,n)}}function m(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 b(e){return(b=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&&d(e,t)}(s,e);var t,n,r,a=y(s);function s(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),a.call(this,e)}return t=s,(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 c.a}},{key:"appLinks",get:function(){var e,t,n,o=this.options.goBackTab.link;return e={},t=o.selector,n=o.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:l.a,backTab:e,backArrow:i.a.getSvg(i.b.ArrowLeft)}}},{key:"onSave",value:function(){o.Radio.channel(u.b.LIBRARY_EDITOR).trigger(u.a.LibraryEditor.SAVE_VIDEO)}},{key:"onRender",value:function(){this.showChildView("tabs",new p.a({tabs:this.options.tabs,activeTab:this.options.activeTab}))}}])&&f(t.prototype,n),r&&f(t,r),Object.defineProperty(t,"prototype",{writable:!1}),s}(r.a.Component)},1123:function(e,t,n){e.exports={svgContainer:"_27gR6"}},1124:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a=e.lambda,l=e.escapeExpression;return'<div class="row">\r\n <h4>\r\n <a class="d-inline-flex align-items-center '+l(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.link:i,t))+" "+l(a(null!=(i=null!=(i=null!=t?t.options:t)?i.backTab:i)?i.link:i,t))+'">\r\n <span class="'+l(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 "+l(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})},1130:function(e,t,n){"use strict";n.d(t,"a",(function(){return g}));var o=n(6),r=n(2),i=n(30),a=n(16),l=n(305),s=n(12),c=n(1059),u=n(201),p=n(1154),h=n.n(p);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 o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}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,o=v(e);if(t){var r=v(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return b(this,n)}}function b(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 v(e){return(v=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&&y(e,t)}(f,e);var t,n,r,p=m(f);function f(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,f),p.call(this,e)}return t=f,(n=[{key:"initialize",value:function(){this.options.playerViewModelKey&&this.listenToPlayerViewModel(),this.initViewModel(),this.options.editing&&this.syncTime()}},{key:"name",get:function(){return"ChapterFormComponent"}},{key:"lang",get:function(){return"libraryEditor.chapterForm"}},{key:"tagName",get:function(){return"form"}},{key:"viewModelName",get:function(){return"".concat(this.name,":").concat(this.cid)}},{key:"template",get:function(){return h.a}},{key:"className",get:function(){return this.options.creating?"py-3":"border-top p-2"}},{key:"behaviors",get:function(){return[{behaviorClass:l.a,bindViewModel:!0},{behaviorClass:l.f,bindViewModel:!0}]}},{key:"events",value:function(){return{submit:"onSubmit","change .chapter-name":"validateName","keyup .chapter-name":"validateName","change .time-input":"onTimeInputUpdate","click .time-input":"onTimeInputUpdate","keyup .time-input":"onTimeInputUpdate","click .cancel":"destroyView"}}},{key:"bindings",get:function(){return{"[name=name]":{observe:"name",setOptions:{validate:!0}},"[name=hours]":{observe:"hours",setOptions:{validate:!0}},"[name=minutes]":{observe:"minutes",setOptions:{validate:!0}},"[name=seconds]":{observe:"seconds",setOptions:{validate:!0}}}}},{key:"initViewModel",value:function(){this.viewModel=i.a.get(this.viewModelName,this.model.toJSON())}},{key:"listenToPlayerViewModel",value:function(){var e=i.a.get(this.options.playerViewModelKey);this.listenTo(e,"change:currenttime",this.updateTime)}},{key:"updateTime",value:function(e){this.webPlayerTime=e.get("currenttime"),this.syncTime()}},{key:"syncTime",value:function(){var e=this.viewModel.get("startTime")||this.webPlayerTime;this.viewModel.set({hours:s.x.getHoursComponent(e),minutes:s.x.getMinutesComponent(e),seconds:s.x.getSecondsComponent(e)})}},{key:"getNewTime",value:function(){return this.enabled()?s.x.parseTime(this.viewModel.pick("hours","minutes","seconds")):0}},{key:"enabled",value:function(){return this.options.creating||0!==this.model.collection.indexOf(this.model)}},{key:"maxTimes",value:function(){var e=s.x.millisecondsToSeconds(this.options.duration),t=s.x.getHoursComponent(e),n=t>0?59:s.x.getMinutesComponent(e);return{maxHr:t,maxMin:n,maxSec:n>0?59:s.x.getSecondsComponent(e)}}},{key:"onTimeInputUpdate",value:function(){o.Radio.channel(this.options.channelName).trigger(u.LibraryEditorActions.UpdateChapterTime,this.getNewTime()),this.validateStartTime()}},{key:"destroyView",value:function(){o.Radio.channel(this.options.channelName).trigger(u.LibraryEditorActions.CancelChapterEdit),this.destroy()}},{key:"onSubmit",value:function(e){if(e.preventDefault(),!this.validate())return!1;var t={id:this.viewModel.get("id"),name:this.viewModel.get("name"),startTime:this.getNewTime()},n=o.Radio.channel(this.options.channelName),r=u.LibraryEditorActions.CreateChapter;this.options.editing&&(r=u.LibraryEditorActions.UpdateChapter),n.trigger(r,t),this.stopListening(this.viewModel),i.a.clear(this.viewModelName)}},{key:"validate",value:function(){this.viewModel.validate();var e=this.validateStartTime(),t=this.validateName();return this.viewModel.isValid()&&e&&t}},{key:"validateStartTime",value:function(){var e=this,t=o.Validation.callbacks,n=t.valid,r=t.invalid,i=this.model.collection||this.options.collection,a=this.getNewTime(),l=c.a.isValidChapterTime(this.model,a,this.options.duration,i),s=[],u=["seconds","minutes","hours"];return a<0?s=u:l&&(s.push("seconds"),a>59&&s.push("minutes"),a>3540&&s.push("hours")),u.forEach((function(t){return n(e,t,null)})),s.forEach((function(t){return r(e,t,l,null)})),!l}},{key:"validateName",value:function(e){if(!e||13!==e.keyCode){var t=o.Validation.callbacks,n=t.valid,r=t.invalid,i=this.model.collection||this.options.collection,a=c.a.isValidChapterName(this.model,this.viewModel.get("name"),i);return a?r(this,"name",a,null):n(this,"name",null),!a}}},{key:"viewOptions",value:function(){var e=this.maxTimes(),t=e.maxHr,n=e.maxMin,o=0===e.maxSec,r=0===n,i=0===t;return Object.assign(Object.assign({},this.options),{enabled:this.enabled(),timeId:"".concat(this.cid,"-time"),chapterId:"".concat(this.cid,"-chapter-name"),plusSvg:a.a.getSvg(a.b.Plus),secDisabled:o,minDisabled:r,hrDisabled:i})}}])&&d(t.prototype,n),r&&d(t,r),Object.defineProperty(t,"prototype",{writable:!1}),f}(r.a.Component)},1154:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({1:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a=e.lambda,l=e.escapeExpression,s=null!=t?t:e.nullContext||{},c=e.hooks.helperMissing;return' <div class="col-6 form-group">\r\n <label class="d-block" for="'+l(a(null!=(i=null!=t?t.options:t)?i.timeId:i,t))+'">'+l((n.lang||t&&t.lang||c).call(s,"startTimeLabel",{name:"lang",hash:{},data:r}))+'</label>\r\n <input\r\n class="form-control d-inline-block col-3 time-input hour-input"\r\n type="number"\r\n placeholder="'+l((n.lang||t&&t.lang||c).call(s,"hoursPlaceholder",{name:"lang",hash:{},data:r}))+'"\r\n name="hours"\r\n autocomplete="off"\r\n '+(null!=(i=n.if.call(s,null!=(i=null!=t?t.options:t)?i.hrDisabled:i,{name:"if",hash:{},fn:e.program(2,r,0),inverse:e.noop,data:r}))?i:"")+'> <b>:</b>\r\n <input\r\n class="form-control d-inline-block col-3 time-input minute-input"\r\n type="number"\r\n placeholder="'+l((n.lang||t&&t.lang||c).call(s,"minutesPlaceholder",{name:"lang",hash:{},data:r}))+'"\r\n name="minutes"\r\n autocomplete="off"\r\n '+(null!=(i=n.if.call(s,null!=(i=null!=t?t.options:t)?i.minDisabled:i,{name:"if",hash:{},fn:e.program(2,r,0),inverse:e.noop,data:r}))?i:"")+'> <b>:</b>\r\n <input\r\n class="form-control d-inline-block col-3 time-input second-input"\r\n type="number"\r\n placeholder="'+l((n.lang||t&&t.lang||c).call(s,"secondsPlaceholder",{name:"lang",hash:{},data:r}))+'"\r\n name="seconds"\r\n id="'+l(a(null!=(i=null!=t?t.options:t)?i.timeId:i,t))+'"\r\n autocomplete="off"\r\n '+(null!=(i=n.if.call(s,null!=(i=null!=t?t.options:t)?i.secDisabled:i,{name:"if",hash:{},fn:e.program(2,r,0),inverse:e.noop,data:r}))?i:"")+'>\r\n <div class="form-feedback"></div>\r\n </div>\r\n'},2:function(e,t,n,o,r){return"disabled"},4:function(e,t,n,o,r){var i;e.propertyIsEnumerable;return' <button type="submit" class="btn btn-primary btn-sm ml-2">\r\n <span class="d-inline-block align-middle svg-container">'+(null!=(i=e.lambda(null!=(i=null!=t?t.options:t)?i.plusSvg:i,t))?i:"")+'</span>\r\n <span class="align-middle">'+e.escapeExpression((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"add",{name:"lang",hash:{},data:r}))+"</span>\r\n </button>\r\n"},6:function(e,t,n,o,r){e.propertyIsEnumerable;var i=null!=t?t:e.nullContext||{},a=e.hooks.helperMissing,l=e.escapeExpression;return' <button type="submit" class="btn btn-primary btn-sm ml-2">'+l((n.lang||t&&t.lang||a).call(i,"save",{name:"lang",hash:{},data:r}))+'</button>\r\n <button type="button" class="btn btn-secondary btn-sm cancel ml-2">'+l((n.lang||t&&t.lang||a).call(i,"cancel",{name:"lang",hash:{},data:r}))+"</button>\r\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a=e.lambda,l=e.escapeExpression,s=null!=t?t:e.nullContext||{},c=e.hooks.helperMissing;return'<div class="row">\r\n <div class="col-6 form-group">\r\n <label for="'+l(a(null!=(i=null!=t?t.options:t)?i.chapterId:i,t))+'">'+l((n.lang||t&&t.lang||c).call(s,"nameLabel",{name:"lang",hash:{},data:r}))+'</label>\r\n <input type="text" class="form-control chapter-name" name="name" id="'+l(a(null!=(i=null!=t?t.options:t)?i.chapterId:i,t))+'" placeholder="'+l((n.lang||t&&t.lang||c).call(s,"namePlaceholder",{name:"lang",hash:{},data:r}))+'" autofocus autocomplete="off">\r\n <div class="form-feedback"></div>\r\n </div>\r\n'+(null!=(i=n.if.call(s,null!=(i=null!=t?t.options:t)?i.enabled:i,{name:"if",hash:{},fn:e.program(1,r,0),inverse:e.noop,data:r}))?i:"")+'</div>\r\n\r\n<div class="row">\r\n'+(null!=(i=n.if.call(s,null!=(i=null!=t?t.options:t)?i.creating:i,{name:"if",hash:{},fn:e.program(4,r,0),inverse:e.noop,data:r}))?i:"")+"\r\n"+(null!=(i=n.if.call(s,null!=(i=null!=t?t.options:t)?i.editing:i,{name:"if",hash:{},fn:e.program(6,r,0),inverse:e.noop,data:r}))?i:"")+"</div>"},useData:!0})},1155:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({1:function(e,t,n,o,r){var i;e.propertyIsEnumerable;return e.escapeExpression(e.lambda(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.loading:i,t))},3:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a=e.lambda,l=e.escapeExpression,s=null!=t?t:e.nullContext||{};return' <div class="col-2 text-right">\r\n <a class="action edit-chapter my-2 svg-container '+l(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svgContainer:i,t))+' d-inline-block text-muted"\r\n title="'+l((n.lang||t&&t.lang||e.hooks.helperMissing).call(s,"edit",{name:"lang",hash:{},data:r}))+'">'+(null!=(i=a(null!=(i=null!=t?t.options:t)?i.editSvg:i,t))?i:"")+"</a>\r\n"+(null!=(i=n.if.call(s,null!=(i=null!=t?t.options:t)?i.allowDelete:i,{name:"if",hash:{},fn:e.program(4,r,0),inverse:e.noop,data:r}))?i:"")+" </div>\r\n"},4:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a=e.lambda,l=e.escapeExpression;return' <a class="action delete-chapter my-2 svg-container '+l(a(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svgContainer:i,t))+' d-inline-block text-muted"\r\n title="'+l((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"delete",{name:"lang",hash:{},data:r}))+'">'+(null!=(i=a(null!=(i=null!=t?t.options:t)?i.deleteSvg:i,t))?i:"")+"</a>\r\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a,l=null!=t?t:e.nullContext||{},s=e.lambda,c=e.escapeExpression;return'<div class="row mx-0 border-top chapter-item '+(null!=(i=n.if.call(l,null!=(i=null!=t?t.options:t)?i.loading:i,{name:"if",hash:{},fn:e.program(1,r,0),inverse:e.noop,data:r}))?i:"")+'">\r\n <div class="clickable-seek col-1">\r\n <p class="m-0 py-2">'+c(s(null!=(i=null!=t?t.options:t)?i.index:i,t))+'</p>\r\n </div>\r\n <div class="clickable-seek col-6">\r\n <p class="m-0 py-2">'+c("function"==typeof(a=null!=(a=n.name||(null!=t?t.name:t))?a:e.hooks.helperMissing)?a.call(l,{name:"name",hash:{},data:r}):a)+'</p>\r\n </div>\r\n <div class="clickable-seek col-3 text-right">\r\n <p class="m-0 py-2">'+c(s(null!=(i=null!=t?t.options:t)?i.time:i,t))+"</p>\r\n </div>\r\n"+(null!=(i=n.if.call(l,null!=(i=null!=t?t.options:t)?i.showActions:i,{name:"if",hash:{},fn:e.program(3,r,0),inverse:e.noop,data:r}))?i:"")+'</div>\r\n<div class="edit-form-region"></div>\r\n'},useData:!0})},1156:function(e,t,n){e.exports={darkBackground:"_2jtQl",loading:"_152ia",svgContainer:"xdD5o",chapterItem:"_3G38c"}},1157:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){e.propertyIsEnumerable;var i=null!=t?t:e.nullContext||{},a=e.hooks.helperMissing,l=e.escapeExpression;return"<h5>"+l((n.lang||t&&t.lang||a).call(i,"chapters",{name:"lang",hash:{},data:r}))+'</h5>\r\n<div class="row mt-3 m-0 border-bottom">\r\n <div class="col-1">\r\n <label>#</label>\r\n </div>\r\n <div class="col-6">\r\n <label>'+l((n.lang||t&&t.lang||a).call(i,"nameLabel",{name:"lang",hash:{},data:r}))+'</label>\r\n </div>\r\n <div class="col-3 text-right">\r\n <label>'+l((n.lang||t&&t.lang||a).call(i,"startLabel",{name:"lang",hash:{},data:r}))+'</>\r\n </div>\r\n</div>\r\n<div class="chapter-list-region"></div>'},useData:!0})},1166:function(e,t,n){"use strict";n.d(t,"a",(function(){return g}));var o=n(2),r=n(265),i=n(12),a=n(3),l=n(306),s=n(201),c=n(1167),u=n.n(c),p=n(1168),h=n.n(p);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 o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}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,o=v(e);if(t){var r=v(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return b(this,n)}}function b(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 v(e){return(v=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&&y(e,t)}(f,e);var t,n,c,p=m(f);function f(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,f),p.call(this,e)}return t=f,(n=[{key:"initialize",value:function(){this.spinnerModel=new o.a.Model({showSpinner:this.isProcessing()}),this.listenTo(this.options.channelName,s.LibraryEditorActions.MergeChapters,this.onClickMergeChapters)}},{key:"name",get:function(){return"ConcatenateRequestComponent"}},{key:"template",get:function(){return u.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(r.c.ShowSpinner,!0),this.render()}},{key:"isProcessing",value:function(){return!(!this.model||!this.model.get("status")||this.model.get("status")!==l.a.New&&this.model.get("status")!==l.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 r.a({buttonText:e[this.options.type],extraButtonClass:"btn-primary ".concat(h.a.btn),model:this.spinnerModel,spinnerOptions:{size:i.s.Small,type:i.t.Light,extraClasses:"mx-auto"},channelName:this.options.channelName,saveEvent:s.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(r.c.ShowSpinner),failed:this.model&&this.model.get("status")&&this.model.get("status")===l.a.ConcatenationFailed}}},{key:"onRender",value:function(){this.renderButton()}}])&&d(t.prototype,n),c&&d(t,c),Object.defineProperty(t,"prototype",{writable:!1}),f}(o.a.Component)},1167:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({1:function(e,t,n,o,r){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,r,0),inverse:e.noop,data:r}))?i:""},2:function(e,t,n,o,r){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:r}))+"</p>\r\n"},4:function(e,t,n,o,r){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,r,0),inverse:e.noop,data:r}))?i:""},5:function(e,t,n,o,r){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:r}))+"</p>\r\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){e.propertyIsEnumerable;var i,a=e.lambda,l=e.escapeExpression;return"<h4>"+l(a(null!=(i=null!=(i=null!=t?t.options:t)?i.componentOptions:i)?i.heading:i,t))+"</h4>\r\n<p>"+l(a(null!=(i=null!=(i=null!=t?t.options:t)?i.componentOptions:i)?i.line1:i,t))+"</p>\r\n<p>"+l(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,r,0),inverse:e.program(4,r,0),data:r}))?i:"")},useData:!0})},1168:function(e,t,n){e.exports={btn:"_59zg9"}},1201:function(e,t,n){"use strict";var o=n(2),r=n(6),i=n(16),a=n(144),l=n(12),s=n(1130),c=n(201),u=n(1155),p=n.n(u),h=n(1156),f=n.n(h);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 y(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}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,o=g(e);if(t){var r=g(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return v(this,n)}}function v(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 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&&m(e,t)}(h,e);var t,n,o,u=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),u.call(this,e)}return t=h,(n=[{key:"initialize",value:function(){this.bindListeners()}},{key:"name",get:function(){return"ChapterItemComponent"}},{key:"lang",get:function(){return"libraryEditor.chapterItem"}},{key:"instanceChannelName",get:function(){return"".concat(this.name).concat(this.cid)}},{key:"template",get:function(){return p.a}},{key:"className",get:function(){return"chapter ".concat(f.a.chapterItem)}},{key:"behaviors",get:function(){return[{behaviorClass:a.a,selector:".action"}]}},{key:"regions",value:function(){return{editForm:{replaceElement:!1,el:".edit-form-region"}}}},{key:"elements",get:function(){return{chapterItem:".chapter-item",editChapter:".edit-chapter",deleteChapter:".delete-chapter"}}},{key:"events",value:function(){return{"click @ui.editChapter":"onEditChapter","click @ui.deleteChapter":"onDeleteChapter","click .clickable-seek":"onClick"}}},{key:"bindListeners",value:function(){this.listenTo(this.instanceChannelName,c.LibraryEditorActions.CancelChapterEdit,this.onCancelEdit),this.listenTo(this.instanceChannelName,c.LibraryEditorActions.UpdateChapter,this.onUpdateChapter),this.listenTo(this.instanceChannelName,c.LibraryEditorActions.UpdateChapterTime,this.onUpdateChapterTime),this.listenTo(this.model,"change:showEditor",this.onShowEditorChange),this.listenTo(this.model,"change:loading",this.onLoadingChange);var e=this.model.collection.first();this.model!==e?this.listenTo(this.model.collection,"sort",this.render):this.listenTo(this.model.collection,"add remove sort",this.render)}},{key:"onClick",value:function(){var e=r.Radio.channel(this.options.channelName);this.model.get("isPhysicalChapter")?e.trigger(c.LibraryEditorActions.SeekToChapter,this.model.get("index")):e.trigger(c.LibraryEditorActions.UpdateChapterTime,this.model.get("startTime"))}},{key:"onLoadingChange",value:function(){var e=this.model.get("loading")?"disable":"enable";this.getUI("editChapter").tooltip(e),this.getUI("deleteChapter").tooltip(e),this.model.set("showEditor",!1,{silent:!0}),this.render()}},{key:"onShowEditorChange",value:function(){this.model.get("loading")||(this.model.get("showEditor")?this.showEditView():this.hideEditView())}},{key:"showEditView",value:function(){this.renderEditForm(),this.getUI("chapterItem").addClass(f.a.darkBackground)}},{key:"hideEditView",value:function(){this.model.set("showEditor",!1,{silent:!0}),this.getUI("chapterItem").removeClass(f.a.darkBackground),this.detachChildView("editForm")}},{key:"onCancelEdit",value:function(){this.hideEditView()}},{key:"onDeleteChapter",value:function(){this.model.get("loading")||r.Radio.channel(this.options.channelName).trigger(c.LibraryEditorActions.DeleteChapter,this.model)}},{key:"onUpdateChapter",value:function(e){r.Radio.channel(this.options.channelName).trigger(c.LibraryEditorActions.UpdateChapter,e),this.render()}},{key:"onUpdateChapterTime",value:function(e){r.Radio.channel(this.options.channelName).trigger(c.LibraryEditorActions.UpdateChapterTime,e)}},{key:"onEditChapter",value:function(){r.Radio.channel(this.options.channelName).trigger(c.LibraryEditorActions.ToggleEdit,this.model)}},{key:"canDelete",value:function(e){var t=this.model.collection.length;return 1===e&&1===t||!(1===e&&t>1)}},{key:"viewOptions",value:function(){var e=this.model.collection.indexOf(this.model)+1,t=l.x.trimToMinutes(l.x.secondsToHoursFormatted(this.model.get("startTime")));return Object.assign(Object.assign({},this.options),{styles:f.a,time:t,index:e,loading:this.model.get("loading"),allowDelete:this.canDelete(e),editSvg:i.a.getSvg(i.b.Edit),deleteSvg:i.a.getSvg(i.b.Delete)})}},{key:"renderEditForm",value:function(){this.showChildView("editForm",new s.a({model:this.model,editing:!0,channelName:this.instanceChannelName,duration:this.options.duration}))}},{key:"onBeforeDetach",value:function(){$(".tooltip").remove()}}])&&y(t.prototype,n),o&&y(t,o),Object.defineProperty(t,"prototype",{writable:!1}),h}(o.a.Component);function k(e){return(k="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 o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function E(e,t){return(E=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function O(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,o=P(e);if(t){var r=P(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return T(this,n)}}function T(e,t){if(t&&("object"===k(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 P(e){return(P=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var S=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&&E(e,t)}(i,e);var t,n,o,r=O(i);function i(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),r.call(this,e)}return t=i,(n=[{key:"initialize",value:function(){this.bindEditorListeners()}},{key:"name",get:function(){return"ChapterComponentCollection"}},{key:"className",get:function(){return"chapters"}},{key:"childView",get:function(){return w}},{key:"bindEditorListeners",value:function(){this.options.editable&&this.listenTo(this.options.channelName,c.LibraryEditorActions.ToggleEdit,this.toggleEditForm)}},{key:"toggleEditForm",value:function(e){this.collection.each((function(t){return t!==e&&t.set("showEditor",!1)})),e.set("showEditor",!e.get("showEditor"))}},{key:"childViewOptions",get:function(){return{showActions:this.options.showActions,duration:this.options.duration,channelName:this.options.channelName}}}])&&C(t.prototype,n),o&&C(t,o),Object.defineProperty(t,"prototype",{writable:!1}),i}(o.a.ComponentCollection),j=n(1157),x=n.n(j);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 _(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function I(e,t){return(I=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function D(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,o=L(e);if(t){var r=L(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return N(this,n)}}function N(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 L(e){return(L=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"a",(function(){return V}));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&&I(e,t)}(i,e);var t,n,o,r=D(i);function i(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),r.call(this,e)}return t=i,(n=[{key:"name",get:function(){return"ChaptersComponent"}},{key:"template",get:function(){return x.a}},{key:"lang",get:function(){return"libraryEditor.chapters"}},{key:"className",get:function(){return"chapters ".concat(!this.options.editable&&"py-3 border-top")}},{key:"regions",value:function(){return{chapterList:{replaceElement:!0,el:".chapter-list-region"}}}},{key:"viewOptions",value:function(){return{showHeader:this.options.showHeader}}},{key:"onRender",value:function(){this.showChildView("chapterList",new S({collection:this.collection,duration:this.options.duration,channelName:this.options.channelName,showActions:this.options.showActions,editable:this.options.editable}))}}])&&_(t.prototype,n),o&&_(t,o),Object.defineProperty(t,"prototype",{writable:!1}),i}(o.a.Component)},1297:function(e,t,n){var o=n(10);e.exports=(o.default||o).template({compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){return'<div class="tab-region w-100"></div>\r\n<div class="row">\r\n <div class="col-6 pt-3">\r\n <div class="webplayer-region"></div>\r\n <div class="add-chapter-region"></div>\r\n </div>\r\n <div class="col-6 mb-2 pt-3">\r\n <div class="chapter-list-region"></div>\r\n </div>\r\n</div>'},useData:!0})},1442:function(e,t,n){"use strict";n.r(t),n.d(t,"EditChaptersView",(function(){return L}));var o=n(1),r=n(2),i=n(5),a=n(3),l=n(121),s=n(371),c=n(191),u=n(12),p=n(0),h=n(202),f=n(9),d=n(4),y=n(42),m=n(1200),b=n(318),v=n(1122),g=n(1166),w=n(1130),k=n(1201),C=n(207),E=n(201),O=n(1055),T=n(1297),P=n.n(T),S=n(306),j=n(145);function x(e){return(x="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 R(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}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,o=N(e);if(t){var r=N(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return D(this,n)}}function D(e,t){if(t&&("object"===x(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 N(e){return(N=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var L=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&&_(e,t)}(D,e);var t,n,T,x=I(D);function D(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,D),x.call(this,e)}return t=D,(n=[{key:"initialize",value:function(){this.bindListeners(),this.initializeDataServices(),u.v.initBackButton()}},{key:"name",get:function(){return"EditVideoChaptersView"}},{key:"title",get:function(){return!!this.model&&this.model.get("name")}},{key:"lang",get:function(){return"libraryEditor.editChapters"}},{key:"channelName",get:function(){return"".concat(this.name).concat(this.cid)}},{key:"className",get:function(){return"bg-white p-3"}},{key:"template",get:function(){return P.a}},{key:"regions",value:function(){return{tabs:{el:".tab-region",partialLoading:f.h.EditVideoTabs},webplayer:{replaceElement:!0,el:".webplayer-region",partialLoading:f.h.WebPlayer},addChapter:{replaceElement:!0,el:".add-chapter-region",partialLoading:f.h.EditVideoChaptersForm},chapterList:{replaceElement:!0,el:".chapter-list-region",partialLoading:f.h.EditVideoChapterList}}}},{key:"bindListeners",value:function(){this.listenTo(p.e.VIDEO,"".concat(p.f.VIDEOS,":").concat(this.options.videoId,":sync"),this.render),this.listenTo(p.e.VIDEO,"".concat(p.f.VIDEOS,":").concat(this.options.videoId,":error"),this.onVideoDataError),this.listenTo(p.e.VIDEO,"".concat(p.f.VIDEO_HAS_PHYSICAL_CHAPTERS,":").concat(this.options.videoId,":sync"),this.render),this.listenTo(p.e.CHAPTER,"".concat(p.f.CONCATENATE_STATUS,":").concat(this.options.videoId,":error"),this.onConcatenateDataError),this.listenTo(this.channelName,E.LibraryEditorActions.CreateChapter,this.onCreateChapter),this.listenTo(this.channelName,E.LibraryEditorActions.UpdateChapter,this.onUpdateChapter),this.listenTo(this.channelName,E.LibraryEditorActions.DeleteChapter,this.onDeleteChapter),this.listenTo(this.channelName,E.LibraryEditorActions.UpdateChapterTime,this.onTimeInputUpdate),this.listenTo(this.channelName,E.LibraryEditorActions.SeekToChapter,this.onSeekToChapter),this.listenTo(this.channelName,E.LibraryEditorActions.MergeChapters,this.onMergeChapters)}},{key:"initializeDataServices",value:function(){this.videoDataService=i.a.getInstance(p.g.Video,this),this.chapterDataService=i.a.getInstance(p.g.Chapter,this)}},{key:"onVideoDataError",value:function(e){switch(e.type){case l.a.NotFound:r.a.ErrorHelper.throw(new C.l);break;case l.a.Forbidden:r.a.ErrorHelper.throw(new C.f)}}},{key:"onConcatenateDataError",value:function(e){e.type===l.a.NotFound&&(this.concatenateRequestNotFound=!0,this.render())}},{key:"onCreateChapter",value:function(e){0===this.chapters.length&&0!==e.startTime&&this.createChapter({name:a.a.getPhrase(this.lang,"intro"),startTime:0}),this.createChapter(e)}},{key:"createChapter",value:function(e){var t=this,n=new c.a(e);this.chapters.add(n),n.set("loading",!0),this.chapterDataService.createChapter(this.model.get("id"),e.name,e.startTime,(function(e){n.set(e.toJSON(),{silent:!0}),n.set("loading",!1),t.chapters.sort(),t.renderChapterForm(),t.logAction(e,d.UserAction.Create)}))}},{key:"onUpdateChapter",value:function(e){var t=this,n=this.chapters.find((function(t){return t.get("id")===e.id}));n.set("loading",!0);var o=b.a.updatedChaptersAlert(this.model.get("name"));this.chapterDataService.updateChapter(n.id,e.name,e.startTime,(function(e){n.set(e.toJSON(),{silent:!0}),n.set("loading",!1),t.chapters.sort(),t.logAction(e,d.UserAction.Edit)}),o)}},{key:"onDeleteChapter",value:function(e){var t=this;e.set("loading",!0),this.chapterDataService.deleteChapter(e.id,(function(){t.logAction(e,d.UserAction.Delete),t.chapters.remove(e)}))}},{key:"onMergeChapters",value:function(){var e=this;this.chapterDataService.addConcatenateRequest(this.options.videoId,(function(){e.pollConcatenation()}))}},{key:"onTimeInputUpdate",value:function(e){e>=0&&e<=u.x.millisecondsToSeconds(this.model.get("duration"))&&this.player.seekTo(e)}},{key:"logAction",value:function(e,t){var n=Object.assign({videoId:this.model.get("id")},e.pick("id","name","startTime"));y.a.logUserAction(n,{actionType:t,entity:d.EntityType.Chapter,location:d.LocationContext.EditVideoChapters})}},{key:"onSeekToChapter",value:function(e){e<0||this.player.seekToChapter(e)}},{key:"startPollingConcatenation",value:function(){if(this.concatenateRequest){var e=[S.a.SingleFile,S.a.ConcatenationFailed];o.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")!==S.a.SingleFile)return setTimeout((function(){return e.pollConcatenation()}),5e3),void e.renderConcatenationRequest();e.videoDataService.clearPhysicialChaptersCache(),e.render()}))}},{key:"renderChapterList",value:function(){this.showChildView("chapterList",new k.a({collection:this.chapters,duration:this.model.get("duration"),channelName:this.channelName,showActions:!this.hasPhysicalChapters.get("value"),editable:!this.hasPhysicalChapters.get("value"),showHeader:!0}))}},{key:"renderChapterForm",value:function(){this.showChildView("addChapter",new w.a({model:new c.a,collection:this.chapters,creating:!0,duration:this.model.get("duration"),channelName:this.channelName,playerViewModelKey:"".concat(p.y.NAME,"-").concat(this.model.get("id"))}))}},{key:"renderConcatenationRequest",value:function(){this.isRendered()&&this.showChildView("addChapter",new g.a({type:"chapters",channelName:this.channelName,model:this.concatenateRequest}))}},{key:"renderEditComponents",value:function(){if(this.hasPhysicalChapters.get("value"))return this.renderConcatenationRequest(),void this.mapPhysicalChapters();this.renderChapterForm(),this.renderChapterList()}},{key:"renderTabs",value:function(){this.showChildView("tabs",new v.a({tabs:u.v.getEditVideoTabs(this.options.videoId),activeTab:".edit-chapters-applink",goBackTab:u.v.getBackButton(this.options.videoId)}))}},{key:"renderWebPlayer",value:function(){this.player=new m.a({model:this.model,webPlayerUrl:this.config.get("webPlayerUrl"),captureAnalytics:!1,currentUser:this.currentUser}),this.showChildView("webplayer",this.player)}},{key:"mapPhysicalChapters",value:function(){var e=this;this.renderPartialLoading("chapterList"),this.player.query("getChapters",(function(t){e.chapters=new s.a(O.a.mapPhysicalChapters(t)),e.renderChapterList()}))}},{key:"redirectToVideoDetails",value:function(){r.a.AppLinkHelper.trigger({application:p.b.LIBRARY_EDITOR,action:p.a.LibraryEditor.VIDEO_DETAILS,args:[this.model.get("id")]},{replace:!0})}},{key:"fetchData",value:function(){var e=this;if(this.model=this.videoDataService.getVideo(this.options.videoId),this.model){if(!u.j.canEditVideo(this.model))return void this.redirectToVideoDetails();this.chapters=this.model.chapters}this.hasPhysicalChapters=this.videoDataService.hasPhysicalChapters(this.options.videoId),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:"requiredResources",get:function(){return{config:h.b.config,currentUser:j.b.currentUser}}},{key:"onBeforeRender",value:function(){return this.fetchData(),this.shouldRender()}},{key:"onRender",value:function(){this.renderTabs(),this.renderWebPlayer(),this.renderEditComponents(),this.startPollingConcatenation()}}])&&R(t.prototype,n),T&&R(t,T),Object.defineProperty(t,"prototype",{writable:!1}),D}(r.a.View)}}]);
@@ -1 +1 @@
1
- (window.webpackJsonp_clickview_library_editor=window.webpackJsonp_clickview_library_editor||[]).push([[32],{1048:function(t,e,n){t.exports={dragItem:"_2TIZ7",svgContainer:"_3JzEU",dragText:"_1Kdwj"}},1049:function(t,e,n){var r=n(10);t.exports=(r.default||r).template({compiler:[8,">= 4.3.0"],main:function(t,e,n,r,o){t.propertyIsEnumerable;var i,c=t.lambda,a=t.escapeExpression;return'<span class="'+a(c(null!=(i=null!=(i=null!=e?e.options:e)?i.styles:i)?i.svgContainer:i,e))+' mr-2">'+(null!=(i=c(null!=(i=null!=e?e.options:e)?i.svg:i,e))?i:"")+'</span>\r\n<span class="'+a(c(null!=(i=null!=(i=null!=e?e.options:e)?i.styles:i)?i.dragText:i,e))+'">'+a(c(null!=(i=null!=e?e.options:e)?i.text:i,e))+"</span>"},useData:!0})},1062:function(t,e,n){"use strict";var r=n(1048),o=n.n(r),i=n(1049),c=n.n(i);function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function u(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function l(t,e){return(l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function s(t){var e=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(t){return!1}}();return function(){var n,r=p(t);if(e){var o=p(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return f(this,n)}}function f(t,e){if(e&&("object"===a(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function p(t){return(p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var y=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&l(t,e)}(a,t);var e,n,r,i=s(a);function a(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),i.call(this,t)}return e=a,(n=[{key:"name",get:function(){return"DraggableItemComponent"}},{key:"template",get:function(){return c.a}},{key:"className",get:function(){return"".concat(o.a.dragItem," p-3")}},{key:"viewOptions",value:function(){return Object.assign({styles:o.a},this.options)}}])&&u(e.prototype,n),r&&u(e,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(n(2).a.Component),d={delay:150,cursorAt:{left:-20,top:10},refreshPositions:!0};n.d(e,"c",(function(){return o.a})),n.d(e,"b",(function(){return y})),n.d(e,"a",(function(){return d}))},1070:function(t,e,n){"use strict";n.d(e,"a",(function(){return j}));var r=n(1),o=n(6),i=n(2),c=n(19),a=n(16),u=n(0),l=n(12),s=n(3),f=n(1062),p=n(200),y=n(1073),d=n.n(y);function b(t){return(b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function h(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function g(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function v(t,e){return(v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function m(t){var e=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(t){return!1}}();return function(){var n,r=w(t);if(e){var o=w(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return O(this,n)}}function O(t,e){if(e&&("object"===b(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function w(t){return(w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var j=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&v(t,e)}(O,t);var e,n,y,b=m(O);function O(){return h(this,O),b.apply(this,arguments)}return e=O,(n=[{key:"initialize",value:function(){this.options.model||i.a.ErrorHelper.throw(new c.a("DraggableVideoBehavior must be passed a Video model")),this.listenTo(u.w.VIDEO_DRAG_DROP,"drag:style:".concat(this.options.model.id),this.styleDragStart),this.listenTo(u.w.VIDEO_DRAG_DROP,"drag:stop",this.styleDragStop)}},{key:"lang",get:function(){return"libraryEditor.behaviors"}},{key:"helper",value:function(){var t=this.getVideoModels();return new f.b({text:t.length>1?s.a.getPhrase(this.lang,"videos",{videoCount:t.length}):t[0].get("name"),svg:a.a.getSvg(a.b.Play)}).render().el}},{key:"getSelector",value:function(){return this.view.getUI(this.options.selector)}},{key:"styleDragStart",value:function(){this.getSelector().addClass(d.a.draggingVideo)}},{key:"styleDragStop",value:function(){this.getSelector().removeClass(d.a.draggingVideo)}},{key:"start",value:function(){var t=this.getVideoModels(),e=o.Radio.channel(u.w.VIDEO_DRAG_DROP);e.trigger("drag:start",t,this.options.collectionIdentifier),r.each(t,(function(t){return e.trigger("drag:style:".concat(t.id))}))}},{key:"stop",value:function(){o.Radio.channel(u.w.VIDEO_DRAG_DROP).trigger("drag:stop")}},{key:"getVideoModels",value:function(){var t=this,e=l.a.GetSelectedModels({key:this.options.collectionIdentifier.toString(),type:p.CheckboxTypes.VIDEO_LIST,collection:this.view.model.collection});return r.any(e,(function(e){return e.id===t.view.model.id}))||(e=[this.view.model]),e.length?e:[this.view.model]}},{key:"getClassMappings",value:function(){return{"ui-draggable":f.c.draggable,"ui-draggable-disabled":f.c.disabled,"ui-draggable-handle":f.c.handle,"ui-draggable-dragging":f.c.dragging}}},{key:"onRender",value:function(){var t=this.getSelector(),e={helper:r.bind(this.helper,this),start:r.bind(this.start,this),stop:r.bind(this.stop,this)};e.classes=this.getClassMappings(),t.draggable(r.extend({},f.a,e))}},{key:"onBeforeDestroy",value:function(){var t=this.getSelector();t.draggable("instance")&&t.draggable("destroy")}}])&&g(e.prototype,n),y&&g(e,y),Object.defineProperty(e,"prototype",{writable:!1}),O}(i.a.Behavior)},1073:function(t,e,n){t.exports={draggingVideo:"_3cCHx"}},1101:function(t,e,n){"use strict";var r=n(204),o=n(1),i=n(202),c=n(0),a=n(146),u=n(307);function l(t){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t){return function(t){if(Array.isArray(t))return f(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return f(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function p(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function y(t,e){return(y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function d(t){var e=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(t){return!1}}();return function(){var n,r=h(t);if(e){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return b(this,n)}}function b(t,e){if(e&&("object"===l(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var g=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&y(t,e)}(l,t);var e,n,r,i=d(l);function l(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,l),(e=i.call(this,{collectionPrefix:"".concat(c.f.RECENT_VIDEOS,":collection"),cursor:t.cursor,sort:t.sort})).setAdditionalData(t),e}return e=l,(n=[{key:"setAdditionalData",value:function(t){var e=t.libraryIds,n=t.dateQueryString,r=t.subjects;e&&(this.libraryIds=e),r&&(o.isArray(r)&&r.length&&(this.subjects=r),o.isArray(r)||(this.subjects=[r]));var i=o.findWhere(u.g,{queryString:n})||u.e;this.dateOption=new a.b(i)}},{key:"toString",value:function(){var t=this.subjects&&this.subjects.length&&this.subjects.map((function(t){return escape(t.get("name"))}))||[];return[this.collectionPrefix,this.libraryIds,this.dateOption.get("from"),this.dateOption.get("to")].concat(s(t),[this.cursor]).filter(Boolean).join(":")}},{key:"toParams",value:function(){var t={};return this.libraryIds&&(t.libraryIds=this.libraryIds),this.dateOption&&(t.from=this.dateOption.get("from"),t.to=this.dateOption.get("to")),this.subjects&&(t.subjectIds=o.flatten(this.subjects.map((function(t){return t.get("subjectIds")})))),this.cursor&&(t.cursor=this.cursor),t}}])&&p(e.prototype,n),r&&p(e,r),Object.defineProperty(e,"prototype",{writable:!1}),l}(i.a);function v(t){return(v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function m(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function O(t,e){return(O=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function w(t){var e=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(t){return!1}}();return function(){var n,r=_(t);if(e){var o=_(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return j(this,n)}}function j(t,e){if(e&&("object"===v(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _(t){return(_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var P=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&O(t,e)}(l,t);var e,n,r,i=w(l);function l(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,l),(e=i.call(this,{collectionPrefix:"".concat(c.f.RECENT_SUBJECTS,":collection"),sort:t.sort})).setAdditionalData(t),e}return e=l,(n=[{key:"setAdditionalData",value:function(t){var e=t.libraryIds,n=t.dateQueryString;e&&(this.libraryIds=e);var r=o.findWhere(u.g,{queryString:n})||u.e;this.dateOption=new a.b(r)}},{key:"toString",value:function(){return[this.collectionPrefix,this.libraryIds,this.dateOption.get("from"),this.dateOption.get("to")].filter(Boolean).join(":")}},{key:"toParams",value:function(){var t={};return this.libraryIds&&(t.libraryIds=this.libraryIds),this.dateOption&&(t.from=this.dateOption.get("from"),t.to=this.dateOption.get("to")),t}}])&&m(e.prototype,n),r&&m(e,r),Object.defineProperty(e,"prototype",{writable:!1}),l}(i.a);function S(t){return(S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function R(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function k(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function E(t,e){return(E=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function D(t){var e=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(t){return!1}}();return function(){var n,r=x(t);if(e){var o=x(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return C(this,n)}}function C(t,e){if(e&&("object"===S(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function x(t){return(x=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var I=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&E(t,e)}(i,t);var e,n,r,o=D(i);function i(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return k(this,i),o.call(this,{collectionPrefix:c.f.LIBRARY_FOLDERS,id:t,sort:e,cursor:n})}return e=i,n&&R(e.prototype,n),r&&R(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(i.a);n.d(e,"d",(function(){return r.a})),n.d(e,"b",(function(){return g})),n.d(e,"c",(function(){return P})),n.d(e,"a",(function(){return I}))},1104:function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var r=n(1),o=n(6),i=n(2),c=n(155);function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function s(t,e){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function f(t){var e=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(t){return!1}}();return function(){var n,r=y(t);if(e){var o=y(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return p(this,n)}}function p(t,e){if(e&&("object"===a(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function y(t){return(y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var d=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}(p,t);var e,n,i,a=f(p);function p(){return u(this,p),a.apply(this,arguments)}return e=p,(n=[{key:"getDroppableElement",value:function(){return this.options.ui?this.view.getUI(this.options.ui):this.$el}},{key:"drop",value:function(){var t=this;r.each(this.options.channelNames,(function(e){o.Radio.channel(e).trigger("drag:drop",t.view.model,t.options.analyticsOptions)}))}},{key:"accept",value:function(){var t=this,e=!1;return r.each(this.options.channelNames,(function(n){!0===o.Radio.channel(n).request("accept",t.view.model)&&(e=!0)})),e}},{key:"over",value:function(){var t=this;this.isHoveringOver=!0,window.setTimeout((function(){t.isHoveringOver&&t.view.trigger("open:sub:folders",c.active)}),500)}},{key:"out",value:function(){this.isHoveringOver=!1}},{key:"onRender",value:function(){var t={tolerance:"pointer",drop:r.bind(this.drop,this),accept:r.bind(this.accept,this),over:r.bind(this.over,this),out:r.bind(this.out,this)};t.classes={"ui-droppable":c.droppable,"ui-droppable-active":c.active,"ui-droppable-hover":c.hover},this.getDroppableElement().droppable(t)}},{key:"onBeforeDestroy",value:function(){this.getDroppableElement().droppable("instance")&&this.getDroppableElement().droppable("destroy")}}])&&l(e.prototype,n),i&&l(e,i),Object.defineProperty(e,"prototype",{writable:!1}),p}(i.a.Behavior)},1110:function(t,e,n){"use strict";n.d(e,"a",(function(){return v}));var r=n(1),o=n(6),i=n(2),c=n(16),a=n(0),u=n(1062),l=n(1115),s=n.n(l);function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function p(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function y(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function d(t,e){return(d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function b(t){var e=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(t){return!1}}();return function(){var n,r=g(t);if(e){var o=g(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h(this,n)}}function h(t,e){if(e&&("object"===f(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function g(t){return(g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var v=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&d(t,e)}(f,t);var e,n,i,l=b(f);function f(){return p(this,f),l.apply(this,arguments)}return e=f,(n=[{key:"getClassMappings",value:function(){return{"ui-draggable":u.c.draggable,"ui-draggable-handle":u.c.handle,"ui-draggable-disabled":u.c.disabled,"ui-draggable-dragging":u.c.dragging}}},{key:"helper",value:function(){return new u.b({text:this.view.model.get("name"),svg:c.a.getSvg(c.b.Folder)}).render().el}},{key:"start",value:function(){o.Radio.channel(a.w.FOLDER_DRAG_DROP).trigger("drag:start",this.view.model),this.view.$el.addClass(s.a.draggingFolder)}},{key:"stop",value:function(){o.Radio.channel(a.w.FOLDER_DRAG_DROP).trigger("drag:stop"),this.view.$el.removeClass(s.a.draggingFolder)}},{key:"onRender",value:function(){var t={helper:r.bind(this.helper,this),start:r.bind(this.start,this),stop:r.bind(this.stop,this)};t.classes=this.getClassMappings(),this.view.$el.draggable(r.extend({},u.a,t))}},{key:"onBeforeDestroy",value:function(){this.view.$el.draggable("instance")&&this.view.$el.draggable("destroy")}}])&&y(e.prototype,n),i&&y(e,i),Object.defineProperty(e,"prototype",{writable:!1}),f}(i.a.Behavior)},1115:function(t,e,n){t.exports={dragging:"_2wBn3",draggingFolder:"_1r3AS"}},1217:function(t,e,n){var r=n(10);t.exports=(r.default||r).template({compiler:[8,">= 4.3.0"],main:function(t,e,n,r,o){t.propertyIsEnumerable;var i,c,a=t.lambda,u=t.escapeExpression;return'<a\r\n class="d-block cursor-pointer no-decoration '+u(a(null!=(i=null!=(i=null!=e?e.options:e)?i.styles:i)?i.folder:i,e))+'"\r\n style="background-image: url(\''+u(a(null!=(i=null!=e?e.options:e)?i.imageUrl:i,e))+'\')"\r\n>\r\n <h3 class="position-absolute text-white text-center m-0">'+u("function"==typeof(c=null!=(c=n.name||(null!=e?e.name:e))?c:t.hooks.helperMissing)?c.call(null!=e?e:t.nullContext||{},{name:"name",hash:{},data:o}):c)+'</h3>\r\n</a>\r\n<div class="actions-region"></div>'},useData:!0})},1218:function(t,e,n){t.exports={folder:"_1MHyt",actions:"_3-hwy"}},1221:function(t,e,n){var r=n(10);t.exports=(r.default||r).template({compiler:[8,">= 4.3.0"],main:function(t,e,n,r,o){var i;t.propertyIsEnumerable;return'<h1 class="h3">'+t.escapeExpression("function"==typeof(i=null!=(i=n.name||(null!=e?e.name:e))?i:t.hooks.helperMissing)?i.call(null!=e?e:t.nullContext||{},{name:"name",hash:{},data:o}):i)+'</h1>\r\n<div class="folders-region"></div>\r\n<div class="actions-region"></div>'},useData:!0})},1222:function(t,e,n){t.exports={actions:"_3vCmp"}},1482:function(t,e,n){"use strict";n.r(e);var r=n(1),o=n(2),i=n(5),c=n(3),a=n(4),u=n(16),l=n(309),s=n(36),f=n(201),p=n(0),y=n(9),d=n(1101),b=n(1217),h=n.n(b),g=n(1218),v=n.n(g),m=n(12),O=n(1110),w=(n(1070),n(1104)),j=n(1124);function _(t){return(_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function P(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function S(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function R(t,e,n){return e&&S(t.prototype,e),n&&S(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function k(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&E(t,e)}function E(t,e){return(E=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function D(t){var e=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(t){return!1}}();return function(){var n,r=x(t);if(e){var o=x(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return C(this,n)}}function C(t,e){if(e&&("object"===_(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function x(t){return(x=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var I=function(t){k(n,t);var e=D(n);function n(t){return P(this,n),e.call(this,t)}return R(n,[{key:"initialize",value:function(){this.listenTo(this.model,"change:name",this.render)}},{key:"name",get:function(){return"LibraryFolderItemComponent"}},{key:"template",get:function(){return h.a}},{key:"className",get:function(){return"col-3 p-2"}},{key:"appLinks",get:function(){return{a:{application:p.b.LIBRARY_EDITOR,action:p.a.LibraryEditor.FOLDER,args:[this.model.get("id")]}}}},{key:"regions",value:function(){return{actions:{el:".actions-region",replaceElement:!0}}}},{key:"behaviors",get:function(){return[{behaviorClass:w.a,channelNames:[p.w.VIDEO_DRAG_DROP,p.w.FOLDER_DRAG_DROP],analyticsOptions:{location:a.LocationContext.LibraryTiles}},{behaviorClass:O.a}]}},{key:"viewOptions",value:function(){var t=m.g.createFolderThumbnailUrl(this.model.thumbnail,{fallbackBaseUrl:this.options.imageCdnUrl,fallbackCategoryName:this.model.get("name"),type:y.f.Thumbnails});return{styles:v.a,imageUrl:t}}},{key:"onRender",value:function(){this.showChildView("actions",new j.a({model:this.model,extraClasses:"".concat(v.a.actions," rounded-circle"),buttonClass:"text-light",analyticsOptions:{location:a.LocationContext.LibraryTiles},overrideClasses:!0}))}}]),n}(o.a.Component),T=function(t){k(n,t);var e=D(n);function n(t){return P(this,n),e.call(this,t)}return R(n,[{key:"name",get:function(){return"LibraryFolderListComponent"}},{key:"className",get:function(){return"row"}},{key:"childView",get:function(){return I}},{key:"childViewOptions",get:function(){return this.options.childOptions}}]),n}(o.a.ComponentCollection),B=n(1201),L=n(1221),A=n.n(L),V=n(1222),F=n.n(V);function M(t){return(M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function N(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function U(t,e){return(U=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function G(t){var e=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(t){return!1}}();return function(){var n,r=J(t);if(e){var o=J(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return H(this,n)}}function H(t,e){if(e&&("object"===M(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function J(t){return(J=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}n.d(e,"LibraryView",(function(){return q}));var q=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&U(t,e)}(h,t);var e,n,o,b=G(h);function h(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,h),b.call(this,t)}return e=h,(n=[{key:"initialize",value:function(){var t=this;this.libraryDataService=i.a.getInstance(p.g.Library,this),this.listenTo(p.e.LIBRARY,"clear:library:folder:cache",(function(){t.folders=null,t.render()}))}},{key:"name",get:function(){return"LibraryView"}},{key:"title",get:function(){return!!this.model&&this.model.get("name")}},{key:"lang",get:function(){return"libraryEditor.library"}},{key:"template",get:function(){return A.a}},{key:"className",get:function(){return"bg-white px-3 pt-3 pb-2 position-relative ".concat(F.a.library)}},{key:"behaviors",get:function(){var t=this;return[{behaviorClass:l.a,region:"folders",type:y.c.Library,shouldRender:function(){return t.model&&!t.model.children.length},componentOptions:{libraryId:this.options.libraryId,moreSvg:u.a.getSvg(u.b.More),heading:c.a.getPhrase(this.lang,"emptyStateHeading"),description:c.a.getPhrase(this.lang,"emptyStateInfo",{moreSvg:'<span class="d-inline-block svg-container align-top">\n '.concat(u.a.getSvg(u.b.More),"</span>")})},emptyStateComponents:p.h}]}},{key:"regions",value:function(){return{folders:{el:".folders-region",replaceElement:!0,partialLoading:y.h.LibraryFolders},actions:{el:".actions-region",replaceElement:!0}}}},{key:"renderFolders",value:function(){this.showChildView("folders",new T({collection:this.folders,childOptions:{imageCdnUrl:this.config.get("imageCdnUrl")}}))}},{key:"renderActions",value:function(){this.showChildView("actions",new B.a({model:this.model,extraClasses:"".concat(F.a.actions," rounded-circle mr-2 mt-2"),analyticsOptions:{location:a.LocationContext.Banner}}))}},{key:"requiredResources",get:function(){return{config:f.b.config}}},{key:"bindScrollListener",value:function(){var t=this;if(!this.scrollBound){this.scrollBound=!0;var e=$(window),n=r.debounce((function(){if(e.scrollTop()+e.height()>t.$el.offset().top+t.$el.height()&&t.currentIdentifier){var n=t.libraryDataService.getLibraryFoldersCursors(t.currentIdentifier);n&&n.next&&t.libraryDataService.getLibraryFolders(t.getNewCollectionIdentifier(n.next),(function(e){t.folders.add(e.toJSON())}))}}),333);e.scroll(n),window.setTimeout(n,100)}}},{key:"getNewCollectionIdentifier",value:function(t){return this.currentIdentifier=new d.a(this.model.categoryTree.get("id"),s.a.AtoZ,t)}},{key:"onBeforeRender",value:function(){var t=this;if(this.model)return this.folders||this.libraryDataService.getLibraryFolders(this.getNewCollectionIdentifier(),(function(e){t.folders=e,t.render()})),!!this.model&&!!this.folders;this.libraryDataService.getLibraries((function(e){t.model=e.get(t.options.libraryId),t.listenTo(t.model,"change:name",t.render),t.render()}))}},{key:"onRender",value:function(){this.renderFolders(),this.renderActions(),this.bindScrollListener()}}])&&N(e.prototype,n),o&&N(e,o),Object.defineProperty(e,"prototype",{writable:!1}),h}(o.a.View)}}]);
1
+ (window.webpackJsonp_clickview_library_editor=window.webpackJsonp_clickview_library_editor||[]).push([[32],{1052:function(t,e,n){t.exports={dragItem:"_2TIZ7",svgContainer:"_3JzEU",dragText:"_1Kdwj"}},1053:function(t,e,n){var r=n(10);t.exports=(r.default||r).template({compiler:[8,">= 4.3.0"],main:function(t,e,n,r,o){t.propertyIsEnumerable;var i,c=t.lambda,a=t.escapeExpression;return'<span class="'+a(c(null!=(i=null!=(i=null!=e?e.options:e)?i.styles:i)?i.svgContainer:i,e))+' mr-2">'+(null!=(i=c(null!=(i=null!=e?e.options:e)?i.svg:i,e))?i:"")+'</span>\r\n<span class="'+a(c(null!=(i=null!=(i=null!=e?e.options:e)?i.styles:i)?i.dragText:i,e))+'">'+a(c(null!=(i=null!=e?e.options:e)?i.text:i,e))+"</span>"},useData:!0})},1066:function(t,e,n){"use strict";var r=n(1052),o=n.n(r),i=n(1053),c=n.n(i);function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function u(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function l(t,e){return(l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function s(t){var e=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(t){return!1}}();return function(){var n,r=p(t);if(e){var o=p(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return f(this,n)}}function f(t,e){if(e&&("object"===a(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function p(t){return(p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var y=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&l(t,e)}(a,t);var e,n,r,i=s(a);function a(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),i.call(this,t)}return e=a,(n=[{key:"name",get:function(){return"DraggableItemComponent"}},{key:"template",get:function(){return c.a}},{key:"className",get:function(){return"".concat(o.a.dragItem," p-3")}},{key:"viewOptions",value:function(){return Object.assign({styles:o.a},this.options)}}])&&u(e.prototype,n),r&&u(e,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(n(2).a.Component),d={delay:150,cursorAt:{left:-20,top:10},refreshPositions:!0};n.d(e,"c",(function(){return o.a})),n.d(e,"b",(function(){return y})),n.d(e,"a",(function(){return d}))},1074:function(t,e,n){"use strict";n.d(e,"a",(function(){return j}));var r=n(1),o=n(6),i=n(2),c=n(19),a=n(16),u=n(0),l=n(12),s=n(3),f=n(1066),p=n(201),y=n(1077),d=n.n(y);function b(t){return(b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function h(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function g(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function v(t,e){return(v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function m(t){var e=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(t){return!1}}();return function(){var n,r=w(t);if(e){var o=w(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return O(this,n)}}function O(t,e){if(e&&("object"===b(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function w(t){return(w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var j=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&v(t,e)}(O,t);var e,n,y,b=m(O);function O(){return h(this,O),b.apply(this,arguments)}return e=O,(n=[{key:"initialize",value:function(){this.options.model||i.a.ErrorHelper.throw(new c.a("DraggableVideoBehavior must be passed a Video model")),this.listenTo(u.w.VIDEO_DRAG_DROP,"drag:style:".concat(this.options.model.id),this.styleDragStart),this.listenTo(u.w.VIDEO_DRAG_DROP,"drag:stop",this.styleDragStop)}},{key:"lang",get:function(){return"libraryEditor.behaviors"}},{key:"helper",value:function(){var t=this.getVideoModels();return new f.b({text:t.length>1?s.a.getPhrase(this.lang,"videos",{videoCount:t.length}):t[0].get("name"),svg:a.a.getSvg(a.b.Play)}).render().el}},{key:"getSelector",value:function(){return this.view.getUI(this.options.selector)}},{key:"styleDragStart",value:function(){this.getSelector().addClass(d.a.draggingVideo)}},{key:"styleDragStop",value:function(){this.getSelector().removeClass(d.a.draggingVideo)}},{key:"start",value:function(){var t=this.getVideoModels(),e=o.Radio.channel(u.w.VIDEO_DRAG_DROP);e.trigger("drag:start",t,this.options.collectionIdentifier),r.each(t,(function(t){return e.trigger("drag:style:".concat(t.id))}))}},{key:"stop",value:function(){o.Radio.channel(u.w.VIDEO_DRAG_DROP).trigger("drag:stop")}},{key:"getVideoModels",value:function(){var t=this,e=l.a.GetSelectedModels({key:this.options.collectionIdentifier.toString(),type:p.CheckboxTypes.VIDEO_LIST,collection:this.view.model.collection});return r.any(e,(function(e){return e.id===t.view.model.id}))||(e=[this.view.model]),e.length?e:[this.view.model]}},{key:"getClassMappings",value:function(){return{"ui-draggable":f.c.draggable,"ui-draggable-disabled":f.c.disabled,"ui-draggable-handle":f.c.handle,"ui-draggable-dragging":f.c.dragging}}},{key:"onRender",value:function(){var t=this.getSelector(),e={helper:r.bind(this.helper,this),start:r.bind(this.start,this),stop:r.bind(this.stop,this)};e.classes=this.getClassMappings(),t.draggable(r.extend({},f.a,e))}},{key:"onBeforeDestroy",value:function(){var t=this.getSelector();t.draggable("instance")&&t.draggable("destroy")}}])&&g(e.prototype,n),y&&g(e,y),Object.defineProperty(e,"prototype",{writable:!1}),O}(i.a.Behavior)},1077:function(t,e,n){t.exports={draggingVideo:"_3cCHx"}},1105:function(t,e,n){"use strict";var r=n(205),o=n(1),i=n(203),c=n(0),a=n(146),u=n(307);function l(t){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t){return function(t){if(Array.isArray(t))return f(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return f(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function p(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function y(t,e){return(y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function d(t){var e=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(t){return!1}}();return function(){var n,r=h(t);if(e){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return b(this,n)}}function b(t,e){if(e&&("object"===l(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var g=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&y(t,e)}(l,t);var e,n,r,i=d(l);function l(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,l),(e=i.call(this,{collectionPrefix:"".concat(c.f.RECENT_VIDEOS,":collection"),cursor:t.cursor,sort:t.sort})).setAdditionalData(t),e}return e=l,(n=[{key:"setAdditionalData",value:function(t){var e=t.libraryIds,n=t.dateQueryString,r=t.subjects;e&&(this.libraryIds=e),r&&(o.isArray(r)&&r.length&&(this.subjects=r),o.isArray(r)||(this.subjects=[r]));var i=o.findWhere(u.g,{queryString:n})||u.e;this.dateOption=new a.b(i)}},{key:"toString",value:function(){var t=this.subjects&&this.subjects.length&&this.subjects.map((function(t){return escape(t.get("name"))}))||[];return[this.collectionPrefix,this.libraryIds,this.dateOption.get("from"),this.dateOption.get("to")].concat(s(t),[this.cursor]).filter(Boolean).join(":")}},{key:"toParams",value:function(){var t={};return this.libraryIds&&(t.libraryIds=this.libraryIds),this.dateOption&&(t.from=this.dateOption.get("from"),t.to=this.dateOption.get("to")),this.subjects&&(t.subjectIds=o.flatten(this.subjects.map((function(t){return t.get("subjectIds")})))),this.cursor&&(t.cursor=this.cursor),t}}])&&p(e.prototype,n),r&&p(e,r),Object.defineProperty(e,"prototype",{writable:!1}),l}(i.a);function v(t){return(v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function m(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function O(t,e){return(O=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function w(t){var e=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(t){return!1}}();return function(){var n,r=_(t);if(e){var o=_(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return j(this,n)}}function j(t,e){if(e&&("object"===v(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _(t){return(_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var P=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&O(t,e)}(l,t);var e,n,r,i=w(l);function l(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,l),(e=i.call(this,{collectionPrefix:"".concat(c.f.RECENT_SUBJECTS,":collection"),sort:t.sort})).setAdditionalData(t),e}return e=l,(n=[{key:"setAdditionalData",value:function(t){var e=t.libraryIds,n=t.dateQueryString;e&&(this.libraryIds=e);var r=o.findWhere(u.g,{queryString:n})||u.e;this.dateOption=new a.b(r)}},{key:"toString",value:function(){return[this.collectionPrefix,this.libraryIds,this.dateOption.get("from"),this.dateOption.get("to")].filter(Boolean).join(":")}},{key:"toParams",value:function(){var t={};return this.libraryIds&&(t.libraryIds=this.libraryIds),this.dateOption&&(t.from=this.dateOption.get("from"),t.to=this.dateOption.get("to")),t}}])&&m(e.prototype,n),r&&m(e,r),Object.defineProperty(e,"prototype",{writable:!1}),l}(i.a);function S(t){return(S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function R(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function k(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function E(t,e){return(E=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function D(t){var e=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(t){return!1}}();return function(){var n,r=x(t);if(e){var o=x(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return C(this,n)}}function C(t,e){if(e&&("object"===S(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function x(t){return(x=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var I=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&E(t,e)}(i,t);var e,n,r,o=D(i);function i(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return k(this,i),o.call(this,{collectionPrefix:c.f.LIBRARY_FOLDERS,id:t,sort:e,cursor:n})}return e=i,n&&R(e.prototype,n),r&&R(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(i.a);n.d(e,"d",(function(){return r.a})),n.d(e,"b",(function(){return g})),n.d(e,"c",(function(){return P})),n.d(e,"a",(function(){return I}))},1108:function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var r=n(1),o=n(6),i=n(2),c=n(155);function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function s(t,e){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function f(t){var e=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(t){return!1}}();return function(){var n,r=y(t);if(e){var o=y(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return p(this,n)}}function p(t,e){if(e&&("object"===a(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function y(t){return(y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var d=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}(p,t);var e,n,i,a=f(p);function p(){return u(this,p),a.apply(this,arguments)}return e=p,(n=[{key:"getDroppableElement",value:function(){return this.options.ui?this.view.getUI(this.options.ui):this.$el}},{key:"drop",value:function(){var t=this;r.each(this.options.channelNames,(function(e){o.Radio.channel(e).trigger("drag:drop",t.view.model,t.options.analyticsOptions)}))}},{key:"accept",value:function(){var t=this,e=!1;return r.each(this.options.channelNames,(function(n){!0===o.Radio.channel(n).request("accept",t.view.model)&&(e=!0)})),e}},{key:"over",value:function(){var t=this;this.isHoveringOver=!0,window.setTimeout((function(){t.isHoveringOver&&t.view.trigger("open:sub:folders",c.active)}),500)}},{key:"out",value:function(){this.isHoveringOver=!1}},{key:"onRender",value:function(){var t={tolerance:"pointer",drop:r.bind(this.drop,this),accept:r.bind(this.accept,this),over:r.bind(this.over,this),out:r.bind(this.out,this)};t.classes={"ui-droppable":c.droppable,"ui-droppable-active":c.active,"ui-droppable-hover":c.hover},this.getDroppableElement().droppable(t)}},{key:"onBeforeDestroy",value:function(){this.getDroppableElement().droppable("instance")&&this.getDroppableElement().droppable("destroy")}}])&&l(e.prototype,n),i&&l(e,i),Object.defineProperty(e,"prototype",{writable:!1}),p}(i.a.Behavior)},1114:function(t,e,n){"use strict";n.d(e,"a",(function(){return v}));var r=n(1),o=n(6),i=n(2),c=n(16),a=n(0),u=n(1066),l=n(1119),s=n.n(l);function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function p(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function y(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function d(t,e){return(d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function b(t){var e=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(t){return!1}}();return function(){var n,r=g(t);if(e){var o=g(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h(this,n)}}function h(t,e){if(e&&("object"===f(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function g(t){return(g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var v=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&d(t,e)}(f,t);var e,n,i,l=b(f);function f(){return p(this,f),l.apply(this,arguments)}return e=f,(n=[{key:"getClassMappings",value:function(){return{"ui-draggable":u.c.draggable,"ui-draggable-handle":u.c.handle,"ui-draggable-disabled":u.c.disabled,"ui-draggable-dragging":u.c.dragging}}},{key:"helper",value:function(){return new u.b({text:this.view.model.get("name"),svg:c.a.getSvg(c.b.Folder)}).render().el}},{key:"start",value:function(){o.Radio.channel(a.w.FOLDER_DRAG_DROP).trigger("drag:start",this.view.model),this.view.$el.addClass(s.a.draggingFolder)}},{key:"stop",value:function(){o.Radio.channel(a.w.FOLDER_DRAG_DROP).trigger("drag:stop"),this.view.$el.removeClass(s.a.draggingFolder)}},{key:"onRender",value:function(){var t={helper:r.bind(this.helper,this),start:r.bind(this.start,this),stop:r.bind(this.stop,this)};t.classes=this.getClassMappings(),this.view.$el.draggable(r.extend({},u.a,t))}},{key:"onBeforeDestroy",value:function(){this.view.$el.draggable("instance")&&this.view.$el.draggable("destroy")}}])&&y(e.prototype,n),i&&y(e,i),Object.defineProperty(e,"prototype",{writable:!1}),f}(i.a.Behavior)},1119:function(t,e,n){t.exports={dragging:"_2wBn3",draggingFolder:"_1r3AS"}},1221:function(t,e,n){var r=n(10);t.exports=(r.default||r).template({compiler:[8,">= 4.3.0"],main:function(t,e,n,r,o){t.propertyIsEnumerable;var i,c,a=t.lambda,u=t.escapeExpression;return'<a\r\n class="d-block cursor-pointer no-decoration '+u(a(null!=(i=null!=(i=null!=e?e.options:e)?i.styles:i)?i.folder:i,e))+'"\r\n style="background-image: url(\''+u(a(null!=(i=null!=e?e.options:e)?i.imageUrl:i,e))+'\')"\r\n>\r\n <h3 class="position-absolute text-white text-center m-0">'+u("function"==typeof(c=null!=(c=n.name||(null!=e?e.name:e))?c:t.hooks.helperMissing)?c.call(null!=e?e:t.nullContext||{},{name:"name",hash:{},data:o}):c)+'</h3>\r\n</a>\r\n<div class="actions-region"></div>'},useData:!0})},1222:function(t,e,n){t.exports={folder:"_1MHyt",actions:"_3-hwy"}},1225:function(t,e,n){var r=n(10);t.exports=(r.default||r).template({compiler:[8,">= 4.3.0"],main:function(t,e,n,r,o){var i;t.propertyIsEnumerable;return'<h1 class="h3">'+t.escapeExpression("function"==typeof(i=null!=(i=n.name||(null!=e?e.name:e))?i:t.hooks.helperMissing)?i.call(null!=e?e:t.nullContext||{},{name:"name",hash:{},data:o}):i)+'</h1>\r\n<div class="folders-region"></div>\r\n<div class="actions-region"></div>'},useData:!0})},1226:function(t,e,n){t.exports={actions:"_3vCmp"}},1486:function(t,e,n){"use strict";n.r(e);var r=n(1),o=n(2),i=n(5),c=n(3),a=n(4),u=n(16),l=n(309),s=n(36),f=n(202),p=n(0),y=n(9),d=n(1105),b=n(1221),h=n.n(b),g=n(1222),v=n.n(g),m=n(12),O=n(1114),w=(n(1074),n(1108)),j=n(1128);function _(t){return(_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function P(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function S(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function R(t,e,n){return e&&S(t.prototype,e),n&&S(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function k(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&E(t,e)}function E(t,e){return(E=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function D(t){var e=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(t){return!1}}();return function(){var n,r=x(t);if(e){var o=x(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return C(this,n)}}function C(t,e){if(e&&("object"===_(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function x(t){return(x=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var I=function(t){k(n,t);var e=D(n);function n(t){return P(this,n),e.call(this,t)}return R(n,[{key:"initialize",value:function(){this.listenTo(this.model,"change:name",this.render)}},{key:"name",get:function(){return"LibraryFolderItemComponent"}},{key:"template",get:function(){return h.a}},{key:"className",get:function(){return"col-3 p-2"}},{key:"appLinks",get:function(){return{a:{application:p.b.LIBRARY_EDITOR,action:p.a.LibraryEditor.FOLDER,args:[this.model.get("id")]}}}},{key:"regions",value:function(){return{actions:{el:".actions-region",replaceElement:!0}}}},{key:"behaviors",get:function(){return[{behaviorClass:w.a,channelNames:[p.w.VIDEO_DRAG_DROP,p.w.FOLDER_DRAG_DROP],analyticsOptions:{location:a.LocationContext.LibraryTiles}},{behaviorClass:O.a}]}},{key:"viewOptions",value:function(){var t=m.g.createFolderThumbnailUrl(this.model.thumbnail,{fallbackBaseUrl:this.options.imageCdnUrl,fallbackCategoryName:this.model.get("name"),type:y.f.Thumbnails});return{styles:v.a,imageUrl:t}}},{key:"onRender",value:function(){this.showChildView("actions",new j.a({model:this.model,extraClasses:"".concat(v.a.actions," rounded-circle"),buttonClass:"text-light",analyticsOptions:{location:a.LocationContext.LibraryTiles},overrideClasses:!0}))}}]),n}(o.a.Component),T=function(t){k(n,t);var e=D(n);function n(t){return P(this,n),e.call(this,t)}return R(n,[{key:"name",get:function(){return"LibraryFolderListComponent"}},{key:"className",get:function(){return"row"}},{key:"childView",get:function(){return I}},{key:"childViewOptions",get:function(){return this.options.childOptions}}]),n}(o.a.ComponentCollection),B=n(1205),L=n(1225),A=n.n(L),V=n(1226),F=n.n(V);function M(t){return(M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function N(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function U(t,e){return(U=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function G(t){var e=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(t){return!1}}();return function(){var n,r=J(t);if(e){var o=J(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return H(this,n)}}function H(t,e){if(e&&("object"===M(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function J(t){return(J=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}n.d(e,"LibraryView",(function(){return q}));var q=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&U(t,e)}(h,t);var e,n,o,b=G(h);function h(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,h),b.call(this,t)}return e=h,(n=[{key:"initialize",value:function(){var t=this;this.libraryDataService=i.a.getInstance(p.g.Library,this),this.listenTo(p.e.LIBRARY,"clear:library:folder:cache",(function(){t.folders=null,t.render()}))}},{key:"name",get:function(){return"LibraryView"}},{key:"title",get:function(){return!!this.model&&this.model.get("name")}},{key:"lang",get:function(){return"libraryEditor.library"}},{key:"template",get:function(){return A.a}},{key:"className",get:function(){return"bg-white px-3 pt-3 pb-2 position-relative ".concat(F.a.library)}},{key:"behaviors",get:function(){var t=this;return[{behaviorClass:l.a,region:"folders",type:y.c.Library,shouldRender:function(){return t.model&&!t.model.children.length},componentOptions:{libraryId:this.options.libraryId,moreSvg:u.a.getSvg(u.b.More),heading:c.a.getPhrase(this.lang,"emptyStateHeading"),description:c.a.getPhrase(this.lang,"emptyStateInfo",{moreSvg:'<span class="d-inline-block svg-container align-top">\n '.concat(u.a.getSvg(u.b.More),"</span>")})},emptyStateComponents:p.h}]}},{key:"regions",value:function(){return{folders:{el:".folders-region",replaceElement:!0,partialLoading:y.h.LibraryFolders},actions:{el:".actions-region",replaceElement:!0}}}},{key:"renderFolders",value:function(){this.showChildView("folders",new T({collection:this.folders,childOptions:{imageCdnUrl:this.config.get("imageCdnUrl")}}))}},{key:"renderActions",value:function(){this.showChildView("actions",new B.a({model:this.model,extraClasses:"".concat(F.a.actions," rounded-circle mr-2 mt-2"),analyticsOptions:{location:a.LocationContext.Banner}}))}},{key:"requiredResources",get:function(){return{config:f.b.config}}},{key:"bindScrollListener",value:function(){var t=this;if(!this.scrollBound){this.scrollBound=!0;var e=$(window),n=r.debounce((function(){if(e.scrollTop()+e.height()>t.$el.offset().top+t.$el.height()&&t.currentIdentifier){var n=t.libraryDataService.getLibraryFoldersCursors(t.currentIdentifier);n&&n.next&&t.libraryDataService.getLibraryFolders(t.getNewCollectionIdentifier(n.next),(function(e){t.folders.add(e.toJSON())}))}}),333);e.scroll(n),window.setTimeout(n,100)}}},{key:"getNewCollectionIdentifier",value:function(t){return this.currentIdentifier=new d.a(this.model.categoryTree.get("id"),s.a.AtoZ,t)}},{key:"onBeforeRender",value:function(){var t=this;if(this.model)return this.folders||this.libraryDataService.getLibraryFolders(this.getNewCollectionIdentifier(),(function(e){t.folders=e,t.render()})),!!this.model&&!!this.folders;this.libraryDataService.getLibraries((function(e){t.model=e.get(t.options.libraryId),t.listenTo(t.model,"change:name",t.render),t.render()}))}},{key:"onRender",value:function(){this.renderFolders(),this.renderActions(),this.bindScrollListener()}}])&&N(e.prototype,n),o&&N(e,o),Object.defineProperty(e,"prototype",{writable:!1}),h}(o.a.View)}}]);
@@ -1 +1 @@
1
- (window.webpackJsonp_clickview_library_editor=window.webpackJsonp_clickview_library_editor||[]).push([[33],{1045:function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var r=n(2),i=n(265);function o(e){return(o="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 a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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 s(e,t){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function c(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=f(e);if(t){var i=f(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return l(this,n)}}function l(e,t){if(t&&("object"===o(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 f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var d=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&&s(e,t)}(l,e);var t,n,r,o=c(l);function l(){return a(this,l),o.apply(this,arguments)}return t=l,(n=[{key:"defaults",value:function(){return e={},t=i.c.Disabled,n=!0,t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e;var e,t,n}}])&&u(t.prototype,n),r&&u(t,r),Object.defineProperty(t,"prototype",{writable:!1}),l}(r.a.Model)},1051:function(e,t,n){"use strict";var r=n(1055),i=n(1052),o=(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 i.g})),n.d(t,"g",(function(){return i.j})),n.d(t,"f",(function(){return i.i})),n.d(t,"c",(function(){return i.f})),n.d(t,"e",(function(){return i.h})),n.d(t,"b",(function(){return o.a})),n.d(t,"h",(function(){return a.a}))},1052:function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"k",(function(){return p})),n.d(t,"g",(function(){return b})),n.d(t,"e",(function(){return h})),n.d(t,"j",(function(){return g})),n.d(t,"i",(function(){return v})),n.d(t,"c",(function(){return w})),n.d(t,"b",(function(){return E})),n.d(t,"d",(function(){return O})),n.d(t,"f",(function(){return P})),n.d(t,"h",(function(){return y}));var r=n(2),i=n(1),o=n(19),a=n(29),u=n(3),s="libraryEditor.utils",c=["tags","thumbnail","chapters","resources","subtitles","disabled","links","restrictions","categories"];function l(e,t){if(e){var n=i.reduce(e,(function(e,n,r){var o=t[r];return n||o?i.isObject(n)&&i.isObject(o)&&!i.isUndefined(n.id)&&n.id===o.id?e:i.isArray(n)?f(n,o).length?e.concat(r):e:i.isEqual(n,o)?e:e.concat(r):e}),[]);if(n.length)return i.object(i.map(n,(function(n){return i.isArray(t[n])?[n,f(e[n],t[n])]:[n,t[n]]})))}}function f(e,t){var n=[];return i.each(t,(function(t){var r=i.findWhere(e,{id:t.id});if(!i.isUndefined(r)||0!==Object.keys(t).length){var o=i.isUndefined(r)?t:l(r,t);o&&(t.id<0&&!t.value||(!r||t.id<0?n.push(t):(o.id=t.id,n.push(o))))}})),n}var d={getChanges:function(e,t){var n=l(i.omit(e.toJSON(),c),i.omit(t.toJSON(),c));if(n)return i.object(i.map(i.keys(n),(function(e){return[e,d.formatChanges(e,n[e])]})))},formatChanges:function(e,t){if(!t)return null;if(i.isObject(t)&&i.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 i.map(t,(function(e){return e.id}));case"dateModified":case"hasBroadcast":case"seriesSort":return;default:r.a.ErrorHelper.throw(new o.a("There are no formatting settings for ".concat(e)))}},updateModelState:function(e,t,n){var o=["distributors","producers","directors","productionCompanies"];for(var a in i.each(i.keys(n),(function(e){o.includes(e)&&(n[e]=t.get(e).toJSON())})),t.set(i.clone(n),{silent:!0}),e.set(t.toJSON(),{silent:!0}),n){if(!n[a]&&e.associations[a]){var u=e.get(a);(u instanceof r.a.Model||u instanceof r.a.NestedModel)&&u.clear()}}},getRemovedObjectIds:function(e,t){var n=["distributors","productionCompanies","producers","directors"],r={};return i.each(i.keys(e.toJSON()),(function(o){if(i.contains(n,o)){var a=e.get(o).map((function(e){return e.id})),u=t.get(o).map((function(e){return e.id})),s=i.filter(a,(function(e){return e&&!i.contains(u,e)}));s.length&&(r[o]=s)}})),r}},p={name:[{required:!0,msg:function(){return u.a.getPhrase(s,"videoTitleRequired")}},{maxLength:255,msg:function(){return u.a.getPhrase(s,"videoTitleExceeds")}}],description:[{required:!1},{maxLength:16e3,msg:function(){return u.a.getPhrase(s,"videoDescriptionExceeds")}}],episodeNumber:function(e,t,n){return e&&e<1?u.a.getPhrase(s,"episodeNumberLessThanOne"):e&&e>2147483647?u.a.getPhrase(s,"episodeNumberExceeds"):e%1!=0?u.a.getPhrase(s,"episodeNumberNotWhole"):n.season&&n.season.get("number")>=0&&null===e?u.a.getPhrase(s,"episodeNumberNoSeason"):""},season:function(e,t,n){return n.season&&n.season.get("number")||e&&e.number||!n.episodeNumber?"":u.a.getPhrase(s,"seasonNoEpisodeNumber")}},m=a().year(),h={productionYear:function(e){return e||0===e?(e=+e,isNaN(e)?"Production year must be a number.":e<1900||e>m?u.a.getPhrase(s,"validProductionYears",{currentYear:m}):void 0):""}},b={name:[{required:!0,msg:function(){return u.a.getPhrase(s,"resourceNameRequired")}}]},g={suggestion:[{required:!0,msg:function(){return u.a.getPhrase(s,"suggestEditRequired")}},{maxLength:16e3,msg:function(){return u.a.getPhrase(s,"suggestEditExceeds")}}],reason:[{required:!0,msg:function(){return u.a.getPhrase(s,"suggestEditReasonRequired")}},{maxLength:16e3,msg:function(){return u.a.getPhrase(s,"suggestEditReasonExceeds")}}]},y={number:function(e){return e?+e<1?u.a.getPhrase(s,"seasonLessThanOne"):+e>3e3?u.a.getPhrase(s,"seasonExceeds"):+e%1!=0?u.a.getPhrase(s,"seasonNotWhole"):"":u.a.getPhrase(s,"seasonRequired")}},v={empty:function(){return u.a.getPhrase(s,"suggestEditRatingRequired")},original:function(){return u.a.getPhrase(s,"suggestEditRatingInvalid")}},P={url:[{required:!0,pattern:"url",msg:function(){return u.a.getPhrase(s,"linkUrlRequired")}},{maxLength:16e3,msg:function(){return u.a.getPhrase(s,"linkUrlExceeds")}}],name:[{required:!0,msg:function(){return u.a.getPhrase(s,"linkNameRequired")}},{maxLength:255,msg:function(){return u.a.getPhrase(s,"linkNameExceeds")}}]},w={name:[{maxLength:128,msg:function(){return u.a.getPhrase(s,"fieldNameExceeds")}}],value:[{maxLength:16e3,msg:function(){return u.a.getPhrase(s,"fieldValueExceeds")}}]},E={fields:function(e){return e&&e.length?e.all((function(e){return!1!==e.isValid()}))?"":u.a.getPhrase(s,"fieldsInvalid"):""}};function O(){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 l}));var r=n(1),i=n(48),o=n(169),a=n(3),u="libraryEditor.utils",s={name:[{required:!0,msg:function(){return a.a.getPhrase(u,"folderNameRequired")}},{maxLength:255,msg:function(){return a.a.getPhrase(u,"folderNameExceeds")}}]},c=function(e,t){return{parentId:function(n){return n?i.a.calculateDestinationFolderDepth(e,n,t)>o.a.MAX_FOLDER_DEPTH?a.a.getPhrase(u,"maxFolderDepth",{maxDepth:o.a.MAX_FOLDER_DEPTH}):"":a.a.getPhrase(u,"selectParentFolder")}}},l=function(e){var t=e.validateName,n=e.validateParent,i=e.folder,o=e.collection;return t&&n?r.extend({},s,c(i,o)):t?s:n?c(i,o):void 0}},1054:function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var r=n(16),i=n(3),o=n(200),a=n(1071),u=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}var c,l="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"}(c||(c={}));var f={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 u.a.HostedLibrary:case u.a.CustomLibrary:return e.get("name");case u.a.Exchange:return i.a.getPhrase(l,"exchange");case u.a.Workspace:return i.a.getPhrase(l,"workspace");default:return""}},mapSourceToClass:function(e){switch(e){case u.a.HostedLibrary:case u.a.CustomLibrary:return"bg-info";case u.a.Exchange:return"bg-green";case u.a.Workspace:default:return"bg-red"}},isInteractive:function(e){return!(!e||!e.interactives)&&!!e.interactives.length},mapTypeToSvg:function(e){var t,n=(s(t={},c.Pdf,r.b.FilePDF),s(t,c.Image,r.b.FileImg),s(t,c.PowerPoint,r.b.FilePowerpoint),s(t,c.Document,r.b.FileWord),s(t,c.Excel,r.b.FileExcel),s(t,c.Zip,r.b.FileZip),s(t,c.File,r.b.File),t)[e];return n||(n=r.b.Folder),r.a.getSvg(n)},mapTypeToClass:function(e){switch(e){case c.Pdf:return"icon-red";case c.Image:return"icon-purple";case c.Document:return"icon-blue";case c.Excel:return"icon-green";case c.PowerPoint:return"icon-orange";case c.Zip:return"icon-teal";case c.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 c.Pdf:return i.a.getPhrase(l,"pdf");case c.Image:return i.a.getPhrase(l,"image");case c.Document:return i.a.getPhrase(l,"document");case c.Excel:return i.a.getPhrase(l,"spreadsheet");case c.PowerPoint:return i.a.getPhrase(l,"presentation");case c.Zip:return i.a.getPhrase(l,"zipArchive");case c.File:return i.a.getPhrase(l,"file");default:return""}},translateMetadataCollectionNames:function(e){return new a.a(e.map((function(e){return Object.assign(Object.assign({},e.toJSON()),{name:f.translateMetadataName(e.get("name"))})})))},translateMetadataName:function(e){var t="suggestEdit";switch(e){case o.MetadataType.VideoTitle:t+="VideoTitle";break;case o.MetadataType.Description:t+="Description";break;case o.MetadataType.Rating:t+="Rating";break;case o.MetadataType.SeriesTitle:t+="SeriesTitle";break;case o.MetadataType.Season:t+="SeasonNumber";break;case o.MetadataType.EpisodeNumber:t+="EpisodeNumber";break;case o.MetadataType.BroadcastDate:t+="BroadcastDate";break;case o.MetadataType.Channel:t+="Channel";break;case o.MetadataType.ProductionYear:t+="ProductionYear";break;case o.MetadataType.Distributors:t+="Distributors";break;case o.MetadataType.ProductionCompanies:t+="ProductionCompanies";break;case o.MetadataType.Directors:t+="Directors";break;case o.MetadataType.Producers:t+="Producers";break;case o.MetadataType.Other:t+="Other"}return i.a.getPhrase(l,t)}}},1055:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(1),i=n(12),o=n(3),a="libraryEditor.utils",u={isValidChapterTime:function(e,t,n,o){if(o){if(!r.isNumber(t))return s.StartTime.Invalid();if(t<0)return s.StartTime.Invalid();if(t>i.x.millisecondsToSeconds(n))return s.StartTime.Exceeds();if(o.some((function(n){return!(n.id&&n.id===e.id||n.cid===e.cid)&&n.get("startTime")===t})))return s.StartTime.Exists()}},isValidChapterName:function(e,t,n){return t?t.length>255?s.Name.MaxLength():n.some((function(n){return!(n.id&&n.id===e.id||n.cid===e.cid)&&n.get("name").trim()===t.trim()}))?s.Name.Exists():r.isEmpty(t.trim())?s.Name.Invalid():void 0:s.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}))}},s={Name:{Invalid:function(){return o.a.getPhrase(a,"chapterNameInvalid")},Exists:function(){return o.a.getPhrase(a,"chapterNameExists")},MaxLength:function(){return o.a.getPhrase(a,"chapterNameExceeds")}},StartTime:{Invalid:function(){return o.a.getPhrase(a,"chapterStartTimeInvalid")},Exists:function(){return o.a.getPhrase(a,"chapterStartTimeExists")},Exceeds:function(){return o.a.getPhrase(a,"chapterStartTimeExceeds")}}}},1056:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3),i="libraryEditor.utils",o={name:[{required:!0,msg:function(){return r.a.getPhrase(i,"libraryNameRequired")}},{maxLength:255,msg:function(){return r.a.getPhrase(i,"libraryNameExceeds")}}]}},1058:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(3),i=n(1052),o=r.a.encloseNamespace("libraryEditor.utils"),a={name:[{required:!0,msg:function(){return o("videoTitleRequired")}}],folderId:[{required:!0,msg:function(){return o("uploadFolderRequired")}}],libraryId:[{required:!0,msg:function(){return o("uploadLibraryRequired")}}],episodeNumber:function(e,t,n){return e&&e<1?o("episodeNumberLessThanOne"):e&&e>255?o("episodeNumberExceeds"):e&&e%1!=0?o("episodeNumberNotWhole"):n.season&&n.season.get("number")>=0&&null===e?o("episodeNumberNoSeason"):""},season:function(e,t,n){return n.season&&n.season.get("number")||e&&e.number||!n.episodeNumber?"":o("seasonNoEpisodeNumber")},productionYear:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i.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 i(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 o(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 u(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=c(e);if(t){var i=c(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return s(this,n)}}function s(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 c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"a",(function(){return l}));var l=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)}(c,e);var t,n,r,s=u(c);function c(){return o(this,c),s.apply(this,arguments)}return t=c,n&&i(t.prototype,n),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}(n(2).a.Collection)},1330:function(e,t,n){var r=n(10);e.exports=(r.default||r).template({1:function(e,t,n,r,i){var o;e.propertyIsEnumerable;return(null!=(o=e.lambda(null!=(o=null!=t?t.options:t)?o.spinnerEl:o,t))?o:"")+"\r\n"},3:function(e,t,n,r,i){return'<form>\r\n <div class="form-group">\r\n <label for="url" class="control-label">URL</label>\r\n <input name="url" id="url" type="text" class="form-control" placeholder="URL" autocomplete="off" autofocus/>\r\n <div class="form-feedback"></div>\r\n </div>\r\n <div class="form-group">\r\n <label for="name" class="control-label">Name</label>\r\n <input name="name" id="name" type="text" class="form-control" placeholder="Name" autocomplete="off" autofocus/>\r\n <div class="form-feedback"></div>\r\n </div>\r\n</form>\r\n'},compiler:[8,">= 4.3.0"],main:function(e,t,n,r,i){var o;e.propertyIsEnumerable;return null!=(o=n.unless.call(null!=t?t:e.nullContext||{},null!=(o=null!=t?t.options:t)?o.dataFetched:o,{name:"unless",hash:{},fn:e.program(1,i,0),inverse:e.program(3,i,0),data:i}))?o:""},useData:!0})},1449:function(e,t,n){"use strict";n.r(t),n.d(t,"EditLinkView",(function(){return O}));var r=n(6),i=n(2),o=n(5),a=n(30),u=n(42),s=n(305),c=n(265),l=n(12),f=n(0),d=n(192),p=n(1045),m=n(1051),h=n(1330),b=n.n(h);function g(e){return(g="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 v(e,t){return(v=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 i=E(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return w(this,n)}}function w(e,t){if(t&&("object"===g(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 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&&v(e,t)}(w,e);var t,n,h,g=P(w);function w(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,w),g.call(this,e)}return t=w,(n=[{key:"initialize",value:function(){this.listenTo(f.e.LINK,"link:".concat(this.options.linkId,":sync"),this.render),this.linkDataService=o.a.getInstance(f.g.Link,this)}},{key:"name",get:function(){return"EditLinkView"}},{key:"title",get:function(){return"Edit link"}},{key:"template",get:function(){return b.a}},{key:"channelName",get:function(){return l.k.generateUniqueChannelName(this)}},{key:"bindings",get:function(){return{"[name=url]":{observe:"url",setOptions:{validate:!0}},"[name=name]":{observe:"name",setOptions:{validate:!0}}}}},{key:"behaviors",get:function(){var e=this;return[{behaviorClass:s.e,title:"Edit link",spinnerButtonOptions:{channelName:this.channelName,model:this.spinnerModel=new p.a,buttonText:"Save",onClick:function(t){return e.onSubmit(t)}}}]}},{key:"events",value:function(){return{submit:"onSubmit"}}},{key:"onSubmit",value:function(e){var t=this;e&&e.preventDefault(),this.viewModel.validate(),!1!==this.viewModel.isValid()&&(r.Radio.channel(this.channelName).trigger(c.b.ShowSpinner),this.linkDataService.updateLink(this.options.videoId,this.viewModel,(function(){t.logAction(),i.a.AppLinkHelper.trigger({application:f.b.LIBRARY_EDITOR,action:f.a.LibraryEditor.EDIT_VIDEO_RESOURCES,args:[t.options.videoId]})})))}},{key:"logAction",value:function(){var e={id:this.options.linkId,parentId:+this.options.videoId,name:this.viewModel.get("name")};u.a.logUserAction(e,this.options.analyticsOptions)}},{key:"dataFetched",value:function(){return!!this.model&&!!this.viewModel}},{key:"onBeforeRender",value:function(){var e=this;this.model=this.linkDataService.getLink(this.options.linkId,(function(t){e.viewModel=a.a.get("link:".concat(e.options.linkId),t.toJSON(),{ctor:d.a}),e.viewModel.addValidation(m.c)})),this.dataFetched()&&this.spinnerModel.set(c.c.Disabled,!1)}},{key:"viewOptions",value:function(){return{dataFetched:this.dataFetched(),spinnerEl:l.r.getSpinner({size:l.s.Large,extraClasses:"mx-auto"})}}},{key:"onRender",value:function(){this.viewModel&&(this.stickit(this.viewModel),r.Validation.bind(this,{model:this.viewModel}))}},{key:"onClose",value:function(){this.unstickit()}}])&&y(t.prototype,n),h&&y(t,h),Object.defineProperty(t,"prototype",{writable:!1}),w}(i.a.View)}}]);
1
+ (window.webpackJsonp_clickview_library_editor=window.webpackJsonp_clickview_library_editor||[]).push([[33],{1049:function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var r=n(2),i=n(265);function o(e){return(o="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 a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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 s(e,t){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function c(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=f(e);if(t){var i=f(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return l(this,n)}}function l(e,t){if(t&&("object"===o(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 f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var d=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&&s(e,t)}(l,e);var t,n,r,o=c(l);function l(){return a(this,l),o.apply(this,arguments)}return t=l,(n=[{key:"defaults",value:function(){return e={},t=i.c.Disabled,n=!0,t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e;var e,t,n}}])&&u(t.prototype,n),r&&u(t,r),Object.defineProperty(t,"prototype",{writable:!1}),l}(r.a.Model)},1055:function(e,t,n){"use strict";var r=n(1059),i=n(1056),o=(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 i.g})),n.d(t,"g",(function(){return i.j})),n.d(t,"f",(function(){return i.i})),n.d(t,"c",(function(){return i.f})),n.d(t,"e",(function(){return i.h})),n.d(t,"b",(function(){return o.a})),n.d(t,"h",(function(){return a.a}))},1056:function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"k",(function(){return p})),n.d(t,"g",(function(){return b})),n.d(t,"e",(function(){return h})),n.d(t,"j",(function(){return g})),n.d(t,"i",(function(){return v})),n.d(t,"c",(function(){return w})),n.d(t,"b",(function(){return E})),n.d(t,"d",(function(){return O})),n.d(t,"f",(function(){return P})),n.d(t,"h",(function(){return y}));var r=n(2),i=n(1),o=n(19),a=n(29),u=n(3),s="libraryEditor.utils",c=["tags","thumbnail","chapters","resources","subtitles","disabled","links","restrictions","categories"];function l(e,t){if(e){var n=i.reduce(e,(function(e,n,r){var o=t[r];return n||o?i.isObject(n)&&i.isObject(o)&&!i.isUndefined(n.id)&&n.id===o.id?e:i.isArray(n)?f(n,o).length?e.concat(r):e:i.isEqual(n,o)?e:e.concat(r):e}),[]);if(n.length)return i.object(i.map(n,(function(n){return i.isArray(t[n])?[n,f(e[n],t[n])]:[n,t[n]]})))}}function f(e,t){var n=[];return i.each(t,(function(t){var r=i.findWhere(e,{id:t.id});if(!i.isUndefined(r)||0!==Object.keys(t).length){var o=i.isUndefined(r)?t:l(r,t);o&&(t.id<0&&!t.value||(!r||t.id<0?n.push(t):(o.id=t.id,n.push(o))))}})),n}var d={getChanges:function(e,t){var n=l(i.omit(e.toJSON(),c),i.omit(t.toJSON(),c));if(n)return i.object(i.map(i.keys(n),(function(e){return[e,d.formatChanges(e,n[e])]})))},formatChanges:function(e,t){if(!t)return null;if(i.isObject(t)&&i.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 i.map(t,(function(e){return e.id}));case"dateModified":case"hasBroadcast":case"seriesSort":return;default:r.a.ErrorHelper.throw(new o.a("There are no formatting settings for ".concat(e)))}},updateModelState:function(e,t,n){var o=["distributors","producers","directors","productionCompanies"];for(var a in i.each(i.keys(n),(function(e){o.includes(e)&&(n[e]=t.get(e).toJSON())})),t.set(i.clone(n),{silent:!0}),e.set(t.toJSON(),{silent:!0}),n){if(!n[a]&&e.associations[a]){var u=e.get(a);(u instanceof r.a.Model||u instanceof r.a.NestedModel)&&u.clear()}}},getRemovedObjectIds:function(e,t){var n=["distributors","productionCompanies","producers","directors"],r={};return i.each(i.keys(e.toJSON()),(function(o){if(i.contains(n,o)){var a=e.get(o).map((function(e){return e.id})),u=t.get(o).map((function(e){return e.id})),s=i.filter(a,(function(e){return e&&!i.contains(u,e)}));s.length&&(r[o]=s)}})),r}},p={name:[{required:!0,msg:function(){return u.a.getPhrase(s,"videoTitleRequired")}},{maxLength:255,msg:function(){return u.a.getPhrase(s,"videoTitleExceeds")}}],description:[{required:!1},{maxLength:16e3,msg:function(){return u.a.getPhrase(s,"videoDescriptionExceeds")}}],episodeNumber:function(e,t,n){return e&&e<1?u.a.getPhrase(s,"episodeNumberLessThanOne"):e&&e>2147483647?u.a.getPhrase(s,"episodeNumberExceeds"):e%1!=0?u.a.getPhrase(s,"episodeNumberNotWhole"):n.season&&n.season.get("number")>=0&&null===e?u.a.getPhrase(s,"episodeNumberNoSeason"):""},season:function(e,t,n){return n.season&&n.season.get("number")||e&&e.number||!n.episodeNumber?"":u.a.getPhrase(s,"seasonNoEpisodeNumber")}},m=a().year(),h={productionYear:function(e){return e||0===e?(e=+e,isNaN(e)?"Production year must be a number.":e<1900||e>m?u.a.getPhrase(s,"validProductionYears",{currentYear:m}):void 0):""}},b={name:[{required:!0,msg:function(){return u.a.getPhrase(s,"resourceNameRequired")}}]},g={suggestion:[{required:!0,msg:function(){return u.a.getPhrase(s,"suggestEditRequired")}},{maxLength:16e3,msg:function(){return u.a.getPhrase(s,"suggestEditExceeds")}}],reason:[{required:!0,msg:function(){return u.a.getPhrase(s,"suggestEditReasonRequired")}},{maxLength:16e3,msg:function(){return u.a.getPhrase(s,"suggestEditReasonExceeds")}}]},y={number:function(e){return e?+e<1?u.a.getPhrase(s,"seasonLessThanOne"):+e>3e3?u.a.getPhrase(s,"seasonExceeds"):+e%1!=0?u.a.getPhrase(s,"seasonNotWhole"):"":u.a.getPhrase(s,"seasonRequired")}},v={empty:function(){return u.a.getPhrase(s,"suggestEditRatingRequired")},original:function(){return u.a.getPhrase(s,"suggestEditRatingInvalid")}},P={url:[{required:!0,pattern:"url",msg:function(){return u.a.getPhrase(s,"linkUrlRequired")}},{maxLength:16e3,msg:function(){return u.a.getPhrase(s,"linkUrlExceeds")}}],name:[{required:!0,msg:function(){return u.a.getPhrase(s,"linkNameRequired")}},{maxLength:255,msg:function(){return u.a.getPhrase(s,"linkNameExceeds")}}]},w={name:[{maxLength:128,msg:function(){return u.a.getPhrase(s,"fieldNameExceeds")}}],value:[{maxLength:16e3,msg:function(){return u.a.getPhrase(s,"fieldValueExceeds")}}]},E={fields:function(e){return e&&e.length?e.all((function(e){return!1!==e.isValid()}))?"":u.a.getPhrase(s,"fieldsInvalid"):""}};function O(){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 l}));var r=n(1),i=n(48),o=n(169),a=n(3),u="libraryEditor.utils",s={name:[{required:!0,msg:function(){return a.a.getPhrase(u,"folderNameRequired")}},{maxLength:255,msg:function(){return a.a.getPhrase(u,"folderNameExceeds")}}]},c=function(e,t){return{parentId:function(n){return n?i.a.calculateDestinationFolderDepth(e,n,t)>o.a.MAX_FOLDER_DEPTH?a.a.getPhrase(u,"maxFolderDepth",{maxDepth:o.a.MAX_FOLDER_DEPTH}):"":a.a.getPhrase(u,"selectParentFolder")}}},l=function(e){var t=e.validateName,n=e.validateParent,i=e.folder,o=e.collection;return t&&n?r.extend({},s,c(i,o)):t?s:n?c(i,o):void 0}},1058:function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var r=n(16),i=n(3),o=n(201),a=n(1075),u=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}var c,l="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"}(c||(c={}));var f={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 u.a.HostedLibrary:case u.a.CustomLibrary:return e.get("name");case u.a.Exchange:return i.a.getPhrase(l,"exchange");case u.a.Workspace:return i.a.getPhrase(l,"workspace");default:return""}},mapSourceToClass:function(e){switch(e){case u.a.HostedLibrary:case u.a.CustomLibrary:return"bg-info";case u.a.Exchange:return"bg-green";case u.a.Workspace:default:return"bg-red"}},isInteractive:function(e){return!(!e||!e.interactives)&&!!e.interactives.length},mapTypeToSvg:function(e){var t,n=(s(t={},c.Pdf,r.b.FilePDF),s(t,c.Image,r.b.FileImg),s(t,c.PowerPoint,r.b.FilePowerpoint),s(t,c.Document,r.b.FileWord),s(t,c.Excel,r.b.FileExcel),s(t,c.Zip,r.b.FileZip),s(t,c.File,r.b.File),t)[e];return n||(n=r.b.Folder),r.a.getSvg(n)},mapTypeToClass:function(e){switch(e){case c.Pdf:return"icon-red";case c.Image:return"icon-purple";case c.Document:return"icon-blue";case c.Excel:return"icon-green";case c.PowerPoint:return"icon-orange";case c.Zip:return"icon-teal";case c.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 c.Pdf:return i.a.getPhrase(l,"pdf");case c.Image:return i.a.getPhrase(l,"image");case c.Document:return i.a.getPhrase(l,"document");case c.Excel:return i.a.getPhrase(l,"spreadsheet");case c.PowerPoint:return i.a.getPhrase(l,"presentation");case c.Zip:return i.a.getPhrase(l,"zipArchive");case c.File:return i.a.getPhrase(l,"file");default:return""}},translateMetadataCollectionNames:function(e){return new a.a(e.map((function(e){return Object.assign(Object.assign({},e.toJSON()),{name:f.translateMetadataName(e.get("name"))})})))},translateMetadataName:function(e){var t="suggestEdit";switch(e){case o.MetadataType.VideoTitle:t+="VideoTitle";break;case o.MetadataType.Description:t+="Description";break;case o.MetadataType.Rating:t+="Rating";break;case o.MetadataType.SeriesTitle:t+="SeriesTitle";break;case o.MetadataType.Season:t+="SeasonNumber";break;case o.MetadataType.EpisodeNumber:t+="EpisodeNumber";break;case o.MetadataType.BroadcastDate:t+="BroadcastDate";break;case o.MetadataType.Channel:t+="Channel";break;case o.MetadataType.ProductionYear:t+="ProductionYear";break;case o.MetadataType.Distributors:t+="Distributors";break;case o.MetadataType.ProductionCompanies:t+="ProductionCompanies";break;case o.MetadataType.Directors:t+="Directors";break;case o.MetadataType.Producers:t+="Producers";break;case o.MetadataType.Other:t+="Other"}return i.a.getPhrase(l,t)}}},1059:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(1),i=n(12),o=n(3),a="libraryEditor.utils",u={isValidChapterTime:function(e,t,n,o){if(o){if(!r.isNumber(t))return s.StartTime.Invalid();if(t<0)return s.StartTime.Invalid();if(t>i.x.millisecondsToSeconds(n))return s.StartTime.Exceeds();if(o.some((function(n){return!(n.id&&n.id===e.id||n.cid===e.cid)&&n.get("startTime")===t})))return s.StartTime.Exists()}},isValidChapterName:function(e,t,n){return t?t.length>255?s.Name.MaxLength():n.some((function(n){return!(n.id&&n.id===e.id||n.cid===e.cid)&&n.get("name").trim()===t.trim()}))?s.Name.Exists():r.isEmpty(t.trim())?s.Name.Invalid():void 0:s.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}))}},s={Name:{Invalid:function(){return o.a.getPhrase(a,"chapterNameInvalid")},Exists:function(){return o.a.getPhrase(a,"chapterNameExists")},MaxLength:function(){return o.a.getPhrase(a,"chapterNameExceeds")}},StartTime:{Invalid:function(){return o.a.getPhrase(a,"chapterStartTimeInvalid")},Exists:function(){return o.a.getPhrase(a,"chapterStartTimeExists")},Exceeds:function(){return o.a.getPhrase(a,"chapterStartTimeExceeds")}}}},1060:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3),i="libraryEditor.utils",o={name:[{required:!0,msg:function(){return r.a.getPhrase(i,"libraryNameRequired")}},{maxLength:255,msg:function(){return r.a.getPhrase(i,"libraryNameExceeds")}}]}},1062:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(3),i=n(1056),o=r.a.encloseNamespace("libraryEditor.utils"),a={name:[{required:!0,msg:function(){return o("videoTitleRequired")}}],folderId:[{required:!0,msg:function(){return o("uploadFolderRequired")}}],libraryId:[{required:!0,msg:function(){return o("uploadLibraryRequired")}}],episodeNumber:function(e,t,n){return e&&e<1?o("episodeNumberLessThanOne"):e&&e>255?o("episodeNumberExceeds"):e&&e%1!=0?o("episodeNumberNotWhole"):n.season&&n.season.get("number")>=0&&null===e?o("episodeNumberNoSeason"):""},season:function(e,t,n){return n.season&&n.season.get("number")||e&&e.number||!n.episodeNumber?"":o("seasonNoEpisodeNumber")},productionYear:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i.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 i(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 o(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 u(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=c(e);if(t){var i=c(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return s(this,n)}}function s(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 c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"a",(function(){return l}));var l=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)}(c,e);var t,n,r,s=u(c);function c(){return o(this,c),s.apply(this,arguments)}return t=c,n&&i(t.prototype,n),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}(n(2).a.Collection)},1334:function(e,t,n){var r=n(10);e.exports=(r.default||r).template({1:function(e,t,n,r,i){var o;e.propertyIsEnumerable;return(null!=(o=e.lambda(null!=(o=null!=t?t.options:t)?o.spinnerEl:o,t))?o:"")+"\r\n"},3:function(e,t,n,r,i){return'<form>\r\n <div class="form-group">\r\n <label for="url" class="control-label">URL</label>\r\n <input name="url" id="url" type="text" class="form-control" placeholder="URL" autocomplete="off" autofocus/>\r\n <div class="form-feedback"></div>\r\n </div>\r\n <div class="form-group">\r\n <label for="name" class="control-label">Name</label>\r\n <input name="name" id="name" type="text" class="form-control" placeholder="Name" autocomplete="off" autofocus/>\r\n <div class="form-feedback"></div>\r\n </div>\r\n</form>\r\n'},compiler:[8,">= 4.3.0"],main:function(e,t,n,r,i){var o;e.propertyIsEnumerable;return null!=(o=n.unless.call(null!=t?t:e.nullContext||{},null!=(o=null!=t?t.options:t)?o.dataFetched:o,{name:"unless",hash:{},fn:e.program(1,i,0),inverse:e.program(3,i,0),data:i}))?o:""},useData:!0})},1453:function(e,t,n){"use strict";n.r(t),n.d(t,"EditLinkView",(function(){return O}));var r=n(6),i=n(2),o=n(5),a=n(30),u=n(42),s=n(305),c=n(265),l=n(12),f=n(0),d=n(192),p=n(1049),m=n(1055),h=n(1334),b=n.n(h);function g(e){return(g="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 v(e,t){return(v=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 i=E(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return w(this,n)}}function w(e,t){if(t&&("object"===g(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 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&&v(e,t)}(w,e);var t,n,h,g=P(w);function w(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,w),g.call(this,e)}return t=w,(n=[{key:"initialize",value:function(){this.listenTo(f.e.LINK,"link:".concat(this.options.linkId,":sync"),this.render),this.linkDataService=o.a.getInstance(f.g.Link,this)}},{key:"name",get:function(){return"EditLinkView"}},{key:"title",get:function(){return"Edit link"}},{key:"template",get:function(){return b.a}},{key:"channelName",get:function(){return l.k.generateUniqueChannelName(this)}},{key:"bindings",get:function(){return{"[name=url]":{observe:"url",setOptions:{validate:!0}},"[name=name]":{observe:"name",setOptions:{validate:!0}}}}},{key:"behaviors",get:function(){var e=this;return[{behaviorClass:s.e,title:"Edit link",spinnerButtonOptions:{channelName:this.channelName,model:this.spinnerModel=new p.a,buttonText:"Save",onClick:function(t){return e.onSubmit(t)}}}]}},{key:"events",value:function(){return{submit:"onSubmit"}}},{key:"onSubmit",value:function(e){var t=this;e&&e.preventDefault(),this.viewModel.validate(),!1!==this.viewModel.isValid()&&(r.Radio.channel(this.channelName).trigger(c.b.ShowSpinner),this.linkDataService.updateLink(this.options.videoId,this.viewModel,(function(){t.logAction(),i.a.AppLinkHelper.trigger({application:f.b.LIBRARY_EDITOR,action:f.a.LibraryEditor.EDIT_VIDEO_RESOURCES,args:[t.options.videoId]})})))}},{key:"logAction",value:function(){var e={id:this.options.linkId,parentId:+this.options.videoId,name:this.viewModel.get("name")};u.a.logUserAction(e,this.options.analyticsOptions)}},{key:"dataFetched",value:function(){return!!this.model&&!!this.viewModel}},{key:"onBeforeRender",value:function(){var e=this;this.model=this.linkDataService.getLink(this.options.linkId,(function(t){e.viewModel=a.a.get("link:".concat(e.options.linkId),t.toJSON(),{ctor:d.a}),e.viewModel.addValidation(m.c)})),this.dataFetched()&&this.spinnerModel.set(c.c.Disabled,!1)}},{key:"viewOptions",value:function(){return{dataFetched:this.dataFetched(),spinnerEl:l.r.getSpinner({size:l.s.Large,extraClasses:"mx-auto"})}}},{key:"onRender",value:function(){this.viewModel&&(this.stickit(this.viewModel),r.Validation.bind(this,{model:this.viewModel}))}},{key:"onClose",value:function(){this.unstickit()}}])&&y(t.prototype,n),h&&y(t,h),Object.defineProperty(t,"prototype",{writable:!1}),w}(i.a.View)}}]);