@clickview/library-editor 1.1.50-dev.1 → 1.1.50-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 (78) hide show
  1. package/dist/bundles.json +2 -2
  2. package/dist/en.json +1 -1
  3. package/dist/scripts/{0-5f0c2cd8fe.chunk.js → 0-39b4264c40.chunk.js} +1 -1
  4. package/dist/scripts/{1-7a35a849f0.chunk.js → 1-b4853334f7.chunk.js} +1 -1
  5. package/dist/scripts/{10-45d2a5ef25.chunk.js → 10-74b6a07baa.chunk.js} +1 -1
  6. package/dist/scripts/{11-74bc3f2d9f.chunk.js → 11-f9ca151e61.chunk.js} +1 -1
  7. package/dist/scripts/{12-f0c771aad1.chunk.js → 12-a961dabbb5.chunk.js} +1 -1
  8. package/dist/scripts/{13-d70fedb2e0.chunk.js → 13-31b759d4dc.chunk.js} +1 -1
  9. package/dist/scripts/{14-fafea6f32c.chunk.js → 14-28ab8d5025.chunk.js} +1 -1
  10. package/dist/scripts/{15-7aa65c016d.chunk.js → 15-e326770074.chunk.js} +1 -1
  11. package/dist/scripts/{16-56c022c016.chunk.js → 16-33bc415c72.chunk.js} +1 -1
  12. package/dist/scripts/{17-14a7b2aed1.chunk.js → 17-4d85362caa.chunk.js} +1 -1
  13. package/dist/scripts/{2-0c5fba8b60.chunk.js → 2-6334a56d75.chunk.js} +1 -1
  14. package/dist/scripts/{20-48346c1412.chunk.js → 20-09959dbb36.chunk.js} +1 -1
  15. package/dist/scripts/{21-f9ff3e0692.chunk.js → 21-d07eac93af.chunk.js} +1 -1
  16. package/dist/scripts/{22-82ad962fa7.chunk.js → 22-d5cba8a51b.chunk.js} +1 -1
  17. package/dist/scripts/{23-d534e3d903.chunk.js → 23-6f0c2ffe34.chunk.js} +1 -1
  18. package/dist/scripts/{24-264b454456.chunk.js → 24-28d1ee1ddb.chunk.js} +1 -1
  19. package/dist/scripts/{25-e1743bb45d.chunk.js → 25-3b12323e76.chunk.js} +1 -1
  20. package/dist/scripts/{26-0d7e56893b.chunk.js → 26-41d73fb1cc.chunk.js} +1 -1
  21. package/dist/scripts/{27-4ddeaff155.chunk.js → 27-9faadbc5ad.chunk.js} +1 -1
  22. package/dist/scripts/{28-96aef6893a.chunk.js → 28-1abda5ddcd.chunk.js} +1 -1
  23. package/dist/scripts/{29-554f426b85.chunk.js → 29-89a17b3cd5.chunk.js} +1 -1
  24. package/dist/scripts/{3-75a0223960.chunk.js → 3-c468e5f805.chunk.js} +1 -1
  25. package/dist/scripts/{30-9bdc787ec5.chunk.js → 30-4331611384.chunk.js} +1 -1
  26. package/dist/scripts/{31-67f46f7d90.chunk.js → 31-0522a0350b.chunk.js} +1 -1
  27. package/dist/scripts/{32-afdbc7da12.chunk.js → 32-e9df7dd92c.chunk.js} +1 -1
  28. package/dist/scripts/{33-6c83870de4.chunk.js → 33-b88d856ab0.chunk.js} +1 -1
  29. package/dist/scripts/{34-486d783b77.chunk.js → 34-c677ede372.chunk.js} +1 -1
  30. package/dist/scripts/{35-44dfa1d229.chunk.js → 35-58a7bef4a3.chunk.js} +1 -1
  31. package/dist/scripts/{36-6e22a76e9d.chunk.js → 36-22798bd81a.chunk.js} +1 -1
  32. package/dist/scripts/{37-247574943e.chunk.js → 37-0336031536.chunk.js} +1 -1
  33. package/dist/scripts/{38-c053771304.chunk.js → 38-b424c6398c.chunk.js} +1 -1
  34. package/dist/scripts/{39-0034f40388.chunk.js → 39-faf8a59822.chunk.js} +1 -1
  35. package/dist/scripts/{4-bbf9a27d2b.chunk.js → 4-4c62127fb2.chunk.js} +1 -1
  36. package/dist/scripts/{40-4c9075f25f.chunk.js → 40-9b473a87c2.chunk.js} +1 -1
  37. package/dist/scripts/{41-9ef30d9bce.chunk.js → 41-20fe91435b.chunk.js} +1 -1
  38. package/dist/scripts/{42-d5ebd7e173.chunk.js → 42-143ac3914b.chunk.js} +1 -1
  39. package/dist/scripts/{43-18cb4a605c.chunk.js → 43-ce726c3839.chunk.js} +1 -1
  40. package/dist/scripts/{44-c501392a17.chunk.js → 44-fc7c025c5f.chunk.js} +1 -1
  41. package/dist/scripts/{45-6f27b84b9a.chunk.js → 45-1e84cd6639.chunk.js} +1 -1
  42. package/dist/scripts/{46-26943c79e1.chunk.js → 46-26b40a870e.chunk.js} +1 -1
  43. package/dist/scripts/{47-58f15ff5f7.chunk.js → 47-f03e03252c.chunk.js} +1 -1
  44. package/dist/scripts/{48-59c60086c6.chunk.js → 48-c9a61fd1e3.chunk.js} +1 -1
  45. package/dist/scripts/{49-c7095beb6f.chunk.js → 49-2879e96eed.chunk.js} +1 -1
  46. package/dist/scripts/{5-a06b2153c3.chunk.js → 5-96980a85ac.chunk.js} +1 -1
  47. package/dist/scripts/{50-015c9c420c.chunk.js → 50-b76b6c7d52.chunk.js} +1 -1
  48. package/dist/scripts/{51-0cca989dae.chunk.js → 51-c252822f95.chunk.js} +1 -1
  49. package/dist/scripts/{52-3cc8a4a0c6.chunk.js → 52-ecde4fecf3.chunk.js} +1 -1
  50. package/dist/scripts/{53-b0a20bc5a0.chunk.js → 53-3ab3b83088.chunk.js} +1 -1
  51. package/dist/scripts/{54-79dca3d489.chunk.js → 54-0e921db390.chunk.js} +1 -1
  52. package/dist/scripts/{55-8c5eba8730.chunk.js → 55-bd9dc838cd.chunk.js} +1 -1
  53. package/dist/scripts/{56-4d5b5fecd6.chunk.js → 56-6528a68474.chunk.js} +1 -1
  54. package/dist/scripts/{57-84eff54b39.chunk.js → 57-3477d4f9b5.chunk.js} +1 -1
  55. package/dist/scripts/{58-c0d48a915f.chunk.js → 58-2c62df5dbd.chunk.js} +1 -1
  56. package/dist/scripts/{59-53d002a1db.chunk.js → 59-13ade58ba1.chunk.js} +1 -1
  57. package/dist/scripts/{6-6c8dac1a42.chunk.js → 6-1fdfa2191a.chunk.js} +1 -1
  58. package/dist/scripts/{60-9ba5670a0b.chunk.js → 60-f36c57ef33.chunk.js} +1 -1
  59. package/dist/scripts/{61-7189b10e86.chunk.js → 61-24acf3201f.chunk.js} +1 -1
  60. package/dist/scripts/{62-6c382c4af3.chunk.js → 62-d869eccf9a.chunk.js} +1 -1
  61. package/dist/scripts/{63-d55def5355.chunk.js → 63-d35e9ced47.chunk.js} +1 -1
  62. package/dist/scripts/{64-4925cb46d4.chunk.js → 64-dfc3cd19ee.chunk.js} +1 -1
  63. package/dist/scripts/{65-28d1f3d305.chunk.js → 65-b66a158393.chunk.js} +1 -1
  64. package/dist/scripts/{66-dd4f73d58f.chunk.js → 66-89b577d70f.chunk.js} +1 -1
  65. package/dist/scripts/{67-25c6582829.chunk.js → 67-029aaf6fac.chunk.js} +1 -1
  66. package/dist/scripts/{68-4962d3fcfc.chunk.js → 68-452e0327d9.chunk.js} +1 -1
  67. package/dist/scripts/{69-2067a2189e.chunk.js → 69-0491a8faf5.chunk.js} +1 -1
  68. package/dist/scripts/{7-881a9b64de.chunk.js → 7-13b4886b73.chunk.js} +1 -1
  69. package/dist/scripts/{70-d2472d2122.chunk.js → 70-62aff2ab4e.chunk.js} +1 -1
  70. package/dist/scripts/{71-3f1e0d4f31.chunk.js → 71-91b4d4dfcb.chunk.js} +1 -1
  71. package/dist/scripts/{72-d5c52637ca.chunk.js → 72-4d851db609.chunk.js} +1 -1
  72. package/dist/scripts/{8-ef172e304b.chunk.js → 8-55ea9736c8.chunk.js} +1 -1
  73. package/dist/scripts/{9-d5b2cc8210.chunk.js → 9-e4f29db920.chunk.js} +1 -1
  74. package/dist/scripts/bundle-361d3bdf1a.min.js +10 -0
  75. package/dist/scripts/polyfills-e9aab74cda.min.js +1 -0
  76. package/package.json +3 -3
  77. package/dist/scripts/bundle-2b9531d6bc.min.js +0 -10
  78. package/dist/scripts/polyfills-35ff77d456.min.js +0 -1
