@brightspot/ui 6.0.4-pr.228.1 → 6.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/custom-elements.json +237 -237
- package/dist/storybook/assets/{ActionBar.stories-B3W9l3sW.js → ActionBar.stories-BSwwf2PX.js} +1 -1
- package/dist/storybook/assets/{ActionItem.stories-Bgq9Si14.js → ActionItem.stories-SCIA5Rt0.js} +1 -1
- package/dist/storybook/assets/{AiSparkle.stories-BvZZGCv0.js → AiSparkle.stories-ByeiNU3G.js} +1 -1
- package/dist/storybook/assets/{Avatar.stories-DKefO8vf.js → Avatar.stories-1EUJytBr.js} +1 -1
- package/dist/storybook/assets/{AvatarGroup.stories-DLU0xm5i.js → AvatarGroup.stories-Bstlt4go.js} +1 -1
- package/dist/storybook/assets/{Badge.stories-DYf4buS2.js → Badge.stories-X7m0Vl2G.js} +1 -1
- package/dist/storybook/assets/{Banner.stories-kvxGWQ8i.js → Banner.stories-ljxjOtEc.js} +1 -1
- package/dist/storybook/assets/{Button-QbHhnaex.js → Button-Dbpmp5Ih.js} +1 -1
- package/dist/storybook/assets/{Button.stories-Cbc2kacG.js → Button.stories-C5qS3rIw.js} +1 -1
- package/dist/storybook/assets/{ButtonGroup.stories-BlMr_i2l.js → ButtonGroup.stories-Bl1Ko9jX.js} +1 -1
- package/dist/storybook/assets/{Card.stories-CXgpz0_-.js → Card.stories-CfFIzXg5.js} +1 -1
- package/dist/storybook/assets/{Celebrate.stories-DGuheVhJ.js → Celebrate.stories-TSJrIQR8.js} +1 -1
- package/dist/storybook/assets/{Checkbox.stories-D5gjg3gd.js → Checkbox.stories-DUpT9Iwh.js} +1 -1
- package/dist/storybook/assets/{CircularProgress.stories-BtEajA8s.js → CircularProgress.stories-usNosiIU.js} +1 -1
- package/dist/storybook/assets/{ClipboardMixin.stories-CVWhGXfx.js → ClipboardMixin.stories-0jnZ0Drs.js} +1 -1
- package/dist/storybook/assets/{Color-6BZIO3FS-Cy2iWC0B.js → Color-6BZIO3FS-C6ecAOER.js} +1 -1
- package/dist/storybook/assets/{Colors.stories-lMKhdwtD.js → Colors.stories-DcbIlkPs.js} +1 -1
- package/dist/storybook/assets/{CombinedEffects.stories-GYFjehaD.js → CombinedEffects.stories-CU-hwRPT.js} +1 -1
- package/dist/storybook/assets/{ComponentStatesMixin-Cxyscq1q.js → ComponentStatesMixin-Dcz-J-hg.js} +1 -1
- package/dist/storybook/assets/{ComponentStatesMixin.stories-Czvdt00v.js → ComponentStatesMixin.stories-orhdmIUX.js} +1 -1
- package/dist/storybook/assets/{CopyToClipboard.stories-EYf9o4P1.js → CopyToClipboard.stories-D1R2yCQL.js} +1 -1
- package/dist/storybook/assets/{Debounce.stories-B4zKKGEF.js → Debounce.stories-6z8aEn7O.js} +1 -1
- package/dist/storybook/assets/{DocsRenderer-LL677BLK-BTEtWPBs.js → DocsRenderer-LL677BLK-B-fTNYB5.js} +3 -3
- package/dist/storybook/assets/{Dropdown.stories-WQFH9gjF.js → Dropdown.stories-CeVpVPrP.js} +1 -1
- package/dist/storybook/assets/{EmptyState.stories-CtZTgOyf.js → EmptyState.stories-DdCyApUP.js} +1 -1
- package/dist/storybook/assets/{EscaAvatar.stories-PJbKYuIx.js → EscaAvatar.stories-DNK85ssI.js} +1 -1
- package/dist/storybook/assets/{Events.stories-CED0yKoW.js → Events.stories-B1qeq2wy.js} +1 -1
- package/dist/storybook/assets/{Heading.stories-Yo84UBrv.js → Heading.stories-DRu5hUyJ.js} +1 -1
- package/dist/storybook/assets/{HueRipple.stories-DQaK4bfx.js → HueRipple.stories-D3zqVZWM.js} +1 -1
- package/dist/storybook/assets/{Icon.stories-BLBUeiJt.js → Icon.stories-CKG5fIIH.js} +1 -1
- package/dist/storybook/assets/{IconButton.stories-DE-AWDCu.js → IconButton.stories-B3RZKBqV.js} +1 -1
- package/dist/storybook/assets/{LinearProgress.stories-BMOO9ziw.js → LinearProgress.stories-BPvFKGi0.js} +1 -1
- package/dist/storybook/assets/{Message.stories-CQ4FeNtL.js → Message.stories-Dq3YDccT.js} +1 -1
- package/dist/storybook/assets/{OnFindMixin.stories-BgF86VyY.js → OnFindMixin.stories-qKTooUKN.js} +1 -1
- package/dist/storybook/assets/{Pagination.stories-BQz3D7WR.js → Pagination.stories-BaFWcckS.js} +1 -1
- package/dist/storybook/assets/{Popover.stories-BySl8X_V.js → Popover.stories-DlHlfWrk.js} +1 -1
- package/dist/storybook/assets/{ReadyMixin-ZKicHfUd.js → ReadyMixin-BQ-q8NO4.js} +1 -1
- package/dist/storybook/assets/{RovingTabindexMixin.stories-DSHo6CDn.js → RovingTabindexMixin.stories-CQkteE6h.js} +1 -1
- package/dist/storybook/assets/{Rtc.stories-k6JRiPH-.js → Rtc.stories-BWBDrPM8.js} +1 -1
- package/dist/storybook/assets/{ScrollShadow.stories-DC0FuAGC.js → ScrollShadow.stories-BtM7Q6Ys.js} +1 -1
- package/dist/storybook/assets/{Switch.stories-wOpKQIoZ.js → Switch.stories-Ys6MzOf7.js} +1 -1
- package/dist/storybook/assets/{Tab.stories-48kIvcjq.js → Tab.stories-CNIDOscR.js} +1 -1
- package/dist/storybook/assets/{Tabs.stories-BOy2M1hf.js → Tabs.stories-oAxuRqKE.js} +1 -1
- package/dist/storybook/assets/{Throttle.stories-nWsWmaUP.js → Throttle.stories-D2nPrZEL.js} +1 -1
- package/dist/storybook/assets/{Tooltip.stories-lw4S0OCL.js → Tooltip.stories-DJhjWYNV.js} +1 -1
- package/dist/storybook/assets/{Upload.stories-CT96w70S.js → Upload.stories-DBveASQF.js} +1 -1
- package/dist/storybook/assets/{UploadItem.stories-DAQ0uKRd.js → UploadItem.stories-Co5bGJs6.js} +1 -1
- package/dist/storybook/assets/{Welcome.stories-D_tWLJfQ.js → Welcome.stories-Cls_kv8A.js} +1 -1
- package/dist/storybook/assets/{Widget.stories-Vklgd-HE.js → Widget.stories-CXpqw5z8.js} +1 -1
- package/dist/storybook/assets/{WithTooltip-65CFNBJE-CkTzfxlJ.js → WithTooltip-65CFNBJE-Ik6o5Ygb.js} +1 -1
- package/dist/storybook/assets/{blocks-Dcu5vb5v.js → blocks-DjXAnVrm.js} +5 -5
- package/dist/storybook/assets/{formatter-EIJCOSYU-Dv3UXZl_.js → formatter-EIJCOSYU-CQXaWVan.js} +1 -1
- package/dist/storybook/assets/if-defined-BVO6TNCy.js +1 -0
- package/dist/storybook/assets/{iframe-DUPD-I_r.js → iframe-D43T7JCn.js} +4 -4
- package/dist/storybook/assets/{index-DonibaDQ.js → index-DIk8fbbl.js} +1 -1
- package/dist/storybook/assets/onFind-CamigPPi.js +1 -0
- package/dist/storybook/assets/{onFind.stories-CUNfMRDo.js → onFind.stories-DgxMtTTG.js} +20 -20
- package/dist/storybook/assets/{onRemove.stories-SA3czp21.js → onRemove.stories-DltMfNLX.js} +1 -1
- package/dist/storybook/assets/{onVisible.stories-BaKmrATX.js → onVisible.stories-x3VhGAuF.js} +1 -1
- package/dist/storybook/assets/{style-map-DcmF1KuF.js → style-map-C5J-rKx9.js} +1 -1
- package/dist/storybook/assets/{syntaxhighlighter-ED5Y7EFY-CgbdQuEL.js → syntaxhighlighter-ED5Y7EFY-CphVNry2.js} +1 -1
- package/dist/storybook/iframe.html +1 -1
- package/dist/storybook/project.json +1 -1
- package/dist/util/onFind.d.ts.map +1 -1
- package/dist/util/onFind.js +66 -137
- package/dist/util/onFind.js.map +1 -1
- package/package.json +1 -1
- package/src/legacy/tool-ui/src/dom/onFind.ts +270 -29
- package/src/legacy/tool-ui/src/main/webapp/dist/{2111.efb40a1ab7d6b02913dd.js → 2111.3956b5196a514b2c0131.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{2456.2c20c3564647ca071b26.js → 2456.5bcfb782c2ec27de32ed.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{2537.a4d0a358f9c1a60ebc68.js → 2537.e8f1359bedd328bf57f4.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{270.8fb1c93bc009582a32cd.js → 270.3011484ff80f3093083a.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{2825.9c2b897f2a3799dcbd19.js → 2825.c1342ac2662d11fd4125.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{2947.52cb126b0e2ab4415189.js → 2947.f96d21c44c05980974ef.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{3532.ed7716198932139a4fb1.js → 3532.c358dfbb2cde0f802c7f.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{3543.c62d88fc2904cccc7e64.js → 3543.2d704cf9e170322468e7.js} +2 -2
- package/src/legacy/tool-ui/src/main/webapp/dist/{3611.5466757310c53bea4b6e.js → 3611.61837ffa933f74502094.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/4114.57fe159e416e716f8cbc.js +1 -0
- package/src/legacy/tool-ui/src/main/webapp/dist/{4374.a2ea1952e2daf222dc20.js → 4374.37147747a254da8f5f8a.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{4450.9eaca48c71e3dfb64a45.js → 4450.16dd5684292fd0a7ea7f.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{4478.3c6e9704ad67996b53a8.js → 4478.93f64e6a6ccb35a6c6d4.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/4582.243dbaa3d8a8648f6f40.js +1 -0
- package/src/legacy/tool-ui/src/main/webapp/dist/{4790.ff3be0fd92b8d7422ae0.js → 4790.10d75f7c7f8e54ce83a1.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/4795.034ebc93a67b7a3d6536.js +1 -0
- package/src/legacy/tool-ui/src/main/webapp/dist/{5098.36bb17ff636e87930c6c.js → 5098.33613009827cfc80aafb.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{5385.a7d0efb64a5e06173012.js → 5385.6656501b67424994820b.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{5598.2f1f3ddbbaefdc2fce5a.js → 5598.d84773ca53126661bdca.js} +2 -2
- package/src/legacy/tool-ui/src/main/webapp/dist/{5617.96a2611314c9148efa9c.js → 5617.c81ecb679371ca302f1f.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{7175.43f44b9e832f6734d8ea.js → 5718.449113ae2463a3bb8a83.js} +2 -2
- package/src/legacy/tool-ui/src/main/webapp/dist/{1478.b8f12bb302ba4337da4c.js → 6086.7ca02b827506f29db590.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{6216.3ad86a4e1c11cd87b2cc.js → 6216.2d532054fcb8e634f96b.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{6497.17547f58bb12eb6df22d.js → 6497.b7d8dcbf0e7c8d8d538d.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{6565.9abec7b54647bee08edc.js → 6565.0e5abc3bd344c53ae154.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{1536.9b3398bf3ebc2f20f009.js → 7033.4cd6efbe12e7aaa35745.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{7202.237027436f4c50941edf.js → 7202.1e5b8f21215ea6eae20a.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{6664.ec6ef73e3bb33125bd4c.js → 7361.793163ca71dfac69d9eb.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{7524.ae0837d4dafc92523de7.js → 7524.2990be869cf0a2988d17.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{7741.84e705c31c3ebc66db92.js → 7741.0b2789c4e783af835763.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{7863.043ee730e243753af268.js → 7863.2a1d1fd229778a47e10b.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{8752.3e4315bdb4ad40297406.js → 8752.3d02a0f42ec39786fdf0.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{8897.b12d749c9564eaa0c945.js → 8897.bfeed19f2a4acbb6d67c.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{8934.9f3371f510334b7bae6d.js → 8934.e90ceca8169fc25e4e1b.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{9277.385ca94e4e3722d25e81.js → 9277.88b2d89b3ba1c24e7f93.js} +2 -2
- package/src/legacy/tool-ui/src/main/webapp/dist/{9360.269cf0d9b358dcf52f55.js → 9360.bb0352313d610cae11de.js} +2 -2
- package/src/legacy/tool-ui/src/main/webapp/dist/{9576.18cf577b8886dd85372e.js → 9576.174d6a99544d17e7416d.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/Appetizeio.185641211f7c0e42a455.js +1 -0
- package/src/legacy/tool-ui/src/main/webapp/dist/CISpectrum.74db7dc80b3a6797a167.js +1 -0
- package/src/legacy/tool-ui/src/main/webapp/dist/{CodeMirror.2fda1e731cfcb7bec629.js → CodeMirror.5ddffe054374f883d6f8.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{ImageEditor.a6da6e88cc958354ec68.js → ImageEditor.14e3b3035666436f53a5.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/RTEProseMirror.24cbb57c0030725925a0.js +500 -0
- package/src/legacy/tool-ui/src/main/webapp/dist/TimedContent.4bb4dc83ffbe4019dd7b.js +1 -0
- package/src/legacy/tool-ui/src/main/webapp/dist/{VideoEditor.c183998c7b2b0dae98f6.js → VideoEditor.11c89dda5cf125738a33.js} +2 -2
- package/src/legacy/tool-ui/src/main/webapp/dist/{v4.18729ea4f861ad351303.js → v4.e496a62fb1d4be0544d4.js} +9 -9
- package/src/legacy/tool-ui/src/main/webapp/dist/{v5.beb4fdae5f572ba09fa3.js → v5.1711204aaf6c5fa01b1b.js} +8 -8
- package/dist/storybook/assets/if-defined-Ct57L3GT.js +0 -1
- package/dist/storybook/assets/onFind-BCF79WfX.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/3409.8e764d5fa8e2c2cf4d00.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/4795.d4ba3cc84dbf7e58fecb.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/5306.b41630da0d1df3453bc0.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/6996.f0fbe667259b36548b69.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/8430.0e134152362fff9ad9d0.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/Appetizeio.47287ce7992dc52bcb47.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/CISpectrum.45b362ff7dbae9d80cd9.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/RTEProseMirror.5a8f4754ee77adc85db2.js +0 -500
- package/src/legacy/tool-ui/src/main/webapp/dist/TimedContent.2d0ed03e8d1c994ecfb2.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/bsp-rings-bg.svg +0 -9
- /package/src/legacy/tool-ui/src/main/webapp/dist/{3543.c62d88fc2904cccc7e64.js.LICENSE.txt → 3543.2d704cf9e170322468e7.js.LICENSE.txt} +0 -0
- /package/src/legacy/tool-ui/src/main/webapp/dist/{5598.2f1f3ddbbaefdc2fce5a.js.LICENSE.txt → 5598.d84773ca53126661bdca.js.LICENSE.txt} +0 -0
- /package/src/legacy/tool-ui/src/main/webapp/dist/{7175.43f44b9e832f6734d8ea.js.LICENSE.txt → 5718.449113ae2463a3bb8a83.js.LICENSE.txt} +0 -0
- /package/src/legacy/tool-ui/src/main/webapp/dist/{9277.385ca94e4e3722d25e81.js.LICENSE.txt → 9277.88b2d89b3ba1c24e7f93.js.LICENSE.txt} +0 -0
- /package/src/legacy/tool-ui/src/main/webapp/dist/{9360.269cf0d9b358dcf52f55.js.LICENSE.txt → 9360.bb0352313d610cae11de.js.LICENSE.txt} +0 -0
- /package/src/legacy/tool-ui/src/main/webapp/dist/{RTEProseMirror.5a8f4754ee77adc85db2.js.LICENSE.txt → RTEProseMirror.24cbb57c0030725925a0.js.LICENSE.txt} +0 -0
- /package/src/legacy/tool-ui/src/main/webapp/dist/{VideoEditor.c183998c7b2b0dae98f6.js.LICENSE.txt → VideoEditor.11c89dda5cf125738a33.js.LICENSE.txt} +0 -0
- /package/src/legacy/tool-ui/src/main/webapp/dist/{v4.18729ea4f861ad351303.js.LICENSE.txt → v4.e496a62fb1d4be0544d4.js.LICENSE.txt} +0 -0
- /package/src/legacy/tool-ui/src/main/webapp/dist/{v5.beb4fdae5f572ba09fa3.js.LICENSE.txt → v5.1711204aaf6c5fa01b1b.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkbrightspot_cms=self.webpackChunkbrightspot_cms||[]).push([[2415],{56155(e,t,n){n.d(t,{A:()=>E}),n(44764),n(84978),n(13722),n(91672),n(92280);var r=n(59314),o=n.n(r);function i(e,t,n){a(e,t),t.set(e,n)}function a(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function l(e,t){return e.get(c(e,t))}function s(e,t,n){return e.set(c(e,t),n),n}function c(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}let d=0;var u=new WeakMap,m=new WeakMap,f=new WeakMap,p=new WeakMap,h=new WeakMap,y=new WeakSet;class v{constructor(e,t,n){var r;a(this,r=y),r.add(this),i(this,u,void 0),i(this,m,void 0),i(this,f,void 0),i(this,p,void 0),i(this,h,void 0),s(u,this,e),s(m,this,"data-ofc"+d++),Array.isArray(t)||(t=[t]),s(f,this,t.map(t.some(e=>e.indexOf(",")>-1)?e=>e:e=>`${e}:not([${l(m,this)}])`).join(",")),s(p,this,n);const o=t.map(e=>e.trim()).filter(e=>e.indexOf(" ")<0&&e.indexOf(",")<0);o.length===t.length&&s(h,this,o)}addTriggerElements(e,t){if(l(u,this).contains(t)){t.matches(l(f,this))&&e.push(t);for(const n of t.querySelectorAll(l(f,this)))e.push(n)}}trigger(e){if("loading"!==document.readyState)if(l(h,this)&&Array.isArray(e))for(const t of e)l(h,this).some(e=>t.matches(e))&&c(y,this,g).call(this,t);else for(const e of l(u,this).querySelectorAll(l(f,this)))c(y,this,g).call(this,e)}}function g(e){if(!k(e)&&!e.hasAttribute(l(m,this))){e.setAttribute(l(m,this),"");try{l(p,this).call(this,e)}catch(t){o().error("Failed callback!",e,t)}}}let b,C=!1,T=!1,w=!1,x=[];const P=[];function k(e){return e instanceof Element&&(null!==e.closest(".CIG-wordCount")||null!==e.closest(".ContentEdit-previewDisplay")||null!==e.closest(".ContentLabel")||null!==e.closest(".PreviewFrame-typeDisplay")||null!==e.closest(".ProseMirrorToolbar")||null!==e.closest(".ProseMirror")||null!==e.closest(".ProseMirrorContainer")||null!==e.closest(".ProseMirror-fullscreen-container")||null!==e.closest(".ProseMirror-comments")||null!==e.closest(".RichTextEditor")||null!==e.closest(".WorkInProgressSaveStatus")||null!==e.closest("#aria-live-container")||null!==e.closest(".widget-urlsAutomatic"))}const N=Array.prototype.every,A=e=>e.nodeType===Node.TEXT_NODE;function S(e){if(C)return void(T=!0);const t=Array.isArray(e),n=[];if(t){for(const t of e){const e=t.target;if(!k(e))switch(t.type){case"attributes":t.oldValue!==e.getAttribute(t.attributeName)&&n.push(t);break;case"childList":N.call(t.addedNodes,A)&&N.call(t.removedNodes,A)||n.push(t)}}if(0===n.length)return}if(n.length>500&&(w=!0),!w)if(t)for(const e of n){const t=e.target;switch(e.type){case"attributes":x.push(t);break;case"childList":for(const e of P)e.addTriggerElements(x,t)}}else w=!0;(w||x.length>0)&&!b&&(b=window.requestAnimationFrame(()=>{const e=w?void 0:x;w=!1,x=[],b=0,P.forEach(t=>t.trigger(e))}))}function I(){document.documentElement.hidden=!1,S(),new MutationObserver(S).observe(document,{attributes:!0,attributeFilter:["class","data-bsp-autosubmit","data-chart-type","data-code-type","data-internal-name","data-tab","name","rel","target"],attributeOldValue:!0,childList:!0,subtree:!0})}function M(e,t,n){let r,o;void 0!==n?(r=e,o=t):(r=document,o=e,n=t);const i=new v(r,o,n);i.trigger(),P.push(i)}document.documentElement.hidden=!0,"loading"===document.readyState?document.addEventListener("DOMContentLoaded",I):I(),M.triggerCallbacks=S,M.pause=()=>{C=!0},M.resume=()=>{C=!1,T&&(T=!1,setTimeout(S,100))};const E=7717==n.j?M:null},91762(e,t,n){n.d(t,{A:()=>E}),n(57573),n(49371),n(42723),n(56065),n(56673);var r=n(23707),o=n.n(r);function i(e,t,n){a(e,t),t.set(e,n)}function a(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function l(e,t){return e.get(c(e,t))}function s(e,t,n){return e.set(c(e,t),n),n}function c(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}let d=0;var u=new WeakMap,m=new WeakMap,f=new WeakMap,p=new WeakMap,h=new WeakMap,y=new WeakSet;class v{constructor(e,t,n){var r;a(this,r=y),r.add(this),i(this,u,void 0),i(this,m,void 0),i(this,f,void 0),i(this,p,void 0),i(this,h,void 0),s(u,this,e),s(m,this,"data-ofc"+d++),Array.isArray(t)||(t=[t]),s(f,this,t.map(t.some(e=>e.indexOf(",")>-1)?e=>e:e=>`${e}:not([${l(m,this)}])`).join(",")),s(p,this,n);const o=t.map(e=>e.trim()).filter(e=>e.indexOf(" ")<0&&e.indexOf(",")<0);o.length===t.length&&s(h,this,o)}addTriggerElements(e,t){if(l(u,this).contains(t)){t.matches(l(f,this))&&e.push(t);for(const n of t.querySelectorAll(l(f,this)))e.push(n)}}trigger(e){if("loading"!==document.readyState)if(l(h,this)&&Array.isArray(e))for(const t of e)l(h,this).some(e=>t.matches(e))&&c(y,this,g).call(this,t);else for(const e of l(u,this).querySelectorAll(l(f,this)))c(y,this,g).call(this,e)}}function g(e){if(!k(e)&&!e.hasAttribute(l(m,this))){e.setAttribute(l(m,this),"");try{l(p,this).call(this,e)}catch(t){o().error("Failed callback!",e,t)}}}let b,C=!1,T=!1,w=!1,x=[];const P=[];function k(e){return e instanceof Element&&(null!==e.closest(".CIG-wordCount")||null!==e.closest(".ContentEdit-previewDisplay")||null!==e.closest(".ContentLabel")||null!==e.closest(".PreviewFrame-typeDisplay")||null!==e.closest(".ProseMirrorToolbar")||null!==e.closest(".ProseMirror")||null!==e.closest(".ProseMirrorContainer")||null!==e.closest(".ProseMirror-fullscreen-container")||null!==e.closest(".ProseMirror-comments")||null!==e.closest(".RichTextEditor")||null!==e.closest(".WorkInProgressSaveStatus")||null!==e.closest("#aria-live-container")||null!==e.closest(".widget-urlsAutomatic"))}const N=Array.prototype.every,A=e=>e.nodeType===Node.TEXT_NODE;function S(e){if(C)return void(T=!0);const t=Array.isArray(e),n=[];if(t){for(const t of e){const e=t.target;if(!k(e))switch(t.type){case"attributes":t.oldValue!==e.getAttribute(t.attributeName)&&n.push(t);break;case"childList":N.call(t.addedNodes,A)&&N.call(t.removedNodes,A)||n.push(t)}}if(0===n.length)return}if(n.length>500&&(w=!0),!w)if(t)for(const e of n){const t=e.target;switch(e.type){case"attributes":x.push(t);break;case"childList":for(const e of P)e.addTriggerElements(x,t)}}else w=!0;(w||x.length>0)&&!b&&(b=window.requestAnimationFrame(()=>{const e=w?void 0:x;w=!1,x=[],b=0,P.forEach(t=>t.trigger(e))}))}function I(){document.documentElement.hidden=!1,S(),new MutationObserver(S).observe(document,{attributes:!0,attributeFilter:["class","data-bsp-autosubmit","data-chart-type","data-code-type","data-internal-name","data-tab","name","rel","target"],attributeOldValue:!0,childList:!0,subtree:!0})}function M(e,t,n){let r,o;void 0!==n?(r=e,o=t):(r=document,o=e,n=t);const i=new v(r,o,n);i.trigger(),P.push(i)}document.documentElement.hidden=!0,"loading"===document.readyState?document.addEventListener("DOMContentLoaded",I):I(),M.triggerCallbacks=S,M.pause=()=>{C=!0},M.resume=()=>{C=!1,T&&(T=!1,setTimeout(S,100))};const E=3324==n.j?M:null},55603(e,t,n){n.r(t),n(84978),n(39589);var r=n(32246),o=n(1439);const i=".inputContainer-TimedContentPlayerNote-player-visible",a=".TimedContentPlayerNote",l=".TimedCompanionSelector",s=".timed",c="pause"+s,d="timeUpdate"+s,u="seek"+s,m="destroy"+s,f='textarea[name$="offsetLabel"]';(0,r.A)(".TimedContentPlayerNote",e=>{let t=o(e),n=t.closest(".inputContainer"),r=t.find(a+"-thumbnail"),s=t.find(a+"-thumbnail-link"),p=t.find(a+"-player"),h=t.find(a+"-player-frame"),y=t.find(a+"-player-close");if(t.find(l).length>0){let t=o(e).find(l+"-controls-timestamp"),r=o(e).find(l+"-controls-button");n.on(d,function(e,n){t.attr("data-ts",n),t.attr("data-ts-formatted",v(n)),t.html("@ "+v(n))}),r.on("click",function(e){e.preventDefault(),h.trigger(c);let n=o(this).closest(i).find("> .repeatableForm"),r=n.find("> ol").first(),a=r.find("li").size();n.find("> .addButtonContainer .addButton").click();let l=setInterval(function(){let e=r.find("li");e.size()>a&&(clearInterval(l),e.last().find(f).val(t.attr("data-ts-formatted")))},200)}),n.on("click",".TimedCompanionJumpToTimeAction",function(e){return e.preventDefault(),h.trigger(u,o(this).attr("data-ts")),!1}),n.on("click",".TimedCompanionSyncAction",function(e){e.preventDefault(),h.trigger(c);let n=t.attr("data-ts-formatted");return o(this).closest(".inputContainer").find(f).val(n).trigger("change"),!1})}function v(e){let t=e%60,n=(e=Math.floor(e/60))%60,r=Math.floor(e/60);return t<10&&(t="0"+t),r>0?r+":"+n+":"+t:n+":"+t}y.on("click",function(e){h.trigger(m),p.hide().find(".frame").empty(),r.show(),n.removeClass(i.substring(1))}),s.on("click",function(e){return e.preventDefault(),r.hide(),p.show(),n.addClass(i.substring(1)),!0})})},26602(e,t,n){n.r(t),n(49371),n(26780);var r=n(45055),o=n(88630);const i=".inputContainer-TimedContentPlayerNote-player-visible",a=".TimedContentPlayerNote",l=".TimedCompanionSelector",s=".timed",c="pause"+s,d="timeUpdate"+s,u="seek"+s,m="destroy"+s,f='textarea[name$="offsetLabel"]';(0,r.A)(".TimedContentPlayerNote",e=>{let t=o(e),n=t.closest(".inputContainer"),r=t.find(a+"-thumbnail"),s=t.find(a+"-thumbnail-link"),p=t.find(a+"-player"),h=t.find(a+"-player-frame"),y=t.find(a+"-player-close");if(t.find(l).length>0){let t=o(e).find(l+"-controls-timestamp"),r=o(e).find(l+"-controls-button");n.on(d,function(e,n){t.attr("data-ts",n),t.attr("data-ts-formatted",v(n)),t.html("@ "+v(n))}),r.on("click",function(e){e.preventDefault(),h.trigger(c);let n=o(this).closest(i).find("> .repeatableForm"),r=n.find("> ol").first(),a=r.find("li").size();n.find("> .addButtonContainer .addButton").click();let l=setInterval(function(){let e=r.find("li");e.size()>a&&(clearInterval(l),e.last().find(f).val(t.attr("data-ts-formatted")))},200)}),n.on("click",".TimedCompanionJumpToTimeAction",function(e){return e.preventDefault(),h.trigger(u,o(this).attr("data-ts")),!1}),n.on("click",".TimedCompanionSyncAction",function(e){e.preventDefault(),h.trigger(c);let n=t.attr("data-ts-formatted");return o(this).closest(".inputContainer").find(f).val(n).trigger("change"),!1})}function v(e){let t=e%60,n=(e=Math.floor(e/60))%60,r=Math.floor(e/60);return t<10&&(t="0"+t),r>0?r+":"+n+":"+t:n+":"+t}y.on("click",function(e){h.trigger(m),p.hide().find(".frame").empty(),r.show(),n.removeClass(i.substring(1))}),s.on("click",function(e){return e.preventDefault(),r.hide(),p.show(),n.addClass(i.substring(1)),!0})})},32246(e,t,n){n.d(t,{A:()=>r.A});var r=n(56155)},45055(e,t,n){n.d(t,{A:()=>r.A});var r=n(91762)},17497(e,t,n){n.d(t,{A:()=>l});var r=n(64664),o=n.n(r),i=n(25243),a=n.n(i)()(o());a.push([e.id,'.TimedContentPlayerNote{--TimedContent-player-maxWidth:500px;--TimedContent-player-maxHeight:300px;position:relative}[dir] .TimedContentPlayerNote{padding-top:var(--gap-m)}.inputContainer-TimedContentPlayerNote-player-visible .TimedContentPlayerNote{top:calc(-1 * var(--gap-xl))}[dir] .inputContainer-TimedContentPlayerNote-player-visible .TimedContentPlayerNote{margin-bottom:calc(-1 * var(--gap-m))}[dir] .CIG-row[data-field=timedCompanions] .Sortable,[dir] .inputContainer-TimedContentPlayerNote-player-visible .Sortable{box-shadow:var(--shadow-1)}[dir] .CIG-row[data-field=timedCompanions] ol>li,[dir] .inputContainer-TimedContentPlayerNote-player-visible ol>li{border:none}.TimedContentPlayerNote-player-close{color:var(--color-black)}[dir] .TimedContentPlayerNote-player-close{cursor:pointer;margin-bottom:var(--gap-m)}[dir=ltr] .TimedContentPlayerNote-player-close{text-align:right}[dir=rtl] .TimedContentPlayerNote-player-close{text-align:left}.TimedContentPlayerNote-player-close:after{--Icon-fill:"FILL" 1;display:inline-block;font-family:Material Symbols Outlined;font-feature-settings:"liga";font-size:var(--Icon-size);-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-style:normal;font-variation-settings:var(--Icon-fill);font-weight:400;letter-spacing:normal;line-height:1;position:relative;text-rendering:optimizeLegibility;text-transform:none;top:calc((var(--Text-height) - var(--Icon-size)) / 2);vertical-align:top;white-space:nowrap;word-wrap:normal;content:"clear"}[dir] .TimedContentPlayerNote-player-close:after{transform:var(--Icon-transform)}[dir=ltr] .TimedContentPlayerNote-player-close:after{direction:ltr}[dir=rtl] .TimedContentPlayerNote-player-close:after{direction:rtl}.TimedContentPlayerNote-thumbnail-link{display:inline-block;position:relative}[dir] .TimedContentPlayerNote-thumbnail-link{cursor:pointer}.TimedContentPlayerNote-thumbnail-link:before{--Icon-fill:"FILL" 1;display:inline-block;font-family:Material Symbols Outlined;font-feature-settings:"liga";font-size:var(--Icon-size);-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-style:normal;font-variation-settings:var(--Icon-fill);font-weight:400;letter-spacing:normal;line-height:1;position:relative;text-rendering:optimizeLegibility;text-transform:none;top:calc((var(--Text-height) - var(--Icon-size)) / 2);vertical-align:top;white-space:nowrap;word-wrap:normal;color:var(--color-white);content:"play_circle";font-size:calc(var(--fontSize-xxl) * 2);opacity:.8;position:absolute;top:50%}[dir] .TimedContentPlayerNote-thumbnail-link:before{transform:var(--Icon-transform);text-shadow:0 0 var(--gap-s) var(--color-black)}[dir=ltr] .TimedContentPlayerNote-thumbnail-link:before{direction:ltr;left:50%;transform:translate(-50%,-50%)}[dir=rtl] .TimedContentPlayerNote-thumbnail-link:before{direction:rtl;right:50%;transform:translate(50%,-50%)}.TimedContentPlayerNote-thumbnail-link:hover:before{color:var(--color-gray2)}.TimedContentPlayerNote-thumbnail img{max-height:var(--TimedContent-player-maxHeight);max-width:var(--TimedContent-player-maxWidth)}.TimedContentPlayerNote-thumbnail-noimage{display:block;height:var(--TimedContent-player-maxHeight);max-width:calc(100vw - var(--CIG-padding) * 2);width:var(--TimedContent-player-maxWidth)}[dir] .TimedContentPlayerNote-thumbnail-noimage{background-color:var(--color-black)}.TimedContentPlayerNote-player{display:none}.TimedContentPlayerNote-player-close{display:block}.TimedContentPlayerNote-player-frame{display:flex;flex-direction:column;height:auto;justify-content:center;overflow:hidden;width:100%}[dir] .TimedContentPlayerNote-player-frame{border:1px solid var(--color-gray4)}.TimedContentPlayerNote-player-frame>.frame{position:relative;white-space:nowrap}[dir] .TimedContentPlayerNote-player-frame>.frame{text-align:center}.TimedContentPlayerNote-player-control{display:none}.inputContainer-TimedContentPlayerNote-player-visible .TimedContentPlayerNote-player-control{display:inherit}[dir] .TimedContentPreview .TimedContentPlayerNote-player-frame{background-color:var(--color-black)}.TimedCompanionSelector{display:inline-block}[dir] .TimedCompanionSelector-player{background-color:var(--color-black)}[dir] .TimedCompanionSelector-controls{margin-top:var(--gap-m)}[dir=ltr] .TimedCompanionSelector-controls-timestamp{margin-left:var(--gap-m)}[dir=rtl] .TimedCompanionSelector-controls-timestamp{margin-right:var(--gap-m)}[dir] .TimedCompanionSelector .TimedContentPlayerNote-player-frame{background-color:transparent}[dir] .TimedCompanionSelector .addButtonContainer{padding-top:var(--gap-m)}.TimedCompanionSelector .addButtonContainer .addButton{font-size:medium}.Page-content.is-previewing .TimedContent-companions{display:block}@media (min-width:1201px){.TimedContentPlayerNote{--TimedContent-player-maxWidth:350px;--TimedContent-player-maxHeight:250px}.TimedContent-companions{display:grid;grid-template:"label label label" auto "note . companions" auto/minmax(0,1fr) var(--gap-s) minmax(0,1fr)}.TimedContent-companions>.CIG-label{grid-area:label}.TimedContent-companions>.CIG-note{grid-area:note}.TimedContent-companions>.CIG-large{grid-area:companions}[dir] .TimedContent-companions>.CIG-large{padding-top:var(--gap-m)}}.TimedContentIframeToolPlayer{height:var(--TimedContent-player-maxHeight);position:relative}.TimedContentIframeToolPlayer iframe{height:100%;max-width:100%;position:absolute;top:0;width:100%}[dir] .TimedContentIframeToolPlayer iframe{border-style:none}[dir=ltr] .TimedContentIframeToolPlayer iframe{left:0}[dir=rtl] .TimedContentIframeToolPlayer iframe{right:0}',""]);const l=7717==n.j?a:null},85010(e,t,n){n.d(t,{A:()=>l});var r=n(77473),o=n.n(r),i=n(12434),a=n.n(i)()(o());a.push([e.id,"",""]);const l=3324==n.j?a:null},25243(e){e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,r,o,i){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(r)for(var l=0;l<this.length;l++){var s=this[l][0];null!=s&&(a[s]=!0)}for(var c=0;c<e.length;c++){var d=[].concat(e[c]);r&&a[d[0]]||(void 0!==i&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=i),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),o&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=o):d[4]="".concat(o)),t.push(d))}},t}},12434(e){e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,r,o,i){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(r)for(var l=0;l<this.length;l++){var s=this[l][0];null!=s&&(a[s]=!0)}for(var c=0;c<e.length;c++){var d=[].concat(e[c]);r&&a[d[0]]||(void 0!==i&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=i),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),o&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=o):d[4]="".concat(o)),t.push(d))}},t}},64664(e){e.exports=function(e){return e[1]}},77473(e){e.exports=function(e){return e[1]}},43516(e,t,n){n.r(t),n.d(t,{default:()=>v});var r=n(96291),o=n.n(r),i=n(96918),a=n.n(i),l=n(77322),s=n.n(l),c=n(55800),d=n.n(c),u=n(10207),m=n.n(u),f=n(37746),p=n.n(f),h=n(17497),y={};y.styleTagTransform=p(),y.setAttributes=d(),y.insert=s().bind(null,"head"),y.domAPI=a(),y.insertStyleElement=m(),o()(h.A,y);const v=h.A&&h.A.locals?h.A.locals:void 0},27271(e,t,n){n.r(t),n.d(t,{default:()=>v});var r=n(67290),o=n.n(r),i=n(9727),a=n.n(i),l=n(6323),s=n.n(l),c=n(20610),d=n.n(c),u=n(97398),m=n.n(u),f=n(50555),p=n.n(f),h=n(85010),y={};y.styleTagTransform=p(),y.setAttributes=d(),y.insert=s().bind(null,"head"),y.domAPI=a(),y.insertStyleElement=m(),o()(h.A,y);const v=h.A&&h.A.locals?h.A.locals:void 0},96291(e){var t=[];function n(e){for(var n=-1,r=0;r<t.length;r++)if(t[r].identifier===e){n=r;break}return n}function r(e,r){for(var i={},a=[],l=0;l<e.length;l++){var s=e[l],c=r.base?s[0]+r.base:s[0],d=i[c]||0,u="".concat(c," ").concat(d);i[c]=d+1;var m=n(u),f={css:s[1],media:s[2],sourceMap:s[3],supports:s[4],layer:s[5]};if(-1!==m)t[m].references++,t[m].updater(f);else{var p=o(f,r);r.byIndex=l,t.splice(l,0,{identifier:u,updater:p,references:1})}a.push(u)}return a}function o(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,o){var i=r(e=e||[],o=o||{});return function(e){e=e||[];for(var a=0;a<i.length;a++){var l=n(i[a]);t[l].references--}for(var s=r(e,o),c=0;c<i.length;c++){var d=n(i[c]);0===t[d].references&&(t[d].updater(),t.splice(d,1))}i=s}}},67290(e){var t=[];function n(e){for(var n=-1,r=0;r<t.length;r++)if(t[r].identifier===e){n=r;break}return n}function r(e,r){for(var i={},a=[],l=0;l<e.length;l++){var s=e[l],c=r.base?s[0]+r.base:s[0],d=i[c]||0,u="".concat(c," ").concat(d);i[c]=d+1;var m=n(u),f={css:s[1],media:s[2],sourceMap:s[3],supports:s[4],layer:s[5]};if(-1!==m)t[m].references++,t[m].updater(f);else{var p=o(f,r);r.byIndex=l,t.splice(l,0,{identifier:u,updater:p,references:1})}a.push(u)}return a}function o(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,o){var i=r(e=e||[],o=o||{});return function(e){e=e||[];for(var a=0;a<i.length;a++){var l=n(i[a]);t[l].references--}for(var s=r(e,o),c=0;c<i.length;c++){var d=n(i[c]);0===t[d].references&&(t[d].updater(),t.splice(d,1))}i=s}}},77322(e){var t={};e.exports=function(e,n){var r=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},6323(e){var t={};e.exports=function(e,n){var r=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},10207(e){e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},97398(e){e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},55800(e,t,n){e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},20610(e,t,n){e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},96918(e){e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,o&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var i=n.sourceMap;i&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},9727(e){e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,o&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var i=n.sourceMap;i&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},37746(e){e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},50555(e){e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}}}]);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! For license information please see VideoEditor.
|
|
2
|
-
"use strict";(self.webpackChunkbrightspot_cms=self.webpackChunkbrightspot_cms||[]).push([[8863],{14932(e,t,i){function r(e,t){return e?(Array.isArray(t)&&(t=t.join(",")),e.closest(t)):null}i.d(t,{A:()=>r}),Object.defineProperty(r,"name",{value:"default",configurable:!0})},27741(e,t,i){function r(e,t){return e?(Array.isArray(t)&&(t=t.join(",")),e.closest(t)):null}i.d(t,{A:()=>r}),Object.defineProperty(r,"name",{value:"default",configurable:!0})},40627(e,t,i){function r(e,t){return e?(Array.isArray(t)&&(t=t.join(",")),e.querySelectorAll(t)):[]}i.d(t,{A:()=>r}),Object.defineProperty(r,"name",{value:"default",configurable:!0})},76394(e,t,i){function r(e,t){return e?(Array.isArray(t)&&(t=t.join(",")),e.querySelectorAll(t)):[]}i.d(t,{A:()=>r}),Object.defineProperty(r,"name",{value:"default",configurable:!0})},41044(e,t,i){function r(e,t){if(Array.isArray(e)&&(e=e.join(",")),document.querySelector(e))return void t();let i=!1;const r=new MutationObserver(async()=>{document.querySelector(e)&&(r.disconnect(),i||(i=!0,t()))});r.observe(document,{attributes:!0,childList:!0,subtree:!0})}i.d(t,{A:()=>r})},53853(e,t,i){function r(e,t){if(Array.isArray(e)&&(e=e.join(",")),document.querySelector(e))return void t();let i=!1;const r=new MutationObserver(async()=>{document.querySelector(e)&&(r.disconnect(),i||(i=!0,t()))});r.observe(document,{attributes:!0,childList:!0,subtree:!0})}i.d(t,{A:()=>r})},73609(e,t,i){i.d(t,{A:()=>c}),i(67219),i(44764),i(84978),i(13722),i(39589),i(25809);var r=i(1439),o=i.n(r),a=i(5292);if(7717==i.j)var s=i(26594);if(7717==i.j)var n=i(40627);if(7717==i.j)var l=i(95628);var d=i(66556);class c{constructor(e){this._container=e,this._update=(0,s.A)(this._update.bind(this)),this._update(),window.addEventListener("brightspot-content-state-change",()=>{this._toggle()})}_forEachChild(e){for(const t of this._container.children){const i=t.dataset.tab;void 0!==i&&e(i,t)}}_toArray(e){if(e)try{const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{}return[]}_update(){this._observer&&(this._observer.disconnect(),this._observer=null);const e=(0,a.A)("div",{className:"TabBar",role:"tablist"}),t=(0,a.A)("button",{className:"TabBar-menuToggle",title:window.BRIGHTSPOT?.ui.tooltips.tabs,type:"button","aria-haspopup":"menu","aria-expanded":"false","aria-label":window.BRIGHTSPOT?.ui.tooltips.tabs}),i=(0,a.A)("div",{className:"TabBar-menuList",role:"menu","aria-label":window.BRIGHTSPOT?.ui.tooltips.tabs}),r=(0,a.A)("div",{className:"TabBar-menu"},t,i);t.onclick=()=>{(0,d.AM)(i,t,e)};const o="MENU"===this._container.dataset.tcMode,s=this._container.dataset.tcMain,c=this._toArray(this._container.dataset.tcExceptions),h=new Set;this._defaultTab=null;for(const e of this._container.children){const t=e.dataset.tab;void 0!==t&&(h.has(t)||(this._defaultTab||(this._defaultTab=t),h.add(t)))}const u=this._toArray(this._container.dataset.tcStart),p=this._toArray(this._container.dataset.tcEnd),m=[];for(const e of u)h.has(e)&&m.push(e);for(const e of h)u.includes(e)||p.includes(e)||m.push(e);for(const e of p)h.has(e)&&m.push(e);for(const t of m){const r=c.indexOf(t)>-1?o?e:i:o?i:e;r.insertBefore((0,a.A)("button",{className:"TabBar-item",dataset:{tab:t},role:"tab",onclick:e=>{e.preventDefault(),this.select(t,e)},onkeydown:e=>{var t=e.currentTarget,i=t.closest(".TabBar");switch(e.key){case"ArrowRight":return void(t.nextSibling?t.nextSibling.focus():i.firstChild.focus());case"ArrowLeft":return void(t.previousSibling?t.previousSibling.focus():i.lastChild.focus())}}},t),t===s?r.firstChild:null)}m.includes(s)&&(this._defaultTab=s),1===e.children.length&&i.insertBefore(e.children[0],i.firstChild);for(const e of i.children)e.className="TabBar-menuItem",e.setAttribute("role","menuitem");if((0,d.D1)(i,t),this._bar&&(this._bar.remove(),this._bar=null,this._menu=null,this._menuToggle=null,this._menuList=null),0===m.length||m.length<2&&!this._container.getAttribute("data-show-tabs")){this._container.dataset.tabless="true";const e=this._container.querySelectorAll(":scope > .TC-unselected");return void Array.from(e).forEach(e=>{e.classList.remove("TC-unselected")})}this._bar=e,this._container.insertBefore(e,this._container.firstChild),i.children.length>0&&(0===e.children.length&&(e.classList.add("is-menuOnly"),e.removeAttribute("role")),this._menu=r,this._menuToggle=t,this._menuList=i,this._bar.appendChild(r));const g=this._toggle();g.includes(this._defaultTab)||(this._defaultTab=g[0]),e.hidden=1===Array.from(i.children).filter(e=>!e.hidden).length;let v=!1;for(const e of(0,n.A)(this._container,".CIG-row > .Message.is-error")){let t,i=e;do{t=i,i=t.parentNode}while(i!==this._container);const r=(0,l.A)(this._bar,`[data-tab="${t.dataset.tab}"]`);r&&!r.classList.contains("is-error")&&(r.classList.add("is-error"),r.classList.contains("TabBar-menuItem")&&(v=!0))}v&&e.classList.add("is-menuError"),this.select()}_toggle(){const e=[];this._forEachChild((t,i)=>{i.hidden||i instanceof HTMLHeadingElement||e.push(t)});for(const t of[this._bar,this._menuList])if(t)for(const i of t.children)i!==this._menu&&(i.hidden=!e.includes(i.dataset.tab));return e}select(e,t){const i=e&&this._container.closest(".ContentEdit.is-new, .StandardForm.is-new");if(e||(e=this._defaultTab),this._bar&&!this._bar.classList.contains("is-menuOnly"))for(const t of this._bar.children){const i=t.dataset.tab===e;t.classList.toggle("is-selected",i),t.setAttribute("aria-selected",i),i?t.removeAttribute("tabindex"):t.setAttribute("tabindex","-1")}if(this._menuList){let t=!1;for(const i of this._menuList.children)i.classList.toggle("is-selected",i.dataset.tab===e)&&(t=e!==this._defaultTab);this._bar.classList.toggle("is-menuSelected",t),this._menuToggle.innerText=t?e:""}if(this._forEachChild((t,i)=>{i.classList.toggle("TC-unselected",t!==e)}),window.dispatchEvent(new Event("resize")),o()(this._container).find("> [data-tab]").trigger("tabbedShow"),o()(this._bar).trigger("tabbed-select"),i){const t=this._container.querySelector(`:scope > .CIG-row:not(.inputContainer-readOnly)[data-tab="${e}"] > .CIG-label > label`)?.htmlFor;t&&document.getElementById(t)?.focus()}else t&&t.target.scrollIntoView({block:"nearest"})}}},9216(e,t,i){i.d(t,{A:()=>c}),i(86634),i(57573),i(49371),i(42723),i(26780),i(96648);var r=i(88630),o=i.n(r),a=i(18101);if(3324==i.j)var s=i(39403);if(3324==i.j)var n=i(76394);if(3324==i.j)var l=i(60021);var d=i(79365);class c{constructor(e){this._container=e,this._update=(0,s.A)(this._update.bind(this)),this._update(),window.addEventListener("brightspot-content-state-change",()=>{this._toggle()})}_forEachChild(e){for(const t of this._container.children){const i=t.dataset.tab;void 0!==i&&e(i,t)}}_toArray(e){if(e)try{const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{}return[]}_update(){this._observer&&(this._observer.disconnect(),this._observer=null);const e=(0,a.A)("div",{className:"TabBar",role:"tablist"}),t=(0,a.A)("button",{className:"TabBar-menuToggle",title:window.BRIGHTSPOT?.ui.tooltips.tabs,type:"button","aria-haspopup":"menu","aria-expanded":"false","aria-label":window.BRIGHTSPOT?.ui.tooltips.tabs}),i=(0,a.A)("div",{className:"TabBar-menuList",role:"menu","aria-label":window.BRIGHTSPOT?.ui.tooltips.tabs}),r=(0,a.A)("div",{className:"TabBar-menu"},t,i);t.onclick=()=>{(0,d.AM)(i,t,e)};const o="MENU"===this._container.dataset.tcMode,s=this._container.dataset.tcMain,c=this._toArray(this._container.dataset.tcExceptions),h=new Set;this._defaultTab=null;for(const e of this._container.children){const t=e.dataset.tab;void 0!==t&&(h.has(t)||(this._defaultTab||(this._defaultTab=t),h.add(t)))}const u=this._toArray(this._container.dataset.tcStart),p=this._toArray(this._container.dataset.tcEnd),m=[];for(const e of u)h.has(e)&&m.push(e);for(const e of h)u.includes(e)||p.includes(e)||m.push(e);for(const e of p)h.has(e)&&m.push(e);for(const t of m){const r=c.indexOf(t)>-1?o?e:i:o?i:e;r.insertBefore((0,a.A)("button",{className:"TabBar-item",dataset:{tab:t},role:"tab",onclick:e=>{e.preventDefault(),this.select(t,e)},onkeydown:e=>{var t=e.currentTarget,i=t.closest(".TabBar");switch(e.key){case"ArrowRight":return void(t.nextSibling?t.nextSibling.focus():i.firstChild.focus());case"ArrowLeft":return void(t.previousSibling?t.previousSibling.focus():i.lastChild.focus())}}},t),t===s?r.firstChild:null)}m.includes(s)&&(this._defaultTab=s),1===e.children.length&&i.insertBefore(e.children[0],i.firstChild);for(const e of i.children)e.className="TabBar-menuItem",e.setAttribute("role","menuitem");if((0,d.D1)(i,t),this._bar&&(this._bar.remove(),this._bar=null,this._menu=null,this._menuToggle=null,this._menuList=null),0===m.length||m.length<2&&!this._container.getAttribute("data-show-tabs")){this._container.dataset.tabless="true";const e=this._container.querySelectorAll(":scope > .TC-unselected");return void Array.from(e).forEach(e=>{e.classList.remove("TC-unselected")})}this._bar=e,this._container.insertBefore(e,this._container.firstChild),i.children.length>0&&(0===e.children.length&&(e.classList.add("is-menuOnly"),e.removeAttribute("role")),this._menu=r,this._menuToggle=t,this._menuList=i,this._bar.appendChild(r));const g=this._toggle();g.includes(this._defaultTab)||(this._defaultTab=g[0]),e.hidden=1===Array.from(i.children).filter(e=>!e.hidden).length;let v=!1;for(const e of(0,n.A)(this._container,".CIG-row > .Message.is-error")){let t,i=e;do{t=i,i=t.parentNode}while(i!==this._container);const r=(0,l.A)(this._bar,`[data-tab="${t.dataset.tab}"]`);r&&!r.classList.contains("is-error")&&(r.classList.add("is-error"),r.classList.contains("TabBar-menuItem")&&(v=!0))}v&&e.classList.add("is-menuError"),this.select()}_toggle(){const e=[];this._forEachChild((t,i)=>{i.hidden||i instanceof HTMLHeadingElement||e.push(t)});for(const t of[this._bar,this._menuList])if(t)for(const i of t.children)i!==this._menu&&(i.hidden=!e.includes(i.dataset.tab));return e}select(e,t){const i=e&&this._container.closest(".ContentEdit.is-new, .StandardForm.is-new");if(e||(e=this._defaultTab),this._bar&&!this._bar.classList.contains("is-menuOnly"))for(const t of this._bar.children){const i=t.dataset.tab===e;t.classList.toggle("is-selected",i),t.setAttribute("aria-selected",i),i?t.removeAttribute("tabindex"):t.setAttribute("tabindex","-1")}if(this._menuList){let t=!1;for(const i of this._menuList.children)i.classList.toggle("is-selected",i.dataset.tab===e)&&(t=e!==this._defaultTab);this._bar.classList.toggle("is-menuSelected",t),this._menuToggle.innerText=t?e:""}if(this._forEachChild((t,i)=>{i.classList.toggle("TC-unselected",t!==e)}),window.dispatchEvent(new Event("resize")),o()(this._container).find("> [data-tab]").trigger("tabbedShow"),o()(this._bar).trigger("tabbed-select"),i){const t=this._container.querySelector(`:scope > .CIG-row:not(.inputContainer-readOnly)[data-tab="${e}"] > .CIG-label > label`)?.htmlFor;t&&document.getElementById(t)?.focus()}else t&&t.target.scrollIntoView({block:"nearest"})}}},36245(e,t,i){i.r(t),i.d(t,{default:()=>m}),i(67219),i(44764),i(84978),i(13722),i(25809),i(91672),i(92280);var r=i(14932),o=i(5292),a=i(74336),s=i.n(a),n=(i(93916),i(32246)),l=i(41044),d=i(60994),c=(i(25317),i(73609));const h="is-VideoEditorLoaded",u="is-VideoEditorOpen",p="use-credentials";class m{constructor(e){this.getState=()=>this._currentVideoState,this.SMPTEToSeconds=(e,t=24)=>{const i=e.split(":"),r=Number(i[3]),o=1/t*(isNaN(r)?0:r);return 60*Number(i[0])*60+60*Number(i[1])+Number(i[2])+o},this.secondsToSMPTE=(e,t=24)=>{const i=new Date;function r(e){return e<10?"0"+e:e}return i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(1e3*e),"hh:mm:ss:ff".replace(/hh|mm|ss|ff/g,function(o){switch(o){case"hh":return r(i.getHours()<13?i.getHours():i.getHours()-12);case"mm":return r(i.getMinutes());case"ss":return r(i.getSeconds());case"ff":return r(Math.floor(e%1*t))}})},this.isIntersecting=(e,t)=>e.left<=t.right&&t.left<=e.right&&e.top<=t.bottom&&t.top<=e.bottom,this.fromSMPTEToXCoordinate=(e,t,i)=>{const r=1e3*this.SMPTEToSeconds(e)/(1e3*t),{width:o}=i.getBoundingClientRect();return o*r},this.combine=(e,t)=>{const i=Math.max(e.left,t.left),r=Math.max(e.top,t.top);return{x:i,y:r,intersectionWidth:Math.min(e.left+e.width,t.left+t.width)-i,height:Math.min(e.top+e.height,t.top+t.height)-r}},this.createSlider=(e,t,i,r=null,o=null,a=null)=>{let n=null;const l=Array.isArray(t)?t:[t];r&&(n=Array.isArray(r)?r:[r]);const d=l.map(e=>e.value),c=l.map(e=>+e.getAttribute("min")),h=l.map(e=>+e.getAttribute("max"));let u={start:n||d,connect:!0,range:o||{min:c,max:h}};a&&(u.format=a),s().create(e,u),e.noUiSlider.on("update",(e,t)=>{const r=e[t];i(r)}),e.noUiSlider.on("set",(e,t)=>{l[t].value=e[t],l[t].dispatchEvent(new Event("change",{bubbles:!0}))})},this.originEl=e,this.rootEl=this.originEl.closest("form");const t=(0,o.A)("div",{class:"VideoEditorAside-top"},[(0,o.A)("h2","Edit Video"),(0,o.A)("button",{className:"VideoEditor-stage-closeButton",name:"action-done",onclick:e=>{this._VideoPlayer.pause(),this.rootEl.classList.remove(u),e.preventDefault()}},"Done")]),i=(0,o.A)("div",{class:"VideoEditorAside-body"}),r=(0,o.A)("div",{class:"VideoEditor-stage-aside"},[t,i]);this.ClipModel={clips:new Map,observers:[],observersOnRemove:[],addClip:function(e){const{key:t,placeholder:i}=e;if(t&&i)if(this.clips.has(i)){const r={...this.clips.get(i)};this.clips.set(t,{...e,...r}),this.clips.delete(i)}else if(this.clips.has(t)){const i={...this.clips.get(t),...e};this.clips.delete(t),this.clips.set(t,i)}this.clips.has(t)||this.clips.set(t||i,e),this.notify()},removeClip:function(e){this.clips.has(e)&&(this.clips.delete(e),this.notifyOnRemove(e))},getClips:function(){return this.clips},observe:function(e){this.observers.push(e)},observeOnRemove:function(e){this.observersOnRemove.push(e)},notifyOnRemove:function(e){this.observersOnRemove.forEach(t=>t(e))},notify:function(){this.observers.forEach(e=>e(this.clips))}},(0,n.A)(this.originEl,".FilePreview-actions",e=>{e.insertAdjacentElement("beforeend",(0,o.A)("a",{class:"icon icon-action-edit",href:"#",onclick:e=>{this.rootEl.querySelectorAll("video").forEach(e=>e.pause()),this.rootEl.classList.add(u)}},"Edit"))}),this.rootEl.insertAdjacentElement("beforeend",(0,o.A)("div",{class:"VideoEditor-stage"},r)),this._initVideo().then(async e=>{this._updateVideoState(h),await this._createVideoPlayer(e),r.insertAdjacentElement("beforebegin",(0,o.A)("div",{class:"VideoEditor-stage-main"},this._VideoPlayer.elements.container)),r.insertAdjacentElement("beforebegin",(0,o.A)("div",{className:"VideoEditor-stage-bottom"},(0,o.A)("div",{className:"VideoEditor-minimap"},[(0,o.A)("div",{className:"VideoEditor-overlays"}),(0,o.A)("div",{className:"VideoEditor-filmstrip"},[(0,o.A)("div",{className:"VideoEditorFilmstrip-images"}),(0,o.A)("div",{className:"VideoEditorFilmstrip-clips"})])]))),this._ColorUI=this._createColorUI(),await new Promise((e,t)=>{(0,n.A)(this.originEl,'[data-field-name="clippings"]',t=>{e(t)})}).then(e=>{this._ClippingUI=this._createClippingUI(e)}).catch(e=>{console.warn(`Failed to create the Clipping UI due to: ${e}`)}),this._OverlayUI=this._createOverlayUI(this._VideoPlayer,e.videoWidth,e.videoHeight),this._MiniMap=this._createMiniMap(e,this._OverlayUI),this._ColorUI&&i.append(this._ColorUI.element),this._OverlayUI&&i.append(this._OverlayUI.element),this._ClippingUI&&i.append(this._ClippingUI.element),new c.A(i),this._applyInitialValues([this._ColorUI,this._OverlayUI,this._ClippingUI])})}async _initVideo(){return this._updateVideoState("is-VideoEditorLoading"),new Promise((e,t)=>{const i=".VideoEditor-fileContainer video:not(.VideoEditor-captureVideo):not(.awsElementalVideo)";(0,l.A)(i,()=>{const t=document.querySelector(i);t.readyState>=2?e(t):t.addEventListener("loadedmetadata",i=>{e(t)})})})}async _createMiniMap(e,t){let i=null,r=e;const a=24,s="is-selecting",n=this.rootEl.querySelector(".VideoEditor-filmstrip"),l=this.rootEl.querySelector(".VideoEditor-minimap");this.createFilmstripPlaceholder(r),await this.createFilmstrip(this.originEl.querySelector(".FilePreview-actions + video"),r.videoWidth,r.videoHeight,r.duration);let d,c,h=!1,u=null,p=!1,m=0;const g=(0,o.A)("span",{className:"playhead"});l.appendChild(g);const v=parseInt(g.offsetWidth)/2,y=e=>{const t=e/this.rootEl.querySelector(".VideoEditor-filmstrip").offsetWidth;return 1e3*r.duration*t},f={_x:0,x:0,setOrigin:e=>{this._x=e.offsetLeft}};f.setOrigin(l);const b=()=>{l.classList.remove(s),u&&u.remove(),window.cancelAnimationFrame(i),u=null,p=!1},E=(e,t,i)=>{const{width:r}=e.getBoundingClientRect();let s=(t-a)/r*100,n=i/r*100;const l=this.rootEl.querySelectorAll(".VideoEditor-filmstrip .VideoEditorClip-surface"),d=`placeholder-${Date.now()}`,c=(0,o.A)("div",{classList:"VideoEditorClip-surface","data-placeholder":d});let h;return c.style.left=`${s}%`,c.style.width=`${n}%`,e.appendChild(c),l.forEach(e=>{if(c===e)return;const t=c.getBoundingClientRect(),i=e.getBoundingClientRect();if(this.isIntersecting(t,i)){const o=this.combine(t,i);i.left<t.left&&(s=(i.left-a)/r*100,c.style.left=`${s}%`),h=t.width+i.width-o.intersectionWidth,n=h/r*100,c.style.width=`${n}%`,this.ClipModel.removeClip(e.getAttribute("data-ref-key"))}}),c};let A=null,C=0,w=0,S=0;const V=e=>{const t=(0,o.A)("div",{className:"VideoEditorClip-resizerLeft"}),i=(0,o.A)("div",{className:"VideoEditorClip-resizerRight"});e.appendChild((0,o.A)("div",{className:"VideoEditorClip-resizeUI"},[t,i]))},I=e=>{m=e.x-a;const t=this.rootEl.querySelector(".VideoEditor-filmstrip"),i=m/l.offsetWidth,o=r.duration*i*1e3;if(u){const e=u;p=!1,u=!1,c=o;const{x:i,width:r}=e.getBoundingClientRect(),n=E(t,i,r);V(n),e.parentElement.remove(),l.classList.remove(s);const{x:h,width:m}=n.getBoundingClientRect();d=y(h-a),c=y(h+m-a);const g=n.getAttribute("data-placeholder"),v=this.secondsToSMPTE(d/1e3),f=this.secondsToSMPTE(c/1e3);this.ClipModel.addClip({placeholder:g,startTimeSMPTE:v,endTimeSMPTE:f})}else{p=!0,l.classList.add(s);const e=(e=>{const t="http://www.w3.org/2000/svg",i=document.createElementNS(t,"svg");i.setAttribute("class","VideoEditorFilmstrip-selectionContainer"),i.setAttribute("preserveAspectRatio","none");const r=document.createElementNS(t,"rect");return r.setAttribute("class","VideoEditorFilmstrip-selection"),r.setAttribute("x",`${e}`),r.setAttribute("height","100%"),i.appendChild(r),r})(m);t.appendChild(e.parentElement),u=e,d=o}};this.rootEl.querySelector(".VideoEditor-stage-bottom").onmouseleave=e=>{b()},l.onmousedown=e=>{A=e.target;var t;A.classList.contains("VideoEditorClip-resizerLeft")||A.classList.contains("VideoEditorClip-resizerRight")?(e.preventDefault(),t=A.closest(".VideoEditorClip-surface"),h=t,C=parseFloat(window.getComputedStyle(t,null).getPropertyValue("width").replace("px","")),w=t.getBoundingClientRect().left,S=f.x):I(e)},l.onmouseup=e=>{if(h){const e=h,t=`placeholder-${Date.now()}`;let i;e.setAttribute("data-placeholder",t),h=!1,this.rootEl.querySelectorAll(".VideoEditor-filmstrip .VideoEditorClip-surface").forEach(t=>{if(e===t)return;const r=e.getBoundingClientRect(),o=t.getBoundingClientRect();if(this.isIntersecting(r,o)){const s=this.combine(r,o);o.left<r.left&&(e.style.left=o.left-a+"px"),i=r.width+o.width-s.intersectionWidth,e.style.width=`${i}px`,this.ClipModel.removeClip(t.getAttribute("data-ref-key"))}});const{x:r,width:o}=e.getBoundingClientRect();d=y(r-a),c=y(r+o-a);const s=this.secondsToSMPTE(d/1e3),n=this.secondsToSMPTE(c/1e3);this.ClipModel.addClip({key:e.getAttribute("data-ref-key"),placeholder:e.getAttribute("data-placeholder"),startTimeSMPTE:s,endTimeSMPTE:n})}},l.onmouseenter=e=>{this._VideoPlayer.stop(),window.cancelAnimationFrame(i),i=window.requestAnimationFrame(_),g.classList.remove("is-hidden")},l.onmouseleave=e=>{window.cancelAnimationFrame(i),g.classList.add("is-hidden")},l.onmousemove=e=>{f.x=e.pageX,f.clientX=e.clientX,h&&(e=>{const t=n.getBoundingClientRect(),{width:i}=t,r=f.x-t.left,o=A.closest(".VideoEditorClip-surface");if(r<=0)o.style.left="0%";else{if(r>=t.width){const e=100-parseFloat(o.style.left);return void(o.style.width=`${e}%`)}if(A.classList.contains("VideoEditorClip-resizerRight")){const t=C+(e.pageX-S);let r=t/i*100;t>1&&(o.style.width=`${r}%`)}else{const t=C-(e.pageX-S);let r=t/i*100;if(t>1){o.style.width=`${r}%`;let t=(w+(e.pageX-a-S))/i*100;o.style.left=`${t}%`}}}})(e)},document.onkeydown=e=>{"Escape"===e.key&&p&&b()};const _=e=>{const t=l.getBoundingClientRect(),o=f.lastX-l.offsetLeft;var a;a=o-v,g.style.transform=`translateX(${a}px)`,(e=>{if(u){const t=parseInt(u.getAttribute("x"));e<m?(u.setAttribute("x",`${e}px`),u.setAttribute("width",`${Math.abs(e-m)}px`)):(u.setAttribute("x",`${m}px`),u.setAttribute("width",`${Math.abs(e-t)}px`))}})(o),this._VideoPlayer.currentTime=r.duration*(o/t.width),f.lastX=f.x,f.lastY=f.y,i=window.requestAnimationFrame(_)},T="http://www.w3.org/2000/svg",x=document.createElementNS(T,"svg"),$=`gradient-${Date.now()}`,P=document.createElementNS(T,"linearGradient"),M=document.createElementNS(T,"rect");x.setAttribute("width","100%"),x.setAttribute("height","100%"),x.setAttribute("version","1.1"),x.setAttribute("xmlns",T),x.setAttribute("class","VideoOverlays-clipBackground"),P.id=$,P.setAttribute("x1","0"),P.setAttribute("x2","100%"),P.setAttribute("y1","0"),P.setAttribute("y2","0"),x.appendChild(P),M.setAttribute("fill",`url(#${$})`),M.setAttribute("width","100%"),M.setAttribute("height","100%"),x.appendChild(M),this.rootEl.querySelector(".VideoEditor-overlays").appendChild(x);const O=document.createElementNS(T,"svg"),q=document.createElementNS(T,"defs"),k=document.createElementNS(T,"clipPath");O.setAttribute("version","1.1"),O.setAttribute("xmlns",T),O.setAttribute("class","VideoOverlays-clippingSvg"),k.setAttribute("id","VideoEditorOverlays-svgPath"),q.appendChild(k),O.appendChild(q),this.rootEl.querySelector(".VideoEditor-overlays").appendChild(O);const L=(e,t)=>{const i=document.createElementNS(T,"stop");return i.setAttribute("offset",`${e}%`),i.setAttribute("stop-color",`${t}`),i},N=()=>{const e=`gradient-${Date.now()}`;P.id=e,M.setAttribute("fill",`url(#${e})`)},G=()=>{const e=t.getOverlays(),i=r.duration;k.innerHTML="";let o=1;e.forEach(e=>{const t=e.getStartSeconds()/i*100,r=e.getStopSeconds()/i*100,a=document.createElementNS(T,"rect"),s=1===o?4:4*o+4*(o-1);a.setAttribute("x",`${t}%`),a.setAttribute("width",r-t+"%"),a.setAttribute("y",`calc(100% - ${s})`),a.setAttribute("height","4"),k.appendChild(a),o++})},U=e=>{const t=new Set,i=r.duration;P.innerHTML="",e.size?(e.forEach(e=>{const{startTimeSMPTE:r,endTimeSMPTE:o}=e,a=""===r?0:1e3*this.SMPTEToSeconds(r),s=""===o?0:1e3*this.SMPTEToSeconds(o),n=a/1e3/i*100,l=s/1e3/i*100;t.add(n),t.add(l)}),[...t].sort((e,t)=>e-t).forEach((e,t)=>{t%2==0||0===t?(P.append(L(e,"white")),P.append(L(e,"rgb(113, 133, 162)"))):(P.append(L(e,"rgb(113, 133, 162)")),P.append(L(e,"white")))})):P.append(L("0","white"),L("100","white"))};return P.append(L("0","white"),L("100","white")),this.ClipModel.getClips().forEach(e=>{const t=this.fromSMPTEToXCoordinate(e.startTimeSMPTE,r.duration,n),i=this.fromSMPTEToXCoordinate(e.endTimeSMPTE,r.duration,n)-t,{key:o}=e,s=E(n,t+a,i);s.removeAttribute("data-placeholder"),s.setAttribute("data-ref-key",o),V(s)}),U(this.ClipModel.getClips()),this.ClipModel.observe(e=>{e.forEach(e=>{const{key:t,placeholder:i}=e,r=this.rootEl.querySelector(`.VideoEditor-filmstrip .VideoEditorClip-surface[data-placeholder="${i}"]`);t&&r&&(r.removeAttribute("data-placeholder"),r.setAttribute("data-ref-key",t))}),U(e),N()}),this.ClipModel.observeOnRemove(e=>{const t=this.rootEl.querySelector(`.VideoEditor-filmstrip .VideoEditorClip-surface[data-ref-key="${e}"]`);t&&(t.remove(),U(this.ClipModel.getClips())),N()}),_(),this._VideoPlayer.on("playing",e=>{window.cancelAnimationFrame(i)}),{element:l,redrawClips:U,redrawOverlays:G,reset:()=>{G(),U(this.ClipModel.getClips());const e=this.rootEl.querySelector(".VideoOverlays-clippingSvg clipPath");e?e.innerHTML="":console.warn("querySelector('.VideoOverlays-clippingSvg clipPath') returned null. Overlay path may not have reset properly."),N()},setVideo:e=>{r=e}}}createFilmstripPlaceholder(e){const t=this.rootEl.querySelector(".VideoEditorFilmstrip-images"),i=[],r=e.duration/10;for(let e=1;e<=10;e++){const t=(0,o.A)("div",{className:"VideoEditorFilmstrip-placeholder"},(0,o.A)("span",{className:"VideoEditorFilmstrip-placeholderLabel"},`${this.secondsToSMPTE(e*r)}`));i.push(t)}i.forEach(e=>t.appendChild(e))}async createFilmstrip(e,t,i,r){const a=r/10,s=this.rootEl.querySelector(".VideoEditorFilmstrip-images"),n=this.rootEl.querySelector(".VideoEditor-filmstrip"),l=e.cloneNode(!0);l.crossOrigin=p,await new Promise((e,t)=>{l.readyState>=2?e():l.addEventListener("loadedmetadata",t=>{e()})}),l.className="VideoEditor-captureVideo",l.removeAttribute("controls"),l.setAttribute("muted",!0),l.setAttribute("playsinline",!0),e.insertAdjacentElement("afterend",l);const d="http://www.w3.org/2000/svg",c=document.createElementNS(d,"svg"),h=document.createElementNS(d,"defs"),u=document.createElementNS(d,"clipPath");c.setAttribute("version","1.1"),c.setAttribute("xmlns",d),c.setAttribute("class","VideoEditorFilmstrip-clippingSvg"),u.setAttribute("id","VideoEditorFilmstrip-svgPath"),h.appendChild(u),c.appendChild(h);const m=document.createElementNS(d,"rect");m.setAttribute("x","0"),m.setAttribute("width","50%"),m.setAttribute("height","100%"),u.appendChild(m),s.parentElement.appendChild(c);let g=0,v=!1;const y=e=>{if(!v)return(e=>new Promise((t,i)=>{const r=e=>{l.removeEventListener("seeked",r),t()};l.addEventListener("seeked",r),l.currentTime=e}))(e).then(()=>{const e=(0,o.A)("canvas",{width:.2*t,height:.2*i});e.getContext("2d").drawImage(l,0,0,e.width,e.height);const r=(0,o.A)("img");r.crossOrigin=p,r.src=e.toDataURL(),s.children[g].replaceWith(r),++g}).catch(e=>{v=!0,console.warn(`Video screen shot failed due to:\n${e}`)})},f=()=>{n.classList.add("is-clipped");let e=s.querySelectorAll("img");e.length||(e=s.querySelectorAll("img, .VideoEditorFilmstrip-placeholder")),e.forEach(e=>{this.rootEl.querySelector(".VideoEditorFilmstrip-clips").append(e.cloneNode(!0))})},b=t=>{const i=e.duration;u.innerHTML="",t.forEach(e=>{const t=document.createElementNS(d,"rect"),r=this.fromSMPTEToXCoordinate(e.startTimeSMPTE,i,n),o=this.fromSMPTEToXCoordinate(e.endTimeSMPTE,i,n)-r,{width:a}=n.getBoundingClientRect(),s=r/a*100,l=o/a*100;t.setAttribute("x",`${s}%`),t.setAttribute("width",`${l}%`),t.setAttribute("height","100%"),t.setAttribute("data-ref-key",e.key||e.placeholder),u.appendChild(t)})};for(let e=1;e<=10;e++)await y(e*a);l.remove(),this.ClipModel.getClips().size&&f(),b(this.ClipModel.getClips()),this.ClipModel.observe(e=>{0===this.rootEl.querySelector(".VideoEditorFilmstrip-clips").childElementCount&&f(),b(e)}),this.ClipModel.observeOnRemove(e=>{const t=u.querySelector(`rect[data-ref-key="${e}"]`);t&&t.remove(),this.ClipModel.getClips().size||(n.classList.remove("is-clipped"),this.rootEl.querySelector(".VideoEditorFilmstrip-clips").innerHTML="")})}resetFilmstrip(){const e=this.rootEl.querySelector(".VideoEditorFilmstrip-clippingSvg");e?e.remove():console.warn("querySelector('.VideoEditorFilmstrip-clippingSvg') returned null. Filmstrip clip-path may not have reset properly."),this.rootEl.querySelector(".VideoEditorFilmstrip-images").innerHTML=""}_applyInitialValues(e){e.forEach(e=>{const t=(i=e.element.querySelectorAll("input[name]"),[...i].reduce((e,t)=>{const i=t.name.substring(t.name.lastIndexOf("/")+1);return Object.assign(e,{[i]:"checkbox"===t.type?t.checked:t.value}),e},{}));var i;e.handleUpdate(t)})}_createClippingUI(e){const t=new Map;e.classList.contains("is-inHiddenCluster")&&e.classList.remove("is-inHiddenCluster");const i=(0,o.A)("div",{class:"VideoEditor-ClippingUI","data-tab":"Clip"},(0,o.A)("h2","Click on the filmstrip area to clip your video."),(0,o.A)("em",{},"Tip: Creating a clip can be cancelled by pressing the escape key."),this.originEl.querySelector('[data-name$="/frameRate"]'),e);(0,n.A)(e,".RCIG-list > li:not(.is-removing)",e=>{if(e.classList.contains("is-collapsed")){const t=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window}),i=e.querySelector(".RCIG-title");i.dispatchEvent(t),i.dispatchEvent(t)}}),(0,n.A)(e,".RCIG-item.is-removing",async e=>{const i=await(async e=>new Promise((t,i)=>{(0,n.A)(e,".CIG",e=>{const i=e.getAttribute("data-id").split("/")[0];t(i)})}))(e);t.delete(i)}),(0,n.A)(e,".RCIG-list > li:not(.is-removing) .CIG",e=>{const t=e.getAttribute("data-id").split("/")[0],i=e.querySelector('[data-name$="startTimecode"] textarea').value,r=e.querySelector('[data-name$="endTimecode"] textarea').value;let o=`placeholder-${Date.now()}`;this.ClipModel.getClips().forEach((e,t)=>{t.includes("placeholder")&&(o=t)}),this.ClipModel.addClip({placeholder:o,key:t,startTimeSMPTE:i,endTimeSMPTE:r})}),(0,n.A)(e,".RCIG-list > li .RCIG-remove",e=>{e.onclick=e=>{const t=e.currentTarget.parentNode.querySelector(".CIG").getAttribute("data-id").split("/")[0];this.ClipModel.removeClip(t)}});const r=()=>{i.querySelector(".RCIG-add").click()};return this.ClipModel.observe(e=>{e.forEach(e=>{const{key:t,placeholder:o,startTimeSMPTE:a,endTimeSMPTE:s}=e;if(!t&&o)r();else{const e=i.querySelector('[data-name$="/clippings"]').querySelector(`.CIG[data-id="${t}"]`),r=e.querySelector('[data-name$="startTimecode"] textarea'),o=e.querySelector('[data-name$="endTimecode"] textarea');r.value=a,o.value=s,r.dispatchEvent(new Event("change",{bubbles:!0})),o.dispatchEvent(new Event("change",{bubbles:!0}))}})}),this.ClipModel.observeOnRemove(t=>{const i=e.querySelector(`.RCIG-list .CIG[data-id="${t}"]`),r=i.closest("li");if(i&&r&&!r.classList.contains("is-removing")){const e=i.parentNode.querySelector(".RCIG-remove");e&&e.click()}}),{createClip:r,element:i,handleUpdate:e=>{},reset:()=>{e.querySelectorAll(".RCIG-list > li:not(.is-removing) .RCIG-remove").forEach(e=>{e.click()})}}}_createColorUI(){const e={hue:0,saturation:50,brightness:50,contrast:50},t=new Map,i=e=>{const{hue:t,saturation:i,brightness:r,contrast:o}={...e};""!==t&&d.noUiSlider.set(t),""!==i&&h.noUiSlider.set(i),""!==r&&p.noUiSlider.set(r),""!==o&&g.noUiSlider.set(o)},r=(e,t=100)=>2*parseFloat(e)/100*t,a=(e,i)=>{let r="";const o=[...this.rootEl.querySelectorAll(".VideoEditor-stage-main video")];i?t.set(e,i):t.delete(e),t.forEach((e,t)=>{r+=` ${t}(${e}) `}),o.forEach(e=>e.style.filter=`${r.trim()}`)},s=this.originEl.querySelector(".VideoEditor-InputColors"),n=s.querySelector('input[name$="hue"]'),l=n.closest(".inputContainer");n.type="range",n.min="-180",n.max="180",n.value=l.hasAttribute("data-interacted")?n.value:e.hue;const d=(0,o.A)("div",{className:"is-slideable"});n.insertAdjacentElement("beforebegin",d),this.createSlider(d,n,e=>{a("hue-rotate",`${e}deg`)});const c=s.querySelector('input[name$="saturation"]');c.type="range",c.min="0",c.max="100";const h=(0,o.A)("div",{className:"is-slideable"});c.insertAdjacentElement("beforebegin",h),this.createSlider(h,c,e=>{a("saturate",`${r(e)}%`)});const u=s.querySelector('input[name$="brightness"]');u.type="range",u.min="0",u.max="100";const p=(0,o.A)("div",{className:"is-slideable"});u.insertAdjacentElement("beforebegin",p),this.createSlider(p,u,e=>{a("brightness",`${r(e)}%`)});const m=s.querySelector('input[name$="contrast"]');m.type="range",m.min="0",m.max="100";const g=(0,o.A)("div",{className:"is-slideable"});m.insertAdjacentElement("beforebegin",g),this.createSlider(g,m,e=>{a("contrast",`${r(e)}%`)});const v=(0,o.A)("div",{class:"VideoEditor-ColorUI","data-tab":"Color"},(0,o.A)("h2","Adjust Color"),(0,o.A)("em","Tip: Increment/decrement with up and down keys after clicking the slider."),s.querySelectorAll(".CIG-row")),y=(0,o.A)("a",{class:"VideoEditor-resetButton",onclick:t=>{t.preventDefault(),t.stopPropagation(),i(e)}},"Reset");return v.append(y),{element:v,handleUpdate:e=>{const{saturation:t,brightness:i,contrast:o,hue:s}={...e};a("saturate",t?`${r(t)}%`:null),a("brightness",i?`${r(i)}%`:null),a("contrast",o?`${r(o)}%`:null),a("hue-rotate",s?`${s}deg`:null)},reset:()=>{i(e)}}}_createOverlayUI(e,t,i){const r=new Map,a=this.originEl.querySelector('[data-field-name="imageOverlayOptions"]');a.removeAttribute("hidden"),(0,n.A)(a,".RCIG-list > li .RCIG-remove",e=>{e.onclick=e=>{const t=e.currentTarget.parentNode.querySelector(".VideoEditor-InputOverlay").getAttribute("data-id").split("/")[0],i=this.rootEl.querySelector(`.VideoOverlay-layer[data-name-ref="${t}"]`);i?i.remove():console.warn(`querySelector('.VideoOverlay-layer[data-name-ref="${t}"]') returned null. Overlay layer may not have been removed.`),this._MiniMap.then(e=>{e.redrawOverlays()})}});const s=(0,o.A)("div",{class:"VideoEditor-OverlayUI","data-tab":"Overlay"},(0,o.A)("h2",{},"Add Image Overlays"),(0,o.A)("em",{},"Up to 8 images can be added and overlapped."),a);e.on("timeupdate",e=>{const t=+e.detail.plyr.currentTime;r.forEach(e=>{const i=e.getStartSeconds(),r=e.getStopSeconds();i<=t&&r>=t?e.show():e.hide()})});const l=e=>this.rootEl.querySelector(`.VideoEditor-stage-main .plyr__video-wrapper [data-name-ref="${e}"]`),d=(e,t)=>{this.rootEl.querySelector(".VideoEditor-stage-main .plyr__video-wrapper").querySelector(`[data-name-ref="${e}"]`).style.setProperty("--index",t)},c=e=>new Promise(async(r,a)=>{const s=await h(e),n=s.id,d=(0,o.A)("canvas",{class:"VideoOverlay-layer is-hidden",width:t,height:i}),c=d.getContext("2d");c.drawImage(s.element,10,10);const u=s.element.naturalWidth,p=s.element.naturalHeight;d.setAttribute("data-name-ref",n);const m=this.rootEl.querySelector(".VideoEditor-stage-main .plyr__video-wrapper"),g=m.querySelector(`[data-name-ref="${n}"]`);g?m.replaceChild(d,g):m.appendChild(d);const v=e.querySelector('input[name$="/opacity"]');v.type="range",v.min=0,v.max=100;const y=(0,o.A)("div",{className:"is-slideable"});v.insertAdjacentElement("beforebegin",y);const f=v.getAttribute("name").split("/")[0],b=l(f);this.createSlider(y,v,e=>{var t;t=e/100,b.style.opacity=t});const E=e.querySelector('input[name$="/widthPercent"]'),A=e.querySelector('input[name$="/heightPercent"]'),C=(0,o.A)("input");C.type="range",C.min=1,C.max=100,C.step="1";const w=(0,o.A)("div",{className:"is-slideable"});C.insertAdjacentElement("beforebegin",w),this.createSlider(w,C,e=>{var t;t=e,E.value=parseInt(t),A.value=parseInt(t),E.dispatchEvent(new Event("change",{bubbles:!0})),A.dispatchEvent(new Event("change",{bubbles:!0}))},+E.value);const S=e.querySelector('input[name$="/xPercent"]'),V=e.querySelector('input[name$="/yPercent"]'),I=(e,r)=>{let o=e||0,a=r||0;return o=-1===Math.sign(o)?0:o,a=-1===Math.sign(a)?0:a,{xPercent:parseInt(o/t*100),yPercent:parseInt(a/i*100)}},_=new Map([["0,0","0,0"],["50,0",t/2-u/2+",0"],["100,0",t-u+",0"],["0,50","0,"+(i/2-p/2)],["50,50",`${t/2-u/2},${i/2-p/2}`],["100,50",`${t-u},${i/2-p/2}`],["0,100","0,"+(i-p)],["50,100",`${t/2-u/2},${i-p}`],["100,100",`${t-u},${i-p}`]]),T=(0,o.A)("div",{class:"VideoOverlay-layoutUI"}),x=(e,t)=>{const i=parseInt(e),r=parseInt(t);c.clearRect(0,0,d.width,d.height),c.drawImage(s.element,i,r)},$=e=>{const t=T.querySelector(`[data-coords="${e}"]`);T.querySelectorAll("* > .is-selected").forEach(e=>e.classList.remove("is-selected")),t.classList.add("is-selected")};_.forEach((e,t)=>{const{0:i,1:r}=e.split(","),{xPercent:a,yPercent:s}=I(i,r);T.appendChild((0,o.A)("div",{className:"VideoOverlay-layout-item","data-coords":`${a},${s}`,onclick:e=>{x(i,r),((e,t)=>{const{xPercent:i,yPercent:r}=I(e,t);S.value=i,V.value=r,S.dispatchEvent(new Event("change",{bubbles:!0})),V.dispatchEvent(new Event("change",{bubbles:!0}))})(i,r),$(`${a},${s}`),e.preventDefault()}}))});const P=e.querySelector('textarea[name$="/startTime"]'),M=(0,o.A)("input");M.style.display="none",M.setAttribute("hidden","true"),M.value=P.value?1e3*this.SMPTEToSeconds(P.value):0,M.onchange=e=>{const t=M.value/1e3;P.value=this.secondsToSMPTE(t),this._MiniMap.then(e=>{e.redrawOverlays()}),k(t)};const O=e.querySelector('input[name$="/duration"]'),q=(0,o.A)("div",{className:"is-slideable"});O.insertAdjacentElement("beforebegin",q),O.onchange=e=>{const t=O.value/1e3;this._MiniMap.then(e=>{e.redrawOverlays()}),k(t)},this.createSlider(q,[M,O],e=>{},[+M.value,+O.value],{min:0,max:1e3*this._VideoPlayer.duration},{to:function(e){return parseInt(e)},from:function(e){return parseInt(e)}});const k=e=>{this._VideoPlayer.currentTime=parseFloat(e)},L=e.querySelector('input[name$="/fadeIn"]'),N=e.querySelector('input[name$="/fadeOut"]'),G=e=>{L.value=e,N.value=e,d.style.setProperty("--transitionDuration-millis",`${e}ms`)},U=(0,o.A)("input",{type:"radio",name:`effect-for-${n}`,className:"radio-button",value:0,onchange:e=>{G(0)}}),R=(0,o.A)("input",{type:"radio",name:`effect-for-${n}`,className:"radio-button",value:350,onchange:e=>{G(350)}}),F=(0,o.A)("input",{type:"radio",name:`effect-for-${n}`,className:"radio-button",value:1e3,onchange:e=>{G(1e3)}});e.querySelector('.VideoEditor-InputOverlay > [data-field$="file"]').insertAdjacentElement("afterend",(0,o.A)("div",{className:"CIG-row",visible:!0},[(0,o.A)("div",{className:"CIG-label"},"Position"),T])),e.querySelector('.VideoEditor-InputOverlay > [data-field$="opacity"]').insertAdjacentElement("afterend",(0,o.A)("div",{className:"CIG-row scale",visible:!0},[(0,o.A)("div",{className:"CIG-label"},"Scale"),(0,o.A)("div",{className:"CIG-small"},w)])),e.querySelector('.VideoEditor-InputOverlay > [data-field$="xPercent"]').insertAdjacentElement("beforebegin",(0,o.A)("div",{className:"CIG-row",visible:!0},[(0,o.A)("div",{className:"CIG-label"},"Duration"),(0,o.A)("div",{className:"CIG-small",style:"position:relative"},[M,q])])),e.querySelector('.VideoEditor-InputOverlay > [data-field$="widthPercent"]').insertAdjacentElement("beforebegin",(0,o.A)("div",{className:"CIG-row",visible:!0},[(0,o.A)("div",{className:"CIG-label"},"Fade Effect"),(0,o.A)("div",{className:"CIG-small VideoOverlay-fadeEffect-group"},[(0,o.A)("label",{for:U.id,className:"radio-button-click-target"},U,"None"),(0,o.A)("label",{for:R.id,className:"radio-button-click-target"},R,"Brief"),(0,o.A)("label",{for:F.id,className:"radio-button-click-target"},F,"Gradual")])]));const B=()=>{d.classList.remove("is-hidden"),d.style.opacity=y.noUiSlider.get()/100};(r=>{const{opacity:o,xPercent:a,yPercent:s,widthPercent:l,heightPercent:d,startTime:c,duration:h,fadeIn:u}={...r};if(""!==o&&y.noUiSlider.set(o),""!==a&&""!==s){let e=t*(a/100),r=i*(s/100);e=-1===Math.sign(e)?0:e||0,r=-1===Math.sign(r)?0:r||0,x(e,r),$(`${a},${s}`)}""!==l&&""!==d?w.noUiSlider.set(l):w.noUiSlider.set(50);const p=""!==c?this.SMPTEToSeconds(c):0,m=""!==c?1e3*p:0,g=h||parseFloat(1e3*this._VideoPlayer.duration);q.noUiSlider.set([+m,+g]);const v=u;if(""!==v){const t=e.querySelector(`input[name="effect-for-${n}"][value="${v}"]`);t&&(t.checked=!0,G(v))}B()})([e.querySelector('input[name$="/opacity"]'),e.querySelector('input[name$="/xPercent"]'),e.querySelector('input[name$="/yPercent"]'),e.querySelector('input[name$="/widthPercent"]'),e.querySelector('input[name$="/heightPercent"]'),e.querySelector('textarea[name$="/startTime"]'),e.querySelector('input[name$="/duration"]'),e.querySelector('input[name$="/fadeIn"]'),e.querySelector('input[name$="/fadeOut"]')].reduce((e,t)=>{const i=t.name.substring(t.name.lastIndexOf("/")+1);return Object.assign(e,{[i]:"checkbox"===t.type?t.checked:t.value}),e},{})),e.querySelectorAll('.CIG-row[data-name$="/xPercent"], .CIG-row[data-name$="/yPercent"], .CIG-row[data-name$="/widthPercent"], .CIG-row[data-name$="/heightPercent"], .CIG-row[data-name$="/startTime"], .CIG-row[data-name$="/duration"], .CIG-row[data-name$="/fadeIn"], .CIG-row[data-name$="/fadeOut"]').forEach(e=>{e.classList.add("is-hidden")}),this._MiniMap.then(e=>{e.redrawOverlays()}),r({item:e,hide:()=>{d.classList.add("is-hidden"),d.style.opacity=0},show:B,getStartSeconds:()=>M.value/1e3,getStopSeconds:()=>O.value/1e3,remove:()=>{d.classList.add("is-removing")}})}).catch(e=>{console.warn(`Overlay failed to initialize due to: \n${e}`)});(0,n.A)(a,".RCIG-list",e=>{new MutationObserver(e=>{e.forEach(e=>{if(e.addedNodes.length){const t=e.addedNodes[0].querySelector(".CIG");t&&t.closest("ol").childNodes.forEach(async(e,t)=>{const i=await u(e);d(i,t),this._MiniMap.then(e=>{e.redrawOverlays()})})}})}).observe(e,{attributes:!1,childList:!0})});const h=e=>new Promise((t,i)=>{(0,n.A)(e,".filePreview",e=>{if(e){const i=new MutationObserver(r=>{r.some(r=>{if(r.target.classList.contains("is-imageEditorLoaded")){i.disconnect();const r=e.querySelector("img.cropper-hide");if(!r)return;const o=e.parentElement.getAttribute("data-name").split("/")[0];r.setAttribute("class","VideoOverlay-image"),r.setAttribute("style",`filter:${r.style.filter}`),r.setAttribute("data-name-ref",o),r.closest(".VideoEditor-InputOverlay").classList.add("is-overlay-ready"),t({id:o,element:r})}})});return i.observe(e,{attributeFilter:["class"]}),!0}})}),u=async e=>new Promise((t,i)=>{(0,n.A)(e,".filePreview",e=>{const i=e.parentElement.getAttribute("data-name").split("/")[0];t(i)})});return(0,n.A)(a,".RCIG-list .VideoEditor-InputOverlay",e=>{c(e).then(async e=>{const t=await u(e.item);r.set(t,e),d(t,(e=>{const t=e.closest("li");return[...t.parentNode.children].indexOf(t)})(e.item)),this._MiniMap.then(e=>{e.redrawOverlays()})}).catch(e=>{console.warn(`Failed to initialize Overlay due to: \n${e}`)})}),(0,n.A)(a,".RCIG-item.is-removing",async e=>{const t=await u(e);r.get(t).remove(),r.delete(t)}),(0,n.A)(a,".RCIG-list > li:not(.is-removing)",e=>{if(e.classList.contains("is-collapsed")){const t=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window}),i=e.querySelector(".RCIG-title");i.dispatchEvent(t),i.dispatchEvent(t)}}),{element:s,handleUpdate:e=>{},getOverlays:()=>{let e=[];return a.querySelectorAll(".RCIG-list .RCIG-item:not(.is-removing) .VideoEditor-InputOverlay.is-overlay-ready").forEach(t=>{const i=r.get(t.getAttribute("data-object-id"));i&&e.push(i)}),e},reset:()=>{a.querySelectorAll(".RCIG-list > li:not(.is-removing) .RCIG-remove").forEach(e=>{e.click()})}}}_createVideoPlayer(e){const t=e.cloneNode(!0);return this.originEl.appendChild(t),new Promise((e,i)=>{this._VideoPlayer=new d.A(t,{hideControls:!1,invertTime:!1,controls:["play","progress","current-time","mute","volume"]}),this._VideoPlayer.on("ready",t=>{e()})})}_updateVideoState(e){const t=document.querySelector(".Page-content .content-edit");this._currentVideoState&&t.classList.remove(this._currentVideoState),t.classList.add(e),this._currentVideoState=e}}let g=null;(0,n.A)(".VideoEditor",e=>{g=new m(e),(e=>{const t=(0,r.A)(e,".CIG-row");(0,n.A)(t,".fileSelector",t=>{const i=t.querySelector("select");i?i.addEventListener("change",t=>{var i;g&&(i=e,document.querySelector(".Page-content .content-edit").classList.remove(g.getState()),g._VideoPlayer.destroy(),i.querySelectorAll("video").forEach(e=>e.remove()),g.rootEl.querySelector(".VideoEditor-stage video").remove(),g._initVideo().then(async e=>{const t=g.rootEl.querySelector(".VideoEditor-stage-main");g._updateVideoState(h),await g._createVideoPlayer(e),t.appendChild(g._VideoPlayer.elements.container),g._ColorUI&&g._ColorUI.reset(),g._OverlayUI&&g._OverlayUI.reset(),g._ClippingUI&&g._ClippingUI.reset(),g._MiniMap.then(t=>{t.reset(),t.setVideo(e)}),g.resetFilmstrip(),g.createFilmstripPlaceholder(e),await g.createFilmstrip(e,e.videoWidth,e.videoHeight,e.duration)}))}):console.warn("Missing <select> in .fileSelector element!")})})(e)})},71852(e,t,i){i.r(t),i.d(t,{default:()=>m}),i(86634),i(57573),i(49371),i(42723),i(96648),i(56065),i(56673);var r=i(27741),o=i(18101),a=i(38729),s=i.n(a),n=(i(6725),i(45055)),l=i(53853),d=i(73803),c=(i(12508),i(9216));const h="is-VideoEditorLoaded",u="is-VideoEditorOpen",p="use-credentials";class m{constructor(e){this.getState=()=>this._currentVideoState,this.SMPTEToSeconds=(e,t=24)=>{const i=e.split(":"),r=Number(i[3]),o=1/t*(isNaN(r)?0:r);return 60*Number(i[0])*60+60*Number(i[1])+Number(i[2])+o},this.secondsToSMPTE=(e,t=24)=>{const i=new Date;function r(e){return e<10?"0"+e:e}return i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(1e3*e),"hh:mm:ss:ff".replace(/hh|mm|ss|ff/g,function(o){switch(o){case"hh":return r(i.getHours()<13?i.getHours():i.getHours()-12);case"mm":return r(i.getMinutes());case"ss":return r(i.getSeconds());case"ff":return r(Math.floor(e%1*t))}})},this.isIntersecting=(e,t)=>e.left<=t.right&&t.left<=e.right&&e.top<=t.bottom&&t.top<=e.bottom,this.fromSMPTEToXCoordinate=(e,t,i)=>{const r=1e3*this.SMPTEToSeconds(e)/(1e3*t),{width:o}=i.getBoundingClientRect();return o*r},this.combine=(e,t)=>{const i=Math.max(e.left,t.left),r=Math.max(e.top,t.top);return{x:i,y:r,intersectionWidth:Math.min(e.left+e.width,t.left+t.width)-i,height:Math.min(e.top+e.height,t.top+t.height)-r}},this.createSlider=(e,t,i,r=null,o=null,a=null)=>{let n=null;const l=Array.isArray(t)?t:[t];r&&(n=Array.isArray(r)?r:[r]);const d=l.map(e=>e.value),c=l.map(e=>+e.getAttribute("min")),h=l.map(e=>+e.getAttribute("max"));let u={start:n||d,connect:!0,range:o||{min:c,max:h}};a&&(u.format=a),s().create(e,u),e.noUiSlider.on("update",(e,t)=>{const r=e[t];i(r)}),e.noUiSlider.on("set",(e,t)=>{l[t].value=e[t],l[t].dispatchEvent(new Event("change",{bubbles:!0}))})},this.originEl=e,this.rootEl=this.originEl.closest("form");const t=(0,o.A)("div",{class:"VideoEditorAside-top"},[(0,o.A)("h2","Edit Video"),(0,o.A)("button",{className:"VideoEditor-stage-closeButton",name:"action-done",onclick:e=>{this._VideoPlayer.pause(),this.rootEl.classList.remove(u),e.preventDefault()}},"Done")]),i=(0,o.A)("div",{class:"VideoEditorAside-body"}),r=(0,o.A)("div",{class:"VideoEditor-stage-aside"},[t,i]);this.ClipModel={clips:new Map,observers:[],observersOnRemove:[],addClip:function(e){const{key:t,placeholder:i}=e;if(t&&i)if(this.clips.has(i)){const r={...this.clips.get(i)};this.clips.set(t,{...e,...r}),this.clips.delete(i)}else if(this.clips.has(t)){const i={...this.clips.get(t),...e};this.clips.delete(t),this.clips.set(t,i)}this.clips.has(t)||this.clips.set(t||i,e),this.notify()},removeClip:function(e){this.clips.has(e)&&(this.clips.delete(e),this.notifyOnRemove(e))},getClips:function(){return this.clips},observe:function(e){this.observers.push(e)},observeOnRemove:function(e){this.observersOnRemove.push(e)},notifyOnRemove:function(e){this.observersOnRemove.forEach(t=>t(e))},notify:function(){this.observers.forEach(e=>e(this.clips))}},(0,n.A)(this.originEl,".FilePreview-actions",e=>{e.insertAdjacentElement("beforeend",(0,o.A)("a",{class:"icon icon-action-edit",href:"#",onclick:e=>{this.rootEl.querySelectorAll("video").forEach(e=>e.pause()),this.rootEl.classList.add(u)}},"Edit"))}),this.rootEl.insertAdjacentElement("beforeend",(0,o.A)("div",{class:"VideoEditor-stage"},r)),this._initVideo().then(async e=>{this._updateVideoState(h),await this._createVideoPlayer(e),r.insertAdjacentElement("beforebegin",(0,o.A)("div",{class:"VideoEditor-stage-main"},this._VideoPlayer.elements.container)),r.insertAdjacentElement("beforebegin",(0,o.A)("div",{className:"VideoEditor-stage-bottom"},(0,o.A)("div",{className:"VideoEditor-minimap"},[(0,o.A)("div",{className:"VideoEditor-overlays"}),(0,o.A)("div",{className:"VideoEditor-filmstrip"},[(0,o.A)("div",{className:"VideoEditorFilmstrip-images"}),(0,o.A)("div",{className:"VideoEditorFilmstrip-clips"})])]))),this._ColorUI=this._createColorUI(),await new Promise((e,t)=>{(0,n.A)(this.originEl,'[data-field-name="clippings"]',t=>{e(t)})}).then(e=>{this._ClippingUI=this._createClippingUI(e)}).catch(e=>{console.warn(`Failed to create the Clipping UI due to: ${e}`)}),this._OverlayUI=this._createOverlayUI(this._VideoPlayer,e.videoWidth,e.videoHeight),this._MiniMap=this._createMiniMap(e,this._OverlayUI),this._ColorUI&&i.append(this._ColorUI.element),this._OverlayUI&&i.append(this._OverlayUI.element),this._ClippingUI&&i.append(this._ClippingUI.element),new c.A(i),this._applyInitialValues([this._ColorUI,this._OverlayUI,this._ClippingUI])})}async _initVideo(){return this._updateVideoState("is-VideoEditorLoading"),new Promise((e,t)=>{const i=".VideoEditor-fileContainer video:not(.VideoEditor-captureVideo):not(.awsElementalVideo)";(0,l.A)(i,()=>{const t=document.querySelector(i);t.readyState>=2?e(t):t.addEventListener("loadedmetadata",i=>{e(t)})})})}async _createMiniMap(e,t){let i=null,r=e;const a=24,s="is-selecting",n=this.rootEl.querySelector(".VideoEditor-filmstrip"),l=this.rootEl.querySelector(".VideoEditor-minimap");this.createFilmstripPlaceholder(r),await this.createFilmstrip(this.originEl.querySelector(".FilePreview-actions + video"),r.videoWidth,r.videoHeight,r.duration);let d,c,h=!1,u=null,p=!1,m=0;const g=(0,o.A)("span",{className:"playhead"});l.appendChild(g);const v=parseInt(g.offsetWidth)/2,y=e=>{const t=e/this.rootEl.querySelector(".VideoEditor-filmstrip").offsetWidth;return 1e3*r.duration*t},f={_x:0,x:0,setOrigin:e=>{this._x=e.offsetLeft}};f.setOrigin(l);const b=()=>{l.classList.remove(s),u&&u.remove(),window.cancelAnimationFrame(i),u=null,p=!1},E=(e,t,i)=>{const{width:r}=e.getBoundingClientRect();let s=(t-a)/r*100,n=i/r*100;const l=this.rootEl.querySelectorAll(".VideoEditor-filmstrip .VideoEditorClip-surface"),d=`placeholder-${Date.now()}`,c=(0,o.A)("div",{classList:"VideoEditorClip-surface","data-placeholder":d});let h;return c.style.left=`${s}%`,c.style.width=`${n}%`,e.appendChild(c),l.forEach(e=>{if(c===e)return;const t=c.getBoundingClientRect(),i=e.getBoundingClientRect();if(this.isIntersecting(t,i)){const o=this.combine(t,i);i.left<t.left&&(s=(i.left-a)/r*100,c.style.left=`${s}%`),h=t.width+i.width-o.intersectionWidth,n=h/r*100,c.style.width=`${n}%`,this.ClipModel.removeClip(e.getAttribute("data-ref-key"))}}),c};let A=null,C=0,w=0,S=0;const V=e=>{const t=(0,o.A)("div",{className:"VideoEditorClip-resizerLeft"}),i=(0,o.A)("div",{className:"VideoEditorClip-resizerRight"});e.appendChild((0,o.A)("div",{className:"VideoEditorClip-resizeUI"},[t,i]))},I=e=>{m=e.x-a;const t=this.rootEl.querySelector(".VideoEditor-filmstrip"),i=m/l.offsetWidth,o=r.duration*i*1e3;if(u){const e=u;p=!1,u=!1,c=o;const{x:i,width:r}=e.getBoundingClientRect(),n=E(t,i,r);V(n),e.parentElement.remove(),l.classList.remove(s);const{x:h,width:m}=n.getBoundingClientRect();d=y(h-a),c=y(h+m-a);const g=n.getAttribute("data-placeholder"),v=this.secondsToSMPTE(d/1e3),f=this.secondsToSMPTE(c/1e3);this.ClipModel.addClip({placeholder:g,startTimeSMPTE:v,endTimeSMPTE:f})}else{p=!0,l.classList.add(s);const e=(e=>{const t="http://www.w3.org/2000/svg",i=document.createElementNS(t,"svg");i.setAttribute("class","VideoEditorFilmstrip-selectionContainer"),i.setAttribute("preserveAspectRatio","none");const r=document.createElementNS(t,"rect");return r.setAttribute("class","VideoEditorFilmstrip-selection"),r.setAttribute("x",`${e}`),r.setAttribute("height","100%"),i.appendChild(r),r})(m);t.appendChild(e.parentElement),u=e,d=o}};this.rootEl.querySelector(".VideoEditor-stage-bottom").onmouseleave=e=>{b()},l.onmousedown=e=>{A=e.target;var t;A.classList.contains("VideoEditorClip-resizerLeft")||A.classList.contains("VideoEditorClip-resizerRight")?(e.preventDefault(),t=A.closest(".VideoEditorClip-surface"),h=t,C=parseFloat(window.getComputedStyle(t,null).getPropertyValue("width").replace("px","")),w=t.getBoundingClientRect().left,S=f.x):I(e)},l.onmouseup=e=>{if(h){const e=h,t=`placeholder-${Date.now()}`;let i;e.setAttribute("data-placeholder",t),h=!1,this.rootEl.querySelectorAll(".VideoEditor-filmstrip .VideoEditorClip-surface").forEach(t=>{if(e===t)return;const r=e.getBoundingClientRect(),o=t.getBoundingClientRect();if(this.isIntersecting(r,o)){const s=this.combine(r,o);o.left<r.left&&(e.style.left=o.left-a+"px"),i=r.width+o.width-s.intersectionWidth,e.style.width=`${i}px`,this.ClipModel.removeClip(t.getAttribute("data-ref-key"))}});const{x:r,width:o}=e.getBoundingClientRect();d=y(r-a),c=y(r+o-a);const s=this.secondsToSMPTE(d/1e3),n=this.secondsToSMPTE(c/1e3);this.ClipModel.addClip({key:e.getAttribute("data-ref-key"),placeholder:e.getAttribute("data-placeholder"),startTimeSMPTE:s,endTimeSMPTE:n})}},l.onmouseenter=e=>{this._VideoPlayer.stop(),window.cancelAnimationFrame(i),i=window.requestAnimationFrame(_),g.classList.remove("is-hidden")},l.onmouseleave=e=>{window.cancelAnimationFrame(i),g.classList.add("is-hidden")},l.onmousemove=e=>{f.x=e.pageX,f.clientX=e.clientX,h&&(e=>{const t=n.getBoundingClientRect(),{width:i}=t,r=f.x-t.left,o=A.closest(".VideoEditorClip-surface");if(r<=0)o.style.left="0%";else{if(r>=t.width){const e=100-parseFloat(o.style.left);return void(o.style.width=`${e}%`)}if(A.classList.contains("VideoEditorClip-resizerRight")){const t=C+(e.pageX-S);let r=t/i*100;t>1&&(o.style.width=`${r}%`)}else{const t=C-(e.pageX-S);let r=t/i*100;if(t>1){o.style.width=`${r}%`;let t=(w+(e.pageX-a-S))/i*100;o.style.left=`${t}%`}}}})(e)},document.onkeydown=e=>{"Escape"===e.key&&p&&b()};const _=e=>{const t=l.getBoundingClientRect(),o=f.lastX-l.offsetLeft;var a;a=o-v,g.style.transform=`translateX(${a}px)`,(e=>{if(u){const t=parseInt(u.getAttribute("x"));e<m?(u.setAttribute("x",`${e}px`),u.setAttribute("width",`${Math.abs(e-m)}px`)):(u.setAttribute("x",`${m}px`),u.setAttribute("width",`${Math.abs(e-t)}px`))}})(o),this._VideoPlayer.currentTime=r.duration*(o/t.width),f.lastX=f.x,f.lastY=f.y,i=window.requestAnimationFrame(_)},T="http://www.w3.org/2000/svg",x=document.createElementNS(T,"svg"),$=`gradient-${Date.now()}`,P=document.createElementNS(T,"linearGradient"),M=document.createElementNS(T,"rect");x.setAttribute("width","100%"),x.setAttribute("height","100%"),x.setAttribute("version","1.1"),x.setAttribute("xmlns",T),x.setAttribute("class","VideoOverlays-clipBackground"),P.id=$,P.setAttribute("x1","0"),P.setAttribute("x2","100%"),P.setAttribute("y1","0"),P.setAttribute("y2","0"),x.appendChild(P),M.setAttribute("fill",`url(#${$})`),M.setAttribute("width","100%"),M.setAttribute("height","100%"),x.appendChild(M),this.rootEl.querySelector(".VideoEditor-overlays").appendChild(x);const O=document.createElementNS(T,"svg"),q=document.createElementNS(T,"defs"),k=document.createElementNS(T,"clipPath");O.setAttribute("version","1.1"),O.setAttribute("xmlns",T),O.setAttribute("class","VideoOverlays-clippingSvg"),k.setAttribute("id","VideoEditorOverlays-svgPath"),q.appendChild(k),O.appendChild(q),this.rootEl.querySelector(".VideoEditor-overlays").appendChild(O);const L=(e,t)=>{const i=document.createElementNS(T,"stop");return i.setAttribute("offset",`${e}%`),i.setAttribute("stop-color",`${t}`),i},N=()=>{const e=`gradient-${Date.now()}`;P.id=e,M.setAttribute("fill",`url(#${e})`)},G=()=>{const e=t.getOverlays(),i=r.duration;k.innerHTML="";let o=1;e.forEach(e=>{const t=e.getStartSeconds()/i*100,r=e.getStopSeconds()/i*100,a=document.createElementNS(T,"rect"),s=1===o?4:4*o+4*(o-1);a.setAttribute("x",`${t}%`),a.setAttribute("width",r-t+"%"),a.setAttribute("y",`calc(100% - ${s})`),a.setAttribute("height","4"),k.appendChild(a),o++})},U=e=>{const t=new Set,i=r.duration;P.innerHTML="",e.size?(e.forEach(e=>{const{startTimeSMPTE:r,endTimeSMPTE:o}=e,a=""===r?0:1e3*this.SMPTEToSeconds(r),s=""===o?0:1e3*this.SMPTEToSeconds(o),n=a/1e3/i*100,l=s/1e3/i*100;t.add(n),t.add(l)}),[...t].sort((e,t)=>e-t).forEach((e,t)=>{t%2==0||0===t?(P.append(L(e,"white")),P.append(L(e,"rgb(113, 133, 162)"))):(P.append(L(e,"rgb(113, 133, 162)")),P.append(L(e,"white")))})):P.append(L("0","white"),L("100","white"))};return P.append(L("0","white"),L("100","white")),this.ClipModel.getClips().forEach(e=>{const t=this.fromSMPTEToXCoordinate(e.startTimeSMPTE,r.duration,n),i=this.fromSMPTEToXCoordinate(e.endTimeSMPTE,r.duration,n)-t,{key:o}=e,s=E(n,t+a,i);s.removeAttribute("data-placeholder"),s.setAttribute("data-ref-key",o),V(s)}),U(this.ClipModel.getClips()),this.ClipModel.observe(e=>{e.forEach(e=>{const{key:t,placeholder:i}=e,r=this.rootEl.querySelector(`.VideoEditor-filmstrip .VideoEditorClip-surface[data-placeholder="${i}"]`);t&&r&&(r.removeAttribute("data-placeholder"),r.setAttribute("data-ref-key",t))}),U(e),N()}),this.ClipModel.observeOnRemove(e=>{const t=this.rootEl.querySelector(`.VideoEditor-filmstrip .VideoEditorClip-surface[data-ref-key="${e}"]`);t&&(t.remove(),U(this.ClipModel.getClips())),N()}),_(),this._VideoPlayer.on("playing",e=>{window.cancelAnimationFrame(i)}),{element:l,redrawClips:U,redrawOverlays:G,reset:()=>{G(),U(this.ClipModel.getClips());const e=this.rootEl.querySelector(".VideoOverlays-clippingSvg clipPath");e?e.innerHTML="":console.warn("querySelector('.VideoOverlays-clippingSvg clipPath') returned null. Overlay path may not have reset properly."),N()},setVideo:e=>{r=e}}}createFilmstripPlaceholder(e){const t=this.rootEl.querySelector(".VideoEditorFilmstrip-images"),i=[],r=e.duration/10;for(let e=1;e<=10;e++){const t=(0,o.A)("div",{className:"VideoEditorFilmstrip-placeholder"},(0,o.A)("span",{className:"VideoEditorFilmstrip-placeholderLabel"},`${this.secondsToSMPTE(e*r)}`));i.push(t)}i.forEach(e=>t.appendChild(e))}async createFilmstrip(e,t,i,r){const a=r/10,s=this.rootEl.querySelector(".VideoEditorFilmstrip-images"),n=this.rootEl.querySelector(".VideoEditor-filmstrip"),l=e.cloneNode(!0);l.crossOrigin=p,await new Promise((e,t)=>{l.readyState>=2?e():l.addEventListener("loadedmetadata",t=>{e()})}),l.className="VideoEditor-captureVideo",l.removeAttribute("controls"),l.setAttribute("muted",!0),l.setAttribute("playsinline",!0),e.insertAdjacentElement("afterend",l);const d="http://www.w3.org/2000/svg",c=document.createElementNS(d,"svg"),h=document.createElementNS(d,"defs"),u=document.createElementNS(d,"clipPath");c.setAttribute("version","1.1"),c.setAttribute("xmlns",d),c.setAttribute("class","VideoEditorFilmstrip-clippingSvg"),u.setAttribute("id","VideoEditorFilmstrip-svgPath"),h.appendChild(u),c.appendChild(h);const m=document.createElementNS(d,"rect");m.setAttribute("x","0"),m.setAttribute("width","50%"),m.setAttribute("height","100%"),u.appendChild(m),s.parentElement.appendChild(c);let g=0,v=!1;const y=e=>{if(!v)return(e=>new Promise((t,i)=>{const r=e=>{l.removeEventListener("seeked",r),t()};l.addEventListener("seeked",r),l.currentTime=e}))(e).then(()=>{const e=(0,o.A)("canvas",{width:.2*t,height:.2*i});e.getContext("2d").drawImage(l,0,0,e.width,e.height);const r=(0,o.A)("img");r.crossOrigin=p,r.src=e.toDataURL(),s.children[g].replaceWith(r),++g}).catch(e=>{v=!0,console.warn(`Video screen shot failed due to:\n${e}`)})},f=()=>{n.classList.add("is-clipped");let e=s.querySelectorAll("img");e.length||(e=s.querySelectorAll("img, .VideoEditorFilmstrip-placeholder")),e.forEach(e=>{this.rootEl.querySelector(".VideoEditorFilmstrip-clips").append(e.cloneNode(!0))})},b=t=>{const i=e.duration;u.innerHTML="",t.forEach(e=>{const t=document.createElementNS(d,"rect"),r=this.fromSMPTEToXCoordinate(e.startTimeSMPTE,i,n),o=this.fromSMPTEToXCoordinate(e.endTimeSMPTE,i,n)-r,{width:a}=n.getBoundingClientRect(),s=r/a*100,l=o/a*100;t.setAttribute("x",`${s}%`),t.setAttribute("width",`${l}%`),t.setAttribute("height","100%"),t.setAttribute("data-ref-key",e.key||e.placeholder),u.appendChild(t)})};for(let e=1;e<=10;e++)await y(e*a);l.remove(),this.ClipModel.getClips().size&&f(),b(this.ClipModel.getClips()),this.ClipModel.observe(e=>{0===this.rootEl.querySelector(".VideoEditorFilmstrip-clips").childElementCount&&f(),b(e)}),this.ClipModel.observeOnRemove(e=>{const t=u.querySelector(`rect[data-ref-key="${e}"]`);t&&t.remove(),this.ClipModel.getClips().size||(n.classList.remove("is-clipped"),this.rootEl.querySelector(".VideoEditorFilmstrip-clips").innerHTML="")})}resetFilmstrip(){const e=this.rootEl.querySelector(".VideoEditorFilmstrip-clippingSvg");e?e.remove():console.warn("querySelector('.VideoEditorFilmstrip-clippingSvg') returned null. Filmstrip clip-path may not have reset properly."),this.rootEl.querySelector(".VideoEditorFilmstrip-images").innerHTML=""}_applyInitialValues(e){e.forEach(e=>{const t=(i=e.element.querySelectorAll("input[name]"),[...i].reduce((e,t)=>{const i=t.name.substring(t.name.lastIndexOf("/")+1);return Object.assign(e,{[i]:"checkbox"===t.type?t.checked:t.value}),e},{}));var i;e.handleUpdate(t)})}_createClippingUI(e){const t=new Map;e.classList.contains("is-inHiddenCluster")&&e.classList.remove("is-inHiddenCluster");const i=(0,o.A)("div",{class:"VideoEditor-ClippingUI","data-tab":"Clip"},(0,o.A)("h2","Click on the filmstrip area to clip your video."),(0,o.A)("em",{},"Tip: Creating a clip can be cancelled by pressing the escape key."),this.originEl.querySelector('[data-name$="/frameRate"]'),e);(0,n.A)(e,".RCIG-list > li:not(.is-removing)",e=>{if(e.classList.contains("is-collapsed")){const t=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window}),i=e.querySelector(".RCIG-title");i.dispatchEvent(t),i.dispatchEvent(t)}}),(0,n.A)(e,".RCIG-item.is-removing",async e=>{const i=await(async e=>new Promise((t,i)=>{(0,n.A)(e,".CIG",e=>{const i=e.getAttribute("data-id").split("/")[0];t(i)})}))(e);t.delete(i)}),(0,n.A)(e,".RCIG-list > li:not(.is-removing) .CIG",e=>{const t=e.getAttribute("data-id").split("/")[0],i=e.querySelector('[data-name$="startTimecode"] textarea').value,r=e.querySelector('[data-name$="endTimecode"] textarea').value;let o=`placeholder-${Date.now()}`;this.ClipModel.getClips().forEach((e,t)=>{t.includes("placeholder")&&(o=t)}),this.ClipModel.addClip({placeholder:o,key:t,startTimeSMPTE:i,endTimeSMPTE:r})}),(0,n.A)(e,".RCIG-list > li .RCIG-remove",e=>{e.onclick=e=>{const t=e.currentTarget.parentNode.querySelector(".CIG").getAttribute("data-id").split("/")[0];this.ClipModel.removeClip(t)}});const r=()=>{i.querySelector(".RCIG-add").click()};return this.ClipModel.observe(e=>{e.forEach(e=>{const{key:t,placeholder:o,startTimeSMPTE:a,endTimeSMPTE:s}=e;if(!t&&o)r();else{const e=i.querySelector('[data-name$="/clippings"]').querySelector(`.CIG[data-id="${t}"]`),r=e.querySelector('[data-name$="startTimecode"] textarea'),o=e.querySelector('[data-name$="endTimecode"] textarea');r.value=a,o.value=s,r.dispatchEvent(new Event("change",{bubbles:!0})),o.dispatchEvent(new Event("change",{bubbles:!0}))}})}),this.ClipModel.observeOnRemove(t=>{const i=e.querySelector(`.RCIG-list .CIG[data-id="${t}"]`),r=i.closest("li");if(i&&r&&!r.classList.contains("is-removing")){const e=i.parentNode.querySelector(".RCIG-remove");e&&e.click()}}),{createClip:r,element:i,handleUpdate:e=>{},reset:()=>{e.querySelectorAll(".RCIG-list > li:not(.is-removing) .RCIG-remove").forEach(e=>{e.click()})}}}_createColorUI(){const e={hue:0,saturation:50,brightness:50,contrast:50},t=new Map,i=e=>{const{hue:t,saturation:i,brightness:r,contrast:o}={...e};""!==t&&d.noUiSlider.set(t),""!==i&&h.noUiSlider.set(i),""!==r&&p.noUiSlider.set(r),""!==o&&g.noUiSlider.set(o)},r=(e,t=100)=>2*parseFloat(e)/100*t,a=(e,i)=>{let r="";const o=[...this.rootEl.querySelectorAll(".VideoEditor-stage-main video")];i?t.set(e,i):t.delete(e),t.forEach((e,t)=>{r+=` ${t}(${e}) `}),o.forEach(e=>e.style.filter=`${r.trim()}`)},s=this.originEl.querySelector(".VideoEditor-InputColors"),n=s.querySelector('input[name$="hue"]'),l=n.closest(".inputContainer");n.type="range",n.min="-180",n.max="180",n.value=l.hasAttribute("data-interacted")?n.value:e.hue;const d=(0,o.A)("div",{className:"is-slideable"});n.insertAdjacentElement("beforebegin",d),this.createSlider(d,n,e=>{a("hue-rotate",`${e}deg`)});const c=s.querySelector('input[name$="saturation"]');c.type="range",c.min="0",c.max="100";const h=(0,o.A)("div",{className:"is-slideable"});c.insertAdjacentElement("beforebegin",h),this.createSlider(h,c,e=>{a("saturate",`${r(e)}%`)});const u=s.querySelector('input[name$="brightness"]');u.type="range",u.min="0",u.max="100";const p=(0,o.A)("div",{className:"is-slideable"});u.insertAdjacentElement("beforebegin",p),this.createSlider(p,u,e=>{a("brightness",`${r(e)}%`)});const m=s.querySelector('input[name$="contrast"]');m.type="range",m.min="0",m.max="100";const g=(0,o.A)("div",{className:"is-slideable"});m.insertAdjacentElement("beforebegin",g),this.createSlider(g,m,e=>{a("contrast",`${r(e)}%`)});const v=(0,o.A)("div",{class:"VideoEditor-ColorUI","data-tab":"Color"},(0,o.A)("h2","Adjust Color"),(0,o.A)("em","Tip: Increment/decrement with up and down keys after clicking the slider."),s.querySelectorAll(".CIG-row")),y=(0,o.A)("a",{class:"VideoEditor-resetButton",onclick:t=>{t.preventDefault(),t.stopPropagation(),i(e)}},"Reset");return v.append(y),{element:v,handleUpdate:e=>{const{saturation:t,brightness:i,contrast:o,hue:s}={...e};a("saturate",t?`${r(t)}%`:null),a("brightness",i?`${r(i)}%`:null),a("contrast",o?`${r(o)}%`:null),a("hue-rotate",s?`${s}deg`:null)},reset:()=>{i(e)}}}_createOverlayUI(e,t,i){const r=new Map,a=this.originEl.querySelector('[data-field-name="imageOverlayOptions"]');a.removeAttribute("hidden"),(0,n.A)(a,".RCIG-list > li .RCIG-remove",e=>{e.onclick=e=>{const t=e.currentTarget.parentNode.querySelector(".VideoEditor-InputOverlay").getAttribute("data-id").split("/")[0],i=this.rootEl.querySelector(`.VideoOverlay-layer[data-name-ref="${t}"]`);i?i.remove():console.warn(`querySelector('.VideoOverlay-layer[data-name-ref="${t}"]') returned null. Overlay layer may not have been removed.`),this._MiniMap.then(e=>{e.redrawOverlays()})}});const s=(0,o.A)("div",{class:"VideoEditor-OverlayUI","data-tab":"Overlay"},(0,o.A)("h2",{},"Add Image Overlays"),(0,o.A)("em",{},"Up to 8 images can be added and overlapped."),a);e.on("timeupdate",e=>{const t=+e.detail.plyr.currentTime;r.forEach(e=>{const i=e.getStartSeconds(),r=e.getStopSeconds();i<=t&&r>=t?e.show():e.hide()})});const l=e=>this.rootEl.querySelector(`.VideoEditor-stage-main .plyr__video-wrapper [data-name-ref="${e}"]`),d=(e,t)=>{this.rootEl.querySelector(".VideoEditor-stage-main .plyr__video-wrapper").querySelector(`[data-name-ref="${e}"]`).style.setProperty("--index",t)},c=e=>new Promise(async(r,a)=>{const s=await h(e),n=s.id,d=(0,o.A)("canvas",{class:"VideoOverlay-layer is-hidden",width:t,height:i}),c=d.getContext("2d");c.drawImage(s.element,10,10);const u=s.element.naturalWidth,p=s.element.naturalHeight;d.setAttribute("data-name-ref",n);const m=this.rootEl.querySelector(".VideoEditor-stage-main .plyr__video-wrapper"),g=m.querySelector(`[data-name-ref="${n}"]`);g?m.replaceChild(d,g):m.appendChild(d);const v=e.querySelector('input[name$="/opacity"]');v.type="range",v.min=0,v.max=100;const y=(0,o.A)("div",{className:"is-slideable"});v.insertAdjacentElement("beforebegin",y);const f=v.getAttribute("name").split("/")[0],b=l(f);this.createSlider(y,v,e=>{var t;t=e/100,b.style.opacity=t});const E=e.querySelector('input[name$="/widthPercent"]'),A=e.querySelector('input[name$="/heightPercent"]'),C=(0,o.A)("input");C.type="range",C.min=1,C.max=100,C.step="1";const w=(0,o.A)("div",{className:"is-slideable"});C.insertAdjacentElement("beforebegin",w),this.createSlider(w,C,e=>{var t;t=e,E.value=parseInt(t),A.value=parseInt(t),E.dispatchEvent(new Event("change",{bubbles:!0})),A.dispatchEvent(new Event("change",{bubbles:!0}))},+E.value);const S=e.querySelector('input[name$="/xPercent"]'),V=e.querySelector('input[name$="/yPercent"]'),I=(e,r)=>{let o=e||0,a=r||0;return o=-1===Math.sign(o)?0:o,a=-1===Math.sign(a)?0:a,{xPercent:parseInt(o/t*100),yPercent:parseInt(a/i*100)}},_=new Map([["0,0","0,0"],["50,0",t/2-u/2+",0"],["100,0",t-u+",0"],["0,50","0,"+(i/2-p/2)],["50,50",`${t/2-u/2},${i/2-p/2}`],["100,50",`${t-u},${i/2-p/2}`],["0,100","0,"+(i-p)],["50,100",`${t/2-u/2},${i-p}`],["100,100",`${t-u},${i-p}`]]),T=(0,o.A)("div",{class:"VideoOverlay-layoutUI"}),x=(e,t)=>{const i=parseInt(e),r=parseInt(t);c.clearRect(0,0,d.width,d.height),c.drawImage(s.element,i,r)},$=e=>{const t=T.querySelector(`[data-coords="${e}"]`);T.querySelectorAll("* > .is-selected").forEach(e=>e.classList.remove("is-selected")),t.classList.add("is-selected")};_.forEach((e,t)=>{const{0:i,1:r}=e.split(","),{xPercent:a,yPercent:s}=I(i,r);T.appendChild((0,o.A)("div",{className:"VideoOverlay-layout-item","data-coords":`${a},${s}`,onclick:e=>{x(i,r),((e,t)=>{const{xPercent:i,yPercent:r}=I(e,t);S.value=i,V.value=r,S.dispatchEvent(new Event("change",{bubbles:!0})),V.dispatchEvent(new Event("change",{bubbles:!0}))})(i,r),$(`${a},${s}`),e.preventDefault()}}))});const P=e.querySelector('textarea[name$="/startTime"]'),M=(0,o.A)("input");M.style.display="none",M.setAttribute("hidden","true"),M.value=P.value?1e3*this.SMPTEToSeconds(P.value):0,M.onchange=e=>{const t=M.value/1e3;P.value=this.secondsToSMPTE(t),this._MiniMap.then(e=>{e.redrawOverlays()}),k(t)};const O=e.querySelector('input[name$="/duration"]'),q=(0,o.A)("div",{className:"is-slideable"});O.insertAdjacentElement("beforebegin",q),O.onchange=e=>{const t=O.value/1e3;this._MiniMap.then(e=>{e.redrawOverlays()}),k(t)},this.createSlider(q,[M,O],e=>{},[+M.value,+O.value],{min:0,max:1e3*this._VideoPlayer.duration},{to:function(e){return parseInt(e)},from:function(e){return parseInt(e)}});const k=e=>{this._VideoPlayer.currentTime=parseFloat(e)},L=e.querySelector('input[name$="/fadeIn"]'),N=e.querySelector('input[name$="/fadeOut"]'),G=e=>{L.value=e,N.value=e,d.style.setProperty("--transitionDuration-millis",`${e}ms`)},U=(0,o.A)("input",{type:"radio",name:`effect-for-${n}`,className:"radio-button",value:0,onchange:e=>{G(0)}}),R=(0,o.A)("input",{type:"radio",name:`effect-for-${n}`,className:"radio-button",value:350,onchange:e=>{G(350)}}),F=(0,o.A)("input",{type:"radio",name:`effect-for-${n}`,className:"radio-button",value:1e3,onchange:e=>{G(1e3)}});e.querySelector('.VideoEditor-InputOverlay > [data-field$="file"]').insertAdjacentElement("afterend",(0,o.A)("div",{className:"CIG-row",visible:!0},[(0,o.A)("div",{className:"CIG-label"},"Position"),T])),e.querySelector('.VideoEditor-InputOverlay > [data-field$="opacity"]').insertAdjacentElement("afterend",(0,o.A)("div",{className:"CIG-row scale",visible:!0},[(0,o.A)("div",{className:"CIG-label"},"Scale"),(0,o.A)("div",{className:"CIG-small"},w)])),e.querySelector('.VideoEditor-InputOverlay > [data-field$="xPercent"]').insertAdjacentElement("beforebegin",(0,o.A)("div",{className:"CIG-row",visible:!0},[(0,o.A)("div",{className:"CIG-label"},"Duration"),(0,o.A)("div",{className:"CIG-small",style:"position:relative"},[M,q])])),e.querySelector('.VideoEditor-InputOverlay > [data-field$="widthPercent"]').insertAdjacentElement("beforebegin",(0,o.A)("div",{className:"CIG-row",visible:!0},[(0,o.A)("div",{className:"CIG-label"},"Fade Effect"),(0,o.A)("div",{className:"CIG-small VideoOverlay-fadeEffect-group"},[(0,o.A)("label",{for:U.id,className:"radio-button-click-target"},U,"None"),(0,o.A)("label",{for:R.id,className:"radio-button-click-target"},R,"Brief"),(0,o.A)("label",{for:F.id,className:"radio-button-click-target"},F,"Gradual")])]));const B=()=>{d.classList.remove("is-hidden"),d.style.opacity=y.noUiSlider.get()/100};(r=>{const{opacity:o,xPercent:a,yPercent:s,widthPercent:l,heightPercent:d,startTime:c,duration:h,fadeIn:u}={...r};if(""!==o&&y.noUiSlider.set(o),""!==a&&""!==s){let e=t*(a/100),r=i*(s/100);e=-1===Math.sign(e)?0:e||0,r=-1===Math.sign(r)?0:r||0,x(e,r),$(`${a},${s}`)}""!==l&&""!==d?w.noUiSlider.set(l):w.noUiSlider.set(50);const p=""!==c?this.SMPTEToSeconds(c):0,m=""!==c?1e3*p:0,g=h||parseFloat(1e3*this._VideoPlayer.duration);q.noUiSlider.set([+m,+g]);const v=u;if(""!==v){const t=e.querySelector(`input[name="effect-for-${n}"][value="${v}"]`);t&&(t.checked=!0,G(v))}B()})([e.querySelector('input[name$="/opacity"]'),e.querySelector('input[name$="/xPercent"]'),e.querySelector('input[name$="/yPercent"]'),e.querySelector('input[name$="/widthPercent"]'),e.querySelector('input[name$="/heightPercent"]'),e.querySelector('textarea[name$="/startTime"]'),e.querySelector('input[name$="/duration"]'),e.querySelector('input[name$="/fadeIn"]'),e.querySelector('input[name$="/fadeOut"]')].reduce((e,t)=>{const i=t.name.substring(t.name.lastIndexOf("/")+1);return Object.assign(e,{[i]:"checkbox"===t.type?t.checked:t.value}),e},{})),e.querySelectorAll('.CIG-row[data-name$="/xPercent"], .CIG-row[data-name$="/yPercent"], .CIG-row[data-name$="/widthPercent"], .CIG-row[data-name$="/heightPercent"], .CIG-row[data-name$="/startTime"], .CIG-row[data-name$="/duration"], .CIG-row[data-name$="/fadeIn"], .CIG-row[data-name$="/fadeOut"]').forEach(e=>{e.classList.add("is-hidden")}),this._MiniMap.then(e=>{e.redrawOverlays()}),r({item:e,hide:()=>{d.classList.add("is-hidden"),d.style.opacity=0},show:B,getStartSeconds:()=>M.value/1e3,getStopSeconds:()=>O.value/1e3,remove:()=>{d.classList.add("is-removing")}})}).catch(e=>{console.warn(`Overlay failed to initialize due to: \n${e}`)});(0,n.A)(a,".RCIG-list",e=>{new MutationObserver(e=>{e.forEach(e=>{if(e.addedNodes.length){const t=e.addedNodes[0].querySelector(".CIG");t&&t.closest("ol").childNodes.forEach(async(e,t)=>{const i=await u(e);d(i,t),this._MiniMap.then(e=>{e.redrawOverlays()})})}})}).observe(e,{attributes:!1,childList:!0})});const h=e=>new Promise((t,i)=>{(0,n.A)(e,".filePreview",e=>{if(e){const i=new MutationObserver(r=>{r.some(r=>{if(r.target.classList.contains("is-imageEditorLoaded")){i.disconnect();const r=e.querySelector("img.cropper-hide");if(!r)return;const o=e.parentElement.getAttribute("data-name").split("/")[0];r.setAttribute("class","VideoOverlay-image"),r.setAttribute("style",`filter:${r.style.filter}`),r.setAttribute("data-name-ref",o),r.closest(".VideoEditor-InputOverlay").classList.add("is-overlay-ready"),t({id:o,element:r})}})});return i.observe(e,{attributeFilter:["class"]}),!0}})}),u=async e=>new Promise((t,i)=>{(0,n.A)(e,".filePreview",e=>{const i=e.parentElement.getAttribute("data-name").split("/")[0];t(i)})});return(0,n.A)(a,".RCIG-list .VideoEditor-InputOverlay",e=>{c(e).then(async e=>{const t=await u(e.item);r.set(t,e),d(t,(e=>{const t=e.closest("li");return[...t.parentNode.children].indexOf(t)})(e.item)),this._MiniMap.then(e=>{e.redrawOverlays()})}).catch(e=>{console.warn(`Failed to initialize Overlay due to: \n${e}`)})}),(0,n.A)(a,".RCIG-item.is-removing",async e=>{const t=await u(e);r.get(t).remove(),r.delete(t)}),(0,n.A)(a,".RCIG-list > li:not(.is-removing)",e=>{if(e.classList.contains("is-collapsed")){const t=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window}),i=e.querySelector(".RCIG-title");i.dispatchEvent(t),i.dispatchEvent(t)}}),{element:s,handleUpdate:e=>{},getOverlays:()=>{let e=[];return a.querySelectorAll(".RCIG-list .RCIG-item:not(.is-removing) .VideoEditor-InputOverlay.is-overlay-ready").forEach(t=>{const i=r.get(t.getAttribute("data-object-id"));i&&e.push(i)}),e},reset:()=>{a.querySelectorAll(".RCIG-list > li:not(.is-removing) .RCIG-remove").forEach(e=>{e.click()})}}}_createVideoPlayer(e){const t=e.cloneNode(!0);return this.originEl.appendChild(t),new Promise((e,i)=>{this._VideoPlayer=new d.A(t,{hideControls:!1,invertTime:!1,controls:["play","progress","current-time","mute","volume"]}),this._VideoPlayer.on("ready",t=>{e()})})}_updateVideoState(e){const t=document.querySelector(".Page-content .content-edit");this._currentVideoState&&t.classList.remove(this._currentVideoState),t.classList.add(e),this._currentVideoState=e}}let g=null;(0,n.A)(".VideoEditor",e=>{g=new m(e),(e=>{const t=(0,r.A)(e,".CIG-row");(0,n.A)(t,".fileSelector",t=>{const i=t.querySelector("select");i?i.addEventListener("change",t=>{var i;g&&(i=e,document.querySelector(".Page-content .content-edit").classList.remove(g.getState()),g._VideoPlayer.destroy(),i.querySelectorAll("video").forEach(e=>e.remove()),g.rootEl.querySelector(".VideoEditor-stage video").remove(),g._initVideo().then(async e=>{const t=g.rootEl.querySelector(".VideoEditor-stage-main");g._updateVideoState(h),await g._createVideoPlayer(e),t.appendChild(g._VideoPlayer.elements.container),g._ColorUI&&g._ColorUI.reset(),g._OverlayUI&&g._OverlayUI.reset(),g._ClippingUI&&g._ClippingUI.reset(),g._MiniMap.then(t=>{t.reset(),t.setVideo(e)}),g.resetFilmstrip(),g.createFilmstripPlaceholder(e),await g.createFilmstrip(e,e.videoWidth,e.videoHeight,e.duration)}))}):console.warn("Missing <select> in .fileSelector element!")})})(e)})},85235(e,t,i){i.d(t,{A:()=>n});var r=i(64664),o=i.n(r),a=i(25243),s=i.n(a)()(o());s.push([e.id,'.is-VideoEditorLoading .FilePreview-actions *{visibility:hidden}.is-VideoEditorLoaded .FilePreview-actions *{visibility:visible}.is-VideoEditorOpen .VideoEditor-stage{opacity:1}[dir] .is-VideoEditorOpen .VideoEditor-stage{transform:none}.VideoEditor-fileContainer>:not([data-name$="/file"]),.VideoEditor-InputColors{display:none}.VideoEditor-stage{--VideoEditor-asideWidth:440px;--VideoEditor-bottomHeight:221px;bottom:0;display:block;opacity:0;position:fixed;top:var(--Page-headerBottom);transition:opacity var(--time-xs) var(--ease-in),transform var(--time-s) var(--ease-out);z-index:1000}[dir] .VideoEditor-stage{background:var(--color-white);transform:scaleY(0);transform-origin:bottom}[dir=ltr] .VideoEditor-stage,[dir=rtl] .VideoEditor-stage{left:0;right:0}[dir=ltr] .CIG .VideoEditor-stage>.TabBar,[dir=rtl] .CIG .VideoEditor-stage>.TabBar{margin-left:0;margin-right:0}.VideoEditor-stage>[data-tab]{height:calc(100% - var(--gap-m) * 2 - var(--lineHeight-m))}.VideoEditor-stage-closeButton{color:var(--color-white);position:absolute;top:calc(var(--gap-l) - var(--gap-s))}[dir] .VideoEditor-stage-closeButton{background:var(--Link-color);border-color:var(--Link-color)}[dir=ltr] .VideoEditor-stage-closeButton{right:calc(var(--gap-l) - var(--gap-s))}[dir=rtl] .VideoEditor-stage-closeButton{left:calc(var(--gap-l) - var(--gap-s))}.VideoEditor-stage-closeButton:focus,.VideoEditor-stage-closeButton:hover{color:var(--color-white)}[dir] .VideoEditor-stage-closeButton:focus,[dir] .VideoEditor-stage-closeButton:hover{background:var(--Link-hoverColor);border-color:var(--Link-hoverColor)}.VideoEditor-stage-aside{bottom:0;display:flex;flex-flow:column wrap;position:absolute;top:0;width:var(--VideoEditor-asideWidth)}[dir=ltr] .VideoEditor-stage-aside{right:0}[dir=rtl] .VideoEditor-stage-aside{left:0}.VideoEditor-stage-aside .TC-unselected,.VideoEditor-stage-aside input[type=range]{display:none}.VideoEditorAside-top{align-items:center;display:flex;flex-direction:row;height:calc(var(--gap-l) * 3)}[dir] .VideoEditorAside-top{padding:var(--gap-l)}.VideoEditorAside-top>h2:first-of-type{font-size:var(--fontSize-xl);font-weight:400}.VideoEditorAside-body{max-height:calc(100% - (var(--gap-l) * 3));overflow:auto;width:100%}[dir] .VideoEditorAside-body{padding:0 var(--gap-l) var(--gap-m) var(--gap-l)}.VideoEditor-stage-main{bottom:var(--VideoEditor-bottomHeight);display:flex;justify-content:center;position:absolute;top:0}[dir] .VideoEditor-stage-main{background-color:var(--color-gray1);background-size:50px 50px}[dir=ltr] .VideoEditor-stage-main{background-image:linear-gradient(-45deg,var(--color-gray1),var(--color-gray1) 25%,var(--color-gray2) 0,var(--color-gray2) 50%,var(--color-gray1) 0,var(--color-gray1) 75%,var(--color-gray2) 0);left:0;right:var(--VideoEditor-asideWidth)}[dir=rtl] .VideoEditor-stage-main{background-image:linear-gradient(45deg,var(--color-gray1),var(--color-gray1) 25%,var(--color-gray2) 0,var(--color-gray2) 50%,var(--color-gray1) 0,var(--color-gray1) 75%,var(--color-gray2) 0);right:0;left:var(--VideoEditor-asideWidth)}.VideoEditor-stage-bottom{bottom:0;height:var(--VideoEditor-bottomHeight);position:absolute}[dir] .VideoEditor-stage-bottom{background:#ececee;padding:var(--gap-l)}[dir=ltr] .VideoEditor-stage-bottom{left:0;right:var(--VideoEditor-asideWidth)}[dir=rtl] .VideoEditor-stage-bottom{right:0;left:var(--VideoEditor-asideWidth)}.VideoEditor-stage-bottom:before{color:var(--color-gray6);content:"Overlays";font-size:12px;position:absolute;text-transform:uppercase;top:calc(var(--gap-l) + 4px);writing-mode:vertical-rl}[dir=ltr] .VideoEditor-stage-bottom:before{left:0;text-align:right;transform:rotate(180deg)}[dir=rtl] .VideoEditor-stage-bottom:before{right:0;text-align:left;transform:rotate(-180deg)}.VideoEditor-stage-bottom:after{content:"";height:100%;position:absolute;top:0;width:1px;z-index:1}[dir=ltr] .VideoEditor-stage-bottom:after{right:0}[dir=rtl] .VideoEditor-stage-bottom:after{left:0}.VideoEditor-captureVideo{height:3px;width:auto}.VideoEditor-minimap{display:flex;flex-direction:column;position:relative}[dir] .VideoEditor-minimap{cursor:copy}[dir] .VideoEditor-minimap.is-selecting{cursor:col-resize}.VideoEditor-minimap .playhead{height:100%;pointer-events:none;position:absolute;width:1px;z-index:1}[dir] .VideoEditor-minimap .playhead{background:var(--color-black)}.VideoEditor-minimap .playhead:after{content:"";height:0;position:absolute;width:0}[dir] .VideoEditor-minimap .playhead:after{border-bottom:10px solid var(--color-black)}[dir=ltr] .VideoEditor-minimap .playhead:after{border-left:10px solid transparent;border-right:10px solid transparent;transform:translate(-9.5px,-9px) rotate(180deg)}[dir=rtl] .VideoEditor-minimap .playhead:after{border-right:10px solid transparent;border-left:10px solid transparent;transform:translate(9.5px,-9px) rotate(-180deg)}.VideoEditor-minimap .playhead.is-hidden{opacity:.25}.VideoEditorClip-surface{bottom:0;height:100%;position:absolute;z-index:4}[dir] .VideoEditorClip-surface{padding:2px 0}.VideoEditorClip-surface:hover .VideoEditorClip-resizeUI{display:block;opacity:1}[dir=ltr] .VideoEditorClip-surface:hover .VideoEditorClip-resizeUI,[dir=rtl] .VideoEditorClip-surface:hover .VideoEditorClip-resizeUI{animation:none}.VideoEditor-overlays{height:65px;position:relative}[dir] .VideoEditor-overlays{margin-bottom:8px}.VideoOverlays-clippingSvg{height:100%;position:absolute;top:0;width:100%}[dir=ltr] .VideoOverlays-clippingSvg{left:0}[dir=rtl] .VideoOverlays-clippingSvg{right:0}.VideoOverlays-clipBackground{clip-path:url(#VideoEditorOverlays-svgPath)}.VideoEditor-filmstrip{display:block;height:96px;position:relative;width:100%}.VideoEditorFilmstrip-placeholder{align-items:center;display:flex;justify-content:center}[dir] .VideoEditorFilmstrip-placeholder{background-color:var(--color-black);background-repeat:no-repeat;background-size:5% 8%,5% 8%,5% 8%,5% 8%,5% 8%,5% 8%,5% 8%,5% 8%,5% 8%,5% 8%,5% 8%,5% 8%,5% 8%,5% 8%,5% 8%,5% 8%,5% 8%,5% 8%,5% 8%,5% 8%,5% 8%,5% 8%}[dir=ltr] .VideoEditorFilmstrip-placeholder{background-image:linear-gradient(90deg,#ececee,#ececee),linear-gradient(90deg,#ececee,#ececee),linear-gradient(90deg,#ececee,#ececee),linear-gradient(90deg,#ececee,#ececee),linear-gradient(90deg,#ececee,#ececee),linear-gradient(90deg,#ececee,#ececee),linear-gradient(90deg,#ececee,#ececee),linear-gradient(90deg,#ececee,#ececee),linear-gradient(90deg,#ececee,#ececee),linear-gradient(90deg,#ececee,#ececee),linear-gradient(90deg,#ececee,#ececee),linear-gradient(90deg,#ececee,#ececee),linear-gradient(90deg,#ececee,#ececee),linear-gradient(90deg,#ececee,#ececee),linear-gradient(90deg,#ececee,#ececee),linear-gradient(90deg,#ececee,#ececee),linear-gradient(90deg,#ececee,#ececee),linear-gradient(90deg,#ececee,#ececee),linear-gradient(90deg,#ececee,#ececee),linear-gradient(90deg,#ececee,#ececee),linear-gradient(90deg,#ececee,#ececee),linear-gradient(90deg,#ececee,#ececee);background-position:5% 5%,15% 5%,25% 5%,35% 5%,45% 5%,55% 5%,65% 5%,75% 5%,85% 5%,95% 5%,5% 95%,15% 95%,25% 95%,35% 95%,45% 95%,55% 95%,65% 95%,75% 95%,85% 95%,95% 95%}[dir=rtl] .VideoEditorFilmstrip-placeholder{background-image:linear-gradient(270deg,#ececee,#ececee),linear-gradient(270deg,#ececee,#ececee),linear-gradient(270deg,#ececee,#ececee),linear-gradient(270deg,#ececee,#ececee),linear-gradient(270deg,#ececee,#ececee),linear-gradient(270deg,#ececee,#ececee),linear-gradient(270deg,#ececee,#ececee),linear-gradient(270deg,#ececee,#ececee),linear-gradient(270deg,#ececee,#ececee),linear-gradient(270deg,#ececee,#ececee),linear-gradient(270deg,#ececee,#ececee),linear-gradient(270deg,#ececee,#ececee),linear-gradient(270deg,#ececee,#ececee),linear-gradient(270deg,#ececee,#ececee),linear-gradient(270deg,#ececee,#ececee),linear-gradient(270deg,#ececee,#ececee),linear-gradient(270deg,#ececee,#ececee),linear-gradient(270deg,#ececee,#ececee),linear-gradient(270deg,#ececee,#ececee),linear-gradient(270deg,#ececee,#ececee),linear-gradient(270deg,#ececee,#ececee),linear-gradient(270deg,#ececee,#ececee);background-position:95% 5%,85% 5%,75% 5%,65% 5%,55% 5%,45% 5%,35% 5%,25% 5%,15% 5%,5% 5%,95% 95%,85% 95%,75% 95%,65% 95%,55% 95%,45% 95%,35% 95%,25% 95%,15% 95%,5% 95%}.VideoEditorFilmstrip-placeholderLabel{align-items:center;color:var(--color-white);display:flex;font-size:var(--fontSize-xs);height:68%;justify-content:center;position:relative;width:97%}[dir] .VideoEditorFilmstrip-placeholderLabel{background:hsla(0,0%,91.4%,.2)}.VideoEditorFilmstrip-selectionContainer{height:100%;position:absolute;top:0;width:100%;z-index:3}.VideoEditorFilmstrip-selection{fill:none;shape-rendering:geometricPrecision;stroke:#fff;stroke-dasharray:6px;stroke-dashoffset:12px;stroke-width:2px;vector-effect:non-scaling-stroke}[dir=ltr] .VideoEditorFilmstrip-selection,[dir=rtl] .VideoEditorFilmstrip-selection{animation:stroke .2s linear infinite}@keyframes stroke{to{stroke-dashoffset:0}}.VideoEditorFilmstrip-clippingSvg{height:100%;position:absolute;width:100%}.VideoEditorFilmstrip-clips,.VideoEditorFilmstrip-images{display:flex;height:96px;pointer-events:none}.VideoEditorFilmstrip-clips{bottom:0;clip-path:url(#VideoEditorFilmstrip-svgPath);position:absolute;top:0}[dir=ltr] .VideoEditorFilmstrip-clips,[dir=rtl] .VideoEditorFilmstrip-clips{left:0;right:0}.VideoEditorFilmstrip-clips>img,.VideoEditorFilmstrip-images>img,.VideoEditorFilmstrip-placeholder{object-fit:cover;pointer-events:none;width:10%}.VideoEditor-filmstrip.is-clipped .VideoEditorFilmstrip-images{filter:brightness(.4) saturate(.4)}.VideoEditorClip-resizeUI{box-sizing:border-box;height:100%;opacity:1;outline:2px solid var(--color-blue5);width:100%}[dir=ltr] .VideoEditorClip-resizeUI,[dir=rtl] .VideoEditorClip-resizeUI{animation:intro .2s ease-out .2s forwards}@keyframes intro{to{opacity:.3}}.VideoEditorClip-resizerLeft{height:20px;position:absolute;top:calc(50% - 10px);transition:transform .1s ease;width:20px}[dir] .VideoEditorClip-resizerLeft{background:var(--color-blue5);border-radius:50%;cursor:col-resize}[dir=ltr] .VideoEditorClip-resizerLeft{left:-10px}[dir=rtl] .VideoEditorClip-resizerLeft{right:-10px}[dir] .VideoEditorClip-resizerLeft:hover{transform:scale(1.2)}.VideoEditorClip-resizerRight{height:20px;position:absolute;top:calc(50% - 10px);transition:transform .1s ease;width:20px}[dir] .VideoEditorClip-resizerRight{background:var(--color-blue5);border-radius:50%;cursor:col-resize}[dir=ltr] .VideoEditorClip-resizerRight{right:-10px}[dir=rtl] .VideoEditorClip-resizerRight{left:-10px}[dir] .VideoEditorClip-resizerRight:hover{transform:scale(1.2)}.VideoOverlay-layer{--index:auto;--transitionDuration-millis:0;height:100%;object-fit:contain;opacity:0;pointer-events:none;position:absolute;top:0;transition:opacity var(--transitionDuration-millis) ease;width:100%;z-index:var(--index)}[dir=ltr] .VideoOverlay-layer{left:0}[dir=rtl] .VideoOverlay-layer{right:0}.VideoOverlay-layer.is-removing{visibility:hidden}.VideoOverlay-image{display:block;height:auto;max-width:100%;position:relative}.VideoEditor-OverlayUI .ImageEditor-open{opacity:0;pointer-events:none}.VideoEditor-OverlayUI .RCIG{display:flex;flex-direction:column-reverse;max-width:calc(var(--VideoEditor-asideWidth) - 2 * var(--gap-l))}[dir] .VideoEditor-OverlayUI .RCIG>:last-child{margin-bottom:var(--gap-m)}.VideoEditor-OverlayUI .RCIG-list{display:flex;flex-direction:column-reverse}.VideoEditor-ClippingUI .RCIG-item.is-removing,.VideoEditor-OverlayUI .RCIG-item.is-removing{display:none}.VideoEditor-OverlayUI .RCIG-addSelect{display:flex}.VideoOverlay-layoutUI{display:grid;grid-gap:var(--gap-xs);grid-template-columns:repeat(3,minmax(90px,1fr));grid-template-rows:repeat(3,minmax(40px,60px));width:100%}[dir] .VideoOverlay-layoutUI{margin-top:var(--gap-l)}[dir] .VideoOverlay-layout-item{background:var(--color-gray4);cursor:pointer}[dir] .VideoOverlay-layout-item:hover{background:var(--Input-focusColor)}.VideoOverlay-layout-item:nth-child(5n){display:flex}.VideoOverlay-layout-item:nth-child(5n):after{--Icon-fill:"FILL" 1;display:inline-block;font-family:Material Symbols Outlined;font-feature-settings:"liga";font-size:var(--Icon-size);-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-style:normal;font-variation-settings:var(--Icon-fill);font-weight:400;letter-spacing:normal;line-height:1;position:relative;text-rendering:optimizeLegibility;text-transform:none;top:calc((var(--Text-height) - var(--Icon-size)) / 2);vertical-align:top;white-space:nowrap;word-wrap:normal;align-items:center;color:var(--color-white);content:"play_circle_filled";display:flex;flex:1;justify-content:center}[dir] .VideoOverlay-layout-item:nth-child(5n):after{transform:var(--Icon-transform)}[dir=ltr] .VideoOverlay-layout-item:nth-child(5n):after{direction:ltr}[dir=rtl] .VideoOverlay-layout-item:nth-child(5n):after{direction:rtl}[dir] .VideoOverlay-layout-item.is-selected{background:var(--color-dominant6)}.VideoEditor-InputOverlay.is-overlay-ready .CIG-row[data-name$="/opacity"],.VideoEditor-InputOverlay.is-overlay-ready .CIG-row[visible]{display:block}.VideoEditor-InputOverlay.is-overlay-ready .CIG-row.scale{display:none}.VideoOverlay-fadeEffect-group{display:flex;justify-content:space-between;position:relative}.VideoEditor-resetButton{--Link-color:var(--color-red6);--Link-hoverColor:var(--color-red5);--Link-decoration:none;--Text-height:var(--lineHeight-s);font-size:var(--fontSize-s);line-height:var(--lineHeight-s);align-items:center;display:block}[dir] .VideoEditor-resetButton{margin:var(--gap-l) 0 0 0}.VideoEditor-resetButton:before{--Icon-fill:"FILL" 1;display:inline-block;font-family:Material Symbols Outlined;font-feature-settings:"liga";font-size:var(--Icon-size);-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-style:normal;font-variation-settings:var(--Icon-fill);font-weight:400;letter-spacing:normal;line-height:1;position:relative;text-rendering:optimizeLegibility;text-transform:none;top:calc((var(--Text-height) - var(--Icon-size)) / 2);vertical-align:top;white-space:nowrap;word-wrap:normal;--Icon-size:var(--iconSize-s);content:"refresh"}[dir] .VideoEditor-resetButton:before{transform:var(--Icon-transform)}[dir=ltr] .VideoEditor-resetButton:before{direction:ltr;margin-right:var(--gap-xs)}[dir=rtl] .VideoEditor-resetButton:before{direction:rtl;margin-left:var(--gap-xs)}.VideoEditor-ClippingUI .RCIG-controls,.VideoEditor-ClippingUI ol[data-sortable-input-name$="/clippings"] .CIG-note{display:none}[dir=ltr] .FilePreview-actions>:not(:first-child){margin-left:var(--gap-m)}[dir=rtl] .FilePreview-actions>:not(:first-child){margin-right:var(--gap-m)}[dir=ltr] .VideoEditor-OverlayUI .CIG-row:only-child.is-unlabeled>.CIG-large>.CIG{margin-right:unset}[dir=rtl] .VideoEditor-OverlayUI .CIG-row:only-child.is-unlabeled>.CIG-large>.CIG{margin-left:unset}.VideoEditor-InputOverlay .CIG-row:not([data-name$="/file"]){display:none}.Popup .VideoEditor-InputOverlay .CIG-row:not([data-name$="/file"]),.VideoEditor-InputOverlay .CIG-row[data-name$="/heightPercent"],.VideoEditor-InputOverlay .CIG-row[data-name$="/widthPercent"]{display:initial}[dir] .CIG-row:only-child.is-unlabeled:before{box-shadow:none}[dir=ltr] .CIG-row:only-child.is-unlabeled>.CIG-large>.CIG{padding-right:var(--CIG-padding)}[dir=rtl] .CIG-row:only-child.is-unlabeled>.CIG-large>.CIG{padding-left:var(--CIG-padding)}.VideoEditor-ColorUI .CIG-note,.VideoEditor-OverlayUI .CIG-note{display:none}.VideoEditor-ColorUI .CIG-note .VideoEditor-OverlayUI .RCIG-addSelect,.VideoEditor-OverlayUI .CIG-note .VideoEditor-OverlayUI .RCIG-addSelect{display:flex}.VideoEditor-ColorUI .CIG-row:after,.VideoEditor-OverlayUI .CIG-row:after{display:none}.is-slideable{--Thumb-diameter:1.5em;--Thumb-color:var(--color-dominant6);--Thumb-hover-color:var(--Input-focusColor);--Track-color:var(--color-gray3);--Track-height:4px}.is-slideable.noUi-target{height:20px}[dir] .is-slideable.noUi-target{background:none;border:none;box-shadow:none}.is-slideable.noUi-target:after{content:"";height:var(--Track-height);position:absolute;top:50%;width:100%}[dir] .is-slideable.noUi-target:after{background:var(--Track-color);transform:translateY(-50%)}.is-slideable.noUi-horizontal .noUi-handle{height:var(--Thumb-diameter);top:-2px;width:var(--Thumb-diameter)}[dir] .is-slideable.noUi-horizontal .noUi-handle{background:var(--Thumb-color);border:none;border-radius:100%;box-shadow:none}[dir=ltr] .is-slideable.noUi-horizontal .noUi-handle{left:calc(-1 * var(--Thumb-diameter) / 2)}[dir=rtl] .is-slideable.noUi-horizontal .noUi-handle{right:calc(-1 * var(--Thumb-diameter) / 2)}.is-slideable.noUi-horizontal .noUi-handle:after,.is-slideable.noUi-horizontal .noUi-handle:before{content:none}[dir] .is-slideable.noUi-horizontal .noUi-handle:hover{background:var(--Thumb-hover-color)}[dir] .is-slideable .noUi-connect{background:rgba(14,128,184,.44)}html[dir=ltr]:not([dir=rtl]) .is-slideable.noUi-horizontal .noUi-handle{right:calc(-1 * var(--Thumb-diameter) / 2)}html[dir=rtl]:not([dir=rtl]) .is-slideable.noUi-horizontal .noUi-handle{left:calc(-1 * var(--Thumb-diameter) / 2)}.VideoEditor-stage{--Video-controlsHeight:50px}.VideoEditor-stage .plyr--video{display:flex;flex-direction:column}.VideoEditor-stage .plyr__controls{height:var(--Video-controlsHeight)}.VideoEditor-stage .plyr--video .plyr__controls{order:2;position:relative}[dir] .VideoEditor-stage .plyr--video .plyr__controls{background:var(--color-blue7);padding:10px}.VideoEditor-stage .plyr__volume{display:flex}.VideoEditor-stage .plyr__video-wrapper{height:100%;max-height:calc(100vh - var(--Page-headerBottom) - var(--Video-controlsHeight) - var(--VideoEditor-bottomHeight));width:100%}.VideoEditor-stage .plyr video{height:100%;object-fit:contain;width:100%}',""]);const n=7717==i.j?s:null},11011(e,t,i){i.d(t,{A:()=>n});var r=i(77473),o=i.n(r),a=i(12434),s=i.n(a)()(o());s.push([e.id,"",""]);const n=3324==i.j?s:null},86456(e,t,i){i.r(t),i.d(t,{default:()=>y});var r=i(96291),o=i.n(r),a=i(96918),s=i.n(a),n=i(77322),l=i.n(n),d=i(33419),c=i.n(d),h=i(10207),u=i.n(h),p=i(37746),m=i.n(p),g=i(85235),v={};v.styleTagTransform=m(),v.setAttributes=c(),v.insert=l().bind(null,"head"),v.domAPI=s(),v.insertStyleElement=u(),o()(g.A,v);const y=g.A&&g.A.locals?g.A.locals:void 0},64583(e,t,i){i.r(t),i.d(t,{default:()=>y});var r=i(67290),o=i.n(r),a=i(9727),s=i.n(a),n=i(6323),l=i.n(n),d=i(20610),c=i.n(d),h=i(97398),u=i.n(h),p=i(50555),m=i.n(p),g=i(11011),v={};v.styleTagTransform=m(),v.setAttributes=c(),v.insert=l().bind(null,"head"),v.domAPI=s(),v.insertStyleElement=u(),o()(g.A,v);const y=g.A&&g.A.locals?g.A.locals:void 0}}]);
|
|
1
|
+
/*! For license information please see VideoEditor.11c89dda5cf125738a33.js.LICENSE.txt */
|
|
2
|
+
"use strict";(self.webpackChunkbrightspot_cms=self.webpackChunkbrightspot_cms||[]).push([[8863],{14932(e,t,i){function r(e,t){return e?(Array.isArray(t)&&(t=t.join(",")),e.closest(t)):null}i.d(t,{A:()=>r}),Object.defineProperty(r,"name",{value:"default",configurable:!0})},27741(e,t,i){function r(e,t){return e?(Array.isArray(t)&&(t=t.join(",")),e.closest(t)):null}i.d(t,{A:()=>r}),Object.defineProperty(r,"name",{value:"default",configurable:!0})},40627(e,t,i){function r(e,t){return e?(Array.isArray(t)&&(t=t.join(",")),e.querySelectorAll(t)):[]}i.d(t,{A:()=>r}),Object.defineProperty(r,"name",{value:"default",configurable:!0})},76394(e,t,i){function r(e,t){return e?(Array.isArray(t)&&(t=t.join(",")),e.querySelectorAll(t)):[]}i.d(t,{A:()=>r}),Object.defineProperty(r,"name",{value:"default",configurable:!0})},41044(e,t,i){function r(e,t){if(Array.isArray(e)&&(e=e.join(",")),document.querySelector(e))return void t();let i=!1;const r=new MutationObserver(async()=>{document.querySelector(e)&&(r.disconnect(),i||(i=!0,t()))});r.observe(document,{attributes:!0,childList:!0,subtree:!0})}i.d(t,{A:()=>r})},53853(e,t,i){function r(e,t){if(Array.isArray(e)&&(e=e.join(",")),document.querySelector(e))return void t();let i=!1;const r=new MutationObserver(async()=>{document.querySelector(e)&&(r.disconnect(),i||(i=!0,t()))});r.observe(document,{attributes:!0,childList:!0,subtree:!0})}i.d(t,{A:()=>r})},73609(e,t,i){i.d(t,{A:()=>c}),i(67219),i(44764),i(84978),i(13722),i(39589),i(25809);var r=i(1439),o=i.n(r),a=i(5292);if(7717==i.j)var s=i(26594);if(7717==i.j)var n=i(40627);if(7717==i.j)var l=i(95628);var d=i(66556);class c{constructor(e){this._container=e,this._update=(0,s.A)(this._update.bind(this)),this._update(),window.addEventListener("brightspot-content-state-change",()=>{this._toggle()})}_forEachChild(e){for(const t of this._container.children){const i=t.dataset.tab;void 0!==i&&e(i,t)}}_toArray(e){if(e)try{const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{}return[]}_update(){this._observer&&(this._observer.disconnect(),this._observer=null);const e=(0,a.A)("div",{className:"TabBar",role:"tablist"}),t=(0,a.A)("button",{className:"TabBar-menuToggle",title:window.BRIGHTSPOT?.ui.tooltips.tabs,type:"button","aria-haspopup":"menu","aria-expanded":"false","aria-label":window.BRIGHTSPOT?.ui.tooltips.tabs}),i=(0,a.A)("div",{className:"TabBar-menuList",role:"menu","aria-label":window.BRIGHTSPOT?.ui.tooltips.tabs}),r=(0,a.A)("div",{className:"TabBar-menu"},t,i);t.onclick=()=>{(0,d.AM)(i,t,e)};const o="MENU"===this._container.dataset.tcMode,s=this._container.dataset.tcMain,c=this._toArray(this._container.dataset.tcExceptions),h=new Set;this._defaultTab=null;for(const e of this._container.children){const t=e.dataset.tab;void 0!==t&&(h.has(t)||(this._defaultTab||(this._defaultTab=t),h.add(t)))}const u=this._toArray(this._container.dataset.tcStart),p=this._toArray(this._container.dataset.tcEnd),m=[];for(const e of u)h.has(e)&&m.push(e);for(const e of h)u.includes(e)||p.includes(e)||m.push(e);for(const e of p)h.has(e)&&m.push(e);for(const t of m){const r=c.indexOf(t)>-1?o?e:i:o?i:e;r.insertBefore((0,a.A)("button",{className:"TabBar-item",dataset:{tab:t},role:"tab",onclick:e=>{e.preventDefault(),this.select(t,e)},onkeydown:e=>{var t=e.currentTarget,i=t.closest(".TabBar");switch(e.key){case"ArrowRight":return void(t.nextSibling?t.nextSibling.focus():i.firstChild.focus());case"ArrowLeft":return void(t.previousSibling?t.previousSibling.focus():i.lastChild.focus())}}},t),t===s?r.firstChild:null)}m.includes(s)&&(this._defaultTab=s),1===e.children.length&&i.insertBefore(e.children[0],i.firstChild);for(const e of i.children)e.className="TabBar-menuItem",e.setAttribute("role","menuitem");if((0,d.D1)(i,t),this._bar&&(this._bar.remove(),this._bar=null,this._menu=null,this._menuToggle=null,this._menuList=null),0===m.length||m.length<2&&!this._container.getAttribute("data-show-tabs")){this._container.dataset.tabless="true";const e=this._container.querySelectorAll(":scope > .TC-unselected");return void Array.from(e).forEach(e=>{e.classList.remove("TC-unselected")})}this._bar=e,this._container.insertBefore(e,this._container.firstChild),i.children.length>0&&(0===e.children.length&&(e.classList.add("is-menuOnly"),e.removeAttribute("role")),this._menu=r,this._menuToggle=t,this._menuList=i,this._bar.appendChild(r));const g=this._toggle();g.includes(this._defaultTab)||(this._defaultTab=g[0]),e.hidden=1===Array.from(i.children).filter(e=>!e.hidden).length;let v=!1;for(const e of(0,n.A)(this._container,".CIG-row > .Message.is-error")){let t,i=e;do{t=i,i=t.parentNode}while(i!==this._container);const r=(0,l.A)(this._bar,`[data-tab="${t.dataset.tab}"]`);r&&!r.classList.contains("is-error")&&(r.classList.add("is-error"),r.classList.contains("TabBar-menuItem")&&(v=!0))}v&&e.classList.add("is-menuError"),this.select()}_toggle(){const e=[];this._forEachChild((t,i)=>{i.hidden||i instanceof HTMLHeadingElement||e.push(t)});for(const t of[this._bar,this._menuList])if(t)for(const i of t.children)i!==this._menu&&(i.hidden=!e.includes(i.dataset.tab));return e}select(e,t){const i=e&&this._container.closest(".ContentEdit.is-new, .StandardForm.is-new");if(e||(e=this._defaultTab),this._bar&&!this._bar.classList.contains("is-menuOnly"))for(const t of this._bar.children){const i=t.dataset.tab===e;t.classList.toggle("is-selected",i),t.setAttribute("aria-selected",i),i?t.removeAttribute("tabindex"):t.setAttribute("tabindex","-1")}if(this._menuList){let t=!1;for(const i of this._menuList.children)i.classList.toggle("is-selected",i.dataset.tab===e)&&(t=e!==this._defaultTab);this._bar.classList.toggle("is-menuSelected",t),this._menuToggle.innerText=t?e:""}if(this._forEachChild((t,i)=>{i.classList.toggle("TC-unselected",t!==e)}),window.dispatchEvent(new Event("resize")),o()(this._container).find("> [data-tab]").trigger("tabbedShow"),o()(this._bar).trigger("tabbed-select"),i){const t=this._container.querySelector(`:scope > .CIG-row:not(.inputContainer-readOnly)[data-tab="${e}"] > .CIG-label > label`)?.htmlFor;t&&document.getElementById(t)?.focus()}else t&&t.target.scrollIntoView({block:"nearest"})}}},9216(e,t,i){i.d(t,{A:()=>c}),i(86634),i(57573),i(49371),i(42723),i(26780),i(96648);var r=i(88630),o=i.n(r),a=i(18101);if(3324==i.j)var s=i(39403);if(3324==i.j)var n=i(76394);if(3324==i.j)var l=i(60021);var d=i(79365);class c{constructor(e){this._container=e,this._update=(0,s.A)(this._update.bind(this)),this._update(),window.addEventListener("brightspot-content-state-change",()=>{this._toggle()})}_forEachChild(e){for(const t of this._container.children){const i=t.dataset.tab;void 0!==i&&e(i,t)}}_toArray(e){if(e)try{const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{}return[]}_update(){this._observer&&(this._observer.disconnect(),this._observer=null);const e=(0,a.A)("div",{className:"TabBar",role:"tablist"}),t=(0,a.A)("button",{className:"TabBar-menuToggle",title:window.BRIGHTSPOT?.ui.tooltips.tabs,type:"button","aria-haspopup":"menu","aria-expanded":"false","aria-label":window.BRIGHTSPOT?.ui.tooltips.tabs}),i=(0,a.A)("div",{className:"TabBar-menuList",role:"menu","aria-label":window.BRIGHTSPOT?.ui.tooltips.tabs}),r=(0,a.A)("div",{className:"TabBar-menu"},t,i);t.onclick=()=>{(0,d.AM)(i,t,e)};const o="MENU"===this._container.dataset.tcMode,s=this._container.dataset.tcMain,c=this._toArray(this._container.dataset.tcExceptions),h=new Set;this._defaultTab=null;for(const e of this._container.children){const t=e.dataset.tab;void 0!==t&&(h.has(t)||(this._defaultTab||(this._defaultTab=t),h.add(t)))}const u=this._toArray(this._container.dataset.tcStart),p=this._toArray(this._container.dataset.tcEnd),m=[];for(const e of u)h.has(e)&&m.push(e);for(const e of h)u.includes(e)||p.includes(e)||m.push(e);for(const e of p)h.has(e)&&m.push(e);for(const t of m){const r=c.indexOf(t)>-1?o?e:i:o?i:e;r.insertBefore((0,a.A)("button",{className:"TabBar-item",dataset:{tab:t},role:"tab",onclick:e=>{e.preventDefault(),this.select(t,e)},onkeydown:e=>{var t=e.currentTarget,i=t.closest(".TabBar");switch(e.key){case"ArrowRight":return void(t.nextSibling?t.nextSibling.focus():i.firstChild.focus());case"ArrowLeft":return void(t.previousSibling?t.previousSibling.focus():i.lastChild.focus())}}},t),t===s?r.firstChild:null)}m.includes(s)&&(this._defaultTab=s),1===e.children.length&&i.insertBefore(e.children[0],i.firstChild);for(const e of i.children)e.className="TabBar-menuItem",e.setAttribute("role","menuitem");if((0,d.D1)(i,t),this._bar&&(this._bar.remove(),this._bar=null,this._menu=null,this._menuToggle=null,this._menuList=null),0===m.length||m.length<2&&!this._container.getAttribute("data-show-tabs")){this._container.dataset.tabless="true";const e=this._container.querySelectorAll(":scope > .TC-unselected");return void Array.from(e).forEach(e=>{e.classList.remove("TC-unselected")})}this._bar=e,this._container.insertBefore(e,this._container.firstChild),i.children.length>0&&(0===e.children.length&&(e.classList.add("is-menuOnly"),e.removeAttribute("role")),this._menu=r,this._menuToggle=t,this._menuList=i,this._bar.appendChild(r));const g=this._toggle();g.includes(this._defaultTab)||(this._defaultTab=g[0]),e.hidden=1===Array.from(i.children).filter(e=>!e.hidden).length;let v=!1;for(const e of(0,n.A)(this._container,".CIG-row > .Message.is-error")){let t,i=e;do{t=i,i=t.parentNode}while(i!==this._container);const r=(0,l.A)(this._bar,`[data-tab="${t.dataset.tab}"]`);r&&!r.classList.contains("is-error")&&(r.classList.add("is-error"),r.classList.contains("TabBar-menuItem")&&(v=!0))}v&&e.classList.add("is-menuError"),this.select()}_toggle(){const e=[];this._forEachChild((t,i)=>{i.hidden||i instanceof HTMLHeadingElement||e.push(t)});for(const t of[this._bar,this._menuList])if(t)for(const i of t.children)i!==this._menu&&(i.hidden=!e.includes(i.dataset.tab));return e}select(e,t){const i=e&&this._container.closest(".ContentEdit.is-new, .StandardForm.is-new");if(e||(e=this._defaultTab),this._bar&&!this._bar.classList.contains("is-menuOnly"))for(const t of this._bar.children){const i=t.dataset.tab===e;t.classList.toggle("is-selected",i),t.setAttribute("aria-selected",i),i?t.removeAttribute("tabindex"):t.setAttribute("tabindex","-1")}if(this._menuList){let t=!1;for(const i of this._menuList.children)i.classList.toggle("is-selected",i.dataset.tab===e)&&(t=e!==this._defaultTab);this._bar.classList.toggle("is-menuSelected",t),this._menuToggle.innerText=t?e:""}if(this._forEachChild((t,i)=>{i.classList.toggle("TC-unselected",t!==e)}),window.dispatchEvent(new Event("resize")),o()(this._container).find("> [data-tab]").trigger("tabbedShow"),o()(this._bar).trigger("tabbed-select"),i){const t=this._container.querySelector(`:scope > .CIG-row:not(.inputContainer-readOnly)[data-tab="${e}"] > .CIG-label > label`)?.htmlFor;t&&document.getElementById(t)?.focus()}else t&&t.target.scrollIntoView({block:"nearest"})}}},36245(e,t,i){i.r(t),i.d(t,{default:()=>m}),i(67219),i(44764),i(84978),i(13722),i(25809),i(91672),i(92280);var r=i(14932),o=i(5292),a=i(74336),s=i.n(a),n=(i(93916),i(32246)),l=i(41044),d=i(60994),c=(i(25317),i(73609));const h="is-VideoEditorLoaded",u="is-VideoEditorOpen",p="use-credentials";class m{constructor(e){this.getState=()=>this._currentVideoState,this.SMPTEToSeconds=(e,t=24)=>{const i=e.split(":"),r=Number(i[3]),o=1/t*(isNaN(r)?0:r);return 60*Number(i[0])*60+60*Number(i[1])+Number(i[2])+o},this.secondsToSMPTE=(e,t=24)=>{const i=new Date;function r(e){return e<10?"0"+e:e}return i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(1e3*e),"hh:mm:ss:ff".replace(/hh|mm|ss|ff/g,function(o){switch(o){case"hh":return r(i.getHours()<13?i.getHours():i.getHours()-12);case"mm":return r(i.getMinutes());case"ss":return r(i.getSeconds());case"ff":return r(Math.floor(e%1*t))}})},this.isIntersecting=(e,t)=>e.left<=t.right&&t.left<=e.right&&e.top<=t.bottom&&t.top<=e.bottom,this.fromSMPTEToXCoordinate=(e,t,i)=>{const r=1e3*this.SMPTEToSeconds(e)/(1e3*t),{width:o}=i.getBoundingClientRect();return o*r},this.combine=(e,t)=>{const i=Math.max(e.left,t.left),r=Math.max(e.top,t.top);return{x:i,y:r,intersectionWidth:Math.min(e.left+e.width,t.left+t.width)-i,height:Math.min(e.top+e.height,t.top+t.height)-r}},this.createSlider=(e,t,i,r=null,o=null,a=null)=>{let n=null;const l=Array.isArray(t)?t:[t];r&&(n=Array.isArray(r)?r:[r]);const d=l.map(e=>e.value),c=l.map(e=>+e.getAttribute("min")),h=l.map(e=>+e.getAttribute("max"));let u={start:n||d,connect:!0,range:o||{min:c,max:h}};a&&(u.format=a),s().create(e,u),e.noUiSlider.on("update",(e,t)=>{const r=e[t];i(r)}),e.noUiSlider.on("set",(e,t)=>{l[t].value=e[t],l[t].dispatchEvent(new Event("change",{bubbles:!0}))})},this.originEl=e,this.rootEl=this.originEl.closest("form");const t=(0,o.A)("div",{class:"VideoEditorAside-top"},[(0,o.A)("h2","Edit Video"),(0,o.A)("button",{className:"VideoEditor-stage-closeButton",name:"action-done",onclick:e=>{this._VideoPlayer.pause(),this.rootEl.classList.remove(u),e.preventDefault()}},"Done")]),i=(0,o.A)("div",{class:"VideoEditorAside-body"}),r=(0,o.A)("div",{class:"VideoEditor-stage-aside"},[t,i]);this.ClipModel={clips:new Map,observers:[],observersOnRemove:[],addClip:function(e){const{key:t,placeholder:i}=e;if(t&&i)if(this.clips.has(i)){const r={...this.clips.get(i)};this.clips.set(t,{...e,...r}),this.clips.delete(i)}else if(this.clips.has(t)){const i={...this.clips.get(t),...e};this.clips.delete(t),this.clips.set(t,i)}this.clips.has(t)||this.clips.set(t||i,e),this.notify()},removeClip:function(e){this.clips.has(e)&&(this.clips.delete(e),this.notifyOnRemove(e))},getClips:function(){return this.clips},observe:function(e){this.observers.push(e)},observeOnRemove:function(e){this.observersOnRemove.push(e)},notifyOnRemove:function(e){this.observersOnRemove.forEach(t=>t(e))},notify:function(){this.observers.forEach(e=>e(this.clips))}},(0,n.A)(this.originEl,".FilePreview-actions",e=>{e.insertAdjacentElement("beforeend",(0,o.A)("a",{class:"icon icon-action-edit",href:"#",onclick:e=>{this.rootEl.querySelectorAll("video").forEach(e=>e.pause()),this.rootEl.classList.add(u)}},"Edit"))}),this.rootEl.insertAdjacentElement("beforeend",(0,o.A)("div",{class:"VideoEditor-stage"},r)),this._initVideo().then(async e=>{this._updateVideoState(h),await this._createVideoPlayer(e),r.insertAdjacentElement("beforebegin",(0,o.A)("div",{class:"VideoEditor-stage-main"},this._VideoPlayer.elements.container)),r.insertAdjacentElement("beforebegin",(0,o.A)("div",{className:"VideoEditor-stage-bottom"},(0,o.A)("div",{className:"VideoEditor-minimap"},[(0,o.A)("div",{className:"VideoEditor-overlays"}),(0,o.A)("div",{className:"VideoEditor-filmstrip"},[(0,o.A)("div",{className:"VideoEditorFilmstrip-images"}),(0,o.A)("div",{className:"VideoEditorFilmstrip-clips"})])]))),this._ColorUI=this._createColorUI(),await new Promise((e,t)=>{(0,n.A)(this.originEl,'[data-field-name="clippings"]',t=>{e(t)})}).then(e=>{this._ClippingUI=this._createClippingUI(e)}).catch(e=>{console.warn(`Failed to create the Clipping UI due to: ${e}`)}),this._OverlayUI=this._createOverlayUI(this._VideoPlayer,e.videoWidth,e.videoHeight),this._MiniMap=this._createMiniMap(e,this._OverlayUI),this._ColorUI&&i.append(this._ColorUI.element),this._OverlayUI&&i.append(this._OverlayUI.element),this._ClippingUI&&i.append(this._ClippingUI.element),new c.A(i),this._applyInitialValues([this._ColorUI,this._OverlayUI,this._ClippingUI])})}async _initVideo(){return this._updateVideoState("is-VideoEditorLoading"),new Promise((e,t)=>{const i=".VideoEditor-fileContainer video:not(.VideoEditor-captureVideo):not(.awsElementalVideo)";(0,l.A)(i,()=>{const t=document.querySelector(i);t.readyState>=2?e(t):t.addEventListener("loadedmetadata",i=>{e(t)})})})}async _createMiniMap(e,t){let i=null,r=e;const a=24,s="is-selecting",n=this.rootEl.querySelector(".VideoEditor-filmstrip"),l=this.rootEl.querySelector(".VideoEditor-minimap");this.createFilmstripPlaceholder(r),await this.createFilmstrip(this.originEl.querySelector(".FilePreview-actions + video"),r.videoWidth,r.videoHeight,r.duration);let d,c,h=!1,u=null,p=!1,m=0;const g=(0,o.A)("span",{className:"playhead"});l.appendChild(g);const v=parseInt(g.offsetWidth)/2,y=e=>{const t=e/this.rootEl.querySelector(".VideoEditor-filmstrip").offsetWidth;return 1e3*r.duration*t},f={_x:0,x:0,setOrigin:e=>{this._x=e.offsetLeft}};f.setOrigin(l);const b=()=>{l.classList.remove(s),u&&u.remove(),window.cancelAnimationFrame(i),u=null,p=!1},E=(e,t,i)=>{const{width:r}=e.getBoundingClientRect();let s=(t-a)/r*100,n=i/r*100;const l=this.rootEl.querySelectorAll(".VideoEditor-filmstrip .VideoEditorClip-surface"),d=`placeholder-${Date.now()}`,c=(0,o.A)("div",{classList:"VideoEditorClip-surface","data-placeholder":d});let h;return c.style.left=`${s}%`,c.style.width=`${n}%`,e.appendChild(c),l.forEach(e=>{if(c===e)return;const t=c.getBoundingClientRect(),i=e.getBoundingClientRect();if(this.isIntersecting(t,i)){const o=this.combine(t,i);i.left<t.left&&(s=(i.left-a)/r*100,c.style.left=`${s}%`),h=t.width+i.width-o.intersectionWidth,n=h/r*100,c.style.width=`${n}%`,this.ClipModel.removeClip(e.getAttribute("data-ref-key"))}}),c};let A=null,C=0,w=0,S=0;const V=e=>{const t=(0,o.A)("div",{className:"VideoEditorClip-resizerLeft"}),i=(0,o.A)("div",{className:"VideoEditorClip-resizerRight"});e.appendChild((0,o.A)("div",{className:"VideoEditorClip-resizeUI"},[t,i]))},I=e=>{m=e.x-a;const t=this.rootEl.querySelector(".VideoEditor-filmstrip"),i=m/l.offsetWidth,o=r.duration*i*1e3;if(u){const e=u;p=!1,u=!1,c=o;const{x:i,width:r}=e.getBoundingClientRect(),n=E(t,i,r);V(n),e.parentElement.remove(),l.classList.remove(s);const{x:h,width:m}=n.getBoundingClientRect();d=y(h-a),c=y(h+m-a);const g=n.getAttribute("data-placeholder"),v=this.secondsToSMPTE(d/1e3),f=this.secondsToSMPTE(c/1e3);this.ClipModel.addClip({placeholder:g,startTimeSMPTE:v,endTimeSMPTE:f})}else{p=!0,l.classList.add(s);const e=(e=>{const t="http://www.w3.org/2000/svg",i=document.createElementNS(t,"svg");i.setAttribute("class","VideoEditorFilmstrip-selectionContainer"),i.setAttribute("preserveAspectRatio","none");const r=document.createElementNS(t,"rect");return r.setAttribute("class","VideoEditorFilmstrip-selection"),r.setAttribute("x",`${e}`),r.setAttribute("height","100%"),i.appendChild(r),r})(m);t.appendChild(e.parentElement),u=e,d=o}};this.rootEl.querySelector(".VideoEditor-stage-bottom").onmouseleave=e=>{b()},l.onmousedown=e=>{A=e.target;var t;A.classList.contains("VideoEditorClip-resizerLeft")||A.classList.contains("VideoEditorClip-resizerRight")?(e.preventDefault(),t=A.closest(".VideoEditorClip-surface"),h=t,C=parseFloat(window.getComputedStyle(t,null).getPropertyValue("width").replace("px","")),w=t.getBoundingClientRect().left,S=f.x):I(e)},l.onmouseup=e=>{if(h){const e=h,t=`placeholder-${Date.now()}`;let i;e.setAttribute("data-placeholder",t),h=!1,this.rootEl.querySelectorAll(".VideoEditor-filmstrip .VideoEditorClip-surface").forEach(t=>{if(e===t)return;const r=e.getBoundingClientRect(),o=t.getBoundingClientRect();if(this.isIntersecting(r,o)){const s=this.combine(r,o);o.left<r.left&&(e.style.left=o.left-a+"px"),i=r.width+o.width-s.intersectionWidth,e.style.width=`${i}px`,this.ClipModel.removeClip(t.getAttribute("data-ref-key"))}});const{x:r,width:o}=e.getBoundingClientRect();d=y(r-a),c=y(r+o-a);const s=this.secondsToSMPTE(d/1e3),n=this.secondsToSMPTE(c/1e3);this.ClipModel.addClip({key:e.getAttribute("data-ref-key"),placeholder:e.getAttribute("data-placeholder"),startTimeSMPTE:s,endTimeSMPTE:n})}},l.onmouseenter=e=>{this._VideoPlayer.stop(),window.cancelAnimationFrame(i),i=window.requestAnimationFrame(_),g.classList.remove("is-hidden")},l.onmouseleave=e=>{window.cancelAnimationFrame(i),g.classList.add("is-hidden")},l.onmousemove=e=>{f.x=e.pageX,f.clientX=e.clientX,h&&(e=>{const t=n.getBoundingClientRect(),{width:i}=t,r=f.x-t.left,o=A.closest(".VideoEditorClip-surface");if(r<=0)o.style.left="0%";else{if(r>=t.width){const e=100-parseFloat(o.style.left);return void(o.style.width=`${e}%`)}if(A.classList.contains("VideoEditorClip-resizerRight")){const t=C+(e.pageX-S);let r=t/i*100;t>1&&(o.style.width=`${r}%`)}else{const t=C-(e.pageX-S);let r=t/i*100;if(t>1){o.style.width=`${r}%`;let t=(w+(e.pageX-a-S))/i*100;o.style.left=`${t}%`}}}})(e)},document.onkeydown=e=>{"Escape"===e.key&&p&&b()};const _=e=>{const t=l.getBoundingClientRect(),o=f.lastX-l.offsetLeft;var a;a=o-v,g.style.transform=`translateX(${a}px)`,(e=>{if(u){const t=parseInt(u.getAttribute("x"));e<m?(u.setAttribute("x",`${e}px`),u.setAttribute("width",`${Math.abs(e-m)}px`)):(u.setAttribute("x",`${m}px`),u.setAttribute("width",`${Math.abs(e-t)}px`))}})(o),this._VideoPlayer.currentTime=r.duration*(o/t.width),f.lastX=f.x,f.lastY=f.y,i=window.requestAnimationFrame(_)},T="http://www.w3.org/2000/svg",x=document.createElementNS(T,"svg"),$=`gradient-${Date.now()}`,P=document.createElementNS(T,"linearGradient"),M=document.createElementNS(T,"rect");x.setAttribute("width","100%"),x.setAttribute("height","100%"),x.setAttribute("version","1.1"),x.setAttribute("xmlns",T),x.setAttribute("class","VideoOverlays-clipBackground"),P.id=$,P.setAttribute("x1","0"),P.setAttribute("x2","100%"),P.setAttribute("y1","0"),P.setAttribute("y2","0"),x.appendChild(P),M.setAttribute("fill",`url(#${$})`),M.setAttribute("width","100%"),M.setAttribute("height","100%"),x.appendChild(M),this.rootEl.querySelector(".VideoEditor-overlays").appendChild(x);const O=document.createElementNS(T,"svg"),q=document.createElementNS(T,"defs"),k=document.createElementNS(T,"clipPath");O.setAttribute("version","1.1"),O.setAttribute("xmlns",T),O.setAttribute("class","VideoOverlays-clippingSvg"),k.setAttribute("id","VideoEditorOverlays-svgPath"),q.appendChild(k),O.appendChild(q),this.rootEl.querySelector(".VideoEditor-overlays").appendChild(O);const L=(e,t)=>{const i=document.createElementNS(T,"stop");return i.setAttribute("offset",`${e}%`),i.setAttribute("stop-color",`${t}`),i},N=()=>{const e=`gradient-${Date.now()}`;P.id=e,M.setAttribute("fill",`url(#${e})`)},G=()=>{const e=t.getOverlays(),i=r.duration;k.innerHTML="";let o=1;e.forEach(e=>{const t=e.getStartSeconds()/i*100,r=e.getStopSeconds()/i*100,a=document.createElementNS(T,"rect"),s=1===o?4:4*o+4*(o-1);a.setAttribute("x",`${t}%`),a.setAttribute("width",r-t+"%"),a.setAttribute("y",`calc(100% - ${s})`),a.setAttribute("height","4"),k.appendChild(a),o++})},U=e=>{const t=new Set,i=r.duration;P.innerHTML="",e.size?(e.forEach(e=>{const{startTimeSMPTE:r,endTimeSMPTE:o}=e,a=""===r?0:1e3*this.SMPTEToSeconds(r),s=""===o?0:1e3*this.SMPTEToSeconds(o),n=a/1e3/i*100,l=s/1e3/i*100;t.add(n),t.add(l)}),[...t].sort((e,t)=>e-t).forEach((e,t)=>{t%2==0||0===t?(P.append(L(e,"white")),P.append(L(e,"rgb(113, 133, 162)"))):(P.append(L(e,"rgb(113, 133, 162)")),P.append(L(e,"white")))})):P.append(L("0","white"),L("100","white"))};return P.append(L("0","white"),L("100","white")),this.ClipModel.getClips().forEach(e=>{const t=this.fromSMPTEToXCoordinate(e.startTimeSMPTE,r.duration,n),i=this.fromSMPTEToXCoordinate(e.endTimeSMPTE,r.duration,n)-t,{key:o}=e,s=E(n,t+a,i);s.removeAttribute("data-placeholder"),s.setAttribute("data-ref-key",o),V(s)}),U(this.ClipModel.getClips()),this.ClipModel.observe(e=>{e.forEach(e=>{const{key:t,placeholder:i}=e,r=this.rootEl.querySelector(`.VideoEditor-filmstrip .VideoEditorClip-surface[data-placeholder="${i}"]`);t&&r&&(r.removeAttribute("data-placeholder"),r.setAttribute("data-ref-key",t))}),U(e),N()}),this.ClipModel.observeOnRemove(e=>{const t=this.rootEl.querySelector(`.VideoEditor-filmstrip .VideoEditorClip-surface[data-ref-key="${e}"]`);t&&(t.remove(),U(this.ClipModel.getClips())),N()}),_(),this._VideoPlayer.on("playing",e=>{window.cancelAnimationFrame(i)}),{element:l,redrawClips:U,redrawOverlays:G,reset:()=>{G(),U(this.ClipModel.getClips());const e=this.rootEl.querySelector(".VideoOverlays-clippingSvg clipPath");e?e.innerHTML="":console.warn("querySelector('.VideoOverlays-clippingSvg clipPath') returned null. Overlay path may not have reset properly."),N()},setVideo:e=>{r=e}}}createFilmstripPlaceholder(e){const t=this.rootEl.querySelector(".VideoEditorFilmstrip-images"),i=[],r=e.duration/10;for(let e=1;e<=10;e++){const t=(0,o.A)("div",{className:"VideoEditorFilmstrip-placeholder"},(0,o.A)("span",{className:"VideoEditorFilmstrip-placeholderLabel"},`${this.secondsToSMPTE(e*r)}`));i.push(t)}i.forEach(e=>t.appendChild(e))}async createFilmstrip(e,t,i,r){const a=r/10,s=this.rootEl.querySelector(".VideoEditorFilmstrip-images"),n=this.rootEl.querySelector(".VideoEditor-filmstrip"),l=e.cloneNode(!0);l.crossOrigin=p,await new Promise((e,t)=>{l.readyState>=2?e():l.addEventListener("loadedmetadata",t=>{e()})}),l.className="VideoEditor-captureVideo",l.removeAttribute("controls"),l.setAttribute("muted",!0),l.setAttribute("playsinline",!0),e.insertAdjacentElement("afterend",l);const d="http://www.w3.org/2000/svg",c=document.createElementNS(d,"svg"),h=document.createElementNS(d,"defs"),u=document.createElementNS(d,"clipPath");c.setAttribute("version","1.1"),c.setAttribute("xmlns",d),c.setAttribute("class","VideoEditorFilmstrip-clippingSvg"),u.setAttribute("id","VideoEditorFilmstrip-svgPath"),h.appendChild(u),c.appendChild(h);const m=document.createElementNS(d,"rect");m.setAttribute("x","0"),m.setAttribute("width","50%"),m.setAttribute("height","100%"),u.appendChild(m),s.parentElement.appendChild(c);let g=0,v=!1;const y=e=>{if(!v)return(e=>new Promise((t,i)=>{const r=e=>{l.removeEventListener("seeked",r),t()};l.addEventListener("seeked",r),l.currentTime=e}))(e).then(()=>{const e=(0,o.A)("canvas",{width:.2*t,height:.2*i});e.getContext("2d").drawImage(l,0,0,e.width,e.height);const r=(0,o.A)("img");r.crossOrigin=p,r.src=e.toDataURL(),s.children[g].replaceWith(r),++g}).catch(e=>{v=!0,console.warn(`Video screen shot failed due to:\n${e}`)})},f=()=>{n.classList.add("is-clipped");let e=s.querySelectorAll("img");e.length||(e=s.querySelectorAll("img, .VideoEditorFilmstrip-placeholder")),e.forEach(e=>{this.rootEl.querySelector(".VideoEditorFilmstrip-clips").append(e.cloneNode(!0))})},b=t=>{const i=e.duration;u.innerHTML="",t.forEach(e=>{const t=document.createElementNS(d,"rect"),r=this.fromSMPTEToXCoordinate(e.startTimeSMPTE,i,n),o=this.fromSMPTEToXCoordinate(e.endTimeSMPTE,i,n)-r,{width:a}=n.getBoundingClientRect(),s=r/a*100,l=o/a*100;t.setAttribute("x",`${s}%`),t.setAttribute("width",`${l}%`),t.setAttribute("height","100%"),t.setAttribute("data-ref-key",e.key||e.placeholder),u.appendChild(t)})};for(let e=1;e<=10;e++)await y(e*a);l.remove(),this.ClipModel.getClips().size&&f(),b(this.ClipModel.getClips()),this.ClipModel.observe(e=>{0===this.rootEl.querySelector(".VideoEditorFilmstrip-clips").childElementCount&&f(),b(e)}),this.ClipModel.observeOnRemove(e=>{const t=u.querySelector(`rect[data-ref-key="${e}"]`);t&&t.remove(),this.ClipModel.getClips().size||(n.classList.remove("is-clipped"),this.rootEl.querySelector(".VideoEditorFilmstrip-clips").innerHTML="")})}resetFilmstrip(){const e=this.rootEl.querySelector(".VideoEditorFilmstrip-clippingSvg");e?e.remove():console.warn("querySelector('.VideoEditorFilmstrip-clippingSvg') returned null. Filmstrip clip-path may not have reset properly."),this.rootEl.querySelector(".VideoEditorFilmstrip-images").innerHTML=""}_applyInitialValues(e){e.forEach(e=>{const t=(i=e.element.querySelectorAll("input[name]"),[...i].reduce((e,t)=>{const i=t.name.substring(t.name.lastIndexOf("/")+1);return Object.assign(e,{[i]:"checkbox"===t.type?t.checked:t.value}),e},{}));var i;e.handleUpdate(t)})}_createClippingUI(e){const t=new Map;e.classList.contains("is-inHiddenCluster")&&e.classList.remove("is-inHiddenCluster");const i=(0,o.A)("div",{class:"VideoEditor-ClippingUI","data-tab":"Clip"},(0,o.A)("h2","Click on the filmstrip area to clip your video."),(0,o.A)("em",{},"Tip: Creating a clip can be cancelled by pressing the escape key."),this.originEl.querySelector('[data-name$="/frameRate"]'),e);(0,n.A)(e,".RCIG-list > li:not(.is-removing)",e=>{if(e.classList.contains("is-collapsed")){const t=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window}),i=e.querySelector(".RCIG-title");i.dispatchEvent(t),i.dispatchEvent(t)}}),(0,n.A)(e,".RCIG-item.is-removing",async e=>{const i=await(async e=>new Promise((t,i)=>{(0,n.A)(e,".CIG",e=>{const i=e.getAttribute("data-id").split("/")[0];t(i)})}))(e);t.delete(i)}),(0,n.A)(e,".RCIG-list > li:not(.is-removing) .CIG",e=>{const t=e.getAttribute("data-id").split("/")[0],i=e.querySelector('[data-name$="startTimecode"] textarea').value,r=e.querySelector('[data-name$="endTimecode"] textarea').value;let o=`placeholder-${Date.now()}`;this.ClipModel.getClips().forEach((e,t)=>{t.includes("placeholder")&&(o=t)}),this.ClipModel.addClip({placeholder:o,key:t,startTimeSMPTE:i,endTimeSMPTE:r})}),(0,n.A)(e,".RCIG-list > li .RCIG-remove",e=>{e.onclick=e=>{const t=e.currentTarget.parentNode.querySelector(".CIG").getAttribute("data-id").split("/")[0];this.ClipModel.removeClip(t)}});const r=()=>{i.querySelector(".RCIG-add").click()};return this.ClipModel.observe(e=>{e.forEach(e=>{const{key:t,placeholder:o,startTimeSMPTE:a,endTimeSMPTE:s}=e;if(!t&&o)r();else{const e=i.querySelector('[data-name$="/clippings"]').querySelector(`.CIG[data-id="${t}"]`),r=e.querySelector('[data-name$="startTimecode"] textarea'),o=e.querySelector('[data-name$="endTimecode"] textarea');r.value=a,o.value=s,r.dispatchEvent(new Event("change",{bubbles:!0})),o.dispatchEvent(new Event("change",{bubbles:!0}))}})}),this.ClipModel.observeOnRemove(t=>{const i=e.querySelector(`.RCIG-list .CIG[data-id="${t}"]`),r=i.closest("li");if(i&&r&&!r.classList.contains("is-removing")){const e=i.parentNode.querySelector(".RCIG-remove");e&&e.click()}}),{createClip:r,element:i,handleUpdate:e=>{},reset:()=>{e.querySelectorAll(".RCIG-list > li:not(.is-removing) .RCIG-remove").forEach(e=>{e.click()})}}}_createColorUI(){const e={hue:0,saturation:50,brightness:50,contrast:50},t=new Map,i=e=>{const{hue:t,saturation:i,brightness:r,contrast:o}={...e};""!==t&&d.noUiSlider.set(t),""!==i&&h.noUiSlider.set(i),""!==r&&p.noUiSlider.set(r),""!==o&&g.noUiSlider.set(o)},r=(e,t=100)=>2*parseFloat(e)/100*t,a=(e,i)=>{let r="";const o=[...this.rootEl.querySelectorAll(".VideoEditor-stage-main video")];i?t.set(e,i):t.delete(e),t.forEach((e,t)=>{r+=` ${t}(${e}) `}),o.forEach(e=>e.style.filter=`${r.trim()}`)},s=this.originEl.querySelector(".VideoEditor-InputColors"),n=s.querySelector('input[name$="hue"]'),l=n.closest(".inputContainer");n.type="range",n.min="-180",n.max="180",n.value=l.hasAttribute("data-interacted")?n.value:e.hue;const d=(0,o.A)("div",{className:"is-slideable"});n.insertAdjacentElement("beforebegin",d),this.createSlider(d,n,e=>{a("hue-rotate",`${e}deg`)});const c=s.querySelector('input[name$="saturation"]');c.type="range",c.min="0",c.max="100";const h=(0,o.A)("div",{className:"is-slideable"});c.insertAdjacentElement("beforebegin",h),this.createSlider(h,c,e=>{a("saturate",`${r(e)}%`)});const u=s.querySelector('input[name$="brightness"]');u.type="range",u.min="0",u.max="100";const p=(0,o.A)("div",{className:"is-slideable"});u.insertAdjacentElement("beforebegin",p),this.createSlider(p,u,e=>{a("brightness",`${r(e)}%`)});const m=s.querySelector('input[name$="contrast"]');m.type="range",m.min="0",m.max="100";const g=(0,o.A)("div",{className:"is-slideable"});m.insertAdjacentElement("beforebegin",g),this.createSlider(g,m,e=>{a("contrast",`${r(e)}%`)});const v=(0,o.A)("div",{class:"VideoEditor-ColorUI","data-tab":"Color"},(0,o.A)("h2","Adjust Color"),(0,o.A)("em","Tip: Increment/decrement with up and down keys after clicking the slider."),s.querySelectorAll(".CIG-row")),y=(0,o.A)("a",{class:"VideoEditor-resetButton",onclick:t=>{t.preventDefault(),t.stopPropagation(),i(e)}},"Reset");return v.append(y),{element:v,handleUpdate:e=>{const{saturation:t,brightness:i,contrast:o,hue:s}={...e};a("saturate",t?`${r(t)}%`:null),a("brightness",i?`${r(i)}%`:null),a("contrast",o?`${r(o)}%`:null),a("hue-rotate",s?`${s}deg`:null)},reset:()=>{i(e)}}}_createOverlayUI(e,t,i){const r=new Map,a=this.originEl.querySelector('[data-field-name="imageOverlayOptions"]');a.removeAttribute("hidden"),(0,n.A)(a,".RCIG-list > li .RCIG-remove",e=>{e.onclick=e=>{const t=e.currentTarget.parentNode.querySelector(".VideoEditor-InputOverlay").getAttribute("data-id").split("/")[0],i=this.rootEl.querySelector(`.VideoOverlay-layer[data-name-ref="${t}"]`);i?i.remove():console.warn(`querySelector('.VideoOverlay-layer[data-name-ref="${t}"]') returned null. Overlay layer may not have been removed.`),this._MiniMap.then(e=>{e.redrawOverlays()})}});const s=(0,o.A)("div",{class:"VideoEditor-OverlayUI","data-tab":"Overlay"},(0,o.A)("h2",{},"Add Image Overlays"),(0,o.A)("em",{},"Up to 8 images can be added and overlapped."),a);e.on("timeupdate",e=>{const t=+e.detail.plyr.currentTime;r.forEach(e=>{const i=e.getStartSeconds(),r=e.getStopSeconds();i<=t&&r>=t?e.show():e.hide()})});const l=e=>this.rootEl.querySelector(`.VideoEditor-stage-main .plyr__video-wrapper [data-name-ref="${e}"]`),d=(e,t)=>{this.rootEl.querySelector(".VideoEditor-stage-main .plyr__video-wrapper").querySelector(`[data-name-ref="${e}"]`).style.setProperty("--index",t)},c=e=>new Promise(async(r,a)=>{const s=await h(e),n=s.id,d=(0,o.A)("canvas",{class:"VideoOverlay-layer is-hidden",width:t,height:i}),c=d.getContext("2d");c.drawImage(s.element,10,10);const u=s.element.naturalWidth,p=s.element.naturalHeight;d.setAttribute("data-name-ref",n);const m=this.rootEl.querySelector(".VideoEditor-stage-main .plyr__video-wrapper"),g=m.querySelector(`[data-name-ref="${n}"]`);g?m.replaceChild(d,g):m.appendChild(d);const v=e.querySelector('input[name$="/opacity"]');v.type="range",v.min=0,v.max=100;const y=(0,o.A)("div",{className:"is-slideable"});v.insertAdjacentElement("beforebegin",y);const f=v.getAttribute("name").split("/")[0],b=l(f);this.createSlider(y,v,e=>{var t;t=e/100,b.style.opacity=t});const E=e.querySelector('input[name$="/widthPercent"]'),A=e.querySelector('input[name$="/heightPercent"]'),C=(0,o.A)("input");C.type="range",C.min=1,C.max=100,C.step="1";const w=(0,o.A)("div",{className:"is-slideable"});C.insertAdjacentElement("beforebegin",w),this.createSlider(w,C,e=>{var t;t=e,E.value=parseInt(t),A.value=parseInt(t),E.dispatchEvent(new Event("change",{bubbles:!0})),A.dispatchEvent(new Event("change",{bubbles:!0}))},+E.value);const S=e.querySelector('input[name$="/xPercent"]'),V=e.querySelector('input[name$="/yPercent"]'),I=(e,r)=>{let o=e||0,a=r||0;return o=-1===Math.sign(o)?0:o,a=-1===Math.sign(a)?0:a,{xPercent:parseInt(o/t*100),yPercent:parseInt(a/i*100)}},_=new Map([["0,0","0,0"],["50,0",t/2-u/2+",0"],["100,0",t-u+",0"],["0,50","0,"+(i/2-p/2)],["50,50",`${t/2-u/2},${i/2-p/2}`],["100,50",`${t-u},${i/2-p/2}`],["0,100","0,"+(i-p)],["50,100",`${t/2-u/2},${i-p}`],["100,100",`${t-u},${i-p}`]]),T=(0,o.A)("div",{class:"VideoOverlay-layoutUI"}),x=(e,t)=>{const i=parseInt(e),r=parseInt(t);c.clearRect(0,0,d.width,d.height),c.drawImage(s.element,i,r)},$=e=>{const t=T.querySelector(`[data-coords="${e}"]`);T.querySelectorAll("* > .is-selected").forEach(e=>e.classList.remove("is-selected")),t.classList.add("is-selected")};_.forEach((e,t)=>{const{0:i,1:r}=e.split(","),{xPercent:a,yPercent:s}=I(i,r);T.appendChild((0,o.A)("div",{className:"VideoOverlay-layout-item","data-coords":`${a},${s}`,onclick:e=>{x(i,r),((e,t)=>{const{xPercent:i,yPercent:r}=I(e,t);S.value=i,V.value=r,S.dispatchEvent(new Event("change",{bubbles:!0})),V.dispatchEvent(new Event("change",{bubbles:!0}))})(i,r),$(`${a},${s}`),e.preventDefault()}}))});const P=e.querySelector('textarea[name$="/startTime"]'),M=(0,o.A)("input");M.style.display="none",M.setAttribute("hidden","true"),M.value=P.value?1e3*this.SMPTEToSeconds(P.value):0,M.onchange=e=>{const t=M.value/1e3;P.value=this.secondsToSMPTE(t),this._MiniMap.then(e=>{e.redrawOverlays()}),k(t)};const O=e.querySelector('input[name$="/duration"]'),q=(0,o.A)("div",{className:"is-slideable"});O.insertAdjacentElement("beforebegin",q),O.onchange=e=>{const t=O.value/1e3;this._MiniMap.then(e=>{e.redrawOverlays()}),k(t)},this.createSlider(q,[M,O],e=>{},[+M.value,+O.value],{min:0,max:1e3*this._VideoPlayer.duration},{to:function(e){return parseInt(e)},from:function(e){return parseInt(e)}});const k=e=>{this._VideoPlayer.currentTime=parseFloat(e)},L=e.querySelector('input[name$="/fadeIn"]'),N=e.querySelector('input[name$="/fadeOut"]'),G=e=>{L.value=e,N.value=e,d.style.setProperty("--transitionDuration-millis",`${e}ms`)},U=(0,o.A)("input",{type:"radio",name:`effect-for-${n}`,className:"radio-button",value:0,onchange:e=>{G(0)}}),R=(0,o.A)("input",{type:"radio",name:`effect-for-${n}`,className:"radio-button",value:350,onchange:e=>{G(350)}}),F=(0,o.A)("input",{type:"radio",name:`effect-for-${n}`,className:"radio-button",value:1e3,onchange:e=>{G(1e3)}});e.querySelector('.VideoEditor-InputOverlay > [data-field$="file"]').insertAdjacentElement("afterend",(0,o.A)("div",{className:"CIG-row",visible:!0},[(0,o.A)("div",{className:"CIG-label"},"Position"),T])),e.querySelector('.VideoEditor-InputOverlay > [data-field$="opacity"]').insertAdjacentElement("afterend",(0,o.A)("div",{className:"CIG-row scale",visible:!0},[(0,o.A)("div",{className:"CIG-label"},"Scale"),(0,o.A)("div",{className:"CIG-small"},w)])),e.querySelector('.VideoEditor-InputOverlay > [data-field$="xPercent"]').insertAdjacentElement("beforebegin",(0,o.A)("div",{className:"CIG-row",visible:!0},[(0,o.A)("div",{className:"CIG-label"},"Duration"),(0,o.A)("div",{className:"CIG-small",style:"position:relative"},[M,q])])),e.querySelector('.VideoEditor-InputOverlay > [data-field$="widthPercent"]').insertAdjacentElement("beforebegin",(0,o.A)("div",{className:"CIG-row",visible:!0},[(0,o.A)("div",{className:"CIG-label"},"Fade Effect"),(0,o.A)("div",{className:"CIG-small VideoOverlay-fadeEffect-group"},[(0,o.A)("label",{for:U.id,className:"radio-button-click-target"},U,"None"),(0,o.A)("label",{for:R.id,className:"radio-button-click-target"},R,"Brief"),(0,o.A)("label",{for:F.id,className:"radio-button-click-target"},F,"Gradual")])]));const B=()=>{d.classList.remove("is-hidden"),d.style.opacity=y.noUiSlider.get()/100};(r=>{const{opacity:o,xPercent:a,yPercent:s,widthPercent:l,heightPercent:d,startTime:c,duration:h,fadeIn:u}={...r};if(""!==o&&y.noUiSlider.set(o),""!==a&&""!==s){let e=t*(a/100),r=i*(s/100);e=-1===Math.sign(e)?0:e||0,r=-1===Math.sign(r)?0:r||0,x(e,r),$(`${a},${s}`)}""!==l&&""!==d?w.noUiSlider.set(l):w.noUiSlider.set(50);const p=""!==c?this.SMPTEToSeconds(c):0,m=""!==c?1e3*p:0,g=h||parseFloat(1e3*this._VideoPlayer.duration);q.noUiSlider.set([+m,+g]);const v=u;if(""!==v){const t=e.querySelector(`input[name="effect-for-${n}"][value="${v}"]`);t&&(t.checked=!0,G(v))}B()})([e.querySelector('input[name$="/opacity"]'),e.querySelector('input[name$="/xPercent"]'),e.querySelector('input[name$="/yPercent"]'),e.querySelector('input[name$="/widthPercent"]'),e.querySelector('input[name$="/heightPercent"]'),e.querySelector('textarea[name$="/startTime"]'),e.querySelector('input[name$="/duration"]'),e.querySelector('input[name$="/fadeIn"]'),e.querySelector('input[name$="/fadeOut"]')].reduce((e,t)=>{const i=t.name.substring(t.name.lastIndexOf("/")+1);return Object.assign(e,{[i]:"checkbox"===t.type?t.checked:t.value}),e},{})),e.querySelectorAll('.CIG-row[data-name$="/xPercent"], .CIG-row[data-name$="/yPercent"], .CIG-row[data-name$="/widthPercent"], .CIG-row[data-name$="/heightPercent"], .CIG-row[data-name$="/startTime"], .CIG-row[data-name$="/duration"], .CIG-row[data-name$="/fadeIn"], .CIG-row[data-name$="/fadeOut"]').forEach(e=>{e.classList.add("is-hidden")}),this._MiniMap.then(e=>{e.redrawOverlays()}),r({item:e,hide:()=>{d.classList.add("is-hidden"),d.style.opacity=0},show:B,getStartSeconds:()=>M.value/1e3,getStopSeconds:()=>O.value/1e3,remove:()=>{d.classList.add("is-removing")}})}).catch(e=>{console.warn(`Overlay failed to initialize due to: \n${e}`)});(0,n.A)(a,".RCIG-list",e=>{new MutationObserver(e=>{e.forEach(e=>{if(e.addedNodes.length){const t=e.addedNodes[0].querySelector(".CIG");t&&t.closest("ol").childNodes.forEach(async(e,t)=>{const i=await u(e);d(i,t),this._MiniMap.then(e=>{e.redrawOverlays()})})}})}).observe(e,{attributes:!1,childList:!0})});const h=e=>new Promise((t,i)=>{(0,n.A)(e,".filePreview",e=>{if(e){const i=new MutationObserver(r=>{r.some(r=>{if(r.target.classList.contains("is-imageEditorLoaded")){i.disconnect();const r=e.querySelector("img.cropper-hide");if(!r)return;const o=e.parentElement.getAttribute("data-name").split("/")[0];r.setAttribute("class","VideoOverlay-image"),r.setAttribute("style",`filter:${r.style.filter}`),r.setAttribute("data-name-ref",o),r.closest(".VideoEditor-InputOverlay").classList.add("is-overlay-ready"),t({id:o,element:r})}})});return i.observe(e,{attributeFilter:["class"]}),!0}})}),u=async e=>new Promise((t,i)=>{(0,n.A)(e,".filePreview",e=>{const i=e.parentElement.getAttribute("data-name").split("/")[0];t(i)})});return(0,n.A)(a,".RCIG-list .VideoEditor-InputOverlay",e=>{c(e).then(async e=>{const t=await u(e.item);r.set(t,e),d(t,(e=>{const t=e.closest("li");return[...t.parentNode.children].indexOf(t)})(e.item)),this._MiniMap.then(e=>{e.redrawOverlays()})}).catch(e=>{console.warn(`Failed to initialize Overlay due to: \n${e}`)})}),(0,n.A)(a,".RCIG-item.is-removing",async e=>{const t=await u(e);r.get(t).remove(),r.delete(t)}),(0,n.A)(a,".RCIG-list > li:not(.is-removing)",e=>{if(e.classList.contains("is-collapsed")){const t=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window}),i=e.querySelector(".RCIG-title");i.dispatchEvent(t),i.dispatchEvent(t)}}),{element:s,handleUpdate:e=>{},getOverlays:()=>{let e=[];return a.querySelectorAll(".RCIG-list .RCIG-item:not(.is-removing) .VideoEditor-InputOverlay.is-overlay-ready").forEach(t=>{const i=r.get(t.getAttribute("data-object-id"));i&&e.push(i)}),e},reset:()=>{a.querySelectorAll(".RCIG-list > li:not(.is-removing) .RCIG-remove").forEach(e=>{e.click()})}}}_createVideoPlayer(e){const t=e.cloneNode(!0);return this.originEl.appendChild(t),new Promise((e,i)=>{this._VideoPlayer=new d.A(t,{hideControls:!1,invertTime:!1,controls:["play","progress","current-time","mute","volume"]}),this._VideoPlayer.on("ready",t=>{e()})})}_updateVideoState(e){const t=document.querySelector(".Page-content .content-edit");this._currentVideoState&&t.classList.remove(this._currentVideoState),t.classList.add(e),this._currentVideoState=e}}let g=null;(0,n.A)(".VideoEditor",e=>{g=new m(e),(e=>{const t=(0,r.A)(e,".CIG-row");(0,n.A)(t,".fileSelector",t=>{const i=t.querySelector("select");i?i.addEventListener("change",t=>{var i;g&&(i=e,document.querySelector(".Page-content .content-edit").classList.remove(g.getState()),g._VideoPlayer.destroy(),i.querySelectorAll("video").forEach(e=>e.remove()),g.rootEl.querySelector(".VideoEditor-stage video").remove(),g._initVideo().then(async e=>{const t=g.rootEl.querySelector(".VideoEditor-stage-main");g._updateVideoState(h),await g._createVideoPlayer(e),t.appendChild(g._VideoPlayer.elements.container),g._ColorUI&&g._ColorUI.reset(),g._OverlayUI&&g._OverlayUI.reset(),g._ClippingUI&&g._ClippingUI.reset(),g._MiniMap.then(t=>{t.reset(),t.setVideo(e)}),g.resetFilmstrip(),g.createFilmstripPlaceholder(e),await g.createFilmstrip(e,e.videoWidth,e.videoHeight,e.duration)}))}):console.warn("Missing <select> in .fileSelector element!")})})(e)})},71852(e,t,i){i.r(t),i.d(t,{default:()=>m}),i(86634),i(57573),i(49371),i(42723),i(96648),i(56065),i(56673);var r=i(27741),o=i(18101),a=i(38729),s=i.n(a),n=(i(6725),i(45055)),l=i(53853),d=i(73803),c=(i(12508),i(9216));const h="is-VideoEditorLoaded",u="is-VideoEditorOpen",p="use-credentials";class m{constructor(e){this.getState=()=>this._currentVideoState,this.SMPTEToSeconds=(e,t=24)=>{const i=e.split(":"),r=Number(i[3]),o=1/t*(isNaN(r)?0:r);return 60*Number(i[0])*60+60*Number(i[1])+Number(i[2])+o},this.secondsToSMPTE=(e,t=24)=>{const i=new Date;function r(e){return e<10?"0"+e:e}return i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(1e3*e),"hh:mm:ss:ff".replace(/hh|mm|ss|ff/g,function(o){switch(o){case"hh":return r(i.getHours()<13?i.getHours():i.getHours()-12);case"mm":return r(i.getMinutes());case"ss":return r(i.getSeconds());case"ff":return r(Math.floor(e%1*t))}})},this.isIntersecting=(e,t)=>e.left<=t.right&&t.left<=e.right&&e.top<=t.bottom&&t.top<=e.bottom,this.fromSMPTEToXCoordinate=(e,t,i)=>{const r=1e3*this.SMPTEToSeconds(e)/(1e3*t),{width:o}=i.getBoundingClientRect();return o*r},this.combine=(e,t)=>{const i=Math.max(e.left,t.left),r=Math.max(e.top,t.top);return{x:i,y:r,intersectionWidth:Math.min(e.left+e.width,t.left+t.width)-i,height:Math.min(e.top+e.height,t.top+t.height)-r}},this.createSlider=(e,t,i,r=null,o=null,a=null)=>{let n=null;const l=Array.isArray(t)?t:[t];r&&(n=Array.isArray(r)?r:[r]);const d=l.map(e=>e.value),c=l.map(e=>+e.getAttribute("min")),h=l.map(e=>+e.getAttribute("max"));let u={start:n||d,connect:!0,range:o||{min:c,max:h}};a&&(u.format=a),s().create(e,u),e.noUiSlider.on("update",(e,t)=>{const r=e[t];i(r)}),e.noUiSlider.on("set",(e,t)=>{l[t].value=e[t],l[t].dispatchEvent(new Event("change",{bubbles:!0}))})},this.originEl=e,this.rootEl=this.originEl.closest("form");const t=(0,o.A)("div",{class:"VideoEditorAside-top"},[(0,o.A)("h2","Edit Video"),(0,o.A)("button",{className:"VideoEditor-stage-closeButton",name:"action-done",onclick:e=>{this._VideoPlayer.pause(),this.rootEl.classList.remove(u),e.preventDefault()}},"Done")]),i=(0,o.A)("div",{class:"VideoEditorAside-body"}),r=(0,o.A)("div",{class:"VideoEditor-stage-aside"},[t,i]);this.ClipModel={clips:new Map,observers:[],observersOnRemove:[],addClip:function(e){const{key:t,placeholder:i}=e;if(t&&i)if(this.clips.has(i)){const r={...this.clips.get(i)};this.clips.set(t,{...e,...r}),this.clips.delete(i)}else if(this.clips.has(t)){const i={...this.clips.get(t),...e};this.clips.delete(t),this.clips.set(t,i)}this.clips.has(t)||this.clips.set(t||i,e),this.notify()},removeClip:function(e){this.clips.has(e)&&(this.clips.delete(e),this.notifyOnRemove(e))},getClips:function(){return this.clips},observe:function(e){this.observers.push(e)},observeOnRemove:function(e){this.observersOnRemove.push(e)},notifyOnRemove:function(e){this.observersOnRemove.forEach(t=>t(e))},notify:function(){this.observers.forEach(e=>e(this.clips))}},(0,n.A)(this.originEl,".FilePreview-actions",e=>{e.insertAdjacentElement("beforeend",(0,o.A)("a",{class:"icon icon-action-edit",href:"#",onclick:e=>{this.rootEl.querySelectorAll("video").forEach(e=>e.pause()),this.rootEl.classList.add(u)}},"Edit"))}),this.rootEl.insertAdjacentElement("beforeend",(0,o.A)("div",{class:"VideoEditor-stage"},r)),this._initVideo().then(async e=>{this._updateVideoState(h),await this._createVideoPlayer(e),r.insertAdjacentElement("beforebegin",(0,o.A)("div",{class:"VideoEditor-stage-main"},this._VideoPlayer.elements.container)),r.insertAdjacentElement("beforebegin",(0,o.A)("div",{className:"VideoEditor-stage-bottom"},(0,o.A)("div",{className:"VideoEditor-minimap"},[(0,o.A)("div",{className:"VideoEditor-overlays"}),(0,o.A)("div",{className:"VideoEditor-filmstrip"},[(0,o.A)("div",{className:"VideoEditorFilmstrip-images"}),(0,o.A)("div",{className:"VideoEditorFilmstrip-clips"})])]))),this._ColorUI=this._createColorUI(),await new Promise((e,t)=>{(0,n.A)(this.originEl,'[data-field-name="clippings"]',t=>{e(t)})}).then(e=>{this._ClippingUI=this._createClippingUI(e)}).catch(e=>{console.warn(`Failed to create the Clipping UI due to: ${e}`)}),this._OverlayUI=this._createOverlayUI(this._VideoPlayer,e.videoWidth,e.videoHeight),this._MiniMap=this._createMiniMap(e,this._OverlayUI),this._ColorUI&&i.append(this._ColorUI.element),this._OverlayUI&&i.append(this._OverlayUI.element),this._ClippingUI&&i.append(this._ClippingUI.element),new c.A(i),this._applyInitialValues([this._ColorUI,this._OverlayUI,this._ClippingUI])})}async _initVideo(){return this._updateVideoState("is-VideoEditorLoading"),new Promise((e,t)=>{const i=".VideoEditor-fileContainer video:not(.VideoEditor-captureVideo):not(.awsElementalVideo)";(0,l.A)(i,()=>{const t=document.querySelector(i);t.readyState>=2?e(t):t.addEventListener("loadedmetadata",i=>{e(t)})})})}async _createMiniMap(e,t){let i=null,r=e;const a=24,s="is-selecting",n=this.rootEl.querySelector(".VideoEditor-filmstrip"),l=this.rootEl.querySelector(".VideoEditor-minimap");this.createFilmstripPlaceholder(r),await this.createFilmstrip(this.originEl.querySelector(".FilePreview-actions + video"),r.videoWidth,r.videoHeight,r.duration);let d,c,h=!1,u=null,p=!1,m=0;const g=(0,o.A)("span",{className:"playhead"});l.appendChild(g);const v=parseInt(g.offsetWidth)/2,y=e=>{const t=e/this.rootEl.querySelector(".VideoEditor-filmstrip").offsetWidth;return 1e3*r.duration*t},f={_x:0,x:0,setOrigin:e=>{this._x=e.offsetLeft}};f.setOrigin(l);const b=()=>{l.classList.remove(s),u&&u.remove(),window.cancelAnimationFrame(i),u=null,p=!1},E=(e,t,i)=>{const{width:r}=e.getBoundingClientRect();let s=(t-a)/r*100,n=i/r*100;const l=this.rootEl.querySelectorAll(".VideoEditor-filmstrip .VideoEditorClip-surface"),d=`placeholder-${Date.now()}`,c=(0,o.A)("div",{classList:"VideoEditorClip-surface","data-placeholder":d});let h;return c.style.left=`${s}%`,c.style.width=`${n}%`,e.appendChild(c),l.forEach(e=>{if(c===e)return;const t=c.getBoundingClientRect(),i=e.getBoundingClientRect();if(this.isIntersecting(t,i)){const o=this.combine(t,i);i.left<t.left&&(s=(i.left-a)/r*100,c.style.left=`${s}%`),h=t.width+i.width-o.intersectionWidth,n=h/r*100,c.style.width=`${n}%`,this.ClipModel.removeClip(e.getAttribute("data-ref-key"))}}),c};let A=null,C=0,w=0,S=0;const V=e=>{const t=(0,o.A)("div",{className:"VideoEditorClip-resizerLeft"}),i=(0,o.A)("div",{className:"VideoEditorClip-resizerRight"});e.appendChild((0,o.A)("div",{className:"VideoEditorClip-resizeUI"},[t,i]))},I=e=>{m=e.x-a;const t=this.rootEl.querySelector(".VideoEditor-filmstrip"),i=m/l.offsetWidth,o=r.duration*i*1e3;if(u){const e=u;p=!1,u=!1,c=o;const{x:i,width:r}=e.getBoundingClientRect(),n=E(t,i,r);V(n),e.parentElement.remove(),l.classList.remove(s);const{x:h,width:m}=n.getBoundingClientRect();d=y(h-a),c=y(h+m-a);const g=n.getAttribute("data-placeholder"),v=this.secondsToSMPTE(d/1e3),f=this.secondsToSMPTE(c/1e3);this.ClipModel.addClip({placeholder:g,startTimeSMPTE:v,endTimeSMPTE:f})}else{p=!0,l.classList.add(s);const e=(e=>{const t="http://www.w3.org/2000/svg",i=document.createElementNS(t,"svg");i.setAttribute("class","VideoEditorFilmstrip-selectionContainer"),i.setAttribute("preserveAspectRatio","none");const r=document.createElementNS(t,"rect");return r.setAttribute("class","VideoEditorFilmstrip-selection"),r.setAttribute("x",`${e}`),r.setAttribute("height","100%"),i.appendChild(r),r})(m);t.appendChild(e.parentElement),u=e,d=o}};this.rootEl.querySelector(".VideoEditor-stage-bottom").onmouseleave=e=>{b()},l.onmousedown=e=>{A=e.target;var t;A.classList.contains("VideoEditorClip-resizerLeft")||A.classList.contains("VideoEditorClip-resizerRight")?(e.preventDefault(),t=A.closest(".VideoEditorClip-surface"),h=t,C=parseFloat(window.getComputedStyle(t,null).getPropertyValue("width").replace("px","")),w=t.getBoundingClientRect().left,S=f.x):I(e)},l.onmouseup=e=>{if(h){const e=h,t=`placeholder-${Date.now()}`;let i;e.setAttribute("data-placeholder",t),h=!1,this.rootEl.querySelectorAll(".VideoEditor-filmstrip .VideoEditorClip-surface").forEach(t=>{if(e===t)return;const r=e.getBoundingClientRect(),o=t.getBoundingClientRect();if(this.isIntersecting(r,o)){const s=this.combine(r,o);o.left<r.left&&(e.style.left=o.left-a+"px"),i=r.width+o.width-s.intersectionWidth,e.style.width=`${i}px`,this.ClipModel.removeClip(t.getAttribute("data-ref-key"))}});const{x:r,width:o}=e.getBoundingClientRect();d=y(r-a),c=y(r+o-a);const s=this.secondsToSMPTE(d/1e3),n=this.secondsToSMPTE(c/1e3);this.ClipModel.addClip({key:e.getAttribute("data-ref-key"),placeholder:e.getAttribute("data-placeholder"),startTimeSMPTE:s,endTimeSMPTE:n})}},l.onmouseenter=e=>{this._VideoPlayer.stop(),window.cancelAnimationFrame(i),i=window.requestAnimationFrame(_),g.classList.remove("is-hidden")},l.onmouseleave=e=>{window.cancelAnimationFrame(i),g.classList.add("is-hidden")},l.onmousemove=e=>{f.x=e.pageX,f.clientX=e.clientX,h&&(e=>{const t=n.getBoundingClientRect(),{width:i}=t,r=f.x-t.left,o=A.closest(".VideoEditorClip-surface");if(r<=0)o.style.left="0%";else{if(r>=t.width){const e=100-parseFloat(o.style.left);return void(o.style.width=`${e}%`)}if(A.classList.contains("VideoEditorClip-resizerRight")){const t=C+(e.pageX-S);let r=t/i*100;t>1&&(o.style.width=`${r}%`)}else{const t=C-(e.pageX-S);let r=t/i*100;if(t>1){o.style.width=`${r}%`;let t=(w+(e.pageX-a-S))/i*100;o.style.left=`${t}%`}}}})(e)},document.onkeydown=e=>{"Escape"===e.key&&p&&b()};const _=e=>{const t=l.getBoundingClientRect(),o=f.lastX-l.offsetLeft;var a;a=o-v,g.style.transform=`translateX(${a}px)`,(e=>{if(u){const t=parseInt(u.getAttribute("x"));e<m?(u.setAttribute("x",`${e}px`),u.setAttribute("width",`${Math.abs(e-m)}px`)):(u.setAttribute("x",`${m}px`),u.setAttribute("width",`${Math.abs(e-t)}px`))}})(o),this._VideoPlayer.currentTime=r.duration*(o/t.width),f.lastX=f.x,f.lastY=f.y,i=window.requestAnimationFrame(_)},T="http://www.w3.org/2000/svg",x=document.createElementNS(T,"svg"),$=`gradient-${Date.now()}`,P=document.createElementNS(T,"linearGradient"),M=document.createElementNS(T,"rect");x.setAttribute("width","100%"),x.setAttribute("height","100%"),x.setAttribute("version","1.1"),x.setAttribute("xmlns",T),x.setAttribute("class","VideoOverlays-clipBackground"),P.id=$,P.setAttribute("x1","0"),P.setAttribute("x2","100%"),P.setAttribute("y1","0"),P.setAttribute("y2","0"),x.appendChild(P),M.setAttribute("fill",`url(#${$})`),M.setAttribute("width","100%"),M.setAttribute("height","100%"),x.appendChild(M),this.rootEl.querySelector(".VideoEditor-overlays").appendChild(x);const O=document.createElementNS(T,"svg"),q=document.createElementNS(T,"defs"),k=document.createElementNS(T,"clipPath");O.setAttribute("version","1.1"),O.setAttribute("xmlns",T),O.setAttribute("class","VideoOverlays-clippingSvg"),k.setAttribute("id","VideoEditorOverlays-svgPath"),q.appendChild(k),O.appendChild(q),this.rootEl.querySelector(".VideoEditor-overlays").appendChild(O);const L=(e,t)=>{const i=document.createElementNS(T,"stop");return i.setAttribute("offset",`${e}%`),i.setAttribute("stop-color",`${t}`),i},N=()=>{const e=`gradient-${Date.now()}`;P.id=e,M.setAttribute("fill",`url(#${e})`)},G=()=>{const e=t.getOverlays(),i=r.duration;k.innerHTML="";let o=1;e.forEach(e=>{const t=e.getStartSeconds()/i*100,r=e.getStopSeconds()/i*100,a=document.createElementNS(T,"rect"),s=1===o?4:4*o+4*(o-1);a.setAttribute("x",`${t}%`),a.setAttribute("width",r-t+"%"),a.setAttribute("y",`calc(100% - ${s})`),a.setAttribute("height","4"),k.appendChild(a),o++})},U=e=>{const t=new Set,i=r.duration;P.innerHTML="",e.size?(e.forEach(e=>{const{startTimeSMPTE:r,endTimeSMPTE:o}=e,a=""===r?0:1e3*this.SMPTEToSeconds(r),s=""===o?0:1e3*this.SMPTEToSeconds(o),n=a/1e3/i*100,l=s/1e3/i*100;t.add(n),t.add(l)}),[...t].sort((e,t)=>e-t).forEach((e,t)=>{t%2==0||0===t?(P.append(L(e,"white")),P.append(L(e,"rgb(113, 133, 162)"))):(P.append(L(e,"rgb(113, 133, 162)")),P.append(L(e,"white")))})):P.append(L("0","white"),L("100","white"))};return P.append(L("0","white"),L("100","white")),this.ClipModel.getClips().forEach(e=>{const t=this.fromSMPTEToXCoordinate(e.startTimeSMPTE,r.duration,n),i=this.fromSMPTEToXCoordinate(e.endTimeSMPTE,r.duration,n)-t,{key:o}=e,s=E(n,t+a,i);s.removeAttribute("data-placeholder"),s.setAttribute("data-ref-key",o),V(s)}),U(this.ClipModel.getClips()),this.ClipModel.observe(e=>{e.forEach(e=>{const{key:t,placeholder:i}=e,r=this.rootEl.querySelector(`.VideoEditor-filmstrip .VideoEditorClip-surface[data-placeholder="${i}"]`);t&&r&&(r.removeAttribute("data-placeholder"),r.setAttribute("data-ref-key",t))}),U(e),N()}),this.ClipModel.observeOnRemove(e=>{const t=this.rootEl.querySelector(`.VideoEditor-filmstrip .VideoEditorClip-surface[data-ref-key="${e}"]`);t&&(t.remove(),U(this.ClipModel.getClips())),N()}),_(),this._VideoPlayer.on("playing",e=>{window.cancelAnimationFrame(i)}),{element:l,redrawClips:U,redrawOverlays:G,reset:()=>{G(),U(this.ClipModel.getClips());const e=this.rootEl.querySelector(".VideoOverlays-clippingSvg clipPath");e?e.innerHTML="":console.warn("querySelector('.VideoOverlays-clippingSvg clipPath') returned null. Overlay path may not have reset properly."),N()},setVideo:e=>{r=e}}}createFilmstripPlaceholder(e){const t=this.rootEl.querySelector(".VideoEditorFilmstrip-images"),i=[],r=e.duration/10;for(let e=1;e<=10;e++){const t=(0,o.A)("div",{className:"VideoEditorFilmstrip-placeholder"},(0,o.A)("span",{className:"VideoEditorFilmstrip-placeholderLabel"},`${this.secondsToSMPTE(e*r)}`));i.push(t)}i.forEach(e=>t.appendChild(e))}async createFilmstrip(e,t,i,r){const a=r/10,s=this.rootEl.querySelector(".VideoEditorFilmstrip-images"),n=this.rootEl.querySelector(".VideoEditor-filmstrip"),l=e.cloneNode(!0);l.crossOrigin=p,await new Promise((e,t)=>{l.readyState>=2?e():l.addEventListener("loadedmetadata",t=>{e()})}),l.className="VideoEditor-captureVideo",l.removeAttribute("controls"),l.setAttribute("muted",!0),l.setAttribute("playsinline",!0),e.insertAdjacentElement("afterend",l);const d="http://www.w3.org/2000/svg",c=document.createElementNS(d,"svg"),h=document.createElementNS(d,"defs"),u=document.createElementNS(d,"clipPath");c.setAttribute("version","1.1"),c.setAttribute("xmlns",d),c.setAttribute("class","VideoEditorFilmstrip-clippingSvg"),u.setAttribute("id","VideoEditorFilmstrip-svgPath"),h.appendChild(u),c.appendChild(h);const m=document.createElementNS(d,"rect");m.setAttribute("x","0"),m.setAttribute("width","50%"),m.setAttribute("height","100%"),u.appendChild(m),s.parentElement.appendChild(c);let g=0,v=!1;const y=e=>{if(!v)return(e=>new Promise((t,i)=>{const r=e=>{l.removeEventListener("seeked",r),t()};l.addEventListener("seeked",r),l.currentTime=e}))(e).then(()=>{const e=(0,o.A)("canvas",{width:.2*t,height:.2*i});e.getContext("2d").drawImage(l,0,0,e.width,e.height);const r=(0,o.A)("img");r.crossOrigin=p,r.src=e.toDataURL(),s.children[g].replaceWith(r),++g}).catch(e=>{v=!0,console.warn(`Video screen shot failed due to:\n${e}`)})},f=()=>{n.classList.add("is-clipped");let e=s.querySelectorAll("img");e.length||(e=s.querySelectorAll("img, .VideoEditorFilmstrip-placeholder")),e.forEach(e=>{this.rootEl.querySelector(".VideoEditorFilmstrip-clips").append(e.cloneNode(!0))})},b=t=>{const i=e.duration;u.innerHTML="",t.forEach(e=>{const t=document.createElementNS(d,"rect"),r=this.fromSMPTEToXCoordinate(e.startTimeSMPTE,i,n),o=this.fromSMPTEToXCoordinate(e.endTimeSMPTE,i,n)-r,{width:a}=n.getBoundingClientRect(),s=r/a*100,l=o/a*100;t.setAttribute("x",`${s}%`),t.setAttribute("width",`${l}%`),t.setAttribute("height","100%"),t.setAttribute("data-ref-key",e.key||e.placeholder),u.appendChild(t)})};for(let e=1;e<=10;e++)await y(e*a);l.remove(),this.ClipModel.getClips().size&&f(),b(this.ClipModel.getClips()),this.ClipModel.observe(e=>{0===this.rootEl.querySelector(".VideoEditorFilmstrip-clips").childElementCount&&f(),b(e)}),this.ClipModel.observeOnRemove(e=>{const t=u.querySelector(`rect[data-ref-key="${e}"]`);t&&t.remove(),this.ClipModel.getClips().size||(n.classList.remove("is-clipped"),this.rootEl.querySelector(".VideoEditorFilmstrip-clips").innerHTML="")})}resetFilmstrip(){const e=this.rootEl.querySelector(".VideoEditorFilmstrip-clippingSvg");e?e.remove():console.warn("querySelector('.VideoEditorFilmstrip-clippingSvg') returned null. Filmstrip clip-path may not have reset properly."),this.rootEl.querySelector(".VideoEditorFilmstrip-images").innerHTML=""}_applyInitialValues(e){e.forEach(e=>{const t=(i=e.element.querySelectorAll("input[name]"),[...i].reduce((e,t)=>{const i=t.name.substring(t.name.lastIndexOf("/")+1);return Object.assign(e,{[i]:"checkbox"===t.type?t.checked:t.value}),e},{}));var i;e.handleUpdate(t)})}_createClippingUI(e){const t=new Map;e.classList.contains("is-inHiddenCluster")&&e.classList.remove("is-inHiddenCluster");const i=(0,o.A)("div",{class:"VideoEditor-ClippingUI","data-tab":"Clip"},(0,o.A)("h2","Click on the filmstrip area to clip your video."),(0,o.A)("em",{},"Tip: Creating a clip can be cancelled by pressing the escape key."),this.originEl.querySelector('[data-name$="/frameRate"]'),e);(0,n.A)(e,".RCIG-list > li:not(.is-removing)",e=>{if(e.classList.contains("is-collapsed")){const t=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window}),i=e.querySelector(".RCIG-title");i.dispatchEvent(t),i.dispatchEvent(t)}}),(0,n.A)(e,".RCIG-item.is-removing",async e=>{const i=await(async e=>new Promise((t,i)=>{(0,n.A)(e,".CIG",e=>{const i=e.getAttribute("data-id").split("/")[0];t(i)})}))(e);t.delete(i)}),(0,n.A)(e,".RCIG-list > li:not(.is-removing) .CIG",e=>{const t=e.getAttribute("data-id").split("/")[0],i=e.querySelector('[data-name$="startTimecode"] textarea').value,r=e.querySelector('[data-name$="endTimecode"] textarea').value;let o=`placeholder-${Date.now()}`;this.ClipModel.getClips().forEach((e,t)=>{t.includes("placeholder")&&(o=t)}),this.ClipModel.addClip({placeholder:o,key:t,startTimeSMPTE:i,endTimeSMPTE:r})}),(0,n.A)(e,".RCIG-list > li .RCIG-remove",e=>{e.onclick=e=>{const t=e.currentTarget.parentNode.querySelector(".CIG").getAttribute("data-id").split("/")[0];this.ClipModel.removeClip(t)}});const r=()=>{i.querySelector(".RCIG-add").click()};return this.ClipModel.observe(e=>{e.forEach(e=>{const{key:t,placeholder:o,startTimeSMPTE:a,endTimeSMPTE:s}=e;if(!t&&o)r();else{const e=i.querySelector('[data-name$="/clippings"]').querySelector(`.CIG[data-id="${t}"]`),r=e.querySelector('[data-name$="startTimecode"] textarea'),o=e.querySelector('[data-name$="endTimecode"] textarea');r.value=a,o.value=s,r.dispatchEvent(new Event("change",{bubbles:!0})),o.dispatchEvent(new Event("change",{bubbles:!0}))}})}),this.ClipModel.observeOnRemove(t=>{const i=e.querySelector(`.RCIG-list .CIG[data-id="${t}"]`),r=i.closest("li");if(i&&r&&!r.classList.contains("is-removing")){const e=i.parentNode.querySelector(".RCIG-remove");e&&e.click()}}),{createClip:r,element:i,handleUpdate:e=>{},reset:()=>{e.querySelectorAll(".RCIG-list > li:not(.is-removing) .RCIG-remove").forEach(e=>{e.click()})}}}_createColorUI(){const e={hue:0,saturation:50,brightness:50,contrast:50},t=new Map,i=e=>{const{hue:t,saturation:i,brightness:r,contrast:o}={...e};""!==t&&d.noUiSlider.set(t),""!==i&&h.noUiSlider.set(i),""!==r&&p.noUiSlider.set(r),""!==o&&g.noUiSlider.set(o)},r=(e,t=100)=>2*parseFloat(e)/100*t,a=(e,i)=>{let r="";const o=[...this.rootEl.querySelectorAll(".VideoEditor-stage-main video")];i?t.set(e,i):t.delete(e),t.forEach((e,t)=>{r+=` ${t}(${e}) `}),o.forEach(e=>e.style.filter=`${r.trim()}`)},s=this.originEl.querySelector(".VideoEditor-InputColors"),n=s.querySelector('input[name$="hue"]'),l=n.closest(".inputContainer");n.type="range",n.min="-180",n.max="180",n.value=l.hasAttribute("data-interacted")?n.value:e.hue;const d=(0,o.A)("div",{className:"is-slideable"});n.insertAdjacentElement("beforebegin",d),this.createSlider(d,n,e=>{a("hue-rotate",`${e}deg`)});const c=s.querySelector('input[name$="saturation"]');c.type="range",c.min="0",c.max="100";const h=(0,o.A)("div",{className:"is-slideable"});c.insertAdjacentElement("beforebegin",h),this.createSlider(h,c,e=>{a("saturate",`${r(e)}%`)});const u=s.querySelector('input[name$="brightness"]');u.type="range",u.min="0",u.max="100";const p=(0,o.A)("div",{className:"is-slideable"});u.insertAdjacentElement("beforebegin",p),this.createSlider(p,u,e=>{a("brightness",`${r(e)}%`)});const m=s.querySelector('input[name$="contrast"]');m.type="range",m.min="0",m.max="100";const g=(0,o.A)("div",{className:"is-slideable"});m.insertAdjacentElement("beforebegin",g),this.createSlider(g,m,e=>{a("contrast",`${r(e)}%`)});const v=(0,o.A)("div",{class:"VideoEditor-ColorUI","data-tab":"Color"},(0,o.A)("h2","Adjust Color"),(0,o.A)("em","Tip: Increment/decrement with up and down keys after clicking the slider."),s.querySelectorAll(".CIG-row")),y=(0,o.A)("a",{class:"VideoEditor-resetButton",onclick:t=>{t.preventDefault(),t.stopPropagation(),i(e)}},"Reset");return v.append(y),{element:v,handleUpdate:e=>{const{saturation:t,brightness:i,contrast:o,hue:s}={...e};a("saturate",t?`${r(t)}%`:null),a("brightness",i?`${r(i)}%`:null),a("contrast",o?`${r(o)}%`:null),a("hue-rotate",s?`${s}deg`:null)},reset:()=>{i(e)}}}_createOverlayUI(e,t,i){const r=new Map,a=this.originEl.querySelector('[data-field-name="imageOverlayOptions"]');a.removeAttribute("hidden"),(0,n.A)(a,".RCIG-list > li .RCIG-remove",e=>{e.onclick=e=>{const t=e.currentTarget.parentNode.querySelector(".VideoEditor-InputOverlay").getAttribute("data-id").split("/")[0],i=this.rootEl.querySelector(`.VideoOverlay-layer[data-name-ref="${t}"]`);i?i.remove():console.warn(`querySelector('.VideoOverlay-layer[data-name-ref="${t}"]') returned null. Overlay layer may not have been removed.`),this._MiniMap.then(e=>{e.redrawOverlays()})}});const s=(0,o.A)("div",{class:"VideoEditor-OverlayUI","data-tab":"Overlay"},(0,o.A)("h2",{},"Add Image Overlays"),(0,o.A)("em",{},"Up to 8 images can be added and overlapped."),a);e.on("timeupdate",e=>{const t=+e.detail.plyr.currentTime;r.forEach(e=>{const i=e.getStartSeconds(),r=e.getStopSeconds();i<=t&&r>=t?e.show():e.hide()})});const l=e=>this.rootEl.querySelector(`.VideoEditor-stage-main .plyr__video-wrapper [data-name-ref="${e}"]`),d=(e,t)=>{this.rootEl.querySelector(".VideoEditor-stage-main .plyr__video-wrapper").querySelector(`[data-name-ref="${e}"]`).style.setProperty("--index",t)},c=e=>new Promise(async(r,a)=>{const s=await h(e),n=s.id,d=(0,o.A)("canvas",{class:"VideoOverlay-layer is-hidden",width:t,height:i}),c=d.getContext("2d");c.drawImage(s.element,10,10);const u=s.element.naturalWidth,p=s.element.naturalHeight;d.setAttribute("data-name-ref",n);const m=this.rootEl.querySelector(".VideoEditor-stage-main .plyr__video-wrapper"),g=m.querySelector(`[data-name-ref="${n}"]`);g?m.replaceChild(d,g):m.appendChild(d);const v=e.querySelector('input[name$="/opacity"]');v.type="range",v.min=0,v.max=100;const y=(0,o.A)("div",{className:"is-slideable"});v.insertAdjacentElement("beforebegin",y);const f=v.getAttribute("name").split("/")[0],b=l(f);this.createSlider(y,v,e=>{var t;t=e/100,b.style.opacity=t});const E=e.querySelector('input[name$="/widthPercent"]'),A=e.querySelector('input[name$="/heightPercent"]'),C=(0,o.A)("input");C.type="range",C.min=1,C.max=100,C.step="1";const w=(0,o.A)("div",{className:"is-slideable"});C.insertAdjacentElement("beforebegin",w),this.createSlider(w,C,e=>{var t;t=e,E.value=parseInt(t),A.value=parseInt(t),E.dispatchEvent(new Event("change",{bubbles:!0})),A.dispatchEvent(new Event("change",{bubbles:!0}))},+E.value);const S=e.querySelector('input[name$="/xPercent"]'),V=e.querySelector('input[name$="/yPercent"]'),I=(e,r)=>{let o=e||0,a=r||0;return o=-1===Math.sign(o)?0:o,a=-1===Math.sign(a)?0:a,{xPercent:parseInt(o/t*100),yPercent:parseInt(a/i*100)}},_=new Map([["0,0","0,0"],["50,0",t/2-u/2+",0"],["100,0",t-u+",0"],["0,50","0,"+(i/2-p/2)],["50,50",`${t/2-u/2},${i/2-p/2}`],["100,50",`${t-u},${i/2-p/2}`],["0,100","0,"+(i-p)],["50,100",`${t/2-u/2},${i-p}`],["100,100",`${t-u},${i-p}`]]),T=(0,o.A)("div",{class:"VideoOverlay-layoutUI"}),x=(e,t)=>{const i=parseInt(e),r=parseInt(t);c.clearRect(0,0,d.width,d.height),c.drawImage(s.element,i,r)},$=e=>{const t=T.querySelector(`[data-coords="${e}"]`);T.querySelectorAll("* > .is-selected").forEach(e=>e.classList.remove("is-selected")),t.classList.add("is-selected")};_.forEach((e,t)=>{const{0:i,1:r}=e.split(","),{xPercent:a,yPercent:s}=I(i,r);T.appendChild((0,o.A)("div",{className:"VideoOverlay-layout-item","data-coords":`${a},${s}`,onclick:e=>{x(i,r),((e,t)=>{const{xPercent:i,yPercent:r}=I(e,t);S.value=i,V.value=r,S.dispatchEvent(new Event("change",{bubbles:!0})),V.dispatchEvent(new Event("change",{bubbles:!0}))})(i,r),$(`${a},${s}`),e.preventDefault()}}))});const P=e.querySelector('textarea[name$="/startTime"]'),M=(0,o.A)("input");M.style.display="none",M.setAttribute("hidden","true"),M.value=P.value?1e3*this.SMPTEToSeconds(P.value):0,M.onchange=e=>{const t=M.value/1e3;P.value=this.secondsToSMPTE(t),this._MiniMap.then(e=>{e.redrawOverlays()}),k(t)};const O=e.querySelector('input[name$="/duration"]'),q=(0,o.A)("div",{className:"is-slideable"});O.insertAdjacentElement("beforebegin",q),O.onchange=e=>{const t=O.value/1e3;this._MiniMap.then(e=>{e.redrawOverlays()}),k(t)},this.createSlider(q,[M,O],e=>{},[+M.value,+O.value],{min:0,max:1e3*this._VideoPlayer.duration},{to:function(e){return parseInt(e)},from:function(e){return parseInt(e)}});const k=e=>{this._VideoPlayer.currentTime=parseFloat(e)},L=e.querySelector('input[name$="/fadeIn"]'),N=e.querySelector('input[name$="/fadeOut"]'),G=e=>{L.value=e,N.value=e,d.style.setProperty("--transitionDuration-millis",`${e}ms`)},U=(0,o.A)("input",{type:"radio",name:`effect-for-${n}`,className:"radio-button",value:0,onchange:e=>{G(0)}}),R=(0,o.A)("input",{type:"radio",name:`effect-for-${n}`,className:"radio-button",value:350,onchange:e=>{G(350)}}),F=(0,o.A)("input",{type:"radio",name:`effect-for-${n}`,className:"radio-button",value:1e3,onchange:e=>{G(1e3)}});e.querySelector('.VideoEditor-InputOverlay > [data-field$="file"]').insertAdjacentElement("afterend",(0,o.A)("div",{className:"CIG-row",visible:!0},[(0,o.A)("div",{className:"CIG-label"},"Position"),T])),e.querySelector('.VideoEditor-InputOverlay > [data-field$="opacity"]').insertAdjacentElement("afterend",(0,o.A)("div",{className:"CIG-row scale",visible:!0},[(0,o.A)("div",{className:"CIG-label"},"Scale"),(0,o.A)("div",{className:"CIG-small"},w)])),e.querySelector('.VideoEditor-InputOverlay > [data-field$="xPercent"]').insertAdjacentElement("beforebegin",(0,o.A)("div",{className:"CIG-row",visible:!0},[(0,o.A)("div",{className:"CIG-label"},"Duration"),(0,o.A)("div",{className:"CIG-small",style:"position:relative"},[M,q])])),e.querySelector('.VideoEditor-InputOverlay > [data-field$="widthPercent"]').insertAdjacentElement("beforebegin",(0,o.A)("div",{className:"CIG-row",visible:!0},[(0,o.A)("div",{className:"CIG-label"},"Fade Effect"),(0,o.A)("div",{className:"CIG-small VideoOverlay-fadeEffect-group"},[(0,o.A)("label",{for:U.id,className:"radio-button-click-target"},U,"None"),(0,o.A)("label",{for:R.id,className:"radio-button-click-target"},R,"Brief"),(0,o.A)("label",{for:F.id,className:"radio-button-click-target"},F,"Gradual")])]));const B=()=>{d.classList.remove("is-hidden"),d.style.opacity=y.noUiSlider.get()/100};(r=>{const{opacity:o,xPercent:a,yPercent:s,widthPercent:l,heightPercent:d,startTime:c,duration:h,fadeIn:u}={...r};if(""!==o&&y.noUiSlider.set(o),""!==a&&""!==s){let e=t*(a/100),r=i*(s/100);e=-1===Math.sign(e)?0:e||0,r=-1===Math.sign(r)?0:r||0,x(e,r),$(`${a},${s}`)}""!==l&&""!==d?w.noUiSlider.set(l):w.noUiSlider.set(50);const p=""!==c?this.SMPTEToSeconds(c):0,m=""!==c?1e3*p:0,g=h||parseFloat(1e3*this._VideoPlayer.duration);q.noUiSlider.set([+m,+g]);const v=u;if(""!==v){const t=e.querySelector(`input[name="effect-for-${n}"][value="${v}"]`);t&&(t.checked=!0,G(v))}B()})([e.querySelector('input[name$="/opacity"]'),e.querySelector('input[name$="/xPercent"]'),e.querySelector('input[name$="/yPercent"]'),e.querySelector('input[name$="/widthPercent"]'),e.querySelector('input[name$="/heightPercent"]'),e.querySelector('textarea[name$="/startTime"]'),e.querySelector('input[name$="/duration"]'),e.querySelector('input[name$="/fadeIn"]'),e.querySelector('input[name$="/fadeOut"]')].reduce((e,t)=>{const i=t.name.substring(t.name.lastIndexOf("/")+1);return Object.assign(e,{[i]:"checkbox"===t.type?t.checked:t.value}),e},{})),e.querySelectorAll('.CIG-row[data-name$="/xPercent"], .CIG-row[data-name$="/yPercent"], .CIG-row[data-name$="/widthPercent"], .CIG-row[data-name$="/heightPercent"], .CIG-row[data-name$="/startTime"], .CIG-row[data-name$="/duration"], .CIG-row[data-name$="/fadeIn"], .CIG-row[data-name$="/fadeOut"]').forEach(e=>{e.classList.add("is-hidden")}),this._MiniMap.then(e=>{e.redrawOverlays()}),r({item:e,hide:()=>{d.classList.add("is-hidden"),d.style.opacity=0},show:B,getStartSeconds:()=>M.value/1e3,getStopSeconds:()=>O.value/1e3,remove:()=>{d.classList.add("is-removing")}})}).catch(e=>{console.warn(`Overlay failed to initialize due to: \n${e}`)});(0,n.A)(a,".RCIG-list",e=>{new MutationObserver(e=>{e.forEach(e=>{if(e.addedNodes.length){const t=e.addedNodes[0].querySelector(".CIG");t&&t.closest("ol").childNodes.forEach(async(e,t)=>{const i=await u(e);d(i,t),this._MiniMap.then(e=>{e.redrawOverlays()})})}})}).observe(e,{attributes:!1,childList:!0})});const h=e=>new Promise((t,i)=>{(0,n.A)(e,".filePreview",e=>{if(e){const i=new MutationObserver(r=>{r.some(r=>{if(r.target.classList.contains("is-imageEditorLoaded")){i.disconnect();const r=e.querySelector("img.cropper-hide");if(!r)return;const o=e.parentElement.getAttribute("data-name").split("/")[0];r.setAttribute("class","VideoOverlay-image"),r.setAttribute("style",`filter:${r.style.filter}`),r.setAttribute("data-name-ref",o),r.closest(".VideoEditor-InputOverlay").classList.add("is-overlay-ready"),t({id:o,element:r})}})});return i.observe(e,{attributeFilter:["class"]}),!0}})}),u=async e=>new Promise((t,i)=>{(0,n.A)(e,".filePreview",e=>{const i=e.parentElement.getAttribute("data-name").split("/")[0];t(i)})});return(0,n.A)(a,".RCIG-list .VideoEditor-InputOverlay",e=>{c(e).then(async e=>{const t=await u(e.item);r.set(t,e),d(t,(e=>{const t=e.closest("li");return[...t.parentNode.children].indexOf(t)})(e.item)),this._MiniMap.then(e=>{e.redrawOverlays()})}).catch(e=>{console.warn(`Failed to initialize Overlay due to: \n${e}`)})}),(0,n.A)(a,".RCIG-item.is-removing",async e=>{const t=await u(e);r.get(t).remove(),r.delete(t)}),(0,n.A)(a,".RCIG-list > li:not(.is-removing)",e=>{if(e.classList.contains("is-collapsed")){const t=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window}),i=e.querySelector(".RCIG-title");i.dispatchEvent(t),i.dispatchEvent(t)}}),{element:s,handleUpdate:e=>{},getOverlays:()=>{let e=[];return a.querySelectorAll(".RCIG-list .RCIG-item:not(.is-removing) .VideoEditor-InputOverlay.is-overlay-ready").forEach(t=>{const i=r.get(t.getAttribute("data-object-id"));i&&e.push(i)}),e},reset:()=>{a.querySelectorAll(".RCIG-list > li:not(.is-removing) .RCIG-remove").forEach(e=>{e.click()})}}}_createVideoPlayer(e){const t=e.cloneNode(!0);return this.originEl.appendChild(t),new Promise((e,i)=>{this._VideoPlayer=new d.A(t,{hideControls:!1,invertTime:!1,controls:["play","progress","current-time","mute","volume"]}),this._VideoPlayer.on("ready",t=>{e()})})}_updateVideoState(e){const t=document.querySelector(".Page-content .content-edit");this._currentVideoState&&t.classList.remove(this._currentVideoState),t.classList.add(e),this._currentVideoState=e}}let g=null;(0,n.A)(".VideoEditor",e=>{g=new m(e),(e=>{const t=(0,r.A)(e,".CIG-row");(0,n.A)(t,".fileSelector",t=>{const i=t.querySelector("select");i?i.addEventListener("change",t=>{var i;g&&(i=e,document.querySelector(".Page-content .content-edit").classList.remove(g.getState()),g._VideoPlayer.destroy(),i.querySelectorAll("video").forEach(e=>e.remove()),g.rootEl.querySelector(".VideoEditor-stage video").remove(),g._initVideo().then(async e=>{const t=g.rootEl.querySelector(".VideoEditor-stage-main");g._updateVideoState(h),await g._createVideoPlayer(e),t.appendChild(g._VideoPlayer.elements.container),g._ColorUI&&g._ColorUI.reset(),g._OverlayUI&&g._OverlayUI.reset(),g._ClippingUI&&g._ClippingUI.reset(),g._MiniMap.then(t=>{t.reset(),t.setVideo(e)}),g.resetFilmstrip(),g.createFilmstripPlaceholder(e),await g.createFilmstrip(e,e.videoWidth,e.videoHeight,e.duration)}))}):console.warn("Missing <select> in .fileSelector element!")})})(e)})},85235(e,t,i){i.d(t,{A:()=>n});var r=i(64664),o=i.n(r),a=i(25243),s=i.n(a)()(o());s.push([e.id,'.is-VideoEditorLoading .FilePreview-actions *{visibility:hidden}.is-VideoEditorLoaded .FilePreview-actions *{visibility:visible}.is-VideoEditorOpen .VideoEditor-stage{opacity:1}[dir] .is-VideoEditorOpen .VideoEditor-stage{transform:none}.VideoEditor-fileContainer>:not([data-name$="/file"]),.VideoEditor-InputColors{display:none}.VideoEditor-stage{--VideoEditor-asideWidth:440px;--VideoEditor-bottomHeight:221px;bottom:0;display:block;opacity:0;position:fixed;top:var(--Page-headerBottom);transition:opacity var(--time-xs) var(--ease-in),transform var(--time-s) var(--ease-out);z-index:1000}[dir] .VideoEditor-stage{background:var(--color-white);transform:scaleY(0);transform-origin:bottom}[dir=ltr] .VideoEditor-stage,[dir=rtl] .VideoEditor-stage{left:0;right:0}[dir=ltr] .CIG .VideoEditor-stage>.TabBar,[dir=rtl] .CIG .VideoEditor-stage>.TabBar{margin-left:0;margin-right:0}.VideoEditor-stage>[data-tab]{height:calc(100% - var(--gap-m) * 2 - var(--lineHeight-m))}.VideoEditor-stage-closeButton{color:var(--color-white);position:absolute;top:calc(var(--gap-l) - var(--gap-s))}[dir] .VideoEditor-stage-closeButton{background:var(--Link-color);border-color:var(--Link-color)}[dir=ltr] .VideoEditor-stage-closeButton{right:calc(var(--gap-l) - var(--gap-s))}[dir=rtl] .VideoEditor-stage-closeButton{left:calc(var(--gap-l) - var(--gap-s))}.VideoEditor-stage-closeButton:focus,.VideoEditor-stage-closeButton:hover{color:var(--color-white)}[dir] .VideoEditor-stage-closeButton:focus,[dir] .VideoEditor-stage-closeButton:hover{background:var(--Link-hoverColor);border-color:var(--Link-hoverColor)}.VideoEditor-stage-aside{bottom:0;display:flex;flex-flow:column wrap;position:absolute;top:0;width:var(--VideoEditor-asideWidth)}[dir=ltr] .VideoEditor-stage-aside{right:0}[dir=rtl] .VideoEditor-stage-aside{left:0}.VideoEditor-stage-aside .TC-unselected,.VideoEditor-stage-aside input[type=range]{display:none}.VideoEditorAside-top{align-items:center;display:flex;flex-direction:row;height:calc(var(--gap-l) * 3)}[dir] .VideoEditorAside-top{padding:var(--gap-l)}.VideoEditorAside-top>h2:first-of-type{font-size:var(--fontSize-xl);font-weight:400}.VideoEditorAside-body{max-height:calc(100% - (var(--gap-l) * 3));overflow:auto;width:100%}[dir] .VideoEditorAside-body{padding:0 var(--gap-l) var(--gap-m) var(--gap-l)}.VideoEditor-stage-main{bottom:var(--VideoEditor-bottomHeight);display:flex;justify-content:center;position:absolute;top:0}[dir] .VideoEditor-stage-main{background-color:var(--color-gray1);background-size:50px 50px}[dir=ltr] .VideoEditor-stage-main{background-image:linear-gradient(-45deg,var(--color-gray1),var(--color-gray1) 25%,var(--color-gray2) 0,var(--color-gray2) 50%,var(--color-gray1) 0,var(--color-gray1) 75%,var(--color-gray2) 0);left:0;right:var(--VideoEditor-asideWidth)}[dir=rtl] .VideoEditor-stage-main{background-image:linear-gradient(45deg,var(--color-gray1),var(--color-gray1) 25%,var(--color-gray2) 0,var(--color-gray2) 50%,var(--color-gray1) 0,var(--color-gray1) 75%,var(--color-gray2) 0);right:0;left:var(--VideoEditor-asideWidth)}.VideoEditor-stage-bottom{bottom:0;height:var(--VideoEditor-bottomHeight);position:absolute}[dir] .VideoEditor-stage-bottom{background:#ececee;padding:var(--gap-l)}[dir=ltr] .VideoEditor-stage-bottom{left:0;right:var(--VideoEditor-asideWidth)}[dir=rtl] .VideoEditor-stage-bottom{right:0;left:var(--VideoEditor-asideWidth)}.VideoEditor-stage-bottom:before{color:var(--color-gray6);content:"Overlays";font-size:12px;position:absolute;text-transform:uppercase;top:calc(var(--gap-l) + 4px);writing-mode:vertical-rl}[dir=ltr] .VideoEditor-stage-bottom:before{left:0;text-align:right;transform:rotate(180deg)}[dir=rtl] .VideoEditor-stage-bottom:before{right:0;text-align:left;transform:rotate(-180deg)}.VideoEditor-stage-bottom:after{content:"";height:100%;position:absolute;top:0;width:1px;z-index:1}[dir=ltr] .VideoEditor-stage-bottom:after{right:0}[dir=rtl] .VideoEditor-stage-bottom:after{left:0}.VideoEditor-captureVideo{height:3px;width:auto}.VideoEditor-minimap{display:flex;flex-direction:column;position:relative}[dir] .VideoEditor-minimap{cursor:copy}[dir] .VideoEditor-minimap.is-selecting{cursor:col-resize}.VideoEditor-minimap .playhead{height:100%;pointer-events:none;position:absolute;width:1px;z-index:1}[dir] .VideoEditor-minimap .playhead{background:var(--color-black)}.VideoEditor-minimap .playhead:after{content:"";height:0;position:absolute;width:0}[dir] .VideoEditor-minimap .playhead:after{border-bottom:10px solid var(--color-black)}[dir=ltr] .VideoEditor-minimap .playhead:after{border-left:10px solid transparent;border-right:10px solid transparent;transform:translate(-9.5px,-9px) rotate(180deg)}[dir=rtl] .VideoEditor-minimap .playhead:after{border-right:10px solid transparent;border-left:10px solid transparent;transform:translate(9.5px,-9px) rotate(-180deg)}.VideoEditor-minimap .playhead.is-hidden{opacity:.25}.VideoEditorClip-surface{bottom:0;height:100%;position:absolute;z-index:4}[dir] .VideoEditorClip-surface{padding:2px 0}.VideoEditorClip-surface:hover .VideoEditorClip-resizeUI{display:block;opacity:1}[dir=ltr] .VideoEditorClip-surface:hover .VideoEditorClip-resizeUI,[dir=rtl] .VideoEditorClip-surface:hover .VideoEditorClip-resizeUI{animation:none}.VideoEditor-overlays{height:65px;position:relative}[dir] .VideoEditor-overlays{margin-bottom:8px}.VideoOverlays-clippingSvg{height:100%;position:absolute;top:0;width:100%}[dir=ltr] .VideoOverlays-clippingSvg{left:0}[dir=rtl] .VideoOverlays-clippingSvg{right:0}.VideoOverlays-clipBackground{clip-path:url(#VideoEditorOverlays-svgPath)}.VideoEditor-filmstrip{display:block;height:96px;position:relative;width:100%}.VideoEditorFilmstrip-placeholder{align-items:center;display:flex;justify-content:center}[dir] .VideoEditorFilmstrip-placeholder{background-color:var(--color-black);background-repeat:no-repeat;background-size:5% 8%,5% 8%,5% 8%,5% 8%,5% 8%,5% 8%,5% 8%,5% 8%,5% 8%,5% 8%,5% 8%,5% 8%,5% 8%,5% 8%,5% 8%,5% 8%,5% 8%,5% 8%,5% 8%,5% 8%,5% 8%,5% 8%}[dir=ltr] .VideoEditorFilmstrip-placeholder{background-image:linear-gradient(90deg,#ececee,#ececee),linear-gradient(90deg,#ececee,#ececee),linear-gradient(90deg,#ececee,#ececee),linear-gradient(90deg,#ececee,#ececee),linear-gradient(90deg,#ececee,#ececee),linear-gradient(90deg,#ececee,#ececee),linear-gradient(90deg,#ececee,#ececee),linear-gradient(90deg,#ececee,#ececee),linear-gradient(90deg,#ececee,#ececee),linear-gradient(90deg,#ececee,#ececee),linear-gradient(90deg,#ececee,#ececee),linear-gradient(90deg,#ececee,#ececee),linear-gradient(90deg,#ececee,#ececee),linear-gradient(90deg,#ececee,#ececee),linear-gradient(90deg,#ececee,#ececee),linear-gradient(90deg,#ececee,#ececee),linear-gradient(90deg,#ececee,#ececee),linear-gradient(90deg,#ececee,#ececee),linear-gradient(90deg,#ececee,#ececee),linear-gradient(90deg,#ececee,#ececee),linear-gradient(90deg,#ececee,#ececee),linear-gradient(90deg,#ececee,#ececee);background-position:5% 5%,15% 5%,25% 5%,35% 5%,45% 5%,55% 5%,65% 5%,75% 5%,85% 5%,95% 5%,5% 95%,15% 95%,25% 95%,35% 95%,45% 95%,55% 95%,65% 95%,75% 95%,85% 95%,95% 95%}[dir=rtl] .VideoEditorFilmstrip-placeholder{background-image:linear-gradient(270deg,#ececee,#ececee),linear-gradient(270deg,#ececee,#ececee),linear-gradient(270deg,#ececee,#ececee),linear-gradient(270deg,#ececee,#ececee),linear-gradient(270deg,#ececee,#ececee),linear-gradient(270deg,#ececee,#ececee),linear-gradient(270deg,#ececee,#ececee),linear-gradient(270deg,#ececee,#ececee),linear-gradient(270deg,#ececee,#ececee),linear-gradient(270deg,#ececee,#ececee),linear-gradient(270deg,#ececee,#ececee),linear-gradient(270deg,#ececee,#ececee),linear-gradient(270deg,#ececee,#ececee),linear-gradient(270deg,#ececee,#ececee),linear-gradient(270deg,#ececee,#ececee),linear-gradient(270deg,#ececee,#ececee),linear-gradient(270deg,#ececee,#ececee),linear-gradient(270deg,#ececee,#ececee),linear-gradient(270deg,#ececee,#ececee),linear-gradient(270deg,#ececee,#ececee),linear-gradient(270deg,#ececee,#ececee),linear-gradient(270deg,#ececee,#ececee);background-position:95% 5%,85% 5%,75% 5%,65% 5%,55% 5%,45% 5%,35% 5%,25% 5%,15% 5%,5% 5%,95% 95%,85% 95%,75% 95%,65% 95%,55% 95%,45% 95%,35% 95%,25% 95%,15% 95%,5% 95%}.VideoEditorFilmstrip-placeholderLabel{align-items:center;color:var(--color-white);display:flex;font-size:var(--fontSize-xs);height:68%;justify-content:center;position:relative;width:97%}[dir] .VideoEditorFilmstrip-placeholderLabel{background:hsla(0,0%,91.4%,.2)}.VideoEditorFilmstrip-selectionContainer{height:100%;position:absolute;top:0;width:100%;z-index:3}.VideoEditorFilmstrip-selection{fill:none;shape-rendering:geometricPrecision;stroke:#fff;stroke-dasharray:6px;stroke-dashoffset:12px;stroke-width:2px;vector-effect:non-scaling-stroke}[dir=ltr] .VideoEditorFilmstrip-selection,[dir=rtl] .VideoEditorFilmstrip-selection{animation:stroke .2s linear infinite}@keyframes stroke{to{stroke-dashoffset:0}}.VideoEditorFilmstrip-clippingSvg{height:100%;position:absolute;width:100%}.VideoEditorFilmstrip-clips,.VideoEditorFilmstrip-images{display:flex;height:96px;pointer-events:none}.VideoEditorFilmstrip-clips{bottom:0;clip-path:url(#VideoEditorFilmstrip-svgPath);position:absolute;top:0}[dir=ltr] .VideoEditorFilmstrip-clips,[dir=rtl] .VideoEditorFilmstrip-clips{left:0;right:0}.VideoEditorFilmstrip-clips>img,.VideoEditorFilmstrip-images>img,.VideoEditorFilmstrip-placeholder{object-fit:cover;pointer-events:none;width:10%}.VideoEditor-filmstrip.is-clipped .VideoEditorFilmstrip-images{filter:brightness(.4) saturate(.4)}.VideoEditorClip-resizeUI{box-sizing:border-box;height:100%;opacity:1;outline:2px solid var(--color-blue5);width:100%}[dir=ltr] .VideoEditorClip-resizeUI,[dir=rtl] .VideoEditorClip-resizeUI{animation:intro .2s ease-out .2s forwards}@keyframes intro{to{opacity:.3}}.VideoEditorClip-resizerLeft{height:20px;position:absolute;top:calc(50% - 10px);transition:transform .1s ease;width:20px}[dir] .VideoEditorClip-resizerLeft{background:var(--color-blue5);border-radius:50%;cursor:col-resize}[dir=ltr] .VideoEditorClip-resizerLeft{left:-10px}[dir=rtl] .VideoEditorClip-resizerLeft{right:-10px}[dir] .VideoEditorClip-resizerLeft:hover{transform:scale(1.2)}.VideoEditorClip-resizerRight{height:20px;position:absolute;top:calc(50% - 10px);transition:transform .1s ease;width:20px}[dir] .VideoEditorClip-resizerRight{background:var(--color-blue5);border-radius:50%;cursor:col-resize}[dir=ltr] .VideoEditorClip-resizerRight{right:-10px}[dir=rtl] .VideoEditorClip-resizerRight{left:-10px}[dir] .VideoEditorClip-resizerRight:hover{transform:scale(1.2)}.VideoOverlay-layer{--index:auto;--transitionDuration-millis:0;height:100%;object-fit:contain;opacity:0;pointer-events:none;position:absolute;top:0;transition:opacity var(--transitionDuration-millis) ease;width:100%;z-index:var(--index)}[dir=ltr] .VideoOverlay-layer{left:0}[dir=rtl] .VideoOverlay-layer{right:0}.VideoOverlay-layer.is-removing{visibility:hidden}.VideoOverlay-image{display:block;height:auto;max-width:100%;position:relative}.VideoEditor-OverlayUI .ImageEditor-open{opacity:0;pointer-events:none}.VideoEditor-OverlayUI .RCIG{display:flex;flex-direction:column-reverse;max-width:calc(var(--VideoEditor-asideWidth) - 2 * var(--gap-l))}[dir] .VideoEditor-OverlayUI .RCIG>:last-child{margin-bottom:var(--gap-m)}.VideoEditor-OverlayUI .RCIG-list{display:flex;flex-direction:column-reverse}.VideoEditor-ClippingUI .RCIG-item.is-removing,.VideoEditor-OverlayUI .RCIG-item.is-removing{display:none}.VideoEditor-OverlayUI .RCIG-addSelect{display:flex}.VideoOverlay-layoutUI{display:grid;grid-gap:var(--gap-xs);grid-template-columns:repeat(3,minmax(90px,1fr));grid-template-rows:repeat(3,minmax(40px,60px));width:100%}[dir] .VideoOverlay-layoutUI{margin-top:var(--gap-l)}[dir] .VideoOverlay-layout-item{background:var(--color-gray4);cursor:pointer}[dir] .VideoOverlay-layout-item:hover{background:var(--Input-focusColor)}.VideoOverlay-layout-item:nth-child(5n){display:flex}.VideoOverlay-layout-item:nth-child(5n):after{--Icon-fill:"FILL" 1;display:inline-block;font-family:Material Symbols Outlined;font-feature-settings:"liga";font-size:var(--Icon-size);-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-style:normal;font-variation-settings:var(--Icon-fill);font-weight:400;letter-spacing:normal;line-height:1;position:relative;text-rendering:optimizeLegibility;text-transform:none;top:calc((var(--Text-height) - var(--Icon-size)) / 2);vertical-align:top;white-space:nowrap;word-wrap:normal;align-items:center;color:var(--color-white);content:"play_circle_filled";display:flex;flex:1;justify-content:center}[dir] .VideoOverlay-layout-item:nth-child(5n):after{transform:var(--Icon-transform)}[dir=ltr] .VideoOverlay-layout-item:nth-child(5n):after{direction:ltr}[dir=rtl] .VideoOverlay-layout-item:nth-child(5n):after{direction:rtl}[dir] .VideoOverlay-layout-item.is-selected{background:var(--color-dominant6)}.VideoEditor-InputOverlay.is-overlay-ready .CIG-row[data-name$="/opacity"],.VideoEditor-InputOverlay.is-overlay-ready .CIG-row[visible]{display:block}.VideoEditor-InputOverlay.is-overlay-ready .CIG-row.scale{display:none}.VideoOverlay-fadeEffect-group{display:flex;justify-content:space-between;position:relative}.VideoEditor-resetButton{--Link-color:var(--color-red6);--Link-hoverColor:var(--color-red5);--Link-decoration:none;--Text-height:var(--lineHeight-s);font-size:var(--fontSize-s);line-height:var(--lineHeight-s);align-items:center;display:block}[dir] .VideoEditor-resetButton{margin:var(--gap-l) 0 0 0}.VideoEditor-resetButton:before{--Icon-fill:"FILL" 1;display:inline-block;font-family:Material Symbols Outlined;font-feature-settings:"liga";font-size:var(--Icon-size);-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-style:normal;font-variation-settings:var(--Icon-fill);font-weight:400;letter-spacing:normal;line-height:1;position:relative;text-rendering:optimizeLegibility;text-transform:none;top:calc((var(--Text-height) - var(--Icon-size)) / 2);vertical-align:top;white-space:nowrap;word-wrap:normal;--Icon-size:var(--iconSize-s);content:"refresh"}[dir] .VideoEditor-resetButton:before{transform:var(--Icon-transform)}[dir=ltr] .VideoEditor-resetButton:before{direction:ltr;margin-right:var(--gap-xs)}[dir=rtl] .VideoEditor-resetButton:before{direction:rtl;margin-left:var(--gap-xs)}.VideoEditor-ClippingUI .RCIG-controls,.VideoEditor-ClippingUI ol[data-sortable-input-name$="/clippings"] .CIG-note{display:none}[dir=ltr] .FilePreview-actions>:not(:first-child){margin-left:var(--gap-m)}[dir=rtl] .FilePreview-actions>:not(:first-child){margin-right:var(--gap-m)}[dir=ltr] .VideoEditor-OverlayUI .CIG-row:only-child.is-unlabeled>.CIG-large>.CIG{margin-right:unset}[dir=rtl] .VideoEditor-OverlayUI .CIG-row:only-child.is-unlabeled>.CIG-large>.CIG{margin-left:unset}.VideoEditor-InputOverlay .CIG-row:not([data-name$="/file"]){display:none}.Popup .VideoEditor-InputOverlay .CIG-row:not([data-name$="/file"]),.VideoEditor-InputOverlay .CIG-row[data-name$="/heightPercent"],.VideoEditor-InputOverlay .CIG-row[data-name$="/widthPercent"]{display:initial}[dir] .CIG-row:only-child.is-unlabeled:before{box-shadow:none}[dir=ltr] .CIG-row:only-child.is-unlabeled>.CIG-large>.CIG{padding-right:var(--CIG-padding)}[dir=rtl] .CIG-row:only-child.is-unlabeled>.CIG-large>.CIG{padding-left:var(--CIG-padding)}.VideoEditor-ColorUI .CIG-note,.VideoEditor-OverlayUI .CIG-note{display:none}.VideoEditor-ColorUI .CIG-note .VideoEditor-OverlayUI .RCIG-addSelect,.VideoEditor-OverlayUI .CIG-note .VideoEditor-OverlayUI .RCIG-addSelect{display:flex}.VideoEditor-ColorUI .CIG-row:after,.VideoEditor-OverlayUI .CIG-row:after{display:none}.is-slideable{--Thumb-diameter:1.5em;--Thumb-color:var(--color-dominant6);--Thumb-hover-color:var(--Input-focusColor);--Track-color:var(--color-gray3);--Track-height:4px}.is-slideable.noUi-target{height:20px}[dir] .is-slideable.noUi-target{background:none;border:none;box-shadow:none}.is-slideable.noUi-target:after{content:"";height:var(--Track-height);position:absolute;top:50%;width:100%}[dir] .is-slideable.noUi-target:after{background:var(--Track-color);transform:translateY(-50%)}.is-slideable.noUi-horizontal .noUi-handle{height:var(--Thumb-diameter);top:-2px;width:var(--Thumb-diameter)}[dir] .is-slideable.noUi-horizontal .noUi-handle{background:var(--Thumb-color);border:none;border-radius:100%;box-shadow:none}[dir=ltr] .is-slideable.noUi-horizontal .noUi-handle{left:calc(-1 * var(--Thumb-diameter) / 2)}[dir=rtl] .is-slideable.noUi-horizontal .noUi-handle{right:calc(-1 * var(--Thumb-diameter) / 2)}.is-slideable.noUi-horizontal .noUi-handle:after,.is-slideable.noUi-horizontal .noUi-handle:before{content:none}[dir] .is-slideable.noUi-horizontal .noUi-handle:hover{background:var(--Thumb-hover-color)}[dir] .is-slideable .noUi-connect{background:rgba(14,128,184,.44)}html[dir=ltr]:not([dir=rtl]) .is-slideable.noUi-horizontal .noUi-handle{right:calc(-1 * var(--Thumb-diameter) / 2)}html[dir=rtl]:not([dir=rtl]) .is-slideable.noUi-horizontal .noUi-handle{left:calc(-1 * var(--Thumb-diameter) / 2)}.VideoEditor-stage{--Video-controlsHeight:50px}.VideoEditor-stage .plyr--video{display:flex;flex-direction:column}.VideoEditor-stage .plyr__controls{height:var(--Video-controlsHeight)}.VideoEditor-stage .plyr--video .plyr__controls{order:2;position:relative}[dir] .VideoEditor-stage .plyr--video .plyr__controls{background:var(--color-blue7);padding:10px}.VideoEditor-stage .plyr__volume{display:flex}.VideoEditor-stage .plyr__video-wrapper{height:100%;max-height:calc(100vh - var(--Page-headerBottom) - var(--Video-controlsHeight) - var(--VideoEditor-bottomHeight));width:100%}.VideoEditor-stage .plyr video{height:100%;object-fit:contain;width:100%}',""]);const n=7717==i.j?s:null},11011(e,t,i){i.d(t,{A:()=>n});var r=i(77473),o=i.n(r),a=i(12434),s=i.n(a)()(o());s.push([e.id,"",""]);const n=3324==i.j?s:null},86456(e,t,i){i.r(t),i.d(t,{default:()=>y});var r=i(96291),o=i.n(r),a=i(96918),s=i.n(a),n=i(77322),l=i.n(n),d=i(55800),c=i.n(d),h=i(10207),u=i.n(h),p=i(37746),m=i.n(p),g=i(85235),v={};v.styleTagTransform=m(),v.setAttributes=c(),v.insert=l().bind(null,"head"),v.domAPI=s(),v.insertStyleElement=u(),o()(g.A,v);const y=g.A&&g.A.locals?g.A.locals:void 0},64583(e,t,i){i.r(t),i.d(t,{default:()=>y});var r=i(67290),o=i.n(r),a=i(9727),s=i.n(a),n=i(6323),l=i.n(n),d=i(20610),c=i.n(d),h=i(97398),u=i.n(h),p=i(50555),m=i.n(p),g=i(11011),v={};v.styleTagTransform=m(),v.setAttributes=c(),v.insert=l().bind(null,"head"),v.domAPI=s(),v.insertStyleElement=u(),o()(g.A,v);const y=g.A&&g.A.locals?g.A.locals:void 0}}]);
|