@clickview/lite 0.65.0-rc.2 → 0.65.0-rc.4

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 (31) hide show
  1. package/dist/bundles.json +1 -1
  2. package/dist/scripts/{121-b5db11dd8a-lite.chunk.js → 121-2bdbacb1be-lite.chunk.js} +2 -2
  3. package/dist/scripts/121-2bdbacb1be-lite.chunk.js.map +1 -0
  4. package/dist/scripts/{3836-27a1870c7c-lite.chunk.js → 3836-7fe81289f4-lite.chunk.js} +2 -2
  5. package/dist/scripts/3836-7fe81289f4-lite.chunk.js.map +1 -0
  6. package/dist/scripts/3991-90b0f88c18-lite.chunk.js +2 -0
  7. package/dist/scripts/3991-90b0f88c18-lite.chunk.js.map +1 -0
  8. package/dist/scripts/5896-a44ced2fcc-lite.chunk.js +3 -0
  9. package/dist/scripts/5896-a44ced2fcc-lite.chunk.js.map +1 -0
  10. package/dist/scripts/6181-09ef43a648-lite.chunk.js +3 -0
  11. package/dist/scripts/6181-09ef43a648-lite.chunk.js.map +1 -0
  12. package/dist/scripts/{9940-1704275672-lite.chunk.js → 9940-5b88a977db-lite.chunk.js} +3 -3
  13. package/dist/scripts/9940-5b88a977db-lite.chunk.js.map +1 -0
  14. package/dist/scripts/bundle-1ca74b3a19.min.js +3 -0
  15. package/dist/scripts/bundle-1ca74b3a19.min.js.map +1 -0
  16. package/package.json +1 -1
  17. package/dist/scripts/121-b5db11dd8a-lite.chunk.js.map +0 -1
  18. package/dist/scripts/3836-27a1870c7c-lite.chunk.js.map +0 -1
  19. package/dist/scripts/3991-c68f020ff6-lite.chunk.js +0 -2
  20. package/dist/scripts/3991-c68f020ff6-lite.chunk.js.map +0 -1
  21. package/dist/scripts/5896-5a8f1d27ec-lite.chunk.js +0 -3
  22. package/dist/scripts/5896-5a8f1d27ec-lite.chunk.js.map +0 -1
  23. package/dist/scripts/6181-dd58338ca5-lite.chunk.js +0 -3
  24. package/dist/scripts/6181-dd58338ca5-lite.chunk.js.map +0 -1
  25. package/dist/scripts/9940-1704275672-lite.chunk.js.map +0 -1
  26. package/dist/scripts/bundle-7b9e0a0911.min.js +0 -3
  27. package/dist/scripts/bundle-7b9e0a0911.min.js.map +0 -1
  28. /package/dist/scripts/{5896-5a8f1d27ec-lite.chunk.js.LICENSE.txt → 5896-a44ced2fcc-lite.chunk.js.LICENSE.txt} +0 -0
  29. /package/dist/scripts/{6181-dd58338ca5-lite.chunk.js.LICENSE.txt → 6181-09ef43a648-lite.chunk.js.LICENSE.txt} +0 -0
  30. /package/dist/scripts/{9940-1704275672-lite.chunk.js.LICENSE.txt → 9940-5b88a977db-lite.chunk.js.LICENSE.txt} +0 -0
  31. /package/dist/scripts/{bundle-7b9e0a0911.min.js.LICENSE.txt → bundle-1ca74b3a19.min.js.LICENSE.txt} +0 -0
package/dist/bundles.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "appBundle": "bundle-7b9e0a0911.min.js",
2
+ "appBundle": "bundle-1ca74b3a19.min.js",
3
3
  "cssBundle": "lite-app-0fdd5b0631.css",
4
4
  "polyfillBundle": "polyfills-644ebb0602.min.js"