@@ -1 +1 @@
1
- (window.webpackJsonp_clickview_library_editor=window.webpackJsonp_clickview_library_editor||[]).push([[8],{1030:function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var o=n(2),r=n(264);function i(e){return(i="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){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(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 u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(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=f(e);if(t){var r=f(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return a(this,n)}}function a(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var p=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}}),t&&u(e,t)}(a,e);var t,n,o,i=l(a);function a(){return c(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"defaults",value:function(){return e={},t=r.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}}])&&s(t.prototype,n),o&&s(t,o),a}(o.a.Model)},1039:function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var o=n(1),r=n(2),i=n(310);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 s(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 u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(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=f(e);if(t){var r=f(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return a(this,n)}}function a(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var p=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}}),t&&u(e,t)}(a,e);var t,n,r,c=l(a);function a(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),c.call(this,e)}return t=a,(n=[{key:"name",get:function(){return"DropdownCollectionComponent"}},{key:"className",get:function(){return"dropdown-menu items-viewpart ".concat(this.getExtraClasses(this.options.displayOptions))}},{key:"attributes",get:function(){return{"aria-labelledby":"dropdownSelector"}}},{key:"initialize",value:function(){this.listenTo(this.options.channelName,"center:dropdown",this.centerSelectedItem)}},{key:"childView",get:function(){return i.a}},{key:"childViewOptions",get:function(){var e={channelName:this.options.channelName,analyticsHelper:this.options.analyticsHelper};return o.extend(e,this.options.childOptions)}},{key:"getExtraClasses",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.alignment,n=void 0===t?"left":t,o=e.extraClasses,r="dropdown-menu-".concat(n);return o&&(r="".concat(r," ").concat(o)),r}},{key:"centerSelectedItem",value:function(){var e=this.$el.find(".active");if(e.length){var t=this.$el.scrollTop()+e.position().top,n=.5*this.$el.height()+.5*e.height();this.$el.scrollTop(t-n)}}}])&&s(t.prototype,n),r&&s(t,r),a}(r.a.ComponentCollection)},1191:function(e,t,n){e.exports={select:"_1rbBR",selectButton:"htYy7",svgContainer:"_1sQ7D",groupButton:"_2CM1D",groupButtons:"_3uv-z",groupButtonSelected:"uC5RG",buttonDisabled:"_3-I1L",mediumWeight:"_10amI"}},1247: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,c=e.lambda,s=e.escapeExpression;return'<label for="'+s(c(null!=(i=null!=t?t.options:t)?i.buttonId:i,t))+'" class="control-label">'+s(c(null!=(i=null!=t?t.options:t)?i.labelText:i,t))+"</label>\r\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){e.propertyIsEnumerable;var i,c=e.lambda,s=e.escapeExpression;return(null!=(i=n.if.call(null!=t?t:e.nullContext||{},null!=(i=null!=t?t.options:t)?i.labelText:i,{name:"if",hash:{},fn:e.program(1,r,0),inverse:e.noop,data:r}))?i:"")+'<button class="dropdown-toggle form-control btn-block text-left '+s(c(null!=(i=null!=t?t.options:t)?i.buttonClass:i,t))+'" type="button" id="'+s(c(null!=(i=null!=t?t.options:t)?i.buttonId:i,t))+'" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">\r\n '+s(c(null!=(i=null!=t?t.options:t)?i.selected:i,t))+'\r\n</button>\r\n<div class="dropdown-menu-region"></div>'},useData:!0})},1248: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="year-group-region"></div>\r\n<div name="year" class="mt-3"></div>'},useData:!0})},1249: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=e.lambda(null!=(i=null!=t?t.options:t)?i.spinnerEl:i,t))?i:"")+"\r\n"},3:function(e,t,n,o,r){e.propertyIsEnumerable;var i,c=e.lambda,s=e.escapeExpression;return'<div class="d-flex align-items-center">\r\n<label class="control-label m-0 pb-2">'+s(c(null!=(i=null!=t?t.options:t)?i.restrictFromLabel:i,t))+"</label>\r\n"+(null!=(i=n.if.call(null!=t?t:e.nullContext||{},null!=(i=null!=t?t.options:t)?i.supportUrl:i,{name:"if",hash:{},fn:e.program(4,r,0),inverse:e.noop,data:r}))?i:"")+'</div>\r\n<div class="dropdown-region '+s(c(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.select:i,t))+' mb-3"></div>\r\n<div class="access-view-region"></div>\r\n'},4:function(e,t,n,o,r){e.propertyIsEnumerable;var i,c=e.lambda,s=e.escapeExpression;return'<a \r\n class="d-inline-block ml-1 mb-3 '+s(c(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svgContainer:i,t))+'"\r\n title="'+s((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"findOutMore",{name:"lang",hash:{},data:r}))+'"\r\n href="'+s(c(null!=(i=null!=t?t.options:t)?i.supportUrl:i,t))+'" \r\n target="_blank"\r\n>\r\n '+(null!=(i=c(null!=(i=null!=t?t.options:t)?i.svg:i,t))?i:"")+"\r\n</a>\r\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){var i;e.propertyIsEnumerable;return null!=(i=n.unless.call(null!=t?t:e.nullContext||{},null!=(i=null!=t?t.options:t)?i.dataFetched:i,{name:"unless",hash:{},fn:e.program(1,r,0),inverse:e.program(3,r,0),data:r}))?i:""},useData:!0})},1464:function(e,t,n){"use strict";n.r(t);var o=n(1),r=n(6),i=n(2),c=n(5),s=n(3),u=n(16),l=n(143),a=n(308),f=n(306),p=n(1030),h=n(303),d=n(4),y=n(42),g=n(13),m=n(369),b=n(0),v=n(144),w=n(200),k=n(9),O=n(264),S=n(1039),C=n(1247),R=n.n(C);function I(e){return(I="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 P(e,t){return(P=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function E(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=x(e);if(t){var r=x(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return j(this,n)}}function j(e,t){return!t||"object"!==I(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function x(e){return(x=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var N=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}}),t&&P(e,t)}(i,e);var t,n,o,r=E(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(){var e=this.model?this.model.get("id"):"";g.c.setSelected(e,this.collection),this.listenTo(this.options.channelName,this.options.eventName,this.onSelect)}},{key:"name",get:function(){return"DropdownComponent"}},{key:"template",get:function(){return R.a}},{key:"className",get:function(){return this.options.buttonClass?"select-channel ".concat(this.options.buttonClass):"select-channel"}},{key:"regions",value:function(){return{dropdown:{el:".dropdown-menu-region",replaceElement:!0}}}},{key:"onSelect",value:function(e){g.c.setSelected(e.get("id"),this.collection),this.render()}},{key:"viewOptions",value:function(){var e=g.c.getSelected(this.collection);return Object.assign({selected:e&&e.get("name")},this.options)}},{key:"getIsOptionDisabledFn",value:function(){var e=g.c.getSelected(this.collection),t=e&&e.id;return function(){return!!t&&(t=t.toString(),this.model.get("id").toString()===t)}}},{key:"renderChannelDropdown",value:function(){this.showChildView("dropdown",new S.a({collection:this.collection,channelName:this.options.channelName,childOptions:{titleProperty:this.options.titleProperty,isDisabled:this.getIsOptionDisabledFn(),eventName:this.options.eventName},displayOptions:this.options.displayOptions,analyticsHelper:this.options.analyticsHelper}))}},{key:"onRender",value:function(){this.renderChannelDropdown()}}])&&_(t.prototype,n),o&&_(t,o),i}(i.a.Component),T=n(1191),D=n.n(T),A=n(1248),V=n.n(A);function B(e){return(B="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 G(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function M(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 U(e,t,n){return t&&M(e.prototype,t),n&&M(e,n),e}function F(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}}),t&&Y(e,t)}function Y(e,t){return(Y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function L(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=H(e);if(t){var r=H(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return z(this,n)}}function z(e,t){return!t||"object"!==B(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function H(e){return(H=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var $=function(e){F(n,e);var t=L(n);function n(){return G(this,n),t.apply(this,arguments)}return U(n,[{key:"name",get:function(){return"RestrictAccessYearGroupItemView"}},{key:"className",get:function(){var e="btn text-center p-0 pb-1 pt-1 ".concat(D.a.groupButton);return this.model.get("selected")&&(e+=" ".concat(D.a.groupButtonSelected)),e}},{key:"tagName",get:function(){return"button"}},{key:"attributes",get:function(){var e=100/this.model.collection.length;return{type:"button",style:"width: ".concat(e,"%")}}},{key:"template",get:function(){var e=this.model.get("year");return"<span>".concat(e,"</span>")}},{key:"events",value:function(){return{click:"onClick"}}},{key:"onClick",value:function(){r.Radio.channel(this.options.channelName).trigger("group:selected",this.model)}}]),n}(i.a.Component),q=function(e){F(n,e);var t=L(n);function n(){return G(this,n),t.apply(this,arguments)}return U(n,[{key:"initialize",value:function(){this.bindListeners()}},{key:"name",get:function(){return"RestrictAccessYearGroupComponentCollection"}},{key:"className",get:function(){return"btn-group w-100 ".concat(D.a.groupButtons)}},{key:"channelName",get:function(){return"".concat(this.name).concat(this.cid)}},{key:"childView",get:function(){return $}},{key:"childViewOptions",get:function(){return{channelName:this.channelName}}},{key:"bindListeners",value:function(){this.listenTo(this.channelName,"group:selected",this.onYearGroupSelected)}},{key:"onYearGroupSelected",value:function(e){this.collection.each((function(t){return t.set("selected",t.get("groupId")<=e.get("groupId"))})),this.model.set("groupId",e.get("groupId")),this.model.set("yearGroup",e.get("groupId")),this.render()}},{key:"onBeforeRender",value:function(){var e=this.model.get("yearGroup")||this.model.get("groupId");e&&(this.collection.each((function(t){return t.set("selected",t.get("groupId")<=e)})),this.model.set("groupId",e))}}]),n}(i.a.CollectionView),J=function(e){F(n,e);var t=L(n);function n(){return G(this,n),t.apply(this,arguments)}return U(n,[{key:"initialize",value:function(){this.configDataService=c.a.getInstance(b.g.Config,this)}},{key:"name",get:function(){return"RestrictAccessGroupComponent"}},{key:"lang",get:function(){return"shared.restrictAccess"}},{key:"props",get:function(){return["configDataService","currentUser"]}},{key:"template",get:function(){return V.a}},{key:"bindings",get:function(){var e=this;return{"[name=year]":{observe:"groupId",onGet:function(t){return e.buildGroupMessage(t)},updateMethod:"html",escape:!1}}}},{key:"regions",value:function(){return{yearGroupList:{replaceElement:!0,el:".year-group-region"}}}},{key:"requiredResources",get:function(){return{currentUser:v.b.currentUser}}},{key:"viewOptions",value:function(){return{styles:D.a}}},{key:"onBeforeRender",value:function(){var e=this;this.yearGroups||this.getYearGroups(),o.some(this.yearGroups,(function(t){return t.groupId===e.model.get("groupId")}))||this.model.set("groupId",void 0)}},{key:"onRender",value:function(){this.stickit(),this.showChildView("yearGroupList",new q({model:this.model,collection:new i.a.Collection(this.yearGroups)}))}},{key:"onBeforeDestroy",value:function(){this.unstickit()}},{key:"getYearGroups",value:function(){var e=this,t=this.configDataService.getCustomerYearGroups(this.currentUser.get("countryCode"));this.yearGroups=[],o.keys(k.n).forEach((function(n){var r=parseInt(n,10);if(!o.isNaN(r)&&o.contains(t,r)){var i=r===k.n.Kindergarten?"K":k.n[r].replace("Year","Y");e.yearGroups.push({year:i,groupId:r})}}))}},{key:"buildGroupMessage",value:function(e){if(e){var t=g.o.mapYearGroupToName(e);return s.a.getPhrase(this.lang,"selectedYearGroups",{classNames:D.a.mediumWeight,groupName:t})}return s.a.getPhrase(this.lang,"selectYearGroups")}}]),n}(i.a.Component);function W(e){return(W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function K(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Q(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 X(e,t){return(X=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Z(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=te(e);if(t){var r=te(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return ee(this,n)}}function ee(e,t){return!t||"object"!==W(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function te(e){return(te=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ne,oe=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}}),t&&X(e,t)}(i,e);var t,n,o,r=Z(i);function i(){return K(this,i),r.apply(this,arguments)}return t=i,(n=[{key:"name",get:function(){return"RestrictAccessComponent"}},{key:"template",get:function(){return"<p>".concat(this.getTemplateText(),"</p>")}},{key:"lang",get:function(){return"shared.restrictAccess"}},{key:"getTemplateText",value:function(){return s.a.getPhrase(this.lang,"groupNoAccess",{groupName:g.o.mapYearGroupToName(this.model.get("groupId"))})}}])&&Q(t.prototype,n),o&&Q(t,o),i}(i.a.Component),re=n(1249),ie=n.n(re);function ce(e){return(ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function se(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 ue(e,t){return(ue=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function le(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=fe(e);if(t){var r=fe(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return ae(this,n)}}function ae(e,t){return!t||"object"!==ce(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function fe(e){return(fe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"RestrictAccessView",(function(){return pe})),function(e){e.Students="Students",e.Groups="Certain year groups",e.All="Students and staff"}(ne||(ne={}));var pe=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}}),t&&ue(e,t)}(R,e);var t,n,S,C=le(R);function R(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,R),C.call(this,e)}return t=R,(n=[{key:"initialize",value:function(){this.restriction=new m.a({groupId:k.n.Students}),this.selected=ne.Students,this.bindListeners(),this.videoDataService=c.a.getInstance(b.g.Video,this),this.restrictedVideoDataService=c.a.getInstance(b.g.RestrictedVideo,this),this.videoMixinService=c.a.getInstance(b.x.VideoMixin,this)}},{key:"bindListeners",value:function(){this.listenTo(this.channelName,"dropdown:selected",this.onOptionSelected),this.listenTo(this.restriction,"change:groupId",this.onGroupChanged),this.listenTo(b.e.VIDEO,"".concat(b.f.VIDEOS,":").concat(this.options.videoId,":sync"),this.render),this.listenTo(b.e.RESTRICTED_VIDEO,"".concat(b.f.RESTRICTED_OBJECTS,":").concat(this.options.videoId,":sync"),this.render)}},{key:"name",get:function(){return"RestrictAccessView"}},{key:"title",get:function(){return s.a.getPhrase(this.lang,"title")}},{key:"lang",get:function(){return"shared.restrictAccess"}},{key:"tagName",get:function(){return"form"}},{key:"className",get:function(){return"form-group"}},{key:"channelName",get:function(){return g.k.generateUniqueChannelName(this)}},{key:"template",get:function(){return ie.a}},{key:"behaviors",get:function(){var e=this;return[{behaviorClass:h.e,title:s.a.getPhrase(this.lang,"popupHeading"),modalClasses:D.a.modal,hideCloseButton:!0,size:"modal-md",spinnerButtonOptions:{channelName:this.channelName,model:this.spinnerModel=new p.a,buttonText:s.a.getPhrase(this.lang,"updateAccess"),tooltip:function(){return e.getSubmitBtnTooltipOptions()},onClick:function(t){return e.onSubmit(t)}},buttons:[{text:s.a.getPhrase(this.lang,"allowFullAccess"),getClassName:function(){return e.getAllowFullAccessBtnClassName()}}]},{behaviorClass:l.a,selector:".".concat(D.a.svgContainer),title:s.a.getPhrase(this.lang,"findOutMore")}]}},{key:"elements",get:function(){return{submit:"submit"}}},{key:"events",value:function(){return{submit:"onSubmit","click .allow-full-access":"onAllowFullAccess"}}},{key:"regions",value:function(){return{dropdown:".dropdown-region",accessView:{replaceElement:!0,el:".access-view-region"}}}},{key:"getAllowFullAccessBtnClassName",value:function(){var e="btn btn-link cursor-pointer mr-2 allow-full-access";return this.dataFetched()&&!this.spinnerModel.get(O.c.ShowSpinner)||(e+=" disabled"),e}},{key:"getSubmitBtnTooltipOptions",value:function(){if(this.dataFetched()&&this.spinnerModel.get(O.c.Disabled))return{title:s.a.getPhrase(this.lang,"selectYear")}}},{key:"onOptionSelected",value:function(e){this.refreshRestriction();var t=this.getAccessView(e.get("name"));this.showChildView("accessView",new t({model:this.restriction,currentUser:this.currentUser})),this.renderDropdown()}},{key:"onGroupChanged",value:function(e){this.isRendered()&&this.spinnerModel.set(O.c.Disabled,o.isUndefined(e.get("groupId")))}},{key:"getAccessView",value:function(e){switch(this.selected=e,e){case ne.Students:return this.restriction.set("groupId",k.n.Students),oe;case ne.Groups:return J;case ne.All:return this.restriction.set("groupId",k.n.All),oe}}},{key:"getSelection",value:function(e){switch(e){case k.n.All:case k.n.Staff:return ne.All;case k.n.Students:return ne.Students;default:return ne.Groups}}},{key:"refreshRestriction",value:function(){if(this.restrictedObjectCollection&&this.restrictedObjectCollection.length&&this.model){this.videoMixinService.mixinVideoRestriction(this.model,this.restrictedObjectCollection);var e=this.model.restrictions.last();e&&o.isNumber(e.get("groupId"))&&(this.restriction.set("groupId",e.get("groupId")),this.selected=this.getSelection(e.get("groupId")))}}},{key:"onSubmit",value:function(e){var t=this;if(e&&e.preventDefault(),o.isUndefined(this.restriction.get("groupId")))return!1;r.Radio.channel(this.channelName).trigger(O.b.ShowSpinner),this.restrictedVideoDataService.updateVideoRestriction(this.options.videoId,this.restriction.get("groupId"),this.currentUser.get("customerId"),this.currentUser.get("id"),(function(){t.triggerMethod("hide"),r.Radio.channel(b.e.RESTRICTED_VIDEO).trigger("cache:cleared")})),this.logAction(this.restriction.get("groupId"))}},{key:"onAllowFullAccess",value:function(){this.dataFetched()&&!this.spinnerModel.get(O.c.ShowSpinner)&&(this.spinnerModel.set(O.c.Disabled,!0),this.restriction.set("groupId",k.n.All),this.restrictedVideoDataService.deleteVideoRestriction(this.options.videoId,(function(){r.Radio.channel(b.e.RESTRICTED_VIDEO).trigger("cache:cleared")})),this.triggerMethod("hide"),this.logAction())}},{key:"logAction",value:function(e){var t={location:d.LocationContext.Popup,actionType:d.UserAction.SetAccess,entity:d.EntityType.Video,workflowPhase:d.WorkflowPhase.Complete},n={id:this.model.get("id"),restriction:!!o.isNumber(e)&&k.n[e]};y.a.logUserAction(n,t)}},{key:"dataFetched",value:function(){return!!this.model&&!!this.restrictedObjectCollection}},{key:"renderDropdown",value:function(){var e=this;this.collection=new i.a.Collection([{name:ne.Students},{name:ne.Groups},{name:ne.All}]),this.collection.each((function(t){return t.set("selected",t.get("name")===e.selected)})),this.showChildView("dropdown",new N({titleProperty:"name",eventName:"dropdown:selected",buttonId:"select-btn",collection:this.collection,channelName:this.channelName,buttonClass:D.a.selectButton,displayOptions:{extraClasses:"w-100"},analyticsHelper:y.a}))}},{key:"requiredResources",get:function(){return{config:w.b.config,currentUser:v.b.currentUser}}},{key:"onBeforeRender",value:function(){this.model=this.videoDataService.getVideo(this.options.videoId),this.restrictedObjectCollection=this.restrictedVideoDataService.getVideoRestrictions([this.options.videoId]),this.model&&this.restrictedObjectCollection&&this.refreshRestriction(),this.dataFetched()&&this.spinnerModel.set(O.c.Disabled,!1)}},{key:"viewOptions",value:function(){var e,t;return{styles:D.a,supportUrl:a.a.getArticle(null===(e=this.config)||void 0===e?void 0:e.get("supportSiteUrl"),f.a.VideoAccess,null===(t=this.currentUser)||void 0===t?void 0:t.get("countryCode")),svg:u.a.getSvg(u.b.Info),dataFetched:this.dataFetched(),spinnerEl:g.r.getSpinner({size:g.s.Large,extraClasses:"mx-auto"}),restrictFromLabel:s.a.getPhrase(this.lang,"popupSubheading")}}},{key:"onRender",value:function(){this.dataFetched()&&(this.renderDropdown(),this.onOptionSelected(new i.a.Model({name:this.selected})))}}])&&se(t.prototype,n),S&&se(t,S),R}(i.a.View)}}]);
1
+ (window.webpackJsonp_clickview_library_editor=window.webpackJsonp_clickview_library_editor||[]).push([[8],{1027:function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var o=n(2),r=n(263);function i(e){return(i="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){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(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 u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(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=f(e);if(t){var r=f(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return a(this,n)}}function a(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var p=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}}),t&&u(e,t)}(a,e);var t,n,o,i=l(a);function a(){return c(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"defaults",value:function(){return e={},t=r.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}}])&&s(t.prototype,n),o&&s(t,o),a}(o.a.Model)},1036:function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var o=n(1),r=n(2),i=n(309);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 s(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 u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(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=f(e);if(t){var r=f(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return a(this,n)}}function a(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var p=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}}),t&&u(e,t)}(a,e);var t,n,r,c=l(a);function a(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),c.call(this,e)}return t=a,(n=[{key:"name",get:function(){return"DropdownCollectionComponent"}},{key:"className",get:function(){return"dropdown-menu items-viewpart ".concat(this.getExtraClasses(this.options.displayOptions))}},{key:"attributes",get:function(){return{"aria-labelledby":"dropdownSelector"}}},{key:"initialize",value:function(){this.listenTo(this.options.channelName,"center:dropdown",this.centerSelectedItem)}},{key:"childView",get:function(){return i.a}},{key:"childViewOptions",get:function(){var e={channelName:this.options.channelName,analyticsHelper:this.options.analyticsHelper};return o.extend(e,this.options.childOptions)}},{key:"getExtraClasses",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.alignment,n=void 0===t?"left":t,o=e.extraClasses,r="dropdown-menu-".concat(n);return o&&(r="".concat(r," ").concat(o)),r}},{key:"centerSelectedItem",value:function(){var e=this.$el.find(".active");if(e.length){var t=this.$el.scrollTop()+e.position().top,n=.5*this.$el.height()+.5*e.height();this.$el.scrollTop(t-n)}}}])&&s(t.prototype,n),r&&s(t,r),a}(r.a.ComponentCollection)},1188:function(e,t,n){e.exports={select:"_1rbBR",selectButton:"htYy7",svgContainer:"_1sQ7D",groupButton:"_2CM1D",groupButtons:"_3uv-z",groupButtonSelected:"uC5RG",buttonDisabled:"_3-I1L",mediumWeight:"_10amI"}},1244: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,c=e.lambda,s=e.escapeExpression;return'<label for="'+s(c(null!=(i=null!=t?t.options:t)?i.buttonId:i,t))+'" class="control-label">'+s(c(null!=(i=null!=t?t.options:t)?i.labelText:i,t))+"</label>\r\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){e.propertyIsEnumerable;var i,c=e.lambda,s=e.escapeExpression;return(null!=(i=n.if.call(null!=t?t:e.nullContext||{},null!=(i=null!=t?t.options:t)?i.labelText:i,{name:"if",hash:{},fn:e.program(1,r,0),inverse:e.noop,data:r}))?i:"")+'<button class="dropdown-toggle form-control btn-block text-left '+s(c(null!=(i=null!=t?t.options:t)?i.buttonClass:i,t))+'" type="button" id="'+s(c(null!=(i=null!=t?t.options:t)?i.buttonId:i,t))+'" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">\r\n '+s(c(null!=(i=null!=t?t.options:t)?i.selected:i,t))+'\r\n</button>\r\n<div class="dropdown-menu-region"></div>'},useData:!0})},1245: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="year-group-region"></div>\r\n<div name="year" class="mt-3"></div>'},useData:!0})},1246: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=e.lambda(null!=(i=null!=t?t.options:t)?i.spinnerEl:i,t))?i:"")+"\r\n"},3:function(e,t,n,o,r){e.propertyIsEnumerable;var i,c=e.lambda,s=e.escapeExpression;return'<div class="d-flex align-items-center">\r\n<label class="control-label m-0 pb-2">'+s(c(null!=(i=null!=t?t.options:t)?i.restrictFromLabel:i,t))+"</label>\r\n"+(null!=(i=n.if.call(null!=t?t:e.nullContext||{},null!=(i=null!=t?t.options:t)?i.supportUrl:i,{name:"if",hash:{},fn:e.program(4,r,0),inverse:e.noop,data:r}))?i:"")+'</div>\r\n<div class="dropdown-region '+s(c(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.select:i,t))+' mb-3"></div>\r\n<div class="access-view-region"></div>\r\n'},4:function(e,t,n,o,r){e.propertyIsEnumerable;var i,c=e.lambda,s=e.escapeExpression;return'<a \r\n class="d-inline-block ml-1 mb-3 '+s(c(null!=(i=null!=(i=null!=t?t.options:t)?i.styles:i)?i.svgContainer:i,t))+'"\r\n title="'+s((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"findOutMore",{name:"lang",hash:{},data:r}))+'"\r\n href="'+s(c(null!=(i=null!=t?t.options:t)?i.supportUrl:i,t))+'" \r\n target="_blank"\r\n>\r\n '+(null!=(i=c(null!=(i=null!=t?t.options:t)?i.svg:i,t))?i:"")+"\r\n</a>\r\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,r){var i;e.propertyIsEnumerable;return null!=(i=n.unless.call(null!=t?t:e.nullContext||{},null!=(i=null!=t?t.options:t)?i.dataFetched:i,{name:"unless",hash:{},fn:e.program(1,r,0),inverse:e.program(3,r,0),data:r}))?i:""},useData:!0})},1461:function(e,t,n){"use strict";n.r(t);var o=n(1),r=n(6),i=n(2),c=n(5),s=n(3),u=n(17),l=n(142),a=n(307),f=n(305),p=n(1027),h=n(302),d=n(4),y=n(42),g=n(13),m=n(368),b=n(0),v=n(143),w=n(197),k=n(9),O=n(263),S=n(1036),C=n(1244),R=n.n(C);function I(e){return(I="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 P(e,t){return(P=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function E(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=x(e);if(t){var r=x(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return j(this,n)}}function j(e,t){return!t||"object"!==I(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function x(e){return(x=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var N=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}}),t&&P(e,t)}(i,e);var t,n,o,r=E(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(){var e=this.model?this.model.get("id"):"";g.c.setSelected(e,this.collection),this.listenTo(this.options.channelName,this.options.eventName,this.onSelect)}},{key:"name",get:function(){return"DropdownComponent"}},{key:"template",get:function(){return R.a}},{key:"className",get:function(){return this.options.buttonClass?"select-channel ".concat(this.options.buttonClass):"select-channel"}},{key:"regions",value:function(){return{dropdown:{el:".dropdown-menu-region",replaceElement:!0}}}},{key:"onSelect",value:function(e){g.c.setSelected(e.get("id"),this.collection),this.render()}},{key:"viewOptions",value:function(){var e=g.c.getSelected(this.collection);return Object.assign({selected:e&&e.get("name")},this.options)}},{key:"getIsOptionDisabledFn",value:function(){var e=g.c.getSelected(this.collection),t=e&&e.id;return function(){return!!t&&(t=t.toString(),this.model.get("id").toString()===t)}}},{key:"renderChannelDropdown",value:function(){this.showChildView("dropdown",new S.a({collection:this.collection,channelName:this.options.channelName,childOptions:{titleProperty:this.options.titleProperty,isDisabled:this.getIsOptionDisabledFn(),eventName:this.options.eventName},displayOptions:this.options.displayOptions,analyticsHelper:this.options.analyticsHelper}))}},{key:"onRender",value:function(){this.renderChannelDropdown()}}])&&_(t.prototype,n),o&&_(t,o),i}(i.a.Component),T=n(1188),D=n.n(T),A=n(1245),V=n.n(A);function B(e){return(B="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 G(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function M(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 U(e,t,n){return t&&M(e.prototype,t),n&&M(e,n),e}function F(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}}),t&&Y(e,t)}function Y(e,t){return(Y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function L(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=H(e);if(t){var r=H(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return z(this,n)}}function z(e,t){return!t||"object"!==B(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function H(e){return(H=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var $=function(e){F(n,e);var t=L(n);function n(){return G(this,n),t.apply(this,arguments)}return U(n,[{key:"name",get:function(){return"RestrictAccessYearGroupItemView"}},{key:"className",get:function(){var e="btn text-center p-0 pb-1 pt-1 ".concat(D.a.groupButton);return this.model.get("selected")&&(e+=" ".concat(D.a.groupButtonSelected)),e}},{key:"tagName",get:function(){return"button"}},{key:"attributes",get:function(){var e=100/this.model.collection.length;return{type:"button",style:"width: ".concat(e,"%")}}},{key:"template",get:function(){var e=this.model.get("year");return"<span>".concat(e,"</span>")}},{key:"events",value:function(){return{click:"onClick"}}},{key:"onClick",value:function(){r.Radio.channel(this.options.channelName).trigger("group:selected",this.model)}}]),n}(i.a.Component),q=function(e){F(n,e);var t=L(n);function n(){return G(this,n),t.apply(this,arguments)}return U(n,[{key:"initialize",value:function(){this.bindListeners()}},{key:"name",get:function(){return"RestrictAccessYearGroupComponentCollection"}},{key:"className",get:function(){return"btn-group w-100 ".concat(D.a.groupButtons)}},{key:"channelName",get:function(){return"".concat(this.name).concat(this.cid)}},{key:"childView",get:function(){return $}},{key:"childViewOptions",get:function(){return{channelName:this.channelName}}},{key:"bindListeners",value:function(){this.listenTo(this.channelName,"group:selected",this.onYearGroupSelected)}},{key:"onYearGroupSelected",value:function(e){this.collection.each((function(t){return t.set("selected",t.get("groupId")<=e.get("groupId"))})),this.model.set("groupId",e.get("groupId")),this.model.set("yearGroup",e.get("groupId")),this.render()}},{key:"onBeforeRender",value:function(){var e=this.model.get("yearGroup")||this.model.get("groupId");e&&(this.collection.each((function(t){return t.set("selected",t.get("groupId")<=e)})),this.model.set("groupId",e))}}]),n}(i.a.CollectionView),J=function(e){F(n,e);var t=L(n);function n(){return G(this,n),t.apply(this,arguments)}return U(n,[{key:"initialize",value:function(){this.configDataService=c.a.getInstance(b.g.Config,this)}},{key:"name",get:function(){return"RestrictAccessGroupComponent"}},{key:"lang",get:function(){return"shared.restrictAccess"}},{key:"props",get:function(){return["configDataService","currentUser"]}},{key:"template",get:function(){return V.a}},{key:"bindings",get:function(){var e=this;return{"[name=year]":{observe:"groupId",onGet:function(t){return e.buildGroupMessage(t)},updateMethod:"html",escape:!1}}}},{key:"regions",value:function(){return{yearGroupList:{replaceElement:!0,el:".year-group-region"}}}},{key:"requiredResources",get:function(){return{currentUser:v.b.currentUser}}},{key:"viewOptions",value:function(){return{styles:D.a}}},{key:"onBeforeRender",value:function(){var e=this;this.yearGroups||this.getYearGroups(),o.some(this.yearGroups,(function(t){return t.groupId===e.model.get("groupId")}))||this.model.set("groupId",void 0)}},{key:"onRender",value:function(){this.stickit(),this.showChildView("yearGroupList",new q({model:this.model,collection:new i.a.Collection(this.yearGroups)}))}},{key:"onBeforeDestroy",value:function(){this.unstickit()}},{key:"getYearGroups",value:function(){var e=this,t=this.configDataService.getCustomerYearGroups(this.currentUser.get("countryCode"));this.yearGroups=[],o.keys(k.n).forEach((function(n){var r=parseInt(n,10);if(!o.isNaN(r)&&o.contains(t,r)){var i=r===k.n.Kindergarten?"K":k.n[r].replace("Year","Y");e.yearGroups.push({year:i,groupId:r})}}))}},{key:"buildGroupMessage",value:function(e){if(e){var t=g.o.mapYearGroupToName(e);return s.a.getPhrase(this.lang,"selectedYearGroups",{classNames:D.a.mediumWeight,groupName:t})}return s.a.getPhrase(this.lang,"selectYearGroups")}}]),n}(i.a.Component);function W(e){return(W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function K(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Q(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 X(e,t){return(X=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Z(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=te(e);if(t){var r=te(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return ee(this,n)}}function ee(e,t){return!t||"object"!==W(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function te(e){return(te=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ne,oe=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}}),t&&X(e,t)}(i,e);var t,n,o,r=Z(i);function i(){return K(this,i),r.apply(this,arguments)}return t=i,(n=[{key:"name",get:function(){return"RestrictAccessComponent"}},{key:"template",get:function(){return"<p>".concat(this.getTemplateText(),"</p>")}},{key:"lang",get:function(){return"shared.restrictAccess"}},{key:"getTemplateText",value:function(){return s.a.getPhrase(this.lang,"groupNoAccess",{groupName:g.o.mapYearGroupToName(this.model.get("groupId"))})}}])&&Q(t.prototype,n),o&&Q(t,o),i}(i.a.Component),re=n(1246),ie=n.n(re);function ce(e){return(ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function se(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 ue(e,t){return(ue=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function le(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=fe(e);if(t){var r=fe(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return ae(this,n)}}function ae(e,t){return!t||"object"!==ce(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function fe(e){return(fe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"RestrictAccessView",(function(){return pe})),function(e){e.Students="Students",e.Groups="Certain year groups",e.All="Students and staff"}(ne||(ne={}));var pe=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}}),t&&ue(e,t)}(R,e);var t,n,S,C=le(R);function R(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,R),C.call(this,e)}return t=R,(n=[{key:"initialize",value:function(){this.restriction=new m.a({groupId:k.n.Students}),this.selected=ne.Students,this.bindListeners(),this.videoDataService=c.a.getInstance(b.g.Video,this),this.restrictedVideoDataService=c.a.getInstance(b.g.RestrictedVideo,this),this.videoMixinService=c.a.getInstance(b.x.VideoMixin,this)}},{key:"bindListeners",value:function(){this.listenTo(this.channelName,"dropdown:selected",this.onOptionSelected),this.listenTo(this.restriction,"change:groupId",this.onGroupChanged),this.listenTo(b.e.VIDEO,"".concat(b.f.VIDEOS,":").concat(this.options.videoId,":sync"),this.render),this.listenTo(b.e.RESTRICTED_VIDEO,"".concat(b.f.RESTRICTED_OBJECTS,":").concat(this.options.videoId,":sync"),this.render)}},{key:"name",get:function(){return"RestrictAccessView"}},{key:"title",get:function(){return s.a.getPhrase(this.lang,"title")}},{key:"lang",get:function(){return"shared.restrictAccess"}},{key:"tagName",get:function(){return"form"}},{key:"className",get:function(){return"form-group"}},{key:"channelName",get:function(){return g.k.generateUniqueChannelName(this)}},{key:"template",get:function(){return ie.a}},{key:"behaviors",get:function(){var e=this;return[{behaviorClass:h.e,title:s.a.getPhrase(this.lang,"popupHeading"),modalClasses:D.a.modal,hideCloseButton:!0,size:"modal-md",spinnerButtonOptions:{channelName:this.channelName,model:this.spinnerModel=new p.a,buttonText:s.a.getPhrase(this.lang,"updateAccess"),tooltip:function(){return e.getSubmitBtnTooltipOptions()},onClick:function(t){return e.onSubmit(t)}},buttons:[{text:s.a.getPhrase(this.lang,"allowFullAccess"),getClassName:function(){return e.getAllowFullAccessBtnClassName()}}]},{behaviorClass:l.a,selector:".".concat(D.a.svgContainer),title:s.a.getPhrase(this.lang,"findOutMore")}]}},{key:"elements",get:function(){return{submit:"submit"}}},{key:"events",value:function(){return{submit:"onSubmit","click .allow-full-access":"onAllowFullAccess"}}},{key:"regions",value:function(){return{dropdown:".dropdown-region",accessView:{replaceElement:!0,el:".access-view-region"}}}},{key:"getAllowFullAccessBtnClassName",value:function(){var e="btn btn-link cursor-pointer mr-2 allow-full-access";return this.dataFetched()&&!this.spinnerModel.get(O.c.ShowSpinner)||(e+=" disabled"),e}},{key:"getSubmitBtnTooltipOptions",value:function(){if(this.dataFetched()&&this.spinnerModel.get(O.c.Disabled))return{title:s.a.getPhrase(this.lang,"selectYear")}}},{key:"onOptionSelected",value:function(e){this.refreshRestriction();var t=this.getAccessView(e.get("name"));this.showChildView("accessView",new t({model:this.restriction,currentUser:this.currentUser})),this.renderDropdown()}},{key:"onGroupChanged",value:function(e){this.isRendered()&&this.spinnerModel.set(O.c.Disabled,o.isUndefined(e.get("groupId")))}},{key:"getAccessView",value:function(e){switch(this.selected=e,e){case ne.Students:return this.restriction.set("groupId",k.n.Students),oe;case ne.Groups:return J;case ne.All:return this.restriction.set("groupId",k.n.All),oe}}},{key:"getSelection",value:function(e){switch(e){case k.n.All:case k.n.Staff:return ne.All;case k.n.Students:return ne.Students;default:return ne.Groups}}},{key:"refreshRestriction",value:function(){if(this.restrictedObjectCollection&&this.restrictedObjectCollection.length&&this.model){this.videoMixinService.mixinVideoRestriction(this.model,this.restrictedObjectCollection);var e=this.model.restrictions.last();e&&o.isNumber(e.get("groupId"))&&(this.restriction.set("groupId",e.get("groupId")),this.selected=this.getSelection(e.get("groupId")))}}},{key:"onSubmit",value:function(e){var t=this;if(e&&e.preventDefault(),o.isUndefined(this.restriction.get("groupId")))return!1;r.Radio.channel(this.channelName).trigger(O.b.ShowSpinner),this.restrictedVideoDataService.updateVideoRestriction(this.options.videoId,this.restriction.get("groupId"),this.currentUser.get("customerId"),this.currentUser.get("id"),(function(){t.triggerMethod("hide"),r.Radio.channel(b.e.RESTRICTED_VIDEO).trigger("cache:cleared")})),this.logAction(this.restriction.get("groupId"))}},{key:"onAllowFullAccess",value:function(){this.dataFetched()&&!this.spinnerModel.get(O.c.ShowSpinner)&&(this.spinnerModel.set(O.c.Disabled,!0),this.restriction.set("groupId",k.n.All),this.restrictedVideoDataService.deleteVideoRestriction(this.options.videoId,(function(){r.Radio.channel(b.e.RESTRICTED_VIDEO).trigger("cache:cleared")})),this.triggerMethod("hide"),this.logAction())}},{key:"logAction",value:function(e){var t={location:d.LocationContext.Popup,actionType:d.UserAction.SetAccess,entity:d.EntityType.Video,workflowPhase:d.WorkflowPhase.Complete},n={id:this.model.get("id"),restriction:!!o.isNumber(e)&&k.n[e]};y.a.logUserAction(n,t)}},{key:"dataFetched",value:function(){return!!this.model&&!!this.restrictedObjectCollection}},{key:"renderDropdown",value:function(){var e=this;this.collection=new i.a.Collection([{name:ne.Students},{name:ne.Groups},{name:ne.All}]),this.collection.each((function(t){return t.set("selected",t.get("name")===e.selected)})),this.showChildView("dropdown",new N({titleProperty:"name",eventName:"dropdown:selected",buttonId:"select-btn",collection:this.collection,channelName:this.channelName,buttonClass:D.a.selectButton,displayOptions:{extraClasses:"w-100"},analyticsHelper:y.a}))}},{key:"requiredResources",get:function(){return{config:w.b.config,currentUser:v.b.currentUser}}},{key:"onBeforeRender",value:function(){this.model=this.videoDataService.getVideo(this.options.videoId),this.restrictedObjectCollection=this.restrictedVideoDataService.getVideoRestrictions([this.options.videoId]),this.model&&this.restrictedObjectCollection&&this.refreshRestriction(),this.dataFetched()&&this.spinnerModel.set(O.c.Disabled,!1)}},{key:"viewOptions",value:function(){var e,t;return{styles:D.a,supportUrl:a.a.getArticle(null===(e=this.config)||void 0===e?void 0:e.get("supportSiteUrl"),f.a.VideoAccess,null===(t=this.currentUser)||void 0===t?void 0:t.get("countryCode")),svg:u.a.getSvg(u.b.Info),dataFetched:this.dataFetched(),spinnerEl:g.r.getSpinner({size:g.s.Large,extraClasses:"mx-auto"}),restrictFromLabel:s.a.getPhrase(this.lang,"popupSubheading")}}},{key:"onRender",value:function(){this.dataFetched()&&(this.renderDropdown(),this.onOptionSelected(new i.a.Model({name:this.selected})))}}])&&se(t.prototype,n),S&&se(t,S),R}(i.a.View)}}]);
@@ -1 +1 @@
1
- (window.webpackJsonp_clickview_library_editor=window.webpackJsonp_clickview_library_editor||[]).push([[9],{1036:function(e,t,n){"use strict";var r=n(1041),i=n(1037),a=(n(1038),n(3),n(1042)),o=(n(1044),n(1040));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 a.a})),n.d(t,"h",(function(){return o.a}))},1037: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 h})),n.d(t,"e",(function(){return m})),n.d(t,"j",(function(){return b})),n.d(t,"i",(function(){return v})),n.d(t,"c",(function(){return E})),n.d(t,"b",(function(){return R})),n.d(t,"d",(function(){return x})),n.d(t,"f",(function(){return P})),n.d(t,"h",(function(){return y}));var r=n(2),i=n(1),a=n(19),o=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 a=t[r];return n||a?i.isObject(n)&&i.isObject(a)&&!i.isUndefined(n.id)&&n.id===a.id?e:i.isArray(n)?f(n,a).length?e.concat(r):e:i.isEqual(n,a)?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 a=i.isUndefined(r)?t:l(r,t);a&&(t.id<0&&!t.value||(!r||t.id<0?n.push(t):(a.id=t.id,n.push(a))))}})),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":return;default:r.a.ErrorHelper.throw(new a.a("There are no formatting settings for ".concat(e)))}},updateModelState:function(e,t,n){var a=["distributors","producers","directors","productionCompanies"];for(var o in i.each(i.keys(n),(function(e){a.includes(e)&&(n[e]=t.get(e).toJSON())})),t.set(i.clone(n),{silent:!0}),e.set(t.toJSON(),{silent:!0}),n){if(!n[o]&&e.associations[o]){var u=e.get(o);(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(a){if(i.contains(n,a)){var o=e.get(a).map((function(e){return e.id})),u=t.get(a).map((function(e){return e.id})),s=i.filter(o,(function(e){return e&&!i.contains(u,e)}));s.length&&(r[a]=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")}},g=o().year(),m={productionYear:function(e){return e||0===e?(e=+e,isNaN(e)?"Production year must be a number.":e<1900||e>g?u.a.getPhrase(s,"validProductionYears",{currentYear:g}):void 0):""}},h={name:[{required:!0,msg:function(){return u.a.getPhrase(s,"resourceNameRequired")}}]},b={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")}}]},E={name:[{maxLength:128,msg:function(){return u.a.getPhrase(s,"fieldNameExceeds")}}],value:[{maxLength:16e3,msg:function(){return u.a.getPhrase(s,"fieldValueExceeds")}}]},R={fields:function(e){return e&&e.length?e.all((function(e){return!1!==e.isValid()}))?"":u.a.getPhrase(s,"fieldsInvalid"):""}};function x(){return[{id:-1,name:"Admin Notes",value:"",placeholder:"Notes that only admins will see"}]}},1038:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(1),i=n(48),a=n(168),o=n(3),u="libraryEditor.utils",s={name:[{required:!0,msg:function(){return o.a.getPhrase(u,"folderNameRequired")}},{maxLength:255,msg:function(){return o.a.getPhrase(u,"folderNameExceeds")}}]},c=function(e,t){return{parentId:function(n){return n?i.a.calculateDestinationFolderDepth(e,n,t)>a.a.MAX_FOLDER_DEPTH?o.a.getPhrase(u,"maxFolderDepth",{maxDepth:a.a.MAX_FOLDER_DEPTH}):"":o.a.getPhrase(u,"selectParentFolder")}}},l=function(e){var t=e.validateName,n=e.validateParent,i=e.folder,a=e.collection;return t&&n?r.extend({},s,c(i,a)):t?s:n?c(i,a):void 0}},1040:function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var r=n(16),i=n(3),a=n(199),o=n(1056),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 o.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 a.MetadataType.VideoTitle:t+="VideoTitle";break;case a.MetadataType.Description:t+="Description";break;case a.MetadataType.Rating:t+="Rating";break;case a.MetadataType.SeriesTitle:t+="SeriesTitle";break;case a.MetadataType.Season:t+="SeasonNumber";break;case a.MetadataType.EpisodeNumber:t+="EpisodeNumber";break;case a.MetadataType.BroadcastDate:t+="BroadcastDate";break;case a.MetadataType.Channel:t+="Channel";break;case a.MetadataType.ProductionYear:t+="ProductionYear";break;case a.MetadataType.Distributors:t+="Distributors";break;case a.MetadataType.ProductionCompanies:t+="ProductionCompanies";break;case a.MetadataType.Directors:t+="Directors";break;case a.MetadataType.Producers:t+="Producers";break;case a.MetadataType.Other:t+="Other"}return i.a.getPhrase(l,t)}}},1041:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(1),i=n(13),a=n(3),o="libraryEditor.utils",u={isValidChapterTime:function(e,t,n,a){if(a){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(a.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 a.a.getPhrase(o,"chapterNameInvalid")},Exists:function(){return a.a.getPhrase(o,"chapterNameExists")},MaxLength:function(){return a.a.getPhrase(o,"chapterNameExceeds")}},StartTime:{Invalid:function(){return a.a.getPhrase(o,"chapterStartTimeInvalid")},Exists:function(){return a.a.getPhrase(o,"chapterStartTimeExists")},Exceeds:function(){return a.a.getPhrase(o,"chapterStartTimeExceeds")}}}},1042:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(3),i="libraryEditor.utils",a={name:[{required:!0,msg:function(){return r.a.getPhrase(i,"libraryNameRequired")}},{maxLength:255,msg:function(){return r.a.getPhrase(i,"libraryNameExceeds")}}]}},1044:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3),i=n(1037),a=r.a.encloseNamespace("libraryEditor.utils"),o={name:[{required:!0,msg:function(){return a("videoTitleRequired")}}],folderId:[{required:!0,msg:function(){return a("uploadFolderRequired")}}],libraryId:[{required:!0,msg:function(){return a("uploadLibraryRequired")}}],episodeNumber:function(e,t,n){return e&&e<1?a("episodeNumberLessThanOne"):e&&e>255?a("episodeNumberExceeds"):e&&e%1!=0?a("episodeNumberNotWhole"):n.season&&n.season.get("number")>=0&&null===e?a("episodeNumberNoSeason"):""},season:function(e,t,n){return n.season&&n.season.get("number")||e&&e.number||!n.episodeNumber?"":a("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)}}},1056: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){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){return(a=Object.setPrototypeOf||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,r=s(e);if(t){var i=s(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return u(this,n)}}function u(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"a",(function(){return c}));var c=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(n,e);var t=o(n);function n(){return i(this,n),t.apply(this,arguments)}return n}(n(2).a.Collection)},1096:function(e,t,n){e.exports={requiredStar:"_3S5iJ",disabled:"_3iZQ5",formGroup:"B4xS9",suggestEdit:"_3n3sM",programTitle:"_3bWJB",description:"_3qayV",seriesTitle:"_3ojjo",broadcastDate:"_2hA-0",channel:"_1SMGG",rating:"_3AkUv",productionYear:"_1DYCl",distributors:"_2CbiR",productionCompanies:"_3hB5o",directors:"ksEaA",producers:"h7P2B",episodeNumber:"_3fMUg",seasonNumber:"GwqaB",icon:"quxL2",infoSvgContainer:"_18UDY"}},1193:function(e,t,n){e.exports={selectRating:"_1I6jj",removeRating:"_1ze5G",disabled:"_2hO8J",disabledSelected:"mnQ5O"}},1196:function(e,t,n){"use strict";var r=n(1),i=n(6),a=n(2),o=n(143),u=n(487),s=n(1250),c=n.n(s),l=n(1193),f=n.n(l);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 p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function g(e,t){return(g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=b(e);if(t){var i=b(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return h(this,n)}}function h(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf: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}}),t&&g(e,t)}(u,e);var t,n,r,a=m(u);function u(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),a.call(this,e)}return t=u,(n=[{key:"name",get:function(){return"SelectRatingItemComponent"}},{key:"template",get:function(){return c.a}},{key:"tagName",get:function(){return"li"}},{key:"attributes",get:function(){return{title:this.options.editable?this.model.get("name"):""}}},{key:"className",get:function(){var e="";return e+="btn ".concat(this.options.editable?"btn-light":"".concat(f.a.disabled)),this.model.get("selected")&&(e+=this.options.editable?" active":" ".concat(f.a.disabledSelected)),e}},{key:"events",value:function(){return{click:"onClick"}}},{key:"behaviors",get:function(){var e=this.options.editable?this.options.model.get("name"):"";return[{behaviorClass:o.a,title:e}]}},{key:"onClick",value:function(){this.options.editable&&i.Radio.channel(this.options.channelName).trigger("select:rating",this.model)}},{key:"onRender",value:function(){this.resetClassName()}}])&&p(t.prototype,n),r&&p(t,r),u}(a.a.Component);function v(e){return(v="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 P(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 E(e,t){return(E=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function R(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=k(e);if(t){var i=k(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return x(this,n)}}function x(e,t){return!t||"object"!==v(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function k(e){return(k=Object.setPrototypeOf?Object.getPrototypeOf: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}}),t&&E(e,t)}(a,e);var t,n,r,i=R(a);function a(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.call(this,e)}return t=a,(n=[{key:"name",get:function(){return"SelectRatingCollectionComponent"}},{key:"tagName",get:function(){return"ul"}},{key:"className",get:function(){return"rating-group btn-group p-0 m-0"}},{key:"childView",get:function(){return y}},{key:"childViewOptions",get:function(){return{channelName:this.options.channelName,currentRatingId:this.options.currentRatingId,editable:this.options.editable}}}])&&P(t.prototype,n),r&&P(t,r),a}(a.a.ComponentCollection),N=n(13),O=n(3),T=n(0),S=n(199),C=n(1251),_=n.n(C),j=n(1096),I=n.n(j);function M(e){return(M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function D(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function q(e,t){return(q=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function L(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=B(e);if(t){var i=B(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return F(this,n)}}function F(e,t){return!t||"object"!==M(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function B(e){return(B=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"a",(function(){return A}));var A=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}}),t&&q(e,t)}(c,e);var t,n,a,s=L(c);function c(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),s.call(this,e)}return t=c,(n=[{key:"name",get:function(){return"SelectRatingComponent"}},{key:"channelName",get:function(){return"".concat(this.name).concat(this.cid)}},{key:"lang",get:function(){return"shared.selectRating"}},{key:"events",value:function(){return{"click .remove-rating":"onRemoveRating"}}},{key:"regions",value:function(){return{ratings:{el:".ratings-region",replaceElement:!0}}}},{key:"template",get:function(){return _.a}},{key:"behaviors",get:function(){return[{behaviorClass:o.a,selector:".remove-rating",title:O.a.getPhrase(this.lang,"removeTooltip")}]}},{key:"appLinks",get:function(){return{".suggest-rating":{application:T.b.LIBRARY_EDITOR,action:T.a.LibraryEditor.SUGGEST_AN_EDIT,args:[this.options.videoId],params:{metadata:S.MetadataType.Rating}}}}},{key:"defaults",get:function(){return{editable:!0}}},{key:"initialize",value:function(){this.setViewCollection(),this.setCurrentRating(this.model),this.bindListeners()}},{key:"bindListeners",value:function(){this.listenTo(this.channelName,"select:rating",this.onRatingSelected)}},{key:"setCurrentRating",value:function(e){N.l.setRating(e,this.viewCollection)}},{key:"onRatingSelected",value:function(e){this.setCurrentRating(e);var t=N.c.getSelected(this.viewCollection);this.updateRating(t)}},{key:"onRemoveRating",value:function(e){e.preventDefault(),this.$(".remove-rating").tooltip("dispose"),this.setCurrentRating(null);var t=this.collection.findWhere({value:0});return this.updateRating(t),!1}},{key:"updateRating",value:function(e){i.Radio.channel(this.options.parentChannelName).trigger("select:rating",e),this.render()}},{key:"setViewCollection",value:function(){var e=r.filter(this.collection.toJSON(),(function(e){return 0!==e.value}));return this.viewCollection=new u.a(e)}},{key:"viewOptions",value:function(){var e=N.c.getSelected(this.viewCollection);return{styles:r.extend(I.a,f.a),showRemove:!this.options.hideRemove&&e&&this.options.editable,editable:this.options.editable,hideHeaderText:this.options.hideHeaderText}}},{key:"renderRatingCollectionComponent",value:function(){this.showChildView("ratings",new w({collection:this.viewCollection,channelName:this.channelName,editable:this.options.editable}))}},{key:"onRender",value:function(){this.renderRatingCollectionComponent()}}])&&D(t.prototype,n),a&&D(t,a),c}(a.a.Component)},1250:function(e,t,n){var r=n(10);e.exports=(r.default||r).template({compiler:[8,">= 4.3.0"],main:function(e,t,n,r,i){var a;e.propertyIsEnumerable;return"\r\n"+e.escapeExpression("function"==typeof(a=null!=(a=n.code||(null!=t?t.code:t))?a:e.hooks.helperMissing)?a.call(null!=t?t:e.nullContext||{},{name:"code",hash:{},data:i}):a)},useData:!0})},1251:function(e,t,n){var r=n(10);e.exports=(r.default||r).template({1:function(e,t,n,r,i){e.propertyIsEnumerable;var a,o=null!=t?t:e.nullContext||{};return' <label class="'+(null!=(a=n.unless.call(o,null!=(a=null!=t?t.options:t)?a.editable:a,{name:"unless",hash:{},fn:e.program(2,i,0),inverse:e.noop,data:i}))?a:"")+'">'+e.escapeExpression((n.lang||t&&t.lang||e.hooks.helperMissing).call(o,"rating",{name:"lang",hash:{},data:i}))+"</label>\r\n "+(null!=(a=n.unless.call(o,null!=(a=null!=t?t.options:t)?a.editable:a,{name:"unless",hash:{},fn:e.program(4,i,0),inverse:e.noop,data:i}))?a:"")+"\r\n"},2:function(e,t,n,r,i){return"d-inline-block"},4:function(e,t,n,r,i){e.propertyIsEnumerable;var a,o=e.escapeExpression;return'<span class="'+o(e.lambda(null!=(a=null!=(a=null!=t?t.options:t)?a.styles:a)?a.suggestEdit:a,t))+'">- <a class="suggest-rating">'+o((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"suggestEdit",{name:"lang",hash:{},data:i}))+"</a></span><br>"},6:function(e,t,n,r,i){e.propertyIsEnumerable;var a,o=e.escapeExpression;return'<span class="text-muted mx-2 remove-rating '+o(e.lambda(null!=(a=null!=(a=null!=t?t.options:t)?a.styles:a)?a.removeRating:a,t))+'">'+o((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"remove",{name:"lang",hash:{},data:i}))+"</span>"},compiler:[8,">= 4.3.0"],main:function(e,t,n,r,i){e.propertyIsEnumerable;var a,o=e.lambda,u=e.escapeExpression,s=null!=t?t:e.nullContext||{};return'<div class="edit-rating form-group '+u(o(null!=(a=null!=(a=null!=t?t.options:t)?a.styles:a)?a.selectRating:a,t))+" "+u(o(null!=(a=null!=(a=null!=t?t.options:t)?a.styles:a)?a.rating:a,t))+'">\r\n'+(null!=(a=n.unless.call(s,null!=(a=null!=t?t.options:t)?a.hideHeaderText:a,{name:"unless",hash:{},fn:e.program(1,i,0),inverse:e.noop,data:i}))?a:"")+' <div>\r\n <div class="ratings-region" name="rating"></div>\r\n '+(null!=(a=n.if.call(s,null!=(a=null!=t?t.options:t)?a.showRemove:a,{name:"if",hash:{},fn:e.program(6,i,0),inverse:e.noop,data:i}))?a:"")+'\r\n <div class="form-feedback"></div>\r\n </div>\r\n</div>'},useData:!0})}}]);
1
+ (window.webpackJsonp_clickview_library_editor=window.webpackJsonp_clickview_library_editor||[]).push([[9],{1033:function(e,t,n){"use strict";var r=n(1038),i=n(1034),a=(n(1035),n(3),n(1039)),o=(n(1041),n(1037));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 a.a})),n.d(t,"h",(function(){return o.a}))},1034: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 h})),n.d(t,"e",(function(){return m})),n.d(t,"j",(function(){return b})),n.d(t,"i",(function(){return v})),n.d(t,"c",(function(){return E})),n.d(t,"b",(function(){return R})),n.d(t,"d",(function(){return x})),n.d(t,"f",(function(){return P})),n.d(t,"h",(function(){return y}));var r=n(2),i=n(1),a=n(18),o=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 a=t[r];return n||a?i.isObject(n)&&i.isObject(a)&&!i.isUndefined(n.id)&&n.id===a.id?e:i.isArray(n)?f(n,a).length?e.concat(r):e:i.isEqual(n,a)?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 a=i.isUndefined(r)?t:l(r,t);a&&(t.id<0&&!t.value||(!r||t.id<0?n.push(t):(a.id=t.id,n.push(a))))}})),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":return;default:r.a.ErrorHelper.throw(new a.a("There are no formatting settings for ".concat(e)))}},updateModelState:function(e,t,n){var a=["distributors","producers","directors","productionCompanies"];for(var o in i.each(i.keys(n),(function(e){a.includes(e)&&(n[e]=t.get(e).toJSON())})),t.set(i.clone(n),{silent:!0}),e.set(t.toJSON(),{silent:!0}),n){if(!n[o]&&e.associations[o]){var u=e.get(o);(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(a){if(i.contains(n,a)){var o=e.get(a).map((function(e){return e.id})),u=t.get(a).map((function(e){return e.id})),s=i.filter(o,(function(e){return e&&!i.contains(u,e)}));s.length&&(r[a]=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")}},g=o().year(),m={productionYear:function(e){return e||0===e?(e=+e,isNaN(e)?"Production year must be a number.":e<1900||e>g?u.a.getPhrase(s,"validProductionYears",{currentYear:g}):void 0):""}},h={name:[{required:!0,msg:function(){return u.a.getPhrase(s,"resourceNameRequired")}}]},b={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")}}]},E={name:[{maxLength:128,msg:function(){return u.a.getPhrase(s,"fieldNameExceeds")}}],value:[{maxLength:16e3,msg:function(){return u.a.getPhrase(s,"fieldValueExceeds")}}]},R={fields:function(e){return e&&e.length?e.all((function(e){return!1!==e.isValid()}))?"":u.a.getPhrase(s,"fieldsInvalid"):""}};function x(){return[{id:-1,name:"Admin Notes",value:"",placeholder:"Notes that only admins will see"}]}},1035:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(1),i=n(48),a=n(166),o=n(3),u="libraryEditor.utils",s={name:[{required:!0,msg:function(){return o.a.getPhrase(u,"folderNameRequired")}},{maxLength:255,msg:function(){return o.a.getPhrase(u,"folderNameExceeds")}}]},c=function(e,t){return{parentId:function(n){return n?i.a.calculateDestinationFolderDepth(e,n,t)>a.a.MAX_FOLDER_DEPTH?o.a.getPhrase(u,"maxFolderDepth",{maxDepth:a.a.MAX_FOLDER_DEPTH}):"":o.a.getPhrase(u,"selectParentFolder")}}},l=function(e){var t=e.validateName,n=e.validateParent,i=e.folder,a=e.collection;return t&&n?r.extend({},s,c(i,a)):t?s:n?c(i,a):void 0}},1037:function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var r=n(17),i=n(3),a=n(196),o=n(1053),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 o.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 a.MetadataType.VideoTitle:t+="VideoTitle";break;case a.MetadataType.Description:t+="Description";break;case a.MetadataType.Rating:t+="Rating";break;case a.MetadataType.SeriesTitle:t+="SeriesTitle";break;case a.MetadataType.Season:t+="SeasonNumber";break;case a.MetadataType.EpisodeNumber:t+="EpisodeNumber";break;case a.MetadataType.BroadcastDate:t+="BroadcastDate";break;case a.MetadataType.Channel:t+="Channel";break;case a.MetadataType.ProductionYear:t+="ProductionYear";break;case a.MetadataType.Distributors:t+="Distributors";break;case a.MetadataType.ProductionCompanies:t+="ProductionCompanies";break;case a.MetadataType.Directors:t+="Directors";break;case a.MetadataType.Producers:t+="Producers";break;case a.MetadataType.Other:t+="Other"}return i.a.getPhrase(l,t)}}},1038:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(1),i=n(13),a=n(3),o="libraryEditor.utils",u={isValidChapterTime:function(e,t,n,a){if(a){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(a.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 a.a.getPhrase(o,"chapterNameInvalid")},Exists:function(){return a.a.getPhrase(o,"chapterNameExists")},MaxLength:function(){return a.a.getPhrase(o,"chapterNameExceeds")}},StartTime:{Invalid:function(){return a.a.getPhrase(o,"chapterStartTimeInvalid")},Exists:function(){return a.a.getPhrase(o,"chapterStartTimeExists")},Exceeds:function(){return a.a.getPhrase(o,"chapterStartTimeExceeds")}}}},1039:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(3),i="libraryEditor.utils",a={name:[{required:!0,msg:function(){return r.a.getPhrase(i,"libraryNameRequired")}},{maxLength:255,msg:function(){return r.a.getPhrase(i,"libraryNameExceeds")}}]}},1041:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3),i=n(1034),a=r.a.encloseNamespace("libraryEditor.utils"),o={name:[{required:!0,msg:function(){return a("videoTitleRequired")}}],folderId:[{required:!0,msg:function(){return a("uploadFolderRequired")}}],libraryId:[{required:!0,msg:function(){return a("uploadLibraryRequired")}}],episodeNumber:function(e,t,n){return e&&e<1?a("episodeNumberLessThanOne"):e&&e>255?a("episodeNumberExceeds"):e&&e%1!=0?a("episodeNumberNotWhole"):n.season&&n.season.get("number")>=0&&null===e?a("episodeNumberNoSeason"):""},season:function(e,t,n){return n.season&&n.season.get("number")||e&&e.number||!n.episodeNumber?"":a("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)}}},1053: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){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){return(a=Object.setPrototypeOf||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,r=s(e);if(t){var i=s(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return u(this,n)}}function u(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"a",(function(){return c}));var c=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(n,e);var t=o(n);function n(){return i(this,n),t.apply(this,arguments)}return n}(n(2).a.Collection)},1093:function(e,t,n){e.exports={requiredStar:"_3S5iJ",disabled:"_3iZQ5",formGroup:"B4xS9",suggestEdit:"_3n3sM",programTitle:"_3bWJB",description:"_3qayV",seriesTitle:"_3ojjo",broadcastDate:"_2hA-0",channel:"_1SMGG",rating:"_3AkUv",productionYear:"_1DYCl",distributors:"_2CbiR",productionCompanies:"_3hB5o",directors:"ksEaA",producers:"h7P2B",episodeNumber:"_3fMUg",seasonNumber:"GwqaB",icon:"quxL2",infoSvgContainer:"_18UDY"}},1190:function(e,t,n){e.exports={selectRating:"_1I6jj",removeRating:"_1ze5G",disabled:"_2hO8J",disabledSelected:"mnQ5O"}},1193:function(e,t,n){"use strict";var r=n(1),i=n(6),a=n(2),o=n(142),u=n(486),s=n(1247),c=n.n(s),l=n(1190),f=n.n(l);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 p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function g(e,t){return(g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=b(e);if(t){var i=b(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return h(this,n)}}function h(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf: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}}),t&&g(e,t)}(u,e);var t,n,r,a=m(u);function u(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),a.call(this,e)}return t=u,(n=[{key:"name",get:function(){return"SelectRatingItemComponent"}},{key:"template",get:function(){return c.a}},{key:"tagName",get:function(){return"li"}},{key:"attributes",get:function(){return{title:this.options.editable?this.model.get("name"):""}}},{key:"className",get:function(){var e="";return e+="btn ".concat(this.options.editable?"btn-light":"".concat(f.a.disabled)),this.model.get("selected")&&(e+=this.options.editable?" active":" ".concat(f.a.disabledSelected)),e}},{key:"events",value:function(){return{click:"onClick"}}},{key:"behaviors",get:function(){var e=this.options.editable?this.options.model.get("name"):"";return[{behaviorClass:o.a,title:e}]}},{key:"onClick",value:function(){this.options.editable&&i.Radio.channel(this.options.channelName).trigger("select:rating",this.model)}},{key:"onRender",value:function(){this.resetClassName()}}])&&p(t.prototype,n),r&&p(t,r),u}(a.a.Component);function v(e){return(v="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 P(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 E(e,t){return(E=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function R(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=k(e);if(t){var i=k(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return x(this,n)}}function x(e,t){return!t||"object"!==v(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function k(e){return(k=Object.setPrototypeOf?Object.getPrototypeOf: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}}),t&&E(e,t)}(a,e);var t,n,r,i=R(a);function a(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.call(this,e)}return t=a,(n=[{key:"name",get:function(){return"SelectRatingCollectionComponent"}},{key:"tagName",get:function(){return"ul"}},{key:"className",get:function(){return"rating-group btn-group p-0 m-0"}},{key:"childView",get:function(){return y}},{key:"childViewOptions",get:function(){return{channelName:this.options.channelName,currentRatingId:this.options.currentRatingId,editable:this.options.editable}}}])&&P(t.prototype,n),r&&P(t,r),a}(a.a.ComponentCollection),N=n(13),O=n(3),T=n(0),S=n(196),C=n(1248),_=n.n(C),j=n(1093),I=n.n(j);function M(e){return(M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function D(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function q(e,t){return(q=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function L(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=B(e);if(t){var i=B(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return F(this,n)}}function F(e,t){return!t||"object"!==M(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function B(e){return(B=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"a",(function(){return A}));var A=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}}),t&&q(e,t)}(c,e);var t,n,a,s=L(c);function c(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),s.call(this,e)}return t=c,(n=[{key:"name",get:function(){return"SelectRatingComponent"}},{key:"channelName",get:function(){return"".concat(this.name).concat(this.cid)}},{key:"lang",get:function(){return"shared.selectRating"}},{key:"events",value:function(){return{"click .remove-rating":"onRemoveRating"}}},{key:"regions",value:function(){return{ratings:{el:".ratings-region",replaceElement:!0}}}},{key:"template",get:function(){return _.a}},{key:"behaviors",get:function(){return[{behaviorClass:o.a,selector:".remove-rating",title:O.a.getPhrase(this.lang,"removeTooltip")}]}},{key:"appLinks",get:function(){return{".suggest-rating":{application:T.b.LIBRARY_EDITOR,action:T.a.LibraryEditor.SUGGEST_AN_EDIT,args:[this.options.videoId],params:{metadata:S.MetadataType.Rating}}}}},{key:"defaults",get:function(){return{editable:!0}}},{key:"initialize",value:function(){this.setViewCollection(),this.setCurrentRating(this.model),this.bindListeners()}},{key:"bindListeners",value:function(){this.listenTo(this.channelName,"select:rating",this.onRatingSelected)}},{key:"setCurrentRating",value:function(e){N.l.setRating(e,this.viewCollection)}},{key:"onRatingSelected",value:function(e){this.setCurrentRating(e);var t=N.c.getSelected(this.viewCollection);this.updateRating(t)}},{key:"onRemoveRating",value:function(e){e.preventDefault(),this.$(".remove-rating").tooltip("dispose"),this.setCurrentRating(null);var t=this.collection.findWhere({value:0});return this.updateRating(t),!1}},{key:"updateRating",value:function(e){i.Radio.channel(this.options.parentChannelName).trigger("select:rating",e),this.render()}},{key:"setViewCollection",value:function(){var e=r.filter(this.collection.toJSON(),(function(e){return 0!==e.value}));return this.viewCollection=new u.a(e)}},{key:"viewOptions",value:function(){var e=N.c.getSelected(this.viewCollection);return{styles:r.extend(I.a,f.a),showRemove:!this.options.hideRemove&&e&&this.options.editable,editable:this.options.editable,hideHeaderText:this.options.hideHeaderText}}},{key:"renderRatingCollectionComponent",value:function(){this.showChildView("ratings",new w({collection:this.viewCollection,channelName:this.channelName,editable:this.options.editable}))}},{key:"onRender",value:function(){this.renderRatingCollectionComponent()}}])&&D(t.prototype,n),a&&D(t,a),c}(a.a.Component)},1247:function(e,t,n){var r=n(10);e.exports=(r.default||r).template({compiler:[8,">= 4.3.0"],main:function(e,t,n,r,i){var a;e.propertyIsEnumerable;return"\r\n"+e.escapeExpression("function"==typeof(a=null!=(a=n.code||(null!=t?t.code:t))?a:e.hooks.helperMissing)?a.call(null!=t?t:e.nullContext||{},{name:"code",hash:{},data:i}):a)},useData:!0})},1248:function(e,t,n){var r=n(10);e.exports=(r.default||r).template({1:function(e,t,n,r,i){e.propertyIsEnumerable;var a,o=null!=t?t:e.nullContext||{};return' <label class="'+(null!=(a=n.unless.call(o,null!=(a=null!=t?t.options:t)?a.editable:a,{name:"unless",hash:{},fn:e.program(2,i,0),inverse:e.noop,data:i}))?a:"")+'">'+e.escapeExpression((n.lang||t&&t.lang||e.hooks.helperMissing).call(o,"rating",{name:"lang",hash:{},data:i}))+"</label>\r\n "+(null!=(a=n.unless.call(o,null!=(a=null!=t?t.options:t)?a.editable:a,{name:"unless",hash:{},fn:e.program(4,i,0),inverse:e.noop,data:i}))?a:"")+"\r\n"},2:function(e,t,n,r,i){return"d-inline-block"},4:function(e,t,n,r,i){e.propertyIsEnumerable;var a,o=e.escapeExpression;return'<span class="'+o(e.lambda(null!=(a=null!=(a=null!=t?t.options:t)?a.styles:a)?a.suggestEdit:a,t))+'">- <a class="suggest-rating">'+o((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"suggestEdit",{name:"lang",hash:{},data:i}))+"</a></span><br>"},6:function(e,t,n,r,i){e.propertyIsEnumerable;var a,o=e.escapeExpression;return'<span class="text-muted mx-2 remove-rating '+o(e.lambda(null!=(a=null!=(a=null!=t?t.options:t)?a.styles:a)?a.removeRating:a,t))+'">'+o((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"remove",{name:"lang",hash:{},data:i}))+"</span>"},compiler:[8,">= 4.3.0"],main:function(e,t,n,r,i){e.propertyIsEnumerable;var a,o=e.lambda,u=e.escapeExpression,s=null!=t?t:e.nullContext||{};return'<div class="edit-rating form-group '+u(o(null!=(a=null!=(a=null!=t?t.options:t)?a.styles:a)?a.selectRating:a,t))+" "+u(o(null!=(a=null!=(a=null!=t?t.options:t)?a.styles:a)?a.rating:a,t))+'">\r\n'+(null!=(a=n.unless.call(s,null!=(a=null!=t?t.options:t)?a.hideHeaderText:a,{name:"unless",hash:{},fn:e.program(1,i,0),inverse:e.noop,data:i}))?a:"")+' <div>\r\n <div class="ratings-region" name="rating"></div>\r\n '+(null!=(a=n.if.call(s,null!=(a=null!=t?t.options:t)?a.showRemove:a,{name:"if",hash:{},fn:e.program(6,i,0),inverse:e.noop,data:i}))?a:"")+'\r\n <div class="form-feedback"></div>\r\n </div>\r\n</div>'},useData:!0})}}]);