@hippovideo/video-sdk 0.0.0-experimental-ded431a10a04-20230620 → 0.0.0-experimental-9e59d2b3318f-20230620
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/232-bundle-hippo-yrfznej8uuk-420a156f3d106dc3c208.js +2 -0
- package/app/232-bundle-hippo-yrfznej8uuk-420a156f3d106dc3c208.js.LICENSE.txt +46 -0
- package/app/{245-bundle-hippo-f0qq7x96g54-04b05167456f574035d1.js → 245-bundle-hippo-yrfznej8uuk-a779b7190910b127f176.js} +1 -1
- package/app/{520-bundle-hippo-f0qq7x96g54-d74cf5078c89a2fa7930.js → 520-bundle-hippo-yrfznej8uuk-bc32ad6d1a9f7e43c32b.js} +1 -1
- package/app/617-bundle-hippo-yrfznej8uuk-b068922de2bf2af8ce61.js +1 -0
- package/app/697-bundle-hippo-yrfznej8uuk-b0d8971a5c657b55f78a.js +1 -0
- package/app/hv_recorder.js +1 -1
- package/app/hv_recorder.js.LICENSE.txt +0 -47
- package/app/webpack-common-manifest.json +7 -36
- package/package.json +1 -1
- package/app/107-bundle-hippo-f0qq7x96g54-3fad86f11646f0cd2296.js +0 -1
- package/app/157-bundle-hippo-f0qq7x96g54-90f61daceef36d92d765.js +0 -1
- package/app/238-bundle-hippo-f0qq7x96g54-b61acbf599b47f15e1ff.js +0 -1
- package/app/239-bundle-hippo-f0qq7x96g54-29765f212c5b82b9b5c9.js +0 -1
- package/app/283-bundle-hippo-f0qq7x96g54-095a8772f0b647aa12ab.js +0 -1
- package/app/307-bundle-hippo-f0qq7x96g54-46ceaa5b69d013f1a160.js +0 -1
- package/app/362-bundle-hippo-f0qq7x96g54-28bf93bdaaaca6e8a7d1.js +0 -1
- package/app/37-bundle-hippo-f0qq7x96g54-e813c079958693323e0d.js +0 -1
- package/app/442-bundle-hippo-f0qq7x96g54-a40760aafd35feb385c9.js +0 -1
- package/app/454-bundle-hippo-f0qq7x96g54-640863e104cb8d4444b5.js +0 -1
- package/app/487-bundle-hippo-f0qq7x96g54-a8a4683af31cd239bdfa.js +0 -1
- package/app/525-bundle-hippo-f0qq7x96g54-9e22fb533f478807c968.js +0 -1
- package/app/528-bundle-hippo-f0qq7x96g54-e7c6879087f0bc809436.js +0 -1
- package/app/582-bundle-hippo-f0qq7x96g54-a9eac0a0dff2505acd77.js +0 -1
- package/app/605-bundle-hippo-f0qq7x96g54-3d6e46646daa3d9ffc77.js +0 -1
- package/app/611-bundle-hippo-f0qq7x96g54-f7d2a84b0b194f07a962.js +0 -1
- package/app/652-bundle-hippo-f0qq7x96g54-2446a2200548df5c62f3.js +0 -1
- package/app/66-bundle-hippo-f0qq7x96g54-d26ab7f3718ca8adb7b9.js +0 -1
- package/app/660-bundle-hippo-f0qq7x96g54-e4d99213565d245f92b3.js +0 -1
- package/app/692-bundle-hippo-f0qq7x96g54-98e2778801517c6d709f.js +0 -1
- package/app/751-bundle-hippo-f0qq7x96g54-d3e1ee01d1e1f8c54119.js +0 -1
- package/app/771-bundle-hippo-f0qq7x96g54-5a6062e3490ee9261b7e.js +0 -1
- package/app/780-bundle-hippo-f0qq7x96g54-4e7a932e3d7564dbfd08.js +0 -1
- package/app/795-bundle-hippo-f0qq7x96g54-fa5dee47c4eb61932834.js +0 -1
- package/app/823-bundle-hippo-f0qq7x96g54-2b0bbd0da340d8be2937.js +0 -1
- package/app/847-bundle-hippo-f0qq7x96g54-a7274fcf2651c06dc9cc.js +0 -1
- package/app/85-bundle-hippo-f0qq7x96g54-cee943b1271f7f21df76.js +0 -1
- package/app/869-bundle-hippo-f0qq7x96g54-13a727a5f462660b7c19.js +0 -1
- package/app/892-bundle-hippo-f0qq7x96g54-6dc5a8967bfd8695b74a.js +0 -1
- package/app/907-bundle-hippo-f0qq7x96g54-6b974d5b2e5cef32804d.js +0 -1
- package/app/963-bundle-hippo-f0qq7x96g54-abde1d79679a282d1de2.js +0 -1
- package/app/99-bundle-hippo-f0qq7x96g54-d4e79df05dcd313d5feb.js +0 -1
- /package/app/{188-bundle-hippo-f0qq7x96g54-1036786bf949fd672026.js → 188-bundle-hippo-yrfznej8uuk-1036786bf949fd672026.js} +0 -0
- /package/app/{245-bundle-hippo-f0qq7x96g54-04b05167456f574035d1.js.LICENSE.txt → 245-bundle-hippo-yrfznej8uuk-a779b7190910b127f176.js.LICENSE.txt} +0 -0
- /package/app/{520-bundle-hippo-f0qq7x96g54-d74cf5078c89a2fa7930.js.LICENSE.txt → 520-bundle-hippo-yrfznej8uuk-bc32ad6d1a9f7e43c32b.js.LICENSE.txt} +0 -0
- /package/app/{881-bundle-hippo-f0qq7x96g54-1e41c84326fac8446b66.js → 881-bundle-hippo-yrfznej8uuk-1e41c84326fac8446b66.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunkHVRecorder=self.webpackChunkHVRecorder||[]).push([[617],{71854:function(e,i,t){var o,s;o=[t(11329),t(68446)],void 0===(s=function(e,i){return function(e){function i(e,i){return e.w('<div class="simple-edit-container hide ').x(i.get(["integrationType"],!1),i,{block:t},{}).w('"><div class="simple-edit-controls"><div class="se-control-detail default-control-detail clearfix hide"><span class="info-text"></span></div>').h("ne",i,{block:o},{key:i.get(["trim"],!1),value:"false"},"h").h("ne",i,{block:a},{key:i.get(["crop"],!1),value:"false"},"h").h("ne",i,{block:r},{key:i.get(["image"],!1),value:"false"},"h").h("ne",i,{block:h},{key:i.get(["text"],!1),value:"false"},"h").h("ne",i,{block:g},{key:i.get(["stickers"],!1),value:"false"},"h").h("ne",i,{block:v},{key:i.get(["callout"],!1),value:"false"},"h").h("ne",i,{block:k},{key:i.get(["blur"],!1),value:"false"},"h").h("ne",i,{block:x},{key:i.get(["resize"],!1),value:"false"},"h").w('<div class="simple-edit-buttons-box ').x(i.get(["integrationType"],!1),i,{block:P},{}).w('">').h("ne",i,{block:V},{key:i.get(["trim"],!1),value:"false"},"h").h("ne",i,{block:T},{key:i.get(["crop"],!1),value:"false"},"h").nx(i.get(["fromQuickRecord"],!1),i,{block:S},{}).h("ne",i,{block:_},{key:i.get(["stickers"],!1),value:"false"},"h").h("ne",i,{block:E},{key:i.get(["callouts"],!1),value:"false"},"h").h("ne",i,{block:A},{key:i.get(["blur"],!1),value:"false"},"h").h("ne",i,{block:M},{key:i.get(["resize"],!1),value:"false"},"h").w('</div></div></div><div class="modal-backdrop image-upload-progress-container" id="imageUploadProgessContainer"><div class="text-center loading-container"><div class="progress-text" id="imageUploadProgressText"> </div></div></div>')}function t(e,i){return e.f(i.get(["integrationType"],!1),i,"h").w("-simple-edit")}function o(e,i){return e.w('<div class="se-control-detail clearfix trim-control-detail hide"><img class="ruler ruler-static" src="').f(i.get(["origin"],!1),i,"h").w('/img/ruler-two.png"><canvas class="ruler ruler-dynamic hide" width="1000" height="15"></canvas><input type="text" class="sliderValue" style="display:none" data-index="0" value="0" /><input type="text" class="sliderValue" style="display:none" data-index="1" value="0" /><div class="trim-slider" id="trimSlider"></div>').h("ne",i,{block:s},{key:i.get(["shouldHideTrimTimer"],!1),value:"true"},"h").w('<div class="trim-preview-container"><video class="trim-preview-video"></video></div><div class="preview-trim-arrow"></div></div>')}function s(e,i){return e.w('<div class="trim-before-container"><div class="trim-before-time-element"><div class="arrow right-arrow"></div><span class="trim-before-time"></span></div><div class="trim-before-pop"><span>').f(i.getPath(!1,["simpleEdit","trimStartTime"]),i,"h").w('</span><input type="text" class="trim-before-input"><div class="before-trim-div"><div class="arrow up-arrow trim-input-btn trim-input-btn-plus"></div><div class="arrow down-arrow trim-input-btn trim-input-btn-minus"></div></div><div class="trim-arrow"></div></div></div><div class="trim-after-container"><div class="trim-after-time-element"><div class="arrow left-arrow"></div><span class="trim-after-time"></span></div><div class="trim-after-pop"><span>').f(i.getPath(!1,["simpleEdit","trimEndTime"]),i,"h").w('</span><input type="text" class="trim-after-input"><div class="after-trim-div"><div class="arrow up-arrow trim-input-btn trim-input-btn-plus"></div><div class="arrow down-arrow trim-input-btn trim-input-btn-minus"></div></div><div class="trim-arrow"></div></div></div>')}function a(e,i){return e.w('<div class="se-control-detail clearfix crop-control-detail hide"><div class="pull-left reposition-webcam-container"><input type="checkbox" class="reposition-webcam wiz-checkbox-blue" id="move" checked /><label for="move">').f(i.getPath(!1,["simpleEdit","moveWebcam"]),i,"h").w('</label></div><div class="pull-right text-right"><a class="apply-crop apply-btn" id="cropApplyBtn">').f(i.getPath(!1,["simpleEdit","apply"]),i,"h").w('</a><a class="reset-crop reset-btn" id="cropResetBtn">').f(i.getPath(!1,["simpleEdit","reset"]),i,"h").w("</a></div></div>")}function r(e,i){return e.w('<div class="se-control-detail clearfix addimage-control-detail hide">').nx(i.get(["fromQuickRecord"],!1),i,{else:n,block:d},{}).w('<div class="addimage-selected hide"><div class="left"><input type="checkbox" class="wiz-checkbox-blue" id="imageArLock" checked /><label for="imageArLock" class="image-ar-lock">').f(i.getPath(!1,["simpleEdit","lockAspectRatioResize"]),i,"h").w('</label></div><div class="left opacity-container"><span class="left">').f(i.getPath(!1,["simpleEdit","opacity"]),i,"h").w('</span><input class="left slider" type="range" min="0" max="100" id="imageOpacitySlider"><input class="left slider-ip" type="number" min="0" max="100" value="100" id="imageOpacityInput"></div><div class="right delete-btn-container"><div id="deleteImage" class="delete-btn">').f(i.getPath(!1,["simpleEdit","delete"]),i,"h").w("</div></div></div></div>")}function n(e,i){return e.w('\x3c!-- new quick record flow personalization --\x3e<div class="addimage-initial cpv-personalization hide"><div class="add-image-action left add-text hide">\t<img src="').f(i.get(["origin"],!1),i,"h").w('/svg/plus-ico-blue.svg"/><span id="addTextLink">\t').f(i.getPath(!1,["simpleEdit","addText"]),i,"h").w('\t</span>\t</div><div class="add-image-action left" id="addImageBtn"><img src="').f(i.get(["origin"],!1),i,"h").w('/svg/plus-ico-blue.svg"/><span>').f(i.getPath(!1,["simpleEdit","addImage"]),i,"h").w("</span></div>").x(i.get(["canShowPersonalization"],!1),i,{block:l},{}).w("</div>\x3c!-- end of new quick record flow personalization --\x3e")}function l(e,i){return e.w('<div class="add-image-action left" id="addPersonalizedImageBtn"><img src="').f(i.get(["origin"],!1),i,"h").w('/svg/plus-ico-blue.svg"/><span>').f(i.getPath(!1,["simpleEdit","addPersonalizedImage"]),i,"h").w('</span></div><div class="add-image-action left" id="addWebsiteImageBtn"><img src="').f(i.get(["origin"],!1),i,"h").w('/svg/plus-ico-blue.svg"/><span>').f(i.getPath(!1,["simpleEdit","addWebsiteImage"]),i,"h").w("</span></div>")}function d(e,i){return e.w('<div class="addimage-initial hide"><div class="add-image-action left add-text hide">\t<span id="addTextLink">\t').f(i.getPath(!1,["simpleEdit","addText"]),i,"h").w('\t</span>\t</div><div class="add-image-action left" id="addImageBtn"><span>').f(i.getPath(!1,["simpleEdit","addImage"]),i,"h").w("</span></div>").x(i.get(["canShowPersonalization"],!1),i,{block:c},{}).w("</div>")}function c(e,i){return e.w('<div class="add-image-action left" id="addPersonalizedImageBtn"><span>').f(i.getPath(!1,["simpleEdit","addPersonalizedImage"]),i,"h").w('</span></div><div class="left add-image-tooltip"><img src="').f(i.get(["origin"],!1),i,"h").w('/img/help.png"><div class="add-image-tooltip-content">').f(i.getPath(!1,["simpleEdit","addImageInfo"]),i,"h").w('<a href="https://help.hippovideo.io/support/solutions/articles/19000100178-image-personalization" target="_blank">').f(i.getPath(!1,["simpleEdit","learnMore"]),i,"h").w('</a></div></div><div class="add-image-action left" id="addWebsiteImageBtn"><span>').f(i.getPath(!1,["simpleEdit","addWebsiteImage"]),i,"h").w('</span></div><div class="left add-image-tooltip"><img src="').f(i.get(["origin"],!1),i,"h").w('/img/help.png"><div class="add-image-tooltip-content">').f(i.getPath(!1,["simpleEdit","addWebsiteImageInfo"]),i,"h").w('<a href="https://help.hippovideo.io/support/solutions/articles/19000100178-image-personalization" target="_blank">').f(i.getPath(!1,["simpleEdit","learnMore"]),i,"h").w("</a></div></div>")}function h(e,i){return e.w('<div class="se-control-detail clearfix addtext-control-detail hide"><div class="addtext-container"><div id="textPropertiesTab" style="display:none" class="sdk-top-wrap"><div class="sdk-text-wrap"><div class="padding-face se-font mf-custom-selector"><select class="se-text-properties se-font-selector"></select></div><div class="padding-face se-fontsize mf-custom-selector"><select class="se-text-properties se-fontsize-selector"><option value="15">15px</option><option value="17">17px</option><option value="20">20px</option><option value="25">25px</option><option value="35">35px</option><option value="40" selected>40px</option><option value="50">50px</option><option value="60">60px</option><option value="70">70px</option><option value="90">90px</option><option value="110">110px</option></select></div><div class="padding-face alignment-selector"><select class="se-text-properties se-textalign-selector"><option value="left">').f(i.getPath(!1,["simpleEdit","left"]),i,"h").w('</option><option value="center" selected>').f(i.getPath(!1,["simpleEdit","center"]),i,"h").w('</option><option value="right">').f(i.getPath(!1,["simpleEdit","right"]),i,"h").w('</option></select></div></div><div class="sdk-textstyle-wrap"><div class="se-bold-face"><input type="checkbox" id="c1" class="se-text-properties se-bold-toggle chk-btn" /><label for=\'c1\'><b>B</b></label></div><div class="italic-face"><input type="checkbox" id="c2" class="se-text-properties se-italic-toggle chk-btn" /><label for=\'c2\'><i>I</i></label></div><div class=""><div class="padding-face color-picker"><input type = "color" class="se-text-properties se-color-choose se-color-selector"/></div></div></div></div><div class="padding-face for-merge-field"><div class="mf-custom-selector mf-custom-selector-button merge-field-container">').x(i.get(["canShowPersonalization"],!1),i,{block:p},{}).w('</div><div class="padding-face se-add-text-btn text-right"><a class="add-text" id="addTextLink"><img src="').h("eq",i,{else:m,block:f},{key:i.get(["integrationType"],!1),value:"lessonly"},"h").w('" alt="plus" />').f(i.getPath(!1,["simpleEdit","addText"]),i,"h").w("</a></div></div></div></div>")}function p(e,i){return e.w('<div class="mf-selector"><select id="seMfSelector"><option selected>').f(i.getPath(!1,["simpleEdit","mergeFields"]),i,"h").w("</option>").s(i.get(["mfValues"],!1),i,{block:u},{}).w('</select></div><div class="text-right mf-label"><label><div><span class="mf-info-tooltip">').f(i.getPath(!1,["simpleEdit","mfInfoTooltip"]),i,"h").w('</span><img src="').f(i.get(["origin"],!1),i,"h").w('/svg/help1.svg" /></div></label></div>')}function u(e,i){return e.w("<option>").f(i.get(["mf"],!1),i,"h").w("</option>")}function m(e,i){return e.f(i.get(["origin"],!1),i,"h").w("/img/small-plus.png")}function f(e,i){return e.w("/img/small-plus-4a90e2.png")}function g(e,i){return e.w('<div class="se-control-detail clearfix addsticker-control-detail hide"><div class="addsticker-initial hide"><div class="sticker-btn-container clearfix"></div></div><div class="addsticker-selected hide"><div class=""><input type="checkbox" class="lock-aspect-ratio sticker-control wiz-checkbox-blue" id="sticker-lock" checked /><label for="sticker-lock">').f(i.getPath(!1,["simpleEdit","lockAspectRatioResize"]),i,"h").w('</label></div><div class=""><div class="text-right"><span>').f(i.getPath(!1,["simpleEdit","opacity"]),i,"h").w('</span></div><div class=""><select class="opacity-val sticker-control"><option value="0">0</option><option value="25">25</option><option value="50">50</option><option value="75">75</option><option value="100">100</option></select></div></div><div class="text-right"><a class="delete-sticker delete-label" id="deleteSticker">').f(i.getPath(!1,["simpleEdit","delete"]),i,"h").w("</a></div></div></div>")}function v(e,i){return e.w('<div class="se-control-detail clearfix addcallout-control-detail hide"><div class="addcallout-initial clearfix hide"><img class="callout-scroll-left pull-left" src="').h("eq",i,{else:y,block:b},{key:i.get(["integrationType"],!1),value:"lessonly"},"h").w('"><div class="callout-btn-scroll-container pull-left"><div class="callout-btn-container"></div></div><img class="callout-scroll-right pull-right" src="').h("eq",i,{else:w,block:C},{key:i.get(["integrationType"],!1),value:"lessonly"},"h").w('"><div class="callout-scroll-hide-layer"></div></div><div class="addcallout-selected hide"><div class=""><input type="checkbox" class="lock-aspect-ratio callout-control wiz-checkbox-blue" id="callout-lock" checked /><label for="callout-lock">').f(i.getPath(!1,["simpleEdit","lockAspectRatioResize"]),i,"h").w('</label></div><div class="se-callout-internal"><div class=""><span>').f(i.getPath(!1,["simpleEdit","opacity"]),i,"h").w('</span></div><div class=""><select class="opacity-val callout-control"><option value="0">0</option><option value="25">25</option><option value="50">50</option><option value="75">75</option><option value="100" selected>100</option></select></div></div><div class="se-callout-internal"><div class=""><span>').f(i.getPath(!1,["simpleEdit","color"]),i,"h").w('</span></div><div class=""><select class="callout-control callout-variation"><option value="0">').f(i.getPath(!1,["simpleEdit","default"]),i,"h").w('</option><option value="1">').f(i.getPath(!1,["simpleEdit","yellow"]),i,"h").w('</option><option value="2">').f(i.getPath(!1,["simpleEdit","orange"]),i,"h").w('</option><option value="3">').f(i.getPath(!1,["simpleEdit","green"]),i,"h").w('</option><option value="4">').f(i.getPath(!1,["simpleEdit","violet"]),i,"h").w('</option><option value="5">').f(i.getPath(!1,["simpleEdit","blue"]),i,"h").w('</option><option value="6">').f(i.getPath(!1,["simpleEdit","dark"]),i,"h").w('</option><option value="7">').f(i.getPath(!1,["simpleEdit","white"]),i,"h").w('</option></select></div></div><div class="text-right"><a class="delete-callout delete-label" id="deleteCallout">').f(i.getPath(!1,["simpleEdit","delete"]),i,"h").w("</a></div></div></div>")}function y(e,i){return e.f(i.get(["origin"],!1),i,"h").w("/img/sli-aro-left.png")}function b(e,i){return e.w("/img/sli-aro-left-4a90e2.png")}function w(e,i){return e.f(i.get(["origin"],!1),i,"h").w("/img/sli-aro-right.png")}function C(e,i){return e.w("/img/sli-aro-right-4a90e2.png")}function k(e,i){return e.w('<div class="se-control-detail clearfix blur-control-detail text-left hide"><div class="blur-initial hide" id="blurInitial">').f(i.getPath(!1,["simpleEdit","blurDescription"]),i,"h").w('<div class="outline-btn pull-right" id="applyBlur"> ').f(i.getPath(!1,["simpleEdit","addNewBlur"]),i,"h").w(' </div></div><div class="blur-selected clearfix hide" id="blurSelected"><div class="pull-left"><input type="checkbox" class="lock-aspect-ratio blur-control wiz-checkbox-blue" id="blurLock" /><label for="blurLock">').f(i.getPath(!1,["simpleEdit","lockAspectRatioResize"]),i,"h").w('</label></div><div class="pull-left content-box"><div class="props-label pull-left"><span> ').f(i.getPath(!1,["simpleEdit","strength"]),i,"h").w(' </span></div><div class="pull-left"><div class="blur-control" id="blurStrength"></div></div><div class="pull-left"><input type="number" step="1" min="0" max="100" value="25" class="blur-input" id="blurStrengthText" /></div></div><div class="pull-right text-right content-box"><a class="delete-blur delete-label" id="deleteblur">').f(i.getPath(!1,["simpleEdit","delete"]),i,"h").w("</a></div></div></div>")}function x(e,i){return e.w('<div class="se-resize-control-detail hide"><div class="se-control-detail clearfix primaryvid-control-detail hide"><input type="checkbox" class="lock-aspect-ratio primary-vid-control wiz-checkbox-blue" id="lock-three" checked /><label for="lock-three" class="cursor-pointer" >').f(i.getPath(!1,["simpleEdit","lockAspectRatioResize"]),i,"h").w('</label></div><div class="se-control-detail clearfix secondaryvid-control-detail hide"><input type="checkbox" class="lock-aspect-ratio secondary-vid-control wiz-checkbox-blue" id="lock-four" checked /><label for="lock-four">').f(i.getPath(!1,["simpleEdit","lockAspectRatioResize"]),i,"h").w("</label></div></div>")}function P(e,i){return e.f(i.get(["integrationType"],!1),i,"h").w("-se-icon-sprite")}function V(e,i){return e.w('<div class="wiz-simple-edit-btn trim-btn ').x(i.get(["isHideTrim"],!1),i,{block:$},{}).w('" id="trimBtn" tooltip="').f(i.getPath(!1,["simpleEdit","trim"]),i,"h").w('" tooltip-position="bottom"><span class="simple-edit-trim"></span></div>')}function $(e,i){return e.w(" disp-none ")}function T(e,i){return e.w('<div class="wiz-simple-edit-btn crop-btn ').x(i.get(["isHideCorp"],!1),i,{block:I},{}).w('" id="cropBtn" tooltip="').f(i.getPath(!1,["simpleEdit","crop"]),i,"h").w('" tooltip-position="bottom"><span class="simple-edit-crop"></span></div>')}function I(e,i){return e.w(" disp-none ")}function S(e,i){return e.h("ne",i,{block:F},{key:i.get(["text"],!1),value:"false"},"h").h("ne",i,{block:L},{key:i.get(["image"],!1),value:"false"},"h")}function F(e,i){return e.w('<div class="wiz-simple-edit-btn add-text-btn" id="addTextBtn" tooltip="').f(i.getPath(!1,["simpleEdit","text"]),i,"h").w('" tooltip-position="bottom"><span class="simple-edit-text"></span></div>')}function L(e,i){return e.w('<div class="wiz-simple-edit-btn add-image-btn" id="addImageMenuBtn" tooltip="').f(i.getPath(!1,["simpleEdit","image"]),i,"h").w('" tooltip-position="bottom"><span class="simple-edit-image-personalisation"></span></div>')}function _(e,i){return e.w('<div class="wiz-simple-edit-btn add-stickers-btn ').x(i.get(["isHideStickers"],!1),i,{block:R},{}).w('" id="addStickersBtn" tooltip="').f(i.getPath(!1,["simpleEdit","emoji"]),i,"h").w('" tooltip-position="bottom"><span class="simple-edit-sticker"></span></div>')}function R(e,i){return e.w(" disp-none ")}function E(e,i){return e.w('<div class="wiz-simple-edit-btn add-callouts-btn ').x(i.get(["isHideCallouts"],!1),i,{block:z},{}).w('" id="addCalloutsBtn" tooltip="').f(i.getPath(!1,["simpleEdit","callout"]),i,"h").w('" tooltip-position="bottom"><span class="simple-edit-callout"></span></div>')}function z(e,i){return e.w(" disp-none ")}function A(e,i){return e.w('<div class="wiz-simple-edit-btn add-blur-btn ').x(i.get(["isHideBlur"],!1),i,{block:B},{}).w('" id="blurBtn" tooltip="').f(i.getPath(!1,["simpleEdit","blur"]),i,"h").w('" tooltip-position="bottom"><span class="simple-edit-blur"></span></div>')}function B(e,i){return e.w(" disp-none ")}function M(e,i){return e.w('<div class="wiz-simple-edit-btn resize-draggable-btn ').x(i.get(["isResizableNotAllowed"],!1),i,{block:D},{}).w('" id="resizeDragBtn" tooltip="').f(i.getPath(!1,["simpleEdit","resize"]),i,"h").w('" tooltip-position="bottom"><span class="simple-edit-resize"></span></div>')}function D(e,i){return e.w(" disp-none ")}e.register("templates/simple_edit/sdk_controls",i),i.__dustBody=!0,t.__dustBody=!0,o.__dustBody=!0,s.__dustBody=!0,a.__dustBody=!0,r.__dustBody=!0,n.__dustBody=!0,l.__dustBody=!0,d.__dustBody=!0,c.__dustBody=!0,h.__dustBody=!0,p.__dustBody=!0,u.__dustBody=!0,m.__dustBody=!0,f.__dustBody=!0,g.__dustBody=!0,v.__dustBody=!0,y.__dustBody=!0,b.__dustBody=!0,w.__dustBody=!0,C.__dustBody=!0,k.__dustBody=!0,x.__dustBody=!0,P.__dustBody=!0,V.__dustBody=!0,$.__dustBody=!0,T.__dustBody=!0,I.__dustBody=!0,S.__dustBody=!0,F.__dustBody=!0,L.__dustBody=!0,_.__dustBody=!0,R.__dustBody=!0,E.__dustBody=!0,z.__dustBody=!0,A.__dustBody=!0,B.__dustBody=!0,M.__dustBody=!0,D.__dustBody=!0}(e),function(i,t){var o;return e.render("templates/simple_edit/sdk_controls",i,(function(e,i){if("function"==typeof t)try{t(e,i)}catch(e){}if(e)throw e;o=i})),o}}.apply(i,o))||(e.exports=s)},49046:function(e,i,t){var o,s;o=[t(11329),t(68446)],void 0===(s=function(e,i){return function(e){function i(e,i){return e.w('<div class="sticker-family-container sticker-family-container-').f(i.get(["i"],!1),i,"h").w('"><img class="sticker-family-main" src = "').f(i.get(["mainImg"],!1),i,"h").w('" id="sticker-family-main-').f(i.get(["i"],!1),i,"h").w('"><div class="custom-scroll sticker-family-all hide"></div></div>')}e.register("templates/simple_edit/sticker_family",i),i.__dustBody=!0}(e),function(i,t){var o;return e.render("templates/simple_edit/sticker_family",i,(function(e,i){if("function"==typeof t)try{t(e,i)}catch(e){}if(e)throw e;o=i})),o}}.apply(i,o))||(e.exports=s)},39352:function(e,i,t){"use strict";t.r(i),t.d(i,{default:function(){return Ee}}),t(82526),t(41817),t(41539),t(32165),t(66992),t(78783),t(33948),t(47042),t(39714),t(68309),t(91038),t(74916),t(47941),t(57327),t(38880),t(54747),t(49337);var o=t(4942),s=t(71002),a=t(67294),r=t(19755),n=t.n(r),l=t(13919),d=t(72316),c=t.n(d),h=t(15864),p=t(83958),u=t(60112),m=t.n(u),f=(t(69600),t(9653),t(26699),t(32023),{getImportedImageInfo:function(e){var i=e.upload_type,t={};return"local_file"===i?(t.upload_type="local_file",t.file_name=e.name,t.size=e.size,t.description=e.description||e.name):"existing_media"===i?(t.upload_type="existing_media",t.video_id=e.id):"gdrive"===i?(t.upload_type="gdrive",t.id=e.id,t.token_id=e.token_id):"url"===i&&(t.upload_type="url",t.url=e.url),t.contains_image=!0,t},getMfImage:function(e,i){var t=document.createElement("canvas");t.width=2e3,t.height=1125;var o=t.getContext("2d");o.fillStyle="white",o.fillRect(0,0,t.width,t.height),o.fillStyle="#2a2a2a";var s="image"===i?"360px":"300px";o.font="700 "+s+" Open Sans";var a="image"===i?"IMAGE":"WEBSITE";o.fillText("$"+a+e+"$",100,500),o.fillStyle="#969ca2",o.font="170px Open Sans";var r="G O E S H E R E".split("").join(String.fromCharCode(8201));return o.fillText(r,110,800),t.toDataURL("image/png")},getNewImageMfId:function(e,i){for(var t=[],o=[],s="image"===i,a=0;a<e.clips.length;a++){var r=e.clips[a];"image-mf"===r.footage.type&&(s?void 0!==r.footage.is_website&&"false"!==r.footage.is_website.toString()||(r.footage.image_id?o.push(Number(r.footage.image_id)):o.push(Number(r.footage.id))):r.footage.is_website&&"true"===r.footage.is_website.toString()&&o.push(Number(r.footage.image_id)),t.push(Number(r.footage.id)))}var n=this.getId(t);return{imageId:this.getId(o),footageId:n}},getId:function(e){for(var i=1;e.includes(i);)++i;return i}}),g=(t(69826),{getPaletteConfig:function(e,i,t){var o=this,s={};return(HippoVideo.data.api.getProperty("showBrandingColorPalette")||t)&&(s={showSelectionPalette:!1,showPalette:!0,hideAfterPaletteSelect:!0,beforeShow:function(){var e=n()("."+i);return e.find("#showMoreContainer").remove(),e.addClass("palette-view"),e.find(".sp-picker-container .sp-top, .sp-picker-container .sp-input-container").hide(),e.find(".sp-picker-container").prepend("<div id='showMoreContainer'><div id='showMoreOption'>+ More Colors</div></div>"),e.find("#showMoreOption").off("click").on("click",{containerClassName:i,self:o},o.handleShowMore),!0},palette:[e]}),s},handleShowMore:function(e){var i=n()("."+e.data.containerClassName);e.data.self.showColorPicker(i)},showColorPicker:function(e){e.find(".sp-picker-container .sp-top, .sp-picker-container .sp-input-container").show(),e.removeClass("palette-view"),e.find("#showMoreContainer").remove()}}),v=t(85614),y=t.n(v),b=t(45925),w=t.n(b),C=t(51898),k=t.n(C),x=t(66671),P=t(952),V=t.n(P),$=t(49046),T=t.n($),I=(t(38482),t(91272)),S=(t(12419),t(15861)),F=t(15785),L=t(15671),_=t(43144),R=t(60136),E=t(73930),z=t(61120),A=t(64687),B=t.n(A),M=(t(64765),t(56977),t(73210),t(40561),t(92222),t(91058),t(21249),t(15306),t(88674),t(39575),t(82472),t(92990),t(18927),t(33105),t(35035),t(74345),t(7174),t(32846),t(44731),t(77209),t(96319),t(58867),t(37789),t(33739),t(29368),t(14483),t(12056),t(3462),t(30678),t(27462),t(33824),t(55021),t(12974),t(15016),t(4723),t(29254),t(23157),t(34553),t(1618)),D=t(7020),O=t.n(D),U=t(96467),j=t.n(U),N=t(81460),W=t(97081),J=t.n(W),H=t(7607),G=t.n(H),Z=t(71665),Y=(t(31169),t(59116),t(67214),t(95665),t(39045),t(96134),t(96951),t(45371),t(99307),t(86222)),K=t.n(Y),q=t(3480),X=t.n(q),Q=t(75884),ee=t.n(Q),ie=t(68227),te=t.n(ie),oe=(t(20454),t(63981)),se=t(92883),ae=t(61650),re=t.n(ae),ne=(t(86227),t(62526),t(13919));var le,de=["image/png","image/jpeg","image/jpg","image/bmp"],ce=["webm","mkv","flv","vob","ogv","avi","mov","qt","wmv","yuv","rm","rmvb","asf","amv","mp4","quicktime","m4p","m4v","mpg","mp2","mpeg","mpe","mpv","m2v","svi","3gp","3g2","mxf","roq","nsv","f4v","f4p","f4a","f4b","swf"],he=oe.Z.SUPPORTED_IMAGE_FORMATS,pe=["audio/*"],ue=oe.Z.ACCEPTED_VIDEO_TYPES,me=oe.Z.ACCEPT_IMAGE_ONLY_FORMATS,fe=oe.Z.SUPPORTED_DOC_FORMATS,ge=["application/pdf"],ve="Something went wrong. Please contact support@hippovideo.io",ye=[{category:"audioLibrary",type:"s3"},{category:"existingMedia",type:"existing_media"},{category:"webSearch",type:"url"},{category:"gDrive",type:"gdrive"},{category:"shopify",type:"shopify"},{category:"videoLibrary",type:"video_library"}],be=function(e){(0,R.Z)(a,e);var i,t,o,s=(t=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=(0,z.Z)(t);if(o){var s=(0,z.Z)(this).constructor;e=Reflect.construct(i,arguments,s)}else e=i.apply(this,arguments);return(0,E.Z)(this,e)});function a(){return(0,L.Z)(this,a),s.apply(this,arguments)}return(0,_.Z)(a,[{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.gDriveToken=void 0,this.nextWebFileId=0,this.totalLocalFiles=0,this.isDrawOpen=!1,this.webSearchPerPage=20,this.recentlyUsedNextPage=0,this.driveNextPageToken=void 0,this.selectList=[],this.driveAccounts=[],this.configuredDriveAccount=void 0,this.configuredDriveUserId=void 0,this.categoriesAndTags={},this.testimonialCategoriesList=void 0,this.isWebSearching=!1,this.isDrawForceClosed=!1,this.isMediaUploading=!1,this.isDriveInitializationChecked=!1,this.isLibraryVideoInitializationChecked=!1,this.contactId=e.contactId,this.contactEmail=e.contactEmail,this.fromSDK=e.fromSDK,this.sdkVideoModel=e.sdkVideoModel,this.$el=void 0===e.el?n()("#importMediaContainer"):n()(e.el),this.importType=e.type||"image",this.onlyDoc=e.onlyDoc||!1,this.actionType=e.actionType,this.isMultiple=void 0===e.isMultiple||e.isMultiple,this.maximumFilesAllowed=e.maximumFilesAllowed||50,this.maximumPerFileSize=e.maximumPerFileSize||10,this.handleOneFileUpload=e.handleOneFileUpload||!1,this.mediaCategoryId=e.mediaCategoryId,this.isPrimaryVideoPresent=e.isPrimaryVideoPresent,this.showSelectedDrawer=!this.handleOneFileUpload,this.callbackMethodToHandleFiles=e.callbackMethodToHandleFiles||function(){},this.fromAddMore=e.fromAddMore,this.digest=void 0!==e.digest&&e.digest,this.callBack=e.importVideoPreview,this.closeImportCallback=e.closeImportCallback,this.allowCloseImportWhileUploading=void 0===e.allowCloseImportWhileUploading||e.allowCloseImportWhileUploading,this.isProEditImport=void 0!==e.isFromProEdit&&e.isFromProEdit,this.canShowVideoLibrary=this.isProEditImport||e.canShowVideoLibrary,this.callBackProEdit=void 0!==e.callBackProEdit&&e.callBackProEdit,this.canShowImageWebSearch=!("image"!==this.importType&&!e.canShowImageWebSearch),this.canShowShopify=!("image"!==this.importType&&!e.canShowShopify),this.canShowAddViaLink=e.canShowAddViaLink||!1,this.canShowTabs=null==e.canShowTabs||e.canShowTabs,this.restrict_gif=e.restrict_gif||!1,this.virtualBgImage=e.virtualBgImage,this.needAssetId=e.needAssetId||!1;var i=e.fromEdit||!1,t=h.default.getLocalStorageValue("defaultFolderId-"+HippoVideo.data.api.getProperty("userId"));this.selectedCategory=t||0,i&&(this.canShowShopify=!1,this.canShowImageWebSearch=!1),this.virtualBgImage&&(this.canShowShopify=!1),this.saveLibraryVideoAsNewAsset=void 0===e.saveLibraryVideoAsNewAsset||e.saveLibraryVideoAsNewAsset,this.importMediaCallback=e.importMediaCallback,this.showVideoImportPreview=void 0===e.showVideoImportPreview||e.showVideoImportPreview,this.canShowAudioLibrary=!("audio"!==this.importType&&!e.canShowAudioLibrary),this.canShowRecentlyUsed=null==e.canShowRecentlyUsed?!this.isVideoImport():e.canShowRecentlyUsed,this.canShowVideoLibraryMulti=null!=e.canShowVideoLibraryMulti&&e.canShowVideoLibraryMulti,this.isFromVideoPages=null!=e.fromVideoPages&&e.fromVideoPages,this.videoOnly=null!=e.videoOnly&&e.videoOnly,this.isNeedCreateBtn=null==e.isNeedCreateBtn||e.isNeedCreateBtn,this.actionFrom="importLocalTab",this.canShowCreateVideoOption=!1,this.canShowTestimonial=this.isProEditImport&&HippoVideo.data.api.getProperty("isTestimonialEnabled"),this.canShowGdriveImport=null==e.canShowGdriveImport?!this.digest:e.canShowGdriveImport,this.canImportImageFromLibrary=null!=e.canShowImageLibrary?e.canShowImageLibrary:"image"===this.importType,this.canShowImportFromLocal=null==e.canShowImportFromLocal?!this.digest:e.canShowImportFromLocal,this.isSalesGettingStarted=void 0!==e.isSalesGettingStarted&&e.isSalesGettingStarted,this.cancelRedirect=!0,this.fromSalesForce=e.fromSalesForce||!1,this.isOutlookSpecific=e.isOutlookSpecific||!1,this.leadName=e.leadName,this.isShopifyUser=HippoVideo.AppRegistry.isShopifyUser,this.isFromCarousel=e.isFromCarousel||!1,this.isIntroOutroVideo=e.isIntroOutroVideo||!1,this.isFromVideoTemplateCard=e.isFromVideoTemplateCard||!1,this.renderingFirstTime=!0,this.fileChangeCount=0,this.importStartTime=null,this.customParams=e.customParams,this.importList=[],this.selectedFilesList=this.selectList,this.showAddMoreTemplate=null==e.showAddMoreTemplate||e.showAddMoreTemplate,this.isMultipleImageImport=!1,this.canShowWebLink=e.canShowWebLink||!1,this.virtualBGFromWeblink=e.virtualBGFromWeblink||!1,this.preserveTransparencyEnabled=HippoVideo.data.api.getProperty("preserveTransparencyEnabled"),this.videoLibraryBodyEl=n()("#importVideoLibraryContainer"),this.selectedContentTypeCount=1,this.isAddLinkEnable=!1;try{this.Logger=HippoVideo.Class.Logger.getLogger("ImportMediaView")}catch(e){console.log(e)}this.isFromVideoPages&&(this.onVideoSubmit=e.onVideoSubmit,this.pageId=e.pageId,this.alreadySelectedFiles=e.selectedFiles,this.thumbDomain=e.thumbDomain,this.canShowCreateVideoOption=!0),this.onlyDoc&&(this.canShowCreateVideoOption=!1),this.isNeedCreateBtn||(this.canShowCreateVideoOption=!1),this.search={type:"image",query:"",page:1,perPage:30},!this.isDocOrVideoImport()&&!this.isImageImport()||this.digest?this.render():(this.cancelRedirect=!1,this.fetchTagsAndCategories(),this.canShowTestimonial&&this.fetchTestimonialCategories())}},{key:"render",value:function(){var e,i=this;switch(this.importType){case"image":e=this.restrict_gif?me:he;break;case"audio":e=pe;break;case"video":e=ue,this.isProEditImport&&(e=(e=e+","+he)+","+pe);break;case"doc":e=fe+","+he,this.onlyDoc&&(e=fe);break;case"custom":e=this.customParams.acceptedFormats}G()((0,M.YH)(x.Z.t.wizImport,{title:this.getImportTitle(),type:this.importType,isMultiple:this.isMultiple,fromVideoPages:this.isFromVideoPages,maxFileSize:this.maximumPerFileSize,formatsList:this.getSupportedFormats(),acceptFormats:e,selectedTitle:this.getSelectedTitle(),canShowImportFromLocal:this.canShowImportFromLocal,handleOneFileUpload:this.handleOneFileUpload,isPrimaryVideoPresent:this.isPrimaryVideoPresent,canShowRecentlyUsed:this.canShowRecentlyUsed,canShowAudioLibrary:this.canShowAudioLibrary,canShowVideoLibraryMulti:this.canShowVideoLibraryMulti,canShowImageWebSearch:this.canShowImageWebSearch,canShowGdriveImport:this.canShowGdriveImport,canShowWebLink:this.canShowWebLink,virtualBGFromWeblink:this.virtualBGFromWeblink,canImportImageFromLibrary:this.canImportImageFromLibrary,canShowShopify:this.canShowShopify,canShowVideoLibrary:this.canShowVideoLibrary,canShowTestimonial:this.canShowTestimonial,canUploadImageFromLocal:this.isProEditImport,canUploadAudioFromLocal:this.isProEditImport,testimonialcategories:this.testimonialCategoriesList?this.testimonialCategoriesList.categories:void 0,categories:this.categoriesAndTags.categories,canShowCreateVideoOption:this.canShowCreateVideoOption,isShopifyUser:this.isShopifyUser,canShowAddViaLink:this.canShowAddViaLink,canShowTabs:this.canShowTabs,isOnlyDoc:this.onlyDoc}),(function(e,t){i.$el.empty().append(n()(t)),i.initializeEventListeners(),i.initUI(),i.$el.show(),"image"!=i.importType||"shopify"!=i.actionType&&!i.isShopifyUser||(n()("#import").text("Create Video"),n()("#importShopifyTab").click());var o={theme:"hippocategory",width:"element",dropdownCssClass:"et-dropdown-css"};i.isMultiple&&n()("#selectedImageGallery").sortable({containment:"parent",cursor:"move",tolerance:"pointer",items:"> .media-video",placeholder:"image image-placeholder"}),n()("#shopifyProducts").select2(o),n()("#shopifyStores").select2(o),n()("#videoCatList").select2(o)}))}},{key:"initializeEventListeners",value:function(){this.closeImport=this.closeImport.bind(this),this.filesChangeHandler=this.filesChangeHandler.bind(this),this.filesDropHandler=this.filesDropHandler.bind(this),this.playerSlideChanged=this.playerSlideChanged.bind(this),this.fetchRecentlyUsed=this.fetchRecentlyUsed.bind(this),this.showGoogleLogin=this.showGoogleLogin.bind(this),this.videoConverting=this.videoConverting.bind(this),this.handleImportButtonClick=this.handleImportButtonClick.bind(this),this.importVideoFileAndProceed=this.importVideoFileAndProceed.bind(this),this.updateVideoImportDetails=this.updateVideoImportDetails.bind(this),this.enableChangeFileBtn=this.enableChangeFileBtn.bind(this),this.disableChangeFileBtn=this.disableChangeFileBtn.bind(this),this.cancelHandler=this.cancelHandler.bind(this),this.cancelWebLinkHandler=this.cancelWebLinkHandler.bind(this),this._searchCategoriesList=this._searchCategoriesList.bind(this),this._clearCategoriesList=this._clearCategoriesList.bind(this),this.refreshLibrary=this.refreshLibrary.bind(this),this.showReloadBtn=this.showReloadBtn.bind(this),this.initializeShopify=this.initializeShopify.bind(this),this.shopifyProductsChanged=this.shopifyProductsChanged.bind(this),this.shopifyStoreChanged=this.shopifyStoreChanged.bind(this),this.showShopifyGallery=this.showShopifyGallery.bind(this),this.showShopifyLogin=this.showShopifyLogin.bind(this),this.linkAddToDrawer=this.linkAddToDrawer.bind(this),this.openDrawer=this.openCloseDrawer.bind(this,!0),this.closeDrawer=this.openCloseDrawer.bind(this,!1),this.videoCompressing=this.videoCompressing.bind(this),this.showNameAndThumbnailEdit=this.showNameAndThumbnailEdit.bind(this),this._handleLinkIconChange=this._handleLinkIconChange.bind(this),this.filterTags=this.filterTags.bind(this),this.renderTags=this.renderTags.bind(this),this.$el.find("#import").bind("click",this.handleImportButtonClick),this.$el.find("#closeImport, #cancelImport").bind("click",this.closeImport),this.$el.find(".tab").bind("click",{context:this},this.changeTab),this.$el.find("#libraryRefresh").bind("click",{context:this},this.refreshLibrary),this.$el.find("#browseFiles").bind("click",(function(){n()("#importFileUpload")[0].click()})),this.$el.find("#importFileUpload").bind("change",this.filesChangeHandler),this.$el.find(".search-from-web-box").bind("keypress",{context:this},this.searchBoxkeyPressed),this.$el.find(".search-icon").bind("click",{context:this},this.searchImageClicked),this.$el.find("#loadMoreContent").bind("click",{context:this},this.loadMoreImages),this.$el.find("#importLocalBanner, #importLocalContent").unbind("drop",!1).bind("drop",this.filesDropHandler),this.$el.find("#importLocalBanner, #importLocalContent").unbind("dragover",!1).bind("dragover",this.filesDropHandler),this.$el.find("#mediaGenre").bind("change",{context:this},this.mediaGenreChanged),this.$el.find("#driveAccessBtn").bind("click",{context:this},this.showGoogleLogin),this.$el.find("#shopifyAccessBtn").bind("click",{context:this},this.showShopifyLogin),this.$el.find("#driveAccounts").bind("change",{context:this},this.driveAccountChanged),this.$el.find("#shopifyProducts").bind("change",{context:this},this.shopifyProductsChanged),this.$el.find("#shopifyStores").bind("change",{context:this},this.shopifyStoreChanged),this.$el.find("#loadMoreContentDrive").bind("click",{context:this},this.loadMoreFromDrive),this.$el.find("#cancelVideoForm").bind("click",{context:this},this.cancelHandler),this.$el.find("#cancelWebLink").bind("click",{context:this},this.cancelWebLinkHandler),this.$el.find("#submitVideoForm").bind("click",{context:this},this.updateVideoImportDetails),this.$el.find("#videoCatList").bind("change",{context:this},this.videoCategoryChange),this.$el.find("#importVideoLibraryContainer").bind("scroll",{context:this},(0,M.Rs)(this.onScrollHandle,300)),this.$el.find(".hv-content-type-tags").bind("click",{context:this},this.handleContentTypeChange),this.$el.find("#testimonialCatList").bind("change",{context:this},this.testimonialCategoryChange),this.$el.find("#importVideoLibrarySearch").bind("keypress",{context:this},this._searchCategoriesList),this.$el.find("#clear-icon").bind("click",{context:this},this._clearCategoriesList),this.$el.find("#loadMoreLibraryVideo").bind("click",{context:this},this.loadMoreFromVideoLibrary),this.$el.find("#createVideoFromImportBtn").bind("click",{context:this},this.showReloadBtn),this.initializeImportViaWebSiteLink=this.initializeImportViaWebSiteLink.bind(this),this.addWebsiteLink=this.addWebsiteLink.bind(this),this.resetWebsiteLink=this.resetWebsiteLink.bind(this),this.showWebSitePreview=this.showWebSitePreview.bind(this),this.showWebSitePreviewError=this.showWebSitePreviewError.bind(this),this.getFileFromUrl=this.getFileFromUrl.bind(this),this.dataURLtoFile=this.dataURLtoFile.bind(this),this.documentImportSuccessCallback=this.documentImportSuccessCallback.bind(this),this.ImportGdriveVideoSuccessCallback=this.ImportGdriveVideoSuccessCallback.bind(this),this.webLinkUrlChanged=this.webLinkUrlChanged.bind(this),this.showSelectedDrawer&&(this.$el.find("#openDrawHandle").bind("click",this.openDrawer),this.$el.find("#closeDrawHandle").bind("click",this.closeDrawer),this.$el.find(".scroll-arrow").bind("click",{context:this},this.scrollSelectionStrip))}},{key:"initUI",value:function(){this.$el.find("#importFromLocal").removeClass("hide"),this.virtualBGFromWeblink&&this.$el.find("#importViaWebLink").click(),this.isFromVideoPages&&(this.$el.find("#footnote").remove(),(this.isPrimaryVideoPresent||this.isMultiple||!this.isFromCarousel)&&this.$el.find("#importVideoLibraryTabMulti").click()),this.updateSelectedCounter(),setTimeout((function(){var e=n()(window).outerHeight(),i=n()(".import-media-container").outerHeight();e>i?n()(".import-media-container").css("margin-top",Math.floor((e-i)/2)+"px"):n()(".import-media-container").css("margin-top","15px")}),50)}},{key:"fetchTagsAndCategories",value:function(){var e=this;this._getVideoModel().getTagsVideoCategories((function(i){e.isDocumentImport()||e.isImageImport()||(e.maximumPerFileSize=i.import_file_size),e.numImportsExceeded=i.num_imports_exceeded,e.categoriesAndTags=i||{},e.canShowTestimonial||e.render()}),(function(e){p.default.showBannerAlert(ve,4e3,"error")}))}},{key:"fetchTestimonialCategories",value:function(){var e=this;(new Z.Z).fetchTestimonialCategory((function(i){e.testimonialCategoriesList=i||{},e.render()}),(function(i){e.$el.find(".import-drive-spin-loading").addClass("hide"),p.default.showBannerAlert(ve,4e3,"error")}))}},{key:"getSupportedFormats",value:function(){return this.isProEditImport?"MP4, MKV, FLV, MPEG, 3GP, MP3, JPEG, PNG and GIF":this.isVideoImport()?"MP4, MKV, FLV, MPEG, 3GP":this.isAudioImport()?"MP3, WMA, WAV":this.isImageImport()?"JPEG, PNG, BMP":this.isDocumentImport()?"PDF, PPT, PPTX, DOC, DOCX, TXT, RTF, JPG, JPEG, PNG, BMP, GIF":void 0}},{key:"getImportTitle",value:function(){if(this.isProEditImport)return x.Z.t.wizImport.importMedia;var e;switch(this.importType){case"image":default:e=x.Z.t.wizImport.importImages;break;case"audio":e=x.Z.t.wizImport.importAudio;break;case"video":e="replace"==this.actionType?x.Z.t.wizPreview.replaceVideo:x.Z.t.wizImport.importVideo;break;case"custom":var i=this.customParams.name;e=x.Z.t.wizImport.custom[i].title}return e}},{key:"getSelectedTitle",value:function(){var e;switch(this.importType){case"image":default:e=x.Z.t.wizImport.imagesSelected;break;case"audio":e=x.Z.t.wizImport.audiosSelected;break;case"video":e=x.Z.t.wizImport.videosSelected;break;case"custom":var i=this.customParams.name;e=x.Z.t.wizImport.custom[i].selectionTitle}return e}},{key:"isVideoImport",value:function(){return"video"===this.importType}},{key:"isAudioImport",value:function(){return"audio"===this.importType}},{key:"isImageImport",value:function(){return"image"===this.importType}},{key:"isDocumentImport",value:function(){return"doc"===this.importType}},{key:"isCustomImport",value:function(){return"custom"===this.importType}},{key:"isDocOrVideoImport",value:function(){var e=this.isDocumentImport(),i=this.isVideoImport(),t=this.isCustomImport()&&this.customParams.isDocOrVideoImport;return e||i||t}},{key:"filesChangeHandler",value:function(e){var i=(e.target||[]).files;return this.importStartTime||(this.importStartTime=(new Date).getTime()/1e3),this.processImportFiles(i),!1}},{key:"filesDropHandler",value:function(e){var i=[],t=(e.originalEvent.dataTransfer||[]).items;this.importStartTime||(this.importStartTime=(new Date).getTime()/1e3),e.preventDefault();for(var o=0;o<t.length;o++)i.push(t[o].getAsFile());this.processImportFiles(i)}},{key:"canUploadVideoinBackground",value:function(e){return void 0!==e?this.isLocalVideoImport=this.isVideoImport()&&!this.isProEditImport&&this.showVideoImportPreview&&"local_file"===e[0].upload_type:void 0===this.isLocalVideoImport&&(this.isLocalVideoImport=this.isVideoImport()&&!this.isProEditImport&&this.showVideoImportPreview&&"gdrive"!==this.getSelectedMedia()[0].upload_type),this.isLocalVideoImport}},{key:"startVideoUploadAfterFileSelection",value:function(){this.canUploadVideoinBackground()&&(this.disableChangeFileBtn(),this.assetId?(this.abortVideoUpload(),this.updateVideoS3Key()):this.importVideoFileAndProceed())}},{key:"processImportFiles",value:function(e){var i=this,t=this.validateAndGetFiles(e),o=t.length,s=0,a=this;if(o>0)for(var r=function(){var e=t[n];if(e.id="localFile-".concat(a.totalLocalFiles++),e.sizeFormatted="".concat((e.size/1048576).toFixed(2)," MB"),e.isImagePreview=a.isImageImport(),e.isAudioPreview=a.isAudioImport(),e.isVideoPreview=a.isVideoImport(),e.upload_type="local_file",a.isAudioImport()||a.isDocOrVideoImport()){if(e.isImagePreview=!0,e.preview_url="/img/film-hippo.png",++s>=o&&1==o)a.displayLocalFiles(t),a.$el.find("#importLocalBanner").addClass("hide"),i.startVideoUploadAfterFileSelection();else if(o>1)return se.Z.isDocument(e.name)||se.Z.isImage(e.name)?(i.isMultipleImageImport=!0,i.totalFiles=o,i.validatedImageFiles=t,i.displayLocalFiles(t),a.$el.find("#importLocalBanner").addClass("hide")):(i.hippoYogaLoader=new N.Z({id:"importVideoFormContainer"}),i.hippoYogaLoader.render(),i.hippoYogaLoader.updateProgressText(x.Z.t.progressMessages.preparingFile),i.$el.find("#tabContainer, .import-footer, #importFromLocal").toggleClass("hide"),i.totalFiles=o,i.processMultipleVideoImport(t)),"break"}else{var r=new FileReader;r.onload=function(i){e.local_src=i.target.result,e.preview_url=r.result,++s>=o&&(a.displayLocalFiles(t),a.$el.find("#importLocalBanner").addClass("hide"))},r.readAsDataURL(e)}},n=0;n<o&&"break"!==r();n++);}},{key:"imageLoadedCallback",value:function(e){n()(e.target.parentElement).find(".animated-background").fadeOut("slow")}},{key:"searchBoxkeyPressed",value:function(e){var i=e.data.context,t=e.key,o=i.$el.find("#searchFromWebTextBox").val().trim()||"";"Enter"===t&&o&&!i.isWebSearching&&i.searchImages(o,1)}},{key:"searchImageClicked",value:function(e){var i=e.data.context,t=i.$el.find("#searchFromWebTextBox").val().trim()||"";t&&!i.isWebSearching&&i.searchImages(t,1)}},{key:"searchImages",value:function(e,i){var t=this,o=!1;this.isWebSearching=!0,this.$el.find(".search-icon").addClass("hide"),this.$el.find(".import-spin-loading").removeClass("hide"),this.$el.find(".search-from-web-box").val(e),h.default.trackInThirdPartyTools("Import-Pop - Image Web Searching ",{}),(new Z.Z).searchFromWeb(e,i,this.webSearchPerPage,"flickr","image",(function(s){e!==t.search.query&&t.$el.find("#importWebContent").empty(),t.displayWebFiles(s),t.search.query=e,o=!s.has_photos,(new Z.Z).searchFromWeb(e,i,t.webSearchPerPage,"pexels","image",(function(e){t.displayWebFiles(e),t.$el.find(".search-icon").removeClass("hide"),t.$el.find(".import-spin-loading").addClass("hide"),t.isWebSearching=!1,(o=o&&!e.has_photos)&&0===t.$el.find("#importWebContent .image").length&&!t.isWebSearching?(t.$el.find("#webSearchEmptyState").removeClass("hide"),t.$el.find("#loadMoreContent").addClass("hide")):(t.$el.find("#webSearchEmptyState").addClass("hide"),t.$el.find("#loadMoreContent").removeClass("hide"))}),(function(e){t.isWebSearching=!1,t.$el.find(".search-icon").removeClass("hide"),t.$el.find(".import-spin-loading").addClass("hide"),p.default.showBannerAlert(ve,4e3,"error"),p.default.postErrorsToLog({error:"Error while searching Images from pexels :: ",stackTrace:JSON.stringify(e)})}))}),(function(e){t.isWebSearching=!1,t.$el.find(".search-icon").removeClass("hide"),t.$el.find(".import-spin-loading").addClass("hide"),p.default.showBannerAlert(ve,4e3,"error"),p.default.postErrorsToLog({error:"Error while searching Images from Flickr :: ",stackTrace:JSON.stringify(e)})}))}},{key:"mediaGenreChanged",value:function(e){var i=e.data.context,t=n()(e.target).val();i.searchMediaFromLibrary(t),h.default.trackInThirdPartyTools("Import-Pop - Media Genre changed to ".concat(t),{})}},{key:"searchMediaFromLibrary",value:function(){var e=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"jazz";this.$el.find(".import-spin-loading").removeClass("hide"),(new Z.Z).searchMediaLibrary(i,(function(i){X()((0,M.YH)(x.Z.t.wizImport,{files:i.audio,type:"audio",isSortable:!1,showDelete:!1,isMultiple:e.isMultiple,showControls:!0,showAddMoreTemplate:!1,category:"audioLibrary"}),(function(i,t){e.$el.find("#importLibraryContent").empty().append(n()(t)),e.$el.find(".import-spin-loading").addClass("hide"),e.$el.find("#importLibraryContent .image").unbind().bind("click",{context:e},e.toggleMediaSelection),e.initializeAudioPlayerActions()}))}),(function(i){p.default.showBannerAlert(ve,4e3,"error"),e.$el.find(".import-spin-loading").addClass("hide")}))}},{key:"fetchRecentlyUsed",value:function(){var e=this;this.$el.find(".import-recent-spin-loading").removeClass("hide"),this.isFetchingRecentlyUsed=!0,(new Z.Z).fetchRecentlyUsed(this.importType,this.recentlyUsedNextPage,(function(i){X()((0,M.YH)(x.Z.t.wizImport,{files:i.urls,type:e.importType,isSortable:!1,showDelete:!1,isMultiple:e.isMultiple,showControls:!0,showAddMoreTemplate:!1,category:"existingMedia"}),(function(t,o){e.recentlyUsedNextPage++,e.isFetchingRecentlyUsed=!1,e.$el.find("#recentlyUsedContent").append(n()(o)),e.$el.find(".import-recent-spin-loading").addClass("hide"),e.$el.find("#recentlyUsedContent .gallery-view").one("load",{context:e},e.imageLoadedCallback),e.$el.find("#recentlyUsedContent .image").unbind().bind("click",{context:e},e.toggleMediaSelection),i.has_more?e.$el.find("#loadMoreContentrecent").unbind().bind("click",e.fetchRecentlyUsed).removeClass("hide"):e.$el.find("#loadMoreContentrecent").addClass("hide"),0===e.$el.find("#recentlyUsedContent .image").length?(e.isFetchingRecentlyUsed=!0,e.$el.find("#recentlyUsedEmptyState").removeClass("hide")):e.$el.find("#recentlyUsedEmptyState").addClass("hide"),e.initializeAudioPlayerActions()}))}),(function(i){e.isFetchingRecentlyUsed=!1,p.default.showBannerAlert(ve,4e3,"error"),e.$el.find(".import-recent-spin-loading").addClass("hide")}))}},{key:"loadMoreImages",value:function(e){var i=e.data.context,t=i.search.query||"";t&&!i.isWebSearching&&i.searchImages(t,++i.search.page)}},{key:"toggleMediaSelection",value:function(e){var i=e.data.context,t=i.selectedFilesList,o=e.currentTarget,s=i.getSelectedMedia(),a=n()(o).find("img")[0],r=n()(o).find("input")[0],l=a.dataset.thumbnailurl;if(!n()(e.target).hasClass("player-progress"))if(n()(o).hasClass("selected"))i.removeFileFromSelection(o.id);else if(i.handleOneFileUpload&&1===s.length&&i.removeFileFromSelection(s[0].id),i.getSelectedMedia().length<i.maximumFilesAllowed){n()(o).addClass("selected");var d=o.dataset.isDocument,c=o.dataset.isImage,u=o.dataset.fileExt;if(o.id.includes("local")){var m=(0,M.Kr)(t,{id:o.id}),f=t.splice(m,1);f[0].local_src=a.src,f[0].upload_type="local_file",f[0].is_document=d,f[0].is_image=c,f[0].file_ext=u,i.addFilesToSelectedList(f)}else{var g=(0,M.zU)(ye,{category:a.dataset.category})[0]||[],v="audioLibrary"===a.dataset.category?void 0:a.dataset.url;i.isFromVideoPages&&(v=l=r.dataset.thumbnail);var y=o.id;"importImgLibTab"==i.actionFrom&&(v=l=r.dataset.thumbnail,i.isProEditImport&&(y=o.dataset.assetDetails)),i.addFilesToSelectedList([{id:y,upload_type:g.type,url:v,name:a.dataset.name,description:a.dataset.description,bucket:a.dataset.bucket,key:a.dataset.key,thumbnail_url:l,video_id:y,video_token:o.dataset.token,token_id:i.gDriveToken,is_document:d,is_image:c,file_ext:u,duration:a.dataset.duration}])}}else p.default.showBannerAlert("You can select a maximum of ".concat(i.maximumFilesAllowed," ").concat(i.importType," files to import."),3e3,"error"),h.default.trackInThirdPartyTools("Import-Pop - User selecting more than max files ",{}),i.isDrawOpen||i.$el.find("#openDrawHandle")[0].click()}},{key:"scrollSelectionStrip",value:function(e){var i=e.data.context,t=i.$el.find("#selectedImageGallery").innerWidth(),o=i.$el.find("#selectedImageGallery").scrollLeft(),s=n()(e.currentTarget).hasClass("scroll-left")?o-t:o+t;i.$el.find("#selectedImageGallery").animate({scrollLeft:s},"slow")}},{key:"handlePlayPauseMedia",value:function(e){var i=e.data.context,t=e.currentTarget.dataset.footage,o=i.$el.find("#".concat(t," .media-controls")).hasClass("playing");i.$el.find(".image .media-controls").removeClass("playing"),i.$el.find(".image .audio-player").each((function(){this.pause()})),o||(i.$el.find("#".concat(t," .media-controls")).addClass("playing"),i.$el.find("#".concat(t," .audio-player"))[0].play()),e.stopPropagation()}},{key:"handleLoadedMetaData",value:function(e){var i=e.data.context,t=e.currentTarget.dataset.footage;i.$el.find("#".concat(t," .media-duration")).text(Number(this.duration/60).toFixed(2)),i.$el.find("#".concat(t," .player-progress")).slider({orientation:"horizontal",range:"min",min:0,max:this.duration,slide:i.playerSlideChanged}),n()(this).unbind().bind("timeupdate",{context:i},i.handleMediaTimeUpdate),i.$el.find("#".concat(t)).addClass("media-ready")}},{key:"handleMediaTimeUpdate",value:function(e){var i=e.data.context,t=e.currentTarget.dataset.footage;i.$el.find("#".concat(t," .player-progress")).slider("option","value",this.currentTime)}},{key:"playerSlideChanged",value:function(e,i){var t=e.currentTarget.dataset.footage;this.$el.find("#".concat(t," .audio-player"))[0].currentTime=i.value,e.stopPropagation()}},{key:"addLocalFilesToSelectedList",value:function(e){var i=this.getSelectedMedia().length,t=this.maximumFilesAllowed;this.isFromVideoPages&&"importLocalTab"===this.actionFrom?this.addToSelectedList(e):i<t&&(e.length<=t-i?this.addFilesToSelectedList(e):this.addFilesToSelectedList(e.splice(0,t-i)))}},{key:"displayLocalFiles",value:function(e){var i=this;X()((0,M.YH)(x.Z.t.wizImport,{files:e,type:this.importType,isSortable:!1,showDelete:!1,showControls:!0,isMultiple:this.isMultiple,showAddMoreTemplate:this.showAddMoreTemplate,category:"localFile",acceptFormats:this.customParams&&this.customParams.acceptedFormats}),(function(t,o){i.canUploadVideoinBackground(e)&&n()("#importLocalContent .media-video").hide(),i.$el.find("#importLocalContent .secondary-upload").remove(),i.$el.find("#importLocalContent").append(n()(o)),i.$el.find("#importLocalContentContainer").removeClass("hide"),i.addLocalFilesToSelectedList(e),i.initializeLocalGalleryActions(),i.initializeAudioPlayerActions(),i.isDocOrVideoImport()&&i.handleImportButtonClick()}))}},{key:"displayWebFiles",value:function(e){var i=this,t=e.urls||[];t.forEach((function(e){e.id="webFile-".concat(i.nextWebFileId++)})),X()((0,M.YH)(x.Z.t.wizImport,{files:t,type:"image",isSortable:!1,showDelete:!1,showControls:!0,isMultiple:this.isMultiple,showAddMoreTemplate:!1,category:"webSearch"}),(function(e,t){i.$el.find("#importWebContent").append(n()(t)),i.$el.find("#importWebContentContainer").removeClass("hide"),i.$el.find("#importWebBanner").addClass("hide").empty(),i.$el.find("#importWebContent .gallery-view").one("load",{context:i},i.imageLoadedCallback),i.$el.find("#importWebContent .image").unbind().bind("click",{context:i},i.toggleMediaSelection),i.$el.find("#footerPoweredBy, #loadMoreContent").removeClass("hide"),i.$el.find("#footnote").addClass("hide")}))}},{key:"initializeLocalGalleryActions",value:function(){var e=this;this.$el.find("#importLocalContent .gallery-view").one("load",{context:this},this.imageLoadedCallback),this.$el.find("#importLocalContent .gallery-delete").unbind().bind("click",{context:this},this.deleteFile),this.$el.find("#importLocalContent .image").unbind().bind("click",{context:this},this.toggleMediaSelection),this.$el.find("#secondaryUploadContainer").unbind().bind("click",(function(){e.$el.find("#secondaryFileUpload")[0].click()})),this.$el.find("#secondaryFileUpload").unbind().bind("change",this.filesChangeHandler)}},{key:"initializeAudioPlayerActions",value:function(){("audio"===this.importType||this.isProEditImport)&&(this.$el.find(".image .play-icon").unbind().bind("click",{context:this},this.handlePlayPauseMedia),this.$el.find(".image .audio-player").on("loadedmetadata",{context:this},this.handleLoadedMetaData))}},{key:"initializeMediaLibrary",value:function(){0===this.$el.find("#importLibraryContent .image").length&&this.searchMediaFromLibrary()}},{key:"initializeRecentlyUsed",value:function(){0!==this.$el.find("#recentlyUsedContent .image").length||this.isFetchingRecentlyUsed||this.fetchRecentlyUsed()}},{key:"initializeShopify",value:function(e){var i=this;this.$el.find(".import-shopify-spin-loading").removeClass("hide"),this.$el.find(".import-shopify-spin-loading").addClass("show"),this.$el.find("#importshopifyEmptyState").removeClass("hide"),this.$el.find("#importshopifyEmptyState").addClass("hide"),(new Z.Z).fetchShopifyProducts(e,(function(t){if(i.products=t,i.products.code>0)n()("#importShopifyBanner").show(),n()("#importshopifyContainer").hide(),i.$el.find(".import-shopify-spin-loading").removeClass("hide"),i.$el.find(".import-web-banner-shopify").removeClass("hide");else{var o,s=[];i.$el.find("#shopifyProducts").empty(),i.$el.find("#shopifyStores").empty(),n()("#importshopifyContainer").show(),i.$el.find("#shopifyProductsFilter").removeClass("hide");for(var a=0;a<i.products.access_params.data.length;a++)o=n()("<option>").text(i.products.access_params.data[a].app_url).attr("value",i.products.access_params.data[a].app_url),i.products.access_params.data[a].app_url==e&&o.attr("selected","selected"),i.$el.find("#shopifyStores").append(o),i.isShopifyUser||a==i.products.access_params.data.length-1&&(o=n()("<option>").text("Add Store").attr("value","Add Store"),i.$el.find("#shopifyStores").append(o));if(o=null,i.products.data.products.length){n()("#shopifyProductWrap").show();for(var r=0;r<i.products.data.products.length;r++)if(i.products.data.products[r].images&&i.products.data.products[r].images.length>0){if(o=n()("<option>").text(i.products.data.products[r].title).attr("value",i.products.data.products[r].id),0==s.length){o.attr("selected","selected");for(var l=0;l<i.products.data.products[r].images.length;l++){var d={id:i.products.data.products[r].images[l].id,url:i.products.data.products[r].images[l].src,upload_type:"url",title:i.products.data.products[r].title};s.push(d)}}i.$el.find("#shopifyProducts").append(o)}}else o=n()("<option>").text("No products found").attr("value",""),i.$el.find("#shopifyProducts").append(o);i.showShopifyGallery(s),i.isShopifyUser&&(i.removeAllFilesFromSelection(),n()("#selectedImageGallery").empty(),i.addFilesToSelectedList(s))}}),(function(e){i.isFetchingDrive=!1,i.$el.find(".import-shopify-spin-loading").addClass("hide"),p.default.showBannerAlert(ve,4e3,"error")}))}},{key:"shopifyStoreChanged",value:function(){var e=this;document.getElementById("importshopifyContent").innerHTML="";var i=n()("#shopifyStores :selected").val();"Add Store"==i?(this.$el.find("#importshopifyContainer").addClass("hide"),this.$el.find("#importShopifyBanner").removeClass("hide"),this.$el.find("#importFromShopify").removeClass("hide"),this.isShopifyUser&&(this.removeAllFilesFromSelection(),n()("#selectedImageGallery").empty(),this.addFilesToSelectedList([])),n()("#shopifyGrantAccessCancel").off("click").on("click",(function(){e.$el.find("#importshopifyContainer").removeClass("hide"),e.$el.find("#importShopifyBanner").addClass("hide"),e.initializeShopify()}))):this.initializeShopify(i)}},{key:"shopifyProductsChanged",value:function(e){var i=[];document.getElementById("importshopifyContent").innerHTML="",this.$el.find("#importshopifyEmptyState").removeClass("hide"),this.$el.find("#importshopifyEmptyState").addClass("hide");for(var t=0;t<this.products.data.products.length;t++)if(this.products.data.products[t].id==n()("#shopifyProducts").val()){for(var o=0;o<this.products.data.products[t].images.length;o++){var s={id:this.products.data.products[t].images[o].id,url:this.products.data.products[t].images[o].src,upload_type:"url",title:this.products.data.products[t].title};i.push(s)}this.showShopifyGallery(i),this.isShopifyUser&&(this.removeAllFilesFromSelection(),n()("#selectedImageGallery").empty(),this.addFilesToSelectedList(i))}}},{key:"showShopifyGallery",value:function(e){var i=this;X()((0,M.YH)(x.Z.t.wizImport,{files:e,type:this.importType,isSortable:!1,showDelete:!1,showControls:!0,isMultiple:this.isMultiple,showAddMoreTemplate:!1,category:"shopify"}),(function(e,t){i.isFetchingDrive=!1,i.$el.find("#importshopifyContent").append(n()(t)),i.$el.find(".import-shopify-spin-loading").addClass("hide"),i.$el.find("#importshopifyContent .gallery-view").one("load",{context:i},i.imageLoadedCallback),i.$el.find("#importshopifyContent .image").unbind().bind("click",{context:i},i.toggleMediaSelection),0===i.$el.find("#importshopifyContent .image").length?i.$el.find("#importshopifyEmptyState").removeClass("hide"):i.$el.find("#importshopifyEmptyState").addClass("hide"),json.page_token?(i.driveNextPageToken=json.page_token,i.$el.find("#loadMoreContentDrive").removeClass("hide")):(i.driveNextPageToken=void 0,i.$el.find("#loadMoreContentDrive").addClass("hide"))}))}},{key:"initializeGDrive",value:function(){var e=this;0!==this.$el.find("#importDriveContent .image").length||this.isDriveInitializationChecked||this.isFetchingDrive||(this.$el.find(".import-drive-spin-loading").removeClass("hide"),this.isFetchingDrive=!0,(this.fromSDK?this._getVideoModel():new Z.Z).fetchDriveAccounts((function(i){var t=(i||[]).accounts;if(t.length>0){e.driveAccounts=t,e.updateAccountsSelect();var o=t[0];o.account_email=o.email,e.fetchFilesFromDrive(o)}else e.$el.find("#importDriveBanner").removeClass("hide"),e.$el.find(".import-drive-spin-loading").addClass("hide")}),(function(i){e.isFetchingDrive=!1,e.$el.find(".import-drive-spin-loading").addClass("hide"),p.default.showBannerAlert(ve,4e3,"error")})))}},{key:"refreshLibrary",value:function(){this.$el.find("#importVideoLibraryContent").empty(),this.$el.find("#loadMoreLibraryVideo").addClass("hide"),this.$el.find("#importVideoLibrarySearch").val(""),this.isLibraryVideoInitializationChecked=!1,this.isFetchingLibraryVideos=!1,this.initializeVideoLibrary()}},{key:"initializeVideoLibrary",value:function(){var e=this;n()("#importVideoLibraryl").removeClass("hide"),this.$el.find("#importVideoLibraryContent").empty(),this.$el.find("#loadMoreLibraryVideo,#testimonialCatList,#videoCatFilter, #videoLibrarySearch, .tag-filter,.hv-content-type-container").addClass("hide"),this.$el.find("#importVideoLibrarySearch").val(""),this.isFetchingLibraryVideos=!1,ee()((0,M.YH)(x.Z.t.wizImport,{categories:this.categoriesAndTags.categories}),(function(i,t){if(!e.isFetchingLibraryVideos){e.renderTags(),e.$el.find(".fetching-library-videos-loading").addClass("hide"),e.$el.find(".import-library-spin-loading").removeClass("hide"),e.isFetchingLibraryVideos=!0,e.offset=0;var o=0;e.categoriesAndTags.default_cat_id>0?(o=e.categoriesAndTags.default_cat_id,e.$el.find("#videoCatList").val(o).trigger("change.select2")):e.$el.find("#videoCatList").length>0&&parseInt(e.$el.find("#videoCatList").val())>0&&(o=parseInt(e.$el.find("#videoCatList").val()));var s={offset:0,categoryId:o,fetch_recording_configuration:!0};e.fetchLibraryVideos(s)}e.videoLibraryBodyEl=n()("#importVideoLibraryContainer")}))}},{key:"renderTags",value:function(){this.TagInput=HippoVideo.render(re(),{actionHandler:this.filterTags,testId:"import-lib-tags",bordered:!0},document.getElementById("libCategories"))}},{key:"filterTags",value:function(e,i){if(this.filterTagList=e.map((function(e){return i?e.name:e.id})),!i){var t={offset:0,categoryId:this.selectedCategory};this.fetchLibraryVideos(t)}}},{key:"initializeTestimonial",value:function(){var e=this;this.$el.find("#importVideoLibraryContent").empty(),this.$el.find("#loadMoreLibraryVideo,#videoCatList,#videoLibrarySearch,#videoCatFilter, .tag-filter,.hv-content-type-container").addClass("hide"),this.isFetchingTestimonialVideos=!1,ee()((0,M.YH)(x.Z.t.wizImport,{testimonialcategories:this.testimonialCategoriesList.categories}),(function(i,t){if(!e.isFetchingTestimonialVideos){e.$el.find(".import-library-spin-loading").removeClass("hide"),e.isFetchingTestimonialVideos=!0,e.offset=0;var o=e.testimonialCategoriesList.categories[0].id;e.$el.find("#testimonialCatList").length>0&&parseInt(e.$el.find("#testimonialCatList").val())>0&&(o=parseInt(e.$el.find("#testimonialCatList").val()));var s={offset:0,categoryId:o};e.fetchTestimonialVideos(s)}}))}},{key:"videoCategoryChange",value:function(e){var i=e.data.context;i.$el.find(".fetching-library-videos-loading").removeClass("hide"),i.$el.find("#importVideoLibrayEmptyState").addClass("hide"),i.$el.find(".hv-header-library-wrapper").addClass("disable-btn"),i.$el.find("#tabContainer").addClass("disable-btn"),i.offset=0,i.selectedCategory=e.target.value;var t={offset:0,categoryId:e.target.value};i.$el.find("#importVideoLibraryContent").empty(),h.default.setLocalStorageValue("defaultFolderId-"+HippoVideo.data.api.getProperty("userId"),e.target.value),i.fetchLibraryVideos(t)}},{key:"onScrollHandle",value:function(e){var i=e.data.context;if(i.canLoadOnScroll()){var t=i.videoLibraryBodyEl.scrollTop();if(i.videoLibraryBodyEl[0].scrollHeight-t<i.videoLibraryBodyEl[0].clientHeight+5){i.offset=i.offset+20,i.$el.find(".fetching-library-videos-loading").removeClass("hide"),i.$el.find(".hv-header-library-wrapper").addClass("disable-btn"),i.$el.find("#tabContainer").addClass("disable-btn"),i.$el.find("#loadMoreLibraryVideo").addClass("hide");var o="0"===n()("#videoCatList").val()?"":n()("#videoCatList").val(),s={offset:i.offset,categoryId:o};i.fetchLibraryVideos(s)}}}},{key:"handleContentTypeChange",value:function(e){var i,t=e.data.context;n()("#"+e.target.id).hasClass("selected")&&1==t.selectedContentTypeCount||(i={offset:0,categoryId:"0"===n()("#videoCatList").val()?"":n()("#videoCatList").val()},n()("#"+e.target.id).hasClass("selected")?(n()("#"+e.target.id).removeClass("selected"),t.selectedContentTypeCount=t.selectedContentTypeCount-1):(n()("#"+e.target.id).addClass("selected"),t.selectedContentTypeCount=t.selectedContentTypeCount+1),t.$el.find(".fetching-library-videos-loading").removeClass("hide"),t.$el.find("#importVideoLibrayEmptyState").addClass("hide"),t.$el.find(".hv-header-library-wrapper").addClass("disable-btn"),t.$el.find("#tabContainer").addClass("disable-btn"),t.$el.find("#importVideoLibraryContent").empty(),t.offset=0,t.fetchLibraryVideos(i))}},{key:"testimonialCategoryChange",value:function(e){var i=e.data.context;i.$el.find(".fetching-videos-loading").removeClass("hide"),this.$el.find("#importVideoLibrayEmptyState").addClass("hide");var t={offset:0,categoryId:e.target.value};i.$el.find("#importVideoLibraryContent").empty(),i.fetchTestimonialVideos(t)}},{key:"fetchLibraryVideos",value:function(e){var i=this;if("importVideoLibrarylTab"==this.actionFrom&&(e.fetch_videos=!0),this.isFromVideoPages){if(e.fetch_videos=this.videoOnly,this.filterTagList&&this.filterTagList.length){var t=this.filterTagList.toString();e.filter_by_tag_ids=t}this.onlyDoc&&(e.fetch_images=!1,e.fetch_videos=!1,e.fetch_documents=!0),this.searchWord&&(e.search_type=1,e.search_word=encodeURIComponent(this.searchWord))}"importImgLibTab"==this.actionFrom&&(e.fetch_images=!0,e.fetch_videos=!1),this.canImportImageFromLibrary||0!=this.videoOnly||"importVideoLibrarylTab"==this.actionFrom||"importImgLibTab"==this.actionFrom||0!=this.onlyDoc?(n()(".hv-content-type-container").addClass("disp-none"),n()("#importVideoLibraryContainer").addClass("hv-content-type-Notpresent")):(e=this.fetchContentTypeChanges(e),n()(".hv-content-type-container").removeClass("disp-none"),n()("#importVideoLibraryContainer").removeClass("hv-content-type-Notpresent")),(new Z.Z).fetchLibraryVideos(e,(function(e){"importVideoLibrarylTab"!==i.actionFrom&&"importVideoLibraryTabMulti"!==i.actionFrom&&"importImgLibTab"!==i.actionFrom||i.appendLibraryVideos(e)}),(function(e){i.$el.find(".import-drive-spin-loading").addClass("hide"),p.default.showBannerAlert(ve,4e3,"error")}))}},{key:"fetchContentTypeChanges",value:function(e){for(var i=n()(".hv-content-type-tags"),t=0;t<i.length;t++)n()("#"+i[t].id).hasClass("selected")?e[n()("#"+i[t].id).attr("data-id")]=!0:e[n()("#"+i[t].id).attr("data-id")]=!1;return e}},{key:"fetchTestimonialVideos",value:function(e){var i=this;(new Z.Z).fetchTestimonial(e,(function(e){i.appendTestimonialVideos(e)}),(function(e){i.isFetchingTestimonialVideos=!1,i.$el.find(".import-drive-spin-loading").addClass("hide"),p.default.showBannerAlert(ve,4e3,"error")}))}},{key:"appendTestimonialVideos",value:function(e){var i=this,t=this;0==this.offset?this.json=e:n().each(e.categories,(function(e,i){t.json.libraries.push(i)})),te()((0,M.YH)(x.Z.t.wizImport,{libraries:this.json.libraries,current_asset_id:parseInt(window.location.pathname.split("/")[3]),category:"importImgLibTab"==this.actionFrom?"existingMedia":"videoLibrary"}),(function(e,o){i.$el.find(".import-library-spin-loading").addClass("hide"),i.$el.find(".fetching-videos-loading").addClass("hide"),i.$el.find(".hv-header-library-wrapper").addClass("disable-btn"),i.$el.find("#tabContainer").addClass("disable-btn"),i.$el.find(".fetching-library-videos-loading").addClass("hide"),i.$el.find("#importVideoLibraryContainer,#videoCatFilter, #testimonialCatList, .tag-filter,.hv-content-type-container").removeClass("hide"),i.$el.find("#importVideoLibraryContent").empty().append(n()(o)).removeClass("hide"),t.isFromVideoPages&&0==t.selectedFilesList.length&&0!=t.alreadySelectedFiles.length&&t.addFilesToSelectedList(t.alreadySelectedFiles),i.$el.find("#importVideoLibraryContent .image").unbind().bind("click",{context:i},i.toggleMediaSelection),0===i.$el.find("#importVideoLibraryContent .image").length?i.$el.find("#importVideoLibrayEmptyState").removeClass("hide"):i.$el.find("#importVideoLibrayEmptyState").addClass("hide"),i.json.num_videos>i.offset+20?i.$el.find("#loadMoreLibraryVideo").removeClass("hide"):i.$el.find("#loadMoreLibraryVideo").addClass("hide"),i.mediaCategoryId&&i.$el.find("#importVideoCategories").val(i.mediaCategoryId).trigger("change")}))}},{key:"canLoadOnScroll",value:function(){return!(n()("#importVideoLibraryContent").find(".image").length<=0)&&this.json.num_videos>this.offset+20}},{key:"appendLibraryVideos",value:function(e){var i=this,t=this;0==this.offset||e.is_search?this.json=e:n().each(e.libraries,(function(e,i){t.json.libraries.push(i)})),te()((0,M.YH)(x.Z.t.wizImport,{libraries:this.json.libraries,current_asset_id:parseInt(window.location.pathname.split("/")[3]),category:"importImgLibTab"==this.actionFrom?"existingMedia":"videoLibrary"}),(function(e,o){if(i.$el.find(".import-library-spin-loading").addClass("hide"),i.$el.find(".fetching-videos-loading").addClass("hide"),i.$el.find(".hv-header-library-wrapper").removeClass("disable-btn"),i.$el.find("#tabContainer").removeClass("disable-btn"),i.$el.find(".fetching-library-videos-loading,#testimonialCatList").addClass("hide"),i.$el.find("#importVideoLibraryContainer, #videoCatFilter,#videoCatList, #videoLibrarySearch,.tag-filter,.hv-content-type-container").removeClass("hide"),i.$el.find("#importVideoLibraryContent").empty().append(n()(o)).removeClass("hide"),t.isFromVideoPages)if(t.renderingFirstTime&&0==t.selectedFilesList.length&&0!=t.alreadySelectedFiles.length)t.addFilesToSelectedList(t.alreadySelectedFiles),t.renderingFirstTime=!1;else if(0!=t.selectedFilesList.length){t.$el.find("#selectedImageGallery").empty();var s=(0,F.Z)(t.selectedFilesList);t.selectedFilesList.length=0,t.addFilesToSelectedList(s)}i.$el.find("#importVideoLibraryContent .image").unbind().bind("click",{context:i},i.toggleMediaSelection),0===i.$el.find("#importVideoLibraryContent .image").length?i.$el.find("#importVideoLibrayEmptyState").removeClass("hide"):i.$el.find("#importVideoLibrayEmptyState").addClass("hide"),i.json.num_videos>i.offset+20?i.$el.find("#loadMoreLibraryVideo").removeClass("hide"):i.$el.find("#loadMoreLibraryVideo").addClass("hide"),i.mediaCategoryId&&i.$el.find("#importVideoCategories").val(i.mediaCategoryId).trigger("change")}))}},{key:"_searchCategoriesList",value:function(e){var i=e.target.value,t=e.data.context;if(13==e.keyCode){var o=this;if(null!=i&&""!==i.trim()){t.$el.find(".fetching-library-videos-loading").removeClass("hide"),t.$el.find("#importVideoLibrayEmptyState").addClass("hide"),t.$el.find(".hv-header-library-wrapper").addClass("disable-btn"),t.$el.find("#tabContainer").addClass("disable-btn"),i=i.trim(),this.searchWord=i;var s={search_word:encodeURIComponent(i),categoryId:"0"===n()("#videoCatList").val()?"":n()("#videoCatList").val(),from:0,search_type:1};"importVideoLibrarylTab"==this.actionFrom&&(s.fetch_videos=!0),this.isFromVideoPages&&(s.fetch_videos=this.videoOnly,this.filterTagList&&this.filterTagList.length&&(s.filter_by_tag_ids=this.filterTagList)),"importImgLibTab"==this.actionFrom&&(s.fetch_images=!0,s.fetch_videos=!1),this.onlyDoc&&(s.fetch_images=!1,s.fetch_videos=!1,s.fetch_documents=!0),this.canImportImageFromLibrary||0!=this.videoOnly||"importVideoLibrarylTab"==this.actionFrom||"importImgLibTab"==this.actionFrom||(s=t.fetchContentTypeChanges(s)),this._getVideoModel().searchLibrary(s,(function(e){e.is_search=!0,e.key_word=i,o.appendLibraryVideos(e)}))}else{t.$el.find(".fetching-library-videos-loading").removeClass("hide"),t.$el.find("#importVideoLibrayEmptyState").addClass("hide"),t.$el.find(".hv-header-library-wrapper").addClass("disable-btn"),t.$el.find("#tabContainer").addClass("disable-btn"),t.$el.find("#loadMoreLibraryVideo").addClass("hide");var a="0"===n()("#videoCatList").val()?"":n()("#videoCatList").val(),r={offset:t.offset,categoryId:a};t.fetchLibraryVideos(r)}}i.length>-1?(n()("#searchIcon").addClass("disp-none"),n()("#clear-icon").removeClass("disp-none")):(n()("#searchIcon").removeClass("disp-none"),n()("#clear-icon").addClass("disp-none"))}},{key:"_clearCategoriesList",value:function(e){var i=e.data.context;i.$el.find(".fetching-library-videos-loading").removeClass("hide"),i.$el.find("#importVideoLibrayEmptyState").addClass("hide"),i.$el.find(".hv-header-library-wrapper").addClass("disable-btn"),i.$el.find("#tabContainer").addClass("disable-btn"),i.$el.find("#loadMoreLibraryVideo").addClass("hide"),n()("#importVideoLibrarySearch").val(""),n()("#searchIcon").removeClass("disp-none"),n()("#clear-icon").addClass("disp-none");var t="0"===n()("#videoCatList").val()?"":n()("#videoCatList").val();i.offset=0;var o={offset:i.offset,categoryId:t};i.fetchLibraryVideos(o)}},{key:"updateAccountsSelect",value:function(e){var i,t=this,o=this.driveAccounts;this.$el.find("#driveAccounts").empty(),(o||[]).forEach((function(o,s){i=n()("<option>").text(o.email).attr("value",o.email),(!e&&0===s||e&&e===o.email)&&i.attr("selected","selected"),t.$el.find("#driveAccounts").append(i)})),this.$el.find("#driveAccounts").append(n()("<option>").text("Add new account").attr("value","new"))}},{key:"showShopifyLogin",value:function(e){var i=this,t=n()("#shopUrl").val();h.default.shopifyGrantAccess(t,(function(){i.$el.find(".import-web-banner-shopify").addClass("hide"),i.$el.find("#importshopifyContainer").removeClass("hide"),i.initializeShopify()})),h.default.trackInThirdPartyTools("Import-Pop - Shopify Login opened",{})}},{key:"showGoogleLogin",value:function(e){var i=this;h.default._openGoogleLogin("gdrive","https://www.googleapis.com/auth/drive.file https://www.googleapis.com/auth/drive.readonly https://www.googleapis.com/auth/userinfo.email",(function(e,t,o){var s={auth_code:t,drive_import:!0};i.isDriveInitializationChecked=!0,(new Z.Z).configureDrive(s,(function(e){i.$el.find("#importDriveBanner").addClass("hide"),i.$el.find("#importDriveContent").empty(),i.driveAccounts.push(e),i.updateAccountsSelect(e.email),e.account_email=e.email,i.fetchFilesFromDrive(e),h.default.trackInThirdPartyTools("Import-Pop - G-Drive Configured",{})}),(function(e){i.isFetchingDrive=!1,p.default.showBannerAlert(ve,4e3,"error")}))})),h.default.trackInThirdPartyTools("Import-Pop - G-Drive Login opened",{})}},{key:"driveAccountChanged",value:function(e){var i=e.data.context,t={},o=i.$el.find("#driveAccounts").val();"new"===o?i.showGoogleLogin():o!==i.configuredDriveAccount&&(t.email=o,t.user_id=((0,M.zU)(i.driveAccounts,{email:t.email})[0]||{}).user_id,i.$el.find("#importDriveContent").empty(),i.driveNextPageToken=void 0,t.account_email=t.email,i.fetchFilesFromDrive(t),h.default.trackInThirdPartyTools("Import-Pop - G-Drive Account changed",{}))}},{key:"fetchFilesFromDrive",value:function(e){var i=this,t={email:e.email,unique_id:e.user_id,file_type:this.importType,account_email:e.email};this.driveNextPageToken&&(t.page_token=this.driveNextPageToken),this.isFetchingDrive=!0,this.configuredDriveAccount=e.email,this.configuredDriveUserId=e.user_id,this.$el.find(".import-drive-spin-loading").removeClass("hide"),(this.fromSDK?this._getVideoModel():new Z.Z).fetchFilesFromDrive(t,(function(e){var t=e.files;i.gDriveToken=e.token_id,X()((0,M.YH)(x.Z.t.wizImport,{files:t,type:i.importType,isSortable:!1,showDelete:!1,showControls:!0,isMultiple:i.isMultiple,showAddMoreTemplate:!1,category:"gDrive"}),(function(t,o){i.isFetchingDrive=!1,i.$el.find("#importDriveContent").append(n()(o)),i.$el.find("#importDriveContainer, #accountsFilter").removeClass("hide"),i.$el.find(".import-drive-spin-loading").addClass("hide"),i.$el.find("#importDriveContent .gallery-view").one("load",{context:i},i.imageLoadedCallback),i.$el.find("#importDriveContent .image").unbind().bind("click",{context:i},i.toggleMediaSelection),0===i.$el.find("#importDriveContent .image").length?i.$el.find("#importDriveEmptyState").removeClass("hide"):i.$el.find("#importDriveEmptyState").addClass("hide"),e.page_token?(i.driveNextPageToken=e.page_token,i.$el.find("#loadMoreContentDrive").removeClass("hide")):(i.driveNextPageToken=void 0,i.$el.find("#loadMoreContentDrive").addClass("hide")),i.initializeAudioPlayerActions()}))}),(function(e){i.isFetchingDrive=!1,i.$el.find(".import-drive-spin-loading").addClass("hide"),p.default.showBannerAlert(ve,4e3,"error")}))}},{key:"loadMoreFromDrive",value:function(e){var i=e.data.context,t=i.configuredDriveAccount,o={email:t,account_email:t,user_id:((0,M.zU)(i.driveAccounts,{email:t})[0]||{}).user_id};i.fetchFilesFromDrive(o)}},{key:"validateAndGetFiles",value:function(e){var i=this.maximumFilesAllowed;(this.isFromVideoPages||"replace"===this.actionType)&&(this.selectedFilesList=[],i=1);for(var t,o,s,a,r=this.importType,l=this.getSelectedMedia().length,d=[],c=!1,u=!1,m=!1,f=0;f<e.length;f++){"image"==(s=e[f]).type.split("/")[0]&&"doc"==this.importType&&(this.maximumPerFileSize=5);var g=1024*this.maximumPerFileSize*1024;l+d.length>=i?u=!0:s.size>g?m=!0:this.isAudioImport()?s.type.includes("audio/")?d.push(s):c=!0:this.isImageImport()?(0,M.EY)(de,s.type)?d.push(s):c=!0:this.isProEditImport?(a=s.name.split(".").pop().toLowerCase(),(0,M.EY)(ce,s.type.split("video/")[1])||(0,M.EY)(ce,a)||(0,M.EY)(de,s.type)||s.type.includes("audio/")||s.type.includes("image/gif")?d.push(s):c=!0):this.isVideoImport()?(a=s.name.split(".").pop().toLowerCase(),(0,M.EY)(ce,s.type.split("video/")[1])||(0,M.EY)(ce,a)?d.push(s):c=!0):(this.isDocumentImport()||this.isCustomImport())&&d.push(s)}return u&&(t="You can import a maximum of ".concat(i," ").concat(r," files."),o="CVFI - User selected more than max limit of files"),c&&(t="image"===r?"You can select only JPEG, PNG, BMP file types.":x.Z.t.wizImport.unsupported,o="CVFI - User selected incorrect file types"),m&&(t="Please select ".concat(r," files of size less than ").concat(this.maximumPerFileSize," MB each."),o="CVFI - User selected larger files"),c&&u&&(t="Please select a maximum of ".concat(i," ").concat(r," files of valid file types."),o="CVFI - User selected incorrect file types and more number of files"),t&&(t=d.length>0?"".concat(t," Valid files will be imported."):t,p.default.showBannerAlert(t,4e3,"error"),h.default.trackInThirdPartyTools(o,{email:n()("#userEmail").val()})),0===d.length&&n()("#secondaryFileUpload, #importFileUpload").val(""),d}},{key:"getSelectedMedia",value:function(){return(0,M.zU)(this.selectedFilesList,{isIncluded:!0})||[]}},{key:"handleImportButtonClick",value:function(){var e=this,i=[];if(!this.isFromVideoPages||"importVideoLibraryTabMulti"!=this.actionFrom&&"importViaLinkTab"!=this.actionFrom)this.isProEditImport||!this.showVideoImportPreview?(this.$el.find("#tabContainer, .import-body-container").addClass("hide"),this.$el.find("#import, #cancelImport").addClass("hide"),this.$el.find("#submitVideoForm, #cancelVideoForm").removeClass("hide"),this.importVideoFileAndProceed()):this.isDocOrVideoImport()?this.showVideoDetailsForm():"gdrive"==this.selectedFilesList[0].upload_type?this.processImageImportFromDrive():this.sendFilesToInitiator();else{var t=this.selectedFilesList;this.isFromCarousel&&n()("#vpt1AddCarouselVideos").removeClass("disp-none");var o="primary";if(this.isMultiple){o="carousel";var s={},a=0;t.forEach((function(e){s[e.id]=a,a++}));for(var r=[],l=n()("#selectedImageGallery .media-video"),d=0;d<l.length;d++)r.push(t[s[l[d].id]]);t=r}this.onlyDoc&&(o="doc"),t.forEach((function(t){if(t.already_selected){if(e.needAssetId){var s=t.id;"string"==typeof t.id&&t.id.includes("-")&&(s=t.id.split("-")[0]);var a=parseInt(s);t.asset_id=a}t.is_custom_link&&t.thumbnail_url&&"/img/film-hippo.png"==t.thumbnail_url&&(t.thumbnail_url=""),i.push(t),delete t.already_selected,delete t.isIncluded}else if(t.is_custom_link)i.push({id:t.id,thumbnail_url:"/img/film-hippo.png"==t.thumbnail_url?"":t.thumbnail_url,file_ext:t.file_ext,is_custom_link:!0,custom_link:t.custom_link,title:t.title});else{var r=t.id.split("-")[0],n=t.id,l=e.thumbDomain+t.video_token,d=t.video_token,c=t.is_document,h=t.is_image,p=t.name,u=t.description,m=t.duration?t.duration.replace(/m|s/g,""):void 0;("primary"==o||h||c)&&(l+="?is_play=false"),i.push({asset_id:parseInt(r),thumbnail_url:l,id:n,token:d,file_ext:t.file_ext,is_document:c,is_image:h,title:p,duration:m,description:u})}}));var c={pageId:this.pageId,type:o,videos:i};this.onVideoSubmit(c),this.cancelRedirect=!1,this.closeImport()}}},{key:"showVideoDetailsForm",value:function(){var e=this,i=this.getSelectedMedia()[0],t=(i=(0,M.D2)(i)).name;if(this.isMultipleImageImport){for(var o=[],s=0;s<this.totalFiles;s++)o.push(this.validatedImageFiles[s].name);t=o.join(", ")}this.isFromVideoPages&&"importLocalTab"==this.actionFrom&&(i.thumbnail_url="");var a=(0,M.YH)({},x.Z.t.wizImport,i,{tags:this.categoriesAndTags.tags,categories:this.categoriesAndTags.categories,isCategoryAvailable:this.categoriesAndTags.is_cat_available,isDocument:se.Z.isDocument(i.name),isVideo:"video"===this.importType,digest:this.digest,showPreserveTransparency:"video/quicktime"==i.type&&this.preserveTransparencyEnabled,askVideoDetails:!(this.digest||this.isProEditImport||this.isSalesGettingStarted||"replace"==this.actionType),isMultipleImageImport:void 0!==this.isMultipleImageImport&&this.isMultipleImageImport,totalFileNamesText:t,totalFileCount:void 0===this.totalFiles?1:this.totalFiles});K()(a,(function(i,t){e.$el.find("#tabContainer, .import-body-container").addClass("hide"),e.$el.find("#importVideoFormContainer").empty().append(n()(t)).removeClass("hide"),e.$el.find("#importVideoTitle").unbind("change").bind("change",{context:e},e.handleVideoTitleChange);var o=e.$el.find("#importVideoTitle").val();if(o){var s=o.split(".");s.length>1&&s.pop(),e.$el.find("#importVideoTitle").val(s.join(" "))}e.$el.find("#import, #cancelImport").addClass("hide"),e.canShowWebLink&&e.$el.find("#cancelWebLink").removeClass("hide"),e.$el.find("#submitVideoForm, #cancelVideoForm").removeClass("hide"),e.$el.find("#importVideoCategories").select2({multiple:!0,theme:"hippocategory",dropdownCssClass:"hippoSelectResult"});var a=e;n()("#importVideoCategories").on("select2:unselecting",(function(e){if(1==a.$el.find("#importVideoCategories").val().length)return!1})),HippoVideo.render(re(),{actionHandler:function(i){return e.filterTags(i,!0)},title:"Add Tags",maxChars:60,testId:"import-video-tags",bordered:!1,sdkVideoModel:e.sdkVideoModel,fromSDK:e.fromSDK},document.getElementById("importVideoTags")),e.mediaCategoryId&&e.$el.find("#importVideoCategories").val(e.mediaCategoryId).trigger("change"),e.isMultipleImageImport&&e.$el.find("#cancelVideoForm").toggleClass("hide")}))}},{key:"cancelHandler",value:function(e){var i=e.data.context;if("replace"===i.actionType)n()("#importFileUpload")[0].click();else{var t=i.getSelectedMedia()[0],o=i.$el.find(".tab.active")[0].dataset.panelId;i.$el.find("#".concat(t.id))[0].click(),i.$el.find(".import-body-container, #submitVideoForm, #cancelVideoForm, .import-body-container").addClass("hide"),i.$el.find("#tabContainer, #import, #cancelImport, #".concat(o)).removeClass("hide")}}},{key:"cancelWebLinkHandler",value:function(e){var i=e.data.context;this.removeAllFilesFromSelection(),i.$el.find("#resetWebsiteLinkBtn").click(),i.$el.find("#submitVideoForm,#cancelWebLink,#importVideoFormContainer").addClass("hide"),i.$el.find("#import,#cancelImport,#importFromWebLink").removeClass("hide")}},{key:"sendFilesToInitiator",value:function(){h.default.trackInThirdPartyTools("Import-Pop - Import Button clicked",{}),this.callbackMethodToHandleFiles((0,M.zU)(this.selectedFilesList,{isIncluded:!0}),this.importType),this.cancelRedirect=!1,this.closeImport()}},{key:"importVideoFileAndProceed",value:function(){if(this.isMultipleImageImport&&this.validatedImageFiles)return this.fileTags=(0,M.D2)(this.filterTagList||[]),this.categoriesAndTags.is_cat_available&&(this.categories=this.$el.find("#importVideoCategories").val()),this.$el.find(".import-footer").toggleClass("hide"),this.hippoYogaLoader=new N.Z({id:"importVideoFormContainer"}),this.hippoYogaLoader.render(),this.hippoYogaLoader.updateProgressText(x.Z.t.progressMessages.preparingFile),void this.processMultipleImageImport(this.validatedImageFiles);this.submitVideoFormTime=(new Date).getTime()/1e3,this.$el.find("label.error").remove();var e,i,t,o=this.getSelectedMedia()[0];this.preserveTransparency=this.$el.find("#preserveTransparency").prop("checked");var s=!0;if(this.digest||this.isProEditImport||!this.showVideoImportPreview||this.isSalesGettingStarted||"replace"==this.actionType||((e=this.$el.find("#importVideoTitle").val().trim())&&(e=encodeURIComponent(e)),e?((i=this.$el.find("#importVideoDesc").val().trim())&&(i=encodeURIComponent(i)),t=(0,M.D2)(this.filterTagList||[])):(n()('<label class="error"> '.concat(x.Z.t.wizImport.enterFileName," </label>")).insertBefore(this.$el.find("#importVideoTitle")),s=!1),this.categoriesAndTags.is_cat_available&&(this.categories=this.$el.find("#importVideoCategories").val())),this.sendGitomerTestimonialTrack("import button"),s){if(this.hippoYogaLoader=new N.Z({id:"importVideoFormContainer"}),("importVideoLibrarylTab"===this.actionFrom||"importImgLibTab"===this.actionFrom)&&!this.saveLibraryVideoAsNewAsset){if(this.importMediaCallback){var a=o.id.split("-")[0];return void this.importMediaCallback({hippoYogaLoader:this.hippoYogaLoader,contactId:this.contactId,contactEmail:this.contactEmail,assetId:a,fileName:e,categories:this.categories,showVirtualBG:this.isWebcamOnlyVideo(a)})}return void(window.location.href="/video/view/".concat(o.id.split("-")[0]))}e=(e=(e=e||this.contactEmail)||(this.leadName?"Hi "+this.leadName:void 0))||"New Video",this.canUploadVideoinBackground()||(this.hippoYogaLoader.render(),this.hippoYogaLoader.updateProgressText(x.Z.t.progressMessages.preparingFile),this.$el.find("#importVideoDetails, .import-footer").toggleClass("hide")),this.isProEditImport?this.callBackProEdit(this.actionFrom,o,this.$el,this.hippoYogaLoader,e,this.configuredDriveUserId):se.Z.isDocument(o.name.toLowerCase())||se.Z.isImage(o.name.toLowerCase())?this.processDocumentImport(e,i,t,o):"gdrive"===o.upload_type?this.processVideoImportFromDrive(e,i,t,o.id):(this.$el.find("#submitVideoForm").prop("disabled",!0),this.processVideoImport(e,i,t,o,this.preserveTransparency))}h.default.trackInThirdPartyTools("import video done")}},{key:"handleVideoTitleChange",value:function(e){var i=e.data.context;i.$el.find("label.error").remove();var t=i.$el.find("#importVideoTitle").val().trim();t&&(t=encodeURIComponent(t)),t||n()('<label class="error"> '.concat(x.Z.t.wizImport.enterFileName," </label>")).insertBefore(i.$el.find("#importVideoTitle"))}},{key:"_getVideoModel",value:function(){return this.digest?new(w())({digest:this.digest}):this.fromSDK?this.sdkVideoModel:new(w())}},{key:"isWebcamOnlyVideo",value:function(e){if(this.json){var i=this.json.libraries.filter((function(i){return i.id==e}))[0];if(i&&i.recording_config&&i.recording_config.webCam&&!i.recording_config.screenRecord&&(!i.content||!i.content.is_renderless))return!0}return!1}},{key:"processMultipleVideoImport",value:function(e){var i=this;e.length<1&&(this.multipleUploadedFiles=void 0,window.location.href="/video/library");var t=e[e.length-1],o=t.name.split(".")[0],s=this,a=(t.size||1)/1024,r=this._getVideoModel(),n={fileName:o,size:a,fromAdvancedEdit:!1,token:this.digest,contactId:this.contactId,initiator:"import_pop",source:(h.default.getQueryParams()||{}).source,isMobile:!1};r.createVideoImport(n,(function(o){var a={bucket:o.upload_bucket,key:o.upload_key,acl:"private",digest:i.digest},n=new(O())(a),l=o.authoring_asset_id,d=o.upload_video_id;i.assetId=l,i.isMediaUploading=!0,i.setWarningOnExit(l),e.pop(),i.multipleUploadedFiles=e,i.hippoYogaLoader.updateProgressText("("+(i.totalFiles-i.multipleUploadedFiles.length)+"/"+i.totalFiles+")"+x.Z.t.progressMessages.uploadingFile),n.uploadFile(t,(function(e){i.hippoYogaLoader.updateProgress(e)}),(function(e){s.isMediaUploading=!1,i.hippoYogaLoader.updateProgressText("("+(i.totalFiles-i.multipleUploadedFiles.length)+"/"+i.totalFiles+")"+x.Z.t.progressMessages.videoUploadedWaiting),r.convertVideo(l,d,!1,!0,s.digest,s.videoConverting,s.errorHandling)}),(function(e){s.isMediaUploading=!1,s.hippoYogaLoader.updateProgressText(x.Z.t.progressMessages.errorUploading),p.default.postErrorsToLog({error:"Error while importing Video :: ",stackTrace:JSON.stringify(e)})})),i.setCategoriesForVideo(l)}),(function(e){s.isMediaUploading=!1,p.default.showBannerAlert(ve,4e3,"error"),p.default.postErrorsToLog({error:"Error while importing Video in createVideoImport :: ",stackTrace:JSON.stringify(e)})}))}},{key:"processDocumentImport",value:function(e,i,t,o){var s=this,a=this,r=o.type,n=(o.size||1)/1024,l=this._getVideoModel(),d=this.categories,c=new FormData;r||(r="image"),c.append("initiator","hippo-website-image"),c.append("file_name",e),c.append("description",i),c.append("file_type",r),c.append("size",n.toString()),null!=d&&c.append("cat_ids",d),c.append("tags",t);var h=o.name.split(".").pop().toLowerCase();c.append("file_ext",h),l.documentImport(c,(function(n){if("gdrive"!=o.upload_type){var l={bucket:n.upload_bucket,key:n.upload_key,acl:"private",digest:s.digest,fromSDK:s.fromSDK,sdkVideoModel:s._getVideoModel()};-1!=ge.indexOf(r)&&(l.contentType=r);var d=new(O())(l),c=n.authoring_asset_id;n.upload_video_id,s.assetId=c,s.isMediaUploading=!0,s.setWarningOnExit(c),s.hippoYogaLoader.updateProgressText(x.Z.t.progressMessages.uploadingFile),d.uploadFile(o,(function(e){}),(function(i){a.documentImportSuccessCallback(n,c,r,e)}),(function(e){a.isMediaUploading=!1,a.hippoYogaLoader.updateProgressText(x.Z.t.progressMessages.doc.error),p.default.postErrorsToLog({error:"Error while importing Video :: ",stackTrace:JSON.stringify(e)})}))}else{var h={file_id:o.id,tags:(t||[]).join(","),file_name:e,fileType:r,description:i,gdrive_user_id:s.configuredDriveUserId,record_from_mobile:!1,file_extension:"hvr",render_not_required:!1,compress_required:!0};a.ImportGdriveVideoSuccessCallback(n,h,e)}}),(function(e){a.isMediaUploading=!1,p.default.showBannerAlert(ve,4e3,"error"),p.default.postErrorsToLog({error:"Error while importing Video in createVideoImport :: ",stackTrace:JSON.stringify(e)})}))}},{key:"documentImportSuccessCallback",value:function(e,i,t,o){var s=this,a=this,r=this._getVideoModel();a.hippoYogaLoader.updateProgress(80);var n={authoring_id:e.authoring_id,asset_id:i,file_type:"document"};t&&"image"==t.split("/")[0]&&(n.file_type="image",a.imageFileName=o,r.compressVideo(i,!1,!0,a.videoCompressing,a.errorHandling)),this.setCategoriesForVideo(i),r.updateDocState(n,(function(e){if(window.onbeforeunload=function(){},a.isMediaUploading=!1,a.hippoYogaLoader.updateProgress(100),console.log("response file upload",e),t&&"image"!=t.split("/")[0]){var i=a.isFromCarousel?"carousel":a.onlyDoc?"doc":"primary";if(a.importMediaCallback)return void a.importMediaCallback({assetId:a.assetId,mediaLocation:i,fileName:o,response:e,categories:a.categories});null!=a.categories&&1==a.categories.length?window.location.href="/video/category/".concat(a.categories):window.location.href="/video/library"}}),(function(e){p.default.showBannerAlert(x.Z.t.progressMessages.errorUpdatingState,3e3,"error"),setTimeout((function(){window.onbeforeunload=function(){},s.isMediaUploading=!1,a.hippoYogaLoader.updateProgress(100);var e=s.isFromCarousel?"carousel":"primary";if(s.importMediaCallback)return s.importMediaCallback({assetId:s.assetId,mediaLocation:e,fileName:o,categories:s.categories}),void s.closeImport();window.location.href="/video/library"}),3e3)}))}},{key:"processVideoImport",value:function(e,i,t,o,s){var a=this,r=this,n=(o.size||1)/1024;this.videoModel=this._getVideoModel();var l={fileName:e,description:i,size:n,tags:t,fromAdvancedEdit:!1,token:this.digest,contactId:this.contactId,initiator:"import_pop",source:(h.default.getQueryParams()||{}).source,isMobile:!1,isIntroOutroVideo:this.isIntroOutroVideo,isFromVideoTemplateCard:this.isFromVideoTemplateCard};this.videoModel.createVideoImport(l,(function(e){var i={bucket:e.upload_bucket,key:e.upload_key,acl:"private",digest:a.digest,enableChangeFileBtn:r.enableChangeFileBtn},t=new(O())(i);a.uploader=t,a.assetId=e.authoring_asset_id,a.upload_key=e.upload_key,a.videoId=e.upload_video_id,a.preserveTransparency=s,a.uploadeVideoId=e.upload_video_id,a.isMediaUploading=!0,a.$el.find("#submitVideoForm").prop("disabled",!1),a.setWarningOnExit(a.assetId),a.hippoYogaLoader&&a.hippoYogaLoader.updateProgressText(x.Z.t.progressMessages.uploadingFile);var n={file_size:o.size,asset_id:a.assetId};a.uploadRateData=n,navigator&&navigator.connection&&(n.rtt=navigator.connection.rtt),a.videoModel.updateImportUploadRate(n),a.setCategoriesForVideo(a.assetId),a.uploadVideoFile(o)}),(function(e){r.isMediaUploading=!1,p.default.showBannerAlert(ve,4e3,"error"),p.default.postErrorsToLog({error:"Error while importing Video in createVideoImport :: ",stackTrace:JSON.stringify(e)})}))}},{key:"enableChangeFileBtn",value:function(){this.$el.find("#cancelVideoForm").prop("disabled",!1)}},{key:"disableChangeFileBtn",value:function(){this.$el.find("#cancelVideoForm").prop("disabled",!0)}},{key:"uploadVideoFile",value:function(e){var i=this,t=(new Date).getTime(),o=this;this.uploader.uploadFile(e,(function(e){o.hippoYogaLoader&&o.hippoYogaLoader.updateProgress(e)}),(function(s){if(i.importStartTime&&i.submitVideoFormTime&&i.Logger){var a=(new Date).getTime()/1e3,r=i.submitVideoFormTime-i.importStartTime,n=a-i.submitVideoFormTime,l=Math.max(n-r,0);try{i.Logger.log(window.HippoVideo.Class.Level.INFO,"Import_video_upload_time: ",[{asset_id:i.assetId,file_size:e.size,form_filling_time:r,current_waiting_time:n,new_waiting_time:l,improvement:100*(1-l/n)}])}catch(e){console.log(e)}}o.isMediaUploading=!1,i.uploadRateData.total_time=(new Date).getTime()-t,i.videoModel.updateImportUploadRate(o.uploadRateData),i.isVideoUploaded=!0,i.initiateVideoConversion()}),(function(e){o.isMediaUploading=!1,i.uploadRateData.total_time=(new Date).getTime()-t,i.uploadRateData.error=!0,i.videoModel.updateImportUploadRate(i.uploadRateData),o.hippoYogaLoader.updateProgressText(x.Z.t.progressMessages.errorUploading),p.default.postErrorsToLog({error:"Error while importing Video :: ",stackTrace:JSON.stringify(e)})}))}},{key:"updateVideoS3Key",value:function(){var e=this;this.fileChangeCount++;var i=this.videoId+"_"+this.fileChangeCount+".mp4",t={fileChangeCount:this.fileChangeCount,mediaId:this.videoId,assetId:this.assetId};this.videoModel.updateS3Key(t,(function(i){e.uploadVideoFile(e.getSelectedMedia()[0])}),(function(e){p.default.postErrorsToLog({error:"Error while updating video s3 key :: ",stackTrace:JSON.stringify(e)})})),this.uploader.userUploadKey=i}},{key:"processVideoImportFromDrive",value:function(e,i,t,o){var s=this,a={file_id:o,tags:(t||[]).join(","),file_name:e,description:i,gdrive_user_id:this.configuredDriveUserId,record_from_mobile:!1};this.contactId&&(a.contact_id=this.contactId),(new Z.Z).createVideoFromDrive(a,(function(i){return i.file_size_exceeded?(p.default.showBannerAlert("Please select a file of size less than ".concat(i.allowed_file_size," MB. Selected file cannot be imported"),4e3,"error"),void p.default.postErrorsToLog({error:"File size exceed from GDrive :: "})):i.import_count_exceeded?(p.default.showBannerAlert("".concat(x.Z.t.wizShareI18N.importLimit),4e3,"error"),void p.default.postErrorsToLog({error:"Import limit exceed from GDrive :: "})):void s.ImportGdriveVideoSuccessCallback(i,a,e)}),s.errorHandling)}},{key:"processImageImportFromDrive",value:function(){var e=this;fetch(e.selectedFilesList[0].url).then((function(e){if(e.ok)return e.arrayBuffer();throw new Error("Something went wrong. Please try again later")})).then((function(i){var t=window.btoa(String.fromCharCode.apply(null,new Uint8Array(i)));e.selectedFilesList[0].preview_url="data:image/png;base64,"+t,e.sendFilesToInitiator()})).catch((function(e){p.default.showBannerAlert(e,1500,"error")}))}},{key:"ImportGdriveVideoSuccessCallback",value:function(e,i,t){var o=this,s=this,a=e.authoring_asset_id;i.asset_id=a,s.setCategoriesForVideo(a),s.hippoYogaLoader.updateValues(30,"Importing file from GDrive"),(this.fromSDK?this._getVideoModel():new Z.Z).importVideoToDrive(ne.extend({},i,e),(function(e){s.hippoYogaLoader.updateProgress(100),j().initialize(2e3,void 0,o.digest).getStatus(e.operation_id,(function(e){s.hippoYogaLoader.updateValues(0,e)}),(function(e,i){s.hippoYogaLoader.updateValues(i,e)}),(function(e){HippoVideo&&HippoVideo.AppRegistry&&HippoVideo.AppRegistry.isIntroOutroGlobalSettingsEnabled&&o._getVideoModel().renderImportedVideo(o.assetId),s.hippoYogaLoader.updateProgress(100),s.importMediaCallback?s.importMediaCallback({contactId:s.contactId,contactEmail:s.contactEmail,assetId:a,fileName:t,response:e,categories:s.categories}):window.location.href="/video/view/".concat(a)}),(function(e){s.hippoYogaLoader.updateProgressText(e.reason),p.default.postErrorsToLog({error:"Error while converting Video in Import pop :: ",stackTrace:JSON.stringify(e)})}))}),s.errorHandling)}},{key:"updateVideoImportDetails",value:function(){var e,i,t,o=this.getSelectedMedia()[0];this.preserveTransparency=this.$el.find("#preserveTransparency").prop("checked");var s=!0,a=(o.size||1)/1024;if(this.canUploadVideoinBackground()&&"video_library"!==this.getSelectedMedia()[0].upload_type){if(this.digest||this.isProEditImport||!this.showVideoImportPreview||this.isSalesGettingStarted||"replace"==this.actionType||((e=this.$el.find("#importVideoTitle").val().trim())&&(e=encodeURIComponent(e)),e?((i=this.$el.find("#importVideoDesc").val().trim())&&(i=encodeURIComponent(i)),t=(0,M.D2)(this.filterTagList||[])):s=!1,this.categoriesAndTags.is_cat_available&&(this.categories=this.$el.find("#importVideoCategories").val())),s){this.hippoYogaLoader.render(),this.hippoYogaLoader.updateProgressText(x.Z.t.progressMessages.preparingFile),this.$el.find("#importVideoDetails, .import-footer").toggleClass("hide"),this.hippoYogaLoader.updateProgressText(x.Z.t.progressMessages.uploadingFile),this.clickedImport=!0,this.setCategoriesForVideo(this.assetId),this.initiateVideoConversion();var r={assetId:this.assetId,fileName:e,description:i,size:a,tags:t};this.videoModel.updateVideoImport(r,(function(e){}),(function(e){p.default.postErrorsToLog({error:"Error while Updating Video details :: ",stackTrace:JSON.stringify(e)})}))}}else this.importVideoFileAndProceed();this.filterTagList=null}},{key:"setCategoriesForVideo",value:function(e){this.categoriesAndTags.is_cat_available&&(this.categories?this.categories.includes(this.mediaCategoryId)||"virtual_bg"==this.actionType||this.categories.push(this.mediaCategoryId):this.mediaCategoryId?this.categories=[this.mediaCategoryId]:this.categories=["recorded"],(this.fromSDK?this._getVideoModel():new(J())).assignCategories(e,this.categories,(function(e){}),(function(e){p.default.showBannerAlert(ve,4e3,"error"),p.default.postErrorsToLog({error:"Error while setting category for import Video :: ",stackTrace:JSON.stringify(e)})})))}},{key:"initiateVideoConversion",value:function(){(this.clickedImport&&this.isVideoUploaded||!this.canUploadVideoinBackground())&&(this.hippoYogaLoader.updateProgressText(x.Z.t.progressMessages.videoUploadedWaiting),this.preserveTransparency&&this.preserveTransparencyEnabled?this.videoModel.processDirectImport(this.assetId,this.videoId,this.digest,!1,this.videoConverting,this.errorHandling):this.videoModel.convertVideo(this.assetId,this.videoId,!1,!0,this.digest,this.videoConverting,this.errorHandling))}},{key:"videoConverting",value:function(e){var i=this;if(this.multipleUploadedFiles&&this.multipleUploadedFiles.length>0)this.processMultipleVideoImport(this.multipleUploadedFiles);else{var t=this;window.onbeforeunload=function(){},j().initialize(2e3,void 0,this.digest).getStatus(e,(function(e){t.hippoYogaLoader.updateValues(0,e)}),(function(e,i){t.hippoYogaLoader.updateValues(i,e)}),(function(e){if(HippoVideo&&HippoVideo.AppRegistry&&HippoVideo.AppRegistry.isIntroOutroGlobalSettingsEnabled&&i._getVideoModel().renderImportedVideo(i.assetId),t.hippoYogaLoader.updateProgress(100),i.digest||i.callBack){t.$el.hide();var o=t.getSelectedMedia()[0];i.callBack({file:o,assetId:i.assetId,mediaId:i.uploadeVideoId})}else{var s=t.getSelectedMedia()[0];if(i.importMediaCallback){var a=i.isFromCarousel?"carousel":"primary";i.importMediaCallback({response:e,contactId:i.contactId,contactEmail:i.contactEmail,assetId:i.assetId,mediaLocation:a,hippoYogaLoader:t.hippoYogaLoader,fileName:s.name,categories:i.categories})}else i.multipleUploadedFiles?i.processMultipleVideoImport(i.multipleUploadedFiles):setTimeout((function(){window.location.href="/video/view/".concat(t.assetId)}),1e3)}}),(function(e){t.hippoYogaLoader.updateProgressText(e.reason),p.default.postErrorsToLog({error:"Error while converting Video in Import pop :: ",stackTrace:JSON.stringify(e)})}))}}},{key:"errorHandling",value:function(e){p.default.showBannerAlert(ve,4e3,"error"),p.default.postErrorsToLog({error:"Error while importing Video :: ",stackTrace:JSON.stringify(e)})}},{key:"setWarningOnExit",value:function(e){window.onbeforeunload=function(i){return this._getVideoModel().setErrorState(e,y().authorState.UPLOAD_CANCELLED,!0),""}}},{key:"abortVideoUpload",value:function(){var e=this;if(e.isVideoImport()&&e.uploader){e.uploader.cancelImport(!1);var i={asset_id:this.assetId,media_id:this.videoId,fileChangeCount:this.fileChangeCount};e.videoModel.deleteUploadedVideoFromS3(i,(function(e){}),(function(e){p.default.postErrorsToLog({error:"error while deleting video file from s3 :: ",stackTrace:JSON.stringify(e)})}))}this.isVideoUploaded=!1}},{key:"closeImport",value:function(e){this.isVideoImport()&&!this.clickedImport&&this.showVideoImportPreview&&(this.abortVideoUpload(),this._getVideoModel().setErrorState(this.assetId,y().authorState.UPLOAD_CANCELLED,!0),window.onbeforeunload=function(){},this.isMediaUploading=!1);var i=!0;if(this.fromSalesForce)return this.isOutlookSpecific?void h.default.closeOutlookPreviewTab("cancel"):void h.default.closeCurrentTab();this.isMediaUploading&&(this.allowCloseImportWhileUploading?p.default.showBannerAlert(x.Z.t.wizImport.uploadInBackground,4e3):i=!1),this.cancelRedirect&&this.isShopifyUser&&"image"===this.importType&&!this.fromAddMore?((new(w())).setErrorState(this.assetId,y().authorState.CREATE_SLIDESHOW_CANCELLED,!1),window.onbeforeunload=function(){},window.location.href="/video/library"):i&&(this.$el.hide(),this.$el.find("*").unbind(),this.$el.empty(),this.closeImportCallback&&this.closeImportCallback(this.contactEmail,this.contactId))}},{key:"changeTab",value:function(e){var i=e.data.context,t=e.currentTarget.id,o=i.$el.find("#".concat(t)).data("panelId");i.$el.find(".tab").removeClass("active"),i.$el.find("#".concat(t)).addClass("active"),i.$el.find(".import-body-container, #footerPoweredBy").addClass("hide"),i.$el.find("#".concat(o,", #footnote")).removeClass("hide"),i.actionFrom=t,"importWebTab"===t&&""!==i.search.query&&(i.$el.find("#footerPoweredBy").removeClass("hide"),i.$el.find("#footnote").addClass("hide")),"importLibraryTab"===t?i.initializeMediaLibrary():"recentlyUsedTab"===t?i.initializeRecentlyUsed():"importDriveTab"===t?i.initializeGDrive():"importShopifyTab"===t?(document.getElementById("importshopifyContent").innerHTML="",i.initializeShopify()):"importTestimonial"===t?i.initializeTestimonial():"importVideoLibrarylTab"===t||"importVideoLibraryTabMulti"===t||"importImgLibTab"===t?i.initializeVideoLibrary():"importViaLinkTab"===t?i.initializeImportViaLink():"importViaWebLink"===t&&i.initializeImportViaWebSiteLink(),i.updateCurrentSelectionList(t),i.updateSelectedCounter(),i.handleOneFileUpload&&(i.removeAllFilesFromSelection(),n()("#selectedImageGallery").empty(),i.addFilesToSelectedList([])),h.default.trackInThirdPartyTools("Import-Pop - Tabs switched to ".concat(t),{})}},{key:"initializeImportViaLink",value:function(){var e;this.fromLocalTab&&(this.selectedFilesList=this.selectList),this.renderingFirstTime&&0==this.selectedFilesList.length&&0!=this.alreadySelectedFiles.length?(e=this.alreadySelectedFiles,this.renderingFirstTime=!1):e=this.selectedFilesList?this.selectedFilesList:this.alreadySelectedFiles||[],this.isFromVideoPages&&e&&e.length>0&&this.addFilesToSelectedList(e),this.$el.find("#addLinkBtn").unbind().bind("click",{context:this},this.validateAndUpdateLink),this.$el.find("#resetLinkBtn").unbind().bind("click",{context:this},this.resetAndUpdateLink),this.$el.find("#importCustomLinkTxt").unbind().bind("keypress",{context:this},this.customLinkChange),this.$el.find("#importCustomLinkTxt").unbind().bind("paste",{context:this},this.handlePasteLink),this.$el.find("#checkLinkBtn").unbind().bind("click",{context:this},this.addCustomLink),this.$el.find("#changeCustomThumbnailId").unbind().bind("click",{context:this},this._handleLinkIconChange),this.$el.find("#linkLogoInput").on("change",this._logoPreview),n()(document).off().on("click","#selectedImageGallery .gallery-view",{context:this},this.editCustomLink)}},{key:"customLinkChange",value:function(e){e.data.context.$el.find("#linkErrorId").addClass("disp-none")}},{key:"handlePasteLink",value:function(e){var i=e.data.context;n()("#importCustomLinkTxt").val("");var t=e.originalEvent.clipboardData.getData("text").replace("https://","");i.$el.find("#linkErrorId").addClass("disp-none"),setTimeout((function(){n()("#importCustomLinkTxt").val(t)}),50)}},{key:"editCustomLink",value:function(e){var i=e.data.context,t=n()(this).attr("data-resourceid"),o=i.selectedFilesList.filter((function(e){return e.id==t})),s={status:!0,image_url:o[0].thumbnail_url,title:o[0].title,url:o[0].custom_link};i.closeDrawer(),i.$el.find("#checkLinkBtn").addClass("disp-none"),i.$el.find("#checkLinkBtn").prop("disabled",""),i.$el.find("#importCustomLinkTxt").val(s.url),i.$el.find("#importCustomLinkTxt").prop("disabled","disabled"),i.$el.find("#addLinkBtn").attr("data-update-id",t),i.$el.find("#addLinkBtn").text("Save"),i.showNameAndThumbnailEdit(s)}},{key:"addCustomLink",value:function(e){h.default.trackInThirdPartyTools("sales page - carousel link check btn clicked");var i=e.data.context,t="https://"+i.$el.find("#importCustomLinkTxt").val();if(i.$el.find("#importCustomLinkTxt").val().includes("https://"))p.default.showBannerAlert("Invalid website URL",3e3,"error");else if(""!=i.$el.find("#importCustomLinkTxt").val()&&h.default.isUrlValid(t)){i.$el.find("#linkErrorId").addClass("disp-none"),i.$el.find("#checkLinkBtn").prop("disabled","disabled");var o={url:t,meta_types:y().metaDataType.IMAGE_URL+","+y().metaDataType.TITLE};(new Z.Z).getMetaDataContent(o,i.showNameAndThumbnailEdit),n()("#importCustomLinkTxt").val(i.$el.find("#importCustomLinkTxt").val())}else i.$el.find("#linkErrorId").text(x.Z.t.wizImport.linkErrorMsg),i.$el.find("#linkErrorId").removeClass("disp-none"),i.$el.find("#checkLinkBtn").prop("disabled","")}},{key:"addWebsiteLink",value:function(e){h.default.trackInThirdPartyTools("Website link check btn clicked");var i=this.$el.find("#importWebLinkTxt").val();if(this.$el.find("#websiteErrorMsgDiv").addClass("disp-none"),this.$el.find("#WeblinkErrorId").addClass("disp-none"),this.$el.find("#weblinkErrorMsgContainer").addClass("disp-none"),this.$el.find("#WebsitePreviewImg").hide(),this.selectedFilesList=[],i=-1===i.indexOf("://")?"https://"+i:i,h.default.isUrlValid(i)){this.$el.find("#checkWebsiteLinkBtn").prop("disabled","disabled"),this.$el.find("#websitePreviewDiv").show(),this.$el.find("#importWebsiteSpinner").show();var t=this.constructWebsiteName(i);this.$el.find("#websiteName").val(t);var o={url:i};(this.fromSDK?this._getVideoModel():new Z.Z).getPreviewFromWebSiteLink(o,this.showWebSitePreview,this.showWebSitePreviewError)}else this.$el.find("#WeblinkErrorId").text(x.Z.t.wizImport.websiteLinkErrorMsg),this.$el.find("#WeblinkErrorId").removeClass("disp-none"),this.$el.find("#weblinkErrorMsgContainer").removeClass("disp-none"),this.$el.find("#checkWebsiteLinkBtn").prop("disabled","")}},{key:"resetWebsiteLink",value:function(){this.$el.find("#importWebLinkTxt").val(""),this.$el.find("#WebsitePreviewImg").attr("src","").css("display","none"),this.$el.find("#import").attr("disabled","disabled"),this.$el.find("#checkWebsiteLinkBtn").removeClass("hide"),this.$el.find("#resetWebsiteLinkBtn").addClass("hide")}},{key:"webLinkUrlChanged",value:function(){this.$el.find("#importWebLinkTxt").val().length>0?this.$el.find("#checkWebsiteLinkBtn").prop("disabled",""):this.$el.find("#checkWebsiteLinkBtn").prop("disabled","disabled")}},{key:"constructWebsiteName",value:function(e){var i=e.match(/:\/\/(www[0-9]?\.)?(.[^/:]+)/i);if(null!=i&&i.length>2&&"string"==typeof i[2]&&i[2].length>0){var t=i[2].split(".")[0];return t.charAt(0).toUpperCase()+t.slice(1)}return null}},{key:"showWebSitePreview",value:function(e){if(e.status){this.$el.find("#importWebsiteSpinner").hide(),this.$el.find("#WebsitePreviewImg").show(),this.$el.find("#WebsitePreviewImg").attr("src",e.link),this.$el.find("#checkWebsiteLinkBtn").prop("disabled",""),this.$el.find("#import").removeAttr("disabled"),this.$el.find("#checkWebsiteLinkBtn").addClass("hide"),this.$el.find("#resetWebsiteLinkBtn").removeClass("hide");var i=this.$el.find("#websiteName").val()+".jpg";this.getFileFromUrl(e.link,i)}else this.showWebSitePreviewError(e)}},{key:"showWebSitePreviewError",value:function(e){this.$el.find("#importWebsiteSpinner").hide(),this.$el.find("#websiteErrorMsgDiv .link-label").html(e&&e.msg==x.Z.t.wizImport.websiteInvalidUrl?x.Z.t.wizImport.websiteNoteMsg:x.Z.t.wizImport.websiteErrorMsg),this.$el.find("#websiteErrorMsgDiv").removeClass("disp-none")}},{key:"initializeImportViaWebSiteLink",value:function(){this.$el.find("#checkWebsiteLinkBtn").unbind().bind("click",{context:this},this.addWebsiteLink),this.$el.find("#resetWebsiteLinkBtn").unbind().bind("click",{context:this},this.resetWebsiteLink),this.$el.find("#checkWebsiteRetryBtn").unbind().bind("click",{context:this},this.addWebsiteLink),this.$el.find("#importWebLinkTxt").unbind().bind("change",{context:this},this.webLinkUrlChanged),this.$el.find("#importWebLinkTxt").unbind().bind("keyup",{context:this},this.webLinkUrlChanged),this.$el.find("#websitePreviewDiv").hide(),this.$el.find("#importWebsiteSpinner").hide(),this.$el.find("#websiteErrorMsgDiv").addClass("disp-none"),this.$el.find("#WebsitePreviewImg").hide(),this.$el.find("#import").attr("disabled","disabled"),this.$el.find("#checkWebsiteLinkBtn").prop("disabled","disabled")}},{key:"_logoPreview",value:function(e){if(h.default.trackInThirdPartyTools("sales page - carousel link thumbnail changed"),e.target.files&&e.target.files[0]){var i=new FileReader;i.onload=function(e){""!=n()("#linkLogoInput").val()&&(n()("#linkLogoInput").val(""),n()("#linkLogoImg").attr("src",e.target.result))},i.readAsDataURL(e.target.files[0])}}},{key:"getFileFromUrl",value:(i=(0,S.Z)(B().mark((function e(i,t){var o,s,a;return B().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(i);case 2:return o=e.sent,e.next=5,o.blob();case 5:s=e.sent,a=new File([s],t,{type:"image/jpeg"}),this.addFilesToSelectedList([a]);case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"dataURLtoFile",value:function(e,i){var t=this;fetch(e).then((function(e){return e.arrayBuffer()})).then((function(e){return new File([e],i,{type:"image/jpg"})})).then((function(e){t.addFilesToSelectedList([e])}))}},{key:"_handleLinkIconChange",value:function(e){n()("#linkLogoInput").click()}},{key:"showNameAndThumbnailEdit",value:function(e){this.closeDrawer(),this.$el.find("#linkNameField").removeClass("disp-none"),this.$el.find("#checkLinkBtn").addClass("disp-none"),this.$el.find("#importCustomLinkTxt").addClass("disabled"),this.$el.find("#importCustomLinkTxt").addClass("disable-link-input"),this.$el.find("#linkThumbnailField").removeClass("disp-none"),this.$el.find("#linkDisplayOptions").removeClass("disp-none"),this.$el.find("#checkLinkBtn").prop("disabled",""),this.$el.find("#import").attr("disabled","disabled"),this.isAddLinkEnable=!0;var i=e.image_url||"/img/without_link.png",t=e.title||"",o=e.url||"";this.linkMetaDataResponse=e,n()("#importCustomLinkTxt").length>0&&(o=o.replace("https://","")),e.status?(this.$el.find("#CustomTitleTxt").val(t),this.$el.find("#importCustomLinkTxt").val(o),n()("#linkLogoImg").attr("src",i)):(this.$el.find("#CustomTitleTxt").val(""),n()("#linkLogoImg").attr("src","/img/without_link.png"))}},{key:"resetAndUpdateLink",value:function(e){var i=e.data.context;if(i.$el.find("#addLinkBtn").attr("data-update-id")){var t=i.$el.find("#addLinkBtn").attr("data-update-id");i.removeFileFromSelection(t),i.$el.find("#addLinkBtn").removeAttr("data-update-id"),i.$el.find("#addLinkBtn").text("Add Link")}h.default.trackInThirdPartyTools("sales page - carousel link reset"),i.$el.find("#importCustomLinkTxt").val(""),i.$el.find("#importCustomLinkTxt").focus(),i.$el.find("#addLinkBtn").prop("disabled",""),i.$el.find("#resetLinkBtn").prop("disabled",""),i.$el.find("#linkNameField").addClass("disp-none"),i.$el.find("#linkThumbnailField").addClass("disp-none"),i.$el.find("#linkDisplayOptions").addClass("disp-none"),i.$el.find("#checkLinkBtn").removeClass("disp-none"),i.$el.find("#importCustomLinkTxt").removeClass("disabled"),i.$el.find("#importCustomLinkTxt").removeAttr("disabled"),i.$el.find("#importCustomLinkTxt").removeClass("disable-link-input"),i.$el.find("#import").removeAttr("disabled"),i.isAddLinkEnable=!1}},{key:"validateAndUpdateLink",value:function(e){h.default.trackInThirdPartyTools("sales page - carousel link added");var i=e.data.context;i.$el.find("#addLinkBtn").prop("disabled","disabled"),i.$el.find("#resetLinkBtn").prop("disabled","disabled");var t=i.linkMetaDataResponse.url,o=i.$el.find("#CustomTitleTxt").val(),s=i.$el.find("#linkLogoImg").attr("src");if("/img/without_link.png"==s&&(s=""),s.startsWith("data:image/")){var a={thumbnail:s};(new Z.Z).fetchCarouselThumbnailLink(a,(function(e){e.status?i.linkAddToDrawer(o,e.thumbnail,t):i.linkAddToDrawer(o,"",t)}),(function(e){i.linkAddToDrawer(o,"",t)}))}else i.linkAddToDrawer(o,s,t)}},{key:"linkAddToDrawer",value:function(e,i,t){var o=this.$el.find("#addLinkBtn").attr("data-update-id")?this.$el.find("#addLinkBtn").attr("data-update-id"):this.getMaxIdForLink(),s=[];s.push({id:o,title:e,url:i,is_custom_link:!0,custom_link:t,thumbnail_url:i}),this.addFilesToSelectedList(s),this.openDrawer(),this.$el.find("#importCustomLinkTxt").val(""),this.$el.find("#importCustomLinkTxt").focus(),this.$el.find("#addLinkBtn").prop("disabled",""),this.$el.find("#resetLinkBtn").prop("disabled",""),this.$el.find("#linkNameField").addClass("disp-none"),this.$el.find("#linkThumbnailField").addClass("disp-none"),this.$el.find("#linkDisplayOptions").addClass("disp-none"),this.$el.find("#checkLinkBtn").removeClass("disp-none"),this.$el.find("#addLinkBtn").removeAttr("data-update-id"),this.$el.find("#addLinkBtn").text("Add Link"),this.$el.find("#importCustomLinkTxt").removeClass("disabled"),this.$el.find("#importCustomLinkTxt").removeAttr("disabled"),this.$el.find("#importCustomLinkTxt").removeClass("disable-link-input"),this.$el.find("#import").removeAttr("disabled"),this.isAddLinkEnable=!1}},{key:"getMaxIdForLink",value:function(){var e,i=this.selectedFilesList&&this.selectedFilesList.length>0?this.selectedFilesList:this.alreadySelectedFiles||[];if(i){var t=[];for(var o in i){var s=i[o];s.is_custom_link&&t.push(parseInt(s.id))}t.length>0&&(e=Math.max.apply(null,t)+1)}return e||(e=1),e.toString()}},{key:"updateCurrentSelectionList",value:function(e){this.isFromCarousel&&"importLocalTab"===e?(this.fromLocalTab=!0,this.selectedFilesList=this.importList):(this.fromLocalTab=!1,this.selectedFilesList=this.selectList)}},{key:"addFilesToSelectedList",value:function(e){var i=this,t=this;X()((0,M.YH)({},x.Z.t.wizImport,{files:e,type:this.isDocOrVideoImport()?"video":this.importType,isSortable:!1,showDelete:!0,isMultiple:this.isMultiple,showControls:!1,showAddMoreTemplate:!1}),(function(o,s){i.$el.find("#selectedImageGallery").append(n()(s)),(e||[]).forEach((function(e){delete e.local_src,e.isIncluded=!0,e.is_image_preview&&(e.isImagePreview=!0),se.Z.listIncludes(t.selectedFilesList,e)?(t.updateFileList(e),t.$el.find("#selectedImageGallery #"+e.id).length>0&&(t.$el.find("#selectedImageGallery #"+e.id).last().remove(),t.$el.find("#selectedImageGallery img[data-resourceid="+e.id+"]").attr("src",e.thumbnail_url))):t.selectedFilesList.push(e),t.isFromVideoPages?t.$el.find(".import-images-container").find("[data-token=".concat(e.token||e.video_token,"]")).addClass("selected"):t.$el.find("#".concat(e.id)).addClass("selected")})),i.isFromVideoPages&&"importLocalTab"===i.actionFrom?0===i.getSelectedMedia().length?i.$el.find("#import").attr("disabled","disabled"):i.$el.find("#import").removeAttr("disabled"):(i.updateSelectedCounter(),i.$el.find("#selectedImageGallery .image").removeClass("pull-left"),i.$el.find("#selectedImageGallery .gallery-view").one("load",{context:i},i.imageLoadedCallback),i.$el.find("#selectedImageGallery .gallery-delete").unbind().bind("click",{context:i},i.deleteFile),i.$el.find("#selectedImageGallery").scrollLeft(i.$el.find("#selectedImageGallery")[0].scrollWidth))}))}},{key:"addToSelectedList",value:function(e){var i=this;(e||[]).forEach((function(e){delete e.local_src,e.isIncluded=!0,e.is_image_preview&&(e.isImagePreview=!0),i.selectedFilesList.push(e)}))}},{key:"updateFileList",value:function(e){var i=e.id,t=this.selectedFilesList.findIndex((function(e){return e.id==i}));this.selectedFilesList[t].title=e.title,e&&e.thumbnail_url&&""!=e.thumbnail_url?this.selectedFilesList[t].thumbnail_url=e.thumbnail_url:this.selectedFilesList[t].thumbnail_url="/img/film-hippo.png",this.selectedFilesList[t].url=e.url}},{key:"deleteFile",value:function(e){var i=e.currentTarget.dataset.footage;e.data.context.removeFileFromSelection(i)}},{key:"removeFileFromSelection",value:function(e){var i=(0,M.Kr)(this.selectedFilesList,{id:e});this.$el.find("#selectedImageGallery #".concat(e)).remove(),this.$el.find("#".concat(e)).removeClass("selected"),e.includes("local")?this.selectedFilesList[i].isIncluded=!1:this.selectedFilesList.splice(i,1),this.updateSelectedCounter()}},{key:"removeAllFilesFromSelection",value:function(){this.selectedFilesList.length=0}},{key:"openCloseDrawer",value:function(e){var i=this;this.$el.find("#openDrawHandle, #closeDrawHandle").addClass("hide"),e?this.$el.find("#selectionDrawer").slideDown("fast",(function(){i.$el.find("#closeDrawHandle").removeClass("hide"),i.$el.find(".main-gallery").addClass("extra-margin")})):this.$el.find("#selectionDrawer").slideUp("fast",(function(){i.$el.find("#closeDrawHandle").removeClass("hide"),i.isFromVideoPages&&"importLocalTab"===i.actionFrom||i.$el.find("#openDrawHandle").removeClass("hide"),i.$el.find(".main-gallery").removeClass("extra-margin")})),this.isDrawOpen=e,this.$el.find("#selectedImageGallery")[0].scrollWidth>=this.$el.find("#selectedImageGallery").innerWidth()?this.$el.find(".scroll-arrow").removeClass("hide"):this.$el.find(".scroll-arrow").addClass("hide")}},{key:"updateSelectedCounter",value:function(){this.$el.find("#selectedFilesCounter").text(0);var e=this.getSelectedMedia().length;this.showSelectedDrawer?(0===e?(this.$el.find("#openDrawHandle").addClass("hide"),this.$el.find("#import").attr("disabled","disabled"),this.isDrawOpen&&(this.isDrawForceClosed=!1,this.$el.find("#closeDrawHandle")[0].click())):(this.$el.find(".import-body").removeClass("no-box-shadow"),this.$el.find("#import").removeAttr("disabled"),this.$el.find("#importViaLinkTab").hasClass("active")&&this.isAddLinkEnable&&this.$el.find("#import").attr("disabled","disabled"),this.isDrawOpen||this.$el.find("#openDrawHandle").removeClass("hide"),this.isDrawForceClosed||(this.isDrawForceClosed=!0,this.openDrawer())),e<10&&(e="0".concat(e)),this.$el.find("#selectedFilesCounter").text(e),this.$el.find("#selectedImageGallery")[0].scrollWidth>=this.$el.find("#selectedImageGallery").innerWidth()?this.$el.find(".scroll-arrow").removeClass("hide"):this.$el.find(".scroll-arrow").addClass("hide")):0===e?this.$el.find("#import").attr("disabled","disabled"):(this.$el.find("#import").removeAttr("disabled"),this.$el.find("#importViaLinkTab").hasClass("active")&&this.isAddLinkEnable&&this.$el.find("#import").attr("disabled","disabled"))}},{key:"showReloadBtn",value:function(){this.$el.find("#libraryRefresh").removeClass("hide")}},{key:"sendGitomerTestimonialTrack",value:function(e){n()("#digest").val()==y().GITOMER_WIDGET.TOKEN&&h.default.trackInThirdPartyTools("hippo widget - "+e)}},{key:"processMultipleImageImport",value:function(e){var i=this;e.length<1&&(this.multipleUploadedFiles=void 0,this.redirectAfterMultiImport());var t=e[e.length-1],o=t.name.split(".")[0],s=this,a=t.type,r=(t.size||1)/1024,n=this._getVideoModel(),l=this.categories,d=new FormData;d.append("file_name",o),d.append("description",""),d.append("file_type",a),d.append("size",r.toString()),null!=l&&d.append("cat_ids",l),d.append("tags",this.fileTags);var c=t.name.split(".").pop().toLowerCase();d.append("file_ext",c);var h=a&&"image"==a.split("/")[0];n.documentImport(d,(function(a){var r={bucket:a.upload_bucket,key:a.upload_key,acl:"private",digest:i.digest},l=new(O())(r),d=a.authoring_asset_id;i.assetId=d,i.isMediaUploading=!0,i.setWarningOnExit(d),e.pop(),i.multipleUploadedFiles=e,i.hippoYogaLoader.updateProgress(0);var c=h?x.Z.t.progressMessages.imageUploadedWaiting:x.Z.t.progressMessages.uploadingFile;i.hippoYogaLoader.updateProgressText("("+(i.totalFiles-i.multipleUploadedFiles.length)+"/"+i.totalFiles+") "+x.Z.t.progressMessages.uploadingFile),l.uploadFile(t,(function(e){i.hippoYogaLoader.updateProgress(e)}),(function(e){i.hippoYogaLoader.updateProgressText("("+(i.totalFiles-i.multipleUploadedFiles.length)+"/"+i.totalFiles+") "+c),s.isMediaUploading=!1;var t={authoring_id:a.authoring_id,asset_id:d};n.updateDocState(t,(function(e){}),(function(t){p.default.showBannerAlert(x.Z.t.progressMessages.errorUpdatingState,3e3,"error"),setTimeout((function(){window.onbeforeunload=function(){},i.isMediaUploading=!1,s.hippoYogaLoader.updateProgress(100);var t=i.isFromCarousel?"carousel":"primary";i.importMediaCallback?i.importMediaCallback({assetId:i.assetId,mediaLocation:t,fileName:o,response:e,categories:i.categories}):window.location.href="/video/library"}),3e3)})),h?n.compressVideo(d,!1,!0,s.videoCompressing,s.errorHandling):s.processMultipleImageImport(i.multipleUploadedFiles)}),(function(e){s.isMediaUploading=!1,s.hippoYogaLoader.updateProgressText(x.Z.t.progressMessages.doc.error),p.default.postErrorsToLog({error:"Error while importing Document/Image :: ",stackTrace:JSON.stringify(e)})}))}),(function(e){s.isMediaUploading=!1,p.default.showBannerAlert(ve,4e3,"error"),p.default.postErrorsToLog({error:"Error while importing Document/image :: ",stackTrace:JSON.stringify(e)})}))}},{key:"videoCompressing",value:function(e){if(this.multipleUploadedFiles&&this.multipleUploadedFiles.length>0)this.processMultipleImageImport(this.multipleUploadedFiles);else{var i=this;j().initialize(2e3).getStatus(e.video,(function(e){i.hippoYogaLoader.updateValues(0,e)}),(function(e,t){i.hippoYogaLoader.updateValues(t,e)}),(function(e){i.hippoYogaLoader.updateProgress(100),i.redirectAfterMultiImport(e)}),(function(e){i.redirectAfterMultiImport(e)}))}}},{key:"redirectAfterMultiImport",value:function(e){window.onbeforeunload=function(){};var i=this.isFromCarousel?"carousel":"primary";this.importMediaCallback?this.importMediaCallback({assetId:this.assetId,mediaLocation:i,fileName:this.imageFileName,response:e,categories:this.categories}):null!=this.categories&&1==this.categories.length?window.location.href="/video/category/".concat(this.categories):window.location.href="/video/library"}}]),a}(c().View),we=t(49485),Ce=(t(58229),t(73423),t(26891),t(25911),t(7023),t(14316),t(87285),t(66709),t(91707),t(68573),t(85341),c().View.extend({initialize:function(e){this.$el=e.$el||n()(e.el),this.origin=e.fromSDK?window._HVDomain||"https://assets.hippovideo.io":"",this.isFromSdk=e.fromSDK||!1,this.videoPlayerView=e.videoPlayerView,this.assetId=e.assetId,this.token=e.token,this.tokenType=e.tokenType,this.recorder=e.recorder,this.recorderApiModel=e.recorderApiModel,this.digest=e.digest,this.integrationType=e.integration_type,this.embeddedDigest=e.embeddedDigest,this.isPersonalizationEnabled=e.isPersonalizationEnabled,this.customColors=e.customColors,this.overrideWarnOnExit=e.overrideWarnOnExit,this.isPPR=e.isPPR,this.enabled=!1,this.askReloadConfirmation=!1,this.onBoardRequired=this.isOnBoardRequired(),this.currentSelectedText=void 0,this.currentSelectedSticker=void 0,this.currentSelectedCallout=void 0,this.currentSelectedBlur=void 0,this.showingColorPicker=!1,this.blurPlayInterval=void 0,this.isBlurEnabled=e.isBlurEnabled,this.authoringId=e.authoringId,this.footageUrls=e.footageUrls||{},this.closeImportCallback=e.closeImportCallback||function(){},this.openImportCallback=e.openImportCallback||function(){},this.defaultTextAreaValue=x.Z.t.simpleEdit.enterTextHere,this.isMac=window.navigator.userAgent.indexOf("Mac")>=0,this.isTicketVideoPreview=e.isTicketViewPreview,this.isAssignmentVideoPreview=e.isAssignmentVideoPreview,this.isTestimonialVideoPreview=e.isTestimonialVideoPreview,this.isGuestRecording=e.isGuestRecording,this.fromQuickRecord=e.fromQuickRecord,this.canInitializeUI=e.initEditUI,this.initSettingModel(),this.brand_colors=[],this.defaultFontValue="timesnewroman",this.brand_font_color="#000000",this.colorPaletteEnabled=e.colorPaletteEnabled,this.isPPR=e.isPPR,this.fontCache={},this.sessionDetails={addedClips:[],primaryVideo:void 0,secondaryVideo:void 0,trimSliderStart:0,trimSliderEnd:0,totalAddedEffects:0},this.stickerSize=[],this.stickers={1:{name:"Smileys",mainId:1124,startId:945,endId:1935},2:{name:"Animals&Nature",mainId:315,startId:286,endId:434},3:{name:"Food&Drink",mainId:932,startId:854,endId:944},4:{name:"Objects",mainId:1947,startId:1936,endId:2134},5:{name:"Travel&Places",mainId:435,startId:435,endId:547},6:{name:"Activity",mainId:829,startId:547,endId:853},7:{name:"Symbols",mainId:2340,startId:2135,endId:2428},8:{name:"Flags",mainId:25,startId:2,endId:285}},this.callouts=h.default.getAvailableCallouts(),this.calloutsDisplayorder=h.default.getCalloutDisplayorder(),this.selectPrimaryVideo=this.selectPrimaryVideo.bind(this),this.selectSecondaryVideo=this.selectSecondaryVideo.bind(this),this.userEventStart=this.userEventStart.bind(this),this.userEventStop=this.userEventStop.bind(this),this.selectTrim=this.selectTrim.bind(this),this.selectCrop=this.selectCrop.bind(this),this.selectAddText=this.selectAddText.bind(this),this.selectAddCallouts=this.selectAddCallouts.bind(this),this.selectAddStickers=this.selectAddStickers.bind(this),this.selectAddImage=this.selectAddImage.bind(this),this.hanldeImageAspectRatioChange=this.hanldeImageAspectRatioChange.bind(this),this.deleteImage=this.deleteImage.bind(this),this.changeImageOpacity=this.changeImageOpacity.bind(this),this.addImage=this.addImage.bind(this),this.addPersonalizedImage=this.addPersonalizedImage.bind(this),this.processSelectedImage=this.processSelectedImage.bind(this),this.createNewImage=this.createNewImage.bind(this),this.addWebsiteImageBtn=this.addWebsiteImageBtn.bind(this),this.applyCrop=this.applyCrop.bind(this),this.resetCrop=this.resetCrop.bind(this),this.addEnteredText=this.addEnteredText.bind(this),this.textPropertyChanged=this.textPropertyChanged.bind(this),this.textEditableChanged=this.textEditableChanged.bind(this),this.deleteText=this.deleteText.bind(this),this.addNewSticker=this.addNewSticker.bind(this),this.deleteSticker=this.deleteSticker.bind(this),this.stickerPropertyChanged=this.stickerPropertyChanged.bind(this),this.calloutPropertyChanged=this.calloutPropertyChanged.bind(this),this.deleteCallout=this.deleteCallout.bind(this),this.playerTimeUpdate=this.playerTimeUpdate.bind(this),this.makeVideoResizeableDraggable=this.makeVideoResizeableDraggable.bind(this),this.selectBlur=this.selectBlur.bind(this),this.selectAddBlur=this.selectAddBlur.bind(this),this.deleteBlur=this.deleteBlur.bind(this),this.addNewBlur=this.addNewBlur.bind(this),this.blurPropertyChanged=this.blurPropertyChanged.bind(this),this.blurAreaChanged=this.blurAreaChanged.bind(this),this.handleVideoPlay=this.handleVideoPlay.bind(this),this.handleVideoPause=this.handleVideoPause.bind(this),this.handleVideoSeeked=this.handleVideoSeeked.bind(this),this.newComponentDragged=this.newComponentDragged.bind(this),this.newComponentDropped=this.newComponentDropped.bind(this),this.getReloadConfirmationState=this.getReloadConfirmationState.bind(this),this.checkAndPopulateMf=this.checkAndPopulateMf.bind(this),this.playerResized=this.playerResized.bind(this),this.textBoxResized=this.textBoxResized.bind(this),this.initializeAtwho=this.initializeAtwho.bind(this),this.fontLoaded=this.fontLoaded.bind(this),this.markerSelected=this.markerSelected.bind(this),this.globalKeypress=this.globalKeypress.bind(this),this.initSettingModel=this.initSettingModel.bind(this),this.getBrandingInfoSuccess=this.getBrandingInfoSuccess.bind(this),this.cropResizable=this.videoPlayerView.$el.find(".se-crop-resizable"),this.primaryVideoContainer=this.videoPlayerView.$el.find(".primary-video-container"),this.primaryVideoOverflowContainer=this.videoPlayerView.$el.find(".primary-video-overflow-container"),this.secondaryVideoContainer=this.videoPlayerView.$el.find(".secondary-video-container"),this.secondaryVideoOverflowContainer=this.videoPlayerView.$el.find(".secondary-video-overflow-container"),this.infoText=this.$el.find(".default-control-detail .info-text"),p.default.initializeJQueryTouchPunch(),this.$el.find(".se-text-properties").unbind("change").bind("change",this.textPropertyChanged),0!=this.canInitializeUI&&this.initializeUI(),n()(document).bind("mousedown",{that:this},this.globalClick),this.$el.find(".trim-btn").unbind("click").bind("click",this.selectTrim),this.$el.find(".crop-btn").unbind("click").bind("click",this.selectCrop),this.$el.find(".add-text-btn").unbind("click").bind("click",this.selectAddText),this.$el.find(".add-callouts-btn").unbind("click").bind("click",this.selectAddCallouts),this.$el.find(".add-stickers-btn").unbind("click").bind("click",this.selectAddStickers),this.$el.find(".add-image-btn").unbind("click").bind("click",this.selectAddImage),this.$el.find(".apply-crop").unbind("click").bind("click",this.applyCrop),this.$el.find(".reset-crop").unbind("click").bind("click",this.resetCrop),this.$el.find(".add-text").unbind("click").bind("click",this.addEnteredText),this.videoPlayerView.$el.find(".se-text-editable").unbind("keypress").bind("keypress",this.textEditableChanged),this.videoPlayerView.$el.find(".se-clip-time").unbind("click").bind("click",{that:this},this.showClipTimePop),this.videoPlayerView.$el.find(".timer-input-btn").unbind("click").bind("click",{that:this},this.clipInputButtonClicked),this.videoPlayerView.$el.find(".timer-start-input, .timer-stop-input").unbind("keyup").bind("keyup",{that:this},this.clipInputtyped),this.$el.find(".se-sticker-btn").unbind("click").bind("click",{that:this},this.stickerBtnClicked),this.$el.find(".delete-sticker").unbind("click").bind("click",this.deleteSticker),this.$el.find(".sticker-control").unbind("change").bind("change",{that:this},this.stickerPropertyChanged),this.$el.find(".se-callout-btn").unbind("click").bind("click",{that:this},this.calloutBtnClicked),this.$el.find(".delete-callout").unbind("click").bind("click",this.deleteCallout),this.$el.find(".callout-control").unbind("change").bind("change",{that:this},this.calloutPropertyChanged),this.$el.find(".lock-aspect-ratio").unbind("click").bind("click",{that:this},this.lockAspectRatio),this.$el.find(".sticker-family-container").unbind("click").bind("click",{that:this},this.showStickerFamily),this.$el.find(".callout-scroll-right, .callout-scroll-left").unbind("click").bind("click",{that:this},this.scrollCallouts),this.$el.find(".addtext-input-text").unbind("keyup").bind("keyup",{that:this},this.addTextChanged),this.$el.find(".trim-input-btn").unbind("click").bind("click",{that:this},this.trimInputButtonClicked),this.$el.find(".trim-before-input, .trim-after-input").unbind("keyup").bind("keyup",{that:this},this.trimInputTyped),this.$el.find(".trim-before-time").unbind("click").bind("click",{that:this},this.showTrimBeforePop),this.$el.find(".trim-after-time").unbind("click").bind("click",{that:this},this.showTrimAfterPop),this.$el.find("#blurBtn").unbind("click").bind("click",this.selectAddBlur),this.$el.find("#resizeDragBtn").unbind("click").bind("click",this.makeVideoResizeableDraggable),this.$el.find(".delete-blur").unbind("click").bind("click",this.deleteBlur),this.$el.find("#applyBlur").unbind("click").bind("click",{that:this},this.addNewBlur),this.$el.find(".blur-control").unbind("click").bind("click",this.blurPropertyChanged),this.$el.find("#imageOpacitySlider").unbind("change").bind("change",this.changeImageOpacity),this.$el.find("#imageOpacityInput").unbind("change keyup").bind("change keyup",this.changeImageOpacity),this.$el.find("#imageArLock").unbind("change").bind("change",this.hanldeImageAspectRatioChange),this.$el.find("#deleteImage").unbind("click").bind("click",this.deleteImage),this.$el.find("#addImageBtn").unbind("click").bind("click",this.addImage),this.$el.find("#addPersonalizedImageBtn").unbind("click").bind("click",this.addPersonalizedImage),this.$el.find("#addWebsiteImageBtn").unbind("click").bind("click",this.addWebsiteImageBtn),this.$el.find("#imageOpacitySlider").val(100),!(this.isGuestRecording||this.isTicketVideoPreview||this.isAssignmentVideoPreview||this.isTestimonialVideoPreview||"true"!=n()("#isAddImageInVideoEnabled").val())||this.$el.find("#addImageMenuBtn").remove(),this.isTicketVideoPreview&&this.$el.find(".merge-field-container").remove(),document.fonts&&(document.fonts.onloadingdone=this.fontLoaded),this.videoPlayerView.setUpdateHandler(this.playerTimeUpdate),this.videoPlayerView.setPlayPauseHandler(this.handleVideoPlay,!0),this.videoPlayerView.setPlayPauseHandler(this.handleVideoPause,!1),this.videoPlayerView.setSeekedHandler(this.handleVideoSeeked),this.videoPlayerView.setPlayerResizeHandler(this.playerResized),this.userEmail=n()("#userEmail").val(),n()(document).bind("keydown",{that:this},this.globalKeypress),this.applyCustomColors(),this.addCustomFontStyles(),HippoVideo&&HippoVideo.AppRegistry&&HippoVideo.AppRegistry.isDeepIntg&&HippoVideo.AppRegistry.isPersonalizationEnabled&&n()("#addTextBtn").hide()},initSettingModel:function(){var e=this;this.settingModel=new(k())({settingTabName:y().wizSetting.BRANDING});var i={};try{if(HippoVideo&&HippoVideo.data&&HippoVideo.data.api&&HippoVideo.data.api.getProperty&&""!=HippoVideo.data.api.getProperty("userEmail"))i={authentication_token:HippoVideo.data.api.getProperty("authToken"),email:encodeURIComponent(HippoVideo.data.api.getProperty("userEmail"))},this.settingModel.fetch({data:i,success:function(i){e.brand_colors=i.get("info").brand_colors,i.get("info").brand_font&&(e.defaultFontValue=i.get("info").brand_font.toLowerCase().replace(/\s/g,""),e.$el.find(".se-font-selector").val(e.defaultFontValue)),i.get("info").brand_font_color&&(e.brand_font_color=i.get("info").brand_font_color),e.setupSpectrum()}});else if(this.digest||this.recorderApiModel){var t=e.getPageSource();this.recorderApiModel?this.recorderApiModel.getBrandingInfo().then((function(i){e.getBrandingInfoSuccess(i,e)})).catch((function(e){console.error(e)})):this.settingModel.getDigestInfo(this.digest,t,(function(i){e.getBrandingInfoSuccess(i,e)}))}}catch(e){console.error(e)}},getBrandingInfoSuccess:function(e,i){i.brand_colors=e.brand_colors,e.brand_font&&(i.defaultFontValue=e.brand_font.toLowerCase().replace(/\s/g,""),i.$el.find(".se-font-selector").val(i.defaultFontValue)),e.brand_font_color&&(i.brand_font_color=e.brand_font_color),i.setupSpectrum()},getPageSource:function(){return"true"==n()("#isTestimonial").val()?"testimonial":n()("#isGuestRecording").val()?"guest":"lessonly"==h.default.getQueryParams().type?"lessonly":"generic_embed"==h.default.getQueryParams().type?"generic_embed":this.integrationType?this.integrationType:""},resizeHandler:function(){this.mediaContainerResized(this.primaryVideoContainer),this.mediaContainerResized(this.secondaryVideoContainer)},initializeUI:function(){var e=this;this.defaultFontValue="timesnewroman",this.$el.find(".trim-slider").slider({range:!0,min:0,max:1e3,step:1,values:[0,1e3],start:function(){e.unselectAllComponents()},slide:function(i,t){e.$el.find(".trim-control-detail input.sliderValue[data-index=0]").val(t.values[0]),e.$el.find(".trim-control-detail input.sliderValue[data-index=1]").val(1e3-t.values[1]),e.trimChanged(),e.trimSliding(t)},stop:function(i){e.$el.find(".trim-before-container, .trim-after-container").removeClass("trim-hovered"),e.trimChanged()}}),this.cropResizable.resizable({containment:e.videoPlayerView.$el.find(".se-crop-scale"),handles:"n, e, w, s, ne, nw, se, sw",resize:function(i,t){e.cropResized(!0)},stop:function(){e.cropStopped()}}),this.makeVideoContainerResizable(this.primaryVideoContainer,this.$el.find(".primaryvid-control-detail .lock-aspect-ratio").is(":checked")),this.primaryVideoContainer.draggable({scroll:!1,opacity:.9,snap:".hippo-video-player, .se-crop-highlighter",snapMode:"both",snapTolerance:10,start:this.userEventStart,stop:function(){e.unselectAllComponents(),e.userEventStop()}}),this.makeVideoContainerResizable(this.secondaryVideoContainer,this.$el.find(".secondaryvid-control-detail .lock-aspect-ratio").is(":checked")),this.secondaryVideoContainer.draggable({scroll:!1,opacity:.9,snap:".hippo-video-player, .primary-video-container, .se-crop-highlighter",snapMode:"both",snapTolerance:10,start:this.userEventStart,stop:function(){e.unselectAllComponents(),e.userEventStop()}}),n()(".primary-video-container, .secondary-video-container").hover((function(){n()(".se-components-hover").removeClass("se-components-hover"),n()(this).addClass("se-components-hover")}),(function(){n()(this).removeClass("se-components-hover")}));var i=h.default.getFontMap(),t=[];for(var o in i)t.push(o);t=t.sort();for(var s=0;s<t.length;s++)o=t[s],this.$el.find(".se-font-selector").append(n()("<option>",{value:o,text:i[o].family,style:"font-family: "+i[o].family+";"})),this.defaultFontValue=i[o].isDefault?o:this.defaultFontValue;for(var a in this.$el.find(".se-font-selector").val(this.defaultFontValue),this.$el.find(".sticker-btn-container").empty(),this.stickers){var r=this.stickers[a];this.$el.find(".sticker-btn-container").append(T()({i:a,mainImg:"https://s3.amazonaws.com/hippolms-wiz-static/stickers-preview/s"+r.mainId+".png?v=2"})),this.downloadAndSetStickers(this,a,r.startId,r.endId)}for(var l in this.$el.find(".callout-btn-container").empty(),this.calloutsDisplayorder){a=this.calloutsDisplayorder[l];var d=document.createElement("img");n()(d).addClass("se-callout-btn"),d.id="se-callout-btn-"+a,d.src="https://s3.amazonaws.com/hippolms-wiz-static/callouts/c"+a+".png?v=2",d.crossOrigin="Anonymous",this.$el.find(".callout-btn-container").append(d),this.findCalloutSize(a)}this.$el.find(".se-callout-btn").draggable({scroll:!1,helper:"clone",revert:"invalid",revertDuration:100,start:this.newComponentDragged,stop:this.newComponentDropped}),this.$el.find(".se-sticker-btn").draggable({scroll:!1,appendTo:"body",stack:".se-sticker-btn",helper:"clone",revert:"invalid",revertDuration:100,start:this.newComponentDragged,stop:this.newComponentDropped}),this.videoPlayerView.$el.find(".se-crop-resizable").droppable({accept:".se-sticker-btn, .se-callout-btn",drop:function(i,t){e.componentDropped(t.draggable[0].id,i.pageX-e.videoPlayerView.$el.find(".se-crop-scale").offset().left-40,i.pageY-e.videoPlayerView.$el.find(".se-crop-scale").offset().top-40)}}),this.videoPlayerView.$el.find(".se-clip-time").resizable({containment:e.videoPlayerView.$el.find(".components-time-container"),handles:"e, w",resize:function(e,i){},stop:function(){e.onClipTimeChangeHandler(),e.updateTimeFromClipToPopup(e)}});var c=this.$el.find(".addtext-control-detail .color-picker .sp-replacer"),p=document.createElement("div");n()(p).addClass("text-color-picker"),n()(p).text("A"),n()(c).prepend(p),this.$el.find(".se-font-selector").select2({minimumResultsForSearch:-1,theme:"hippocategory",width:"element",dropdownCssClass:"et-dropdown-css",templateResult:function(e,i){return e.element&&n()(i)[0].style.setProperty("font-family",n()(e.element).css("font-family"),"important"),e.text}}),this.$el.find(".se-fontsize-selector").select2({minimumResultsForSearch:-1,theme:"hippocategory"}),this.isPersonalizationEnabled&&(this.$el.find("#seMfSelector").select2({tags:!0,multiple:!1,theme:"hippocategory",templateResult:function(e,i){return e.element&&n()(i).addClass("selection-in-blue"),e.text}}),this.mfValues=["{Email}","{First Name}","{Last Name}","{Country}","{City}","{Phone Number}","{Company Name}","{Title}","{State}","{Address}"],this.$el.find("#seMfSelector").on("change",{that:this},this.handleMfChange)),this.$el.find(".se-textalign-selector").select2({minimumResultsForSearch:-1,dropdownAutoWidth:!0,theme:"hippocategory",templateSelection:function(i){return'<img width="10" src="'+e.origin+"/svg/text-"+i.id+'-align.svg"/>'},templateResult:function(i){return i.id||(i.id="center"),'<img width="10" style="margin-right:5px" src="'+e.origin+"/svg/text-"+i.id+'-align.svg"/>'+i.text},escapeMarkup:function(e){return e}}).next(".select2-container").addClass("textalign-select2"),this.$el.find(".select2-selection__rendered").removeAttr("title"),this.disable(),this.cropResized(!1),this.enableBlurForPlayer()},setupSpectrum:function(){var e=this,i={showInput:!0,preferredFormat:"rgb",clickoutFiresChange:!0,chooseText:"set",color:e.brand_font_color,show:function(){e.showingColorPicker=!0,n()(".seColorContainer").length>0&&n()(".seColorContainer")[0].scrollIntoView({block:"end",behavior:"smooth"})},hide:function(){e.showingColorPicker=!1},move:function(){e._previewColorChange()},change:function(){e._handleColorChange(),e.showingColorPicker=!1},containerClassName:"seColorContainer"};if(this.brand_colors&&this.brand_colors.length>0){var t=g.getPaletteConfig(this.brand_colors,"seColorContainer",this.colorPaletteEnabled);i=Object.assign(i,t)}this.$el.find(".se-color-selector").spectrum(i)},_previewColorChange:function(){if(this.currentSelectedText){var e=this.$el.find(".addtext-control-detail .se-color-choose").spectrum("get").toHexString();this.videoPlayerView.$el.find("#se-component-"+this.currentSelectedText+" .text-el-line").css("color",e)}},_handleColorChange:function(){this.setTextColorInClip()},setTextColorInClip:function(){if(this.currentSelectedText){var e=this.getClipOf(this.currentSelectedText);e&&(e.properties.color=this.$el.find(".addtext-control-detail .se-color-choose").spectrum("get").toHexString(),this.updateProjectJson(),this.reconstructUI())}},downloadAndSetStickers:function(e,i,t,o){if(!(t>=o)){var s=document.createElement("img");n()(s).addClass("se-sticker-btn"),s.id="se-sticker-btn-"+t,s.src="https://s3.amazonaws.com/hippolms-wiz-static/stickers-all/transparent.png?v=2";var a=(t-2)%50*-20,r=-20*Math.floor((t-2)/50);s.style.background="url('https://s3.amazonaws.com/hippolms-wiz-static/stickers-all/stickers_all.png?v=2') "+a+"px "+r+"px",e.$el.find(".sticker-family-container-"+i+" .sticker-family-all").append(s),e.findStickerSize(t),n()(s).unbind("click").bind("click",{that:e},e.stickerBtnClicked),setTimeout((function(){e.downloadAndSetStickers(e,i,t+1,o)}),10)}},enable:function(){this.enabled=!0;try{HippoVideo.data.api.getProperty("isTrimEnabled")&&this.$el.find(".simple-edit-buttons-box").hide()}catch(e){}this.primaryVideoContainer.css("z-index","100"),this.secondaryVideoContainer.css("z-index","101"),this.videoPlayerView.setSimpleEditMode(!0),this.unselectAllControls(),this.videoPlayerView.$el.find(".se-crop-highlighter").css({background:"rgba(72, 72, 72, 0.97)","z-index":"108"}),this.videoPlayerView.$el.css("overflow","visible"),this.videoPlayerView.$el.find(".se-crop-scale").css({top:"0px",left:"0px"}),this.scaleElement(this.videoPlayerView.$el.find(".se-crop-scale"),1,1,0,0),n()("#previewPageLeft").addClass("simple-edit-top-pad"),n()(".body-wiz").addClass("tmp-body-wiz").removeClass("body-wiz"),n()(".tmp-body-wiz").css("margin-top","105px"),n()(".tmp-body-wiz").animate({marginTop:"0px"},200),this.videoPlayerView.$el.find(".thumbnail-container").hide(),this.videoPlayerView.$el.find(".play-btn-container").fadeOut(100),this.videoPlayerView.$el.find(".player-touch-guard").hide(),this.snapshot={},this.snapshot.projectJson=h.default.naiveClone(this.projectJson),this.snapshot.trimSliderStart=this.sessionDetails.trimSliderStart,this.snapshot.trimSliderEnd=this.sessionDetails.trimSliderEnd,this.snapshot.addedClips=h.default.naiveClone(this.sessionDetails.addedClips),this.cropResizable.removeClass("disp-none").addClass("disp-show"),this.snapshot.crop={x:this.cropResizable.position().left,y:this.cropResizable.position().top,w:this.cropResizable.width(),h:this.cropResizable.height()},this.cropResizable.removeClass("disp-show").addClass("disp-none"),this.onBoardRequired?(this.onBoardRequired=!1,this.onBoardUser()):(this.$el.find(".default-control-detail").show(),this.infoText.html(" ")),this.reconstructUI(),this.videoPlayerView.resizePlayerForWindow(),this.$el.find("#trimBtn").length>0?this.selectTrim():this.$el.find(".simple-edit-buttons-box .wiz-simple-edit-btn").first().click(),!1===this.overrideWarnOnExit&&(window.onbeforeunload=function(){return"Please save before you close!!"}),this.prefetchAssetsForSimpleEdit()},save:function(){this.disable(),this.disabled(),this.projectJson.simpleEdit=!0,this.projectJson.seSessionDetails=this.sessionDetails,this.renderVideo()},renderVideo:function(e){var i=this;this.recorder?this.recorder.renderVideo({assetId:this.assetId,projectJson:this.getIOAdjustedProjectJSON(),renderFrom:"simple_edit",immediate_render:!1}).then((function(){h.default.trackInDB("SE-Save",i.userEmail),i.isPPR&&i._getVideoModel().urgent_videos([i.assetId],(function(){m().trigger("remountCtaActions"),e&&e.resolve("")}))})).catch((function(i){console.error(err),e&&e.reject("error")})):this._getVideoModel().mergeAndRender(this.assetId,this.getIOAdjustedProjectJSON(),"simple_edit",this.digest,(function(t){h.default.trackInDB("SE-Save",i.userEmail),i.isPPR&&i._getVideoModel().urgent_videos([i.assetId],(function(){m().trigger("remountCtaActions"),e&&e.resolve("")}))}),(function(i){console.log("error ",i),e&&e.reject("error")}))},savePPR:function(){var e=this;return new Promise((function(i,t){e.disable(),e.disabled(),e.projectJson.simpleEdit=!0,e.projectJson.seSessionDetails=e.sessionDetails,e.renderVideoPPR().then((function(){i("success")})).catch((function(){t("error")}))}))},renderVideoPPR:function(){var e=this;return new Promise((function(i,t){e.renderVideo({resolve:i,reject:t})}))},cancel:function(){this.cancelCrop(),this.disable(),this.projectJson=this.snapshot.projectJson,this.sessionDetails.trimSliderStart=this.snapshot.trimSliderStart,this.sessionDetails.trimSliderEnd=this.snapshot.trimSliderEnd,this.sessionDetails.addedClips=this.snapshot.addedClips;var e=this;this.reconstructUI(!0,(function(){e.disabled()})),this.isFromSdk&&this.videoPlayerView.$el.css("overflow","hidden")},disable:function(){this.enabled=!1,this.unselectAllComponents(),this.unselectAllControls(),this.primaryVideoContainer.css("z-index","0"),this.primaryVideoContainer.resizable({disabled:!0}),this.primaryVideoContainer.draggable({disabled:!0}),this.secondaryVideoContainer.css("z-index","0"),this.secondaryVideoContainer.resizable({disabled:!0}),this.secondaryVideoContainer.draggable({disabled:!0}),this.videoPlayerView.setSimpleEditMode(!1),this.videoPlayerView.$el.find(".player-border").fadeOut(),this.videoPlayerView.$el.find(".player-touch-guard").show(),n()(".tmp-body-wiz").animate({marginTop:"0px"},200,(function(){n()(".tmp-body-wiz").addClass("body-wiz").removeClass("tmp-body-wiz")})),this.askReloadConfirmation=!1,!1===this.overrideWarnOnExit&&(window.onbeforeunload=void 0)},disabled:function(){this.cropResizable.removeClass("disp-none").addClass("disp-show"),null!=this.projectJson.crop&&this.cropResizable.css({left:this.getValueForPlayer(this.projectJson.crop.x,!0)+"px",top:this.getValueForPlayer(this.projectJson.crop.y,!1)+"px",width:this.getValueForPlayer(this.projectJson.crop.w,!0)+"px",height:this.getValueForPlayer(this.projectJson.crop.h,!1)+"px"}),this.cropResizable.removeClass("disp-show").addClass("disp-none"),this.reconstructUI(),this.cropResized(!1,!1),this.cropResizable.removeClass("disp-none").addClass("disp-show"),this.videoPlayerView.$el.find(".se-text-component, .se-image-component").draggable({disabled:!0}),this.videoPlayerView.$el.find(".se-text-component").unbind("click"),this.videoPlayerView.$el.find(".se-text-component").css({"user-select":"none",cursor:"default"}),this.videoPlayerView.$el.find(".se-crop-highlighter").css({background:"black","z-index":"200"}),this.videoPlayerView.$el.css("overflow","hidden");var e=this.cropResizable.height(),i=this.cropResizable.width(),t=this.videoPlayerView.$el.width(),o=this.videoPlayerView.$el.height(),s=t/i,a=o/e;if(s*e>o){var r=this.cropResizable.position().top,n=t/2-i*a/2-this.cropResizable.position().left;this.videoPlayerView.$el.find(".se-crop-scale").css("top",-r+"px"),this.scaleElement(this.videoPlayerView.$el.find(".se-crop-scale"),a,a,this.cropResizable.position().left,r),this.videoPlayerView.$el.find(".se-crop-scale").css("left",n+"px")}else r=o/2-e*s/2-this.cropResizable.position().top,n=this.cropResizable.position().left,this.videoPlayerView.$el.find(".se-crop-scale").css("left",-n+"px"),this.scaleElement(this.videoPlayerView.$el.find(".se-crop-scale"),s,s,n,this.cropResizable.position().top),this.videoPlayerView.$el.find(".se-crop-scale").css("top",r+"px");this.cropResizable.removeClass("disp-show").addClass("disp-none")},setProjectJson:function(e){if(this.projectJson=e,window.projectJson=this.projectJson,this.projectJson.simpleEdit=!0,null!=this.projectJson.seSessionDetails)this.sessionDetails=this.projectJson.seSessionDetails;else{this.sessionDetails.totalCreatedClips=this.projectJson.clips.length;for(var i=!1,t=0;t<this.projectJson.clips.length;t++)(r=this.projectJson.clips[t]).footage.type,"screenrecord"==r.footage.type&&(i=!0);var o=-1,s=[],a=JSON.parse(JSON.stringify(this.projectJson.clips||[]));for(t=0;t<this.projectJson.clips.length;t++)(r=a[t]).properties.xposRaw=this.getValueForPlayer(r.properties.xpos,!0),r.properties.yposRaw=this.getValueForPlayer(r.properties.ypos,!1),r.properties.widthRaw=this.getValueForPlayer(r.properties.width,!0),r.properties.heightRaw=this.getValueForPlayer(r.properties.height,!1),"screenrecord"!=r.footage.type&&"webcam"!=r.footage.type||(o=-1==o?r.footage.duration:Math.min(o,r.footage.duration),s.push(r.footage)),r.footage.containsVideo&&("screenrecord"==r.footage.type||"webcam"==r.footage.type&&!i?(this.sessionDetails.primaryVideo=r.id,this.sessionDetails.totalAddedEffects=(r.effects||[]).length):"webcam"==r.footage.type&&(this.sessionDetails.secondaryVideo=r.id));for(var t in s)s[t].duration=o}for(t=0;t<this.projectJson.clips.length;t++){var r=this.projectJson.clips[t];this.isImageComponent(r.id)&&("image"==r.footage.type?r.footage.src=this.footageUrls[Number(r.footage.id)]:r.footage.src=f.getMfImage(r.footage.image_id?r.footage.image_id:r.footage.id,r.footage.is_website?"website":"image"))}this.cropResizable.removeClass("disp-none").addClass("disp-show"),null!=this.projectJson.crop&&this.cropResizable.css({left:this.getValueForPlayer(this.projectJson.crop.x,!0)+"px",top:this.getValueForPlayer(this.projectJson.crop.y,!1)+"px",width:this.getValueForPlayer(this.projectJson.crop.w,!0)+"px",height:this.getValueForPlayer(this.projectJson.crop.h,!1)+"px"}),this.cropResizable.removeClass("disp-show").addClass("disp-none"),null==this.sessionDetails.secondaryVideo&&this.secondaryVideoContainer.hide(),this.reconstructUI(),this.cropResized(!1,!1),this.enabled||this.disabled()},mediaContainerResized:function(e){var i=e.find("video");0==i.length&&(i=e.find("img"));var t=e.width()/i.width(),o=e.height()/i.height();i.css("height",""),this.scaleElement(i,t,o)},scaleElement:function(e,i,t,o,s){e.css({"-ms-transform":"scale("+i+","+t+")","-webkit-transform":"scale("+i+","+t+")",transform:"scale("+i+","+t+")","-ms-transform-origin:":null==o?"top left":o+"px "+s+"px","-webkit-transform-origin":null==o?"top left":o+"px "+s+"px","transform-origin":null==o?"top left":o+"px "+s+"px"})},globalClick:function(e){HippoVideo&&HippoVideo.AppRegistry&&HippoVideo.AppRegistry.isDeepIntg&&("saveTextEdit"!==e.target.id&&"cancelTextEdit"!==e.target.id||n()("#"+e.target.id).is(":visible")&&n()("#"+e.target.id).click());var i=e.data.that;i.enabled&&(i.currentSelectedText,0!=i.videoPlayerView.$el.find(".se-text-editable").has(n()(e.target)).length||0!=i.videoPlayerView.$el.find(".se-text-component").has(n()(e.target)).length||n()(e.target).hasClass("se-text-component")||n()(e.target).hasClass("se-text-editable")||null==i.currentSelectedText||n()(e.target).parent().hasClass("atwho-view-ul")||(i.textEditableChanged(),i.videoPlayerView.$el.find(".se-text-editable").is(":visible")?i.closeTextEditable():0==i.$el.find(".addtext-control-detail").has(n()(e.target)).length&&0==i.videoPlayerView.$el.find(".player-controls-container").has(n()(e.target)).length&&0==n()(".sp-picker-container").has(n()(e.target)).length&&0==n()(".sp-palette-container").has(n()(e.target)).length&&i.unselectText()),0!=i.videoPlayerView.$el.find(".se-text-editable").has(n()(e.target)).length||0!=i.videoPlayerView.$el.find(".se-text-component").has(n()(e.target)).length||n()(e.target).hasClass("se-text-component")||n()(e.target).hasClass("se-text-editable")||n()(e.target).parent().hasClass("atwho-view-ul")||n()(e.target).hasClass("se-image-component")||(null!=i.currentSelectedSticker?0==i.$el.find(".addsticker-control-detail").has(n()(e.target)).length&&0==i.$el.find(".addimage-control-detail").has(n()(e.target)).length&&0==i.videoPlayerView.$el.find(".player-controls-container").has(n()(e.target)).length&&0==n()(".sp-picker-container").has(n()(e.target)).length&&0==n()(".sp-palette-container").has(n()(e.target)).length&&i.unselectSticker():null!=i.currentSelectedCallout?0==i.$el.find(".addcallout-control-detail").has(n()(e.target)).length&&0==i.videoPlayerView.$el.find(".player-controls-container").has(n()(e.target)).length&&0==n()(".sp-picker-container").has(n()(e.target)).length&&0==n()(".sp-palette-container").has(n()(e.target)).length&&i.unselectCallout():null!=i.currentSelectedBlur&&0==i.$el.find(".blur-control-detail").has(n()(e.target)).length&&0==i.videoPlayerView.$el.find(".player-controls-container").has(n()(e.target)).length&&0==n()(".sp-picker-container").has(n()(e.target)).length&&0==n()(".sp-palette-container").has(n()(e.target)).length&&i.unselectBlur()),0!=i.$el.has(n()(e.target)).length||0!=i.videoPlayerView.$el.has(n()(e.target)).length||i.showingColorPicker||n()(e.target).parent().hasClass("atwho-view-ul")||i.unselectAllComponents(),0==i.$el.find(".sticker-family-container").has(n()(e.target)).length&&i.$el.find(".sticker-family-all").hide(),!n()(e.target).hasClass("trim-before-pop")&&0==i.$el.find(".trim-before-pop").has(n()(e.target)).length&&i.$el.find(".trim-before-pop").is(":visible")&&i.$el.find(".trim-before-pop").fadeOut(100),!n()(e.target).hasClass("trim-after-pop")&&0==i.$el.find(".trim-after-pop").has(n()(e.target)).length&&i.$el.find(".trim-after-pop").is(":visible")&&i.$el.find(".trim-after-pop").fadeOut(100))},selectPrimaryVideo:function(){this.enabled&&(this.primaryVideoOverflowContainer.css("overflow","visible"),this.primaryVideoContainer.addClass("edit-video-selected").css("z-index","105").resizable("enable"),this.secondaryVideoContainer.removeClass("edit-video-selected").css("z-index","106").resizable("disable"),this.$el.find(".primaryvid-control-detail").show(),this.$el.find(".secondaryvid-control-detail").hide())},selectSecondaryVideo:function(){this.enabled&&(this.secondaryVideoOverflowContainer.css("overflow","visible"),this.secondaryVideoContainer.addClass("edit-video-selected").css("z-index","105").resizable("enable"),this.primaryVideoContainer.removeClass("edit-video-selected").css("z-index","105").resizable("disable"),this.$el.find(".primaryvid-control-detail").hide(),this.$el.find(".secondaryvid-control-detail").show())},makeVideoResizeableDraggable:function(){this.enabled&&(this.isPPR?h.default.trackInThirdPartyTools("video_preview_Resize_save_isPPR",{email:this.userEmail}):h.default.trackInThirdPartyTools("video_preview_Resize_save",{email:this.userEmail}),this.unselectAllControls(),this.userEventStart(),this.unselectAllComponents(),this.selectPrimaryVideo(),this.selectControl("resize-draggable-btn"),this.primaryVideoContainer.unbind("mousedown",this.selectPrimaryVideo).bind("mousedown",this.selectPrimaryVideo).draggable("enable"),this.secondaryVideoContainer.unbind("mousedown",this.selectSecondaryVideo).bind("mousedown",this.selectSecondaryVideo).draggable("enable"),this.$el.find(".se-resize-control-detail").show())},unselectClips:function(){this.primaryVideoContainer.unbind("mousedown",this.selectPrimaryVideo).resizable({disabled:!0}).draggable({disabled:!0}),this.secondaryVideoContainer.unbind("mousedown",this.selectSecondaryVideo).resizable({disabled:!0}).draggable({disabled:!0}),this.$el.find(".se-resize-control-detail, .primaryvid-control-detail, .secondaryvid-control-detail").hide(),this.primaryVideoOverflowContainer.css("overflow","hidden"),this.secondaryVideoOverflowContainer.css("overflow","hidden"),this.primaryVideoContainer.css("z-index","100"),this.secondaryVideoContainer.css("z-index","101"),n()(".edit-video-selected").removeClass("edit-video-selected")},userEventStart:function(){this.videoPlayerView.$el.find(".player-border").fadeIn()},userEventStop:function(){this.videoPlayerView.$el.find(".player-border").fadeOut(),this.updateProjectJson()},playerResized:function(e){if(null!=this.projectJson&&(this.enabled||(this.videoPlayerView.$el.find(".se-crop-scale").css({top:"0px",left:"0px"}),this.scaleElement(this.videoPlayerView.$el.find(".se-crop-scale"),1,1,0,0)),this.cropResizable.removeClass("disp-none").addClass("disp-show"),null!=this.projectJson.crop&&this.cropResizable.css({left:this.getValueForPlayer(this.projectJson.crop.x,!0)+"px",top:this.getValueForPlayer(this.projectJson.crop.y,!1)+"px",width:this.getValueForPlayer(this.projectJson.crop.w,!0)+"px",height:this.getValueForPlayer(this.projectJson.crop.h,!1)+"px"}),this.cropResizable.removeClass("disp-show").addClass("disp-none"),this.reconstructUI(),this.cropResized(!1,!1),!this.enabled)){this.videoPlayerView.$el.find(".se-crop-resizable").removeClass("disp-none").addClass("disp-show");var i=this.cropResizable.height(),t=this.cropResizable.width(),o=this.videoPlayerView.$el.width(),s=this.videoPlayerView.$el.height(),a=o/t,r=s/i;if(a*i>s){var n=this.cropResizable.position().top,l=o/2-t*r/2-this.cropResizable.position().left;this.videoPlayerView.$el.find(".se-crop-scale").css("top",-n+"px"),this.scaleElement(this.videoPlayerView.$el.find(".se-crop-scale"),r,r,this.cropResizable.position().left,n),this.videoPlayerView.$el.find(".se-crop-scale").css("left",l+"px")}else n=s/2-i*a/2-this.cropResizable.position().top,l=this.cropResizable.position().left,this.videoPlayerView.$el.find(".se-crop-scale").css("left",-l+"px"),this.scaleElement(this.videoPlayerView.$el.find(".se-crop-scale"),a,a,l,this.cropResizable.position().top),this.videoPlayerView.$el.find(".se-crop-scale").css("top",n+"px");this.videoPlayerView.$el.find(".se-crop-resizable").removeClass("disp-show").addClass("disp-none"),this.videoPlayerView.resizeFitThumnbail()}},updateProjectJson:function(){if(this.enabled){var e=h.default.map(this.sessionDetails.trimSliderStart,0,1e3,0,this.videoPlayerView.mediaPlayer.duration),i=h.default.map(this.sessionDetails.trimSliderEnd,0,1e3,0,this.videoPlayerView.mediaPlayer.duration);if(h.default.isNumber(e)&&h.default.isNumber(i))for(var t=0;t<this.projectJson.clips.length;t++){var o=this.projectJson.clips[t];if(this.updateClipPropertiesForProjectJSON(o,e,i),o.id===this.sessionDetails.primaryVideo)for(var s=o.effects||[],a=0;a<s.length;a++)this.updateClipPropertiesForProjectJSON(s[a],e,i)}var r=this.cropResizable.is(":visible");for(this.cropResizable.removeClass("disp-none").addClass("disp-show"),this.projectJson.crop={x:this.getValueForProject(this.cropResizable.position().left,!0),y:this.getValueForProject(this.cropResizable.position().top,!1),w:Math.min(this.getValueForProject(this.cropResizable.width(),!0),this.projectJson.canvasWidth),h:Math.min(this.getValueForProject(this.cropResizable.height(),!1),this.projectJson.canvasHeight)},r||this.cropResizable.removeClass("disp-show").addClass("disp-none"),t=0;t<this.projectJson.clips.length;t++)s=(o=this.projectJson.clips[t]).effects||[],null!=this.sessionDetails.primaryVideo&&o.id==this.sessionDetails.primaryVideo&&(o.properties.widthRaw=this.primaryVideoContainer.width(),o.properties.heightRaw=this.primaryVideoContainer.height(),o.properties.xposRaw=this.primaryVideoContainer.position().left,o.properties.yposRaw=this.primaryVideoContainer.position().top,o.properties.width=this.getValueForProject(o.properties.widthRaw,!0),o.properties.height=this.getValueForProject(o.properties.heightRaw,!1),o.properties.xpos=this.getValueForProject(o.properties.xposRaw,!0),o.properties.ypos=this.getValueForProject(o.properties.yposRaw,!1)),null!=this.sessionDetails.secondaryVideo&&o.id==this.sessionDetails.secondaryVideo&&(o.properties.widthRaw=this.secondaryVideoContainer.width(),o.properties.heightRaw=this.secondaryVideoContainer.height(),o.properties.xposRaw=this.secondaryVideoContainer.position().left,o.properties.yposRaw=this.secondaryVideoContainer.position().top,o.properties.width=this.getValueForProject(o.properties.widthRaw,!0),o.properties.height=this.getValueForProject(o.properties.heightRaw,!1),o.properties.xpos=this.getValueForProject(o.properties.xposRaw,!0),o.properties.ypos=this.getValueForProject(o.properties.yposRaw,!1)),-1!==this.sessionDetails.addedClips.indexOf(o.id)&&o.footage.containsImage&&(this.videoPlayerView.$el.find("#se-component-"+o.id).length>0?(o.properties.xposRaw=this.videoPlayerView.$el.find("#se-component-"+o.id).position().left,o.properties.yposRaw=this.videoPlayerView.$el.find("#se-component-"+o.id).position().top,o.properties.widthRaw=this.videoPlayerView.$el.find("#se-component-"+o.id).width(),o.properties.heightRaw=this.videoPlayerView.$el.find("#se-component-"+o.id).height(),o.properties.xpos=this.getValueForProject(o.properties.xposRaw,!0),o.properties.ypos=this.getValueForProject(o.properties.yposRaw,!1),o.properties.width=this.getValueForProject(o.properties.widthRaw,!0),o.properties.height=this.getValueForProject(o.properties.heightRaw,!1)):console.warn("not drawn#se-component-"+o.id)),o.footage.containsText&&(null==o.properties.fontSizeProject&&(o.properties.fontSizeProject=this.getValueForProject(o.properties.fontSize,!0)),o.properties.boundingBoxRaw&&(o.properties.boundingBox=this.getBoundingBoxForProject(o.properties.boundingBoxRaw)))}},updateClipPropertiesForProjectJSON:function(e,i,t){null!=e.startFrom&&null!=e.endAt?(e.position=e.startFrom-i,0==e.position&&(e.position=.001),e.position>this.videoPlayerView.mediaPlayer.duration-t?e.deleted=!0:e.deleted=!1,e.end=e.endAt-e.startFrom,e.endAt>this.videoPlayerView.mediaPlayer.duration-t&&(e.end=this.videoPlayerView.mediaPlayer.duration-t-e.startFrom),e.end=Math.max(.02,e.end),e.start=0):(e.start=i,e.end=(e.footage?e.footage.duration:e.duration)-t,e.end<e.start&&(e.end=e.start))},reconstructUI:function(e,i,{blurRegionChanged:t=!1}={}){if(this.projectJson){var o=this.videoPlayerView.$el.width()/this.projectJson.canvasWidth,s=this.videoPlayerView.$el.height()/this.projectJson.canvasHeight,a=this,r=!1,l=this.videoPlayerView.$el.find(".se-components-container");l.empty();var d=function(){a.resizeHandler(),i&&!r&&(r=!0,i())};void 0===this.sessionDetails.primaryVideo&&void 0===this.sessionDetails.secondaryVideo&&this.updateProjectJson();var c=h.default.map(this.sessionDetails.trimSliderStart,0,1e3,0,this.videoPlayerView.mediaPlayer.duration),p=h.default.map(this.sessionDetails.trimSliderEnd,0,1e3,0,this.videoPlayerView.mediaPlayer.duration);h.default.isNumber(c)&&h.default.isNumber(p)&&this.videoPlayerView.trim(c,p,!0);for(var u=JSON.parse(JSON.stringify(this.projectJson.clips||[])),m=0;m<this.projectJson.clips.length;m++){var f=u[m];if(null!=this.sessionDetails.primaryVideo&&f.id==this.sessionDetails.primaryVideo&&this.primaryVideoContainer.animate({width:f.properties.width*o+"px",height:f.properties.height*s+"px",left:f.properties.xpos*o+"px",top:f.properties.ypos*s+"px"},e?200:10,d),null!=this.sessionDetails.secondaryVideo&&f.id==this.sessionDetails.secondaryVideo&&this.secondaryVideoContainer.animate({width:f.properties.width*o+"px",height:f.properties.height*s+"px",left:f.properties.xpos*o+"px",top:f.properties.ypos*s+"px"},e?200:10,d),-1!=this.sessionDetails.addedClips.indexOf(f.id))if(a=this,f.footage.containsText){(v=document.createElement("div")).id="se-component-"+f.id,n()(v).addClass("se-text-component"),f.properties.boundingBox?(f.properties.boundingBoxRaw={x:f.properties.boundingBox.x*o,y:f.properties.boundingBox.y*s,w:f.properties.boundingBox.w*o,h:f.properties.boundingBox.h*s},n()(v).css({left:f.properties.boundingBoxRaw.x+"px",top:f.properties.boundingBoxRaw.y+"px",width:f.properties.boundingBoxRaw.w+"px",height:f.properties.boundingBoxRaw.h+"px"})):n()(v).css({left:f.properties.xpos*o+"px",top:f.properties.ypos*s+"px"}),this.setTextDraggableContainerSize(v,f,!1);var g=document.createElement("div");n()(g).addClass("se-text-container"),this.checkAndPopulateMf(f.properties.text),this.newlineTextToHtml(g,f),n()(v).append(g),n()(v).append('<span class="se-text-delete">x</span>'),n()(v).find(".se-text-delete").bind("click",this.deleteText),n()(v).draggable({scroll:!1,opacity:.9,snap:".hippo-video-player, .se-crop-highlighter",snapMode:"both",snapTolerance:10,start:function(e){a.selectText(e.target.id.split("se-component-")[1]),a.userEventStart()},stop:function(){a.textBoxResized(),a.textPropertyChanged(),a.userEventStop()}}),f.footage.calloutId&&n()(v).draggable("option","containment","#se-component-"+f.footage.calloutId),n()(v).click((function(e){if(!((new Date).getTime()-a.lastTextResizeTime<100)){var i=a.currentSelectedText==e.currentTarget.id.split("se-component-")[1];a.selectText(e.currentTarget.id.split("se-component-")[1]),i&&a.showTextEditable(e.currentTarget.id.split("se-component-")[1])}})),n()(v).hover((function(e){a.currentSelectedText!=e.currentTarget.id.split("se-component-")[1]&&(n()(".se-components-hover").removeClass("se-components-hover"),n()(this).addClass("se-components-hover"))}),(function(e){a.currentSelectedText!=e.currentTarget.id.split("se-component-")[1]&&n()(this).removeClass("se-components-hover")})),l.append(v),f.id==this.currentSelectedText&&this.selectText(f.id,!0),this.setLineHeight(f)}else if(f.footage.containsImage){var v=document.createElement("div"),y=document.createElement("img");y.crossOrigin="Anonymous",v.id="se-component-"+f.id,n()(v).addClass("se-image-component"),f.footage.id<=-1e4?y.src="https://s3.amazonaws.com/hippolms-wiz-static/callouts/c"+(-f.footage.id-1e4)+".png?v=2":this.isImageComponent(f.id)?y.src=f.footage.src:y.src="https://s3.amazonaws.com/hippolms-wiz-static/stickers/s"+(-f.footage.id-100)+".png?v=2",n()(v).css({left:f.properties.xpos*o+"px",top:f.properties.ypos*s+"px",width:f.properties.width*o+"px",height:f.properties.height*s+"px",opacity:f.properties.opacity}),n()(v).draggable({scroll:!1,opacity:.9,snap:".hippo-video-player, .se-crop-highlighter",snapMode:"both",snapTolerance:10,drag:function(e){var i=e.target.id.split("se-component-")[1];null==i&&(i=n()(e.target).parent()[0].id.split("se-component-")[1]),a.isCalloutImage(i)&&a.calloutDragged()},start:function(e){var i=e.target.id.split("se-component-")[1];if(null==i&&(i=n()(e.target).parent()[0].id.split("se-component-")[1]),a.isCalloutImage(i)){a.selectCallout(i);var t=a.getClipOf(i),o=a.getClipOf(t.footage.textId);o&&o.properties.boundingBoxRaw&&(a.calloutTextBoxSpread={x:h.default.map(o.properties.boundingBoxRaw.x,t.properties.xposRaw,t.properties.xposRaw+t.properties.widthRaw,0,1),y:h.default.map(o.properties.boundingBoxRaw.y,t.properties.yposRaw,t.properties.yposRaw+t.properties.heightRaw,0,1),w:o.properties.boundingBoxRaw.w/t.properties.widthRaw})}else a.selectSticker(i);a.userEventStart()},stop:function(e){var i=e.target.id.split("se-component-")[1];null==i&&(i=n()(e.target).parent()[0].id.split("se-component-")[1]),a.isCalloutImage(i)?(a.calloutDragged(),a.calloutPropertyChanged()):a.stickerPropertyChanged(),a.userEventStop(),a.isCalloutImage(i)?a.unselectCallout():a.unselectSticker()}}),n()(v).resizable({handles:"n, e, w, s, ne, nw, se, sw",aspectRatio:f.properties.lockAspectRatio,resize:function(e,i){a.mediaContainerResized(n()(e.target));var t=e.target.id.split("se-component-")[1];null==t&&(t=n()(e.target).parent()[0].id.split("se-component-")[1]),a.isCalloutImage(t)&&a.calloutResized(t)},start:function(e){var i=e.target.id.split("se-component-")[1];if(null==i&&(i=n()(e.target).parent()[0].id.split("se-component-")[1]),a.isCalloutImage(i)){a.selectCallout(i);var t=a.getClipOf(i),o=a.getClipOf(t.footage.textId);o&&o.properties.boundingBoxRaw&&(a.calloutTextBoxSpread={x:h.default.map(o.properties.boundingBoxRaw.x,t.properties.xposRaw,t.properties.xposRaw+t.properties.widthRaw,0,1),y:h.default.map(o.properties.boundingBoxRaw.y,t.properties.yposRaw,t.properties.yposRaw+t.properties.heightRaw,0,1),w:o.properties.boundingBoxRaw.w/t.properties.widthRaw})}else a.selectSticker(i);a.userEventStart()},stop:function(e){var i=e.target.id.split("se-component-")[1];null==i&&(i=n()(e.target).parent()[0].id.split("se-component-")[1]),a.isCalloutImage(i)?(a.calloutResized(i),a.calloutPropertyChanged()):a.stickerPropertyChanged(),a.userEventStop(),a.setAdaptiveBorderForTarget(n()(e.target))}}),this.currentSelectedSticker!=f.id&&this.currentSelectedCallout!=f.id&&n()(v).resizable({disabled:!0}),n()(v).find(".ui-resizable-handle").css("display",""),n()(v).find(".ui-resizable-handle").removeClass("ui-icon ui-icon-gripsmall-diagonal-se"),n()(v).click((function(e){var i=e.target.id.split("se-component-")[1];null==i&&(i=n()(e.target).parent()[0].id.split("se-component-")[1]),a.isCalloutImage(i)?a.selectCallout(i):a.selectSticker(i)})),n()(v).hover((function(){n()(".se-components-hover").removeClass("se-components-hover"),n()(this).addClass("se-components-hover")}),(function(){n()(this).removeClass("se-components-hover")})),n()(v).append(y),l.append(v),this.currentSelectedSticker!=f.id&&this.currentSelectedCallout!=f.id||this.setAdaptiveBorderForTarget(this.videoPlayerView.$el.find("#se-component-"+f.id)),a.mediaContainerResized(n()(v))}}this.initializeAtwho(),this.applyEffects({blurRegionChanged:t}),this.resizeHandler(),this.playerTimeUpdate()}},checkAndPopulateMf:function(e){if(this.isPersonalizationEnabled)for(var i,t=0,o=e.indexOf("${",0);-1!=o&&-1!=t;)-1!=(t=e.indexOf("}",o))&&(i=e.substring(o+2,t),this.mfValues.includes("{"+i+"}")||(this.mfValues.push("{"+i+"}"),this.$el.find("#seMfSelector").append(n()("<option>"+i+"</option>"))),o=e.indexOf("${",t))},applyEffects:function({blurRegionChanged:e}={}){var i,t=this.getClipOf(this.sessionDetails.primaryVideo),o=this;if(t){var s=t.effects||[],a=this.videoPlayerView.$el.find(".se-effects-components-container");a.empty();for(var r=0;r<s.length;r++){(i=s[r]).xposRaw=this.getValueFromClipPercent(i.xpos,t,!0),i.yposRaw=this.getValueFromClipPercent(i.ypos,t,!1),i.widthRaw=this.getValueFromClipPercent(i.width,t,!0),i.heightRaw=this.getValueFromClipPercent(i.height,t,!1);var l=document.createElement("div");l.id="se-effects-"+i.id,l.className="se-effects",l.style.left=i.xposRaw+"px",l.style.top=i.yposRaw+"px",l.style.width=i.widthRaw+"px",l.style.height=i.heightRaw+"px",n()(l).draggable({scroll:!1,opacity:.9,snap:".hippo-video-player, .se-crop-highlighter",snapMode:"both",snapTolerance:10,containment:o.primaryVideoContainer,start:function(e){o.selectBlur(e.target.id.split("se-effects-")[1]),o.userEventStart()},stop:function(e){o.blurAreaChanged(),o.userEventStop()}}).resizable({handles:"n, e, w, s, ne, nw, se, sw",aspectRatio:i.lockAspectRatio,containment:o.primaryVideoContainer,start:function(e){var i=e.target.id.split("se-effects-")[1];i||(i=n()(e.target).parent()[0].id.split("se-effects-")[1]),o.selectBlur(i),o.userEventStart()},stop:function(e){o.blurAreaChanged(),o.userEventStop(),o.setAdaptiveBorderForTarget(n()(e.target))}}).mousedown((function(e){o.selectBlur(e.target.id.split("se-effects-")[1]),e.stopPropagation()})),this.currentSelectedBlur!=i.id&&n()(l).resizable({disabled:!0}),n()(l).find(".ui-resizable-handle").css("display",""),n()(l).find(".ui-resizable-handle").removeClass("ui-icon ui-icon-gripsmall-diagonal-se"),a.append(l)}}this.drawBlurLayer({blurRegionChanged:e})},getValueForPlayer:function(e,i){var t=this.videoPlayerView.$el.width(),o=this.videoPlayerView.$el.height(),s=this.projectJson.canvasWidth,a=this.projectJson.canvasHeight;return i?h.default.roundNumber(e*(t/s),3):h.default.roundNumber(e*(o/a),3)},getValueForProject:function(e,i){var t=this.videoPlayerView.$el.width(),o=this.videoPlayerView.$el.height(),s=this.projectJson.canvasWidth,a=this.projectJson.canvasHeight;return i?h.default.roundNumber(e*(s/t),3):h.default.roundNumber(e*(a/o),3)},getBoundingBoxForProject:function(e){var i={x:this.getValueForProject(e.x,!0),y:this.getValueForProject(e.y,!1),w:this.getValueForProject(e.w,!0),h:this.getValueForProject(e.h,!1)};return null!=e.topPadding&&(i.topPadding=this.getValueForProject(e.topPadding,!1)),i},getValueForClip:function(e,i,t){var o=i.properties.widthRaw||i.properties.width,s=i.properties.heightRaw||i.properties.height;return t?h.default.roundNumber(h.default.map(e,0,o,0,1),5):h.default.roundNumber(h.default.map(e,0,s,0,1),5)},getValueFromClipPercent:function(e,i,t){var o=i.properties.widthRaw||i.properties.width,s=i.properties.heightRaw||i.properties.height;return t?h.default.roundNumber(e*o,5):h.default.roundNumber(e*s,5)},onBoardUser:function(){var e=this;this.unselectAllControls(),this.$el.find(".default-control-detail").show(),this.infoText.html("Resize and Move videos.."),this.secondaryVideoOverflowContainer.css("overflow","visible"),this.secondaryVideoContainer.find(".ui-resizable-handle").hide(),n().when(this.secondaryVideoContainer.find(".ui-resizable-handle").delay(200).fadeIn(300)).done((function(){n().when(e.secondaryVideoContainer.find(".ui-resizable-handle").fadeOut(300)).done((function(){e.secondaryVideoOverflowContainer.css("overflow","hidden"),e.primaryVideoOverflowContainer.css("overflow","visible"),e.primaryVideoContainer.find(".ui-resizable-handle").hide(),n().when(e.primaryVideoContainer.find(".ui-resizable-handle").delay(500).fadeIn(300)).done((function(){n().when(e.primaryVideoContainer.find(".ui-resizable-handle").fadeOut(300)).done((function(){e.secondaryVideoContainer.find(".ui-resizable-handle").css("display",""),e.primaryVideoContainer.find(".ui-resizable-handle").css("display",""),e.unselectClips(),e.onBoardControls()}))}))}))}))},onBoardControls:function(){var e=this;e.highlightControl(".trim-btn","Trim Video to change start and end points..",(function(){e.highlightControl(".crop-btn","Crop video..",(function(){e.highlightControl(".add-text-btn","Add text to video.",(function(){e.highlightControl(".add-callouts-btn","Add callouts to video",(function(){e.highlightControl(".add-stickers-btn","Add your favourite stickers",(function(){e.infoText.html("Lets go!!"),setTimeout((function(){e.infoText.html(" ")}),1500)}))}))}))}))}))},highlightControl:function(e,i,t){var o=this;o.infoText.delay(300).html(i),o.$el.find(e).animate({opacity:.5},200,(function(){o.$el.find(e).delay(700).animate({opacity:1},200,(function(){t&&t()}))}))},unselectAllControls:function(){this.$el.find(".se-control-detail").hide(),this.unselectCrop(),this.unselectClips(),this.videoPlayerView.$el.find(".components-marker-container").empty()},unselectAllComponents:function(){this.unselectText(),this.unselectSticker(),this.unselectCallout(),this.unselectBlur(),this.primaryVideoOverflowContainer.css("overflow","hidden"),this.secondaryVideoOverflowContainer.css("overflow","hidden")},selectTrim:function(e){null!=e&&(this.askReloadConfirmation=!0),this.isPPR?h.default.trackInThirdPartyTools("video_preview_Trim_save_isPPR",{email:this.userEmail}):h.default.trackInThirdPartyTools("video_preview_Trim_save",{email:this.userEmail}),this.unselectAllControls(),this.$el.find(".trim-slider").slider("values",[this.sessionDetails.trimSliderStart,1e3-this.sessionDetails.trimSliderEnd]),this.$el.find(".trim-control-detail").fadeIn(100),this.$el.find(".trim-preview-container, .preview-trim-arrow").hide(),this.updateTrimInput(),this.selectControl("trim-btn"),isFinite(this.videoPlayerView.mediaPlayer.duration)||this.$el.find(".trim-before-container, .trim-after-container").hide()},trimInputButtonClicked:function(e){var i=e.data.that,t=e.target,o=h.default.map(i.sessionDetails.trimSliderStart,0,1e3,0,i.videoPlayerView.mediaPlayer.duration),s=i.videoPlayerView.mediaPlayer.duration-h.default.map(i.sessionDetails.trimSliderEnd,0,1e3,0,i.videoPlayerView.mediaPlayer.duration);n().contains(i.$el.find(".trim-before-container")[0],t)?n()(t).hasClass("trim-input-btn-minus")?o=Math.max(o-1,0):n()(t).hasClass("trim-input-btn-plus")&&(o=Math.min(o+1,i.videoPlayerView.mediaPlayer.duration)):n().contains(i.$el.find(".trim-after-container")[0],t)&&(n()(t).hasClass("trim-input-btn-minus")?s=Math.max(s-1,0):n()(t).hasClass("trim-input-btn-plus")&&(s=Math.min(s+1,i.videoPlayerView.mediaPlayer.duration))),Math.floor(o)>=Math.floor(s)||(i.$el.find(".trim-before-input").val(h.default.strToTime(o)),i.$el.find(".trim-after-input").val(h.default.strToTime(s)),i.trimInputChanged())},trimInputTyped:function(e){var i=e.data.that,t=n()(e.target),o=h.default.map(i.sessionDetails.trimSliderStart,0,1e3,0,i.videoPlayerView.mediaPlayer.duration),s=i.videoPlayerView.mediaPlayer.duration-h.default.map(i.sessionDetails.trimSliderEnd,0,1e3,0,i.videoPlayerView.mediaPlayer.duration);if(38==e.keyCode||40==e.keyCode){if(e.preventDefault(),38==e.keyCode?t.hasClass("trim-before-input")?o=Math.min(o+1,i.videoPlayerView.mediaPlayer.duration):t.hasClass("trim-after-input")&&(s=Math.min(s+1,i.videoPlayerView.mediaPlayer.duration)):40==e.keyCode&&(t.hasClass("trim-before-input")?o=Math.max(o-1,0):t.hasClass("trim-after-input")&&(s=Math.max(s-1,0))),Math.floor(o)>=Math.floor(s))return;i.$el.find(".trim-before-input").val(h.default.strToTime(o)),i.$el.find(".trim-after-input").val(h.default.strToTime(s)),i.trimInputChanged()}else i=e.data.that,clearTimeout(i.trimInputTypedTimeout),i.trimInputTypedTimeout=setTimeout((function(){i.trimInputChanged()}),500)},trimInputChanged:function(){var e=h.default.timeToIntWithMillisecond(this.$el.find(".trim-before-input").val()),i=h.default.timeToIntWithMillisecond(this.$el.find(".trim-after-input").val()),t=h.default.map(e,0,this.videoPlayerView.mediaPlayer.duration,0,1e3),o=h.default.map(i,0,this.videoPlayerView.mediaPlayer.duration,0,1e3);parseInt(t)>=parseInt(o)||(this.$el.find(".trim-slider").slider("values",[t,o]),this.$el.find(".trim-control-detail input.sliderValue[data-index=0]").val(t),this.$el.find(".trim-control-detail input.sliderValue[data-index=1]").val(1e3-o)),this.trimChanged()},updateTrimInput:function(){var e=h.default.map(this.sessionDetails.trimSliderStart,0,1e3,0,this.videoPlayerView.mediaPlayer.duration),i=this.videoPlayerView.mediaPlayer.duration-h.default.map(this.sessionDetails.trimSliderEnd,0,1e3,0,this.videoPlayerView.mediaPlayer.duration);if(!isFinite(e)||!isFinite(i))return this.$el.find(".trim-before-time").html("-"),void this.$el.find(".trim-after-time").html("-");e=parseFloat(e).toFixed(3),i=parseFloat(i).toFixed(3),this.$el.find(".trim-before-time").html(h.default.strToTime(e)),this.$el.find(".trim-after-time").html(h.default.strToTime(i)),this.$el.find(".trim-before-input").val(h.default.strToTime(e)),this.$el.find(".trim-after-input").val(h.default.strToTime(i)),this.$el.find(".ruler-dynamic").is(":visible")||(this.drawDynamicRuler(),this.$el.find(".ruler-static").hide(),this.$el.find(".ruler-dynamic").show())},drawDynamicRuler:function(){for(var e=this.$el.find(".ruler-dynamic")[0].width,i=this.$el.find(".ruler-dynamic")[0].height,t=e/this.videoPlayerView.mediaPlayer.duration,o=t,s=2;o<15;s++)o=t*s;var a,r=this.$el.find(".ruler-dynamic")[0],n=r.getContext("2d");for(n.clearRect(0,0,r.width,r.height),n.lineWidth=1,s=0;s<e;s+=o){a=s,n.beginPath(),n.moveTo(s,0),n.lineTo(s,i/2);for(var l=0;l<4;l++)a+=o/5,n.moveTo(a,0),n.lineTo(a,i/3);n.stroke(),n.closePath()}},showTrimBeforePop:function(e){e.data.that.$el.find(".trim-before-pop").fadeIn(100)},showTrimAfterPop:function(e){e.data.that.$el.find(".trim-after-pop").fadeIn(100)},trimSliding:function(e){if(this.$el.find(".trim-preview-video")[0].src.length<=0&&(this.$el.find(".trim-preview-video")[0].src=this.videoPlayerView.mediaPlayer.currentSrc),e.handle==this.$el.find(".trim-slider .ui-slider-handle")[0]){this.$el.find(".trim-before-container").addClass("trim-hovered");var i=h.default.map(this.sessionDetails.trimSliderStart,0,1e3,0,this.videoPlayerView.mediaPlayer.duration);this.$el.find(".trim-preview-video")[0].currentTime=i,this.$el.find(".trim-preview-container").css("left",n()(this.$el.find(".trim-slider .ui-slider-handle")[0]).position().left-n()(".trim-preview-container").width()/2+"px"),this.$el.find(".preview-trim-arrow").css("left",n()(this.$el.find(".trim-slider .ui-slider-handle")[0]).position().left)}else{this.$el.find(".trim-after-container").addClass("trim-hovered");var t=h.default.map(this.sessionDetails.trimSliderEnd,0,1e3,0,this.videoPlayerView.mediaPlayer.duration);this.$el.find(".trim-preview-video")[0].currentTime=this.videoPlayerView.mediaPlayer.duration-t,this.$el.find(".trim-preview-container").css("left",n()(this.$el.find(".trim-slider .ui-slider-handle")[1]).position().left-+n()(".trim-preview-container").width()/2+"px"),this.$el.find(".preview-trim-arrow").css("left",n()(this.$el.find(".trim-slider .ui-slider-handle")[1]).position().left)}this.$el.find(".trim-preview-container, .preview-trim-arrow").show(),clearTimeout(this.trimFadeoutTimeout);var o=this;this.trimFadeoutTimeout=setTimeout((function(){o.$el.find(".trim-preview-container, .preview-trim-arrow").fadeOut(200)}),2e3)},trimChanged:function(){this.trimLeadGenerated=!0,this.sessionDetails.trimSliderStart=this.$el.find(".trim-control-detail input.sliderValue[data-index=0]").val(),this.sessionDetails.trimSliderEnd=this.$el.find(".trim-control-detail input.sliderValue[data-index=1]").val(),this.updateTrimInput(),this.updateProjectJson(),this.reconstructUI()},disableTrim:function(){n()(".trim-btn").addClass("disabled")},selectCrop:function(){this.askReloadConfirmation=!0,this.isPPR?h.default.trackInThirdPartyTools("video_preview_Crop_save_isPPR",{email:this.userEmail}):h.default.trackInThirdPartyTools("video_preview_Crop_save",{email:this.userEmail}),this.unselectAllControls(),this.unselectAllComponents(),this.$el.find(".crop-control-detail").fadeIn(100),this.cropResizable.resizable("enable"),this.cropResizable.removeClass("disp-none").addClass("disp-show"),this.selectControl("crop-btn")},cropResized:function(e,i){var t=this.cropResizable.is(":visible");if(this.cropResizable.removeClass("disp-none").addClass("disp-show"),this.videoPlayerView.$el.find(".se-crop-highlighter").show(),this.videoPlayerView.$el.find(".se-crop-highlighter-right").css("left",this.cropResizable.position().left+this.cropResizable.width()+"px"),this.videoPlayerView.$el.find(".se-crop-highlighter-left").css("right",this.videoPlayerView.$el.width()-this.cropResizable.position().left+"px"),this.videoPlayerView.$el.find(".se-crop-highlighter-bottom").css({top:this.cropResizable.position().top+this.cropResizable.height()+"px",width:this.cropResizable.width()+2+"px",left:this.cropResizable.position().left-1+"px"}),this.videoPlayerView.$el.find(".se-crop-highlighter-top").css({bottom:this.videoPlayerView.$el.height()-this.cropResizable.position().top+"px",width:this.cropResizable.width()+2+"px",left:this.cropResizable.position().left-1+"px"}),null!=this.projectJson&&(null==i&&n()(".reposition-webcam").is(":checked")||1==i)){var o=this.webcamSnappedLayoutOnCrop();this.secondaryVideoContainer.css({left:o.x+"px",top:o.y+"px"})}null!=this.projectJson&&e&&this.updateProjectJson(),0==t&&this.cropResizable.removeClass("disp-show").addClass("disp-none")},cropStopped:function(){this.cropResizable.position().left<0&&this.cropResizable.css("left","0"),this.cropResizable.position().top<0&&this.cropResizable.css("top","0"),this.cropResizable.position().left+this.cropResizable.width()>this.videoPlayerView.$el.width()&&this.cropResizable.css("width",this.videoPlayerView.$el.width()-this.cropResizable.position().left+"px"),this.cropResizable.position().top+this.cropResizable.height()>this.videoPlayerView.$el.height()&&this.cropResizable.css("height",this.videoPlayerView.$el.height()-this.cropResizable.position().top+"px"),this.cropResized(!0)},applyCrop:function(){this.unselectCrop(),this.$el.find(".default-control-detail").show()},resetCrop:function(){this.cropResizable.css({left:"0",top:"0",width:"100%",height:"100%"}),this.cropResizable.removeClass("disp-none").addClass("disp-show"),this.cropResized(!0),this.unselectCrop(),this.$el.find(".default-control-detail").show()},cancelCrop:function(){this.cropResizable.css({left:this.snapshot.crop.x+"px",top:this.snapshot.crop.y+"px",width:this.snapshot.crop.w+"px",height:this.snapshot.crop.h+"px"}),this.cropResizable.removeClass("disp-none").addClass("disp-show"),this.cropResized(!0,!1),this.unselectCrop(),this.$el.find(".default-control-detail").show()},unselectCrop:function(){this.cropResizable.resizable({disabled:!0}),this.cropResizable.removeClass("disp-show").addClass("disp-none"),this.$el.find(".crop-control-detail").hide()},disableCrop:function(){n()(".crop-btn").addClass("disabled")},handleMfChange:function(e){var i=e.data.that,t=i.$el.find("#seMfSelector").find(":selected").val();if("Merge Fields"!==t){if(i.mfValues.includes("{"+t+"}")){if(i.currentSelectedText){var o=i.getClipOf(i.currentSelectedText);o?(o.properties.textUnwrapped!=this.defaultTextAreaValue?o.properties.textUnwrapped+=" ${"+t+"} ":o.properties.textUnwrapped=" ${"+t+"} ",i.showTextEditable(o.id)):i.addEnteredText("${"+t+"} ")}else i.addEnteredText("${"+t+"} ");i.$el.find("#seMfSelector").val("Merge Fields").trigger("change")}else i.mfValues.push("{"+t+"}"),i.$el.find("#seMfSelector").append(n()("<option selected>"+t+"</option>")).trigger("change"),n()("#select2-seMfSelector-results").find(".select2-results__option--highlighted").remove(),i.initializeAtwho();h.default.trackInThirdPartyTools(y().PERSONALIZATION_ACTIONS.PA122,{assetId:this.assetId,email:this.userEmail})}},initializeAtwho:function(){this.isPersonalizationEnabled&&n()("#seTextEditable").atwho({at:"$",data:this.mfValues,limit:this.mfValues.length})},selectAddText:function(){this.askReloadConfirmation=!0,h.default.trackInThirdPartyTools("video_preview_Text_save",{email:this.userEmail}),this.unselectAllControls(),this.$el.find(".addtext-control-detail").fadeIn(100),this.showMarkers("text"),this.selectControl("add-text-btn"),this.isTextClipExist()||this.$el.find(".addtext-control-detail").find("#addTextLink").click()},isTextClipExist:function(){if(this.projectJson&&this.projectJson.clips)for(var e=0;e<this.projectJson.clips.length;e++)if("text"==this.projectJson.clips[e].footage.type)return!0;return!1},addEnteredText:function(e){n()(".addimage-control-detail").css("margin","0px"),(!e||e instanceof n().Event)&&(e=this.defaultTextAreaValue);var i=this.getMaxDuration(),t=this.sessionDetails.totalCreatedClips;this.projectJson.trackNames.push("Text - "+e.substring(0,10));var o={containsAudio:!1,containsVideo:!1,containsText:!0,duration:i,type:"text"},s=this.$el.find(".se-font-selector").val(),a=this.$el.find(".se-fontsize-selector").val();null==a&&(a=40);var r=this.$el.find(".se-bold-toggle").is(":checked"),l=this.$el.find(".se-italic-toggle").is(":checked"),d=this;this.getFont(s,r,l,(function(r){var n=d.getMetrics(e,a,r),l={w:n.actualWidth+Math.min(100,Math.max(20,n.actualWidth/10)),h:n.fontHeight+Math.min(100,Math.max(20,n.fontHeight/10))};l.x=d.videoPlayerView.$el.find(".se-crop-highlighter-left").width(),l.x+=(d.videoPlayerView.$el.find(".se-crop-highlighter-right").position().left-d.videoPlayerView.$el.find(".se-crop-highlighter-left").width()-l.w)/2,l.y=d.videoPlayerView.$el.find(".se-crop-highlighter-top").height(),l.y+=(d.videoPlayerView.$el.find(".se-crop-highlighter-bottom").position().top-d.videoPlayerView.$el.find(".se-crop-highlighter-top").height()-l.h)/2;var c={color:"#000000",font:s,fontSize:a,fontSizeProject:d.getValueForProject(a,!0),fadein:0,fadeout:0,opacity:1,text:e,textUnwrapped:e,textAlign:"center",xposRaw:l.x,yposRaw:l.y,xpos:d.getValueForProject(l.x,!0),ypos:d.getValueForProject(l.y,!1),boundingBoxRaw:l,boundingBox:d.getBoundingBoxForProject(l)},h=Math.max(d.videoPlayerView.getCurrentTime(),.001);d.getLuminanceForClip(c.boundingBoxRaw.x,c.boundingBoxRaw.y,c.boundingBoxRaw.w,c.boundingBoxRaw.h)<128&&(c.color="#FFFFFF");var p={deleted:!1,end:3,footage:o,id:t,position:Math.max(h-d.videoPlayerView.trimStart,.001),properties:c,start:0,track:d.projectJson.totalVideoTracks+1,startFrom:h,endAt:Math.min(d.videoPlayerView.getCurrentTime()+3,i)};d.projectJson.totalVideoTracks++,d.projectJson.clips.push(p),d.sessionDetails.addedClips.push(p.id),d.reconstructUI(),d.currentSelectedText=t,d.videoPlayerView.$el.find(".se-text-editable").val(p.properties.text),d.selectText(t),d.sessionDetails.totalCreatedClips++,d.$el.find(".addtext-control-detail .se-color-choose").spectrum("set",d.brand_font_color||p.properties.color),d.$el.find(".addtext-control-detail .color-picker .sp-replacer .text-color-picker").css("color",p.properties.color),d.textPropertyChanged(!0),d.videoPlayerView.$el.find("#se-component-"+t).click()})),h.default.trackInThirdPartyTools("Add text clicked")},getLuminanceForClip:function(e,i,t,o){if(null==e||null==i||null==t||null==o)return null;var s=this.videoPlayerView.$el.find(".primary-video")[0],a=document.createElement("canvas"),r=this.videoPlayerView.$el.width(),n=this.videoPlayerView.$el.height();a.width=r,a.height=n;var l=a.getContext("2d");l.clearRect(0,0,r,n),l.rect(0,0,r,n),l.globalAlpha=1,l.drawImage(s,0,0,r,n);for(var d=l.getImageData(e,i,t,o),c=d.data.length/4,h=0,p=0,u=0,m=0;m<c;m++)h+=d.data[4*m+0],p+=d.data[4*m+1],u+=d.data[4*m+2];return.2126*(h/=c)+.7152*(p/=c)+u/c*.0722},selectText:function(e,i){if(this.enabled){this.currentSelectedText==e||this.fromQuickRecord||(this.unselectAllControls(),this.unselectAllComponents()),this.$el.find("#textPropertiesTab").show(),this.currentSelectedText=e,this.currentSelectedClip=this.getClipOf(e),this.$el.find(".addtext-control-detail").show();var t=this.getClipOf(e);this.videoPlayerView.$el.find(".se-text-editable").val(t.properties.textUnwrapped?t.properties.textUnwrapped:t.properties.text),this.videoPlayerView.$el.find(".se-text-editable").css({"font-family":null!=h.default.getFontMap()[t.properties.font]?h.default.getFontMap()[t.properties.font].css:"","font-size":t.properties.fontSize+"px","font-style":t.properties.italic?"italic":"normal","font-weight":t.properties.bold?"bold":"normal",color:t.properties.color}),this.$el.find(".addtext-input-text").val(t.properties.text),this.$el.find(".se-font-selector").val(this.getFontIfAvailable(t.properties.font)).trigger("change.select2"),this.$el.find(".se-fontsize-selector").val(t.properties.fontSize).trigger("change.select2"),this.$el.find(".se-bold-toggle").prop("checked",t.properties.bold),this.$el.find(".se-italic-toggle").prop("checked",t.properties.italic),this.$el.find(".addtext-control-detail .se-color-choose").spectrum("set",t.properties.color||this.brand_font_color),this.$el.find(".addtext-control-detail .se-shadow-toggle").spectrum("set",t.properties.shadow),this.$el.find(".addtext-control-detail .color-picker .sp-replacer .text-color-picker").css("color",t.properties.color),this.$el.find(".se-textalign-selector").val(t.properties.textAlign?t.properties.textAlign:"left").trigger("change.select2"),this.videoPlayerView.$el.find("#se-component-"+this.currentSelectedText).addClass("se-text-component-selected"),this.setAdaptiveBorderForTarget(this.videoPlayerView.$el.find("#se-component-"+this.currentSelectedText)),n()(".se-components-hover").removeClass("se-components-hover"),this.setTextDraggableContainerSize(this.videoPlayerView.$el.find("#se-component-"+this.currentSelectedText)[0],t,!0),i||this.showClipTime(t),this.selectControl("add-text-btn"),this.showMarkers("text")}},getFontIfAvailable:function(e){if(null==e)return this.defaultFontValue;for(var i in h.default.getFontMap())if(i==e)return e;return this.defaultFontValue},setAdaptiveBorderForTarget:function(e){0!=e.length&&(this.getLuminanceForClip(e.position().left,e.position().top,e.width(),e.height())<128?n()(e).addClass("white"):n()(e).addClass("black"))},unselectText:function(e){if(null!=this.currentSelectedText){this.$el.find("#textPropertiesTab").hide(),e=void 0===e?"callouttext"==this.getClipOf(this.currentSelectedText).footage.type:e,this.closeTextEditable();var i=this.videoPlayerView.$el.find("#se-component-"+this.currentSelectedText);this.currentSelectedText=void 0,this.videoPlayerView.$el.find(".se-text-editable").val(""),this.videoPlayerView.$el.find(".se-text-editable").hide(),i&&n()(i).removeClass("se-text-component-selected black white").resizable("destroy"),this.$el.find(".se-text-component").show(),e?this.showMarkers("calloutimage"):this.showMarkers("text"),this.videoPlayerView.$el.find(".se-clip-time").hide()}},textEditableChanged:function(e){var i=this.getClipOf(this.currentSelectedText);i.properties.textUnwrapped=this.videoPlayerView.$el.find(".se-text-editable").val().trim(),i.properties.textUnwrapped.trim().length||(i.properties.text=""),this.newlineTextToHtml(this.videoPlayerView.$el.find("#se-component-"+this.currentSelectedText+" .se-text-container")[0],i),e&&13==e.keyCode&&!e.shiftKey&&(this.closeTextEditable(),this.unselectText())},addTextChanged:function(e){var i=e.data.that;13==e.keyCode&&i.addEnteredText()},textPropertyChanged:function(e){if(this.currentSelectedText){var i=this.getClipOf(this.currentSelectedText);i&&(i.properties.text=this.getTextFromTextEl(this.videoPlayerView.$el.find("#se-component-"+this.currentSelectedText)).trim(),i.properties.font=this.$el.find(".se-font-selector").val(),i.properties.fontSize=this.$el.find(".se-fontsize-selector").val(),(null==i.properties.fontSizeProject||e&&e.target&&n()(e.target).hasClass("se-fontsize-selector"))&&(i.properties.fontSizeProject=this.getValueForProject(i.properties.fontSize,!0)),i.properties.bold=this.$el.find(".se-bold-toggle").is(":checked"),i.properties.italic=this.$el.find(".se-italic-toggle").is(":checked"),e&&(i.properties.color=this.$el.find(".addtext-control-detail .se-color-choose").spectrum("get").toHexString()),this.$el.find(".addtext-control-detail .color-picker .sp-replacer .text-color-picker").css("color",i.properties.color),i.properties.textAlign=this.$el.find(".se-textalign-selector").val(),i.properties.xposRaw=this.videoPlayerView.$el.find("#se-component-"+this.currentSelectedText).position().left,i.properties.yposRaw=this.videoPlayerView.$el.find("#se-component-"+this.currentSelectedText).position().top,i.properties.xpos=this.getValueForProject(i.properties.xposRaw,!0),i.properties.ypos=this.getValueForProject(i.properties.yposRaw,!1),i.footage.calloutId&&(i.properties.offsetX=this.videoPlayerView.$el.find("#se-component-"+this.currentSelectedText).position().left-this.videoPlayerView.$el.find("#se-component-"+i.footage.calloutId).position().left,i.properties.offsetY=this.videoPlayerView.$el.find("#se-component-"+this.currentSelectedText).position().top-this.videoPlayerView.$el.find("#se-component-"+i.footage.calloutId).position().top),this.updateProjectJson(),this.reconstructUI())}},showTextEditable:function(e){var i=this.getClipOf(e),t=this.getClipElOf(e);this.videoPlayerView.$el.find(".se-text-editable").css({left:t.position().left+"px",top:t.position().top+"px",width:t.width()+"px",height:t.height()+"px","text-align":i.properties.textAlign}),t.fadeOut();var o=this,s=i.properties.textUnwrapped?i.properties.textUnwrapped:i.properties.text;s=s==this.defaultTextAreaValue?"":s,this.videoPlayerView.$el.find(".se-text-editable").val(s),this.videoPlayerView.$el.find(".se-text-editable").fadeIn(150,(function(){o.videoPlayerView.$el.find(".se-text-editable").focus()}))},closeTextEditable:function(){var e=this.getClipOf(this.currentSelectedText);e&&this.setLineHeight(e),this.videoPlayerView.$el.find(".se-text-editable").hide(),this.videoPlayerView.$el.find(".se-text-component").show(),e&&!e.properties.text.trim().length&&this.videoPlayerView.$el.find("#se-component-"+this.currentSelectedText).find(".se-text-delete").click()},deleteText:function(){var e="callouttext"==this.getClipOf(this.currentSelectedText).footage.type;this.removeClip(this.currentSelectedText),this.unselectText(e),this.reconstructUI()},selectAddStickers:function(){this.askReloadConfirmation=!0,this.isPPR?h.default.trackInThirdPartyTools("video_preview_Emoji_save_isPPR",{email:this.userEmail}):h.default.trackInThirdPartyTools("video_preview_Emoji_save",{email:this.userEmail}),this.unselectAllControls(),this.$el.find(".addsticker-selected").hide(),this.$el.find(".addsticker-initial").show(),this.$el.find(".addsticker-control-detail").fadeIn(100),this.showMarkers("sticker"),this.selectControl("add-stickers-btn")},selectAddImage:function(){this.askReloadConfirmation=!0,this.unselectAllControls(),this.$el.find(".addimage-selected").hide(),this.$el.find(".addimage-initial").show(),this.$el.find(".addimage-control-detail").fadeIn(100),this.selectControl("add-image-btn"),this.isPPR?h.default.trackInThirdPartyTools("video_preview_Image_save_isPPR",{email:this.userEmail}):h.default.trackInThirdPartyTools(y().PERSONALIZATION_ACTIONS.PA41,{email:this.userEmail})},hanldeImageAspectRatioChange:function(){this.stickerPropertyChanged(),h.default.trackInThirdPartyTools(y().PERSONALIZATION_ACTIONS.PA413,{email:this.userEmail})},deleteImage:function(){this.deleteSticker(),h.default.trackInThirdPartyTools(y().PERSONALIZATION_ACTIONS.PA415,{email:this.userEmail})},changeImageOpacity:function(e){this.$el.find("#imageOpacitySlider").val(""===n()(e.currentTarget).val()?0:n()(e.currentTarget).val()),this.$el.find("#imageOpacityInput").val(""===n()(e.currentTarget).val()?"":parseInt(n()(e.currentTarget).val())>100?100:n()(e.currentTarget).val()),this.stickerPropertyChanged(),h.default.trackInThirdPartyTools(y().PERSONALIZATION_ACTIONS.PA414,{email:this.userEmail})},addImage:function(){this.openImportCallback(),new be({type:"image",maximumFilesAllowed:1,maximumPerFileSize:5,isMultiple:!1,showAddMoreTemplate:!1,callbackMethodToHandleFiles:this.processSelectedImage,closeImportCallback:this.closeImportCallback}),h.default.trackInThirdPartyTools(y().PERSONALIZATION_ACTIONS.PA411,{email:this.userEmail})},addPersonalizedImage:function(){var e={component_type:"image-mf"},i=f.getNewImageMfId(this.projectJson,"image");e.id=i.footageId,e.image_id=i.imageId,e.is_website=!1,e.url=f.getMfImage(e.image_id,"image"),e.addToFootageList=!1,this.createNewImage(e),h.default.trackInThirdPartyTools(y().PERSONALIZATION_ACTIONS.PA412,{email:this.userEmail})},addWebsiteImageBtn:function(){var e={component_type:"image-mf"},i=f.getNewImageMfId(this.projectJson,"website");e.id=i.footageId,e.image_id=i.imageId,e.is_website=!0,e.url=f.getMfImage(e.image_id,"website"),e.addToFootageList=!1,this.createNewImage(e),h.default.trackInThirdPartyTools(y().PERSONALIZATION_ACTIONS.PA416,{email:this.userEmail})},processSelectedImage:function(e,i){var t=e[0],o=f.getImportedImageInfo(t),s=[o],a=this;this.$el.find("#imageUploadProgessContainer").show(),this.$el.find("#imageUploadProgressText").text(x.Z.t.simpleEdit.prepareToImport),(new(w())).importAssetForSlideShow(JSON.stringify(s),this.assetId,void 0,(function(e){var i=e.video[0];"local_file"==o.upload_type?new(O())({acl:"private",bucket:i.bucket,key:i.key}).uploadFile(t,void 0,(function(e){a.$el.find("#imageUploadProgessContainer").hide(),a.closeImportCallback(),i.component_type="image",i.addToFootageList=!0,a.createNewImage(i)}),(function(e){p.default.showBannerAlert(x.Z.t.simpleEdit.errorMessage,3e3,"error"),p.default.postErrorsToLog({error:"Error while uploading media to S3 for user.",stackTrace:JSON.stringify(e)}),a.$el.find("#imageUploadProgessContainer").hide(),a.closeImportCallback()})):(a.$el.find("#imageUploadProgessContainer").hide(),a.closeImportCallback(),i.component_type="image",i.addToFootageList=!0,a.createNewImage(i))}),(function(e){p.default.showBannerAlert(x.Z.t.simpleEdit.errorMessage,3e3,"error"),p.default.postErrorsToLog({error:"Error while importing slideshow for user.",stackTrace:JSON.stringify(e)}),a.$el.find("#imageUploadProgessContainer").hide(),a.closeImportCallback()}))},createNewImage:function(e){var i=this.sessionDetails.totalCreatedClips,t=this.getMaxDuration();this.projectJson.trackNames.push("Image");var o={containsAudio:!1,containsVideo:!1,containsText:!1,containsImage:!0,id:e.id.toString(),duration:t,type:e.component_type};"image-mf"===e.component_type&&(o.is_website=e.is_website,o.image_id=e.image_id);var s=this.videoPlayerView.$el.find(".se-crop-highlighter-left").width();s+=(this.videoPlayerView.$el.find(".se-crop-highlighter-right").position().left-this.videoPlayerView.$el.find(".se-crop-highlighter-left").width())/2;var a=this.videoPlayerView.$el.find(".se-crop-highlighter-top").height();a+=(this.videoPlayerView.$el.find(".se-crop-highlighter-bottom").position().top-this.videoPlayerView.$el.find(".se-crop-highlighter-top").height())/2;var r=new Image;r.crossOrigin="Anonymous",r.src=e.url;var n=this;r.onload=function(){var l,d=r.width,c=r.height;r.width>n.videoPlayerView.$el.width()?(l=n.videoPlayerView.$el.width()/r.width,d=n.videoPlayerView.$el.width()/3,c=l*r.height/3):r.height>n.videoPlayerView.$el.height()?(l=n.videoPlayerView.$el.height()/r.height,c=n.videoPlayerView.$el.height()/3,d=l*r.width/3):(d=r.width/3,c=r.height/3);var h={fadein:0,fadeout:0,heightRaw:c,widthRaw:d,height:n.getValueForProject(c,!1),width:n.getValueForProject(d,!0),xposRaw:s,yposRaw:a,xpos:n.getValueForProject(s,!0),ypos:n.getValueForProject(a,!1),opacity:1,lockAspectRatio:!0,containsAlpha:!0},p=Math.max(n.videoPlayerView.getCurrentTime(),.001),u={deleted:!1,end:3,footage:o,id:i,position:Math.max(p-n.videoPlayerView.trimStart,.001),properties:h,start:0,track:n.projectJson.totalVideoTracks+1,startFrom:p,endAt:Math.min(n.videoPlayerView.getCurrentTime()+3,t)};n.projectJson.totalVideoTracks++,n.projectJson.clips.push(u),e.addToFootageList&&n.projectJson.footageList.push(e.id),o.src=e.url,n.sessionDetails.addedClips.push(u.id),n.reconstructUI(),n.selectSticker(i),n.sessionDetails.totalCreatedClips++}},isImageComponent:function(e){return"image"==this.getClipOf(e).footage.type||"image-mf"==this.getClipOf(e).footage.type},componentDropped:function(e,i,t){-1!==e.indexOf("se-sticker-btn-")?this.addNewSticker(e.split("se-sticker-btn-")[1],i,t):-1!==e.indexOf("se-callout-btn-")&&this.addNewCallout(e.split("se-callout-btn-")[1],i,t)},stickerBtnClicked:function(e){e.data.that.addNewSticker(e.target.id.split("se-sticker-btn-")[1])},addNewSticker:function(e,i,t){var o=this.sessionDetails.totalCreatedClips,s=this.getMaxDuration();this.projectJson.trackNames.push("Sticker");var a={containsAudio:!1,containsVideo:!1,containsText:!1,containsImage:!0,id:-e-100,duration:s,type:"sticker"};null!=i&&null!=t||(i=this.videoPlayerView.$el.find(".se-crop-highlighter-left").width(),i+=(this.videoPlayerView.$el.find(".se-crop-highlighter-right").position().left-this.videoPlayerView.$el.find(".se-crop-highlighter-left").width())/2,t=this.videoPlayerView.$el.find(".se-crop-highlighter-top").height(),t+=(this.videoPlayerView.$el.find(".se-crop-highlighter-bottom").position().top-this.videoPlayerView.$el.find(".se-crop-highlighter-top").height())/2);var r={fadein:0,fadeout:0,heightRaw:this.stickerSize[e].height/1.5,widthRaw:this.stickerSize[e].width/1.5,height:this.getValueForProject(this.stickerSize[e].height/1.5,!1),width:this.getValueForProject(this.stickerSize[e].width/1.5,!0),xposRaw:i,yposRaw:t,xpos:this.getValueForProject(i,!0),ypos:this.getValueForProject(t,!1),opacity:1,lockAspectRatio:!0},n=Math.max(this.videoPlayerView.getCurrentTime(),.001),l={deleted:!1,end:3,footage:a,id:o,position:Math.max(n-this.videoPlayerView.trimStart,.001),properties:r,start:0,track:this.projectJson.totalVideoTracks+1,startFrom:n,endAt:Math.min(this.videoPlayerView.getCurrentTime()+3,s)};this.projectJson.totalVideoTracks++,this.projectJson.clips.push(l),this.sessionDetails.addedClips.push(l.id),this.reconstructUI(),this.selectSticker(o),this.sessionDetails.totalCreatedClips++},selectSticker:function(e){if(this.enabled){this.unselectAllControls(),this.unselectAllComponents(),this.currentSelectedSticker=e,this.currentSelectedClip=this.getClipOf(e);var i=this.getClipOf(this.currentSelectedSticker);this.isImageComponent(i.id)?(this.$el.find(".addimage-selected #imageOpacitySlider").val(100*i.properties.opacity),this.$el.find(".addimage-selected #imageOpacityInput").val(parseInt(100*i.properties.opacity)),this.$el.find(".addimage-selected #imageArLock").prop("checked",i.properties.lockAspectRatio),this.$el.find(".addimage-control-detail").show(),this.$el.find(".addimage-initial").hide(),this.$el.find(".addimage-selected").show()):(this.$el.find(".addsticker-selected .opacity-val").val(100*i.properties.opacity),this.$el.find(".addsticker-selected .lock-aspect-ratio").prop("checked",i.properties.lockAspectRatio),this.$el.find(".addsticker-control-detail").show(),this.$el.find(".addsticker-initial").hide(),this.$el.find(".addsticker-selected").show());var t=this.videoPlayerView.$el.find("#se-component-"+e);t.resizable("enable"),t.addClass("edit-video-selected"),this.setAdaptiveBorderForTarget(this.videoPlayerView.$el.find("#se-component-"+e)),this.isImageComponent(i.id)?(this.showMarkers("image"),this.selectControl("add-image-btn")):(this.showMarkers("sticker"),this.selectControl("add-stickers-btn")),this.showClipTime(i)}},unselectSticker:function(){null!=this.currentSelectedSticker&&(this.isImageComponent(this.currentSelectedSticker)?(this.currentSelectedSticker=void 0,this.$el.find(".addimage-initial").show(),this.$el.find(".addimage-selected").hide(),this.showMarkers("image")):(this.currentSelectedSticker=void 0,this.$el.find(".addsticker-initial").show(),this.$el.find(".addsticker-selected").hide(),this.showMarkers("sticker")),n()(".se-image-component").resizable({disabled:!0}),n()(".se-image-component").removeClass("edit-video-selected white black"),this.videoPlayerView.$el.find(".se-clip-time").hide())},stickerPropertyChanged:function(){var e=this.getClipOf(this.currentSelectedSticker);this.isImageComponent(this.currentSelectedSticker)?(e.properties.opacity=this.$el.find(".addimage-selected #imageOpacitySlider").val()/100,e.properties.lockAspectRatio=this.$el.find(".addimage-selected #imageArLock").is(":checked")):(e.properties.opacity=this.$el.find(".addsticker-selected .opacity-val").val()/100,e.properties.lockAspectRatio=this.$el.find(".addsticker-selected .lock-aspect-ratio").is(":checked")),this.updateProjectJson(),this.reconstructUI()},deleteSticker:function(){var e=this.currentSelectedSticker;this.unselectSticker(),this.removeClip(e),this.reconstructUI()},findStickerSize:function(e){this.stickerSize[e]={width:128,height:128}},showStickerFamily:function(e){e.data.that.$el.find(".sticker-family-all").hide(),n()(e.target).closest(".sticker-family-container").find(".sticker-family-all").show()},selectAddBlur:function(){"true"===n()("#isBlurEnabled").val()||this.isBlurEnabled?(this.askReloadConfirmation=!0,this.isPPR?h.default.trackInThirdPartyTools("video_preview_Blur_save_isPPR",{email:this.userEmail}):h.default.trackInThirdPartyTools("video_preview_Blur_save",{email:this.userEmail}),this.unselectAllControls(),this.$el.find("#blurSelected").hide(),this.$el.find("#blurInitial").show(),this.$el.find(".blur-control-detail").fadeIn(100),this.showMarkers("effects"),this.selectControl("add-blur-btn"),n()(".new").hide()):(h.default._upgradeAlertPopup(x.Z.t,V()),n()(".new").hide())},addNewBlur:function(e,i){if(void 0!==this.sessionDetails.primaryVideo||void 0!==this.sessionDetails.secondaryVideo){var t=this.getMaxDuration(),o=this.videoPlayerView.$el.find(".se-effects-canvas").width(),s=this.videoPlayerView.$el.find(".se-effects-canvas").height(),a=this.getClipOf(this.sessionDetails.primaryVideo)||{},r=Math.max(this.videoPlayerView.getCurrentTime(),.001);null==this.sessionDetails.totalAddedEffects&&(this.sessionDetails.totalAddedEffects=0);var n=this.sessionDetails.totalAddedEffects++,l=this.getValueFromClipPercent(.3,a,!0,!0),d=this.getValueFromClipPercent(.3,a,!1,!0),c={id:n,type:"blur",opacity:1,strength:10,widthRaw:l,heightRaw:d,xposRaw:e=this.getValueFromClipPercent(.5,a,!0,!0),yposRaw:i=this.getValueFromClipPercent(.5,a,!1,!0),lockAspectRatio:!1,start:0,end:3,width:.3,height:.3,xpos:.5,ypos:.5,initialWidth:o/l,initialHeight:s/d,initialXpos:0!==e?o/e:o/.01,initialYpos:0!==i?s/i:s/.01,startFrom:r,endAt:Math.min(this.videoPlayerView.getCurrentTime()+3,t),position:Math.max(r-this.videoPlayerView.trimStart,.001)};a.effects?a.effects.push(c):a.effects=[c],this.reconstructUI(void 0,void 0,{blurRegionChanged:!0}),this.selectBlur(n),h.default.trackInThirdPartyTools("SE - Add New Blur",{email:this.userEmail})}},enableBlurForPlayer:function(){var e=this;this.$el.find("#blurStrength").slider({min:0,max:100,step:1,value:50,slide:e.blurPropertyChanged}),this.$el.find("#blurStrengthText").bind("change",(function(){e.blurPropertyChanged({},{},!0)}))},blurPropertyChanged:function(e,i,t){var o=this.getClipOf(this.sessionDetails.primaryVideo)||{},s=l.default.filter(o.effects,{id:Number(this.currentSelectedBlur)})[0]||{};if(t){var a=this.$el.find("#blurStrengthText").val();this.$el.find("#blurStrength").slider("option","value",a)}else a=this.$el.find("#blurStrength").slider("option","value"),this.$el.find("#blurStrengthText").val(a);s.strength=h.default.map(a,0,100,0,20),s.lockAspectRatio=this.$el.find(".blur-selected .lock-aspect-ratio").is(":checked"),this.updateProjectJson(),this.reconstructUI(void 0,void 0,{blurRegionChanged:!0})},blurAreaChanged:function(){var e=this.getClipOf(this.sessionDetails.primaryVideo)||{},i=l.default.filter(e.effects,{id:Number(this.currentSelectedBlur)})[0]||{},t=n()("#se-effects-"+i.id),o=this.videoPlayerView.$el.find(".se-effects-canvas").width(),s=this.videoPlayerView.$el.find(".se-effects-canvas").height();i.xpos=this.getValueForClip(t.position().left,e,!0),i.ypos=this.getValueForClip(t.position().top,e,!1),i.width=this.getValueForClip(t.width(),e,!0),i.height=this.getValueForClip(t.height(),e,!1),i.widthRaw=this.getValueFromClipPercent(i.width,e,!0,!0),i.heightRaw=this.getValueFromClipPercent(i.height,e,!1,!0),i.xposRaw=this.getValueFromClipPercent(i.xpos,e,!0,!0),i.yposRaw=this.getValueFromClipPercent(i.ypos,e,!1,!0),i.initialWidth=o/i.widthRaw,i.initialHeight=s/i.heightRaw,i.initialXpos=0!==i.xposRaw?o/i.xposRaw:o/.01,i.initialYpos=0!==i.yposRaw?s/i.yposRaw:s/.01,this.reconstructUI(void 0,void 0,{blurRegionChanged:!0})},selectBlur:function(e){if(this.enabled){var i=this.getClipOf(this.sessionDetails.primaryVideo)||{},t=l.default.filter(i.effects,{id:Number(e)})[0]||{},o=Math.ceil(h.default.map(t.strength,0,20,0,100));this.unselectAllControls(),this.unselectAllComponents(),this.currentSelectedBlur=e,this.currentSelectedClip=t,this.$el.find("#blurStrengthText").val(o),this.$el.find("#blurStrength").slider("option","value",o),this.$el.find(".blur-selected .lock-aspect-ratio").prop("checked",t.lockAspectRatio),this.$el.find(".blur-control-detail").show(),this.$el.find(".blur-initial").hide(),this.$el.find(".blur-selected").show(),this.showMarkers("effects"),n()("#se-effects-"+e+" .ui-resizable-handle").show(),n()("#se-effects-"+e).resizable("enable").addClass("edit-video-selected"),this.setAdaptiveBorderForTarget(n()("#se-effects-"+e)),this.selectControl("add-blur-btn"),void 0!==t.id&&this.showClipTime(t)}},unselectBlur:function(){null!=this.currentSelectedBlur&&(this.currentSelectedBlur=void 0,this.$el.find(".blur-initial").show(),this.$el.find(".blur-selected").hide(),n()(".se-effects .ui-resizable-handle").hide(),n()(".se-effects").resizable({disabled:!0}).removeClass("edit-video-selected white black"),this.showMarkers("effects"),this.videoPlayerView.$el.find(".se-clip-time").hide())},deleteBlur:function(){for(var e=this.getClipOf(this.sessionDetails.primaryVideo)||{},i=e.effects||[],t=0;t<e.effects.length&&e.effects[t].id!=this.currentSelectedBlur;t++);t!=e.effects.length&&(i.splice(t,1),this.unselectBlur(),this.reconstructUI(),h.default.trackInThirdPartyTools("SE - Delete Blur",{email:this.userEmail}))},drawBlurLayer:function({blurRegionChanged:e}={}){if(this.projectJson){var i=this.videoPlayerView.$el.find(".primary-video")[0],t=this.videoPlayerView.$el.find(".se-effects-canvas")[0],o=t.getContext("2d"),s=this.primaryVideoContainer.width(),a=this.primaryVideoContainer.height(),r=(this.getClipOf(this.sessionDetails.primaryVideo)||{}).effects||[];t.width=s,t.height=a,o.clearRect(0,0,s,a);for(var l=0;l<r.length;l++){var d=r[l];if(d&&!(this.videoPlayerView.getCurrentTime()-this.videoPlayerView.trimStart<d.position-.1||this.videoPlayerView.getCurrentTime()-this.videoPlayerView.trimStart>d.position+(d.end-d.start))){d.initialWidth&&0==e&&function(){let e=t.width/d.initialWidth,i=t.height/d.initialHeight,o=t.width/d.initialXpos,s=t.height/d.initialYpos;n()("#se-effects-"+d.id).css({left:o+"px",top:s+"px",width:e+"px",height:i+"px"}),d.widthRaw=e,d.heightRaw=i,d.xposRaw=o,d.yposRaw=s}(),o.save(),o.rect(d.xposRaw,d.yposRaw,d.widthRaw,d.heightRaw),o.clip(),o.filter="blur("+d.strength+"px)";var c=h.default.map(d.xposRaw,0,s,0,i.videoWidth),p=h.default.map(d.yposRaw,0,a,0,i.videoHeight),u=h.default.map(d.widthRaw,0,s,0,i.videoWidth),m=h.default.map(d.heightRaw,0,a,0,i.videoHeight);o.drawImage(i,c,p,u,m,d.xposRaw,d.yposRaw,d.widthRaw,d.heightRaw),o.restore(),n()("#se-effects-"+d.id).css({opacity:"1","z-index":"106"})}else n()("#se-effects-"+d.id).css({opacity:"0","z-index":"-1"})}}},getMaxDuration:function(){for(var e=0,i=0;i<this.projectJson.clips.length;i++)e=Math.max(e,this.projectJson.clips[i].end);return e},selectAddCallouts:function(){this.askReloadConfirmation=!0,this.isPPR?h.default.trackInThirdPartyTools("video_preview_Callout_save_isPPR",{email:this.userEmail}):h.default.trackInThirdPartyTools("video_preview_Callout_save",{email:this.userEmail}),this.unselectAllControls(),this.$el.find(".addcallout-selected").hide(),this.$el.find(".addcallout-initial").show(),this.$el.find(".addcallout-control-detail").fadeIn(100),this.showMarkers("calloutimage"),this.selectControl("add-callouts-btn")},calloutBtnClicked:function(e){e.data.that.addNewCallout(e.target.id.split("se-callout-btn-")[1])},addNewCallout:function(e,i,t){var o=this.sessionDetails.totalCreatedClips,s=this.getMaxDuration();this.projectJson.trackNames.push("Callout-Image");var a={containsAudio:!1,containsVideo:!1,containsText:!1,containsImage:!0,id:-e-1e4,baseId:-e-1e4,duration:s,type:"calloutimage"};null!=i&&null!=t||(i=this.videoPlayerView.$el.find(".se-crop-highlighter-left").width(),i+=(this.videoPlayerView.$el.find(".se-crop-highlighter-right").position().left-this.videoPlayerView.$el.find(".se-crop-highlighter-left").width())/2,t=this.videoPlayerView.$el.find(".se-crop-highlighter-top").height(),t+=(this.videoPlayerView.$el.find(".se-crop-highlighter-bottom").position().top-this.videoPlayerView.$el.find(".se-crop-highlighter-top").height())/2);var r={fadein:0,fadeout:0,heightRaw:this.callouts[e].height/2,widthRaw:this.callouts[e].width/2,height:this.getValueForProject(this.callouts[e].height/2,!1),width:this.getValueForProject(this.callouts[e].width/2,!0),xposRaw:i,yposRaw:t,xpos:this.getValueForProject(i,!0),ypos:this.getValueForProject(t,!1),opacity:1,lockAspectRatio:!0},n=3,l=Math.max(this.videoPlayerView.getCurrentTime(),.001),d={deleted:!1,end:n,footage:a,id:o,position:Math.max(l-this.videoPlayerView.trimStart,.001),properties:r,start:0,track:this.projectJson.totalVideoTracks+1,startFrom:l,endAt:Math.min(this.videoPlayerView.getCurrentTime()+n,s)};if(this.projectJson.totalVideoTracks++,this.projectJson.clips.push(d),this.sessionDetails.addedClips.push(d.id),this.sessionDetails.totalCreatedClips++,this.callouts[e].hasText){var c=this.sessionDetails.totalCreatedClips;this.projectJson.trackNames.push("Callout-Text"),a.textId=c;var h={containsAudio:!1,containsVideo:!1,containsText:!0,containsImage:!1,duration:s,calloutId:o,type:"callouttext"};i+=0;var p={x:r.xposRaw,y:t+=50,w:r.widthRaw,h:r.heightRaw/4},u={text:this.defaultTextAreaValue,textUnwrapped:this.defaultTextAreaValue,font:this.defaultFontValue,fontSize:15,fontSizeProject:this.getValueForProject(15,!0),color:"black",bold:!1,italic:!1,opacity:1,xposRaw:i,yposRaw:t,xpos:this.getValueForProject(i,!0),ypos:this.getValueForProject(t,!1),offsetX:0,offsetY:50,textAlign:"center",boundingBoxRaw:p,boundingBox:this.getBoundingBoxForProject(p)};this.getLuminanceForClip(u.boundingBoxRaw.x,u.boundingBoxRaw.y,u.boundingBoxRaw.w,u.boundingBoxRaw.h)<128&&(u.color="#FFFFFF"),n=3,l=Math.max(this.videoPlayerView.getCurrentTime(),.001);var m={deleted:!1,end:n,footage:h,id:c,position:Math.max(l-this.videoPlayerView.trimStart,.001),properties:u,start:0,track:this.projectJson.totalVideoTracks+1,startFrom:l,endAt:Math.min(this.videoPlayerView.getCurrentTime()+n,s)};this.projectJson.totalVideoTracks++,this.projectJson.clips.push(m),this.sessionDetails.addedClips.push(m.id),this.sessionDetails.totalCreatedClips++}this.reconstructUI(),this.selectCallout(o)},selectCallout:function(e){if(this.enabled){this.unselectAllControls(),this.unselectAllComponents(),this.currentSelectedCallout=e,this.currentSelectedClip=this.getClipOf(e),this.$el.find(".addcallout-control-detail").show(),this.$el.find(".addcallout-initial").hide(),this.$el.find(".addcallout-selected").show();var i=this.getClipOf(this.currentSelectedCallout);this.$el.find(".addcallout-selected .opacity-val").val(100*i.properties.opacity),this.$el.find(".addcallout-selected .lock-aspect-ratio").prop("checked",i.properties.lockAspectRatio),this.$el.find(".addcallout-selected .callout-variation").val(i.footage.baseId-i.footage.id);var t=this.videoPlayerView.$el.find("#se-component-"+e);t.resizable("enable"),t.addClass("edit-video-selected"),this.setAdaptiveBorderForTarget(this.videoPlayerView.$el.find("#se-component-"+e)),this.showMarkers("calloutimage"),this.showClipTime(i),this.selectControl("add-callouts-btn")}},unselectCallout:function(){null!=this.currentSelectedCallout&&(this.currentSelectedCallout=void 0,this.$el.find(".addcallout-initial").show(),this.$el.find(".addcallout-selected").hide(),n()(".se-image-component").resizable({disabled:!0}),n()(".se-image-component").removeClass("edit-video-selected white black"),this.showMarkers("calloutimage"),this.videoPlayerView.$el.find(".se-clip-time").hide())},calloutDragged:function(){var e=this.getClipOf(this.currentSelectedCallout),i=this.getClipOf(e.footage.textId);if(null!=i){var t=this.getClipElOf(e.footage.textId);i.properties.boundingBoxRaw?t.css({left:h.default.map(this.calloutTextBoxSpread.x,0,1,e.properties.xposRaw,e.properties.xposRaw+e.properties.widthRaw)+"px",top:h.default.map(this.calloutTextBoxSpread.y,0,1,e.properties.yposRaw,e.properties.yposRaw+e.properties.heightRaw)+"px"}):this.videoPlayerView.$el.find("#se-component-"+e.footage.textId).css({left:this.videoPlayerView.$el.find("#se-component-"+e.id).position().left+i.properties.offsetX+"px",top:this.videoPlayerView.$el.find("#se-component-"+e.id).position().top+i.properties.offsetY+"px"}),i.properties.xposRaw=t.position().left,i.properties.yposRaw=t.position().top,i.properties.xpos=this.getValueForProject(i.properties.xposRaw,!0),i.properties.ypos=this.getValueForProject(i.properties.yposRaw,!1),i&&i.properties.boundingBoxRaw&&(i.properties.boundingBoxRaw.x=i.properties.xposRaw,i.properties.boundingBoxRaw.y=i.properties.yposRaw,i.properties.boundingBox=this.getBoundingBoxForProject(i.properties.boundingBoxRaw))}this.updateProjectJson()},calloutResized:function(e){var i=this.getClipOf(e),t=this.getClipOf(i.footage.textId);t&&t.properties.boundingBoxRaw&&this.calloutTextBoxSpread&&(this.getClipElOf(t.id).css({left:h.default.map(this.calloutTextBoxSpread.x,0,1,i.properties.xposRaw,i.properties.xposRaw+i.properties.widthRaw)+"px",top:h.default.map(this.calloutTextBoxSpread.y,0,1,i.properties.yposRaw,i.properties.yposRaw+i.properties.heightRaw)+"px",width:this.calloutTextBoxSpread.w*i.properties.widthRaw+"px"}),this.textBoxResized(t.id)),this.updateProjectJson()},calloutPropertyChanged:function(){var e=this.getClipOf(this.currentSelectedCallout);e.properties.opacity=this.$el.find(".addcallout-selected .opacity-val").val()/100,e.properties.lockAspectRatio=this.$el.find(".addcallout-selected .lock-aspect-ratio").is(":checked"),e.footage.id=e.footage.baseId-parseInt(this.$el.find(".callout-variation").val()),this.updateProjectJson(),this.reconstructUI()},deleteCallout:function(){var e=this.getClipOf(this.currentSelectedCallout),i=this.getClipOf(e.footage.textId);null!=i&&this.removeClip(i.id),this.removeClip(this.currentSelectedCallout),this.unselectCallout(),this.reconstructUI()},findCalloutSize:function(e){var i=document.createElement("img");i.src="https://s3.amazonaws.com/hippolms-wiz-static/callouts/c"+e+".png?v=2",i.crossOrigin="Anonymous";var t=this;this.callouts[e]&&(this.callouts[e].width=300,this.callouts[e].height=300),i.onload=function(){t.callouts[e]&&(t.callouts[e].width=i.width,t.callouts[e].height=i.height)}},isCalloutImage:function(e){return this.getClipOf(e).footage.id<=-1e4},scrollCallouts:function(e){var i=n()(e.target).hasClass("callout-scroll-left"),t=e.data.that;t.$el.find(".callout-btn-scroll-container").animate({scrollLeft:t.$el.find(".callout-btn-scroll-container").scrollLeft()+200*(i?-1:1)},200)},newComponentDragged:function(){this.videoPlayerView.$el.find(".se-crop-resizable").removeClass("disp-none").addClass("disp-show"),this.videoPlayerView.$el.find(".se-components-droppable").fadeIn(200),this.videoPlayerView.$el.find(".se-components-droppable").css({"z-index":1e3,width:this.videoPlayerView.$el.find(".se-crop-resizable").width()+"px",height:this.videoPlayerView.$el.find(".se-crop-resizable").height()+"px",left:this.videoPlayerView.$el.find(".se-crop-resizable").position().left+"px",top:this.videoPlayerView.$el.find(".se-crop-resizable").position().top+"px"})},newComponentDropped:function(){this.videoPlayerView.$el.find(".se-crop-resizable").removeClass("disp-show").addClass("disp-none"),this.videoPlayerView.$el.find(".se-components-droppable").hide(),this.videoPlayerView.$el.find(".se-components-droppable").css("z-index",0)},getClipOf:function(e){for(var i=void 0,t=0;t<this.projectJson.clips.length;t++)if(this.projectJson.clips[t].id==e){i=this.projectJson.clips[t];break}return i},getClipElOf:function(e){return this.videoPlayerView.$el.find("#se-component-"+e)},removeClip:function(e){e=parseInt(e);for(var i=0;i<this.projectJson.clips.length;i++)if(this.projectJson.clips[i].id==e){this.projectJson.clips.splice(i,1);break}-1!==this.sessionDetails.addedClips.indexOf(e)&&this.sessionDetails.addedClips.splice(this.sessionDetails.addedClips.indexOf(e),1)},lockAspectRatio:function(e){var i=e.data.that;n()(e.target).hasClass("primary-vid-control")?(i.primaryVideoContainer.resizable("destroy"),i.makeVideoContainerResizable(i.primaryVideoContainer,n()(e.target).is(":checked"))):n()(e.target).hasClass("secondary-vid-control")&&(i.secondaryVideoContainer.resizable("destroy"),i.makeVideoContainerResizable(i.secondaryVideoContainer,n()(e.target).is(":checked")))},opacityChanged:function(e){var i=e.data.that;n()(e.target).hasClass("primary-vid-control")?(i.primaryVideoContainer.resizable("destroy"),i.makeVideoContainerResizable(i.primaryVideoContainer,n()(e.target).is(":checked"))):n()(e.target).hasClass("secondary-vid-control")&&(i.secondaryVideoContainer.resizable("destroy"),i.makeVideoContainerResizable(i.secondaryVideoContainer,n()(e.target).is(":checked")))},showClipTime:function(e,i){var t=e.footage?e.footage.type:"blur";this.videoPlayerView.$el.find(".se-clip-time").show();var o=Math.max(h.default.map(e.startFrom,this.videoPlayerView.trimStart,this.videoPlayerView.mediaPlayer.duration-this.videoPlayerView.trimEnd,0,this.videoPlayerView.$el.find(".components-time-container").width()),0),s=Math.min(h.default.map(e.endAt,this.videoPlayerView.trimStart,this.videoPlayerView.mediaPlayer.duration-this.videoPlayerView.trimEnd,0,this.videoPlayerView.$el.find(".components-time-container").width()),this.videoPlayerView.$el.find(".components-time-container").width());this.videoPlayerView.$el.find(".se-clip-time").resizable("enable"),this.videoPlayerView.$el.find(".se-clip-time").css({left:o+"px",width:s-o+"px"}),this.timerPopUpCheck(),this.videoPlayerView.$el.find(".se-clip-time .se-selected-type").html(t.substring(0,1).toUpperCase()),i||this.updateTimeFromClipToPopup(this),n()(".timer-pop-up").show()},playerTimeUpdate:function(){for(var e=0;e<this.sessionDetails.addedClips.length;e++){var i=this.getClipOf(this.sessionDetails.addedClips[e]);null!=i&&(this.videoPlayerView.getCurrentTime()-this.videoPlayerView.trimStart<i.position-.1||this.videoPlayerView.getCurrentTime()-this.videoPlayerView.trimStart>i.position+(i.end-i.start)?this.videoPlayerView.$el.find("#se-component-"+i.id).css({opacity:"0","z-index":"0"}):this.videoPlayerView.$el.find("#se-component-"+i.id).css({opacity:null!=i.properties.opacity?i.properties.opacity:1,"z-index":"107"}))}},handleVideoPlay:function(){var e=this;this.blurPlayInterval=setInterval((function(){e.drawBlurLayer({blurRegionChanged:!0})}),15)},handleVideoPause:function(){clearInterval(this.blurPlayInterval)},handleVideoSeeked:function(){this.drawBlurLayer({blurRegionChanged:!0}),this.setBorderForClipOnVideoSeek()},showMarkers:function(e){var i,t,o=this.videoPlayerView.$el.find(".player-progress").width()+parseInt(n()(".player-progress").css("marginRight"))+parseInt(n()(".player-progress").css("marginLeft"));if(this.isFromSdk&&(o=this.videoPlayerView.$el.find(".hvplayer-seekbar-wrapper").outerWidth()+parseInt(n()(".hvplayer-seekbar-wrapper").css("marginRight"))+parseInt(n()(".hvplayer-seekbar-wrapper").css("marginLeft"))),this.videoPlayerView.$el.find(".components-time-container, .components-marker-container").css("width",o+"px"),this.videoPlayerView.$el.find(".components-marker-container").empty(),"effects"===e){i=(this.getClipOf(this.sessionDetails.primaryVideo)||{}).effects||[];for(var s=0;s<i.length;s++)t=Math.max(h.default.map(i[s].startFrom,this.videoPlayerView.trimStart,this.videoPlayerView.mediaPlayer.duration-this.videoPlayerView.trimEnd,0,this.videoPlayerView.$el.find(".components-time-container").width()),0),this.videoPlayerView.$el.find(".components-marker-container").append('<span class="se-selected-type" id="effect-'+i[s].id+'" style = "left:'+t+'px">'+i[s].type.substring(0,1).toUpperCase()+"</span>")}else for(s=0;s<this.projectJson.clips.length;s++){var a=this.projectJson.clips[s];a.footage.type==e&&(t=Math.max(h.default.map(a.startFrom,this.videoPlayerView.trimStart,this.videoPlayerView.mediaPlayer.duration-this.videoPlayerView.trimEnd,0,this.videoPlayerView.$el.find(".components-time-container").width()),0),this.videoPlayerView.$el.find(".components-marker-container").append('<span class="se-selected-type" id="clip-'+a.id+'" style = "left:'+t+'px">'+a.footage.type.substring(0,1).toUpperCase()+"</span>"))}this.videoPlayerView.$el.find(".se-selected-type").bind("click",{that:this},this.markerSelected)},markerSelected:function(e){var i,t=e.target.id,o=0;if(t.includes("clip"))i=t.split("-")[1],o=this.getClipOf(i).startFrom;else{if(!t.includes("effect"))return;{i=t.split("-")[1];let e=this.getClipOf(this.sessionDetails.primaryVideo).effects.findIndex((function(e){return e.id==i}));o=(this.getClipOf(this.sessionDetails.primaryVideo).effects[e]||{}).startFrom}}this.videoPlayerView.goToTime(Math.min(Math.max(o,this.videoPlayerView.trimStart),this.videoPlayerView.mediaPlayer.duration-this.videoPlayerView.trimEnd)),this.reconstructUI(),this.selectComponentFromId(i,t.includes("effect"))},selectComponentFromId:function(e,i){var t;i?this.selectBlur(e):"sticker"===(t=this.getClipOf(e).footage.type)?this.selectSticker(e):"text"===t?this.selectText(e):"calloutimage"===t&&this.selectCallout(e)},makeVideoContainerResizable:function(e,i){var t=this;e.resizable({aspectRatio:i,handles:"n, e, w, s, ne, nw, se, sw",resize:function(e,i){t.mediaContainerResized(n()(e.target))},start:this.userEventStart,stop:function(){t.userEventStop(),t.reconstructUI()}}),this.videoPlayerView.$el.find(".ui-resizable-handle").removeClass("ui-icon ui-icon-gripsmall-diagonal-se")},isOnBoardRequired:function(){return!1},getFont:function(e,i,t,o){var s=this;this.fontCache[e+":"+i+":"+t]?o(this.fontCache[e+":"+i+":"+t]):(e||(console.warn("fontname not set"),e=s.defaultFontValue),(0,I.load)(this.getFontURL(e,i,t),(function(a,r){if(a){var n;for(var l in console.error("error loading font "+e+":"+i+":"+t),s.fontCache)n=s.fontCache[l];n?o(n):(console.warn("trying to load default font"),(0,I.load)(s.getFontURL("montserrat",i,t),(function(e,i){a?console.error("loading default font also failed"):o(i)})))}else s.fontCache[e+":"+i+":"+t]=r,o(r)})))},setLineHeight:function(e){var i=this;null==e.properties.fontSizeProject&&(e.properties.fontSizeProject=this.getValueForProject(e.properties.fontSize));var t=this.getValueForPlayer(e.properties.fontSizeProject,!0);this.getFont(e.properties.font,e.properties.bold,e.properties.italic,(function(o){var s=i.getMetrics(e.properties.text,t,o),a=0;i.videoPlayerView.$el.find("#se-component-"+e.id+" div").each((function(){var e=i.getMetrics(n()(this).text(),t,o);a=Math.max(a,e.actualBoundingBoxAscent-e.actualBoundingBoxDescent)})),a+=(s.fontBoundingBoxAscent-s.fontBoundingBoxDescent)/10,e.properties.lineHeight=i.getValueForProject(a,!1);var r=0,l=0,d=a*i.videoPlayerView.$el.find("#se-component-"+e.id+" .text-el-line").length,c=Math.min(Math.max(10,d/2),40);e.properties.boundingBoxRaw&&(c=(e.properties.boundingBoxRaw.h-d)/2);var h=e.properties.textAlign?e.properties.textAlign:"left";i.videoPlayerView.$el.find("#se-component-"+e.id+" .text-el-line").each((function(){var e=i.getMetrics(n()(this).text(),t,o);l=Math.max(l,e.actualWidth)})),null==e.properties.boundingBoxRaw&&(c=Math.min(Math.max(10,d/2),40),e.properties.boundingBoxRaw={x:e.properties.xposRaw,y:e.properties.yposRaw-c,w:l+2*c,h:d+2*c},e.properties.textAlign=h,i.setTextDraggableContainerSize(i.videoPlayerView.$el.find("#se-component-"+e.id)[0],e,!1)),e.properties.boundingBoxRaw.topPadding=c,e.properties.boundingBox=i.getBoundingBoxForProject(e.properties.boundingBoxRaw),i.videoPlayerView.$el.find("#se-component-"+e.id+" .text-el-line").each((function(){var s=i.getMetrics(n()(this).text(),t,o),l=0;"center"==h?l=(e.properties.boundingBoxRaw.w-s.actualWidth)/2:"right"==h&&(l=e.properties.boundingBoxRaw.w-s.actualWidth),n()(this).css({"line-height":s.fontBoundingBoxAscent-s.fontBoundingBoxDescent+"px",top:r+(s.actualBoundingBoxAscent-s.fontBoundingBoxAscent)+c+"px",left:l+"px"}),r+=a}))}))},setTextDraggableContainerSize:function(e,i,t){var o=this;i.properties.boundingBoxRaw&&(n()(e).css({width:i.properties.boundingBoxRaw.w+"px",height:i.properties.boundingBoxRaw.h+"px"}),t&&(n()(e).resizable({handles:"se",aspectRatio:!1,containment:this.primaryVideoContainer,create:function(){n()(this).find(".ui-resizable-handle").removeClass("ui-icon ui-icon-gripsmall-diagonal-se")},stop:function(){o.lastTextResizeTime=(new Date).getTime()},resize:o.textBoxResized}),i.footage.calloutId&&n()(e).resizable("option","containment","#se-component-"+i.footage.calloutId)))},selectControl:function(e){this.$el.find(".se-control-selected").removeClass("se-control-selected"),this.$el.find("."+e).addClass("se-control-selected")},computedDuration:function(){this.resizeHandler(),this.$el.find(".trim-before-container, .trim-after-container").show(),this.reconstructUI(),this.updateTrimInput()},_getVideoModel:function(){if(this.embeddedDigest&&this.embeddedDigest.length>0)var e=new(w())({embedded_digest:this.embeddedDigest});else e=this.digest?new(w())({digest:this.digest}):new(w());return e},getReloadConfirmationState:function(){return this.askReloadConfirmation},prefetchAssetsForSimpleEdit:function(){try{var e=new Image;e.src="https://s3.amazonaws.com/hippolms-wiz-static/stickers-all/stickers_all.png?v=2",e.crossOrigin="Anonymous"}catch(e){console.log("Image constructor - Browser not supported!")}},showClipTimePop:function(e){var i=n()(e.target);(i.hasClass("se-clip-time")||i.hasClass("se-selected-type"))&&(e.data.that.updateTimeFromClipToPopup(e.data.that),n()(".timer-pop-up").toggle())},clipInputButtonClicked:function(e){e.stopPropagation();var i=e.data.that,t=i.currentSelectedClip||{},o=e.target.className.indexOf("timer-start-btn")>-1,s=e.target.className.indexOf("plus")>-1;i.calculateTimeAndUpdateClip(o,s,t,i),i.reconstructUI()},clipInputtyped:function(e){e.stopPropagation();var i=e.data.that,t=e.keyCode,o=n()(e.target).hasClass("timer-start-input");if(38===t||40===t)i.calculateTimeAndUpdateClip(o,38===t,i.currentSelectedClip||{},i);else{let e=h.default.timeToSeconds(n()(".timer-start-input").val()),t=h.default.timeToSeconds(n()(".timer-stop-input").val());clearTimeout(i.clipTimeInputTimeout),i.isValidClipTime(e,t)?i.setClipTimeAndUpdateValues(e,t,i):i.clipTimeInputTimeout=setTimeout((function(){i.updateTimeFromClipToPopup()}),1e3)}i.reconstructUI()},isValidClipTime:function(e,i){var t=this.videoPlayerView,o=t.mediaPlayer.duration-t.trimEnd;return!(e>=i||e<t.trimStart||i>o||isNaN(e)||isNaN(i))},updateTimeFromClipToPopup:function(e){var i=(e=e||this).currentSelectedClip||{};n()(".timer-start-input").val(h.default.strToTime(i.startFrom)),n()(".timer-stop-input").val(h.default.strToTime(i.endAt))},calculateTimeAndUpdateClip:function(e,i,t,o){var s=t.startFrom,a=t.endAt,r=o.videoPlayerView,l=r.mediaPlayer.duration-r.trimEnd;e?s=i?Math.min(s+1,l):Math.max(s-1,r.trimStart):a=i?Math.min(a+1,l):Math.max(a-1,r.trimStart),s>=a||(n()(".timer-start-input").val(h.default.strToTime(s)),n()(".timer-stop-input").val(h.default.strToTime(a)),o.setClipTimeAndUpdateValues(s,a,o))},setClipTimeAndUpdateValues:function(e,i,t){var o=t.currentSelectedClip||{},s=o.footage?o.footage.type:"blur";o.startFrom=e,o.endAt=i,("calloutimage"===s||"sticker"===s||"text"===s||"blur"===s)&&this.showClipTime(o,!0),this.updateCalloutClipTime(o),this.updateProjectJson()},updateCalloutClipTime:function(e){if(null!=e&&null!=e.footage&&null!=e.footage.type){var i;if("callouttext"==e.footage.type)i=this.getClipOf(e.footage.calloutId);else{if("calloutimage"!=e.footage.type||null==e.footage.textId)return;i=this.getClipOf(e.footage.textId)||{}}i.startFrom=e.startFrom,i.endAt=e.endAt}},onClipTimeChangeHandler:function(){var e=h.default.map(this.videoPlayerView.$el.find(".se-clip-time").position().left,0,this.videoPlayerView.$el.find(".components-time-container").width(),this.videoPlayerView.trimStart,this.videoPlayerView.mediaPlayer.duration-this.videoPlayerView.trimEnd),i=h.default.map(this.videoPlayerView.$el.find(".se-clip-time").width(),0,this.videoPlayerView.$el.find(".components-time-container").width(),0,this.videoPlayerView.mediaPlayer.duration-this.videoPlayerView.trimStart-this.videoPlayerView.trimEnd),t=this.getSelectedClipOrEffect();null!=t&&(t.startFrom=e,t.endAt=t.startFrom+i,this.updateCalloutClipTime(t),this.updateProjectJson(),this.reconstructUI(),this.timerPopUpCheck())},getTextFromTextEl:function(e){for(var i=e.find(".text-el-line").toArray(),t="",o=0;o<i.length;o++)t+=n()(i[o]).text()+(o+1<i.length?"\n":"");return t},newlineTextToHtml:function(e,i){var t=this,o=i.properties.text.split(/[\r\n]+/);for(var s in i.properties.textUnwrapped&&(o=i.properties.textUnwrapped.split(/[\r\n]+/),i.properties.boundingBoxRaw&&i.properties.textUnwrapped&&this.getFont(i.properties.font,i.properties.bold,i.properties.italic,(function(e){for(var s=0;s<o.length;s++){for(var a=o[s].split(/(\$[\s]*\{.*\}|\S+|\s+)/).filter((function(e){return 0!=e.length})),r=[{first:o[s]}],n=a.length-1;n>0;n--)r.push({first:a.slice(0,n).join(""),second:a.slice(n,a.length).join("")});var l=r[r.length-1].first;if(!l.replace(/\s/g,"").startsWith("${"))for(n=l.length-1;n>0;n--)r.push({first:l.slice(0,n),second:[l.slice(n,l.length),a.slice(1,a.length).join("")].join("")});for(var d=0;d<r.length&&!(t.getMetrics(r[d].first,t.getValueForPlayer(i.properties.fontSizeProject,!0),e).actualWidth<=i.properties.boundingBoxRaw.w);d++);d=Math.min(r.length-1,d),o[s]=r[d].first,r[d].second&&o.splice(s+1,0,r[d].second)}})),i.properties.text=o.join("\n")),n()(e).empty(),o){var a=document.createElement("div");n()(a).append(o[s]),n()(a).addClass("text-el-line"),n()(a).css({"font-family":null!=h.default.getFontMap()[i.properties.font]?h.default.getFontMap()[i.properties.font].css:"","font-size":this.getValueForPlayer(i.properties.fontSizeProject,!0)+"px","font-style":i.properties.italic?"italic":"normal","font-weight":i.properties.bold?"bold":"normal",color:i.properties.color,position:"absolute","line-height":"0.7em"}),n()(e).append(a)}this.setLineHeight(i)},fontLoaded:function(e){if(null!=this.currentSelectedText){var i=this.getClipOf(this.currentSelectedText),t=this.getClipElOf(this.currentSelectedText);this.newlineTextToHtml(t.find(".se-text-container")[0],i)}},textBoxResized:function(e){(e instanceof n().Event||null==e)&&(e=this.currentSelectedText);var i=this.getClipOf(e),t=this.getClipElOf(e);i.properties.boundingBoxRaw={x:t.position().left,y:t.position().top,w:t.width(),h:t.height()},i.properties.boundingBox=this.getBoundingBoxForProject(i.properties.boundingBoxRaw),this.newlineTextToHtml(t.find(".se-text-container")[0],i)},webcamSnappedLayoutOnCrop:function(){var e="bottom-left";return this.projectJson&&null!=this.projectJson.webcamPosition&&(e=this.projectJson.webcamPosition),"bottom-left"==e?{x:this.cropResizable.position().left,y:this.cropResizable.position().top+this.cropResizable.height()-this.secondaryVideoContainer.height()}:"bottom-right"==e?{x:this.cropResizable.position().left+this.cropResizable.width()-this.secondaryVideoContainer.width(),y:this.cropResizable.position().top+this.cropResizable.height()-this.secondaryVideoContainer.height()}:"top-right"==e?{x:this.cropResizable.position().left+this.cropResizable.width()-this.secondaryVideoContainer.width(),y:this.cropResizable.position().top}:"top-left"==e?{x:this.cropResizable.position().left,y:this.cropResizable.position().top}:void 0},getProjectJSON:function(){return this.projectJson},getIOAdjustedProjectJSON:function(){var e=h.default.naiveClone(this.projectJson);if(null!=e.ioDetails)try{if(e.ioDetails.intro&&e.ioDetails.intro.theme>0){for(var i=e.ioDetails.intro,t=i.duration,o=t,s=0;s<e.clips.length;s++)e.clips[s].deleted||e.clips[s].properties.isPlaceHolder||(e.clips[s].position=parseInt(e.clips[s].position)+t,o=Math.min(o,e.clips[s].position));var a=e.totalVideoTracks;for(s=0;s<i.clips.length;s++)if(!(d=i.clips[s]).deleted&&!d.properties.isPlaceHolder){var r=s+1;o<t&&(r+=a),r>e.totalVideoTracks&&(e.totalVideoTracks++,e.trackNames.push(d.properties.text)),d.track=r,e.clips.push(d)}}if(e.ioDetails.outro&&e.ioDetails.outro.theme>0){var n=e.ioDetails.outro,l=0;for(s=0;s<e.clips.length;s++)e.clips[s].deleted||e.clips[s].properties.isPlaceHolder||(l=Math.max(l,parseInt(e.clips[s].position)+e.clips[s].end-e.clips[s].start));for(s=0;s<n.clips.length;s++){var d;(d=n.clips[s]).deleted||d.properties.isPlaceHolder||((r=s+1)>=e.totalVideoTracks&&(e.totalVideoTracks++,e.trackNames.push(d.properties.text)),d.position=l,d.track=r,e.clips.push(d))}}}catch(e){console.error(e)}return e},overrideStyle:function(e,i,t){e.each((function(){this.style.setProperty(i,t,"important")}))},applyCustomColors:function(){this.customColors&&(this.customColors.primaryColor&&(this.overrideStyle(this.$el.find(".trim-slider .ui-slider-handle"),"background",this.customColors.primaryColor),this.overrideStyle(this.$el.find(".trim-slider .ui-slider-range"),"border-color",this.customColors.primaryColor)),this.customColors.secondaryColor&&this.overrideStyle(this.$el.find(".trim-slider .ui-slider-range"),"background",this.customColors.secondaryColor),this.customColors.bgColor&&this.overrideStyle(this.$el.find(".trim-slider"),"background",this.customColors.bgColor))},addCustomFontStyles:function(){var e=document.createElement("style");for(var i in h.default.getFontMap()){var t=h.default.getFontMap()[i],o=we.Z.getFormatType(t);e.appendChild(document.createTextNode("@font-face { font-family: '"+t.family+"'; font-style: normal; font-weight: 400; src: url('"+this.getFontURL(i,!1,!1)+"') format('"+o+"'); }")),e.appendChild(document.createTextNode("@font-face { font-family: '"+t.family+"'; font-style: normal; font-weight: bold; src: url('"+this.getFontURL(i,!0,!1)+"') format('"+o+"'); }")),e.appendChild(document.createTextNode("@font-face { font-family: '"+t.family+"'; font-style: italic; font-weight: 400; src: url('"+this.getFontURL(i,!1,!0)+"') format('"+o+"'); }")),e.appendChild(document.createTextNode("@font-face { font-family: '"+t.family+"'; font-style: italic; font-weight: bold; src: url('"+this.getFontURL(i,!0,!0)+"') format('"+o+"'); }"))}document.head.appendChild(e)},getFontURL:function(e,i,t){return we.Z.getFontURL(e,i,t)},getMetrics:function(e,i,t){for(var o=0,s=0,a=0,r=1/t.unitsPerEm*i,n=t.stringToGlyphs(e.replace(/\s/g,"")),l=0;l<n.length;l++){var d=n[l];d.advanceWidth&&(a+=d.advanceWidth*r),l<n.length-1&&(a+=t.getKerningValue(d,n[l+1])*r),o=Math.max(o,d.yMax),s=Math.min(s,d.yMin)}var c=t.getPath(e,0,0,i);return{actualWidth:c.getBoundingBox().x2-c.getBoundingBox().x1,width:a,actualBoundingBoxAscent:o*r,actualBoundingBoxDescent:s*r,actualHeight:o*r-s*r,fontBoundingBoxAscent:t.ascender*r,fontBoundingBoxDescent:t.descender*r,fontHeight:t.ascender*r-t.descender*r}},globalKeypress:function(e){var i=e.keyCode;0==this.videoPlayerView.$el.find(".timer-pop-up").find(n()(e.target)).length&&(!this.isMac&&46===i||this.isMac&&8===i)&&this.deleteClipOrEffectSelected()},deleteClipOrEffectSelected:function(){null!=this.currentSelectedBlur?this.deleteBlur():null!=this.currentSelectedSticker?this.deleteSticker():null!=this.currentSelectedCallout?this.deleteCallout():null!=this.currentSelectedText&&(this.videoPlayerView.$el.find(".se-text-editable").is(":visible")||this.deleteText())},setBorderForClipOnVideoSeek:function(){var e=this.getSelectedClipOrEffect();null!=e&&(null!=this.currentSelectedBlur?(this.videoPlayerView.$el.find("#se-effects-"+e.id).removeClass("black white"),this.setAdaptiveBorderForTarget(this.videoPlayerView.$el.find("#se-effects-"+e.id))):(this.videoPlayerView.$el.find("#se-component-"+e.id).removeClass("black white"),this.setAdaptiveBorderForTarget(this.videoPlayerView.$el.find("#se-component-"+e.id))))},getSelectedClipOrEffect:function(){var e=null!=this.currentSelectedText?this.currentSelectedText:null!=this.currentSelectedSticker?this.currentSelectedSticker:null!=this.currentSelectedCallout?this.currentSelectedCallout:void 0;if(null!=e)return this.getClipOf(e);if(null!=this.currentSelectedBlur){e=this.currentSelectedBlur;var i=(this.getClipOf(this.sessionDetails.primaryVideo)||{}).effects||[];return l.default.filter(i,{id:Number(e)})[0]||{}}},timerPopUpCheck:function(){var e=this.videoPlayerView.$el.find(".se-clip-time .timer-pop-up"),i=this.videoPlayerView.$el.hasClass("hvplayer-wrapper");if(e&&i){var t=document.querySelector(".se-clip-time .timer-pop-up").getBoundingClientRect(),o=document.querySelector(".hvplayer-wrapper").getBoundingClientRect(),s=o.left+o.width;t.left+t.width>s?this.videoPlayerView.$el.find(".se-clip-time .timer-pop-up").addClass("timer-pop-right"):this.videoPlayerView.$el.find(".se-clip-time .timer-pop-up").removeClass("timer-pop-right")}}})),ke=t(71854),xe=t.n(ke),Pe=t(46044),Ve=t(40985),$e=t.n(Ve),Te=t(30168),Ie=t(67165).ZP.div(le||(le=(0,Te.Z)(["\n width: ",";\n margin-top: ",';\n margin-left: auto;\n margin-right: auto;\n\n /* Because the css of image-upload-progress-container is not defined properly and you will need to import entire wiz-delivery.scss file for this to work */\n .image-upload-progress-container {\n display: none;\n }\n margin-top: 0;\n .simple-edit-container .addcallout-control-detail .callout-scroll-hide-layer{\n height: 12px;\n background-color: #262B37;\n }\n .simple-edit-container{\n .simple-edit-controls{\n position: relative;\n display: flex;\n flex-direction: row;\n align-items: center;\n padding-bottom: 36px;\n min-height: 136px;\n background-color: #262B37 !important;\n border: 1px solid #414B5C !important;\n .se-control-detail, .se-resize-control-detail{\n width: 100%;\n }\n .simple-edit-buttons-box{\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n background-color: #2E3542 !important;\n .wiz-simple-edit-btn{\n width: 38px;\n height: 32px;\n margin: 0 10px;\n padding-top: 3px;\n background-color: transparent !important;\n span{\n margin: 0;\n }\n }\n .se-control-selected{\n background-color: #222832 !important;\n border: 1px solid #404856;\n border-radius: 4px;\n }\n }\n .trim-control-detail{\n position: relative;\n align-self: flex-start;\n font-size: 0;\n .trim-slider{\n margin-top: 0 !important;\n background-color: #3B3A47 !important;\n .ui-slider-handle{\n margin-top: 0 !important;\n &:nth-child(3){\n transform: translateX(-10px);\n &:before{\n margin-left: 0 !important;\n }\n }\n }\n }\n .ui-slider-range{\n background-color: rgba(255, 255, 255, 0.3) !important;\n border-radius: 4px;\n }\n .trim-preview-container{\n top: 0;\n margin-top: -50px;\n transform: translateY(-100%);\n }\n .preview-trim-arrow{\n top: 0;\n margin-top: -50px;\n }\n .ruler{\n filter: invert(1);\n margin-top: 0 !important;\n }\n }\n .crop-control-detail{\n overflow: hidden;\n .reposition-webcam-container{\n label{\n margin-left: 8px;\n padding-top: 0;\n color: #C7CBD7;\n &:before{\n top: 0;\n }\n &:after{\n top: 3px;\n }\n }\n input{\n margin-top: 1px;\n vertical-align: top;\n }\n }\n .text-right{\n .apply-btn{\n color: #eb602d;\n }\n .apply-btn, .reset-btn{\n cursor: pointer;\n }\n }\n }\n .clearfix{\n &:after{\n content: "";\n display: block;\n clear: both;\n }\n }\n }\n .addtext-control-detail{\n .addtext-container{\n .sdk-top-wrap{\n width: calc(100% - 33.33%);\n .mf-custom-selector, .alignment-selector{\n .select2-selection{\n background-color: transparent;\n }\n }\n .alignment-selector{\n .select2-selection__rendered{\n line-height: 28px;\n }\n .select2-selection__arrow{\n position: static;\n b{\n right: 5px;\n left: auto;\n margin-top: 0;\n margin-left: 0;\n transform: translateY(-7px);\n }\n }\n }\n .se-font, .se-fontsize{\n .select2-selection__arrow{\n position: absolute;\n top: 0;\n right: 0;\n }\n }\n }\n .for-merge-field{\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n width: 33.33%;\n }\n }\n .color-picker{\n .sp-replacer{\n width: 18px !important;\n height: 18px !important;\n margin: 0;\n padding: 2px;\n line-height: 0;\n background-color: transparent !important;\n border: 0 !important;\n &:before{\n left: -1px !important;\n top: -1px !important;\n width: 18px !important;\n height: 18px !important;\n border: 1px solid #C7CBD7;\n box-sizing: border-box;\n }\n }\n .sp-preview{\n width: 12px;\n height: 12px;\n margin-top: 0;\n margin-left: 0;\n &-inner{\n width: 100% !important;\n height: 100% !important;\n }\n }\n }\n .mf-custom-selector-button .select2-selection .select2-selection__rendered{\n background-color: #484F61 !important;\n border: 0 !important;\n }\n .merge-field-container{\n width: calc(100% - 70px);\n padding-left: 10px;\n .mf-selector{\n width: calc(100% - 30px);\n .select2-container{\n width: 100% !important;\n }\n }\n }\n .se-add-text-btn{\n text-align: left !important;\n cursor: pointer;\n .add-text{\n color: #EB602D;\n white-space: nowrap;\n }\n img{\n filter: invert(1);\n }\n }\n .addtext-container{\n .select2-container .select2-selection--single .select2-selection__rendered{\n width: 100%;\n padding-right: 10px;\n color: #C7CBD7 !important;\n img{\n filter: invert(1);\n opacity: 0.7;\n }\n }\n .select2-selection__arrow b{\n border-color: #A1A6B4 transparent transparent transparent;\n }\n }\n .se-bold-face label, .italic-face label{\n height: auto;\n color: #C7CBD7;\n line-height: normal;\n background-color: transparent;\n cursor: pointer;\n }\n }\n .merge-field-container{\n .mf-label{\n position: relative;\n }\n }\n .select2-container--hippocategory{\n border: 0;\n }\n .se-resize-control-detail{\n label{\n margin-left: 8px;\n color: #C7CBD7;\n }\n input{\n margin-top: 1px;\n vertical-align: top;\n }\n }\n .blur-control-detail{\n .blur-initial{\n color: #C7CBD7;\n }\n .outline-btn{\n color: #EB602D;\n background-color: transparent;\n border-color: #EB602D;\n transform: translateY(-7px);\n }\n .blur-selected{\n color: #C7CBD7 !important;\n .blur-control.lock-aspect-ratio{\n width: 14px;\n margin-top: 5px;\n }\n label{\n color: #c7cbd7 !important;\n transform: translateY(-5px);\n }\n input[type=\'number\']{\n height: 28px;\n margin-top: 0;\n margin-bottom: 0 !important;\n color: #ffffff;\n background-color: #242b38;\n border-color: #ebebeb;\n }\n }\n .delete-blur{\n color: #EB602D;\n cursor: pointer;\n }\n }\n .addcallout-control-detail{\n .callout-btn-container{\n .se-callout-btn{\n filter: invert(1);\n }\n }\n }\n .addcallout-control-detail{\n .addcallout-selected{\n grid-template-columns: 2fr 1fr 1fr 0.6fr;\n }\n label[for="callout-lock"]{\n margin-left: 6px;\n color: #C7CBD7;\n }\n span{\n display: block;\n margin-top: 7px;\n color: #C7CBD7 !important;\n line-height: normal;\n }\n .se-callout-internal{\n grid-template-columns: 1fr 1.5fr;\n div{\n &:first-of-type{\n padding-right: 8px;\n text-align: right;\n }\n }\n select.callout-control{\n width: 100%;\n margin-bottom: 0;\n padding: 6px 4px;\n color: #ffffff;\n background-color: #1E2126;\n border: 1px solid #363E4E;\n border-radius: 4px;\n outline: none;\n -webkit-appearance: auto !important;\n -moz-appearance: auto !important;\n }\n }\n .delete-callout{\n color: #EB602D;\n cursor: pointer;\n }\n }\n .addsticker-control-detail{\n .addsticker-selected{\n &>div{\n display: inline-block;\n vertical-align: middle;\n &:first-of-type{\n width: 50%;\n }\n &:nth-of-type(2){\n width: 35%;\n &>div{\n display: inline-block;\n vertical-align: middle;\n }\n }\n &:last-of-type{\n width: 15%;\n }\n }\n label[for="sticker-lock"]{\n margin-left: 6px;\n color: #C7CBD7;\n }\n span{\n display: block;\n color: #C7CBD7 !important;\n line-height: normal;\n }\n select.sticker-control{\n width: 90px;\n margin-bottom: 0;\n padding: 6px 4px;\n color: #ffffff;\n background-color: #1E2126;\n border: 1px solid #363E4E;\n border-radius: 4px;\n outline: none;\n -webkit-appearance: auto !important;\n -moz-appearance: auto !important;\n }\n .delete-label{\n color: #EB602D;\n cursor: pointer;\n }\n }\n }\n }\n'])),(function(e){return e.isFromDynamicInteg?"100%":"85%"}),(function(e){return e.showSimpleEditor?"38px":"0"})),Se=t(9198),Fe=t(13919);function Le(e,i){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,i){if(e){if("string"==typeof e)return _e(e,i);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_e(e,i):void 0}}(e))||i&&e&&"number"==typeof e.length){t&&(e=t);var o=0,s=function(){};return{s:s,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,r=!0,n=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return r=e.done,e},e:function(e){n=!0,a=e},f:function(){try{r||null==t.return||t.return()}finally{if(n)throw a}}}}function _e(e,i){(null==i||i>e.length)&&(i=e.length);for(var t=0,o=new Array(i);t<i;t++)o[t]=e[t];return o}function Re(e,i){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);i&&(o=o.filter((function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable}))),t.push.apply(t,o)}return t}function Ee(e){var i=e.videoPlayerView,t=e.token,r=e.tokenType,n=e.recorder,l=e.recorderApiModel,d=e.isPersonalisationEnabled,c=e.customColors,h=e.footageUrls,p=e.showSimpleEditor,u=e.projectJson,m=e.integrationType,f=e.onSimpleEditorInitialize,g=e.videoDetails,v=e.isFromDynamicInteg,b=g||n.recordDetails,w=(0,a.useState)(b),C=w[0],k=w[1],x=(0,a.useContext)(Pe.Z).recorderInitOptions.edit,P=(0,Se._e)(),V=(0,a.useRef)(!1),$=(0,a.useRef)(),T=(0,a.useRef)(u),I=(0,a.useRef)();return(0,a.useEffect)((function(){if(!C||!C.asset_id)return n.getRecordDetails().then((function(e){k(e)})).catch((function(e){console.error("ERROR IN GETTING RECORD DETAILS ",e)})),function(){n.cancelGetRecordDetails()}}),[n]),(0,a.useEffect)((function(){$.current&&($.current.innerHTML+=xe()(Fe.extend($e(),function(e){for(var i=1;i<arguments.length;i++){var t=null!=arguments[i]?arguments[i]:{};i%2?Re(Object(t),!0).forEach((function(i){(0,o.Z)(e,i,t[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Re(Object(t)).forEach((function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))}))}return e}({shouldHideTrimTimer:"true",integrationType:m,canShowPersonalization:d,mfValues:y().personalization.defaultMergeFields,origin:P},function(){try{var e={};if(x&&"object"===(0,s.Z)(x)&&null!==x)for(var i in x)!1!==x[i]&&"false"!==x[i]||(e[i]="false");return e}catch(e){return{}}}()))),V.current=!0)}),[$]),(0,a.useEffect)((function(){i&&$.current&&C&&V.current&&function(){if(C.asset_id){var e={el:$.current,fromSDK:!0,videoPlayerView:i,integration_type:m,assetId:C&&C.asset_id,token:t,tokenType:r,recorder:n,recorderApiModel:l,isBlurEnabled:!0,embeddedDigest:C&&C.delivery_token,isPersonalizationEnabled:d,customColors:c,authoringId:C&&C.authoring_id,footageUrls:h};I.current?I.current.initialize(e):I.current=new Ce(e),f&&f(I.current)}}()}),[i,$,C,V]),(0,a.useEffect)((function(){if(I.current&&I.current.projectJson)if(p){I.current.enable();var e,i=Le($.current.getElementsByClassName("simple-edit-container"));try{for(i.s();!(e=i.n()).done;)e.value.classList.remove("hide")}catch(e){i.e(e)}finally{i.f()}I.current.height="140px"}else{var t,o=Le($.current.getElementsByClassName("simple-edit-container"));try{for(o.s();!(t=o.n()).done;)t.value.classList.add("hide")}catch(e){o.e(e)}finally{o.f()}I.current.height="0"}}),[p]),(0,a.useEffect)((function(){return T.current=u,u&&I.current&&i&&(setTimeout((function(){I.current.setProjectJson(u)}),300),i.show()),function(){}}),[u]),(0,a.useEffect)((function(){I.current&&i&&T.current&&(setTimeout((function(){I.current.setProjectJson(u)}),300),i.show())}),[I,i]),a.createElement(Ie,{showSimpleEditor:!0,ref:$,isFromDynamicInteg:v})}},46102:function(){}}]);
|