5
5
  }
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunk_clickview_lite=self.webpackChunk_clickview_lite||[]).push([[121],{86877:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(23481);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},r(e)}function i(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,u(o.key),o)}}function u(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}function a(e){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},a(e)}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}var s=function(e){function t(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=a(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,c()?Reflect.construct(t,n||[],a(e).constructor):t.apply(e,n))}(this,t,[e])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l(e,t)}(t,e),n=t,(u=[{key:"name",get:function(){return"FileTypeError"}},{key:"lang",get:function(){return"upload.fileType"}},{key:"dialogOptions",get:function(){return{title:o.T.getPhrase(this.lang,"heading"),text:o.T.getPhrase(this.lang,"body"),buttons:[{text:o.T.getPhrase(this.lang,"okay"),className:"btn btn-dark",success:!0},{text:o.T.getPhrase(this.lang,"close"),className:"btn btn-link",close:!0}]}}}])&&i(n.prototype,u),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,u}(n(47663).S)},90121:(e,t,n)=>{n.r(t),n.d(t,{BaseVideoUploadService:()=>fe,LearningResourceUploadService:()=>ye,MixedMediaUploadService:()=>de,SubtitleUploadService:()=>pe,UploadType:()=>ue});var o,r=n(48088),i=n(39479),u=n(46865),c=n(79976),a=n(37433),l=n(54149),s=n(71365),f=n(23481),p=n(70794),y=n(81886),d=n(49985),h=n(65858),b=n(29555);!function(e){e[e.Permanent=0]="Permanent",e[e.Temporary=1]="Temporary"}(o||(o={}));var g=n(86877),v=n(28046),m=n(52003),w=n(60735),S=n(53301),O=n.n(S),P=n(47663);function k(e){return k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},k(e)}function j(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,T(o.key),o)}}function T(e){var t=function(e){if("object"!=k(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=k(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==k(t)?t:t+""}function U(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(U=function(){return!!e})()}function E(e){return E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},E(e)}function _(e,t){return _=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_(e,t)}var I="upload.internetConnectivityError",x=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=E(t),function(e,t){if(t&&("object"==k(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,U()?Reflect.construct(t,n||[],E(e).constructor):t.apply(e,n))}(this,t,[f.T.getPhrase(I,"title")])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_(e,t)}(t,e),n=t,(o=[{key:"name",get:function(){return"InternetConnectivityError"}},{key:"dialogOptions",get:function(){return{title:f.T.getPhrase(I,"heading"),text:f.T.getPhrase(I,"body"),buttons:[{text:f.T.getPhrase(I,"okay"),className:"btn btn-outline-dark",success:!0}]}}}])&&j(n.prototype,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,o}(P.S),R=n(44331);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},D(e)}function F(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,C(o.key),o)}}function C(e){var t=function(e){if("object"!=D(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=D(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==D(t)?t:t+""}function L(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(L=function(){return!!e})()}function A(e){return A=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},A(e)}function M(e,t){return M=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},M(e,t)}var V="upload.slowInternetError",z=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=A(t),function(e,t){if(t&&("object"==D(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,L()?Reflect.construct(t,n||[],A(e).constructor):t.apply(e,n))}(this,t,[f.T.getPhrase(V,"title")])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&M(e,t)}(t,e),n=t,(o=[{key:"name",get:function(){return"SlowInternetError"}},{key:"dialogOptions",get:function(){return{title:f.T.getPhrase(V,"heading"),text:f.T.getPhrase(V,"body"),buttons:[{text:f.T.getPhrase(V,"okay"),className:"btn btn-outline-dark",success:!0}]}}}])&&F(n.prototype,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,o}(P.S);function N(e){return N="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},N(e)}function B(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,Q(o.key),o)}}function Q(e){var t=function(e){if("object"!=N(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=N(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==N(t)?t:t+""}function q(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(q=function(){return!!e})()}function Z(e){return Z=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Z(e)}function X(e,t){return X=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},X(e,t)}var J=[],G=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(e,t,n){return t=Z(t),function(e,t){if(t&&("object"==N(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,q()?Reflect.construct(t,n||[],Z(e).constructor):t.apply(e,n))}(this,t,[e])).slowInternetTimeout={},n.showSlowInternetTimeout=!0,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&X(e,t)}(t,e),n=t,o=[{key:"name",get:function(){return"DropzoneWrapper"}},{key:"initialize",value:function(e){var t=this.options.loggingEnabled,n=r.Radio.channel(e.channelName),o=this;this.dropzone=new(O())(document.createElement("div"),{url:function(e){return e[0].cvUpload.ingestUrl},chunking:this.options.chunkingEnabled,chunkSize:this.options.chunkSize,forceChunking:!0,autoProcessQueue:!0,maxFilesize:this.options.maxFileSize,acceptedFiles:this.options.acceptedFiles,paramName:"content",timeout:18e4,init:function(){var e=this;t&&(i.each(J,(function(t){e.on(t,(function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];var r=n[0]instanceof File?n[0].name:n[0];console.info(t,r,n)}))})),this.on("uploadprogress",(function(e,t,r){var i=r/e.size*100;n.trigger("progress",o.getId(e),i,r)})),this.on("success",(function(e){var t=e.upload.chunks,o=i.last(t),r=o.xhr;r||(r=o.file.xhr);var u=JSON.parse(r.response);e.cvUpload.fileId=u.id,n.trigger(b.S.UPLOAD_SUCCESS,e,u)})),this.on("error",(function(e,t,n){n&&0===n.status?y.Q.Ry.throw(new x):"canceled"!==e.status&&y.Q.Ry.throw(new R.n(f.T.getPhrase("upload.services","uploadError",{fileName:e.name,message:t.message})))})),this.on("sending",(function(e){window.clearTimeout(o.slowInternetTimeout[e.path]),o.showSlowInternetTimeout&&(o.slowInternetTimeout[e.path]=window.setTimeout((function(){o.showSlowInternetTimeout&&y.Q.Ry.throw(new z),o.showSlowInternetTimeout=!1}),3e4))})),this.on("complete",(function(e){return window.clearTimeout(o.slowInternetTimeout[e.path])})))},params:function(e,t,n){if(n)return{chunk_index:n.index,upload_length:n.file.size}},addedfile:function(){},thumbnail:function(){},uploadprogress:function(){}})}},{key:"getId",value:function(e){return e.upload.uuid}},{key:"addFile",value:function(e){this.dropzone.addFile(e)}},{key:"removeFile",value:function(e){this.dropzone.removeFile(e)}},{key:"start",value:function(){this.dropzone.processQueue()}},{key:"destroy",value:function(){this.dropzone.destroy()}}],u=[{key:"isValidFile",value:function(e,t){return O().isValidFile(e,t)}}],o&&B(n.prototype,o),u&&B(n,u),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,o,u}(y.Q.t6);function H(e){return H="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},H(e)}function W(e,t,n){return(t=ee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function K(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,ee(o.key),o)}}function Y(e,t,n){return t&&K(e.prototype,t),n&&K(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ee(e){var t=function(e){if("object"!=H(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=H(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==H(t)?t:t+""}function te(e,t,n){return t=oe(t),function(e,t){if(t&&("object"==H(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ne()?Reflect.construct(t,n||[],oe(e).constructor):t.apply(e,n))}function ne(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ne=function(){return!!e})()}function oe(e){return oe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},oe(e)}function re(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ie(e,t)}function ie(e,t){return ie=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ie(e,t)}var ue,ce=function(e){function t(){var e;return $(this,t),(e=te(this,t,[{dataProvider:s.u.getInstance(a.R.Ajax),cache:s.u.getInstance(u.p.Fifo),alertService:s.u.getInstance(c.P.ALERT)}])).incrementingUploadId=0,e}return re(t,e),Y(t,[{key:"name",get:function(){return"UploadDataService"}},{key:"channelName",get:function(){return"private:upload:data:service"}},{key:"requestUploads",value:function(e,t,n,o,r){var u=this,c=this.chain();i.each(t,(function(t){u.incrementingUploadId++,c.create({resource:e,eventPrefix:"request:upload:".concat(u.incrementingUploadId),data:u.getFileUploadRequest(t,n),callback:function(e){o(t,e)},errorHandler:u.alertService.error("Something went wrong while we were uploading your video. Please try again.")})})),c.func((function(){r()})).run()}},{key:"cancelUpload",value:function(e,t,n){this.create({resource:"/api/upload/cancel",eventPrefix:"cancel:upload",data:{uploadId:e,ingestUrl:t},callback:n})}},{key:"getFileUploadRequest",value:function(e,t){var n=e.name.split(".");return{name:n.join("."),extension:n.length>1?n.pop():"",fileSize:e.size,fileLifestyle:t}}},{key:"onDestroy",value:function(){s.u.releaseInstance(a.R.Ajax).releaseInstance(u.p.Fifo)}}])}(l.B);!function(e){e[e.Video=0]="Video",e[e.LearningResource=1]="LearningResource",e[e.Subtitle=2]="Subtitle",e[e.MixedMedia=3]="MixedMedia"}(ue||(ue={}));var ae=W(W(W(W({},ue.Video,v.l.VIDEO),ue.LearningResource,v.l.RESOURCES),ue.Subtitle,v.l.SUBTITLES),ue.MixedMedia,v.l.MIXED_MEDIA),le=W(W(W(W({},ue.Video,m.Q4.VIDEO_UPLOAD),ue.LearningResource,m.Q4.RESOURCE_UPLOAD),ue.Subtitle,m.Q4.SUBTITLE_UPLOAD),ue.MixedMedia,m.Q4.MIXED_MEDIA_UPLOAD),se=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return $(this,t),te(this,t,[Object.assign({uploadUrl:"/api/upload"},e)])}return re(t,e),Y(t,[{key:"initialize",value:function(){this.uploadDataService=new ce,this.progressViewModel=p.r.get("upload:progress:".concat(this.uploadType)),this.bindListeners()}},{key:"channelName",get:function(){return le[this.uploadType]}},{key:"lang",get:function(){return"uploadShared.services"}},{key:"initUploader",value:function(e,t){if(!this.uploader){var n=4194304;e&&n<e&&(n=e),t&&n>t&&(n=t),this.uploader=new G({chunkingEnabled:!0,loggingEnabled:!0,chunkSize:n,maxFileSize:53687091200,acceptedFiles:this.getAcceptedFiles(),channelName:this.channelName})}}},{key:"bindListeners",value:function(){this.listenTo(this.channelName,"progress",this.onProgress),this.listenTo(this.channelName,b.S.UPLOAD_SUCCESS,this.onSuccess)}},{key:"onProgress",value:function(e,t,n){var o=this.collection.get(e);o&&(o.set({progress:t>100?100:t,totalUploaded:n}),this.setOverallProgress())}},{key:"isUploading",value:function(){return!!this.getCollection().length}},{key:"getCollection",value:function(){return this.collection||(this.collection=new y.Q.FE),this.collection}},{key:"setOverallProgress",value:function(){var e=this,t=0,n=0,o=this.getCollection();if(o.length){o.each((function(e){t+=e.get("totalUploaded")||0,n+=e.get("file").size||0}));var r=t/n*100,i=r>=100,u=function(){e.progressViewModel.set({progress:i?100:r,done:i})};i?window.setTimeout(u,2e3):u()}else this.progressViewModel.set({progress:0})}},{key:"isValidFile",value:function(e){return G.isValidFile(e,this.getAcceptedFiles())}},{key:"addFiles",value:function(e,t){var n=this;i.any(e,(function(e){return!n.isValidFile(e)}))?y.Q.Ry.throw(new g.Z(f.T.getPhrase(this.lang,"invalidFileType"))):this.requestUploads(e,t)}},{key:"requestUploads",value:function(e,t){var n=this,o=this.isUploading(),i=this.getCollection();this.uploadDataService.requestUploads(this.options.uploadUrl,e,this.fileLifestyle,(function(e,t){n.initUploader(1024*t.minChunkSize,1024*t.maxChunkSize),e.cvUpload={uploadId:t.uploadId,ingestUrl:t.ingestUrl},n.uploader.addFile(e);var o=e.name;n.uploadType===ue.Video&&(o=o.replace(/\.[^/.]+$/,"")),i.add(Object.assign({id:n.uploader.getId(e),file:e,name:o},n.getAdditionalFileInfo(e,t)),{at:i.length-1})}),(function(){t&&d.k.logUserAction({uploadCount:e.length},t),r.Radio.channel(n.channelName).trigger(b.S.FILES_ADDED,e,o)}))}},{key:"addFile",value:function(e,t){this.addFiles([e],t)}},{key:"cancelUpload",value:function(e){var t=this,n=this.getCollection(),o=n.get(e);if(o){var i=o.get("file");this.uploader.removeFile(i),n.remove(o),this.uploadDataService.cancelUpload(i.cvUpload.uploadId,i.cvUpload.ingestUrl,(function(){d.k.logUserAction(o.toJSON(),{entity:h.py.Video,actionType:h.Vw.Upload,workflowPhase:h.eu.Discard,descriptor:h.yh.Single,location:h.LZ.MyUploads}),r.Radio.channel(t.channelName).trigger(b.S.UPLOAD_CANCELLED)})),this.setOverallProgress()}}},{key:"onSuccess",value:function(e,t){var n=this.uploader.getId(e),o=this.getCollection().get(n);o.set("fileInfo",t),d.k.logUserAction({id:e.cvUpload.uploadId},{entity:h.py.Video,actionType:h.Vw.Upload,workflowPhase:h.eu.Complete,descriptor:h.yh.Single,location:h.LZ.VideoUpload}),r.Radio.channel(this.channelName).trigger(b.S.UPLOAD_COMPLETE,o)}},{key:"cancelAllUploads",value:function(){var e=this,t=this.getCollection().map((function(e){return e.get("id")}));i.each(t,(function(t){return e.cancelUpload(t)}))}},{key:"getUpload",value:function(e){var t=this.uploader.getId(e);return this.getCollection().get(t)}},{key:"getAcceptedFiles",value:function(){return ae[this.uploadType]}},{key:"getAdditionalFileInfo",value:function(e,t){return{}}}])}(y.Q.t6),fe=function(e){function t(){return $(this,t),te(this,t,arguments)}return re(t,e),Y(t,[{key:"uploadType",get:function(){return ue.Video}},{key:"name",get:function(){return w.D.VideoUpload}},{key:"fileLifestyle",get:function(){return o.Temporary}}])}(se),pe=function(e){function t(){return $(this,t),te(this,t,arguments)}return re(t,e),Y(t,[{key:"uploadType",get:function(){return ue.Subtitle}},{key:"name",get:function(){return w.D.SubtitleUpload}},{key:"fileLifestyle",get:function(){return o.Permanent}}])}(se),ye=function(e){function t(){return $(this,t),te(this,t,arguments)}return re(t,e),Y(t,[{key:"uploadType",get:function(){return ue.LearningResource}},{key:"name",get:function(){return w.D.ResourceUpload}},{key:"fileLifestyle",get:function(){return o.Permanent}}])}(se),de=function(e){function t(){return $(this,t),te(this,t,arguments)}return re(t,e),Y(t,[{key:"uploadType",get:function(){return ue.MixedMedia}},{key:"name",get:function(){return w.D.MixedMediaUpload}},{key:"fileLifestyle",get:function(){return o.Temporary}}])}(se)},28046:(e,t,n)=>{n.d(t,{l:()=>y,v:()=>d});var o=n(39479),r=["pdf"],i=["doc","docx","dotx","dot","rtf","docm","odt"],u=["csv","txt"],c=["xls","xlt","xlsx"],a=["jpg","tif","png","bmp","gif","jpeg"],l="video/*",s=["zip","rar"],f=["ppt","pot","pps","pptx"],p=["srt"],y={IMAGES:".".concat(a.join(",.")),VIDEO:l,MIXED_MEDIA:".".concat(a.join(",."),",").concat(l),RESOURCES:".".concat([].concat(i,c,f,r,u,a,s).join(",.")),SUBTITLES:".".concat(p.join(",."))},d={getResourceType:function(e){var t=e.toLowerCase();return o.contains(i,t)?"document":o.contains(c,t)?"excel":o.contains(f,t)?"powerpoint":o.contains(r,t)?"pdf":o.contains(u,t)?"text":o.contains(a,t)?"image":o.contains(s,t)?"archive":o.contains(p,t)?"subtitle":""}}}}]);
2
- //# sourceMappingURL=121-b5db11dd8a-lite.chunk.js.map
1
+ "use strict";(self.webpackChunk_clickview_lite=self.webpackChunk_clickview_lite||[]).push([[121],{86877:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(23481);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},r(e)}function i(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,u(o.key),o)}}function u(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}function a(e){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},a(e)}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}var s=function(e){function t(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=a(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,c()?Reflect.construct(t,n||[],a(e).constructor):t.apply(e,n))}(this,t,[e])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l(e,t)}(t,e),n=t,(u=[{key:"name",get:function(){return"FileTypeError"}},{key:"lang",get:function(){return"upload.fileType"}},{key:"dialogOptions",get:function(){return{title:o.T.getPhrase(this.lang,"heading"),text:o.T.getPhrase(this.lang,"body"),buttons:[{text:o.T.getPhrase(this.lang,"okay"),className:"btn btn-dark",success:!0},{text:o.T.getPhrase(this.lang,"close"),className:"btn btn-link",close:!0}]}}}])&&i(n.prototype,u),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,u}(n(47663).S)},90121:(e,t,n)=>{n.r(t),n.d(t,{BaseVideoUploadService:()=>fe,LearningResourceUploadService:()=>ye,MixedMediaUploadService:()=>de,SubtitleUploadService:()=>pe,UploadType:()=>ue});var o,r=n(48088),i=n(39479),u=n(46865),c=n(79976),a=n(37433),l=n(54149),s=n(71365),f=n(23481),p=n(70794),y=n(81886),d=n(49985),h=n(65858),b=n(29555);!function(e){e[e.Permanent=0]="Permanent",e[e.Temporary=1]="Temporary"}(o||(o={}));var g=n(86877),v=n(28046),m=n(52003),w=n(60735),S=n(53301),O=n.n(S),k=n(47663);function P(e){return P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},P(e)}function j(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,T(o.key),o)}}function T(e){var t=function(e){if("object"!=P(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=P(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==P(t)?t:t+""}function U(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(U=function(){return!!e})()}function E(e){return E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},E(e)}function _(e,t){return _=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_(e,t)}var I="upload.internetConnectivityError",x=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=E(t),function(e,t){if(t&&("object"==P(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,U()?Reflect.construct(t,n||[],E(e).constructor):t.apply(e,n))}(this,t,[f.T.getPhrase(I,"title")])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_(e,t)}(t,e),n=t,(o=[{key:"name",get:function(){return"InternetConnectivityError"}},{key:"dialogOptions",get:function(){return{title:f.T.getPhrase(I,"heading"),text:f.T.getPhrase(I,"body"),buttons:[{text:f.T.getPhrase(I,"okay"),className:"btn btn-outline-dark",success:!0}]}}}])&&j(n.prototype,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,o}(k.S),R=n(44331);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},C(e)}function D(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,L(o.key),o)}}function L(e){var t=function(e){if("object"!=C(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=C(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==C(t)?t:t+""}function F(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(F=function(){return!!e})()}function A(e){return A=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},A(e)}function M(e,t){return M=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},M(e,t)}var z="upload.slowInternetError",V=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=A(t),function(e,t){if(t&&("object"==C(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,F()?Reflect.construct(t,n||[],A(e).constructor):t.apply(e,n))}(this,t,[f.T.getPhrase(z,"title")])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&M(e,t)}(t,e),n=t,(o=[{key:"name",get:function(){return"SlowInternetError"}},{key:"dialogOptions",get:function(){return{title:f.T.getPhrase(z,"heading"),text:f.T.getPhrase(z,"body"),buttons:[{text:f.T.getPhrase(z,"okay"),className:"btn btn-outline-dark",success:!0}]}}}])&&D(n.prototype,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,o}(k.S);function N(e){return N="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},N(e)}function B(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,Q(o.key),o)}}function Q(e){var t=function(e){if("object"!=N(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=N(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==N(t)?t:t+""}function q(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(q=function(){return!!e})()}function Z(e){return Z=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Z(e)}function X(e,t){return X=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},X(e,t)}var J=[],G=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(e,t,n){return t=Z(t),function(e,t){if(t&&("object"==N(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,q()?Reflect.construct(t,n||[],Z(e).constructor):t.apply(e,n))}(this,t,[e])).slowInternetTimeout={},n.showSlowInternetTimeout=!0,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&X(e,t)}(t,e),n=t,o=[{key:"name",get:function(){return"DropzoneWrapper"}},{key:"initialize",value:function(e){var t=this.options.loggingEnabled,n=r.Radio.channel(e.channelName),o=this;this.dropzone=new(O())(document.createElement("div"),{url:function(e){return e[0].cvUpload.ingestUrl},chunking:this.options.chunkingEnabled,chunkSize:this.options.chunkSize,forceChunking:!0,autoProcessQueue:!0,maxFilesize:this.options.maxFileSize,acceptedFiles:this.options.acceptedFiles,paramName:"content",timeout:18e4,init:function(){var e=this;t&&(i.each(J,(function(t){e.on(t,(function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];var r=n[0]instanceof File?n[0].name:n[0];console.info(t,r,n)}))})),this.on("uploadprogress",(function(e,t,r){var i=r/e.size*100;n.trigger("progress",o.getId(e),i,r)})),this.on("success",(function(e){var t=e.upload.chunks,o=i.last(t),r=o.xhr;r||(r=o.file.xhr);var u=JSON.parse(r.response);e.cvUpload.fileId=u.id,n.trigger(b.S.UPLOAD_SUCCESS,e,u)})),this.on("error",(function(e,t,n){n&&0===n.status?y.Q.Ry.throw(new x):"canceled"!==e.status&&y.Q.Ry.throw(new R.n(f.T.getPhrase("upload.services","uploadError",{fileName:e.name,message:t.message})))})),this.on("sending",(function(e){window.clearTimeout(o.slowInternetTimeout[e.path]),o.showSlowInternetTimeout&&(o.slowInternetTimeout[e.path]=window.setTimeout((function(){o.showSlowInternetTimeout&&y.Q.Ry.throw(new V),o.showSlowInternetTimeout=!1}),3e4))})),this.on("complete",(function(e){return window.clearTimeout(o.slowInternetTimeout[e.path])})))},params:function(e,t,n){if(n)return{chunk_index:n.index,upload_length:n.file.size}},addedfile:function(){},thumbnail:function(){},uploadprogress:function(){}})}},{key:"getId",value:function(e){return e.upload.uuid}},{key:"addFile",value:function(e){this.dropzone.addFile(e)}},{key:"removeFile",value:function(e){this.dropzone.removeFile(e)}},{key:"start",value:function(){this.dropzone.processQueue()}},{key:"destroy",value:function(){this.dropzone.destroy()}}],u=[{key:"isValidFile",value:function(e,t){return O().isValidFile(e,t)}}],o&&B(n.prototype,o),u&&B(n,u),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,o,u}(y.Q.t6);function H(e){return H="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},H(e)}function W(e,t,n){return(t=ee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function K(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,ee(o.key),o)}}function Y(e,t,n){return t&&K(e.prototype,t),n&&K(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ee(e){var t=function(e){if("object"!=H(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=H(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==H(t)?t:t+""}function te(e,t,n){return t=oe(t),function(e,t){if(t&&("object"==H(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ne()?Reflect.construct(t,n||[],oe(e).constructor):t.apply(e,n))}function ne(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ne=function(){return!!e})()}function oe(e){return oe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},oe(e)}function re(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ie(e,t)}function ie(e,t){return ie=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ie(e,t)}var ue,ce=function(e){function t(){var e;return $(this,t),(e=te(this,t,[{dataProvider:s.u.getInstance(a.R.Ajax),cache:s.u.getInstance(u.p.Fifo),alertService:s.u.getInstance(c.P.ALERT)}])).incrementingUploadId=0,e}return re(t,e),Y(t,[{key:"name",get:function(){return"UploadDataService"}},{key:"channelName",get:function(){return"private:upload:data:service"}},{key:"requestUploads",value:function(e,t,n,o,r){var u=this,c=this.chain();i.each(t,(function(t){u.incrementingUploadId++,c.create({resource:e,eventPrefix:"request:upload:".concat(u.incrementingUploadId),data:u.getFileUploadRequest(t,n),callback:function(e){o(t,e)},errorHandler:u.alertService.error("Something went wrong while we were uploading your video. Please try again.")})})),c.func((function(){r()})).run()}},{key:"cancelUpload",value:function(e,t,n){this.create({resource:"/api/upload/cancel",eventPrefix:"cancel:upload",data:{uploadId:e,ingestUrl:t},callback:n})}},{key:"getFileUploadRequest",value:function(e,t){var n=e.name.split(".");return{name:n.join("."),extension:n.length>1?n.pop():"",fileSize:e.size,fileLifestyle:t}}},{key:"onDestroy",value:function(){s.u.releaseInstance(a.R.Ajax).releaseInstance(u.p.Fifo)}}])}(l.B);!function(e){e[e.Video=0]="Video",e[e.LearningResource=1]="LearningResource",e[e.Subtitle=2]="Subtitle",e[e.MixedMedia=3]="MixedMedia"}(ue||(ue={}));var ae=W(W(W(W({},ue.Video,v.l.VIDEO),ue.LearningResource,v.l.RESOURCES),ue.Subtitle,v.l.SUBTITLES),ue.MixedMedia,v.l.MIXED_MEDIA),le=W(W(W(W({},ue.Video,m.Q4.VIDEO_UPLOAD),ue.LearningResource,m.Q4.RESOURCE_UPLOAD),ue.Subtitle,m.Q4.SUBTITLE_UPLOAD),ue.MixedMedia,m.Q4.MIXED_MEDIA_UPLOAD),se=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return $(this,t),te(this,t,[Object.assign({uploadUrl:"/api/upload"},e)])}return re(t,e),Y(t,[{key:"initialize",value:function(){this.uploadDataService=new ce,this.progressViewModel=p.r.get("upload:progress:".concat(this.uploadType)),this.bindListeners()}},{key:"channelName",get:function(){return le[this.uploadType]}},{key:"lang",get:function(){return"uploadShared.services"}},{key:"initUploader",value:function(e,t){if(!this.uploader){var n=4194304;e&&n<e&&(n=e),t&&n>t&&(n=t),this.uploader=new G({chunkingEnabled:!0,loggingEnabled:!0,chunkSize:n,maxFileSize:53687091200,acceptedFiles:this.getAcceptedFiles(),channelName:this.channelName})}}},{key:"bindListeners",value:function(){this.listenTo(this.channelName,"progress",this.onProgress),this.listenTo(this.channelName,b.S.UPLOAD_SUCCESS,this.onSuccess)}},{key:"onProgress",value:function(e,t,n){var o=this.collection.get(e);o&&(o.set({progress:t>100?100:t,totalUploaded:n}),this.setOverallProgress())}},{key:"isUploading",value:function(){return!!this.getCollection().length}},{key:"getCollection",value:function(){return this.collection||(this.collection=new y.Q.FE),this.collection}},{key:"setOverallProgress",value:function(){var e=this,t=0,n=0,o=this.getCollection();if(o.length){o.each((function(e){t+=e.get("totalUploaded")||0,n+=e.get("file").size||0}));var r=t/n*100,i=r>=100,u=function(){e.progressViewModel.set({progress:i?100:r,done:i})};i?window.setTimeout(u,2e3):u()}else this.progressViewModel.set({progress:0})}},{key:"isValidFile",value:function(e){return G.isValidFile(e,this.getAcceptedFiles())}},{key:"addFiles",value:function(e,t){var n=this;i.any(e,(function(e){return!n.isValidFile(e)}))?y.Q.Ry.throw(new g.Z(f.T.getPhrase(this.lang,"invalidFileType"))):this.requestUploads(e,t)}},{key:"requestUploads",value:function(e,t){var n=this,o=this.isUploading(),i=this.getCollection();this.uploadDataService.requestUploads(this.options.uploadUrl,e,this.fileLifestyle,(function(e,t){"minChunkSize"in t||"maxChunkSize"in t?n.initUploader(1024*t.minChunkSize,1024*t.maxChunkSize):n.initUploader(t.minChunkLength,t.maxChunkLength),e.cvUpload={uploadId:t.uploadId,ingestUrl:t.ingestUrl},n.uploader.addFile(e);var o=e.name;n.uploadType===ue.Video&&(o=o.replace(/\.[^/.]+$/,"")),i.add(Object.assign({id:n.uploader.getId(e),file:e,name:o},n.getAdditionalFileInfo(e,t)),{at:i.length-1})}),(function(){t&&d.k.logUserAction({uploadCount:e.length},t),r.Radio.channel(n.channelName).trigger(b.S.FILES_ADDED,e,o)}))}},{key:"addFile",value:function(e,t){this.addFiles([e],t)}},{key:"cancelUpload",value:function(e){var t=this,n=this.getCollection(),o=n.get(e);if(o){var i=o.get("file");this.uploader.removeFile(i),n.remove(o),this.uploadDataService.cancelUpload(i.cvUpload.uploadId,i.cvUpload.ingestUrl,(function(){d.k.logUserAction(o.toJSON(),{entity:h.py.Video,actionType:h.Vw.Upload,workflowPhase:h.eu.Discard,descriptor:h.yh.Single,location:h.LZ.MyUploads}),r.Radio.channel(t.channelName).trigger(b.S.UPLOAD_CANCELLED)})),this.setOverallProgress()}}},{key:"onSuccess",value:function(e,t){var n=this.uploader.getId(e),o=this.getCollection().get(n);o.set("fileInfo",t),d.k.logUserAction({id:e.cvUpload.uploadId},{entity:h.py.Video,actionType:h.Vw.Upload,workflowPhase:h.eu.Complete,descriptor:h.yh.Single,location:h.LZ.VideoUpload}),r.Radio.channel(this.channelName).trigger(b.S.UPLOAD_COMPLETE,o)}},{key:"cancelAllUploads",value:function(){var e=this,t=this.getCollection().map((function(e){return e.get("id")}));i.each(t,(function(t){return e.cancelUpload(t)}))}},{key:"getUpload",value:function(e){var t=this.uploader.getId(e);return this.getCollection().get(t)}},{key:"getAcceptedFiles",value:function(){return ae[this.uploadType]}},{key:"getAdditionalFileInfo",value:function(e,t){return{}}}])}(y.Q.t6),fe=function(e){function t(){return $(this,t),te(this,t,arguments)}return re(t,e),Y(t,[{key:"uploadType",get:function(){return ue.Video}},{key:"name",get:function(){return w.D.VideoUpload}},{key:"fileLifestyle",get:function(){return o.Temporary}}])}(se),pe=function(e){function t(){return $(this,t),te(this,t,arguments)}return re(t,e),Y(t,[{key:"uploadType",get:function(){return ue.Subtitle}},{key:"name",get:function(){return w.D.SubtitleUpload}},{key:"fileLifestyle",get:function(){return o.Permanent}}])}(se),ye=function(e){function t(){return $(this,t),te(this,t,arguments)}return re(t,e),Y(t,[{key:"uploadType",get:function(){return ue.LearningResource}},{key:"name",get:function(){return w.D.ResourceUpload}},{key:"fileLifestyle",get:function(){return o.Permanent}}])}(se),de=function(e){function t(){return $(this,t),te(this,t,arguments)}return re(t,e),Y(t,[{key:"uploadType",get:function(){return ue.MixedMedia}},{key:"name",get:function(){return w.D.MixedMediaUpload}},{key:"fileLifestyle",get:function(){return o.Temporary}}])}(se)},28046:(e,t,n)=>{n.d(t,{l:()=>y,v:()=>d});var o=n(39479),r=["pdf"],i=["doc","docx","dotx","dot","rtf","docm","odt"],u=["csv","txt"],c=["xls","xlt","xlsx"],a=["jpg","tif","png","bmp","gif","jpeg"],l="video/*",s=["zip","rar"],f=["ppt","pot","pps","pptx"],p=["srt"],y={IMAGES:".".concat(a.join(",.")),VIDEO:l,MIXED_MEDIA:".".concat(a.join(",."),",").concat(l),RESOURCES:".".concat([].concat(i,c,f,r,u,a,s).join(",.")),SUBTITLES:".".concat(p.join(",."))},d={getResourceType:function(e){var t=e.toLowerCase();return o.contains(i,t)?"document":o.contains(c,t)?"excel":o.contains(f,t)?"powerpoint":o.contains(r,t)?"pdf":o.contains(u,t)?"text":o.contains(a,t)?"image":o.contains(s,t)?"archive":o.contains(p,t)?"subtitle":""}}}}]);
2
+ //# sourceMappingURL=121-2bdbacb1be-lite.chunk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scripts/121-2bdbacb1be-lite.chunk.js","mappings":"usCAYO,IAAMA,EAAc,YACzB,WAAYC,GAAe,O,4FAAA,S,qYAAA,SACnBA,GACR,CAEA,O,qRAAA,M,EAAA,G,EAAA,iBACA,WACE,MAAO,eACT,GAEA,gBACA,WACE,MAAO,iBACT,GAEA,yBACA,WACE,MAAO,CACLC,MAAO,cAA0BC,KAAKC,KAAM,WAC5CC,KAAM,cAA0BF,KAAKC,KAAM,QAC3CE,QAAS,CAAC,CACRD,KAAM,cAA0BF,KAAKC,KAAM,QAC3CG,UAAW,eACXC,SAAS,GACR,CACDH,KAAM,cAA0BF,KAAKC,KAAM,SAC3CG,UAAW,eACXE,OAAO,IAGb,M,6EAAC,CA9BwB,C,SAAQ,E,uLCZvBC,E,gJAAZ,SAAYA,GACV,6BACA,4BACD,CAHD,CAAYA,IAAAA,EAAa,K,ooCCKzB,IAAMN,EAAO,mCAEAO,EAA0B,YACrC,oB,4FAAA,S,qYAAA,SACQC,EAAA,YAA0BR,EAAM,UACxC,CAEA,O,qRAAA,M,EAAA,G,EAAA,iBACA,WACE,MAAO,2BACT,GAEA,yBACA,WACE,MAAO,CACLF,MAAOU,EAAA,YAA0BR,EAAM,WACvCC,KAAMO,EAAA,YAA0BR,EAAM,QACtCE,QAAS,CAAC,CACRD,KAAMO,EAAA,YAA0BR,EAAM,QACtCG,UAAW,uBACXC,SAAS,IAGf,M,6EAAC,CArBoC,CAAQK,EAAA,G,gkCCF/C,IAAM,EAAO,2BA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ACA,WACE,OAAOzK,EAAc4K,SACvB,IAAC,CAdwC,CAAQvD,IAiBtCyD,GAAwB,yGAEnC,WACE,OAAOjG,GAAWsC,UACpB,GAEA,gBACA,WACE,OAAOsD,EAAA,kBACT,GAEA,yBACA,WACE,OAAOzK,EAAc0K,SACvB,IAAC,CAdkC,CAAQrD,G,0DCnfvC0D,EAAgB,CAAC,OACjBC,EAAgB,CAAE,MAAO,OAAQ,OAAQ,MAAO,MAAO,OAAQ,OAC/DC,EAAiB,CAAE,MAAO,OAC1BC,EAAkB,CAAE,MAAO,MAAO,QAClCC,EAAkB,CAAE,MAAO,MAAO,MAAO,MAAO,MAAO,QACvDC,EAAgB,UAChBC,EAAoB,CAAE,MAAO,OAC7BC,EAAuB,CAAE,MAAO,MAAO,MAAO,QAE9CC,EAAqB,CAAC,OAEtBC,EAAiB,CACrBC,OAAQ,IAAF,OAAMN,EAAgB5E,KAAK,OACjCmF,MAAON,EACPO,YAAa,IAAF,OAAMR,EAAgB5E,KAAK,MAAK,YAAI6E,GAC/CQ,UAAW,IAAF,OAAM,UACVZ,EACAE,EACAI,EACAP,EACAE,EACAE,EACAE,GACH9E,KAAK,OACPsF,UAAW,IAAF,OAAMN,EAAmBhF,KAAK,QAGnCuF,EAAsB,CAC1BC,gBAAe,SAACvF,GACd,IAAMwF,EAAMxF,EAAUyF,cAEtB,OAAI,WAAWjB,EAAegB,GAAa,WACvC,WAAWd,EAAiBc,GAAa,QACzC,WAAWV,EAAsBU,GAAa,aAC9C,WAAWjB,EAAeiB,GAAa,MAEvC,WAAWf,EAAgBe,GAAa,OACxC,WAAWb,EAAiBa,GAAa,QACzC,WAAWX,EAAmBW,GAAa,UAC3C,WAAWT,EAAoBS,GAAa,WAEzC,EACT,E","sources":["file:///app/packages/libs/shared/src/apps/upload/errors/file-type/FileTypeError.ts","file:///app/packages/libs/shared/src/apps/upload/enums/FileLifestyle.ts","file:///app/packages/libs/shared/src/apps/upload/errors/internet-connectivity/InternetConnectivityError.ts","file:///app/packages/libs/shared/src/apps/upload/errors/slow-internet/SlowInternetError.ts","file:///app/packages/libs/shared/src/apps/upload/services/DropzoneWrapper.ts","file:///app/packages/libs/shared/src/apps/upload/services/UploadService.ts","file:///app/packages/libs/shared/src/apps/upload/utils/FileExtensionsHelper.ts"],"sourcesContent":["import { LanguageService } from 'libs/common/backbone/services/LanguageService';\n\nimport { DialogError } from 'libs/shared/errors/primitives/DialogError';\nimport { DialogOptions } from 'libs/shared/interfaces';\n\n/**\n * TODO: Create a more useful message here.\n * Perhaps using the mime types listen on MDN\n * https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Complete_list_of_MIME_types\n * or in the list of all the official mime types\n * https://www.iana.org/assignments/media-types/media-types.xhtml\n */\nexport class FileTypeError extends DialogError {\n constructor(message: string) {\n super(message);\n }\n\n // @ts-ignore\n public get name(): string {\n return 'FileTypeError';\n }\n\n // @ts-ignore\n public get lang(): string {\n return 'upload.fileType';\n }\n\n // @ts-ignore\n public get dialogOptions(): DialogOptions {\n return {\n title: LanguageService.getPhrase(this.lang, 'heading'),\n text: LanguageService.getPhrase(this.lang, 'body'),\n buttons: [{\n text: LanguageService.getPhrase(this.lang, 'okay'),\n className: 'btn btn-dark',\n success: true\n }, {\n text: LanguageService.getPhrase(this.lang, 'close'),\n className: 'btn btn-link',\n close: true\n }]\n };\n }\n}","export enum FileLifestyle {\n Permanent = 0,\n Temporary = 1\n}","import { LanguageService } from 'libs/common/backbone/services/LanguageService';\n\nimport { DialogError } from 'libs/shared/errors/primitives/DialogError';\nimport { DialogOptions } from 'libs/shared/interfaces';\n\nconst lang = 'upload.internetConnectivityError';\n\nexport class InternetConnectivityError extends DialogError {\n constructor() {\n super(LanguageService.getPhrase(lang, 'title'));\n }\n\n // @ts-ignore\n public get name(): string {\n return 'InternetConnectivityError';\n }\n\n // @ts-ignore\n public get dialogOptions(): DialogOptions {\n return {\n title: LanguageService.getPhrase(lang, 'heading'),\n text: LanguageService.getPhrase(lang, 'body'),\n buttons: [{\n text: LanguageService.getPhrase(lang, 'okay'),\n className: 'btn btn-outline-dark',\n success: true\n }]\n };\n }\n}","import { LanguageService } from 'libs/common/backbone/services/LanguageService';\n\nimport { DialogError } from 'libs/shared/errors/primitives/DialogError';\nimport { DialogOptions } from 'libs/shared/interfaces';\n\nconst lang = 'upload.slowInternetError';\n\nexport class SlowInternetError extends DialogError {\n constructor() {\n super(LanguageService.getPhrase(lang, 'title'));\n }\n\n // @ts-ignore\n public get name(): string {\n return 'SlowInternetError';\n }\n\n // @ts-ignore\n public get dialogOptions(): DialogOptions {\n return {\n title: LanguageService.getPhrase(lang, 'heading'),\n text: LanguageService.getPhrase(lang, 'body'),\n buttons: [{\n text: LanguageService.getPhrase(lang, 'okay'),\n className: 'btn btn-outline-dark',\n success: true\n }]\n };\n }\n}","import { ObjectHash, Radio } from 'backbone';\nimport Dropzone from 'dropzone';\nimport * as _ from 'underscore';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { Core } from 'libs/common/core';\n\nimport { InternetConnectivityError } from 'libs/shared/apps/upload/errors/internet-connectivity/InternetConnectivityError';\nimport { AlertError } from 'libs/shared/errors/primitives/AlertError';\n\nimport { UploadEventNames } from '../constants/UploadConstants';\nimport { SlowInternetError } from '../errors/slow-internet/SlowInternetError';\n\nexport interface UploadApiWrapperOptions extends Core.ServiceOptions {\n maxFileSize: number;\n chunkSize: number;\n chunkingEnabled: boolean;\n loggingEnabled: boolean;\n acceptedFiles: string;\n channelName: string;\n}\n\nexport interface UploadApiWrapper {\n addFile(file: File): void;\n destroy(): void;\n start(): void;\n getId(file: File): string;\n removeFile(file: File): void;\n}\n\nconst dropzoneEvents: string[] = [\n // 'uploadprogress', 'totaluploadprogress',\n // 'addedfile', 'removedfile', 'thumbnail', 'error', 'processing',\n // 'sending', 'success', 'complete', 'addedfile',\n // 'maxfilesreached', 'maxfilesexceeded', 'processingmultiple',\n // 'sendingmultiple', 'completemultiple', 'canceledmultiple',\n // 'reset', 'queuecomplete'\n];\n\nexport class DropzoneWrapper extends Core.Service implements UploadApiWrapper {\n private dropzone: Dropzone;\n public options: UploadApiWrapperOptions;\n\n private slowInternetTimeout: {[uploadId: string]: number} = {};\n private showSlowInternetTimeout: boolean = true;\n\n // @ts-ignore\n public get name(): string {\n return 'DropzoneWrapper';\n }\n\n constructor(options: UploadApiWrapperOptions) {\n super(options);\n }\n\n public initialize(options: UploadApiWrapperOptions): void {\n const { loggingEnabled } = this.options;\n\n const uploadChannel = Radio.channel(options.channelName);\n\n /**\n * Thought I wouldn't see this in any of our TS\n * Guess I was wrong - sha\n */\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const self = this;\n\n this.dropzone = new Dropzone(document.createElement('div'), {\n url: ((files: Dropzone.DropzoneFile[]) => {\n const file = files[0] as any;\n\n const { ingestUrl } = file.cvUpload;\n\n return ingestUrl;\n }) as any,\n\n chunking: this.options.chunkingEnabled,\n chunkSize: this.options.chunkSize,\n forceChunking: true,\n autoProcessQueue: true,\n maxFilesize: this.options.maxFileSize,\n acceptedFiles: this.options.acceptedFiles,\n paramName: 'content',\n timeout: 180000, // 3 mins in milliseconds\n\n init: function (): void {\n if (!loggingEnabled)\n return;\n\n _.each(dropzoneEvents, (eventName: string) => {\n this.on(eventName, (...args: any[]) => {\n const file = args[0] instanceof File ? args[0].name : args[0];\n console.info(eventName, file, args);\n });\n });\n\n this.on('uploadprogress', (file: File, percentage: number, totalBytes: number) => {\n const progress = totalBytes / file.size * 100;\n uploadChannel.trigger('progress', self.getId(file), progress, totalBytes);\n });\n\n this.on('success', (file: File) => {\n /**\n * This is sort of a hack. It assumes the last chunk will be the last chunk that is uploaded\n * which may not necessarily be the case\n */\n const chunks = (file as any).upload.chunks;\n\n const lastChunk = _.last(chunks) as any;\n\n let xhr = lastChunk.xhr;\n\n if (!xhr)\n xhr = lastChunk.file.xhr;\n\n const response = JSON.parse(xhr.response);\n\n (file as any).cvUpload.fileId = response.id;\n\n uploadChannel.trigger(UploadEventNames.UPLOAD_SUCCESS, file, response);\n });\n\n this.on('error', (file: File, messageObj: ObjectHash, xhr: XMLHttpRequest) => {\n if (xhr && xhr.status === 0) {\n Core.ErrorHelper.throw(new InternetConnectivityError());\n return;\n }\n\n /**\n * Don't throw if the error was caused by canceling\n * the chunk upload. this will happen when the user cancels\n * an upload themselves.\n */\n if ((file as Dropzone.DropzoneFile).status !== 'canceled')\n Core.ErrorHelper.throw(\n new AlertError(LanguageService.getPhrase('upload.services', 'uploadError', {\n fileName: file.name,\n message: messageObj.message\n }))\n );\n });\n\n /**\n * We've increased the upload timeout from 30s to 3mins. This means that the upload\n * will not timeout with an upload speed as slow as 200Kbps. However if a single chunk takes\n * longer than 30s, which is an upload speed of 1Mbps. We'll show a dialog letting the user\n * know that their internet speed is very slow, and the upload may take quite some time.\n * - Sha\n */\n this.on('sending', (file: File) => {\n window.clearTimeout(self.slowInternetTimeout[(file as any).path]);\n\n if (!self.showSlowInternetTimeout)\n return;\n\n self.slowInternetTimeout[(file as any).path] = window.setTimeout(() => {\n if (self.showSlowInternetTimeout)\n Core.ErrorHelper.throw(new SlowInternetError());\n\n self.showSlowInternetTimeout = false;\n }, 30000); // 30s\n });\n\n /**\n * Complete will trigger both on successful uploads and on a cancelled upload.\n */\n this.on('complete', (file: File) => window.clearTimeout(self.slowInternetTimeout[(file as any).path]));\n },\n\n params: (files: Dropzone.DropzoneFile[], xhr: XMLHttpRequest, chunk: any) => {\n if (!chunk)\n return;\n\n return {\n chunk_index: chunk.index,\n upload_length: chunk.file.size\n };\n },\n\n /**\n * These methods are here to disable Dropzone's UI related features\n */\n addedfile: () => {},\n thumbnail: () => {},\n uploadprogress: () => {}\n });\n }\n\n public getId(file: File): string {\n return (file as any).upload.uuid;\n }\n\n public addFile(file: Dropzone.DropzoneFile): void {\n this.dropzone.addFile(file);\n }\n\n public removeFile(file: Dropzone.DropzoneFile): void {\n this.dropzone.removeFile(file);\n }\n\n public start(): void {\n this.dropzone.processQueue();\n }\n\n public destroy(): void {\n this.dropzone.destroy();\n }\n\n public static isValidFile(file: File, acceptedFiles: string): boolean {\n return Dropzone.isValidFile(file, acceptedFiles);\n }\n}","import { Radio } from 'backbone';\nimport * as _ from 'underscore';\n\nimport { Caches } from 'libs/common/backbone/constants/Caches';\nimport { CommonServices } from 'libs/common/backbone/constants/CommonServices';\nimport { DataProviders } from 'libs/common/backbone/constants/DataProviders';\nimport { BaseDataService } from 'libs/common/backbone/services/BaseDataService';\nimport { InstanceManager } from 'libs/common/backbone/services/InstanceManager';\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { ViewModelService } from 'libs/common/backbone/services/ViewModelService';\nimport { Core } from 'libs/common/core';\nimport { HashObject } from 'libs/common/react/interfaces/HashObject';\n\nimport { AnalyticsHelper } from 'libs/analytics/AnalyticsHelper';\nimport { AnalyticsOptions, EntityType, LocationContext, OperationDescriptor, UserAction, WorkflowPhase } from 'libs/analytics/interfaces';\n\nimport { UploadEventNames } from 'libs/shared/apps/upload/constants/UploadConstants';\nimport { FileLifestyle } from 'libs/shared/apps/upload/enums/FileLifestyle';\nimport { FileTypeError } from 'libs/shared/apps/upload/errors/file-type/FileTypeError';\nimport { FileExtensions } from 'libs/shared/apps/upload/utils/FileExtensionsHelper';\nimport { SharedServiceChannels } from 'libs/shared/constants/RadioChannels';\nimport { SharedServices } from 'libs/shared/constants/SharedServices';\n\nimport { DropzoneWrapper, UploadApiWrapper } from './DropzoneWrapper';\n\n/**\n * This data service is locally private and is only\n * used by the UploadService to request/cancel uploads from\n * FileApi\n */\nclass UploadDataService extends BaseDataService {\n constructor() {\n super({\n dataProvider: InstanceManager.getInstance(DataProviders.Ajax),\n cache: InstanceManager.getInstance(Caches.Fifo),\n alertService: InstanceManager.getInstance(CommonServices.ALERT)\n });\n }\n\n private incrementingUploadId: number = 0;\n\n // @ts-ignore\n public get name(): string {\n /**\n * This string is not in DataServices because this data service is private.\n */\n return 'UploadDataService';\n }\n\n /**\n * This is not sitting in RadioChannels\n * because it is only used in this file\n */\n // @ts-ignore\n public get channelName(): string {\n return 'private:upload:data:service';\n }\n\n public requestUploads(\n resource: string,\n files: File[],\n fileLifestyle: FileLifestyle,\n fileCallback: (file: File, response: any) => void,\n callback: () => void\n ): void {\n const chain = this.chain();\n\n _.each(files, file => {\n this.incrementingUploadId++;\n\n chain.create({\n resource,\n eventPrefix: `request:upload:${this.incrementingUploadId}`,\n data: this.getFileUploadRequest(file, fileLifestyle),\n callback: (response: any) => {\n fileCallback(file, response);\n },\n errorHandler: this.alertService.error(`Something went wrong while we were uploading your video. Please try again.`)\n });\n });\n\n chain.func(() => {\n callback();\n }).run();\n }\n\n public cancelUpload(uploadId: string, ingestUrl: string, callback?: (response: any) => void): void {\n this.create({\n resource: '/api/upload/cancel',\n eventPrefix: 'cancel:upload',\n data: {\n uploadId, ingestUrl\n },\n callback\n });\n }\n\n private getFileUploadRequest(file: File, fileLifestyle: FileLifestyle): HashObject {\n const splitName = file.name.split('.');\n\n /**\n * TODO: We may need to set the file permanence in file api to\n * permanent for resources and subtitles\n * Check what Prad/Cam say in\n * https://app.asana.com/0/720933954350984/735809491718142\n */\n return {\n name: splitName.join('.'),\n extension: splitName.length > 1 ? splitName.pop() : '',\n fileSize: file.size,\n fileLifestyle\n };\n }\n\n public onDestroy(): void {\n InstanceManager\n .releaseInstance(DataProviders.Ajax)\n .releaseInstance(Caches.Fifo);\n }\n}\n\n\nexport interface UploadItem extends Core.Model {\n file: File;\n name: string;\n progress: number;\n}\n\nexport enum UploadType {\n Video,\n LearningResource,\n Subtitle,\n MixedMedia\n}\n\nconst AcceptedFiles = {\n [UploadType.Video]: FileExtensions.VIDEO,\n [UploadType.LearningResource]: FileExtensions.RESOURCES,\n [UploadType.Subtitle]: FileExtensions.SUBTITLES,\n [UploadType.MixedMedia]: FileExtensions.MIXED_MEDIA\n};\n\nconst ChannelNames = {\n [UploadType.Video]: SharedServiceChannels.VIDEO_UPLOAD,\n [UploadType.LearningResource]: SharedServiceChannels.RESOURCE_UPLOAD,\n [UploadType.Subtitle]: SharedServiceChannels.SUBTITLE_UPLOAD,\n [UploadType.MixedMedia]: SharedServiceChannels.MIXED_MEDIA_UPLOAD\n};\n\nconst CHUNK_SIZE = 1024 * 1024 * 4; // 4mb\nconst MAX_FILE_SIZE = 1024 * 1024 * 1024 * 50; // 50gb\n\nexport interface UploadServiceOptions {\n uploadUrl?: string;\n}\n\nclass UploadService extends Core.Service {\n protected options: UploadServiceOptions;\n protected uploadType: UploadType;\n protected fileLifestyle: FileLifestyle;\n\n /**\n *\n */\n constructor(options: UploadServiceOptions = {}) {\n super({\n uploadUrl: '/api/upload',\n ...options\n });\n }\n\n protected uploader: UploadApiWrapper;\n\n private progressViewModel: Core.Model;\n\n private uploadDataService: UploadDataService;\n\n private collection: Core.Collection<UploadItem>;\n\n public initialize(): void {\n this.uploadDataService = new UploadDataService();\n\n this.progressViewModel = ViewModelService.get(`upload:progress:${this.uploadType}`);\n\n this.bindListeners();\n }\n\n // @ts-ignore\n public get channelName(): string {\n return ChannelNames[this.uploadType];\n }\n\n // @ts-ignore\n public get lang(): string {\n return 'uploadShared.services';\n }\n\n /**\n * Dropzone is initialized once after the first upload is requested and it's chunk size\n * is set for the rest of the uploads. If we happen to have multiple ingest\n * servers that have different chunk max / min sizes, this may voilate those\n * sizes.\n */\n private initUploader(minChunkSize: number, maxChunkSize: number): void {\n if (this.uploader)\n return;\n\n let chunkSize = CHUNK_SIZE;\n\n if (minChunkSize && chunkSize < minChunkSize)\n chunkSize = minChunkSize;\n\n if (maxChunkSize && chunkSize > maxChunkSize)\n chunkSize = maxChunkSize;\n\n this.uploader = new DropzoneWrapper({\n chunkingEnabled: true,\n loggingEnabled: true,\n chunkSize,\n maxFileSize: MAX_FILE_SIZE,\n acceptedFiles: this.getAcceptedFiles(),\n channelName: this.channelName\n });\n }\n\n private bindListeners(): void {\n this.listenTo(this.channelName, 'progress', this.onProgress);\n\n this.listenTo(this.channelName, UploadEventNames.UPLOAD_SUCCESS, this.onSuccess);\n }\n\n private onProgress(id: string, percentage: number, totalUploaded: number): void {\n const model = this.collection.get(id);\n\n if (!model)\n return;\n\n model.set({\n progress: percentage > 100 ? 100 : percentage,\n totalUploaded\n });\n\n this.setOverallProgress();\n }\n\n public isUploading(): boolean {\n return !!this.getCollection().length;\n }\n\n public getCollection(): Core.Collection<UploadItem> {\n if (this.collection)\n return this.collection;\n\n this.collection = new Core.Collection<UploadItem>();\n return this.collection;\n }\n\n public setOverallProgress(): void {\n let totalUploaded = 0;\n let totalFileSize = 0;\n\n const collection = this.getCollection();\n\n if (!collection.length) {\n this.progressViewModel.set({ progress: 0 });\n return;\n }\n\n collection.each((model: Core.Model) => {\n totalUploaded += model.get('totalUploaded') || 0;\n totalFileSize += model.get('file').size || 0;\n });\n\n const percentage = totalUploaded / totalFileSize * 100;\n\n const done = percentage >= 100;\n\n const updateProgress = () => {\n this.progressViewModel.set({\n progress: done ? 100 : percentage,\n done\n });\n };\n\n if (!done) {\n updateProgress();\n return;\n }\n \n /**\n * The ingest backend takes a short while after an upload is done\n * before the complete endpoint will actually response successfully.\n * So this prevents the eager beavers from clicking \"finish\" immediately\n * and having their entire upload session break.\n * - Sha\n */\n window.setTimeout(updateProgress, 2000);\n }\n\n public isValidFile(file: File): boolean {\n return DropzoneWrapper.isValidFile(file, this.getAcceptedFiles());\n }\n\n /**\n * Request uploads from fileApi and starts uploading.\n * @param files Array of browser File objects\n * @returns Returns false if any of the files did not match the accepted file list.\n */\n public addFiles(files: File[], analyticsOptions?: AnalyticsOptions): void {\n if (_.any(files, file => !this.isValidFile(file))) {\n Core.ErrorHelper.throw(\n new FileTypeError(LanguageService.getPhrase(this.lang, 'invalidFileType'))\n );\n return;\n }\n\n this.requestUploads(files, analyticsOptions);\n }\n\n private requestUploads(files: File[], analyticsOptions?: AnalyticsOptions): void {\n const wasUploading = this.isUploading();\n\n const collection = this.getCollection();\n\n const fileCallback = (file: File, response: any) => {\n /**\n * minChunkSize and maxChunkSize have been deprecated.\n * Remove once Lite and Library Editor has been updated\n * to use the new fields minChunkLength and maxChunkLength.\n */\n if ('minChunkSize' in response || 'maxChunkSize' in response) {\n this.initUploader(response.minChunkSize * 1024, response.maxChunkSize * 1024);\n } else {\n this.initUploader(response.minChunkLength, response.maxChunkLength);\n }\n\n (file as any).cvUpload = {\n uploadId: response.uploadId,\n ingestUrl: response.ingestUrl\n };\n\n this.uploader.addFile(file);\n\n let fileName = file.name;\n\n // Remove file extension from filename if video\n if (this.uploadType === UploadType.Video)\n fileName = fileName.replace(/\\.[^/.]+$/, '');\n\n collection.add({\n id: this.uploader.getId(file),\n file,\n name: fileName,\n ...this.getAdditionalFileInfo(file, response)\n }, { at: collection.length - 1 });\n };\n\n const callback = () => {\n if (analyticsOptions) {\n AnalyticsHelper.logUserAction({\n uploadCount: files.length\n }, analyticsOptions);\n }\n\n const channel = Radio.channel(this.channelName);\n channel.trigger(UploadEventNames.FILES_ADDED, files, wasUploading);\n };\n\n this.uploadDataService.requestUploads(\n this.options.uploadUrl,\n files,\n this.fileLifestyle,\n fileCallback,\n callback\n );\n }\n\n public addFile(file: File, analyticsOptions: AnalyticsOptions): void {\n this.addFiles([file], analyticsOptions);\n }\n\n public cancelUpload(id: string): void {\n const collection = this.getCollection();\n const model = collection.get(id);\n\n if (!model)\n return;\n\n const file = model.get('file') as any;\n\n this.uploader.removeFile(file);\n collection.remove(model);\n\n this.uploadDataService.cancelUpload(file.cvUpload.uploadId, file.cvUpload.ingestUrl, () => {\n AnalyticsHelper.logUserAction(model.toJSON(), {\n entity: EntityType.Video,\n actionType: UserAction.Upload,\n workflowPhase: WorkflowPhase.Discard,\n descriptor: OperationDescriptor.Single,\n location: LocationContext.MyUploads\n });\n\n Radio.channel(this.channelName).trigger(UploadEventNames.UPLOAD_CANCELLED);\n });\n\n this.setOverallProgress();\n }\n\n protected onSuccess(file: File, response: any): void {\n const fileId = this.uploader.getId(file);\n\n const upload = this.getCollection().get(fileId);\n\n upload.set('fileInfo', response);\n\n AnalyticsHelper.logUserAction({\n id: (file as any).cvUpload.uploadId\n }, {\n entity: EntityType.Video,\n actionType: UserAction.Upload,\n workflowPhase: WorkflowPhase.Complete,\n descriptor: OperationDescriptor.Single,\n location: LocationContext.VideoUpload\n });\n\n const channel = Radio.channel(this.channelName);\n channel.trigger(UploadEventNames.UPLOAD_COMPLETE, upload);\n }\n\n public cancelAllUploads(): void {\n /**\n * We're using model ids and _.each\n * instead of collection.each because this.cancelUpload\n * removes items from the collection which breaks collection.each\n */\n const models = this.getCollection().map(m => m.get('id'));\n _.each(models, m => this.cancelUpload(m));\n }\n\n public getUpload(file: File): Core.Model {\n const fileId = this.uploader.getId(file);\n\n return this.getCollection().get(fileId);\n }\n\n protected getAcceptedFiles(): string {\n return AcceptedFiles[this.uploadType];\n }\n\n // eslint-disable-next-line\n protected getAdditionalFileInfo(file: File, response: any): HashObject {\n return {};\n }\n}\n\nexport class BaseVideoUploadService extends UploadService {\n // @ts-ignore\n protected get uploadType(): UploadType {\n return UploadType.Video;\n }\n\n // @ts-ignore\n public get name(): string {\n return SharedServices.VideoUpload;\n }\n\n // @ts-ignore\n public get fileLifestyle(): FileLifestyle {\n return FileLifestyle.Temporary;\n }\n}\n\nexport class SubtitleUploadService extends UploadService {\n // @ts-ignore\n protected get uploadType(): UploadType {\n return UploadType.Subtitle;\n }\n\n // @ts-ignore\n public get name(): string {\n return SharedServices.SubtitleUpload;\n }\n\n // @ts-ignore\n public get fileLifestyle(): FileLifestyle {\n return FileLifestyle.Permanent;\n }\n}\n\nexport class LearningResourceUploadService extends UploadService {\n // @ts-ignore\n protected get uploadType(): UploadType {\n return UploadType.LearningResource;\n }\n\n // @ts-ignore\n public get name(): string {\n return SharedServices.ResourceUpload;\n }\n\n // @ts-ignore\n public get fileLifestyle(): FileLifestyle {\n return FileLifestyle.Permanent;\n }\n}\n\nexport class MixedMediaUploadService extends UploadService {\n // @ts-ignore\n protected get uploadType(): UploadType {\n return UploadType.MixedMedia;\n }\n\n // @ts-ignore\n public get name(): string {\n return SharedServices.MixedMediaUpload;\n }\n\n // @ts-ignore\n public get fileLifestyle(): FileLifestyle {\n return FileLifestyle.Temporary;\n }\n}","import * as _ from 'underscore';\n\n/**\n * This are kept as separate variables for when we eventually need a single group of them.\n * For example when we add image upload support.\n */\n\nconst pdfExtensions = ['pdf'];\nconst docExtensions = [ 'doc', 'docx', 'dotx', 'dot', 'rtf', 'docm', 'odt' ];\nconst textExtensions = [ 'csv', 'txt' ];\nconst excelExtensions = [ 'xls', 'xlt', 'xlsx' ];\nconst imageExtensions = [ 'jpg', 'tif', 'png', 'bmp', 'gif', 'jpeg' ];\nconst videoMimeType = 'video/*';\nconst archiveExtensions = [ 'zip', 'rar' ];\nconst powerPointExtensions = [ 'ppt', 'pot', 'pps', 'pptx' ];\n\nconst subtitleExtensions = ['srt'];\n\nconst FileExtensions = {\n IMAGES: `.${imageExtensions.join(',.')}`,\n VIDEO: videoMimeType,\n MIXED_MEDIA: `.${imageExtensions.join(',.')},${videoMimeType}`,\n RESOURCES: `.${[\n ...docExtensions,\n ...excelExtensions,\n ...powerPointExtensions,\n ...pdfExtensions,\n ...textExtensions,\n ...imageExtensions,\n ...archiveExtensions\n ].join(',.')}`,\n SUBTITLES: `.${subtitleExtensions.join(',.')}`\n};\n\nconst FileExtensionHelper = {\n getResourceType(extension: string): string {\n const ext = extension.toLowerCase();\n\n if (_.contains(docExtensions, ext)) return 'document';\n if (_.contains(excelExtensions, ext)) return 'excel';\n if (_.contains(powerPointExtensions, ext)) return 'powerpoint';\n if (_.contains(pdfExtensions, ext)) return 'pdf';\n\n if (_.contains(textExtensions, ext)) return 'text';\n if (_.contains(imageExtensions, ext)) return 'image';\n if (_.contains(archiveExtensions, ext)) return 'archive';\n if (_.contains(subtitleExtensions, ext)) return 'subtitle';\n\n return '';\n }\n};\n\nexport { FileExtensions, FileExtensionHelper };"],"names":["FileTypeError","message","title","this","lang","text","buttons","className","success","close","FileLifestyle","InternetConnectivityError","LanguageService","DialogError","SlowInternetError","dropzoneEvents","DropzoneWrapper","options","slowInternetTimeout","showSlowInternetTimeout","loggingEnabled","uploadChannel","Radio","channelName","self","dropzone","document","createElement","url","files","cvUpload","ingestUrl","chunking","chunkingEnabled","chunkSize","forceChunking","autoProcessQueue","maxFilesize","maxFileSize","acceptedFiles","paramName","timeout","init","eventName","on","args","file","File","name","console","info","percentage","totalBytes","progress","size","trigger","getId","chunks","upload","lastChunk","xhr","response","JSON","parse","fileId","id","messageObj","status","AlertError","fileName","window","clearTimeout","path","setTimeout","params","chunk","chunk_index","index","upload_length","addedfile","thumbnail","uploadprogress","uuid","addFile","removeFile","processQueue","destroy","UploadType","UploadDataService","dataProvider","InstanceManager","DataProviders","cache","Caches","alertService","CommonServices","incrementingUploadId","resource","fileLifestyle","fileCallback","callback","chain","create","eventPrefix","data","getFileUploadRequest","errorHandler","error","func","run","uploadId","splitName","split","join","extension","length","pop","fileSize","releaseInstance","BaseDataService","B","AcceptedFiles","Video","LearningResource","Subtitle","MixedMedia","ChannelNames","UploadService","uploadUrl","uploadDataService","progressViewModel","ViewModelService","uploadType","bindListeners","minChunkSize","maxChunkSize","uploader","getAcceptedFiles","listenTo","onProgress","onSuccess","totalUploaded","model","collection","get","set","setOverallProgress","getCollection","totalFileSize","each","done","updateProgress","isValidFile","analyticsOptions","requestUploads","wasUploading","isUploading","initUploader","minChunkLength","maxChunkLength","replace","add","getAdditionalFileInfo","at","AnalyticsHelper","uploadCount","addFiles","remove","cancelUpload","toJSON","entity","actionType","workflowPhase","descriptor","location","models","map","m","BaseVideoUploadService","SharedServices","Temporary","SubtitleUploadService","Permanent","LearningResourceUploadService","MixedMediaUploadService","pdfExtensions","docExtensions","textExtensions","excelExtensions","imageExtensions","videoMimeType","archiveExtensions","powerPointExtensions","subtitleExtensions","FileExtensions","IMAGES","VIDEO","MIXED_MEDIA","RESOURCES","SUBTITLES","FileExtensionHelper","getResourceType","ext","toLowerCase"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunk_clickview_lite=self.webpackChunk_clickview_lite||[]).push([[3836,121],{86877:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(23481);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},r(e)}function i(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,a(o.key),o)}}function a(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(u=function(){return!!e})()}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}var s=function(e){function t(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=c(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,u()?Reflect.construct(t,n||[],c(e).constructor):t.apply(e,n))}(this,t,[e])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l(e,t)}(t,e),n=t,(a=[{key:"name",get:function(){return"FileTypeError"}},{key:"lang",get:function(){return"upload.fileType"}},{key:"dialogOptions",get:function(){return{title:o.T.getPhrase(this.lang,"heading"),text:o.T.getPhrase(this.lang,"body"),buttons:[{text:o.T.getPhrase(this.lang,"okay"),className:"btn btn-dark",success:!0},{text:o.T.getPhrase(this.lang,"close"),className:"btn btn-link",close:!0}]}}}])&&i(n.prototype,a),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,a}(n(47663).S)},90121:(e,t,n)=>{n.r(t),n.d(t,{BaseVideoUploadService:()=>fe,LearningResourceUploadService:()=>de,MixedMediaUploadService:()=>ye,SubtitleUploadService:()=>pe,UploadType:()=>ae});var o,r=n(48088),i=n(39479),a=n(46865),u=n(79976),c=n(37433),l=n(54149),s=n(71365),f=n(23481),p=n(70794),d=n(81886),y=n(49985),h=n(65858),b=n(29555);!function(e){e[e.Permanent=0]="Permanent",e[e.Temporary=1]="Temporary"}(o||(o={}));var g=n(86877),v=n(28046),m=n(52003),O=n(60735),w=n(53301),S=n.n(w),P=n(47663);function k(e){return k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},k(e)}function E(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,T(o.key),o)}}function T(e){var t=function(e){if("object"!=k(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=k(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==k(t)?t:t+""}function j(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(j=function(){return!!e})()}function U(e){return U=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},U(e)}function _(e,t){return _=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_(e,t)}var I="upload.internetConnectivityError",L=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=U(t),function(e,t){if(t&&("object"==k(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,j()?Reflect.construct(t,n||[],U(e).constructor):t.apply(e,n))}(this,t,[f.T.getPhrase(I,"title")])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_(e,t)}(t,e),n=t,(o=[{key:"name",get:function(){return"InternetConnectivityError"}},{key:"dialogOptions",get:function(){return{title:f.T.getPhrase(I,"heading"),text:f.T.getPhrase(I,"body"),buttons:[{text:f.T.getPhrase(I,"okay"),className:"btn btn-outline-dark",success:!0}]}}}])&&E(n.prototype,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,o}(P.S),D=n(44331);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},C(e)}function R(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,x(o.key),o)}}function x(e){var t=function(e){if("object"!=C(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=C(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==C(t)?t:t+""}function A(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(A=function(){return!!e})()}function F(e){return F=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},F(e)}function M(e,t){return M=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},M(e,t)}var V="upload.slowInternetError",N=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=F(t),function(e,t){if(t&&("object"==C(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,A()?Reflect.construct(t,n||[],F(e).constructor):t.apply(e,n))}(this,t,[f.T.getPhrase(V,"title")])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&M(e,t)}(t,e),n=t,(o=[{key:"name",get:function(){return"SlowInternetError"}},{key:"dialogOptions",get:function(){return{title:f.T.getPhrase(V,"heading"),text:f.T.getPhrase(V,"body"),buttons:[{text:f.T.getPhrase(V,"okay"),className:"btn btn-outline-dark",success:!0}]}}}])&&R(n.prototype,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,o}(P.S);function z(e){return z="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},z(e)}function B(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,Q(o.key),o)}}function Q(e){var t=function(e){if("object"!=z(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=z(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==z(t)?t:t+""}function q(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(q=function(){return!!e})()}function Y(e){return Y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Y(e)}function W(e,t){return W=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},W(e,t)}var Z=[],K=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(e,t,n){return t=Y(t),function(e,t){if(t&&("object"==z(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,q()?Reflect.construct(t,n||[],Y(e).constructor):t.apply(e,n))}(this,t,[e])).slowInternetTimeout={},n.showSlowInternetTimeout=!0,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&W(e,t)}(t,e),n=t,o=[{key:"name",get:function(){return"DropzoneWrapper"}},{key:"initialize",value:function(e){var t=this.options.loggingEnabled,n=r.Radio.channel(e.channelName),o=this;this.dropzone=new(S())(document.createElement("div"),{url:function(e){return e[0].cvUpload.ingestUrl},chunking:this.options.chunkingEnabled,chunkSize:this.options.chunkSize,forceChunking:!0,autoProcessQueue:!0,maxFilesize:this.options.maxFileSize,acceptedFiles:this.options.acceptedFiles,paramName:"content",timeout:18e4,init:function(){var e=this;t&&(i.each(Z,(function(t){e.on(t,(function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];var r=n[0]instanceof File?n[0].name:n[0];console.info(t,r,n)}))})),this.on("uploadprogress",(function(e,t,r){var i=r/e.size*100;n.trigger("progress",o.getId(e),i,r)})),this.on("success",(function(e){var t=e.upload.chunks,o=i.last(t),r=o.xhr;r||(r=o.file.xhr);var a=JSON.parse(r.response);e.cvUpload.fileId=a.id,n.trigger(b.S.UPLOAD_SUCCESS,e,a)})),this.on("error",(function(e,t,n){n&&0===n.status?d.Q.Ry.throw(new L):"canceled"!==e.status&&d.Q.Ry.throw(new D.n(f.T.getPhrase("upload.services","uploadError",{fileName:e.name,message:t.message})))})),this.on("sending",(function(e){window.clearTimeout(o.slowInternetTimeout[e.path]),o.showSlowInternetTimeout&&(o.slowInternetTimeout[e.path]=window.setTimeout((function(){o.showSlowInternetTimeout&&d.Q.Ry.throw(new N),o.showSlowInternetTimeout=!1}),3e4))})),this.on("complete",(function(e){return window.clearTimeout(o.slowInternetTimeout[e.path])})))},params:function(e,t,n){if(n)return{chunk_index:n.index,upload_length:n.file.size}},addedfile:function(){},thumbnail:function(){},uploadprogress:function(){}})}},{key:"getId",value:function(e){return e.upload.uuid}},{key:"addFile",value:function(e){this.dropzone.addFile(e)}},{key:"removeFile",value:function(e){this.dropzone.removeFile(e)}},{key:"start",value:function(){this.dropzone.processQueue()}},{key:"destroy",value:function(){this.dropzone.destroy()}}],a=[{key:"isValidFile",value:function(e,t){return S().isValidFile(e,t)}}],o&&B(n.prototype,o),a&&B(n,a),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,o,a}(d.Q.t6);function X(e){return X="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},X(e)}function H(e,t,n){return(t=ee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function J(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function G(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,ee(o.key),o)}}function $(e,t,n){return t&&G(e.prototype,t),n&&G(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ee(e){var t=function(e){if("object"!=X(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=X(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==X(t)?t:t+""}function te(e,t,n){return t=oe(t),function(e,t){if(t&&("object"==X(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ne()?Reflect.construct(t,n||[],oe(e).constructor):t.apply(e,n))}function ne(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ne=function(){return!!e})()}function oe(e){return oe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},oe(e)}function re(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ie(e,t)}function ie(e,t){return ie=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ie(e,t)}var ae,ue=function(e){function t(){var e;return J(this,t),(e=te(this,t,[{dataProvider:s.u.getInstance(c.R.Ajax),cache:s.u.getInstance(a.p.Fifo),alertService:s.u.getInstance(u.P.ALERT)}])).incrementingUploadId=0,e}return re(t,e),$(t,[{key:"name",get:function(){return"UploadDataService"}},{key:"channelName",get:function(){return"private:upload:data:service"}},{key:"requestUploads",value:function(e,t,n,o,r){var a=this,u=this.chain();i.each(t,(function(t){a.incrementingUploadId++,u.create({resource:e,eventPrefix:"request:upload:".concat(a.incrementingUploadId),data:a.getFileUploadRequest(t,n),callback:function(e){o(t,e)},errorHandler:a.alertService.error("Something went wrong while we were uploading your video. Please try again.")})})),u.func((function(){r()})).run()}},{key:"cancelUpload",value:function(e,t,n){this.create({resource:"/api/upload/cancel",eventPrefix:"cancel:upload",data:{uploadId:e,ingestUrl:t},callback:n})}},{key:"getFileUploadRequest",value:function(e,t){var n=e.name.split(".");return{name:n.join("."),extension:n.length>1?n.pop():"",fileSize:e.size,fileLifestyle:t}}},{key:"onDestroy",value:function(){s.u.releaseInstance(c.R.Ajax).releaseInstance(a.p.Fifo)}}])}(l.B);!function(e){e[e.Video=0]="Video",e[e.LearningResource=1]="LearningResource",e[e.Subtitle=2]="Subtitle",e[e.MixedMedia=3]="MixedMedia"}(ae||(ae={}));var ce=H(H(H(H({},ae.Video,v.l.VIDEO),ae.LearningResource,v.l.RESOURCES),ae.Subtitle,v.l.SUBTITLES),ae.MixedMedia,v.l.MIXED_MEDIA),le=H(H(H(H({},ae.Video,m.Q4.VIDEO_UPLOAD),ae.LearningResource,m.Q4.RESOURCE_UPLOAD),ae.Subtitle,m.Q4.SUBTITLE_UPLOAD),ae.MixedMedia,m.Q4.MIXED_MEDIA_UPLOAD),se=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return J(this,t),te(this,t,[Object.assign({uploadUrl:"/api/upload"},e)])}return re(t,e),$(t,[{key:"initialize",value:function(){this.uploadDataService=new ue,this.progressViewModel=p.r.get("upload:progress:".concat(this.uploadType)),this.bindListeners()}},{key:"channelName",get:function(){return le[this.uploadType]}},{key:"lang",get:function(){return"uploadShared.services"}},{key:"initUploader",value:function(e,t){if(!this.uploader){var n=4194304;e&&n<e&&(n=e),t&&n>t&&(n=t),this.uploader=new K({chunkingEnabled:!0,loggingEnabled:!0,chunkSize:n,maxFileSize:53687091200,acceptedFiles:this.getAcceptedFiles(),channelName:this.channelName})}}},{key:"bindListeners",value:function(){this.listenTo(this.channelName,"progress",this.onProgress),this.listenTo(this.channelName,b.S.UPLOAD_SUCCESS,this.onSuccess)}},{key:"onProgress",value:function(e,t,n){var o=this.collection.get(e);o&&(o.set({progress:t>100?100:t,totalUploaded:n}),this.setOverallProgress())}},{key:"isUploading",value:function(){return!!this.getCollection().length}},{key:"getCollection",value:function(){return this.collection||(this.collection=new d.Q.FE),this.collection}},{key:"setOverallProgress",value:function(){var e=this,t=0,n=0,o=this.getCollection();if(o.length){o.each((function(e){t+=e.get("totalUploaded")||0,n+=e.get("file").size||0}));var r=t/n*100,i=r>=100,a=function(){e.progressViewModel.set({progress:i?100:r,done:i})};i?window.setTimeout(a,2e3):a()}else this.progressViewModel.set({progress:0})}},{key:"isValidFile",value:function(e){return K.isValidFile(e,this.getAcceptedFiles())}},{key:"addFiles",value:function(e,t){var n=this;i.any(e,(function(e){return!n.isValidFile(e)}))?d.Q.Ry.throw(new g.Z(f.T.getPhrase(this.lang,"invalidFileType"))):this.requestUploads(e,t)}},{key:"requestUploads",value:function(e,t){var n=this,o=this.isUploading(),i=this.getCollection();this.uploadDataService.requestUploads(this.options.uploadUrl,e,this.fileLifestyle,(function(e,t){n.initUploader(1024*t.minChunkSize,1024*t.maxChunkSize),e.cvUpload={uploadId:t.uploadId,ingestUrl:t.ingestUrl},n.uploader.addFile(e);var o=e.name;n.uploadType===ae.Video&&(o=o.replace(/\.[^/.]+$/,"")),i.add(Object.assign({id:n.uploader.getId(e),file:e,name:o},n.getAdditionalFileInfo(e,t)),{at:i.length-1})}),(function(){t&&y.k.logUserAction({uploadCount:e.length},t),r.Radio.channel(n.channelName).trigger(b.S.FILES_ADDED,e,o)}))}},{key:"addFile",value:function(e,t){this.addFiles([e],t)}},{key:"cancelUpload",value:function(e){var t=this,n=this.getCollection(),o=n.get(e);if(o){var i=o.get("file");this.uploader.removeFile(i),n.remove(o),this.uploadDataService.cancelUpload(i.cvUpload.uploadId,i.cvUpload.ingestUrl,(function(){y.k.logUserAction(o.toJSON(),{entity:h.py.Video,actionType:h.Vw.Upload,workflowPhase:h.eu.Discard,descriptor:h.yh.Single,location:h.LZ.MyUploads}),r.Radio.channel(t.channelName).trigger(b.S.UPLOAD_CANCELLED)})),this.setOverallProgress()}}},{key:"onSuccess",value:function(e,t){var n=this.uploader.getId(e),o=this.getCollection().get(n);o.set("fileInfo",t),y.k.logUserAction({id:e.cvUpload.uploadId},{entity:h.py.Video,actionType:h.Vw.Upload,workflowPhase:h.eu.Complete,descriptor:h.yh.Single,location:h.LZ.VideoUpload}),r.Radio.channel(this.channelName).trigger(b.S.UPLOAD_COMPLETE,o)}},{key:"cancelAllUploads",value:function(){var e=this,t=this.getCollection().map((function(e){return e.get("id")}));i.each(t,(function(t){return e.cancelUpload(t)}))}},{key:"getUpload",value:function(e){var t=this.uploader.getId(e);return this.getCollection().get(t)}},{key:"getAcceptedFiles",value:function(){return ce[this.uploadType]}},{key:"getAdditionalFileInfo",value:function(e,t){return{}}}])}(d.Q.t6),fe=function(e){function t(){return J(this,t),te(this,t,arguments)}return re(t,e),$(t,[{key:"uploadType",get:function(){return ae.Video}},{key:"name",get:function(){return O.D.VideoUpload}},{key:"fileLifestyle",get:function(){return o.Temporary}}])}(se),pe=function(e){function t(){return J(this,t),te(this,t,arguments)}return re(t,e),$(t,[{key:"uploadType",get:function(){return ae.Subtitle}},{key:"name",get:function(){return O.D.SubtitleUpload}},{key:"fileLifestyle",get:function(){return o.Permanent}}])}(se),de=function(e){function t(){return J(this,t),te(this,t,arguments)}return re(t,e),$(t,[{key:"uploadType",get:function(){return ae.LearningResource}},{key:"name",get:function(){return O.D.ResourceUpload}},{key:"fileLifestyle",get:function(){return o.Permanent}}])}(se),ye=function(e){function t(){return J(this,t),te(this,t,arguments)}return re(t,e),$(t,[{key:"uploadType",get:function(){return ae.MixedMedia}},{key:"name",get:function(){return O.D.MixedMediaUpload}},{key:"fileLifestyle",get:function(){return o.Temporary}}])}(se)},28046:(e,t,n)=>{n.d(t,{l:()=>d,v:()=>y});var o=n(39479),r=["pdf"],i=["doc","docx","dotx","dot","rtf","docm","odt"],a=["csv","txt"],u=["xls","xlt","xlsx"],c=["jpg","tif","png","bmp","gif","jpeg"],l="video/*",s=["zip","rar"],f=["ppt","pot","pps","pptx"],p=["srt"],d={IMAGES:".".concat(c.join(",.")),VIDEO:l,MIXED_MEDIA:".".concat(c.join(",."),",").concat(l),RESOURCES:".".concat([].concat(i,u,f,r,a,c,s).join(",.")),SUBTITLES:".".concat(p.join(",."))},y={getResourceType:function(e){var t=e.toLowerCase();return o.contains(i,t)?"document":o.contains(u,t)?"excel":o.contains(f,t)?"powerpoint":o.contains(r,t)?"pdf":o.contains(a,t)?"text":o.contains(c,t)?"image":o.contains(s,t)?"archive":o.contains(p,t)?"subtitle":""}}},3836:(e,t,n)=>{n.r(t),n.d(t,{VideoUploadService:()=>U});var o,r=n(48088),i=n(79976),a=n(60139),u=n(71365),c=n(23481),l=n(29555),s=n(90121);!function(e){e[e.Upload=1]="Upload",e[e.Tv=2]="Tv"}(o||(o={}));var f,p,d=n(65728);!function(e){e[e.ExternalOnly=0]="ExternalOnly",e[e.EmbeddedOnly=1]="EmbeddedOnly"}(f||(f={})),function(e){e[e.IosApp=1]="IosApp",e[e.AndroidApp=2]="AndroidApp",e[e.WinApp=3]="WinApp",e[e.LibraryPublisher=4]="LibraryPublisher",e[e.ExchangeClient=5]="ExchangeClient",e[e.Online=6]="Online",e[e.Tinder=7]="Tinder",e[e.Cloud247=8]="Cloud247",e[e.Livestream=9]="Livestream",e[e.Curator=10]="Curator",e[e.LibraryEditor=11]="LibraryEditor",e[e.Lite=12]="Lite"}(p||(p={}));var y=n(75795),h=n(14070),b=n(97291),g=n(57322),v=n(16800);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},m(e)}function O(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,w(o.key),o)}}function w(e){var t=function(e){if("object"!=m(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=m(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==m(t)?t:t+""}function S(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(S=function(){return!!e})()}function P(e,t,n,o){var r=k(E(1&o?e.prototype:e),t,n);return 2&o&&"function"==typeof r?function(e){return r.apply(n,e)}:r}function k(){return k="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var o=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=E(e)););return e}(e,t);if(o){var r=Object.getOwnPropertyDescriptor(o,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},k.apply(null,arguments)}function E(e){return E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},E(e)}function T(e,t){return T=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},T(e,t)}var j=c.T.encloseNamespace("upload.services"),U=function(e){function t(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=E(t),function(e,t){if(t&&("object"==m(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,S()?Reflect.construct(t,n||[],E(e).constructor):t.apply(e,n))}(this,t,[e])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&T(e,t)}(t,e),n=t,(c=[{key:"initialize",value:function(){P(t,"initialize",this,3)([]),this.videoUploadDataService=u.u.getInstance(g.O.VideoUpload,this),this.pendingItemsService=u.u.getInstance(g.K.PendingItems,this),this.userDataService=u.u.getInstance(g.O.FlightUser,this),this.alertService=u.u.getInstance(i.P.ALERT,this),this.listenTo(this.channelName,l.S.FILES_ADDED,this.onUploadStart),this.listenTo(this.channelName,l.S.UPLOAD_COMPLETE,this.unlockNav),this.listenTo(this.channelName,l.S.UPLOAD_CANCELLED,this.unlockNav)}},{key:"onUploadStart",value:function(e){var t={type:a.NK.Success,heading:j("startUploadAlertHeading"),message:1===e.length?j("startUploadSingleAlertBody",{videoName:e[0].name}):j("startUploadMultipleAlertBody",{uploadCount:e.length})},n=y.O.getCurrentContext().appLink;!!v.Y.getMyVideosAppLinks().find((function(e){return n.application===e.application&&n.action===e.action}))||(t.appLinkText=j("startUploadAlertAppLinkText",{smartCount:e.length}),t.appLink={application:b.O.MY_VIDEOS,action:h.e.MyVideos.MY_VIDEOS},t.appLinkClassName="info-link"),this.alertService.createAlert(t)}},{key:"unlockNav",value:function(){this.getCollection().some((function(e){return e.get("progress")<100}))||r.Radio.channel(this.channelName).trigger(l.S.UNLOCK_NAV)}},{key:"completeUpload",value:function(e,t){var n=this;e.set("sending",!0),this.userDataService.getCurrentUser((function(r){n.userDataService.getCustomerSettings(r.customerId,(function(i){n.userDataService.getWorkspace((function(a){n.videoUploadDataService.completeVideoUpload({id:e.get("id"),userId:r.id,customerId:r.customerId,libraryId:a.id,categoryId:e.get("categoryId")||null,pendingProcessOrigin:o.Upload,origin:p.Lite,fileId:t.id,subtitleOptions:{subtitleExtractOptions:f.EmbeddedOnly},video:{name:e.get("name"),description:e.get("description")},autoCaption:!!i[d.E.AutoCaptioning].value},(function(t){e.set("pendingProcessId",t.pendingProcessId),n.pendingItemsService.forceFetchPendingItems({resetTimeout:!0})}))}))}))}))}},{key:"onSuccess",value:function(e,n){var o=this;P(t,"onSuccess",this,3)([e,n]);var r=this.getUpload(e);r.get("editingMetadata")?this.listenToOnce(r,"change:editingMetadata",(function(){o.completeUpload(r,n)})):this.completeUpload(r,n)}},{key:"getAdditionalFileInfo",value:function(e,t){var n=y.O.getCurrentRoute().appLink;return n.application!==b.O.MY_VIDEOS||n.action!==h.e.MyVideos.MY_VIDEOS_FOLDER?{}:{categoryId:+n.args[0]}}}])&&O(n.prototype,c),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,c}(s.BaseVideoUploadService)}}]);
2
- //# sourceMappingURL=3836-27a1870c7c-lite.chunk.js.map
1
+ "use strict";(self.webpackChunk_clickview_lite=self.webpackChunk_clickview_lite||[]).push([[3836,121],{86877:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(23481);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},r(e)}function i(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,a(o.key),o)}}function a(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(u=function(){return!!e})()}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}var s=function(e){function t(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=c(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,u()?Reflect.construct(t,n||[],c(e).constructor):t.apply(e,n))}(this,t,[e])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l(e,t)}(t,e),n=t,(a=[{key:"name",get:function(){return"FileTypeError"}},{key:"lang",get:function(){return"upload.fileType"}},{key:"dialogOptions",get:function(){return{title:o.T.getPhrase(this.lang,"heading"),text:o.T.getPhrase(this.lang,"body"),buttons:[{text:o.T.getPhrase(this.lang,"okay"),className:"btn btn-dark",success:!0},{text:o.T.getPhrase(this.lang,"close"),className:"btn btn-link",close:!0}]}}}])&&i(n.prototype,a),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,a}(n(47663).S)},90121:(e,t,n)=>{n.r(t),n.d(t,{BaseVideoUploadService:()=>fe,LearningResourceUploadService:()=>de,MixedMediaUploadService:()=>ye,SubtitleUploadService:()=>pe,UploadType:()=>ae});var o,r=n(48088),i=n(39479),a=n(46865),u=n(79976),c=n(37433),l=n(54149),s=n(71365),f=n(23481),p=n(70794),d=n(81886),y=n(49985),h=n(65858),g=n(29555);!function(e){e[e.Permanent=0]="Permanent",e[e.Temporary=1]="Temporary"}(o||(o={}));var b=n(86877),v=n(28046),m=n(52003),O=n(60735),w=n(53301),S=n.n(w),P=n(47663);function k(e){return k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},k(e)}function E(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,T(o.key),o)}}function T(e){var t=function(e){if("object"!=k(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=k(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==k(t)?t:t+""}function U(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(U=function(){return!!e})()}function j(e){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},j(e)}function _(e,t){return _=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_(e,t)}var I="upload.internetConnectivityError",L=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=j(t),function(e,t){if(t&&("object"==k(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,U()?Reflect.construct(t,n||[],j(e).constructor):t.apply(e,n))}(this,t,[f.T.getPhrase(I,"title")])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_(e,t)}(t,e),n=t,(o=[{key:"name",get:function(){return"InternetConnectivityError"}},{key:"dialogOptions",get:function(){return{title:f.T.getPhrase(I,"heading"),text:f.T.getPhrase(I,"body"),buttons:[{text:f.T.getPhrase(I,"okay"),className:"btn btn-outline-dark",success:!0}]}}}])&&E(n.prototype,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,o}(P.S),C=n(44331);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},D(e)}function x(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,R(o.key),o)}}function R(e){var t=function(e){if("object"!=D(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=D(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==D(t)?t:t+""}function A(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(A=function(){return!!e})()}function F(e){return F=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},F(e)}function M(e,t){return M=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},M(e,t)}var V="upload.slowInternetError",N=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=F(t),function(e,t){if(t&&("object"==D(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,A()?Reflect.construct(t,n||[],F(e).constructor):t.apply(e,n))}(this,t,[f.T.getPhrase(V,"title")])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&M(e,t)}(t,e),n=t,(o=[{key:"name",get:function(){return"SlowInternetError"}},{key:"dialogOptions",get:function(){return{title:f.T.getPhrase(V,"heading"),text:f.T.getPhrase(V,"body"),buttons:[{text:f.T.getPhrase(V,"okay"),className:"btn btn-outline-dark",success:!0}]}}}])&&x(n.prototype,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,o}(P.S);function z(e){return z="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},z(e)}function B(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,Q(o.key),o)}}function Q(e){var t=function(e){if("object"!=z(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=z(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==z(t)?t:t+""}function q(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(q=function(){return!!e})()}function Y(e){return Y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Y(e)}function W(e,t){return W=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},W(e,t)}var Z=[],K=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(e,t,n){return t=Y(t),function(e,t){if(t&&("object"==z(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,q()?Reflect.construct(t,n||[],Y(e).constructor):t.apply(e,n))}(this,t,[e])).slowInternetTimeout={},n.showSlowInternetTimeout=!0,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&W(e,t)}(t,e),n=t,o=[{key:"name",get:function(){return"DropzoneWrapper"}},{key:"initialize",value:function(e){var t=this.options.loggingEnabled,n=r.Radio.channel(e.channelName),o=this;this.dropzone=new(S())(document.createElement("div"),{url:function(e){return e[0].cvUpload.ingestUrl},chunking:this.options.chunkingEnabled,chunkSize:this.options.chunkSize,forceChunking:!0,autoProcessQueue:!0,maxFilesize:this.options.maxFileSize,acceptedFiles:this.options.acceptedFiles,paramName:"content",timeout:18e4,init:function(){var e=this;t&&(i.each(Z,(function(t){e.on(t,(function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];var r=n[0]instanceof File?n[0].name:n[0];console.info(t,r,n)}))})),this.on("uploadprogress",(function(e,t,r){var i=r/e.size*100;n.trigger("progress",o.getId(e),i,r)})),this.on("success",(function(e){var t=e.upload.chunks,o=i.last(t),r=o.xhr;r||(r=o.file.xhr);var a=JSON.parse(r.response);e.cvUpload.fileId=a.id,n.trigger(g.S.UPLOAD_SUCCESS,e,a)})),this.on("error",(function(e,t,n){n&&0===n.status?d.Q.Ry.throw(new L):"canceled"!==e.status&&d.Q.Ry.throw(new C.n(f.T.getPhrase("upload.services","uploadError",{fileName:e.name,message:t.message})))})),this.on("sending",(function(e){window.clearTimeout(o.slowInternetTimeout[e.path]),o.showSlowInternetTimeout&&(o.slowInternetTimeout[e.path]=window.setTimeout((function(){o.showSlowInternetTimeout&&d.Q.Ry.throw(new N),o.showSlowInternetTimeout=!1}),3e4))})),this.on("complete",(function(e){return window.clearTimeout(o.slowInternetTimeout[e.path])})))},params:function(e,t,n){if(n)return{chunk_index:n.index,upload_length:n.file.size}},addedfile:function(){},thumbnail:function(){},uploadprogress:function(){}})}},{key:"getId",value:function(e){return e.upload.uuid}},{key:"addFile",value:function(e){this.dropzone.addFile(e)}},{key:"removeFile",value:function(e){this.dropzone.removeFile(e)}},{key:"start",value:function(){this.dropzone.processQueue()}},{key:"destroy",value:function(){this.dropzone.destroy()}}],a=[{key:"isValidFile",value:function(e,t){return S().isValidFile(e,t)}}],o&&B(n.prototype,o),a&&B(n,a),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,o,a}(d.Q.t6);function X(e){return X="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},X(e)}function H(e,t,n){return(t=ee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function J(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function G(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,ee(o.key),o)}}function $(e,t,n){return t&&G(e.prototype,t),n&&G(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ee(e){var t=function(e){if("object"!=X(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=X(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==X(t)?t:t+""}function te(e,t,n){return t=oe(t),function(e,t){if(t&&("object"==X(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ne()?Reflect.construct(t,n||[],oe(e).constructor):t.apply(e,n))}function ne(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ne=function(){return!!e})()}function oe(e){return oe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},oe(e)}function re(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ie(e,t)}function ie(e,t){return ie=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ie(e,t)}var ae,ue=function(e){function t(){var e;return J(this,t),(e=te(this,t,[{dataProvider:s.u.getInstance(c.R.Ajax),cache:s.u.getInstance(a.p.Fifo),alertService:s.u.getInstance(u.P.ALERT)}])).incrementingUploadId=0,e}return re(t,e),$(t,[{key:"name",get:function(){return"UploadDataService"}},{key:"channelName",get:function(){return"private:upload:data:service"}},{key:"requestUploads",value:function(e,t,n,o,r){var a=this,u=this.chain();i.each(t,(function(t){a.incrementingUploadId++,u.create({resource:e,eventPrefix:"request:upload:".concat(a.incrementingUploadId),data:a.getFileUploadRequest(t,n),callback:function(e){o(t,e)},errorHandler:a.alertService.error("Something went wrong while we were uploading your video. Please try again.")})})),u.func((function(){r()})).run()}},{key:"cancelUpload",value:function(e,t,n){this.create({resource:"/api/upload/cancel",eventPrefix:"cancel:upload",data:{uploadId:e,ingestUrl:t},callback:n})}},{key:"getFileUploadRequest",value:function(e,t){var n=e.name.split(".");return{name:n.join("."),extension:n.length>1?n.pop():"",fileSize:e.size,fileLifestyle:t}}},{key:"onDestroy",value:function(){s.u.releaseInstance(c.R.Ajax).releaseInstance(a.p.Fifo)}}])}(l.B);!function(e){e[e.Video=0]="Video",e[e.LearningResource=1]="LearningResource",e[e.Subtitle=2]="Subtitle",e[e.MixedMedia=3]="MixedMedia"}(ae||(ae={}));var ce=H(H(H(H({},ae.Video,v.l.VIDEO),ae.LearningResource,v.l.RESOURCES),ae.Subtitle,v.l.SUBTITLES),ae.MixedMedia,v.l.MIXED_MEDIA),le=H(H(H(H({},ae.Video,m.Q4.VIDEO_UPLOAD),ae.LearningResource,m.Q4.RESOURCE_UPLOAD),ae.Subtitle,m.Q4.SUBTITLE_UPLOAD),ae.MixedMedia,m.Q4.MIXED_MEDIA_UPLOAD),se=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return J(this,t),te(this,t,[Object.assign({uploadUrl:"/api/upload"},e)])}return re(t,e),$(t,[{key:"initialize",value:function(){this.uploadDataService=new ue,this.progressViewModel=p.r.get("upload:progress:".concat(this.uploadType)),this.bindListeners()}},{key:"channelName",get:function(){return le[this.uploadType]}},{key:"lang",get:function(){return"uploadShared.services"}},{key:"initUploader",value:function(e,t){if(!this.uploader){var n=4194304;e&&n<e&&(n=e),t&&n>t&&(n=t),this.uploader=new K({chunkingEnabled:!0,loggingEnabled:!0,chunkSize:n,maxFileSize:53687091200,acceptedFiles:this.getAcceptedFiles(),channelName:this.channelName})}}},{key:"bindListeners",value:function(){this.listenTo(this.channelName,"progress",this.onProgress),this.listenTo(this.channelName,g.S.UPLOAD_SUCCESS,this.onSuccess)}},{key:"onProgress",value:function(e,t,n){var o=this.collection.get(e);o&&(o.set({progress:t>100?100:t,totalUploaded:n}),this.setOverallProgress())}},{key:"isUploading",value:function(){return!!this.getCollection().length}},{key:"getCollection",value:function(){return this.collection||(this.collection=new d.Q.FE),this.collection}},{key:"setOverallProgress",value:function(){var e=this,t=0,n=0,o=this.getCollection();if(o.length){o.each((function(e){t+=e.get("totalUploaded")||0,n+=e.get("file").size||0}));var r=t/n*100,i=r>=100,a=function(){e.progressViewModel.set({progress:i?100:r,done:i})};i?window.setTimeout(a,2e3):a()}else this.progressViewModel.set({progress:0})}},{key:"isValidFile",value:function(e){return K.isValidFile(e,this.getAcceptedFiles())}},{key:"addFiles",value:function(e,t){var n=this;i.any(e,(function(e){return!n.isValidFile(e)}))?d.Q.Ry.throw(new b.Z(f.T.getPhrase(this.lang,"invalidFileType"))):this.requestUploads(e,t)}},{key:"requestUploads",value:function(e,t){var n=this,o=this.isUploading(),i=this.getCollection();this.uploadDataService.requestUploads(this.options.uploadUrl,e,this.fileLifestyle,(function(e,t){"minChunkSize"in t||"maxChunkSize"in t?n.initUploader(1024*t.minChunkSize,1024*t.maxChunkSize):n.initUploader(t.minChunkLength,t.maxChunkLength),e.cvUpload={uploadId:t.uploadId,ingestUrl:t.ingestUrl},n.uploader.addFile(e);var o=e.name;n.uploadType===ae.Video&&(o=o.replace(/\.[^/.]+$/,"")),i.add(Object.assign({id:n.uploader.getId(e),file:e,name:o},n.getAdditionalFileInfo(e,t)),{at:i.length-1})}),(function(){t&&y.k.logUserAction({uploadCount:e.length},t),r.Radio.channel(n.channelName).trigger(g.S.FILES_ADDED,e,o)}))}},{key:"addFile",value:function(e,t){this.addFiles([e],t)}},{key:"cancelUpload",value:function(e){var t=this,n=this.getCollection(),o=n.get(e);if(o){var i=o.get("file");this.uploader.removeFile(i),n.remove(o),this.uploadDataService.cancelUpload(i.cvUpload.uploadId,i.cvUpload.ingestUrl,(function(){y.k.logUserAction(o.toJSON(),{entity:h.py.Video,actionType:h.Vw.Upload,workflowPhase:h.eu.Discard,descriptor:h.yh.Single,location:h.LZ.MyUploads}),r.Radio.channel(t.channelName).trigger(g.S.UPLOAD_CANCELLED)})),this.setOverallProgress()}}},{key:"onSuccess",value:function(e,t){var n=this.uploader.getId(e),o=this.getCollection().get(n);o.set("fileInfo",t),y.k.logUserAction({id:e.cvUpload.uploadId},{entity:h.py.Video,actionType:h.Vw.Upload,workflowPhase:h.eu.Complete,descriptor:h.yh.Single,location:h.LZ.VideoUpload}),r.Radio.channel(this.channelName).trigger(g.S.UPLOAD_COMPLETE,o)}},{key:"cancelAllUploads",value:function(){var e=this,t=this.getCollection().map((function(e){return e.get("id")}));i.each(t,(function(t){return e.cancelUpload(t)}))}},{key:"getUpload",value:function(e){var t=this.uploader.getId(e);return this.getCollection().get(t)}},{key:"getAcceptedFiles",value:function(){return ce[this.uploadType]}},{key:"getAdditionalFileInfo",value:function(e,t){return{}}}])}(d.Q.t6),fe=function(e){function t(){return J(this,t),te(this,t,arguments)}return re(t,e),$(t,[{key:"uploadType",get:function(){return ae.Video}},{key:"name",get:function(){return O.D.VideoUpload}},{key:"fileLifestyle",get:function(){return o.Temporary}}])}(se),pe=function(e){function t(){return J(this,t),te(this,t,arguments)}return re(t,e),$(t,[{key:"uploadType",get:function(){return ae.Subtitle}},{key:"name",get:function(){return O.D.SubtitleUpload}},{key:"fileLifestyle",get:function(){return o.Permanent}}])}(se),de=function(e){function t(){return J(this,t),te(this,t,arguments)}return re(t,e),$(t,[{key:"uploadType",get:function(){return ae.LearningResource}},{key:"name",get:function(){return O.D.ResourceUpload}},{key:"fileLifestyle",get:function(){return o.Permanent}}])}(se),ye=function(e){function t(){return J(this,t),te(this,t,arguments)}return re(t,e),$(t,[{key:"uploadType",get:function(){return ae.MixedMedia}},{key:"name",get:function(){return O.D.MixedMediaUpload}},{key:"fileLifestyle",get:function(){return o.Temporary}}])}(se)},28046:(e,t,n)=>{n.d(t,{l:()=>d,v:()=>y});var o=n(39479),r=["pdf"],i=["doc","docx","dotx","dot","rtf","docm","odt"],a=["csv","txt"],u=["xls","xlt","xlsx"],c=["jpg","tif","png","bmp","gif","jpeg"],l="video/*",s=["zip","rar"],f=["ppt","pot","pps","pptx"],p=["srt"],d={IMAGES:".".concat(c.join(",.")),VIDEO:l,MIXED_MEDIA:".".concat(c.join(",."),",").concat(l),RESOURCES:".".concat([].concat(i,u,f,r,a,c,s).join(",.")),SUBTITLES:".".concat(p.join(",."))},y={getResourceType:function(e){var t=e.toLowerCase();return o.contains(i,t)?"document":o.contains(u,t)?"excel":o.contains(f,t)?"powerpoint":o.contains(r,t)?"pdf":o.contains(a,t)?"text":o.contains(c,t)?"image":o.contains(s,t)?"archive":o.contains(p,t)?"subtitle":""}}},3836:(e,t,n)=>{n.r(t),n.d(t,{VideoUploadService:()=>j});var o,r=n(48088),i=n(79976),a=n(60139),u=n(71365),c=n(23481),l=n(29555),s=n(90121);!function(e){e[e.Upload=1]="Upload",e[e.Tv=2]="Tv"}(o||(o={}));var f,p,d=n(65728);!function(e){e[e.ExternalOnly=0]="ExternalOnly",e[e.EmbeddedOnly=1]="EmbeddedOnly"}(f||(f={})),function(e){e[e.IosApp=1]="IosApp",e[e.AndroidApp=2]="AndroidApp",e[e.WinApp=3]="WinApp",e[e.LibraryPublisher=4]="LibraryPublisher",e[e.ExchangeClient=5]="ExchangeClient",e[e.Online=6]="Online",e[e.Tinder=7]="Tinder",e[e.Cloud247=8]="Cloud247",e[e.Livestream=9]="Livestream",e[e.Curator=10]="Curator",e[e.LibraryEditor=11]="LibraryEditor",e[e.Lite=12]="Lite"}(p||(p={}));var y=n(75795),h=n(14070),g=n(97291),b=n(57322),v=n(16800);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},m(e)}function O(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,w(o.key),o)}}function w(e){var t=function(e){if("object"!=m(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=m(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==m(t)?t:t+""}function S(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(S=function(){return!!e})()}function P(e,t,n,o){var r=k(E(1&o?e.prototype:e),t,n);return 2&o&&"function"==typeof r?function(e){return r.apply(n,e)}:r}function k(){return k="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var o=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=E(e)););return e}(e,t);if(o){var r=Object.getOwnPropertyDescriptor(o,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},k.apply(null,arguments)}function E(e){return E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},E(e)}function T(e,t){return T=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},T(e,t)}var U=c.T.encloseNamespace("upload.services"),j=function(e){function t(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=E(t),function(e,t){if(t&&("object"==m(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,S()?Reflect.construct(t,n||[],E(e).constructor):t.apply(e,n))}(this,t,[e])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&T(e,t)}(t,e),n=t,(c=[{key:"initialize",value:function(){P(t,"initialize",this,3)([]),this.videoUploadDataService=u.u.getInstance(b.O.VideoUpload,this),this.pendingItemsService=u.u.getInstance(b.K.PendingItems,this),this.userDataService=u.u.getInstance(b.O.FlightUser,this),this.alertService=u.u.getInstance(i.P.ALERT,this),this.listenTo(this.channelName,l.S.FILES_ADDED,this.onUploadStart),this.listenTo(this.channelName,l.S.UPLOAD_COMPLETE,this.unlockNav),this.listenTo(this.channelName,l.S.UPLOAD_CANCELLED,this.unlockNav)}},{key:"onUploadStart",value:function(e){var t={type:a.NK.Success,heading:U("startUploadAlertHeading"),message:1===e.length?U("startUploadSingleAlertBody",{videoName:e[0].name}):U("startUploadMultipleAlertBody",{uploadCount:e.length})},n=y.O.getCurrentContext().appLink;!!v.Y.getMyVideosAppLinks().find((function(e){return n.application===e.application&&n.action===e.action}))||(t.appLinkText=U("startUploadAlertAppLinkText",{smartCount:e.length}),t.appLink={application:g.O.MY_VIDEOS,action:h.e.MyVideos.MY_VIDEOS},t.appLinkClassName="info-link"),this.alertService.createAlert(t)}},{key:"unlockNav",value:function(){this.getCollection().some((function(e){return e.get("progress")<100}))||r.Radio.channel(this.channelName).trigger(l.S.UNLOCK_NAV)}},{key:"completeUpload",value:function(e,t){var n=this;e.set("sending",!0),this.userDataService.getCurrentUser((function(r){n.userDataService.getCustomerSettings(r.customerId,(function(i){n.userDataService.getWorkspace((function(a){n.videoUploadDataService.completeVideoUpload({id:e.get("id"),userId:r.id,customerId:r.customerId,libraryId:a.id,categoryId:e.get("categoryId")||null,pendingProcessOrigin:o.Upload,origin:p.Lite,fileId:t.id,subtitleOptions:{subtitleExtractOptions:f.EmbeddedOnly},video:{name:e.get("name"),description:e.get("description")},autoCaption:!!i[d.E.AutoCaptioning].value},(function(t){e.set("pendingProcessId",t.pendingProcessId),n.pendingItemsService.forceFetchPendingItems({resetTimeout:!0})}))}))}))}))}},{key:"onSuccess",value:function(e,n){var o=this;P(t,"onSuccess",this,3)([e,n]);var r=this.getUpload(e);r.get("editingMetadata")?this.listenToOnce(r,"change:editingMetadata",(function(){o.completeUpload(r,n)})):this.completeUpload(r,n)}},{key:"getAdditionalFileInfo",value:function(e,t){var n=y.O.getCurrentRoute().appLink;return n.application!==g.O.MY_VIDEOS||n.action!==h.e.MyVideos.MY_VIDEOS_FOLDER?{}:{categoryId:+n.args[0]}}}])&&O(n.prototype,c),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,c}(s.BaseVideoUploadService)}}]);
2
+ //# sourceMappingURL=3836-7fe81289f4-lite.chunk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scripts/3836-7fe81289f4-lite.chunk.js","mappings":"4sCAYO,IAAMA,EAAc,YACzB,WAAYC,GAAe,O,4FAAA,S,qYAAA,SACnBA,GACR,CAEA,O,qRAAA,M,EAAA,G,EAAA,iBACA,WACE,MAAO,eACT,GAEA,gBACA,WACE,MAAO,iBACT,GAEA,yBACA,WACE,MAAO,CACLC,MAAO,cAA0BC,KAAKC,KAAM,WAC5CC,KAAM,cAA0BF,KAAKC,KAAM,QAC3CE,QAAS,CAAC,CACRD,KAAM,cAA0BF,KAAKC,KAAM,QAC3CG,UAAW,eACXC,SAAS,GACR,CACDH,KAAM,cAA0BF,KAAKC,KAAM,SAC3CG,UAAW,eACXE,OAAO,IAGb,M,6EAAC,CA9BwB,C,SAAQ,E,uLCZvBC,E,gJAAZ,SAAYA,GACV,6BACA,4BACD,CAHD,CAAYA,IAAAA,EAAa,K,ooCCKzB,IAAMN,EAAO,mCAEAO,EAA0B,YACrC,oB,4FAAA,S,qYAAA,SACQC,EAAA,YAA0BR,EAAM,UACxC,CAEA,O,qRAAA,M,EAAA,G,EAAA,iBACA,WACE,MAAO,2BACT,GAEA,yBACA,WACE,MAAO,CACLF,MAAOU,EAAA,YAA0BR,EAAM,WACvCC,KAAMO,EAAA,YAA0BR,EAAM,QACtCE,QAAS,CAAC,CACRD,KAAMO,EAAA,YAA0BR,EAAM,QACtCG,UAAW,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AAQI,cAAgB,eAAyBJ,EAAQK,SAAW,8BAC/D,CAAC,EAEH,CACLgB,YAAarB,EAAQhL,KAAK,GAE9B,M,6EAAC,CA1H6B,CAAQ,EAAAqI,uB","sources":["file:///app/packages/libs/shared/src/apps/upload/errors/file-type/FileTypeError.ts","file:///app/packages/libs/shared/src/apps/upload/enums/FileLifestyle.ts","file:///app/packages/libs/shared/src/apps/upload/errors/internet-connectivity/InternetConnectivityError.ts","file:///app/packages/libs/shared/src/apps/upload/errors/slow-internet/SlowInternetError.ts","file:///app/packages/libs/shared/src/apps/upload/services/DropzoneWrapper.ts","file:///app/packages/libs/shared/src/apps/upload/services/UploadService.ts","file:///app/packages/libs/shared/src/apps/upload/utils/FileExtensionsHelper.ts","file:///app/packages/libs/shared/src/enums/PendingProcessOrigin.ts","file:///app/packages/libs/shared/src/enums/SubtitleExtractionOptions.ts","file:///app/packages/libs/shared/src/enums/VideoOrigin.ts","file:///app/packages/projects/lite/src/apps/upload/services/VideoUploadService.ts"],"sourcesContent":["import { LanguageService } from 'libs/common/backbone/services/LanguageService';\n\nimport { DialogError } from 'libs/shared/errors/primitives/DialogError';\nimport { DialogOptions } from 'libs/shared/interfaces';\n\n/**\n * TODO: Create a more useful message here.\n * Perhaps using the mime types listen on MDN\n * https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Complete_list_of_MIME_types\n * or in the list of all the official mime types\n * https://www.iana.org/assignments/media-types/media-types.xhtml\n */\nexport class FileTypeError extends DialogError {\n constructor(message: string) {\n super(message);\n }\n\n // @ts-ignore\n public get name(): string {\n return 'FileTypeError';\n }\n\n // @ts-ignore\n public get lang(): string {\n return 'upload.fileType';\n }\n\n // @ts-ignore\n public get dialogOptions(): DialogOptions {\n return {\n title: LanguageService.getPhrase(this.lang, 'heading'),\n text: LanguageService.getPhrase(this.lang, 'body'),\n buttons: [{\n text: LanguageService.getPhrase(this.lang, 'okay'),\n className: 'btn btn-dark',\n success: true\n }, {\n text: LanguageService.getPhrase(this.lang, 'close'),\n className: 'btn btn-link',\n close: true\n }]\n };\n }\n}","export enum FileLifestyle {\n Permanent = 0,\n Temporary = 1\n}","import { LanguageService } from 'libs/common/backbone/services/LanguageService';\n\nimport { DialogError } from 'libs/shared/errors/primitives/DialogError';\nimport { DialogOptions } from 'libs/shared/interfaces';\n\nconst lang = 'upload.internetConnectivityError';\n\nexport class InternetConnectivityError extends DialogError {\n constructor() {\n super(LanguageService.getPhrase(lang, 'title'));\n }\n\n // @ts-ignore\n public get name(): string {\n return 'InternetConnectivityError';\n }\n\n // @ts-ignore\n public get dialogOptions(): DialogOptions {\n return {\n title: LanguageService.getPhrase(lang, 'heading'),\n text: LanguageService.getPhrase(lang, 'body'),\n buttons: [{\n text: LanguageService.getPhrase(lang, 'okay'),\n className: 'btn btn-outline-dark',\n success: true\n }]\n };\n }\n}","import { LanguageService } from 'libs/common/backbone/services/LanguageService';\n\nimport { DialogError } from 'libs/shared/errors/primitives/DialogError';\nimport { DialogOptions } from 'libs/shared/interfaces';\n\nconst lang = 'upload.slowInternetError';\n\nexport class SlowInternetError extends DialogError {\n constructor() {\n super(LanguageService.getPhrase(lang, 'title'));\n }\n\n // @ts-ignore\n public get name(): string {\n return 'SlowInternetError';\n }\n\n // @ts-ignore\n public get dialogOptions(): DialogOptions {\n return {\n title: LanguageService.getPhrase(lang, 'heading'),\n text: LanguageService.getPhrase(lang, 'body'),\n buttons: [{\n text: LanguageService.getPhrase(lang, 'okay'),\n className: 'btn btn-outline-dark',\n success: true\n }]\n };\n }\n}","import { ObjectHash, Radio } from 'backbone';\nimport Dropzone from 'dropzone';\nimport * as _ from 'underscore';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { Core } from 'libs/common/core';\n\nimport { InternetConnectivityError } from 'libs/shared/apps/upload/errors/internet-connectivity/InternetConnectivityError';\nimport { AlertError } from 'libs/shared/errors/primitives/AlertError';\n\nimport { UploadEventNames } from '../constants/UploadConstants';\nimport { SlowInternetError } from '../errors/slow-internet/SlowInternetError';\n\nexport interface UploadApiWrapperOptions extends Core.ServiceOptions {\n maxFileSize: number;\n chunkSize: number;\n chunkingEnabled: boolean;\n loggingEnabled: boolean;\n acceptedFiles: string;\n channelName: string;\n}\n\nexport interface UploadApiWrapper {\n addFile(file: File): void;\n destroy(): void;\n start(): void;\n getId(file: File): string;\n removeFile(file: File): void;\n}\n\nconst dropzoneEvents: string[] = [\n // 'uploadprogress', 'totaluploadprogress',\n // 'addedfile', 'removedfile', 'thumbnail', 'error', 'processing',\n // 'sending', 'success', 'complete', 'addedfile',\n // 'maxfilesreached', 'maxfilesexceeded', 'processingmultiple',\n // 'sendingmultiple', 'completemultiple', 'canceledmultiple',\n // 'reset', 'queuecomplete'\n];\n\nexport class DropzoneWrapper extends Core.Service implements UploadApiWrapper {\n private dropzone: Dropzone;\n public options: UploadApiWrapperOptions;\n\n private slowInternetTimeout: {[uploadId: string]: number} = {};\n private showSlowInternetTimeout: boolean = true;\n\n // @ts-ignore\n public get name(): string {\n return 'DropzoneWrapper';\n }\n\n constructor(options: UploadApiWrapperOptions) {\n super(options);\n }\n\n public initialize(options: UploadApiWrapperOptions): void {\n const { loggingEnabled } = this.options;\n\n const uploadChannel = Radio.channel(options.channelName);\n\n /**\n * Thought I wouldn't see this in any of our TS\n * Guess I was wrong - sha\n */\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const self = this;\n\n this.dropzone = new Dropzone(document.createElement('div'), {\n url: ((files: Dropzone.DropzoneFile[]) => {\n const file = files[0] as any;\n\n const { ingestUrl } = file.cvUpload;\n\n return ingestUrl;\n }) as any,\n\n chunking: this.options.chunkingEnabled,\n chunkSize: this.options.chunkSize,\n forceChunking: true,\n autoProcessQueue: true,\n maxFilesize: this.options.maxFileSize,\n acceptedFiles: this.options.acceptedFiles,\n paramName: 'content',\n timeout: 180000, // 3 mins in milliseconds\n\n init: function (): void {\n if (!loggingEnabled)\n return;\n\n _.each(dropzoneEvents, (eventName: string) => {\n this.on(eventName, (...args: any[]) => {\n const file = args[0] instanceof File ? args[0].name : args[0];\n console.info(eventName, file, args);\n });\n });\n\n this.on('uploadprogress', (file: File, percentage: number, totalBytes: number) => {\n const progress = totalBytes / file.size * 100;\n uploadChannel.trigger('progress', self.getId(file), progress, totalBytes);\n });\n\n this.on('success', (file: File) => {\n /**\n * This is sort of a hack. It assumes the last chunk will be the last chunk that is uploaded\n * which may not necessarily be the case\n */\n const chunks = (file as any).upload.chunks;\n\n const lastChunk = _.last(chunks) as any;\n\n let xhr = lastChunk.xhr;\n\n if (!xhr)\n xhr = lastChunk.file.xhr;\n\n const response = JSON.parse(xhr.response);\n\n (file as any).cvUpload.fileId = response.id;\n\n uploadChannel.trigger(UploadEventNames.UPLOAD_SUCCESS, file, response);\n });\n\n this.on('error', (file: File, messageObj: ObjectHash, xhr: XMLHttpRequest) => {\n if (xhr && xhr.status === 0) {\n Core.ErrorHelper.throw(new InternetConnectivityError());\n return;\n }\n\n /**\n * Don't throw if the error was caused by canceling\n * the chunk upload. this will happen when the user cancels\n * an upload themselves.\n */\n if ((file as Dropzone.DropzoneFile).status !== 'canceled')\n Core.ErrorHelper.throw(\n new AlertError(LanguageService.getPhrase('upload.services', 'uploadError', {\n fileName: file.name,\n message: messageObj.message\n }))\n );\n });\n\n /**\n * We've increased the upload timeout from 30s to 3mins. This means that the upload\n * will not timeout with an upload speed as slow as 200Kbps. However if a single chunk takes\n * longer than 30s, which is an upload speed of 1Mbps. We'll show a dialog letting the user\n * know that their internet speed is very slow, and the upload may take quite some time.\n * - Sha\n */\n this.on('sending', (file: File) => {\n window.clearTimeout(self.slowInternetTimeout[(file as any).path]);\n\n if (!self.showSlowInternetTimeout)\n return;\n\n self.slowInternetTimeout[(file as any).path] = window.setTimeout(() => {\n if (self.showSlowInternetTimeout)\n Core.ErrorHelper.throw(new SlowInternetError());\n\n self.showSlowInternetTimeout = false;\n }, 30000); // 30s\n });\n\n /**\n * Complete will trigger both on successful uploads and on a cancelled upload.\n */\n this.on('complete', (file: File) => window.clearTimeout(self.slowInternetTimeout[(file as any).path]));\n },\n\n params: (files: Dropzone.DropzoneFile[], xhr: XMLHttpRequest, chunk: any) => {\n if (!chunk)\n return;\n\n return {\n chunk_index: chunk.index,\n upload_length: chunk.file.size\n };\n },\n\n /**\n * These methods are here to disable Dropzone's UI related features\n */\n addedfile: () => {},\n thumbnail: () => {},\n uploadprogress: () => {}\n });\n }\n\n public getId(file: File): string {\n return (file as any).upload.uuid;\n }\n\n public addFile(file: Dropzone.DropzoneFile): void {\n this.dropzone.addFile(file);\n }\n\n public removeFile(file: Dropzone.DropzoneFile): void {\n this.dropzone.removeFile(file);\n }\n\n public start(): void {\n this.dropzone.processQueue();\n }\n\n public destroy(): void {\n this.dropzone.destroy();\n }\n\n public static isValidFile(file: File, acceptedFiles: string): boolean {\n return Dropzone.isValidFile(file, acceptedFiles);\n }\n}","import { Radio } from 'backbone';\nimport * as _ from 'underscore';\n\nimport { Caches } from 'libs/common/backbone/constants/Caches';\nimport { CommonServices } from 'libs/common/backbone/constants/CommonServices';\nimport { DataProviders } from 'libs/common/backbone/constants/DataProviders';\nimport { BaseDataService } from 'libs/common/backbone/services/BaseDataService';\nimport { InstanceManager } from 'libs/common/backbone/services/InstanceManager';\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { ViewModelService } from 'libs/common/backbone/services/ViewModelService';\nimport { Core } from 'libs/common/core';\nimport { HashObject } from 'libs/common/react/interfaces/HashObject';\n\nimport { AnalyticsHelper } from 'libs/analytics/AnalyticsHelper';\nimport { AnalyticsOptions, EntityType, LocationContext, OperationDescriptor, UserAction, WorkflowPhase } from 'libs/analytics/interfaces';\n\nimport { UploadEventNames } from 'libs/shared/apps/upload/constants/UploadConstants';\nimport { FileLifestyle } from 'libs/shared/apps/upload/enums/FileLifestyle';\nimport { FileTypeError } from 'libs/shared/apps/upload/errors/file-type/FileTypeError';\nimport { FileExtensions } from 'libs/shared/apps/upload/utils/FileExtensionsHelper';\nimport { SharedServiceChannels } from 'libs/shared/constants/RadioChannels';\nimport { SharedServices } from 'libs/shared/constants/SharedServices';\n\nimport { DropzoneWrapper, UploadApiWrapper } from './DropzoneWrapper';\n\n/**\n * This data service is locally private and is only\n * used by the UploadService to request/cancel uploads from\n * FileApi\n */\nclass UploadDataService extends BaseDataService {\n constructor() {\n super({\n dataProvider: InstanceManager.getInstance(DataProviders.Ajax),\n cache: InstanceManager.getInstance(Caches.Fifo),\n alertService: InstanceManager.getInstance(CommonServices.ALERT)\n });\n }\n\n private incrementingUploadId: number = 0;\n\n // @ts-ignore\n public get name(): string {\n /**\n * This string is not in DataServices because this data service is private.\n */\n return 'UploadDataService';\n }\n\n /**\n * This is not sitting in RadioChannels\n * because it is only used in this file\n */\n // @ts-ignore\n public get channelName(): string {\n return 'private:upload:data:service';\n }\n\n public requestUploads(\n resource: string,\n files: File[],\n fileLifestyle: FileLifestyle,\n fileCallback: (file: File, response: any) => void,\n callback: () => void\n ): void {\n const chain = this.chain();\n\n _.each(files, file => {\n this.incrementingUploadId++;\n\n chain.create({\n resource,\n eventPrefix: `request:upload:${this.incrementingUploadId}`,\n data: this.getFileUploadRequest(file, fileLifestyle),\n callback: (response: any) => {\n fileCallback(file, response);\n },\n errorHandler: this.alertService.error(`Something went wrong while we were uploading your video. Please try again.`)\n });\n });\n\n chain.func(() => {\n callback();\n }).run();\n }\n\n public cancelUpload(uploadId: string, ingestUrl: string, callback?: (response: any) => void): void {\n this.create({\n resource: '/api/upload/cancel',\n eventPrefix: 'cancel:upload',\n data: {\n uploadId, ingestUrl\n },\n callback\n });\n }\n\n private getFileUploadRequest(file: File, fileLifestyle: FileLifestyle): HashObject {\n const splitName = file.name.split('.');\n\n /**\n * TODO: We may need to set the file permanence in file api to\n * permanent for resources and subtitles\n * Check what Prad/Cam say in\n * https://app.asana.com/0/720933954350984/735809491718142\n */\n return {\n name: splitName.join('.'),\n extension: splitName.length > 1 ? splitName.pop() : '',\n fileSize: file.size,\n fileLifestyle\n };\n }\n\n public onDestroy(): void {\n InstanceManager\n .releaseInstance(DataProviders.Ajax)\n .releaseInstance(Caches.Fifo);\n }\n}\n\n\nexport interface UploadItem extends Core.Model {\n file: File;\n name: string;\n progress: number;\n}\n\nexport enum UploadType {\n Video,\n LearningResource,\n Subtitle,\n MixedMedia\n}\n\nconst AcceptedFiles = {\n [UploadType.Video]: FileExtensions.VIDEO,\n [UploadType.LearningResource]: FileExtensions.RESOURCES,\n [UploadType.Subtitle]: FileExtensions.SUBTITLES,\n [UploadType.MixedMedia]: FileExtensions.MIXED_MEDIA\n};\n\nconst ChannelNames = {\n [UploadType.Video]: SharedServiceChannels.VIDEO_UPLOAD,\n [UploadType.LearningResource]: SharedServiceChannels.RESOURCE_UPLOAD,\n [UploadType.Subtitle]: SharedServiceChannels.SUBTITLE_UPLOAD,\n [UploadType.MixedMedia]: SharedServiceChannels.MIXED_MEDIA_UPLOAD\n};\n\nconst CHUNK_SIZE = 1024 * 1024 * 4; // 4mb\nconst MAX_FILE_SIZE = 1024 * 1024 * 1024 * 50; // 50gb\n\nexport interface UploadServiceOptions {\n uploadUrl?: string;\n}\n\nclass UploadService extends Core.Service {\n protected options: UploadServiceOptions;\n protected uploadType: UploadType;\n protected fileLifestyle: FileLifestyle;\n\n /**\n *\n */\n constructor(options: UploadServiceOptions = {}) {\n super({\n uploadUrl: '/api/upload',\n ...options\n });\n }\n\n protected uploader: UploadApiWrapper;\n\n private progressViewModel: Core.Model;\n\n private uploadDataService: UploadDataService;\n\n private collection: Core.Collection<UploadItem>;\n\n public initialize(): void {\n this.uploadDataService = new UploadDataService();\n\n this.progressViewModel = ViewModelService.get(`upload:progress:${this.uploadType}`);\n\n this.bindListeners();\n }\n\n // @ts-ignore\n public get channelName(): string {\n return ChannelNames[this.uploadType];\n }\n\n // @ts-ignore\n public get lang(): string {\n return 'uploadShared.services';\n }\n\n /**\n * Dropzone is initialized once after the first upload is requested and it's chunk size\n * is set for the rest of the uploads. If we happen to have multiple ingest\n * servers that have different chunk max / min sizes, this may voilate those\n * sizes.\n */\n private initUploader(minChunkSize: number, maxChunkSize: number): void {\n if (this.uploader)\n return;\n\n let chunkSize = CHUNK_SIZE;\n\n if (minChunkSize && chunkSize < minChunkSize)\n chunkSize = minChunkSize;\n\n if (maxChunkSize && chunkSize > maxChunkSize)\n chunkSize = maxChunkSize;\n\n this.uploader = new DropzoneWrapper({\n chunkingEnabled: true,\n loggingEnabled: true,\n chunkSize,\n maxFileSize: MAX_FILE_SIZE,\n acceptedFiles: this.getAcceptedFiles(),\n channelName: this.channelName\n });\n }\n\n private bindListeners(): void {\n this.listenTo(this.channelName, 'progress', this.onProgress);\n\n this.listenTo(this.channelName, UploadEventNames.UPLOAD_SUCCESS, this.onSuccess);\n }\n\n private onProgress(id: string, percentage: number, totalUploaded: number): void {\n const model = this.collection.get(id);\n\n if (!model)\n return;\n\n model.set({\n progress: percentage > 100 ? 100 : percentage,\n totalUploaded\n });\n\n this.setOverallProgress();\n }\n\n public isUploading(): boolean {\n return !!this.getCollection().length;\n }\n\n public getCollection(): Core.Collection<UploadItem> {\n if (this.collection)\n return this.collection;\n\n this.collection = new Core.Collection<UploadItem>();\n return this.collection;\n }\n\n public setOverallProgress(): void {\n let totalUploaded = 0;\n let totalFileSize = 0;\n\n const collection = this.getCollection();\n\n if (!collection.length) {\n this.progressViewModel.set({ progress: 0 });\n return;\n }\n\n collection.each((model: Core.Model) => {\n totalUploaded += model.get('totalUploaded') || 0;\n totalFileSize += model.get('file').size || 0;\n });\n\n const percentage = totalUploaded / totalFileSize * 100;\n\n const done = percentage >= 100;\n\n const updateProgress = () => {\n this.progressViewModel.set({\n progress: done ? 100 : percentage,\n done\n });\n };\n\n if (!done) {\n updateProgress();\n return;\n }\n \n /**\n * The ingest backend takes a short while after an upload is done\n * before the complete endpoint will actually response successfully.\n * So this prevents the eager beavers from clicking \"finish\" immediately\n * and having their entire upload session break.\n * - Sha\n */\n window.setTimeout(updateProgress, 2000);\n }\n\n public isValidFile(file: File): boolean {\n return DropzoneWrapper.isValidFile(file, this.getAcceptedFiles());\n }\n\n /**\n * Request uploads from fileApi and starts uploading.\n * @param files Array of browser File objects\n * @returns Returns false if any of the files did not match the accepted file list.\n */\n public addFiles(files: File[], analyticsOptions?: AnalyticsOptions): void {\n if (_.any(files, file => !this.isValidFile(file))) {\n Core.ErrorHelper.throw(\n new FileTypeError(LanguageService.getPhrase(this.lang, 'invalidFileType'))\n );\n return;\n }\n\n this.requestUploads(files, analyticsOptions);\n }\n\n private requestUploads(files: File[], analyticsOptions?: AnalyticsOptions): void {\n const wasUploading = this.isUploading();\n\n const collection = this.getCollection();\n\n const fileCallback = (file: File, response: any) => {\n /**\n * minChunkSize and maxChunkSize have been deprecated.\n * Remove once Lite and Library Editor has been updated\n * to use the new fields minChunkLength and maxChunkLength.\n */\n if ('minChunkSize' in response || 'maxChunkSize' in response) {\n this.initUploader(response.minChunkSize * 1024, response.maxChunkSize * 1024);\n } else {\n this.initUploader(response.minChunkLength, response.maxChunkLength);\n }\n\n (file as any).cvUpload = {\n uploadId: response.uploadId,\n ingestUrl: response.ingestUrl\n };\n\n this.uploader.addFile(file);\n\n let fileName = file.name;\n\n // Remove file extension from filename if video\n if (this.uploadType === UploadType.Video)\n fileName = fileName.replace(/\\.[^/.]+$/, '');\n\n collection.add({\n id: this.uploader.getId(file),\n file,\n name: fileName,\n ...this.getAdditionalFileInfo(file, response)\n }, { at: collection.length - 1 });\n };\n\n const callback = () => {\n if (analyticsOptions) {\n AnalyticsHelper.logUserAction({\n uploadCount: files.length\n }, analyticsOptions);\n }\n\n const channel = Radio.channel(this.channelName);\n channel.trigger(UploadEventNames.FILES_ADDED, files, wasUploading);\n };\n\n this.uploadDataService.requestUploads(\n this.options.uploadUrl,\n files,\n this.fileLifestyle,\n fileCallback,\n callback\n );\n }\n\n public addFile(file: File, analyticsOptions: AnalyticsOptions): void {\n this.addFiles([file], analyticsOptions);\n }\n\n public cancelUpload(id: string): void {\n const collection = this.getCollection();\n const model = collection.get(id);\n\n if (!model)\n return;\n\n const file = model.get('file') as any;\n\n this.uploader.removeFile(file);\n collection.remove(model);\n\n this.uploadDataService.cancelUpload(file.cvUpload.uploadId, file.cvUpload.ingestUrl, () => {\n AnalyticsHelper.logUserAction(model.toJSON(), {\n entity: EntityType.Video,\n actionType: UserAction.Upload,\n workflowPhase: WorkflowPhase.Discard,\n descriptor: OperationDescriptor.Single,\n location: LocationContext.MyUploads\n });\n\n Radio.channel(this.channelName).trigger(UploadEventNames.UPLOAD_CANCELLED);\n });\n\n this.setOverallProgress();\n }\n\n protected onSuccess(file: File, response: any): void {\n const fileId = this.uploader.getId(file);\n\n const upload = this.getCollection().get(fileId);\n\n upload.set('fileInfo', response);\n\n AnalyticsHelper.logUserAction({\n id: (file as any).cvUpload.uploadId\n }, {\n entity: EntityType.Video,\n actionType: UserAction.Upload,\n workflowPhase: WorkflowPhase.Complete,\n descriptor: OperationDescriptor.Single,\n location: LocationContext.VideoUpload\n });\n\n const channel = Radio.channel(this.channelName);\n channel.trigger(UploadEventNames.UPLOAD_COMPLETE, upload);\n }\n\n public cancelAllUploads(): void {\n /**\n * We're using model ids and _.each\n * instead of collection.each because this.cancelUpload\n * removes items from the collection which breaks collection.each\n */\n const models = this.getCollection().map(m => m.get('id'));\n _.each(models, m => this.cancelUpload(m));\n }\n\n public getUpload(file: File): Core.Model {\n const fileId = this.uploader.getId(file);\n\n return this.getCollection().get(fileId);\n }\n\n protected getAcceptedFiles(): string {\n return AcceptedFiles[this.uploadType];\n }\n\n // eslint-disable-next-line\n protected getAdditionalFileInfo(file: File, response: any): HashObject {\n return {};\n }\n}\n\nexport class BaseVideoUploadService extends UploadService {\n // @ts-ignore\n protected get uploadType(): UploadType {\n return UploadType.Video;\n }\n\n // @ts-ignore\n public get name(): string {\n return SharedServices.VideoUpload;\n }\n\n // @ts-ignore\n public get fileLifestyle(): FileLifestyle {\n return FileLifestyle.Temporary;\n }\n}\n\nexport class SubtitleUploadService extends UploadService {\n // @ts-ignore\n protected get uploadType(): UploadType {\n return UploadType.Subtitle;\n }\n\n // @ts-ignore\n public get name(): string {\n return SharedServices.SubtitleUpload;\n }\n\n // @ts-ignore\n public get fileLifestyle(): FileLifestyle {\n return FileLifestyle.Permanent;\n }\n}\n\nexport class LearningResourceUploadService extends UploadService {\n // @ts-ignore\n protected get uploadType(): UploadType {\n return UploadType.LearningResource;\n }\n\n // @ts-ignore\n public get name(): string {\n return SharedServices.ResourceUpload;\n }\n\n // @ts-ignore\n public get fileLifestyle(): FileLifestyle {\n return FileLifestyle.Permanent;\n }\n}\n\nexport class MixedMediaUploadService extends UploadService {\n // @ts-ignore\n protected get uploadType(): UploadType {\n return UploadType.MixedMedia;\n }\n\n // @ts-ignore\n public get name(): string {\n return SharedServices.MixedMediaUpload;\n }\n\n // @ts-ignore\n public get fileLifestyle(): FileLifestyle {\n return FileLifestyle.Temporary;\n }\n}","import * as _ from 'underscore';\n\n/**\n * This are kept as separate variables for when we eventually need a single group of them.\n * For example when we add image upload support.\n */\n\nconst pdfExtensions = ['pdf'];\nconst docExtensions = [ 'doc', 'docx', 'dotx', 'dot', 'rtf', 'docm', 'odt' ];\nconst textExtensions = [ 'csv', 'txt' ];\nconst excelExtensions = [ 'xls', 'xlt', 'xlsx' ];\nconst imageExtensions = [ 'jpg', 'tif', 'png', 'bmp', 'gif', 'jpeg' ];\nconst videoMimeType = 'video/*';\nconst archiveExtensions = [ 'zip', 'rar' ];\nconst powerPointExtensions = [ 'ppt', 'pot', 'pps', 'pptx' ];\n\nconst subtitleExtensions = ['srt'];\n\nconst FileExtensions = {\n IMAGES: `.${imageExtensions.join(',.')}`,\n VIDEO: videoMimeType,\n MIXED_MEDIA: `.${imageExtensions.join(',.')},${videoMimeType}`,\n RESOURCES: `.${[\n ...docExtensions,\n ...excelExtensions,\n ...powerPointExtensions,\n ...pdfExtensions,\n ...textExtensions,\n ...imageExtensions,\n ...archiveExtensions\n ].join(',.')}`,\n SUBTITLES: `.${subtitleExtensions.join(',.')}`\n};\n\nconst FileExtensionHelper = {\n getResourceType(extension: string): string {\n const ext = extension.toLowerCase();\n\n if (_.contains(docExtensions, ext)) return 'document';\n if (_.contains(excelExtensions, ext)) return 'excel';\n if (_.contains(powerPointExtensions, ext)) return 'powerpoint';\n if (_.contains(pdfExtensions, ext)) return 'pdf';\n\n if (_.contains(textExtensions, ext)) return 'text';\n if (_.contains(imageExtensions, ext)) return 'image';\n if (_.contains(archiveExtensions, ext)) return 'archive';\n if (_.contains(subtitleExtensions, ext)) return 'subtitle';\n\n return '';\n }\n};\n\nexport { FileExtensions, FileExtensionHelper };","export enum PendingProcessOrigin {\n Upload = 1,\n Tv = 2\n}","export enum SubtitleExtractionOptions {\n ExternalOnly = 0,\n EmbeddedOnly = 1\n}","export enum VideoOrigin {\n IosApp = 1,\n AndroidApp = 2,\n WinApp = 3,\n LibraryPublisher = 4,\n ExchangeClient = 5,\n Online = 6,\n Tinder = 7,\n Cloud247 = 8,\n Livestream = 9,\n Curator = 10,\n LibraryEditor = 11,\n Lite = 12\n}","import { Radio } from 'backbone';\n\nimport { CommonServices } from 'libs/common/backbone/constants/CommonServices';\nimport { AlertType, BaseAlert, BaseAlertService } from 'libs/common/backbone/services/BaseAlertService';\nimport { InstanceManager } from 'libs/common/backbone/services/InstanceManager';\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { Core } from 'libs/common/core';\nimport { HashObject } from 'libs/common/react/interfaces/HashObject';\n\nimport { UploadEventNames } from 'libs/shared/apps/upload/constants/UploadConstants';\nimport { BasePendingItemsService } from 'libs/shared/apps/upload/services/BasePendingItemsService';\nimport { BaseVideoUploadService, UploadServiceOptions } from 'libs/shared/apps/upload/services/UploadService';\nimport { PendingProcessOrigin } from 'libs/shared/enums/PendingProcessOrigin';\nimport { SettingName, SettingsLookup } from 'libs/shared/enums/SettingName';\nimport { SubtitleExtractionOptions } from 'libs/shared/enums/SubtitleExtractionOptions';\nimport { VideoOrigin } from 'libs/shared/enums/VideoOrigin';\nimport { CurrentUser } from 'libs/shared/interfaces';\nimport { ContextService } from 'libs/shared/services/ContextService';\n\nimport { Actions } from 'shared/constants/LiteActions';\nimport { AppChannels } from 'shared/constants/LiteRadioChannels';\nimport { DataServices, Services } from 'shared/constants/Services';\nimport { FlightUserDataService } from 'shared/services/FlightUserDataService';\nimport { LeftNavHelper } from 'shared/utils/LeftNavHelper';\n\nimport { FlightVideoUploadDataService } from './FlightVideoUploadDataService';\n\nconst getPhrase = LanguageService.encloseNamespace('upload.services');\n\ninterface VideoUploadServiceOptions extends UploadServiceOptions {\n}\n\nexport class VideoUploadService extends BaseVideoUploadService {\n private videoUploadDataService: FlightVideoUploadDataService;\n private pendingItemsService: BasePendingItemsService;\n private userDataService: FlightUserDataService;\n private alertService: BaseAlertService;\n public options: VideoUploadServiceOptions;\n\n constructor(options: VideoUploadServiceOptions) {\n super(options);\n }\n\n public initialize(): void {\n super.initialize();\n\n this.videoUploadDataService = InstanceManager.getInstance(DataServices.VideoUpload, this);\n this.pendingItemsService = InstanceManager.getInstance(Services.PendingItems, this);\n this.userDataService = InstanceManager.getInstance(DataServices.FlightUser, this);\n this.alertService = InstanceManager.getInstance(CommonServices.ALERT, this);\n\n this.listenTo(this.channelName, UploadEventNames.FILES_ADDED, this.onUploadStart);\n this.listenTo(this.channelName, UploadEventNames.UPLOAD_COMPLETE, this.unlockNav);\n this.listenTo(this.channelName, UploadEventNames.UPLOAD_CANCELLED, this.unlockNav);\n }\n\n private onUploadStart(files: FileList): void {\n const alert: BaseAlert = {\n type: AlertType.Success,\n heading: getPhrase('startUploadAlertHeading'),\n message: files.length === 1\n ? getPhrase('startUploadSingleAlertBody', { videoName: files[0].name })\n : getPhrase('startUploadMultipleAlertBody', { uploadCount: files.length })\n };\n\n const { appLink: currentAppLink } = ContextService.getCurrentContext();\n\n const uploadAppLinks = LeftNavHelper.getMyVideosAppLinks();\n const inUploadApp = !!uploadAppLinks.find(a => (\n currentAppLink.application === a.application && currentAppLink.action === a.action\n ));\n\n // If the user is not on the \"My Videos\" page, add an applink to the alert\n if (!inUploadApp) {\n alert.appLinkText = getPhrase('startUploadAlertAppLinkText', { smartCount: files.length });\n alert.appLink = {\n application: AppChannels.MY_VIDEOS,\n action: Actions.MyVideos.MY_VIDEOS\n };\n alert.appLinkClassName = 'info-link';\n }\n\n this.alertService.createAlert(alert);\n }\n\n private unlockNav(): void {\n const collection = this.getCollection();\n\n if (collection.some(upload => upload.get('progress') < 100))\n return;\n\n Radio.channel(this.channelName).trigger(UploadEventNames.UNLOCK_NAV);\n }\n\n private completeUpload(upload: Core.Model, response: any): void {\n upload.set('sending', true);\n\n this.userDataService.getCurrentUser((user: CurrentUser) => {\n this.userDataService.getCustomerSettings(user.customerId, (settings: SettingsLookup) => {\n this.userDataService.getWorkspace((workspace: HashObject) => {\n this.videoUploadDataService.completeVideoUpload({\n id: upload.get('id'),\n userId: user.id,\n customerId: user.customerId,\n libraryId: workspace.id,\n categoryId: upload.get('categoryId') || null,\n pendingProcessOrigin: PendingProcessOrigin.Upload,\n origin: VideoOrigin.Lite,\n fileId: response.id,\n subtitleOptions: {\n subtitleExtractOptions: SubtitleExtractionOptions.EmbeddedOnly\n },\n video: { name: upload.get('name'), description: upload.get('description') },\n autoCaption: !!settings[SettingName.AutoCaptioning].value\n }, (item: any) => {\n upload.set('pendingProcessId', item.pendingProcessId);\n this.pendingItemsService.forceFetchPendingItems({\n resetTimeout: true\n });\n });\n });\n });\n });\n }\n\n protected onSuccess(file: File, response: any): void {\n super.onSuccess(file, response);\n\n const upload = this.getUpload(file);\n\n /**\n * editingMetadata is set by the EditUploadView.\n * If it's set, we wait till the user is done editing the metadata before\n * we post the data\n */\n if (upload.get('editingMetadata')) {\n this.listenToOnce(upload, 'change:editingMetadata', () => {\n this.completeUpload(upload, response);\n });\n } else {\n this.completeUpload(upload, response);\n }\n }\n\n // eslint-disable-next-line\n protected getAdditionalFileInfo(file: File, response: any): HashObject {\n const { appLink } = ContextService.getCurrentRoute();\n\n if (appLink.application !== AppChannels.MY_VIDEOS || appLink.action !== Actions.MyVideos.MY_VIDEOS_FOLDER)\n return {};\n\n return {\n categoryId: +appLink.args[0]\n };\n }\n}\n"],"names":["FileTypeError","message","title","this","lang","text","buttons","className","success","close","FileLifestyle","InternetConnectivityError","LanguageService","DialogError","SlowInternetError","dropzoneEvents","DropzoneWrapper","options","slowInternetTimeout","showSlowInternetTimeout","loggingEnabled","uploadChannel","Radio","channelName","self","dropzone","document","createElement","url","files","cvUpload","ingestUrl","chunking","chunkingEnabled","chunkSize","forceChunking","autoProcessQueue","maxFilesize","maxFileSize","acceptedFiles","paramName","timeout","init","eventName","on","args","file","File","name","console","info","percentage","totalBytes","progress","size","trigger","getId","chunks","upload","lastChunk","xhr","response","JSON","parse","fileId","id","messageObj","status","AlertError","fileName","window","clearTimeout","path","setTimeout","params","chunk","chunk_index","index","upload_length","addedfile","thumbnail","uploadprogress","uuid","addFile","removeFile","processQueue","destroy","UploadType","UploadDataService","dataProvider","InstanceManager","DataProviders","cache","Caches","alertService","CommonServices","incrementingUploadId","resource","fileLifestyle","fileCallback","callback","chain","create","eventPrefix","data","getFileUploadRequest","errorHandler","error","func","run","uploadId","splitName","split","join","extension","length","pop","fileSize","releaseInstance","BaseDataService","B","AcceptedFiles","Video","LearningResource","Subtitle","MixedMedia","ChannelNames","UploadService","uploadUrl","uploadDataService","progressViewModel","ViewModelService","uploadType","bindListeners","minChunkSize","maxChunkSize","uploader","getAcceptedFiles","listenTo","onProgress","onSuccess","totalUploaded","model","collection","get","set","setOverallProgress","getCollection","totalFileSize","each","done","updateProgress","isValidFile","analyticsOptions","requestUploads","wasUploading","isUploading","initUploader","minChunkLength","maxChunkLength","replace","add","getAdditionalFileInfo","at","AnalyticsHelper","uploadCount","addFiles","remove","cancelUpload","toJSON","entity","actionType","workflowPhase","descriptor","location","models","map","m","BaseVideoUploadService","SharedServices","Temporary","SubtitleUploadService","Permanent","LearningResourceUploadService","MixedMediaUploadService","pdfExtensions","docExtensions","textExtensions","excelExtensions","imageExtensions","videoMimeType","archiveExtensions","powerPointExtensions","subtitleExtensions","FileExtensions","IMAGES","VIDEO","MIXED_MEDIA","RESOURCES","SUBTITLES","FileExtensionHelper","getResourceType","ext","toLowerCase","PendingProcessOrigin","SubtitleExtractionOptions","VideoOrigin","getPhrase","VideoUploadService","videoUploadDataService","pendingItemsService","Services","userDataService","onUploadStart","unlockNav","alert","type","heading","videoName","currentAppLink","ContextService","appLink","LeftNavHelper","find","a","application","action","appLinkText","smartCount","appLinkClassName","createAlert","some","getCurrentUser","user","getCustomerSettings","customerId","settings","getWorkspace","workspace","completeVideoUpload","userId","libraryId","categoryId","pendingProcessOrigin","Upload","origin","Lite","subtitleOptions","subtitleExtractOptions","EmbeddedOnly","video","description","autoCaption","SettingName","value","item","pendingProcessId","forceFetchPendingItems","resetTimeout","getUpload","listenToOnce","completeUpload"],"sourceRoot":""}
@@ -0,0 +1,2 @@
1
+ "use strict";(self.webpackChunk_clickview_lite=self.webpackChunk_clickview_lite||[]).push([[3991],{2158:(e,t,r)=>{r.d(t,{T:()=>b});var a=r(32735),n=r(2948),l=r(20354),c=r(38304),i=r(25925),o=r(21750),s=r(1666),u=r(5112),m=r(61699),d=r(31949),f=r(22902),v=r(37802),h=r(75795),p=r(33857);function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,a=Array(t);r<t;r++)a[r]=e[r];return a}function b(e){var t,r,b,E,g=(b=(0,n.D)("has:playlist",null),E=2,function(e){if(Array.isArray(e))return e}(b)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var a,n,l,c,i=[],o=!0,s=!1;try{if(l=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;o=!1}else for(;!(o=(a=l.call(r)).done)&&(i.push(a.value),i.length!==t);o=!0);}catch(e){s=!0,n=e}finally{try{if(!o&&null!=r.return&&(c=r.return(),Object(c)!==c))return}finally{if(s)throw n}}return i}}(b,E)||function(e,t){if(e){if("string"==typeof e)return y(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?y(e,t):void 0}}(b,E)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),N=g[0],w=g[1],x=l.a.useBasicFetch(d.N.currentUser()),S=l.a.useBasicFetch((null===(t=x.data)||void 0===t?void 0:t.isAuthenticated)&&d.N.user(x.data.id)),j=l.a.useBasicFetch((null===(r=x.data)||void 0===r?void 0:r.isAuthenticated)&&s.h.customer(x.data.customerId)),C=l.a.useBasicFetch(o.x.availablePresentations(i.R.Subject)),T=l.a.useBasicFetch(o.x.presentation(i.R.Subject)),A=l.a.useBasicFetch(o.x.availablePresentations(i.R.Curriculum)),D=l.a.useBasicFetch(u.C.getUserPlaylists(new p.l)),P=l.a.useBasicFetch(m.o.mySubjectPreferences()),I=(0,f.T)().hasPermissions;a.useEffect((function(){var e,t,r,a;D.hasCompleted&&N!==!!(null===(t=null===(e=D.data)||void 0===e?void 0:e.data)||void 0===t?void 0:t.length)&&w(!!(null===(a=null===(r=D.data)||void 0===r?void 0:r.data)||void 0===a?void 0:a.length))}),[D.hasCompleted]);var O=x.hasCompleted&&S.hasCompleted&&j.hasCompleted&&C.hasCompleted&&A.hasCompleted&&T.hasCompleted&&D.hasCompleted&&P.hasCompleted&&null!==N,k=(0,v.r)(null).userSettings;return{getPathway:function(){var t,r,a,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=n.jobTitleOverride||(null===(a=null===(r=null===(t=S.data)||void 0===t?void 0:t.userProfile)||void 0===r?void 0:r.metadata)||void 0===a?void 0:a.jobTitle),i=n.preferredPresentationOverride||T.data;return O?c.m.getOnboardingPathway({jobTitle:l,userSettings:k.data,presentations:C.data,curriculums:A.data,preferredSubjects:P.data,preferredPresentation:i,appLink:h.O.getCurrentRoute().appLink,appLinks:e,masterUser:S.data,customer:j.data,hasPlaylist:N,hasPermissions:I,currentUser:x.data}):{screens:{},currentScreen:null,totalScreens:0,totalScreensInProgressBar:0,hasCompletedAllSteps:!1}},hasLoadedPathway:O}}},63478:(e,t,r)=>{r.d(t,{B:()=>n});var a=r(32735);function n(e){return a.createElement("div",{className:"w-100 h-100 position-fixed bg-".concat(e.variant)},e.children)}},52588:(e,t,r)=>{r.d(t,{R:()=>u});var a=r(32735),n=r(75896),l=r(55171),c=r(54610),i=r(79967),o=r(67453);function s(e,t){return"mobile"===t?function(e){var t=e%10,r={top:"".concat(4*e,"%")};switch(t){case 0:return r.left="12.5%",r.animationDelay="0.5s",r;case 1:return r.right="7.5%",r.animationDelay="1s",r;case 2:return r.left="10%",r;case 3:return r.right="2.5%",r.animationDelay="0.5s",r;case 4:return r.left="2.5%",r.animationDelay="1.5s",r;case 5:return r.right="10%",r;case 6:return r.left="12.5%",r.animationDelay="1.5s",r;case 7:return r.right="7.5%",r.animationDelay="0.5s",r;case 8:return r.left="5%",r.animationDelay="1s",r;case 9:return r.right="2.5%",r.animationDelay="1s",r;default:return r.left="10%",r.animationDelay="1.5s",r}}(e):"50%"===t?function(e){var t=e%10,r={top:"".concat(4*e,"%")};switch(t){case 0:return r.left="25%",r.animationDelay="0.5s",r;case 1:return r.right="15%",r.animationDelay="1s",r;case 2:return r.left="20%",r;case 3:return r.right="5%",r.animationDelay="0.5s",r;case 4:return r.left="5%",r.animationDelay="1.5s",r;case 5:return r.right="20%",r;case 6:return r.left="25%",r.animationDelay="1.5s",r;case 7:return r.right="15%",r.animationDelay="0.5s",r;case 8:return r.left="10%",r.animationDelay="1s",r;case 9:return r.right="5%",r.animationDelay="1s",r;default:return r.left="20%",r.animationDelay="1.5s",r}}(e):function(e){var t=e%10,r={top:"".concat(4*e,"%")};switch(t){case 0:return r.left="25%",r.animationDelay="0.5s",r;case 1:return r.right="30%",r.animationDelay="1s",r;case 2:return r.left="40%",r;case 3:return r.right="10%",r.animationDelay="0.5s",r;case 4:return r.left="10%",r.animationDelay="1.5s",r;case 5:return r.right="40%",r;case 6:return r.left="30%",r.animationDelay="1.5s",r;case 7:return r.right="30%",r.animationDelay="0.5s",r;case 8:return r.left="10%",r.animationDelay="1s",r;case 9:return r.right="10%",r.animationDelay="1s",r;default:return r.left="40%",r.animationDelay="1.5s",r}}(e)}var u=a.memo((function(e){var t=n.m.shuffle(l.e.Onboarding.LOADING_THUMBNAILS),r=(0,i.k)();return a.createElement("div",{className:"".concat("n2Qe4"," ").concat("50%"===e.screenSize?"w-50":"w-100")},t.map((function(t,n){return a.createElement("div",{key:n,className:"".concat("ZlA2t"," position-absolute rounded-3 overflow-hidden"),style:s(n,r.xs?"mobile":e.screenSize)},!e.hideThumbnailMask&&a.createElement("div",{className:"".concat("jNop3"," ").concat("blue"===e.variant?"jVOWE":"YNfFq")}),a.createElement("img",{className:"img-fluid",src:o.j.createUrl(t,{size:c.h2.Small})}))})))}))},39375:(e,t,r)=>{r.d(t,{Y:()=>u});var a=r(32735),n=r(54610),l=r(67453),c=r(2248);const i={magicTab:"H5jzm",subjectPlaceholder:"r1L6T",placeholderCover:"z9CFT",promotedTopicPlaceholder:"PbYs6",promotedTopicPlaceholderText:"hZ8Nf"};function o(e){return a.createElement("li",{className:"col-4"},a.createElement("div",{className:"d-flex border rounded-3 overflow-hidden ".concat(i.subjectPlaceholder)},e.coverUrl?a.createElement("div",{className:i.placeholderCover},a.createElement("img",{className:"img-fluid",src:l.j.createUrl(e.coverUrl,{size:n.h2.Small})})):a.createElement("div",{className:"".concat(i.placeholderCover," bg-light-blue")})))}function s(){return a.createElement("li",{className:"col-4"},a.createElement("div",{className:"bg-light-blue rounded-3 w-100 p-1 ".concat(i.promotedTopicPlaceholder)}))}function u(e){var t,r,n,l=Math.max(12-(null!==(r=null===(t=e.subjects)||void 0===t?void 0:t.length)&&void 0!==r?r:0),0);return a.createElement(c.L,{presentation:e.presentation,curriculum:e.curriculum,editingCurriculum:e.editingCurriculum},a.createElement("div",{className:"px-3 pt-3 w-100 d-flex flex-column align-items-center"},a.createElement("div",{className:"rounded-3 border overflow-hidden d-flex mb-2"},a.createElement("div",{className:"bg-light ".concat(i.magicTab)}),a.createElement("div",{className:"".concat(i.magicTab)})),a.createElement("ul",{className:"list-unstyled mb-0 row w-100 g-xl-2 g-lg-1 mb-2"},null===(n=e.subjects)||void 0===n?void 0:n.map((function(e){var t;return a.createElement(o,{key:e.id,coverUrl:null===(t=e.cover)||void 0===t?void 0:t.url})})),new Array(l).fill(0).map((function(e,t){return a.createElement(o,{key:t})}))),a.createElement("ul",{className:"list-unstyled mb-0 row w-100 g-xl-2 g-lg-1"},a.createElement(s,null),a.createElement(s,null),a.createElement(s,null),a.createElement(s,null),a.createElement(s,null),a.createElement(s,null),a.createElement(s,null),a.createElement(s,null),a.createElement(s,null))))}},2248:(e,t,r)=>{r.d(t,{L:()=>y});var a=r(32735),n=r(60376),l=r(83914),c=r(2786),i=r(83345),o=r(54610),s=r(72639),u=r(79967),m=r(67453),d=r(35223),f=r(87114);const v={dot:"AlRQD",logo:"L42gR",blackBar:"ESCxm",topNav:"a3G_4",leftNav:"YxGVV",belowHeader:"jc_cg",leftNavIcon:"U6i6r",leftNavText:"LnYlW",presentationPlaceholderIcon:"Ljaju",presentationIcon:"QdwPq",presentationPlaceholderText:"af06V",curriculumIcon:"N7T4T",curriculumIconSmall:"_6xrUg",curriculumContainer:"Z65qX",iconPlaceholder:"CKOXL",shadow:"zygeJ",presentationName:"Oj7Dt"};var h="onboarding.mockLayout";function p(){return a.createElement("div",{className:"d-flex align-items-center justify-content-center mb-2 px-3"},a.createElement("div",{className:"".concat(v.leftNavIcon," rounded-circle")}),a.createElement("div",{className:"".concat(v.leftNavText," rounded-pill")}))}function y(e){var t,r,y=(0,u.k)();return a.createElement("div",{className:"border border-dark border-2 bg-white rounded-3 user-select-none overflow-hidden position-relative h-100 w-100"},!!e.editingCurriculum&&a.createElement("div",{className:"w-100 h-100 position-absolute ".concat(v.shadow)},a.createElement("div",{className:"d-flex align-items-center h-100 w-50 ".concat(v.curriculumContainer)},a.createElement("div",{className:"bg-white rounded-3 border p-3 w-100"},a.createElement("h2",{className:"h6 text-start"},a.createElement(i.x,{namespace:h,phrase:"curriculum"})),e.curriculum?a.createElement("div",{className:"d-flex align-items-center"},a.createElement("div",{className:"".concat(v.curriculumIcon," rounded-circle me-2 border")},a.createElement(n.f,{imageUrl:m.j.createUrl(null===(t=e.curriculum.cover)||void 0===t?void 0:t.url,{size:o.h2.Small})})),a.createElement("div",{className:"text-start"},e.curriculum.name)):a.createElement("div",{className:"d-flex align-items-center text-secondary"},a.createElement("div",{className:"me-2 rounded-circle p-1 ".concat(v.iconPlaceholder)},a.createElement(n.f,{svgSize:l.S.Large,textVariant:"secondary",svgName:d.vn.GraduationCap})),a.createElement(i.x,{namespace:h,phrase:"selectCurriculum"}))))),a.createElement("div",{className:"bg-dark d-flex px-3 py-2 ".concat(v.blackBar)},a.createElement("div",{className:"rounded-circle me-2 ".concat(v.dot)}),a.createElement("div",{className:"rounded-circle me-2 ".concat(v.dot)}),a.createElement("div",{className:"rounded-circle ".concat(v.dot)})),a.createElement("div",{className:"border-bottom px-3 py-2 d-flex align-items-center ".concat(v.topNav)},a.createElement("div",{className:"".concat(v.logo," me-4")},y.xs?a.createElement(c.bc,null):a.createElement(c.$S,null)),a.createElement("div",{className:"form-control w-75 d-flex justify-content-start"},a.createElement(l.x,{svgName:d.vn.Search})),!!e.curriculum&&a.createElement("div",{className:"".concat(v.curriculumIconSmall," rounded-circle ms-2 me-n1 border")},a.createElement(n.f,{imageUrl:null===(r=e.curriculum.cover)||void 0===r?void 0:r.url}))),a.createElement("div",{className:"d-flex ".concat(v.belowHeader)},a.createElement("div",{className:"".concat(v.leftNav," border-end")},a.createElement("div",{className:"d-flex flex-column pt-3 h-100"},a.createElement(p,null),a.createElement(p,null),a.createElement(p,null),a.createElement(p,null),a.createElement(p,null),a.createElement("div",{className:"d-flex align-items-end h-100 w-100"},a.createElement("div",{className:"border-top p-3 w-100"},a.createElement("div",{className:"d-flex align-items-center"},a.createElement("div",{className:"".concat(function(){if(!e.presentation)return v.presentationPlaceholderIcon;switch(f.i.getMappedPresentationLevel(e.presentation.learningLevel)){case s.p.Level_1:return"bg-indigo ".concat(v.presentationIcon);case s.p.Level_3:return"bg-blue ".concat(v.presentationIcon);default:case s.p.Level_2:return"bg-green ".concat(v.presentationIcon)}}()," text-white rounded")},a.createElement(l.x,{svgName:d.vn.School,size:l.S.Large})),e.presentation?a.createElement("span",{className:"fw-semibold text-truncate ".concat(v.presentationName)},e.presentation.name):a.createElement("div",{className:"".concat(v.presentationPlaceholderText," fw-semibold")},a.createElement(i.x,{namespace:h,phrase:"schoolLevel"}))))))),a.createElement("div",{className:"w-100 h-100 overflow-hidden"},e.children)))}},62007:(e,t,r)=>{r.d(t,{u:()=>u});var a=r(32735),n=r(5465),l=r(84591),c=r(54610),i=r(2248);const o={banner:"CQxNy",title:"NzV5V",description1:"kjCZi",description2:"cBeyJ",placeholder:"Ks_Tl",playlistName:"eFPqz",thumbnailCol:"dgCQ7",videoInfoCol:"pzfE2"};function s(e){return a.createElement("li",{className:"row mb-2"},a.createElement("div",{className:"col-lg-4 col-5 ".concat(o.thumbnailCol)},e.video?a.createElement(l.u,{video:e.video,type:"cosmetic",hideDuration:!0,imageOptions:{size:c.h2.Medium}}):a.createElement(n.oy,{type:n.mS.Video,extraClasses:"position-relative rounded-3 ".concat(o.placeholder)})),a.createElement("div",{className:"col-lg-8 col-7 ".concat(o.videoInfoCol)},a.createElement("div",{className:"".concat(o.title," rounded-pill bg-grey mb-1")}),a.createElement("div",{className:"".concat(o.description1," rounded-pill bg-grey mb-1")}),a.createElement("div",{className:"".concat(o.description2," rounded-pill bg-grey mb-1")})))}function u(e){var t,r,n,l=e.hidePlaceholders?0:Math.max(6-(null!==(r=null===(t=e.videos)||void 0===t?void 0:t.length)&&void 0!==r?r:0),0);return a.createElement(i.L,{presentation:e.presentation,curriculum:e.curriculum},a.createElement("div",{className:"bg-teal ".concat(o.banner," position-relative")},e.name&&a.createElement("div",{className:"h5 text-white mb-0 ".concat(o.playlistName)},e.name)),a.createElement("ul",{className:"list-unstyled mb-0 w-100 p-2"},null===(n=e.videos)||void 0===n?void 0:n.map((function(e){return a.createElement(s,{key:e.id,video:e})})),new Array(l).fill(0).map((function(e,t){return a.createElement(s,{key:t})}))))}},40574:(e,t,r)=>{r.r(t),r.d(t,{OnboardingCompletedLoaderView:()=>z});var a=r(32735),n=r(57900),l=r(2948),c=r(20354),i=r(2158),o=r(21750),s=r(86702),u=r(82817),m=r(86698),d=r(83345),f=r(63478),v=r(52588),h=r(62007),p=r(96347);function y(){a.useEffect((function(){(0,p.p)("tsparticles",{count:500,drift:25,origin:{x:50,y:100},position:{x:50,y:100},startVelocity:100,ticks:100,gravity:3})}),[])}var b=r(67963);const E={playlistContainer:"J5iom",confetti:"Ja1bk",discover:"njFgx"};function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,a=Array(t);r<t;r++)a[r]=e[r];return a}var N="onboarding.creatingPlaylistLoader",w=5e3;function x(e){var t,r,n=(t=a.useState(!1),r=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var a,n,l,c,i=[],o=!0,s=!1;try{if(l=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;o=!1}else for(;!(o=(a=l.call(r)).done)&&(i.push(a.value),i.length!==t);o=!0);}catch(e){s=!0,n=e}finally{try{if(!o&&null!=r.return&&(c=r.return(),Object(c)!==c))return}finally{if(s)throw n}}return i}}(t,r)||function(e,t){if(e){if("string"==typeof e)return g(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?g(e,t):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),l=n[0],c=n[1];return y(),a.useEffect((function(){var e=window.setTimeout((function(){c(!0)}),w);return function(){window.clearTimeout(e)}}),[]),a.useEffect((function(){if(l){var t=window.setTimeout((function(){(0,b.i)(e.redirectUrl)}),w);return function(){window.clearTimeout(t)}}}),[l]),l?a.createElement(f.B,{variant:"ultramarine"},a.createElement("div",{className:"".concat(E.playlistContainer," ").concat(E.discover)},a.createElement("h1",{className:"text-white h3 text-center mb-3"},a.createElement(d.x,{namespace:N,phrase:"takingYouToDiscover"})),a.createElement(h.u,{presentation:e.presentation,curriculum:e.curriculum,videos:e.videos,name:e.name,hidePlaceholders:!0})),a.createElement(v.R,{screenSize:"100%",variant:"ultramarine"})):a.createElement(f.B,{variant:"ultramarine"},a.createElement("div",{className:"".concat(E.playlistContainer," ").concat(E.confetti)},a.createElement("h1",{className:"text-white h3 text-center mb-3"},a.createElement(d.x,{namespace:N,phrase:"greatJob"}),a.createElement("br",null),a.createElement(d.x,{namespace:N,phrase:"creatingPlaylist"})),a.createElement(h.u,{presentation:e.presentation,curriculum:e.curriculum,videos:e.videos,name:e.name,hidePlaceholders:!0})))}var S=r(39375);const j={container:"GVDR9"};function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,a=Array(t);r<t;r++)a[r]=e[r];return a}var T="onboarding.defaultLoader",A=5e3;function D(e){var t,r,n=(t=a.useState(!1),r=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var a,n,l,c,i=[],o=!0,s=!1;try{if(l=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;o=!1}else for(;!(o=(a=l.call(r)).done)&&(i.push(a.value),i.length!==t);o=!0);}catch(e){s=!0,n=e}finally{try{if(!o&&null!=r.return&&(c=r.return(),Object(c)!==c))return}finally{if(s)throw n}}return i}}(t,r)||function(e,t){if(e){if("string"==typeof e)return C(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?C(e,t):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),l=n[0],c=n[1];return y(),a.useEffect((function(){var e=window.setTimeout((function(){c(!0)}),A);return function(){window.clearTimeout(e)}}),[]),a.useEffect((function(){if(l){var t=window.setTimeout((function(){(0,b.i)(e.redirectUrl)}),A);return function(){window.clearTimeout(t)}}}),[l]),l?a.createElement(f.B,{variant:"ultramarine"},a.createElement("div",{className:"".concat(j.container)},a.createElement("h1",{className:"text-white h3 text-center mb-3"},a.createElement(d.x,{namespace:T,phrase:"takingYouToDiscover"})),a.createElement(S.Y,{presentation:e.presentation,curriculum:e.curriculum,subjects:e.subjects})),a.createElement(v.R,{screenSize:"100%",variant:"ultramarine"})):a.createElement(f.B,{variant:"ultramarine"},a.createElement("div",{className:"".concat(j.container)},a.createElement("h1",{className:"text-white h3 text-center mb-3"},a.createElement(d.x,{namespace:T,phrase:"allDone"})),a.createElement(S.Y,{presentation:e.presentation,subjects:e.subjects,curriculum:e.curriculum})))}const P={discoverContainer:"u6Ak8",confetti:"BVY_E",discover:"yYZ_G"};function I(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,a=Array(t);r<t;r++)a[r]=e[r];return a}var O="onboarding.preferencesLoader",k=5e3;function L(e){var t,r,n=(t=a.useState(!1),r=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var a,n,l,c,i=[],o=!0,s=!1;try{if(l=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;o=!1}else for(;!(o=(a=l.call(r)).done)&&(i.push(a.value),i.length!==t);o=!0);}catch(e){s=!0,n=e}finally{try{if(!o&&null!=r.return&&(c=r.return(),Object(c)!==c))return}finally{if(s)throw n}}return i}}(t,r)||function(e,t){if(e){if("string"==typeof e)return I(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?I(e,t):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),l=n[0],c=n[1];return y(),a.useEffect((function(){var e=window.setTimeout((function(){c(!0)}),k);return function(){window.clearTimeout(e)}}),[]),a.useEffect((function(){if(l){var t=window.setTimeout((function(){(0,b.i)(e.redirectUrl)}),k);return function(){window.clearTimeout(t)}}}),[l]),l?a.createElement(f.B,{variant:"ultramarine"},a.createElement("div",{className:"".concat(P.discoverContainer," ").concat(P.discover)},a.createElement("h1",{className:"text-white h3 text-center mb-3"},a.createElement(d.x,{namespace:O,phrase:"takingYouToDiscover"})),a.createElement(S.Y,{presentation:e.presentation,curriculum:e.curriculum,subjects:e.subjects})),a.createElement(v.R,{screenSize:"100%",variant:"ultramarine"})):a.createElement(f.B,{variant:"ultramarine"},a.createElement("div",{className:"".concat(P.discoverContainer," ").concat(P.confetti)},a.createElement("h1",{className:"text-white h3 text-center mb-3"},a.createElement(d.x,{namespace:O,phrase:"greatJob"}),a.createElement("br",null),a.createElement(d.x,{namespace:O,phrase:"loadingPreferences"})),a.createElement(S.Y,{presentation:e.presentation,curriculum:e.curriculum,subjects:e.subjects})))}function U(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var a,n,l,c,i=[],o=!0,s=!1;try{if(l=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;o=!1}else for(;!(o=(a=l.call(r)).done)&&(i.push(a.value),i.length!==t);o=!0);}catch(e){s=!0,n=e}finally{try{if(!o&&null!=r.return&&(c=r.return(),Object(c)!==c))return}finally{if(s)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return B(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?B(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function B(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,a=Array(t);r<t;r++)a[r]=e[r];return a}function z(e){var t=(0,b.u)(),r=(0,i.T)(t).getPathway,d=U((0,l.D)(s.y.ONBOARDING_LOADER,{}),1)[0],f=U((0,l.D)(s.y.ONBOARDING_VIDEOS_V2,[],{storage:n.Z1.LocalStorage}),1)[0],v=(0,m.y)().preferredPresentation,h=(0,u.M)().preferredCurriculum,p=c.a.useBasicFetch(o.x.classifications()),y=a.useMemo((function(){switch(r().currentScreen){case"create-playlist":return"create-playlist";case"subjects-summary":case"subjects":case"school-level":case"select-curriculum":return"preferences";default:return"default"}}),[]);return"default"===y?a.createElement(D,{subjects:p.data,presentation:v,curriculum:h,redirectUrl:e.redirectUrl}):"create-playlist"===y?a.createElement(x,{name:d.playlistName,videos:f.map((function(e){return e.data})),presentation:v,curriculum:h,redirectUrl:e.redirectUrl}):"preferences"===y?a.createElement(L,{subjects:p.data,presentation:v,curriculum:h,redirectUrl:e.redirectUrl}):a.createElement(a.Fragment,null)}}}]);
2
+ //# sourceMappingURL=3991-90b0f88c18-lite.chunk.js.map