{"version":3,"sources":["webpack:///../WCC.UI/App/components/attachments/video/video.html?5e0f","webpack:///../WCC.UI/App/components/attachments/video/video.scss?94cb","webpack:///../WCC.UI/App/components/attachments/video/video.ts","webpack:///../WCC.UI/App/managers/videoOverlay.ts","webpack:///../WCC.UI/App/webpack/runtime/htmlExposer.js","webpack:///../WCC.UI/App/components/attachments/video/video.scss","webpack:///../WCC.UI/App/components/attachments/video/video.html"],"names":["content","expose","__esModule","default","api","module","i","options","exports","locals","components","preload","videoFileTypes","enums","UserFileTypes","OriginalVideo","value","LQVideo","HQVideo","WCCVideoVM","constructor","videoOrConfig","info","effects","video","cover","labels","thumbnailIcon","iconScale","isThumbnailLoaded","ko","observable","WCCVideo","width","height","NodeTracker","node","element","this","isCompact","pureComputed","isTiny","flattenComputed","thumbnail","pluck","v","thumbnailURL","th","link","icon","hasContent","hasThumbnail","isNotNull","undefined","hqFile","ratio","AttachmentsHelpers","getRatio","unwrap","applyBindingsToNode","click","showVideo","not","system","toPercents","invokeNotNull","register","async","stage","videoOverlayManager","show","close","videoFiles","files","filter","file","includes","type","length","videoFile","preview","FilesHelpers","getVideoPreview","blob","loadAsBlob","name","src","__decorate","injectable","__param","inject","wccModules","componentConfig","componentInfo","overlayManager","toOverlay","data","buttons","SystemHelpers","html","getTemplatesAndResources","forEach","document","head","appendChild","___CSS_LOADER_API_IMPORT___","push"],"mappings":"2IAAA,UAAO,CACC,2GACA,wDAIC,KAJ4C,EAAF,SAAYA,EAASC,GAG5D,OADAA,EADAD,EAAUA,EAAQE,WAAaF,EAAQG,QAAUH,GAE1CA,GACV,4B,wECNT,IAAII,EAAM,EAAQ,gFACFJ,EAAU,EAAQ,sJAIC,iBAFvBA,EAAUA,EAAQE,WAAaF,EAAQG,QAAUH,KAG/CA,EAAU,CAAC,CAACK,EAAOC,EAAIN,EAAS,MAG9C,IAAIO,EAAU,CAEd,OAAiB,OACjB,WAAoB,GAEPH,EAAIJ,EAASO,GAI1BF,EAAOG,QAAUR,EAAQS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cjs.js??ref--26-1!./video.html\", \n \"!../../../webpack/runtime/htmlExposer.js\"], function (content, expose) {\n content = content.__esModule ? content.default : content;\n expose(content);\n return content;\n });","var api = require(\"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\");\n var content = require(\"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/sass-loader/dist/cjs.js!./video.scss\");\n\n content = content.__esModule ? content.default : content;\n\n if (typeof content === 'string') {\n content = [[module.id, content, '']];\n }\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nmodule.exports = content.locals || {};","import { wccModules } from 'enums/wccModules';\r\nimport { AttachmentsHelpers } from 'helpers/attachments';\r\nimport { FilesHelpers } from 'helpers/files';\r\nimport { inject, injectable } from 'inversify';\r\nimport { Subscribable, SubscribableOrNullableValue } from 'knockout';\r\nimport { NodeTracker } from 'managers/nodes/tracker';\r\nimport videoOverlayManager from 'managers/videoOverlay';\r\nimport { EffectsContainer } from 'mixins/withEffects';\r\nimport WCCVideo from 'models/attachments/video';\r\nimport './video.html';\r\nimport './video.scss';\r\n\r\ncomponents.preload('wcc-fluid-icon', 'wcc-image');\r\n\r\nconst videoFileTypes = [\r\n enums.UserFileTypes.OriginalVideo.value,\r\n enums.UserFileTypes.LQVideo.value,\r\n enums.UserFileTypes.HQVideo.value\r\n]\r\n\r\ninterface WCCVideoConfig {\r\n video: SubscribableOrNullableValue\r\n cover: SubscribableOrNullableValue\r\n}\r\n\r\n@injectable()\r\nexport default class WCCVideoVM {\r\n private video: Subscribable\r\n\r\n labels = labels;\r\n thumbnailIcon = 'fal fa-film';\r\n iconScale = 0.15;\r\n\r\n isThumbnailLoaded = ko.observable(false);\r\n\r\n thumbnailURL: Subscribable\r\n icon: Subscribable\r\n cover: SubscribableOrNullableValue\r\n\r\n hasThumbnail: Subscribable\r\n hasContent: Subscribable\r\n isCompact: Subscribable\r\n isTiny: Subscribable\r\n \r\n constructor(\r\n @inject(wccModules.componentConfig) videoOrConfig: WCCVideo | WCCVideoConfig,\r\n @inject(wccModules.componentInfo) info: ko.components.ComponentInfo,\r\n @inject(wccModules.effects) private effects: EffectsContainer\r\n ) {\r\n let video: SubscribableOrNullableValue\r\n let cover: SubscribableOrNullableValue\r\n\r\n if (videoOrConfig instanceof WCCVideo) {\r\n video = videoOrConfig;\r\n } else {\r\n video = videoOrConfig.video;\r\n cover = videoOrConfig.cover;\r\n }\r\n\r\n const { width, height } = new NodeTracker({ node: info.element });\r\n this.isCompact = ko.pureComputed(() => width() < 150 || height() < 150);\r\n this.isTiny = ko.pureComputed(() => width() < 100 || height() < 100);\r\n\r\n this.video = ko.flattenComputed(video);\r\n this.cover = cover;\r\n\r\n const thumbnail = this.video.pluck(v => v.thumbnail);\r\n this.thumbnailURL = thumbnail.pluck(th => th.link);\r\n this.icon = ko.pureComputed(() => this.hasContent() ? 'fal fa-play' : 'far fa-clock');\r\n\r\n this.hasThumbnail = this.thumbnailURL.isNotNull();\r\n this.hasContent = this.video.pluck(video => video.hqFile() != undefined, false);\r\n\r\n const ratio = ko.pureComputed(() => AttachmentsHelpers.getRatio(0, 0, ko.unwrap(cover)));\r\n\r\n ko.applyBindingsToNode(info.element, {\r\n 'click': () => this.showVideo(),\r\n\r\n 'css': {\r\n 'wcc-video': true,\r\n 'wcc-video--with-content': this.hasContent,\r\n 'wcc-video--compact': this.isCompact,\r\n 'wcc-video--tiny': this.isTiny,\r\n 'wcc-video--pending': this.hasThumbnail.not()\r\n },\r\n\r\n 'style': {\r\n 'padding-top': ko.pureComputed(() => this.isThumbnailLoaded() ? undefined : system.toPercents(ratio()))\r\n }\r\n });\r\n }\r\n\r\n private showVideo() {\r\n if (this.hasContent()) {\r\n this.video.invokeNotNull(video => {\r\n this.effects.register(async () => {\r\n const stage = await videoOverlayManager.show(video);\r\n\r\n return () => stage.close();\r\n });\r\n });\r\n }\r\n }\r\n\r\n private async generateThumbnailLink(video: WCCVideo) {\r\n const videoFiles = video.files().filter(file => videoFileTypes.includes(file.type()));\r\n\r\n if (videoFiles.length > 0) {\r\n const videoFile = videoFiles[0];\r\n const preview = await FilesHelpers.getVideoPreview({\r\n blob: await FilesHelpers.loadAsBlob(videoFile.link()),\r\n name: videoFile.name()\r\n });\r\n\r\n if (preview != undefined)\r\n return preview.src; \r\n }\r\n }\r\n}","import overlayManager from 'managers/overlay';\r\nimport WCCVideo from 'models/attachments/video';\r\n\r\ncomponents.preload('video-overlay-stage');\r\n\r\nexport class VideoOverlayManager {\r\n constructor() { }\r\n\r\n async show(video: WCCVideo) {\r\n return await overlayManager.toOverlay('', {\r\n data: video,\r\n buttons: ['close']\r\n });\r\n }\r\n}\r\n\r\nconst videoOverlayManager = new VideoOverlayManager();\r\n\r\nexport default videoOverlayManager;","define(function () {\r\n const system = require('helpers/system').SystemHelpers;\r\n\r\n return function (html) {\r\n system.getTemplatesAndResources(html)\r\n .forEach(function (node) { document.head.appendChild(node) });\r\n }\r\n});","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".wcc-video{display:block;border-radius:4px;overflow:hidden;position:relative}.wcc-video .wcc-image,.wcc-video .wcc-attachment-box-layout,.wcc-video .wcc-attachment-panel-layout,.wcc-video .wcc-attachment-row-layout,.wcc-video .attachment-caption{transform:scale(1) !important}.wcc-video .wcc-fluid-icon{position:absolute;top:0;right:0;bottom:0;left:0}.wcc-video.wcc-video--compact .wcc-video__uploaded-message{display:block !important}.wcc-video.wcc-video--compact .wcc-video__uploaded-message .wcc-video__uploaded-message-container{padding:10px}.wcc-video.wcc-video--compact .wcc-video__uploaded-message .wcc-video__uploaded-message-container span{font-size:11px !important}.wcc-video.wcc-video--compact .wcc-video__uploaded-message .wcc-video__uploaded-message-container .fa{font-size:15px}.wcc-video.wcc-video--compact .wcs-spinner{display:none}.wcc-video.wcc-video--compact .wcc-video__processing-message{display:none}.wcc-video.wcc-video--compact .wcc-video__icon{display:none}.wcc-video.wcc-video--compact .wcc-video__pending-cover__content{font-size:12px;text-align:center}.wcc-video.wcc-video--tiny .wcc-video__processing-message,.wcc-video.wcc-video--tiny .wcc-video__uploaded-message{display:none !important}.wcc-video.wcc-video--tiny .wcs-spinner{height:13px}.wcc-video--with-content{cursor:pointer}.wcc-video--with-content:hover .wcc-video__icon{color:#5ca2dd}.wcc-video__body{position:relative}.wcc-video__body .wcc-image__content{border-radius:4px}.wcc-video__image{width:100%}.wcc-video__icon-container{position:relative;padding-top:56.25%}.wcc-video__icon{position:absolute;bottom:10px;left:10px;display:flex;justify-content:center;align-items:center;width:70px;height:46px;border-radius:15%;background-color:rgba(64,64,64,.85);color:rgba(248,248,247,.85);transition:color 250ms ease-in-out;font-size:26px;padding-left:1%}.wcc-video__processing-message,.wcc-video__uploaded-message{position:absolute;top:50%;width:100%;text-align:center;color:#fff}.wcc-video__processing-message .wcc-video__processing-message-container,.wcc-video__processing-message .wcc-video__uploaded-message-container,.wcc-video__uploaded-message .wcc-video__processing-message-container,.wcc-video__uploaded-message .wcc-video__uploaded-message-container{background:#000;border-radius:10px;opacity:.6;display:inline-block;padding:10px 40px}.wcc-video__processing-message .wcc-video__processing-message-container span,.wcc-video__processing-message .wcc-video__uploaded-message-container span,.wcc-video__uploaded-message .wcc-video__processing-message-container span,.wcc-video__uploaded-message .wcc-video__uploaded-message-container span{font-size:12px}.wcc-video__processing-message .wcc-video__processing-message-container .fa,.wcc-video__processing-message .wcc-video__uploaded-message-container .fa,.wcc-video__uploaded-message .wcc-video__processing-message-container .fa,.wcc-video__uploaded-message .wcc-video__uploaded-message-container .fa{font-size:25px}.wcc-video__pending-cover{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;align-items:center;background:rgba(0,0,0,.65)}.wcc-video__pending-cover__body{padding:5px}.wcc-video__pending-cover__content{color:#fff;text-align:center}.wcc-video__pending-cover__content .fas.fa-check{font-size:50px}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// Module\nvar code = \"\";\n// Exports\nmodule.exports = code;"],"sourceRoot":""}