react-covideo-embed 1.0.67 → 1.0.68
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/build/index.js +1 -1
- package/package.json +1 -1
- package/storybook-static/357.42a13d21.iframe.bundle.js +0 -1
- package/storybook-static/433.62d42712.iframe.bundle.js +0 -1
- package/storybook-static/447.8daf228e.iframe.bundle.js +0 -402
- package/storybook-static/447.8daf228e.iframe.bundle.js.LICENSE.txt +0 -56
- package/storybook-static/447.8daf228e.iframe.bundle.js.map +0 -1
- package/storybook-static/525.255de6ba.iframe.bundle.js +0 -1
- package/storybook-static/677.18371a2a.iframe.bundle.js +0 -1
- package/storybook-static/757.f4372d22.iframe.bundle.js +0 -95
- package/storybook-static/757.f4372d22.iframe.bundle.js.LICENSE.txt +0 -25
- package/storybook-static/757.f4372d22.iframe.bundle.js.map +0 -1
- package/storybook-static/793.cf38c5c2.iframe.bundle.js +0 -1
- package/storybook-static/908.0e3d7327.iframe.bundle.js +0 -782
- package/storybook-static/908.0e3d7327.iframe.bundle.js.LICENSE.txt +0 -946
- package/storybook-static/908.0e3d7327.iframe.bundle.js.map +0 -1
- package/storybook-static/948.f5c676b7.iframe.bundle.js +0 -1
- package/storybook-static/950.5473fc63.iframe.bundle.js +0 -1
- package/storybook-static/CovideoEmbed-stories.3e1c79bd.iframe.bundle.js +0 -1
- package/storybook-static/favicon.svg +0 -7
- package/storybook-static/iframe.html +0 -481
- package/storybook-static/index.html +0 -155
- package/storybook-static/index.json +0 -1
- package/storybook-static/main.70dd0fa6.iframe.bundle.js +0 -1
- package/storybook-static/project.json +0 -1
- package/storybook-static/runtime~main.ceae5404.iframe.bundle.js +0 -1
- package/storybook-static/sb-addons/essentials-actions-3/manager-bundle.js +0 -3
- package/storybook-static/sb-addons/essentials-actions-3/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-backgrounds-4/manager-bundle.js +0 -12
- package/storybook-static/sb-addons/essentials-backgrounds-4/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-controls-2/manager-bundle.js +0 -60
- package/storybook-static/sb-addons/essentials-controls-2/manager-bundle.js.LEGAL.txt +0 -18
- package/storybook-static/sb-addons/essentials-measure-7/manager-bundle.js +0 -3
- package/storybook-static/sb-addons/essentials-measure-7/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-outline-8/manager-bundle.js +0 -3
- package/storybook-static/sb-addons/essentials-outline-8/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-toolbars-6/manager-bundle.js +0 -3
- package/storybook-static/sb-addons/essentials-toolbars-6/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-viewport-5/manager-bundle.js +0 -3
- package/storybook-static/sb-addons/essentials-viewport-5/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/links-1/manager-bundle.js +0 -3
- package/storybook-static/sb-addons/links-1/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +0 -3
- package/storybook-static/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-common-assets/fonts.css +0 -31
- package/storybook-static/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-bold.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-italic.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-regular.woff2 +0 -0
- package/storybook-static/sb-manager/WithTooltip-KJL26V4Q-5LS5AN27.js +0 -1
- package/storybook-static/sb-manager/chunk-2IOEGHGR.js +0 -274
- package/storybook-static/sb-manager/chunk-B3YDJJJH.js +0 -347
- package/storybook-static/sb-manager/chunk-BLWCBWKL.js +0 -9
- package/storybook-static/sb-manager/chunk-GUVK2GTO.js +0 -6
- package/storybook-static/sb-manager/chunk-VQTIH3SE.js +0 -186
- package/storybook-static/sb-manager/chunk-ZR5JZWHI.js +0 -1
- package/storybook-static/sb-manager/formatter-2WMMO6ZP-JI7RHVTW.js +0 -58
- package/storybook-static/sb-manager/globals-module-info.js +0 -1
- package/storybook-static/sb-manager/globals-runtime.js +0 -1
- package/storybook-static/sb-manager/globals.js +0 -1
- package/storybook-static/sb-manager/index.js +0 -1
- package/storybook-static/sb-manager/runtime.js +0 -1
- package/storybook-static/sb-manager/syntaxhighlighter-BP7B2CQK-WOJYHKQR.js +0 -1
- package/storybook-static/sb-preview/globals.js +0 -1
- package/storybook-static/sb-preview/runtime.js +0 -156
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunkreact_covideo_embed=self.webpackChunkreact_covideo_embed||[]).push([[161],{"./node_modules/css-loader/dist/cjs.js!./src/index.css":(module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/css-loader/dist/runtime/sourceMaps.js"),_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__),_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/css-loader/dist/runtime/api.js"),___CSS_LOADER_EXPORT___=__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__)()(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default());___CSS_LOADER_EXPORT___.push([module.id,"@import url(https://fonts.googleapis.com/css2?family=Work+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,500;1,600;1,700;1,800&display=swap);"]),___CSS_LOADER_EXPORT___.push([module.id,"@import url(https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,500;1,600;1,700;1,800&display=swap);"]),___CSS_LOADER_EXPORT___.push([module.id,"#covideo-embeddable-recorder {\n background: #f6f7f9;\n color: #272a32;\n font-style: normal;\n font-weight: 400;\n font-size: 15px;\n line-height: 24px;\n box-sizing: border-box;\n text-align: left;\n max-width: 100%;\n}\n\n#covideo-embeddable-recorder *,\n#covideo-embeddable-recorder *::before,\n#covideo-embeddable-recorder *::after {\n box-sizing: border-box;\n}\n\n#covideo-embeddable-recorder input,\n#covideo-embeddable-recorder button,\n#covideo-embeddable-recorder textarea,\n#covideo-embeddable-recorder select {\n font-family: inherit;\n}\n\n#covideo-embeddable-recorder .ai-assist > button {\n width: 32px;\n height: 32px;\n}\n\n#covideo-embeddable-recorder .ai-assist > button:hover {\n opacity: 1 !important;\n}\n\n.ReactModal__Body--open .ai-assist img {\n width: 100%;\n max-width: 400px;\n}\n\n.ReactModal__Body--open .ai-assist svg {\n box-sizing: content-box !important;\n}\n\n@media (max-width: 768px) {\n .ReactModal__Body--open .ai-assist img {\n width: 100%;\n height: auto;\n }\n}\n\n@media (max-width: 1240px) {\n .ReactModal__Content {\n padding: 0 15px !important;\n height: 100%;\n display: block;\n inset: auto;\n position: initial !important;\n transform: none !important;\n margin-right: 0 !important;\n min-width: auto !important;\n width: auto !important;\n }\n}\n","",{version:3,sources:["webpack://./src/index.css"],names:[],mappings:"AAGA;EACE,mBAAmB;EACnB,cAAc;EACd,kBAAkB;EAClB,gBAAgB;EAChB,eAAe;EACf,iBAAiB;EACjB,sBAAsB;EACtB,gBAAgB;EAChB,eAAe;AACjB;;AAEA;;;EAGE,sBAAsB;AACxB;;AAEA;;;;EAIE,oBAAoB;AACtB;;AAEA;EACE,WAAW;EACX,YAAY;AACd;;AAEA;EACE,qBAAqB;AACvB;;AAEA;EACE,WAAW;EACX,gBAAgB;AAClB;;AAEA;EACE,kCAAkC;AACpC;;AAEA;EACE;IACE,WAAW;IACX,YAAY;EACd;AACF;;AAEA;EACE;IACE,0BAA0B;IAC1B,YAAY;IACZ,cAAc;IACd,WAAW;IACX,4BAA4B;IAC5B,0BAA0B;IAC1B,0BAA0B;IAC1B,0BAA0B;IAC1B,sBAAsB;EACxB;AACF",sourcesContent:["@import url('https://fonts.googleapis.com/css2?family=Work+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,500;1,600;1,700;1,800&display=swap');\n@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,500;1,600;1,700;1,800&display=swap');\n\n#covideo-embeddable-recorder {\n background: #f6f7f9;\n color: #272a32;\n font-style: normal;\n font-weight: 400;\n font-size: 15px;\n line-height: 24px;\n box-sizing: border-box;\n text-align: left;\n max-width: 100%;\n}\n\n#covideo-embeddable-recorder *,\n#covideo-embeddable-recorder *::before,\n#covideo-embeddable-recorder *::after {\n box-sizing: border-box;\n}\n\n#covideo-embeddable-recorder input,\n#covideo-embeddable-recorder button,\n#covideo-embeddable-recorder textarea,\n#covideo-embeddable-recorder select {\n font-family: inherit;\n}\n\n#covideo-embeddable-recorder .ai-assist > button {\n width: 32px;\n height: 32px;\n}\n\n#covideo-embeddable-recorder .ai-assist > button:hover {\n opacity: 1 !important;\n}\n\n.ReactModal__Body--open .ai-assist img {\n width: 100%;\n max-width: 400px;\n}\n\n.ReactModal__Body--open .ai-assist svg {\n box-sizing: content-box !important;\n}\n\n@media (max-width: 768px) {\n .ReactModal__Body--open .ai-assist img {\n width: 100%;\n height: auto;\n }\n}\n\n@media (max-width: 1240px) {\n .ReactModal__Content {\n padding: 0 15px !important;\n height: 100%;\n display: block;\n inset: auto;\n position: initial !important;\n transform: none !important;\n margin-right: 0 !important;\n min-width: auto !important;\n width: auto !important;\n }\n}\n"],sourceRoot:""}]);const __WEBPACK_DEFAULT_EXPORT__=___CSS_LOADER_EXPORT___},"./node_modules/css-loader/dist/cjs.js!./stories/CovideoEmbed.css":(module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/css-loader/dist/runtime/sourceMaps.js"),_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__),_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/css-loader/dist/runtime/api.js"),___CSS_LOADER_EXPORT___=__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__)()(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default());___CSS_LOADER_EXPORT___.push([module.id,"#video-insert {\n border: 1px solid black;\n border-radius: 2px;\n padding: 2px 6px;\n margin-bottom: 8px;\n width: 230px;\n}\n#video-insert a img {\n width: 100%;\n height: auto;\n}\n.consumer-app {\n display: flex;\n align-items: flex-start;\n justify-content: center;\n flex-wrap: nowrap;\n gap: 8px;\n}\n.covideo-container {\n position: relative;\n width: 815px;\n height: 830px;\n min-width: 360px;\n max-width: 100%;\n overflow: auto;\n resize: both;\n box-shadow: 0px 0px 2px #999;\n background: #f6f7f9;\n}\n","",{version:3,sources:["webpack://./stories/CovideoEmbed.css"],names:[],mappings:"AAAA;EACE,uBAAuB;EACvB,kBAAkB;EAClB,gBAAgB;EAChB,kBAAkB;EAClB,YAAY;AACd;AACA;EACE,WAAW;EACX,YAAY;AACd;AACA;EACE,aAAa;EACb,uBAAuB;EACvB,uBAAuB;EACvB,iBAAiB;EACjB,QAAQ;AACV;AACA;EACE,kBAAkB;EAClB,YAAY;EACZ,aAAa;EACb,gBAAgB;EAChB,eAAe;EACf,cAAc;EACd,YAAY;EACZ,4BAA4B;EAC5B,mBAAmB;AACrB",sourcesContent:["#video-insert {\n border: 1px solid black;\n border-radius: 2px;\n padding: 2px 6px;\n margin-bottom: 8px;\n width: 230px;\n}\n#video-insert a img {\n width: 100%;\n height: auto;\n}\n.consumer-app {\n display: flex;\n align-items: flex-start;\n justify-content: center;\n flex-wrap: nowrap;\n gap: 8px;\n}\n.covideo-container {\n position: relative;\n width: 815px;\n height: 830px;\n min-width: 360px;\n max-width: 100%;\n overflow: auto;\n resize: both;\n box-shadow: 0px 0px 2px #999;\n background: #f6f7f9;\n}\n"],sourceRoot:""}]);const __WEBPACK_DEFAULT_EXPORT__=___CSS_LOADER_EXPORT___},"./stories/CovideoEmbed.stories.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{CovideoEmbedStory:()=>CovideoEmbedStory,default:()=>CovideoEmbed_stories});var jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js"),injectStylesIntoStyleTag=__webpack_require__("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),injectStylesIntoStyleTag_default=__webpack_require__.n(injectStylesIntoStyleTag),styleDomAPI=__webpack_require__("./node_modules/style-loader/dist/runtime/styleDomAPI.js"),styleDomAPI_default=__webpack_require__.n(styleDomAPI),insertBySelector=__webpack_require__("./node_modules/style-loader/dist/runtime/insertBySelector.js"),insertBySelector_default=__webpack_require__.n(insertBySelector),setAttributesWithoutAttributes=__webpack_require__("./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"),setAttributesWithoutAttributes_default=__webpack_require__.n(setAttributesWithoutAttributes),insertStyleElement=__webpack_require__("./node_modules/style-loader/dist/runtime/insertStyleElement.js"),insertStyleElement_default=__webpack_require__.n(insertStyleElement),styleTagTransform=__webpack_require__("./node_modules/style-loader/dist/runtime/styleTagTransform.js"),styleTagTransform_default=__webpack_require__.n(styleTagTransform),cjs_js_src=__webpack_require__("./node_modules/css-loader/dist/cjs.js!./src/index.css"),options={};options.styleTagTransform=styleTagTransform_default(),options.setAttributes=setAttributesWithoutAttributes_default(),options.insert=insertBySelector_default().bind(null,"head"),options.domAPI=styleDomAPI_default(),options.insertStyleElement=insertStyleElement_default();injectStylesIntoStyleTag_default()(cjs_js_src.A,options);cjs_js_src.A&&cjs_js_src.A.locals&&cjs_js_src.A.locals;var _a,_b,config_COOKIE_NAMES,es=__webpack_require__("./node_modules/react-query/es/index.js"),axios=__webpack_require__("./node_modules/axios/index.js"),axios_default=__webpack_require__.n(axios),process=__webpack_require__("./node_modules/process/browser.js"),__assign=function(){return __assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},__assign.apply(this,arguments)},API_EXPRESS_MAP={default:"https://api-sandbox.covideo.com/",development:"https://localhost:3000/api/",sandbox:"https://api-sandbox.covideo.com/",staging:"https://api-staging.covideo.com/",production:"https://api.covideo.com/"};!function(COOKIE_NAMES){COOKIE_NAMES.jwt="react-covideo-embed-jwt",COOKIE_NAMES.merge="react-covideo-merge",COOKIE_NAMES.recordSettings="record_settings",COOKIE_NAMES.recordError="react-covideo-record-error"}(config_COOKIE_NAMES||(config_COOKIE_NAMES={}));var token=localStorage.getItem(config_COOKIE_NAMES.jwt),apiExpress=API_EXPRESS_MAP.default,apiKey=void 0,config_updateToken=function(tokenNew,hasExternalJwt){void 0===hasExternalJwt&&(hasExternalJwt=!1),hasExternalJwt||localStorage.setItem(config_COOKIE_NAMES.jwt,tokenNew),token=tokenNew,config_EXPRESS_API.defaults.headers.Authorization="Bearer ".concat(token),config_options.headers.Authorization="Bearer ".concat(token)},config_options={headers:__assign(__assign({Authorization:"Bearer ".concat(token)},void 0!==apiKey?{ApiKey:apiKey}:{}),(_a={},_a["React-Covideo-Embed-Version"]=process.env.REACT_COVIDEO_EMBED_VERSION,_a))},config_EXPRESS_API=axios_default().create({baseURL:apiExpress,headers:__assign(__assign({"Content-Type":"application/json",Authorization:"Bearer ".concat(token)},void 0!==apiKey?{ApiKey:apiKey}:{}),(_b={},_b["React-Covideo-Embed-Version"]=process.env.REACT_COVIDEO_EMBED_VERSION,_b))}),react=__webpack_require__("./node_modules/react/index.js"),index_esm=__webpack_require__("./node_modules/react-resize-detector/build/index.esm.js"),dayjs_min=__webpack_require__("./node_modules/dayjs/dayjs.min.js"),dayjs_min_default=__webpack_require__.n(dayjs_min),utc=__webpack_require__("./node_modules/dayjs/plugin/utc.js"),utc_default=__webpack_require__.n(utc),timezone=__webpack_require__("./node_modules/dayjs/plugin/timezone.js"),timezone_default=__webpack_require__.n(timezone),__read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar};dayjs_min_default().extend(utc_default()),dayjs_min_default().extend(timezone_default());var functions_toString=function(o){return o?(Object.keys(o).forEach((function(k){if("object"==typeof o[k])return functions_toString(o[k]);"boolean"!=typeof o[k]&&(o[k]=""+o[k])})),o):o},toHHMMSSFF=function(sec_num,frame_rate){void 0===frame_rate&&(frame_rate=30);var hours=Math.floor(sec_num/3600),minutes=Math.floor((sec_num-3600*hours)/60),seconds=sec_num-3600*hours-60*minutes,milliseconds=parseInt((seconds%1).toFixed(3).substring(2)),frame=parseInt(Math.floor(milliseconds/(1e3/frame_rate)).toFixed(0));if(seconds=parseInt(Math.floor(seconds).toFixed(0)),isNaN(minutes))return"00:00:00:00";var time="";return hours<10&&(time="0"),time+=hours+":",minutes<10&&(time+="0"),time+=minutes+":",seconds<10&&(time+="0"),time+=seconds+":",frame<10&&(time+="0"),time+frame},toMMSS=function(sec_num,fractionDigits){void 0===fractionDigits&&(fractionDigits=1);var hours=Math.floor(sec_num/3600),minutes=Math.floor((sec_num-3600*hours)/60),seconds=sec_num-3600*hours-60*minutes;if(isNaN(minutes))return"00:00.0";var time="";return minutes<10&&(time+="0"),time+=minutes+":",seconds<10&&(time+="0"),time+=seconds.toFixed(fractionDigits)},generateFileName=function(userData,fileExt){return userData.userId+"_"+userData.customerId+"_"+(Math.random()+1).toString(36).substring(2)+"."+fileExt},checkIfVideoIsTrimmed=function(_a){var trimStart=_a.trimStart,trimEnd=_a.trimEnd,videoDuration=_a.videoDuration;return 0!==videoDuration&&0!==trimEnd&&(0!==trimStart||videoDuration-trimEnd>.3)},functions_isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),toMB=function(KB){return(KB/1e3).toFixed(2)};function checkIfMobileDevice(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}var WHITELABEL,THEME_NAME,react_covideo_common_esm=__webpack_require__("./node_modules/react-covideo-common/dist/react-covideo-common.esm.js"),styled_components_browser_esm=__webpack_require__("./node_modules/styled-components/dist/styled-components.browser.esm.js"),__makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},ConfigurationContext_assign=function(){return ConfigurationContext_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},ConfigurationContext_assign.apply(this,arguments)},__rest=function(s,e){var t={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0&&(t[p]=s[p]);if(null!=s&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(p=Object.getOwnPropertySymbols(s);i<p.length;i++)e.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i])&&(t[p[i]]=s[p[i]])}return t};!function(WHITELABEL){WHITELABEL.CDK="cdk"}(WHITELABEL||(WHITELABEL={})),function(THEME_NAME){THEME_NAME.AUTOMOTIVE="automotive",THEME_NAME.COVIDEO="covideo",THEME_NAME.KENNECTED="kennected",THEME_NAME.PROVIDEO="provideo",THEME_NAME.APP_2_VID="app2vid",THEME_NAME.BRANDING="branding",THEME_NAME.CDK="cdk"}(THEME_NAME||(THEME_NAME={}));var templateObject_1,_path,_path2,_path3,_path4,_path5,_path6,_path7,_path8,_path9,_path10,_defs,ConfigurationContext=(0,react.createContext)({}),GlobalStyle=(0,styled_components_browser_esm.DU)(templateObject_1||(templateObject_1=__makeTemplateObject(["\n * {\n font-family: ",";\n }\n button span {\n font-family: ",";\n"],["\n * {\n font-family: ",";\n }\n button span {\n font-family: ",";\n"])),(function(props){return props.$isCdk?"'Roboto', sans-serif":"'Work Sans', sans-serif"}),(function(props){return props.$isCdk?"'Roboto', sans-serif!important":"'Work Sans', sans-serif"})),ConfigurationProvider=function(_a){var children=_a.children,props=__rest(_a,["children"]),_b=(0,index_esm.uZ)({refreshMode:"debounce",refreshRate:100}),width=_b.width,height=_b.height,ref=_b.ref,token=props.token,env=props.env,onVideoInsert=props.onVideoInsert,onVideoInsertError=props.onVideoInsertError,hideFeatures=props.hideFeatures,apikey=props.apikey,onRecordButtonClick=props.onRecordButtonClick,onUploadButtonClick=props.onUploadButtonClick,reRender=props.reRender,featureVisibility=Object.fromEntries(Object.values(Feature).map((function(feature){return["show".concat((string=feature,string.charAt(0).toUpperCase()+string.slice(1)),"Feature"),!(null==hideFeatures?void 0:hideFeatures.includes(feature))];var string})));env&&function(env){apiExpress=API_EXPRESS_MAP[env]||API_EXPRESS_MAP.default,config_EXPRESS_API.defaults.baseURL=apiExpress}(env),apikey&&(apiKey=apikey,config_EXPRESS_API.defaults.headers.ApiKey=apiKey,config_options.headers.ApiKey=apiKey);var hasExternalJwt=!!token;hasExternalJwt&&config_updateToken(token,hasExternalJwt);var showRecordFeature=!!onRecordButtonClick||featureVisibility.showRecordBothFeature||featureVisibility.showRecordCamFeature||featureVisibility.showRecordScreenFeature,showUploadFeature=!!onUploadButtonClick||featureVisibility.showUploadFeature,showInsertFeature=featureVisibility.showInsertFeature&&!!onVideoInsert,value=ConfigurationContext_assign(ConfigurationContext_assign({token,env,onVideoInsert,onVideoInsertError,hasExternalJwt,containerWidth:width||0,containerHeight:height||0},featureVisibility),{showRecordFeature,showInsertFeature,onRecordButtonClick,onUploadButtonClick,showUploadFeature,reRender,whitelabel:props.whitelabel}),themeName=(null==props?void 0:props.whitelabel)||"branding",isCdkEnviroment=(null==props?void 0:props.whitelabel)===WHITELABEL.CDK;return(0,jsx_runtime.jsxs)(ConfigurationContext.Provider,ConfigurationContext_assign({value},{children:[(0,jsx_runtime.jsx)(GlobalStyle,{$isCdk:isCdkEnviroment}),(0,jsx_runtime.jsx)(react_covideo_common_esm.yr,ConfigurationContext_assign({themeName,additionalStyles:{themeName,isCdkEnviroment,containerWidth:width,containerHeight:height}},{children:(0,jsx_runtime.jsx)("div",ConfigurationContext_assign({ref},{children}))}))]}))},useConfigurationContext=function(){var context=(0,react.useContext)(ConfigurationContext);if(!context)throw new Error("useConfigurationContext must be used within ConfigurationProvider");return context},react_router=__webpack_require__("./node_modules/react-router/esm/react-router.js"),__awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},__generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},login=function(_a){var username=_a.username,password=_a.password;return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(_b){switch(_b.label){case 0:return[4,config_EXPRESS_API.post("/auth",{username,password})];case 1:return[2,_b.sent().data]}}))}))},FileSaver_min=__webpack_require__("./node_modules/file-saver/dist/FileSaver.min.js"),DEFAULT_FOLDER_NAMES_COMPANY="Company",DEFAULT_FOLDER_NAMES_PRIMARY="Primary",DEFAULT_FOLDER_NAMES_PRIVATE="Private",DEFAULT_FOLDER_NAMES_VAULT="Vault",videosApi_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},videosApi_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},ALL_FOLDERS_value="_all",ALL_FOLDERS_label="All folders",getFolders=function(){return videosApi_awaiter(void 0,void 0,void 0,(function(){var data,folders;return videosApi_generator(this,(function(_a){switch(_a.label){case 0:return[4,config_EXPRESS_API.get("/folders/new?getShared=true")];case 1:return data=_a.sent().data,(folders=data&&data.folders||[]).push({folderId:ALL_FOLDERS_value,name:ALL_FOLDERS_label,isDeletable:!1}),[2,folders]}}))}))},getVideo=function(videoId){return videosApi_awaiter(void 0,void 0,void 0,(function(){return videosApi_generator(this,(function(_a){switch(_a.label){case 0:return[4,config_EXPRESS_API.get("/videos/".concat(videoId))];case 1:return[2,_a.sent().data]}}))}))},deleteVideo=function(_a){var videoIds=_a.videoIds,deleteMultiple=_a.deleteMultiple,companyVideos=_a.companyVideos;return videosApi_awaiter(void 0,void 0,Promise,(function(){var data,url;return videosApi_generator(this,(function(_b){switch(_b.label){case 0:return data={isCompanyVideo:companyVideos},url="/videos/".concat(videoIds[0]),deleteMultiple&&(url="/videos",data={ids:videoIds,isCompanyVideo:companyVideos}),[4,config_EXPRESS_API.delete(url,{data})];case 1:return[2,_b.sent().data]}}))}))},updateVideo=function(_a){var videoId=_a.videoId,data=_a.videoBody;return videosApi_awaiter(void 0,void 0,void 0,(function(){return videosApi_generator(this,(function(_b){switch(_b.label){case 0:return[4,config_EXPRESS_API.put("/videos/".concat(videoId),data)];case 1:return[2,{video:_b.sent().data}]}}))}))},trimVideo=function(videoId,data){return videosApi_awaiter(void 0,void 0,void 0,(function(){return videosApi_generator(this,(function(_a){switch(_a.label){case 0:return[4,config_EXPRESS_API.put("/videos/".concat(videoId,"/trim"),data)];case 1:return[2,_a.sent().data]}}))}))},startTranscription=function(videoId){return videosApi_awaiter(void 0,void 0,Promise,(function(){return videosApi_generator(this,(function(_a){switch(_a.label){case 0:return[4,config_EXPRESS_API.post("/videos/".concat(videoId,"/transcripts/start"))];case 1:return[2,_a.sent().data]}}))}))},designApi_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},designApi_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},inventoryApi_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},inventoryApi_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},getInventoryItems=function(params){return inventoryApi_awaiter(void 0,void 0,Promise,(function(){return inventoryApi_generator(this,(function(_a){switch(_a.label){case 0:return[4,config_EXPRESS_API.get("/inventory",{params})];case 1:return[2,_a.sent().data]}}))}))},videoRequestApi_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},videoRequestApi_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},createVideoRequest=function(_a){var data=_a.data;return videoRequestApi_awaiter(void 0,void 0,Promise,(function(){return videoRequestApi_generator(this,(function(_b){switch(_b.label){case 0:return[4,config_EXPRESS_API.post("/video-requests",data)];case 1:return[2,_b.sent().data]}}))}))},voiceOverApi_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},voiceOverApi_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},getVoiceoverSignedURLs=function(data){return voiceOverApi_awaiter(void 0,void 0,Promise,(function(){return voiceOverApi_generator(this,(function(_a){switch(_a.label){case 0:return[4,config_EXPRESS_API.post("/aws/signedurl/voiceover-audio",data)];case 1:return[2,_a.sent().data]}}))}))},uploadVoiceoverAudio=function(_a){var data=_a.data;return voiceOverApi_awaiter(void 0,void 0,Promise,(function(){return voiceOverApi_generator(this,(function(_b){switch(_b.label){case 0:return[4,axios_default().put(data.uploadURL,data.file,{headers:{"Content-Type":data.mimeType}})];case 1:return[2,_b.sent().data]}}))}))},addVoiceoverToVideo=function(_a){var videoId=_a.videoId,audioFileName=_a.audioFileName,_b=_a.newVideoTitle,newVideoTitle=void 0===_b?"":_b,_c=_a.overwriteOriginal,overwriteOriginal=void 0!==_c&&_c;return voiceOverApi_awaiter(void 0,void 0,Promise,(function(){return voiceOverApi_generator(this,(function(_d){switch(_d.label){case 0:return[4,config_EXPRESS_API.post("/videos/".concat(videoId,"/voiceover"),{newVideoTitle,audioFileName,overwriteOriginal})];case 1:return[2,_d.sent().data]}}))}))},cachedTags={all:[],user:[]},getTags=function(_a){var _b=_a.page,page=void 0===_b?0:_b,_c=_a.size,size=void 0===_c?50:_c,_d=_a.search,search=void 0===_d?"":_d,_e=_a.all,all=void 0!==_e&&_e,sort=_a.sort,_f=_a.refresh,refresh=void 0===_f||_f;return voiceOverApi_awaiter(void 0,void 0,void 0,(function(){var params,response,_g,_h;return voiceOverApi_generator(this,(function(_j){switch(_j.label){case 0:if(params={start:page*size,limit:size,search,sort,all:""},all&&(params.all="true"),!refresh){if(all&&(null===(_g=null==cachedTags?void 0:cachedTags.all)||void 0===_g?void 0:_g.length))return[2,cachedTags.all];if(!all&&(null===(_h=null==cachedTags?void 0:cachedTags.user)||void 0===_h?void 0:_h.length))return[2,cachedTags.user]}return[4,config_EXPRESS_API.get("/video-tags",{params})];case 1:return response=_j.sent(),all?cachedTags.all=response.data:cachedTags.user=response.data,[2,response.data]}}))}))},wtvApi_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},wtvApi_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},getWTVVideos=function(props){return wtvApi_awaiter(void 0,void 0,void 0,(function(){var start,params,data,count,videos;return wtvApi_generator(this,(function(_a){switch(_a.label){case 0:return start=((props.page||1)-1)*(props.limit||12),params={start,limit:props.limit,search:props.search,year:props.year},[4,config_EXPRESS_API.get("/wtv",{params})];case 1:return data=_a.sent().data,count=data&&data.count||0,videos=data&&data.videos||[],[2,{count,videos}]}}))}))},attributesApi_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},attributesApi_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},getAttributes=function(_a){var _b=_a.page,page=void 0===_b?0:_b,_c=_a.size,size=void 0===_c?10:_c,search=_a.search,sort=_a.sort,_d=_a.filterByDepartment,filterByDepartment=void 0!==_d&&_d;return attributesApi_awaiter(void 0,void 0,void 0,(function(){var params,data,videoAttributes;return attributesApi_generator(this,(function(_e){switch(_e.label){case 0:return params={start:page*size,limit:size,search,sort,filterByDepartment},[4,config_EXPRESS_API.get("/video-attributes",{params})];case 1:return data=_e.sent().data,videoAttributes=data&&data.videoAttributes||[],[2,{count:data&&data.count||0,attributes:videoAttributes}]}}))}))},putVideoAttributes=function(videoId,data){return attributesApi_awaiter(void 0,void 0,void 0,(function(){return attributesApi_generator(this,(function(_a){switch(_a.label){case 0:return[4,config_EXPRESS_API.put("/videos/".concat(videoId,"/video-attributes"),data)];case 1:return[2,{videoAttributes:_a.sent().data}]}}))}))};function _extends(){return _extends=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},_extends.apply(null,arguments)}const CovideoLogo=function SvgCovideoLogo(props){return react.createElement("svg",_extends({width:133,height:33,viewBox:"0 0 133 33",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props),_path||(_path=react.createElement("path",{d:"M48.4811 22.7098C44.7502 22.7098 42.0752 20.0065 42.0752 16.208C42.0752 12.3628 44.8206 9.65956 48.6219 9.65956C51.0857 9.65956 53.268 10.8947 54.2301 12.8755L53.0803 13.528C52.2355 11.9667 50.5695 10.9413 48.6219 10.9413C45.6653 10.9413 43.4831 13.1085 43.4831 16.208C43.4831 19.2608 45.5949 21.428 48.4811 21.428C50.4287 21.428 52.2121 20.3328 53.0099 18.8413L54.1597 19.5404C53.1507 21.4746 50.9215 22.7098 48.4811 22.7098Z",fill:"white"})),_path2||(_path2=react.createElement("path",{d:"M61.8263 22.7331C58.0484 22.7331 55.303 19.8434 55.303 16.1847C55.303 12.5492 58.0484 9.65956 61.8263 9.65956C65.6042 9.65956 68.3496 12.5492 68.3496 16.1847C68.3496 19.8434 65.6042 22.7331 61.8263 22.7331ZM61.8263 21.4513C64.7829 21.4513 66.9417 19.121 66.9417 16.1847C66.9417 13.2717 64.7829 10.9413 61.8263 10.9413C58.8932 10.9413 56.7109 13.2717 56.7109 16.1847C56.7109 19.121 58.8932 21.4513 61.8263 21.4513Z",fill:"white"})),_path3||(_path3=react.createElement("path",{d:"M78.8263 9.65956H82.8388L77.2776 22.4068H74.3914L68.8537 9.65956H72.9131L75.8932 17.4897L78.8263 9.65956Z",fill:"white"})),_path4||(_path4=react.createElement("path",{d:"M85.617 8.35455C84.3734 8.35455 83.4113 7.42239 83.4113 6.18728C83.4113 4.95218 84.3969 4.02002 85.617 4.02002C86.8607 4.02002 87.8227 4.95218 87.8227 6.18728C87.8227 7.42239 86.8607 8.35455 85.617 8.35455ZM87.4473 22.4301H83.7633V9.65956H87.4473V22.4301Z",fill:"white"})),_path5||(_path5=react.createElement("path",{d:"M98.9292 4.69583H102.613V22.4301H99.0465V21.0552C98.1783 22.0339 96.9581 22.7564 95.2217 22.7564C91.6316 22.7564 88.8862 19.9133 88.8862 16.0448C88.8862 12.1997 91.6316 9.33331 95.2217 9.33331C96.8877 9.33331 98.061 10.0091 98.9292 10.8947V4.69583ZM95.8318 19.4239C97.7794 19.4239 99.1169 17.9091 99.1169 16.0215C99.1169 14.1805 97.7794 12.6658 95.8318 12.6658C93.8842 12.6658 92.5467 14.1805 92.5467 16.0215C92.5467 17.9091 93.8842 19.4239 95.8318 19.4239Z",fill:"white"})),_path6||(_path6=react.createElement("path",{d:"M117.413 15.7419C117.413 16.2546 117.366 16.7673 117.295 17.2799H107.839C108.238 18.6782 109.341 19.6802 111.335 19.6802C112.72 19.6802 114.315 19.1443 115.348 18.4451L116.803 20.9387C115.559 21.8708 113.565 22.7098 111.171 22.7098C106.361 22.7098 104.132 19.4938 104.132 16.0215C104.132 12.223 106.83 9.33331 110.913 9.33331C114.597 9.33331 117.413 11.687 117.413 15.7419ZM110.913 12.2929C109.411 12.2929 108.238 13.1785 107.816 14.6699H113.87C113.541 13.2251 112.462 12.2929 110.913 12.2929Z",fill:"white"})),_path7||(_path7=react.createElement("path",{d:"M125.152 22.7797C120.999 22.7797 118.23 19.7502 118.23 16.0448C118.23 12.3395 120.999 9.31001 125.152 9.31001C129.329 9.31001 132.122 12.3395 132.122 16.0448C132.122 19.7502 129.329 22.7797 125.152 22.7797ZM125.152 19.3773C127.006 19.3773 128.438 17.9091 128.438 16.0215C128.438 14.1805 127.006 12.7124 125.152 12.7124C123.322 12.7124 121.891 14.1805 121.891 16.0215C121.891 17.9091 123.322 19.3773 125.152 19.3773Z",fill:"white"})),_path8||(_path8=react.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.438 25.0699V6.95488L8.33453 2.43408L0 10.7149V21.4334L8.33453 29.77L15.438 25.0699Z",fill:"#1C8578"})),_path9||(_path9=react.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M24.6235 15.8128L35.6432 15.765V10.7185L24.9183 0H10.791L8.33688 2.43765L24.6235 15.8128Z",fill:"url(#paint0_linear_11_13017)"})),_path10||(_path10=react.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M24.6235 15.8134L8.33688 29.7741L10.7233 32.16H24.9183L35.6432 21.4375V15.7656L24.6235 15.8134Z",fill:"#11A694"})),_defs||(_defs=react.createElement("defs",null,react.createElement("linearGradient",{id:"paint0_linear_11_13017",x1:18.7201,y1:1.67911,x2:27.9868,y2:15.5693,gradientUnits:"userSpaceOnUse"},react.createElement("stop",{offset:.0483,stopColor:"#11A694"}),react.createElement("stop",{offset:1,stopColor:"#2FE0C7"})))))};var CovideoLogo_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked};const images_CovideoLogo=(0,styled_components_browser_esm.Ay)(CovideoLogo)(CovideoLogo_templateObject_1||(CovideoLogo_templateObject_1=CovideoLogo_makeTemplateObject(["\n max-height: 48px;\n max-width: 200px;\n"],["\n max-height: 48px;\n max-width: 200px;\n"])));var CovideoLogo_templateObject_1,cdkLogo_path,cdkLogo_path2,cdkLogo_path3,cdkLogo_path4,cdkLogo_path5,cdkLogo_path6,cdkLogo_path7,cdkLogo_path8,cdkLogo_path9,cdkLogo_path10;function cdkLogo_extends(){return cdkLogo_extends=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},cdkLogo_extends.apply(null,arguments)}const cdkLogo=function SvgCdkLogo(props){return react.createElement("svg",cdkLogo_extends({width:1024,height:219,viewBox:"0 0 1024 219",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props),cdkLogo_path||(cdkLogo_path=react.createElement("path",{d:"M99.8311 97.6852V121.3H107.851C112.249 121.3 114.486 120.31 116.404 118.468C118.641 116.29 119.889 113.596 119.889 109.591C119.889 105.846 118.778 103.075 116.738 100.913C114.836 98.8728 112.599 97.6852 107.866 97.6852H99.8311Z",fill:"white"})),cdkLogo_path2||(cdkLogo_path2=react.createElement("path",{d:"M109.449 0C49.0938 0 0 49.1166 0 109.5C0 169.883 49.0938 219 109.449 219C169.804 219 218.898 169.883 218.898 109.5C218.898 49.1166 169.804 0 109.449 0ZM58.4834 132.292C44.087 132.292 34.5452 122.03 34.5452 109.47C34.5452 96.9087 44.1479 86.7078 58.1486 86.7078C66.0316 86.7078 74.0516 89.7376 79.5758 94.0768L72.6667 101.568C68.6491 98.279 63.4597 96.3758 59.5791 96.3758C51.62 96.3758 46.4915 102.359 46.4915 109.53C46.4915 116.702 51.7569 122.685 59.8987 122.685C64.8902 122.685 70.0948 119.731 73.8994 116.169L80.8693 123.538C75.6799 128.136 67.9186 132.292 58.4529 132.292H58.4834ZM125.732 124.847C121.989 128.532 116.602 130.968 108.11 130.968H88.3262V88.0172H108.11C116.13 88.0172 122.05 90.2553 126.052 94.4575C129.735 98.3399 131.774 103.593 131.774 109.454C131.774 115.316 129.674 120.965 125.732 124.847ZM172.544 130.968L157.888 112.484L152.699 117.417V130.968H141.133V88.0172H152.699V104.125L169.591 88.0172H184.185L165.969 105.054L186.803 130.968H172.544Z",fill:"white"})),cdkLogo_path3||(cdkLogo_path3=react.createElement("path",{d:"M988.664 158.418C981.983 158.418 975.962 156.923 970.6 153.933C965.326 150.855 961.151 146.678 958.074 141.401C954.998 136.037 953.459 129.925 953.459 123.065C953.459 116.118 954.998 110.006 958.074 104.729C961.151 99.4527 965.326 95.3194 970.6 92.3293C975.874 89.3393 981.895 87.8443 988.664 87.8443C995.52 87.8443 1001.59 89.3393 1006.86 92.3293C1012.22 95.3194 1016.4 99.4527 1019.39 104.729C1022.46 110.006 1024 116.118 1024 123.065C1024 129.925 1022.46 136.037 1019.39 141.401C1016.4 146.678 1012.22 150.855 1006.86 153.933C1001.5 156.923 995.432 158.418 988.664 158.418ZM988.664 150.107C993.674 150.107 998.113 149.008 1001.98 146.81C1005.85 144.523 1008.88 141.357 1011.08 137.312C1013.36 133.178 1014.51 128.43 1014.51 123.065C1014.51 117.613 1013.36 112.864 1011.08 108.818C1008.88 104.773 1005.85 101.651 1001.98 99.4527C998.113 97.1662 993.718 96.0229 988.796 96.0229C983.873 96.0229 979.478 97.1662 975.61 99.4527C971.743 101.651 968.666 104.773 966.381 108.818C964.095 112.864 962.953 117.613 962.953 123.065C962.953 128.43 964.095 133.178 966.381 137.312C968.666 141.357 971.743 144.523 975.61 146.81C979.478 149.008 983.829 150.107 988.664 150.107Z",fill:"white"})),cdkLogo_path4||(cdkLogo_path4=react.createElement("path",{d:"M910.276 158.418C903.068 158.418 896.739 156.923 891.289 153.933C885.839 150.855 881.576 146.678 878.499 141.401C875.423 136.037 873.885 129.925 873.885 123.065C873.885 116.206 875.335 110.138 878.236 104.861C881.224 99.5846 885.268 95.4513 890.366 92.4613C895.552 89.3833 901.354 87.8443 907.771 87.8443C914.275 87.8443 920.033 89.3393 925.043 92.3293C930.141 95.2314 934.141 99.3647 937.042 104.729C939.942 110.006 941.393 116.118 941.393 123.065C941.393 123.505 941.349 123.989 941.261 124.516C941.261 124.956 941.261 125.44 941.261 125.967H881.005V118.976H936.251L932.559 121.746C932.559 116.733 931.46 112.292 929.262 108.423C927.153 104.465 924.252 101.387 920.56 99.1888C916.868 96.9903 912.605 95.891 907.771 95.891C903.024 95.891 898.761 96.9903 894.981 99.1888C891.201 101.387 888.256 104.465 886.147 108.423C884.037 112.38 882.982 116.909 882.982 122.01V123.461C882.982 128.737 884.125 133.398 886.411 137.444C888.784 141.401 892.036 144.523 896.168 146.81C900.387 149.008 905.177 150.107 910.539 150.107C914.759 150.107 918.67 149.36 922.274 147.865C925.966 146.37 929.131 144.083 931.768 141.005L937.042 147.073C933.965 150.767 930.097 153.581 925.439 155.516C920.868 157.451 915.813 158.418 910.276 158.418Z",fill:"white"})),cdkLogo_path5||(cdkLogo_path5=react.createElement("path",{d:"M819.069 158.418C812.477 158.418 806.543 156.923 801.269 153.933C796.083 150.943 791.996 146.809 789.007 141.533C786.018 136.168 784.524 130.012 784.524 123.065C784.524 116.03 786.018 109.874 789.007 104.597C791.996 99.3207 796.083 95.2314 801.269 92.3293C806.543 89.3392 812.477 87.8442 819.069 87.8442C825.134 87.8442 830.54 89.2073 835.287 91.9335C840.122 94.6597 843.945 98.6611 846.758 103.938C849.659 109.126 851.109 115.502 851.109 123.065C851.109 130.54 849.703 136.916 846.89 142.192C844.077 147.469 840.254 151.514 835.419 154.329C830.672 157.055 825.222 158.418 819.069 158.418ZM819.729 150.107C824.651 150.107 829.046 149.008 832.914 146.809C836.869 144.523 839.946 141.357 842.143 137.312C844.429 133.178 845.572 128.43 845.572 123.065C845.572 117.613 844.429 112.864 842.143 108.818C839.946 104.773 836.869 101.651 832.914 99.4526C829.046 97.1661 824.651 96.0228 819.729 96.0228C814.894 96.0228 810.543 97.1661 806.675 99.4526C802.808 101.651 799.731 104.773 797.446 108.818C795.16 112.864 794.017 117.613 794.017 123.065C794.017 128.43 795.16 133.178 797.446 137.312C799.731 141.357 802.808 144.523 806.675 146.809C810.543 149.008 814.894 150.107 819.729 150.107ZM845.835 157.758V136.916L846.758 122.933L845.44 108.95V59.8786H854.801V157.758H845.835Z",fill:"white"})),cdkLogo_path6||(cdkLogo_path6=react.createElement("path",{d:"M756.103 157.758V88.5038H765.464V157.758H756.103ZM760.849 73.2018C758.915 73.2018 757.289 72.5423 755.971 71.2231C754.652 69.904 753.993 68.3211 753.993 66.4743C753.993 64.6275 754.652 63.0885 755.971 61.8573C757.289 60.5382 758.915 59.8786 760.849 59.8786C762.783 59.8786 764.409 60.4942 765.728 61.7254C767.046 62.9566 767.705 64.4956 767.705 66.3423C767.705 68.2771 767.046 69.904 765.728 71.2231C764.497 72.5423 762.871 73.2018 760.849 73.2018Z",fill:"white"})),cdkLogo_path7||(cdkLogo_path7=react.createElement("path",{d:"M694.572 157.758L653.698 65.4186H664.246L702.484 152.349H696.682L735.183 65.4186H745.072L704.198 157.758H694.572Z",fill:"white"})),cdkLogo_path8||(cdkLogo_path8=react.createElement("path",{d:"M503.809 157.758V65.4186H521.477L560.769 130.584H551.408L590.04 65.4186H607.577L607.84 157.758H587.799L587.667 96.1544H591.359L560.505 147.996H550.88L519.368 96.1544H523.851V157.758H503.809Z",fill:"white"})),cdkLogo_path9||(cdkLogo_path9=react.createElement("path",{d:"M406.852 157.758V65.4186H446.803C455.066 65.4186 462.186 66.7817 468.163 69.5079C474.14 72.1462 478.755 75.9717 482.007 80.9844C485.26 85.9971 486.886 91.9771 486.886 98.9246C486.886 105.784 485.26 111.72 482.007 116.733C478.755 121.658 474.14 125.439 468.163 128.077C462.186 130.716 455.066 132.035 446.803 132.035H418.718L428.212 122.669V157.758H406.852ZM465.526 157.758L442.452 124.252H465.262L488.6 157.758H465.526ZM428.212 125.043L418.718 115.018H445.616C452.209 115.018 457.131 113.611 460.384 110.797C463.636 107.895 465.262 103.937 465.262 98.9246C465.262 93.8239 463.636 89.8665 460.384 87.0524C457.131 84.2382 452.209 82.8312 445.616 82.8312H418.718L428.212 72.6738V125.043Z",fill:"white"})),cdkLogo_path10||(cdkLogo_path10=react.createElement("path",{d:"M354.323 159.341C347.203 159.341 340.566 158.198 334.413 155.911C328.348 153.537 323.074 150.195 318.591 145.886C314.108 141.577 310.592 136.52 308.043 130.716C305.581 124.912 304.351 118.536 304.351 111.588C304.351 104.641 305.581 98.2652 308.043 92.461C310.592 86.6568 314.108 81.6002 318.591 77.291C323.162 72.9818 328.48 69.684 334.545 67.3975C340.61 65.023 347.247 63.8358 354.454 63.8358C362.453 63.8358 369.661 65.2429 376.078 68.0571C382.583 70.7833 388.033 74.8286 392.428 80.1931L378.715 92.8568C375.551 89.2511 372.035 86.5689 368.167 84.81C364.299 82.9633 360.08 82.0399 355.509 82.0399C351.202 82.0399 347.247 82.7434 343.643 84.1505C340.039 85.5575 336.918 87.5802 334.281 90.2185C331.644 92.8568 329.578 95.9787 328.084 99.5843C326.678 103.19 325.974 107.191 325.974 111.588C325.974 115.986 326.678 119.987 328.084 123.593C329.578 127.198 331.644 130.32 334.281 132.958C336.918 135.597 340.039 137.619 343.643 139.026C347.247 140.433 351.202 141.137 355.509 141.137C360.08 141.137 364.299 140.258 368.167 138.499C372.035 136.652 375.551 133.882 378.715 130.188L392.428 142.852C388.033 148.216 382.583 152.306 376.078 155.12C369.661 157.934 362.41 159.341 354.323 159.341Z",fill:"white"})))};var CdkLogo_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked};const images_CdkLogo=(0,styled_components_browser_esm.Ay)(cdkLogo)(CdkLogo_templateObject_1||(CdkLogo_templateObject_1=CdkLogo_makeTemplateObject(["\n max-height: 48px;\n max-width: 200px;\n"],["\n max-height: 48px;\n max-width: 200px;\n"])));var CdkLogo_templateObject_1,TopBar_templateObject_1,templateObject_2,templateObject_3,templateObject_4,templateObject_5,templateObject_6,templateObject_7,templateObject_8,templateObject_9,Container_templateObject_1,Input_templateObject_1,ButtonDropdown_templateObject_1,ButtonDropdown_templateObject_2,ButtonDropdown_templateObject_3,ButtonDropdown_templateObject_4,ButtonDropdown_templateObject_5,ButtonDropdown_templateObject_6,ButtonDropdown_templateObject_7,Spinner_templateObject_1,Spinner_templateObject_2,LoadingIndicator_templateObject_1,LoadingIndicator_templateObject_2,LoadingIndicator_templateObject_3,VideoQualityType,VideoEditingType,Logo=function(){return(0,styled_components_browser_esm.DP)().isCdkEnviroment?(0,jsx_runtime.jsx)(images_CdkLogo,{}):(0,jsx_runtime.jsx)(images_CovideoLogo,{})},theme_assign=function(){return theme_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},theme_assign.apply(this,arguments)},screenSizes_mb=420,screenSizes_xs=660,screenSizes_sm=768,screenSizes_cmd=812,screenSizes_md=1024,screenSizes_lg=1200,screenSizes_xlg=1368,screenSizes_xxlg=1750,fontCommon={fontFamily:"var(--font-family-secondary)"},fontNormal400=theme_assign(theme_assign({},fontCommon),{fontWeight:400}),fontNormal500=theme_assign(theme_assign({},fontCommon),{fontWeight:500}),fontBold700=(theme_assign(theme_assign({},fontCommon),{fontWeight:600}),theme_assign(theme_assign({},fontCommon),{fontWeight:700})),fontSizes_sm=(theme_assign(theme_assign({},fontCommon),{fontWeight:800}),"14px"),fontSizes_m="15px",fontSizes_md="16px",fontSizes_lg="18px",mediaQueryMinWidth={mb:"@media (min-width: ".concat(screenSizes_mb,"px)"),xs:"@media (min-width: ".concat(screenSizes_xs,"px)"),sm:"@media (min-width: ".concat(screenSizes_sm,"px)"),md:"@media (min-width: ".concat(screenSizes_md,"px)"),lg:"@media (min-width: ".concat(screenSizes_lg,"px)"),xlg:"@media (min-width: ".concat(screenSizes_xlg,"px)"),xxlg:"@media (min-width: ".concat(screenSizes_xxlg,"px)"),cmd:"@media (min-width: ".concat(screenSizes_cmd,"px)")},palette_grayBorder=("@media (max-width: ".concat(screenSizes_mb,"px)"),"@media (max-width: ".concat(screenSizes_xs,"px)"),"@media (max-width: ".concat(screenSizes_sm,"px)"),"@media (max-width: ".concat(screenSizes_md,"px)"),"@media (max-width: ".concat(screenSizes_lg,"px)"),"@media (max-width: ".concat(screenSizes_xlg,"px)"),"@media (max-width: ".concat(screenSizes_xxlg,"px)"),"#dfe3e6"),palette_white="#fff",palette_black_1_100="#000",palette_blackRgb60="rgba(52,58,64, .6)",palette_blackRgba75="rgba(0,0,0, .75)",palette_themeDark="#343A40",palette_gray10="#F6F7F9",palette_gray20="#EEEFF2",palette_gray40="#D0D3D9",palette_gray60="#9297A2",palette_gray80="#4E5461",palette_gray100="#272A32",palette_transparent="transparent",palette_error="rgba(232, 76, 61, 1)",palette_black="#000",palette_black25="rgba(39, 42, 50, 0.25)",palette_black40="rgba(39, 42, 50, 0.4)",palette_red100="#E84C3D",palette_whiteRgb85="rgba(255,255,255, .85)",palette_primaryDarkBlue="#041640",palette_lightgray40="rgba(213,214,217,0.4)",palette_covideoGray100="rgba(78, 84, 97, 1)",palette_themeDark50Percent="#B3B9BF",palette_themeDark75Percent="#676D73",palette_secondaryButtonBlueBg="#F2F4F6",palette_label="#9297a2",palette_lightgray="rgba(213,214,217,1)",palette_blackRgb75="rgba(52,58,64, .75)",palette_primaryBlack25Percent="rgba(36, 39, 46, 0.25)",palette_secondaryBlue="#007BFF",palette_midGrey="#9297a2",palette_coal="#272a32",palette_covideoGray40="rgba(208, 211, 217, 1)",TopBar_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},Wrapper=styled_components_browser_esm.Ay.div(TopBar_templateObject_1||(TopBar_templateObject_1=TopBar_makeTemplateObject(["\n height: 64px;\n position: relative;\n z-index: 9;\n top: 0;\n right: 0;\n left: 0;\n background: rgb(2, 21, 19);\n box-shadow:\n 0px 0px 2px rgba(66, 79, 104, 0.08),\n 0px 4px 8px rgba(66, 79, 104, 0.03);\n"],["\n height: 64px;\n position: relative;\n z-index: 9;\n top: 0;\n right: 0;\n left: 0;\n background: rgb(2, 21, 19);\n box-shadow:\n 0px 0px 2px rgba(66, 79, 104, 0.08),\n 0px 4px 8px rgba(66, 79, 104, 0.03);\n"]))),DektopChildrenWrapper=styled_components_browser_esm.Ay.div(templateObject_2||(templateObject_2=TopBar_makeTemplateObject(["\n height: 64px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n z-index: 8;\n padding: 0 12px;\n"],["\n height: 64px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n z-index: 8;\n padding: 0 12px;\n"]))),Left=styled_components_browser_esm.Ay.div(templateObject_4||(templateObject_4=TopBar_makeTemplateObject(["\n margin-right: auto;\n width: 42%;\n display: flex;\n align-items: center;\n justify-content: flex-start;\n gap: 8px;\n ","\n"],["\n margin-right: auto;\n width: 42%;\n display: flex;\n align-items: center;\n justify-content: flex-start;\n gap: 8px;\n ","\n"])),(function(_a){return _a.theme.containerWidth<screenSizes_xs&&(0,styled_components_browser_esm.AH)(templateObject_3||(templateObject_3=TopBar_makeTemplateObject(["\n width: 49%;\n "],["\n width: 49%;\n "])))})),Center=styled_components_browser_esm.Ay.div(templateObject_6||(templateObject_6=TopBar_makeTemplateObject(["\n margin: 0 auto;\n display: flex;\n align-items: center;\n justify-content: center;\n white-space: nowrap;\n ","\n }\n"],["\n margin: 0 auto;\n display: flex;\n align-items: center;\n justify-content: center;\n white-space: nowrap;\n ","\n }\n"])),(function(_a){return _a.theme.containerWidth<480&&(0,styled_components_browser_esm.AH)(templateObject_5||(templateObject_5=TopBar_makeTemplateObject(["\n display: none;\n "],["\n display: none;\n "])))})),Right=styled_components_browser_esm.Ay.div(templateObject_8||(templateObject_8=TopBar_makeTemplateObject(["\n margin-left: auto;\n width: 42%;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: 8px;\n button {\n flex-shrink: 0;\n }\n ","\n"],["\n margin-left: auto;\n width: 42%;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: 8px;\n button {\n flex-shrink: 0;\n }\n ","\n"])),(function(_a){return _a.theme.containerWidth<screenSizes_xs&&(0,styled_components_browser_esm.AH)(templateObject_7||(templateObject_7=TopBar_makeTemplateObject(["\n width: 49%;\n "],["\n width: 49%;\n "])))})),EmptyDiv=styled_components_browser_esm.Ay.div(templateObject_9||(templateObject_9=TopBar_makeTemplateObject(["\n min-height: 1px;\n"],["\n min-height: 1px;\n"]))),TopBar=function(_a){var left=_a.left,right=_a.right,center=_a.center;return(0,jsx_runtime.jsx)(Wrapper,{children:(0,jsx_runtime.jsxs)(DektopChildrenWrapper,{children:[(0,jsx_runtime.jsx)(Left,{children:left||(0,jsx_runtime.jsx)(EmptyDiv,{})}),(0,jsx_runtime.jsx)(Center,{children:center||(0,jsx_runtime.jsx)(EmptyDiv,{})}),(0,jsx_runtime.jsx)(Right,{children:right||(0,jsx_runtime.jsx)(EmptyDiv,{})})]})})},Container_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},Container_assign=function(){return Container_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},Container_assign.apply(this,arguments)},Container_Wrapper=styled_components_browser_esm.Ay.div(Container_templateObject_1||(Container_templateObject_1=Container_makeTemplateObject(["\n width: 928px;\n max-width: 100%;\n margin: 0 auto 0;\n padding: 32px 16px;\n position: relative;\n"],["\n width: 928px;\n max-width: 100%;\n margin: 0 auto 0;\n padding: 32px 16px;\n position: relative;\n"]))),Container=function(_a){var children=_a.children,extendStyle=_a.extendStyle;return(0,jsx_runtime.jsx)(Container_Wrapper,Container_assign({style:null==extendStyle?void 0:extendStyle.wrapper},{children}))},Input_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},Input=styled_components_browser_esm.Ay.input.attrs((function(_a){var _b=_a.type;return{type:void 0===_b?"text":_b}}))(Input_templateObject_1||(Input_templateObject_1=Input_makeTemplateObject(["\n background: ",";\n border: 1px solid\n ",";\n border-radius: 6px;\n outline: none;\n height: 40px;\n padding: ",";\n font-size: 15px;\n line-height: 24px;\n width: ",";\n &::placeholder {\n color: ",";\n opacity: 1;\n }\n &:focus {\n border: 1px solid ",";\n }\n"],["\n background: ",";\n border: 1px solid\n ",";\n border-radius: 6px;\n outline: none;\n height: 40px;\n padding: ",";\n font-size: 15px;\n line-height: 24px;\n width: ",";\n &::placeholder {\n color: ",";\n opacity: 1;\n }\n &:focus {\n border: 1px solid ",";\n }\n"])),palette_white,(function(props){return props.borderColor||props.theme.colors.primary[20]}),(function(_a){return _a.padding||"8px"}),(function(_a){return _a.width}),palette_gray60,(function(_a){return _a.theme.colors.primary[100]})),ButtonDropdown_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},ButtonDropdown_assign=function(){return ButtonDropdown_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},ButtonDropdown_assign.apply(this,arguments)},ButtonStyled=styled_components_browser_esm.Ay.button(ButtonDropdown_templateObject_3||(ButtonDropdown_templateObject_3=ButtonDropdown_makeTemplateObject(["\n background-color: ",";\n box-sizing: border-box;\n color: ",";\n border: 1px solid;\n border-color: ",";\n width: ",";\n height: ",";\n display: flex;\n align-items: center;\n justify-content: center;\n padding: ",";\n cursor: pointer;\n border-radius: 6px;\n font-weight: 600;\n font-size: ",";\n line-height: 24px;\n margin: ",";\n > span {\n white-space: nowrap;\n }\n ","\n &:hover {\n ","\n }\n"],["\n background-color: ",";\n box-sizing: border-box;\n color: ",";\n border: 1px solid;\n border-color: ",";\n width: ",";\n height: ",";\n display: flex;\n align-items: center;\n justify-content: center;\n padding: ",";\n cursor: pointer;\n border-radius: 6px;\n font-weight: 600;\n font-size: ",";\n line-height: 24px;\n margin: ",";\n > span {\n white-space: nowrap;\n }\n ","\n &:hover {\n ","\n }\n"])),(function(_a){return _a.backgroundColor}),(function(_a){var textColor=_a.textColor,theme=_a.theme;return textColor||theme.colors.primary[100]}),(function(_a){var borderColor=_a.borderColor,theme=_a.theme;return borderColor||theme.colors.primary[5]}),(function(_a){return _a.width}),(function(props){return props.height||"40px"}),(function(props){return props.padding||"0 16px"}),(function(_a){return _a.fontSize}),(function(props){return props.margin}),(function(_a){return _a.disabled&&(0,styled_components_browser_esm.AH)(ButtonDropdown_templateObject_1||(ButtonDropdown_templateObject_1=ButtonDropdown_makeTemplateObject(["\n pointer-events: none;\n opacity: 0.4;\n "],["\n pointer-events: none;\n opacity: 0.4;\n "])))}),(function(_a){var hoverBorderColor=_a.hoverBorderColor;return hoverBorderColor&&(0,styled_components_browser_esm.AH)(ButtonDropdown_templateObject_2||(ButtonDropdown_templateObject_2=ButtonDropdown_makeTemplateObject(["\n border-color: ",";\n "],["\n border-color: ",";\n "])),hoverBorderColor)})),IconWrapper=styled_components_browser_esm.Ay.div(ButtonDropdown_templateObject_4||(ButtonDropdown_templateObject_4=ButtonDropdown_makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n margin: ",";\n"],["\n display: flex;\n align-items: center;\n justify-content: center;\n margin: ",";\n"])),(function(_a){return _a.margin})),IconOtherWrapper=styled_components_browser_esm.Ay.div(ButtonDropdown_templateObject_5||(ButtonDropdown_templateObject_5=ButtonDropdown_makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n margin: ",";\n"],["\n display: flex;\n align-items: center;\n justify-content: center;\n margin: ",";\n"])),(function(_a){return _a.margin})),TextWrapper=styled_components_browser_esm.Ay.div(ButtonDropdown_templateObject_6||(ButtonDropdown_templateObject_6=ButtonDropdown_makeTemplateObject(["\n display: flex;\n align-items: flex-start;\n flex-direction: column;\n flex-wrap: nowrap;\n > span {\n max-width: 200px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"],["\n display: flex;\n align-items: flex-start;\n flex-direction: column;\n flex-wrap: nowrap;\n > span {\n max-width: 200px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"]))),SubText=styled_components_browser_esm.Ay.div(ButtonDropdown_templateObject_7||(ButtonDropdown_templateObject_7=ButtonDropdown_makeTemplateObject(["\n font-size: 10px;\n line-height: 10px;\n opacity: 0.8;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 115px;\n"],["\n font-size: 10px;\n line-height: 10px;\n opacity: 0.8;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 115px;\n"]))),ButtonDropdown=function(_a){var text=_a.text,subtext=_a.subtext,_b=_a.type,type=void 0===_b?"button":_b,icon=_a.icon,iconOther=_a.iconOther,_c=_a.backgroundColor,backgroundColor=void 0===_c?palette_white:_c,borderColor=_a.borderColor,hoverBorderColor=_a.hoverBorderColor,textColor=_a.textColor,_d=_a.disabled,disabled=void 0!==_d&&_d,_e=_a.margin,margin=void 0===_e?"0":_e,_f=_a.width,width=void 0===_f?"auto":_f,_g=_a.fontSize,fontSize=void 0===_g?"13px":_g,_h=_a.padding,padding=void 0===_h?"0 16px":_h,height=_a.height,onClick=_a.onClick,title=_a.title,buttonPadding=padding||(icon?"0 16px 0 12px":"0 16px");return(0,jsx_runtime.jsxs)(ButtonStyled,ButtonDropdown_assign({backgroundColor,borderColor,textColor,disabled,margin,onClick,type,width,fontSize,padding:buttonPadding,height,hoverBorderColor,title},{children:[!!icon&&(0,jsx_runtime.jsx)(IconWrapper,ButtonDropdown_assign({margin:text?"0 6px 0 0":"0"},{children:icon})),(0,jsx_runtime.jsxs)(TextWrapper,{children:[(0,jsx_runtime.jsx)("span",{children:text}),(0,jsx_runtime.jsx)(SubText,{children:subtext})]}),!!iconOther&&(0,jsx_runtime.jsx)(IconOtherWrapper,ButtonDropdown_assign({margin:text?"0 0 0 8px":"0"},{children:iconOther}))]}))},Spinner_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},animation=(0,styled_components_browser_esm.i7)(Spinner_templateObject_1||(Spinner_templateObject_1=Spinner_makeTemplateObject(["\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n"],["\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n"]))),Spinner=styled_components_browser_esm.Ay.div(Spinner_templateObject_2||(Spinner_templateObject_2=Spinner_makeTemplateObject(["\n display: inline-block;\n width: ","px;\n height: ","px;\n\n &:after {\n content: ' ';\n display: block;\n width: ","px;\n height: ","px;\n margin: 1px;\n border-radius: 50%;\n border: ","px solid\n ",";\n border-color: "," transparent\n "," transparent;\n animation: "," 1.2s linear infinite;\n }\n"],["\n display: inline-block;\n width: ","px;\n height: ","px;\n\n &:after {\n content: ' ';\n display: block;\n width: ","px;\n height: ","px;\n margin: 1px;\n border-radius: 50%;\n border: ","px solid\n ",";\n border-color: "," transparent\n "," transparent;\n animation: "," 1.2s linear infinite;\n }\n"])),(function(props){return props.size?"15":"24"}),(function(props){return props.size?"15":"24"}),(function(props){return props.size?props.size:"14"}),(function(props){return props.size?props.size:"14"}),(function(props){return props.thickness?props.thickness:"3"}),(function(props){return props.color?props.color:"#fff"}),(function(props){return props.color?props.color:"#fff"}),(function(props){return props.color?props.color:"#fff"}),animation),LoadingIndicator_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},LoadingIndicator_assign=function(){return LoadingIndicator_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},LoadingIndicator_assign.apply(this,arguments)},LoadingOverlay=styled_components_browser_esm.Ay.div(LoadingIndicator_templateObject_1||(LoadingIndicator_templateObject_1=LoadingIndicator_makeTemplateObject(["\n font-weight: 700;\n color: ",";\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n box-sizing: border-box;\n line-height: 50px;\n margin: 0;\n z-index: ",";\n"],["\n font-weight: 700;\n color: ",";\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n box-sizing: border-box;\n line-height: 50px;\n margin: 0;\n z-index: ",";\n"])),palette_gray100,(function(props){return void 0!==props.zIndex?props.zIndex:99})),LoadingSection=styled_components_browser_esm.Ay.div(LoadingIndicator_templateObject_2||(LoadingIndicator_templateObject_2=LoadingIndicator_makeTemplateObject(["\n width: 100%;\n display: flex;\n flex-direction: column;\n text-align: center;\n justify-content: center;\n\n h1 {\n font-size: 18px;\n margin: 0;\n letter-spacing: 1px;\n }\n"],["\n width: 100%;\n display: flex;\n flex-direction: column;\n text-align: center;\n justify-content: center;\n\n h1 {\n font-size: 18px;\n margin: 0;\n letter-spacing: 1px;\n }\n"]))),LoadingContainer=styled_components_browser_esm.Ay.div(LoadingIndicator_templateObject_3||(LoadingIndicator_templateObject_3=LoadingIndicator_makeTemplateObject(["\n position: ",";\n height: ",";\n"],["\n position: ",";\n height: ",";\n"])),(function(props){return props.height?"relative":"inherit"}),(function(props){return"string"==typeof props.height?props.height:"number"==typeof props.height?"".concat(props.height,"px"):void 0===props.height?0:void 0})),LoadingIndicator=function(_a){var _b=_a.isLoading,isLoading=void 0!==_b&&_b,_c=_a.error,error=void 0!==_c&&_c,_d=_a.text,text=void 0===_d?"Loading...":_d,color=_a.color,height=_a.height,zIndex=_a.zIndex,onRetry=_a.onRetry,hideLoaderText=_a.hideLoaderText;return(0,jsx_runtime.jsxs)(LoadingContainer,LoadingIndicator_assign({height},{children:[isLoading&&!error&&(0,jsx_runtime.jsx)(LoadingOverlay,LoadingIndicator_assign({zIndex},{children:(0,jsx_runtime.jsxs)(LoadingSection,{children:[(0,jsx_runtime.jsx)("div",{children:(0,jsx_runtime.jsx)(Spinner,{color:color||palette_gray100})}),!hideLoaderText&&(0,jsx_runtime.jsx)("h1",LoadingIndicator_assign({style:{color}},{children:text}))]})})),error&&(0,jsx_runtime.jsx)(LoadingOverlay,LoadingIndicator_assign({zIndex},{children:(0,jsx_runtime.jsx)(LoadingSection,LoadingIndicator_assign({style:{cursor:onRetry?"pointer":"auto"},onClick:function(){return onRetry&&onRetry()}},{children:(0,jsx_runtime.jsx)("h1",{children:"Try Again..."})}))}))]}))},jwt_decode_esm=__webpack_require__("./node_modules/jwt-decode/build/jwt-decode.esm.js"),authReducer_assign=function(){return authReducer_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},authReducer_assign.apply(this,arguments)},authReducer=function(state,action){var payload=action.payload;switch(action.type){case"GET_USER_SUCCESS":return authReducer_assign(authReducer_assign({},state),{userData:authReducer_assign(authReducer_assign({},state.userData),functions_toString(payload))});case"JWT_DECODED":return authReducer_assign(authReducer_assign({},state),{userData:authReducer_assign(authReducer_assign({},state.userData),payload)});default:return state}},AUTH_ACTIONS_JWT_DECODED="JWT_DECODED",AUTH_ACTIONS_GET_USER_SUCCESS="GET_USER_SUCCESS",AuthorizationContext_assign=function(){return AuthorizationContext_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},AuthorizationContext_assign.apply(this,arguments)},AuthorizationContext_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar};!function(VideoQualityType){VideoQualityType.FHD="1080",VideoQualityType["4K"]="4096"}(VideoQualityType||(VideoQualityType={})),function(VideoEditingType){VideoEditingType.Basic="Basic",VideoEditingType.Advanced="Advanced"}(VideoEditingType||(VideoEditingType={}));var AutomotiveRole,defaultUseData={id:"0",uid:"0",userId:"0",customerId:"0",resellerId:"0",firstName:"0",lastName:"0",eleadEnabled:!1,admin:!1,resellerAdmin:!1,trial:!1,notifyMe:!1,access:"0",verified:0,captions:!1,vin:!1,iat:0,exp:0,totalLogins:0,showWelcome:!1,salesforceIntegration:!1,autoTranscribe:!1,wheelsTV:!1,webEmailEnabled:!1,allowDelete:!0,webShare:!0,timeZone:"",intercom:{},videoCount:0,droplrAccess:!1,affiliateAccess:!1,email:"",phone1:"",customer:{},transcriptionAccess:!1,playButtonPosition:"0",trialAccount:!1,automotiveRole:"0",vdpEnabled:!1,markVideosAsSent:null,packageDetails:null,reactionsPreference:null,isCompanyAdmin:!1},AuthorizationContext=(0,react.createContext)({}),AuthorizationContextProvider=function(_a){var _b=_a.initialUser,initialUser=void 0===_b?{}:_b,children=_a.children,_c=AuthorizationContext_read((0,react.useState)(token),2),jwt=_c[0],setJwt=_c[1],_d=AuthorizationContext_read((0,react.useReducer)(authReducer,{userData:AuthorizationContext_assign(AuthorizationContext_assign({},defaultUseData),initialUser),jwt:"",setJwt}),2),state=_d[0],dispatch=_d[1];(0,react.useEffect)((function(){0!==Object.keys(initialUser).length&&dispatch({type:AUTH_ACTIONS_GET_USER_SUCCESS,payload:initialUser})}),[JSON.stringify(initialUser)]),(0,react.useEffect)((function(){try{var decodedToken=jwt&&(0,jwt_decode_esm.A)(jwt)||defaultUseData;dispatch({type:AUTH_ACTIONS_JWT_DECODED,payload:decodedToken})}catch(error){console.log("Invalid token.")}}),[jwt]);var value=AuthorizationContext_assign(AuthorizationContext_assign({},state),{dispatch});return(0,jsx_runtime.jsx)(AuthorizationContext.Provider,AuthorizationContext_assign({value},{children}))},useAuthorizationContext=function(){return(0,react.useContext)(AuthorizationContext)};!function(AutomotiveRole){AutomotiveRole.NO_ROLE="0",AutomotiveRole.TECHNICIAN="1",AutomotiveRole.SERVICE_ADVISOR="2",AutomotiveRole.SERVICE_MANAGER="3",AutomotiveRole.SALESPERSON="4",AutomotiveRole.SALES_MANAGER="5",AutomotiveRole.BDC="6"}(AutomotiveRole||(AutomotiveRole={}));var IMS_PROVIDERS_VALUES,MarkAsSentOptions_ASK_VERY_TIME={label:"Ask every time",value:2},MarkAsSentOptions_NEVER={label:"Never",value:0},MarkAsSentOptions_ALWAYS={label:"Always",value:1};!function(IMS_PROVIDERS_VALUES){IMS_PROVIDERS_VALUES.VAUTO="vAutoDealerId",IMS_PROVIDERS_VALUES.EDEALER="eDealerId",IMS_PROVIDERS_VALUES.HOMENET="homeNetId",IMS_PROVIDERS_VALUES.MAX_DIGITAL="maxDigitalId",IMS_PROVIDERS_VALUES.DEALERS_LINK="dealersLinkId",IMS_PROVIDERS_VALUES.DEALER_CUE="dealerCueId",IMS_PROVIDERS_VALUES.AUTO_REVOLUTION="autoRevolutionId",IMS_PROVIDERS_VALUES.VINSOLUTIONS="vinsolutionsIMSDealerId",IMS_PROVIDERS_VALUES.DEALER_CENTER="dealerCenterDealerId",IMS_PROVIDERS_VALUES.DEALR_CLOUD="dealrCloudId",IMS_PROVIDERS_VALUES.VIN_MOTION="vinMotionId",IMS_PROVIDERS_VALUES.AUTO_SWEET="autoSweetId",IMS_PROVIDERS_VALUES.DEALERSOCKET="dealerSocketIMSDealerId",IMS_PROVIDERS_VALUES.PREDIAN="predianId",IMS_PROVIDERS_VALUES.DEALER_INSPIRE="dealerInspireId",IMS_PROVIDERS_VALUES.CARS_FOR_SALE="carsForSaleId",IMS_PROVIDERS_VALUES.DEALER_CAR_SEARCH="dealerCarSearchId",IMS_PROVIDERS_VALUES.INVENTORY_PLUS="inventoryPlusId",IMS_PROVIDERS_VALUES.PRO_MAX="proMaxId",IMS_PROVIDERS_VALUES.JD_POWER="jdPowerId",IMS_PROVIDERS_VALUES.AUTOVERIFY="autoVerifyDealerId",IMS_PROVIDERS_VALUES.DEALER_DOT_COM="dealerDotComIMS",IMS_PROVIDERS_VALUES.ASTRAWEBIDS="astraWebIDSId",IMS_PROVIDERS_VALUES.AGENCY360="agency360Id",IMS_PROVIDERS_VALUES.SINCRO="sincroId",IMS_PROVIDERS_VALUES.DEALER_SYNC="dealerSyncId",IMS_PROVIDERS_VALUES.DAELER_E_PROCESS="dealerEProcessId",IMS_PROVIDERS_VALUES.CDK="cdkStoreId",IMS_PROVIDERS_VALUES.DEAL_PACK="dealPackDealerId",IMS_PROVIDERS_VALUES.CARPRAZE="carprazeId",IMS_PROVIDERS_VALUES.AUTOTRADER="autoTraderId",IMS_PROVIDERS_VALUES.NET_LOOK="netLookId"}(IMS_PROVIDERS_VALUES||(IMS_PROVIDERS_VALUES={}));var CheckboxInput_templateObject_1,CheckboxInput_templateObject_2,CheckboxInput_templateObject_3,CheckboxInput_templateObject_4,CheckboxInput_templateObject_5,RadioInput_templateObject_1,RadioInput_templateObject_2,RadioInput_templateObject_3,RadioInput_templateObject_4,Modal_templateObject_1,Modal_templateObject_2,Modal_templateObject_3,CloseButton_templateObject_1,NewDropdown_templateObject_1,NewDropdown_templateObject_2,NewDropdown_templateObject_3,NewDropdown_templateObject_4,ModalRecordingSettings_templateObject_1,ModalRecordingSettings_templateObject_2,ModalRecordingSettings_templateObject_3,ModalRecordingSettings_templateObject_4,ModalRecordingSettings_templateObject_5,ModalRecordingSettings_templateObject_6,ModalRecordingSettings_templateObject_7,ModalRecordingSettings_templateObject_8,ModalRecordingSettings_templateObject_9,templateObject_10,templateObject_11,ToastNotification_templateObject_1,ToastNotification_templateObject_2,toast_notifications_templateObject_1,ButtonSwitch_templateObject_1,ButtonSwitch_templateObject_2,ButtonSwitch_templateObject_3,NewTextInput_templateObject_1,VIDE0_ACTIVITY_TYPE,_g,checkIsIMSEnabled=function(userData){var isAutomotiveSalesRole=checkIfAutomotiveSalesRole(userData),hasIMSField=Object.values(IMS_PROVIDERS_VALUES).some((function(key){return!!(null==userData?void 0:userData.customer[key])})),isIMSEnabled=isAutomotiveSalesRole&&(hasIMSField||function(userData){return!!(null==userData?void 0:userData.customerId)&&["64604","65425"].includes(userData.customerId.toString())}(userData));return isIMSEnabled},checkIfAutomotive=function(userData){return checkIfAutomotiveServiceRole(userData)||checkIfAutomotiveSalesRole(userData)},checkIfAutomotiveServiceRole=function(userData){var customer=userData.customer,automotiveRole=userData.automotiveRole;return"1"===customer.automotiveAccess&&[AutomotiveRole.TECHNICIAN.toString(),AutomotiveRole.SERVICE_ADVISOR.toString(),AutomotiveRole.SERVICE_MANAGER.toString()].includes(automotiveRole)},checkIfAutomotiveSalesRole=function(userData){var customer=userData.customer,automotiveRole=userData.automotiveRole;return"1"===customer.automotiveAccess&&[AutomotiveRole.SALESPERSON.toString(),AutomotiveRole.SALES_MANAGER.toString(),AutomotiveRole.BDC.toString()].includes(automotiveRole)},checkIfVideoRequestFieldsRequired=function(userData){var customer=userData.customer,automotiveRole=userData.automotiveRole;return"1"===customer.automotiveAccess&&automotiveRole===AutomotiveRole.TECHNICIAN},getMarkAsSentValue=function(userData){return checkIfAutomotive(userData)?null===userData.customer.markVideosAsSent?MarkAsSentOptions_ASK_VERY_TIME.value:parseInt(userData.customer.markVideosAsSent.toString(),10):MarkAsSentOptions_NEVER.value},CheckboxInput_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},CheckboxInput_assign=function(){return CheckboxInput_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},CheckboxInput_assign.apply(this,arguments)},Icon=styled_components_browser_esm.Ay.svg(CheckboxInput_templateObject_1||(CheckboxInput_templateObject_1=CheckboxInput_makeTemplateObject(["\n fill: none;\n stroke: white;\n stroke-width: 5px;\n display: flex;\n"],["\n fill: none;\n stroke: white;\n stroke-width: 5px;\n display: flex;\n"]))),CheckboxContainer=styled_components_browser_esm.Ay.label(CheckboxInput_templateObject_2||(CheckboxInput_templateObject_2=CheckboxInput_makeTemplateObject(["\n display: block;\n position: relative;\n margin: 0 auto;\n width: 24px;\n height: 24px;\n "," {\n width: 24px;\n height: 24px;\n }\n"],["\n display: block;\n position: relative;\n margin: 0 auto;\n width: 24px;\n height: 24px;\n "," {\n width: 24px;\n height: 24px;\n }\n"])),mediaQueryMinWidth.mb),HiddenCheckbox=styled_components_browser_esm.Ay.input.attrs({type:"checkbox"})(CheckboxInput_templateObject_3||(CheckboxInput_templateObject_3=CheckboxInput_makeTemplateObject(["\n position: absolute;\n border: 0;\n z-index: -1;\n width: 0;\n height: 0;\n top: -1px;\n left: -5px;\n &:focus {\n outline: 0;\n }\n"],["\n position: absolute;\n border: 0;\n z-index: -1;\n width: 0;\n height: 0;\n top: -1px;\n left: -5px;\n &:focus {\n outline: 0;\n }\n"]))),CheckboxWrapper=styled_components_browser_esm.Ay.div(CheckboxInput_templateObject_4||(CheckboxInput_templateObject_4=CheckboxInput_makeTemplateObject(["\n width: ",";\n"],["\n width: ",";\n"])),(function(props){return props.width?props.width:"auto"})),StyledCheckbox=styled_components_browser_esm.Ay.div(CheckboxInput_templateObject_5||(CheckboxInput_templateObject_5=CheckboxInput_makeTemplateObject(["\n border-radius: 4px;\n box-sizing: border-box;\n background-color: ",";\n border: ",";\n\n position: absolute;\n margin-right: 0.25rem;\n top: 0;\n left: 0px;\n width: 24px;\n height: 24px;\n vertical-align: middle;\n opacity: ",";\n cursor: ",";\n color: white;\n transition: all 150ms;\n "," {\n visibility: ",";\n ","\n }\n "," {\n width: 24px;\n height: 24px;\n }\n"],["\n border-radius: 4px;\n box-sizing: border-box;\n background-color: ",";\n border: ",";\n\n position: absolute;\n margin-right: 0.25rem;\n top: 0;\n left: 0px;\n width: 24px;\n height: 24px;\n vertical-align: middle;\n opacity: ",";\n cursor: ",";\n color: white;\n transition: all 150ms;\n "," {\n visibility: ",";\n ","\n }\n "," {\n width: 24px;\n height: 24px;\n }\n"])),(function(props){return props.checked?"".concat(props.theme.colors.primary[100]):"white"}),(function(props){return props.checked?"none":"1px solid ".concat(props.theme.colors.black[20])}),(function(props){return props.disabled?.6:1}),(function(props){return props.disabled?"normal":"pointer"}),Icon,(function(props){return props.checked?"visible":"hidden"}),(function(props){return props.checkGroupIndicator&&"visibility: visible;"}),mediaQueryMinWidth.mb),CheckboxInput=function(props){var boxSize=props.boxSize,checked=props.checked,_a=props.checkGroupIndicator,checkGroupIndicator=void 0!==_a&&_a,disabled=props.disabled,width=props.width,onClick=props.onClick,_b=props.style,style=void 0===_b?{}:_b,userData=useAuthorizationContext().userData,isAutomotive=checkIfAutomotive(userData);return(0,jsx_runtime.jsx)(CheckboxWrapper,CheckboxInput_assign({width},{children:(0,jsx_runtime.jsxs)(CheckboxContainer,CheckboxInput_assign({className:props.className,onClick:function(event){onClick&&onClick(event)}},{children:[(0,jsx_runtime.jsx)(HiddenCheckbox,CheckboxInput_assign({type:"checkbox"},props,{disabled,"aria-label":"Hidden"})),(0,jsx_runtime.jsx)(StyledCheckbox,CheckboxInput_assign({boxSize,checked,checkGroupIndicator,disabled,isAutomotive,style},{children:checkGroupIndicator?(0,jsx_runtime.jsx)(Icon,CheckboxInput_assign({viewBox:"0 0 24 24"},{children:(0,jsx_runtime.jsx)("polyline",{points:"4,12 20,12"})})):(0,jsx_runtime.jsx)(Icon,CheckboxInput_assign({viewBox:"0 0 24 24"},{children:(0,jsx_runtime.jsx)("polyline",{points:"20 6 9 17 4 12"})}))}))]}))}))},RadioInput_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},RadioInput_assign=function(){return RadioInput_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},RadioInput_assign.apply(this,arguments)},RadioInput_rest=function(s,e){var t={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0&&(t[p]=s[p]);if(null!=s&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(p=Object.getOwnPropertySymbols(s);i<p.length;i++)e.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i])&&(t[p[i]]=s[p[i]])}return t},RadioInput_Container=styled_components_browser_esm.Ay.label(RadioInput_templateObject_1||(RadioInput_templateObject_1=RadioInput_makeTemplateObject(["\n display: flex;\n padding: ",";\n align-items: center;\n justify-content: flex-start;\n box-sizing: border-box;\n cursor: pointer;\n user-select: none;\n &:hover ~ span {\n opacity: 0.5;\n }\n"],["\n display: flex;\n padding: ",";\n align-items: center;\n justify-content: flex-start;\n box-sizing: border-box;\n cursor: pointer;\n user-select: none;\n &:hover ~ span {\n opacity: 0.5;\n }\n"])),(function(_a){return!0===_a.removePadding?"0":"5px 0"})),Dot=styled_components_browser_esm.Ay.span(RadioInput_templateObject_2||(RadioInput_templateObject_2=RadioInput_makeTemplateObject(["\n box-sizing: border-box;\n position: relative;\n height: 24px;\n width: 24px;\n background-color: rgba(0, 27, 83, 0.05);\n border-radius: 50%;\n border: solid 1px #d0d3d9;\n margin-right: 0.5rem;\n margin-left: -5px;\n display: flex;\n justify-content: center;\n align-items: center;\n"],["\n box-sizing: border-box;\n position: relative;\n height: 24px;\n width: 24px;\n background-color: rgba(0, 27, 83, 0.05);\n border-radius: 50%;\n border: solid 1px #d0d3d9;\n margin-right: 0.5rem;\n margin-left: -5px;\n display: flex;\n justify-content: center;\n align-items: center;\n"]))),InsideDot=styled_components_browser_esm.Ay.span(RadioInput_templateObject_3||(RadioInput_templateObject_3=RadioInput_makeTemplateObject(["\n background: #fff;\n border-radius: 50%;\n height: 8px;\n width: 8px;\n"],["\n background: #fff;\n border-radius: 50%;\n height: 8px;\n width: 8px;\n"]))),Radio=styled_components_browser_esm.Ay.input.attrs({type:"radio"})(RadioInput_templateObject_4||(RadioInput_templateObject_4=RadioInput_makeTemplateObject(["\n appearance: none;\n width: 0px;\n cursor: pointer;\n &:checked ~ span {\n background-color: ",";\n border: 3px solid\n ","};\n }\n"],["\n appearance: none;\n width: 0px;\n cursor: pointer;\n &:checked ~ span {\n background-color: ",";\n border: 3px solid\n ","};\n }\n"])),(function(_a){return _a.theme.colors.primary[100]}),(function(_a){return _a.theme.colors.primary[100]})),RadioInput_RadioInput=function(props){var value=props.value,text=props.text,removePadding=props.removePadding,rest=RadioInput_rest(props,["value","text","removePadding"]);return(0,jsx_runtime.jsxs)(RadioInput_Container,RadioInput_assign({onClick:props.onClick,htmlFor:rest.name,removePadding,value},{children:[(0,jsx_runtime.jsx)(Radio,RadioInput_assign({value},rest)),(0,jsx_runtime.jsx)(Dot,RadioInput_assign({value},rest,{children:props.checked&&(0,jsx_runtime.jsx)(InsideDot,{})})),text]}))},Modal_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},Modal_assign=function(){return Modal_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},Modal_assign.apply(this,arguments)},DarkBackground=styled_components_browser_esm.Ay.div(Modal_templateObject_1||(Modal_templateObject_1=Modal_makeTemplateObject(["\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n height: 100vh;\n background-color: ",";\n z-index: 998;\n width: 100% !important;\n"],["\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n height: 100vh;\n background-color: ",";\n z-index: 998;\n width: 100% !important;\n"])),palette_blackRgba75),ModalContainer=styled_components_browser_esm.Ay.div(Modal_templateObject_2||(Modal_templateObject_2=Modal_makeTemplateObject(["\n width: auto;\n height: 100vh;\n "," {\n width: 100vw;\n }\n transition: height 0.5s ease-in-out;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 999;\n"],["\n width: auto;\n height: 100vh;\n "," {\n width: 100vw;\n }\n transition: height 0.5s ease-in-out;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 999;\n"])),mediaQueryMinWidth.mb),ModalBody=styled_components_browser_esm.Ay.div(Modal_templateObject_3||(Modal_templateObject_3=Modal_makeTemplateObject(["\n background-color: #fff;\n overflow-y: ",";\n overflow-x: ",";\n border-radius: 4px;\n ","\n "," {\n height: ",";\n width: ",";\n max-height: ",";\n }\n"],["\n background-color: #fff;\n overflow-y: ",";\n overflow-x: ",";\n border-radius: 4px;\n ","\n "," {\n height: ",";\n width: ",";\n max-height: ",";\n }\n"])),(function(props){return props.overflowY}),(function(props){return props.overflowX}),(function(props){if(props.disableFullScreen)return"\n height: ".concat(props.overrideBodyHeight&&props.maxHeight?props.maxHeight:"auto",";\n width: ").concat(props.widthOnDesktop?props.widthOnDesktop:"auto",";\n ")}),mediaQueryMinWidth.cmd,(function(props){return props.overrideBodyHeight&&props.maxHeight?props.maxHeight:"auto"}),(function(props){return props.widthOnDesktop?props.widthOnDesktop:"auto"}),(function(props){return props.maxHeight?props.maxHeight:"90%"})),Modal_Modal=function(_a){var _b=_a.style,style=void 0===_b?{}:_b,children=_a.children,widthOnDesktop=_a.widthOnDesktop,disableFullScreen=_a.disableFullScreen,maxHeight=_a.maxHeight,_c=_a.overrideBodyHeight,overrideBodyHeight=void 0!==_c&&_c,_d=_a.bodyOverflowY,bodyOverflowY=void 0===_d?"auto":_d,_e=_a.bodyOverflowX,bodyOverflowX=void 0===_e?"hidden":_e;return(0,react.useEffect)((function(){if(document&&document.body){var orig=document.body.className;document.body.className=orig+(orig?" ":"")+"modal-open"}return function(){document&&document.body&&(document.body.className=document.body.className.replace(/ ?modal-open/,""))}}),[]),(0,jsx_runtime.jsx)(DarkBackground,Modal_assign({style},{children:(0,jsx_runtime.jsx)(ModalContainer,{children:(0,jsx_runtime.jsx)(ModalBody,Modal_assign({disableFullScreen,widthOnDesktop,maxHeight,overrideBodyHeight,overflowX:bodyOverflowX,overflowY:bodyOverflowY},{children}))})}))},md_index_esm=__webpack_require__("./node_modules/react-icons/md/index.esm.js"),CloseButton_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},CloseButton_assign=function(){return CloseButton_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},CloseButton_assign.apply(this,arguments)},Close=styled_components_browser_esm.Ay.button(CloseButton_templateObject_1||(CloseButton_templateObject_1=CloseButton_makeTemplateObject(["\n border: none;\n cursor: ",";\n width: 60px;\n height: 60px;\n position: absolute;\n right: 0;\n color: ",";\n opacity: 0.6;\n background-color: transparent;\n transition: all 0.3s;\n font-size: 20px;\n padding: ",";\n margin-top: ",";\n margin-right: ",";\n display: flex;\n z-index: ",";\n &:focus {\n outline: 0;\n }\n\n &:hover {\n color: ",";\n opacity: 1;\n }\n\n span {\n transform: rotate(45deg);\n display: block;\n }\n"],["\n border: none;\n cursor: ",";\n width: 60px;\n height: 60px;\n position: absolute;\n right: 0;\n color: ",";\n opacity: 0.6;\n background-color: transparent;\n transition: all 0.3s;\n font-size: 20px;\n padding: ",";\n margin-top: ",";\n margin-right: ",";\n display: flex;\n z-index: ",";\n &:focus {\n outline: 0;\n }\n\n &:hover {\n color: ",";\n opacity: 1;\n }\n\n span {\n transform: rotate(45deg);\n display: block;\n }\n"])),(function(props){return props.disabled?"not-allowed":"pointer"}),(function(props){return props.light?"rgba(255, 255, 255, 0.87)":"rgba(0, 0, 0, 0.87)"}),(function(props){return props.padding||"34px 10px 0px"}),(function(props){return props.marginTop||""}),(function(props){return props.marginRight||""}),(function(props){return props.zIndex?"1":"auto"}),(function(props){return props.light?palette_white:palette_themeDark})),CloseButton_CloseButton=react.memo((function(_a){var _b=_a.disabled,disabled=void 0!==_b&&_b,onClick=_a.onClick,_c=_a.light,light=void 0!==_c&&_c,_d=_a.zIndex,zIndex=void 0!==_d&&_d,_e=_a.padding,padding=void 0===_e?"":_e,_f=_a.marginTop,marginTop=void 0===_f?"":_f,_g=_a.marginRight,marginRight=void 0===_g?"":_g,style=_a.style;return(0,jsx_runtime.jsx)(Close,CloseButton_assign({disabled,onClick,light,zIndex,padding,marginTop,marginRight,style},{children:(0,jsx_runtime.jsx)(md_index_esm.m6K,{})}))})),lodash=__webpack_require__("./node_modules/lodash/lodash.js"),react_select_browser_esm=__webpack_require__("./node_modules/react-select/creatable/dist/react-select.browser.esm.js"),dist_react_select_browser_esm=__webpack_require__("./node_modules/react-select/dist/react-select.browser.esm.js"),NewDropdown_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},NewDropdown_assign=function(){return NewDropdown_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},NewDropdown_assign.apply(this,arguments)},DropdownArrowIcon=(styled_components_browser_esm.Ay.div(NewDropdown_templateObject_1||(NewDropdown_templateObject_1=NewDropdown_makeTemplateObject(["\n font-style: normal;\n font-weight: 600;\n font-size: ",";\n line-height: ",";\n height: ",";\n width: ",";\n background: ",";\n color: ",";\n border-radius: 6px;\n padding: ",";\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n"],["\n font-style: normal;\n font-weight: 600;\n font-size: ",";\n line-height: ",";\n height: ",";\n width: ",";\n background: ",";\n color: ",";\n border-radius: 6px;\n padding: ",";\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n"])),(function(props){var _a;return null!==(_a=props.fontSize)&&void 0!==_a?_a:"12px"}),(function(props){var _a;return null!==(_a=props.lineHeight)&&void 0!==_a?_a:"16px"}),(function(props){var _a;return null!==(_a=props.height)&&void 0!==_a?_a:"auto"}),(function(props){var _a;return null!==(_a=props.width)&&void 0!==_a?_a:"auto"}),(function(props){return props.bgColor}),(function(props){return props.fontColor}),(function(props){var _a;return null!==(_a=props.padding)&&void 0!==_a?_a:"2px 8px"})),styled_components_browser_esm.Ay.span(NewDropdown_templateObject_2||(NewDropdown_templateObject_2=NewDropdown_makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n padding-right: 12px;\n position: relative;\n svg {\n ","\n }\n"],["\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n padding-right: 12px;\n position: relative;\n svg {\n ","\n }\n"])),(function(props){return props.menuIsOpen&&"transform: rotate(180deg);"}))),OptionWrapper=styled_components_browser_esm.Ay.div(NewDropdown_templateObject_3||(NewDropdown_templateObject_3=NewDropdown_makeTemplateObject(["\n width: 100%;\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: center;\n align-items: center;\n"],["\n width: 100%;\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: center;\n align-items: center;\n"]))),OptionIconWrapper=styled_components_browser_esm.Ay.div(NewDropdown_templateObject_4||(NewDropdown_templateObject_4=NewDropdown_makeTemplateObject(["\n text-align: center;\n"],["\n text-align: center;\n"]))),getControlStyles=function(props){var isDisabled=props.isDisabled,selectProps=(props.menuIsOpen,props.selectProps);return isDisabled?{borderColor:palette_transparent}:selectProps.error?{borderColor:palette_error}:{borderColor:palette_covideoGray40}},getOptionStyles=function(props,themes,isShareVideoModal){var isFocused=props.isFocused,isSelected=props.isSelected;return props.isDisabled?{color:palette_gray40,backgroundColor:palette_gray10,cursor:"not-allowed"}:isFocused||isSelected?isShareVideoModal?{color:palette_black_1_100,backgroundColor:"rgb(222, 235, 255)"}:{color:themes.colors.primary[100],backgroundColor:themes.colors.secondary[5]}:{color:palette_covideoGray100,backgroundColor:palette_white}},Dropdown=function(props){var _a=props.ariaLabel,ariaLabel=void 0===_a?"Aria label is missing":_a,name=props.name,options=props.options,value=props.value,_b=props.defaultValue,defaultValue=void 0===_b?void 0:_b,_c=props.placeholder,placeholder=void 0===_c?"No Folders":_c,onChange=props.onChange,getOptionLabel=props.getOptionLabel,getOptionValue=props.getOptionValue,_d=props.menuPosition,menuPosition=void 0===_d?"absolute":_d,_e=props.menuPlacement,menuPlacement=void 0===_e?"auto":_e,menuPortalTarget=props.menuPortalTarget,inputId=props.inputId,className=props.className,_f=props.dropdownHeight,dropdownHeight=void 0===_f?"auto":_f,_g=props.height,height=void 0===_g?48:_g,width=props.width,_h=props.disabled,disabled=void 0!==_h&&_h,_j=props.creatable,creatable=void 0===_j||_j,_k=props.error,error=void 0!==_k&&_k,onMenuScrollToBottom=props.onMenuScrollToBottom,onMenuClose=props.onMenuClose,extendStyles=props.extendStyles,icon=props.icon,_l=props.showIndicator,showIndicator=void 0===_l||_l,_o=(props.chipValueSelected,props.isClearable),isClearable=void 0!==_o&&_o,onInputChange=props.onInputChange,onCreateOption=props.onCreateOption,_p=props.isMulti,isMulti=void 0!==_p&&_p,_q=props.isShareVideoModal,isShareVideoModal=void 0!==_q&&_q,_r=props.zIndexProp,zIndexProp=void 0===_r?9999:_r,_s=props.menuZIndexProp,menuZIndexProp=void 0===_s?2:_s,isSearchable=props.isSearchable,formatCreateLabel=props.formatCreateLabel,_t=props.closeMenuOnScroll,closeMenuOnScroll=void 0===_t?void 0:_t,_u=props.menuShouldBlockScroll,menuShouldBlockScroll=void 0!==_u&&_u,_v=props.isLoading,isLoading=void 0!==_v&&_v,filterOption=props.filterOption,formatOptionLabel=props.formatOptionLabel,customComponents=props.customComponents,onMenuOpen=props.onMenuOpen,maxMenuHeight=props.maxMenuHeight,controlShouldRenderValue=props.controlShouldRenderValue,createOptionPosition=props.createOptionPosition,autoFocus=props.autoFocus,themes=(0,styled_components_browser_esm.DP)(),commonProps={icon,error,options,className,name,placeholder,value,defaultValue,getOptionLabel,getOptionValue,onChange,menuPlacement,menuPosition,isDisabled:disabled,menuPortalTarget,"aria-label":ariaLabel,onMenuScrollToBottom,onMenuClose,isClearable,onInputChange,onCreateOption,isMulti,isSearchable,filterOption},DropdownIndicator=function(props){return showIndicator?(0,jsx_runtime.jsx)(DropdownArrowIcon,NewDropdown_assign({menuIsOpen:props.selectProps.menuIsOpen},{children:(0,jsx_runtime.jsx)(md_index_esm.q0c,{size:18,opacity:.5})})):(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{})},styles={container:function(base){return NewDropdown_assign(NewDropdown_assign({},base),(null==extendStyles?void 0:extendStyles.container)||{})},control:function(base,props){return NewDropdown_assign(NewDropdown_assign(NewDropdown_assign(NewDropdown_assign(NewDropdown_assign({},base),{width,boxShadow:"none",borderRadius:6,minHeight:"40px",cursor:"pointer"}),getControlStyles(props)),(null==extendStyles?void 0:extendStyles.control)||{}),{"&:hover":{borderColor:isShareVideoModal?"rgb(128, 189, 255)":themes.colors.primary[100]},"&:focus-within":{borderColor:isShareVideoModal?"rgb(128, 189, 255)":themes.colors.primary[100]}})},singleValue:function(base){return NewDropdown_assign(NewDropdown_assign(NewDropdown_assign({},base),{width:"95%"}),(null==extendStyles?void 0:extendStyles.singleValue)||{})},valueContainer:function(base){return NewDropdown_assign(NewDropdown_assign({},base),(null==extendStyles?void 0:extendStyles.valueContainer)||{})},input:function(base){return NewDropdown_assign(NewDropdown_assign({},base),(null==extendStyles?void 0:extendStyles.input)||{})},menuPortal:function(base){return NewDropdown_assign(NewDropdown_assign({},base),{zIndex:zIndexProp||9999})},menuList:function(base){return NewDropdown_assign(NewDropdown_assign(NewDropdown_assign({},base),(null==extendStyles?void 0:extendStyles.menuList)||{}),{height:dropdownHeight})},menu:function(base){return NewDropdown_assign(NewDropdown_assign(NewDropdown_assign({},base),(null==extendStyles?void 0:extendStyles.menu)||{}),{marginTop:2,zIndex:menuZIndexProp||2,color:palette_primaryDarkBlue})},option:function(base,props){return NewDropdown_assign(NewDropdown_assign(NewDropdown_assign(NewDropdown_assign({},base),{height:isShareVideoModal?35:height,display:"flex",alignItems:"center",padding:"0 16px",cursor:"pointer",transition:"all 0.3s",fontWeight:isShareVideoModal?"normal":600,fontSize:15}),getOptionStyles(props,themes,isShareVideoModal)),(null==extendStyles?void 0:extendStyles.option)||{})}};return creatable?(0,jsx_runtime.jsx)(react_select_browser_esm.Ay,NewDropdown_assign({},commonProps,{optionHeight:48,isLoading:!1,components:NewDropdown_assign({DropdownIndicator,IndicatorSeparator:function(){return null}},customComponents),styles,isSearchable,formatCreateLabel,formatOptionLabel,createOptionPosition})):(0,jsx_runtime.jsx)(dist_react_select_browser_esm.Ay,NewDropdown_assign({},commonProps,{inputId,optionHeight:48,maxMenuHeight:maxMenuHeight||220,menuShouldScrollIntoView:!1,menuPortalTarget,isLoading,components:NewDropdown_assign({DropdownIndicator,IndicatorSeparator:function(){return null}},customComponents),styles,isSearchable,closeMenuOnScroll,menunShouldBlockScroll:menuShouldBlockScroll,filterOption,formatOptionLabel,onMenuOpen,controlShouldRenderValue,autoFocus}))},ModalRecordingSettings_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},ToastNotification_makeTemplateObject=(styled_components_browser_esm.Ay.div(ModalRecordingSettings_templateObject_1||(ModalRecordingSettings_templateObject_1=ModalRecordingSettings_makeTemplateObject(["\n display: block;\n position: relative;\n width: 592px;\n max-width: 100%;\n min-height: 500px;\n background-color: #fff;\n"],["\n display: block;\n position: relative;\n width: 592px;\n max-width: 100%;\n min-height: 500px;\n background-color: #fff;\n"]))),styled_components_browser_esm.Ay.div(ModalRecordingSettings_templateObject_2||(ModalRecordingSettings_templateObject_2=ModalRecordingSettings_makeTemplateObject(["\n height: 24px;\n font-size: 18px;\n font-weight: bold;\n line-height: 1.33;\n color: ",";\n position: absolute;\n margin-left: 32px;\n margin-top: 32px;\n"],["\n height: 24px;\n font-size: 18px;\n font-weight: bold;\n line-height: 1.33;\n color: ",";\n position: absolute;\n margin-left: 32px;\n margin-top: 32px;\n"])),palette_black_1_100),styled_components_browser_esm.Ay.div(ModalRecordingSettings_templateObject_3||(ModalRecordingSettings_templateObject_3=ModalRecordingSettings_makeTemplateObject(["\n min-height: 406px;\n padding: 62px 32px 32px;\n display: flex;\n flex-direction: column;\n"],["\n min-height: 406px;\n padding: 62px 32px 32px;\n display: flex;\n flex-direction: column;\n"]))),styled_components_browser_esm.Ay.div(ModalRecordingSettings_templateObject_4||(ModalRecordingSettings_templateObject_4=ModalRecordingSettings_makeTemplateObject(["\n width: 100%;\n height: 40px;\n display: flex;\n justify-content: flex-end;\n margin-top: auto;\n > button {\n margin-left: 16px;\n }\n"],["\n width: 100%;\n height: 40px;\n display: flex;\n justify-content: flex-end;\n margin-top: auto;\n > button {\n margin-left: 16px;\n }\n"]))),styled_components_browser_esm.Ay.form(ModalRecordingSettings_templateObject_5||(ModalRecordingSettings_templateObject_5=ModalRecordingSettings_makeTemplateObject(["\n width: 100%;\n"],["\n width: 100%;\n"]))),styled_components_browser_esm.Ay.div(ModalRecordingSettings_templateObject_6||(ModalRecordingSettings_templateObject_6=ModalRecordingSettings_makeTemplateObject(["\n width: 100%;\n display: flex;\n flex-direction: row;\n margin-top: 8px;\n margin-bottom: 16px;\n"],["\n width: 100%;\n display: flex;\n flex-direction: row;\n margin-top: 8px;\n margin-bottom: 16px;\n"]))),styled_components_browser_esm.Ay.div(ModalRecordingSettings_templateObject_7||(ModalRecordingSettings_templateObject_7=ModalRecordingSettings_makeTemplateObject(["\n flex: 100%;\n min-height: 60px;\n & > label {\n font-size: 14px;\n margin-bottom: 5px;\n margin-top: 5px;\n color: ",";\n }\n & > span {\n opacity: 0.25;\n font-size: 16px;\n font-weight: normal;\n font-stretch: normal;\n font-style: normal;\n line-height: 1.5;\n letter-spacing: normal;\n }\n"],["\n flex: 100%;\n min-height: 60px;\n & > label {\n font-size: 14px;\n margin-bottom: 5px;\n margin-top: 5px;\n color: ",";\n }\n & > span {\n opacity: 0.25;\n font-size: 16px;\n font-weight: normal;\n font-stretch: normal;\n font-style: normal;\n line-height: 1.5;\n letter-spacing: normal;\n }\n"])),palette_label),(0,styled_components_browser_esm.Ay)(Dropdown)(ModalRecordingSettings_templateObject_8||(ModalRecordingSettings_templateObject_8=ModalRecordingSettings_makeTemplateObject(["\n width: 528px;\n max-width: 100%;\n & > div {\n border-radius: 4px;\n }\n"],["\n width: 528px;\n max-width: 100%;\n & > div {\n border-radius: 4px;\n }\n"]))),styled_components_browser_esm.Ay.div(ModalRecordingSettings_templateObject_9||(ModalRecordingSettings_templateObject_9=ModalRecordingSettings_makeTemplateObject(["\n width: 100%;\n display: flex;\n flex-direction: column;\n"],["\n width: 100%;\n display: flex;\n flex-direction: column;\n"]))),styled_components_browser_esm.Ay.label(templateObject_10||(templateObject_10=ModalRecordingSettings_makeTemplateObject(["\n display: flex;\n align-items: center;\n font-size: 16px;\n font-weight: normal;\n font-stretch: normal;\n font-style: normal;\n line-height: 1.5;\n letter-spacing: normal;\n color: ",";\n cursor: pointer;\n height: 24px;\n margin-top: 16px;\n > span {\n margin-left: 12px;\n }\n"],["\n display: flex;\n align-items: center;\n font-size: 16px;\n font-weight: normal;\n font-stretch: normal;\n font-style: normal;\n line-height: 1.5;\n letter-spacing: normal;\n color: ",";\n cursor: pointer;\n height: 24px;\n margin-top: 16px;\n > span {\n margin-left: 12px;\n }\n"])),palette_black_1_100),styled_components_browser_esm.Ay.div(templateObject_11||(templateObject_11=ModalRecordingSettings_makeTemplateObject(["\n color: ",";\n margin-left: auto;\n"],["\n color: ",";\n margin-left: auto;\n"])),palette_label),function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked}),ToastNotification_Container=styled_components_browser_esm.Ay.div(ToastNotification_templateObject_1||(ToastNotification_templateObject_1=ToastNotification_makeTemplateObject(["\n box-shadow:\n 0 2px 4px 0 rgba(52, 58, 64, 0.1),\n 0 4px 24px 0 rgba(52, 58, 64, 0.15);\n background-color: ",";\n display: flex;\n align-items: center;\n border-radius: 5px;\n"],["\n box-shadow:\n 0 2px 4px 0 rgba(52, 58, 64, 0.1),\n 0 4px 24px 0 rgba(52, 58, 64, 0.15);\n background-color: ",";\n display: flex;\n align-items: center;\n border-radius: 5px;\n"])),(function(_a){return _a.theme.colors.white[100]})),Message=styled_components_browser_esm.Ay.div(ToastNotification_templateObject_2||(ToastNotification_templateObject_2=ToastNotification_makeTemplateObject(["\n ",";\n font-size: ",";\n line-height: 1.14;\n color: ",";\n padding: 10px 16px;\n margin: 0;\n"],["\n ",";\n font-size: ",";\n line-height: 1.14;\n color: ",";\n padding: 10px 16px;\n margin: 0;\n"])),fontNormal500,fontSizes_sm,palette_themeDark),ToastNotification=function(props){var message=props.message;return(0,jsx_runtime.jsx)(ToastNotification_Container,{children:(0,jsx_runtime.jsx)(Message,{children:message})})},toast_notifications_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},toast_notifications_assign=function(){return toast_notifications_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},toast_notifications_assign.apply(this,arguments)},toast_notifications_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},__spreadArray=function(to,from,pack){if(pack||2===arguments.length)for(var ar,i=0,l=from.length;i<l;i++)!ar&&i in from||(ar||(ar=Array.prototype.slice.call(from,0,i)),ar[i]=from[i]);return to.concat(ar||Array.prototype.slice.call(from))},ToastNotificationGroup=styled_components_browser_esm.Ay.div(toast_notifications_templateObject_1||(toast_notifications_templateObject_1=toast_notifications_makeTemplateObject(["\n position: absolute;\n top: 72px;\n right: 16px;\n z-index: 999;\n display: grid;\n gap: 8px;\n"],["\n position: absolute;\n top: 72px;\n right: 16px;\n z-index: 999;\n display: grid;\n gap: 8px;\n"]))),Context=react.createContext(),ToastNotificationsProvider=function(_a){var children=_a.children,_b=toast_notifications_read(react.useState(),2),scheduledNotification=_b[0],setScheduledNotification=_b[1],_c=toast_notifications_read(react.useState([]),2),notifications=_c[0],setNotifications=_c[1];react.useEffect((function(){if(scheduledNotification){var message=scheduledNotification.message,type=scheduledNotification.type,_a=scheduledNotification.timeout,timeout=void 0===_a?3e3:_a,maxAge=(new Date).getTime()+timeout,notification={id:Math.random(),message,type,maxAge};setNotifications(__spreadArray(__spreadArray([],toast_notifications_read(notifications),!1),[notification],!1)),setScheduledNotification()}}),[scheduledNotification,notifications]),react.useEffect((function(){var removeExpiredNotifications=setInterval((function(){var nextNotifications=notifications.filter((function(n){return!function(_a){var maxAge=_a.maxAge;return maxAge&&maxAge<(new Date).getTime()}(n)}));nextNotifications.length!==notifications.length&&setNotifications(nextNotifications)}),500);return function(){return clearInterval(removeExpiredNotifications)}}),[notifications]);var value={toast:setScheduledNotification};return(0,jsx_runtime.jsx)(Context.Provider,toast_notifications_assign({value},{children:(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[notifications.length>0&&(0,jsx_runtime.jsx)(ToastNotificationGroup,{children:notifications.map((function(_a){var id=_a.id,message=_a.message;return(0,jsx_runtime.jsx)(ToastNotification,{message},id)}))}),children]})}))},useToastNotifications=function(){return react.useContext(Context)},MainWrapper_assign=function(){return MainWrapper_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},MainWrapper_assign.apply(this,arguments)},MainWrapper=function(_a){var children=_a.children;return(0,jsx_runtime.jsx)("div",MainWrapper_assign({id:"covideo-embeddable-recorder"},{children}))},ButtonSwitch_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},ButtonSwitch_assign=function(){return ButtonSwitch_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},ButtonSwitch_assign.apply(this,arguments)},ButtonSwitch_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},Switch=styled_components_browser_esm.Ay.div(ButtonSwitch_templateObject_2||(ButtonSwitch_templateObject_2=ButtonSwitch_makeTemplateObject(["\n box-sizing: border-box;\n height: 40px;\n border-radius: 6px;\n border: solid 1px #d0d3d9;\n background-color: rgba(0, 27, 83, 0.05);\n display: flex;\n align-items: center;\n & > span {\n margin: 12px;\n }\n ","\n"],["\n box-sizing: border-box;\n height: 40px;\n border-radius: 6px;\n border: solid 1px #d0d3d9;\n background-color: rgba(0, 27, 83, 0.05);\n display: flex;\n align-items: center;\n & > span {\n margin: 12px;\n }\n ","\n"])),(function(_a){return _a.disabled&&(0,styled_components_browser_esm.AH)(ButtonSwitch_templateObject_1||(ButtonSwitch_templateObject_1=ButtonSwitch_makeTemplateObject(["\n pointer-events: none;\n > button {\n opacity: 0.5;\n }\n "],["\n pointer-events: none;\n > button {\n opacity: 0.5;\n }\n "])))})),NonSelectedBtn=styled_components_browser_esm.Ay.span(ButtonSwitch_templateObject_3||(ButtonSwitch_templateObject_3=ButtonSwitch_makeTemplateObject(["\n font-size: 15px;\n font-weight: 600;\n font-stretch: normal;\n font-style: normal;\n line-height: 1.6;\n letter-spacing: normal;\n text-align: center;\n color: #9297a2;\n cursor: pointer;\n"],["\n font-size: 15px;\n font-weight: 600;\n font-stretch: normal;\n font-style: normal;\n line-height: 1.6;\n letter-spacing: normal;\n text-align: center;\n color: #9297a2;\n cursor: pointer;\n"]))),ButtonSwitch=function(props){var defaultValue=props.defaultValue,values=props.values,onChange=props.onChange,className=props.className,_a=props.skipConfirmation,skipConfirmation=void 0===_a||_a,_b=ButtonSwitch_read((0,react.useState)(defaultValue),2),value=_b[0],setValue=_b[1];return(0,jsx_runtime.jsx)(Switch,ButtonSwitch_assign({},className&&{className},{disabled:props.disabled},{children:values.map((function(btn){return btn.value===value?(0,jsx_runtime.jsx)("div",ButtonSwitch_assign({style:{width:btn.width}},{children:(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{text:btn.text,size:"large"})}),btn.value):(0,jsx_runtime.jsx)(NonSelectedBtn,ButtonSwitch_assign({onClick:function(){onChange(btn.value),skipConfirmation&&setValue(btn.value)}},{children:btn.text}),btn.value)}))}))},NewTextInput_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},NewTextInput=styled_components_browser_esm.Ay.input.attrs({type:"text"})(NewTextInput_templateObject_1||(NewTextInput_templateObject_1=NewTextInput_makeTemplateObject(["\n display: block;\n width: 100%;\n max-width: 800px;\n font-size: 16px;\n &::placeholder {\n font-size: 16px;\n color: ",";\n opacity: 0.6;\n ","\n }\n border: ",";\n height: 40px;\n padding: 12px;\n box-sizing: border-box;\n border-radius: 4px;\n transition:\n border-color 0.15s ease-in-out,\n box-shadow 0.15s ease-in-out;\n &:focus {\n color: #495057;\n background-color: #fff;\n border-color: #80bdff;\n outline: 0;\n }\n"],["\n display: block;\n width: 100%;\n max-width: 800px;\n font-size: 16px;\n &::placeholder {\n font-size: 16px;\n color: ",";\n opacity: 0.6;\n ","\n }\n border: ",";\n height: 40px;\n padding: 12px;\n box-sizing: border-box;\n border-radius: 4px;\n transition:\n border-color 0.15s ease-in-out,\n box-shadow 0.15s ease-in-out;\n &:focus {\n color: #495057;\n background-color: #fff;\n border-color: #80bdff;\n outline: 0;\n }\n"])),palette_black_1_100,fontNormal500,(function(_a){var error=_a.error,theme=_a.theme;return error?"1px solid ".concat(theme.colors.danger[100]):"solid 1px #dfe3e6"}));function close_extends(){return close_extends=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},close_extends.apply(null,arguments)}!function(VIDE0_ACTIVITY_TYPE){VIDE0_ACTIVITY_TYPE.QUOTE_SEND="Quote-Send",VIDE0_ACTIVITY_TYPE.OPENED_EMAIL="Opened-Email",VIDE0_ACTIVITY_TYPE.WATCHED_VIDEO="Watched-Video",VIDE0_ACTIVITY_TYPE.APPROVED_ITEMS="Approved-Items",VIDE0_ACTIVITY_TYPE.UPDATE_QUOTE="Update-Quote",VIDE0_ACTIVITY_TYPE.RECORDED_VIDEO="Recorded-Video",VIDE0_ACTIVITY_TYPE.APPROVED_VIDEO="Approved-Video",VIDE0_ACTIVITY_TYPE.DENIED_VIDEO="Denied-Video",VIDE0_ACTIVITY_TYPE.DELETE_VIDEO="Delete-Video",VIDE0_ACTIVITY_TYPE.QUOTE_RESEND="Quote-Resend",VIDE0_ACTIVITY_TYPE.UPDATE_RO="RO-Update",VIDE0_ACTIVITY_TYPE.QUICKSHARE="Quickshare",VIDE0_ACTIVITY_TYPE.CRM_SHARE="Crm-Share",VIDE0_ACTIVITY_TYPE.WATCHED_VIDEO_UNKNOWN="WATCHED_VIDEO_UNKNOWN"}(VIDE0_ACTIVITY_TYPE||(VIDE0_ACTIVITY_TYPE={}));const images_close=function SvgClose(props){return react.createElement("svg",close_extends({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24"},props),_g||(_g=react.createElement("g",{fill:"#272A32"},react.createElement("path",{d:"M18.3 5.71c-.187-.187-.44-.292-.705-.292-.265 0-.518.105-.705.292L12 10.59 7.11 5.7c-.187-.187-.44-.292-.705-.292-.265 0-.518.105-.705.292-.39.39-.39 1.02 0 1.41L10.59 12 5.7 16.89c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0L12 13.41l4.89 4.89c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4z"}))))};var CloseIcon_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked};const images_CloseIcon=(0,styled_components_browser_esm.Ay)(images_close)(CloseIcon_templateObject_1||(CloseIcon_templateObject_1=CloseIcon_makeTemplateObject(["\n width: ",";\n height: ",";\n fill: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n fill: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"])),(function(props){return props.width||"16px"}),(function(props){return props.height||"16px"}),(function(props){return props.color||"currentColor"}),(function(props){return props.color||"currentColor"}),(function(props){return props.opacity||"inherit"}));var CloseIcon_templateObject_1,ModalQuickShareMarkAsSent_templateObject_1,ModalQuickShareMarkAsSent_templateObject_2,ModalQuickShareMarkAsSent_templateObject_3,ModalQuickShareMarkAsSent_templateObject_4,ModalQuickShareMarkAsSent_templateObject_5,ModalQuickShareMarkAsSent_templateObject_6,ModalQuickShareMarkAsSent_templateObject_7,ModalQuickShareMarkAsSent_templateObject_8,ModalQuickShareMarkAsSent_templateObject_9,ModalQuickShareMarkAsSent_templateObject_10,ModalQuickShareMarkAsSent_templateObject_11,templateObject_12,PROMPT_TYPE,ai_index_esm=__webpack_require__("./node_modules/react-icons/ai/index.esm.js"),ModalQuickShareMarkAsSent_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},ModalQuickShareMarkAsSent_assign=function(){return ModalQuickShareMarkAsSent_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},ModalQuickShareMarkAsSent_assign.apply(this,arguments)},ModalQuickShareMarkAsSent_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},ModalQuickShareMarkAsSent_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},ModalQuickShareMarkAsSent_ModalItem=styled_components_browser_esm.Ay.div(ModalQuickShareMarkAsSent_templateObject_2||(ModalQuickShareMarkAsSent_templateObject_2=ModalQuickShareMarkAsSent_makeTemplateObject(["\n box-sizing: border-box;\n width: 592px;\n padding: 32px;\n background-color: ",";\n\n ","\n"],["\n box-sizing: border-box;\n width: 592px;\n padding: 32px;\n background-color: ",";\n\n ","\n"])),palette_white,(function(_a){return _a.theme.containerWidth<=screenSizes_xs&&(0,styled_components_browser_esm.AH)(ModalQuickShareMarkAsSent_templateObject_1||(ModalQuickShareMarkAsSent_templateObject_1=ModalQuickShareMarkAsSent_makeTemplateObject(["\n width: 100%;\n "],["\n width: 100%;\n "])))})),Header=styled_components_browser_esm.Ay.div(ModalQuickShareMarkAsSent_templateObject_3||(ModalQuickShareMarkAsSent_templateObject_3=ModalQuickShareMarkAsSent_makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n"],["\n display: flex;\n align-items: center;\n justify-content: space-between;\n"]))),Title=styled_components_browser_esm.Ay.div(ModalQuickShareMarkAsSent_templateObject_4||(ModalQuickShareMarkAsSent_templateObject_4=ModalQuickShareMarkAsSent_makeTemplateObject(["\n color: ",";\n font-weight: bold;\n font-size: 18px;\n line-height: 24px;\n"],["\n color: ",";\n font-weight: bold;\n font-size: 18px;\n line-height: 24px;\n"])),palette_gray100),CloseButtonWrapper=styled_components_browser_esm.Ay.label(ModalQuickShareMarkAsSent_templateObject_5||(ModalQuickShareMarkAsSent_templateObject_5=ModalQuickShareMarkAsSent_makeTemplateObject(["\n display: flex;\n align-items: center;\n margin: 0;\n padding: 0;\n color: ",";\n &:hover {\n cursor: pointer;\n }\n"],["\n display: flex;\n align-items: center;\n margin: 0;\n padding: 0;\n color: ",";\n &:hover {\n cursor: pointer;\n }\n"])),palette_themeDark50Percent),Text=styled_components_browser_esm.Ay.div(ModalQuickShareMarkAsSent_templateObject_6||(ModalQuickShareMarkAsSent_templateObject_6=ModalQuickShareMarkAsSent_makeTemplateObject(["\n font-style: normal;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n"],["\n font-style: normal;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n"])),(function(_a){return _a.theme.colors.primary[100]})),ButtonsWrapper=styled_components_browser_esm.Ay.section(ModalQuickShareMarkAsSent_templateObject_8||(ModalQuickShareMarkAsSent_templateObject_8=ModalQuickShareMarkAsSent_makeTemplateObject(["\n display: flex;\n justify-content: flex-end;\n margin-top: 32px;\n gap: 12px;\n\n ","\n"],["\n display: flex;\n justify-content: flex-end;\n margin-top: 32px;\n gap: 12px;\n\n ","\n"])),(function(_a){return _a.theme.containerWidth<=screenSizes_xs&&(0,styled_components_browser_esm.AH)(ModalQuickShareMarkAsSent_templateObject_7||(ModalQuickShareMarkAsSent_templateObject_7=ModalQuickShareMarkAsSent_makeTemplateObject(["\n justify-content: space-between;\n "],["\n justify-content: space-between;\n "])))})),BlueBox=styled_components_browser_esm.Ay.div(ModalQuickShareMarkAsSent_templateObject_10||(ModalQuickShareMarkAsSent_templateObject_10=ModalQuickShareMarkAsSent_makeTemplateObject(["\n display: flex;\n flex-direction: row;\n width: 500px;\n max-width: 528px;\n height: 80%;\n margin-top: 24px;\n margin-bottom: 24px;\n padding: 20px 16px;\n border-radius: 5px;\n background-color: ",";\n\n ","\n"],["\n display: flex;\n flex-direction: row;\n width: 500px;\n max-width: 528px;\n height: 80%;\n margin-top: 24px;\n margin-bottom: 24px;\n padding: 20px 16px;\n border-radius: 5px;\n background-color: ",";\n\n ","\n"])),palette_secondaryButtonBlueBg,(function(_a){return _a.theme.containerWidth<=screenSizes_xs&&(0,styled_components_browser_esm.AH)(ModalQuickShareMarkAsSent_templateObject_9||(ModalQuickShareMarkAsSent_templateObject_9=ModalQuickShareMarkAsSent_makeTemplateObject(["\n width: 100%;\n "],["\n width: 100%;\n "])))})),Disclaimer=styled_components_browser_esm.Ay.section(ModalQuickShareMarkAsSent_templateObject_11||(ModalQuickShareMarkAsSent_templateObject_11=ModalQuickShareMarkAsSent_makeTemplateObject(["\n display: flex;\n flex-direction: column;\n height: 100%;\n"],["\n display: flex;\n flex-direction: column;\n height: 100%;\n"]))),DisclaimerIconWrap=styled_components_browser_esm.Ay.section(templateObject_12||(templateObject_12=ModalQuickShareMarkAsSent_makeTemplateObject(["\n margin-right: 14px;\n height: 100%;\n color: ",";\n"],["\n margin-right: 14px;\n height: 100%;\n color: ",";\n"])),(function(_a){return _a.theme.colors.primary[40]})),ModalQuickShareMarkAsSent=function(_a){var handleModalClose=_a.handleModalClose,quickShareMarkAsSentHandler=_a.quickShareMarkAsSentHandler,isQuickShareLoading=_a.isQuickShareLoading,markAsSentPayload=_a.markAsSentPayload,getMarkAsSentPayload=_a.getMarkAsSentPayload,isCdkEnviroment=(0,styled_components_browser_esm.DP)().isCdkEnviroment,isCompanyAdmin=useAuthorizationContext().userData.isCompanyAdmin,onSubmit=function(markAsSentConfirmed){return ModalQuickShareMarkAsSent_awaiter(void 0,void 0,void 0,(function(){var payload,finalPayload;return ModalQuickShareMarkAsSent_generator(this,(function(_a){switch(_a.label){case 0:return[4,null==getMarkAsSentPayload?void 0:getMarkAsSentPayload()];case 1:return payload=_a.sent(),finalPayload=ModalQuickShareMarkAsSent_assign(ModalQuickShareMarkAsSent_assign(ModalQuickShareMarkAsSent_assign({markAsSentConfirmed,videoActivityType:VIDE0_ACTIVITY_TYPE.QUICKSHARE},markAsSentPayload),null==payload?void 0:payload.videoShareSetData),void 0!==(null==payload?void 0:payload.useAutomotive)?{useAutomotive:payload.useAutomotive}:{}),quickShareMarkAsSentHandler(finalPayload),[2]}}))}))};return(0,jsx_runtime.jsx)(Modal_Modal,{children:(0,jsx_runtime.jsxs)(ModalQuickShareMarkAsSent_ModalItem,{children:[(0,jsx_runtime.jsxs)(Header,{children:[(0,jsx_runtime.jsx)(Title,{children:"Mark Video as ‘Sent’?"}),(0,jsx_runtime.jsx)(CloseButtonWrapper,{children:(0,jsx_runtime.jsx)(images_CloseIcon,{width:"24px",height:"24px",onClick:handleModalClose,disabled:isQuickShareLoading})})]}),(0,jsx_runtime.jsxs)(BlueBox,{children:[(0,jsx_runtime.jsx)(DisclaimerIconWrap,{children:(0,jsx_runtime.jsx)(ai_index_esm.app,{size:24,color:"inherit"})}),(0,jsx_runtime.jsx)(Disclaimer,{children:(0,jsx_runtime.jsxs)(Text,{children:["If you don't want to answer this question with each quickshare,",isCompanyAdmin?" you":" your admin"," can change quickshare preferences."]})})]}),(0,jsx_runtime.jsxs)(ButtonsWrapper,{children:[(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{text:"Leave as ‘Not Sent’",variant:isCdkEnviroment?"text":"white",disabled:isQuickShareLoading,onClick:function(){return onSubmit(!1)}}),(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{text:"Mark as Sent",disabled:isQuickShareLoading,onClick:function(){return onSubmit(!0)}})]})]})})},react_covideo_ai_assist_esm=__webpack_require__("./node_modules/react-covideo-ai-assist/dist/react-covideo-ai-assist.esm.js"),io_index_esm=__webpack_require__("./node_modules/react-icons/io/index.esm.js");!function(PROMPT_TYPE){PROMPT_TYPE.TELEPROPTER_SCRIPT="Teleprompter Script",PROMPT_TYPE.EMAIL="Email",PROMPT_TYPE.SMS="SMS",PROMPT_TYPE.CRM_MESSAGE="CRM Message"}(PROMPT_TYPE||(PROMPT_TYPE={}));var quckshareApi_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},quckshareApi_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},getQuickshareDetails=function(videoId,params){return quckshareApi_awaiter(void 0,void 0,void 0,(function(){return quckshareApi_generator(this,(function(_a){switch(_a.label){case 0:return[4,config_EXPRESS_API.get("/share/quickshare/".concat(videoId),{params})];case 1:return[2,_a.sent().data]}}))}))},useCopyClipboard_assign=function(){return useCopyClipboard_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},useCopyClipboard_assign.apply(this,arguments)},useCopyClipboard_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},useCopyClipboard_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},useCopyClipboard_rest=function(s,e){var t={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0&&(t[p]=s[p]);if(null!=s&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(p=Object.getOwnPropertySymbols(s);i<p.length;i++)e.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i])&&(t[p[i]]=s[p[i]])}return t},useCopyClipboard=function(){var toast=useToastNotifications().toast,copyToClipboardNonSafari=function(url,html){return useCopyClipboard_awaiter(void 0,void 0,void 0,(function(){var listener;return useCopyClipboard_generator(this,(function(_a){return listener=function(e){e.clipboardData&&(e.clipboardData.setData("text/html",html||""),e.clipboardData.setData("text/plain",url)),e.preventDefault()},document.addEventListener("copy",(function(e){return listener(e)}),{once:!0}),document.execCommand("copy"),[2]}))}))};return{copyClipboard:function(url,html,params){return useCopyClipboard_awaiter(void 0,void 0,void 0,(function(){return useCopyClipboard_generator(this,(function(_a){switch(_a.label){case 0:return _a.trys.push([0,5,,6]),functions_isSafari?[4,(payload=params,useCopyClipboard_awaiter(void 0,void 0,void 0,(function(){var quickshareDetails,textArea,_a,_b;return useCopyClipboard_generator(this,(function(_c){switch(_c.label){case 0:return quickshareDetails=function(){return useCopyClipboard_awaiter(void 0,void 0,void 0,(function(){var videoId,rest,getQuickshareData;return useCopyClipboard_generator(this,(function(_a){switch(_a.label){case 0:return videoId=payload.videoId,payload.toastType,rest=useCopyClipboard_rest(payload,["videoId","toastType"]),[4,getQuickshareDetails(videoId,useCopyClipboard_assign({},rest))];case 1:return[2,{url:(getQuickshareData=_a.sent()).data.url,html:getQuickshareData.data.html}]}}))}))},textArea=document.createElement("textArea"),_b=(_a=navigator.clipboard).write,[4,new ClipboardItem({"text/plain":new Promise((function(resolve){return useCopyClipboard_awaiter(void 0,void 0,void 0,(function(){var _a,_b;return useCopyClipboard_generator(this,(function(_c){switch(_c.label){case 0:return _a=resolve,_b=Blob.bind,[4,quickshareDetails()];case 1:return _a.apply(void 0,[new(_b.apply(Blob,[void 0,[_c.sent().url],{type:"text/plain"}]))]),[2]}}))}))})),"text/html":new Promise((function(resolve){return useCopyClipboard_awaiter(void 0,void 0,void 0,(function(){var _a,range,selection;return useCopyClipboard_generator(this,(function(_b){switch(_b.label){case 0:return textArea.style.visibility="hidden",textArea.setAttribute("contenteditable","true"),_a=textArea,[4,quickshareDetails()];case 1:return _a.value=_b.sent().html,document.body.appendChild(textArea),(range=document.createRange()).selectNodeContents(textArea),null==(selection=window.getSelection())||selection.removeAllRanges(),null==selection||selection.addRange(range),null==textArea||textArea.setSelectionRange(0,999999),resolve(new Blob([textArea.value],{type:"text/html"})),[2]}}))}))}))})];case 1:return[4,_b.apply(_a,[[_c.sent()]])];case 2:return _c.sent(),textArea&&textArea.remove&&textArea.remove(),[2]}}))})))]:[3,2];case 1:return _a.sent(),[3,4];case 2:return[4,copyToClipboardNonSafari(url,html)];case 3:_a.sent(),_a.label=4;case 4:return[3,6];case 5:return _a.sent(),toast({message:"Failed to copy to clipboard"}),[3,6];case 6:return[2]}var payload}))}))}}},useQuickShareMarkAsSentMutation_assign=function(){return useQuickShareMarkAsSentMutation_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},useQuickShareMarkAsSentMutation_assign.apply(this,arguments)},useQuickShareMarkAsSentMutation_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},useQuickShareMarkAsSentMutation_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},useQuickShareMarkAsSentMutation_rest=function(s,e){var t={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0&&(t[p]=s[p]);if(null!=s&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(p=Object.getOwnPropertySymbols(s);i<p.length;i++)e.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i])&&(t[p[i]]=s[p[i]])}return t},markQuickShareAsSent=function(params){return useQuickShareMarkAsSentMutation_awaiter(void 0,void 0,void 0,(function(){var videoId,rest,body;return useQuickShareMarkAsSentMutation_generator(this,(function(_a){switch(_a.label){case 0:return videoId=params.videoId,params.toastType,rest=useQuickShareMarkAsSentMutation_rest(params,["videoId","toastType"]),body=useQuickShareMarkAsSentMutation_assign(useQuickShareMarkAsSentMutation_assign({},rest),functions_isSafari?{reuseShortUrl:!0}:{}),[4,config_EXPRESS_API.post("/share/quickshare/".concat(videoId,"/mark-as-sent"),body)];case 1:return[2,_a.sent().data]}}))}))},useQuickShare_assign=function(){return useQuickShare_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},useQuickShare_assign.apply(this,arguments)},useQuickShare_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},useQuickShare_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},useQuickShare_rest=function(s,e){var t={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0&&(t[p]=s[p]);if(null!=s&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(p=Object.getOwnPropertySymbols(s);i<p.length;i++)e.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i])&&(t[p[i]]=s[p[i]])}return t},useQuickShare=function(_a){var video=_a.video,videoRequest=_a.videoRequest,setShowModalQuickShareMarkAsSent=_a.setShowModalQuickShareMarkAsSent,handleOnMarkAsSentSuccessCallback=_a.handleOnMarkAsSentSuccessCallback,userData=useAuthorizationContext().userData,copyClipboard=useCopyClipboard().copyClipboard,_b=function(onSuccessCallback){var userData=useAuthorizationContext().userData,toast=useToastNotifications().toast,copyClipboard=useCopyClipboard().copyClipboard,_a=useConfigurationContext(),onVideoInsert=_a.onVideoInsert,onVideoInsertError=_a.onVideoInsertError,markAsSent=getMarkAsSentValue(userData);return(0,es.useMutation)(markQuickShareAsSent,{onSuccess:function(data,variables){var dataToShow=function(data,variables){switch(variables.toastType){case"crm_code":return{title:"CRM Code Copied!",clipboardText:data.url,clipboardHtml:data.html};case"url":return{title:"URL Copied!",clipboardText:data.url};case"html_code":return{title:"Raw HTML Copied!",clipboardText:data.legacyHtml};case"quickshare":return{title:"Link copied to clipboard!",clipboardText:data.url,clipboardHtml:data.html};case"insert":return{title:"Inserting video..."}}}(data,variables);if(markAsSent===MarkAsSentOptions_ALWAYS.value&&toast({message:"Video marked as Sent"}),markAsSent===MarkAsSentOptions_ASK_VERY_TIME.value&&variables.markAsSentConfirmed&&toast({message:"Video marked as Sent"}),dataToShow){if(dataToShow.clipboardText)try{!functions_isSafari&&dataToShow.clipboardText&©Clipboard(dataToShow.clipboardText,(null==dataToShow?void 0:dataToShow.clipboardHtml)||"",{})}catch(error){console.log("Failed to copy to clipboard...",error)}dataToShow.title&&setTimeout((function(){toast({message:dataToShow.title})}),100)}"insert"===variables.toastType&&(null==onVideoInsert||onVideoInsert({url:data.url,thumbnail:data.thumbnail,image:(null==data?void 0:data.image)||"",html:data.html,token})),onSuccessCallback()},onError:function(error){null==onVideoInsertError||onVideoInsertError(error)}})}((function(){null==handleOnMarkAsSentSuccessCallback||handleOnMarkAsSentSuccessCallback(),setShowModalQuickShareMarkAsSent(!1)})),isQuickshareLoading=_b.isLoading,quickShareMarkAsSentAsync=_b.mutateAsync,onQuickShareMutationHandler=function(_a){return useQuickShare_awaiter(void 0,void 0,void 0,(function(){var payload,error_1,markAsSentConfirmed=_a.markAsSentConfirmed,videoActivityType=_a.videoActivityType,rest=useQuickShare_rest(_a,["markAsSentConfirmed","videoActivityType"]);return useQuickShare_generator(this,(function(_b){switch(_b.label){case 0:if(payload=useQuickShare_assign(useQuickShare_assign(useQuickShare_assign({videoId:"number"==typeof video?video.toString():(null==video?void 0:video.id)||"",vin:(null==videoRequest?void 0:videoRequest.vin)||"",useAutomotive:!!(null==videoRequest?void 0:videoRequest.vin)},videoActivityType?{videoActivityType}:{}),void 0!==markAsSentConfirmed?{markAsSentConfirmed}:{}),rest),!functions_isSafari)return[3,4];_b.label=1;case 1:return _b.trys.push([1,3,,4]),[4,copyClipboard("","",payload)];case 2:return _b.sent(),[3,4];case 3:return error_1=_b.sent(),console.log("Failed to copy to clipboard...",error_1),[3,4];case 4:return[4,quickShareMarkAsSentAsync(payload)];case 5:return[2,_b.sent()]}}))}))};return{onQuickShareButtonClick:function(_a){var videoActivityType=_a.videoActivityType,rest=useQuickShare_rest(_a,["videoActivityType"]),markAsSent=getMarkAsSentValue(userData);return markAsSent===MarkAsSentOptions_NEVER.value?onQuickShareMutationHandler(useQuickShare_assign({videoActivityType},rest)):markAsSent===MarkAsSentOptions_ASK_VERY_TIME.value?setShowModalQuickShareMarkAsSent(!0):markAsSent===MarkAsSentOptions_ALWAYS.value?onQuickShareMutationHandler(useQuickShare_assign({videoActivityType},rest)):void 0},isQuickshareLoading,onQuickShareMutationHandler}},useImageLoadRetry_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar};const hooks_useImageLoadRetry=function(_a){var src=_a.src,onLoad=_a.onLoad,imgRef=(0,react.useRef)(null),_b=useImageLoadRetry_read((0,react.useState)(0),2),retryCount=_b[0],setRetryCount=_b[1],_c=useImageLoadRetry_read((0,react.useState)(!1),2),error=_c[0],setError=_c[1],handleLoad=function(){var _a,_b,_c,_d;setError(!1),setRetryCount(0),onLoad&&onLoad(null!==(_b=null===(_a=imgRef.current)||void 0===_a?void 0:_a.offsetWidth)&&void 0!==_b?_b:0,null!==(_d=null===(_c=imgRef.current)||void 0===_c?void 0:_c.offsetHeight)&&void 0!==_d?_d:0)},handleError=function(){if(setError(!0),!(retryCount>=30)){var timeout=1e3*Math.pow(2,retryCount);timeout>5e3&&(timeout=5e3),setTimeout((function(){return setRetryCount(retryCount+1)}),timeout)}};return(0,react.useEffect)((function(){return(null==imgRef?void 0:imgRef.current)&&(imgRef.current.onload=handleLoad,imgRef.current.onerror=handleError,imgRef.current.src=src),function(){(null==imgRef?void 0:imgRef.current)&&(imgRef.current.onload=null,imgRef.current.onerror=null)}}),[src,retryCount]),{imgRef,retryCount,error}};var VideoStatus,VideoEncodingStatus;!function(VideoStatus){VideoStatus.NoStatus="",VideoStatus.Pending="pending",VideoStatus.Denied="denied",VideoStatus.Approved="approved"}(VideoStatus||(VideoStatus={})),function(VideoEncodingStatus){VideoEncodingStatus[VideoEncodingStatus.READY=0]="READY",VideoEncodingStatus[VideoEncodingStatus.PROCESSING=1]="PROCESSING",VideoEncodingStatus[VideoEncodingStatus.FAILED=2]="FAILED"}(VideoEncodingStatus||(VideoEncodingStatus={}));var useVideoLoadRetry_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},useVideoLoadRetry_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},useVideoLoadRetry_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar};const hooks_useVideoLoadRetry=function(_a){var videoId=_a.videoId,checkField=_a.checkField,enabled=_a.enabled,_b=useVideoLoadRetry_read((0,react.useState)(null),2),videoData=_b[0],setVideoData=_b[1],_c=useVideoLoadRetry_read((0,react.useState)(0),2),retryCount=_c[0],setRetryCount=_c[1],_d=useVideoLoadRetry_read((0,react.useState)(!1),2),error=_d[0],setError=_d[1];return(0,react.useEffect)((function(){if(enabled){useVideoLoadRetry_awaiter(void 0,void 0,void 0,(function(){var video_1,isProcessed,cache,selectedVideos_1,timeout;return useVideoLoadRetry_generator(this,(function(_a){switch(_a.label){case 0:return _a.trys.push([0,2,,3]),[4,getVideo(videoId.toString())];case 1:return video_1=_a.sent(),isProcessed=(null==video_1?void 0:video_1.processing)===VideoEncodingStatus.FAILED||(null==video_1?void 0:video_1.processing)===VideoEncodingStatus.READY,checkField&&video_1[checkField]?(setVideoData(video_1),[2]):isProcessed?((cache=localStorage.getItem(config_COOKIE_NAMES.merge))&&((selectedVideos_1=JSON.parse(cache)||[]).forEach((function(v,index){v.id===video_1.id&&(selectedVideos_1[index]=video_1)})),localStorage.setItem(config_COOKIE_NAMES.merge,JSON.stringify(selectedVideos_1))),setVideoData(video_1),[2]):retryCount<30?((timeout=1e3*Math.pow(2,retryCount))>5e3&&(timeout=5e3),setTimeout((function(){setRetryCount(retryCount+1)}),timeout),[2]):(setError(!0),[3,3]);case 2:return _a.sent(),setError(!0),[3,3];case 3:return[2]}}))}))}}),[videoId,checkField,retryCount,enabled]),{videoData,retryCount,error}};var VideoItemThumbnail_templateObject_1,VideoItemThumbnail_templateObject_2,VideoItemThumbnail_templateObject_3,VideoItemThumbnail_templateObject_4,VideoItemThumbnail_templateObject_5,modals_Modal_templateObject_1,modals_Modal_templateObject_2,modals_Modal_templateObject_3,Modal_templateObject_4,progressBar_templateObject_1,progressBar_templateObject_2,icon_play_g,VideoItemThumbnail_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},VideoItemThumbnail_assign=function(){return VideoItemThumbnail_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},VideoItemThumbnail_assign.apply(this,arguments)},VideoThumbnailWrapper=styled_components_browser_esm.Ay.div(VideoItemThumbnail_templateObject_1||(VideoItemThumbnail_templateObject_1=VideoItemThumbnail_makeTemplateObject(["\n position: relative;\n width: 100%;\n height: 100%;\n border-radius: 5px;\n background: ",";\n cursor: pointer;\n overflow: hidden;\n opacity: ",";\n"],["\n position: relative;\n width: 100%;\n height: 100%;\n border-radius: 5px;\n background: ",";\n cursor: pointer;\n overflow: hidden;\n opacity: ",";\n"])),palette_black,(function(props){return"deleted"===props.status?.5:1})),VideoThumbnail=styled_components_browser_esm.Ay.img(VideoItemThumbnail_templateObject_2||(VideoItemThumbnail_templateObject_2=VideoItemThumbnail_makeTemplateObject(["\n position: absolute;\n top: 0;\n bottom: 0;\n left: 50%;\n transform: translateX(-50%);\n height: 100%;\n opacity: ",";\n"],["\n position: absolute;\n top: 0;\n bottom: 0;\n left: 50%;\n transform: translateX(-50%);\n height: 100%;\n opacity: ",";\n"])),(function(props){return props.visible?1:0})),SpinnerWrapper=styled_components_browser_esm.Ay.div(VideoItemThumbnail_templateObject_3||(VideoItemThumbnail_templateObject_3=VideoItemThumbnail_makeTemplateObject(["\n display: flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: ",";\n"],["\n display: flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: ",";\n"])),palette_primaryBlack25Percent),Label=styled_components_browser_esm.Ay.div(VideoItemThumbnail_templateObject_4||(VideoItemThumbnail_templateObject_4=VideoItemThumbnail_makeTemplateObject(["\n display: flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n color: ",";\n background-color: ",";\n"],["\n display: flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n color: ",";\n background-color: ",";\n"])),palette_red100,palette_black),VideoDuration=styled_components_browser_esm.Ay.div(VideoItemThumbnail_templateObject_5||(VideoItemThumbnail_templateObject_5=VideoItemThumbnail_makeTemplateObject(["\n position: absolute;\n left: 8px;\n bottom: 6px;\n color: ",";\n font-weight: 500;\n font-size: 13px;\n line-height: 16px;\n padding: 2px 4px;\n border-radius: 5px;\n background: ",";\n display: flex;\n align-items: center;\n justify-content: center;\n min-width: 36px;\n"],["\n position: absolute;\n left: 8px;\n bottom: 6px;\n color: ",";\n font-weight: 500;\n font-size: 13px;\n line-height: 16px;\n padding: 2px 4px;\n border-radius: 5px;\n background: ",";\n display: flex;\n align-items: center;\n justify-content: center;\n min-width: 36px;\n"])),palette_white,palette_primaryBlack25Percent),VideoItemThumbnail=function(_a){var thumbnail=_a.thumbnail,duration=_a.duration,videoId=_a.videoId,emailStatus=_a.emailStatus,processing=_a.processing,onClick=_a.onClick,prepareTime=function(d){return function(sec_num,fractionDigits){void 0===fractionDigits&&(fractionDigits=1);var minutes=Math.floor(sec_num/60),seconds=sec_num-60*minutes;if(isNaN(minutes))return"00.0";var time="";return minutes<10&&(time+="0"),time+=minutes+":",seconds<10&&(time+="0"),time+seconds.toFixed(fractionDigits)}(d/1e3).split(".")[0]},videoData=hooks_useVideoLoadRetry({videoId,checkField:"videoLength",enabled:!duration}).videoData,_b=hooks_useImageLoadRetry({src:(null==videoData?void 0:videoData.autogeneratedThumbnail)||thumbnail}),imgRef=_b.imgRef,retryCount=_b.retryCount,thumbnailAvailable=!_b.error&&0===retryCount,newDuration=duration?prepareTime(duration):(null==videoData?void 0:videoData.videoLength)?prepareTime(null==videoData?void 0:videoData.videoLength):"...";return(0,jsx_runtime.jsxs)(VideoThumbnailWrapper,VideoItemThumbnail_assign({status:emailStatus,onClick},{children:[(0,jsx_runtime.jsx)(VideoThumbnail,{src:thumbnail,ref:imgRef,visible:thumbnailAvailable},retryCount),!thumbnailAvailable&&2!==processing&&(0,jsx_runtime.jsx)(SpinnerWrapper,{children:(0,jsx_runtime.jsx)(Spinner,{})}),!thumbnailAvailable&&2===processing&&(0,jsx_runtime.jsx)(Label,{children:"Failed"}),2!==processing&&(0,jsx_runtime.jsx)(VideoDuration,{children:newDuration})]}))},UseOnClickOutside_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},useOnClickOutside=function(callback){var _a=UseOnClickOutside_read(react.useState(null),2),node=_a[0],setNode=_a[1];react.useEffect((function(){if(node){var handleClickOutside=function(e){node.contains(e.target)||callback()};return document.addEventListener("click",handleClickOutside,!0),function(){return document.removeEventListener("click",handleClickOutside,!0)}}}),[node]);var ref=react.useCallback((function(node){return setNode(node)}),[]);return{ref}},modals_Modal_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},modals_Modal_assign=function(){return modals_Modal_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},modals_Modal_assign.apply(this,arguments)},Modal_DarkBackground=styled_components_browser_esm.Ay.div(modals_Modal_templateObject_1||(modals_Modal_templateObject_1=modals_Modal_makeTemplateObject(["\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n height: 100vh;\n background-color: ",";\n z-index: 998;\n width: 100% !important;\n"],["\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n height: 100vh;\n background-color: ",";\n z-index: 998;\n width: 100% !important;\n"])),palette_blackRgba75),Modal_ModalContainer=styled_components_browser_esm.Ay.div(modals_Modal_templateObject_3||(modals_Modal_templateObject_3=modals_Modal_makeTemplateObject(["\n width: auto;\n height: 100vh;\n ","\n transition: height 0.5s ease-in-out;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 999;\n"],["\n width: auto;\n height: 100vh;\n ","\n transition: height 0.5s ease-in-out;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 999;\n"])),(function(_a){return _a.theme.containerWidth>=screenSizes_mb&&(0,styled_components_browser_esm.AH)(modals_Modal_templateObject_2||(modals_Modal_templateObject_2=modals_Modal_makeTemplateObject(["\n width: 100vw;\n "],["\n width: 100vw;\n "])))})),Modal_ModalBody=styled_components_browser_esm.Ay.div(Modal_templateObject_4||(Modal_templateObject_4=modals_Modal_makeTemplateObject(["\n height: ",";\n background-color: #fff;\n overflow-y: ",";\n overflow-x: ",";\n border-radius: 4px;\n ","\n"],["\n height: ",";\n background-color: #fff;\n overflow-y: ",";\n overflow-x: ",";\n border-radius: 4px;\n ","\n"])),(function(props){return props.maxHeight?props.maxHeight:"100vh"}),(function(props){return props.overflowY}),(function(props){return props.overflowX}),(function(props){if(props.disableFullScreen)return"\n height: ".concat(props.overrideBodyHeight&&props.maxHeight?props.maxHeight:"auto",";\n width: ").concat(props.widthOnDesktop?props.widthOnDesktop:"auto",";\n ")})),modals_Modal_Modal=function(_a){var _b=_a.style,style=void 0===_b?{}:_b,children=_a.children,widthOnDesktop=_a.widthOnDesktop,disableFullScreen=_a.disableFullScreen,maxHeight=_a.maxHeight,_c=_a.overrideBodyHeight,overrideBodyHeight=void 0!==_c&&_c,_d=_a.bodyOverflowY,bodyOverflowY=void 0===_d?"auto":_d,_e=_a.bodyOverflowX,bodyOverflowX=void 0===_e?"hidden":_e,onOutsideClick=_a.onOutsideClick;(0,react.useEffect)((function(){if(document&&document.body){var orig=document.body.className;document.body.className=orig+(orig?" ":"")+"modal-open"}return function(){document&&document.body&&(document.body.className=document.body.className.replace(/ ?modal-open/,""))}}),[]);var ref=useOnClickOutside(onOutsideClick).ref;return(0,jsx_runtime.jsx)(Modal_DarkBackground,modals_Modal_assign({style},{children:(0,jsx_runtime.jsx)(Modal_ModalContainer,{children:(0,jsx_runtime.jsx)(Modal_ModalBody,modals_Modal_assign({disableFullScreen,widthOnDesktop,maxHeight,overrideBodyHeight,overflowX:bodyOverflowX,overflowY:bodyOverflowY,ref:onOutsideClick?ref:null},{children}))})}))},color_convert=__webpack_require__("./node_modules/color-convert/index.js"),index_modern=__webpack_require__("./node_modules/react-full-screen/dist/index.modern.js"),progressBar_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},progressBar_assign=function(){return progressBar_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},progressBar_assign.apply(this,arguments)},ProgressWrapper=styled_components_browser_esm.Ay.div(progressBar_templateObject_1||(progressBar_templateObject_1=progressBar_makeTemplateObject(["\n width: 100%;\n display: flex;\n cursor: pointer;\n flex: 1;\n padding-bottom: ",";\n"],["\n width: 100%;\n display: flex;\n cursor: pointer;\n flex: 1;\n padding-bottom: ",";\n"])),(function(props){return"".concat(props.small?"0px":" 0px 12px")})),Progress=styled_components_browser_esm.Ay.progress(progressBar_templateObject_2||(progressBar_templateObject_2=progressBar_makeTemplateObject(["\n width: 100%;\n color: white;\n opacity: 1;\n height: ","; /* TODO: it's 4px in design */\n border-radius: ",";\n border: 1px solid transparent;\n box-sizing: border-box;\n\n &::-webkit-progress-bar {\n border-radius: 4px;\n }\n &::-webkit-progress-value {\n background-color: white;\n border-radius: 4px;\n }\n"],["\n width: 100%;\n color: white;\n opacity: 1;\n height: ","; /* TODO: it's 4px in design */\n border-radius: ",";\n border: 1px solid transparent;\n box-sizing: border-box;\n\n &::-webkit-progress-bar {\n border-radius: 4px;\n }\n &::-webkit-progress-value {\n background-color: white;\n border-radius: 4px;\n }\n"])),(function(props){return"".concat((props.small,"4px"))}),(function(props){return"".concat(props.small?"1px":"4px")})),ProgressBar=function(props){var _a=props.duration,duration=void 0===_a?.1:_a,_b=props.currentTime,currentTime=void 0===_b?0:_b,scrub=props.scrub,color=props.color,small=props.small,progressRef=react.createRef();return(0,jsx_runtime.jsx)(ProgressWrapper,progressBar_assign({small},{children:(0,jsx_runtime.jsx)(Progress,{ref:progressRef,onClick:function(event){return scrub(event,progressRef)},value:currentTime.toString(),min:"0",max:duration.toString(),color,small})}))},volumeOff_assign=function(){return volumeOff_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},volumeOff_assign.apply(this,arguments)},VolumeOffIcon=function(props){return(0,jsx_runtime.jsxs)("svg",volumeOff_assign({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},{children:[(0,jsx_runtime.jsx)("defs",{children:(0,jsx_runtime.jsx)("path",{id:"volumeOff-a",d:"M3.63 3.635a.996.996 0 0 0 0 1.41l3.66 3.66-.29.3H4c-.55 0-1 .45-1 1v4c0 .55.45 1 1 1h3l3.29 3.29c.63.63 1.71.18 1.71-.71v-4.17l4.18 4.18c-.49.37-1.02.68-1.6.91-.36.15-.58.53-.58.92 0 .72.73 1.18 1.39.91.8-.33 1.55-.77 2.22-1.31l1.34 1.34a.996.996 0 1 0 1.41-1.41L5.05 3.635c-.39-.39-1.02-.39-1.42 0zM19 12.005c0 .82-.15 1.61-.41 2.34l1.53 1.53c.56-1.17.88-2.48.88-3.87 0-3.83-2.4-7.11-5.78-8.4-.59-.23-1.22.23-1.22.86v.19c0 .38.25.71.61.85 2.57 1.04 4.39 3.56 4.39 6.5zm-8.71-6.29l-.17.17L12 7.765v-1.35c0-.89-1.08-1.33-1.71-.7zm6.21 6.29a4.5 4.5 0 0 0-2.5-4.03v1.79l2.48 2.48c.01-.08.02-.16.02-.24z"})}),(0,jsx_runtime.jsxs)("g",volumeOff_assign({fill:"none",fillRule:"evenodd"},{children:[(0,jsx_runtime.jsx)("mask",volumeOff_assign({id:"volumeOff-b",fill:"#fff"},{children:(0,jsx_runtime.jsx)("use",{xlinkHref:"#volumeOff-a"})})),(0,jsx_runtime.jsx)("g",volumeOff_assign({fill:"#fff",fillOpacity:"1",mask:"url(#volumeOff-b)"},{children:(0,jsx_runtime.jsx)("path",{d:"M0 0h24v24H0z"})}))]}))]}))};function icon_play_extends(){return icon_play_extends=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},icon_play_extends.apply(null,arguments)}const icon_play=function SvgIconPlay(props){return react.createElement("svg",icon_play_extends({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24"},props),icon_play_g||(icon_play_g=react.createElement("g",{fill:"#FFF"},react.createElement("path",{d:"M7.928 6.82v10.36c0 .79.87 1.27 1.54.84l8.14-5.18c.62-.39.62-1.29 0-1.69l-8.14-5.17c-.67-.43-1.54.05-1.54.84z"}))))};var playButton_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked};const playButton=(0,styled_components_browser_esm.Ay)(icon_play)(playButton_templateObject_1||(playButton_templateObject_1=playButton_makeTemplateObject(["\n width: ",";\n height: ",";\n path {\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n path {\n opacity: ",";\n }\n"])),(function(props){return props.width||"40px"}),(function(props){return props.height||"40px"}),(function(props){return props.opacity||"inherit"}));var playButton_templateObject_1,icon_pause_g;function icon_pause_extends(){return icon_pause_extends=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},icon_pause_extends.apply(null,arguments)}const icon_pause=function SvgIconPause(props){return react.createElement("svg",icon_pause_extends({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24"},props),icon_pause_g||(icon_pause_g=react.createElement("g",{fill:"#272A32"},react.createElement("path",{d:"M8 19c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2v10c0 1.1.9 2 2 2zm6-12v10c0 1.1.9 2 2 2s2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2z"}))))};var pauseButton_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked};const pauseButton=(0,styled_components_browser_esm.Ay)(icon_pause)(pauseButton_templateObject_1||(pauseButton_templateObject_1=pauseButton_makeTemplateObject(["\n width: ",";\n height: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"])),(function(props){return props.width||"24px"}),(function(props){return props.height||"24px"}),(function(props){return props.color||"currentColor"}),(function(props){return props.opacity||"inherit"}));var pauseButton_templateObject_1,Vector_path,Vector_path2;function Vector_extends(){return Vector_extends=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Vector_extends.apply(null,arguments)}const Vector=function SvgVector(props){return react.createElement("svg",Vector_extends({width:20,height:17,viewBox:"0 0 20 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props),Vector_path||(Vector_path=react.createElement("path",{d:"M17.2907 7.4906C17.3029 7.31501 17.3614 7.14578 17.46 7C17.5559 6.84858 17.6907 6.72571 17.8504 6.64426C18.0101 6.56281 18.1887 6.52577 18.3676 6.53701C18.5464 6.54826 18.719 6.60738 18.8672 6.70818C19.0154 6.80898 19.1338 6.94776 19.21 7.11C19.8115 8.53356 20.0749 10.0772 19.9794 11.6196C19.884 13.1621 19.4324 14.6614 18.66 16C18.4838 16.3052 18.2301 16.5584 17.9245 16.734C17.619 16.9097 17.2724 17.0014 16.92 17H3.07C2.72098 16.9979 2.37858 16.9045 2.07683 16.7291C1.77509 16.5536 1.52451 16.3023 1.35 16C0.294996 14.182 -0.160348 12.0779 0.0486524 9.98638C0.257653 7.89489 1.12037 5.92243 2.51426 4.34919C3.90815 2.77594 5.76232 1.68191 7.81341 1.2225C9.8645 0.763091 12.0082 0.961661 13.94 1.79C14.1082 1.85914 14.2544 1.97285 14.3628 2.11888C14.4712 2.26492 14.5377 2.43776 14.5552 2.61879C14.5727 2.79982 14.5405 2.98219 14.462 3.14628C14.3836 3.31036 14.2619 3.44995 14.11 3.55C13.9642 3.64865 13.795 3.70707 13.6194 3.71936C13.4438 3.73165 13.2681 3.69738 13.11 3.62C12.4369 3.33395 11.7264 3.14538 11 3.06C9.56439 2.8728 8.10489 3.07868 6.77709 3.6557C5.44928 4.23271 4.30294 5.15924 3.46028 6.3365C2.61762 7.51376 2.11023 8.89763 1.99219 10.3406C1.87414 11.7835 2.14988 13.2314 2.79 14.53C2.87447 14.6931 3.0022 14.8297 3.1592 14.9249C3.31619 15.0202 3.49638 15.0704 3.68 15.07H16.33C16.5126 15.0713 16.6921 15.0227 16.849 14.9292C17.0059 14.8358 17.1342 14.7012 17.22 14.54C17.9267 13.0705 18.1674 11.4201 17.91 9.81C17.8129 9.18733 17.6382 8.57927 17.39 8C17.3126 7.84191 17.2784 7.66618 17.2907 7.4906Z",fill:"#001B53"})),Vector_path2||(Vector_path2=react.createElement("path",{d:"M8.00391 11.005C8.00391 10.4743 8.21474 9.96527 8.59002 9.58999L17.08 3.92999L11.42 12.42C11.0447 12.7953 10.5357 13.0061 10.005 13.0061C9.74223 13.0061 9.48201 12.9543 9.23923 12.8538C8.99644 12.7532 8.77584 12.6058 8.59002 12.42C8.4042 12.2342 8.2568 12.0136 8.15623 11.7708C8.05567 11.528 8.00391 11.2678 8.00391 11.005Z",fill:"#001B53"})))};var VectorIcon_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked};const images_VectorIcon=(0,styled_components_browser_esm.Ay)(Vector)(VectorIcon_templateObject_1||(VectorIcon_templateObject_1=VectorIcon_makeTemplateObject(["\n width: ",";\n height: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"])),(function(props){return props.width||"16px"}),(function(props){return props.height||"16px"}),(function(props){return props.color||"currentColor"}),(function(props){return props.opacity||"inherit"}));var VectorIcon_templateObject_1,checkmark_g;function checkmark_extends(){return checkmark_extends=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},checkmark_extends.apply(null,arguments)}const checkmark=function SvgCheckmark(props){return react.createElement("svg",checkmark_extends({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 16 16"},props),checkmark_g||(checkmark_g=react.createElement("g",{fill:"#FFF"},react.createElement("path",{id:"1i74dgfm6a",d:"M5.867 10.603L3.533 8.27c-.123-.125-.291-.195-.466-.195-.176 0-.344.07-.467.195-.26.26-.26.673 0 .933l2.793 2.794c.26.26.68.26.94 0l7.067-7.06c.26-.26.26-.674 0-.934-.123-.124-.291-.195-.467-.195-.175 0-.343.07-.466.195l-6.6 6.6z"}))))};var CheckmarkIcon_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked};const images_CheckmarkIcon=(0,styled_components_browser_esm.Ay)(checkmark)(CheckmarkIcon_templateObject_1||(CheckmarkIcon_templateObject_1=CheckmarkIcon_makeTemplateObject(["\n width: ",";\n height: ",";\n fill: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n fill: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"])),(function(props){return props.width||"21px"}),(function(props){return props.height||"21px"}),(function(props){return props.color||"currentColor"}),(function(props){return props.color||"currentColor"}),(function(props){return props.opacity||"inherit"}));var CheckmarkIcon_templateObject_1,CdkSmallLogo_path,CdkSmallLogo_g;function CdkSmallLogo_extends(){return CdkSmallLogo_extends=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},CdkSmallLogo_extends.apply(null,arguments)}const CdkSmallLogo=function SvgCdkSmallLogo(props){return react.createElement("svg",CdkSmallLogo_extends({width:20,height:20,viewBox:"0 0 290 290",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props),react.createElement("mask",{id:"mask0_16_1171",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:0,y:0,width:290,height:290},CdkSmallLogo_path||(CdkSmallLogo_path=react.createElement("path",{d:"M290 0H0V290H290V0Z",fill:"white"}))),CdkSmallLogo_g||(CdkSmallLogo_g=react.createElement("g",{mask:"url(#mask0_16_1171)"},react.createElement("path",{d:"M143.64 129.1H133.1V160.12H143.64C149.42 160.12 152.36 158.82 154.88 156.4C157.82 153.54 159.46 150 159.46 144.74C159.46 139.82 158 136.18 155.32 133.34C152.82 130.66 149.88 129.1 143.66 129.1H143.64Z",fill:"white"}),react.createElement("path",{d:"M145.74 0.78C66.42 0.78 1.9 65.3 1.9 144.62C1.9 223.94 66.42 288.46 145.74 288.46C225.06 288.46 289.58 223.94 289.58 144.62C289.58 65.3 225.06 0.78 145.74 0.78ZM78.76 174.56C59.84 174.56 47.3 161.08 47.3 144.58C47.3 128.08 59.92 114.68 78.32 114.68C88.68 114.68 98.22 118.66 106.48 124.36L97.4 134.2C92.12 129.88 85.3 127.38 80.2 127.38C69.74 127.38 63 135.24 63 144.66C63 154.08 69.92 161.94 80.62 161.94C87.18 161.94 94.02 158.06 99.02 153.38L108.18 163.06C101.36 169.1 91.16 174.56 78.72 174.56H78.76ZM167.14 164.78C162.22 169.62 155.14 172.82 143.98 172.82H117.98V116.4H143.98C154.52 116.4 162.3 119.34 167.56 124.86C172.4 129.96 175.08 136.86 175.08 144.56C175.08 152.26 172.32 159.68 167.14 164.78ZM228.66 172.82L209.4 148.54L202.58 155.02V172.82H187.38V116.4H202.58V137.56L224.78 116.4H243.96L220.02 138.78L247.4 172.82H228.66Z",fill:"white"}),react.createElement("path",{d:"M264.54 269.48H262.68V274.18H261.34V269.48H259.48V268.4H264.54V269.48Z",fill:"white"}),react.createElement("path",{d:"M270.52 270.7L268.82 273.56H268.2L266.52 270.78V274.18H265.26V268.4H266.36L268.54 271.98L270.66 268.4H271.76L271.78 274.18H270.52V270.7Z",fill:"white"}))))};var CdkSmallLogo_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked};const images_CdkSmallLogo=(0,styled_components_browser_esm.Ay)(CdkSmallLogo)(CdkSmallLogo_templateObject_1||(CdkSmallLogo_templateObject_1=CdkSmallLogo_makeTemplateObject(["\n width: ",";\n height: ",";\n fill: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n fill: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"])),(function(props){return props.width||"21px"}),(function(props){return props.height||"21px"}),(function(props){return props.color||"currentColor"}),(function(props){return props.color||"currentColor"}),(function(props){return props.opacity||"inherit"}));var CdkSmallLogo_templateObject_1,CovideoSmallLogo_g,CovideoSmallLogo_defs;function CovideoSmallLogo_extends(){return CovideoSmallLogo_extends=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},CovideoSmallLogo_extends.apply(null,arguments)}const CovideoSmallLogo=function SvgCovideoSmallLogo(props){return react.createElement("svg",CovideoSmallLogo_extends({width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props),CovideoSmallLogo_g||(CovideoSmallLogo_g=react.createElement("g",{clipPath:"url(#clip0_169_7893)"},react.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.8611 22.8365V8.99684L7.47923 3.75562L0 11.1862V20.81L7.483 28.2956L7.52376 28.2684L13.8611 22.8365Z",fill:"white",fillOpacity:.4}),react.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M32 12.9316V11.1862L22.3706 1.5625H9.68686L7.48309 3.75112L22.1049 15.761H32V12.9316Z",fill:"url(#paint0_linear_169_7893)"}),react.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M22.1049 15.761L7.48309 28.2956L9.62573 30.4375H22.3706L32 20.81V15.761H22.1049Z",fill:"white",fillOpacity:.6}))),CovideoSmallLogo_defs||(CovideoSmallLogo_defs=react.createElement("defs",null,react.createElement("linearGradient",{id:"paint0_linear_169_7893",x1:16.8056,y1:3.07019,x2:25.1265,y2:15.5418,gradientUnits:"userSpaceOnUse"},react.createElement("stop",{offset:.0483,stopColor:"white",stopOpacity:.5}),react.createElement("stop",{offset:1,stopColor:"white",stopOpacity:.8})),react.createElement("clipPath",{id:"clip0_169_7893"},react.createElement("rect",{width:32,height:32,fill:"white"})))))};var CovideoSmallLogo_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked};const images_CovideoSmallLogo=(0,styled_components_browser_esm.Ay)(CovideoSmallLogo)(CovideoSmallLogo_templateObject_1||(CovideoSmallLogo_templateObject_1=CovideoSmallLogo_makeTemplateObject(["\n width: ",";\n height: ",";\n fill: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n fill: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"])),(function(props){return props.width||"21px"}),(function(props){return props.height||"21px"}),(function(props){return props.color||"currentColor"}),(function(props){return props.color||"currentColor"}),(function(props){return props.opacity||"inherit"}));var CovideoSmallLogo_templateObject_1,videoControls_templateObject_1,videoControls_templateObject_2,videoControls_templateObject_3,videoControls_templateObject_4,videoControls_templateObject_5,videoControls_templateObject_6,videoControls_templateObject_7,videoControls_templateObject_8,videoControls_templateObject_9,videoControls_templateObject_10,videoControls_templateObject_11,VideoPlayer_templateObject_1,VideoPlayer_templateObject_2,VideoPlayer_templateObject_3,VideoPlayer_templateObject_4,VideoPlayer_templateObject_5,VideoPlayer_templateObject_6,VideoPlayer_templateObject_7,ModalVideoPreview_templateObject_1,ModalVideoPreview_templateObject_2,ModalVideoPreview_templateObject_3,ModalVideoPreview_templateObject_4,videoControls_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},videoControls_assign=function(){return videoControls_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},videoControls_assign.apply(this,arguments)},videoControls_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},VideoControlsLayout=styled_components_browser_esm.Ay.div(videoControls_templateObject_1||(videoControls_templateObject_1=videoControls_makeTemplateObject(["\n display: flex;\n align-items: center;\n color: white;\n font-size: 14px;\n flex-direction: column;\n justify-content: space-between;\n"],["\n display: flex;\n align-items: center;\n color: white;\n font-size: 14px;\n flex-direction: column;\n justify-content: space-between;\n"]))),BottomControlsLayout=styled_components_browser_esm.Ay.div(videoControls_templateObject_2||(videoControls_templateObject_2=videoControls_makeTemplateObject(["\n margin-top: 6px;\n width: 100%;\n display: flex;\n justify-content: space-between;\n align-items: center;\n color: white;\n font-size: 14px;\n"],["\n margin-top: 6px;\n width: 100%;\n display: flex;\n justify-content: space-between;\n align-items: center;\n color: white;\n font-size: 14px;\n"]))),LeftControls=styled_components_browser_esm.Ay.div(videoControls_templateObject_3||(videoControls_templateObject_3=videoControls_makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: max-content;\n"],["\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: max-content;\n"]))),RightControls=styled_components_browser_esm.Ay.div(videoControls_templateObject_4||(videoControls_templateObject_4=videoControls_makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"],["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"]))),PlayButton=styled_components_browser_esm.Ay.div(videoControls_templateObject_5||(videoControls_templateObject_5=videoControls_makeTemplateObject(["\n width: ",";\n height: ",";\n cursor: pointer;\n margin-right: ",";\n transition: all 0.3s;\n\n &:hover {\n background: rgba(0, 0, 0, 0.2);\n border-radius: 2px;\n }\n"],["\n width: ",";\n height: ",";\n cursor: pointer;\n margin-right: ",";\n transition: all 0.3s;\n\n &:hover {\n background: rgba(0, 0, 0, 0.2);\n border-radius: 2px;\n }\n"])),(function(props){return"".concat(props.small?"16px":"20px")}),(function(props){return"".concat(props.small?"16px":"20px")}),(function(props){return"".concat(props.small?"6px":"8px")})),VolRange=styled_components_browser_esm.Ay.input(videoControls_templateObject_6||(videoControls_templateObject_6=videoControls_makeTemplateObject(["\n /* RESET */\n width: 74px;\n opacity: 1;\n visibility: visible;\n transition: all 0.4s;\n -webkit-appearance: none; /* Hides the slider so that custom slider can be made */\n background: transparent; /* Otherwise white in Chrome */\n\n &:focus {\n outline: none; /* Removes the blue border. We should probably do some kind of focus styling for accessibility reasons though. */\n }\n &::-ms-track {\n width: 96px;\n cursor: pointer;\n /* Hides the slider so custom styles can be added */\n background: transparent;\n border-color: transparent;\n color: transparent;\n height: ",";\n }\n\n &::-webkit-slider-runnable-track {\n width: 100%;\n height: ",";\n cursor: pointer;\n opacity: 0.75;\n background: ",";\n border-radius: ",";\n border: 0.2px solid transparent;\n }\n\n &::-webkit-slider-thumb {\n border: 1px solid transparent;\n height: ",";\n width: ",";\n border-radius: 50%;\n background: ",";\n cursor: pointer;\n -webkit-appearance: none;\n margin-top: -3px;\n }\n"],["\n /* RESET */\n width: 74px;\n opacity: 1;\n visibility: visible;\n transition: all 0.4s;\n -webkit-appearance: none; /* Hides the slider so that custom slider can be made */\n background: transparent; /* Otherwise white in Chrome */\n\n &:focus {\n outline: none; /* Removes the blue border. We should probably do some kind of focus styling for accessibility reasons though. */\n }\n &::-ms-track {\n width: 96px;\n cursor: pointer;\n /* Hides the slider so custom styles can be added */\n background: transparent;\n border-color: transparent;\n color: transparent;\n height: ",";\n }\n\n &::-webkit-slider-runnable-track {\n width: 100%;\n height: ",";\n cursor: pointer;\n opacity: 0.75;\n background: ",";\n border-radius: ",";\n border: 0.2px solid transparent;\n }\n\n &::-webkit-slider-thumb {\n border: 1px solid transparent;\n height: ",";\n width: ",";\n border-radius: 50%;\n background: ",";\n cursor: pointer;\n -webkit-appearance: none;\n margin-top: -3px;\n }\n"])),(function(props){return"".concat((props.small,"2px"))}),(function(props){return"".concat((props.small,"2px"))}),(function(props){return props.color}),(function(props){return"".concat((props.small,"2px"))}),(function(props){return"".concat((props.small,"6px"))}),(function(props){return"".concat((props.small,"6px"))}),(function(props){return props.color})),VolControls=styled_components_browser_esm.Ay.div(videoControls_templateObject_7||(videoControls_templateObject_7=videoControls_makeTemplateObject(["\n display: flex;\n width: 100px;\n align-items: center;\n overflow: hidden;\n transition: all 0.4s;\n margin-right: 8px;\n"],["\n display: flex;\n width: 100px;\n align-items: center;\n overflow: hidden;\n transition: all 0.4s;\n margin-right: 8px;\n"]))),VolumeIconWrapper=styled_components_browser_esm.Ay.div(videoControls_templateObject_8||(videoControls_templateObject_8=videoControls_makeTemplateObject(["\n height: ",";\n width: ",";\n cursor: pointer;\n &:hover {\n background: rgba(0, 0, 0, 0.2);\n border-radius: 2px;\n }\n"],["\n height: ",";\n width: ",";\n cursor: pointer;\n &:hover {\n background: rgba(0, 0, 0, 0.2);\n border-radius: 2px;\n }\n"])),(function(props){return"".concat(props.small?"15px":"20px")}),(function(props){return"".concat(props.small?"15px":"20px")})),TimeDisplay=styled_components_browser_esm.Ay.div(videoControls_templateObject_9||(videoControls_templateObject_9=videoControls_makeTemplateObject(["\n margin-right: 16px;\n color: ",";\n\n ","\n"],["\n margin-right: 16px;\n color: ",";\n\n ","\n"])),(function(props){return props.color}),(function(props){if(props.width&&props.width<330)return"font-size: 11px;"})),ControlsButton=styled_components_browser_esm.Ay.div(videoControls_templateObject_10||(videoControls_templateObject_10=videoControls_makeTemplateObject(["\n display: flex;\n justify-content: center;\n align-items: center;\n width: 20px;\n height: 20px;\n cursor: pointer;\n transition: all 0.3s;\n margin-left: 3px;\n border-radius: 5px;\n\n &:hover {\n background: rgba(255, 255, 255, 0.2);\n }\n\n ","\n"],["\n display: flex;\n justify-content: center;\n align-items: center;\n width: 20px;\n height: 20px;\n cursor: pointer;\n transition: all 0.3s;\n margin-left: 3px;\n border-radius: 5px;\n\n &:hover {\n background: rgba(255, 255, 255, 0.2);\n }\n\n ","\n"])),(function(props){if(props.active&&"#000000"===props.color)return"\n background-color: white;\n &:hover {\n background: white;\n }\n path {\n fill: ".concat(props.color,";\n }")})),PlaybackSpeed=styled_components_browser_esm.Ay.div(videoControls_templateObject_11||(videoControls_templateObject_11=videoControls_makeTemplateObject(["\n z-index: 200;\n overflow-y: auto;\n right: 40px;\n bottom: 60px;\n min-width: 110px;\n max-width: 160px;\n max-height: 160px;\n\n cursor: pointer;\n position: absolute;\n background-color: white;\n border: 1px solid #f7f8fa;\n box-sizing: border-box;\n box-shadow: 0px 6px 16px rgba(29, 30, 36, 0.06);\n border-radius: 5px;\n color: ",";\n display: flex;\n flex-direction: column;\n\n p {\n padding: 8px 24px;\n color: #9297a2;\n font-size: 14px;\n margin: 0;\n ","\n }\n\n div {\n display: flex;\n justify-content: space-between;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n color: #272a32;\n padding: 0 24px;\n ","\n path {\n fill: #272a32;\n }\n\n &:hover {\n background-color: ",";\n }\n }\n"],["\n z-index: 200;\n overflow-y: auto;\n right: 40px;\n bottom: 60px;\n min-width: 110px;\n max-width: 160px;\n max-height: 160px;\n\n cursor: pointer;\n position: absolute;\n background-color: white;\n border: 1px solid #f7f8fa;\n box-sizing: border-box;\n box-shadow: 0px 6px 16px rgba(29, 30, 36, 0.06);\n border-radius: 5px;\n color: ",";\n display: flex;\n flex-direction: column;\n\n p {\n padding: 8px 24px;\n color: #9297a2;\n font-size: 14px;\n margin: 0;\n ","\n }\n\n div {\n display: flex;\n justify-content: space-between;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n color: #272a32;\n padding: 0 24px;\n ","\n path {\n fill: #272a32;\n }\n\n &:hover {\n background-color: ",";\n }\n }\n"])),palette_primaryDarkBlue,(function(props){return props.width&&props.width<330?"font-size: 9px;\n \n padding: 8px 16px;":props.width&&props.width<500?"font-size: 11px;\n ":void 0}),(function(props){return props.width&&props.width<330?"font-size: 10px;\n ":props.width&&props.width<500?"font-size: 12px;\n ":void 0}),palette_lightgray40),PLAYBACK_SPEEDS=[{value:2,label:"2.0x"},{value:1.5,label:"1.5x"},{value:1.25,label:"1.25x"},{value:1,label:"1.0x"},{value:.75,label:"0.75x"},{value:.5,label:"0.5x"}],VideoControls=function(props){var isCdkEnviroment=(0,styled_components_browser_esm.DP)().isCdkEnviroment,isVideoPaused=props.isVideoPaused,isVideoMuted=props.isVideoMuted,togglePlay=props.togglePlay,handleMute=props.handleMute,handleFullScreen=props.handleFullScreen,_a=props.duration,duration=void 0===_a?0:_a,_b=props.currentTime,currentTime=void 0===_b?0:_b,handleVolumeControl=props.handleVolumeControl,volumeRange=props.volumeRange,playerIconsColor=props.playerIconsColor,playerBackgroundColor=props.playerBackgroundColor,setPlayBack=props.setPlayBack,isVisible=props.isVisible,small=props.small,videoRef=props.videoRef,scrub=props.scrub,hideControls=props.hideControls,showPlaybackSpeed=props.showPlaybackSpeed,setShowPlaybackSpeed=props.setShowPlaybackSpeed,_c=videoControls_read(react.useState(1),2),playbackSpeed=_c[0],setPlaybackSpeed=_c[1],formatTimeToString=function(time){var timeMinutes=Math.floor(time/60),timeMinutesString=timeMinutes.toString(),timeSeconds="".concat(Math.floor(time-60*timeMinutes));return 1===timeMinutesString.length&&(timeMinutesString="0".concat(timeMinutes)),1===timeSeconds.length&&(timeSeconds="0".concat(timeSeconds)),"".concat(timeMinutes,":").concat(timeSeconds)},currentTimeString=formatTimeToString(currentTime),volRangeRef=react.createRef(),volumeMultiplied=100*volumeRange;react.useEffect((function(){isVisible||setShowPlaybackSpeed(!1)}),[isVisible]);return(0,jsx_runtime.jsxs)(VideoControlsLayout,videoControls_assign({small},{children:[(0,jsx_runtime.jsx)(ProgressBar,{duration,currentTime,scrub,color:playerIconsColor,small}),(0,jsx_runtime.jsxs)(BottomControlsLayout,{children:[(0,jsx_runtime.jsxs)(LeftControls,{children:[(0,jsx_runtime.jsx)(PlayButton,videoControls_assign({small,onClick:togglePlay},{children:isVideoPaused?(0,jsx_runtime.jsx)(playButton,{color:playerIconsColor,width:20,height:20}):(0,jsx_runtime.jsx)(pauseButton,{color:playerIconsColor,width:20,height:20})})),!small&&(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsxs)(VolControls,{children:[(0,jsx_runtime.jsx)(VolumeIconWrapper,videoControls_assign({small,onClick:handleMute},{children:isVideoMuted?(0,jsx_runtime.jsx)(VolumeOffIcon,{color:playerIconsColor}):(0,jsx_runtime.jsx)(io_index_esm.Epr,{style:{color:playerIconsColor,fontSize:20}})})),(0,jsx_runtime.jsx)(VolRange,{ref:volRangeRef,"aria-label":"Volume Range",type:"range",min:"0",value:volumeMultiplied.toString(),onChange:function(event){return handleVolumeControl(event,volRangeRef)},max:"100",step:"1",color:playerIconsColor,small})]}),(0,jsx_runtime.jsxs)(TimeDisplay,videoControls_assign({width:videoRef.current&&videoRef.current.clientWidth,color:playerIconsColor},{children:[currentTimeString," / ",formatTimeToString(duration)]}))]})]}),!small&&(0,jsx_runtime.jsxs)(RightControls,{children:[(0,jsx_runtime.jsx)(ControlsButton,videoControls_assign({active:showPlaybackSpeed,color:playerBackgroundColor,onClick:function(){setShowPlaybackSpeed(!showPlaybackSpeed)}},{children:(0,jsx_runtime.jsx)(images_VectorIcon,{color:playerIconsColor})})),showPlaybackSpeed&&(0,jsx_runtime.jsxs)(PlaybackSpeed,videoControls_assign({width:videoRef.current&&videoRef.current.clientWidth},{children:[(0,jsx_runtime.jsx)("p",{children:"Playback Speed"}),PLAYBACK_SPEEDS.map((function(ps){return(0,jsx_runtime.jsxs)("div",videoControls_assign({onClick:function(){return rate=ps.value,setPlayBack&&setPlayBack(rate),setPlaybackSpeed(rate),void(hideControls&&hideControls());var rate}},{children:[(0,jsx_runtime.jsx)("span",{children:ps.label})," ",playbackSpeed==ps.value&&(0,jsx_runtime.jsx)(images_CheckmarkIcon,{width:videoRef.current&&videoRef.current.clientWidth<500?"16px":"20px",height:videoRef.current&&videoRef.current.clientWidth<500?"16px":"20px"})]}),ps.value)}))]})),(0,jsx_runtime.jsx)(ControlsButton,videoControls_assign({onClick:handleFullScreen},{children:(0,jsx_runtime.jsx)(md_index_esm.T$Z,{style:{color:playerIconsColor,fontSize:20}})})),isCdkEnviroment?(0,jsx_runtime.jsx)(images_CdkSmallLogo,{style:{marginLeft:4},fill:palette_white}):(0,jsx_runtime.jsx)(images_CovideoSmallLogo,{style:{marginLeft:4},fill:palette_white})]})]})]}))},VideoPlayer_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},VideoPlayer_assign=function(){return VideoPlayer_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},VideoPlayer_assign.apply(this,arguments)},VideoPlayer_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},VideoPlayer_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},VideoPlayer_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},PlayerLayout=styled_components_browser_esm.Ay.div(VideoPlayer_templateObject_2||(VideoPlayer_templateObject_2=VideoPlayer_makeTemplateObject(["\n box-sizing: border-box;\n overflow: overlay;\n display: flex;\n justify-content: center;\n padding-right: 0px;\n height: ",";\n width: ",";\n margin: ",";\n ","\n"],["\n box-sizing: border-box;\n overflow: overlay;\n display: flex;\n justify-content: center;\n padding-right: 0px;\n height: ",";\n width: ",";\n margin: ",";\n ","\n"])),(function(props){return props.height?props.height:"100%"}),(function(props){return props.width?props.width:""}),(function(props){return props.margin?props.margin:""}),(function(_a){return _a.disablePointerEvents&&(0,styled_components_browser_esm.AH)(VideoPlayer_templateObject_1||(VideoPlayer_templateObject_1=VideoPlayer_makeTemplateObject(["\n pointer-events: none;\n "],["\n pointer-events: none;\n "])))})),Figure=styled_components_browser_esm.Ay.figure(VideoPlayer_templateObject_3||(VideoPlayer_templateObject_3=VideoPlayer_makeTemplateObject(["\n border-radius: 4px;\n ","\n margin: 0;\n position: relative;\n height: 100%;\n /* TODO - check if this is ok */\n max-width: 800px;\n overflow: hidden;\n\n ","\n"],["\n border-radius: 4px;\n ","\n margin: 0;\n position: relative;\n height: 100%;\n /* TODO - check if this is ok */\n max-width: 800px;\n overflow: hidden;\n\n ","\n"])),(function(props){return props.borderBottomRadius?"\n border-bottom-left-radius: ".concat(props.borderBottomRadius,";\n border-bottom-right-radius: ").concat(props.borderBottomRadius,";\n "):""}),(function(props){return props.preventWideSize?"width: auto;":"\n width: 100%;\n ".concat(mediaQueryMinWidth.lg," {\n width: 720px;\n }\n ")})),FullscreenWrapper=(0,styled_components_browser_esm.Ay)(index_modern.m)(VideoPlayer_templateObject_4||(VideoPlayer_templateObject_4=VideoPlayer_makeTemplateObject(["\n width: 100%;\n position: relative;\n box-sizing: border-box;\n background-color: ",";\n"],["\n width: 100%;\n position: relative;\n box-sizing: border-box;\n background-color: ",";\n"])),(function(props){return props.backgroundColor?props.backgroundColor:""})),Video=styled_components_browser_esm.Ay.video(VideoPlayer_templateObject_5||(VideoPlayer_templateObject_5=VideoPlayer_makeTemplateObject(["\n border-radius: ",";\n position: relative;\n width: 100%;\n height: ",";\n object-fit: contain; /*object-fit: contain to fix the issue of vertical video SUS-687*/\n max-height: ",";\n"],["\n border-radius: ",";\n position: relative;\n width: 100%;\n height: ",";\n object-fit: contain; /*object-fit: contain to fix the issue of vertical video SUS-687*/\n max-height: ",";\n"])),(function(props){return props.borderBottomRadius||"4px"}),(function(props){return props.isFullScreen?"100%":props.height}),(function(props){return props.isFullScreen?"100%":"unset"})),Overlay=styled_components_browser_esm.Ay.div(VideoPlayer_templateObject_6||(VideoPlayer_templateObject_6=VideoPlayer_makeTemplateObject(["\n display: block;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: ",";\n z-index: 4;\n"],["\n display: block;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: ",";\n z-index: 4;\n"])),palette_whiteRgb85),Controls=styled_components_browser_esm.Ay.div(VideoPlayer_templateObject_7||(VideoPlayer_templateObject_7=VideoPlayer_makeTemplateObject(["\n transition: all 0.15s;\n position: absolute;\n opacity: ",";\n left: 0;\n right: 0;\n bottom: ",";\n background-color: ",";\n padding: ",";\n"],["\n transition: all 0.15s;\n position: absolute;\n opacity: ",";\n left: 0;\n right: 0;\n bottom: ",";\n background-color: ",";\n padding: ",";\n"])),(function(props){return props.isVisible?1:0}),(function(props){return props.isFullScreen?"0px":"7px"}),(function(props){return props.hex}),(function(props){return"".concat(props.small?"0px 2px 1px":"8px")})),VideoPlayer=function(props){var videoSource=props.videoSource,thumbnail=props.thumbnail,small=props.small,videoRef=props.videoRef,autoplay=props.autoplay,playlist=props.playlist,preventWideSize=props.preventWideSize,_a=props.hideContext,hideContext=void 0!==_a&&_a,_b=props.startWithControls,startWithControls=void 0===_b||_b,height=props.height,width=props.width,margin=props.margin,_c=props.disableControls,disableControls=void 0!==_c&&_c,borderBottomRadius=props.borderBottomRadius,FullscreenVideoWrapperBackgroundColor=props.FullscreenVideoWrapperBackgroundColor,setIsVideoLoading=props.setIsVideoLoading,setVideoDuration=props.setVideoDuration,setVideoIsProcessing=props.setVideoIsProcessing,colors=(0,styled_components_browser_esm.DP)().colors,playerBgColor=colors.primary[80],playerIcColor=colors.white[100],_d=VideoPlayer_read(react.useState(!0),2),isVideoPaused=_d[0],setIsVideoPaused=_d[1],_e=VideoPlayer_read(react.useState(!1),2),showPlaybackSpeed=_e[0],setShowPlaybackSpeed=_e[1],_f=VideoPlayer_read(react.useState(!1),2),isVideoMuted=_f[0],setIsVideoMuted=_f[1],_g=VideoPlayer_read(react.useState(1),2),volumeRange=_g[0],setVolumeRange=_g[1],_h=VideoPlayer_read(react.useState(0),2),duration=_h[0],setDuration=_h[1],_j=VideoPlayer_read(react.useState(0),2),currentTime=_j[0],setCurrentTime=_j[1],_k=VideoPlayer_read(react.useState(startWithControls),2),hasControls=_k[0],setHasControls=_k[1],_l=VideoPlayer_read(react.useState(!1),2),isError=_l[0],setIsError=_l[1],_m=VideoPlayer_read(react.useState(0),2),retryTimeout=_m[0],setRetryTimeout=_m[1],userData=useAuthorizationContext().userData,isAutomotive=checkIfAutomotive(userData),hasControlsRef=react.useRef(hasControls),playlistIndex=react.useRef(0),_o=VideoPlayer_read(react.useState(0),2),retryCount=_o[0],setRetryCount=_o[1],controlsRef=react.createRef(),togglePlay=function(){var currentVideo=videoRef.current;currentVideo&&(isVideoPaused?currentVideo.play():currentVideo.pause())},fullScreenHandle=(0,index_modern.V)();react.useEffect((function(){setTimeout((function(){return window.dispatchEvent(new Event("resize"))}),200)}),[fullScreenHandle.active]),react.useEffect((function(){var video=videoRef.current;if(video.textTracks.length&&video.textTracks[0]){for(var line=hasControls?-4:-1,cues=video.textTracks[0].cues,i=0;i<cues.length;i++)cues[i].line=line;video.textTracks[0].activeCues[0]&&(video.textTracks[0].activeCues[0].line=line)}}),[hasControls]);var handleDurationChange=function(){videoRef.current&&isFinite(videoRef.current.duration)&&(setDuration(videoRef.current.duration),setVideoDuration&&setVideoDuration(videoRef.current.duration))},handleError=function(){videoRef.current&&videoRef.current.networkState==HTMLMediaElement.NETWORK_NO_SOURCE&&!isError&&(console.log("error loading mp4"),setIsError(!0),null==setVideoIsProcessing||setVideoIsProcessing(!0))},handleLoadedMetadata=function(){setIsError(!1),null==setVideoIsProcessing||setVideoIsProcessing(!1),clearTimeout(retryTimeout),videoRef.current&&videoRef.current.duration===1/0&&(videoRef.current.currentTime=1e101,videoRef.current.ontimeupdate=function(){this.ontimeupdate=function(){},videoRef.current&&(videoRef.current.currentTime=0)})};react.useEffect((function(){setIsVideoLoading&&setIsVideoLoading(isError),isError&&setRetryCount(retryCount+1)}),[isError]),react.useEffect((function(){var _a;if(retryCount>0&&isError){clearTimeout(retryTimeout);var timeout=setTimeout(setRetryCount,1e3*retryCount,retryCount+1);setRetryTimeout(timeout),null===(_a=videoRef.current)||void 0===_a||_a.load()}}),[retryCount]),react.useEffect((function(){return videoRef.current&&(videoRef.current.addEventListener("durationchange",handleDurationChange,!0),videoRef.current.addEventListener("loadedmetadata",handleLoadedMetadata,!0),videoRef.current.addEventListener("error",handleError,!0),videoRef.current.addEventListener("pause",(function(){return setIsVideoPaused(!0)}),!0),videoRef.current.addEventListener("play",(function(){return setIsVideoPaused(!1)}),!0)),function(){videoRef.current&&(videoRef.current.removeEventListener("durationchange",handleDurationChange,!0),videoRef.current.removeEventListener("loadedmetadata",handleLoadedMetadata,!0),videoRef.current.removeEventListener("error",handleError,!0))}}),[videoRef,controlsRef]),react.useEffect((function(){var video=videoRef.current,controls=null==controlsRef?void 0:controlsRef.current;if(video&&controls&&!showPlaybackSpeed)return video.addEventListener("mouseenter",showControls),video.addEventListener("mouseleave",hideControls),controls.addEventListener("mouseenter",showControls),controls.addEventListener("mouseleave",hideControls),function(){video.removeEventListener("mouseenter",showControls),video.removeEventListener("mouseleave",hideControls),controls.removeEventListener("mouseenter",showControls),controls.removeEventListener("mouseleave",hideControls)}}),[videoRef,controlsRef,showPlaybackSpeed]);var hideControls=function(){videoRef.current&&(setHasControls(!1),hasControlsRef.current=!1)},showControls=function(){disableControls||(setHasControls(!0),hasControlsRef.current=!0)};react.useEffect((function(){playlist&&playlist.length>0&&(playlistIndex.current=0,setCurrentTime(0),setIsVideoPaused(!0))}),[playlist]),react.useEffect((function(){var handleTimeUpdate=function(){if(videoRef.current&&(setCurrentTime(videoRef.current.currentTime),playlistIndex&&playlist&&playlist[playlistIndex.current]&&videoRef.current.currentTime>=playlist[playlistIndex.current].endTime)){var videoEndEvent=new Event("ended");videoRef.current.dispatchEvent(videoEndEvent)}},handleVideoEnded=function(){if(videoRef.current&&playlist&&(playlistIndex.current++,playlistIndex.current<playlist.length&&playlist[playlistIndex.current].videoSource)){videoRef.current.poster=playlist[playlistIndex.current].autogeneratedThumbnail;var time="",start=playlist[playlistIndex.current].startTime,end=playlist[playlistIndex.current].endTime;(start||end)&&(time="#t=".concat(start||0).concat(end?","+end:""));var newSrc=(""+playlist[playlistIndex.current].videoSource).split("#t=")[0]+time;videoRef.current.src=newSrc,videoRef.current.play()}};return videoRef.current&&videoRef.current.addEventListener("timeupdate",handleTimeUpdate,!0),videoRef.current&&videoRef.current.addEventListener("ended",handleVideoEnded,!0),videoRef.current&&autoplay&&(videoRef.current.play(),setIsVideoPaused(!1)),function(){videoRef.current&&(videoRef.current.removeEventListener("timeupdate",handleTimeUpdate,!0),videoRef.current.removeEventListener("ended",handleVideoEnded,!0))}}),[videoRef]),react.useEffect((function(){var videoElement=videoRef.current;if(videoElement&&videoSource){return VideoPlayer_awaiter(void 0,void 0,void 0,(function(){return VideoPlayer_generator(this,(function(_a){try{videoElement.src=videoSource,videoElement.muted=!0,videoElement.oncanplay=function(){return VideoPlayer_awaiter(void 0,void 0,void 0,(function(){var playError_1;return VideoPlayer_generator(this,(function(_b){switch(_b.label){case 0:return _b.trys.push([0,3,,4]),autoplay?[4,videoElement.play()]:[3,2];case 1:_b.sent(),_b.label=2;case 2:return videoElement.muted=!1,[3,4];case 3:return playError_1=_b.sent(),console.error("Autoplay failed:",playError_1),[3,4];case 4:return[2]}}))}))},videoElement.load()}catch(error){console.error("Error in playVideo:",error)}return[2]}))})),function(){videoElement&&(videoElement.pause(),videoElement.src="")}}}),[videoSource]);var newColor=color_convert.hex.rgb(playerBgColor)||[];return(0,jsx_runtime.jsx)(PlayerLayout,VideoPlayer_assign({small,height,width,margin,disablePointerEvents:disableControls},{children:(0,jsx_runtime.jsx)(Figure,VideoPlayer_assign({small,preventWideSize,borderBottomRadius},{children:(0,jsx_runtime.jsxs)(FullscreenWrapper,VideoPlayer_assign({handle:fullScreenHandle,backgroundColor:FullscreenVideoWrapperBackgroundColor},{children:[(0,jsx_runtime.jsx)(Video,VideoPlayer_assign({onContextMenu:function(e){hideContext&&e.preventDefault()},poster:isError?"":thumbnail,preload:functions_isSafari?"auto":"metadata",ref:videoRef,onClick:togglePlay,isFullScreen:fullScreenHandle.active,height:height||"auto",borderBottomRadius,playsInline:!0,controls:!1},{children:(0,jsx_runtime.jsx)("source",{src:videoSource,type:"video/mp4"},retryCount+playlistIndex.current+videoSource)}),videoSource),isError&&(0,jsx_runtime.jsx)(Overlay,{children:(0,jsx_runtime.jsx)(LoadingIndicator,{height:"100%",isLoading:isError,text:"processing..."})}),!disableControls&&(0,jsx_runtime.jsx)(Controls,VideoPlayer_assign({ref:controlsRef,r:newColor[0],g:newColor[1],b:newColor[2],hex:playerBgColor,small,isVisible:hasControls,isFullScreen:fullScreenHandle.active},{children:(0,jsx_runtime.jsx)(VideoControls,{isVideoPaused,togglePlay,isVideoMuted,handleMute:function(){var currentVideo=videoRef.current;currentVideo&&(isVideoMuted?(setVolumeRange(1),setIsVideoMuted(!1),currentVideo.volume=1):(setVolumeRange(0),setIsVideoMuted(!0),currentVideo.volume=0))},handleFullScreen:function(){return fullScreenHandle.active?fullScreenHandle.exit():fullScreenHandle.enter()},setPlayBack:function(rate){videoRef.current.playbackRate=rate},setTranslate:function(){},duration,currentTime,handleVolumeControl:function(e,volumeRef){var volumeRefWidth=volumeRef.current&&volumeRef.current.offsetWidth,eventOffset=e.target.value;if(eventOffset>100&&(eventOffset=100),eventOffset<0&&(eventOffset=0),videoRef.current&&volumeRefWidth){var volume=Number((eventOffset/volumeRefWidth).toFixed(2));if(Math.floor(100*videoRef.current.volume)==e.target.valueAsNumber)return;setVolumeRange(volume),volume<0&&(volume=0,setVolumeRange(0)),volume>1&&(setVolumeRange(1),volume=1),0===volume&&setIsVideoMuted(!0),1!==volume&&setIsVideoMuted(!1),videoRef.current.volume=volume}},volumeRange,playerIconsColor:playerIcColor,small,scrub:function(e,progressRef){var progressElWidth=progressRef.current?progressRef.current.offsetWidth:640;if(videoRef.current){var scrubTime=e.nativeEvent.offsetX/progressElWidth*videoRef.current.duration;videoRef.current.currentTime=scrubTime}},playerBackgroundColor:playerBgColor,captionsEnabled:!1,captions:"",isVisible:hasControls,videoRef,isAutomotive,hideControls,setShowPlaybackSpeed,showPlaybackSpeed})}))]}))}))}))},ModalVideoPreview_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},ModalVideoPreview_assign=function(){return ModalVideoPreview_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},ModalVideoPreview_assign.apply(this,arguments)},ModalVideoPreview_Content=styled_components_browser_esm.Ay.div(ModalVideoPreview_templateObject_1||(ModalVideoPreview_templateObject_1=ModalVideoPreview_makeTemplateObject(["\n display: flex;\n flex-direction: column;\n align-items: center;\n"],["\n display: flex;\n flex-direction: column;\n align-items: center;\n"]))),CloseButtonWrap=styled_components_browser_esm.Ay.div(ModalVideoPreview_templateObject_2||(ModalVideoPreview_templateObject_2=ModalVideoPreview_makeTemplateObject(["\n background-color: ",";\n display: flex;\n justify-content: center;\n align-items: center;\n color: ",";\n height: 24px;\n width: 24px;\n position: absolute;\n z-index: 10;\n right: 4px;\n top: 4px;\n border: 1px solid #fff;\n border-radius: 4px;\n &:hover {\n opacity: 0.7;\n cursor: pointer;\n }\n"],["\n background-color: ",";\n display: flex;\n justify-content: center;\n align-items: center;\n color: ",";\n height: 24px;\n width: 24px;\n position: absolute;\n z-index: 10;\n right: 4px;\n top: 4px;\n border: 1px solid #fff;\n border-radius: 4px;\n &:hover {\n opacity: 0.7;\n cursor: pointer;\n }\n"])),palette_themeDark,palette_white),ModalVideoPreview_ModalItem=styled_components_browser_esm.Ay.div(ModalVideoPreview_templateObject_4||(ModalVideoPreview_templateObject_4=ModalVideoPreview_makeTemplateObject(["\n display: block;\n position: relative;\n background-color: black;\n\n min-width: 660px;\n max-width: 800px;\n\n ","\n"],["\n display: block;\n position: relative;\n background-color: black;\n\n min-width: 660px;\n max-width: 800px;\n\n ","\n"])),(function(_a){return _a.theme.containerWidth<=screenSizes_xs&&(0,styled_components_browser_esm.AH)(ModalVideoPreview_templateObject_3||(ModalVideoPreview_templateObject_3=ModalVideoPreview_makeTemplateObject(["\n width: calc(100vw - 30px);\n min-width: unset;\n max-width: unset;\n "],["\n width: calc(100vw - 30px);\n min-width: unset;\n max-width: unset;\n "])))})),ModalVideoPreview=function(_a){var handleModalClose=_a.handleModalClose,video=_a.video,videoRef=react.createRef();return(0,jsx_runtime.jsx)(modals_Modal_Modal,ModalVideoPreview_assign({maxHeight:"fit-content",onOutsideClick:handleModalClose},{children:(0,jsx_runtime.jsxs)(ModalVideoPreview_ModalItem,{children:[(0,jsx_runtime.jsx)(CloseButtonWrap,ModalVideoPreview_assign({title:"Close video preview",onClick:handleModalClose},{children:(0,jsx_runtime.jsx)(images_CloseIcon,{})})),(0,jsx_runtime.jsx)(ModalVideoPreview_Content,{children:(0,jsx_runtime.jsx)(VideoPlayer,{videoSource:video.videoSource,videoId:video.id,thumbnail:video.autogeneratedThumbnail,videoRef,autoplay:!0,height:"405px",width:"100%"})})]})}))};function pushToDataLayer(event){console.log("Pushing event to GTM dataLayer:",event),"undefined"!=typeof window&&Array.isArray(window.dataLayer)?window.dataLayer.push(event):console.warn("GTM dataLayer not found")}function trackInsertVideoMessage(_a){var video=_a.video,landing_page=_a.landing_page,call_to_actions=_a.call_to_actions,vin=_a.vin;pushToDataLayer({event:"covideo-event",event_name:"Insert Video Message",landing_page,call_to_actions,video_id:video.id,video_title:video.title,video_type:video.videoRequest.videoType,video_customer_name:video.videoRequest.customerName,video_length:video.videoLength,vin})}function trackVideoInteraction(video,video_action){var _a,_b,_c,_d,_e,_f;pushToDataLayer({event:"covideo-event",event_name:"Video Interaction",video_id:video.id,video_title:video.title,video_type:video.videoRequest.videoType,video_customer_name:video.videoRequest.customerName,video_length:video.videoLength,vehicle:null===(_b=null===(_a=video.videoRequest)||void 0===_a?void 0:_a.inventoryItem)||void 0===_b?void 0:_b.title,vin:null===(_d=null===(_c=video.videoRequest)||void 0===_c?void 0:_c.inventoryItem)||void 0===_d?void 0:_d.vin,stock_number:null===(_f=null===(_e=video.videoRequest)||void 0===_e?void 0:_e.inventoryItem)||void 0===_f?void 0:_f.stockNumber,price:17499,condition:"Used",engine:"3.5L Ti-VCT V6 (FFV)",make:"Ford",model:"Taurus",trim:"SEL 4dr Front-wheel Drive Sedan",year:2019,mileage:39231,exterior_color:"Red",interior_color:"Dune",transmission:"Automatic",video_action})}var VideoItem_templateObject_1,VideoItem_templateObject_2,VideoItem_templateObject_3,VideoItem_templateObject_4,VideoItem_templateObject_5,VideoItem_templateObject_6,VideoItem_templateObject_7,VideoItem_templateObject_8,VideoItem_templateObject_9,Search_templateObject_1,Search_templateObject_2,Search_templateObject_3,Search_templateObject_4,NoVideos_templateObject_1,NoVideos_templateObject_2,NoVideos_templateObject_3,NoVideos_templateObject_4,UserDropdown_templateObject_1,UserDropdown_templateObject_2,PageInfo_templateObject_1,VideoEmailStatus,VideoTypeSales,VideoType,VideoItem_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},VideoItem_assign=function(){return VideoItem_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},VideoItem_assign.apply(this,arguments)},VideoItem_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},VideoItem_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},VideoItem_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},VideoItem_spreadArray=function(to,from,pack){if(pack||2===arguments.length)for(var ar,i=0,l=from.length;i<l;i++)!ar&&i in from||(ar||(ar=Array.prototype.slice.call(from,0,i)),ar[i]=from[i]);return to.concat(ar||Array.prototype.slice.call(from))},Card=styled_components_browser_esm.Ay.div(VideoItem_templateObject_1||(VideoItem_templateObject_1=VideoItem_makeTemplateObject(["\n background: ",";\n box-shadow:\n 0px 0px 2px rgba(66, 79, 104, 0.08),\n 0px 4px 8px rgba(66, 79, 104, 0.03);\n border-radius: 6px;\n overflow: hidden;\n opacity: ",";\n &:hover {\n .small-insert-video-button {\n display: none;\n }\n .large-insert-video-button {\n display: flex;\n }\n }\n"],["\n background: ",";\n box-shadow:\n 0px 0px 2px rgba(66, 79, 104, 0.08),\n 0px 4px 8px rgba(66, 79, 104, 0.03);\n border-radius: 6px;\n overflow: hidden;\n opacity: ",";\n &:hover {\n .small-insert-video-button {\n display: none;\n }\n .large-insert-video-button {\n display: flex;\n }\n }\n"])),(function(_a){return _a.theme.colors.white[100]}),(function(_a){var opacity=_a.opacity;return null!=opacity?opacity:"1"})),Head=styled_components_browser_esm.Ay.div(VideoItem_templateObject_2||(VideoItem_templateObject_2=VideoItem_makeTemplateObject(["\n position: relative;\n aspect-ratio: 16 / 9;\n min-height: 100px;\n background-color: ",";\n"],["\n position: relative;\n aspect-ratio: 16 / 9;\n min-height: 100px;\n background-color: ",";\n"])),(function(_a){return _a.backgroundColor||"transparent"})),VideoItem_Content=styled_components_browser_esm.Ay.div(VideoItem_templateObject_3||(VideoItem_templateObject_3=VideoItem_makeTemplateObject(["\n background-color: ",";\n padding: 16px;\n display: flex;\n flex-direction: column;\n gap: 12px;\n"],["\n background-color: ",";\n padding: 16px;\n display: flex;\n flex-direction: column;\n gap: 12px;\n"])),(function(_a){return _a.theme.colors.white[100]})),VideoItem_Title=styled_components_browser_esm.Ay.div(VideoItem_templateObject_4||(VideoItem_templateObject_4=VideoItem_makeTemplateObject(["\n font-weight: 600;\n font-size: 14px;\n line-height: 20px;\n min-height: 40px;\n color: ",";\n background-color: ",";\n width: ",";\n border-radius: 6px;\n word-break: break-word;\n"],["\n font-weight: 600;\n font-size: 14px;\n line-height: 20px;\n min-height: 40px;\n color: ",";\n background-color: ",";\n width: ",";\n border-radius: 6px;\n word-break: break-word;\n"])),palette_gray100,(function(_a){return _a.backgroundColor||"transparent"}),(function(_a){return _a.width||"auto"})),VideoItem_Date=styled_components_browser_esm.Ay.div(VideoItem_templateObject_5||(VideoItem_templateObject_5=VideoItem_makeTemplateObject(["\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n display: flex;\n align-items: center;\n background-color: ",";\n width: ",";\n border-radius: 6px;\n"],["\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n display: flex;\n align-items: center;\n background-color: ",";\n width: ",";\n border-radius: 6px;\n"])),palette_gray80,(function(_a){return _a.backgroundColor||"transparent"}),(function(_a){return _a.width||"auto"})),Duration=styled_components_browser_esm.Ay.div(VideoItem_templateObject_6||(VideoItem_templateObject_6=VideoItem_makeTemplateObject(["\n position: absolute;\n left: 12px;\n bottom: 12px;\n background-color: ",";\n border-radius: 24px;\n color: ",";\n font-weight: 500;\n font-size: 12px;\n line-height: 16px;\n padding: 4px 8px;\n min-width: 50px;\n"],["\n position: absolute;\n left: 12px;\n bottom: 12px;\n background-color: ",";\n border-radius: 24px;\n color: ",";\n font-weight: 500;\n font-size: 12px;\n line-height: 16px;\n padding: 4px 8px;\n min-width: 50px;\n"])),palette_black40,(function(_a){return _a.theme.colors.white[100]})),VideoItem_ButtonsWrapper=styled_components_browser_esm.Ay.div(VideoItem_templateObject_7||(VideoItem_templateObject_7=VideoItem_makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n position: absolute;\n z-index: 1;\n padding: 8px;\n top: 0;\n width: 100%;\n"],["\n display: flex;\n justify-content: space-between;\n position: absolute;\n z-index: 1;\n padding: 8px;\n top: 0;\n width: 100%;\n"]))),LeftButtonsWrapper=styled_components_browser_esm.Ay.div(VideoItem_templateObject_8||(VideoItem_templateObject_8=VideoItem_makeTemplateObject(["\n display: flex;\n flex-direction: row;\n gap: 10px;\n"],["\n display: flex;\n flex-direction: row;\n gap: 10px;\n"]))),VideoItem_CheckboxWrapper=styled_components_browser_esm.Ay.div(VideoItem_templateObject_9||(VideoItem_templateObject_9=VideoItem_makeTemplateObject(["\n position: absolute;\n top: 10px;\n left: 10px;\n"],["\n position: absolute;\n top: 10px;\n left: 10px;\n"]))),VideoItem=function(_a){var _b,_c,_d,video=_a.video,isMerge=_a.isMerge,selectedVideosData=_a.selectedVideosData,setSelectedVideosData=_a.setSelectedVideosData,isCompanyVideo=(null==video?void 0:video.folder)===DEFAULT_FOLDER_NAMES_COMPANY,_e=useConfigurationContext(),showQuickshareFeature=_e.showQuickshareFeature,showVoiceoverFeature=_e.showVoiceoverFeature,showInsertFeature=_e.showInsertFeature,showAiAssistFeature=_e.showAiAssistFeature,env=_e.env,onVideoInsert=_e.onVideoInsert,userData=useAuthorizationContext().userData,isAutomotiveServiceRole=checkIfAutomotiveServiceRole(userData),isAutomotiveSalesRole=checkIfAutomotiveSalesRole(userData),markAsSent=getMarkAsSentValue(userData),isIMSEnabled=checkIsIMSEnabled(userData),isAutomotive=checkIfAutomotive(userData),history=(0,react_router.W6)(),_f=VideoItem_read((0,react.useState)(!1),2),isCopyLoading=_f[0],setIsCopyLoading=_f[1],_g=VideoItem_read((0,react.useState)(!1),2),isDownloadLoading=_g[0],setIsDownloadLoading=_g[1],_h=VideoItem_read((0,react.useState)(!1),2),showPreviewModal=_h[0],setShowPreviewModal=_h[1],_j=VideoItem_read((0,react.useState)(!1),2),showModalMarkAsSent=_j[0],setShowModalQuickShareMarkAsSent=_j[1],toast=useToastNotifications().toast,_k=useQuickShare({video,videoRequest:null==video?void 0:video.videoRequest,setShowModalQuickShareMarkAsSent}),onQuickShareMutationHandler=_k.onQuickShareMutationHandler,isQuickshareLoading=_k.isQuickshareLoading,onQuickShareButtonClick=_k.onQuickShareButtonClick,clientTime=video?function(time,userData,format){void 0===format&&(format="YYYY-MM-DD HH:mm:ss");var userTimeZone=userData.timeZone||Intl.DateTimeFormat().resolvedOptions().timeZone||dayjs_min_default().tz.guess(),videoDate=dayjs_min_default()(time,["M/DD/YYYY h:mm:ss A","M/DD/YYYY, h:mm:ss A","M/D/YYYY h:mm:ss A","M/D/YYYY, h:mm:ss A","MM/DD/YYYY"]),serverUtcOffset=-dayjs_min_default()().tz("America/New_York").utcOffset(),userTimezoneOffset=dayjs_min_default()().tz(userTimeZone).utcOffset(),utcDateTime=videoDate.add(serverUtcOffset,"minute");return dayjs_min_default()(utcDateTime).add(userTimezoneOffset,"minute").format(format)}(video.recordDate,userData,"MM/DD/YYYY hh:mm:ss A"):"";return video?(0,jsx_runtime.jsxs)(Card,{children:[(0,jsx_runtime.jsxs)(Head,VideoItem_assign({backgroundColor:palette_black},{children:[(0,jsx_runtime.jsx)(VideoItemThumbnail,{videoId:video.id,thumbnail:video.thumbnail,duration:video.videoLength||0,processing:video.processing,onClick:function(){setShowPreviewModal(!0)}}),!isMerge&&(0,jsx_runtime.jsxs)(VideoItem_ButtonsWrapper,{children:[(0,jsx_runtime.jsxs)(LeftButtonsWrapper,{children:[!isCompanyVideo&&(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[showInsertFeature&&(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{onClick:function(){trackVideoInteraction(video,"Send & Share"),history.push("/insert-video/".concat(null==video?void 0:video.id))},icon:(0,jsx_runtime.jsx)(io_index_esm.t50,{size:18}),variant:"white",iconPosition:"middle",size:"small",title:"Insert"}),showQuickshareFeature&&(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{onClick:function(){trackVideoInteraction(video,"Copy Video URL"),onQuickShareButtonClick({videoActivityType:VIDE0_ACTIVITY_TYPE.QUICKSHARE,toastType:"quickshare"})},icon:isQuickshareLoading?(0,jsx_runtime.jsx)(Spinner,{size:12}):(0,jsx_runtime.jsx)(io_index_esm.y40,{size:18}),disabled:isQuickshareLoading,variant:"white",title:"Copy Video",size:"small"}),showAiAssistFeature&&(0,jsx_runtime.jsx)(react_covideo_ai_assist_esm.LN,{defaultPromptType:PROMPT_TYPE.CRM_MESSAGE,handleSubmitGeneratedContent:function(content,url,thumbnail,markAsSentConfirmed){var payload={url:url||"",thumbnail:thumbnail||"",image:video.thumbnail||"",html:content,token};null==onVideoInsert||onVideoInsert(payload),setTimeout((function(){markAsSentConfirmed||markAsSent===MarkAsSentOptions_ALWAYS.value&&toast({message:"Video marked as Sent"})}),100),toast({message:"Inserting video..."})},handleOnCopySuccess:function(content,url,thumbnail,markAsSentConfirmed){setTimeout((function(){markAsSentConfirmed||markAsSent===MarkAsSentOptions_ALWAYS.value&&toast({message:"Video marked as Sent"})}),100),toast({message:"Link copied to clipboard!"})},margin:"0",iconColor:"gradient",videoId:video?video.id:"",defaultVin:(null===(_b=null==video?void 0:video.videoRequest)||void 0===_b?void 0:_b.vin)||"",token,userData:{customer:{business:userData.customer.business,hasCovideoMagic:"1"===(null===(_d=null===(_c=null==userData?void 0:userData.customer)||void 0===_c?void 0:_c.hasCovideoMagic)||void 0===_d?void 0:_d.toString()),markVideosAsSent:getMarkAsSentValue(userData)},firstName:userData.firstName,isAutomotiveSalesRole,isAutomotiveServiceRole,isIMSEnabled,isCompanyAdmin:userData.isCompanyAdmin,isAutomotive},aiAssistTheme:"branding",env,apiKey,variant:"white",size:"small"})]}),isCompanyVideo&&(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{onClick:function(){return VideoItem_awaiter(void 0,void 0,void 0,(function(){return VideoItem_generator(this,(function(_a){switch(_a.label){case 0:if(!video)return[2];setIsCopyLoading(!0),_a.label=1;case 1:return _a.trys.push([1,3,,4]),[4,(videoId=video.id,videosApi_awaiter(void 0,void 0,void 0,(function(){return videosApi_generator(this,(function(_a){switch(_a.label){case 0:return[4,config_EXPRESS_API.put("/videos/".concat(videoId,"/move"),{videoId,copy:!0,videoFolder:DEFAULT_FOLDER_NAMES_PRIMARY})];case 1:return[2,_a.sent().data]}}))})))];case 2:return _a.sent(),toast({message:"Video copied successfully."}),[3,4];case 3:return _a.sent(),toast({message:"Copy failed, please try again later."}),[3,4];case 4:return setIsCopyLoading(!1),[2]}var videoId}))}))},icon:isCopyLoading?(0,jsx_runtime.jsx)(Spinner,{size:12}):(0,jsx_runtime.jsx)(md_index_esm.KrV,{size:18}),disabled:isCopyLoading,variant:"white",title:"Copy to Primary",size:"small"}),(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{onClick:function(){return VideoItem_awaiter(void 0,void 0,void 0,(function(){return VideoItem_generator(this,(function(_a){switch(_a.label){case 0:if(!video)return[2];setIsDownloadLoading(!0),_a.label=1;case 1:return _a.trys.push([1,3,,4]),[4,(videoId=video.id,fileName="".concat(video.title,".mp4"),videosApi_awaiter(void 0,void 0,void 0,(function(){var response;return videosApi_generator(this,(function(_a){switch(_a.label){case 0:return[4,config_EXPRESS_API.get("/videos/".concat(videoId,"/download"),{responseType:"blob"})];case 1:return response=_a.sent(),[2,(0,FileSaver_min.saveAs)(new Blob([response.data],{type:"video/mp4"}),fileName)]}}))})))];case 2:return _a.sent(),[3,4];case 3:return _a.sent(),toast({message:"Download failed, please try again later."}),[3,4];case 4:return setIsDownloadLoading(!1),[2]}var videoId,fileName}))}))},title:"Download",icon:isDownloadLoading?(0,jsx_runtime.jsx)(Spinner,{size:12}):(0,jsx_runtime.jsx)(md_index_esm.E5v,{size:18}),disabled:isDownloadLoading,variant:"white",size:"small"})]})]}),showVoiceoverFeature&&!isCompanyVideo&&(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{title:"Voiceover",onClick:function(){trackVideoInteraction(video,"Voice Recorder"),history.push("/voiceover/".concat(video.id))},icon:(0,jsx_runtime.jsx)(io_index_esm.xO7,{size:18}),variant:"white",size:"small"})]}),isMerge&&(0,jsx_runtime.jsx)(VideoItem_CheckboxWrapper,{children:(0,jsx_runtime.jsx)(CheckboxInput,{width:"24px",checked:selectedVideosData.find((function(v){return v.id===video.id})),onChange:function(e){return function(e){var checked=e.target.checked;setSelectedVideosData(checked?VideoItem_spreadArray(VideoItem_spreadArray([],VideoItem_read(selectedVideosData),!1),[video],!1):selectedVideosData.filter((function(e){return e.id!=video.id})))}(e)}})})]})),(0,jsx_runtime.jsxs)(VideoItem_Content,{children:[(0,jsx_runtime.jsx)(VideoItem_Title,{children:video.title}),(0,jsx_runtime.jsxs)(VideoItem_Date,{children:[(0,jsx_runtime.jsx)(io_index_esm.aJu,{size:16,color:palette_gray40,style:{marginRight:6}}),clientTime]})]}),showModalMarkAsSent&&(0,jsx_runtime.jsx)(ModalQuickShareMarkAsSent,{markAsSentPayload:{toastType:"quickshare"},isQuickShareLoading:isQuickshareLoading,quickShareMarkAsSentHandler:onQuickShareMutationHandler,handleModalClose:function(){return VideoItem_awaiter(void 0,void 0,void 0,(function(){return VideoItem_generator(this,(function(_a){return setShowModalQuickShareMarkAsSent(!1),[2]}))}))}}),showPreviewModal&&(0,jsx_runtime.jsx)(ModalVideoPreview,{video,handleModalClose:function(){return setShowPreviewModal(!1)}})]}):(0,jsx_runtime.jsxs)(Card,VideoItem_assign({opacity:".3"},{children:[(0,jsx_runtime.jsx)(Head,VideoItem_assign({backgroundColor:palette_gray20},{children:(0,jsx_runtime.jsx)(Duration,{children:" "})})),(0,jsx_runtime.jsxs)(VideoItem_Content,{children:[(0,jsx_runtime.jsx)(VideoItem_Title,VideoItem_assign({backgroundColor:palette_gray20,width:"100%"},{children:" "})),(0,jsx_runtime.jsx)(VideoItem_Date,VideoItem_assign({backgroundColor:palette_gray20,width:"70%"},{children:" "}))]})]}))},Search_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},Search_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},SearchWrapper=styled_components_browser_esm.Ay.div(Search_templateObject_2||(Search_templateObject_2=Search_makeTemplateObject(["\n position: relative;\n width: 190px;\n ","\n"],["\n position: relative;\n width: 190px;\n ","\n"])),(function(_a){return _a.theme.containerWidth<screenSizes_cmd&&(0,styled_components_browser_esm.AH)(Search_templateObject_1||(Search_templateObject_1=Search_makeTemplateObject(["\n width: 100%;\n "],["\n width: 100%;\n "])))})),SearchIconWrapper=styled_components_browser_esm.Ay.div(Search_templateObject_3||(Search_templateObject_3=Search_makeTemplateObject(["\n position: absolute;\n left: 12px;\n top: 12px;\n color: ",";\n cursor: pointer;\n &:hover {\n color: ",";\n }\n"],["\n position: absolute;\n left: 12px;\n top: 12px;\n color: ",";\n cursor: pointer;\n &:hover {\n color: ",";\n }\n"])),palette_gray60,palette_gray100),ClearIconWrapper=styled_components_browser_esm.Ay.div(Search_templateObject_4||(Search_templateObject_4=Search_makeTemplateObject(["\n position: absolute;\n right: 12px;\n top: 12px;\n color: ",";\n cursor: pointer;\n &:hover {\n color: ",";\n }\n"],["\n position: absolute;\n right: 12px;\n top: 12px;\n color: ",";\n cursor: pointer;\n &:hover {\n color: ",";\n }\n"])),palette_gray60,palette_gray100),Search=function(_a){var prevSearch=_a.prevSearch,handleSearch=_a.handleSearch,containerWidth=useConfigurationContext().containerWidth,_b=Search_read((0,react.useState)(prevSearch||""),2),searchTerm=_b[0],setSearchTerm=_b[1];return(0,jsx_runtime.jsxs)(SearchWrapper,{children:[(0,jsx_runtime.jsx)(SearchIconWrapper,{children:(0,jsx_runtime.jsx)(io_index_esm.uG9,{onClick:function(){return handleSearch(searchTerm)},size:17})}),(0,jsx_runtime.jsx)(Input,{width:"100%",type:"text",padding:"8px 8px 8px 40px",value:searchTerm,placeholder:containerWidth>=screenSizes_mb?"Search videos...":"Search...",onKeyUp:function(e){"Enter"===e.key&&handleSearch(searchTerm)},onChange:function(e){setSearchTerm(e.currentTarget.value)}}),""!==searchTerm&&(0,jsx_runtime.jsx)(ClearIconWrapper,{children:(0,jsx_runtime.jsx)(md_index_esm.Tfw,{onClick:function(){return setSearchTerm(""),void handleSearch("")},size:17})})]})},NoVideos_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},NoVideos_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},NoVideos_spreadArray=function(to,from,pack){if(pack||2===arguments.length)for(var ar,i=0,l=from.length;i<l;i++)!ar&&i in from||(ar||(ar=Array.prototype.slice.call(from,0,i)),ar[i]=from[i]);return to.concat(ar||Array.prototype.slice.call(from))},VideosGrid=styled_components_browser_esm.Ay.div(NoVideos_templateObject_2||(NoVideos_templateObject_2=NoVideos_makeTemplateObject(["\n position: relative;\n display: grid;\n gap: 24px;\n margin: 24px 0;\n grid-template-columns: repeat(3, 1fr);\n z-index: 0;\n ","\n"],["\n position: relative;\n display: grid;\n gap: 24px;\n margin: 24px 0;\n grid-template-columns: repeat(3, 1fr);\n z-index: 0;\n ","\n"])),(function(_a){return _a.theme.containerWidth<screenSizes_xs&&(0,styled_components_browser_esm.AH)(NoVideos_templateObject_1||(NoVideos_templateObject_1=NoVideos_makeTemplateObject(["\n grid-template-columns: 1fr;\n "],["\n grid-template-columns: 1fr;\n "])))})),NoVideos_Text=styled_components_browser_esm.Ay.div(NoVideos_templateObject_4||(NoVideos_templateObject_4=NoVideos_makeTemplateObject(["\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1;\n font-weight: 600;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n ","\n"],["\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1;\n font-weight: 600;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n ","\n"])),palette_gray60,(function(_a){return _a.theme.containerWidth<screenSizes_xs&&(0,styled_components_browser_esm.AH)(NoVideos_templateObject_3||(NoVideos_templateObject_3=NoVideos_makeTemplateObject(["\n top: 32px;\n width: 100%;\n text-align: center;\n "],["\n top: 32px;\n width: 100%;\n text-align: center;\n "])))})),NoVideos=function(_a){var size=_a.size,message=_a.message;return(0,jsx_runtime.jsxs)(VideosGrid,{children:[(0,jsx_runtime.jsx)(NoVideos_Text,{children:message}),NoVideos_spreadArray([],NoVideos_read(Array(size)),!1).map((function(n,i){return(0,jsx_runtime.jsx)(VideoItem,{},i)}))]})},locationKeys_all=function(userId){return["LOCATION",userId]},getUserLocations_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},getUserLocations_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},useGetLocationsQuery=function(userId,enabled){var _a=(0,es.useQuery)(locationKeys_all(userId),(function(){return function(userId){return getUserLocations_awaiter(void 0,void 0,Promise,(function(){return getUserLocations_generator(this,(function(_a){switch(_a.label){case 0:return[4,config_EXPRESS_API.get("/locations/user/".concat(userId))];case 1:return[2,_a.sent().data]}}))}))}(userId)}),{enabled:!!userId&&enabled,refetchOnMount:!1,refetchOnWindowFocus:!1});return{data:_a.data||[],isLoading:_a.isLoading,refetch:_a.refetch}},signIntoLocation_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},signIntoLocation_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},signIntoLocation=function(_a){var locationId=_a.locationId;return signIntoLocation_awaiter(void 0,void 0,Promise,(function(){return signIntoLocation_generator(this,(function(_b){switch(_b.label){case 0:return[4,config_EXPRESS_API.post("/locations/sign-in",{locationId})];case 1:return[2,_b.sent().data]}}))}))},UserDropdown_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},UserDropdown_assign=function(){return UserDropdown_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},UserDropdown_assign.apply(this,arguments)},UserDropdown_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},UserDropdown_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},UserDropdown_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},UserDropdown_Wrapper=styled_components_browser_esm.Ay.div(UserDropdown_templateObject_1||(UserDropdown_templateObject_1=UserDropdown_makeTemplateObject(["\n position: relative;\n"],["\n position: relative;\n"]))),Menu=styled_components_browser_esm.Ay.div(UserDropdown_templateObject_2||(UserDropdown_templateObject_2=UserDropdown_makeTemplateObject(["\n position: absolute;\n cursor: pointer;\n top: 40px;\n min-height: 20px;\n background: pink;\n min-width: 100%;\n box-shadow:\n 0px 0px 4px rgba(66, 79, 104, 0.08),\n 0px 6px 12px rgba(66, 79, 104, 0.06);\n border-radius: 8px;\n background: ",";\n"],["\n position: absolute;\n cursor: pointer;\n top: 40px;\n min-height: 20px;\n background: pink;\n min-width: 100%;\n box-shadow:\n 0px 0px 4px rgba(66, 79, 104, 0.08),\n 0px 6px 12px rgba(66, 79, 104, 0.06);\n border-radius: 8px;\n background: ",";\n"])),palette_white),UserDropdown=(0,react.memo)((function(_a){var _b,_c,handleUpdateToken=_a.handleUpdateToken,_d=(0,styled_components_browser_esm.DP)(),colors=_d.colors,isCdkEnviroment=_d.isCdkEnviroment,_e=useConfigurationContext(),hasExternalJwt=_e.hasExternalJwt,reRender=_e.reRender,showMultiLocationFeature=_e.showMultiLocationFeature,_f=function(hasExternalJwt){return(0,es.useMutation)(signIntoLocation,{onSuccess:function(data){if(hasExternalJwt){var url=new URL(window.location.href);return url.searchParams.set("token",data.accessToken),void(window.location.href=url.toString())}config_updateToken(data.accessToken)},onError:function(err){console.log(err)}})}(hasExternalJwt),signIn=_f.mutateAsync,isChangingLocation=_f.isLoading,userData=useAuthorizationContext().userData,hasLocationsEnabled="1"===(null===(_c=null===(_b=null==userData?void 0:userData.customer)||void 0===_b?void 0:_b.hasMultiLocation)||void 0===_c?void 0:_c.toString()),locations=useGetLocationsQuery(parseInt(null==userData?void 0:userData.userId,10),showMultiLocationFeature&&hasLocationsEnabled).data,hasAccessToLocation=!!(locations&&locations.length&&locations.find((function(location){var _a,_b;return location.locationId.toString()===(null===(_b=null===(_a=null==userData?void 0:userData.customer)||void 0===_a?void 0:_a.locationId)||void 0===_b?void 0:_b.toString())}))),showMultiLocationPicker=showMultiLocationFeature&&hasLocationsEnabled&&hasAccessToLocation,_g=UserDropdown_read((0,react.useState)(!1),2),open=_g[0],setOpen=_g[1],ref=useOnClickOutside((function(){return setOpen(!1)})).ref,history=(0,react_router.W6)(),logout=function(){handleUpdateToken(""),function functions_clearCookies(){for(var name in config_COOKIE_NAMES)localStorage.removeItem(config_COOKIE_NAMES[name])}(),history.go(0)},name=userData.firstName||userData.lastName||"Welcome",currentLocation=(locations||[]).find((function(location){var _a;return(null===(_a=null==userData?void 0:userData.customer)||void 0===_a?void 0:_a.locationId)&&location.locationId.toString()===userData.customer.locationId.toString()})),locationOptions=locations.filter((function(location){return location.locationId!==(null==currentLocation?void 0:currentLocation.locationId)}));return(0,jsx_runtime.jsxs)(UserDropdown_Wrapper,UserDropdown_assign({ref},{children:[(0,jsx_runtime.jsx)(ButtonDropdown,{text:name,subtext:showMultiLocationPicker?null==currentLocation?void 0:currentLocation.name:"",backgroundColor:open?palette_black25:"transparent",borderColor:"transparent",textColor:"white",icon:(0,jsx_runtime.jsx)(io_index_esm.V4N,{size:18,color:"white"}),iconOther:open?(0,jsx_runtime.jsx)(io_index_esm.nxn,{}):(0,jsx_runtime.jsx)(io_index_esm.q2p,{}),onClick:function(){setOpen((function(prev){return!prev}))}}),open&&(0,jsx_runtime.jsxs)(Menu,{children:[showMultiLocationPicker&&(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:(locationOptions||[]).map((function(location){return(0,jsx_runtime.jsx)(ButtonDropdown,{text:location.name,textColor:"black",backgroundColor:"transparent",borderColor:"transparent",onClick:function(){return locationId=location.locationId,UserDropdown_awaiter(void 0,void 0,void 0,(function(){return UserDropdown_generator(this,(function(_a){switch(_a.label){case 0:return[4,signIn({locationId})];case 1:return _a.sent(),reRender(),[2]}}))}));var locationId},disabled:isChangingLocation},location.locationId)}))}),!hasExternalJwt&&(0,jsx_runtime.jsx)(ButtonDropdown,{text:"Log Out",textColor:isCdkEnviroment?colors.primary[100]:colors.danger[80],backgroundColor:"transparent",borderColor:"transparent",icon:(0,jsx_runtime.jsx)(md_index_esm.EyH,{size:18,color:isCdkEnviroment?colors.primary[100]:colors.danger[40]}),onClick:function(){return logout()},disabled:isChangingLocation})]})]}))})),PageInfo_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},PageInfo_Wrapper=styled_components_browser_esm.Ay.div(PageInfo_templateObject_1||(PageInfo_templateObject_1=PageInfo_makeTemplateObject(["\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n"],["\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n"])),palette_gray80),PageInfo=function(_a){var page=_a.page,size=_a.size,count=_a.count,from=page*size+1,to=page*size+size;return to>count&&(to=count),(0,jsx_runtime.jsxs)(PageInfo_Wrapper,{children:[from,"-",to," of ",count]})};!function(VideoEmailStatus){VideoEmailStatus.NoStatus="",VideoEmailStatus.NotSent="not_sent",VideoEmailStatus.Sent="sent",VideoEmailStatus.Watched="watched",VideoEmailStatus.Deleted="deleted"}(VideoEmailStatus||(VideoEmailStatus={})),function(VideoTypeSales){VideoTypeSales.NoType="",VideoTypeSales.Marketing="Marketing",VideoTypeSales.Prospecting="Prospecting",VideoTypeSales.RespondToInquiry="Respond to Inquiry",VideoTypeSales.ThanksForYourBusiness="Thanks For Your Business"}(VideoTypeSales||(VideoTypeSales={})),function(VideoType){VideoType.NoType="",VideoType.AdditionalRepair="Additional Repair",VideoType.RepairInquiry="Repair inquiry",VideoType.RegularService="Regular service",VideoType.ServiceReminder="Service reminder",VideoType.QuoteRequest="Quote request"}(VideoType||(VideoType={}));var PackageName;!function(PackageName){PackageName[PackageName.LEGACY=0]="LEGACY",PackageName[PackageName.FREE=1]="FREE",PackageName[PackageName.PRO=2]="PRO",PackageName[PackageName.TEAMS=3]="TEAMS",PackageName[PackageName.ENTERPRISE=4]="ENTERPRISE"}(PackageName||(PackageName={}));var useQueryState_assign=function(){return useQueryState_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},useQueryState_assign.apply(this,arguments)},useQueryState_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},initialState={data:null,error:null,loading:!0,progress:0},queryReducer=function(state,action){switch(action.type){case"REQUEST":return useQueryState_assign(useQueryState_assign({},state),{loading:!0,error:null});case"PROGRESS":return useQueryState_assign(useQueryState_assign({},state),{progress:Math.min(state.progress+(max=25,Math.floor(Math.random()*Math.floor(max))),100)});case"SUCCESS":return useQueryState_assign(useQueryState_assign({},state),{data:action.data,loading:!1,error:null,progress:100});case"FAILURE":return useQueryState_assign(useQueryState_assign({},state),{data:null,loading:!1,error:action.error,progress:100});default:return state}var max},useQueryFetch_assign=function(){return useQueryFetch_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},useQueryFetch_assign.apply(this,arguments)},useQueryFetch_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},useQueryFetch_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},useQueryFetch=function(_a){var method=_a.method,pathname=_a.pathname,params=_a.params,_b=_a.autoFetch,autoFetch=void 0!==_b&&_b,_c=_a.showToastMessage,showToastMessage=void 0===_c||_c,_d=function(init){var _a=useQueryState_read((0,react.useReducer)(queryReducer,init||initialState),2);return{state:_a[0],dispatch:_a[1]}}({data:null,error:"",loading:!1}),state=_d.state,dispatch=_d.dispatch,data=state.data,error=state.error,loading=state.loading,progress=state.progress,toast=useToastNotifications().toast,fetchData=function(requestConfig,id){return useQueryFetch_awaiter(void 0,void 0,void 0,(function(){var progressInterval,baseUrl,config;return useQueryFetch_generator(this,(function(_a){return dispatch({type:"REQUEST"}),progressInterval=setInterval((function(){dispatch({type:"PROGRESS"})}),200),(baseUrl=null==requestConfig?void 0:requestConfig.baseURL)||(baseUrl=apiExpress),config={url:pathname,baseURL:baseUrl,method:void 0!==method?method:"get",params},axios_default()(useQueryFetch_assign(useQueryFetch_assign(useQueryFetch_assign({},config),{headers:config_options.headers}),requestConfig)).then((function(response){var data=response.data,success=response.success;data&&data.message&&showToastMessage&&toast({title:data.message}),data.id&&(data.video_id=data.id),"patch"===method&&(Array.isArray(data)&&(data=data.length>0?"SUCCESS":success),data=!0===data?"SUCCESS":"ERROR"),id>=0&&(data.id=id,data.data&&(data.data.id=id)),dispatch({type:"SUCCESS",data}),clearInterval(progressInterval)})).catch((function(error){dispatch({type:"FAILURE",error:error.message}),showToastMessage&&toast({title:error.message}),clearInterval(progressInterval)})),[2]}))}))};return autoFetch&&null==data&&!1===loading&&!error&&fetchData(),{data,loading,error,fetchData,progress}},useCreateVideo=function(){var _a=useQueryFetch({pathname:""}),data=_a.data,error=_a.error,loading=_a.loading,fetchData=_a.fetchData;return{videoData:data||null,loading,error,fetch:function(data){fetchData({method:"post",url:"/videos",baseURL:apiExpress,data:{filename:data.filename,title:data.title}},data.hasOwnProperty("id")?data.id:void 0)},progress:_a.progress}},useEncodeVideo=function(){var _a=useQueryFetch({pathname:""}),data=_a.data,error=_a.error,loading=_a.loading,fetchData=_a.fetchData,progress=_a.progress;return{encodeData:data&&(data.data||data.jobId)||null,loading,error,fetch:function(data){var videoId=data.videoId;return fetchData({method:"post",url:"videos/".concat(videoId,"/encode"),baseURL:apiExpress})},progress}},usePresignedUrl=function(){var _a=useQueryFetch({}),data=_a.data,error=_a.error,loading=_a.loading,fetchData=_a.fetchData;return{presignedUrl:data,loading,error,fetch:function(data){fetchData({method:"get",url:"aws/signedurl?filename=".concat(data.fileName,"&filetype=").concat(data.type),baseURL:apiExpress},data.hasOwnProperty("id")?data.id:void 0)}}},ActionDispatchContext_assign=function(){return ActionDispatchContext_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},ActionDispatchContext_assign.apply(this,arguments)},ActionDispatchContext_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},ActionDispatchContext=(0,react.createContext)({}),ActionDispatchProvider=function(_a){var children=_a.children,_b=ActionDispatchContext_read((0,react.useState)({}),2),value={action:_b[0],setAction:_b[1]};return(0,jsx_runtime.jsx)(ActionDispatchContext.Provider,ActionDispatchContext_assign({value},{children}))},requestActionCreator=function(_a){return{type:_a.type,meta:_a.meta}},successActionCreator=function(_a){return{type:_a.type,payload:_a.payload,meta:_a.meta}},failureActionCreator=function(_a){var type=_a.type,payload=_a.payload,meta=_a.meta,_b=_a.error;return{type,payload,meta,error:void 0===_b||_b}},useS3Upload_assign=function(){return useS3Upload_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},useS3Upload_assign.apply(this,arguments)},useS3Upload_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},useS3Upload_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},useS3Upload_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar};function reducer(state,action){switch(action.type){case"FETCH_REQUEST":return useS3Upload_assign(useS3Upload_assign({},state),{loading:!0,error:null});case"FETCH_SUCCESS":return useS3Upload_assign(useS3Upload_assign({},state),{data:action.payload,loading:!1,error:null});case"FETCH_FAILURE":return useS3Upload_assign(useS3Upload_assign({},state),{loading:!1,error:action.payload});default:return state}}var useS3Upload_initialState={data:void 0,loading:!1,error:null},useS3Upload=function(){var _a=useS3Upload_read((0,react.useReducer)(reducer,useS3Upload_initialState),2),state=_a[0],dispatch=_a[1],error=state.error,loading=state.loading,data=state.data,toast=useToastNotifications().toast;!function(dispatch){var action=(0,react.useContext)(ActionDispatchContext).action;(0,react.useEffect)((function(){dispatch(action)}),[action,dispatch])}(dispatch);var uploadVideo=(0,react.useCallback)((function(uploadData){return useS3Upload_awaiter(void 0,void 0,void 0,(function(){var onUploadProgress,isFirefox,err_1;return useS3Upload_generator(this,(function(_a){switch(_a.label){case 0:dispatch(requestActionCreator({type:"FETCH_REQUEST"})),onUploadProgress=function(progressEvent){uploadData.onUploadProgress(progressEvent,uploadData.hasOwnProperty("id")?uploadData.id:void 0)},_a.label=1;case 1:return _a.trys.push([1,3,,4]),isFirefox=function(){var _a;return-1!==(null===(_a=null===navigator||void 0===navigator?void 0:navigator.userAgent)||void 0===_a?void 0:_a.indexOf("Firefox"))}(),[4,axios_default().put(uploadData.url,uploadData.file,{headers:{"content-type":!isFirefox&&uploadData.contentType?uploadData.contentType:uploadData.file.type},onUploadProgress})];case 2:return _a.sent(),dispatch(successActionCreator({type:"FETCH_SUCCESS",payload:{success:!0,id:uploadData.hasOwnProperty("id")?uploadData.id:void 0}})),[2];case 3:if((err_1=_a.sent())instanceof Error)throw toast({message:null==err_1?void 0:err_1.message}),dispatch(failureActionCreator({type:"FETCH_FAILURE",payload:"Something wen wrong"})),new Error(err_1.message);return[3,4];case 4:return[2]}}))}))}),[]);return{data,loading,error,uploadVideo}},useVideoTranscriptionStart_assign=function(){return useVideoTranscriptionStart_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},useVideoTranscriptionStart_assign.apply(this,arguments)},useVideoTranscriptionStart_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},useVideoTranscriptionStart_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},useVideoTranscriptionStart_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar};function useVideoTranscriptionStart_reducer(state,action){switch(action.type){case"FETCH_REQUEST":return useVideoTranscriptionStart_assign(useVideoTranscriptionStart_assign({},state),{loading:!0,error:null});case"FETCH_SUCCESS":return useVideoTranscriptionStart_assign(useVideoTranscriptionStart_assign({},state),{data:action.payload,loading:!1,error:null});case"FETCH_FAILURE":return useVideoTranscriptionStart_assign(useVideoTranscriptionStart_assign({},state),{data:void 0,loading:!1,error:action.payload});default:return state}}var add_g,useVideoTranscriptionStart=function(){var setAction=(0,react.useContext)(ActionDispatchContext).setAction,toast=useToastNotifications().toast,initialState={data:void 0,loading:!1,error:null,isValid:!1},_a=useVideoTranscriptionStart_read((0,react.useReducer)(useVideoTranscriptionStart_reducer,initialState),2),state=_a[0],dispatch=_a[1],data=state.data,error=state.error,loading=state.loading;return{start:function(videoId){return useVideoTranscriptionStart_awaiter(void 0,void 0,void 0,(function(){var response,err_1;return useVideoTranscriptionStart_generator(this,(function(_a){switch(_a.label){case 0:dispatch(requestActionCreator({type:"FETCH_REQUEST"})),_a.label=1;case 1:return _a.trys.push([1,3,,4]),[4,startTranscription(videoId)];case 2:return response=_a.sent(),dispatch(successActionCreator({type:"FETCH_SUCCESS",payload:response})),toast({title:"Transcription Started"}),[2,{data,loading:!1,error:null}];case 3:return err_1=_a.sent(),toast({message:err_1}),dispatch(failureActionCreator({type:"FETCH_FAILURE",payload:"Something went wrong"})),setAction({type:"START_VIDEO_TRANSCRIPTION"}),[2,Promise.reject({loading:!1,error:"Something went wrong"})];case 4:return[2]}}))}))},data,loading,error}};function add_extends(){return add_extends=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},add_extends.apply(null,arguments)}const add=function SvgAdd(props){return react.createElement("svg",add_extends({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24"},props),add_g||(add_g=react.createElement("g",{fill:"#272A32"},react.createElement("path",{id:"bqn2hmlmqa",d:"M18 13h-5v5c0 .55-.45 1-1 1s-1-.45-1-1v-5H6c-.55 0-1-.45-1-1s.45-1 1-1h5V6c0-.55.45-1 1-1s1 .45 1 1v5h5c.55 0 1 .45 1 1s-.45 1-1 1z"}))))};var AddIcon_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked};const images_AddIcon=(0,styled_components_browser_esm.Ay)(add)(AddIcon_templateObject_1||(AddIcon_templateObject_1=AddIcon_makeTemplateObject(["\n width: ",";\n height: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"])),(function(props){return props.width||"24px"}),(function(props){return props.height||"24px"}),(function(props){return props.color||"currentColor"}),(function(props){return props.opacity||"1"}));var AddIcon_templateObject_1,DragAndDrop_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},DragAndDrop_assign=function(){return DragAndDrop_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},DragAndDrop_assign.apply(this,arguments)},__values=function(o){var s="function"==typeof Symbol&&Symbol.iterator,m=s&&o[s],i=0;if(m)return m.call(o);if(o&&"number"==typeof o.length)return{next:function(){return o&&i>=o.length&&(o=void 0),{value:o&&o[i++],done:!o}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")},DragAndDrop_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},DragAndDropContainer=styled_components_browser_esm.Ay.div(DragAndDrop_templateObject_1||(DragAndDrop_templateObject_1=DragAndDrop_makeTemplateObject(["\n margin-top: ","px;\n text-align: center;\n width: ","px;\n max-width: 100%;\n margin-left: auto;\n margin-right: auto;\n height: ","px;\n background-color: ",";\n\n .file-exists {\n text-align: left;\n color: red;\n }\n\n .drag-drop-zone {\n display: block;\n width: ","px;\n max-width: 100%;\n height: ","px;\n border: 1px dashed ",";\n border-radius: 5px;\n color: ",";\n font-size: 16px;\n font-weight: 500;\n font-stretch: normal;\n font-style: normal;\n line-height: 1.5;\n box-sizing: border-box;\n\n input {\n background: none !important;\n border: none;\n padding: 0 !important;\n &:hover {\n cursor: pointer;\n text-decoration: underline;\n color: ",";\n }\n }\n }\n\n .drag-drop-zone.inside-drag-area {\n svg {\n opacity: 0.7;\n }\n }\n\n .drag-drop-zone.outside-drag-area {\n svg {\n opacity: 0.3;\n }\n }\n\n .dropped-files li {\n color: #07f;\n padding: 3px;\n text-align: left;\n font-weight: bold;\n }\n\n .file {\n display: none;\n }\n"],["\n margin-top: ","px;\n text-align: center;\n width: ","px;\n max-width: 100%;\n margin-left: auto;\n margin-right: auto;\n height: ","px;\n background-color: ",";\n\n .file-exists {\n text-align: left;\n color: red;\n }\n\n .drag-drop-zone {\n display: block;\n width: ","px;\n max-width: 100%;\n height: ","px;\n border: 1px dashed ",";\n border-radius: 5px;\n color: ",";\n font-size: 16px;\n font-weight: 500;\n font-stretch: normal;\n font-style: normal;\n line-height: 1.5;\n box-sizing: border-box;\n\n input {\n background: none !important;\n border: none;\n padding: 0 !important;\n &:hover {\n cursor: pointer;\n text-decoration: underline;\n color: ",";\n }\n }\n }\n\n .drag-drop-zone.inside-drag-area {\n svg {\n opacity: 0.7;\n }\n }\n\n .drag-drop-zone.outside-drag-area {\n svg {\n opacity: 0.3;\n }\n }\n\n .dropped-files li {\n color: #07f;\n padding: 3px;\n text-align: left;\n font-weight: bold;\n }\n\n .file {\n display: none;\n }\n"])),(function(props){return props.marginTop}),(function(props){return props.width}),(function(props){return props.height}),(function(props){return props.backgroundColor||palette_white}),(function(props){return props.width-2}),(function(props){return props.height}),palette_lightgray,palette_primaryDarkBlue,palette_secondaryBlue),TextComponent=styled_components_browser_esm.Ay.div(DragAndDrop_templateObject_2||(DragAndDrop_templateObject_2=DragAndDrop_makeTemplateObject(["\n height: 100%;\n width: 100%;\n float: left;\n line-height: 0.2;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n z-index: -1;\n background-color: ",";\n"],["\n height: 100%;\n width: 100%;\n float: left;\n line-height: 0.2;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n z-index: -1;\n background-color: ",";\n"])),(function(props){return props.backgroundColor?props.backgroundColor:props.isActive?"#f6f7f9":"#fff"})),DragAndDrop_ButtonContainer=styled_components_browser_esm.Ay.div(DragAndDrop_templateObject_3||(DragAndDrop_templateObject_3=DragAndDrop_makeTemplateObject(["\n svg {\n opacity: 1 !important;\n }\n"],["\n svg {\n opacity: 1 !important;\n }\n"]))),DragAndDrop_Text=styled_components_browser_esm.Ay.p(DragAndDrop_templateObject_4||(DragAndDrop_templateObject_4=DragAndDrop_makeTemplateObject(["\n width: 317px;\n margin: 0 0 21px;\n font-size: 16px;\n line-height: 1.5;\n text-align: center;\n color: ",";\n"],["\n width: 317px;\n margin: 0 0 21px;\n font-size: 16px;\n line-height: 1.5;\n text-align: center;\n color: ",";\n"])),palette_black_1_100);const components_DragAndDrop=function(_a){var _b=_a.accept,accept=void 0===_b?".csv, text/csv":_b,_c=_a.inputStyle,inputStyle=void 0===_c?{}:_c,onDrop=_a.onDrop,_d=_a.text,text=void 0===_d?"Drag and drop your files here or":_d,_e=_a.width,width=void 0===_e?528:_e,_f=_a.height,height=void 0===_f?100:_f,_g=_a.marginTop,marginTop=void 0===_g?0:_g,_h=_a.disabled,disabled=void 0!==_h&&_h,textStyle=_a.textStyle,backgroundColor=_a.backgroundColor,_j=_a.placeholder,placeholder=void 0===_j?"Browse files...":_j,_k=DragAndDrop_read(react.useReducer((function(state,action){var e_1,_a;switch(action.type){case"SET_DROP_DEPTH":return DragAndDrop_assign(DragAndDrop_assign({},state),{dropDepth:action.dropDepth});case"SET_IN_DROP_ZONE":return DragAndDrop_assign(DragAndDrop_assign({},state),{inDropZone:action.inDropZone});case"ADD_FILE_TO_LIST":var validFile=!0;try{for(var _b=__values(action.files),_c=_b.next();!_c.done;_c=_b.next()){var file=_c.value;validFile=accept.includes(file.name.substr(-4))}}catch(e_1_1){e_1={error:e_1_1}}finally{try{_c&&!_c.done&&(_a=_b.return)&&_a.call(_b)}finally{if(e_1)throw e_1.error}}return validFile?DragAndDrop_assign(DragAndDrop_assign({},state),{fileList:state.fileList.concat(action.files)}):state;default:return state}}),{dropDepth:0,inDropZone:!1,fileList:[]}),2),data=_k[0],dispatch=_k[1],browseFiles=function(){var fileInput=document.getElementById("file");fileInput&&fileInput.click&&fileInput.click()};return(0,jsx_runtime.jsx)(DragAndDropContainer,DragAndDrop_assign({width,height,marginTop,backgroundColor},{children:(0,jsx_runtime.jsx)("div",DragAndDrop_assign({className:data.inDropZone?"drag-drop-zone inside-drag-area":"drag-drop-zone outside-drag-area",onDrop:function(e){return onDrop(e)},onDragOver:function(e){return function(e){e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect="copy",dispatch({type:"SET_IN_DROP_ZONE",inDropZone:!0})}(e)},onDragEnter:function(e){return function(e){e.preventDefault(),e.stopPropagation(),dispatch({type:"SET_DROP_DEPTH",dropDepth:data.dropDepth+1})}(e)},onDragLeave:function(e){return function(e){e.preventDefault(),e.stopPropagation(),e.target&&e.target.id.includes("text-")||(dispatch({type:"SET_DROP_DEPTH",dropDepth:data.dropDepth-1}),dispatch({type:"SET_IN_DROP_ZONE",inDropZone:!1}))}(e)}},{children:(0,jsx_runtime.jsxs)(TextComponent,DragAndDrop_assign({id:"text-browse",isActive:data.inDropZone,backgroundColor},{children:[!data.inDropZone&&0===data.fileList.length&&(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(DragAndDrop_Text,DragAndDrop_assign({style:textStyle},{children:text})),data.inDropZone?(0,jsx_runtime.jsx)("input",{type:"button",value:"browse your files...",onClick:browseFiles}):(0,jsx_runtime.jsx)(DragAndDrop_ButtonContainer,{children:(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{text:placeholder,icon:(0,jsx_runtime.jsx)(images_AddIcon,{color:"#fff"}),disabled,onClick:browseFiles})})]}),data.inDropZone&&(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)("br",{}),(0,jsx_runtime.jsx)("p",DragAndDrop_assign({id:"text-drop"},{children:"Drop file here"}))]}),data.fileList[0]&&(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)("br",{}),(0,jsx_runtime.jsxs)("p",{children:[data.fileList[0][0].name," is ready"]})]}),(0,jsx_runtime.jsx)("input",{className:"file",id:"file",type:"file",style:inputStyle,accept,onChange:function(e){return onDrop(e)},disabled})]}))}))}))};var DragAndDrop_templateObject_1,DragAndDrop_templateObject_2,DragAndDrop_templateObject_3,DragAndDrop_templateObject_4,styles_templateObject_1,styles_templateObject_2,styles_templateObject_3,styles_templateObject_4,styles_templateObject_5,styles_templateObject_6,styles_templateObject_7,styles_templateObject_8,styles_templateObject_9,styles_templateObject_10,styles_templateObject_11,styles_templateObject_12,templateObject_13,templateObject_14,templateObject_15,MultipleUploadList_templateObject_1,View,styles_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},styles_Content=styled_components_browser_esm.Ay.div(styles_templateObject_1||(styles_templateObject_1=styles_makeTemplateObject(["\n min-height: 400px;\n position: relative;\n"],["\n min-height: 400px;\n position: relative;\n"]))),ContentBody=styled_components_browser_esm.Ay.div(styles_templateObject_2||(styles_templateObject_2=styles_makeTemplateObject(["\n font-size: 15px;\n color: ",";\n background-color: ",";\n\n display: flex;\n flex-direction: column;\n\n margin-top: 18px;\n padding: 20px 30px;\n\n min-height: 340px;\n max-height: 340px;\n overflow-y: auto;\n overflow-x: hidden !important;\n width: 500px;\n max-width: 100%;\n"],["\n font-size: 15px;\n color: ",";\n background-color: ",";\n\n display: flex;\n flex-direction: column;\n\n margin-top: 18px;\n padding: 20px 30px;\n\n min-height: 340px;\n max-height: 340px;\n overflow-y: auto;\n overflow-x: hidden !important;\n width: 500px;\n max-width: 100%;\n"])),palette_blackRgb75,palette_gray10),ContentFooter=styled_components_browser_esm.Ay.div(styles_templateObject_4||(styles_templateObject_4=styles_makeTemplateObject(["\n display: flex;\n justify-content: right;\n align-items: center;\n padding: 10px 20px;\n gap: 12px;\n\n ","\n"],["\n display: flex;\n justify-content: right;\n align-items: center;\n padding: 10px 20px;\n gap: 12px;\n\n ","\n"])),(function(_a){return _a.theme.containerWidth<screenSizes_mb&&(0,styled_components_browser_esm.AH)(styles_templateObject_3||(styles_templateObject_3=styles_makeTemplateObject(["\n justify-content: space-between;\n "],["\n justify-content: space-between;\n "])))})),UploadFieldContainer=styled_components_browser_esm.Ay.div(styles_templateObject_5||(styles_templateObject_5=styles_makeTemplateObject(["\n margin-bottom: 24px;\n"],["\n margin-bottom: 24px;\n"]))),FlexContainer=styled_components_browser_esm.Ay.div(styles_templateObject_6||(styles_templateObject_6=styles_makeTemplateObject(["\n display: flex;\n"],["\n display: flex;\n"]))),Skill=styled_components_browser_esm.Ay.div(styles_templateObject_7||(styles_templateObject_7=styles_makeTemplateObject(["\n width: 0%;\n color: white;\n background-color: transparent;\n height: 4px;\n text-align: right;\n font-size: 1px;\n border-radius: 15px;\n"],["\n width: 0%;\n color: white;\n background-color: transparent;\n height: 4px;\n text-align: right;\n font-size: 1px;\n border-radius: 15px;\n"]))),ProgressData=styled_components_browser_esm.Ay.div(styles_templateObject_9||(styles_templateObject_9=styles_makeTemplateObject(["\n width: 50%;\n color: black;\n padding: 1%;\n text-align: left;\n font-size: 16px;\n border-radius: 0px;\n\n ","\n"],["\n width: 50%;\n color: black;\n padding: 1%;\n text-align: left;\n font-size: 16px;\n border-radius: 0px;\n\n ","\n"])),(function(_a){return _a.theme.containerWidth<screenSizes_mb&&(0,styled_components_browser_esm.AH)(styles_templateObject_8||(styles_templateObject_8=styles_makeTemplateObject(["\n font-size: 15px;\n "],["\n font-size: 15px;\n "])))})),ProgressContainer=styled_components_browser_esm.Ay.div(styles_templateObject_10||(styles_templateObject_10=styles_makeTemplateObject(["\n display: flex;\n background: ",";\n"],["\n display: flex;\n background: ",";\n"])),palette_gray10),UploadData=styled_components_browser_esm.Ay.div(styles_templateObject_12||(styles_templateObject_12=styles_makeTemplateObject(["\n flex-grow: 1;\n color: black;\n padding: 1%;\n text-align: right;\n font-size: 16px;\n border-radius: 0px;\n\n ","\n"],["\n flex-grow: 1;\n color: black;\n padding: 1%;\n text-align: right;\n font-size: 16px;\n border-radius: 0px;\n\n ","\n"])),(function(_a){return _a.theme.containerWidth<screenSizes_mb&&(0,styled_components_browser_esm.AH)(styles_templateObject_11||(styles_templateObject_11=styles_makeTemplateObject(["\n font-size: 15px;\n "],["\n font-size: 15px;\n "])))})),UploadingHeader=styled_components_browser_esm.Ay.div(templateObject_14||(templateObject_14=styles_makeTemplateObject(["\n position: absolute;\n top: -47px;\n left: 0;\n padding: 0 32px;\n height: 30px;\n font-size: 18px;\n color: ",";\n background-color: white;\n\n ","\n"],["\n position: absolute;\n top: -47px;\n left: 0;\n padding: 0 32px;\n height: 30px;\n font-size: 18px;\n color: ",";\n background-color: white;\n\n ","\n"])),palette_gray100,(function(_a){return _a.theme.containerWidth<screenSizes_mb&&(0,styled_components_browser_esm.AH)(templateObject_13||(templateObject_13=styles_makeTemplateObject(["\n font-size: 16px;\n "],["\n font-size: 16px;\n "])))})),CancelContainer=styled_components_browser_esm.Ay.div(templateObject_15||(templateObject_15=styles_makeTemplateObject(["\n display: flex;\n height: 249px;\n padding: 32px;\n align-items: center;\n"],["\n display: flex;\n height: 249px;\n padding: 32px;\n align-items: center;\n"]))),MultipleUploadList_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},MultipleUploadList_assign=function(){return MultipleUploadList_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},MultipleUploadList_assign.apply(this,arguments)},MultipleUploadList_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},MultipleUploadList_spreadArray=function(to,from,pack){if(pack||2===arguments.length)for(var ar,i=0,l=from.length;i<l;i++)!ar&&i in from||(ar||(ar=Array.prototype.slice.call(from,0,i)),ar[i]=from[i]);return to.concat(ar||Array.prototype.slice.call(from))},ErrorMessage=styled_components_browser_esm.Ay.div(MultipleUploadList_templateObject_1||(MultipleUploadList_templateObject_1=MultipleUploadList_makeTemplateObject(["\n font-size: 14px;\n color: ",";\n height: 20px;\n margin-top: 15px;\n"],["\n font-size: 14px;\n color: ",";\n height: 20px;\n margin-top: 15px;\n"])),(function(_a){return _a.theme.colors.danger[100]})),MultipleUploadList=function(_a){var progress=_a.progress,uploadingData=_a.uploadingData,setUploadingData=_a.setUploadingData,uplVideo=[],uploadingArr=[],uploadingTotal=[],uploadActiveVideo=[],colors=(0,styled_components_browser_esm.DP)().colors,_b=MultipleUploadList_read(react.useState([{elementId:0,isTitleNotEmpty:!0}]),2),titleValidationArray=_b[0],setTitleValidationArray=_b[1];for(var x in uploadingData)uplVideo.push(uploadingData[x]),uploadingArr=(uploadActiveVideo=uplVideo.filter((function(ele){return 1===ele.showActiveVideo}))).filter((function(ele){return 1===ele.status})),uploadingTotal=uploadActiveVideo.reduce((function(total,obj){return obj.progressEvent.total+total}),0);var isUploadInProgress=function(ele){return ele.status>=1};return(0,jsx_runtime.jsxs)("div",{children:[!!progress&&(0,jsx_runtime.jsxs)(UploadingHeader,{children:[(0,jsx_runtime.jsx)("span",{children:(0,jsx_runtime.jsxs)("b",{children:[uploadingArr.length," of ",uploadActiveVideo.length]})})," videos uploading (",toMB(uploadingTotal)," MB)"]}),uplVideo.map((function(ele){return(0,jsx_runtime.jsxs)(UploadFieldContainer,{children:[" ",ele.showActiveVideo?(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsxs)(FlexContainer,MultipleUploadList_assign({style:MultipleUploadList_assign({},isUploadInProgress(ele)&&{flexDirection:"column"})},{children:[(0,jsx_runtime.jsx)(Input,{maxLength:100,type:"text",value:ele.title,readOnly:!!progress,width:"100%",onChange:function(e){return i=ele.id,title=e.target.value,titleValidationArray.filter((function(el){return el.elementId===i})).forEach((function(i){var index=titleValidationArray.indexOf(i);index>=0&&setTitleValidationArray(titleValidationArray.splice(index,1))})),setTitleValidationArray(MultipleUploadList_spreadArray(MultipleUploadList_spreadArray([],MultipleUploadList_read(titleValidationArray),!1),[{elementId:i,isTitleNotEmpty:!!title.trimStart()}],!1)),void setUploadingData((function(ud){var _a;return MultipleUploadList_assign(MultipleUploadList_assign({},ud),((_a={})[i]=MultipleUploadList_assign(MultipleUploadList_assign({},ud[i]),{title}),_a))}));var i,title}}),isUploadInProgress(ele)&&(0,jsx_runtime.jsxs)("div",MultipleUploadList_assign({style:{width:"100%",marginTop:"18px",backgroundColor:"white"}},{children:[(0,jsx_runtime.jsx)(Skill,{style:{width:ele.progressEvent.percentage+"%",backgroundColor:colors.primary[100]}}),(0,jsx_runtime.jsxs)(ProgressContainer,{children:[(0,jsx_runtime.jsx)(ProgressData,{children:(status=ele.status,0===status?"Waiting...":1===status?"Uploading...":"Encoding...")}),(0,jsx_runtime.jsx)(UploadData,{children:toMB(ele.progressEvent.loaded)+" MB/"+toMB(ele.progressEvent.total)+" MB"})]})]}))]})),titleValidationArray.map((function(element){return element.elementId!==ele.id||element.isTitleNotEmpty?(0,jsx_runtime.jsx)("div",{},"el-".concat(element.elementId)):(0,jsx_runtime.jsx)(ErrorMessage,{children:"Video title is required!"},"error-".concat(element.elementId))}))]}):""]},"Video-list-".concat(ele.id));var status}))]})},VideoUpload_assign=function(){return VideoUpload_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},VideoUpload_assign.apply(this,arguments)},VideoUpload_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},VideoUpload_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},VideoUpload_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar};!function(View){View[View.FORM=0]="FORM",View[View.UPLOADING=1]="UPLOADING",View[View.CREATE=2]="CREATE",View[View.ENCODE=3]="ENCODE"}(View||(View={}));var parseOptions_accept="video/*,.mkv";const videoUpload_VideoUpload=function(_a){var handleModalClose=_a.handleModalClose,onSuccess=_a.onSuccess,toast=useToastNotifications().toast,userData=useAuthorizationContext().userData,startTranscription=useVideoTranscriptionStart().start,isCdkEnviroment=(0,styled_components_browser_esm.DP)().isCdkEnviroment,_b=VideoUpload_read((0,react.useState)(View.FORM),2),currentView=_b[0],setCurrentView=_b[1],_c=VideoUpload_read((0,react.useState)({}),2),uploadingData=_c[0],setUploadingData=_c[1],_d=VideoUpload_read((0,react.useState)(!1),2),disableUpload=_d[0],setDisableUpload=_d[1],_e=VideoUpload_read((0,react.useState)(!1),2),isSubmitClicked=_e[0],setIsSubmitClicked=_e[1],_f=VideoUpload_read((0,react.useState)(!1),2),canceling=_f[0],setCanceling=_f[1],_g=VideoUpload_read((0,react.useState)(View.FORM),2),progress=_g[0],setProgress=_g[1],_h=VideoUpload_read((0,react.useState)([]),2),uploadedVideoArray=_h[0],setUploadedVideoArray=_h[1],_j=VideoUpload_read((0,react.useState)({loaded:0,total:0,percentage:0}),2),setUploadProgress=(_j[0],_j[1]),_k=usePresignedUrl(),presignedUrl=_k.presignedUrl,getPresignedUrl=_k.fetch,isLoadingUrl=_k.loading,urlError=_k.error,_l=useS3Upload(),uploadVideo=_l.uploadVideo,isUploading=_l.loading,uploadData=_l.data,uploadError=_l.error,_m=useCreateVideo(),createVideo=_m.fetch,isCreating=_m.loading,videoData=_m.videoData,createError=_m.error,_o=useEncodeVideo(),encodeVideo=_o.fetch,isEncoding=_o.loading,encodeData=_o.encodeData;(0,react.useEffect)((function(){if(!isLoadingUrl&&!urlError&&Object.keys(uploadingData).length){setCurrentView(View.UPLOADING),setProgress(View.UPLOADING);var id=(presignedUrl||{id:-1}).id;if(void 0===id)return;Object.keys(uploadingData).length&&(uploadingData[id].status=1,setUploadingData(uploadingData)),uploadVideo({url:presignedUrl.url,file:uploadingData[id].file,onUploadProgress,id:presignedUrl.id})}}),[presignedUrl]),(0,react.useEffect)((function(){if(!isUploading&&!uploadError&&uploadData&&Object.keys(uploadingData).length){var id=(uploadData||{id:-1}).id;if(void 0===id)return;Object.keys(uploadingData).length&&(uploadingData[id].status=2,setUploadingData(uploadingData));var data=uploadingData[id];setProgress(View.CREATE),createVideo({filename:data.file.name,title:data.title,id:uploadData.id})}}),[isUploading,uploadData]),(0,react.useEffect)((function(){currentView===View.FORM||uploadingData&&Object.keys(uploadingData).length||setCurrentView(View.FORM);var fileTitles=[],fileTitlesLength=[];Object.keys(uploadingData).forEach((function(id){fileTitles.push(!(!uploadingData[id].title||!uploadingData[id].title.trimStart())),fileTitlesLength.push(uploadingData[id].title.length>100)})),fileTitles.includes(!1)?setDisableUpload(!0):fileTitlesLength.includes(!0)?(toast({title:"Video title can not be more than 100 characters!"}),setDisableUpload(!0)):setDisableUpload(!1)}),[uploadingData]),(0,react.useEffect)((function(){if(!isCreating&&!createError&&videoData&&Object.keys(uploadingData).length){setProgress(View.ENCODE);var id=(videoData||{id:-1}).id;if(void 0===id)return;Object.keys(uploadingData).length&&(uploadingData[id].status=3,setUploadingData(uploadingData)),setUploadedVideoArray([Number(videoData.video_id)]),encodeVideo({videoId:videoData.video_id,customerId:userData.customerId})}}),[isCreating,videoData]),(0,react.useEffect)((function(){isEncoding||!encodeData||uploadedVideoArray.length!==Object.keys(uploadingData).length||Object.values(uploadingData).some((function(f){return f.status<3}))||(transcribeVideo(),onSuccess(uploadedVideoArray),handleModalClose())}),[isCreating,encodeData,uploadedVideoArray]);var handleCloseWithCancel=function(){if(progress===View.FORM)return handleModalClose();setCanceling(!0)},handleSubmit=function(){setIsSubmitClicked(!0),Object.keys(uploadingData).forEach((function(id){var file=uploadingData[id].file;getPresignedUrl({fileName:file.name,type:file.type,id:parseInt(id,10)})}))},onUploadProgress=function(e,id){var percentCompleted=Math.round(100*e.loaded/e.total);if(void 0!==id&&uploadingData[id]){var ud=VideoUpload_assign({},uploadingData);ud[id].progressEvent={loaded:Math.floor(e.loaded/1024),total:Math.floor(e.total/1024),percentage:percentCompleted},setUploadingData(ud),setUploadProgress({loaded:Math.floor(e.loaded/1024),total:Math.floor(e.total/1024),percentage:percentCompleted})}},transcribeVideo=function(){if(userData.autoTranscribe&&videoData&&videoData.id)try{setTimeout((function(){startTranscription(videoData.id)}),5e3)}catch(e){console.log(e)}},isUploadingData=!!Object.keys(uploadingData).length,SubmitButton=function(_a){var _b=_a.disabled,disabled=void 0!==_b&&_b,_c=_a.title,title=void 0===_c?"Upload":_c,_d=_a.onClick,onClick=void 0===_d?handleSubmit:_d;return(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{text:title,onClick,disabled})},uploadFormView=(0,jsx_runtime.jsxs)(styles_Content,{children:[(0,jsx_runtime.jsx)(ContentBody,VideoUpload_assign({style:VideoUpload_assign({},!isUploadingData&&{backgroundColor:"transparent",marginTop:0,maxHeight:"400px"})},{children:isUploadingData?(0,jsx_runtime.jsx)(MultipleUploadList,{uploadingData,setUploadingData,progress}):(0,jsx_runtime.jsx)(components_DragAndDrop,{onDrop:function(e){return VideoUpload_awaiter(void 0,void 0,void 0,(function(){var target;return VideoUpload_generator(this,(function(_a){switch(_a.label){case 0:return e.preventDefault(),e.stopPropagation(),(target=e.dataTransfer||e.target)&&target.files&&target.files.length?[4,(files=target.files,VideoUpload_awaiter(void 0,void 0,void 0,(function(){var _loop_1,i;return VideoUpload_generator(this,(function(_a){for(_loop_1=function(i){if(!/.*\.(avchd|swf|flv|mov|qt|wmv|mkv|m4v|m4p|mpv|mp2|mpe|mpg|ogg|mp4|avi|webm|mpeg)/i.test(files[i].name))return toast({title:"".concat(files[i].name," is of invalid type and won't be uploaded.")}),"continue";var filename=files[i].name.split("."),file_type="mkv"===filename[1]?"video/x-matroska":files[i].type,file=new File([files[i]],generateFileName(userData,filename[filename.length-1]),{type:file_type,lastModified:files[i].lastModified});setUploadingData((function(ud){var u=VideoUpload_assign({},ud),id=0;if(Object.keys(ud).length){var keys=Object.keys(ud);id=parseInt(keys[keys.length-1],10)+1}return u[id]={id,file,title:filename[0],progressEvent:{loaded:0,total:0,percentage:0},status:0,showActiveVideo:1},u}))},i=0;i<files.length;i++)_loop_1(i);return[2]}))})))]:[3,2];case 1:return _a.sent(),[3,3];case 2:toast({title:"Oops! Something went wrong, try again in a few moments"}),_a.label=3;case 3:return[2]}var files}))}))},marginTop:0,height:350,width:440,accept:parseOptions_accept})})),isUploadingData&&(0,jsx_runtime.jsxs)(ContentFooter,{children:[(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{text:"Cancel",variant:isCdkEnviroment?"text":"secondary",onClick:handleCloseWithCancel}),(0,jsx_runtime.jsx)(SubmitButton,{disabled:disableUpload||isSubmitClicked})]})]}),uploadingContent=(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(ContentBody,{children:(0,jsx_runtime.jsx)(MultipleUploadList,{uploadingData,setUploadingData,progress})}),(0,jsx_runtime.jsxs)(ContentFooter,VideoUpload_assign({style:{justifyContent:"right"}},{children:[(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{text:"Cancel",variant:isCdkEnviroment?"text":"secondary",onClick:handleCloseWithCancel}),(0,jsx_runtime.jsx)(SubmitButton,{disabled:!0})]}))]}),cancelingContent=(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(ContentBody,{children:(0,jsx_runtime.jsx)(CancelContainer,{children:"You will have to restart your video upload from the beginning if you cancel now. Are you sure you want to cancel this upload?"})}),(0,jsx_runtime.jsxs)(ContentFooter,{children:[(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{text:"Cancel Upload",variant:isCdkEnviroment?"text":"secondary",onClick:handleModalClose}),(0,jsx_runtime.jsx)(SubmitButton,{title:"Continue Upload",onClick:function(){return setCanceling(!1)}})]})]});return[uploadFormView,(0,jsx_runtime.jsx)(styles_Content,{children:canceling?cancelingContent:uploadingContent})][currentView]};var ModalUpload_templateObject_1,ModalUpload_templateObject_2,Library_templateObject_1,Library_templateObject_2,Library_templateObject_3,Library_templateObject_4,Library_templateObject_5,Library_templateObject_6,Library_templateObject_7,Library_templateObject_8,Library_templateObject_9,Library_templateObject_10,Library_templateObject_11,Library_templateObject_12,Label_templateObject_1,Login_templateObject_1,Login_templateObject_2,Login_templateObject_3,Login_templateObject_4,Login_templateObject_5,Login_templateObject_6,Login_templateObject_7,Login_templateObject_8,Login_templateObject_9,Login_templateObject_10,Login_templateObject_11,InsertVideoSettings_templateObject_1,InsertVideoSettings_templateObject_2,InsertVideoSettings_templateObject_3,InsertVideoSettings_templateObject_4,InsertVideoSettings_templateObject_5,InsertVideoSettings_templateObject_6,InsertVideoSettings_templateObject_7,VehicleSearch_templateObject_1,VehicleSearch_templateObject_2,VehicleSearch_templateObject_3,VehicleSearch_templateObject_4,VehicleSearch_templateObject_5,VehicleSearch_templateObject_6,VehicleSearch_templateObject_7,VehicleSearch_templateObject_8,VehicleSearch_templateObject_9,VehicleSearch_templateObject_10,VehicleSearch_templateObject_11,VehicleSearch_templateObject_12,VehicleSearch_templateObject_13,VideoPreviewTrack_templateObject_1,VideoPreviewTrack_templateObject_2,SliderRail_templateObject_1,SliderRail_templateObject_2,Handle_templateObject_1,Handle_templateObject_2,TimelineRange_templateObject_1,ModalUpload_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},ModalUpload_assign=function(){return ModalUpload_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},ModalUpload_assign.apply(this,arguments)},ModalUpload_Header=styled_components_browser_esm.Ay.div(ModalUpload_templateObject_1||(ModalUpload_templateObject_1=ModalUpload_makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 25px 30px 5px 30px;\n"],["\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 25px 30px 5px 30px;\n"]))),ModalUpload_Title=styled_components_browser_esm.Ay.div(ModalUpload_templateObject_2||(ModalUpload_templateObject_2=ModalUpload_makeTemplateObject(["\n font-weight: bold;\n font-size: 18px;\n"],["\n font-weight: bold;\n font-size: 18px;\n"]))),ModalUpload=function(_a){var handleModalClose=_a.handleModalClose,disabled=_a.disabled,onSuccess=_a.onSuccess;return(0,jsx_runtime.jsxs)(modals_Modal_Modal,ModalUpload_assign({disableFullScreen:!0},{children:[(0,jsx_runtime.jsxs)(ModalUpload_Header,{children:[(0,jsx_runtime.jsx)(ModalUpload_Title,{children:"Upload new video"}),(0,jsx_runtime.jsx)(CloseButton_CloseButton,{style:{position:"static",padding:0,height:"fit-content",width:"fit-content"},disabled,onClick:handleModalClose})]}),(0,jsx_runtime.jsx)(videoUpload_VideoUpload,{handleModalClose,onSuccess})]}))},Library_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},Library_assign=function(){return Library_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},Library_assign.apply(this,arguments)},Library_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},Library_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},Library_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},Library_spreadArray=function(to,from,pack){if(pack||2===arguments.length)for(var ar,i=0,l=from.length;i<l;i++)!ar&&i in from||(ar||(ar=Array.prototype.slice.call(from,0,i)),ar[i]=from[i]);return to.concat(ar||Array.prototype.slice.call(from))},Library_Wrapper=styled_components_browser_esm.Ay.div(Library_templateObject_1||(Library_templateObject_1=Library_makeTemplateObject(["\n background: ",";\n"],["\n background: ",";\n"])),palette_gray10),ActionBar=styled_components_browser_esm.Ay.div(Library_templateObject_3||(Library_templateObject_3=Library_makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n gap: 16px;\n ","\n"],["\n display: flex;\n justify-content: space-between;\n gap: 16px;\n ","\n"])),(function(_a){return _a.theme.containerWidth<screenSizes_cmd&&(0,styled_components_browser_esm.AH)(Library_templateObject_2||(Library_templateObject_2=Library_makeTemplateObject(["\n flex-direction: column;\n "],["\n flex-direction: column;\n "])))})),ActionBarSide=styled_components_browser_esm.Ay.div(Library_templateObject_5||(Library_templateObject_5=Library_makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: flex-start;\n gap: 8px;\n button {\n flex-shrink: 0;\n }\n flex-wrap: wrap;\n ","\n"],["\n display: flex;\n align-items: center;\n justify-content: flex-start;\n gap: 8px;\n button {\n flex-shrink: 0;\n }\n flex-wrap: wrap;\n ","\n"])),(function(_a){return _a.theme.containerWidth<screenSizes_cmd&&(0,styled_components_browser_esm.AH)(Library_templateObject_4||(Library_templateObject_4=Library_makeTemplateObject(["\n justify-content: flex-end;\n "],["\n justify-content: flex-end;\n "])))})),Navigation=styled_components_browser_esm.Ay.div(Library_templateObject_7||(Library_templateObject_7=Library_makeTemplateObject(["\n display: flex;\n gap: 8px;\n justify-content: flex-end;\n align-items: center;\n ","\n"],["\n display: flex;\n gap: 8px;\n justify-content: flex-end;\n align-items: center;\n ","\n"])),(function(_a){return _a.theme.containerWidth<screenSizes_xs&&(0,styled_components_browser_esm.AH)(Library_templateObject_6||(Library_templateObject_6=Library_makeTemplateObject(["\n width: 100%;\n "],["\n width: 100%;\n "])))})),FolderSelectWrapper=styled_components_browser_esm.Ay.div(Library_templateObject_9||(Library_templateObject_9=Library_makeTemplateObject(["\n width: 190px;\n ","\n"],["\n width: 190px;\n ","\n"])),(function(_a){return _a.theme.containerWidth<screenSizes_cmd&&(0,styled_components_browser_esm.AH)(Library_templateObject_8||(Library_templateObject_8=Library_makeTemplateObject(["\n width: 100%;\n "],["\n width: 100%;\n "])))})),Library_VideosGrid=styled_components_browser_esm.Ay.div(Library_templateObject_12||(Library_templateObject_12=Library_makeTemplateObject(["\n display: grid;\n gap: 24px;\n margin: 24px 0;\n grid-template-columns: repeat(3, 1fr);\n ","\n ","\n"],["\n display: grid;\n gap: 24px;\n margin: 24px 0;\n grid-template-columns: repeat(3, 1fr);\n ","\n ","\n"])),(function(_a){return _a.theme.containerWidth<screenSizes_xs&&(0,styled_components_browser_esm.AH)(Library_templateObject_10||(Library_templateObject_10=Library_makeTemplateObject(["\n grid-template-columns: 1fr 1fr;\n "],["\n grid-template-columns: 1fr 1fr;\n "])))}),(function(_a){return _a.theme.containerWidth<screenSizes_mb&&(0,styled_components_browser_esm.AH)(Library_templateObject_11||(Library_templateObject_11=Library_makeTemplateObject(["\n grid-template-columns: 1fr;\n "],["\n grid-template-columns: 1fr;\n "])))})),DEFAULT_FOLDER={folderId:-2,name:"Primary",isDeletable:!1},Library=function(_a){var handleUpdateToken=_a.handleUpdateToken,_b=(0,styled_components_browser_esm.DP)(),colors=_b.colors,isCdkEnviroment=_b.isCdkEnviroment,userData=useAuthorizationContext().userData,toast=useToastNotifications().toast,_c=useConfigurationContext(),showMergeFeature=(_c.hasExternalJwt,_c.showMergeFeature),showWheelsTVFeature=_c.showWheelsTVFeature,showLesaTVFeature=_c.showLesaTVFeature,showRecordFeature=_c.showRecordFeature,showUploadFeature=_c.showUploadFeature,showFolderFeature=_c.showFolderFeature,containerWidth=_c.containerWidth,onUploadButtonClick=_c.onUploadButtonClick,onRecordButtonClick=_c.onRecordButtonClick,_d=Library_read((0,react.useState)(!1),2),isMerge=_d[0],setIsMerge=_d[1],_e=Library_read((0,react.useState)([]),2),selectedVideosData=_e[0],setSelectedVideosData=_e[1],_f=Library_read((0,react.useState)(!1),2),openUploadModal=_f[0],setOpenUploadModal=_f[1],isAutomotive=checkIfAutomotive(userData),isAutomotiveSales=checkIfAutomotiveSalesRole(userData),_g=Library_read((0,react.useState)(0),2),uploadedVideoId=_g[0],setUploadedVideoId=_g[1],history=(0,react_router.W6)(),_h=Library_read((0,react.useState)({page:0,size:6,folderId:DEFAULT_FOLDER.folderId,searchQuery:""}),2),filter=_h[0],setFilter=_h[1],folders=(0,es.useQuery)("cds-folders",getFolders,{refetchOnWindowFocus:!1,staleTime:5e8,select:function(folders){var filteredFolders=Library_spreadArray([],Library_read(folders),!1);return userData.automotiveRole===AutomotiveRole.TECHNICIAN&&(filteredFolders=folders.filter((function(folder){return folder.name!==DEFAULT_FOLDER_NAMES_VAULT&&folder.name!==DEFAULT_FOLDER_NAMES_PRIVATE}))),filteredFolders}}).data,foldersDictionary=folders?(0,lodash.keyBy)(folders,"folderId"):{},currentFolder=foldersDictionary[filter.folderId]||DEFAULT_FOLDER,isSharedFolder=!!(null==currentFolder?void 0:currentFolder.access),folderName=foldersDictionary[filter.folderId]?foldersDictionary[filter.folderId].name:DEFAULT_FOLDER.name;isSharedFolder&&(folderName="".concat("~~shared~~").concat(filter.folderId)),folderName=folderName===ALL_FOLDERS_label?ALL_FOLDERS_value:folderName;var _j=(0,es.useQuery)(["cds-videos",filter],(function(){return Library_awaiter(void 0,void 0,void 0,(function(){return Library_generator(this,(function(_a){return[2,(props={folder:folderName,search:filter.searchQuery,size:filter.size,page:filter.page},videosApi_awaiter(void 0,void 0,void 0,(function(){var start,params,data,videos,_a,_b;return videosApi_generator(this,(function(_c){switch(_c.label){case 0:return start=(props.page||0)*(props.size||10),params={start,limit:props.size,search:props.search,folder:props.folder},[4,config_EXPRESS_API.get("/videos",{params})];case 1:return data=_c.sent().data,videos=(null===(_a=null==data?void 0:data.data)||void 0===_a?void 0:_a.videos)||(null==data?void 0:data.videos)||[],[2,{count:(null===(_b=null==data?void 0:data.data)||void 0===_b?void 0:_b.count)||(null==data?void 0:data.count)||0,videos}]}}))})))];var props}))}))}),{refetchOnWindowFocus:!1,enabled:!!(null==folders?void 0:folders.length)}),data=_j.data,showLoading=_j.isLoading,_k=data||{count:0,videos:[]},videoCount=_k.count,videos=_k.videos,options=(null==folders?void 0:folders.filter(Boolean).filter((function(f){return f.folderId!==ALL_FOLDERS_value})).map((function(f){return{value:f.folderId,label:f.name}})).concat([{value:ALL_FOLDERS_value,label:ALL_FOLDERS_label}]))||[],onCancelMerge=function(){setIsMerge(!1),localStorage.removeItem(config_COOKIE_NAMES.merge),setSelectedVideosData([])},onPageChange=function(direction){"left"===direction&&setFilter((function(prev){return Library_assign(Library_assign({},prev),{page:prev.page-1})})),"right"===direction&&setFilter((function(prev){return Library_assign(Library_assign({},prev),{page:prev.page+1})}))};(0,react.useEffect)((function(){var _a,userPackageId=null===(_a=userData.customer)||void 0===_a?void 0:_a.packageId;Number(userPackageId)!==PackageName.FREE&&Number(userPackageId)!==PackageName.PRO||(toast({message:"Please upgrade you account to use eLead integration."}),handleUpdateToken(""),history.go(0))}),[]),(0,react.useEffect)((function(){var cache=localStorage.getItem(config_COOKIE_NAMES.merge);if(cache)try{var selectedVideos=JSON.parse(cache)||[];setSelectedVideosData(selectedVideos),setIsMerge(!!selectedVideos.length)}catch(error){localStorage.removeItem(config_COOKIE_NAMES.merge)}}),[]),(0,react.useEffect)((function(){pushToDataLayer({event:"covideo-pageview",page_application:"CRM Video Lite",page_url:"https://video.connectcdk.com/embed/home",page_location:"Home",page_section:"Videos",user_id:userData.email,is_internal_user:userData.email.includes("cdk")||userData.email.includes("covideo")})}),[]),(0,react.useEffect)((function(){uploadedVideoId&&history.push("/preview-upload/".concat(uploadedVideoId))}),[uploadedVideoId]);var mergeDisabled=(null==currentFolder?void 0:currentFolder.name)===DEFAULT_FOLDER_NAMES_COMPANY;return(0,jsx_runtime.jsxs)(Library_Wrapper,{children:[(0,jsx_runtime.jsx)(TopBar,{left:(0,jsx_runtime.jsx)(UserDropdown,{handleUpdateToken}),center:(0,jsx_runtime.jsx)(Logo,{}),right:(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[showUploadFeature&&(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{onClick:onUploadButtonClick?function(){return onUploadButtonClick(token)}:function(){return setOpenUploadModal(!0)},variant:isCdkEnviroment?"white":"secondary",text:containerWidth>screenSizes_sm?"Upload":"",icon:(0,jsx_runtime.jsx)(md_index_esm.vpy,{size:22})}),showRecordFeature&&(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{onClick:onRecordButtonClick?function(){return onRecordButtonClick(token)}:function(){return history.push("/record/home")},text:containerWidth>screenSizes_sm?"Record":"",icon:(0,jsx_runtime.jsx)(md_index_esm.S5m,{size:22}),variant:isCdkEnviroment?"white":"red"})]})}),(0,jsx_runtime.jsxs)(Container,{children:[(0,jsx_runtime.jsxs)(ActionBar,{children:[(0,jsx_runtime.jsxs)(ActionBarSide,{children:[(0,jsx_runtime.jsx)(Search,{handleSearch:function(query){var searchQuery=query.toLowerCase();setFilter((function(prev){return Library_assign(Library_assign({},prev),{page:0,searchQuery})}))},prevSearch:filter.searchQuery}),showFolderFeature&&(0,jsx_runtime.jsx)(FolderSelectWrapper,{children:(0,jsx_runtime.jsx)(Dropdown,{options,value:{value:(null==currentFolder?void 0:currentFolder.folderId)||DEFAULT_FOLDER.folderId,label:(null==currentFolder?void 0:currentFolder.name)||DEFAULT_FOLDER.name},onChange:function(option){var _a,folderId;return(folderId=null!==(_a=null==option?void 0:option.value)&&void 0!==_a?_a:DEFAULT_FOLDER.folderId).toString()===(-1).toString()&&onCancelMerge(),void setFilter((function(prev){return Library_assign(Library_assign({},prev),{page:0,folderId})}))},isSearchable:!1,creatable:!1})})]}),(showWheelsTVFeature||showMergeFeature||showLesaTVFeature)&&(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[!isMerge&&(0,jsx_runtime.jsxs)(ActionBarSide,{children:[!!Number(userData.customer.lesaAccess)&&showLesaTVFeature&&(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{onClick:function(){return history.push("/lesa-tv")},icon:(0,jsx_runtime.jsx)(io_index_esm.Y0Z,{size:18}),text:"LesaTV",variant:"white"}),showWheelsTVFeature&&userData.wheelsTV&&(!isAutomotive||isAutomotiveSales)&&(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{onClick:function(){return history.push("/wheels-tv")},icon:(0,jsx_runtime.jsx)(io_index_esm.Y0Z,{size:18}),text:"WheelsTV",variant:"white"}),showMergeFeature&&(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{onClick:function(){return mergeDisabled?{}:setIsMerge(!0)},text:"Merge Videos",variant:"white",disabled:mergeDisabled})]}),isMerge&&(0,jsx_runtime.jsxs)(ActionBarSide,{children:[(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{onClick:onCancelMerge,text:"Cancel",variant:"white"}),(0,jsx_runtime.jsx)(react_covideo_common_esm.m_,{position:"top",hoverable:!(selectedVideosData.length>=2&&selectedVideosData.length<=9),children:(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{onClick:function(){localStorage.setItem(config_COOKIE_NAMES.merge,JSON.stringify(selectedVideosData));var videoIds=selectedVideosData.map((function(video){return video.id})).filter(Boolean).join(",");history.push("/merge/?videos=".concat(videoIds))},text:"Merge Videos",disabled:mergeDisabled||selectedVideosData.length<2||selectedVideosData.length>9}),popup:(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[selectedVideosData.length<2&&"Select 2+ videos to merge",selectedVideosData.length>9&&"Select maximum 9 videos"]}),extendStyles:{popup:Library_assign({left:40},isCdkEnviroment?{color:colors.white[100],background:colors.black[100]}:{})}})]})]})]}),(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[!showLoading&&!!videos.length&&(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(Library_VideosGrid,{children:videos.map((function(video,i){return(0,jsx_runtime.jsx)(VideoItem,{video,isMerge,selectedVideosData,setSelectedVideosData},video.id)}))}),(0,jsx_runtime.jsxs)(Navigation,{children:[(0,jsx_runtime.jsx)(PageInfo,{page:filter.page,size:filter.size,count:videoCount}),(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{onClick:function(){return onPageChange("left")},icon:(0,jsx_runtime.jsx)(md_index_esm.E_E,{size:22}),disabled:0===filter.page,variant:"white",size:"small"}),(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{onClick:function(){return onPageChange("right")},icon:(0,jsx_runtime.jsx)(md_index_esm.xVu,{size:22}),disabled:videos.length<filter.size||(filter.page+1)*filter.size>=videoCount,variant:"white",size:"small"})]})]}),showLoading&&(0,jsx_runtime.jsx)(NoVideos,{message:"Loading...",size:filter.size}),!showLoading&&!videos.length&&(0,jsx_runtime.jsx)(NoVideos,{message:"No videos match your query",size:filter.size})]})]}),openUploadModal&&(0,jsx_runtime.jsx)(ModalUpload,{handleModalClose:function(){return setOpenUploadModal(!1)},onSuccess:function(uploadedVideoIds){return Library_awaiter(void 0,void 0,void 0,(function(){return Library_generator(this,(function(_a){return uploadedVideoIds.length?(setUploadedVideoId(uploadedVideoIds[0]),[2]):[2]}))}))}})]})},Label_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},Label_assign=function(){return Label_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},Label_assign.apply(this,arguments)},Label_Text=styled_components_browser_esm.Ay.div(Label_templateObject_1||(Label_templateObject_1=Label_makeTemplateObject(["\n font-style: normal;\n font-weight: 500;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n"],["\n font-style: normal;\n font-weight: 500;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n"])),(function(props){return props.color||palette_gray60})),Label_Label=function(_a){var text=_a.text,color=_a.color;return(0,jsx_runtime.jsx)(Label_Text,Label_assign({color},{children:text}))},Login_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},Login_assign=function(){return Login_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},Login_assign.apply(this,arguments)},Login_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},Login_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},Login_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},LoginWrapper=styled_components_browser_esm.Ay.div(Login_templateObject_1||(Login_templateObject_1=Login_makeTemplateObject(["\n display: flex;\n justify-content: center;\n align-items: flex-start;\n padding: 50px 0;\n"],["\n display: flex;\n justify-content: center;\n align-items: flex-start;\n padding: 50px 0;\n"]))),LoginCard=styled_components_browser_esm.Ay.div(Login_templateObject_2||(Login_templateObject_2=Login_makeTemplateObject(["\n width: 400px;\n max-width: calc(100% - 32px);\n background: ",";\n box-shadow:\n 0px 0px 2px rgba(66, 79, 104, 0.08),\n 0px 4px 8px rgba(66, 79, 104, 0.03);\n border-radius: 16px;\n padding: 32px;\n"],["\n width: 400px;\n max-width: calc(100% - 32px);\n background: ",";\n box-shadow:\n 0px 0px 2px rgba(66, 79, 104, 0.08),\n 0px 4px 8px rgba(66, 79, 104, 0.03);\n border-radius: 16px;\n padding: 32px;\n"])),palette_white),Login_Form=styled_components_browser_esm.Ay.form(Login_templateObject_3||(Login_templateObject_3=Login_makeTemplateObject(["\n margin-top: 24px;\n display: block;\n"],["\n margin-top: 24px;\n display: block;\n"]))),FormGroup=styled_components_browser_esm.Ay.div(Login_templateObject_4||(Login_templateObject_4=Login_makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap: 8px;\n margin-bottom: 24px;\n"],["\n display: flex;\n flex-direction: column;\n gap: 8px;\n margin-bottom: 24px;\n"]))),Login_ButtonsWrapper=styled_components_browser_esm.Ay.div(Login_templateObject_5||(Login_templateObject_5=Login_makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n"],["\n display: flex;\n align-items: center;\n justify-content: space-between;\n"]))),Anchor=styled_components_browser_esm.Ay.a(Login_templateObject_6||(Login_templateObject_6=Login_makeTemplateObject(["\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n"],["\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n"])),(function(_a){return _a.theme.colors.primary[100]})),Login_Title=styled_components_browser_esm.Ay.div(Login_templateObject_7||(Login_templateObject_7=Login_makeTemplateObject(["\n text-align: center;\n color: ",";\n font-weight: 600;\n font-size: 18px;\n line-height: 24px;\n"],["\n text-align: center;\n color: ",";\n font-weight: 600;\n font-size: 18px;\n line-height: 24px;\n"])),(function(_a){return _a.theme.colors.primary[100]})),Subtitle=styled_components_browser_esm.Ay.div(Login_templateObject_8||(Login_templateObject_8=Login_makeTemplateObject(["\n text-align: center;\n color: ",";\n font-size: 12px;\n margin-top: 12px;\n"],["\n text-align: center;\n color: ",";\n font-size: 12px;\n margin-top: 12px;\n"])),(function(_a){return _a.theme.colors.primary[100]})),ErrorMsg=styled_components_browser_esm.Ay.div(Login_templateObject_9||(Login_templateObject_9=Login_makeTemplateObject(["\n border-radius: 6px;\n color: #721c24;\n background-color: #f8d7da;\n border: 1px solid #f5c6cb;\n padding: 12px 20px;\n margin-bottom: 16px;\n"],["\n border-radius: 6px;\n color: #721c24;\n background-color: #f8d7da;\n border: 1px solid #f5c6cb;\n padding: 12px 20px;\n margin-bottom: 16px;\n"]))),PasswordWrapper=styled_components_browser_esm.Ay.div(Login_templateObject_10||(Login_templateObject_10=Login_makeTemplateObject(["\n position: relative;\n"],["\n position: relative;\n"]))),PasswordToggleIconWrapper=styled_components_browser_esm.Ay.div(Login_templateObject_11||(Login_templateObject_11=Login_makeTemplateObject(["\n position: absolute;\n right: 12px;\n top: 50%;\n transform: translateY(-50%);\n color: ",";\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n &:hover {\n color: ",";\n }\n"],["\n position: absolute;\n right: 12px;\n top: 50%;\n transform: translateY(-50%);\n color: ",";\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n &:hover {\n color: ",";\n }\n"])),palette_gray60,palette_gray100),Login=function(_a){var handleUpdateToken=_a.handleUpdateToken,hasExternalJwt=useConfigurationContext().hasExternalJwt,_b=Login_read((0,react.useState)(""),2),username=_b[0],setUsername=_b[1],_c=Login_read((0,react.useState)(""),2),password=_c[0],setPassword=_c[1],_d=Login_read((0,react.useState)(""),2),errorMsg=_d[0],setErrorMsg=_d[1],_e=Login_read((0,react.useState)(!1),2),showPassword=_e[0],setShowPassword=_e[1],history=(0,react_router.W6)();return hasExternalJwt?(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(TopBar,{center:(0,jsx_runtime.jsx)(Logo,{})}),(0,jsx_runtime.jsx)(LoginWrapper,{children:(0,jsx_runtime.jsxs)(LoginCard,{children:[(0,jsx_runtime.jsx)(Login_Title,{children:"Login failed"}),(0,jsx_runtime.jsx)(Subtitle,{children:"External token invalid."})]})})]}):(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(TopBar,{center:(0,jsx_runtime.jsx)(Logo,{})}),(0,jsx_runtime.jsx)(LoginWrapper,{children:(0,jsx_runtime.jsxs)(LoginCard,{children:[(0,jsx_runtime.jsx)(Login_Title,{children:"Login to your account"}),(0,jsx_runtime.jsxs)(Login_Form,Login_assign({onSubmit:function(e){return Login_awaiter(void 0,void 0,void 0,(function(){var loginData,jwt;return Login_generator(this,(function(_a){switch(_a.label){case 0:e.preventDefault(),_a.label=1;case 1:return _a.trys.push([1,4,,5]),[4,login({username,password})];case 2:return loginData=_a.sent(),jwt=loginData.accessToken,[4,handleUpdateToken(jwt)];case 3:return _a.sent(),history.go(0),[3,5];case 4:return _a.sent(),setErrorMsg("Incorrect Login"),[3,5];case 5:return[2]}}))}))}},{children:[(0,jsx_runtime.jsxs)(FormGroup,{children:[(0,jsx_runtime.jsx)(Label_Label,{text:"Username"}),(0,jsx_runtime.jsx)(Input,{width:"100%",type:"text",value:username,placeholder:"Username",required:!0,onChange:function(e){return setUsername(e.target.value)}})]}),(0,jsx_runtime.jsxs)(FormGroup,{children:[(0,jsx_runtime.jsx)(Label_Label,{text:"Password"}),(0,jsx_runtime.jsxs)(PasswordWrapper,{children:[(0,jsx_runtime.jsx)(Input,{width:"100%",type:showPassword?"text":"password",value:password,placeholder:"Password",required:!0,padding:"8px 40px 8px 8px",onChange:function(e){return setPassword(e.target.value)}}),(0,jsx_runtime.jsxs)(PasswordToggleIconWrapper,Login_assign({onClick:function(){setShowPassword((function(prev){return!prev}))}},{children:[!showPassword&&(0,jsx_runtime.jsx)(io_index_esm.$3n,{size:22}),showPassword&&(0,jsx_runtime.jsx)(io_index_esm.M8f,{size:22})]}))]})]}),errorMsg&&(0,jsx_runtime.jsx)(ErrorMsg,{children:errorMsg}),(0,jsx_runtime.jsxs)(Login_ButtonsWrapper,{children:[(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{text:"Login",type:"submit",disabled:""===username||""===password}),(0,jsx_runtime.jsx)(Anchor,Login_assign({target:"_blank",href:"https://www.covideo.com/reset-password/"},{children:"Forgot password?"}))]})]}))]})})]})},InsertVideoSettings_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},InsertVideoSettings_assign=function(){return InsertVideoSettings_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},InsertVideoSettings_assign.apply(this,arguments)},InsertVideoSettings_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},InsertVideoSettings_spreadArray=function(to,from,pack){if(pack||2===arguments.length)for(var ar,i=0,l=from.length;i<l;i++)!ar&&i in from||(ar||(ar=Array.prototype.slice.call(from,0,i)),ar[i]=from[i]);return to.concat(ar||Array.prototype.slice.call(from))},InsertVideoSettings_Row=styled_components_browser_esm.Ay.div(InsertVideoSettings_templateObject_1||(InsertVideoSettings_templateObject_1=InsertVideoSettings_makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: ",";\n"],["\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: ",";\n"])),(function(props){return props.marginBottom?props.marginBottom:"0"})),CheckboxInputWrapper=styled_components_browser_esm.Ay.div(InsertVideoSettings_templateObject_2||(InsertVideoSettings_templateObject_2=InsertVideoSettings_makeTemplateObject(["\n display: flex;\n align-items: center;\n margin-bottom: 16px;\n"],["\n display: flex;\n align-items: center;\n margin-bottom: 16px;\n"]))),InsertVideoSettings_FormGroup=styled_components_browser_esm.Ay.div(InsertVideoSettings_templateObject_3||(InsertVideoSettings_templateObject_3=InsertVideoSettings_makeTemplateObject(["\n margin-bottom: ",";\n width: ",";\n"],["\n margin-bottom: ",";\n width: ",";\n"])),(function(props){return props.marginBottom?props.marginBottom:"16px"}),(function(props){return props.width?props.width:"auto"})),InsertVideoSettings_Label=styled_components_browser_esm.Ay.p(InsertVideoSettings_templateObject_4||(InsertVideoSettings_templateObject_4=InsertVideoSettings_makeTemplateObject(["\n font-weight: 500;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n margin: 0 0 8px 0;\n"],["\n font-weight: 500;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n margin: 0 0 8px 0;\n"])),palette_gray60),CheckboxLabel=styled_components_browser_esm.Ay.label(InsertVideoSettings_templateObject_5||(InsertVideoSettings_templateObject_5=InsertVideoSettings_makeTemplateObject(["\n margin-left: 12px;\n font-weight: normal;\n font-size: 16px;\n line-height: 24px;\n color: ",";\n"],["\n margin-left: 12px;\n font-weight: normal;\n font-size: 16px;\n line-height: 24px;\n color: ",";\n"])),palette_gray100),AddWebsiteButton=styled_components_browser_esm.Ay.a(InsertVideoSettings_templateObject_6||(InsertVideoSettings_templateObject_6=InsertVideoSettings_makeTemplateObject(["\n max-height: 24px;\n font-size: 15px;\n font-weight: 500;\n line-height: 1.6;\n text-align: right;\n color: ",";\n text-decoration: underline;\n &:hover {\n cursor: pointer;\n }\n"],["\n max-height: 24px;\n font-size: 15px;\n font-weight: 500;\n line-height: 1.6;\n text-align: right;\n color: ",";\n text-decoration: underline;\n &:hover {\n cursor: pointer;\n }\n"])),(function(_a){return _a.theme.colors.primary[100]})),NewWebsiteInput=styled_components_browser_esm.Ay.input(InsertVideoSettings_templateObject_7||(InsertVideoSettings_templateObject_7=InsertVideoSettings_makeTemplateObject(["\n width: 100%;\n border-radius: 4px;\n font-size: 15px;\n font-weight: 500;\n line-height: 1.6;\n border: solid 1px ",";\n outline: none;\n padding: 8px 12px;\n"],["\n width: 100%;\n border-radius: 4px;\n font-size: 15px;\n font-weight: 500;\n line-height: 1.6;\n border: solid 1px ",";\n outline: none;\n padding: 8px 12px;\n"])),palette_gray10),InsertVideoSettings=function(_a){var linksetsData=_a.linksetsData,linksetsLoading=_a.linksetsLoading,templatesData=_a.templatesData,templatesLoading=_a.templatesLoading,overlaysData=_a.overlaysData,overlaysLoading=_a.overlaysLoading,checkboxes=_a.checkboxes,selectedCheckboxes=_a.selectedCheckboxes,setSelectedCheckboxes=_a.setSelectedCheckboxes,insertVideoData=_a.insertVideoData,setInsertVideoData=_a.setInsertVideoData,_b=useConfigurationContext(),showCTAFeature=_b.showCTAFeature,showLandingPageFeature=_b.showLandingPageFeature,showReactionsAndCommentsFeature=_b.showReactionsFeature,_c=InsertVideoSettings_read((0,react.useState)([]),2),templateOptions=_c[0],setTemplateOptions=_c[1],_d=InsertVideoSettings_read((0,react.useState)([]),2),websitesOptions=_d[0],setWebsitesOptions=_d[1],_e=InsertVideoSettings_read((0,react.useState)([]),2),linksetOptions=_e[0],setLinksetOptions=_e[1],_f=InsertVideoSettings_read((0,react.useState)(!1),2),newWebsiteSelected=_f[0],setNewWebsiteSelected=_f[1],isWebsiteOverlaySelected=-1===insertVideoData.templateId;(0,react.useEffect)((function(){!newWebsiteSelected&&websitesOptions.length&&setInsertVideoData(InsertVideoSettings_assign(InsertVideoSettings_assign({},insertVideoData),{overlayId:websitesOptions[0].value}))}),[newWebsiteSelected]),(0,react.useEffect)((function(){setTemplateOptions((templatesData||[]).map((function(_a){return{value:_a.id,label:_a.title,typeId:_a.typeId}})))}),[templatesData]),(0,react.useEffect)((function(){setWebsitesOptions((overlaysData||[]).map((function(_a){var id=_a.id,title=_a.title;return{value:id.toString(),label:title}})))}),[overlaysData]);var setWebsite=(0,lodash.debounce)((function(value){setInsertVideoData(InsertVideoSettings_assign(InsertVideoSettings_assign({},insertVideoData),isWebsiteOverlaySelected?{overlayId:value}:{linksetId:value}))}),1e3);(0,react.useEffect)((function(){var DefaultArray=[{value:"-1",label:"None"}];DefaultArray=linksetsData.every((function(key){return"-1"!==key.id}))?DefaultArray.concat((linksetsData||[]).map((function(_a){var id=_a.id,title=_a.title;return{value:id.toString(),label:title}}))):(linksetsData||[]).map((function(_a){var id=_a.id,title=_a.title;return{value:id.toString(),label:title}})),setLinksetOptions(DefaultArray)}),[linksetsData]),react.useEffect((function(){-1!==insertVideoData.templateId&&setNewWebsiteSelected(!1),websitesOptions.length<=0&&setWebsitesOptions([{value:"",label:""}])}),[isWebsiteOverlaySelected]);var selectedLandingPage=templateOptions.find((function(o){return o.value===insertVideoData.templateId})),isQuotibleSelected=20===(null==selectedLandingPage?void 0:selectedLandingPage.typeId);return(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[showLandingPageFeature&&(0,jsx_runtime.jsx)(InsertVideoSettings_Row,{children:(0,jsx_runtime.jsxs)(InsertVideoSettings_FormGroup,InsertVideoSettings_assign({width:"100%"},{children:[(0,jsx_runtime.jsx)(InsertVideoSettings_Label,{children:"Landing Page"}),(0,jsx_runtime.jsx)(Dropdown,{value:selectedLandingPage,options:templateOptions,onChange:function(option){return null!==option&&setInsertVideoData(InsertVideoSettings_assign(InsertVideoSettings_assign({},insertVideoData),{templateId:parseInt(option.value)}))},isLoading:templatesLoading,isSearchable:!0,creatable:!1})]}))}),isQuotibleSelected||templatesLoading?null:(showCTAFeature||isWebsiteOverlaySelected)&&(0,jsx_runtime.jsx)(InsertVideoSettings_Row,{children:(0,jsx_runtime.jsxs)(InsertVideoSettings_FormGroup,InsertVideoSettings_assign({width:"100%",marginBottom:"35px"},{children:[(0,jsx_runtime.jsxs)(InsertVideoSettings_Row,{children:[(0,jsx_runtime.jsx)(InsertVideoSettings_Label,{children:isWebsiteOverlaySelected?"Websites":"CTAs"}),isWebsiteOverlaySelected&&(0,jsx_runtime.jsx)(AddWebsiteButton,InsertVideoSettings_assign({onClick:function(){return setNewWebsiteSelected((function(prev){return!prev}))}},{children:newWebsiteSelected?"Use Existing":"Add New"}))]}),!newWebsiteSelected&&(0,jsx_runtime.jsx)(Dropdown,{"aria-label":"CTA",className:"dropdown",value:isWebsiteOverlaySelected?websitesOptions.find((function(o){return o.value==insertVideoData.overlayId})):linksetOptions.find((function(o){return o.value==insertVideoData.linksetId})),isClearable:isWebsiteOverlaySelected,placeholder:isWebsiteOverlaySelected?"No Websites":"No CTAs",options:isWebsiteOverlaySelected?websitesOptions:linksetOptions,onChange:function(selectedItem){if(selectedItem)return setInsertVideoData(InsertVideoSettings_assign(InsertVideoSettings_assign({},insertVideoData),isWebsiteOverlaySelected?{overlayId:selectedItem.value}:{linksetId:selectedItem.value}))},isLoading:isWebsiteOverlaySelected?overlaysLoading:linksetsLoading,isSearchable:!0,creatable:!1}),isQuotibleSelected||templatesLoading?null:newWebsiteSelected&&(0,jsx_runtime.jsx)(NewWebsiteInput,{type:"text",placeholder:"Enter website",onChange:function(e){setWebsite(e.target.value)}})]}))}),isQuotibleSelected||templatesLoading?null:!!checkboxes.length&&(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:(0,jsx_runtime.jsx)(InsertVideoSettings_FormGroup,InsertVideoSettings_assign({width:"100%",marginBottom:"15px"},{children:checkboxes.filter((function(option){return showReactionsAndCommentsFeature||"enableReactions"!==option.value})).map((function(checkbox,index){return(0,jsx_runtime.jsx)(InsertVideoSettings_Row,{children:(0,jsx_runtime.jsxs)(CheckboxInputWrapper,{children:[(0,jsx_runtime.jsx)(CheckboxInput,{id:"check-".concat(index),width:"24px",checked:selectedCheckboxes.some((function(c){return c.value===checkbox.value})),onChange:function(e){var checked=e.target.checked;setSelectedCheckboxes(checked?InsertVideoSettings_spreadArray(InsertVideoSettings_spreadArray([],InsertVideoSettings_read(selectedCheckboxes),!1),[checkbox],!1):selectedCheckboxes.filter((function(c){return c.value!==checkbox.value})))}}),(0,jsx_runtime.jsx)(CheckboxLabel,InsertVideoSettings_assign({htmlFor:"check-".concat(index)},{children:checkbox.label}))]})},"check-".concat(index))}))}))})]})},index_75b02bac_browser_esm=__webpack_require__("./node_modules/react-select/dist/index-75b02bac.browser.esm.js"),useGetInventoryItems_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},useGetInventoryItems_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},VehicleSearch_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},VehicleSearch_assign=function(){return VehicleSearch_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},VehicleSearch_assign.apply(this,arguments)},VehicleSearch_rest=function(s,e){var t={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0&&(t[p]=s[p]);if(null!=s&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(p=Object.getOwnPropertySymbols(s);i<p.length;i++)e.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i])&&(t[p[i]]=s[p[i]])}return t},VehicleSearch_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},VehicleSearch_OptionWrapper=styled_components_browser_esm.Ay.div(VehicleSearch_templateObject_1||(VehicleSearch_templateObject_1=VehicleSearch_makeTemplateObject(["\n display: flex;\n align-items: center;\n padding-left: 12px;\n"],["\n display: flex;\n align-items: center;\n padding-left: 12px;\n"]))),OptionLabel=styled_components_browser_esm.Ay.div(VehicleSearch_templateObject_2||(VehicleSearch_templateObject_2=VehicleSearch_makeTemplateObject(["\n margin-left: 0px;\n width: 100%;\n"],["\n margin-left: 0px;\n width: 100%;\n"]))),CustomOptionLabel=styled_components_browser_esm.Ay.div(VehicleSearch_templateObject_3||(VehicleSearch_templateObject_3=VehicleSearch_makeTemplateObject(["\n display: flex;\n justify-content: flex-end;\n align-items: center;\n"],["\n display: flex;\n justify-content: flex-end;\n align-items: center;\n"]))),VehicleSearch_Title=styled_components_browser_esm.Ay.div(VehicleSearch_templateObject_4||(VehicleSearch_templateObject_4=VehicleSearch_makeTemplateObject(["\n max-width: 100%;\n font-weight: 500;\n font-size: 14px;\n line-height: 24px;\n width: 256px;\n margin-right: auto;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n color: ",";\n"],["\n max-width: 100%;\n font-weight: 500;\n font-size: 14px;\n line-height: 24px;\n width: 256px;\n margin-right: auto;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n color: ",";\n"])),palette_gray100),Vin=styled_components_browser_esm.Ay.div(VehicleSearch_templateObject_5||(VehicleSearch_templateObject_5=VehicleSearch_makeTemplateObject(["\n font-weight: 400;\n font-size: 14px;\n line-height: 24px;\n color: ",";\n text-align: right;\n"],["\n font-weight: 400;\n font-size: 14px;\n line-height: 24px;\n color: ",";\n text-align: right;\n"])),palette_gray60),SingleValueWrapper=styled_components_browser_esm.Ay.div(VehicleSearch_templateObject_6||(VehicleSearch_templateObject_6=VehicleSearch_makeTemplateObject(["\n padding-left: 6px;\n"],["\n padding-left: 6px;\n"]))),AddVehicleWrapper=styled_components_browser_esm.Ay.div(VehicleSearch_templateObject_7||(VehicleSearch_templateObject_7=VehicleSearch_makeTemplateObject(["\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n gap: 6px;\n height: 72px;\n border: 1px dashed ",";\n border-radius: 6px;\n &:hover {\n cursor: pointer;\n }\n"],["\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n gap: 6px;\n height: 72px;\n border: 1px dashed ",";\n border-radius: 6px;\n &:hover {\n cursor: pointer;\n }\n"])),(function(_a){return _a.theme.colors.primary[100]})),SelectedVehicleWrapper=styled_components_browser_esm.Ay.div(VehicleSearch_templateObject_8||(VehicleSearch_templateObject_8=VehicleSearch_makeTemplateObject(["\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n padding: 16px;\n gap: 8px;\n height: 108px;\n background: ",";\n box-shadow:\n 0px 0px 2px rgba(66, 79, 104, 0.08),\n 0px 4px 8px rgba(66, 79, 104, 0.03);\n border-radius: 6px;\n"],["\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n padding: 16px;\n gap: 8px;\n height: 108px;\n background: ",";\n box-shadow:\n 0px 0px 2px rgba(66, 79, 104, 0.08),\n 0px 4px 8px rgba(66, 79, 104, 0.03);\n border-radius: 6px;\n"])),palette_white),SelectedVehicleContainer=styled_components_browser_esm.Ay.div(VehicleSearch_templateObject_9||(VehicleSearch_templateObject_9=VehicleSearch_makeTemplateObject(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n height: 36px;\n margin-bottom: 5px;\n padding: 0 8px;\n"],["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n height: 36px;\n margin-bottom: 5px;\n padding: 0 8px;\n"]))),SelectedCarNameContainer=styled_components_browser_esm.Ay.div(VehicleSearch_templateObject_10||(VehicleSearch_templateObject_10=VehicleSearch_makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: 8px;\n width: 50%;\n"],["\n display: flex;\n align-items: center;\n gap: 8px;\n width: 50%;\n"]))),SelectedVehicleButtonContainer=styled_components_browser_esm.Ay.div(VehicleSearch_templateObject_11||(VehicleSearch_templateObject_11=VehicleSearch_makeTemplateObject(["\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n gap: 4px;\n"],["\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n gap: 4px;\n"]))),VehicleSearchWrapper=styled_components_browser_esm.Ay.div(VehicleSearch_templateObject_12||(VehicleSearch_templateObject_12=VehicleSearch_makeTemplateObject(["\n background-color: ",";\n box-shadow:\n 0px 0px 2px rgba(66, 79, 104, 0.08),\n 0px 4px 8px rgba(66, 79, 104, 0.03);\n border-radius: 6px;\n"],["\n background-color: ",";\n box-shadow:\n 0px 0px 2px rgba(66, 79, 104, 0.08),\n 0px 4px 8px rgba(66, 79, 104, 0.03);\n border-radius: 6px;\n"])),palette_white),CarInfoText=styled_components_browser_esm.Ay.div(VehicleSearch_templateObject_13||(VehicleSearch_templateObject_13=VehicleSearch_makeTemplateObject(["\n font-style: normal;\n font-weight: ",";\n font-size: 14px;\n line-height: 20px;\n color: ",";\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n"],["\n font-style: normal;\n font-weight: ",";\n font-size: 14px;\n line-height: 20px;\n color: ",";\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n"])),(function(props){return props.fontWeight||"500"}),(function(props){return props.color||props.theme.colors.primary[100]})),createNew_value="0",DropdownIndicator=function(props){return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{})},filterOptions=function(candidate,input){if(candidate.value===createNew_value)return!0;var label=candidate.label.toLowerCase(),vin=candidate.data.vin?candidate.data.vin.toLowerCase():"";return"".concat(label," ").concat(vin).includes(input.toLowerCase())},Option=function(props){return(0,jsx_runtime.jsx)(VehicleSearch_OptionWrapper,{children:(0,jsx_runtime.jsx)(OptionLabel,{children:(0,jsx_runtime.jsx)(index_75b02bac_browser_esm.F.Option,VehicleSearch_assign({},props))})})},formatOptionLabel=function(_a){var label=_a.label,vin=_a.vin;return(0,jsx_runtime.jsxs)(CustomOptionLabel,{children:[(0,jsx_runtime.jsx)(VehicleSearch_Title,{children:label}),(0,jsx_runtime.jsxs)(Vin,{children:[" ",vin]})]})},SingleValue=function(_a){_a.children;var props=VehicleSearch_rest(_a,["children"]);return(0,jsx_runtime.jsx)(SingleValueWrapper,{children:props.data.label})},NoOptionsMessage=function(props){return(0,jsx_runtime.jsx)(index_75b02bac_browser_esm.F.NoOptionsMessage,VehicleSearch_assign({},props,{children:"No vehicles found, try entering a different name or VIN."}))},VehicleSearch=function(_a){var onChangeVehicle=_a.onChangeVehicle,handleChangeVehicleButtonPress=_a.handleChangeVehicleButtonPress,handleRemoveVehicleButtonPress=_a.handleRemoveVehicleButtonPress,setAddingVehicle=_a.setAddingVehicle,_b=_a.selectedVin,selectedVin=void 0===_b?"":_b,_c=_a.placeholder,placeholder=void 0===_c?"Search vehicle by name or VIN...":_c,_d=_a.fetchSold,fetchSold=void 0===_d||_d,_e=_a.addingVehicle,addingVehicle=void 0===_e||_e,userData=useAuthorizationContext().userData,_f=(0,styled_components_browser_esm.DP)(),colors=_f.colors,isCdkEnviroment=_f.isCdkEnviroment,hasIMS=checkIsIMSEnabled(userData),_g=VehicleSearch_read((0,react.useState)(""),2),vehicleTitle=_g[0],setVehicleTitle=_g[1],_h=VehicleSearch_read((0,react.useState)(selectedVin),2),searchInventoryQuery=_h[0],setSearchInventoryQuery=_h[1],showUpgradeMessageFeature=useConfigurationContext().showUpgradeMessageFeature,selectStyle={control:function(styles,state){return VehicleSearch_assign(VehicleSearch_assign({},styles),{height:"40px",boxShadow:"none",borderColor:state.isFocused?colors.primary[100]:palette_gray40,":hover":{borderColor:colors.primary[100]},":focus":{borderColor:colors.primary[100]},":active":{borderColor:colors.primary[100]}})},option:function(base){return VehicleSearch_assign(VehicleSearch_assign({},base),{backgroundColor:"transparent",color:palette_gray100,padding:"8px",cursor:"pointer",":hover":{backgroundColor:"transparent",opacity:".8"},":focus":{backgroundColor:"transparent",opacity:".8"}})},indicatorSeparator:function(){return{display:"none"}},valueContainer:function(base){return VehicleSearch_assign(VehicleSearch_assign({},base),{padding:4,overflow:"show"})}},data=function(_a){var _b=_a.size,size=void 0===_b?10:_b,_c=_a.page,page=void 0===_c?0:_c,_d=_a.sort,sort=void 0===_d?"":_d,_e=_a.searchQuery,searchQuery=void 0===_e?"":_e,_f=_a.soldFilter,soldFilter=void 0===_f?"":_f,_g=_a.videosRecordedFilter,videosRecordedFilter=void 0===_g?"":_g,_h=_a.countRecorded,countRecorded=void 0!==_h&&_h,_j=_a.enabled,enabled=void 0===_j||_j;return(0,es.useQuery)(["inventoryItems",size,page,sort,searchQuery,soldFilter,videosRecordedFilter,enabled,countRecorded],(function(){return useGetInventoryItems_awaiter(void 0,void 0,void 0,(function(){return useGetInventoryItems_generator(this,(function(_a){return[2,getInventoryItems({limit:size,start:page*size,sort,search:searchQuery||"",soldFilter,videosRecordedFilter,countRecorded})]}))}))}),{refetchOnWindowFocus:!1,staleTime:countRecorded?0:36e5,enabled})}({searchQuery:searchInventoryQuery,countRecorded:!1,enabled:hasIMS,soldFilter:fetchSold?"2":"0"}).data,items=data?data.items:[];(0,react.useEffect)((function(){setSearchInventoryQuery(selectedVin)}),[selectedVin]),(0,react.useEffect)((function(){if(data&&""!==selectedVin&&items){var selectedVehicleList=items.filter((function(item){return item.vin===selectedVin}));if(!selectedVehicleList.length)return null==handleRemoveVehicleButtonPress||handleRemoveVehicleButtonPress(),void setVehicleTitle("");setVehicleTitle(selectedVehicleList[0].title)}}),[items,selectedVin]);var options=items.map((function(v){return{stockNumber:v.stockNumber,vin:v.vin,value:v.vin,label:v.title}}));return hasIMS?addingVehicle?(0,jsx_runtime.jsx)(VehicleSearchWrapper,{children:(0,jsx_runtime.jsx)(dist_react_select_browser_esm.Ay,{components:{Option,DropdownIndicator,SingleValue,NoOptionsMessage},styles:selectStyle,options,value:options.find((function(o){return o.value===selectedVin})),onChange:function(option){onChangeVehicle(option||void 0),setVehicleTitle((null==option?void 0:option.title)||"")},autoFocus:!0,isSearchable:!0,isClearable:!0,placeholder,filterOption:filterOptions,formatOptionLabel,onInputChange:function(input){input.length<2||setSearchInventoryQuery(input)}})}):selectedVin?(0,jsx_runtime.jsxs)(SelectedVehicleWrapper,{children:[(0,jsx_runtime.jsxs)(SelectedVehicleContainer,{children:[(0,jsx_runtime.jsxs)(SelectedCarNameContainer,{children:[(0,jsx_runtime.jsx)(io_index_esm.Y0Z,{size:20,color:colors.primary[40]}),(0,jsx_runtime.jsx)(CarInfoText,{children:vehicleTitle})]}),(0,jsx_runtime.jsx)(CarInfoText,VehicleSearch_assign({color:colors.primary[40],fontWeight:"400"},{children:selectedVin}))]}),(0,jsx_runtime.jsxs)(SelectedVehicleButtonContainer,{children:[(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{onClick:function(){null==handleChangeVehicleButtonPress||handleChangeVehicleButtonPress(),setVehicleTitle("")},text:"Change",variant:"primary",size:"small"}),(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{onClick:function(){null==handleRemoveVehicleButtonPress||handleRemoveVehicleButtonPress(),setVehicleTitle("")},text:"Remove",variant:isCdkEnviroment?"text":"destructive",size:"small"})]})]}):(0,jsx_runtime.jsxs)(AddVehicleWrapper,VehicleSearch_assign({onClick:function(){return null==setAddingVehicle?void 0:setAddingVehicle(!0)}},{children:[(0,jsx_runtime.jsx)(io_index_esm.Y0Z,{size:20,color:colors.primary[100]}),"Add Vehicle"]})):showUpgradeMessageFeature?(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:["To enable the integration with your Inventory Management System, please call us at",(0,jsx_runtime.jsx)("br",{}),(0,jsx_runtime.jsx)("a",VehicleSearch_assign({href:"tel:8003061445"},{children:"800-306-1445"}))]}):null},rcs_esm=__webpack_require__("./node_modules/react-compound-slider/dist/rcs.esm.js"),VideoPreviewTrack_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},PreviewVideo=styled_components_browser_esm.Ay.video(VideoPreviewTrack_templateObject_1||(VideoPreviewTrack_templateObject_1=VideoPreviewTrack_makeTemplateObject(["\n height: auto;\n width: ",";\n object-fit: cover;\n object-position: center;\n &:nth-child(1) {\n border-radius: 6px 0 0 6px;\n }\n &:nth-child(",") {\n border-radius: 0 6px 6px 0;\n }\n"],["\n height: auto;\n width: ",";\n object-fit: cover;\n object-position: center;\n &:nth-child(1) {\n border-radius: 6px 0 0 6px;\n }\n &:nth-child(",") {\n border-radius: 0 6px 6px 0;\n }\n"])),(function(props){return props.width}),(function(_a){return _a.numberOfStills})),PreviewVideoWrapper=styled_components_browser_esm.Ay.div(VideoPreviewTrack_templateObject_2||(VideoPreviewTrack_templateObject_2=VideoPreviewTrack_makeTemplateObject(["\n position: absolute;\n left: 0;\n right: 0;\n height: 48px;\n overflow: hidden;\n display: flex;\n flex-wrap: nowrap;\n"],["\n position: absolute;\n left: 0;\n right: 0;\n height: 48px;\n overflow: hidden;\n display: flex;\n flex-wrap: nowrap;\n"]))),SliderRail_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},SliderRail_assign=function(){return SliderRail_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},SliderRail_assign.apply(this,arguments)},RailOuter=styled_components_browser_esm.Ay.div(SliderRail_templateObject_1||(SliderRail_templateObject_1=SliderRail_makeTemplateObject(["\n position: absolute;\n width: 100%;\n height: 48px;\n cursor: pointer;\n"],["\n position: absolute;\n width: 100%;\n height: 48px;\n cursor: pointer;\n"]))),RailInner=styled_components_browser_esm.Ay.div(SliderRail_templateObject_2||(SliderRail_templateObject_2=SliderRail_makeTemplateObject(["\n position: absolute;\n width: 100%;\n height: 48px;\n pointer-events: none;\n background-color: rgba(0, 27, 83, 0.15);\n border-radius: 6px;\n"],["\n position: absolute;\n width: 100%;\n height: 48px;\n pointer-events: none;\n background-color: rgba(0, 27, 83, 0.15);\n border-radius: 6px;\n"]))),SliderRail=function(_a){var getRailProps=_a.getRailProps;return(0,jsx_runtime.jsxs)(react.Fragment,{children:[(0,jsx_runtime.jsx)(RailOuter,SliderRail_assign({},getRailProps())),(0,jsx_runtime.jsx)(RailInner,{})]})},Handle_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},Handle_assign=function(){return Handle_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},Handle_assign.apply(this,arguments)},Handle_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},MainHandle=styled_components_browser_esm.Ay.div(Handle_templateObject_1||(Handle_templateObject_1=Handle_makeTemplateObject(["\n left: ",";\n position: absolute;\n transform: ",";\n z-index: 400;\n width: 24px;\n height: 48px;\n cursor: pointer;\n"],["\n left: ",";\n position: absolute;\n transform: ",";\n z-index: 400;\n width: 24px;\n height: 48px;\n cursor: pointer;\n"])),(function(props){return props.percent}),(function(props){return props.transform})),Slider=styled_components_browser_esm.Ay.div(Handle_templateObject_2||(Handle_templateObject_2=Handle_makeTemplateObject(["\n left: ",";\n background-color: ",";\n position: absolute;\n transform: ",";\n z-index: 2;\n width: 24px;\n height: 48px;\n border-radius: ",";\n &:before {\n content: '';\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n width: 4px;\n height: 12px;\n background: ",";\n border-radius: 4px;\n }\n"],["\n left: ",";\n background-color: ",";\n position: absolute;\n transform: ",";\n z-index: 2;\n width: 24px;\n height: 48px;\n border-radius: ",";\n &:before {\n content: '';\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n width: 4px;\n height: 12px;\n background: ",";\n border-radius: 4px;\n }\n"])),(function(props){return props.percent}),(function(props){return props.isDisabled?"#666":props.theme.colors.primary[100]}),(function(props){return props.transform}),(function(props){return props.borderRadius}),palette_white),Handle=function(props){var colors=(0,styled_components_browser_esm.DP)().colors,_a=Handle_read(props.domain,2),min=_a[0],max=_a[1],_b=props.handle,id=_b.id,value=_b.value,percent=_b.percent,_c=props.showFloatingPreview,showFloatingPreview=void 0===_c||_c,isActive=props.isActive,disabled=props.disabled,getHandleProps=props.getHandleProps,videoRef=props.videoRef,_d=props.changeVideoPosition,changeVideoPosition=void 0===_d||_d,nChild=props.nChild,_e=Handle_read(react.useState(!1),2),mouseOver=_e[0],setMouseOver=_e[1],previewvideoRef=react.createRef();react.useEffect((function(){isActive&&(showFloatingPreview&&(previewvideoRef.current.currentTime=value||0),changeVideoPosition&&(videoRef.current.currentTime=value||0))}),[value,previewvideoRef,changeVideoPosition,videoRef]);var seconds=toMMSS(value).split(".")[0],miliseconds=toMMSS(value).split(".")[1];return(0,jsx_runtime.jsxs)(react.Fragment,{children:[showFloatingPreview&&(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[!mouseOver&&!isActive||disabled?null:(0,jsx_runtime.jsxs)("div",Handle_assign({style:{left:"".concat(percent,"%"),position:"absolute",marginLeft:"-15px",marginTop:"52px",zIndex:1}},{children:[(0,jsx_runtime.jsx)("div",{style:{width:0,height:0,marginLeft:21,borderLeft:"6px solid transparent",borderRight:"6px solid transparent",borderBottom:"6px solid "}}),(0,jsx_runtime.jsxs)("div",Handle_assign({style:{width:"auto",padding:4,fontSize:12,fontWeight:500,letterSpacing:.34,backgroundColor:colors.primary[100],color:"#fff",textAlign:"center",zIndex:99999}},{children:[seconds,(0,jsx_runtime.jsx)("span",Handle_assign({style:{fontSize:9,fontWeight:400,letterSpacing:.34,color:"#fff",opacity:.7}},{children:"."+miliseconds}))]}))]})),(0,jsx_runtime.jsx)("div",Handle_assign({style:{left:"".concat(percent,"%"),position:"absolute",marginLeft:"-38px",marginTop:"-92px",zIndex:3,visibility:!mouseOver&&!isActive||disabled?"hidden":"visible"}},{children:(0,jsx_runtime.jsx)("div",Handle_assign({style:{width:141,height:80,border:"solid 2px ".concat(colors.primary[100]),backgroundColor:palette_themeDark75Percent,display:"flex",justifyContent:"center"}},{children:(0,jsx_runtime.jsx)("video",{ref:previewvideoRef,height:"100%",src:props.videoSource,playsInline:!0,controls:!1},"previewvideoRef")}))}))]}),(0,jsx_runtime.jsx)(MainHandle,Handle_assign({percent:"".concat(percent,"%")},getHandleProps(id),{onMouseEnter:function(){setMouseOver(!0)},onMouseLeave:function(){setMouseOver(!1)},transform:0===nChild?"translate(0px,0%)":"translate(-15px,0%)"})),(0,jsx_runtime.jsx)(Slider,{role:"slider","aria-valuemin":min,"aria-valuemax":max,"aria-valuenow":value,percent:"".concat(percent,"%"),borderRadius:0===nChild?"5px 0px 0px 5px;":"0px 5px 5px 0px",isDisabled:disabled,transform:0===nChild?"translate(0px,0%)":"translate(-15px,0%)"})]})},Track_assign=function(){return Track_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},Track_assign.apply(this,arguments)},Track=function(_a){var source=_a.source,target=_a.target,getTrackProps=_a.getTrackProps,disabled=_a.disabled;return(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)("div",Track_assign({style:{position:"absolute",height:48,zIndex:1,backgroundColor:disabled?"#999":"rgba(0,0,0,.7)",cursor:"pointer",left:"0",width:"".concat(source.percent+1,"%"),borderRadius:"6px 0 0 6px"}},getTrackProps())),(0,jsx_runtime.jsx)("div",Track_assign({style:{position:"absolute",height:48,zIndex:1,backgroundColor:disabled?"#999":"transparent",cursor:"pointer",left:"".concat(source.percent,"%"),width:"".concat(target.percent-source.percent,"%"),borderRadius:6}},getTrackProps())),(0,jsx_runtime.jsx)("div",Track_assign({style:{position:"absolute",height:48,zIndex:1,backgroundColor:disabled?"#999":"rgba(0,0,0,.7)",cursor:"pointer",left:"".concat(target.percent,"%"),width:"".concat(100-target.percent,"%"),borderRadius:"0 6px 6px 0"}},getTrackProps()))]})},Tick_assign=function(){return Tick_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},Tick_assign.apply(this,arguments)},Tick=function(_a){var tick=_a.tick,count=_a.count;return(0,jsx_runtime.jsxs)("div",{children:[(0,jsx_runtime.jsx)("div",{style:{position:"absolute",width:2,height:48,opacity:.4,backgroundColor:palette_blackRgb60,left:"".concat(tick.percent,"%"),zIndex:1}}),(0,jsx_runtime.jsx)("div",Tick_assign({style:{position:"absolute",marginTop:52,fontSize:10,textAlign:"center",marginLeft:"".concat(-100/count/2,"%"),width:"".concat(100/count,"%"),left:"".concat(tick.percent,"%")}},{children:toMMSS(tick.value).split(".")[0]}))]})},TimelineRange_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},TimelineRange_assign=function(){return TimelineRange_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},TimelineRange_assign.apply(this,arguments)},Wrap=styled_components_browser_esm.Ay.div(TimelineRange_templateObject_1||(TimelineRange_templateObject_1=TimelineRange_makeTemplateObject(["\n position: relative;\n width: ",";\n height: 48px;\n"],["\n position: relative;\n width: ",";\n height: 48px;\n"])),(function(props){return props.width})),VideoPreviewMemo=react.memo((function(_a){for(var videoSource=_a.videoSource,videoDuration=_a.videoDuration,numberOfStills=_a.numberOfStills,refArray=[],videoWidthPercent=100/numberOfStills,i=0;i<numberOfStills;i++)refArray.push(react.createRef());return(0,react.useEffect)((function(){refArray.forEach((function(ref,index){ref.current&&(ref.current.currentTime=videoDuration*(index/numberOfStills))}))}),[refArray]),(0,jsx_runtime.jsx)(PreviewVideoWrapper,{children:refArray.map((function(ref,index){return(0,jsx_runtime.jsx)(PreviewVideo,{ref,src:videoSource,width:"".concat(videoWidthPercent,"%"),numberOfStills,playsInline:!0,controls:!1},"previewvideoRef-".concat(index))}))})})),TimelineRange=function(props){var colors=(0,styled_components_browser_esm.DP)().colors,videoDuration=props.videoDuration,videoSource=props.videoSource,_a=props.setTrimDuration,setTrimDuration=void 0===_a?function(){}:_a,_b=props.setStart,setStart=void 0===_b?function(){}:_b,value=props.value,setValue=props.setValue,_c=props.addHistory,addHistory=void 0===_c?function(){}:_c,_d=props.onSlideEnd,onSlideEnd=void 0===_d?function(){}:_d,valueRef=props.valueRef,videoRef=props.videoRef,_e=props.showTickTime,showTickTime=void 0===_e||_e,_f=props.changeVideoPosition,changeVideoPosition=void 0===_f||_f,_g=props.showFloatingPreview,showFloatingPreview=void 0===_g||_g,width=props.width,_h=props.showPreviewTrack,showPreviewTrack=void 0===_h||_h,domain=[0,videoDuration];react.useEffect((function(){var initialValues=[0,videoDuration||0];value[1]||setValue(initialValues)}),[videoDuration]),react.useEffect((function(){return videoRef&&videoRef.current&&(videoRef.current.addEventListener("play",(function(e){return onPlay(e)})),videoRef.current.addEventListener("timeupdate",(function(e){return onTimeupdate(e)}))),function(){videoRef&&videoRef.current&&(videoRef.current.removeEventListener("play",(function(e){return onPlay(e)})),videoRef.current.removeEventListener("timeupdate",(function(e){return onTimeupdate(e)})))}}),[videoRef]);var onTimeupdate=function(event){var video=event.target;video.currentTime>valueRef.current[1]&&0!=valueRef.current[1]&&video.pause()},onPlay=function(event){var video=event.target;(video.currentTime>=valueRef.current[1]||video.currentTime<valueRef.current[0])&&(video.currentTime=valueRef.current[0])},duration=react.useMemo((function(){return videoDuration}),[videoDuration]),sliderStyle={position:"relative",width:"100%",backgroundColor:colors.primary[40]};return(0,jsx_runtime.jsx)(Wrap,TimelineRange_assign({width},{children:(0,jsx_runtime.jsxs)(rcs_esm.Ap,TimelineRange_assign({rootStyle:sliderStyle,mode:1,step:1e-7,domain,reversed:!1,onChange:function(values){if(!isNaN(values[0])&&!isNaN(values[1])){var newValue=values.slice();addHistory(newValue),setValue(newValue),valueRef.current=newValue}},onUpdate:function(update){setTrimDuration(update[1]-update[0]),setStart(update[0])},values:value,onSlideEnd:function(args){onSlideEnd(args)}},{children:[showPreviewTrack&&(0,jsx_runtime.jsx)(VideoPreviewMemo,{numberOfStills:14,videoSource,videoDuration:duration}),(0,jsx_runtime.jsx)(rcs_esm.hM,{children:function(railProps){return(0,jsx_runtime.jsx)(SliderRail,TimelineRange_assign({},railProps))}}),(0,jsx_runtime.jsx)(rcs_esm.ot,{children:function(_a){var handles=_a.handles,activeHandleID=_a.activeHandleID,getHandleProps=_a.getHandleProps;return(0,jsx_runtime.jsx)("div",TimelineRange_assign({className:"slider-handles"},{children:handles.map((function(handle,index){return(0,jsx_runtime.jsx)(Handle,{showFloatingPreview,nChild:index,handle,domain,isActive:handle.id===activeHandleID,getHandleProps,videoSource,videoRef,changeVideoPosition},handle.id)}))}))}}),(0,jsx_runtime.jsx)(rcs_esm.X5,TimelineRange_assign({left:!1,right:!1},{children:function(_a){var tracks=_a.tracks,getTrackProps=_a.getTrackProps;return(0,jsx_runtime.jsx)("div",TimelineRange_assign({className:"slider-tracks"},{children:tracks.map((function(_a){var id=_a.id,source=_a.source,target=_a.target;return(0,jsx_runtime.jsx)(Track,{source,target,getTrackProps},id)}))}))}})),showTickTime&&(0,jsx_runtime.jsx)(rcs_esm.R_,TimelineRange_assign({count:10},{children:function(_a){var ticks=_a.ticks;return(0,jsx_runtime.jsx)("div",TimelineRange_assign({className:"slider-ticks"},{children:ticks.map((function(tick){return(0,jsx_runtime.jsx)(Tick,{tick,count:ticks.length},tick.id)}))}))}}))]}))}))},Trim_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},Trim_assign=function(){return Trim_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},Trim_assign.apply(this,arguments)},TrimmedContainer=styled_components_browser_esm.Ay.div(Trim_templateObject_1||(Trim_templateObject_1=Trim_makeTemplateObject(["\n margin-top: 8px;\n font-weight: 400;\n color: ",";\n\n span {\n text-decoration: underline;\n cursor: pointer;\n }\n"],["\n margin-top: 8px;\n font-weight: 400;\n color: ",";\n\n span {\n text-decoration: underline;\n cursor: pointer;\n }\n"])),palette_covideoGray100),DisabledTimelineRange=(0,styled_components_browser_esm.Ay)(TimelineRange)(Trim_templateObject_2||(Trim_templateObject_2=Trim_makeTemplateObject(["\n height: 48px;\n width: 100%;\n background-color: ",";\n"],["\n height: 48px;\n width: 100%;\n background-color: ",";\n"])),palette_gray10);const trim_Trim=function(_a){var videoRef=_a.videoRef,videoDuration=_a.videoDuration,videoSource=_a.videoSource,setValue=_a.setValue,value=_a.value,isVideoTrimmed=_a.isVideoTrimmed,valueRef=_a.valueRef,_b=_a.isVideoLoading,isVideoLoading=void 0===_b||_b;return(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[isVideoLoading?(0,jsx_runtime.jsx)(DisabledTimelineRange,{width:"100%",videoRef:null,videoDuration:0,videoSource:"",setValue,value:[0,0],valueRef,showTickTime:!1,showFloatingPreview:!1}):(0,jsx_runtime.jsx)(TimelineRange,{width:"100%",videoRef,videoDuration,videoSource,setValue,value,valueRef,showTickTime:!1,showFloatingPreview:!1}),isVideoTrimmed&&(0,jsx_runtime.jsxs)(TrimmedContainer,{children:["Trimmed.",(0,jsx_runtime.jsx)("span",Trim_assign({style:{marginLeft:8},onClick:function(){setValue([0,videoDuration]),valueRef.current&&(valueRef.current=[0,videoDuration]),videoRef.current&&(videoRef.current.currentTime=0)}},{children:"Revert to Original"}))]})]})};var Trim_templateObject_1,Trim_templateObject_2,InsertVideo_templateObject_1,InsertVideo_templateObject_2,InsertVideo_templateObject_3,InsertVideo_templateObject_4,InsertVideo_templateObject_5,InsertVideo_templateObject_6,InsertVideo_templateObject_7,InsertVideo_templateObject_8,InsertVideo_templateObject_9,InsertVideo_templateObject_10,VideoPreview_templateObject_1,VideoPreview_templateObject_2,RecorderErrors,InsertButton_assign=function(){return InsertButton_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},InsertButton_assign.apply(this,arguments)},InsertButton_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},InsertButton_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},InsertButton_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},InsertButton=function(_a){var video=_a.video,getMarkAsSentPayload=_a.getMarkAsSentPayload,disable=_a.disable,onCRMClick=_a.onCRMClick,_b=(0,styled_components_browser_esm.DP)(),isCdkEnviroment=_b.isCdkEnviroment,userData=(_b.colors,useAuthorizationContext().userData),markAsSent=getMarkAsSentValue(userData),_c=InsertButton_read((0,react.useState)(!1),2),insertingVideo=_c[0],setInsertingVideo=_c[1],_d=InsertButton_read((0,react.useState)(!1),2),showModalQuickShareMarkAsSent=_d[0],setShowModalQuickShareMarkAsSent=_d[1],_e=useQuickShare({video,videoRequest:null==video?void 0:video.videoRequest,setShowModalQuickShareMarkAsSent,handleOnMarkAsSentSuccessCallback:function(){setInsertingVideo(!1)}}),onQuickShareMutationHandler=_e.onQuickShareMutationHandler,isQuickshareLoading=_e.isQuickshareLoading,onQuickShareButtonClick=_e.onQuickShareButtonClick;return(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{onClick:function(){if(null==onCRMClick||onCRMClick(),markAsSent!==MarkAsSentOptions_ASK_VERY_TIME.value){setInsertingVideo(!0);var payload=getMarkAsSentPayload();onQuickShareButtonClick(InsertButton_assign(InsertButton_assign({videoActivityType:VIDE0_ACTIVITY_TYPE.QUICKSHARE,toastType:"insert"},payload.videoShareSetData),{useAutomotive:payload.useAutomotive}))}else onQuickShareButtonClick({videoActivityType:VIDE0_ACTIVITY_TYPE.QUICKSHARE,toastType:"insert"})},text:"Insert",variant:isCdkEnviroment?"white":"primary",disabled:disable||insertingVideo,icon:insertingVideo?(0,jsx_runtime.jsx)(Spinner,{size:12}):(0,jsx_runtime.jsx)(io_index_esm.t50,{size:18})}),showModalQuickShareMarkAsSent&&(0,jsx_runtime.jsx)(ModalQuickShareMarkAsSent,{markAsSentPayload:{toastType:"insert"},isQuickShareLoading:isQuickshareLoading,quickShareMarkAsSentHandler:onQuickShareMutationHandler,handleModalClose:function(){return InsertButton_awaiter(void 0,void 0,void 0,(function(){return InsertButton_generator(this,(function(_a){return setShowModalQuickShareMarkAsSent(!1),[2]}))}))},getMarkAsSentPayload:function(){return InsertButton_awaiter(void 0,void 0,void 0,(function(){return InsertButton_generator(this,(function(_a){return setInsertingVideo(!0),[2,getMarkAsSentPayload()]}))}))}})]})},CopyVideoButton_assign=function(){return CopyVideoButton_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},CopyVideoButton_assign.apply(this,arguments)},CopyVideoButton_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},CopyVideoButton_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},CopyVideoButton_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},CopyVideoButton=function(_a){var video=_a.video,getMarkAsSentPayload=_a.getMarkAsSentPayload,disable=_a.disable,onCRMClick=_a.onCRMClick,_b=(0,styled_components_browser_esm.DP)(),isCdkEnviroment=_b.isCdkEnviroment,containerWidth=(_b.colors,useConfigurationContext().containerWidth),userData=useAuthorizationContext().userData,markAsSent=getMarkAsSentValue(userData),_c=CopyVideoButton_read((0,react.useState)(!1),2),copyingVideo=_c[0],setCopyingVideo=_c[1],_d=CopyVideoButton_read((0,react.useState)(!1),2),showModalQuickShareMarkAsSent=_d[0],setShowModalQuickShareMarkAsSent=_d[1],_e=useQuickShare({video,videoRequest:null==video?void 0:video.videoRequest,setShowModalQuickShareMarkAsSent,handleOnMarkAsSentSuccessCallback:function(){setCopyingVideo(!1)}}),onQuickShareMutationHandler=_e.onQuickShareMutationHandler,isQuickshareLoading=_e.isQuickshareLoading,onQuickShareButtonClick=_e.onQuickShareButtonClick;return(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{variant:isCdkEnviroment?"white":"secondary",onClick:function(){return CopyVideoButton_awaiter(void 0,void 0,void 0,(function(){var payload;return CopyVideoButton_generator(this,(function(_a){return null==onCRMClick||onCRMClick(),markAsSent===MarkAsSentOptions_ASK_VERY_TIME.value?(onQuickShareButtonClick({videoActivityType:VIDE0_ACTIVITY_TYPE.QUICKSHARE,toastType:"quickshare"}),[2]):(setCopyingVideo(!0),payload=getMarkAsSentPayload(),onQuickShareButtonClick(CopyVideoButton_assign(CopyVideoButton_assign({videoActivityType:VIDE0_ACTIVITY_TYPE.QUICKSHARE,toastType:"quickshare"},payload.videoShareSetData),{useAutomotive:payload.useAutomotive})),[2])}))}))},text:containerWidth>screenSizes_sm?"Copy Video":"Copy",disabled:disable||copyingVideo,icon:copyingVideo?(0,jsx_runtime.jsx)(Spinner,{size:12}):(0,jsx_runtime.jsx)(io_index_esm.y40,{size:18})}),showModalQuickShareMarkAsSent&&(0,jsx_runtime.jsx)(ModalQuickShareMarkAsSent,{markAsSentPayload:{toastType:"quickshare"},isQuickShareLoading:isQuickshareLoading,quickShareMarkAsSentHandler:onQuickShareMutationHandler,handleModalClose:function(){return CopyVideoButton_awaiter(void 0,void 0,void 0,(function(){return CopyVideoButton_generator(this,(function(_a){return setShowModalQuickShareMarkAsSent(!1),[2]}))}))},getMarkAsSentPayload:function(){return CopyVideoButton_awaiter(void 0,void 0,void 0,(function(){return CopyVideoButton_generator(this,(function(_a){return setCopyingVideo(!0),[2,getMarkAsSentPayload()]}))}))}})]})},InsertVideo_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},InsertVideo_assign=function(){return InsertVideo_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},InsertVideo_assign.apply(this,arguments)},InsertVideo_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},InsertVideo_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},InsertVideo_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},InsertVideo_spreadArray=function(to,from,pack){if(pack||2===arguments.length)for(var ar,i=0,l=from.length;i<l;i++)!ar&&i in from||(ar||(ar=Array.prototype.slice.call(from,0,i)),ar[i]=from[i]);return to.concat(ar||Array.prototype.slice.call(from))},InsertVideo_Wrapper=styled_components_browser_esm.Ay.div(InsertVideo_templateObject_1||(InsertVideo_templateObject_1=InsertVideo_makeTemplateObject(["\n background: ",";\n"],["\n background: ",";\n"])),palette_gray10),ContentWrapper=styled_components_browser_esm.Ay.div(InsertVideo_templateObject_2||(InsertVideo_templateObject_2=InsertVideo_makeTemplateObject(["\n display: flex;\n box-sizing: border-box;\n justify-content: center;\n align-items: flex-start;\n flex-wrap: wrap;\n gap: 16px;\n"],["\n display: flex;\n box-sizing: border-box;\n justify-content: center;\n align-items: flex-start;\n flex-wrap: wrap;\n gap: 16px;\n"]))),Main=styled_components_browser_esm.Ay.div(InsertVideo_templateObject_4||(InsertVideo_templateObject_4=InsertVideo_makeTemplateObject(["\n box-sizing: border-box;\n width: 100%;\n ","\n"],["\n box-sizing: border-box;\n width: 100%;\n ","\n"])),(function(_a){return _a.theme.containerWidth>=screenSizes_sm&&(0,styled_components_browser_esm.AH)(InsertVideo_templateObject_3||(InsertVideo_templateObject_3=InsertVideo_makeTemplateObject(["\n width: calc(50% - 8px);\n "],["\n width: calc(50% - 8px);\n "])))})),Side=styled_components_browser_esm.Ay.div(InsertVideo_templateObject_6||(InsertVideo_templateObject_6=InsertVideo_makeTemplateObject(["\n box-sizing: border-box;\n width: 100%;\n margin-top: 16px;\n ","\n"],["\n box-sizing: border-box;\n width: 100%;\n margin-top: 16px;\n ","\n"])),(function(_a){return _a.theme.containerWidth>=screenSizes_sm&&(0,styled_components_browser_esm.AH)(InsertVideo_templateObject_5||(InsertVideo_templateObject_5=InsertVideo_makeTemplateObject(["\n margin-top: 0;\n width: calc(50% - 8px);\n "],["\n margin-top: 0;\n width: calc(50% - 8px);\n "])))})),VideoWrapper=styled_components_browser_esm.Ay.div(InsertVideo_templateObject_7||(InsertVideo_templateObject_7=InsertVideo_makeTemplateObject(["\n margin-bottom: 24px;\n background: ",";\n box-shadow:\n 0px 0px 2px rgba(66, 79, 104, 0.08),\n 0px 4px 8px rgba(66, 79, 104, 0.03);\n border-radius: 6px;\n .fullscreen {\n height: auto;\n }\n"],["\n margin-bottom: 24px;\n background: ",";\n box-shadow:\n 0px 0px 2px rgba(66, 79, 104, 0.08),\n 0px 4px 8px rgba(66, 79, 104, 0.03);\n border-radius: 6px;\n .fullscreen {\n height: auto;\n }\n"])),palette_white),InsertVideo_Content=styled_components_browser_esm.Ay.div(InsertVideo_templateObject_8||(InsertVideo_templateObject_8=InsertVideo_makeTemplateObject(["\n background-color: ",";\n padding: 16px;\n display: flex;\n flex-direction: column;\n gap: 12px;\n border-radius: 6px;\n"],["\n background-color: ",";\n padding: 16px;\n display: flex;\n flex-direction: column;\n gap: 12px;\n border-radius: 6px;\n"])),palette_white),InsertVideo_Title=styled_components_browser_esm.Ay.div(InsertVideo_templateObject_9||(InsertVideo_templateObject_9=InsertVideo_makeTemplateObject(["\n font-weight: 600;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n background-color: ",";\n width: ",";\n border-radius: 6px;\n word-break: break-word;\n"],["\n font-weight: 600;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n background-color: ",";\n width: ",";\n border-radius: 6px;\n word-break: break-word;\n"])),palette_gray100,(function(_a){return _a.backgroundColor||"transparent"}),(function(_a){return _a.width||"auto"})),InsertVideo_Date=styled_components_browser_esm.Ay.div(InsertVideo_templateObject_10||(InsertVideo_templateObject_10=InsertVideo_makeTemplateObject(["\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n display: flex;\n align-items: center;\n background-color: ",";\n width: ",";\n border-radius: 6px;\n"],["\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n display: flex;\n align-items: center;\n background-color: ",";\n width: ",";\n border-radius: 6px;\n"])),palette_gray80,(function(_a){return _a.backgroundColor||"transparent"}),(function(_a){return _a.width||"auto"})),defaultInsertVideoCheckboxes=[{label:"Enable video reactions & comments",value:"enableReactions"}],InsertVideo=function(){var _a,_b,_c=useConfigurationContext(),showInsertFeature=_c.showInsertFeature,showQuickshareFeature=_c.showQuickshareFeature,containerWidth=_c.containerWidth,showTrimFeature=_c.showTrimFeature,showCTAFeature=_c.showCTAFeature,showLandingPageFeature=_c.showLandingPageFeature,showReactionsAndCommentsFeature=_c.showReactionsFeature,showWebsiteOverlayFeature=_c.showWebsiteOverlayFeature,_d=(0,styled_components_browser_esm.DP)(),colors=_d.colors,isCdkEnviroment=_d.isCdkEnviroment,payload=((0,react_router.zy)().state||{}).payload,toast=useToastNotifications().toast,userData=useAuthorizationContext().userData,isAutomotive=checkIfAutomotive(userData),isAutomotiveService=checkIfAutomotiveServiceRole(userData),isAutomotiveSales=checkIfAutomotiveSalesRole(userData),reactionsCustomerEnabled=function(userData){var _a;return!(!(null===(_a=userData.customer)||void 0===_a?void 0:_a.reactionsPreference)||"0"===userData.customer.reactionsPreference.toString())}(userData),reactionsEnabledByDefault=function(userData){var _a;return!!(userData.reactionsPreference&&"1"===userData.reactionsPreference.toString()||null===userData.reactionsPreference&&(null===(_a=userData.customer)||void 0===_a?void 0:_a.reactionsPreference)&&"1"===userData.customer.reactionsPreference.toString())}(userData),hasQuotibleAccess="1"===(null===(_b=null===(_a=null==userData?void 0:userData.customer)||void 0===_a?void 0:_a.quotibleAccess)||void 0===_b?void 0:_b.toString()),videoId=(0,react_router.g)().videoId,history=(0,react_router.W6)(),_e=InsertVideo_read((0,react.useState)(!1),2),isVideoProcessing=_e[0],setIsVideoProcessing=_e[1],_f=InsertVideo_read((0,react.useState)([]),2),linksets=_f[0],setLinksets=_f[1],_g=InsertVideo_read((0,react.useState)(!1),2),linksetsLoading=_g[0],setLinksetsLoading=_g[1],_h=InsertVideo_read((0,react.useState)(!1),2),templatesLoading=_h[0],setTemplatesLoading=_h[1],_j=InsertVideo_read((0,react.useState)([]),2),overlays=_j[0],setOverlays=_j[1],_k=InsertVideo_read((0,react.useState)(!1),2),overlaysLoading=_k[0],setOverlaysLoading=_k[1],_l=InsertVideo_read((0,react.useState)(!0),2),videoLoading=_l[0],setVideoLoading=_l[1],_m=InsertVideo_read((0,react.useState)(!1),2),addingVehicle=_m[0],setAddingVehicle=_m[1],_o=InsertVideo_read((0,react.useState)({}),2),video=_o[0],setVideo=_o[1],_p=InsertVideo_read((0,react.useState)({videoId,templateId:(null==payload?void 0:payload.templateId)||0,linksetId:(null==payload?void 0:payload.linksetId)||"",overlayId:(null==payload?void 0:payload.overlayId)||"",vin:""}),2),insertVideoData=_p[0],setInsertVideoData=_p[1],_q=InsertVideo_read((0,react.useState)(defaultInsertVideoCheckboxes),2),insertVideoCheckboxes=_q[0],setInsertVideoCheckboxes=_q[1],_r=InsertVideo_read((0,react.useState)("pending"),2),vin=_r[0],setVin=_r[1],_s=InsertVideo_read((0,react.useState)(!isAutomotive||isAutomotiveService),2),showLPOptions=_s[0],setShowLPOptions=_s[1],_t=InsertVideo_read((0,react.useState)([]),2),templates=_t[0],setTemplates=_t[1],_u=InsertVideo_read((0,react.useState)([]),2),templatesOptions=_u[0],setTemplatesOptions=_u[1],_v=InsertVideo_read((0,react.useState)((null==payload?void 0:payload.templateId)||0),2),defaultTemplateId=_v[0],setDefaultTemplateId=_v[1],salesServicePageOption={id:0,title:"".concat(isAutomotiveService?"Service":"Sales"," page"),typeId:-1},_w=InsertVideo_read((0,react.useState)([]),2),selectedCheckboxes=_w[0],setSelectedCheckboxes=_w[1],_x=InsertVideo_read((0,react.useState)(!1),2),isVideoTrimmed=_x[0],setIsVideoTrimmed=_x[1],_y=InsertVideo_read((0,react.useState)(!1),2),isVideoTrimmingLoading=_y[0],setIsVideoTrimmingLoading=_y[1],_z=InsertVideo_read((0,react.useState)(!0),2),isVideoLoading=_z[0],setIsVideoLoading=_z[1],_0=InsertVideo_read((0,react.useState)([0,0]),2),trimValue=_0[0],setTrimValue=_0[1],_1=InsertVideo_read((0,react.useState)(0),2),videoDuration=_1[0],setVideoDuration=_1[1],trimDurationRef=(0,react.useRef)([0,0]),fetchTemplates=function(){return InsertVideo_awaiter(void 0,void 0,void 0,(function(){var res,templates,defaultTemplate;return InsertVideo_generator(this,(function(_a){switch(_a.label){case 0:return setTemplatesLoading(!0),[4,(params={start:0,limit:100,search:""},designApi_awaiter(void 0,void 0,Promise,(function(){return designApi_generator(this,(function(_a){switch(_a.label){case 0:return[4,config_EXPRESS_API.get("/templates",{params})];case 1:return[2,_a.sent().data]}}))}))).catch((function(err){return err}))];case 1:return(res=_a.sent())instanceof Error||(templates=res.templates,(defaultTemplate=(null==payload?void 0:payload.templateId)?{id:null==payload?void 0:payload.templateId}:null==res?void 0:res.default)?(setDefaultTemplateId(parseInt(defaultTemplate.id)),setInsertVideoData((function(old){return InsertVideo_assign(InsertVideo_assign({},old),{templateId:parseInt(defaultTemplate.id)})})),templates.find((function(temp){return temp.id===defaultTemplate.id}))||(templates=InsertVideo_spreadArray([defaultTemplate],InsertVideo_read(templates),!1))):setInsertVideoData((function(old){return InsertVideo_assign(InsertVideo_assign({},old),{templateId:0})})),!(0,lodash.keyBy)(templates,"id")[-1]&&showWebsiteOverlayFeature&&templates.push({id:-1,title:"Website Overlay",thumbnailURL:"https://www.covideo.com/SampleTemplates/WebsiteOverlay_small.jpg",typeId:18}),setTemplatesLoading(!1),setTemplates(templates),setTemplatesOptions(templates)),[2]}var params}))}))},fetchOverlays=function(){return InsertVideo_awaiter(void 0,void 0,void 0,(function(){var res,websiteUrls;return InsertVideo_generator(this,(function(_a){switch(_a.label){case 0:return showWebsiteOverlayFeature?(setOverlaysLoading(!0),[4,(params={start:0,limit:100,search:""},designApi_awaiter(void 0,void 0,Promise,(function(){return designApi_generator(this,(function(_a){switch(_a.label){case 0:return[4,config_EXPRESS_API.get("/overlays",{params})];case 1:return[2,_a.sent().data]}}))}))).catch((function(err){return err}))]):[3,2];case 1:if((res=_a.sent())instanceof Error)return[2];websiteUrls=res.websiteUrls,setOverlaysLoading(!1),setOverlays(websiteUrls),_a.label=2;case 2:return[2]}var params}))}))},getMarkAsSentPayload=function(){var useAutomotive=isAutomotiveSales&&0===insertVideoData.templateId,allowReactions=!!selectedCheckboxes.some((function(c){return"enableReactions"===c.value}));return{videoShareSetData:{videoId,vin:"pending"!==vin?vin:"",templateId:insertVideoData.templateId||0,linksetId:insertVideoData.linksetId||0,overlayId:insertVideoData.overlayId||0,allowReactions},useAutomotive}};(0,react.useEffect)((function(){if(InsertVideo_awaiter(void 0,void 0,void 0,(function(){var data;return InsertVideo_generator(this,(function(_a){switch(_a.label){case 0:return setVideoLoading(!0),[4,getVideo(videoId)];case 1:return(data=_a.sent())&&setVideo(data),setVideoLoading(!1),[2]}}))})),isAutomotive&&InsertVideo_awaiter(void 0,void 0,void 0,(function(){var data;return InsertVideo_generator(this,(function(_a){switch(_a.label){case 0:return setVideoLoading(!0),[4,(id=videoId,videoRequestApi_awaiter(void 0,void 0,void 0,(function(){return videoRequestApi_generator(this,(function(_a){switch(_a.label){case 0:return[4,config_EXPRESS_API.get("/video-requests/".concat(id,"/get-by-videoid"))];case 1:return[2,_a.sent().data]}}))})))];case 1:return(data=_a.sent())&&setVin(data.vin||(null==payload?void 0:payload.vin)||""),setVideoLoading(!1),[2]}var id}))})),InsertVideo_awaiter(void 0,void 0,void 0,(function(){var res,linksets;return InsertVideo_generator(this,(function(_a){switch(_a.label){case 0:return setLinksetsLoading(!0),[4,(params={start:0,limit:100,search:""},designApi_awaiter(void 0,void 0,Promise,(function(){var _a,search,_b,start,_c,limit;return designApi_generator(this,(function(_d){switch(_d.label){case 0:return _a=params.search,search=void 0===_a?"":_a,_b=params.start,start=void 0===_b?0:_b,_c=params.limit,limit=void 0===_c?0:_c,[4,config_EXPRESS_API.get("/exitlinksets",{params:{search,start,limit}})];case 1:return[2,_d.sent().data]}}))}))).catch((function(err){return err}))];case 1:return(res=_a.sent())instanceof Error||(linksets=res.linksets,setLinksetsLoading(!1),setLinksets(linksets)),[2]}var params}))})),showLPOptions&&(fetchTemplates(),fetchOverlays()),reactionsCustomerEnabled){if(reactionsEnabledByDefault){if(!1!==(null==payload?void 0:payload.allowReactions))return void setSelectedCheckboxes((function(prevValue){return InsertVideo_spreadArray(InsertVideo_spreadArray([],InsertVideo_read(prevValue),!1),InsertVideo_read(insertVideoCheckboxes.filter((function(checkbox){return"enableReactions"===checkbox.value}))),!1)}));setSelectedCheckboxes([])}}else setInsertVideoCheckboxes((function(prevValue){return prevValue.filter((function(checkbox){return"enableReactions"!==checkbox.value}))}))}),[videoId]),(0,react.useEffect)((function(){setTrimValue([0,videoDuration])}),[videoDuration]),(0,react.useEffect)((function(){var _a;if("pending"!==vin){if(vin||(setShowLPOptions(!1),setInsertVideoData((function(old){return InsertVideo_assign(InsertVideo_assign({},old),{vin:""})}))),hasQuotibleAccess||!vin&&!templates.length)return fetchTemplates(),void fetchOverlays();if(1===parseInt((null===(_a=userData.customer.isUsingLandingPageDesign)||void 0===_a?void 0:_a.toString())||"0",10))setTemplatesOptions(templates);else{if(!vin&&templates.length)return setTemplatesOptions(templates),void setInsertVideoData((function(old){return InsertVideo_assign(InsertVideo_assign({},old),{templateId:defaultTemplateId})}));setTemplatesOptions([salesServicePageOption]),setInsertVideoData((function(old){return InsertVideo_assign(InsertVideo_assign({},old),{templateId:0})}))}}}),[vin,videoId]),(0,react.useEffect)((function(){!showLPOptions||insertVideoData.templateId||templatesLoading||templates.length>0&&setInsertVideoData((function(old){return InsertVideo_assign(InsertVideo_assign({},old),{templateId:templates[0].id})}))}),[insertVideoData,templates,templatesLoading,videoId]),(0,react.useEffect)((function(){""!==insertVideoData.overlayId||overlaysLoading||overlays.length>0&&setInsertVideoData((function(old){return InsertVideo_assign(InsertVideo_assign({},old),{overlayId:overlays[0].id})}))}),[insertVideoData,overlays,overlaysLoading,videoId]),(0,react.useEffect)((function(){""!==insertVideoData.linksetId||linksetsLoading||linksets.forEach((function(linkSetData){linkSetData.defaultLinks&&setInsertVideoData((function(old){return InsertVideo_assign(InsertVideo_assign({},old),{linksetId:linkSetData.id})}))}))}),[insertVideoData,linksets,linksetsLoading,videoId]),(0,react.useEffect)((function(){var checkTrim=checkIfVideoIsTrimmed({trimStart:trimValue[0],trimEnd:trimValue[1],videoDuration});return setIsVideoTrimmed(checkTrim),function(){setIsVideoTrimmed(!1)}}),[trimValue,videoDuration]);var videoRef=(0,react.createRef)();if((0,react.useEffect)((function(){pushToDataLayer({event:"covideo-pageview",page_application:"CRM Video Lite",page_url:"https://video.connectcdk.com/embed/home/send-and-share/".concat(videoId),page_location:"Home",page_section:"Videos",user_id:userData.email,is_internal_user:userData.email.includes("cdk")||userData.email.includes("covideo")})}),[]),videoLoading)return(0,jsx_runtime.jsx)(LoadingIndicator,{isLoading:videoLoading});var disableInsert=templatesLoading||linksetsLoading||overlaysLoading||-1===insertVideoData.templateId&&!insertVideoData.overlayId||isVideoProcessing;return(0,jsx_runtime.jsxs)(InsertVideo_Wrapper,{children:[(0,jsx_runtime.jsx)(TopBar,{left:(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{text:"Back",icon:(0,jsx_runtime.jsx)(md_index_esm.MGo,{size:"18"}),onClick:function(){return history.push("/")},variant:"transparent",style:{color:"white"}}),center:(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{}),right:(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[isVideoTrimmed&&(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{variant:isCdkEnviroment?"white":"secondary",onClick:function(){return InsertVideo_awaiter(void 0,void 0,void 0,(function(){var trimmedVideoData,historyState;return InsertVideo_generator(this,(function(_a){switch(_a.label){case 0:return isVideoTrimmed?(setIsVideoTrimmingLoading(!0),[4,InsertVideo_awaiter(void 0,void 0,void 0,(function(){return InsertVideo_generator(this,(function(_a){switch(_a.label){case 0:return _a.trys.push([0,2,,3]),[4,trimVideo(videoId,{duration:trimValue[1],start:trimValue[0],title:video.title})];case 1:return[2,_a.sent()];case 2:return _a.sent(),toast({message:"Something went wrong while trimming the video, try again later!"}),[3,3];case 3:return[2]}}))}))]):[3,2];case 1:trimmedVideoData=_a.sent(),setIsVideoTrimmingLoading(!1),historyState=getMarkAsSentPayload().videoShareSetData,setDefaultTemplateId(historyState.templateId),setIsVideoTrimmed(!1),history.push("/insert-video/".concat(trimmedVideoData.id),{payload:InsertVideo_assign({},historyState)}),_a.label=2;case 2:return[2]}}))}))},text:containerWidth>screenSizes_sm?"Trim Video":"Trim",disabled:isVideoTrimmingLoading,icon:isVideoTrimmingLoading?(0,jsx_runtime.jsx)(Spinner,{size:12}):(0,jsx_runtime.jsx)(md_index_esm.Tm5,{size:18})}),showQuickshareFeature&&!isVideoTrimmed&&(0,jsx_runtime.jsx)(CopyVideoButton,{video,disable:disableInsert,getMarkAsSentPayload,onCRMClick:function(){return InsertVideo_awaiter(void 0,void 0,void 0,(function(){var payload,selectedLandingPage,selectedLinkset;return InsertVideo_generator(this,(function(_a){return payload=getMarkAsSentPayload(),selectedLandingPage=templatesOptions.find((function(o){return o.id===payload.videoShareSetData.templateId})),selectedLinkset=linksets.find((function(o){return o.id===payload.videoShareSetData.linksetId})),trackInsertVideoMessage({video,landing_page:(null==selectedLandingPage?void 0:selectedLandingPage.title)||"",call_to_actions:(null==selectedLinkset?void 0:selectedLinkset.title)||"",event_name:"Copy Video Message",vin:payload.videoShareSetData.vin||""}),[2]}))}))}}),showInsertFeature&&!isVideoTrimmed&&(0,jsx_runtime.jsx)(InsertButton,{video,disable:disableInsert,getMarkAsSentPayload,onCRMClick:function(){return InsertVideo_awaiter(void 0,void 0,void 0,(function(){var payload,selectedLandingPage,selectedLinkset;return InsertVideo_generator(this,(function(_a){return payload=getMarkAsSentPayload(),selectedLandingPage=templatesOptions.find((function(o){return o.id===payload.videoShareSetData.templateId})),selectedLinkset=linksets.find((function(o){return o.id===payload.videoShareSetData.linksetId})),trackInsertVideoMessage({video,landing_page:(null==selectedLandingPage?void 0:selectedLandingPage.title)||"",call_to_actions:(null==selectedLinkset?void 0:selectedLinkset.title)||"",event_name:"Insert Video Message",vin:payload.videoShareSetData.vin||""}),[2]}))}))}})]})}),(0,jsx_runtime.jsx)(Container,{children:(0,jsx_runtime.jsxs)(ContentWrapper,{children:[(0,jsx_runtime.jsxs)(Main,{children:[(0,jsx_runtime.jsxs)(VideoWrapper,{children:[(0,jsx_runtime.jsx)(VideoPlayer,{videoId,videoRef,autoplay:!1,height:"247px",FullscreenVideoWrapperBackgroundColor:colors.black[100],borderBottomRadius:"0px",videoSource:video.videoSource||"",playerBackgroundColor:video.playerBackgroundColor||"",setVideoDuration,setIsVideoLoading,setVideoIsProcessing:setIsVideoProcessing}),(0,jsx_runtime.jsxs)(InsertVideo_Content,{children:[(0,jsx_runtime.jsx)(InsertVideo_Title,{children:video.title}),(0,jsx_runtime.jsxs)(InsertVideo_Date,{children:[(0,jsx_runtime.jsx)(io_index_esm.aJu,{size:16,color:colors.neutral[40],style:{marginRight:6}}),video.recordDate]})]})]}),showTrimFeature&&(0,jsx_runtime.jsx)(trim_Trim,{isVideoTrimmed,setValue:setTrimValue,value:trimValue,videoDuration,videoRef,videoSource:(null==video?void 0:video.videoSource)||"",valueRef:trimDurationRef,isVideoLoading})]}),(showLandingPageFeature||showCTAFeature||showReactionsAndCommentsFeature)&&(0,jsx_runtime.jsxs)(Side,{children:[(0,jsx_runtime.jsx)(InsertVideoSettings,{insertVideoData,setInsertVideoData,overlaysData:overlays,templatesData:templatesOptions,linksetsData:linksets,templatesLoading,linksetsLoading,overlaysLoading,checkboxes:insertVideoCheckboxes,selectedCheckboxes,setSelectedCheckboxes}),isAutomotiveSales&&(0,jsx_runtime.jsx)(VehicleSearch,{onChangeVehicle:function(item){setVin((null==item?void 0:item.vin)||""),setAddingVehicle(!1)},selectedVin:vin,fetchSold:!1,addingVehicle,handleChangeVehicleButtonPress:function(){setVin(""),setAddingVehicle(!0)},handleRemoveVehicleButtonPress:function(){return setVin("")},setAddingVehicle})]})]})})]})},VideoPreview_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},VideoPreview_assign=function(){return VideoPreview_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},VideoPreview_assign.apply(this,arguments)},VideoPreview_Wrapper=styled_components_browser_esm.Ay.div(VideoPreview_templateObject_1||(VideoPreview_templateObject_1=VideoPreview_makeTemplateObject(["\n display: flex;\n justify-content: center;\n align-items: flex-start;\n gap: 32px;\n margin: ",";\n"],["\n display: flex;\n justify-content: center;\n align-items: flex-start;\n gap: 32px;\n margin: ",";\n"])),(function(_a){return _a.margin})),VideoPlayerWrapper=styled_components_browser_esm.Ay.div(VideoPreview_templateObject_2||(VideoPreview_templateObject_2=VideoPreview_makeTemplateObject(["\n width: ",";\n > video {\n display: block;\n width: 100%;\n border-radius: 4px;\n height: ",";\n object-fit: contain;\n background: ",";\n }\n"],["\n width: ",";\n > video {\n display: block;\n width: 100%;\n border-radius: 4px;\n height: ",";\n object-fit: contain;\n background: ",";\n }\n"])),(function(_a){var width=_a.width;return"".concat(width,"px")}),(function(_a){var width=_a.width;return"".concat(.5625*width,"px")}),(function(_a){return _a.theme.colors.primary[100]})),VideoPreview=function(_a){var video=_a.video,videoRef=_a.videoRef,_b=_a.width,width=void 0===_b?696:_b,_c=_a.margin,margin=void 0===_c?"0":_c,_d=_a.useCovideoPlayer,useCovideoPlayer=void 0!==_d&&_d;return(0,jsx_runtime.jsxs)(VideoPreview_Wrapper,VideoPreview_assign({margin},{children:[!useCovideoPlayer&&(0,jsx_runtime.jsx)(VideoPlayerWrapper,VideoPreview_assign({width},{children:(0,jsx_runtime.jsx)("video",VideoPreview_assign({ref:videoRef},!functions_isSafari&&{preload:"metadata"},{width,playsInline:!0,controls:!1},{children:(0,jsx_runtime.jsx)("source",{src:video.videoSource,type:"video/mp4"})}))})),useCovideoPlayer&&(0,jsx_runtime.jsx)(VideoPlayer,{width:"".concat(width,"px"),playerBackgroundColor:video.playerBackgroundColor||"",videoSource:video.videoSource,videoId:video.id,playButtonPosition:video.playButtonPosition||"",playerIconsColor:video.playerIconsAndTextColor||"",videoRef,autoplay:!1,disableControls:!0,startWithControls:!1})]}))},bs_index_esm=__webpack_require__("./node_modules/react-icons/bs/index.esm.js"),useMediaRecorder_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},useMediaRecorder_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},useMediaRecorder_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},stopStream=function(s){try{s.getTracks().forEach((function(t){return t.stop()}))}catch(e){}};!function(RecorderErrors){RecorderErrors.AbortError="media_aborted",RecorderErrors.NotAllowedError="permission_denied",RecorderErrors.NotFoundError="no_specified_media_found",RecorderErrors.NotReadableError="media_in_use",RecorderErrors.OverconstrainedError="invalid_media_constraints",RecorderErrors.TypeError="no_constraints",RecorderErrors.NONE="",RecorderErrors.NO_RECORDER="recorder_error"}(RecorderErrors||(RecorderErrors={}));var BITRATES={low:1e6,standard:25e5,high:5e6,ultra:8e6};function useMediaRecorder(_a){var _this=this,_b=_a.audio,audio=void 0===_b||_b,_c=_a.video,video=void 0!==_c&&_c,_d=_a.onStop,onStop=void 0===_d?function(){return null}:_d,blobPropertyBag=_a.blobPropertyBag,_e=_a.screen,screen=void 0!==_e&&_e,_f=_a.mediaRecorderOptions,mediaRecorderOptions=void 0===_f?null:_f,_g=_a.mimeType,mimeType=void 0===_g?"":_g,_h=_a.quality,quality=void 0===_h?"low":_h,mediaRecorder=(0,react.useRef)(null),mediaChunks=(0,react.useRef)([]),mediaStream=(0,react.useRef)(null),_j=useMediaRecorder_read((0,react.useState)("idle"),2),status=_j[0],setStatus=_j[1],_k=useMediaRecorder_read((0,react.useState)(!1),2),isAudioMuted=_k[0],setIsAudioMuted=_k[1],_l=useMediaRecorder_read((0,react.useState)(null),2),mediaBlobUrl=_l[0],setMediaBlobUrl=_l[1],_m=useMediaRecorder_read((0,react.useState)("NONE"),2),error=_m[0],setError=_m[1],mountedRef=(0,react.useRef)(!1),videoBitsPerSecond=BITRATES[quality]||BITRATES.low;window.streams||(window.streams=[]),window.streams=window.streams.filter(Boolean);var getMediaStream=(0,react.useCallback)((function(){return useMediaRecorder_awaiter(_this,void 0,void 0,(function(){var requiredMedia,stream,audioStream,error_1;return useMediaRecorder_generator(this,(function(_a){switch(_a.label){case 0:setStatus("acquiring_media"),requiredMedia={audio:"boolean"==typeof audio?!!audio:audio,video:"boolean"==typeof video?!!video:video},_a.label=1;case 1:return _a.trys.push([1,8,,9]),screen?[4,window.navigator.mediaDevices.getDisplayMedia({video:video||!0})]:[3,5];case 2:return stream=_a.sent(),window.streams.push(stream),stream&&audio?[4,window.navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0}})]:[3,4];case 3:audioStream=_a.sent(),window.streams.push(audioStream),audioStream.getAudioTracks().forEach((function(audioTrack){return stream.addTrack(audioTrack)})),_a.label=4;case 4:return mediaStream.current=stream,[3,7];case 5:return[4,window.navigator.mediaDevices.getUserMedia(requiredMedia)];case 6:stream=_a.sent(),window.streams.push(stream),mediaStream.current=stream,_a.label=7;case 7:return mountedRef.current?(stream&&setStatus("idle"),[3,9]):(stopStream(stream),[2]);case 8:return error_1=_a.sent(),stopStream(stream),stopStream(audioStream),setError(error_1.name),setStatus("idle"),[3,9];case 9:return[2]}}))}))}),[audio,video,screen]);(0,react.useEffect)((function(){return mountedRef.current=!0,function(){mountedRef.current=!1}}),[]),(0,react.useEffect)((function(){if(!window.MediaRecorder)throw new Error("Unsupported Browser");if(screen&&!window.navigator.mediaDevices.getDisplayMedia)throw new Error("This browser doesn't support screen capturing");var checkConstraints=function(mediaType){var supportedMediaConstraints=navigator.mediaDevices.getSupportedConstraints(),unSupportedConstraints=Object.keys(mediaType).filter((function(constraint){return!supportedMediaConstraints[constraint]}));unSupportedConstraints.length>0&&console.error("The constraints ".concat(unSupportedConstraints.join(",")," doesn't support on this browser. Please check your ReactMediaRecorder component."))};"object"==typeof audio&&checkConstraints(audio),"object"==typeof video&&checkConstraints(video),mediaRecorderOptions&&mediaRecorderOptions.mimeType&&(MediaRecorder.isTypeSupported(mediaRecorderOptions.mimeType)||console.error("The specified MIME type you supplied for MediaRecorder doesn't support this browser")),mediaStream.current||getMediaStream()}),[audio,screen,video,getMediaStream,mediaRecorderOptions]);var onRecordingActive=function(_a){var data=_a.data;mediaChunks.current.push(data)},onRecordingStop=function(){var chunk=useMediaRecorder_read(mediaChunks.current,1)[0],blobProperty=Object.assign({type:chunk.type},blobPropertyBag||(video?{type:"video/mp4"}:{type:"audio/wav"})),blob=new Blob(mediaChunks.current,blobProperty),url=URL.createObjectURL(blob);setStatus("stopped"),setMediaBlobUrl(url),onStop(url,blob)},muteAudio=function(mute){setIsAudioMuted(mute),mediaStream.current&&mediaStream.current.getAudioTracks().forEach((function(audioTrack){return audioTrack.enabled=!mute}))},previewStream=mediaStream.current?new MediaStream(mediaStream.current.getVideoTracks()):null;window.streams.push(previewStream);var previewAudioStream=mediaStream.current?new MediaStream(mediaStream.current.getAudioTracks()):null;return window.streams.push(previewAudioStream),{error:RecorderErrors[error],muteAudio:function(){return muteAudio(!0)},unMuteAudio:function(){return muteAudio(!1)},startRecording:function(){return useMediaRecorder_awaiter(_this,void 0,void 0,(function(){return useMediaRecorder_generator(this,(function(_a){switch(_a.label){case 0:return setError("NONE"),mediaStream.current?[3,2]:[4,getMediaStream()];case 1:_a.sent(),_a.label=2;case 2:return mediaStream.current?mediaStream.current.getTracks().some((function(track){return"ended"===track.readyState}))?[4,getMediaStream()]:[3,4]:[3,5];case 3:_a.sent(),_a.label=4;case 4:mediaRecorder.current=new MediaRecorder(mediaStream.current,{mimeType,videoBitsPerSecond}),mediaRecorder.current.ondataavailable=onRecordingActive,mediaRecorder.current.onstop=onRecordingStop,mediaRecorder.current.onerror=function(){setError("NO_RECORDER"),setStatus("idle")},mediaRecorder.current.start(),setStatus("recording"),_a.label=5;case 5:return[2]}}))}))},startRecordingForCanvas:function(canvasStream){return useMediaRecorder_awaiter(_this,void 0,void 0,(function(){var audioStream;return useMediaRecorder_generator(this,(function(_a){switch(_a.label){case 0:return canvasStream?audio?[4,window.navigator.mediaDevices.getUserMedia({audio})]:[3,2]:(setError("NO_RECORDER"),[2]);case 1:audioStream=_a.sent(),window.streams.push(audioStream),audioStream.getAudioTracks().forEach((function(audioTrack){return canvasStream.addTrack(audioTrack)})),_a.label=2;case 2:return mediaRecorder.current=new MediaRecorder(canvasStream,{mimeType,videoBitsPerSecond}),mediaRecorder.current.ondataavailable=onRecordingActive,mediaRecorder.current.onstop=onRecordingStop,mediaRecorder.current.onerror=function(){setError("NO_RECORDER"),setStatus("idle")},mediaRecorder.current.start(),setStatus("recording"),[2]}}))}))},pauseRecording:function(){mediaRecorder.current&&"recording"===mediaRecorder.current.state&&mediaRecorder.current.pause()},resumeRecording:function(){mediaRecorder.current&&"paused"===mediaRecorder.current.state&&mediaRecorder.current.resume()},stopRecording:function(){mediaRecorder.current&&"inactive"!==mediaRecorder.current.state&&(setStatus("stopping"),mediaRecorder.current.stop(),mediaStream.current&&mediaStream.current.getTracks().forEach((function(track){return track.stop()})),mediaChunks.current=[])},mediaBlobUrl,status,isAudioMuted,previewStream,previewAudioStream,clearBlobUrl:function(){return setMediaBlobUrl(null)}}}var ModalPrompt_templateObject_1,ModalPrompt_templateObject_2,ModalPrompt_templateObject_3,ModalPrompt_templateObject_4,ModalPrompt_templateObject_5,RecordingStatus,PreviewingStatus,ModalPrompt_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},ModalPrompt_ModalItem=styled_components_browser_esm.Ay.div(ModalPrompt_templateObject_1||(ModalPrompt_templateObject_1=ModalPrompt_makeTemplateObject(["\n box-sizing: border-box;\n width: 400px;\n max-width: 100%;\n padding: 32px;\n min-height: 208px;\n background-color: ",";\n"],["\n box-sizing: border-box;\n width: 400px;\n max-width: 100%;\n padding: 32px;\n min-height: 208px;\n background-color: ",";\n"])),palette_white),ModalPrompt_Header=styled_components_browser_esm.Ay.div(ModalPrompt_templateObject_2||(ModalPrompt_templateObject_2=ModalPrompt_makeTemplateObject(["\n display: flex;\n color: ",";\n align-items: center;\n justify-content: space-between;\n font-weight: 700;\n font-size: 18px;\n line-height: 24px;\n"],["\n display: flex;\n color: ",";\n align-items: center;\n justify-content: space-between;\n font-weight: 700;\n font-size: 18px;\n line-height: 24px;\n"])),palette_black_1_100),ModalPrompt_CloseButtonWrapper=styled_components_browser_esm.Ay.label(ModalPrompt_templateObject_3||(ModalPrompt_templateObject_3=ModalPrompt_makeTemplateObject(["\n display: flex;\n align-items: center;\n margin: 0;\n padding: 0;\n color: ",";\n &:hover {\n cursor: pointer;\n }\n"],["\n display: flex;\n align-items: center;\n margin: 0;\n padding: 0;\n color: ",";\n &:hover {\n cursor: pointer;\n }\n"])),palette_themeDark50Percent),ModalPrompt_Content=styled_components_browser_esm.Ay.div(ModalPrompt_templateObject_4||(ModalPrompt_templateObject_4=ModalPrompt_makeTemplateObject(["\n margin-top: 32px;\n"],["\n margin-top: 32px;\n"]))),ModalPrompt_ButtonsWrapper=styled_components_browser_esm.Ay.section(ModalPrompt_templateObject_5||(ModalPrompt_templateObject_5=ModalPrompt_makeTemplateObject(["\n display: flex;\n flex-direction: row-reverse;\n margin-top: 48px;\n gap: 8px;\n gap: 12px;\n"],["\n display: flex;\n flex-direction: row-reverse;\n margin-top: 48px;\n gap: 8px;\n gap: 12px;\n"]))),ModalPrompt=function(_a){var title=_a.title,content=_a.content,primaryButtonText=_a.primaryButtonText,secondaryButtonText=_a.secondaryButtonText,handleModalClose=_a.handleModalClose,handleSubmit=_a.handleSubmit,_b=_a.primaryButtonType,primaryButtonType=void 0===_b?"primary":_b,isCdkEnviroment=(0,styled_components_browser_esm.DP)().isCdkEnviroment;return(0,jsx_runtime.jsx)(Modal_Modal,{children:(0,jsx_runtime.jsxs)(ModalPrompt_ModalItem,{children:[(0,jsx_runtime.jsxs)(ModalPrompt_Header,{children:[title,(0,jsx_runtime.jsx)(ModalPrompt_CloseButtonWrapper,{children:(0,jsx_runtime.jsx)(images_CloseIcon,{width:"24px",height:"24px",onClick:handleModalClose})})]}),(0,jsx_runtime.jsxs)(ModalPrompt_Content,{children:[content,(0,jsx_runtime.jsxs)(ModalPrompt_ButtonsWrapper,{children:[(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{text:primaryButtonText,variant:primaryButtonType,onClick:handleSubmit}),(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{text:secondaryButtonText,variant:isCdkEnviroment?"text":"primary",onClick:handleModalClose})]})]})]})})},AudioRecorder_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},AudioRecorder_assign=function(){return AudioRecorder_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},AudioRecorder_assign.apply(this,arguments)},AudioRecorder_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},AudioRecorder_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},AudioRecorder_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},AudioRecorder_spreadArray=function(to,from,pack){if(pack||2===arguments.length)for(var ar,i=0,l=from.length;i<l;i++)!ar&&i in from||(ar||(ar=Array.prototype.slice.call(from,0,i)),ar[i]=from[i]);return to.concat(ar||Array.prototype.slice.call(from))},AudioRecorder_Wrapper=styled_components_browser_esm.Ay.div(AudioRecorder_templateObject_2||(AudioRecorder_templateObject_2=AudioRecorder_makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 11px;\n width: ",";\n max-width: 100%;\n margin: ",";\n ","\n"],["\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 11px;\n width: ",";\n max-width: 100%;\n margin: ",";\n ","\n"])),(function(_a){var width=_a.width;return"".concat(width,"px")}),(function(_a){return _a.margin}),(function(_a){return _a.disabled&&(0,styled_components_browser_esm.AH)(AudioRecorder_templateObject_1||(AudioRecorder_templateObject_1=AudioRecorder_makeTemplateObject(["\n pointer-events: none;\n opacity: 0.4;\n "],["\n pointer-events: none;\n opacity: 0.4;\n "])))})),AudioRecorder_ButtonsWrapper=styled_components_browser_esm.Ay.div(AudioRecorder_templateObject_3||(AudioRecorder_templateObject_3=AudioRecorder_makeTemplateObject(["\n display: flex;\n justify-content: center;\n gap: 8px;\n flex-shrink: 0;\n"],["\n display: flex;\n justify-content: center;\n gap: 8px;\n flex-shrink: 0;\n"]))),RecordingProgress=styled_components_browser_esm.Ay.div(AudioRecorder_templateObject_5||(AudioRecorder_templateObject_5=AudioRecorder_makeTemplateObject(["\n position: relative;\n width: 100%;\n height: 40px;\n box-sizing: border-box;\n border-radius: 6px;\n display: flex;\n align-items: center;\n background: ",";\n border-radius: 6px;\n ","\n"],["\n position: relative;\n width: 100%;\n height: 40px;\n box-sizing: border-box;\n border-radius: 6px;\n display: flex;\n align-items: center;\n background: ",";\n border-radius: 6px;\n ","\n"])),(function(_a){return _a.theme.colors.primary[5]}),(function(_a){return _a.disabled&&(0,styled_components_browser_esm.AH)(AudioRecorder_templateObject_4||(AudioRecorder_templateObject_4=AudioRecorder_makeTemplateObject(["\n cursor: not-allowed;\n "],["\n cursor: not-allowed;\n "])))})),AudioRecorder_ProgressBar=styled_components_browser_esm.Ay.div(AudioRecorder_templateObject_6||(AudioRecorder_templateObject_6=AudioRecorder_makeTemplateObject(["\n position: relative;\n height: 12px;\n width: 100%;\n margin-right: 12px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n background: #ffffff;\n border-radius: 8px;\n"],["\n position: relative;\n height: 12px;\n width: 100%;\n margin-right: 12px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n background: #ffffff;\n border-radius: 8px;\n"]))),Done=styled_components_browser_esm.Ay.div(AudioRecorder_templateObject_7||(AudioRecorder_templateObject_7=AudioRecorder_makeTemplateObject(["\n position: absolute;\n top: 2px;\n bottom: 2px;\n left: 0;\n width: ",";\n background: ",";\n border-radius: 8px;\n"],["\n position: absolute;\n top: 2px;\n bottom: 2px;\n left: 0;\n width: ",";\n background: ",";\n border-radius: 8px;\n"])),(function(_a){var position=_a.position;return"".concat(position,"%")}),(function(_a){return _a.background})),RecordingInfo=styled_components_browser_esm.Ay.div(AudioRecorder_templateObject_8||(AudioRecorder_templateObject_8=AudioRecorder_makeTemplateObject(["\n box-sizing: border-box;\n width: 100px;\n flex-grow: 0;\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0 13px;\n"],["\n box-sizing: border-box;\n width: 100px;\n flex-grow: 0;\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0 13px;\n"]))),MicIconWrapper=styled_components_browser_esm.Ay.div(AudioRecorder_templateObject_9||(AudioRecorder_templateObject_9=AudioRecorder_makeTemplateObject(["\n flex-grow: 0;\n flex-shrink: 0;\n margin-right: 17px;\n padding-top: 4px;\n"],["\n flex-grow: 0;\n flex-shrink: 0;\n margin-right: 17px;\n padding-top: 4px;\n"]))),CurrentTime=styled_components_browser_esm.Ay.div(AudioRecorder_templateObject_10||(AudioRecorder_templateObject_10=AudioRecorder_makeTemplateObject(["\n font-weight: 500;\n font-size: 14px;\n line-height: 24px;\n color: ",";\n"],["\n font-weight: 500;\n font-size: 14px;\n line-height: 24px;\n color: ",";\n"])),(function(_a){return _a.theme.colors.neutral[100]})),AudioRecorder_Duration=styled_components_browser_esm.Ay.div(AudioRecorder_templateObject_11||(AudioRecorder_templateObject_11=AudioRecorder_makeTemplateObject(["\n font-weight: 500;\n font-size: 14px;\n line-height: 24px;\n width: 60px;\n padding-left: 12px;\n margin-right: 12px;\n color: ",";\n"],["\n font-weight: 500;\n font-size: 14px;\n line-height: 24px;\n width: 60px;\n padding-left: 12px;\n margin-right: 12px;\n color: ",";\n"])),(function(_a){return _a.theme.colors.neutral[60]})),AudioRecorder_Slider=styled_components_browser_esm.Ay.input(AudioRecorder_templateObject_13||(AudioRecorder_templateObject_13=AudioRecorder_makeTemplateObject(["\n -webkit-appearance: none;\n width: 100%;\n background: transparent;\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n z-index: 3;\n cursor: pointer;\n &::-webkit-slider-thumb {\n -webkit-appearance: none;\n width: 4px;\n height: 40px;\n margin-top: 6px;\n z-index: 3;\n }\n &::-moz-range-thumb {\n width: 4px;\n height: 40px;\n margin-top: 6px;\n z-index: 3;\n }\n &::-ms-thumb {\n width: 4px;\n height: 40px;\n z-index: 3;\n }\n ",";\n &:focus {\n outline: none;\n }\n &::-ms-track {\n width: 100%;\n cursor: pointer;\n background: transparent;\n border-color: transparent;\n color: transparent;\n }\n"],["\n -webkit-appearance: none;\n width: 100%;\n background: transparent;\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n z-index: 3;\n cursor: pointer;\n &::-webkit-slider-thumb {\n -webkit-appearance: none;\n width: 4px;\n height: 40px;\n margin-top: 6px;\n z-index: 3;\n }\n &::-moz-range-thumb {\n width: 4px;\n height: 40px;\n margin-top: 6px;\n z-index: 3;\n }\n &::-ms-thumb {\n width: 4px;\n height: 40px;\n z-index: 3;\n }\n ",";\n &:focus {\n outline: none;\n }\n &::-ms-track {\n width: 100%;\n cursor: pointer;\n background: transparent;\n border-color: transparent;\n color: transparent;\n }\n"])),(function(_a){return _a.disabled&&(0,styled_components_browser_esm.AH)(AudioRecorder_templateObject_12||(AudioRecorder_templateObject_12=AudioRecorder_makeTemplateObject(["\n pointer-events: none;\n &::-webkit-slider-thumb {\n display: none;\n }\n &::-moz-range-thumb {\n display: none;\n }\n &::-ms-thumb {\n display: none;\n }\n "],["\n pointer-events: none;\n &::-webkit-slider-thumb {\n display: none;\n }\n &::-moz-range-thumb {\n display: none;\n }\n &::-ms-thumb {\n display: none;\n }\n "])))})),Audio=styled_components_browser_esm.Ay.audio(AudioRecorder_templateObject_14||(AudioRecorder_templateObject_14=AudioRecorder_makeTemplateObject(["\n display: none;\n"],["\n display: none;\n"]))),DEFAULT_SETTINGS={audioSource:{value:"default"}};!function(RecordingStatus){RecordingStatus.NotRecording="NotRecording",RecordingStatus.Recording="Recording",RecordingStatus.RecordingPaused="RecordingPaused",RecordingStatus.Finished="Finished"}(RecordingStatus||(RecordingStatus={})),function(PreviewingStatus){PreviewingStatus.NotPreviewing="NotPreviewing",PreviewingStatus.Previewing="Previewing",PreviewingStatus.PreviewingPaused="PreviewingPaused"}(PreviewingStatus||(PreviewingStatus={}));var AudioRecorder_templateObject_1,AudioRecorder_templateObject_2,AudioRecorder_templateObject_3,AudioRecorder_templateObject_4,AudioRecorder_templateObject_5,AudioRecorder_templateObject_6,AudioRecorder_templateObject_7,AudioRecorder_templateObject_8,AudioRecorder_templateObject_9,AudioRecorder_templateObject_10,AudioRecorder_templateObject_11,AudioRecorder_templateObject_12,AudioRecorder_templateObject_13,AudioRecorder_templateObject_14,ModalInputText_templateObject_1,ModalInputText_templateObject_2,ModalInputText_templateObject_3,ModalInputText_templateObject_4,ModalInputText_templateObject_5,ModalInputText_templateObject_6,components_Search_templateObject_1,components_Search_templateObject_2,components_Search_templateObject_3,components_Search_templateObject_4,components_PageInfo_templateObject_1,VEHICLE_CONDITION,AudioRecorder=function(_a){var _b,audio,video=_a.video,videoRef=_a.videoRef,onChangeVoiceoverValid=_a.onChangeVoiceoverValid,onRecordingUrlGeneration=_a.onRecordingUrlGeneration,handleShowCard=_a.handleShowCard,_c=_a.margin,margin=void 0===_c?"0":_c,_d=_a.width,width=void 0===_d?696:_d,_e=_a.disabled,disabled=void 0!==_e&&_e,containerWidth=useConfigurationContext().containerWidth,_f=(0,styled_components_browser_esm.DP)(),colors=_f.colors,isCdkEnviroment=_f.isCdkEnviroment,toast=useToastNotifications().toast,audioRef=(0,react.createRef)(),_g=AudioRecorder_read((0,react.useState)(RecordingStatus.NotRecording),2),recordingStatus=_g[0],setRecordingStatus=_g[1],_h=AudioRecorder_read((0,react.useState)(PreviewingStatus.NotPreviewing),2),previewingStatus=_h[0],setPreviewingStatus=_h[1],_j=AudioRecorder_read((0,react.useState)(0),2),currentTime=_j[0],setCurrentTime=_j[1],_k=AudioRecorder_read((0,react.useState)(),2),audioPlayer=_k[0],setAudioPlayer=_k[1],_l=AudioRecorder_read((0,react.useState)(!1),2),showRetakePrompt=_l[0],setShowRetakePrompt=_l[1],history=(0,react_router.W6)(),settings={audioSource:JSON.parse(localStorage.getItem(config_COOKIE_NAMES.recordSettings)||JSON.stringify(DEFAULT_SETTINGS)).audioSource};try{audio={deviceId:settings.audioSource.value}}catch(e){}settings&&settings.audioSource&&settings.audioSource.value||(audio=!1);var _m=useMediaRecorder({audio}),error=_m.error,startRecording=_m.startRecording,stopRecording=_m.stopRecording,pauseRecording=_m.pauseRecording,resumeRecording=_m.resumeRecording,mediaBlobUrl=_m.mediaBlobUrl;audio&&!error||(toast({message:"Please enable audio in your recording settings and try again!"}),history.push("/record/home"));var stopStream=function(s){try{s.getTracks().forEach((function(t){return t.stop()}))}catch(e){}};(0,react.useEffect)((function(){return function(){AudioRecorder_spreadArray([],AudioRecorder_read(window.streams),!1).filter(Boolean).forEach((function(s){return stopStream(s)})),window.streams=[],setRecordingStatus(RecordingStatus.NotRecording),setPreviewingStatus(PreviewingStatus.NotPreviewing)}}),[]),(0,react.useEffect)((function(){var handleTimeUpdate=function(){var _a,currentTime=0;videoRef.current&&(currentTime=(null===(_a=null==videoRef?void 0:videoRef.current)||void 0===_a?void 0:_a.currentTime)||0,videoRef.current.currentTime>=videoRef.current.duration&&(currentTime=videoRef.current.duration)),setCurrentTime(currentTime)},handleVideoEnded=function(){stopRecording(),setRecordingStatus(RecordingStatus.Finished),setPreviewingStatus(PreviewingStatus.NotPreviewing)},handleVideoPlay=function(){setRecordingStatus((function(prev){return prev===RecordingStatus.Finished?prev:RecordingStatus.Recording})),setPreviewingStatus((function(prev){return prev===PreviewingStatus.PreviewingPaused?PreviewingStatus.Previewing:prev}))},handleVideoPause=function(){setRecordingStatus((function(prev){return prev===RecordingStatus.Finished?prev:RecordingStatus.RecordingPaused})),setPreviewingStatus((function(prev){return prev===PreviewingStatus.Previewing?PreviewingStatus.PreviewingPaused:prev}))},handleVideoSeeked=function(){videoRef.current&&audioPlayer&&(audioPlayer.currentTime=videoRef.current.currentTime)};return videoRef.current&&(videoRef.current.addEventListener("timeupdate",handleTimeUpdate,!0),videoRef.current.addEventListener("ended",handleVideoEnded,!0),videoRef.current.addEventListener("pause",handleVideoPause,!0),videoRef.current.addEventListener("play",handleVideoPlay,!0),videoRef.current.addEventListener("seeked",handleVideoSeeked,!0)),function(){videoRef.current&&(videoRef.current.removeEventListener("timeupdate",handleTimeUpdate,!0),videoRef.current.removeEventListener("ended",handleVideoEnded,!0),videoRef.current.removeEventListener("pause",handleVideoPause,!0),videoRef.current.removeEventListener("play",handleVideoPlay,!0),videoRef.current.removeEventListener("seeked",handleVideoSeeked,!0))}}),[videoRef]),(0,react.useEffect)((function(){onChangeVoiceoverValid(recordingStatus===RecordingStatus.Finished)}),[recordingStatus]),(0,react.useEffect)((function(){onRecordingUrlGeneration(mediaBlobUrl||""),mediaBlobUrl&&audioRef.current&&audioRef.current.load()}),[mediaBlobUrl]),(0,react.useEffect)((function(){audioRef.current&&setAudioPlayer(audioRef.current)}),[audioRef.current]);var isPreview=recordingStatus===RecordingStatus.Finished,isRecording=recordingStatus===RecordingStatus.Recording,duration=(null===(_b=null==videoRef?void 0:videoRef.current)||void 0===_b?void 0:_b.duration)||((null==video?void 0:video.videoLength)?(null==video?void 0:video.videoLength)/1e3:0),currentPosition=duration?currentTime?parseFloat(currentTime.toString())/parseFloat(duration.toString())*100:0:100,updatePosition=function(e){var position,newPosition=e.target.value.toString();position=(duration*(newPosition/100)).toString(),videoRef.current&&audioPlayer&&(videoRef.current.currentTime=parseFloat(position),audioPlayer.currentTime=parseFloat(position),audioPlayer.play(),videoRef.current.play(),setPreviewingStatus(PreviewingStatus.Previewing))},currentTimeMMSS=new Date(1e3*currentTime).toISOString().substring(14,19);return(0,jsx_runtime.jsxs)(AudioRecorder_Wrapper,AudioRecorder_assign({margin,width,disabled},{children:[(0,jsx_runtime.jsx)(Audio,AudioRecorder_assign({ref:audioRef},{children:(0,jsx_runtime.jsx)("source",{src:mediaBlobUrl||""})})),(0,jsx_runtime.jsxs)(AudioRecorder_ButtonsWrapper,{children:[recordingStatus===RecordingStatus.NotRecording&&(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{variant:isCdkEnviroment?"primary":"red",icon:(0,jsx_runtime.jsx)(bs_index_esm.TWk,{size:12}),text:"Record",onClick:function(){return AudioRecorder_awaiter(void 0,void 0,void 0,(function(){return AudioRecorder_generator(this,(function(_a){return videoRef.current?(null==handleShowCard||handleShowCard(!1),videoRef.current.volume=0,videoRef.current.play(),startRecording(),setRecordingStatus(RecordingStatus.Recording),[2]):[2]}))}))}}),recordingStatus===RecordingStatus.Recording&&(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{icon:(0,jsx_runtime.jsx)(md_index_esm.QG6,{}),text:"Pause",variant:"secondary",onClick:function(){videoRef.current&&(pauseRecording(),videoRef.current.pause(),setRecordingStatus(RecordingStatus.RecordingPaused))}})}),recordingStatus===RecordingStatus.RecordingPaused&&(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{icon:(0,jsx_runtime.jsx)(md_index_esm.XKH,{}),text:"Resume",variant:"primary",onClick:function(){return function(){var _a;videoRef.current&&(resumeRecording(),null===(_a=videoRef.current)||void 0===_a||_a.play(),setRecordingStatus(RecordingStatus.Recording))}()}}),recordingStatus===RecordingStatus.Finished&&previewingStatus===PreviewingStatus.NotPreviewing&&(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{icon:(0,jsx_runtime.jsx)(md_index_esm.XKH,{}),onClick:function(){videoRef.current&&audioPlayer&&(setPreviewingStatus(PreviewingStatus.Previewing),videoRef.current.currentTime=0,videoRef.current.play(),audioPlayer.play())}}),previewingStatus===PreviewingStatus.Previewing&&(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{icon:(0,jsx_runtime.jsx)(md_index_esm.QG6,{}),onClick:function(){videoRef.current&&audioPlayer&&(audioPlayer.pause(),videoRef.current.pause(),setPreviewingStatus(PreviewingStatus.PreviewingPaused))}}),previewingStatus===PreviewingStatus.PreviewingPaused&&(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{icon:(0,jsx_runtime.jsx)(md_index_esm.XKH,{}),onClick:function(){videoRef.current&&audioPlayer&&(audioPlayer.play(),videoRef.current.play(),setPreviewingStatus(PreviewingStatus.Previewing))}})]}),(0,jsx_runtime.jsxs)(RecordingProgress,AudioRecorder_assign({disabled:!isPreview,title:isPreview?"":"Controls disabled before preview."},{children:[(0,jsx_runtime.jsxs)(RecordingInfo,{children:[(0,jsx_runtime.jsx)(MicIconWrapper,{children:(0,jsx_runtime.jsx)(md_index_esm.NjB,{size:22,color:isRecording?colors.primary[100]:colors.neutral[60]})}),(0,jsx_runtime.jsx)(CurrentTime,{children:currentTimeMMSS})]}),(0,jsx_runtime.jsxs)(AudioRecorder_ProgressBar,{children:[(0,jsx_runtime.jsx)(AudioRecorder_Slider,{disabled:!isPreview,type:"range",min:"0",max:"100",value:currentPosition,onChange:function(e){return updatePosition(e)},step:"1"}),(0,jsx_runtime.jsx)(Done,{background:colors.primary[100],position:currentPosition})]}),(0,jsx_runtime.jsx)(AudioRecorder_Duration,{children:toMMSS(duration,0)})]})),[RecordingStatus.RecordingPaused,RecordingStatus.Finished].includes(recordingStatus)&&(0,jsx_runtime.jsx)(AudioRecorder_ButtonsWrapper,{children:(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{variant:isCdkEnviroment?"text":"destructive",icon:(0,jsx_runtime.jsx)(md_index_esm.joZ,{}),text:containerWidth>screenSizes_mb?"Start Over":"",onClick:function(){videoRef.current&&audioPlayer&&(audioPlayer.pause(),videoRef.current.pause(),previewingStatus!==PreviewingStatus.NotPreviewing&&setPreviewingStatus(PreviewingStatus.PreviewingPaused),recordingStatus!==RecordingStatus.Finished&&setRecordingStatus(RecordingStatus.RecordingPaused),setShowRetakePrompt(!0))}})}),showRetakePrompt&&(0,jsx_runtime.jsx)(ModalPrompt,{title:"Start Over?",content:(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"Your voiceover recording will be erased."}),secondaryButtonText:"Go Back",primaryButtonText:"Start Over",primaryButtonType:"primary",handleSubmit:function(){videoRef.current&&audioPlayer&&(setShowRetakePrompt(!1),stopRecording(),videoRef.current.pause(),videoRef.current.currentTime=0,audioPlayer.pause(),audioPlayer.currentTime=0,setRecordingStatus(RecordingStatus.NotRecording),setPreviewingStatus(PreviewingStatus.NotPreviewing))},handleModalClose:function(){return setShowRetakePrompt(!1)}})]}))},ModalInputText_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},ModalInputText_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},ModalInputText_ModalItem=styled_components_browser_esm.Ay.div(ModalInputText_templateObject_1||(ModalInputText_templateObject_1=ModalInputText_makeTemplateObject(["\n box-sizing: border-box;\n width: 400px;\n max-width: 100%;\n padding: 32px;\n min-height: 208px;\n background-color: ",";\n"],["\n box-sizing: border-box;\n width: 400px;\n max-width: 100%;\n padding: 32px;\n min-height: 208px;\n background-color: ",";\n"])),palette_white),ModalInputText_Header=styled_components_browser_esm.Ay.div(ModalInputText_templateObject_2||(ModalInputText_templateObject_2=ModalInputText_makeTemplateObject(["\n display: flex;\n color: ",";\n align-items: center;\n justify-content: space-between;\n font-weight: 700;\n font-size: 18px;\n line-height: 24px;\n"],["\n display: flex;\n color: ",";\n align-items: center;\n justify-content: space-between;\n font-weight: 700;\n font-size: 18px;\n line-height: 24px;\n"])),palette_black_1_100),ModalInputText_CloseButtonWrapper=styled_components_browser_esm.Ay.label(ModalInputText_templateObject_3||(ModalInputText_templateObject_3=ModalInputText_makeTemplateObject(["\n display: flex;\n align-items: center;\n margin: 0;\n padding: 0;\n color: ",";\n &:hover {\n cursor: pointer;\n }\n"],["\n display: flex;\n align-items: center;\n margin: 0;\n padding: 0;\n color: ",";\n &:hover {\n cursor: pointer;\n }\n"])),palette_themeDark50Percent),ModalInputText_Content=styled_components_browser_esm.Ay.div(ModalInputText_templateObject_4||(ModalInputText_templateObject_4=ModalInputText_makeTemplateObject(["\n margin-top: 32px;\n"],["\n margin-top: 32px;\n"]))),ModalInputText_Label=styled_components_browser_esm.Ay.div(ModalInputText_templateObject_5||(ModalInputText_templateObject_5=ModalInputText_makeTemplateObject(["\n font-weight: 500;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n margin-bottom: 8px;\n"],["\n font-weight: 500;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n margin-bottom: 8px;\n"])),palette_gray80),ModalInputText_ButtonsWrapper=styled_components_browser_esm.Ay.section(ModalInputText_templateObject_6||(ModalInputText_templateObject_6=ModalInputText_makeTemplateObject(["\n display: flex;\n flex-direction: row-reverse;\n margin-top: 48px;\n gap: 8px;\n"],["\n display: flex;\n flex-direction: row-reverse;\n margin-top: 48px;\n gap: 8px;\n"]))),ModalInputText=function(_a){var title=_a.title,label=_a.label,defaultValue=_a.defaultValue,primaryButtonText=_a.primaryButtonText,secondaryButtonText=_a.secondaryButtonText,handleModalClose=_a.handleModalClose,handleSubmit=_a.handleSubmit,_b=ModalInputText_read((0,react.useState)(defaultValue),2),inputValue=_b[0],setInputValue=_b[1],isCdkEnviroment=(0,styled_components_browser_esm.DP)().isCdkEnviroment;return(0,jsx_runtime.jsx)(Modal_Modal,{children:(0,jsx_runtime.jsxs)(ModalInputText_ModalItem,{children:[(0,jsx_runtime.jsxs)(ModalInputText_Header,{children:[title,(0,jsx_runtime.jsx)(ModalInputText_CloseButtonWrapper,{children:(0,jsx_runtime.jsx)(images_CloseIcon,{width:"24px",height:"24px",onClick:handleModalClose})})]}),(0,jsx_runtime.jsxs)(ModalInputText_Content,{children:[(0,jsx_runtime.jsx)(ModalInputText_Label,{children:label}),(0,jsx_runtime.jsx)(Input,{autoFocus:!0,value:inputValue,onChange:function(e){return setInputValue(e.currentTarget.value)},width:"100%"}),(0,jsx_runtime.jsxs)(ModalInputText_ButtonsWrapper,{children:[(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{text:secondaryButtonText,variant:isCdkEnviroment?"text":"secondary",onClick:handleModalClose}),(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{text:primaryButtonText,onClick:function(){return handleSubmit(inputValue)},disabled:""===inputValue})]})]})]})})},components_Search_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},components_Search_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},Search_SearchWrapper=styled_components_browser_esm.Ay.div(components_Search_templateObject_2||(components_Search_templateObject_2=components_Search_makeTemplateObject(["\n position: relative;\n width: 216px;\n ","\n"],["\n position: relative;\n width: 216px;\n ","\n"])),(function(_a){return _a.theme.containerWidth<screenSizes_xs&&(0,styled_components_browser_esm.AH)(components_Search_templateObject_1||(components_Search_templateObject_1=components_Search_makeTemplateObject(["\n width: 100%;\n "],["\n width: 100%;\n "])))})),Search_SearchIconWrapper=styled_components_browser_esm.Ay.div(components_Search_templateObject_3||(components_Search_templateObject_3=components_Search_makeTemplateObject(["\n position: absolute;\n left: 12px;\n top: 12px;\n color: ",";\n cursor: pointer;\n &:hover {\n color: ",";\n }\n"],["\n position: absolute;\n left: 12px;\n top: 12px;\n color: ",";\n cursor: pointer;\n &:hover {\n color: ",";\n }\n"])),palette_gray60,palette_gray100),Search_ClearIconWrapper=styled_components_browser_esm.Ay.div(components_Search_templateObject_4||(components_Search_templateObject_4=components_Search_makeTemplateObject(["\n position: absolute;\n right: 12px;\n top: 12px;\n color: ",";\n cursor: pointer;\n &:hover {\n color: ",";\n }\n"],["\n position: absolute;\n right: 12px;\n top: 12px;\n color: ",";\n cursor: pointer;\n &:hover {\n color: ",";\n }\n"])),palette_gray60,palette_gray100),Search_Search=function(_a){var prevSearch=_a.prevSearch,handleSearch=_a.handleSearch,_b=components_Search_read((0,react.useState)(prevSearch||""),2),searchTerm=_b[0],setSearchTerm=_b[1];return(0,jsx_runtime.jsxs)(Search_SearchWrapper,{children:[(0,jsx_runtime.jsx)(Search_SearchIconWrapper,{children:(0,jsx_runtime.jsx)(io_index_esm.uG9,{onClick:function(){return handleSearch(searchTerm)},size:17})}),(0,jsx_runtime.jsx)(Input,{width:"100%",type:"text",padding:"8px 40px 8px 40px",value:searchTerm,placeholder:"Search videos...",onKeyUp:function(e){"Enter"===e.key&&handleSearch(searchTerm)},onChange:function(e){setSearchTerm(e.currentTarget.value)}}),""!==searchTerm&&(0,jsx_runtime.jsx)(Search_ClearIconWrapper,{children:(0,jsx_runtime.jsx)(md_index_esm.Tfw,{onClick:function(){return setSearchTerm(""),void handleSearch("")},size:17})})]})},components_PageInfo_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},components_PageInfo_Wrapper=styled_components_browser_esm.Ay.div(components_PageInfo_templateObject_1||(components_PageInfo_templateObject_1=components_PageInfo_makeTemplateObject(["\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n"],["\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n"])),palette_gray80),PageInfo_PageInfo=function(_a){var page=_a.page,size=_a.size,count=_a.count,from=page*size+1,to=page*size+size;return to>count&&(to=count),(0,jsx_runtime.jsxs)(components_PageInfo_Wrapper,{children:[from,"-",to," of ",count]})},lesaKeys_all=function(_a){return["LESA_LIST",_a.page,_a.search]},useLesaTvVideosQuery_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},useLesaTvVideosQuery_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}};!function(VEHICLE_CONDITION){VEHICLE_CONDITION.NEW="New",VEHICLE_CONDITION.USED="Used",VEHICLE_CONDITION.CERTIFIED="Certified"}(VEHICLE_CONDITION||(VEHICLE_CONDITION={}));var LesaTV_templateObject_1,LesaTV_templateObject_2,LesaTV_templateObject_3,LesaTV_templateObject_4,LesaTV_templateObject_5,LesaTV_templateObject_6,LesaTV_templateObject_7,LesaTV_templateObject_8,LesaTV_templateObject_9,LesaTV_templateObject_10,LesaTV_templateObject_11,LesaTV_templateObject_12,LesaTV_templateObject_13,LesaTV_templateObject_14,LesaTV_templateObject_15,templateObject_16,templateObject_17,templateObject_18,templateObject_19,templateObject_20,templateObject_21,templateObject_22,templateObject_23,Voiceover_templateObject_1,Voiceover_templateObject_2,Voiceover_templateObject_3,Voiceover_templateObject_4,Voiceover_templateObject_5,Voiceover_templateObject_6,Voiceover_templateObject_7,wheelsTV_components_Search_templateObject_1,wheelsTV_components_Search_templateObject_2,wheelsTV_components_Search_templateObject_3,wheelsTV_components_Search_templateObject_4,wheelsTV_components_PageInfo_templateObject_1,WheelsTV_templateObject_1,WheelsTV_templateObject_2,WheelsTV_templateObject_3,WheelsTV_templateObject_4,WheelsTV_templateObject_5,WheelsTV_templateObject_6,WheelsTV_templateObject_7,WheelsTV_templateObject_8,WheelsTV_templateObject_9,WheelsTV_templateObject_10,WheelsTV_templateObject_11,WheelsTV_templateObject_12,WheelsTV_templateObject_13,WheelsTV_templateObject_14,WheelsTV_templateObject_15,WheelsTV_templateObject_16,WheelsTV_templateObject_17,WheelsTV_templateObject_18,WheelsTV_templateObject_19,WheelsTV_templateObject_20,WheelsTV_templateObject_21,WheelsTV_templateObject_22,VideoRow_templateObject_1,VideoRow_templateObject_2,drag_icon_path,useLesaTvVideosQuery=function(params){var _a,toast=useToastNotifications().toast;return(0,es.useQuery)(lesaKeys_all({page:params.page,search:params.search||""}),(function(){return props=params,useLesaTvVideosQuery_awaiter(void 0,void 0,Promise,(function(){var start,params;return useLesaTvVideosQuery_generator(this,(function(_a){switch(_a.label){case 0:return start=((props.page||1)-1)*(props.limit||12),params={start,limit:props.limit,search:props.search,page:props.page},[4,config_EXPRESS_API.get("/lesa/videos",{params})];case 1:return[2,_a.sent().data]}}))}));var props}),{refetchOnMount:!0,refetchOnWindowFocus:!1,enabled:""===params.search||((null===(_a=params.search)||void 0===_a?void 0:_a.length)||0)>2,onError:function(){toast({message:"We're currently experiencing difficulties fetching Lesa videos"})}})},useLesaVideosMutation_assign=function(){return useLesaVideosMutation_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},useLesaVideosMutation_assign.apply(this,arguments)},useLesaVideosMutation_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},useLesaVideosMutation_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},copyLesaVideo=function(params){return useLesaVideosMutation_awaiter(void 0,void 0,void 0,(function(){return useLesaVideosMutation_generator(this,(function(_a){switch(_a.label){case 0:return[4,config_EXPRESS_API.post("/lesa/videos",useLesaVideosMutation_assign({},params))];case 1:return[2,_a.sent()]}}))}))},LesaTV_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},LesaTV_assign=function(){return LesaTV_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},LesaTV_assign.apply(this,arguments)},LesaTV_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},LesaTV_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},LesaTV_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},LesaTV_Wrapper=styled_components_browser_esm.Ay.div(LesaTV_templateObject_1||(LesaTV_templateObject_1=LesaTV_makeTemplateObject(["\n background: ",";\n"],["\n background: ",";\n"])),palette_gray10),TitleWrapper=styled_components_browser_esm.Ay.div(LesaTV_templateObject_2||(LesaTV_templateObject_2=LesaTV_makeTemplateObject(["\n font-style: normal;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n text-align: center;\n color: white;\n"],["\n font-style: normal;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n text-align: center;\n color: white;\n"]))),SearchAndFilterWrapper=styled_components_browser_esm.Ay.div(LesaTV_templateObject_4||(LesaTV_templateObject_4=LesaTV_makeTemplateObject(["\n display: flex;\n flex-direction: row;\n flex-direction: flex-start;\n gap: 8px;\n ","\n"],["\n display: flex;\n flex-direction: row;\n flex-direction: flex-start;\n gap: 8px;\n ","\n"])),(function(_a){return _a.theme.containerWidth<screenSizes_mb&&(0,styled_components_browser_esm.AH)(LesaTV_templateObject_3||(LesaTV_templateObject_3=LesaTV_makeTemplateObject(["\n flex-direction: column;\n width: 100%;\n "],["\n flex-direction: column;\n width: 100%;\n "])))})),YearWrap=styled_components_browser_esm.Ay.div(LesaTV_templateObject_6||(LesaTV_templateObject_6=LesaTV_makeTemplateObject(["\n width: 216px;\n ","\n"],["\n width: 216px;\n ","\n"])),(function(_a){return _a.theme.containerWidth<screenSizes_mb&&(0,styled_components_browser_esm.AH)(LesaTV_templateObject_5||(LesaTV_templateObject_5=LesaTV_makeTemplateObject(["\n width: 100%;\n "],["\n width: 100%;\n "])))})),TableContentContainer=styled_components_browser_esm.Ay.div(LesaTV_templateObject_7||(LesaTV_templateObject_7=LesaTV_makeTemplateObject(["\n background: ",";\n"],["\n background: ",";\n"])),palette_white),VideosList=styled_components_browser_esm.Ay.div(LesaTV_templateObject_8||(LesaTV_templateObject_8=LesaTV_makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n max-width: 925px;\n"],["\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n max-width: 925px;\n"]))),LesaTV_Video=styled_components_browser_esm.Ay.div(LesaTV_templateObject_9||(LesaTV_templateObject_9=LesaTV_makeTemplateObject(["\n width: 100%;\n display: flex;\n align-items: center;\n height: 56px;\n border-bottom: 1px solid rgb(223, 227, 230);\n"],["\n width: 100%;\n display: flex;\n align-items: center;\n height: 56px;\n border-bottom: 1px solid rgb(223, 227, 230);\n"]))),TableHeaderContainer=styled_components_browser_esm.Ay.div(LesaTV_templateObject_10||(LesaTV_templateObject_10=LesaTV_makeTemplateObject(["\n width: 100%;\n display: flex;\n align-items: top;\n height: 32px;\n border-bottom: 1px solid rgb(223, 227, 230);\n"],["\n width: 100%;\n display: flex;\n align-items: top;\n height: 32px;\n border-bottom: 1px solid rgb(223, 227, 230);\n"]))),TableColumnTitle=styled_components_browser_esm.Ay.div(LesaTV_templateObject_11||(LesaTV_templateObject_11=LesaTV_makeTemplateObject(["\n width: 100%;\n display: flex;\n align-items: flex-start;\n font-weight: 500;\n color: ",";\n margin-right: 5px;\n"],["\n width: 100%;\n display: flex;\n align-items: flex-start;\n font-weight: 500;\n color: ",";\n margin-right: 5px;\n"])),palette_gray60),VehicleYear=styled_components_browser_esm.Ay.div(LesaTV_templateObject_12||(LesaTV_templateObject_12=LesaTV_makeTemplateObject(["\n height: 20px;\n margin-left: 24px;\n font-size: 14px;\n line-height: 24px;\n text-align: left !important;\n color: ",";\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 1; /* number of lines to show */\n -webkit-box-orient: vertical;\n max-width: 180px;\n min-width: 40px;\n"],["\n height: 20px;\n margin-left: 24px;\n font-size: 14px;\n line-height: 24px;\n text-align: left !important;\n color: ",";\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 1; /* number of lines to show */\n -webkit-box-orient: vertical;\n max-width: 180px;\n min-width: 40px;\n"])),palette_gray100),VehicleMake=styled_components_browser_esm.Ay.div(LesaTV_templateObject_13||(LesaTV_templateObject_13=LesaTV_makeTemplateObject(["\n height: 20px;\n margin-left: 24px;\n font-size: 14px;\n line-height: 24px;\n text-align: left !important;\n color: ",";\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 1; /* number of lines to show */\n -webkit-box-orient: vertical;\n max-width: 180px;\n min-width: 75px;\n"],["\n height: 20px;\n margin-left: 24px;\n font-size: 14px;\n line-height: 24px;\n text-align: left !important;\n color: ",";\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 1; /* number of lines to show */\n -webkit-box-orient: vertical;\n max-width: 180px;\n min-width: 75px;\n"])),palette_gray100),VehicleStockId=styled_components_browser_esm.Ay.div(LesaTV_templateObject_14||(LesaTV_templateObject_14=LesaTV_makeTemplateObject(["\n height: 20px;\n margin-left: 24px;\n font-size: 14px;\n line-height: 24px;\n text-align: left !important;\n color: ",";\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 1; /* number of lines to show */\n -webkit-box-orient: vertical;\n max-width: 180px;\n min-width: 75px;\n"],["\n height: 20px;\n margin-left: 24px;\n font-size: 14px;\n line-height: 24px;\n text-align: left !important;\n color: ",";\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 1; /* number of lines to show */\n -webkit-box-orient: vertical;\n max-width: 180px;\n min-width: 75px;\n"])),palette_gray100),VehicleModel=styled_components_browser_esm.Ay.div(LesaTV_templateObject_15||(LesaTV_templateObject_15=LesaTV_makeTemplateObject(["\n height: 20px;\n margin-left: 24px;\n font-size: 14px;\n line-height: 24px;\n text-align: left !important;\n color: ",";\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 1; /* number of lines to show */\n -webkit-box-orient: vertical;\n width: inherit;\n"],["\n height: 20px;\n margin-left: 24px;\n font-size: 14px;\n line-height: 24px;\n text-align: left !important;\n color: ",";\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 1; /* number of lines to show */\n -webkit-box-orient: vertical;\n width: inherit;\n"])),palette_gray100),VideoOptions=styled_components_browser_esm.Ay.div(templateObject_16||(templateObject_16=LesaTV_makeTemplateObject(["\n height: 40px;\n width: inherit;\n text-align-last: end;\n margin-left: 24px;\n font-size: 14px;\n line-height: 24px;\n text-align: left !important;\n color: ",";\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n max-width: 173px;\n -webkit-line-clamp: 1; /* number of lines to show */\n -webkit-box-orient: vertical;\n"],["\n height: 40px;\n width: inherit;\n text-align-last: end;\n margin-left: 24px;\n font-size: 14px;\n line-height: 24px;\n text-align: left !important;\n color: ",";\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n max-width: 173px;\n -webkit-line-clamp: 1; /* number of lines to show */\n -webkit-box-orient: vertical;\n"])),palette_gray100),LoadingWrapper=styled_components_browser_esm.Ay.div(templateObject_17||(templateObject_17=LesaTV_makeTemplateObject(["\n margin-top: 100px;\n"],["\n margin-top: 100px;\n"]))),EmptySearch=styled_components_browser_esm.Ay.div(templateObject_18||(templateObject_18=LesaTV_makeTemplateObject(["\n font-size: 14px;\n font-weight: bold;\n text-align: center;\n"],["\n font-size: 14px;\n font-weight: bold;\n text-align: center;\n"]))),TablePaginationContainer=styled_components_browser_esm.Ay.div(templateObject_19||(templateObject_19=LesaTV_makeTemplateObject(["\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: flex-end;\n margin-top: 16px;\n"],["\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: flex-end;\n margin-top: 16px;\n"]))),PaginationText=styled_components_browser_esm.Ay.span(templateObject_20||(templateObject_20=LesaTV_makeTemplateObject(["\n color: ",";\n height: 20px;\n font-size: 14px;\n font-weight: 400;\n font-stretch: normal;\n font-style: normal;\n line-height: 20px;\n letter-spacing: normal;\n color: #4e5461;\n"],["\n color: ",";\n height: 20px;\n font-size: 14px;\n font-weight: 400;\n font-stretch: normal;\n font-style: normal;\n line-height: 20px;\n letter-spacing: normal;\n color: #4e5461;\n"])),palette_gray80),PageInput=styled_components_browser_esm.Ay.input(templateObject_21||(templateObject_21=LesaTV_makeTemplateObject(["\n height: 40px;\n width: 50px;\n margin-right: 16px;\n outline: 0;\n text-align: center;\n font-size: 15px;\n border: 1px solid ",";\n border-radius: 6px;\n"],["\n height: 40px;\n width: 50px;\n margin-right: 16px;\n outline: 0;\n text-align: center;\n font-size: 15px;\n border: 1px solid ",";\n border-radius: 6px;\n"])),(function(_a){return _a.theme.colors.primary[20]})),LesaTV_Navigation=styled_components_browser_esm.Ay.div(templateObject_23||(templateObject_23=LesaTV_makeTemplateObject(["\n display: flex;\n gap: 8px;\n justify-content: flex-end;\n align-items: center;\n ","\n"],["\n display: flex;\n gap: 8px;\n justify-content: flex-end;\n align-items: center;\n ","\n"])),(function(_a){return _a.theme.containerWidth<screenSizes_mb&&(0,styled_components_browser_esm.AH)(templateObject_22||(templateObject_22=LesaTV_makeTemplateObject(["\n width: 100%;\n "],["\n width: 100%;\n "])))})),LesaTV=function(){var history=(0,react_router.W6)(),containerWidth=useConfigurationContext().containerWidth,_a=LesaTV_read((0,react.useState)(""),2),searchTerm=_a[0],setSearchTerm=_a[1],_b=LesaTV_read((0,react.useState)(1),2),page=_b[0],setPage=_b[1],goToLibrary=function(){return history.push("/")},_c=useLesaTvVideosQuery({limit:8,page,search:searchTerm}),data=_c.data,refetch=_c.refetch,isLoadingLesaTv=_c.isLoading,_d=function(_a){var onSuccesCallback=_a.onSuccesCallback,toast=useToastNotifications().toast;return(0,es.useMutation)(copyLesaVideo,{onSuccess:function(){toast({message:"Video has been added!"}),onSuccesCallback()},onError:function(){return toast({message:"An error occured while trying to add the video!"})}})}({onSuccesCallback:function(){goToLibrary()}}),copyLesaVideosMutation=_d.mutateAsync,isCopyingVideo=_d.isLoading,resetPage=function(){setPage(1)},isLoading=isLoadingLesaTv||isCopyingVideo,isNotSearchable=searchTerm.length>0&&searchTerm.length<3;(0,react.useEffect)((function(){isNotSearchable||refetch()}),[searchTerm]);var copyLesaMutationHandler=function(video){var _a;if(video.video){var title=[null==video?void 0:video.year.toString(),video.make,video.model,video.stockNumber].filter(Boolean).join(" ");copyLesaVideosMutation({url:null===(_a=video.video)||void 0===_a?void 0:_a.url,fileName:title,lesaVehicleId:video.lesaVehicleId})}},onPageChange=function(direction){"left"===direction&&setPage((function(prevPage){return prevPage-1})),"right"===direction&&setPage((function(prevPage){return prevPage+1}))},lastPage=Math.ceil(((null==data?void 0:data.count)||0)/8);return(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsxs)(LesaTV_Wrapper,{children:[(0,jsx_runtime.jsx)(TopBar,{left:(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{text:"Back",icon:(0,jsx_runtime.jsx)(md_index_esm.MGo,{size:"18"}),onClick:function(){return goToLibrary()},variant:"transparent",style:{color:"white"}}),center:(0,jsx_runtime.jsx)(TitleWrapper,{children:"Lesa TV Import"})}),(0,jsx_runtime.jsx)(Container,{children:(0,jsx_runtime.jsxs)(SearchAndFilterWrapper,{children:[(0,jsx_runtime.jsx)(Search_Search,{handleSearch:function(search){return void 0===search&&(search=""),LesaTV_awaiter(void 0,void 0,void 0,(function(){return LesaTV_generator(this,(function(_a){return setSearchTerm(search),resetPage(),[2]}))}))},prevSearch:searchTerm}),(0,jsx_runtime.jsx)(YearWrap,{})]})})]}),(0,jsx_runtime.jsx)(TableContentContainer,{children:(0,jsx_runtime.jsx)(Container,LesaTV_assign({extendStyle:{wrapper:{padding:containerWidth>=screenSizes_xs?"32px 16px":"16px 0px"}}},{children:isLoading?(0,jsx_runtime.jsx)(LoadingWrapper,{children:(0,jsx_runtime.jsx)(LoadingIndicator,{isLoading})}):isNotSearchable?(0,jsx_runtime.jsx)(EmptySearch,{children:(0,jsx_runtime.jsx)("p",{children:"Please enter at least three characters to search"})}):(null==data?void 0:data.videos.length)?(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsxs)(TableHeaderContainer,{children:[(0,jsx_runtime.jsx)(VehicleStockId,{children:(0,jsx_runtime.jsx)(TableColumnTitle,{children:" Stock #"})}),containerWidth>=screenSizes_xs&&(0,jsx_runtime.jsx)(VehicleYear,{children:(0,jsx_runtime.jsx)(TableColumnTitle,{children:"Year"})}),(0,jsx_runtime.jsx)(VehicleMake,{children:(0,jsx_runtime.jsx)(TableColumnTitle,{children:"Make"})}),(0,jsx_runtime.jsx)(VehicleModel,{children:(0,jsx_runtime.jsx)(TableColumnTitle,{children:"Model"})})]}),(0,jsx_runtime.jsx)(VideosList,{children:null==data?void 0:data.videos.map((function(video){return(0,jsx_runtime.jsxs)(LesaTV_Video,LesaTV_assign({onClick:function(){}},{children:[(0,jsx_runtime.jsx)(VehicleStockId,{children:video.stockNumber}),containerWidth>=screenSizes_xs&&(0,jsx_runtime.jsx)(VehicleYear,{children:video.year}),(0,jsx_runtime.jsx)(VehicleMake,{children:video.make}),(0,jsx_runtime.jsx)(VehicleModel,{children:video.model}),(0,jsx_runtime.jsx)(VideoOptions,{children:(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{variant:"secondary",onClick:function(){return copyLesaMutationHandler(video)},text:"Add"})})]}),video.stockNumber)}))}),(0,jsx_runtime.jsx)(TablePaginationContainer,{children:(0,jsx_runtime.jsxs)(LesaTV_Navigation,{children:[(0,jsx_runtime.jsx)(PaginationText,{children:"Go to:"}),(0,jsx_runtime.jsx)(PageInput,{type:"number",min:1,value:page,onChange:function(e){if(e.currentTarget&&e.currentTarget.value){var newPage=parseInt(e.currentTarget.value);newPage<=0?resetPage():setPage(newPage>lastPage?lastPage:newPage)}}}),(0,jsx_runtime.jsx)(PageInfo_PageInfo,{page:page-1,size:8,count:(null==data?void 0:data.count)||0}),(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{onClick:function(){return onPageChange("left")},icon:(0,jsx_runtime.jsx)(md_index_esm.E_E,{size:20}),disabled:1===page,size:"small",variant:"secondary"}),(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{onClick:function(){return onPageChange("right")},icon:(0,jsx_runtime.jsx)(md_index_esm.xVu,{size:20}),disabled:page===lastPage,size:"small",variant:"secondary"})]})})]}):(0,jsx_runtime.jsxs)(EmptySearch,{children:[(0,jsx_runtime.jsx)("p",{children:"Oops! It looks like there are no videos matching your search terms."}),(0,jsx_runtime.jsx)("p",{children:"Try using a different search terms"})]})}))})]})},Voiceover_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},Voiceover_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},Voiceover_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},Voiceover_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},Voiceover_Wrapper=styled_components_browser_esm.Ay.div(Voiceover_templateObject_1||(Voiceover_templateObject_1=Voiceover_makeTemplateObject(["\n background: ",";\n"],["\n background: ",";\n"])),palette_white),VoiceOverMessage=styled_components_browser_esm.Ay.div(Voiceover_templateObject_3||(Voiceover_templateObject_3=Voiceover_makeTemplateObject(["\n width: 78%;\n margin-left: auto;\n margin-right: auto;\n height: 40%;\n display: flex;\n flex-direction: row;\n align-items: flex-start;\n padding: 12px;\n gap: 12px;\n background: #f2f4f6;\n border: 1px solid rgba(39, 42, 50, 0.05);\n border-radius: 6px;\n ","\n"],["\n width: 78%;\n margin-left: auto;\n margin-right: auto;\n height: 40%;\n display: flex;\n flex-direction: row;\n align-items: flex-start;\n padding: 12px;\n gap: 12px;\n background: #f2f4f6;\n border: 1px solid rgba(39, 42, 50, 0.05);\n border-radius: 6px;\n ","\n"])),(function(_a){return _a.theme.containerWidth<screenSizes_xs&&(0,styled_components_browser_esm.AH)(Voiceover_templateObject_2||(Voiceover_templateObject_2=Voiceover_makeTemplateObject(["\n width: 100%;\n "],["\n width: 100%;\n "])))})),Voiceover_IconWrapper=styled_components_browser_esm.Ay.div(Voiceover_templateObject_4||(Voiceover_templateObject_4=Voiceover_makeTemplateObject(["\n width: 20px;\n flex-grow: 0;\n flex-shrink: 0;\n"],["\n width: 20px;\n flex-grow: 0;\n flex-shrink: 0;\n"]))),Voiceover_TextWrapper=styled_components_browser_esm.Ay.div(Voiceover_templateObject_5||(Voiceover_templateObject_5=Voiceover_makeTemplateObject(["\n width: auto;\n"],["\n width: auto;\n"]))),Voiceover_Title=styled_components_browser_esm.Ay.div(Voiceover_templateObject_6||(Voiceover_templateObject_6=Voiceover_makeTemplateObject(["\n font-weight: 600;\n font-size: 16px;\n line-height: 24px;\n color: ",";\n"],["\n font-weight: 600;\n font-size: 16px;\n line-height: 24px;\n color: ",";\n"])),(function(_a){return _a.theme.colors.primary[100]})),Voiceover_Text=styled_components_browser_esm.Ay.div(Voiceover_templateObject_7||(Voiceover_templateObject_7=Voiceover_makeTemplateObject(["\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n margin-top: 2%;\n"],["\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n margin-top: 2%;\n"])),palette_blackRgb60),VoiceOver=function(){var userData=useAuthorizationContext().userData,toast=useToastNotifications().toast,_a=(0,styled_components_browser_esm.DP)(),colors=_a.colors,isCdkEnviroment=_a.isCdkEnviroment,videoId=(0,react_router.g)().videoId,history=(0,react_router.W6)(),_b=Voiceover_read((0,react.useState)({}),2),video=_b[0],setVideo=_b[1],_c=Voiceover_read((0,react.useState)(!0),2),videoLoading=_c[0],setVideoLoading=_c[1],_d=Voiceover_read((0,react.useState)(!1),2),uploading=_d[0],setUploading=_d[1],_e=Voiceover_read((0,react.useState)(!1),2),voiceoverValid=_e[0],setVoiceoverValid=_e[1],_f=Voiceover_read((0,react.useState)(!1),2),showModalRename=_f[0],setShowModalRename=_f[1],_g=Voiceover_read((0,react.useState)(""),2),recordingBlobUrl=_g[0],setRecordingBlobUrl=_g[1],videoRef=(0,react.createRef)();if((0,react.useEffect)((function(){Voiceover_awaiter(void 0,void 0,void 0,(function(){var data;return Voiceover_generator(this,(function(_a){switch(_a.label){case 0:return setVideoLoading(!0),[4,getVideo(videoId)];case 1:return(data=_a.sent())&&setVideo(data),setVideoLoading(!1),[2]}}))}))}),[]),(0,react.useEffect)((function(){pushToDataLayer({event:"covideo-pageview",page_application:"CRM Video Lite",page_url:"https://video.connectcdk.com/embed/classic/voiceover/".concat(videoId),page_location:"Home",page_section:"Videos",user_id:userData.email,is_internal_user:userData.email.includes("cdk")||userData.email.includes("covideo")})}),[]),videoLoading)return(0,jsx_runtime.jsx)(LoadingIndicator,{isLoading:videoLoading});return(0,jsx_runtime.jsxs)(Voiceover_Wrapper,{children:[(0,jsx_runtime.jsx)(TopBar,{left:(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{text:"Back",variant:"transparent",icon:(0,jsx_runtime.jsx)(md_index_esm.MGo,{size:"18"}),onClick:function(){return history.push("/")},style:{color:"white"}}),center:(0,jsx_runtime.jsx)(TitleWrapper,{children:"Voiceover"}),right:(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{onClick:function(){setShowModalRename(!0)},text:"Save Video",variant:isCdkEnviroment?"white":"primary",disabled:!voiceoverValid||uploading})}),(0,jsx_runtime.jsx)(Container,{children:!uploading&&(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsxs)(VoiceOverMessage,{children:[(0,jsx_runtime.jsx)(Voiceover_IconWrapper,{children:(0,jsx_runtime.jsx)(md_index_esm.MJW,{size:22,color:colors.primary[60]})}),(0,jsx_runtime.jsxs)(Voiceover_TextWrapper,{children:[(0,jsx_runtime.jsx)(Voiceover_Title,{children:"Duplicated video ready for voiceover"}),(0,jsx_runtime.jsx)(Voiceover_Text,{children:"The video won’t be available in the Library until you save it. A new voiceover will replace the original audio of duplicated video."})]})]}),(0,jsx_runtime.jsx)(VideoPreview,{video,videoRef,margin:"32px 0 0"}),(0,jsx_runtime.jsx)(AudioRecorder,{videoRef,video,onChangeVoiceoverValid:setVoiceoverValid,onRecordingUrlGeneration:function(url){setRecordingBlobUrl(url)},margin:"32px auto 0"})]})}),uploading&&(0,jsx_runtime.jsx)(LoadingIndicator,{isLoading:!0}),showModalRename&&(0,jsx_runtime.jsx)(ModalInputText,{title:"Name new video",label:"Give your new video a name",defaultValue:video.title,secondaryButtonText:"Go Back",primaryButtonText:"Save Video",handleSubmit:function(newVideoTitle){return Voiceover_awaiter(void 0,void 0,void 0,(function(){var blob,newAudioFileName,file,signedUrlData,signedURL,data;return Voiceover_generator(this,(function(_a){switch(_a.label){case 0:return setShowModalRename(!1),setUploading(!0),[4,fetch(recordingBlobUrl||"").then((function(r){return r.blob()}))];case 1:return blob=_a.sent(),newAudioFileName=function(videoId,fileExt){return videoId+"_"+(Math.random()+1).toString(36).substring(2)+"."+fileExt}(video.id,"webm"),file=new File([blob],newAudioFileName),signedUrlData={fileName:file.name,mimeType:"audio/webm",folder:""},[4,getVoiceoverSignedURLs(signedUrlData)];case 2:if(!(signedURL=_a.sent())||signedURL instanceof Error)return setUploading(!1),toast({message:"Server is currently unavailable, try again later!"}),[2];data={file,uploadURL:signedURL.uploadUrl,mimeType:signedUrlData.mimeType},_a.label=3;case 3:return _a.trys.push([3,6,,7]),[4,uploadVoiceoverAudio({data})];case 4:return _a.sent(),[4,addVoiceoverToVideo({videoId:video.id,newVideoTitle,audioFileName:newAudioFileName})];case 5:return _a.sent(),[3,7];case 6:return _a.sent(),setUploading(!1),toast({message:"Creating voiceover failed, try again later!"}),[2];case 7:return toast({message:"Voiceover successfully created!"}),setUploading(!1),setVoiceoverValid(!1),history.push("/"),[2]}}))}))},handleModalClose:function(){return setShowModalRename(!1)}})]})},wheelsTV_components_Search_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},wheelsTV_components_Search_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},components_Search_SearchWrapper=styled_components_browser_esm.Ay.div(wheelsTV_components_Search_templateObject_2||(wheelsTV_components_Search_templateObject_2=wheelsTV_components_Search_makeTemplateObject(["\n position: relative;\n width: 216px;\n ","\n"],["\n position: relative;\n width: 216px;\n ","\n"])),(function(_a){return _a.theme.containerWidth<screenSizes_xs&&(0,styled_components_browser_esm.AH)(wheelsTV_components_Search_templateObject_1||(wheelsTV_components_Search_templateObject_1=wheelsTV_components_Search_makeTemplateObject(["\n width: 100%;\n "],["\n width: 100%;\n "])))})),components_Search_SearchIconWrapper=styled_components_browser_esm.Ay.div(wheelsTV_components_Search_templateObject_3||(wheelsTV_components_Search_templateObject_3=wheelsTV_components_Search_makeTemplateObject(["\n position: absolute;\n left: 12px;\n top: 12px;\n color: ",";\n cursor: pointer;\n &:hover {\n color: ",";\n }\n"],["\n position: absolute;\n left: 12px;\n top: 12px;\n color: ",";\n cursor: pointer;\n &:hover {\n color: ",";\n }\n"])),palette_gray60,palette_gray100),components_Search_ClearIconWrapper=styled_components_browser_esm.Ay.div(wheelsTV_components_Search_templateObject_4||(wheelsTV_components_Search_templateObject_4=wheelsTV_components_Search_makeTemplateObject(["\n position: absolute;\n right: 12px;\n top: 12px;\n color: ",";\n cursor: pointer;\n &:hover {\n color: ",";\n }\n"],["\n position: absolute;\n right: 12px;\n top: 12px;\n color: ",";\n cursor: pointer;\n &:hover {\n color: ",";\n }\n"])),palette_gray60,palette_gray100),components_Search_Search=function(_a){var prevSearch=_a.prevSearch,handleSearch=_a.handleSearch,_b=wheelsTV_components_Search_read((0,react.useState)(prevSearch||""),2),searchTerm=_b[0],setSearchTerm=_b[1];return(0,jsx_runtime.jsxs)(components_Search_SearchWrapper,{children:[(0,jsx_runtime.jsx)(components_Search_SearchIconWrapper,{children:(0,jsx_runtime.jsx)(io_index_esm.uG9,{onClick:function(){return handleSearch(searchTerm)},size:17})}),(0,jsx_runtime.jsx)(Input,{width:"100%",type:"text",padding:"8px 40px 8px 40px",value:searchTerm,placeholder:"Search videos...",onKeyUp:function(e){"Enter"===e.key&&handleSearch(searchTerm)},onChange:function(e){setSearchTerm(e.currentTarget.value)}}),""!==searchTerm&&(0,jsx_runtime.jsx)(components_Search_ClearIconWrapper,{children:(0,jsx_runtime.jsx)(md_index_esm.Tfw,{onClick:function(){return setSearchTerm(""),void handleSearch("")},size:17})})]})},wheelsTV_components_PageInfo_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},wheelsTV_components_PageInfo_Wrapper=styled_components_browser_esm.Ay.div(wheelsTV_components_PageInfo_templateObject_1||(wheelsTV_components_PageInfo_templateObject_1=wheelsTV_components_PageInfo_makeTemplateObject(["\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n"],["\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n"])),palette_gray80),components_PageInfo_PageInfo=function(_a){var page=_a.page,size=_a.size,count=_a.count,from=page*size+1,to=page*size+size;return to>count&&(to=count),(0,jsx_runtime.jsxs)(wheelsTV_components_PageInfo_Wrapper,{children:[from,"-",to," of ",count]})},WheelsTV_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},WheelsTV_assign=function(){return WheelsTV_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},WheelsTV_assign.apply(this,arguments)},WheelsTV_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},WheelsTV_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},WheelsTV_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},WheelsTV_Wrapper=styled_components_browser_esm.Ay.div(WheelsTV_templateObject_1||(WheelsTV_templateObject_1=WheelsTV_makeTemplateObject(["\n background: ",";\n"],["\n background: ",";\n"])),palette_gray10),WheelsTV_SearchAndFilterWrapper=styled_components_browser_esm.Ay.div(WheelsTV_templateObject_3||(WheelsTV_templateObject_3=WheelsTV_makeTemplateObject(["\n display: flex;\n flex-direction: row;\n flex-direction: flex-start;\n gap: 8px;\n ","\n"],["\n display: flex;\n flex-direction: row;\n flex-direction: flex-start;\n gap: 8px;\n ","\n"])),(function(_a){return _a.theme.containerWidth<screenSizes_mb&&(0,styled_components_browser_esm.AH)(WheelsTV_templateObject_2||(WheelsTV_templateObject_2=WheelsTV_makeTemplateObject(["\n flex-direction: column;\n width: 100%;\n "],["\n flex-direction: column;\n width: 100%;\n "])))})),WheelsTV_YearWrap=styled_components_browser_esm.Ay.div(WheelsTV_templateObject_5||(WheelsTV_templateObject_5=WheelsTV_makeTemplateObject(["\n width: 216px;\n ","\n"],["\n width: 216px;\n ","\n"])),(function(_a){return _a.theme.containerWidth<screenSizes_mb&&(0,styled_components_browser_esm.AH)(WheelsTV_templateObject_4||(WheelsTV_templateObject_4=WheelsTV_makeTemplateObject(["\n width: 100%;\n "],["\n width: 100%;\n "])))})),WheelsTV_TableContentContainer=styled_components_browser_esm.Ay.div(WheelsTV_templateObject_6||(WheelsTV_templateObject_6=WheelsTV_makeTemplateObject(["\n background: ",";\n"],["\n background: ",";\n"])),palette_white),WheelsTV_VideosList=styled_components_browser_esm.Ay.div(WheelsTV_templateObject_7||(WheelsTV_templateObject_7=WheelsTV_makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n max-width: 925px;\n"],["\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n max-width: 925px;\n"]))),WheelsTV_Video=styled_components_browser_esm.Ay.div(WheelsTV_templateObject_8||(WheelsTV_templateObject_8=WheelsTV_makeTemplateObject(["\n width: 100%;\n display: flex;\n align-items: center;\n height: 56px;\n border-bottom: 1px solid rgb(223, 227, 230);\n"],["\n width: 100%;\n display: flex;\n align-items: center;\n height: 56px;\n border-bottom: 1px solid rgb(223, 227, 230);\n"]))),WheelsTV_TableHeaderContainer=styled_components_browser_esm.Ay.div(WheelsTV_templateObject_9||(WheelsTV_templateObject_9=WheelsTV_makeTemplateObject(["\n width: 100%;\n display: flex;\n align-items: top;\n height: 32px;\n border-bottom: 1px solid rgb(223, 227, 230);\n"],["\n width: 100%;\n display: flex;\n align-items: top;\n height: 32px;\n border-bottom: 1px solid rgb(223, 227, 230);\n"]))),WheelsTV_TableColumnTitle=styled_components_browser_esm.Ay.div(WheelsTV_templateObject_10||(WheelsTV_templateObject_10=WheelsTV_makeTemplateObject(["\n width: 100%;\n display: flex;\n align-items: flex-start;\n font-weight: 500;\n color: ",";\n margin-right: 5px;\n"],["\n width: 100%;\n display: flex;\n align-items: flex-start;\n font-weight: 500;\n color: ",";\n margin-right: 5px;\n"])),palette_gray60),WheelsTV_VehicleYear=styled_components_browser_esm.Ay.div(WheelsTV_templateObject_11||(WheelsTV_templateObject_11=WheelsTV_makeTemplateObject(["\n height: 20px;\n margin-left: 24px;\n font-size: 14px;\n line-height: 24px;\n text-align: left !important;\n color: ",";\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 1; /* number of lines to show */\n -webkit-box-orient: vertical;\n max-width: 180px;\n min-width: 40px;\n"],["\n height: 20px;\n margin-left: 24px;\n font-size: 14px;\n line-height: 24px;\n text-align: left !important;\n color: ",";\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 1; /* number of lines to show */\n -webkit-box-orient: vertical;\n max-width: 180px;\n min-width: 40px;\n"])),palette_gray100),WheelsTV_VehicleMake=styled_components_browser_esm.Ay.div(WheelsTV_templateObject_13||(WheelsTV_templateObject_13=WheelsTV_makeTemplateObject(["\n height: 20px;\n margin-left: 24px;\n font-size: 14px;\n line-height: 24px;\n text-align: left !important;\n color: ",";\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 1; /* number of lines to show */\n -webkit-box-orient: vertical;\n max-width: 275px;\n min-width: 200px;\n ","\n"],["\n height: 20px;\n margin-left: 24px;\n font-size: 14px;\n line-height: 24px;\n text-align: left !important;\n color: ",";\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 1; /* number of lines to show */\n -webkit-box-orient: vertical;\n max-width: 275px;\n min-width: 200px;\n ","\n"])),palette_gray100,(function(_a){return _a.theme.containerWidth<screenSizes_mb&&(0,styled_components_browser_esm.AH)(WheelsTV_templateObject_12||(WheelsTV_templateObject_12=WheelsTV_makeTemplateObject(["\n min-width: 100px;\n "],["\n min-width: 100px;\n "])))})),WheelsTV_VehicleModel=styled_components_browser_esm.Ay.div(WheelsTV_templateObject_14||(WheelsTV_templateObject_14=WheelsTV_makeTemplateObject(["\n height: 20px;\n margin-left: 24px;\n font-size: 14px;\n line-height: 24px;\n text-align: left !important;\n color: ",";\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 1; /* number of lines to show */\n -webkit-box-orient: vertical;\n width: inherit;\n"],["\n height: 20px;\n margin-left: 24px;\n font-size: 14px;\n line-height: 24px;\n text-align: left !important;\n color: ",";\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 1; /* number of lines to show */\n -webkit-box-orient: vertical;\n width: inherit;\n"])),palette_gray100),WheelsTV_VideoOptions=styled_components_browser_esm.Ay.div(WheelsTV_templateObject_15||(WheelsTV_templateObject_15=WheelsTV_makeTemplateObject(["\n height: 40px;\n width: inherit;\n text-align-last: end;\n margin-left: 24px;\n font-size: 14px;\n line-height: 24px;\n text-align: left !important;\n color: ",";\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n max-width: 173px;\n -webkit-line-clamp: 1; /* number of lines to show */\n -webkit-box-orient: vertical;\n"],["\n height: 40px;\n width: inherit;\n text-align-last: end;\n margin-left: 24px;\n font-size: 14px;\n line-height: 24px;\n text-align: left !important;\n color: ",";\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n max-width: 173px;\n -webkit-line-clamp: 1; /* number of lines to show */\n -webkit-box-orient: vertical;\n"])),palette_gray100),WheelsTV_LoadingWrapper=styled_components_browser_esm.Ay.div(WheelsTV_templateObject_16||(WheelsTV_templateObject_16=WheelsTV_makeTemplateObject(["\n margin-top: 100px;\n"],["\n margin-top: 100px;\n"]))),WheelsTV_EmptySearch=styled_components_browser_esm.Ay.div(WheelsTV_templateObject_17||(WheelsTV_templateObject_17=WheelsTV_makeTemplateObject(["\n font-size: 14px;\n font-weight: bold;\n text-align: center;\n"],["\n font-size: 14px;\n font-weight: bold;\n text-align: center;\n"]))),WheelsTV_TablePaginationContainer=styled_components_browser_esm.Ay.div(WheelsTV_templateObject_18||(WheelsTV_templateObject_18=WheelsTV_makeTemplateObject(["\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: flex-end;\n margin-top: 16px;\n"],["\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: flex-end;\n margin-top: 16px;\n"]))),WheelsTV_PaginationText=styled_components_browser_esm.Ay.span(WheelsTV_templateObject_19||(WheelsTV_templateObject_19=WheelsTV_makeTemplateObject(["\n color: ",";\n height: 20px;\n font-size: 14px;\n font-weight: 400;\n font-stretch: normal;\n font-style: normal;\n line-height: 20px;\n letter-spacing: normal;\n color: #4e5461;\n"],["\n color: ",";\n height: 20px;\n font-size: 14px;\n font-weight: 400;\n font-stretch: normal;\n font-style: normal;\n line-height: 20px;\n letter-spacing: normal;\n color: #4e5461;\n"])),palette_gray80),WheelsTV_PageInput=styled_components_browser_esm.Ay.input(WheelsTV_templateObject_20||(WheelsTV_templateObject_20=WheelsTV_makeTemplateObject(["\n height: 40px;\n width: 50px;\n margin-right: 16px;\n outline: 0;\n text-align: center;\n font-size: 15px;\n border: 1px solid ",";\n border-radius: 6px;\n"],["\n height: 40px;\n width: 50px;\n margin-right: 16px;\n outline: 0;\n text-align: center;\n font-size: 15px;\n border: 1px solid ",";\n border-radius: 6px;\n"])),(function(_a){return _a.theme.colors.primary[20]})),WheelsTV_Navigation=styled_components_browser_esm.Ay.div(WheelsTV_templateObject_22||(WheelsTV_templateObject_22=WheelsTV_makeTemplateObject(["\n display: flex;\n gap: 8px;\n justify-content: flex-end;\n align-items: center;\n ","\n"],["\n display: flex;\n gap: 8px;\n justify-content: flex-end;\n align-items: center;\n ","\n"])),(function(_a){return _a.theme.containerWidth<screenSizes_mb&&(0,styled_components_browser_esm.AH)(WheelsTV_templateObject_21||(WheelsTV_templateObject_21=WheelsTV_makeTemplateObject(["\n width: 100%;\n "],["\n width: 100%;\n "])))})),DEFAULT_YEAR=(new Date).getFullYear(),WheelsTV=function(){var history=(0,react_router.W6)(),containerWidth=(useAuthorizationContext().userData,useConfigurationContext().containerWidth),_a=WheelsTV_read((0,react.useState)(""),2),searchTerm=_a[0],setSearchTerm=_a[1],_b=WheelsTV_read((0,react.useState)(1),2),currentPage=_b[0],setCurrentPage=_b[1],_c=WheelsTV_read((0,react.useState)(1),2),searchDelay=_c[0],setSearchDelay=_c[1],_d=WheelsTV_read((0,react.useState)(DEFAULT_YEAR),2),selectedYear=_d[0],setSelectedYear=_d[1],_e=WheelsTV_read((0,react.useState)(1),2),count=_e[0],setCount=_e[1],_f=WheelsTV_read((0,react.useState)(1),2),lastPage=_f[0],setLastPage=_f[1],_g=WheelsTV_read((0,react.useState)([]),2),videos=_g[0],setVideos=_g[1],toast=useToastNotifications().toast,_h=WheelsTV_read((0,react.useState)(!0),2),loading=_h[0],setLoading=_h[1],goToLibrary=function(){return history.push("/")},rejectSearch=function(){};(0,react.useEffect)((function(){WheelsTV_awaiter(void 0,void 0,void 0,(function(){var data,limit;return WheelsTV_generator(this,(function(_a){switch(_a.label){case 0:setLoading(!0),_a.label=1;case 1:return _a.trys.push([1,3,,4]),[4,getWTVVideos({limit:10,page:currentPage,year:selectedYear,search:searchTerm})];case 2:return data=_a.sent(),setCount(data.count),setVideos(data.videos),limit=data.count<10?data.count:10,setLastPage(Math.ceil(data.count/limit)),setLoading(!1),[3,4];case 3:return _a.sent(),setLoading(!1),[3,4];case 4:return[2]}}))}))}),[10,currentPage,selectedYear]);for(var handleSearch=function(search,page,year){return void 0===search&&(search=""),void 0===page&&(page=0),void 0===year&&(year=0),WheelsTV_awaiter(void 0,void 0,void 0,(function(){return WheelsTV_generator(this,(function(_a){return search.length<2&&""!==search||(search!==searchTerm&&(setSearchTerm(search),page=1,setCurrentPage(1)),searchDelay>0&&clearTimeout(searchDelay),rejectSearch(),new Promise((function(resolve,reject){rejectSearch=reject,setSearchDelay(setTimeout(resolve,search!==searchTerm?500:0))})).then((function(){return WheelsTV_awaiter(void 0,void 0,void 0,(function(){var data;return WheelsTV_generator(this,(function(_a){switch(_a.label){case 0:setLoading(!0),0===year&&(year=selectedYear),_a.label=1;case 1:return _a.trys.push([1,3,,4]),[4,getWTVVideos({limit:10,search,page,year})];case 2:return data=_a.sent(),setCount(data.count),setVideos(data.videos),setLastPage(Math.ceil(data.count/10)),setLoading(!1),[3,4];case 3:return _a.sent(),setLoading(!1),[3,4];case 4:return[2]}}))}))}))),[2]}))}))},onPageChange=function(direction){"left"===direction&&(handleSearch(searchTerm,currentPage-1,selectedYear),setCurrentPage((function(prevPage){return prevPage-1}))),"right"===direction&&(handleSearch(searchTerm,currentPage+1,selectedYear),setCurrentPage((function(prevPage){return prevPage+1})))},years=[],i=DEFAULT_YEAR;i>2007;i--)years.push({value:i.toString(),label:i.toString()});return(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsxs)(WheelsTV_Wrapper,{children:[(0,jsx_runtime.jsx)(TopBar,{left:(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{text:"Back",variant:"transparent",icon:(0,jsx_runtime.jsx)(md_index_esm.MGo,{size:"18"}),onClick:function(){return goToLibrary()},style:{color:"white"}}),center:(0,jsx_runtime.jsx)(TitleWrapper,{children:"Wheels TV Import"})}),(0,jsx_runtime.jsx)(Container,{children:(0,jsx_runtime.jsxs)(WheelsTV_SearchAndFilterWrapper,{children:[(0,jsx_runtime.jsx)(components_Search_Search,{handleSearch,prevSearch:searchTerm}),(0,jsx_runtime.jsx)(WheelsTV_YearWrap,{children:(0,jsx_runtime.jsx)(Dropdown,{value:{value:selectedYear.toString()||"",label:selectedYear.toString()||""},onChange:function(value){setSelectedYear(value.value),setCurrentPage(1),handleSearch(searchTerm,1,value.value)},options:years,isSearchable:!1,creatable:!1})})]})})]}),(0,jsx_runtime.jsx)(WheelsTV_TableContentContainer,{children:(0,jsx_runtime.jsx)(Container,WheelsTV_assign({extendStyle:{wrapper:{padding:containerWidth>=screenSizes_xs?"32px 16px":"16px 0px"}}},{children:loading?(0,jsx_runtime.jsx)(WheelsTV_LoadingWrapper,{children:(0,jsx_runtime.jsx)(LoadingIndicator,{isLoading:loading})}):videos.length?(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsxs)(WheelsTV_TableHeaderContainer,{children:[containerWidth>=screenSizes_xs&&(0,jsx_runtime.jsx)(WheelsTV_VehicleYear,{children:(0,jsx_runtime.jsx)(WheelsTV_TableColumnTitle,{children:"Year"})}),(0,jsx_runtime.jsx)(WheelsTV_VehicleMake,{children:(0,jsx_runtime.jsx)(WheelsTV_TableColumnTitle,{children:"Make"})}),(0,jsx_runtime.jsx)(WheelsTV_VehicleModel,{children:(0,jsx_runtime.jsx)(WheelsTV_TableColumnTitle,{children:"Model"})})]}),(0,jsx_runtime.jsx)(WheelsTV_VideosList,{children:videos.map((function(video){return(0,jsx_runtime.jsxs)(WheelsTV_Video,WheelsTV_assign({onClick:function(){}},{children:[containerWidth>=screenSizes_xs&&(0,jsx_runtime.jsx)(WheelsTV_VehicleYear,{children:video.year}),(0,jsx_runtime.jsx)(WheelsTV_VehicleMake,{children:video.make}),(0,jsx_runtime.jsx)(WheelsTV_VehicleModel,{children:video.model}),(0,jsx_runtime.jsx)(WheelsTV_VideoOptions,{children:(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{onClick:function(){return WheelsTV_awaiter(void 0,void 0,void 0,(function(){return WheelsTV_generator(this,(function(_a){return function(video){WheelsTV_awaiter(void 0,void 0,void 0,(function(){return WheelsTV_generator(this,(function(_a){switch(_a.label){case 0:setLoading(!0),_a.label=1;case 1:return _a.trys.push([1,3,,4]),[4,(props={title:video.year+" "+video.make+" "+video.model,flvName:video.wtvVideoId,animatedGifPath:video.animatedGifPath,year:parseInt(video.year),make:video.make,model:video.model,wtvId:video.wtvId},wtvApi_awaiter(void 0,void 0,void 0,(function(){var data;return wtvApi_generator(this,(function(_a){switch(_a.label){case 0:return data={title:props.title,flvName:props.flvName,wtvId:parseInt(props.wtvId.toString(),10),animatedGifPath:props.animatedGifPath,notes:props.year+";"+props.make+";"+props.model+";"+props.title},[4,config_EXPRESS_API.post("/wtv/videos",data)];case 1:return[2,_a.sent().data]}}))})))];case 2:return _a.sent(),setLoading(!1),toast({message:"Video has been added!"}),goToLibrary(),[3,4];case 3:return _a.sent(),setLoading(!1),toast({message:"An error occured while trying to add the video!"}),[3,4];case 4:return[2]}var props}))}))}(video),[2]}))}))},text:"Add",variant:"secondary"})})]}),video.wtvVideoId)}))}),(0,jsx_runtime.jsx)(WheelsTV_TablePaginationContainer,{children:(0,jsx_runtime.jsxs)(WheelsTV_Navigation,{children:[(0,jsx_runtime.jsx)(WheelsTV_PaginationText,{children:"Go to:"}),(0,jsx_runtime.jsx)(WheelsTV_PageInput,{type:"number",min:1,value:currentPage,onChange:function(e){if(e.currentTarget&&e.currentTarget.value){var newPage=parseInt(e.currentTarget.value);if(newPage<=0)return setCurrentPage(1),void handleSearch(searchTerm,1,selectedYear);if(newPage>lastPage)return setCurrentPage(lastPage),void handleSearch(searchTerm,lastPage,selectedYear);setCurrentPage(newPage),handleSearch(searchTerm,newPage,selectedYear)}}}),(0,jsx_runtime.jsx)(components_PageInfo_PageInfo,{page:currentPage-1,size:10,count}),(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{onClick:function(){return onPageChange("left")},icon:(0,jsx_runtime.jsx)(md_index_esm.E_E,{size:20}),disabled:1===currentPage,variant:"secondary",size:"small"}),(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{onClick:function(){return onPageChange("right")},icon:(0,jsx_runtime.jsx)(md_index_esm.xVu,{size:20}),disabled:currentPage===lastPage,variant:"secondary",size:"small"})]})})]}):(0,jsx_runtime.jsxs)(WheelsTV_EmptySearch,{children:[(0,jsx_runtime.jsx)("p",{children:"Oops! It looks like there are no videos matching your search terms."}),(0,jsx_runtime.jsx)("p",{children:"Try using a different search terms"})]})}))})]})},VideoRow_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},VideoRow_assign=function(){return VideoRow_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},VideoRow_assign.apply(this,arguments)},VideoRow_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},VideoRow_spreadArray=function(to,from,pack){if(pack||2===arguments.length)for(var ar,i=0,l=from.length;i<l;i++)!ar&&i in from||(ar||(ar=Array.prototype.slice.call(from,0,i)),ar[i]=from[i]);return to.concat(ar||Array.prototype.slice.call(from))},VideoRow_Row=styled_components_browser_esm.Ay.div(VideoRow_templateObject_1||(VideoRow_templateObject_1=VideoRow_makeTemplateObject(["\n padding-left: 2px;\n padding-right: 2px;\n padding-top: 2px;\n display: flex;\n flex-direction: column;\n margin-left: 20px;\n height: 85px;\n"],["\n padding-left: 2px;\n padding-right: 2px;\n padding-top: 2px;\n display: flex;\n flex-direction: column;\n margin-left: 20px;\n height: 85px;\n"]))),RangeWrapper=styled_components_browser_esm.Ay.div(VideoRow_templateObject_2||(VideoRow_templateObject_2=VideoRow_makeTemplateObject(["\n position: relative;\n left: ",";\n width: ",";\n"],["\n position: relative;\n left: ",";\n width: ",";\n"])),(function(props){return props.offset}),(function(props){return props.width})),VideoRow=function(_a){var index=_a.index,totalDuration=_a.totalDuration,offset=_a.offset,width=_a.width,_b=_a.video,video=void 0===_b?{}:_b,_c=_a.setVideos,setVideos=void 0===_c?function(){}:_c,hasProcessingVideos=_a.hasProcessingVideos,_d=_a.showPreviewTrack,showPreviewTrack=void 0===_d||_d,valueRef=react.useRef([0,0]),_e=VideoRow_read((0,react.useState)([0,video.duration]),2),value=_e[0],setValue=_e[1];(0,react.useEffect)((function(){setVideos((function(videos){var vtm=VideoRow_spreadArray([],VideoRow_read(videos),!1),startSec=value[0],endSec=value[1],time="#t=".concat(startSec||0).concat(endSec?","+endSec:"");return vtm[index]=VideoRow_assign(VideoRow_assign({},vtm[index]),{start:toHHMMSSFF(value[0]),end:toHHMMSSFF(value[1]),startSec,endSec,source:(""+video.source).split("#t=")[0]+time}),vtm}))}),[value]);var onUpdate=function(args){var duration=args[1]-args[0];setVideos((function(videos){var vtm=VideoRow_spreadArray([],VideoRow_read(videos),!1);return vtm[index]=VideoRow_assign(VideoRow_assign({},vtm[index]),{width:100*duration/totalDuration,trimDuration:duration}),vtm}))};return(0,react.useEffect)((function(){totalDuration&&setVideos((function(videos){var vtm=VideoRow_spreadArray([],VideoRow_read(videos),!1);return vtm[index]=VideoRow_assign(VideoRow_assign({},vtm[index]),{width:100*video.trimDuration/totalDuration}),vtm}))}),[totalDuration]),(0,react.useMemo)((function(){return(0,jsx_runtime.jsx)(VideoRow_Row,{children:(0,jsx_runtime.jsx)(RangeWrapper,VideoRow_assign({offset:"".concat(offset||0,"px"),width:"".concat(width||0,"px")},{children:!!video.duration&&video.ref&&!hasProcessingVideos&&(0,jsx_runtime.jsx)(TimelineRange,{videoRef:video.ref,videoDuration:video.duration,videoSource:video.videoSource,setValue,showTickTime:!1,value,valueRef,width:"100%",onSlideEnd:onUpdate,showPreviewTrack})}))},video.id)}),[video.width,video.ref,value,offset,width,video.processing])};function drag_icon_extends(){return drag_icon_extends=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},drag_icon_extends.apply(null,arguments)}const drag_icon=function SvgDragIcon(props){return react.createElement("svg",drag_icon_extends({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props),drag_icon_path||(drag_icon_path=react.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M21 17C21.5523 17 22 16.5523 22 16C22 15.4477 21.5523 15 21 15H3C2.44772 15 2 15.4477 2 16C2 16.5523 2.44772 17 3 17H21ZM21 13C21.5523 13 22 12.5523 22 12C22 11.4477 21.5523 11 21 11H3C2.44772 11 2 11.4477 2 12C2 12.5523 2.44772 13 3 13H21ZM2 8C2 8.55228 2.44772 9 3 9H21C21.5523 9 22 8.55228 22 8C22 7.44772 21.5523 7 21 7H3C2.44772 7 2 7.44772 2 8Z",fill:"#001B53",fillOpacity:.4})))};var Drag_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked};const images_Drag=(0,styled_components_browser_esm.Ay)(drag_icon)(Drag_templateObject_1||(Drag_templateObject_1=Drag_makeTemplateObject(["\n width: ",";\n height: ",";\n g {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n g {\n fill: ",";\n opacity: ",";\n }\n"])),(function(props){return props.width||"24px"}),(function(props){return props.height||"24px"}),(function(props){return props.color||"currentColor"}),(function(props){return props.opacity||"inherit"}));var Drag_templateObject_1,VideoThumbnail_templateObject_1,VideoThumbnail_templateObject_2,VideoThumbnail_templateObject_3,VideoThumbnail_templateObject_4,VideoThumbnail_templateObject_5,zoom_out_defs,zoom_out_g,VideoThumbnail_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},VideoThumbnail_assign=function(){return VideoThumbnail_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},VideoThumbnail_assign.apply(this,arguments)},VideoThumbnail_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},VideoThumbnail_spreadArray=function(to,from,pack){if(pack||2===arguments.length)for(var ar,i=0,l=from.length;i<l;i++)!ar&&i in from||(ar||(ar=Array.prototype.slice.call(from,0,i)),ar[i]=from[i]);return to.concat(ar||Array.prototype.slice.call(from))},VideoThumbnail_VideoWrapper=styled_components_browser_esm.Ay.div(VideoThumbnail_templateObject_1||(VideoThumbnail_templateObject_1=VideoThumbnail_makeTemplateObject(["\n background-color: ",";\n max-height: 80px;\n align-self: center;\n border-radius: 6px;\n box-shadow:\n 0px 0px 2px rgba(66, 79, 104, 0.08),\n 0px 4px 8px rgba(66, 79, 104, 0.03);\n border-radius: 6px;\n overflow: hidden;\n position: relative;\n aspect-ratio: 16 / 9;\n div {\n display: contents;\n opacity: 0;\n div {\n display: none;\n opacity: 0;\n }\n svg {\n display: none;\n opacity: 0;\n }\n path {\n display: none;\n opacity: 0;\n }\n figure {\n display: contents;\n opacity: 0;\n }\n video {\n display: contents;\n opacity: 0;\n }\n img {\n display: contents;\n opacity: 0;\n }\n }\n"],["\n background-color: ",";\n max-height: 80px;\n align-self: center;\n border-radius: 6px;\n box-shadow:\n 0px 0px 2px rgba(66, 79, 104, 0.08),\n 0px 4px 8px rgba(66, 79, 104, 0.03);\n border-radius: 6px;\n overflow: hidden;\n position: relative;\n aspect-ratio: 16 / 9;\n div {\n display: contents;\n opacity: 0;\n div {\n display: none;\n opacity: 0;\n }\n svg {\n display: none;\n opacity: 0;\n }\n path {\n display: none;\n opacity: 0;\n }\n figure {\n display: contents;\n opacity: 0;\n }\n video {\n display: contents;\n opacity: 0;\n }\n img {\n display: contents;\n opacity: 0;\n }\n }\n"])),palette_themeDark),VideoImg=styled_components_browser_esm.Ay.img(VideoThumbnail_templateObject_2||(VideoThumbnail_templateObject_2=VideoThumbnail_makeTemplateObject(["\n background-color: ",";\n display: block;\n height: 100%;\n margin: auto;\n border-radius: 6px;\n width: 120px;\n object-fit: contain;\n"],["\n background-color: ",";\n display: block;\n height: 100%;\n margin: auto;\n border-radius: 6px;\n width: 120px;\n object-fit: contain;\n"])),palette_themeDark),VideoThumbnail_Row=styled_components_browser_esm.Ay.div(VideoThumbnail_templateObject_3||(VideoThumbnail_templateObject_3=VideoThumbnail_makeTemplateObject(["\n padding-right: 32px;\n border-top-left-radius: 16px;\n border-bottom-left-radius: 16px;\n background-color: #fff;\n height: 80px;\n display: flex;\n flex-direction: row;\n margin-bottom: 8px;\n"],["\n padding-right: 32px;\n border-top-left-radius: 16px;\n border-bottom-left-radius: 16px;\n background-color: #fff;\n height: 80px;\n display: flex;\n flex-direction: row;\n margin-bottom: 8px;\n"]))),DragContainer=styled_components_browser_esm.Ay.div(VideoThumbnail_templateObject_4||(VideoThumbnail_templateObject_4=VideoThumbnail_makeTemplateObject(["\n display: flex;\n justify-content: center;\n height: 80px;\n width: 48px;\n align-items: center;\n opacity: 0.8;\n &:hover {\n cursor: ",";\n opacity: 1;\n }\n"],["\n display: flex;\n justify-content: center;\n height: 80px;\n width: 48px;\n align-items: center;\n opacity: 0.8;\n &:hover {\n cursor: ",";\n opacity: 1;\n }\n"])),(function(props){return props.disabled?"not-allowed":"grab"})),VideoThumbnail_SpinnerWrapper=styled_components_browser_esm.Ay.div(VideoThumbnail_templateObject_5||(VideoThumbnail_templateObject_5=VideoThumbnail_makeTemplateObject(["\n background-color: ",";\n\n aspect-ratio: 16 / 9;\n width: 120px;\n max-height: 80px;\n margin: 6px 0;\n box-sizing: border-box;\n border-radius: 6px;\n\n display: flex;\n justify-content: center;\n align-items: center;\n"],["\n background-color: ",";\n\n aspect-ratio: 16 / 9;\n width: 120px;\n max-height: 80px;\n margin: 6px 0;\n box-sizing: border-box;\n border-radius: 6px;\n\n display: flex;\n justify-content: center;\n align-items: center;\n"])),palette_themeDark),VideoThumbnail_VideoThumbnail=function(_a){var _b=_a.video,video=void 0===_b?{}:_b,_c=_a.setVideos,setVideos=void 0===_c?function(){}:_c,setVideoRef=_a.setVideoRef,index=_a.index,isDragDisabled=_a.isDragDisabled,setShouldFetch=_a.setShouldFetch,videoRef=react.createRef(),_d=VideoThumbnail_read((0,react.useState)(0),2),videoDuration=_d[0],setVideoDuration=_d[1],isExternalVideo=!!(null==video?void 0:video.id)&&(null==video?void 0:video.id.toString().includes("~~~external-video~~~")),_e=hooks_useVideoLoadRetry({videoId:(null==video?void 0:video.id)||0,enabled:!isExternalVideo&&(null==video?void 0:video.processing)===VideoEncodingStatus.PROCESSING}),videoData=_e.videoData,retryCount=_e.retryCount,imgRef=hooks_useImageLoadRetry({src:(null==videoData?void 0:videoData.autogeneratedThumbnail)||(null==video?void 0:video.autoGeneratedGifPath)}).imgRef;(0,react.useEffect)((function(){videoDuration&&setVideos((function(videos){var vtm=VideoThumbnail_spreadArray([],VideoThumbnail_read(videos),!1);return vtm[index]=VideoThumbnail_assign(VideoThumbnail_assign({},vtm[index]),{duration:videoDuration,trimDuration:videoDuration}),vtm}))}),[videoDuration]),(0,react.useEffect)((function(){videoRef&&videoRef.current&&(videoRef.current.onloadedmetadata=function(){return function(){if(videoRef.current){var duration=videoRef.current.duration;setVideoDuration(duration)}}()},setVideoRef(index,videoRef))}),[videoRef]),(0,react.useEffect)((function(){videoData&&0!==retryCount&&setShouldFetch(!0)}),[videoData,retryCount]);var isFinishedProcessing=video.processing===VideoEncodingStatus.FAILED||video.processing===VideoEncodingStatus.READY;return(0,react.useMemo)((function(){return(0,jsx_runtime.jsxs)(VideoThumbnail_Row,{children:[(0,jsx_runtime.jsx)(DragContainer,VideoThumbnail_assign({disabled:isDragDisabled},{children:(0,jsx_runtime.jsx)(images_Drag,{})})),isFinishedProcessing?(0,jsx_runtime.jsxs)(VideoThumbnail_VideoWrapper,{children:[imgRef.current?(0,jsx_runtime.jsx)(VideoImg,{ref:imgRef}):(0,jsx_runtime.jsx)(VideoImg,{src:video.autogeneratedThumbnail}),(0,jsx_runtime.jsx)(VideoPlayer,{videoSource:video.videoSource,videoId:video.id,thumbnail:video.autogeneratedThumbnail,videoRef,autoplay:!1})]}):(0,jsx_runtime.jsx)(VideoThumbnail_SpinnerWrapper,{children:(0,jsx_runtime.jsx)(Spinner,{})})]},video.id)}),[video.videoSource,video.processing,videoData])};function zoom_out_extends(){return zoom_out_extends=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},zoom_out_extends.apply(null,arguments)}const zoom_out=function SvgZoomOut(props){return react.createElement("svg",zoom_out_extends({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:24,height:24,viewBox:"0 0 24 24"},props),zoom_out_defs||(zoom_out_defs=react.createElement("defs",null,react.createElement("path",{id:"p1bfbm3cda",d:"M15.5 14h-.79l-.28-.27c1.2-1.4 1.82-3.31 1.48-5.34-.47-2.78-2.79-5-5.59-5.34-4.23-.52-7.79 3.04-7.27 7.27.34 2.8 2.56 5.12 5.34 5.59 2.03.34 3.94-.28 5.34-1.48l.27.28v.79l4.26 4.25c.41.41 1.07.41 1.48 0l.01-.01c.41-.41.41-1.07 0-1.48L15.5 14zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zm-2-5h4c.28 0 .5.22.5.5s-.22.5-.5.5h-4c-.28 0-.5-.22-.5-.5s.22-.5.5-.5z"}))),zoom_out_g||(zoom_out_g=react.createElement("g",{fill:"none",fillRule:"evenodd",opacity:.2},react.createElement("g",null,react.createElement("g",null,react.createElement("g",{transform:"translate(-1112 -640) translate(1104 632) translate(8 8)"},react.createElement("mask",{id:"98kq0pmrgb",fill:"#fff"},react.createElement("use",{xlinkHref:"#p1bfbm3cda"})),react.createElement("use",{fill:"#000",fillRule:"nonzero",xlinkHref:"#p1bfbm3cda"}),react.createElement("g",{fill:"#272A32",mask:"url(#98kq0pmrgb)"},react.createElement("path",{d:"M0 0H24V24H0z"}))))))))};var ZoomOutIcon_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked};const images_ZoomOutIcon=(0,styled_components_browser_esm.Ay)(zoom_out)(ZoomOutIcon_templateObject_1||(ZoomOutIcon_templateObject_1=ZoomOutIcon_makeTemplateObject(["\n width: ",";\n height: ",";\n g {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n g {\n fill: ",";\n opacity: ",";\n }\n"])),(function(props){return props.width||"24px"}),(function(props){return props.height||"24px"}),(function(props){return props.color||"currentColor"}),(function(props){return props.opacity||"inherit"}));var ZoomOutIcon_templateObject_1,zoom_in_defs,zoom_in_g;function zoom_in_extends(){return zoom_in_extends=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},zoom_in_extends.apply(null,arguments)}const zoom_in=function SvgZoomIn(props){return react.createElement("svg",zoom_in_extends({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:24,height:24,viewBox:"0 0 24 24"},props),zoom_in_defs||(zoom_in_defs=react.createElement("defs",null,react.createElement("path",{id:"eekoyvk17a",d:"M15.499 14h-.79l-.28-.27c1.2-1.4 1.82-3.31 1.48-5.34-.47-2.78-2.79-5-5.59-5.34-4.23-.52-7.78 3.04-7.27 7.27.34 2.8 2.56 5.12 5.34 5.59 2.03.34 3.94-.28 5.34-1.48l.27.28v.79l4.26 4.25c.41.41 1.07.41 1.48 0l.01-.01c.41-.41.41-1.07 0-1.48L15.499 14zm-6 0c-2.49 0-4.5-2.01-4.5-4.5S7.009 5 9.499 5s4.5 2.01 4.5 4.5-2.01 4.5-4.5 4.5zm0-7c-.28 0-.5.22-.5.5V9h-1.5c-.28 0-.5.22-.5.5s.22.5.5.5h1.5v1.5c0 .28.22.5.5.5s.5-.22.5-.5V10h1.5c.28 0 .5-.22.5-.5s-.22-.5-.5-.5h-1.5V7.5c0-.28-.22-.5-.5-.5z"}))),zoom_in_g||(zoom_in_g=react.createElement("g",{fill:"none",fillRule:"evenodd"},react.createElement("g",null,react.createElement("g",null,react.createElement("g",null,react.createElement("g",{transform:"translate(-1376 -640) translate(1104 632) translate(264) translate(8 8)"},react.createElement("mask",{id:"4qknrgzsbb",fill:"#fff"},react.createElement("use",{xlinkHref:"#eekoyvk17a"})),react.createElement("g",{fill:"#272A32",mask:"url(#4qknrgzsbb)"},react.createElement("path",{d:"M0 0H24V24H0z"})))))))))};var ZoomInIcon_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked};const images_ZoomInIcon=(0,styled_components_browser_esm.Ay)(zoom_in)(ZoomInIcon_templateObject_1||(ZoomInIcon_templateObject_1=ZoomInIcon_makeTemplateObject(["\n width: ",";\n height: ",";\n g {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n g {\n fill: ",";\n opacity: ",";\n }\n"])),(function(props){return props.width||"24px"}),(function(props){return props.height||"24px"}),(function(props){return props.color||"currentColor"}),(function(props){return props.opacity||"inherit"}));var ZoomInIcon_templateObject_1,onScreenPlayButton_templateObject_1,onScreenPlayButton_templateObject_2,onScreenPlayButton_templateObject_3,onScreenPlayButton_templateObject_4,onScreenPlayButton_templateObject_5,onScreenPlayButton_templateObject_6,onScreenPlayButton_templateObject_7,Player_templateObject_1,Player_templateObject_2,Player_templateObject_3,Player_templateObject_4,Player_templateObject_5,close_circle_path,close_circle_path2,onScreenPlayButton_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},onScreenPlayButton_assign=function(){return onScreenPlayButton_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},onScreenPlayButton_assign.apply(this,arguments)},OnScreenPlayButtonWrapper=styled_components_browser_esm.Ay.div(onScreenPlayButton_templateObject_7||(onScreenPlayButton_templateObject_7=onScreenPlayButton_makeTemplateObject(["\n display: ",";\n justify-content: center;\n align-items: center;\n background-color: ",";\n opacity: 0.5;\n font-size: ",";\n cursor: pointer;\n width: ","; /*TODO: Check with Andrija, it's 120px on one screen and 100px on another*/\n height: ","; /*TODO: Check with Andrija, it's 120px on one screen and 100px on another*/\n position: absolute;\n\n z-index: 9;\n ","\n\n ","\n\n ","\n\n ","\n\n ","\n\n ","\n"],["\n display: ",";\n justify-content: center;\n align-items: center;\n background-color: ",";\n opacity: 0.5;\n font-size: ",";\n cursor: pointer;\n width: ","; /*TODO: Check with Andrija, it's 120px on one screen and 100px on another*/\n height: ","; /*TODO: Check with Andrija, it's 120px on one screen and 100px on another*/\n position: absolute;\n\n z-index: 9;\n ","\n\n ","\n\n ","\n\n ","\n\n ","\n\n ","\n"])),(function(props){return props.isVideoPaused?"flex":"none"}),(function(props){return props.hex}),(function(props){return props.small?"10px":"40px"}),(function(props){return"".concat(props.small?"30px":"54px")}),(function(props){return"".concat(props.small?"30px":"54px")}),(function(props){return"center"===props.playButtonPosition&&(0,styled_components_browser_esm.AH)(onScreenPlayButton_templateObject_1||(onScreenPlayButton_templateObject_1=onScreenPlayButton_makeTemplateObject(["\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n "],["\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n "])))}),(function(props){return"top-left"===props.playButtonPosition&&(0,styled_components_browser_esm.AH)(onScreenPlayButton_templateObject_2||(onScreenPlayButton_templateObject_2=onScreenPlayButton_makeTemplateObject(["\n top: 5%;\n left: 5%;\n "],["\n top: 5%;\n left: 5%;\n "])))}),(function(props){return"top-right"===props.playButtonPosition&&(0,styled_components_browser_esm.AH)(onScreenPlayButton_templateObject_3||(onScreenPlayButton_templateObject_3=onScreenPlayButton_makeTemplateObject(["\n top: 5%;\n right: 5%;\n "],["\n top: 5%;\n right: 5%;\n "])))}),(function(props){return"bottom-left"===props.playButtonPosition&&(0,styled_components_browser_esm.AH)(onScreenPlayButton_templateObject_4||(onScreenPlayButton_templateObject_4=onScreenPlayButton_makeTemplateObject(["\n bottom: 23%;\n left: 5%;\n "],["\n bottom: 23%;\n left: 5%;\n "])))}),(function(props){return"bottom-right"===props.playButtonPosition&&(0,styled_components_browser_esm.AH)(onScreenPlayButton_templateObject_5||(onScreenPlayButton_templateObject_5=onScreenPlayButton_makeTemplateObject(["\n bottom: 23%;\n right: 5%;\n "],["\n bottom: 23%;\n right: 5%;\n "])))}),(function(props){return"none"===props.playButtonPosition&&(0,styled_components_browser_esm.AH)(onScreenPlayButton_templateObject_6||(onScreenPlayButton_templateObject_6=onScreenPlayButton_makeTemplateObject(["\n display: none;\n "],["\n display: none;\n "])))})),OnScreenPlayButton=function(props){var playerBackgroundColor=props.playerBackgroundColor,playButtonPosition=props.playButtonPosition,isVideoPaused=props.isVideoPaused,togglePlay=props.togglePlay,playerIconsColor=props.playerIconsColor,small=props.small,newColor=color_convert.hex.rgb(playerBackgroundColor);return(0,jsx_runtime.jsx)(OnScreenPlayButtonWrapper,onScreenPlayButton_assign({isVideoPaused,onClick:togglePlay,r:newColor[0],g:newColor[1],b:newColor[2],hex:playerBackgroundColor,playButtonPosition,small},{children:(0,jsx_runtime.jsx)(md_index_esm.XKH,{color:playerIconsColor})}))},Player_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},Player_assign=function(){return Player_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},Player_assign.apply(this,arguments)},Player_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},VideoContainer=styled_components_browser_esm.Ay.div(Player_templateObject_2||(Player_templateObject_2=Player_makeTemplateObject(["\n position: relative;\n background-color: ",";\n border-radius: 6px;\n width: ","px;\n height: ","px;\n max-width: 100%;\n ","\n"],["\n position: relative;\n background-color: ",";\n border-radius: 6px;\n width: ","px;\n height: ","px;\n max-width: 100%;\n ","\n"])),palette_themeDark75Percent,(function(props){return props.width||600}),(function(props){return props.height||300}),(function(_a){return _a.theme.containerWidth<=screenSizes_mb&&(0,styled_components_browser_esm.AH)(Player_templateObject_1||(Player_templateObject_1=Player_makeTemplateObject(["\n border-radius: 0;\n "],["\n border-radius: 0;\n "])))})),ControlsContainer=styled_components_browser_esm.Ay.div(Player_templateObject_3||(Player_templateObject_3=Player_makeTemplateObject(["\n width: 100%;\n justify-content: center;\n display: flex;\n"],["\n width: 100%;\n justify-content: center;\n display: flex;\n"]))),Player_SpinnerWrapper=(styled_components_browser_esm.Ay.input(Player_templateObject_4||(Player_templateObject_4=Player_makeTemplateObject([""],[""]))),styled_components_browser_esm.Ay.div(Player_templateObject_5||(Player_templateObject_5=Player_makeTemplateObject(["\n background-color: ",";\n\n height: ",";\n width: ",";\n\n display: flex;\n justify-content: center;\n align-items: center;\n"],["\n background-color: ",";\n\n height: ",";\n width: ",";\n\n display: flex;\n justify-content: center;\n align-items: center;\n"])),palette_themeDark,(function(props){return props.height?props.height+"px":"332px"}),(function(props){return props.width?props.width+"px":"592px"}))),Player=function(_a){var width=_a.width,height=_a.height,displayVideos=_a.displayVideos,hasProcessingVideos=_a.hasProcessingVideos,videoRef=react.useRef(null),colors=(0,styled_components_browser_esm.DP)().colors,currentVideoIndex=react.useRef(0),_b=Player_read(react.useState(!0),2),setIsLoading=(_b[0],_b[1]),_c=Player_read(react.useState(!1),2),isPlaying=_c[0],setIsPlaying=_c[1],_d=Player_read(react.useState(0),2),trimmedDuration=_d[0],setTrimmedDuration=_d[1],_e=Player_read(react.useState(0),2),currentPlaylistTime=_e[0],setCurrentPlaylistTime=_e[1],_f=Player_read((0,react.useState)(0),2),rangeValue=_f[0],setRangeValue=_f[1];react.useEffect((function(){currentVideoIndex.current=0;for(var playlistDuration=0,i=0;i<displayVideos.length;i++){var videoStartTime=displayVideos[i].startSec?displayVideos[i].startSec:0;playlistDuration+=(displayVideos[i].endSec?displayVideos[i].endSec:displayVideos[i].duration)-videoStartTime}setTrimmedDuration(playlistDuration||1)}),[displayVideos]);var playNextVideo=function(){if(videoRef.current){var video=videoRef.current;setIsLoading(!0);var currentPlaylistVideo=++currentVideoIndex.current;if(displayVideos.length>currentPlaylistVideo){video.src=displayVideos[currentPlaylistVideo].source;var videoStartTime=displayVideos[currentPlaylistVideo].startSec?displayVideos[currentPlaylistVideo].startSec:0;video.currentTime=videoStartTime}else currentVideoIndex.current=0,video.src=displayVideos[0].source,video.pause(),setIsPlaying(!1)}},togglePlay=function(){var currentVideo=videoRef.current;currentVideo&&(isPlaying?currentVideo.pause():currentVideo.play(),setIsPlaying(!isPlaying))},videoReady=!!(displayVideos[currentVideoIndex.current]?displayVideos[currentVideoIndex.current].source:"")&&!hasProcessingVideos,percentage=100*(rangeValue-0)/(trimmedDuration-0),rangerStyle={background:"linear-gradient(90deg, ".concat(colors.primary[100]," 0%, ").concat(colors.primary[100]," ").concat(percentage,"%, #d0d3d9 ").concat(percentage,"%, #d0d3d9 100%)")};return(0,jsx_runtime.jsx)(VideoContainer,Player_assign({width,height},{children:videoReady?(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)("video",Player_assign({},!functions_isSafari&&{preload:"metadata"},{width,height,ref:videoRef,onTimeUpdate:function(){if(videoRef.current){var currentVideo=currentVideoIndex.current,video=videoRef.current,currentTime=video.currentTime;currentTime=(currentTime-=displayVideos[currentVideo].startSec?displayVideos[currentVideo].startSec:0)<0?0:currentTime;for(var i=0;i<currentVideo;i++){var videoStartTime_1=displayVideos[i].startSec?displayVideos[i].startSec:0;currentTime+=(displayVideos[i].endSec?displayVideos[i].endSec:displayVideos[i].duration)-videoStartTime_1}displayVideos[currentVideo].endSec<=video.currentTime&&playNextVideo(),setCurrentPlaylistTime(currentTime)}},onLoadedMetadata:function(){setIsLoading(!1)},onEnded:playNextVideo,onCanPlayThrough:function(){videoRef.current&¤tVideoIndex.current>0&&isPlaying&&videoRef.current.play()},src:"".concat(displayVideos[currentVideoIndex.current].source),onClick:togglePlay,style:{maxWidth:"100%"},playsInline:!0,controls:!1})),(0,jsx_runtime.jsx)(OnScreenPlayButton,{playerBackgroundColor:"#fff",playButtonPosition:"center",isVideoPaused:!isPlaying,togglePlay,playerIconsColor:palette_themeDark75Percent}),(0,jsx_runtime.jsx)(ControlsContainer,{children:(0,jsx_runtime.jsx)(VideoMerge_Slider,{onChange:function(e){setRangeValue(+e.target.value),function(event){var skipTo=parseFloat(event.currentTarget.value);if(videoRef.current)for(var video=videoRef.current,currentVideo=currentVideoIndex.current,videoStart=0,videoDurationStep=0,i=0;i<displayVideos.length;i++){var videoStartTime=displayVideos[i].startSec?displayVideos[i].startSec:0;if(videoDurationStep+=(displayVideos[i].endSec?displayVideos[i].endSec:displayVideos[i].duration)-videoStartTime,skipTo>=videoStart&&skipTo<videoDurationStep){currentVideo!==i&&(setIsLoading(!0),currentVideoIndex.current=i,video.src=displayVideos[i].source),video.currentTime=skipTo-videoStart+videoStartTime;break}videoStart=videoDurationStep}}(e)},value:currentPlaylistTime,max:trimmedDuration,min:"0",type:"range",step:"0.01",color:"red",style:Player_assign(Player_assign({width:"100%",marginTop:"-25px",zIndex:2,height:"4px"},rangerStyle),{boxShadow:"0px 0px 4px rgba(66, 79, 104, 0.08),0px 6px 12px rgba(66, 79, 104, 0.06)"})})})]}):(0,jsx_runtime.jsx)(Player_SpinnerWrapper,{children:(0,jsx_runtime.jsx)(Spinner,{size:30})})}))},react_beautiful_dnd_esm=__webpack_require__("./node_modules/react-beautiful-dnd/dist/react-beautiful-dnd.esm.js");function close_circle_extends(){return close_circle_extends=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},close_circle_extends.apply(null,arguments)}const close_circle=function SvgCloseCircle(props){return react.createElement("svg",close_circle_extends({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24"},props),close_circle_path||(close_circle_path=react.createElement("path",{className:"bg",fill:"white",d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2z"})),close_circle_path2||(close_circle_path2=react.createElement("path",{className:"icon",fill:"#E84C3D",d:"M16.3 16.3c-.39.39-1.02.39-1.41 0L12 13.41 9.11 16.3c-.39.39-1.02.39-1.41 0-.187-.187-.292-.44-.292-.705 0-.265.105-.518.292-.705L10.59 12 7.7 9.11c-.187-.187-.292-.44-.292-.705 0-.265.105-.518.292-.705.39-.39 1.02-.39 1.41 0L12 10.59l2.89-2.89c.39-.39 1.02-.39 1.41 0 .39.39.39 1.02 0 1.41L13.41 12l2.89 2.89c.38.38.38 1.02 0 1.41z"})))};var CloseCircleIcon_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked};const images_CloseCircleIcon=(0,styled_components_browser_esm.Ay)(close_circle)(CloseCircleIcon_templateObject_1||(CloseCircleIcon_templateObject_1=CloseCircleIcon_makeTemplateObject(["\n width: ",";\n height: ",";\n fill: ",";\n path.icon {\n fill: ",";\n opacity: ",";\n }\n\n path.bg {\n fill: ",";\n opacity: ",";\n }\n \n"],["\n width: ",";\n height: ",";\n fill: ",";\n path.icon {\n fill: ",";\n opacity: ",";\n }\n\n path.bg {\n fill: ",";\n opacity: ",";\n }\n \n"])),(function(props){return props.width||"16px"}),(function(props){return props.height||"16px"}),(function(props){return props.color||"currentColor"}),(function(props){return props.color||"currentColor"}),(function(props){return props.opacity||"inherit"}),(function(props){return props.bgColor||"currentColor"}),(function(props){return props.opacity||"inherit"}));var CloseCircleIcon_templateObject_1,InformationBox_templateObject_1,InformationBox_templateObject_2,VideoMerge_templateObject_1,VideoMerge_templateObject_2,VideoMerge_templateObject_3,VideoMerge_templateObject_4,VideoMerge_templateObject_5,VideoMerge_templateObject_6,VideoMerge_templateObject_7,VideoMerge_templateObject_8,VideoMerge_templateObject_9,VideoMerge_templateObject_10,VideoMerge_templateObject_11,VideoMerge_templateObject_12,VideoMerge_templateObject_13,VideoMerge_templateObject_14,VideoMerge_templateObject_15,VideoMerge_templateObject_16,VideoMerge_templateObject_17,VideoMerge_templateObject_18,VideoMerge_templateObject_19,VideoMerge_templateObject_20,VideoMerge_templateObject_21,VideoMerge_templateObject_22,VideoMerge_templateObject_23,templateObject_24,save_path,InformationBox_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},InformationBox_assign=function(){return InformationBox_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},InformationBox_assign.apply(this,arguments)},InformationBox_Container=styled_components_browser_esm.Ay.div(InformationBox_templateObject_1||(InformationBox_templateObject_1=InformationBox_makeTemplateObject(["\n display: flex;\n align-items: center;\n\n gap: 10px;\n\n background-color: ",";\n color: ",";\n border-radius: 6px;\n padding: 12px;\n"],["\n display: flex;\n align-items: center;\n\n gap: 10px;\n\n background-color: ",";\n color: ",";\n border-radius: 6px;\n padding: 12px;\n"])),(function(_a){return _a.theme.colors.primary[5]}),(function(_a){return _a.theme.colors.primary[100]})),IconContainer=styled_components_browser_esm.Ay.div(InformationBox_templateObject_2||(InformationBox_templateObject_2=InformationBox_makeTemplateObject(["\n flex-shrink: 0;\n color: ",";\n"],["\n flex-shrink: 0;\n color: ",";\n"])),(function(_a){return _a.theme.colors.primary[100]})),InformationBox=function(_a){var text=_a.text,width=_a.width;return(0,jsx_runtime.jsxs)(InformationBox_Container,InformationBox_assign({style:{width}},{children:[(0,jsx_runtime.jsx)(IconContainer,{children:(0,jsx_runtime.jsx)(ai_index_esm.app,{size:24,color:"inherit",opacity:.6})}),(0,jsx_runtime.jsx)("div",{children:text})]}))},VideoMerge_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},VideoMerge_assign=function(){return VideoMerge_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},VideoMerge_assign.apply(this,arguments)},VideoMerge_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},VideoMerge_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},VideoMerge_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},VideoMerge_spreadArray=function(to,from,pack){if(pack||2===arguments.length)for(var ar,i=0,l=from.length;i<l;i++)!ar&&i in from||(ar||(ar=Array.prototype.slice.call(from,0,i)),ar[i]=from[i]);return to.concat(ar||Array.prototype.slice.call(from))},VideoMergeLayout=styled_components_browser_esm.Ay.div(VideoMerge_templateObject_1||(VideoMerge_templateObject_1=VideoMerge_makeTemplateObject(["\n background-color: ",";\n height: 100%;\n width: 100%;\n"],["\n background-color: ",";\n height: 100%;\n width: 100%;\n"])),palette_gray10),VideoMerge_ContentWrapper=styled_components_browser_esm.Ay.div(VideoMerge_templateObject_2||(VideoMerge_templateObject_2=VideoMerge_makeTemplateObject(["\n background-color: #f6f7f9;\n display: flex;\n flex-direction: column;\n margin-bottom: -36px;\n min-height: 400px;\n width: 100%;\n margin-top: 15px;\n"],["\n background-color: #f6f7f9;\n display: flex;\n flex-direction: column;\n margin-bottom: -36px;\n min-height: 400px;\n width: 100%;\n margin-top: 15px;\n"]))),VideoMerge_Content=styled_components_browser_esm.Ay.div(VideoMerge_templateObject_3||(VideoMerge_templateObject_3=VideoMerge_makeTemplateObject(["\n background-color: #f6f7f9;\n display: flex;\n flex-direction: row;\n width: 100%;\n padding-bottom: 115px;\n padding-left: 8px;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n margin-top: 10px;\n"],["\n background-color: #f6f7f9;\n display: flex;\n flex-direction: row;\n width: 100%;\n padding-bottom: 115px;\n padding-left: 8px;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n margin-top: 10px;\n"]))),ThumbnailWrapper=styled_components_browser_esm.Ay.div(VideoMerge_templateObject_5||(VideoMerge_templateObject_5=VideoMerge_makeTemplateObject(["\n padding-top: 67px;\n margin-top: ","px;\n display: flex;\n flex-direction: column;\n border-top-left-radius: 16px;\n border-bottom-left-radius: 16px;\n margin-top: 8px;\n ","\n"],["\n padding-top: 67px;\n margin-top: ","px;\n display: flex;\n flex-direction: column;\n border-top-left-radius: 16px;\n border-bottom-left-radius: 16px;\n margin-top: 8px;\n ","\n"])),(function(props){return props.marginTop||0}),(function(_a){return _a.theme.containerWidth<=screenSizes_mb&&(0,styled_components_browser_esm.AH)(VideoMerge_templateObject_4||(VideoMerge_templateObject_4=VideoMerge_makeTemplateObject(["\n padding-top: 0px;\n margin-top: 16px;\n "],["\n padding-top: 0px;\n margin-top: 16px;\n "])))})),RowWrapper=styled_components_browser_esm.Ay.div(VideoMerge_templateObject_6||(VideoMerge_templateObject_6=VideoMerge_makeTemplateObject(["\n float: left;\n flex-direction: column;\n width: ",";\n div {\n margin-top: 3.5px;\n }\n"],["\n float: left;\n flex-direction: column;\n width: ",";\n div {\n margin-top: 3.5px;\n }\n"])),(function(props){return props.width?"".concat(props.width,"px"):"100%"})),RangeContainer=styled_components_browser_esm.Ay.div(VideoMerge_templateObject_7||(VideoMerge_templateObject_7=VideoMerge_makeTemplateObject(["\n display: flex;\n flex-direction: column;\n width: ",";\n margin-bottom: 8px;\n"],["\n display: flex;\n flex-direction: column;\n width: ",";\n margin-bottom: 8px;\n"])),(function(props){return props.width?"".concat(props.width,"px"):"100%"})),RowContainer=styled_components_browser_esm.Ay.div(VideoMerge_templateObject_9||(VideoMerge_templateObject_9=VideoMerge_makeTemplateObject(["\n height: ",";\n min-height: ",";\n overflow-x: auto;\n overflow-y: hidden;\n width: calc(100% - 250px);\n padding-top: 39px;\n padding-bottom: 26px;\n ","\n -ms-overflow-style: none; /* Internet Explorer 10+ */\n scrollbar-width: auto; /* Firefox */\n ::-webkit-scrollbar {\n display: block;\n }\n\n -ms-overflow-style: scrollbar;\n ::-webkit-scrollbar {\n -webkit-appearance: none;\n height: 8px; /* SUS-905 changes */\n }\n ::-webkit-scrollbar-track {\n background-color: ",";\n }\n ::-webkit-scrollbar-thumb {\n border-radius: 4px;\n background-color: ",";\n }\n ::-webkit-scrollbar-thumb:hover {\n background-color: ",";\n }\n"],["\n height: ",";\n min-height: ",";\n overflow-x: auto;\n overflow-y: hidden;\n width: calc(100% - 250px);\n padding-top: 39px;\n padding-bottom: 26px;\n ","\n -ms-overflow-style: none; /* Internet Explorer 10+ */\n scrollbar-width: auto; /* Firefox */\n ::-webkit-scrollbar {\n display: block;\n }\n\n -ms-overflow-style: scrollbar;\n ::-webkit-scrollbar {\n -webkit-appearance: none;\n height: 8px; /* SUS-905 changes */\n }\n ::-webkit-scrollbar-track {\n background-color: ",";\n }\n ::-webkit-scrollbar-thumb {\n border-radius: 4px;\n background-color: ",";\n }\n ::-webkit-scrollbar-thumb:hover {\n background-color: ",";\n }\n"])),(function(props){return props.height?"".concat(props.height+20,"px"):""}),(function(props){return props.height?"".concat(props.height+20,"px"):""}),(function(_a){return _a.theme.containerWidth<=screenSizes_mb&&(0,styled_components_browser_esm.AH)(VideoMerge_templateObject_8||(VideoMerge_templateObject_8=VideoMerge_makeTemplateObject(["\n padding-top: 0;\n margin-top: 16px;\n "],["\n padding-top: 0;\n margin-top: 16px;\n "])))}),palette_gray10,(function(_a){return _a.theme.colors.primary[20]}),(function(_a){return _a.theme.colors.primary[40]})),BlankRowsContainer=styled_components_browser_esm.Ay.div(VideoMerge_templateObject_10||(VideoMerge_templateObject_10=VideoMerge_makeTemplateObject(["\n position: absolute;\n width: calc(100% - 210px);\n"],["\n position: absolute;\n width: calc(100% - 210px);\n"]))),ContentHeader=styled_components_browser_esm.Ay.div(VideoMerge_templateObject_11||(VideoMerge_templateObject_11=VideoMerge_makeTemplateObject(["\n padding: 32px 12px;\n height: 10px; /* SUS-905 changes */\n width: calc(100%-24px);\n display: flex;\n justify-content: space-between;\n"],["\n padding: 32px 12px;\n height: 10px; /* SUS-905 changes */\n width: calc(100%-24px);\n display: flex;\n justify-content: space-between;\n"]))),PreviewContainer=styled_components_browser_esm.Ay.div(VideoMerge_templateObject_13||(VideoMerge_templateObject_13=VideoMerge_makeTemplateObject(["\n display: flex;\n justify-content: center;\n margin-bottom: 32px;\n border-radius: 6px;\n margin-top: 30px;\n ","\n"],["\n display: flex;\n justify-content: center;\n margin-bottom: 32px;\n border-radius: 6px;\n margin-top: 30px;\n ","\n"])),(function(_a){return _a.theme.containerWidth<=screenSizes_mb&&(0,styled_components_browser_esm.AH)(VideoMerge_templateObject_12||(VideoMerge_templateObject_12=VideoMerge_makeTemplateObject(["\n margin-top: 0;\n border-radius: 0;\n margin-bottom: 0;\n "],["\n margin-top: 0;\n border-radius: 0;\n margin-bottom: 0;\n "])))})),RowTime=styled_components_browser_esm.Ay.div(VideoMerge_templateObject_14||(VideoMerge_templateObject_14=VideoMerge_makeTemplateObject(["\n display: flex;\n flex-direction: row;\n width: 100%;\n height: 20px;\n"],["\n display: flex;\n flex-direction: row;\n width: 100%;\n height: 20px;\n"]))),RowTicker=styled_components_browser_esm.Ay.div(VideoMerge_templateObject_15||(VideoMerge_templateObject_15=VideoMerge_makeTemplateObject(["\n display: flex;\n flex-direction: row;\n width: 100%;\n height: 8px;\n"],["\n display: flex;\n flex-direction: row;\n width: 100%;\n height: 8px;\n"]))),VideoMerge_Tick=styled_components_browser_esm.Ay.div(VideoMerge_templateObject_16||(VideoMerge_templateObject_16=VideoMerge_makeTemplateObject(["\n width: ","px;\n height: ","px;\n border-left: 1px solid ",";\n border-right: ",";\n"],["\n width: ","px;\n height: ","px;\n border-left: 1px solid ",";\n border-right: ",";\n"])),(function(props){return props.width||20}),(function(props){return props.inside?4:8}),(function(_a){return _a.theme.colors.primary[20]}),(function(props){return props.rightBorder&&"1px solid ".concat(props.theme.colors.primary[20])})),Time=styled_components_browser_esm.Ay.div(VideoMerge_templateObject_17||(VideoMerge_templateObject_17=VideoMerge_makeTemplateObject(["\n font-size: 12px;\n line-height: 1.43;\n color: ",";\n width: ","px;\n height: 20px;\n display: flex;\n justify-content: space-between;\n"],["\n font-size: 12px;\n line-height: 1.43;\n color: ",";\n width: ","px;\n height: 20px;\n display: flex;\n justify-content: space-between;\n"])),(function(_a){return _a.theme.colors.primary[100]}),(function(props){return props.width||220})),VideoMerge_Row=styled_components_browser_esm.Ay.div(VideoMerge_templateObject_18||(VideoMerge_templateObject_18=VideoMerge_makeTemplateObject(["\n background: #ffffff;\n border-top-right-radius: 16px;\n border-bottom-right-radius: 16px;\n padding-left: 2px;\n padding-right: 2px;\n display: flex;\n flex-direction: column;\n height: 80px;\n margin-bottom: 8px;\n position: relative;\n"],["\n background: #ffffff;\n border-top-right-radius: 16px;\n border-bottom-right-radius: 16px;\n padding-left: 2px;\n padding-right: 2px;\n display: flex;\n flex-direction: column;\n height: 80px;\n margin-bottom: 8px;\n position: relative;\n"]))),ZoomButton=styled_components_browser_esm.Ay.div(VideoMerge_templateObject_19||(VideoMerge_templateObject_19=VideoMerge_makeTemplateObject(["\n min-width: 20px;\n margin-left: 0;\n margin-right: 12px;\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: ",";\n opacity: ",";\n height: 40px;\n width: 46px;\n border-radius: 4px;\n transition: width 0.2s ease;\n overflow: hidden;\n"],["\n min-width: 20px;\n margin-left: 0;\n margin-right: 12px;\n text-decoration: none;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: ",";\n opacity: ",";\n height: 40px;\n width: 46px;\n border-radius: 4px;\n transition: width 0.2s ease;\n overflow: hidden;\n"])),(function(props){return props.disabled?"default":"pointer"}),(function(props){return props.disabled?"0.5":"1"})),AddVideoContainer=styled_components_browser_esm.Ay.div(VideoMerge_templateObject_20||(VideoMerge_templateObject_20=VideoMerge_makeTemplateObject(["\n display: block;\n height: 40px;\n border-radius: 4px;\n color: white;\n button {\n border-radius: 4px;\n }\n"],["\n display: block;\n height: 40px;\n border-radius: 4px;\n color: white;\n button {\n border-radius: 4px;\n }\n"]))),ZoomContainer=styled_components_browser_esm.Ay.div(VideoMerge_templateObject_21||(VideoMerge_templateObject_21=VideoMerge_makeTemplateObject(["\n width: 200px;\n height: 40px;\n padding: 12px;\n box-sizing: border-box;\n display: flex;\n gap: 13px;\n align-items: center;\n background: #ffffff;\n border: 1px solid rgba(0, 27, 83, 0.1);\n border-radius: 6px;\n"],["\n width: 200px;\n height: 40px;\n padding: 12px;\n box-sizing: border-box;\n display: flex;\n gap: 13px;\n align-items: center;\n background: #ffffff;\n border: 1px solid rgba(0, 27, 83, 0.1);\n border-radius: 6px;\n"]))),CloseContainer=styled_components_browser_esm.Ay.div(VideoMerge_templateObject_22||(VideoMerge_templateObject_22=VideoMerge_makeTemplateObject(["\n position: absolute;\n right: 15px;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n"],["\n position: absolute;\n right: 15px;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n"]))),InfoBoxWrapper=styled_components_browser_esm.Ay.div(VideoMerge_templateObject_23||(VideoMerge_templateObject_23=VideoMerge_makeTemplateObject(["\n margin: 30px auto 0 auto;\n max-width: 578px;\n margin-bottom: 10px;\n box-sizing: border-box;\n"],["\n margin: 30px auto 0 auto;\n max-width: 578px;\n margin-bottom: 10px;\n box-sizing: border-box;\n"]))),VideoMerge_Slider=styled_components_browser_esm.Ay.input(templateObject_24||(templateObject_24=VideoMerge_makeTemplateObject(["\n -webkit-appearance: none;\n width: 100%;\n background: transparent;\n cursor: pointer;\n\n /* Thumb styles for WebKit browsers */\n &::-webkit-slider-thumb {\n -webkit-appearance: none;\n width: 12px; /* Adjust width */\n height: 12px; /* Adjust height */\n background: ","; /* Add red color to thumb */\n border-radius: 50%; /* Optional: make it round */\n cursor: pointer;\n z-index: 3;\n }\n\n /* Thumb styles for Firefox */\n &::-moz-range-thumb {\n width: 12px;\n height: 12px;\n background: ","; /* Add red color to thumb */\n border-radius: 50%; /* Optional: make it round */\n cursor: pointer;\n z-index: 3;\n }\n\n /* Thumb styles for IE */\n &::-ms-thumb {\n width: 12px;\n height: 12px;\n background: ","; /* Add red color to thumb */\n border-radius: 50%; /* Optional: make it round */\n cursor: pointer;\n z-index: 3;\n }\n\n &:focus {\n outline: none;\n }\n\n /* Track styles for IE */\n &::-ms-track {\n width: 100%;\n cursor: pointer;\n background: transparent;\n border-color: transparent;\n color: transparent;\n }\n"],["\n -webkit-appearance: none;\n width: 100%;\n background: transparent;\n cursor: pointer;\n\n /* Thumb styles for WebKit browsers */\n &::-webkit-slider-thumb {\n -webkit-appearance: none;\n width: 12px; /* Adjust width */\n height: 12px; /* Adjust height */\n background: ","; /* Add red color to thumb */\n border-radius: 50%; /* Optional: make it round */\n cursor: pointer;\n z-index: 3;\n }\n\n /* Thumb styles for Firefox */\n &::-moz-range-thumb {\n width: 12px;\n height: 12px;\n background: ","; /* Add red color to thumb */\n border-radius: 50%; /* Optional: make it round */\n cursor: pointer;\n z-index: 3;\n }\n\n /* Thumb styles for IE */\n &::-ms-thumb {\n width: 12px;\n height: 12px;\n background: ","; /* Add red color to thumb */\n border-radius: 50%; /* Optional: make it round */\n cursor: pointer;\n z-index: 3;\n }\n\n &:focus {\n outline: none;\n }\n\n /* Track styles for IE */\n &::-ms-track {\n width: 100%;\n cursor: pointer;\n background: transparent;\n border-color: transparent;\n color: transparent;\n }\n"])),(function(_a){return _a.theme.colors.primary[100]}),(function(_a){return _a.theme.colors.primary[100]}),(function(_a){return _a.theme.colors.primary[100]})),VideoMerge=function(_a){var _b=_a.videos,videos=void 0===_b?[]:_b,_c=_a.setVideos,setVideos=void 0===_c?function(){}:_c,hasProcessingVideos=_a.hasProcessingVideos,setShouldFetch=_a.setShouldFetch,_d=(0,styled_components_browser_esm.DP)(),colors=_d.colors,isCdkEnviroment=_d.isCdkEnviroment,containerWidth=useConfigurationContext().containerWidth,history=(0,react_router.W6)(),_e=VideoMerge_read((0,react.useState)(0),2),duration=_e[0],setDuration=_e[1],_f=VideoMerge_read((0,react.useState)(0),2),trimDuration=_f[0],setTrimDuration=_f[1],_g=VideoMerge_read((0,react.useState)(0),2),width=_g[0],setWidth=_g[1],_h=VideoMerge_read((0,react.useState)(0),2),height=_h[0],setHeight=_h[1],_j=VideoMerge_read((0,react.useState)(10),2),secWidth=_j[0],setSecWidth=_j[1],_k=VideoMerge_read((0,react.useState)(20),2),tickerCount=_k[0],setTickerCount=_k[1];(0,react.useEffect)((function(){setDuration(videos.reduce((function(sum,v){return sum+v.duration}),0)||0),setTrimDuration(videos.reduce((function(sum,v){return sum+v.trimDuration}),0)||0)}),[videos]),(0,react.useEffect)((function(){setHeight(60+100*videos.length)}),[videos]),(0,react.useEffect)((function(){!function handleResize(){var n,multiple,w=Math.max((multiple=secWidth,(n=duration*secWidth)>0?Math.ceil(n/multiple)*multiple:multiple),containerWidth-223);setWidth(w),setTickerCount(Math.round(w/secWidth))}()}),[duration,secWidth,containerWidth]);var removeVideo=function(index){if(1!==videos.length){try{var cache=localStorage.getItem(config_COOKIE_NAMES.merge),removedVideo_1=videos[index],filteredSelectedVideos=(JSON.parse(cache||"")||[]).filter((function(video){return video.id.toString()!==removedVideo_1.id.toString()}));localStorage.setItem(config_COOKIE_NAMES.merge,JSON.stringify(filteredSelectedVideos))}catch(error){console.log(error)}setVideos((function(vtm){var newVideos=VideoMerge_spreadArray([],VideoMerge_read(vtm),!1);return newVideos.splice(index,1),newVideos}))}else history.push("/")},setVideoRef=function(index,videoRef){setVideos((function(prev){var vtm=VideoMerge_spreadArray([],VideoMerge_read(prev),!1);return vtm[index].ref=videoRef,vtm}))},calculateVideoOffset=function(i){if(0===i)return 0;var previousVideo=videos[i-1],video=videos[i];return 1===i?previousVideo.endSec*secWidth-video.startSec*secWidth:previousVideo.trimDuration*secWidth+previousVideo.startSec*secWidth-video.startSec*secWidth+calculateVideoOffset(i-1)};return(0,jsx_runtime.jsxs)(VideoMergeLayout,{children:[hasProcessingVideos&&(0,jsx_runtime.jsx)(InfoBoxWrapper,{children:(0,jsx_runtime.jsx)(InformationBox,{text:"Some of the videos are still processing. Please wait until they are done, and then proceed with merging."})}),(0,jsx_runtime.jsx)(PreviewContainer,{children:videos&&!!videos.length&&(0,jsx_runtime.jsx)(Player,{width:592,height:332,displayVideos:videos,hasProcessingVideos})}),(0,jsx_runtime.jsxs)(VideoMerge_ContentWrapper,{children:[(0,jsx_runtime.jsxs)(ContentHeader,{children:[(0,jsx_runtime.jsx)(AddVideoContainer,{children:(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{variant:"white",icon:(0,jsx_runtime.jsx)(images_AddIcon,{height:21,width:21}),text:"Add More Videos",onClick:function(){history.push("/?add-more")}})}),containerWidth>screenSizes_mb&&(0,jsx_runtime.jsxs)(ZoomContainer,{children:[(0,jsx_runtime.jsx)(ZoomButton,VideoMerge_assign({onClick:function(){return!hasProcessingVideos&&secWidth>10&&setSecWidth(secWidth-5)},disabled:hasProcessingVideos||10===secWidth},{children:(0,jsx_runtime.jsx)(images_ZoomOutIcon,{width:24,height:24,color:colors.primary[100]})})),(0,jsx_runtime.jsx)(VideoMerge_Slider,{type:"range",onChange:function(e){return setSecWidth(e.target.value)},min:10,max:200,value:secWidth,disabled:hasProcessingVideos,style:{width:"100px",height:"4px",backgroundColor:"#d0d3d9",boxShadow:"0px 0px 4px rgba(66, 79, 104, 0.08),0px 6px 12px rgba(66, 79, 104, 0.06)"}}),(0,jsx_runtime.jsx)(ZoomButton,VideoMerge_assign({onClick:function(){return!hasProcessingVideos&&secWidth<200&&setSecWidth(secWidth+5)},disabled:200===secWidth||hasProcessingVideos},{children:(0,jsx_runtime.jsx)(images_ZoomInIcon,{width:24,height:24,color:colors.primary[100]})}))]})]}),(0,jsx_runtime.jsxs)(VideoMerge_Content,{children:[(0,jsx_runtime.jsx)(ThumbnailWrapper,{children:(0,jsx_runtime.jsx)(react_beautiful_dnd_esm.JY,VideoMerge_assign({onDragEnd:function(result){return VideoMerge_awaiter(void 0,void 0,void 0,(function(){var updatedVideos;return VideoMerge_generator(this,(function(_a){return result.destination?(updatedVideos=function(list,startIndex,endIndex){var result=Array.from(list),removed=__read(result.splice(startIndex,1),1)[0];return result.splice(endIndex,0,removed),result}(videos,result.source.index,result.destination.index),setVideos(updatedVideos),[2]):[2]}))}))}},{children:(0,jsx_runtime.jsx)(react_beautiful_dnd_esm.gL,VideoMerge_assign({droppableId:"videos"},{children:function(provided){return(0,jsx_runtime.jsxs)("div",VideoMerge_assign({ref:provided.innerRef},provided.droppableProps,{children:[videos.map((function(v,i){return(0,jsx_runtime.jsx)(react_beautiful_dnd_esm.sx,VideoMerge_assign({draggableId:v.id.toString(),index:i,isDragDisabled:hasProcessingVideos},{children:function(provided){return(0,jsx_runtime.jsx)("div",VideoMerge_assign({ref:provided.innerRef},provided.draggableProps,provided.dragHandleProps,{children:(0,jsx_runtime.jsx)(VideoThumbnail_VideoThumbnail,{index:i,video:v,setVideos,removeVideo,setVideoRef,isDragDisabled:hasProcessingVideos,setShouldFetch},"".concat(v.id).concat(i,"thumb"))}))}}),v.id)})),provided.placeholder]}))}}))}))}),(0,jsx_runtime.jsxs)(RowContainer,VideoMerge_assign({height,id:"row-container"},{children:[containerWidth>screenSizes_mb&&(0,jsx_runtime.jsxs)(RangeContainer,VideoMerge_assign({width},{children:[(0,jsx_runtime.jsx)(RowTime,{children:VideoMerge_spreadArray([],VideoMerge_read(Array(Math.round(tickerCount/12)).keys()),!1).map((function(k){return(0,jsx_runtime.jsxs)(Time,VideoMerge_assign({width:12*secWidth},{children:[(0,jsx_runtime.jsx)("span",{children:toMMSS(12*k,0)}),k+1===Math.round(tickerCount/12)&&(0,jsx_runtime.jsx)("span",{children:toMMSS(12*(k+1),0)})]}),k)}))}),(0,jsx_runtime.jsx)(RowTicker,{children:VideoMerge_spreadArray([],VideoMerge_read(Array(tickerCount).keys()),!1).map((function(k){return(0,jsx_runtime.jsx)(VideoMerge_Tick,{width:secWidth,rightBorder:k+1===tickerCount,inside:k>=videos[0].startSec&&k<=videos[0].startSec+trimDuration},k)}))})]})),(0,jsx_runtime.jsx)(BlankRowsContainer,{children:videos.map((function(v,i){return(0,jsx_runtime.jsx)(VideoMerge_Row,{children:(0,jsx_runtime.jsx)(CloseContainer,{children:(0,jsx_runtime.jsx)(images_CloseCircleIcon,{onClick:function(){return removeVideo(i)},height:20,width:20,color:isCdkEnviroment?colors.primary[100]:colors.white[100],bgColor:isCdkEnviroment?colors.white[100]:colors.danger[40]})})},"".concat(v.id).concat(i))}))}),containerWidth>screenSizes_mb&&(0,jsx_runtime.jsx)(RowWrapper,{children:videos.map((function(v,i){return(0,jsx_runtime.jsx)(VideoRow,{index:i,totalDuration:duration,offset:calculateVideoOffset(i),width:v.duration*secWidth,video:v,setVideos,hasProcessingVideos,showPreviewTrack:!1},"".concat(v.id).concat(i,"row"))}))})]}))]})]})]})};function save_extends(){return save_extends=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},save_extends.apply(null,arguments)}const save=function SvgSave(props){return react.createElement("svg",save_extends({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"3 3 18 18"},props),save_path||(save_path=react.createElement("path",{fill:"#001B53",fillRule:"evenodd",d:"M17 3H3v18h18V7l-4-4zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3zm3-10H5V5h10v4z"})))};var SaveIcon_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked};const images_SaveIcon=(0,styled_components_browser_esm.Ay)(save)(SaveIcon_templateObject_1||(SaveIcon_templateObject_1=SaveIcon_makeTemplateObject(["\n width: ",";\n height: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"])),(function(props){return props.width||"24px"}),(function(props){return props.height||"24px"}),(function(props){return props.color||"currentColor"}),(function(props){return props.opacity||"inherit"}));var SaveIcon_templateObject_1,delete_g;function delete_extends(){return delete_extends=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},delete_extends.apply(null,arguments)}const images_delete=function SvgDelete(props){return react.createElement("svg",delete_extends({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:24,height:24,viewBox:"0 0 24 24"},props),delete_g||(delete_g=react.createElement("g",{fill:"#E84C3D"},react.createElement("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V9c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v10zm3.17-7.83c.39-.39 1.02-.39 1.41 0L12 12.59l1.42-1.42c.39-.39 1.02-.39 1.41 0 .39.39.39 1.02 0 1.41L13.41 14l1.42 1.42c.39.39.39 1.02 0 1.41-.39.39-1.02.39-1.41 0L12 15.41l-1.42 1.42c-.39.39-1.02.39-1.41 0-.187-.187-.293-.44-.293-.705 0-.265.106-.518.293-.705L10.59 14l-1.42-1.42c-.39-.38-.39-1.02 0-1.41zM15.5 4l-.71-.71c-.18-.18-.44-.29-.7-.29H9.91c-.26 0-.52.11-.7.29L8.5 4H6c-.55 0-1 .45-1 1s.45 1 1 1h12c.55 0 1-.45 1-1s-.45-1-1-1h-2.5z"}))))};var DeleteIcon_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked};const images_DeleteIcon=(0,styled_components_browser_esm.Ay)(images_delete)(DeleteIcon_templateObject_1||(DeleteIcon_templateObject_1=DeleteIcon_makeTemplateObject(["\n width: ",";\n height: ",";\n g {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n g {\n fill: ",";\n opacity: ",";\n }\n"])),(function(props){return props.width||"24px"}),(function(props){return props.height||"24px"}),(function(props){return props.color||"currentColor"}),(function(props){return props.opacity||"inherit"}));var DeleteIcon_templateObject_1,ModalLeave_templateObject_1,ModalLeave_templateObject_2,ModalLeave_templateObject_3,ModalLeave_templateObject_4,ModalLeave_templateObject_5,ModalLeave_templateObject_6,ModalLeave_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},ModalLeave_assign=function(){return ModalLeave_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},ModalLeave_assign.apply(this,arguments)},ModalLeave_CloseButtonWrapper=styled_components_browser_esm.Ay.label(ModalLeave_templateObject_1||(ModalLeave_templateObject_1=ModalLeave_makeTemplateObject(["\n display: flex;\n align-items: center;\n margin: 0;\n padding: 0;\n color: ",";\n &:hover {\n cursor: pointer;\n }\n"],["\n display: flex;\n align-items: center;\n margin: 0;\n padding: 0;\n color: ",";\n &:hover {\n cursor: pointer;\n }\n"])),palette_themeDark50Percent),ModalLeave_ModalItem=styled_components_browser_esm.Ay.div(ModalLeave_templateObject_2||(ModalLeave_templateObject_2=ModalLeave_makeTemplateObject(["\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n position: relative;\n background-color: ",";\n"],["\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n position: relative;\n background-color: ",";\n"])),palette_white),ModalLeave_Content=styled_components_browser_esm.Ay.div(ModalLeave_templateObject_3||(ModalLeave_templateObject_3=ModalLeave_makeTemplateObject(["\n display: flex;\n flex-direction: column;\n padding: 32px;\n"],["\n display: flex;\n flex-direction: column;\n padding: 32px;\n"]))),ModalLeave_ContentHeader=styled_components_browser_esm.Ay.div(ModalLeave_templateObject_4||(ModalLeave_templateObject_4=ModalLeave_makeTemplateObject(["\n display: flex;\n flex-direction: row;\n font-size: 18px;\n font-weight: bold;\n color: ",";\n justify-content: space-between;\n margin-bottom: 32px;\n p {\n margin: 0;\n }\n"],["\n display: flex;\n flex-direction: row;\n font-size: 18px;\n font-weight: bold;\n color: ",";\n justify-content: space-between;\n margin-bottom: 32px;\n p {\n margin: 0;\n }\n"])),palette_black_1_100),ModalLeave_ContentBody=styled_components_browser_esm.Ay.p(ModalLeave_templateObject_5||(ModalLeave_templateObject_5=ModalLeave_makeTemplateObject(["\n font-size: 14px;\n line-height: 1.43;\n color: ",";\n"],["\n font-size: 14px;\n line-height: 1.43;\n color: ",";\n"])),palette_black_1_100),ModalLeave_ButtonsWrapper=styled_components_browser_esm.Ay.section(ModalLeave_templateObject_6||(ModalLeave_templateObject_6=ModalLeave_makeTemplateObject(["\n display: flex;\n flex-direction: row;\n width: 528px;\n max-width: 100%;\n gap: 12px;\n justify-content: flex-end;\n align-items: right;\n padding: 0 32px 32px;\n"],["\n display: flex;\n flex-direction: row;\n width: 528px;\n max-width: 100%;\n gap: 12px;\n justify-content: flex-end;\n align-items: right;\n padding: 0 32px 32px;\n"]))),ModalLeave=function(_a){var _b=_a.open,open=void 0!==_b&&_b,_c=_a.disableSave,disableSave=void 0!==_c&&_c,infoBoxText=_a.infoBoxText,_d=_a.title,title=void 0===_d?"":_d,_e=_a.text,text=void 0===_e?"":_e,_f=_a.discardButtonText,discardButtonText=void 0===_f?"Keep video":_f,_g=_a.confirmButtonText,confirmButtonText=void 0===_g?"Delete video":_g,onClickDiscardButton=_a.onClickDiscardButton,onClickConfirmButton=_a.onClickConfirmButton,_h=_a.showDiscardIcon,showDiscardIcon=void 0===_h||_h,_j=_a.showSaveIcon,showSaveIcon=void 0===_j||_j,_k=_a.handleModalClose,handleModalClose=void 0===_k?function(){}:_k,isCdkEnviroment=(0,styled_components_browser_esm.DP)().isCdkEnviroment;return open?(0,jsx_runtime.jsx)(modals_Modal_Modal,ModalLeave_assign({disableFullScreen:!0,style:{position:"fixed",zIndex:999}},{children:(0,jsx_runtime.jsxs)(ModalLeave_ModalItem,{children:[(0,jsx_runtime.jsxs)(ModalLeave_Content,{children:[(0,jsx_runtime.jsxs)(ModalLeave_ContentHeader,{children:[(0,jsx_runtime.jsx)("p",{children:title}),(0,jsx_runtime.jsx)(ModalLeave_CloseButtonWrapper,{children:(0,jsx_runtime.jsx)(images_CloseIcon,{width:"24px",height:"24px",onClick:handleModalClose})})]}),(0,jsx_runtime.jsx)(ModalLeave_ContentBody,{children:text}),infoBoxText&&(0,jsx_runtime.jsx)(InformationBox,{text:infoBoxText,width:"430px"})]}),(0,jsx_runtime.jsxs)(ModalLeave_ButtonsWrapper,{children:[(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,ModalLeave_assign({},!!showDiscardIcon&&{icon:(0,jsx_runtime.jsx)(images_DeleteIcon,{height:24,width:24})},{text:discardButtonText,onClick:onClickDiscardButton,variant:isCdkEnviroment?"text":"secondary"})),(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,ModalLeave_assign({},!!showSaveIcon&&{icon:(0,jsx_runtime.jsx)(images_SaveIcon,{height:16,width:16})},{text:confirmButtonText,onClick:onClickConfirmButton,disabled:disableSave}))]})]})})):null},RouteLeavingGuard_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar};const components_RouteLeavingGuard=function(_a){var when=_a.when,_b=_a.navigate,navigate=void 0===_b?function(){}:_b,shouldBlockNavigation=_a.shouldBlockNavigation,_c=_a.onConfirm,onConfirm=void 0===_c?function(){}:_c,_d=_a.onDiscard,onDiscard=void 0===_d?function(){}:_d,_e=_a.onStay,onStay=void 0===_e?function(){}:_e,_f=_a.stay,stay=void 0!==_f&&_f,_g=_a.title,title=void 0===_g?"Leave without saving changes?":_g,_h=_a.text,text=void 0===_h?"Your updates will not be saved. This action can’t be undone.":_h,_j=_a.discardButtonText,discardButtonText=void 0===_j?"Discard Changes":_j,_k=_a.confirmButtonText,confirmButtonText=void 0===_k?"Save Changes":_k,_l=_a.showDiscardIcon,showDiscardIcon=void 0===_l||_l,_m=_a.showSaveIcon,showSaveIcon=void 0===_m||_m,infoBoxText=_a.infoBoxText,disableSave=_a.disableSave,_o=RouteLeavingGuard_read((0,react.useState)(!1),2),modalVisible=_o[0],setModalVisible=_o[1],_p=RouteLeavingGuard_read((0,react.useState)(null),2),lastLocation=_p[0],setLastLocation=_p[1],_q=RouteLeavingGuard_read((0,react.useState)(!1),2),confirmedNavigation=_q[0],setConfirmedNavigation=_q[1],closeModal=function(){setModalVisible(!1)};return(0,react.useEffect)((function(){confirmedNavigation&&lastLocation&&navigate(lastLocation.pathname)}),[confirmedNavigation,lastLocation]),(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(react_router.XG,{when,message:function(nextLocation){return!(!confirmedNavigation&&shouldBlockNavigation(nextLocation))||(setModalVisible(!0),setLastLocation(nextLocation),!1)}}),(0,jsx_runtime.jsx)(ModalLeave,{open:modalVisible,title,text,discardButtonText,confirmButtonText,showDiscardIcon,showSaveIcon,handleModalClose:closeModal,onClickDiscardButton:function(){onDiscard(),setModalVisible(!1),setConfirmedNavigation(!0)},onClickConfirmButton:stay?function(){closeModal(),onStay()}:function(){onConfirm(),setModalVisible(!1),setConfirmedNavigation(!0)},infoBoxText,disableSave})]})};var VideoSourceType;!function(VideoSourceType){VideoSourceType.ORGANIZATION_VIDEO="ORGANIZATION_VIDEO",VideoSourceType.LESA_VEHICLE="LESA_VEHICLE",VideoSourceType.VIDEO="VIDEO",VideoSourceType.WHEELS_TV="WHEELS_TV"}(VideoSourceType||(VideoSourceType={}));var Merge_templateObject_1,icon_car_path,Merge_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},Merge_assign=function(){return Merge_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},Merge_assign.apply(this,arguments)},Merge_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},Merge_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},Merge_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},Merge_spreadArray=function(to,from,pack){if(pack||2===arguments.length)for(var ar,i=0,l=from.length;i<l;i++)!ar&&i in from||(ar||(ar=Array.prototype.slice.call(from,0,i)),ar[i]=from[i]);return to.concat(ar||Array.prototype.slice.call(from))},MainContainer=styled_components_browser_esm.Ay.main(Merge_templateObject_1||(Merge_templateObject_1=Merge_makeTemplateObject(["\n background: ",";\n"],["\n background: ",";\n"])),palette_gray10),Merge=function(){var isCdkEnviroment=(0,styled_components_browser_esm.DP)().isCdkEnviroment,location=(0,react_router.zy)(),ids=(new URLSearchParams(location.search).get("videos")||"").split(",").filter(Boolean),_a=Merge_read((0,react.useState)({}),2),videos=_a[0],setVideos=_a[1],_b=Merge_read((0,react.useState)(ids.map((function(id){return{id}}))),2),videosToMerge=_b[0],setVideosToMerge=_b[1],history=(0,react_router.W6)(),_c=Merge_read(react.useState(!1),2),showSaveModal=_c[0],setShowSaveModal=_c[1],_d=Merge_read(react.useState(!1),2),saved=_d[0],setSaved=_d[1],_e=Merge_read(react.useState(!0),2),loading=_e[0],setLoading=_e[1],_f=Merge_read((0,react.useState)(!0),2),fetchFromLS=_f[0],setFetchFromLS=_f[1];(0,react.useEffect)((function(){if(fetchFromLS){var cache=localStorage.getItem(config_COOKIE_NAMES.merge),videosFromLs=JSON.parse(cache),videosObject_1={};null==videosFromLs||videosFromLs.forEach((function(video){videosObject_1[video.id]=video})),setVideos(videosObject_1),setFetchFromLS(!1)}}),[fetchFromLS]),(0,react.useEffect)((function(){setLoading(!0),Object.values(videos).forEach((function(video){return Merge_awaiter(void 0,void 0,void 0,(function(){var videoDetails;return Merge_generator(this,(function(_a){switch(_a.label){case 0:return[4,getVideo(video.id)];case 1:return videoDetails=_a.sent(),setVideosToMerge((function(videos){return Merge_spreadArray([],Merge_read(videos),!1).map((function(v){var sourceType={sourceType:VideoSourceType.VIDEO,sourceId:Number(v.id)};return v.id.toString()===video.id.toString()?Merge_assign(Merge_assign(Merge_assign({},v),video),{source:videoDetails.videoSource,flvName:videoDetails.flvName+".mp4",start:"00:00:00:00",sourceType}):Merge_assign(Merge_assign({},v),{sourceType})}))})),[2]}}))}))})),setLoading(!1)}),[videos]);if(loading)return(0,jsx_runtime.jsx)(LoadingIndicator,{isLoading:loading});var hasProcessingVideos=!!videosToMerge.find((function(v){return(null==v?void 0:v.processing)===VideoEncodingStatus.PROCESSING}));return(0,jsx_runtime.jsxs)(MainContainer,{children:[videosToMerge.length>=2&&(0,jsx_runtime.jsx)(components_RouteLeavingGuard,{when:!0,navigate:function(path){history.push(path)},stay:!0,onStay:function(){return setShowSaveModal(!0)},onConfirm:function(){},shouldBlockNavigation:function(options){return function(options){return("/"!==options.pathname||"?add-more"!==options.search&&"?merged"!==options.search)&&!saved}(options)},disableSave:hasProcessingVideos,infoBoxText:hasProcessingVideos?"Some of the videos are still processing. Please wait until they are done, and then proceed with merging.":""}),(0,jsx_runtime.jsx)(TopBar,{left:(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{text:"Back",variant:"transparent",icon:(0,jsx_runtime.jsx)(md_index_esm.MGo,{size:"18"}),onClick:function(){window.localStorage.removeItem(config_COOKIE_NAMES.merge),history.push("/")},extendStyles:{container:{color:"white"}}}),center:(0,jsx_runtime.jsx)(TitleWrapper,{children:"Merge Videos"}),right:(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{variant:isCdkEnviroment?"white":"primary",onClick:function(){return setShowSaveModal(!0)},text:"Save",disabled:!videosToMerge||videosToMerge.length<2||hasProcessingVideos})}),(0,jsx_runtime.jsx)(VideoMerge,{videos:videosToMerge,setVideos:setVideosToMerge,hasProcessingVideos,setShouldFetch:setFetchFromLS}),showSaveModal&&(0,jsx_runtime.jsx)(ModalInputText,{title:"Name new video",label:"Give your new video a name",defaultValue:"",secondaryButtonText:"Go Back",primaryButtonText:"Save Video",handleSubmit:function(title){return videoName=title,Merge_awaiter(void 0,void 0,void 0,(function(){var duration,sources;return Merge_generator(this,(function(_a){switch(_a.label){case 0:return window.localStorage.removeItem(config_COOKIE_NAMES.merge),duration=1e3*videosToMerge.reduce((function(sum,v){return sum+v.trimDuration}),0),sources=videosToMerge.filter((function(video){return void 0!==video.sourceType})).map((function(video){return video.sourceType})),pushToDataLayer({event:"covideo-event",event_name:"Saved New Video",merge_ids:videosToMerge.map((function(v){return v.id})),creation_type:"Merged"}),[4,(data=Merge_assign({videos:videosToMerge.map((function(v){return{start:v.start,end:v.end,id:v.id,flvName:v.flvName}})),videoName,duration},sources.length>0&&{sources}),videosApi_awaiter(void 0,void 0,void 0,(function(){return videosApi_generator(this,(function(_a){switch(_a.label){case 0:return[4,config_EXPRESS_API.post("/videos/merge",data)];case 1:return[2,_a.sent().data]}}))})))];case 1:return _a.sent(),setSaved(!0),history.push("/?merged"),[2]}var data}))}));var videoName},handleModalClose:function(){return setShowSaveModal(!1)}})]})},PreviewVideoBar=function(_a){var onSaveVideo=_a.onSaveVideo,isSaveDisabled=_a.isSaveDisabled,setInsertAfterSave=_a.setInsertAfterSave,uploadLoading=_a.uploadLoading,_b=(0,styled_components_browser_esm.DP)(),isCdkEnviroment=_b.isCdkEnviroment,history=(_b.colors,(0,react_router.W6)()),_c=useConfigurationContext(),showInsertFeature=_c.showInsertFeature,containerWidth=_c.containerWidth;return(0,jsx_runtime.jsx)(TopBar,{left:(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{text:"Back",variant:"transparent",icon:(0,jsx_runtime.jsx)(md_index_esm.MGo,{size:"18"}),onClick:function(){history.push("/")},style:{color:"white"}}),center:(0,jsx_runtime.jsx)(TitleWrapper,{children:""}),right:(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{onClick:function(){onSaveVideo()},text:"Save",variant:isCdkEnviroment?"white":"secondary",icon:uploadLoading?(0,jsx_runtime.jsx)(Spinner,{size:12}):(0,jsx_runtime.jsx)(images_SaveIcon,{height:"15px"})}),showInsertFeature&&(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{onClick:function(){setInsertAfterSave(!0),onSaveVideo()},text:containerWidth>screenSizes_sm?"Continue to Insert":"Insert",disabled:isSaveDisabled||uploadLoading,variant:isCdkEnviroment?"white":"primary"})]})})},videoTagsApi_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},videoTagsApi_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},videoTagsApi_cachedTags={all:[],user:[]},videoTagsApi_getTags=function(_a){var _b=_a.page,page=void 0===_b?0:_b,_c=_a.size,size=void 0===_c?50:_c,_d=_a.search,search=void 0===_d?"":_d,_e=_a.all,all=void 0!==_e&&_e,sort=_a.sort,_f=_a.refresh,refresh=void 0===_f||_f;return videoTagsApi_awaiter(void 0,void 0,void 0,(function(){var params,data,_g,_h;return videoTagsApi_generator(this,(function(_j){switch(_j.label){case 0:if(params={start:page*size,limit:size,search,sort,all:""},all&&(params.all="true"),!refresh){if(all&&(null===(_g=null==videoTagsApi_cachedTags?void 0:videoTagsApi_cachedTags.all)||void 0===_g?void 0:_g.length))return[2,videoTagsApi_cachedTags.all];if(!all&&(null===(_h=null==videoTagsApi_cachedTags?void 0:videoTagsApi_cachedTags.user)||void 0===_h?void 0:_h.length))return[2,videoTagsApi_cachedTags.user]}return[4,config_EXPRESS_API.get("/video-tags",{params})];case 1:return data=_j.sent().data,all?videoTagsApi_cachedTags.all=data:videoTagsApi_cachedTags.user=data,[2,data]}}))}))},videoTagsApi_putVideoTags=function(videoId,data){return videoTagsApi_awaiter(void 0,void 0,void 0,(function(){return videoTagsApi_generator(this,(function(_a){switch(_a.label){case 0:return[4,config_EXPRESS_API.put("/videos/".concat(videoId,"/video-tags"),data)];case 1:return[2,{videoTags:_a.sent().data}]}}))}))};function icon_car_extends(){return icon_car_extends=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},icon_car_extends.apply(null,arguments)}const icon_car=function SvgIconCar(props){return react.createElement("svg",icon_car_extends({width:16,height:14,viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props),icon_car_path||(icon_car_path=react.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.5833 0.333252C13.1333 0.333252 13.6 0.683252 13.7667 1.17492L15.4083 5.89992C15.4667 6.07492 15.5 6.26659 15.5 6.44992V12.4166C15.5 13.1083 14.9333 13.6666 14.25 13.6666C13.5583 13.6666 13 13.0999 13 12.4166V11.9999H3V12.4166C3 13.1083 2.44167 13.6666 1.75 13.6666C1.05833 13.6666 0.5 13.1083 0.5 12.4166V6.44992C0.5 6.25825 0.533333 6.07492 0.591667 5.89992L2.23333 1.17492C2.40833 0.683252 2.86667 0.333252 3.41667 0.333252H12.5833ZM2.16667 8.24992C2.16667 8.94159 2.725 9.49992 3.41667 9.49992C4.10833 9.49992 4.66667 8.94159 4.66667 8.24992C4.66667 7.55825 4.10833 6.99992 3.41667 6.99992C2.725 6.99992 2.16667 7.55825 2.16667 8.24992ZM12.5833 9.49992C11.8917 9.49992 11.3333 8.94159 11.3333 8.24992C11.3333 7.55825 11.8917 6.99992 12.5833 6.99992C13.275 6.99992 13.8333 7.55825 13.8333 8.24992C13.8333 8.94159 13.275 9.49992 12.5833 9.49992ZM3.225 2.14992L2.16667 5.33325H13.8333L12.775 2.14992C12.6583 1.81659 12.3417 1.58325 11.9833 1.58325H4.01667C3.65833 1.58325 3.34167 1.81659 3.225 2.14992Z",fill:"#001B53",fillOpacity:.4})))};var CarIcon_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked};const images_CarIcon=(0,styled_components_browser_esm.Ay)(icon_car)(CarIcon_templateObject_1||(CarIcon_templateObject_1=CarIcon_makeTemplateObject(["\n width: ",";\n height: ",";\n g {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n g {\n fill: ",";\n opacity: ",";\n }\n"])),(function(props){return props.width||"24px"}),(function(props){return props.height||"24px"}),(function(props){return props.color||"currentColor"}),(function(props){return props.opacity||"inherit"}));var CarIcon_templateObject_1,hashtag_g;function hashtag_extends(){return hashtag_extends=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},hashtag_extends.apply(null,arguments)}const hashtag=function SvgHashtag(props){return react.createElement("svg",hashtag_extends({width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props),hashtag_g||(hashtag_g=react.createElement("g",null,react.createElement("path",{d:"M11.3327 3.99935C11.3327 3.63268 11.0327 3.33268 10.666 3.33268H8.66602V1.33268C8.66602 0.966016 8.36602 0.666016 7.99935 0.666016C7.63268 0.666016 7.33268 0.966016 7.33268 1.33268V3.33268H4.66602V1.33268C4.66602 0.966016 4.36602 0.666016 3.99935 0.666016C3.63268 0.666016 3.33268 0.966016 3.33268 1.33268V3.33268H1.33268C0.966016 3.33268 0.666016 3.63268 0.666016 3.99935C0.666016 4.36602 0.966016 4.66602 1.33268 4.66602H3.33268V7.33268H1.33268C0.966016 7.33268 0.666016 7.63268 0.666016 7.99935C0.666016 8.36602 0.966016 8.66602 1.33268 8.66602H3.33268V10.666C3.33268 11.0327 3.63268 11.3327 3.99935 11.3327C4.36602 11.3327 4.66602 11.0327 4.66602 10.666V8.66602H7.33268V10.666C7.33268 11.0327 7.63268 11.3327 7.99935 11.3327C8.36602 11.3327 8.66602 11.0327 8.66602 10.666V8.66602H10.666C11.0327 8.66602 11.3327 8.36602 11.3327 7.99935C11.3327 7.63268 11.0327 7.33268 10.666 7.33268H8.66602V4.66602H10.666C11.0327 4.66602 11.3327 4.36602 11.3327 3.99935ZM7.33268 7.33268H4.66602V4.66602H7.33268V7.33268Z",fill:"#001B53"}))))};var HashtagIcon_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked};const images_HashtagIcon=(0,styled_components_browser_esm.Ay)(hashtag)(HashtagIcon_templateObject_1||(HashtagIcon_templateObject_1=HashtagIcon_makeTemplateObject(["\n width: ",";\n height: ",";\n path {\n fill: ",";\n fill-opacity: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n path {\n fill: ",";\n fill-opacity: ",";\n opacity: ",";\n }\n"])),(function(props){return props.width||"14px"}),(function(props){return props.height||"14px"}),(function(props){return props.color||"currentColor"}),(function(props){return props.opacity||"currentColor"}),(function(props){return props.opacity||"inherit"}));var HashtagIcon_templateObject_1,Upload_View,MoonLoader=__webpack_require__("./node_modules/react-spinners/esm/MoonLoader.js"),lib=__webpack_require__("./node_modules/rc-progress/lib/index.js"),Upload_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},Upload_assign=function(){return Upload_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},Upload_assign.apply(this,arguments)},Upload_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},Upload_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},Upload_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},FlexCenter=styled_components_browser_esm.Ay.div(Upload_templateObject_1||(Upload_templateObject_1=Upload_makeTemplateObject(["\n margin-top: 16px;\n background-color: #f6f7f9;\n border-radius: 4px;\n padding: 32px;\n height: 168px;\n display: flex;\n justify-content: center;\n flex-direction: column;\n"],["\n margin-top: 16px;\n background-color: #f6f7f9;\n border-radius: 4px;\n padding: 32px;\n height: 168px;\n display: flex;\n justify-content: center;\n flex-direction: column;\n"]))),CircleContainer=styled_components_browser_esm.Ay.div(Upload_templateObject_2||(Upload_templateObject_2=Upload_makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n"],["\n display: flex;\n justify-content: space-between;\n"]))),CircleText=styled_components_browser_esm.Ay.div(Upload_templateObject_3||(Upload_templateObject_3=Upload_makeTemplateObject(["\n display: flex;\n flex-direction: column;\n position: relative;\n &:nth-child(2) {\n align-items: center;\n justify-content: space-between;\n }\n &:nth-child(3) {\n align-items: flex-end;\n justify-content: flex-end;\n }\n span {\n top: 0px;\n font-size: 16px;\n line-height: 1.5;\n color: ",";\n margin-bottom: 8px;\n }\n .checkmark {\n border-radius: 20px;\n position: absolute;\n top: 106px;\n z-index: 4;\n color: white;\n background-color: ",";\n }\n .rc-progress-circle {\n background-color: #f6f7f9;\n }\n & > div {\n background-color: #f6f7f9;\n z-index: 3;\n border-radius: 50px;\n position: absolute;\n }\n"],["\n display: flex;\n flex-direction: column;\n position: relative;\n &:nth-child(2) {\n align-items: center;\n justify-content: space-between;\n }\n &:nth-child(3) {\n align-items: flex-end;\n justify-content: flex-end;\n }\n span {\n top: 0px;\n font-size: 16px;\n line-height: 1.5;\n color: ",";\n margin-bottom: 8px;\n }\n .checkmark {\n border-radius: 20px;\n position: absolute;\n top: 106px;\n z-index: 4;\n color: white;\n background-color: ",";\n }\n .rc-progress-circle {\n background-color: #f6f7f9;\n }\n & > div {\n background-color: #f6f7f9;\n z-index: 3;\n border-radius: 50px;\n position: absolute;\n }\n"])),(function(props){return props.isActive?palette_black_1_100:"rgba(39, 42, 50, 0.4)"}),(function(props){return props.theme.colors.primary[100]})),Upload_ContentBody=styled_components_browser_esm.Ay.div(Upload_templateObject_4||(Upload_templateObject_4=Upload_makeTemplateObject(["\n ","\n font-size: ",";\n color: ",";\n margin: 0;\n width: 100%;\n margin-bottom: 32px;\n min-height: 190px;\n position: relative;\n"],["\n ","\n font-size: ",";\n color: ",";\n margin: 0;\n width: 100%;\n margin-bottom: 32px;\n min-height: 190px;\n position: relative;\n"])),fontNormal400,fontSizes_m,palette_blackRgb75),Upload_ProgressBar=styled_components_browser_esm.Ay.progress(Upload_templateObject_5||(Upload_templateObject_5=Upload_makeTemplateObject(["\n z-index: 1;\n margin-top: -14.5px;\n width: 100%;\n background-color: ",";\n border: none;\n border-radius: 15px;\n height: 4px;\n &::-webkit-progress-bar {\n margin: 0 auto;\n background-color: ",";\n border-radius: 15px;\n height: 4px;\n }\n &::-moz-progress-bar {\n margin: 0 auto;\n background-color: ",";\n border-radius: 15px;\n height: 4px;\n }\n &::-webkit-progress-value {\n float: left;\n height: 4px;\n margin: 0px -10px 0 0;\n background: ",";\n border-radius: 15px;\n }\n"],["\n z-index: 1;\n margin-top: -14.5px;\n width: 100%;\n background-color: ",";\n border: none;\n border-radius: 15px;\n height: 4px;\n &::-webkit-progress-bar {\n margin: 0 auto;\n background-color: ",";\n border-radius: 15px;\n height: 4px;\n }\n &::-moz-progress-bar {\n margin: 0 auto;\n background-color: ",";\n border-radius: 15px;\n height: 4px;\n }\n &::-webkit-progress-value {\n float: left;\n height: 4px;\n margin: 0px -10px 0 0;\n background: ",";\n border-radius: 15px;\n }\n"])),palette_lightgray,palette_lightgray,(function(_a){return _a.color}),(function(_a){return _a.color})),ProgressText=styled_components_browser_esm.Ay.div(Upload_templateObject_6||(Upload_templateObject_6=Upload_makeTemplateObject(["\n width: 100%;\n text-align: left;\n margin-bottom: 16px;\n height: 24px;\n font-size: 16px;\n line-height: 1.5;\n color: #4e5461;\n margin-top: 32px;\n"],["\n width: 100%;\n text-align: left;\n margin-bottom: 16px;\n height: 24px;\n font-size: 16px;\n line-height: 1.5;\n color: #4e5461;\n margin-top: 32px;\n"]))),MoonLoaderContainer=styled_components_browser_esm.Ay.div(Upload_templateObject_7||(Upload_templateObject_7=Upload_makeTemplateObject(["\n position: absolute;\n top: 30px;\n"],["\n position: absolute;\n top: 30px;\n"]))),circleStyle={width:"24px",zIndex:2,backgroundColor:"f6f7f9"};!function(View){View[View.UPLOADING=1]="UPLOADING",View[View.CREATE=2]="CREATE",View[View.ENCODE=3]="ENCODE"}(Upload_View||(Upload_View={}));const video_Upload=function(_a){var title=_a.title,beginUploadProcess=_a.beginUploadProcess,afterUpload=_a.afterUpload,setSavedVideoId=_a.setSavedVideoId,file=_a.file,fileName=_a.fileName,colors=(0,styled_components_browser_esm.DP)().colors,userData=useAuthorizationContext().userData,_b=Upload_read((0,react.useState)(Upload_View.UPLOADING),2),progress=_b[0],setProgress=_b[1],_c=Upload_read((0,react.useState)({loaded:0,total:0,percentage:0}),2),uploadProgress=_c[0],setUploadProgress=_c[1],_d=usePresignedUrl(),presignedUrl=_d.presignedUrl,getPresignedUrl=_d.fetch,isLoadingUrl=_d.loading,urlError=_d.error,_e=useS3Upload(),uploadVideo=_e.uploadVideo,isUploading=_e.loading,uploadData=_e.data,uploadError=_e.error,_f=useCreateVideo(),createVideo=_f.fetch,isCreating=_f.loading,videoData=_f.videoData,createError=_f.error,createProgress=_f.progress,_g=useEncodeVideo(),encodeVideo=_g.fetch,isEncoding=_g.loading,encodeData=_g.encodeData,encodeError=_g.error,encodeProgress=_g.progress;(0,react.useEffect)((function(){if(beginUploadProcess){if(presignedUrl&&presignedUrl.url||!title)return;Upload_awaiter(void 0,void 0,void 0,(function(){return Upload_generator(this,(function(_a){return file&&getPresignedUrl({fileName,type:"video/webm"}),[2]}))}))}}),[beginUploadProcess]),(0,react.useEffect)((function(){presignedUrl&&(isLoadingUrl||urlError||!file||(setProgress(Upload_View.UPLOADING),uploadVideo({url:presignedUrl.url,file,contentType:"video/webm",onUploadProgress})))}),[presignedUrl]),(0,react.useEffect)((function(){!isUploading&&!uploadError&&uploadData&&file&&(setProgress(Upload_View.CREATE),createVideo({filename:fileName,title}))}),[isUploading,uploadData]),(0,react.useEffect)((function(){!isCreating&&!createError&&videoData&&file&&(setProgress(Upload_View.ENCODE),setSavedVideoId(videoData.video_id),encodeVideo({videoId:videoData.video_id,customerId:userData.customerId}))}),[isCreating,videoData]),(0,react.useEffect)((function(){!isEncoding&&!encodeError&&encodeData&&file&&afterUpload&&afterUpload()}),[isEncoding,encodeData]);var onUploadProgress=function(e){var percentCompleted=Math.round(100*e.loaded/e.total);setUploadProgress({loaded:Math.floor(e.loaded/1024),total:Math.floor(e.total/1024),percentage:percentCompleted})},toMB=function(KB){return(KB/1e3).toFixed(2)};return(0,jsx_runtime.jsx)(Upload_ContentBody,{children:(0,jsx_runtime.jsxs)(FlexCenter,{children:[(0,jsx_runtime.jsxs)(CircleContainer,{children:[(0,jsx_runtime.jsxs)(CircleText,Upload_assign({isActive:isUploading},{children:[(0,jsx_runtime.jsx)("span",{children:isUploading?"Uploading":"Uploaded"}),uploadProgress.percentage<100&&(0,jsx_runtime.jsx)(MoonLoaderContainer,{children:(0,jsx_runtime.jsx)(MoonLoader.A,{size:19.5,color:colors.primary[100],loading:!0})}),(!uploadProgress.percentage||100===uploadProgress.percentage)&&(0,jsx_runtime.jsx)(lib.jl,{style:circleStyle,percent:0,trailWidth:10,strokeWidth:10,strokeColor:colors.primary[100]})]})),(0,jsx_runtime.jsxs)(CircleText,Upload_assign({isActive:isCreating},{children:[(0,jsx_runtime.jsx)("span",{children:isCreating?"Creating":"Created"}),createProgress<100&&(0,jsx_runtime.jsx)(MoonLoaderContainer,{children:(0,jsx_runtime.jsx)(MoonLoader.A,{size:19.5,color:colors.primary[100],loading:!0})}),(!createProgress||100===createProgress)&&(0,jsx_runtime.jsx)(lib.jl,{style:circleStyle,percent:0,trailWidth:10,strokeWidth:10,strokeColor:colors.primary[100]})]})),(0,jsx_runtime.jsxs)(CircleText,Upload_assign({isActive:isEncoding},{children:[(0,jsx_runtime.jsx)("span",{children:isEncoding?"Encoding":"Encoded"}),encodeProgress<100&&(0,jsx_runtime.jsx)(MoonLoaderContainer,{children:(0,jsx_runtime.jsx)(MoonLoader.A,{size:19.5,color:colors.primary[100],loading:!0})}),(!encodeProgress||100===encodeProgress)&&(0,jsx_runtime.jsx)(lib.jl,{style:circleStyle,percent:0,trailWidth:10,strokeWidth:10,strokeColor:colors.primary[100]})]}))]}),(0,jsx_runtime.jsx)(Upload_ProgressBar,{value:progress?progress==Upload_View.UPLOADING?50*uploadProgress.percentage/100:progress==Upload_View.CREATE?50+(createProgress||0):100:0,max:100,color:colors.primary[100]}),(0,jsx_runtime.jsx)(ProgressText,{children:toMB(uploadProgress.loaded)+" MB/"+toMB(uploadProgress.total)+" MB"})]})})};var Upload_templateObject_1,Upload_templateObject_2,Upload_templateObject_3,Upload_templateObject_4,Upload_templateObject_5,Upload_templateObject_6,Upload_templateObject_7,AttributesFields_templateObject_1,AttributesFields_templateObject_2,AttributesFields_templateObject_3,AttributesFields_templateObject_4,AttributesFields_templateObject_5,AttributesFields_templateObject_6,formik_esm=__webpack_require__("./node_modules/formik/dist/formik.esm.js"),AttributesFields_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},AttributesFields_assign=function(){return AttributesFields_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},AttributesFields_assign.apply(this,arguments)},AttributesFields_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},AttributesFields_spreadArray=function(to,from,pack){if(pack||2===arguments.length)for(var ar,i=0,l=from.length;i<l;i++)!ar&&i in from||(ar||(ar=Array.prototype.slice.call(from,0,i)),ar[i]=from[i]);return to.concat(ar||Array.prototype.slice.call(from))},AttributesFields_Content=styled_components_browser_esm.Ay.div(AttributesFields_templateObject_1||(AttributesFields_templateObject_1=AttributesFields_makeTemplateObject(["\n width: auto;\n margin-top: 8px;\n .error {\n border-color: #e84c3d;\n }\n .disabled {\n background-color: #eeeff2;\n cursor: not-allowed;\n }\n\n .disabled > div {\n background-color: #eeeff2;\n cursor: not-allowed;\n }\n"],["\n width: auto;\n margin-top: 8px;\n .error {\n border-color: #e84c3d;\n }\n .disabled {\n background-color: #eeeff2;\n cursor: not-allowed;\n }\n\n .disabled > div {\n background-color: #eeeff2;\n cursor: not-allowed;\n }\n"]))),VideoAttribute=styled_components_browser_esm.Ay.div(AttributesFields_templateObject_2||(AttributesFields_templateObject_2=AttributesFields_makeTemplateObject(["\n margin: 24px 0;\n display: flex;\n flex-direction: column;\n"],["\n margin: 24px 0;\n display: flex;\n flex-direction: column;\n"]))),AttributesFields_Label=styled_components_browser_esm.Ay.div(AttributesFields_templateObject_3||(AttributesFields_templateObject_3=AttributesFields_makeTemplateObject(["\n height: 20px;\n font-size: 14px;\n font-weight: 500;\n font-stretch: normal;\n font-style: normal;\n line-height: 1.43;\n letter-spacing: normal;\n color: ",";\n margin-bottom: 8px;\n"],["\n height: 20px;\n font-size: 14px;\n font-weight: 500;\n font-stretch: normal;\n font-style: normal;\n line-height: 1.43;\n letter-spacing: normal;\n color: ",";\n margin-bottom: 8px;\n"])),palette_label),TextInput=styled_components_browser_esm.Ay.input(AttributesFields_templateObject_4||(AttributesFields_templateObject_4=AttributesFields_makeTemplateObject(["\n padding-left: 8px;\n height: 40px;\n width: 100%;\n border-radius: 4px;\n border: solid 1px #d0d3d9;\n font-size: 16px;\n font-weight: normal;\n font-stretch: normal;\n font-style: normal;\n line-height: 1.5;\n letter-spacing: normal;\n color: ",";\n margin-right: 8px;\n box-sizing: border-box;\n &:focus {\n outline: 0;\n }\n"],["\n padding-left: 8px;\n height: 40px;\n width: 100%;\n border-radius: 4px;\n border: solid 1px #d0d3d9;\n font-size: 16px;\n font-weight: normal;\n font-stretch: normal;\n font-style: normal;\n line-height: 1.5;\n letter-spacing: normal;\n color: ",";\n margin-right: 8px;\n box-sizing: border-box;\n &:focus {\n outline: 0;\n }\n"])),palette_black_1_100),Textarea=styled_components_browser_esm.Ay.textarea(AttributesFields_templateObject_6||(AttributesFields_templateObject_6=AttributesFields_makeTemplateObject(["\n padding-left: 8px;\n width: 242px;\n min-width: 242px;\n max-width: 242px;\n height: 100px;\n min-height: 100px;\n max-height: 300px;\n border-radius: 4px;\n border: solid 1px #d0d3d9;\n &:focus {\n outline: 0;\n }\n ","\n"],["\n padding-left: 8px;\n width: 242px;\n min-width: 242px;\n max-width: 242px;\n height: 100px;\n min-height: 100px;\n max-height: 300px;\n border-radius: 4px;\n border: solid 1px #d0d3d9;\n &:focus {\n outline: 0;\n }\n ","\n"])),(function(_a){return _a.theme.containerWidth>=screenSizes_lg&&(0,styled_components_browser_esm.AH)(AttributesFields_templateObject_5||(AttributesFields_templateObject_5=AttributesFields_makeTemplateObject(["\n width: 368px;\n min-width: 368px;\n max-width: 368px;\n "],["\n width: 368px;\n min-width: 368px;\n max-width: 368px;\n "])))})),AttributeFields=function(_a){var attributes=_a.attributes,initValues=_a.initValues,setIsSaveDisabled=_a.setIsSaveDisabled,colors=(0,styled_components_browser_esm.DP)().colors,userData=useAuthorizationContext().userData,showVideoRequestFields=checkIfAutomotive(userData),isAutomotiveServiceRole=checkIfAutomotiveServiceRole(userData),isAutomotiveSalesRole=checkIfAutomotiveSalesRole(userData),videoRequestFieldsRequired=checkIfVideoRequestFieldsRequired(userData),_b=AttributesFields_read(react.useState(),2),requiredAttributesState=_b[0],setRequiredAttributesState=_b[1],_c=(0,formik_esm.j7)(),errors=_c.errors,validateForm=_c.validateForm,setFieldValue=_c.setFieldValue;react.useEffect((function(){validateForm(),countRequiredAndValidate()}),[attributes]),react.useEffect((function(){0!==(null==requiredAttributesState?void 0:requiredAttributesState.length)?setIsSaveDisabled(!0):setIsSaveDisabled(!1)}),[requiredAttributesState]);var countRequiredAndValidate=function(){var count=0,requiredAttr=[];return attributes.forEach((function(attribute){attribute&&attribute.isRequired&&(""===attribute.default||null===attribute.default)&&(++count,requiredAttr.push(attribute))})),setRequiredAttributesState(requiredAttr),isAutomotiveSalesRole&&videoRequestFieldsRequired&&(count+=1),isAutomotiveServiceRole&&videoRequestFieldsRequired&&(count+=2),count},validateFields=function(value,attribute){""!==value&&attribute.isRequired&&(requiredAttributesState.find((function(at){return at.attributeId===attribute.attributeId}))&&setRequiredAttributesState(requiredAttributesState.filter((function(at){return at.attributeId!==attribute.attributeId}))));""===value&&attribute.isRequired&&(!requiredAttributesState.find((function(at){return at.attributeId===attribute.attributeId}))&&setRequiredAttributesState(AttributesFields_spreadArray(AttributesFields_spreadArray([],AttributesFields_read(requiredAttributesState),!1),[attribute],!1)))};return showVideoRequestFields||attributes.length?(0,jsx_runtime.jsx)(AttributesFields_Content,{children:attributes.map((function(attribute,index){var isDisabled=!(!attribute.isReadOnly&&!attribute.isLocked||!initValues[index]),hasError=!!errors["attributes".concat(index)],isRequired=!!attribute.isRequired,className="";return isDisabled&&(className="disabled"),hasError&&(className+=" error"),(0,jsx_runtime.jsxs)(VideoAttribute,{children:[(0,jsx_runtime.jsxs)(AttributesFields_Label,{children:[attribute.title,isRequired&&(0,jsx_runtime.jsx)("span",AttributesFields_assign({style:{color:colors.primary[100]}},{children:"*"}))]}),"text"===attribute.type&&(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(formik_esm.D0,{name:"attributes".concat(index),disabled:isDisabled,as:TextInput,type:"text",required:isRequired,className,defaultValue:attribute.default,onChange:function(event){validateFields(event.target.value,attribute),setFieldValue("attributes".concat(index),event.target.value)},onFocus:function(){validateForm()}}),hasError?(0,jsx_runtime.jsx)("div",AttributesFields_assign({style:{color:"#E84C3D",marginTop:"3px"}},{children:errors["attributes".concat(index)]})):(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{})]}),"textarea"===attribute.type&&(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(formik_esm.D0,{disabled:isDisabled,name:"attributes".concat(index),as:Textarea,defaultValue:attribute.default,className,required:isRequired,type:"text",onChange:function(event){validateFields(event.target.value,attribute),setFieldValue("attributes".concat(index),event.target.value)}}),hasError?(0,jsx_runtime.jsx)("div",AttributesFields_assign({style:{color:"#E84C3D",marginTop:"3px"}},{children:errors["attributes".concat(index)]})):(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{})]}),"dropdown"===attribute.type&&(0,jsx_runtime.jsx)(formik_esm.D0,AttributesFields_assign({name:"attributes".concat(index),disabled:isDisabled,required:isRequired,className},{children:function(_a){var field=_a.field,form=_a.form,value=field.value,options=attribute.dropdownValues.map((function(dropdown){return{value:dropdown.value,label:dropdown.value}}));return(0,jsx_runtime.jsx)(Dropdown,{creatable:!1,isSearchable:!0,disabled:isDisabled,maxMenuHeight:100,options,defaultValue:options.find((function(o){return o.value===attribute.default}))||"",value:options.find((function(o){return o.value==value})),onChange:function(option){validateFields(option.value,attribute),(attribute.isReadOnly||attribute.isLocked)&&initValues[index]?form.setFieldValue("attributes".concat(index),initValues[index]):form.setFieldValue("attributes".concat(index),option.value)}})}}))]},index)}))}):null},Preview_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},Preview_assign=function(){return Preview_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},Preview_assign.apply(this,arguments)},Preview_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},Preview_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},Preview_rest=function(s,e){var t={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0&&(t[p]=s[p]);if(null!=s&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(p=Object.getOwnPropertySymbols(s);i<p.length;i++)e.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i])&&(t[p[i]]=s[p[i]])}return t},Preview_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},Preview_spreadArray=function(to,from,pack){if(pack||2===arguments.length)for(var ar,i=0,l=from.length;i<l;i++)!ar&&i in from||(ar||(ar=Array.prototype.slice.call(from,0,i)),ar[i]=from[i]);return to.concat(ar||Array.prototype.slice.call(from))},Preview_Content=styled_components_browser_esm.Ay.div(Preview_templateObject_2||(Preview_templateObject_2=Preview_makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n box-sizing: border-box;\n ","\n"],["\n display: flex;\n justify-content: space-between;\n box-sizing: border-box;\n ","\n"])),(function(_a){return _a.theme.containerWidth<screenSizes_xs&&(0,styled_components_browser_esm.AH)(Preview_templateObject_1||(Preview_templateObject_1=Preview_makeTemplateObject(["\n flex-direction: column;\n "],["\n flex-direction: column;\n "])))})),RightSide=styled_components_browser_esm.Ay.div(Preview_templateObject_5||(Preview_templateObject_5=Preview_makeTemplateObject(["\n box-sizing: border-box;\n width: 100%;\n ","\n ","\n"],["\n box-sizing: border-box;\n width: 100%;\n ","\n ","\n"])),(function(_a){return _a.theme.containerWidth>=screenSizes_xs&&(0,styled_components_browser_esm.AH)(Preview_templateObject_3||(Preview_templateObject_3=Preview_makeTemplateObject(["\n width: 50%;\n "],["\n width: 50%;\n "])))}),(function(_a){return _a.theme.containerWidth<screenSizes_xs&&(0,styled_components_browser_esm.AH)(Preview_templateObject_4||(Preview_templateObject_4=Preview_makeTemplateObject(["\n margin-top: 8px;\n "],["\n margin-top: 8px;\n "])))})),LeftSide=styled_components_browser_esm.Ay.div(Preview_templateObject_7||(Preview_templateObject_7=Preview_makeTemplateObject(["\n box-sizing: border-box;\n width: 100%;\n ","\n"],["\n box-sizing: border-box;\n width: 100%;\n ","\n"])),(function(_a){return _a.theme.containerWidth>=screenSizes_xs&&(0,styled_components_browser_esm.AH)(Preview_templateObject_6||(Preview_templateObject_6=Preview_makeTemplateObject(["\n padding-right: 52px;\n width: 50%;\n "],["\n padding-right: 52px;\n width: 50%;\n "])))})),VideoCard=styled_components_browser_esm.Ay.div(Preview_templateObject_8||(Preview_templateObject_8=Preview_makeTemplateObject(["\n box-shadow:\n 0px 0px 2px rgba(66, 79, 104, 0.08),\n 0px 4px 8px rgba(66, 79, 104, 0.03);\n margin-bottom: 32px;\n"],["\n box-shadow:\n 0px 0px 2px rgba(66, 79, 104, 0.08),\n 0px 4px 8px rgba(66, 79, 104, 0.03);\n margin-bottom: 32px;\n"]))),Preview_FormGroup=styled_components_browser_esm.Ay.div(Preview_templateObject_9||(Preview_templateObject_9=Preview_makeTemplateObject(["\n margin-bottom: ",";\n display: grid;\n gap: 8px;\n"],["\n margin-bottom: ",";\n display: grid;\n gap: 8px;\n"])),(function(props){return props.marginBottom||"16px"})),DateContainer=styled_components_browser_esm.Ay.div(Preview_templateObject_10||(Preview_templateObject_10=Preview_makeTemplateObject(["\n background-color: ",";\n padding: 18px;\n display: flex;\n align-items: center;\n border-bottom-left-radius: 6px;\n border-bottom-right-radius: 6px;\n margin-top: -7px;\n"],["\n background-color: ",";\n padding: 18px;\n display: flex;\n align-items: center;\n border-bottom-left-radius: 6px;\n border-bottom-right-radius: 6px;\n margin-top: -7px;\n"])),palette_white),Preview_OptionLabel=styled_components_browser_esm.Ay.div(Preview_templateObject_11||(Preview_templateObject_11=Preview_makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n"],["\n display: flex;\n justify-content: space-between;\n"]))),RightOption=styled_components_browser_esm.Ay.div(Preview_templateObject_12||(Preview_templateObject_12=Preview_makeTemplateObject(["\n color: ",";\n"],["\n color: ",";\n"])),(function(_a){return _a.theme.colors.primary[40]})),LeftOption=styled_components_browser_esm.Ay.div(Preview_templateObject_13||(Preview_templateObject_13=Preview_makeTemplateObject(["\n font-weight: 600;\n color: ",";\n display: flex;\n align-items: center;\n"],["\n font-weight: 600;\n color: ",";\n display: flex;\n align-items: center;\n"])),(function(_a){return _a.theme.colors.primary[100]})),TagContainer=styled_components_browser_esm.Ay.div(Preview_templateObject_14||(Preview_templateObject_14=Preview_makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n gap: 4px;\n"],["\n display: flex;\n flex-wrap: wrap;\n gap: 4px;\n"]))),TRIM_INITIAL_VALUE=[0,0],TagOption=function(_a){_a.children;var _b,props=Preview_rest(_a,["children"]),selectedValueText=props.data.label,isCreateNewOption=!(null===(_b=props.data)||void 0===_b?void 0:_b.__isNew__);return(0,jsx_runtime.jsx)(index_75b02bac_browser_esm.F.Option,Preview_assign({},props,{children:(0,jsx_runtime.jsxs)(LeftOption,{children:[isCreateNewOption&&(0,jsx_runtime.jsx)(images_HashtagIcon,{style:{marginRight:"8px"},width:15,height:15,color:"inherit"}),selectedValueText]})}))};const components_Preview=function(_a){var recordingBlobUrl=_a.recordingBlobUrl,recordDate=_a.recordDate,setSaveFunction=_a.setSaveFunction,_b=_a.insertAfterSave,insertAfterSave=void 0!==_b&&_b,setIsSaveDisabled=_a.setIsSaveDisabled,_c=_a.skipUploadProcess,skipUploadProcess=void 0!==_c&&_c,videoId=_a.videoId,initialTitle=_a.initialTitle,updateUploadLoading=_a.updateUploadLoading,userData=useAuthorizationContext().userData,fileName=(useConfigurationContext().showTrimFeature,(0,react.useMemo)((function(){return generateFileName(userData,"webm")}),[userData,"webm"])),isAutomotiveSales=checkIfAutomotiveSalesRole(userData),isAutomotiveService=checkIfAutomotiveServiceRole(userData),videoRef=(0,react.createRef)(),_d=Preview_read((0,react.useState)(initialTitle||recordDate),2),title=_d[0],setTitle=_d[1],_e=Preview_read((0,react.useState)([]),2),vehicleOptions=_e[0],setVehicleOptions=_e[1],_f=Preview_read((0,react.useState)({value:"",label:"Select vehicle"}),2),vin=_f[0],setVin=_f[1],_g=Preview_read((0,react.useState)({value:"",label:"Select video type"}),2),videoType=_g[0],setVideoType=_g[1],_h=Preview_read((0,react.useState)([]),2),videoAttributes=_h[0],setVideoAttributes=_h[1],_j=Preview_read((0,react.useState)(),2),initialValues=_j[0],setInitialValues=_j[1],_k=Preview_read((0,react.useState)([]),2),tags=_k[0],setTags=_k[1],_l=Preview_read((0,react.useState)([]),2),selectedTags=_l[0],setSelectedTags=_l[1],_m=Preview_read((0,react.useState)({value:"",label:"Search tags or create new..."}),2),tag=_m[0],setTag=_m[1],_o=Preview_read((0,react.useState)(!1),2),isVideoSaved=_o[0],setIsVideoSaved=_o[1],_p=Preview_read((0,react.useState)(!1),2),beginUploadProcess=_p[0],setBeginUploadProcess=_p[1],_q=Preview_read((0,react.useState)({title:"",tags:""}),2),error=_q[0],setError=_q[1],_r=Preview_read((0,react.useState)(),2),file=_r[0],setFile=_r[1],_s=Preview_read((0,react.useState)(0),2),videoDuration=_s[0],setVideoDuration=_s[1],_t=Preview_read((0,react.useState)({}),2),attributesValues=_t[0],setAttributesValues=_t[1],_u=Preview_read((0,react.useState)(!0),2),setIsVideoLoading=(_u[0],_u[1]),_v=((0,react.useRef)([0,0]),Preview_read((0,react.useState)(TRIM_INITIAL_VALUE),2)),trimValue=_v[0],setTrimValue=_v[1],_w=Preview_read((0,react.useState)(!1),2),isVideoTrimmed=_w[0],setIsVideoTrimmed=_w[1],_x=Preview_read((0,react.useState)(videoId||""),2),savedVideoId=_x[0],setSavedVideoId=_x[1],_y=Preview_read((0,react.useState)(),2),initialObjectState=_y[0],setInitialObjectState=_y[1],history=(0,react_router.W6)(),formRef=(0,react.useRef)(null),toast=useToastNotifications().toast,videoTypeOptions=Object.values(isAutomotiveSales?VideoTypeSales:VideoType).map((function(videoType){return{value:videoType,label:videoType||"No video type"}})),initValueObject={};initValueObject.covideoName=title,initValueObject.saveToCompanyFolder=!1;var onSaveVideo=function(){var newErrors,attrValues=formRef.current.values;setAttributesValues(attrValues),setIsVideoSaved(!1),newErrors={title:"",tags:""},title&&title.length||(newErrors.title="Title cannot be empty."),setError(newErrors),Object.values(newErrors).every((function(field){return""===field}))&&(null==updateUploadLoading||updateUploadLoading(!0),skipUploadProcess?afterUpload(attrValues):setBeginUploadProcess(!0))},sortTags=function(unsortedTags){return unsortedTags.sort((function(a,b){var _a;return null===(_a=a.labelField)||void 0===_a?void 0:_a.localeCompare(b.labelField)}))},updateVideoAttributes=function(attrValues){return Preview_awaiter(void 0,void 0,void 0,(function(){var values,attributes;return Preview_generator(this,(function(_b){switch(_b.label){case 0:return values=attrValues||attributesValues,attributes=videoAttributes.map((function(attribute,index){return{attributeId:attribute.attributeId,value:values["attributes".concat(index)]||"",videoId:parseInt(savedVideoId)}})),attributes&&attributes.length?[4,putVideoAttributes(savedVideoId,attributes).catch((function(err){return err}))]:[3,2];case 1:_b.sent(),_b.label=2;case 2:return[2]}}))}))},afterUpload=function(attrValues){return Preview_awaiter(void 0,void 0,void 0,(function(){var trimmedVideoData;return Preview_generator(this,(function(_a){switch(_a.label){case 0:return _a.trys.push([0,9,,10]),selectedTags.length?[4,Preview_awaiter(void 0,void 0,void 0,(function(){var formattedTags;return Preview_generator(this,(function(_a){switch(_a.label){case 0:return formattedTags=selectedTags.map((function(item){return{value:item.value,label:item.labelField,__isNew__:item.__isNew__}})),[4,videoTagsApi_putVideoTags(savedVideoId,formattedTags)];case 1:return _a.sent(),[2]}}))}))]:[3,2];case 1:_a.sent(),_a.label=2;case 2:return[4,updateVideoAttributes(attrValues)];case 3:return _a.sent(),[4,Preview_awaiter(void 0,void 0,void 0,(function(){var videoRequest,result;return Preview_generator(this,(function(_a){switch(_a.label){case 0:return checkIfAutomotive(userData)?(videoRequest=Preview_assign({videoId:parseInt(savedVideoId),videoType:(null==videoType?void 0:videoType.value)||""},!!isAutomotiveSales&&{vin:(null==vin?void 0:vin.value)||""}),[4,createVideoRequest({data:videoRequest})]):[2,0];case 1:return pushToDataLayer({event:"covideo-event",event_name:"Saved New Video",creation_type:"Uploaded",video_id:(result=_a.sent()).video.id,video_title:result.video.title,video_type:result.videoType,video_customer_name:!!result.customerName,video_length:result.video.videoLength,VIN:result.vin}),[2,result.videoRequestId]}}))}))];case 4:return _a.sent(),isVideoTrimmed?[4,trimVideoCreate(savedVideoId)]:[3,6];case 5:(trimmedVideoData=_a.sent())&&setSavedVideoId(trimmedVideoData.id),_a.label=6;case 6:return initialTitle&&videoId&&initialTitle!==title?[4,updateVideo({videoId,videoBody:{title}})]:[3,8];case 7:_a.sent(),_a.label=8;case 8:return setIsVideoSaved(!0),toast({message:"Successfully saved video!"}),[3,10];case 9:return _a.sent(),toast({message:"There was an error while creating your video request. Please try again."}),[3,10];case 10:return[2]}}))}))},trimVideoCreate=function(videoId){return Preview_awaiter(void 0,void 0,void 0,(function(){var start,duration;return Preview_generator(this,(function(_a){switch(_a.label){case 0:start=Math.floor(100*trimValue[0])/100,duration=Math.floor(100*trimValue[1])/100,_a.label=1;case 1:return _a.trys.push([1,3,,4]),[4,trimVideo(videoId,{duration,start})];case 2:return[2,_a.sent()];case 3:return _a.sent(),toast({message:"Something went wrong while trimming the video, try again later!"}),[3,4];case 4:return[2]}}))}))};(0,react.useEffect)((function(){Preview_awaiter(void 0,void 0,void 0,(function(){return Preview_generator(this,(function(_a){switch(_a.label){case 0:return[4,Preview_awaiter(void 0,void 0,void 0,(function(){var results,initValues,e_2;return Preview_generator(this,(function(_a){switch(_a.label){case 0:return _a.trys.push([0,2,,3]),[4,getAttributes({})];case 1:return results=_a.sent(),setVideoAttributes(results.attributes||[]),initValues=results.attributes.map((function(att,index){if("dropdown"===att.type){var defaultValue=att.dropdownValues.find((function(value){return value.default}));return defaultValue&&defaultValue.value?(initValueObject["attributes".concat(index)]=defaultValue.value,defaultValue.value):(initValueObject["attributes".concat(index)]="","")}return initValueObject["attributes".concat(index)]=att.default||"",att.default||""})),formRef.current.values=initValueObject,setInitialObjectState(initValueObject),setInitialValues(initValues),[3,3];case 2:return e_2=_a.sent(),console.log(e_2),[3,3];case 3:return[2]}}))}))];case 1:return _a.sent(),[4,Preview_awaiter(void 0,void 0,void 0,(function(){var tagList,formattedTags_1,sortedTags,e_1;return Preview_generator(this,(function(_a){switch(_a.label){case 0:return _a.trys.push([0,2,,3]),[4,videoTagsApi_getTags({})];case 1:return tagList=_a.sent(),formattedTags_1=[],tagList.forEach((function(item){formattedTags_1.push({label:item.tag,value:item.tagId,labelField:item.tag})})),sortedTags=sortTags(formattedTags_1),setTags(sortedTags),[3,3];case 2:return e_1=_a.sent(),console.log(e_1),[3,3];case 3:return[2]}}))}))];case 2:return _a.sent(),[4,Preview_awaiter(void 0,void 0,void 0,(function(){var inventoryList,formattedInventory_1,e_3;return Preview_generator(this,(function(_a){switch(_a.label){case 0:return _a.trys.push([0,2,,3]),[4,getInventoryItems({})];case 1:return(inventoryList=_a.sent()).items&&(formattedInventory_1=[],inventoryList.items.forEach((function(item){formattedInventory_1.push({label:(0,jsx_runtime.jsxs)(Preview_OptionLabel,{children:[(0,jsx_runtime.jsxs)(LeftOption,{children:[(0,jsx_runtime.jsx)(images_CarIcon,{style:{marginRight:"8px"},width:15,height:15}),item.title]}),(0,jsx_runtime.jsx)(RightOption,{children:item.vin})]}),value:item.vin,labelField:item.vin})})),setVehicleOptions(formattedInventory_1)),[3,3];case 2:return e_3=_a.sent(),console.log(e_3),[3,3];case 3:return[2]}}))}))];case 3:return _a.sent(),[2]}}))}))}),[]),(0,react.useEffect)((function(){var blobUrl;recordingBlobUrl&&(blobUrl=recordingBlobUrl,Preview_awaiter(void 0,void 0,void 0,(function(){var file_1,error_1;return Preview_generator(this,(function(_a){switch(_a.label){case 0:return _a.trys.push([0,2,,3]),[4,fetch(blobUrl||"").then((function(r){return r.blob()}))];case 1:return file_1=_a.sent(),setFile(file_1),[3,3];case 2:return error_1=_a.sent(),console.log(error_1),[3,3];case 3:return[2]}}))})))}),[recordingBlobUrl]),(0,react.useEffect)((function(){isVideoSaved&&setTimeout((function(){null==updateUploadLoading||updateUploadLoading(!1),insertAfterSave&&savedVideoId?history.push("/insert-video/".concat(savedVideoId)):history.push("/")}),400)}),[isVideoSaved,savedVideoId]),(0,react.useEffect)((function(){setTrimValue([0,videoDuration])}),[videoDuration]),(0,react.useEffect)((function(){var checkTrim=checkIfVideoIsTrimmed({trimStart:trimValue[0],trimEnd:trimValue[1],videoDuration});return setIsVideoTrimmed(checkTrim),function(){setIsVideoTrimmed(!1)}}),[trimValue,videoDuration]),(0,react.useEffect)((function(){setIsSaveDisabled(""===title)}),[title]),(0,react.useEffect)((function(){setSaveFunction&&setSaveFunction((function(){return onSaveVideo}))}),[title,trimValue,videoDuration,vin,isVideoTrimmed]);var dateOfMonth,ordinalLetters;return(0,jsx_runtime.jsxs)("div",{children:[(0,jsx_runtime.jsx)(components_RouteLeavingGuard,{when:!0,stay:!0,onConfirm:function(){},navigate:function(path){videoId&&Preview_awaiter(void 0,void 0,void 0,(function(){return Preview_generator(this,(function(_a){switch(_a.label){case 0:return videoId?[4,deleteVideo({videoIds:[videoId],deleteMultiple:!1})]:[2];case 1:return _a.sent(),[2]}}))})),history.push(path)},shouldBlockNavigation:function(){return!isVideoSaved},title:"Delete Current Video?",text:"Do you want to go back? The current video will be deleted.",confirmButtonText:"No, Keep Video",discardButtonText:"Yes, Delete Video",showDiscardIcon:!1,showSaveIcon:!1}),beginUploadProcess?(0,jsx_runtime.jsx)(video_Upload,{title,beginUploadProcess,afterUpload,setSavedVideoId,file,fileName}):(0,jsx_runtime.jsxs)(Preview_Content,{children:[(0,jsx_runtime.jsxs)(LeftSide,{children:[(0,jsx_runtime.jsxs)(VideoCard,{children:[(0,jsx_runtime.jsx)(VideoPlayer,{id:"",videoSource:recordingBlobUrl,videoRef,preventWideSize:!0,borderBottomRadius:"0px",setVideoDuration,setIsVideoLoading}),(0,jsx_runtime.jsxs)(DateContainer,{children:[(0,jsx_runtime.jsx)(io_index_esm.aJu,{size:16,color:palette_gray40,style:{marginRight:6}}),(0,jsx_runtime.jsx)("div",{children:(dateOfMonth=dayjs_min_default()(new Date).date(),ordinalLetters="th",1===dateOfMonth||21===dateOfMonth||31===dateOfMonth?ordinalLetters="st":2===dateOfMonth||22===dateOfMonth?ordinalLetters="nd":3!==dateOfMonth&&23!==dateOfMonth||(ordinalLetters="rd"),dayjs_min_default()(new Date).format("MMM D[".concat(ordinalLetters,"] YYYY @ h:mm A")))})]})]}),!1]}),(0,jsx_runtime.jsx)(RightSide,{children:(0,jsx_runtime.jsx)(formik_esm.l1,Preview_assign({enableReinitialize:!0,innerRef:formRef,initialValues:initialObjectState,validateOnMount:!0,onSubmit:function(){}},{children:function(_a){_a.errors,_a.isValid,_a.values,_a.setFieldValue;return(0,jsx_runtime.jsxs)(formik_esm.lV,{children:[(0,jsx_runtime.jsxs)(Preview_FormGroup,{children:[(0,jsx_runtime.jsx)(Label_Label,{text:"Title"}),!!error.title&&(0,jsx_runtime.jsx)(Label_Label,{text:error.title,color:palette_red100}),(0,jsx_runtime.jsx)(Input,Preview_assign({type:"text",onChange:function(e){return setTitle(e.target.value)},value:title},error.title&&{borderColor:palette_red100}))]}),(0,jsx_runtime.jsxs)(Preview_FormGroup,Preview_assign({marginBottom:"8px"},{children:[(0,jsx_runtime.jsx)(Label_Label,{text:"Tags"}),!!error.tags&&(0,jsx_runtime.jsx)(Label_Label,{text:error.tags,color:palette_red100}),(0,jsx_runtime.jsx)(Dropdown,{options:tags.filter((function(tag){return!tag||!selectedTags.length||!selectedTags.some((function(selectedTag){return selectedTag.value===tag.value}))})),placeholder:"Search tags or create new...",controlShouldRenderValue:!1,value:tag,onChange:function(val){return function(newTag){if(newTag&&newTag.value){var exists=tags.some((function(tag){return tag.value==newTag.value})),newTagValue=exists?newTag:{value:newTag.value,label:newTag.label,labelField:newTag.label,__isNew__:!0},isAlreadySelected=selectedTags.find((function(tag){return tag.value===newTagValue.value}));isAlreadySelected||setSelectedTags((function(prev){return Preview_spreadArray(Preview_spreadArray([],Preview_read(prev||[]),!1),[newTagValue],!1)})),exists||setTags(sortTags(Preview_spreadArray(Preview_spreadArray([],Preview_read(tags),!1),[newTagValue],!1))),setTag(newTagValue)}}(val)},isSearchable:!0,creatable:!0,extendStyles:{control:Preview_assign({},error.tags&&{borderColor:palette_red100})},customComponents:{Option:TagOption}}),(0,jsx_runtime.jsx)(TagContainer,{children:selectedTags.map((function(item,index){return(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{icon:(0,jsx_runtime.jsx)(images_HashtagIcon,{width:15,height:15}),text:item.label,onClick:function(){return function(currentTag,index){var currentSelectedTags=Preview_spreadArray([],Preview_read(selectedTags),!1);if(currentSelectedTags.splice(index,1),setSelectedTags(currentSelectedTags),setTag({value:"",label:"Search tags or create new..."}),tag.__isNew__){var currentAllTags=Preview_spreadArray([],Preview_read(tags),!1),tagIndex=tags.findIndex((function(item){return item.value===currentTag.value}));tagIndex>-1&&(currentAllTags.splice(tagIndex,1),setTags(currentAllTags))}}(item,index)},size:"small",variant:"white"},item.value)}))})]})),isAutomotiveSales&&(0,jsx_runtime.jsxs)(Preview_FormGroup,{children:[(0,jsx_runtime.jsx)(Label_Label,{text:"VIN / search vehicle"}),(0,jsx_runtime.jsx)(Dropdown,{options:vehicleOptions,value:vin,onChange:function(newVin){return setVin(newVin)},isSearchable:!0,isClearable:!!(null==vin?void 0:vin.value),creatable:!1})]}),(isAutomotiveService||isAutomotiveSales)&&(0,jsx_runtime.jsxs)(Preview_FormGroup,Preview_assign({marginBottom:"8px"},{children:[(0,jsx_runtime.jsx)(Label_Label,{text:"Video Type"}),(0,jsx_runtime.jsx)(Dropdown,{options:videoTypeOptions,value:videoType,onChange:function(newVideoType){return setVideoType(newVideoType)},isSearchable:!0,isClearable:!!(null==videoType?void 0:videoType.value),creatable:!1})]})),(0,jsx_runtime.jsx)(AttributeFields,{attributes:videoAttributes||[],initValues:initialValues,setIsSaveDisabled})]})}}))})]})]})};var Preview_templateObject_1,Preview_templateObject_2,Preview_templateObject_3,Preview_templateObject_4,Preview_templateObject_5,Preview_templateObject_6,Preview_templateObject_7,Preview_templateObject_8,Preview_templateObject_9,Preview_templateObject_10,Preview_templateObject_11,Preview_templateObject_12,Preview_templateObject_13,Preview_templateObject_14,PreviewUpload_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},PreviewUpload_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},PreviewUpload_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},INITIAL_VIDEO={id:"",title:"",recordDate:"",views:"0",videoLength:0,thumbnail:"",videoSource:"",tags:[],videoRequest:{videoRequestId:"0"},folder:"",processing:0,autogeneratedThumbnail:""};const previewUpload_PreviewUpload=function(){var videoId=(0,react_router.g)().videoId,_a=PreviewUpload_read((0,react.useState)(INITIAL_VIDEO),2),video=_a[0],setVideo=_a[1],_b=PreviewUpload_read((0,react.useState)(!0),2),videoLoading=_b[0],setVideoLoading=_b[1],_c=PreviewUpload_read((0,react.useState)(),2),onSaveVideo=_c[0],setOnSaveVideo=_c[1],_d=PreviewUpload_read((0,react.useState)(!1),2),insertAfterSave=_d[0],setInsertAfterSave=_d[1],_e=PreviewUpload_read((0,react.useState)(!1),2),isSaveDisabled=_e[0],setIsSaveDisabled=_e[1],_f=PreviewUpload_read((0,react.useState)(!1),2),uploadLoading=_f[0],setUploadLoading=_f[1];return(0,react.useEffect)((function(){video.id||PreviewUpload_awaiter(void 0,void 0,void 0,(function(){var data;return PreviewUpload_generator(this,(function(_a){switch(_a.label){case 0:return videoId?[4,getVideo(videoId)]:[2];case 1:return(data=_a.sent())&&(setVideo(data),setVideoLoading(!1)),[2]}}))}))}),[]),videoLoading?(0,jsx_runtime.jsx)(LoadingIndicator,{isLoading:videoLoading}):(0,jsx_runtime.jsxs)("div",{children:[(0,jsx_runtime.jsx)(PreviewVideoBar,{onSaveVideo:onSaveVideo||function(){},setInsertAfterSave,isSaveDisabled,uploadLoading}),(0,jsx_runtime.jsx)(Container,{children:(0,jsx_runtime.jsx)(components_Preview,{recordingBlobUrl:video.videoSource,recordDate:video.recordDate,insertAfterSave,setSaveFunction:setOnSaveVideo,setIsSaveDisabled,skipUploadProcess:!0,videoId,initialTitle:video.title,updateUploadLoading:function(val){return setUploadLoading(val)}})})]})};var layout_templateObject_1,layout_templateObject_2,layout_templateObject_3,layout_templateObject_4,layout_templateObject_5,typography_templateObject_1,typography_templateObject_2,typography_templateObject_3,typography_templateObject_4,typography_templateObject_5,typography_templateObject_6,typography_templateObject_7,typography_templateObject_8,typography_templateObject_9,typography_templateObject_10,typography_templateObject_11,typography_templateObject_12,typography_templateObject_13,typography_templateObject_14,DEVICE_KIND,VIDEO_QUALITY,layout_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},Gap=styled_components_browser_esm.Ay.div(layout_templateObject_2||(layout_templateObject_2=layout_makeTemplateObject(["\n display: flex;\n flex-wrap: ",";\n margin: ",";\n width: ",";\n height: ",";\n gap: ",";\n flex-direction: ",";\n align-items: ",";\n justify-content: ",";\n ","\n"],["\n display: flex;\n flex-wrap: ",";\n margin: ",";\n width: ",";\n height: ",";\n gap: ",";\n flex-direction: ",";\n align-items: ",";\n justify-content: ",";\n ","\n"])),(function(_a){var flexWrap=_a.flexWrap;return flexWrap||"wrap"}),(function(_a){return _a.m||"0px"}),(function(_a){return _a.width||"auto"}),(function(_a){return _a.height||"auto"}),(function(_a){return _a.gap||"16px"}),(function(_a){return _a.flexDirection||"row"}),(function(_a){return _a.alignItems||"center"}),(function(_a){return _a.justifyContent||"flex-start"}),(function(_a){return _a.center&&(0,styled_components_browser_esm.AH)(layout_templateObject_1||(layout_templateObject_1=layout_makeTemplateObject(["\n align-items: center;\n justify-content: center;\n "],["\n align-items: center;\n justify-content: center;\n "])))})),Stack=((0,styled_components_browser_esm.Ay)(Gap)(layout_templateObject_3||(layout_templateObject_3=layout_makeTemplateObject(["\n max-width: ",";\n overflow: ",";\n text-overflow: ",";\n white-space: ",";\n"],["\n max-width: ",";\n overflow: ",";\n text-overflow: ",";\n white-space: ",";\n"])),(function(_a){return _a.maxWidth}),(function(_a){return _a.overflow}),(function(_a){return _a.textOverflow}),(function(_a){return _a.whiteSpace})),styled_components_browser_esm.Ay.div(layout_templateObject_4||(layout_templateObject_4=layout_makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n margin-bottom: 26px;\n flex-wrap: wrap;\n gap: 32px;\n"],["\n display: flex;\n justify-content: space-between;\n margin-bottom: 26px;\n flex-wrap: wrap;\n gap: 32px;\n"]))),styled_components_browser_esm.Ay.div(layout_templateObject_5||(layout_templateObject_5=layout_makeTemplateObject(["\n display: flex;\n box-sizing: border-box;\n flex-wrap: ",";\n margin: ",";\n padding: ",";\n width: ",";\n max-width: ",";\n height: ",";\n gap: ",";\n flex-direction: column;\n align-items: ",";\n justify-content: ",";\n"],["\n display: flex;\n box-sizing: border-box;\n flex-wrap: ",";\n margin: ",";\n padding: ",";\n width: ",";\n max-width: ",";\n height: ",";\n gap: ",";\n flex-direction: column;\n align-items: ",";\n justify-content: ",";\n"])),(function(_a){var flexWrap=_a.flexWrap;return flexWrap||"wrap"}),(function(_a){return _a.m||"0px"}),(function(_a){return _a.p||"0px"}),(function(_a){return _a.width||"auto"}),(function(_a){return _a.maxWidth||"auto"}),(function(_a){return _a.height||"auto"}),(function(_a){return _a.gap||"16px"}),(function(_a){return _a.alignItems||"center"}),(function(_a){return _a.justifyContent||"flex-start"}))),typography_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},CommonTypography=styled_components_browser_esm.Ay.h1(typography_templateObject_2||(typography_templateObject_2=typography_makeTemplateObject(["\n margin: ",";\n\n color: ",";\n\n text-align: ",";\n\n width: ",";\n\n ","\n\n ","\n"],["\n margin: ",";\n\n color: ",";\n\n text-align: ",";\n\n width: ",";\n\n ","\n\n ","\n"])),(function(_a){return _a.m||0}),(function(_a){return _a.color||palette_gray100}),(function(_a){return _a.textAlign||"left"}),(function(_a){return _a.width||"auto"}),(function(_a){var maxWidth=_a.maxWidth;return maxWidth&&(0,styled_components_browser_esm.AH)({maxWidth})}),(function(_a){return _a.ellipsis&&(0,styled_components_browser_esm.AH)(typography_templateObject_1||(typography_templateObject_1=typography_makeTemplateObject(["\n overflow: hidden;\n text-overflow: ellipsis;\n "],["\n overflow: hidden;\n text-overflow: ellipsis;\n "])))})),CHeading=(0,styled_components_browser_esm.AH)(typography_templateObject_3||(typography_templateObject_3=typography_makeTemplateObject(["\n font-weight: 800;\n font-size: 24px;\n line-height: 40px;\n line-break: anywhere; /*** SUS-797 changes ***/\n"],["\n font-weight: 800;\n font-size: 24px;\n line-height: 40px;\n line-break: anywhere; /*** SUS-797 changes ***/\n"]))),Heading=(0,styled_components_browser_esm.Ay)(CommonTypography).attrs({as:"h1"})(typography_templateObject_4||(typography_templateObject_4=typography_makeTemplateObject(["\n ","\n"],["\n ","\n"])),CHeading),SubHeading=(0,styled_components_browser_esm.Ay)(CommonTypography).attrs({as:"h2"})(typography_templateObject_5||(typography_templateObject_5=typography_makeTemplateObject(["\n font-size: 18px;\n line-height: 24px;\n font-weight: 700;\n"],["\n font-size: 18px;\n line-height: 24px;\n font-weight: 700;\n"]))),ParagraphNormal=(0,styled_components_browser_esm.Ay)(CommonTypography).attrs({as:"p"})(typography_templateObject_6||(typography_templateObject_6=typography_makeTemplateObject(["\n font-size: 16px;\n line-height: 24px;\n font-weight: 400;\n"],["\n font-size: 16px;\n line-height: 24px;\n font-weight: 400;\n"]))),ParagraphExtraSmall=((0,styled_components_browser_esm.Ay)(CommonTypography).attrs({as:"p"})(typography_templateObject_7||(typography_templateObject_7=typography_makeTemplateObject(["\n font-size: 16px;\n line-height: 24px;\n font-weight: 700;\n"],["\n font-size: 16px;\n line-height: 24px;\n font-weight: 700;\n"]))),(0,styled_components_browser_esm.Ay)(CommonTypography).attrs({as:"p"})(typography_templateObject_8||(typography_templateObject_8=typography_makeTemplateObject(["\n font-size: 16px;\n line-height: 24px;\n font-weight: 600;\n"],["\n font-size: 16px;\n line-height: 24px;\n font-weight: 600;\n"]))),(0,styled_components_browser_esm.Ay)(CommonTypography).attrs({as:"p"})(typography_templateObject_9||(typography_templateObject_9=typography_makeTemplateObject(["\n font-size: 16px;\n line-height: 24px;\n font-weight: 500;\n"],["\n font-size: 16px;\n line-height: 24px;\n font-weight: 500;\n"]))),(0,styled_components_browser_esm.Ay)(CommonTypography).attrs({as:"p"})(typography_templateObject_10||(typography_templateObject_10=typography_makeTemplateObject(["\n font-size: 12px;\n line-height: 16px;\n font-weight: 400;\n"],["\n font-size: 12px;\n line-height: 16px;\n font-weight: 400;\n"])))),ParagraphSmall=(0,styled_components_browser_esm.Ay)(CommonTypography).attrs({as:"p"})(typography_templateObject_11||(typography_templateObject_11=typography_makeTemplateObject(["\n font-size: 14px;\n line-height: 20px;\n font-weight: 400;\n"],["\n font-size: 14px;\n line-height: 20px;\n font-weight: 400;\n"]))),ParagraphSmallBold=(0,styled_components_browser_esm.Ay)(CommonTypography).attrs({as:"p"})(typography_templateObject_12||(typography_templateObject_12=typography_makeTemplateObject(["\n font-size: 14px;\n line-height: 20px;\n font-weight: 600;\n"],["\n font-size: 14px;\n line-height: 20px;\n font-weight: 600;\n"]))),io5_index_esm=((0,styled_components_browser_esm.Ay)(CommonTypography).attrs({as:"p"})(typography_templateObject_13||(typography_templateObject_13=typography_makeTemplateObject(["\n font-size: 12px;\n line-height: 16px;\n font-weight: 500;\n"],["\n font-size: 12px;\n line-height: 16px;\n font-weight: 500;\n"]))),(0,styled_components_browser_esm.Ay)(CommonTypography).attrs({as:"label"})(typography_templateObject_14||(typography_templateObject_14=typography_makeTemplateObject(["\n font-size: 15px;\n font-weight: 500;\n line-height: 24px;\n"],["\n font-size: 15px;\n font-weight: 500;\n line-height: 24px;\n"]))),__webpack_require__("./node_modules/react-icons/io5/index.esm.js")),media_assign=function(){return media_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},media_assign.apply(this,arguments)},media_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},media_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},media_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},media_spreadArray=function(to,from,pack){if(pack||2===arguments.length)for(var ar,i=0,l=from.length;i<l;i++)!ar&&i in from||(ar||(ar=Array.prototype.slice.call(from,0,i)),ar[i]=from[i]);return to.concat(ar||Array.prototype.slice.call(from))},handleScreenCapture=function(displayMediaRef,audioSettings,videoSettings){return media_awaiter(void 0,void 0,void 0,(function(){var displayMediaStreamConstraints,displayMediaStream,audioTracks,userMediaStream,combinedStreamTracks_1,combinedStreamTracks;return media_generator(this,(function(_a){switch(_a.label){case 0:return displayMediaStreamConstraints={video:media_assign(media_assign({},videoSettings),{displaySurface:"monitor"}),audio:!0},[4,navigator.mediaDevices.getDisplayMedia(displayMediaStreamConstraints)];case 1:return displayMediaStream=_a.sent(),displayMediaRef.current=displayMediaStream,audioTracks=displayMediaStream.getAudioTracks(),audioSettings?[4,navigator.mediaDevices.getUserMedia({audio:audioSettings})]:[3,3];case 2:return userMediaStream=_a.sent(),audioTracks.length>0?(combinedStreamTracks_1=media_spreadArray(media_spreadArray([],media_read(displayMediaStream.getVideoTracks()),!1),media_read((desktopStream=displayMediaStream,micStream=userMediaStream,context=new AudioContext,desktopStreamSource=context.createMediaStreamSource(desktopStream),micStreamSource=context.createMediaStreamSource(micStream),destination=context.createMediaStreamDestination(),desktopGain=context.createGain(),micGain=context.createGain(),desktopGain.gain.value=.7,micGain.gain.value=.7,desktopStreamSource.connect(desktopGain).connect(destination),micStreamSource.connect(micGain).connect(destination),destination.stream.getTracks())),!1),[2,new MediaStream(combinedStreamTracks_1)]):(combinedStreamTracks=media_spreadArray(media_spreadArray([],media_read(displayMediaStream.getVideoTracks()),!1),media_read(userMediaStream.getAudioTracks()),!1),[2,new MediaStream(combinedStreamTracks)]);case 3:return[2,displayMediaStream]}var desktopStream,micStream,context,desktopStreamSource,micStreamSource,destination,desktopGain,micGain}))}))},enableCamera=function(cameraStreamRef,audioSettings,videoSettings){return media_awaiter(void 0,void 0,void 0,(function(){var cameraStream;return media_generator(this,(function(_a){switch(_a.label){case 0:return[4,navigator.mediaDevices.getUserMedia({audio:audioSettings,video:media_assign(media_assign({},videoSettings),{deviceId:{exact:videoSettings.deviceId}})})];case 1:return cameraStream=_a.sent(),cameraStreamRef.current=cameraStream,[2,cameraStreamRef.current]}}))}))},getScreenAndCameraStreams=function(displayMediaRef,cameraStreamRef,audioSettings,videoSettings,videoCameraPipRef){return media_awaiter(void 0,void 0,void 0,(function(){var displayMediaStreamConstraints,userMediaStream,displayMediaStream,combinedStream;return media_generator(this,(function(_a){switch(_a.label){case 0:return displayMediaStreamConstraints={video:{displaySurface:"monitor",logicalSurface:!0,cursor:"always"}},[4,navigator.mediaDevices.getUserMedia({audio:audioSettings,video:videoSettings})];case 1:return userMediaStream=_a.sent(),videoCameraPipRef.current?(videoCameraPipRef.current.srcObject=userMediaStream,videoCameraPipRef.current.muted=!0,[4,videoCameraPipRef.current.play()]):[3,3];case 2:_a.sent(),videoCameraPipRef.current.requestPictureInPicture(),_a.label=3;case 3:return[4,navigator.mediaDevices.getDisplayMedia(displayMediaStreamConstraints)];case 4:return displayMediaStream=_a.sent(),displayMediaRef.current=displayMediaStream,cameraStreamRef.current=userMediaStream,combinedStream=new MediaStream,userMediaStream.getAudioTracks().forEach((function(track){combinedStream.addTrack(track)})),displayMediaStream.getVideoTracks().forEach((function(track){combinedStream.addTrack(track)})),[2,combinedStream]}}))}))},getSafariScreenAndCameraStreams=function(displayMediaRef,cameraStreamRef,audioSettings,videoSettings,videoCameraPipRef){return media_awaiter(void 0,void 0,void 0,(function(){var displayMediaStreamConstraints,displayMediaStream,userMediaStream,combinedStream;return media_generator(this,(function(_a){switch(_a.label){case 0:return displayMediaStreamConstraints={video:{displaySurface:"browser",logicalSurface:!0,cursor:"always"}},[4,navigator.mediaDevices.getDisplayMedia(displayMediaStreamConstraints)];case 1:return displayMediaStream=_a.sent(),[4,navigator.mediaDevices.getUserMedia({audio:audioSettings,video:videoSettings})];case 2:return userMediaStream=_a.sent(),displayMediaRef.current=displayMediaStream,cameraStreamRef.current=userMediaStream,combinedStream=new MediaStream,userMediaStream.getAudioTracks().forEach((function(track){combinedStream.addTrack(track)})),displayMediaStream.getVideoTracks().forEach((function(track){combinedStream.addTrack(track)})),videoCameraPipRef.current?(videoCameraPipRef.current.srcObject=userMediaStream,videoCameraPipRef.current.muted=!0,[4,videoCameraPipRef.current.play()]):[3,4];case 3:_a.sent(),_a.label=4;case 4:return[2,combinedStream]}}))}))},functions_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},functions_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}};!function(DEVICE_KIND){DEVICE_KIND.AUDIO_INPUT="audioinput",DEVICE_KIND.VIDEO_INPUT="videoinput"}(DEVICE_KIND||(DEVICE_KIND={})),function(VIDEO_QUALITY){VIDEO_QUALITY.LOW="low",VIDEO_QUALITY.STANDARD="standard",VIDEO_QUALITY.HIGH="high"}(VIDEO_QUALITY||(VIDEO_QUALITY={}));var ModalRecordingVideoSettings_templateObject_1,ModalRecordingVideoSettings_templateObject_2,ModalRecordingVideoSettings_templateObject_3,ModalRecordingVideoSettings_templateObject_4,ModalRecordingVideoSettings_templateObject_5,ModalRecordingVideoSettings_templateObject_6,ModalRecordingVideoSettings_templateObject_7,ModalRecordingVideoSettings_templateObject_8,ModalRecordingVideoSettings_templateObject_9,ModalRecordingVideoSettings_templateObject_10,RECORDING_STATUS,RECORD_LOADER_STATUS,provider_assign=function(){return provider_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},provider_assign.apply(this,arguments)},provider_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},provider_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},provider_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},provider_spreadArray=function(to,from,pack){if(pack||2===arguments.length)for(var ar,i=0,l=from.length;i<l;i++)!ar&&i in from||(ar||(ar=Array.prototype.slice.call(from,0,i)),ar[i]=from[i]);return to.concat(ar||Array.prototype.slice.call(from))},RecordSettingsContext=(0,react.createContext)({}),initialSettings={audioSource:null,videoSource:null,videoQuality:VIDEO_QUALITY.STANDARD},RecordSettingsProvider=function(_a){var children=_a.children,noAudio={label:"No Audio",value:!1},noVideo={label:"No Video",value:!1},_b=provider_read((0,react.useState)({audioSource:[],videoSource:[]}),2),recorderSettings=_b[0],setRecorderSettings=_b[1],_c=provider_read((0,react.useState)(initialSettings),2),userSettings=_c[0],setUserSettings=_c[1],_d=provider_read((0,react.useState)(null),2),recordingError=_d[0],setRecordingError=_d[1],_e=provider_read((0,react.useState)(initialSettings),2),initialUserSettings=_e[0],setInitialUserSettings=_e[1],updateErrorMessage=function(){setRecordingError("You do not have the necessary permissions to access this feature. Please check your browser permissions.")},fetchDevices=function(){return provider_awaiter(void 0,void 0,void 0,(function(){var devicesResponse,devices,newConfig,defaultAudio,defaultVideo,initialUserSettings_1,_a;return provider_generator(this,(function(_b){switch(_b.label){case 0:return _b.trys.push([0,2,,3]),[4,new Promise((function(resolve,reject){return functions_awaiter(void 0,void 0,void 0,(function(){var devices,s,e_1;return functions_generator(this,(function(_a){switch(_a.label){case 0:return[4,navigator.mediaDevices.enumerateDevices()];case 1:if(devices=_a.sent(),!(0,lodash.some)(devices,{label:""}))return[3,6];_a.label=2;case 2:return _a.trys.push([2,5,,6]),[4,navigator.mediaDevices.getUserMedia({audio:!0,video:!0})];case 3:return s=_a.sent(),[4,navigator.mediaDevices.enumerateDevices()];case 4:return devices=_a.sent(),s.getTracks().forEach((function(t){return t.stop()})),[3,6];case 5:return e_1=_a.sent(),reject(e_1),[3,6];case 6:return resolve(devices),[2]}}))}))}))];case 1:return devicesResponse=_b.sent(),devices=Array.isArray(devicesResponse)?devicesResponse:[],newConfig=devices.reduce((function(config,device){return device.kind===DEVICE_KIND.AUDIO_INPUT?config.audio.push({label:device.label,value:device.deviceId}):device.kind===DEVICE_KIND.VIDEO_INPUT&&config.video.push({label:device.label,value:device.deviceId}),config}),{audio:[],video:[]}),defaultAudio=newConfig.audio.find((function(item){return"default"===item.value}))||noAudio,defaultVideo=(null===(_a=newConfig.video)||void 0===_a?void 0:_a[0])||noVideo,initialUserSettings_1=function(defaultAudio,defaultVideo){try{var item=localStorage.getItem("record_settings");return item?JSON.parse(item):{videoQuality:VIDEO_QUALITY.STANDARD,videoSource:defaultVideo,audioSource:defaultAudio}}catch(error){return console.error("Error parsing user settings from localStorage:",error),{videoQuality:VIDEO_QUALITY.STANDARD,videoSource:defaultVideo,audioSource:defaultAudio}}}(defaultAudio,defaultVideo),setRecorderSettings({audioSource:provider_spreadArray(provider_spreadArray([],provider_read(newConfig.audio),!1),[noAudio],!1),videoSource:newConfig.video}),setUserSettings(initialUserSettings_1),setInitialUserSettings(initialUserSettings_1),setRecordingError(null),[3,3];case 2:return _b.sent(),updateErrorMessage(),setRecorderSettings({audioSource:[noAudio],videoSource:[noVideo]}),[3,3];case 3:return[2]}}))}))};return(0,react.useEffect)((function(){var _a,handleDeviceChange=function(){fetchDevices()};if(void 0!==(null===(_a=null===navigator||void 0===navigator?void 0:navigator.mediaDevices)||void 0===_a?void 0:_a.ondevicechange))return navigator.mediaDevices.addEventListener("devicechange",handleDeviceChange),fetchDevices(),function(){navigator.mediaDevices.removeEventListener("devicechange",handleDeviceChange)};console.log("The navigator.mediaDevices API is not supported in this browser."),handleDeviceChange()}),[]),(0,jsx_runtime.jsx)(RecordSettingsContext.Provider,provider_assign({value:{recorderSettings,userSettings,setUserSettings,recordingError,updateErrorMessage,initialUserSettings,onSubmitModalHandler:function(){setInitialUserSettings(userSettings),localStorage.setItem("record_settings",JSON.stringify(userSettings))}}},{children}))},useRecordSettings=function(){var context=(0,react.useContext)(RecordSettingsContext);if(void 0===context)throw new Error("useRecordSettings must be used within a RecordSettingsProvider");return context},ModalRecordingVideoSettings_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},ModalRecordingVideoSettings_assign=function(){return ModalRecordingVideoSettings_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},ModalRecordingVideoSettings_assign.apply(this,arguments)},LabelContainerWrapper=styled_components_browser_esm.Ay.div(ModalRecordingVideoSettings_templateObject_1||(ModalRecordingVideoSettings_templateObject_1=ModalRecordingVideoSettings_makeTemplateObject(["\n display: flex;\n width: 90%;\n align-items: center;\n padding: 0 12px;\n height: 38px;\n"],["\n display: flex;\n width: 90%;\n align-items: center;\n padding: 0 12px;\n height: 38px;\n"]))),LabelContainer=styled_components_browser_esm.Ay.div(ModalRecordingVideoSettings_templateObject_2||(ModalRecordingVideoSettings_templateObject_2=ModalRecordingVideoSettings_makeTemplateObject(["\n text-wrap: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: block;\n "," {\n width: 250px;\n }\n"],["\n text-wrap: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: block;\n "," {\n width: 250px;\n }\n"])),mediaQueryMinWidth.mb),ModalRecordingVideoSettings_RadioLabel=styled_components_browser_esm.Ay.label(ModalRecordingVideoSettings_templateObject_3||(ModalRecordingVideoSettings_templateObject_3=ModalRecordingVideoSettings_makeTemplateObject(["\n display: flex;\n gap: 4px;\n color: ",";\n cursor: pointer;\n"],["\n display: flex;\n gap: 4px;\n color: ",";\n cursor: pointer;\n"])),palette_black_1_100),ModalRecordingVideoSettings_ModalItem=styled_components_browser_esm.Ay.div(ModalRecordingVideoSettings_templateObject_5||(ModalRecordingVideoSettings_templateObject_5=ModalRecordingVideoSettings_makeTemplateObject(["\n box-sizing: border-box;\n width: 592px;\n padding: 32px;\n background-color: ",";\n\n ","\n"],["\n box-sizing: border-box;\n width: 592px;\n padding: 32px;\n background-color: ",";\n\n ","\n"])),palette_white,(function(_a){return _a.theme.containerWidth<=screenSizes_xs&&(0,styled_components_browser_esm.AH)(ModalRecordingVideoSettings_templateObject_4||(ModalRecordingVideoSettings_templateObject_4=ModalRecordingVideoSettings_makeTemplateObject(["\n width: 100%;\n "],["\n width: 100%;\n "])))})),ModalRecordingVideoSettings_Header=styled_components_browser_esm.Ay.div(ModalRecordingVideoSettings_templateObject_6||(ModalRecordingVideoSettings_templateObject_6=ModalRecordingVideoSettings_makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 15px;\n"],["\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 15px;\n"]))),ModalRecordingVideoSettings_Title=styled_components_browser_esm.Ay.div(ModalRecordingVideoSettings_templateObject_7||(ModalRecordingVideoSettings_templateObject_7=ModalRecordingVideoSettings_makeTemplateObject(["\n color: ",";\n font-weight: bold;\n font-size: 18px;\n line-height: 24px;\n"],["\n color: ",";\n font-weight: bold;\n font-size: 18px;\n line-height: 24px;\n"])),palette_gray100),ModalRecordingVideoSettings_CloseButtonWrapper=styled_components_browser_esm.Ay.label(ModalRecordingVideoSettings_templateObject_8||(ModalRecordingVideoSettings_templateObject_8=ModalRecordingVideoSettings_makeTemplateObject(["\n display: flex;\n align-items: center;\n margin: 0;\n padding: 0;\n color: ",";\n &:hover {\n cursor: pointer;\n }\n"],["\n display: flex;\n align-items: center;\n margin: 0;\n padding: 0;\n color: ",";\n &:hover {\n cursor: pointer;\n }\n"])),palette_themeDark50Percent),CustomValueContainer=(styled_components_browser_esm.Ay.div(ModalRecordingVideoSettings_templateObject_10||(ModalRecordingVideoSettings_templateObject_10=ModalRecordingVideoSettings_makeTemplateObject(["\n display: flex;\n flex-direction: row;\n width: 500px;\n max-width: 528px;\n height: 80%;\n margin-top: 24px;\n margin-bottom: 24px;\n padding: 20px 16px;\n border-radius: 5px;\n background-color: ",";\n\n ","\n"],["\n display: flex;\n flex-direction: row;\n width: 500px;\n max-width: 528px;\n height: 80%;\n margin-top: 24px;\n margin-bottom: 24px;\n padding: 20px 16px;\n border-radius: 5px;\n background-color: ",";\n\n ","\n"])),palette_secondaryButtonBlueBg,(function(_a){return _a.theme.containerWidth<=screenSizes_xs&&(0,styled_components_browser_esm.AH)(ModalRecordingVideoSettings_templateObject_9||(ModalRecordingVideoSettings_templateObject_9=ModalRecordingVideoSettings_makeTemplateObject(["\n width: 100%;\n "],["\n width: 100%;\n "])))})),function(_a){var children=_a.children;return(0,jsx_runtime.jsx)(LabelContainerWrapper,{children:(0,jsx_runtime.jsx)(LabelContainer,{children})})}),ModalRecordingVideosSettings=function(_a){var handleModalClose=_a.handleModalClose,_b=(0,styled_components_browser_esm.DP)(),colors=_b.colors,isCdkEnviroment=_b.isCdkEnviroment,_c=useRecordSettings(),recorderSettings=_c.recorderSettings,setUserSettings=_c.setUserSettings,userSettings=_c.userSettings,onSubmitModalHandler=_c.onSubmitModalHandler,initialUserSettings=_c.initialUserSettings,onVideoQualityHandler=function(videoQuality){return setUserSettings(ModalRecordingVideoSettings_assign(ModalRecordingVideoSettings_assign({},userSettings),{videoQuality}))};return(0,jsx_runtime.jsx)(Modal_Modal,{children:(0,jsx_runtime.jsxs)(ModalRecordingVideoSettings_ModalItem,{children:[(0,jsx_runtime.jsxs)(ModalRecordingVideoSettings_Header,{children:[(0,jsx_runtime.jsx)(ModalRecordingVideoSettings_Title,{children:"Recording Settings"}),(0,jsx_runtime.jsx)(ModalRecordingVideoSettings_CloseButtonWrapper,{children:(0,jsx_runtime.jsx)(images_CloseIcon,{width:"24px",height:"24px",onClick:handleModalClose})})]}),(0,jsx_runtime.jsxs)(Gap,{children:[!!recorderSettings.videoSource.length&&(0,jsx_runtime.jsxs)(Stack,ModalRecordingVideoSettings_assign({width:"100%",alignItems:"start",gap:"4px"},{children:[(0,jsx_runtime.jsx)(ParagraphSmall,ModalRecordingVideoSettings_assign({color:colors.neutral[60]},{children:"Video source"})),(0,jsx_runtime.jsx)(Dropdown,{creatable:!1,value:userSettings.videoSource,placeholder:"No settings",options:recorderSettings.videoSource,onChange:function(value){return setUserSettings(ModalRecordingVideoSettings_assign(ModalRecordingVideoSettings_assign({},userSettings),{videoSource:value}))},height:40,extendStyles:{container:{width:"100%"}},customComponents:{ValueContainer:CustomValueContainer},isSearchable:!1})]})),!!recorderSettings.audioSource.length&&(0,jsx_runtime.jsxs)(Stack,ModalRecordingVideoSettings_assign({width:"100%",alignItems:"start",gap:"4px"},{children:[(0,jsx_runtime.jsx)(ParagraphSmall,ModalRecordingVideoSettings_assign({color:colors.neutral[60]},{children:"Audio source"})),(0,jsx_runtime.jsx)(Dropdown,{creatable:!1,placeholder:"No settings",value:userSettings.audioSource,options:recorderSettings.audioSource,onChange:function(value){return setUserSettings(ModalRecordingVideoSettings_assign(ModalRecordingVideoSettings_assign({},userSettings),{audioSource:value}))},extendStyles:{container:{width:"100%"}},height:40,customComponents:{ValueContainer:CustomValueContainer},isSearchable:!1})]})),(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(ParagraphSmall,ModalRecordingVideoSettings_assign({color:colors.neutral[60]},{children:"Video quality"})),(0,jsx_runtime.jsxs)(Stack,ModalRecordingVideoSettings_assign({alignItems:"flex-start",width:"100%",gap:"8px",m:"0 0 16px 0"},{children:[(0,jsx_runtime.jsxs)(Gap,ModalRecordingVideoSettings_assign({width:"100%",justifyContent:"space-between"},{children:[(0,jsx_runtime.jsxs)(ModalRecordingVideoSettings_RadioLabel,{children:[(0,jsx_runtime.jsx)(RadioInput_RadioInput,{checked:userSettings.videoQuality===VIDEO_QUALITY.LOW,name:"quality",value:VIDEO_QUALITY.LOW,onClick:function(){return onVideoQualityHandler(VIDEO_QUALITY.LOW)},onChange:function(){return onVideoQualityHandler(VIDEO_QUALITY.LOW)}}),(0,jsx_runtime.jsx)(ParagraphNormal,ModalRecordingVideoSettings_assign({color:colors.neutral[100]},{children:"Low"}))]}),(0,jsx_runtime.jsx)(ParagraphSmall,{children:"Faster Upload"})]})),(0,jsx_runtime.jsxs)(Gap,ModalRecordingVideoSettings_assign({width:"100%",justifyContent:"space-between"},{children:[(0,jsx_runtime.jsxs)(ModalRecordingVideoSettings_RadioLabel,{children:[(0,jsx_runtime.jsx)(RadioInput_RadioInput,{checked:userSettings.videoQuality===VIDEO_QUALITY.STANDARD,name:"quality",value:VIDEO_QUALITY.STANDARD,onClick:function(){return onVideoQualityHandler(VIDEO_QUALITY.STANDARD)},onChange:function(){return onVideoQualityHandler(VIDEO_QUALITY.STANDARD)}}),(0,jsx_runtime.jsxs)(ParagraphNormal,ModalRecordingVideoSettings_assign({color:colors.neutral[100]},{children:["Standard"," "]}))]}),(0,jsx_runtime.jsx)(ParagraphSmall,{children:"Fast Upload"})]})),(0,jsx_runtime.jsxs)(Gap,ModalRecordingVideoSettings_assign({width:"100%",justifyContent:"space-between"},{children:[(0,jsx_runtime.jsxs)(ModalRecordingVideoSettings_RadioLabel,{children:[(0,jsx_runtime.jsx)(RadioInput_RadioInput,{checked:userSettings.videoQuality===VIDEO_QUALITY.HIGH,name:"quality",value:VIDEO_QUALITY.HIGH,onClick:function(){return onVideoQualityHandler(VIDEO_QUALITY.HIGH)},onChange:function(){return onVideoQualityHandler(VIDEO_QUALITY.HIGH)}}),(0,jsx_runtime.jsx)(ParagraphNormal,ModalRecordingVideoSettings_assign({color:colors.neutral[100]},{children:"High"}))]}),(0,jsx_runtime.jsx)(ParagraphSmall,{children:"Slow Upload"})]}))]}))]})]}),(0,jsx_runtime.jsxs)(Gap,ModalRecordingVideoSettings_assign({width:"100%",justifyContent:"flex-end"},{children:[(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{variant:isCdkEnviroment?"text":"secondary",text:"Cancel",onClick:function(){setUserSettings(initialUserSettings),handleModalClose()}}),(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{text:"Save",onClick:function(){onSubmitModalHandler(),handleModalClose()}})]}))]})})};!function(RECORDING_STATUS){RECORDING_STATUS.IDLE="IDLE",RECORDING_STATUS.RECORDING="RECORDING",RECORDING_STATUS.PAUSED="PAUSED",RECORDING_STATUS.CAMERA_READY="CAMERA_READY",RECORDING_STATUS.COUNTDOWN="COUNTDOWN",RECORDING_STATUS.DONE="DONE"}(RECORDING_STATUS||(RECORDING_STATUS={})),function(RECORD_LOADER_STATUS){RECORD_LOADER_STATUS[RECORD_LOADER_STATUS.UPLOADING=1]="UPLOADING",RECORD_LOADER_STATUS[RECORD_LOADER_STATUS.CREATE=2]="CREATE",RECORD_LOADER_STATUS[RECORD_LOADER_STATUS.ENCODE=3]="ENCODE",RECORD_LOADER_STATUS[RECORD_LOADER_STATUS.UPLOAD_COMPLETED=4]="UPLOAD_COMPLETED",RECORD_LOADER_STATUS[RECORD_LOADER_STATUS.ERROR=5]="ERROR"}(RECORD_LOADER_STATUS||(RECORD_LOADER_STATUS={}));var Countdown_templateObject_1,Countdown_templateObject_2,RecorderBody_templateObject_1,RecorderBody_templateObject_2,RecorderBody_templateObject_3,RecorderBody_templateObject_4,RecorderBody_templateObject_5,statuses_WAITING="waiting",statuses_UPLOADING="uploading",statuses_CANCELING="canceling",statuses_CANCELED="canceled",statuses_FINISHED="finished",statuses_GENERATING_PREVIEW="preview",RecordingHeadingWithRouteGuard_assign=function(){return RecordingHeadingWithRouteGuard_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},RecordingHeadingWithRouteGuard_assign.apply(this,arguments)},RecordingHeaderWithRouteGuard=function(_a){var status=_a.status,handleGoToRecordHome=_a.handleGoToRecordHome,teleprompterActions=_a.teleprompterActions,shouldHideChangeRecordingOptionBtn=status===RECORDING_STATUS.RECORDING||status===RECORDING_STATUS.PAUSED,isMobileDevice=checkIfMobileDevice();return(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(components_RouteLeavingGuard,{when:!0,stay:!0,onConfirm:function(){},navigate:handleGoToRecordHome,shouldBlockNavigation:function(){return status===RECORDING_STATUS.RECORDING},title:"Leave without saving the recording?",text:"Your recording will not be saved. This action can’t be undone.",confirmButtonText:"Continue",discardButtonText:"Leave"}),(0,jsx_runtime.jsxs)(Gap,RecordingHeadingWithRouteGuard_assign({m:isMobileDevice?"12px 0 12px 0":"72px 0 32px 0",width:"100%",justifyContent:"space-between"},{children:[shouldHideChangeRecordingOptionBtn?(0,jsx_runtime.jsx)("div",{style:{height:40}}):!isMobileDevice&&(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{icon:(0,jsx_runtime.jsx)(md_index_esm.KQO,{size:18}),variant:"secondary",text:"Change recording option",onClick:handleGoToRecordHome,disabled:status===RECORDING_STATUS.COUNTDOWN}),teleprompterActions]}))]})},Countdown_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},Countdown_assign=function(){return Countdown_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},Countdown_assign.apply(this,arguments)},Countdown_Wrapper=styled_components_browser_esm.Ay.div(Countdown_templateObject_1||(Countdown_templateObject_1=Countdown_makeTemplateObject(["\n display: ",";\n flex-direction: row;\n justify-content: center;\n align-items: center;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n z-index: 3;\n"],["\n display: ",";\n flex-direction: row;\n justify-content: center;\n align-items: center;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n z-index: 3;\n"])),(function(props){return props.hide?"none":"flex"})),Counter=styled_components_browser_esm.Ay.div(Countdown_templateObject_2||(Countdown_templateObject_2=Countdown_makeTemplateObject(["\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n color: #fff;\n font-size: 136px;\n font-weight: 900;\n background-color: ",";\n width: 100%;\n height: 100%;\n opacity: ",";\n transition: opacity 0.2s ease-in;\n border-radius: ",";\n &:hover {\n cursor: pointer;\n }\n"],["\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n color: #fff;\n font-size: 136px;\n font-weight: 900;\n background-color: ",";\n width: 100%;\n height: 100%;\n opacity: ",";\n transition: opacity 0.2s ease-in;\n border-radius: ",";\n &:hover {\n cursor: pointer;\n }\n"])),(function(props){return props.color||props.theme.colors.primary[100]}),(function(props){return props.willStart?.5:0}),(function(props){return props.isFreemium?"24px":"8px"})),CountDown=function(_a){var counter=_a.counter,willStart=_a.willStart,onClick=_a.onClick,hide=_a.hide,isFreemium=_a.isFreemium,colors=(0,styled_components_browser_esm.DP)().colors,colorMap={3:colors.primary[80],2:colors.primary[40],1:colors.primary[20]};return(0,jsx_runtime.jsx)(Countdown_Wrapper,Countdown_assign({hide},{children:(0,jsx_runtime.jsx)(Counter,Countdown_assign({counter,willStart,onClick,isFreemium,color:colorMap[counter]},{children:counter}))}))},RecorderBody_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},RecorderBodyWrapper=styled_components_browser_esm.Ay.div(RecorderBody_templateObject_2||(RecorderBody_templateObject_2=RecorderBody_makeTemplateObject(["\n width: 770px;\n height: 440px;\n position: relative;\n border-radius: 8px;\n\n ","\n"],["\n width: 770px;\n height: 440px;\n position: relative;\n border-radius: 8px;\n\n ","\n"])),(function(_a){var theme=_a.theme;return theme.containerWidth<screenSizes_sm&&(0,styled_components_browser_esm.AH)(RecorderBody_templateObject_1||(RecorderBody_templateObject_1=RecorderBody_makeTemplateObject(["\n height: 100%;\n width: auto;\n background: ",";\n max-height: 440px;\n "],["\n height: 100%;\n width: auto;\n background: ",";\n max-height: 440px;\n "])),theme.colors.neutral[40])})),VideoStyles=styled_components_browser_esm.Ay.video(RecorderBody_templateObject_3||(RecorderBody_templateObject_3=RecorderBody_makeTemplateObject(["\n width: 100%;\n height: 100%;\n pointer-events: none;\n border-radius: 8px;\n max-height: 440px;\n min-height: 440px;\n"],["\n width: 100%;\n height: 100%;\n pointer-events: none;\n border-radius: 8px;\n max-height: 440px;\n min-height: 440px;\n"]))),CanvasStyles=styled_components_browser_esm.Ay.canvas(RecorderBody_templateObject_5||(RecorderBody_templateObject_5=RecorderBody_makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n border-radius: 8px;\n ","\n"],["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n border-radius: 8px;\n ","\n"])),(function(_a){return _a.theme.containerWidth<screenSizes_sm&&(0,styled_components_browser_esm.AH)(RecorderBody_templateObject_4||(RecorderBody_templateObject_4=RecorderBody_makeTemplateObject(["\n max-height: 440px;\n min-height: 440px;\n "],["\n max-height: 440px;\n min-height: 440px;\n "])))})),RecorderBody=function(_a){var countdown=_a.countdown,videoRef=_a.videoRef,teleprompter=_a.teleprompter,status=_a.status,canvasRef=_a.canvasRef,toggleCamera=_a.toggleCamera,isMobileDevice=checkIfMobileDevice(),showCamera=status===RECORDING_STATUS.CAMERA_READY||status===RECORDING_STATUS.IDLE;return(0,jsx_runtime.jsxs)(RecorderBodyWrapper,{children:[teleprompter,(0,jsx_runtime.jsx)(CountDown,{counter:countdown,willStart:countdown>0,hide:!countdown||status===RECORDING_STATUS.CAMERA_READY}),(0,jsx_runtime.jsx)(VideoStyles,{ref:videoRef,controls:!1,autoPlay:!0,playsInline:!0}),canvasRef&&(0,jsx_runtime.jsx)(CanvasStyles,{ref:canvasRef}),isMobileDevice&&showCamera&&(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{variant:"secondary",icon:(0,jsx_runtime.jsx)(md_index_esm.LW4,{size:20}),style:{position:"absolute",right:16,bottom:16},onClick:toggleCamera})]})},RecordRTC=__webpack_require__("./node_modules/recordrtc/RecordRTC.js"),RecordRTC_default=__webpack_require__.n(RecordRTC),useRecorderCountdown_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},useRecordingTime_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},useRecorder_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},useRecorder_BITRATES={low:1e6,standard:25e5,high:5e6};const recordv1_useRecorder=function(_a){var screenStream=_a.screenStream,stopAllStreams=_a.stopAllStreams,videoRef=_a.videoRef,canvasRef=_a.canvasRef,isSegmenterActive=_a.isSegmenterActive,onStartUpladingVoiceOverHandler=_a.onStartUpladingVoiceOverHandler,shouldStartCountdown=_a.shouldStartCountdown,handleGoToRecordHome=_a.handleGoToRecordHome,isCameraToggled=_a.isCameraToggled,toast=useToastNotifications().toast,_b=function(initialCount){var _a=useRecorderCountdown_read((0,react.useState)(initialCount),2),countdown=_a[0],setCountdown=_a[1],countdownIntervalRef=(0,react.useRef)(null);return(0,react.useEffect)((function(){return function(){countdownIntervalRef.current&&clearInterval(countdownIntervalRef.current)}}),[]),{countdown,startRecordingCountdown:function(){setCountdown(initialCount),countdownIntervalRef.current=setInterval((function(){setCountdown((function(prevCount){return prevCount<=1?(clearInterval(countdownIntervalRef.current),countdownIntervalRef.current=null,0):prevCount-1}))}),1e3)},stopRecordingCountdown:function(){countdownIntervalRef.current&&(clearInterval(countdownIntervalRef.current),countdownIntervalRef.current=null),setCountdown(initialCount)}}}(3),countdown=_b.countdown,startRecordingCountdown=_b.startRecordingCountdown,stopRecordingCountdown=_b.stopRecordingCountdown,_c=function(){var _a=useRecordingTime_read((0,react.useState)(0),2),timeInSeconds=_a[0],setTimeInSeconds=_a[1],recordingIntervalRef=(0,react.useRef)(null);return(0,react.useEffect)((function(){return function(){recordingIntervalRef.current&&clearInterval(recordingIntervalRef.current)}}),[]),{timeInSeconds,startRecordingTime:function(){recordingIntervalRef.current=setInterval((function(){setTimeInSeconds((function(prevTime){return prevTime+1}))}),1e3)},stopRecordingTime:function(){recordingIntervalRef.current&&clearInterval(recordingIntervalRef.current)}}}(),startRecordingTime=_c.startRecordingTime,stopRecordingTime=_c.stopRecordingTime,timeInSeconds=_c.timeInSeconds,userSettings=useRecordSettings().userSettings,recorderRef=(0,react.useRef)(null),_d=useRecorder_read((0,react.useState)(RECORDING_STATUS.IDLE),2),status=_d[0],setStatus=_d[1],_e=useRecorder_read((0,react.useState)(null),2),recordedBlob=_e[0],setRecordedBlob=_e[1],videoBitsPerSecond=(null==useRecorder_BITRATES?void 0:useRecorder_BITRATES[null==userSettings?void 0:userSettings.videoQuality])||useRecorder_BITRATES.low;(0,react.useEffect)((function(){return function(){null==stopAllStreams||stopAllStreams(),recorderRef.current&&recorderRef.current.stopRecording((function(){recorderRef.current.destroy(),recorderRef.current=null}))}}),[]),(0,react.useEffect)((function(){videoRef.current&&screenStream&&(videoRef.current.srcObject=screenStream,videoRef.current.muted=!0,videoRef.current.volume=0,videoRef.current.onloadedmetadata=function(){setStatus(RECORDING_STATUS.CAMERA_READY),shouldStartCountdown&&startCountDown()})}),[screenStream]),(0,react.useEffect)((function(){videoRef.current&&screenStream&&(screenStream.getVideoTracks()[0].onended=function(){return status===RECORDING_STATUS.RECORDING||status===RECORDING_STATUS.PAUSED?stopRecording():isCameraToggled?setStatus(RECORDING_STATUS.IDLE):void(null==handleGoToRecordHome||handleGoToRecordHome())})}),[screenStream,status]),(0,react.useEffect)((function(){0===countdown&&status===RECORDING_STATUS.COUNTDOWN&&startRecording()}),[countdown,status]);var getCombinedStream=function(screenStream){var _a;if(isSegmenterActive){var canvasStream=null===(_a=null==canvasRef?void 0:canvasRef.current)||void 0===_a?void 0:_a.captureStream(30);return canvasStream?function(videoStream,audioStream){var combinedStream=new MediaStream;return videoStream.getVideoTracks().forEach((function(track){return combinedStream.addTrack(track)})),audioStream.getAudioTracks().forEach((function(track){return combinedStream.addTrack(track)})),combinedStream}(canvasStream,screenStream):screenStream}return screenStream},mimeType=MediaRecorder.isTypeSupported("video/webm")?"video/webm":"video/mp4",startRecording=function(){if(screenStream){var currentStream=getCombinedStream(screenStream);try{recorderRef.current=new(RecordRTC_default())(currentStream,{videoBitsPerSecond,type:"video",mimeType,recorderType:RecordRTC.MediaStreamRecorder}),recorderRef.current.startRecording(),setStatus(RECORDING_STATUS.RECORDING),startRecordingTime()}catch(error){console.error("Failed to start recording:",error),toast({message:"Failed to start recording"})}}else toast({message:"Something went wrong while trimming the video, try again later!"})},stopRecording=function(){recorderRef.current&&(recorderRef.current.stopRecording((function(){setRecordedBlob(recorderRef.current.getBlob()),null==stopAllStreams||stopAllStreams(),setStatus(RECORDING_STATUS.DONE),null==onStartUpladingVoiceOverHandler||onStartUpladingVoiceOverHandler(recorderRef.current.getBlob()),recorderRef.current.destroy(),recorderRef.current=null})),stopRecordingTime())},startCountDown=function(){setStatus(RECORDING_STATUS.COUNTDOWN),startRecordingCountdown()};return{startRecording,stopRecording,pauseRecording:function(){recorderRef.current&&status===RECORDING_STATUS.RECORDING?(recorderRef.current.pauseRecording(),setStatus(RECORDING_STATUS.PAUSED),stopRecordingTime()):recorderRef.current&&status===RECORDING_STATUS.PAUSED&&(recorderRef.current.resumeRecording(),setStatus(RECORDING_STATUS.RECORDING),startRecordingTime())},startCountDown,stopCountDown:function(){setStatus(RECORDING_STATUS.CAMERA_READY),stopRecordingCountdown()},setStatus,status,recordedBlob,countdown,timeInSeconds}};var VideoRecorderActions_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},VideoRecorderActions_assign=function(){return VideoRecorderActions_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},VideoRecorderActions_assign.apply(this,arguments)},RecordingFlowWrapper=(0,styled_components_browser_esm.Ay)(Gap)(VideoRecorderActions_templateObject_2||(VideoRecorderActions_templateObject_2=VideoRecorderActions_makeTemplateObject(["\n ","\n"],["\n ","\n"])),(function(_a){return _a.theme.containerWidth<screenSizes_sm&&(0,styled_components_browser_esm.AH)(VideoRecorderActions_templateObject_1||(VideoRecorderActions_templateObject_1=VideoRecorderActions_makeTemplateObject(["\n width: 100%;\n justify-content: space-between;\n "],["\n width: 100%;\n justify-content: space-between;\n "])))})),FinishBtnWrapper=(0,styled_components_browser_esm.Ay)(Gap)(VideoRecorderActions_templateObject_4||(VideoRecorderActions_templateObject_4=VideoRecorderActions_makeTemplateObject(["\n position: absolute;\n width: 100%;\n\n ","\n"],["\n position: absolute;\n width: 100%;\n\n ","\n"])),(function(_a){return _a.theme.containerWidth<screenSizes_sm&&(0,styled_components_browser_esm.AH)(VideoRecorderActions_templateObject_3||(VideoRecorderActions_templateObject_3=VideoRecorderActions_makeTemplateObject(["\n position: initial;\n width: unset;\n "],["\n position: initial;\n width: unset;\n "])))}));const recordv1_VideoRecorderActions=function(_a){var status=_a.status,timeInSeconds=_a.timeInSeconds,startCountDown=_a.startCountDown,stopCountDown=_a.stopCountDown,pauseRecording=_a.pauseRecording,stopRecording=_a.stopRecording,isLoadingVB=_a.isLoadingVB,isCdkEnviroment=(0,styled_components_browser_esm.DP)().isCdkEnviroment,preparingFlow=status===RECORDING_STATUS.CAMERA_READY||status===RECORDING_STATUS.COUNTDOWN,recordingFlow=status===RECORDING_STATUS.PAUSED||status===RECORDING_STATUS.RECORDING;return(0,jsx_runtime.jsxs)("div",VideoRecorderActions_assign({style:{width:"100%",position:"relative",paddingBottom:32}},{children:[preparingFlow&&(0,jsx_runtime.jsxs)(Gap,VideoRecorderActions_assign({justifyContent:"center",width:"100%",m:"36px 0 0 0"},{children:[status===RECORDING_STATUS.CAMERA_READY&&!isLoadingVB&&(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{variant:isCdkEnviroment?"primary":"red",icon:(0,jsx_runtime.jsx)(md_index_esm.S5m,{size:24}),text:"Start recording",onClick:startCountDown}),status===RECORDING_STATUS.COUNTDOWN&&(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{variant:isCdkEnviroment?"text":"secondary",text:"Cancel",onClick:stopCountDown})]})),recordingFlow&&(0,jsx_runtime.jsxs)(RecordingFlowWrapper,VideoRecorderActions_assign({m:"32px 0 0 0"},{children:[(0,jsx_runtime.jsxs)(Gap,VideoRecorderActions_assign({style:{position:"relative",zIndex:22}},{children:[(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{variant:status===RECORDING_STATUS.PAUSED?isCdkEnviroment?"text":"red":"secondary",icon:status===RECORDING_STATUS.PAUSED?(0,jsx_runtime.jsx)(md_index_esm.S5m,{size:24}):(0,jsx_runtime.jsx)(md_index_esm.gH6,{}),text:status===RECORDING_STATUS.PAUSED?"Resume":"Pause",onClick:pauseRecording}),(0,jsx_runtime.jsx)("span",VideoRecorderActions_assign({style:{width:50}},{children:toMMSS(timeInSeconds,0)}))]})),(0,jsx_runtime.jsx)(FinishBtnWrapper,VideoRecorderActions_assign({alignItems:"center",justifyContent:"center"},{children:(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{icon:(0,jsx_runtime.jsx)(images_CheckmarkIcon,{}),variant:"primary",text:"Finish",onClick:stopRecording})}))]}))]}))};var VideoRecorderActions_templateObject_1,VideoRecorderActions_templateObject_2,VideoRecorderActions_templateObject_3,VideoRecorderActions_templateObject_4,VideoTag_templateObject_1,ModalVideoTags_templateObject_1,ModalVideoTags_templateObject_2,ModalVideoTags_templateObject_3,ModalVideoTags_templateObject_4,ModalVideoTags_templateObject_5,ModalVideoTags_templateObject_6,ModalVideoTags_templateObject_7,ModalVideoTags_templateObject_8,FormikLabel_templateObject_1,FormikLabel_templateObject_2,FormikLabel_templateObject_3,FormikInputField_templateObject_1,FormikTextAreaField_templateObject_1,ATTRIBUTES_TYPES,browserChecks_isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),isOpera=!!window.opr&&!!opr.addons||!!window.opera||navigator.userAgent.indexOf(" OPR/")>=0,isFirefox="undefined"!=typeof InstallTrigger,videoAttributesKeys_all=function(params){return["VIDEO_ATTRIBUTES",params]},useGetAllVideoAttributesQuery_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},useGetAllVideoAttributesQuery_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},useGetAllVideoAttributesQuery=function(params){return(0,es.useQuery)(videoAttributesKeys_all(params),(function(){return function(_a){var _b=_a.page,page=void 0===_b?0:_b,_c=_a.size,size=void 0===_c?10:_c,_d=_a.filterByDepartment,filterByDepartment=void 0!==_d&&_d;return useGetAllVideoAttributesQuery_awaiter(void 0,void 0,Promise,(function(){var params,data,_e,_f,videoAttributes,_g;return useGetAllVideoAttributesQuery_generator(this,(function(_h){switch(_h.label){case 0:return params={start:page*size,limit:size,filterByDepartment},[4,config_EXPRESS_API.get("/video-attributes",{params})];case 1:return data=_h.sent().data,_f=(_e=data||{}).videoAttributes,videoAttributes=void 0===_f?[]:_f,[2,{count:void 0===(_g=_e.count)?0:_g,attributes:videoAttributes}]}}))}))}(params)}))},DetailsPreviewHeader_assign=function(){return DetailsPreviewHeader_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},DetailsPreviewHeader_assign.apply(this,arguments)},DetailsPreviewHeader=function(_a){var setContineToInsert=_a.setContineToInsert,handleGoToRecordHome=_a.handleGoToRecordHome,_b=(0,formik_esm.j7)(),isValid=_b.isValid,submitForm=_b.submitForm,userData=useAuthorizationContext().userData,_c=useConfigurationContext(),showInsertFeature=_c.showInsertFeature,containerWidth=_c.containerWidth,_d=(0,styled_components_browser_esm.DP)(),colors=_d.colors,isCdkEnviroment=_d.isCdkEnviroment,isAutomotiveSalesRole=checkIfAutomotiveSalesRole(userData);return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:(0,jsx_runtime.jsxs)(Gap,DetailsPreviewHeader_assign({width:"100%",justifyContent:"space-between",m:"0 0 32px 0"},{children:[(0,jsx_runtime.jsx)(Heading,DetailsPreviewHeader_assign({color:colors.black[100]},{children:"Preview recorded video"})),(0,jsx_runtime.jsxs)(Gap,DetailsPreviewHeader_assign({gap:"8px"},{children:[(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{icon:(0,jsx_runtime.jsx)(md_index_esm.kgr,{size:20}),text:"Discard",variant:isCdkEnviroment?"text":"destructive",onClick:handleGoToRecordHome}),(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{disabled:!isValid,icon:(0,jsx_runtime.jsx)(md_index_esm.rZB,{size:18}),text:isAutomotiveSalesRole?"Save":"Save Recording",onClick:submitForm,variant:isCdkEnviroment?"secondary":"primary"}),showInsertFeature&&(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{variant:"primary",disabled:!isValid,icon:(0,jsx_runtime.jsx)(md_index_esm.mm2,{size:20}),text:containerWidth>screenSizes_sm?"Continue to Insert":"Insert",onClick:function(){setContineToInsert(!0),submitForm()}})]}))]}))})},fa_index_esm=__webpack_require__("./node_modules/react-icons/fa/index.esm.js"),VideoTag_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},VideoTag_assign=function(){return VideoTag_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},VideoTag_assign.apply(this,arguments)},Tag=styled_components_browser_esm.Ay.span(VideoTag_templateObject_1||(VideoTag_templateObject_1=VideoTag_makeTemplateObject(["\n font-size: 14px;\n font-weight: 600;\n line-height: 20px;\n letter-spacing: 0px;\n text-align: left;\n border-radius: 5px;\n padding: 4px 8px;\n background: ",";\n color: #4e5461;\n flex: none;\n margin: 6px 8px 0 0;\n .hashtag-icon {\n margin-bottom: -2px;\n margin-right: 2px;\n }\n .close-icon {\n margin-bottom: -3px;\n margin-left: 3px;\n &:hover {\n cursor: pointer;\n path {\n fill: ",";\n }\n }\n }\n"],["\n font-size: 14px;\n font-weight: 600;\n line-height: 20px;\n letter-spacing: 0px;\n text-align: left;\n border-radius: 5px;\n padding: 4px 8px;\n background: ",";\n color: #4e5461;\n flex: none;\n margin: 6px 8px 0 0;\n .hashtag-icon {\n margin-bottom: -2px;\n margin-right: 2px;\n }\n .close-icon {\n margin-bottom: -3px;\n margin-left: 3px;\n &:hover {\n cursor: pointer;\n path {\n fill: ",";\n }\n }\n }\n"])),(function(_a){return _a.theme.colors.primary[5]}),(function(_a){return _a.theme.colors.primary[60]})),VideoTag=function(_a){var tag=_a.tag,_b=_a.showRemove,showRemove=void 0!==_b&&_b,_c=_a.onRemove,onRemove=void 0===_c?function(){}:_c,_d=_a.onClick,onClick=void 0===_d?function(){}:_d,_e=_a.onMouseEnter,onMouseEnter=void 0===_e?function(){}:_e,_f=_a.onMouseLeave,onMouseLeave=void 0===_f?function(){}:_f,children=_a.children,colors=(0,styled_components_browser_esm.DP)().colors;return(0,jsx_runtime.jsxs)(Tag,VideoTag_assign({onClick,onMouseEnter,onMouseLeave,className:"video-tag"},{children:[!!tag.value&&(0,jsx_runtime.jsx)(fa_index_esm.amN,{className:"hashtag-icon"}),tag.label,showRemove&&(0,jsx_runtime.jsx)(io_index_esm.W0M,{onClick:function(){return onRemove(tag)},className:"close-icon",color:colors.primary[40]}),children]}),tag.value)},ModalVideoTags_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},ModalVideoTags_assign=function(){return ModalVideoTags_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},ModalVideoTags_assign.apply(this,arguments)},ModalVideoTags_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},ModalVideoTags_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},ModalVideoTags_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},ModalVideoTags_spreadArray=function(to,from,pack){if(pack||2===arguments.length)for(var ar,i=0,l=from.length;i<l;i++)!ar&&i in from||(ar||(ar=Array.prototype.slice.call(from,0,i)),ar[i]=from[i]);return to.concat(ar||Array.prototype.slice.call(from))},ModalVideoTags_ModalItem=styled_components_browser_esm.Ay.div(ModalVideoTags_templateObject_1||(ModalVideoTags_templateObject_1=ModalVideoTags_makeTemplateObject(["\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n position: relative;\n background-color: ",";\n padding: 32px;\n"],["\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n position: relative;\n background-color: ",";\n padding: 32px;\n"])),palette_white),Section=styled_components_browser_esm.Ay.section(ModalVideoTags_templateObject_2||(ModalVideoTags_templateObject_2=ModalVideoTags_makeTemplateObject(["\n display: flex;\n flex-direction: column;\n width: 528px;\n max-width: 100%;\n gap: 12px;\n justify-content: flex-end;\n align-items: right;\n"],["\n display: flex;\n flex-direction: column;\n width: 528px;\n max-width: 100%;\n gap: 12px;\n justify-content: flex-end;\n align-items: right;\n"]))),SelectInput=(0,styled_components_browser_esm.Ay)(Dropdown)(ModalVideoTags_templateObject_3||(ModalVideoTags_templateObject_3=ModalVideoTags_makeTemplateObject(["\n position: relative;\n display: block;\n font-size: 16px;\n height: 40px;\n box-sizing: border-box;\n transition:\n border-color 0.15s ease-in-out,\n box-shadow 0.15s ease-in-out;\n border: none;\n box-sizing: border-box;\n &:focus {\n color: red;\n background-color: #fff;\n outline: 0;\n }\n"],["\n position: relative;\n display: block;\n font-size: 16px;\n height: 40px;\n box-sizing: border-box;\n transition:\n border-color 0.15s ease-in-out,\n box-shadow 0.15s ease-in-out;\n border: none;\n box-sizing: border-box;\n &:focus {\n color: red;\n background-color: #fff;\n outline: 0;\n }\n"]))),TagsContainer=styled_components_browser_esm.Ay.div(ModalVideoTags_templateObject_4||(ModalVideoTags_templateObject_4=ModalVideoTags_makeTemplateObject(["\n height: 150px;\n display: flex;\n flex-direction: row;\n margin-top: 18px;\n flex-flow: row wrap;\n align-content: flex-start;\n"],["\n height: 150px;\n display: flex;\n flex-direction: row;\n margin-top: 18px;\n flex-flow: row wrap;\n align-content: flex-start;\n"]))),Footer=styled_components_browser_esm.Ay.div(ModalVideoTags_templateObject_5||(ModalVideoTags_templateObject_5=ModalVideoTags_makeTemplateObject(["\n display: flex;\n justify-content: flex-end;\n"],["\n display: flex;\n justify-content: flex-end;\n"]))),ModalVideoTags_Header=styled_components_browser_esm.Ay.div(ModalVideoTags_templateObject_6||(ModalVideoTags_templateObject_6=ModalVideoTags_makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 15px;\n"],["\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 15px;\n"]))),ModalVideoTags_Title=styled_components_browser_esm.Ay.div(ModalVideoTags_templateObject_7||(ModalVideoTags_templateObject_7=ModalVideoTags_makeTemplateObject(["\n color: ",";\n font-weight: bold;\n font-size: 18px;\n line-height: 24px;\n"],["\n color: ",";\n font-weight: bold;\n font-size: 18px;\n line-height: 24px;\n"])),palette_gray100),ModalVideoTags_CloseButtonWrapper=styled_components_browser_esm.Ay.label(ModalVideoTags_templateObject_8||(ModalVideoTags_templateObject_8=ModalVideoTags_makeTemplateObject(["\n display: flex;\n align-items: center;\n margin: 0;\n padding: 0;\n color: ",";\n &:hover {\n cursor: pointer;\n }\n"],["\n display: flex;\n align-items: center;\n margin: 0;\n padding: 0;\n color: ",";\n &:hover {\n cursor: pointer;\n }\n"])),palette_themeDark50Percent),ModalVideoTags=function(_a){var _b=_a.videoTags,videoTags=void 0===_b?[]:_b,handleModalClose=_a.handleModalClose,onSubmit=_a.onSubmit,buttonTitle=(_a.title,_a.buttonTitle),_c=ModalVideoTags_read((0,react.useState)(""),2),inputValue=_c[0],setInputValue=_c[1],_d=ModalVideoTags_read((0,react.useState)([]),2),tags=_d[0],setTags=_d[1],_e=ModalVideoTags_read((0,react.useState)(videoTags),2),displayValues=_e[0],setDisplayValues=_e[1],_f=ModalVideoTags_read((0,react.useState)(""),2),errorMessage=_f[0],setErrorMessage=_f[1],colors=(0,styled_components_browser_esm.DP)().colors,sortTags=function(unsortedTags){return unsortedTags.sort((function(a,b){var _a;return null===(_a=a.label)||void 0===_a?void 0:_a.localeCompare(b.label)}))};react.useEffect((function(){ModalVideoTags_awaiter(void 0,void 0,void 0,(function(){var tags;return ModalVideoTags_generator(this,(function(_a){switch(_a.label){case 0:return[4,getTags({})];case 1:return tags=_a.sent(),setTags(sortTags(tags.map((function(t){return{value:t.tagId,label:t.tag}})).filter((function(t){return!displayValues.find((function(dv){return dv.value===t.value}))})))),[2]}}))}))}),[]);var escPress=function(key){"Escape"===key&&handleModalClose()};(0,react.useEffect)((function(){return document.addEventListener("keyup",(function(e){return escPress(e.key)})),function(){return document.removeEventListener("keyup",(function(e){return escPress(e.key)}),!0)}}),[]);var removeTag=function(tag){setDisplayValues(sortTags(displayValues.filter((function(t){return t.value!==tag.value})))),setTags(sortTags(ModalVideoTags_spreadArray(ModalVideoTags_spreadArray([],ModalVideoTags_read(tags),!1),[tag],!1)))};return(0,jsx_runtime.jsx)(Modal_Modal,ModalVideoTags_assign({disableFullScreen:!0,style:{position:"fixed",zIndex:999}},{children:(0,jsx_runtime.jsxs)(ModalVideoTags_ModalItem,{children:[(0,jsx_runtime.jsxs)(ModalVideoTags_Header,{children:[(0,jsx_runtime.jsx)(ModalVideoTags_Title,{children:"Manage Tags"}),(0,jsx_runtime.jsx)(ModalVideoTags_CloseButtonWrapper,{children:(0,jsx_runtime.jsx)(images_CloseIcon,{width:"24px",height:"24px",onClick:handleModalClose})})]}),(0,jsx_runtime.jsxs)(Section,{children:[(0,jsx_runtime.jsx)(SelectInput,{defaultValue:inputValue,onInputChange:function(v){v.length>50||setInputValue(v)},customComponents:{IndicatorSeparator:function(){return null},DropdownIndicator:function(props){return index_75b02bac_browser_esm.F.DropdownIndicator&&(0,jsx_runtime.jsx)(index_75b02bac_browser_esm.F.DropdownIndicator,ModalVideoTags_assign({},props,{children:(0,jsx_runtime.jsx)(md_index_esm.gZ7,{})}))},Option:function(props){return props.data.__isNew__?(0,jsx_runtime.jsxs)(index_75b02bac_browser_esm.F.Option,ModalVideoTags_assign({},props,{children:[(0,jsx_runtime.jsx)(md_index_esm.jgn,{className:"add-icon",color:colors.primary[100]}),props.label]})):(0,jsx_runtime.jsxs)(index_75b02bac_browser_esm.F.Option,ModalVideoTags_assign({},props,{children:[(0,jsx_runtime.jsx)(fa_index_esm.amN,{color:colors.primary[60],className:"hashtag-icon",size:"14px"}),props.label]}))}},placeholder:"Add tag(s)...",value:[],createOptionPosition:"first",onChange:function(v){var _a;if(v&&v.length){var val=v[0];if(!val||!val.value||!(null===(_a=null==val?void 0:val.value)||void 0===_a?void 0:_a.toString().trim().length))return setErrorMessage((function(){return"Tag can not be empty."})),!1;if(val.value.length>50)return setErrorMessage((function(){return"Tag can not contain more than ".concat(50," characters.")})),!1;if(displayValues.some((function(tag){return tag.label==val.value})))return setErrorMessage((function(){return"Tag already exists."})),!1;setErrorMessage(""),setDisplayValues(sortTags(ModalVideoTags_spreadArray(ModalVideoTags_spreadArray([],ModalVideoTags_read(displayValues),!1),[val],!1))),setTags(sortTags(tags.filter((function(t){return t.value!==val.value}))))}},options:tags,isMulti:!0}),null!=errorMessage&&(0,jsx_runtime.jsx)("span",ModalVideoTags_assign({className:"error-message"},{children:errorMessage})),(0,jsx_runtime.jsx)(TagsContainer,{children:displayValues&&displayValues.map((function(tag){return(0,jsx_runtime.jsx)(VideoTag,{tag,showRemove:!0,onRemove:removeTag},tag.value)}))}),(0,jsx_runtime.jsx)(Footer,{children:(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{onClick:function(){return onSubmit(displayValues)},text:buttonTitle,type:"submit",disabled:function(){try{return JSON.stringify(videoTags)===JSON.stringify(displayValues)}catch(ex){return!1}}()})})]})]})}))},DetailsRecordPreviewTags_assign=function(){return DetailsRecordPreviewTags_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},DetailsRecordPreviewTags_assign.apply(this,arguments)},DetailsRecordPreviewTags_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},DetailsRecordPreviewTags=function(){var _a,_b,isCdkEnviroment=(0,styled_components_browser_esm.DP)().isCdkEnviroment,history=(0,react_router.W6)(),_c=(0,formik_esm.j7)(),values=_c.values,setFieldValue=_c.setFieldValue,_d=DetailsRecordPreviewTags_read((0,react.useState)(!1),2),showModal=_d[0],setShowModal=_d[1],closeModal=function(){setShowModal(!1)};return(0,jsx_runtime.jsxs)(Stack,DetailsRecordPreviewTags_assign({alignItems:"flex-start",width:"100%",m:"32px 0 32px 0"},{children:[(0,jsx_runtime.jsxs)(Gap,DetailsRecordPreviewTags_assign({width:"100%",justifyContent:"space-between"},{children:[(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{variant:isCdkEnviroment?"text":"destructive",icon:(0,jsx_runtime.jsx)(md_index_esm.kgr,{size:18}),text:"Remove this video",onClick:function(){history.push("/record/home")}}),(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{variant:"secondary",icon:(0,jsx_runtime.jsx)(fa_index_esm.amN,{size:"16px"}),text:"Add Tags...",onClick:function(){setShowModal(!0)}})]})),!!(null===(_a=null==values?void 0:values.videoTags)||void 0===_a?void 0:_a.length)&&(0,jsx_runtime.jsx)(Gap,DetailsRecordPreviewTags_assign({gap:"4px",m:"4px 0 0 0"},{children:null===(_b=null==values?void 0:values.videoTags)||void 0===_b?void 0:_b.map((function(tag){return(0,jsx_runtime.jsx)(VideoTag,{tag},tag.value)}))})),showModal&&(0,jsx_runtime.jsx)(ModalVideoTags,{videoTags:null==values?void 0:values.videoTags,handleModalClose:closeModal,onSubmit:function(values){setFieldValue("videoTags",values),closeModal()},title:"Manage Tags",buttonTitle:"Save Changes"})]}))},FormikErrorMessage_assign=function(){return FormikErrorMessage_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},FormikErrorMessage_assign.apply(this,arguments)},FormikErrorMessage=function(_a){var meta=_a.meta,themes=(0,styled_components_browser_esm.DP)();return(0,jsx_runtime.jsx)("div",FormikErrorMessage_assign({style:{height:16}},{children:meta.error&&meta.touched?(0,jsx_runtime.jsx)(ParagraphExtraSmall,FormikErrorMessage_assign({color:themes.colors.danger[80]},{children:meta.error})):null}))},FormikLabel_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},FormikLabel_assign=function(){return FormikLabel_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},FormikLabel_assign.apply(this,arguments)},CommonStyles=(0,styled_components_browser_esm.AH)(FormikLabel_templateObject_1||(FormikLabel_templateObject_1=FormikLabel_makeTemplateObject(["\n font-weight: 500;\n font-size: 14px;\n line-height: 20px;\n margin-bottom: 4px;\n color: ",";\n"],["\n font-weight: 500;\n font-size: 14px;\n line-height: 20px;\n margin-bottom: 4px;\n color: ",";\n"])),(function(_a){return _a.theme.colors.neutral[60]})),StyledLabel=styled_components_browser_esm.Ay.label(FormikLabel_templateObject_2||(FormikLabel_templateObject_2=FormikLabel_makeTemplateObject(["\n ","\n display: block;\n"],["\n ","\n display: block;\n"])),CommonStyles),StyledDiv=styled_components_browser_esm.Ay.div(FormikLabel_templateObject_3||(FormikLabel_templateObject_3=FormikLabel_makeTemplateObject(["\n ","\n"],["\n ","\n"])),CommonStyles),FormikLabel=function(_a){var name=_a.name,label=_a.label,isRequired=_a.isRequired,themes=(0,styled_components_browser_esm.DP)();return name?(0,jsx_runtime.jsxs)(StyledLabel,FormikLabel_assign({htmlFor:name},{children:[label," ",isRequired&&(0,jsx_runtime.jsx)("span",FormikLabel_assign({style:{color:themes.colors.primary[100]}},{children:"*"}))]})):(0,jsx_runtime.jsxs)(StyledDiv,{children:[label," ",isRequired&&(0,jsx_runtime.jsx)("span",FormikLabel_assign({style:{color:themes.colors.primary[100]}},{children:"*"}))]})},FormikInputField_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},FormikInputField_assign=function(){return FormikInputField_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},FormikInputField_assign.apply(this,arguments)},FormikInputField_rest=function(s,e){var t={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0&&(t[p]=s[p]);if(null!=s&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(p=Object.getOwnPropertySymbols(s);i<p.length;i++)e.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i])&&(t[p[i]]=s[p[i]])}return t},FormikInputField_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},FormikInputField_TextInput=styled_components_browser_esm.Ay.input(FormikInputField_templateObject_1||(FormikInputField_templateObject_1=FormikInputField_makeTemplateObject(["\n font-style: normal;\n font-weight: normal;\n font-size: 16px;\n line-height: 24px;\n color: #272a32;\n border-radius: 4px;\n height: 40px;\n width: 100%;\n box-sizing: border-box;\n border: solid 1px #e1e2e5;\n padding: 8px 12px;\n &:focus {\n outline: none;\n border: solid 1px ",";\n }\n &:disabled {\n cursor: not-allowed;\n }\n"],["\n font-style: normal;\n font-weight: normal;\n font-size: 16px;\n line-height: 24px;\n color: #272a32;\n border-radius: 4px;\n height: 40px;\n width: 100%;\n box-sizing: border-box;\n border: solid 1px #e1e2e5;\n padding: 8px 12px;\n &:focus {\n outline: none;\n border: solid 1px ",";\n }\n &:disabled {\n cursor: not-allowed;\n }\n"])),(function(_a){return _a.theme.colors.primary[100]})),FormikInputField=function(_a){var label=_a.label,isRequired=_a.isRequired,props=FormikInputField_rest(_a,["label","isRequired"]),_b=FormikInputField_read((0,formik_esm.Mt)(props),2),field=_b[0],meta=_b[1];return(0,jsx_runtime.jsxs)("div",FormikInputField_assign({style:{width:"100%"}},{children:[(0,jsx_runtime.jsx)(FormikLabel,{label,name:props.name,isRequired}),(0,jsx_runtime.jsx)(FormikInputField_TextInput,FormikInputField_assign({},field,props,{id:props.name})),(0,jsx_runtime.jsx)(FormikErrorMessage,{meta})]}))},FormikTextAreaField_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},FormikTextAreaField_assign=function(){return FormikTextAreaField_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},FormikTextAreaField_assign.apply(this,arguments)},FormikTextAreaField_rest=function(s,e){var t={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0&&(t[p]=s[p]);if(null!=s&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(p=Object.getOwnPropertySymbols(s);i<p.length;i++)e.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i])&&(t[p[i]]=s[p[i]])}return t},FormikTextAreaField_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},FormikTextAreaField_Textarea=styled_components_browser_esm.Ay.textarea(FormikTextAreaField_templateObject_1||(FormikTextAreaField_templateObject_1=FormikTextAreaField_makeTemplateObject(["\n width: 100%;\n height: 100px;\n padding: 8px 12px;\n min-height: 100px;\n max-height: 300px;\n border-radius: 4px;\n box-sizing: border-box;\n border: solid 1px #d0d3d9;\n &:focus {\n outline: none;\n border: solid 1px ",";\n }\n"],["\n width: 100%;\n height: 100px;\n padding: 8px 12px;\n min-height: 100px;\n max-height: 300px;\n border-radius: 4px;\n box-sizing: border-box;\n border: solid 1px #d0d3d9;\n &:focus {\n outline: none;\n border: solid 1px ",";\n }\n"])),(function(_a){return _a.theme.colors.primary[100]})),FormikTextAreaField=function(_a){var label=_a.label,isRequired=_a.isRequired,props=FormikTextAreaField_rest(_a,["label","isRequired"]),_b=FormikTextAreaField_read((0,formik_esm.Mt)(props),2),field=_b[0],meta=_b[1];return(0,jsx_runtime.jsxs)("div",FormikTextAreaField_assign({style:{width:"100%"}},{children:[(0,jsx_runtime.jsx)(FormikLabel,{label,name:props.name,isRequired}),(0,jsx_runtime.jsx)(FormikTextAreaField_Textarea,FormikTextAreaField_assign({},field,props,{id:props.name})),(0,jsx_runtime.jsx)(FormikErrorMessage,{meta})]}))},FormikDropdown_assign=function(){return FormikDropdown_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},FormikDropdown_assign.apply(this,arguments)},FormikDropdown_rest=function(s,e){var t={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0&&(t[p]=s[p]);if(null!=s&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(p=Object.getOwnPropertySymbols(s);i<p.length;i++)e.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i])&&(t[p[i]]=s[p[i]])}return t},FormikDropdown_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},FormikDropdownField=function(_a){var label=_a.label,isRequired=_a.isRequired,options=_a.options,disabled=_a.disabled,props=FormikDropdown_rest(_a,["label","isRequired","options","disabled"]),_b=FormikDropdown_read((0,formik_esm.Mt)(props),3),field=_b[0],meta=_b[1],helpers=_b[2];return(0,jsx_runtime.jsxs)("div",FormikDropdown_assign({style:{width:"100%"}},{children:[(0,jsx_runtime.jsx)(FormikLabel,{label,isRequired}),(0,jsx_runtime.jsx)(Dropdown,{disabled,value:options.find((function(option){return option.value===field.value})),onChange:function(option){helpers.setValue(option?option.value:"")},placeholder:"Select...",onMenuOpen:function(){return helpers.setTouched(!0)},options,menuPortalTarget:document.body,creatable:!1,isSearchable:!1}),(0,jsx_runtime.jsx)(FormikErrorMessage,{meta})]}))},DetailsPreviewVideoAttributes_assign=function(){return DetailsPreviewVideoAttributes_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},DetailsPreviewVideoAttributes_assign.apply(this,arguments)};!function(ATTRIBUTES_TYPES){ATTRIBUTES_TYPES.TEXT="text",ATTRIBUTES_TYPES.TEXTAREA="textarea",ATTRIBUTES_TYPES.DROPDOWN="dropdown"}(ATTRIBUTES_TYPES||(ATTRIBUTES_TYPES={}));var types_AutomotiveRole,DetailsPreviewVideoAttributes=function(){var _a,values=(0,formik_esm.j7)().values;return(null===(_a=null==values?void 0:values.attributes)||void 0===_a?void 0:_a.length)?(0,jsx_runtime.jsx)(Stack,DetailsPreviewVideoAttributes_assign({width:"100%",alignItems:"flex-start"},{children:(0,jsx_runtime.jsx)(formik_esm.ED,DetailsPreviewVideoAttributes_assign({name:"attributes"},{children:function(){var _a;return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:null===(_a=null==values?void 0:values.attributes)||void 0===_a?void 0:_a.map((function(attribute,index){var isRequired=!!attribute.isRequired,isDisabled=!!attribute.isReadOnly||!!attribute.isLocked;return(0,jsx_runtime.jsxs)(react.Fragment,{children:[attribute.type===ATTRIBUTES_TYPES.TEXT&&(0,jsx_runtime.jsx)(FormikInputField,{name:"attributes.".concat(index,".value"),label:attribute.slug,disabled:isDisabled,isRequired}),attribute.type===ATTRIBUTES_TYPES.TEXTAREA&&(0,jsx_runtime.jsx)(FormikTextAreaField,{name:"attributes.".concat(index,".value"),label:attribute.slug,disabled:isDisabled,isRequired}),attribute.type===ATTRIBUTES_TYPES.DROPDOWN&&(0,jsx_runtime.jsx)(FormikDropdownField,{name:"attributes.".concat(index,".value"),label:attribute.slug,disabled:isDisabled,isRequired,options:(null==attribute?void 0:attribute.dropdownValues.map((function(a){return{value:a.value,label:a.value}})))||[]})]},index)}))})}}))})):null},yup_es=__webpack_require__("./node_modules/yup/es/index.js");!function(AutomotiveRole){AutomotiveRole.NO_ROLE="0",AutomotiveRole.TECHNICIAN="1",AutomotiveRole.SERVICE_ADVISOR="2",AutomotiveRole.SERVICE_MANAGER="3",AutomotiveRole.SALESPERSON="4",AutomotiveRole.SALES_MANAGER="5",AutomotiveRole.BDC="6"}(types_AutomotiveRole||(types_AutomotiveRole={}));var VideoRequestDetails_templateObject_1,ProgressCircle_templateObject_1,ProgressCircle_templateObject_2,UploadLoader_templateObject_1,UploadLoader_templateObject_2,UploadLoader_templateObject_3,UploadLoader_templateObject_4,UploadLoader_templateObject_5,PROMPT_USE_CASE,VideoRequestDetails_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},VideoRequestDetails_assign=function(){return VideoRequestDetails_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},VideoRequestDetails_assign.apply(this,arguments)},VideoRequestDetails_Wrapper=styled_components_browser_esm.Ay.div(VideoRequestDetails_templateObject_1||(VideoRequestDetails_templateObject_1=VideoRequestDetails_makeTemplateObject(["\n margin-top: 24px;\n"],["\n margin-top: 24px;\n"]))),VideoRequestDetails=function(_a){var _b,_c,_d=_a.fetchSoldVehiclesForAutomotive,fetchSoldVehiclesForAutomotive=void 0===_d||_d,results=_a.results,userData=useAuthorizationContext().userData,_e=(0,formik_esm.j7)(),setFieldValue=_e.setFieldValue,values=_e.values,showVideoRequestFields=checkIfAutomotive(userData),isAutomotiveService=checkIfAutomotiveServiceRole(userData),isAutomotiveSales=checkIfAutomotiveSalesRole(userData),isTechnician=userData.automotiveRole===types_AutomotiveRole.TECHNICIAN,videoTypeOptions=function(isAutomotiveSales){return Object.values(isAutomotiveSales?VideoTypeSales:VideoType).filter(Boolean).map((function(videoType){return{value:videoType,label:videoType}}))}(isAutomotiveSales),advisorOptions=results.flatMap((function(result){return result.data?result.data.map((function(assignee){return{label:"".concat(assignee.firstName," ").concat(assignee.lastName),value:"".concat(assignee.id)}})):[]}));return showVideoRequestFields?(0,jsx_runtime.jsxs)(VideoRequestDetails_Wrapper,{children:[(0,jsx_runtime.jsx)(FormikDropdownField,{name:"videoRequest.videoType",label:"Video Type",disabled:!1,isRequired:!1,options:videoTypeOptions}),isAutomotiveSales&&(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsxs)("div",VideoRequestDetails_assign({style:{marginBottom:16}},{children:[(0,jsx_runtime.jsx)(FormikLabel,{label:"Search vehicle",isRequired:!1}),(0,jsx_runtime.jsx)(VehicleSearch,{onChangeVehicle:function(item){setFieldValue("videoRequest.vehicle",{vin:(null==item?void 0:item.vin)||"",stockNumber:(null==item?void 0:item.stockNumber)||""})},selectedVin:(null===(_c=null===(_b=values.videoRequest)||void 0===_b?void 0:_b.vehicle)||void 0===_c?void 0:_c.vin)||"",placeholder:"Search vehicle by name, VIN or stock number...",fetchSold:fetchSoldVehiclesForAutomotive})]})),(0,jsx_runtime.jsx)(FormikInputField,{name:"videoRequest.vehicle.vin",label:"VIN",isRequired:!1,disabled:!0}),(0,jsx_runtime.jsx)(FormikInputField,{name:"videoRequest.vehicle.stockNumber",label:"Stock number",isRequired:!1,disabled:!0})]}),isAutomotiveService&&(0,jsx_runtime.jsx)(FormikDropdownField,{name:"videoRequest.advisorId",label:"Assign To",disabled:!1,isRequired:isTechnician,options:advisorOptions}),isAutomotiveService&&(0,jsx_runtime.jsx)(FormikInputField,{name:"videoRequest.repairOrderNumber",label:"RO Number",isRequired:isTechnician}),(0,jsx_runtime.jsx)(FormikInputField,{name:"videoRequest.customerName",label:"Customer Name",isRequired:!1}),isAutomotiveService&&(0,jsx_runtime.jsx)(FormikTextAreaField,{name:"videoRequest.note",label:"Note",isRequired:!1})]}):(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{})},DetailsPreviewAtrributesHeader_assign=function(){return DetailsPreviewAtrributesHeader_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},DetailsPreviewAtrributesHeader_assign.apply(this,arguments)},DetailsPreviewAttributesHeader=function(){var userData=useAuthorizationContext().userData,colors=(0,styled_components_browser_esm.DP)().colors,values=(0,formik_esm.j7)().values,videoRequestFieldsRequired=checkIfVideoRequestFieldsRequired(userData),totalRequiredAttributes=function(){var _a,count=0;return null===(_a=null==values?void 0:values.attributes)||void 0===_a||_a.forEach((function(attribute){attribute&&attribute.isRequired&&count++})),videoRequestFieldsRequired&&(count+=2),count}();return(0,jsx_runtime.jsxs)(Gap,DetailsPreviewAtrributesHeader_assign({justifyContent:"space-between",m:"0 0 16px 0"},{children:[(0,jsx_runtime.jsx)(SubHeading,{children:"Video Attributes "}),(0,jsx_runtime.jsxs)(ParagraphSmall,DetailsPreviewAtrributesHeader_assign({color:colors.primary[100]},{children:[totalRequiredAttributes," required"]}))]}))},automotiveUsersKeys_customer_user=function(customerId,role){return["USER_AUTOMOTIVE",customerId,role]},useUsersByAutomotiveRolesQuery_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},useUsersByAutomotiveRolesQuery_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},useGetUsersByAutomotiveRolesQuery=function(_a){var params=_a.params,enabled=_a.enabled,queries=params.map((function(_a){var customerId=_a.customerId,role=_a.role;return{queryKey:automotiveUsersKeys_customer_user(customerId,role),queryFn:function(){return function(_a){var customerId=_a.customerId,role=_a.role;return useUsersByAutomotiveRolesQuery_awaiter(void 0,void 0,void 0,(function(){return useUsersByAutomotiveRolesQuery_generator(this,(function(_b){switch(_b.label){case 0:return[4,config_EXPRESS_API.get("/users/".concat(customerId,"/automotive-users"),{params:{role}})];case 1:return[2,_b.sent().data]}}))}))}({customerId,role})},enabled}})),results=(0,es.useQueries)(queries),isLoading=results.some((function(query){return query.isLoading})),isError=results.some((function(query){return query.isError}));return{results,isLoading,isError}},useAwsSignedUrlQuery_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},useAwsSignedUrlQuery_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},useAwsSignedUrlQuery=function(params,enabled){return(0,es.useQuery)(["AWS_SIGNED_URL",params.fileName],(function(){return data=params,useAwsSignedUrlQuery_awaiter(void 0,void 0,Promise,(function(){var fileName,type;return useAwsSignedUrlQuery_generator(this,(function(_a){switch(_a.label){case 0:return fileName=data.fileName,type=data.type,[4,config_EXPRESS_API.get("/aws/signedurl",{params:{filename:fileName,filetype:type}})];case 1:return[2,_a.sent().data]}}))}));var data}),{enabled,refetchOnMount:!0,refetchOnReconnect:!0,cacheTime:5e3})},useS3UploadMutation_assign=function(){return useS3UploadMutation_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},useS3UploadMutation_assign.apply(this,arguments)},useS3UploadMutation_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},useS3UploadMutation_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},useS3UploadMutation_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},useS3UploadMutation=function(){var _a=useS3UploadMutation_read((0,react.useState)({loaded:0,total:0,percentage:0}),2),uploadToS3Progress=_a[0],setUploadToS3Progress=_a[1],toast=useToastNotifications().toast;return useS3UploadMutation_assign(useS3UploadMutation_assign({},(0,es.useMutation)((function(data){return function(data,onProgress){return useS3UploadMutation_awaiter(void 0,void 0,Promise,(function(){var url,file,contentType,isFirefox,config,_a;return useS3UploadMutation_generator(this,(function(_b){switch(_b.label){case 0:return url=data.url,file=data.file,contentType=data.contentType,isFirefox=-1!==(null===(_a=null===navigator||void 0===navigator?void 0:navigator.userAgent)||void 0===_a?void 0:_a.indexOf("Firefox")),config={onUploadProgress:function(progressEvent){if(onProgress){var loaded=progressEvent.loaded,total=progressEvent.total,percentCompleted=Math.round(100*loaded/total);onProgress({loaded:Math.floor(loaded/1024),total:Math.floor(total/1024),percentage:percentCompleted})}}},[4,axios_default().put(url,file,useS3UploadMutation_assign({headers:{"content-type":!isFirefox&&contentType?contentType:file.type}},config))];case 1:return[2,_b.sent()]}}))}))}(data,setUploadToS3Progress)}),{onError:function(err){return toast({message:err})}})),{progress:uploadToS3Progress})},useCreateVideoMutation_assign=function(){return useCreateVideoMutation_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},useCreateVideoMutation_assign.apply(this,arguments)},useCreateVideoMutation_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},useCreateVideoMutation_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},useCreateVideoMutation_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},useCreateVideoMutation=function(){var _a=useCreateVideoMutation_read((0,react.useState)({loaded:0,total:0,percentage:0}),2),createProgress=_a[0],setCreateProgress=_a[1],toast=useToastNotifications().toast;return useCreateVideoMutation_assign(useCreateVideoMutation_assign({},(0,es.useMutation)((function(data){return props=data,onProgress=setCreateProgress,useCreateVideoMutation_awaiter(void 0,void 0,Promise,(function(){var title,filename,isFreemium,isGuide,folder,id,videoAttributeValues,videoRequest,videoTags,config,response;return useCreateVideoMutation_generator(this,(function(_a){switch(_a.label){case 0:return title=props.title,filename=props.filename,isFreemium=props.isFreemium,isGuide=props.isGuide,folder=props.folder,id=props.id,videoAttributeValues=props.videoAttributeValues,videoRequest=props.videoRequest,videoTags=props.videoTags,config={onUploadProgress:function(progressEvent){if(onProgress){var loaded=progressEvent.loaded,total=progressEvent.total,percentCompleted=Math.round(100*loaded/total);onProgress({loaded:Math.floor(loaded/1024),total:Math.floor(total/1024),percentage:percentCompleted})}}},[4,config_EXPRESS_API.post("/videos",{filename,title,isFreemium,isGuide:!!isGuide,folder:folder||"Primary",videoAttributeValues,videoRequest,videoTags},config)];case 1:return response=_a.sent(),[2,useCreateVideoMutation_assign(useCreateVideoMutation_assign({},response.data),void 0!==id?{id,videoId:response.data.id}:{})]}}))}));var props,onProgress}),{onSuccess:function(){toast({message:"Video successfully created!"})},onError:function(){toast({message:"Failed to create video. Please try again later."})}})),{progress:createProgress})},useEncodeVideoMutation_assign=function(){return useEncodeVideoMutation_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},useEncodeVideoMutation_assign.apply(this,arguments)},useEncodeVideoMutation_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},useEncodeVideoMutation_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},useEncodeVideoMutation_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},useEncodeVideoMutation=function(){var _a=useEncodeVideoMutation_read((0,react.useState)({loaded:0,total:0,percentage:0}),2),encodeProggress=_a[0],setEncodeProggress=_a[1];return useEncodeVideoMutation_assign(useEncodeVideoMutation_assign({},(0,es.useMutation)((function(data){return function(data,onProgress){return useEncodeVideoMutation_awaiter(void 0,void 0,Promise,(function(){var videoId,config;return useEncodeVideoMutation_generator(this,(function(_a){switch(_a.label){case 0:return videoId=data.videoId,config={onUploadProgress:function(progressEvent){if(onProgress){var loaded=progressEvent.loaded,total=progressEvent.total,percentCompleted=Math.round(100*loaded/total);onProgress({loaded:Math.floor(loaded/1024),total:Math.floor(total/1024),percentage:percentCompleted})}}},[4,config_EXPRESS_API.post("/videos/".concat(videoId,"/encode"),{},config)];case 1:return[2,_a.sent().data]}}))}))}(data,setEncodeProggress)}))),{progress:encodeProggress})},useVideoRecorderUpload_assign=function(){return useVideoRecorderUpload_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},useVideoRecorderUpload_assign.apply(this,arguments)},useVideoRecorderUpload_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},useVideoRecorderUpload_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},useVideoRecorderUpload_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},rc_progress_es=__webpack_require__("./node_modules/rc-progress/es/index.js"),ProgressCircle_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},ProgressCircle_assign=function(){return ProgressCircle_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},ProgressCircle_assign.apply(this,arguments)},ProgressCircle_CircleText=styled_components_browser_esm.Ay.div(ProgressCircle_templateObject_1||(ProgressCircle_templateObject_1=ProgressCircle_makeTemplateObject(["\n display: flex;\n flex-direction: column;\n &:nth-child(2) {\n align-items: center;\n justify-content: space-between;\n }\n &:nth-child(3) {\n align-items: flex-end;\n justify-content: flex-end;\n }\n\n .checkmark {\n border-radius: 20px;\n position: absolute;\n top: 106px;\n z-index: 4;\n color: white;\n }\n .rc-progress-circle {\n background-color: #f6f7f9;\n }\n & > div {\n z-index: 3;\n border-radius: 50px;\n position: absolute;\n top: 105px;\n }\n"],["\n display: flex;\n flex-direction: column;\n &:nth-child(2) {\n align-items: center;\n justify-content: space-between;\n }\n &:nth-child(3) {\n align-items: flex-end;\n justify-content: flex-end;\n }\n\n .checkmark {\n border-radius: 20px;\n position: absolute;\n top: 106px;\n z-index: 4;\n color: white;\n }\n .rc-progress-circle {\n background-color: #f6f7f9;\n }\n & > div {\n z-index: 3;\n border-radius: 50px;\n position: absolute;\n top: 105px;\n }\n"]))),ProgressCircle_Text=styled_components_browser_esm.Ay.span(ProgressCircle_templateObject_2||(ProgressCircle_templateObject_2=ProgressCircle_makeTemplateObject(["\n top: 0px;\n font-size: 16px;\n line-height: 1.5;\n color: ","\n\n margin-bottom: 8px;\n"],["\n top: 0px;\n font-size: 16px;\n line-height: 1.5;\n color: ","\n\n margin-bottom: 8px;\n"])),(function(props){return props.isInProgressOrDone?"".concat(props.theme.colors.primary[100],";"):"rgba(213,214,217,1);"})),getProgressStatusText=function(progressType,percentage){switch(progressType){case"encode":if(0===percentage)return"Waiting...";if(percentage>1&&percentage<99)return"Encoding";if(100===percentage)return"Encoded";break;case"create":if(0===percentage)return"Waiting...";if(percentage>1&&percentage<99)return"Creating";if(100===percentage)return"Created";break;case"upload":if(0===percentage)return"Waiting...";if(percentage>1&&percentage<99)return"Uploading";if(100===percentage)return"Uploaded";break;default:return""}},ProgressCircle=function(_a){var progress=_a.progress,progressType=_a.progressType,themes=(0,styled_components_browser_esm.DP)(),percentage=progress.percentage,isInProgressOrDone=percentage>1&&percentage<=100;return(0,jsx_runtime.jsxs)(ProgressCircle_CircleText,{children:[(0,jsx_runtime.jsx)(ProgressCircle_Text,ProgressCircle_assign({isInProgressOrDone},{children:getProgressStatusText(progressType,percentage)})),(0,jsx_runtime.jsx)(rc_progress_es.jl,{style:{width:"24px",zIndex:2,backgroundColor:"f6f7f9"},percent:percentage,trailWidth:10,strokeWidth:10,strokeColor:themes.colors.primary[100]})]})},UploadLoader_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},UploadLoader_assign=function(){return UploadLoader_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},UploadLoader_assign.apply(this,arguments)},UploadLoader_FlexCenter=styled_components_browser_esm.Ay.div(UploadLoader_templateObject_1||(UploadLoader_templateObject_1=UploadLoader_makeTemplateObject(["\n margin-top: 16px;\n background-color: #f6f7f9;\n border-radius: 4px;\n padding: 32px;\n height: 168px;\n display: flex;\n justify-content: center;\n flex-direction: column;\n"],["\n margin-top: 16px;\n background-color: #f6f7f9;\n border-radius: 4px;\n padding: 32px;\n height: 168px;\n display: flex;\n justify-content: center;\n flex-direction: column;\n"]))),UploadLoader_ProgressContainer=styled_components_browser_esm.Ay.div(UploadLoader_templateObject_2||(UploadLoader_templateObject_2=UploadLoader_makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n"],["\n display: flex;\n justify-content: space-between;\n"]))),UploadLoader_ContentBody=styled_components_browser_esm.Ay.div(UploadLoader_templateObject_3||(UploadLoader_templateObject_3=UploadLoader_makeTemplateObject(["\n ","\n font-size: ",";\n color: ",";\n margin: 0;\n width: 100%;\n margin-bottom: 32px;\n min-height: 190px;\n position: relative;\n"],["\n ","\n font-size: ",";\n color: ",";\n margin: 0;\n width: 100%;\n margin-bottom: 32px;\n min-height: 190px;\n position: relative;\n"])),fontNormal400,fontSizes_m,palette_blackRgb75),UploadLoader_ProgressBar=styled_components_browser_esm.Ay.progress(UploadLoader_templateObject_4||(UploadLoader_templateObject_4=UploadLoader_makeTemplateObject(["\n z-index: 1;\n margin-top: -14.5px;\n width: 100%;\n background-color: ",";\n border: none;\n border-radius: 15px;\n height: 4px;\n &::-webkit-progress-bar {\n margin: 0 auto;\n background-color: ",";\n border-radius: 15px;\n height: 4px;\n }\n &::-moz-progress-bar {\n margin: 0 auto;\n background-color: ",";\n border-radius: 15px;\n height: 4px;\n }\n &::-webkit-progress-value {\n float: left;\n height: 4px;\n margin: 0px -10px 0 0;\n background: ",";\n border-radius: 15px;\n }\n"],["\n z-index: 1;\n margin-top: -14.5px;\n width: 100%;\n background-color: ",";\n border: none;\n border-radius: 15px;\n height: 4px;\n &::-webkit-progress-bar {\n margin: 0 auto;\n background-color: ",";\n border-radius: 15px;\n height: 4px;\n }\n &::-moz-progress-bar {\n margin: 0 auto;\n background-color: ",";\n border-radius: 15px;\n height: 4px;\n }\n &::-webkit-progress-value {\n float: left;\n height: 4px;\n margin: 0px -10px 0 0;\n background: ",";\n border-radius: 15px;\n }\n"])),palette_lightgray,palette_lightgray,(function(_a){return _a.color}),(function(_a){return _a.color})),UploadLoader_ProgressText=styled_components_browser_esm.Ay.div(UploadLoader_templateObject_5||(UploadLoader_templateObject_5=UploadLoader_makeTemplateObject(["\n width: 100%;\n text-align: left;\n margin-bottom: 16px;\n height: 24px;\n font-size: 16px;\n line-height: 1.5;\n color: #4e5461;\n margin-top: 32px;\n"],["\n width: 100%;\n text-align: left;\n margin-bottom: 16px;\n height: 24px;\n font-size: 16px;\n line-height: 1.5;\n color: #4e5461;\n margin-top: 32px;\n"]))),UploadLoader=function(_a){var loaded,total,loadedMB,totalMB,progressState=_a.progressState,uploadToS3Progress=_a.uploadToS3Progress,createProgress=_a.createProgress,encodeProgress=_a.encodeProgress,isMobileDevice=checkIfMobileDevice(),colors=(0,styled_components_browser_esm.DP)().colors;return(0,jsx_runtime.jsx)(UploadLoader_ContentBody,{children:(0,jsx_runtime.jsxs)(UploadLoader_FlexCenter,UploadLoader_assign({style:{padding:isMobileDevice?0:32}},{children:[(0,jsx_runtime.jsxs)(UploadLoader_ProgressContainer,{children:[(0,jsx_runtime.jsx)(ProgressCircle,{progress:uploadToS3Progress,progressType:"upload"}),(0,jsx_runtime.jsx)(ProgressCircle,{progress:createProgress,progressType:"create"}),(0,jsx_runtime.jsx)(ProgressCircle,{progress:encodeProgress,progressType:"encode"})]}),(0,jsx_runtime.jsx)(UploadLoader_ProgressBar,{value:progressState?progressState==RECORD_LOADER_STATUS.UPLOADING?50*uploadToS3Progress.percentage/100:progressState==RECORD_LOADER_STATUS.CREATE?50+(createProgress.percentage||0):100:0,max:100,color:colors.primary[100]}),(0,jsx_runtime.jsx)(UploadLoader_ProgressText,{children:(loaded=uploadToS3Progress.loaded,total=uploadToS3Progress.total,loadedMB=(loaded/1e3).toFixed(2),totalMB=(total/1e3).toFixed(2),"".concat(loadedMB," MB/").concat(totalMB," MB"))})]}))})};!function(PROMPT_USE_CASE){PROMPT_USE_CASE.INITIAL_REACH_OUT="Initial Reach Out",PROMPT_USE_CASE.INITIAL_INQUIRY_REPLY="Initial Inquiry Reply",PROMPT_USE_CASE.VEHICLE_WALKAROUND="Vehicle Walkaround",PROMPT_USE_CASE.TEST_DRIVE_INVITATION="Test Drive Invitation",PROMPT_USE_CASE.APPOINTMENT_REMINDER="Appointment Reminder",PROMPT_USE_CASE.MISSED_APPOINTMENT="Missed Appointment",PROMPT_USE_CASE.UNSOLD_FOLLOW_UP="Unsold Follow Up",PROMPT_USE_CASE.EVENT_PROMOTION_ALERT="Event & Promotion Alert",PROMPT_USE_CASE.POST_SALE_FOLLOW_UP="Post-Sale Follow-Up",PROMPT_USE_CASE.REVIEW_REFERRAL_REQUEST="Review or Referral Request",PROMPT_USE_CASE.SERVICE_MAINTENANCE_REMINDERS="Service and Maintenance Reminders",PROMPT_USE_CASE.NONE=""}(PROMPT_USE_CASE||(PROMPT_USE_CASE={}));var FolderDropdown_templateObject_1,FolderDropdown_templateObject_2,FolderDropdown_templateObject_3,FolderDropdown_templateObject_4,FolderDropdown_templateObject_5,FolderDropdown_templateObject_6,decodeAndReplaceText=function(value,isReplace){void 0===isReplace&&(isReplace=!1);try{return isReplace?decodeURIComponent(value).replaceAll(" "," "):decodeURIComponent(value)}catch(error){return value}},sizeToSpeedRatioLarge=[{value:4e3,label:"160 words / min"},{value:2e3,label:"200 words / min"},{value:1e3,label:"240 words / min"}],sizeToSpeedRatioMedium=[{value:6e3,label:"160 words / min"},{value:4e3,label:"200 words / min"},{value:2e3,label:"240 words / min"}],sizeToSpeedRatioSmall=[{value:8e3,label:"160 words / min"},{value:6e3,label:"200 words / min"},{value:4e3,label:"240 words / min"}],handleScriptSpeedUsingScriptSize=function(ele){switch(ele){case"small":return sizeToSpeedRatioSmall;case"large":default:return sizeToSpeedRatioMedium;case"x-large":return sizeToSpeedRatioLarge}},formatBytes=function(bytes,decimals){if(void 0===decimals&&(decimals=2),0===bytes)return"0 Bytes";var dm=decimals<0?0:decimals,i=Math.floor(Math.log(bytes)/Math.log(1024));return addThousandCommaSeparator(parseFloat((bytes/Math.pow(1024,i)).toFixed(dm)))+" "+["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][i]},addThousandCommaSeparator=function(n,roundDecimal){return void 0===roundDecimal&&(roundDecimal=!1),n.toLocaleString("en",roundDecimal?{minimumFractionDigits:2,maximumFractionDigits:2}:{})},getStatusText=function(status){return status===statuses_WAITING?"Waiting…":status===statuses_UPLOADING?"Uploading…":status===statuses_CANCELING?"Canceling…":status===statuses_CANCELED?"Canceled":status===statuses_GENERATING_PREVIEW?"Generating Preview URL...":"Finished"},getStatusColor=function(status){return status===statuses_WAITING?"#9297A2":palette_primaryDarkBlue},getStatusSize=function(file){return file.status===statuses_UPLOADING?"".concat(file.currentUpload," / ").concat(file.sizeText):file.sizeText},foldersKeys_all=function(){return["FOLDERS"]},getFolders_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},getFolders_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},getFolders_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},getFolders_spreadArray=function(to,from,pack){if(pack||2===arguments.length)for(var ar,i=0,l=from.length;i<l;i++)!ar&&i in from||(ar||(ar=Array.prototype.slice.call(from,0,i)),ar[i]=from[i]);return to.concat(ar||Array.prototype.slice.call(from))},useGetFolders=function(params){return(0,es.useQuery)(foldersKeys_all(),(function(){return function(params){return getFolders_awaiter(void 0,void 0,Promise,(function(){return getFolders_generator(this,(function(_a){switch(_a.label){case 0:return[4,config_EXPRESS_API.get("folders/new",{params})];case 1:return[2,_a.sent().data]}}))}))}(params)}),{select:function(data){var folders=data&&data.folders||[];return getFolders_spreadArray(getFolders_spreadArray([],getFolders_read(folders),!1),[{folderId:ALL_FOLDERS_value,name:ALL_FOLDERS_label,isDeletable:!1}],!1)}})},FolderDropdown_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},FolderDropdown_assign=function(){return FolderDropdown_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},FolderDropdown_assign.apply(this,arguments)},FolderDropdown_rest=function(s,e){var t={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0&&(t[p]=s[p]);if(null!=s&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(p=Object.getOwnPropertySymbols(s);i<p.length;i++)e.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i])&&(t[p[i]]=s[p[i]])}return t},FOLDER_GROUP_LABEL_MY_FOLDERS="MY FOLDERS",FOLDER_GROUP_LABEL_SHARED_WITH_ME="SHARED WITH ME",FolderDropdown_LabelContainer=styled_components_browser_esm.Ay.div(FolderDropdown_templateObject_1||(FolderDropdown_templateObject_1=FolderDropdown_makeTemplateObject(["\n display: flex;\n align-items: center;\n padding: 7px 16px 0px 16px;\n gap: 12px;\n"],["\n display: flex;\n align-items: center;\n padding: 7px 16px 0px 16px;\n gap: 12px;\n"]))),FolderDropdown_Label=(0,styled_components_browser_esm.Ay)(CommonTypography).attrs({as:"p"})(FolderDropdown_templateObject_2||(FolderDropdown_templateObject_2=FolderDropdown_makeTemplateObject(["\n font-size: 11px;\n line-height: 16px;\n font-weight: 600;\n color: ",";\n"],["\n font-size: 11px;\n line-height: 16px;\n font-weight: 600;\n color: ",";\n"])),(function(_a){return _a.theme.colors.primary[40]})),Line=styled_components_browser_esm.Ay.div(FolderDropdown_templateObject_3||(FolderDropdown_templateObject_3=FolderDropdown_makeTemplateObject(["\n flex: 1;\n width: 100%;\n height: 1px;\n background-color: ",";\n"],["\n flex: 1;\n width: 100%;\n height: 1px;\n background-color: ",";\n"])),(function(_a){return _a.theme.colors.primary[5]})),OptionChildSubTitle=styled_components_browser_esm.Ay.div(FolderDropdown_templateObject_4||(FolderDropdown_templateObject_4=FolderDropdown_makeTemplateObject(["\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 1;\n align-self: stretch;\n overflow: hidden;\n color: var(--covideo-grey-80, #4e5461);\n text-overflow: ellipsis;\n\n /* Other/Charts Label */\n font-size: 12px;\n font-style: normal;\n font-weight: 500;\n line-height: 16px; /* 133.333% */\n"],["\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 1;\n align-self: stretch;\n overflow: hidden;\n color: var(--covideo-grey-80, #4e5461);\n text-overflow: ellipsis;\n\n /* Other/Charts Label */\n font-size: 12px;\n font-style: normal;\n font-weight: 500;\n line-height: 16px; /* 133.333% */\n"]))),SharedOptionWrapper=styled_components_browser_esm.Ay.div(FolderDropdown_templateObject_5||(FolderDropdown_templateObject_5=FolderDropdown_makeTemplateObject(["\n display: block;\n width: 100%;\n"],["\n display: block;\n width: 100%;\n"]))),OptionChildWrapper=styled_components_browser_esm.Ay.div(FolderDropdown_templateObject_6||(FolderDropdown_templateObject_6=FolderDropdown_makeTemplateObject(["\n width: 100%;\n overflow: hidden;\n color: var(--covideo-grey-80, #4e5461);\n text-overflow: ellipsis;\n white-space: nowrap;\n"],["\n width: 100%;\n overflow: hidden;\n color: var(--covideo-grey-80, #4e5461);\n text-overflow: ellipsis;\n white-space: nowrap;\n"]))),getIcon=function(iconName,isSelected,id,value){if(void 0===iconName)return null;switch(iconName){case"folder":return id.includes("option-0")&&value!==ALL_FOLDERS_value?(0,jsx_runtime.jsx)("div",FolderDropdown_assign({style:{marginRight:"-6px",marginBottom:"-3px"}},{children:(0,jsx_runtime.jsx)(md_index_esm.KrV,{size:16})})):isSelected&&(0,jsx_runtime.jsx)(io_index_esm.N__,{size:20});case"sharedFolder":return isSelected?isSelected&&(0,jsx_runtime.jsx)(io_index_esm.N__,{size:20}):(0,jsx_runtime.jsx)("div",FolderDropdown_assign({style:{marginRight:"-6px",marginBottom:"-3px"}},{children:(0,jsx_runtime.jsx)(md_index_esm.ZMt,{size:16})}));case"accounts":return isSelected?isSelected&&(0,jsx_runtime.jsx)(io_index_esm.N__,{size:20}):(0,jsx_runtime.jsx)("div",FolderDropdown_assign({style:{marginRight:"-6px",marginBottom:"-3px"}},{children:(0,jsx_runtime.jsx)(md_index_esm.bJB,{size:16})}));default:return null}},CustomOption=function(_a){var children=_a.children,props=FolderDropdown_rest(_a,["children"]),selectProps=props.selectProps,isSelected=props.isSelected,innerProps=props.innerProps;return children===FOLDER_GROUP_LABEL_MY_FOLDERS||children===FOLDER_GROUP_LABEL_SHARED_WITH_ME?(0,jsx_runtime.jsxs)(FolderDropdown_LabelContainer,{children:[(0,jsx_runtime.jsx)(FolderDropdown_Label,{children}),(0,jsx_runtime.jsx)(Line,{})]}):(0,jsx_runtime.jsx)(index_75b02bac_browser_esm.F.Option,FolderDropdown_assign({},props,{children:(0,jsx_runtime.jsxs)(SharedOptionWrapper,{children:[(0,jsx_runtime.jsxs)(OptionWrapper,{children:[(0,jsx_runtime.jsx)(OptionChildWrapper,{children}),(0,jsx_runtime.jsx)(OptionIconWrapper,{children:getIcon(props.data.isFolderShared||props.data.access?props.data.access?"accounts":"sharedFolder":selectProps.icon,isSelected,innerProps.id,props.data.value)})]}),!!props.data.sharedBy&&(0,jsx_runtime.jsxs)(OptionChildSubTitle,{children:["Shared by ",props.data.sharedBy]})]})}))},FolderDropdown=function(props){var options=props.options,value=props.value,onChange=props.onChange,themes=(0,styled_components_browser_esm.DP)(),commonProps={options,value,onChange},styles={container:function(base){return FolderDropdown_assign({},base)},control:function(base,props){return FolderDropdown_assign(FolderDropdown_assign(FolderDropdown_assign(FolderDropdown_assign({},base),{boxShadow:"none",borderRadius:6,minHeight:"40px",cursor:"pointer"}),getControlStyles(props)),{"&:hover":{borderColor:themes.colors.primary[100]},"&:focus-within":{borderColor:themes.colors.primary[100]}})},singleValue:function(base){return FolderDropdown_assign(FolderDropdown_assign({},base),{width:"95%"})},valueContainer:function(base){return FolderDropdown_assign(FolderDropdown_assign({},base),{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",flexWrap:"nowrap"})},input:function(base){return FolderDropdown_assign({},base)},menuPortal:function(base){return FolderDropdown_assign(FolderDropdown_assign({},base),{zIndex:9999})},menuList:function(base){return FolderDropdown_assign(FolderDropdown_assign({},base),{height:"auto"})},menu:function(base){return FolderDropdown_assign(FolderDropdown_assign({},base),{marginTop:2,color:palette_primaryDarkBlue})},option:function(base,props){return FolderDropdown_assign(FolderDropdown_assign(FolderDropdown_assign({},base),{height:40,display:"flex",alignItems:"center",padding:"0 16px",cursor:"pointer",transition:"all 0.3s",fontWeight:600,fontSize:15,zIndex:1}),getOptionStyles(props,themes))}};return(0,jsx_runtime.jsx)(dist_react_select_browser_esm.Ay,FolderDropdown_assign({},commonProps,{icon:"folder",error:!1,className:"dropdown",placeholder:"Filter by type...",isDisabled:!1,"aria-label":"Aria label is missing",menuPosition:"absolute",menuPlacement:"auto",optionHeight:48,maxMenuHeight:220,menuShouldScrollIntoView:!1,menuPortalTarget:null,isLoading:!1,components:{DropdownIndicator:function(props){return(0,jsx_runtime.jsx)(DropdownArrowIcon,FolderDropdown_assign({menuIsOpen:props.selectProps.menuIsOpen},{children:(0,jsx_runtime.jsx)(md_index_esm.q0c,{size:18,opacity:.5})}))},IndicatorSeparator:function(){return null},Option:CustomOption,SingleValue:function(props){return props.children}},styles,isSearchable:!0}))},productFeature_VIRTUAL_BACKGROUNDS=10,productFeature_FOLDER_ORGANIZATION=11,productFeature_TELEPROMPTER=50,checkIfFeatureIsEnabled=function(userData,featureId){return!!featureId&&(!!(userData&&userData.user&&userData.user.packageDetails)&&(0===userData.user.packageDetails.id||!(!userData.user.packageDetails.products||!userData.user.packageDetails.products.length)&&userData.user.packageDetails.products.includes(featureId)))},VideoUploadFolderDropdown_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},VideoUploadFolderDropdown_assign=function(){return VideoUploadFolderDropdown_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},VideoUploadFolderDropdown_assign.apply(this,arguments)},VideoUploadFolderDropdown_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},VideoUploadFolderDropdown_spreadArray=function(to,from,pack){if(pack||2===arguments.length)for(var ar,i=0,l=from.length;i<l;i++)!ar&&i in from||(ar||(ar=Array.prototype.slice.call(from,0,i)),ar[i]=from[i]);return to.concat(ar||Array.prototype.slice.call(from))},VideoUploadFolderDropdown_FOLDER_GROUP_LABEL_MY_FOLDERS="MY FOLDERS",VideoUploadFolderDropdown_FOLDER_GROUP_LABEL_SHARED_WITH_ME="SHARED WITH ME",FOLDER_GROUP_VALUE_MY_FOLDERS="my_folders",FOLDER_GROUP_VALUE_SHARED_WITH_ME="shared_with_me",DropdownWrapper=styled_components_browser_esm.Ay.div(VideoUploadFolderDropdown_templateObject_1||(VideoUploadFolderDropdown_templateObject_1=VideoUploadFolderDropdown_makeTemplateObject(["\n width: ",";\n margin-top: 12px;\n margin-bottom: 12px;\n justify-content: center;\n"],["\n width: ",";\n margin-top: 12px;\n margin-bottom: 12px;\n justify-content: center;\n"])),(function(_a){return _a.width})),VideoUploadFolderDropdown_Label=styled_components_browser_esm.Ay.div(VideoUploadFolderDropdown_templateObject_2||(VideoUploadFolderDropdown_templateObject_2=VideoUploadFolderDropdown_makeTemplateObject(["\n font-weight: 500;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n margin-bottom: 8px;\n"],["\n font-weight: 500;\n font-size: 14px;\n line-height: 20px;\n color: ",";\n margin-bottom: 8px;\n"])),palette_midGrey);const recordv1_VideoUploadFolderDropdown=function(_a){var value=_a.value,setValue=_a.setValue,_b=_a.showSharedWithMeFolders,showSharedWithMeFolders=void 0===_b||_b,_c=_a.showLabel,showLabel=void 0===_c||_c,_d=_a.width,width=void 0===_d?"100%":_d,_e=_a.showAllFolderOption,showAllFolderOption=void 0===_e||_e,userData=useAuthorizationContext().userData,_f=useGetFolders({getShared:!0}),_g=_f.data,folders=void 0===_g?[]:_g,getLatestFolders=_f.refetch,isFolderOrganizationEnabled=checkIfFeatureIsEnabled(userData,productFeature_FOLDER_ORGANIZATION);(0,react.useEffect)((function(){getLatestFolders()}),[]);var folderOptions=[];if(isFolderOrganizationEnabled){var ownedFolders=(null==folders?void 0:folders.filter((function(folder){return!folder.hasOwnProperty("access")&&folder.folderId!==ALL_FOLDERS_value})).map((function(folder){return{value:folder.folderId,label:folder.name,isFolderShared:!!folder.isFolderShared,access:!!folder.hasOwnProperty("access")}})))||[],sharedFolders=(null==folders?void 0:folders.filter((function(folder){return!!folder.hasOwnProperty("access")&&"edit"===folder.access})).map((function(folder){return{value:folder.folderId,label:folder.name,isFolderShared:!!folder.isFolderShared,access:!!folder.hasOwnProperty("access"),sharedBy:folder.sharedBy}})))||[];showAllFolderOption&&(folderOptions=[{value:ALL_FOLDERS_value,label:ALL_FOLDERS_label,isFolderShared:!1,access:!1}]),folderOptions=folderOptions.concat([{value:FOLDER_GROUP_VALUE_MY_FOLDERS,label:VideoUploadFolderDropdown_FOLDER_GROUP_LABEL_MY_FOLDERS,isFolderShared:!1,access:!1}]),ownedFolders.length&&(folderOptions=folderOptions.concat(ownedFolders)),showSharedWithMeFolders&&sharedFolders.length&&(folderOptions=folderOptions.concat([{value:FOLDER_GROUP_VALUE_SHARED_WITH_ME,label:VideoUploadFolderDropdown_FOLDER_GROUP_LABEL_SHARED_WITH_ME,isFolderShared:!1,access:!1}],sharedFolders))}return(0,react.useEffect)((function(){folders&&folders.length&&setValue&&setValue({value:folders[0].folderId.toString(),label:folders[0].name})}),[folders]),(0,jsx_runtime.jsxs)(DropdownWrapper,VideoUploadFolderDropdown_assign({width},{children:[showLabel&&(0,jsx_runtime.jsx)(VideoUploadFolderDropdown_Label,{children:"Select Folder"}),(0,jsx_runtime.jsx)(FolderDropdown,{value,onChange:function(option){setValue&&setValue(option)},options:VideoUploadFolderDropdown_spreadArray([],VideoUploadFolderDropdown_read(folderOptions),!1)})]}))};var VideoUploadFolderDropdown_templateObject_1,VideoUploadFolderDropdown_templateObject_2,DetailsPreview_templateObject_1,DetailsPreview_templateObject_2,DetailsPreview_templateObject_3,DetailsPreview_templateObject_4,DetailsPreview_templateObject_5,DetailsPreview_templateObject_6,DetailsPreview_templateObject_7,DetailsPreview_templateObject_8,Scroller_templateObject_1,DetailsPreview_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},DetailsPreview_assign=function(){return DetailsPreview_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},DetailsPreview_assign.apply(this,arguments)},DetailsPreview_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},DEFAULT_UPLOAD_FOLDER={value:-2,label:"Primary",isFolderShared:!1,access:"edit"},DetailsPreview_Container=styled_components_browser_esm.Ay.div(DetailsPreview_templateObject_2||(DetailsPreview_templateObject_2=DetailsPreview_makeTemplateObject(["\n padding-bottom: 64px;\n display: flex;\n position: relative;\n margin: 32px auto 0 auto;\n width: 1000px;\n flex-direction: column;\n\n ","\n"],["\n padding-bottom: 64px;\n display: flex;\n position: relative;\n margin: 32px auto 0 auto;\n width: 1000px;\n flex-direction: column;\n\n ","\n"])),(function(_a){return _a.theme.containerWidth<screenSizes_md&&(0,styled_components_browser_esm.AH)(DetailsPreview_templateObject_1||(DetailsPreview_templateObject_1=DetailsPreview_makeTemplateObject(["\n width: 100%;\n "],["\n width: 100%;\n "])))})),DetailsPreview_VideoWrapper=styled_components_browser_esm.Ay.div(DetailsPreview_templateObject_3||(DetailsPreview_templateObject_3=DetailsPreview_makeTemplateObject(["\n margin-bottom: 24px;\n max-width: 488px;\n .fullscreen {\n height: auto;\n display: block;\n }\n"],["\n margin-bottom: 24px;\n max-width: 488px;\n .fullscreen {\n height: auto;\n display: block;\n }\n"]))),FormStyles=(0,styled_components_browser_esm.Ay)(formik_esm.lV)(DetailsPreview_templateObject_5||(DetailsPreview_templateObject_5=DetailsPreview_makeTemplateObject(["\n width: 380px;\n\n ","\n"],["\n width: 380px;\n\n ","\n"])),(function(_a){return _a.theme.containerWidth<screenSizes_md&&(0,styled_components_browser_esm.AH)(DetailsPreview_templateObject_4||(DetailsPreview_templateObject_4=DetailsPreview_makeTemplateObject(["\n width: 100%;\n "],["\n width: 100%;\n "])))})),FormBody=(0,styled_components_browser_esm.Ay)(Gap)(DetailsPreview_templateObject_7||(DetailsPreview_templateObject_7=DetailsPreview_makeTemplateObject(["\n flex-flow: initial;\n align-items: flex-start;\n justify-content: space-between;\n\n ","\n"],["\n flex-flow: initial;\n align-items: flex-start;\n justify-content: space-between;\n\n ","\n"])),(function(_a){return _a.theme.containerWidth<screenSizes_md&&(0,styled_components_browser_esm.AH)(DetailsPreview_templateObject_6||(DetailsPreview_templateObject_6=DetailsPreview_makeTemplateObject(["\n flex-direction: column-reverse;\n "],["\n flex-direction: column-reverse;\n "])))})),RecorderLoaderWrapper=(0,styled_components_browser_esm.Ay)(Gap)(DetailsPreview_templateObject_8||(DetailsPreview_templateObject_8=DetailsPreview_makeTemplateObject(["\n width: 770px;\n height: 437px;\n background: '#f6f7f9';\n margin-top: 90px;\n"],["\n width: 770px;\n height: 437px;\n background: '#f6f7f9';\n margin-top: 90px;\n"]))),DetailsRecordingPreview=function(_a){var _b,dateOfMonth,ordinalLetters,videoBlob=_a.videoBlob,handleGoToRecordHome=_a.handleGoToRecordHome,_c=DetailsPreview_read((0,react.useState)(null),2),videoUrl=_c[0],setVideoUrl=_c[1],userData=useAuthorizationContext().userData,history=(0,react_router.W6)(),customer=userData.customer,userId=userData.userId,_d=DetailsPreview_read((0,react.useState)(!1),2),contineToInsert=_d[0],setContineToInsert=_d[1],initialCovideoName=(dateOfMonth=dayjs_min_default()(new Date).date(),ordinalLetters="th",1===dateOfMonth||21===dateOfMonth||31===dateOfMonth?ordinalLetters="st":2===dateOfMonth||22===dateOfMonth?ordinalLetters="nd":3!==dateOfMonth&&23!==dateOfMonth||(ordinalLetters="rd"),dayjs_min_default()(new Date).format("MMM D[".concat(ordinalLetters,"] YYYY @ h:mm A"))),isMobileDevice=checkIfMobileDevice(),_e=function(_a){var _b,_c,contineToInsert=_a.contineToInsert,userData=useAuthorizationContext().userData,isAutomotive=checkIfAutomotive(userData),history=(0,react_router.W6)(),_d=useVideoRecorderUpload_read((0,react.useState)(RECORD_LOADER_STATUS.UPLOADING),2),progressState=_d[0],setProgressState=_d[1],_e=useVideoRecorderUpload_read((0,react.useState)(!1),2),loadingStarted=_e[0],setLoadingIsStared=_e[1],_f=useVideoRecorderUpload_read((0,react.useState)(null),2),recordingFormData=_f[0],setRecordingFormData=_f[1],_g=useAwsSignedUrlQuery({fileName:(null===(_b=null==recordingFormData?void 0:recordingFormData.file)||void 0===_b?void 0:_b.name)||"",type:(null===(_c=null==recordingFormData?void 0:recordingFormData.file)||void 0===_c?void 0:_c.type)||""},!!(null==recordingFormData?void 0:recordingFormData.title)),presignedUrlData=_g.data,isLoadingUrl=_g.isLoading,urlErrorData=_g.error,_h=useS3UploadMutation(),uploadVideoToS3=_h.mutateAsync,isUploading=_h.isLoading,uploadError=_h.error,uploadToS3Progress=_h.progress,_j=useCreateVideoMutation(),createVideo=_j.mutateAsync,isCreating=_j.isLoading,createError=_j.error,createProgress=_j.progress,_k=useEncodeVideoMutation(),encodeVideo=_k.mutateAsync,encodeProgress=_k.progress,isEncoding=_k.isLoading,isErrorEncoding=_k.isError;(0,react.useEffect)((function(){(null==presignedUrlData?void 0:presignedUrlData.url)&&recordingFormData&&startUpload()}),[presignedUrlData,recordingFormData]);var startUpload=function(){return useVideoRecorderUpload_awaiter(void 0,void 0,void 0,(function(){var createResponse,error_1,_a,_b,_c,_d;return useVideoRecorderUpload_generator(this,(function(_e){switch(_e.label){case 0:setLoadingIsStared(!0),_e.label=1;case 1:return _e.trys.push([1,7,,8]),(null==presignedUrlData?void 0:presignedUrlData.url)&&recordingFormData?(setProgressState(RECORD_LOADER_STATUS.UPLOADING),[4,uploadVideoToS3({url:presignedUrlData.url,file:recordingFormData.file,contentType:"video/webm"})]):[3,6];case 2:return _e.sent(),setProgressState(RECORD_LOADER_STATUS.CREATE),[4,createVideo(useVideoRecorderUpload_assign({filename:recordingFormData.file.name,title:recordingFormData.title,folder:recordingFormData.folder.label,isFreemium:!1,videoTags:recordingFormData.videoTags,videoAttributeValues:recordingFormData.attributes.map((function(attr){return{attributeId:attr.attributeId,value:attr.value}}))},isAutomotive&&recordingFormData.videoRequest&&{videoRequest:(obj={repairOrderNumber:recordingFormData.videoRequest.repairOrderNumber,advisorId:recordingFormData.videoRequest.advisorId?Number(recordingFormData.videoRequest.advisorId):"",videoType:recordingFormData.videoRequest.videoType,vin:recordingFormData.videoRequest.vehicle.vin,note:recordingFormData.videoRequest.note,customerName:recordingFormData.videoRequest.customerName},Object.fromEntries(Object.entries(obj).filter((function(_a){var _b=useVideoRecorderUpload_read(_a,2),v=(_b[0],_b[1]);return null!==v&&""!==v}))))}))];case 3:return pushToDataLayer({event:"covideo-event",event_name:"Saved New Video",creation_type:"Recorded",video_id:(createResponse=_e.sent()).id,video_title:createResponse.title,video_type:null===(_a=createResponse.videoRequest)||void 0===_a?void 0:_a.videoType,video_customer_name:null===(_b=createResponse.videoRequest)||void 0===_b?void 0:_b.customerName,VIN:null===(_c=createResponse.videoRequest)||void 0===_c?void 0:_c.vin}),console.log("createResponse",createResponse),createResponse?(setProgressState(RECORD_LOADER_STATUS.ENCODE),[4,encodeVideo({videoId:null===(_d=null==createResponse?void 0:createResponse.id)||void 0===_d?void 0:_d.toString(),customerId:userData.customerId})]):[3,5];case 4:_e.sent(),_e.label=5;case 5:if(setProgressState(RECORD_LOADER_STATUS.UPLOAD_COMPLETED),contineToInsert)return history.push("/insert-video/".concat(createResponse.id,"/")),[2];history.push("/"),setLoadingIsStared(!1),_e.label=6;case 6:return[3,8];case 7:return error_1=_e.sent(),console.error("Error during upload:",error_1),setProgressState(RECORD_LOADER_STATUS.ERROR),setLoadingIsStared(!1),[3,8];case 8:return[2]}var obj}))}))};return{isError:uploadError||createError||urlErrorData||isErrorEncoding,setRecordingFormData,isLoading:isLoadingUrl||isUploading||isCreating||isEncoding||loadingStarted,progressState,uploadToS3Progress,createProgress,encodeProgress}}({contineToInsert}),setRecordingFormData=_e.setRecordingFormData,isSubmittingForm=_e.isLoading,createProgress=_e.createProgress,encodeProgress=_e.encodeProgress,uploadToS3Progress=_e.uploadToS3Progress,progressState=_e.progressState,isAutomotive=checkIfAutomotive(userData),isAutomotiveService=checkIfAutomotiveServiceRole(userData),isTechnician=userData.automotiveRole===types_AutomotiveRole.TECHNICIAN,ref=(0,react.useRef)(),_f=useGetAllVideoAttributesQuery({page:0,size:200,filterByDepartment:!0}),data=_f.data,isLoading=_f.isLoading,params=[{customerId:customer.customerId,role:types_AutomotiveRole.SERVICE_ADVISOR},{customerId:customer.customerId,role:types_AutomotiveRole.SERVICE_MANAGER}],_g=useGetUsersByAutomotiveRolesQuery({params,enabled:isAutomotiveService}),isGettingAutomotiveUsers=_g.isLoading,results=_g.results;(0,react.useEffect)((function(){var url=URL.createObjectURL(videoBlob);return setVideoUrl(url),function(){URL.revokeObjectURL(url)}}),[videoBlob]);var attributes=(null===(_b=null==data?void 0:data.attributes)||void 0===_b?void 0:_b.map((function(field){var _a,_b,defaultDropdownValue="dropdown"===field.type&&(null===(_b=null===(_a=field.dropdownValues)||void 0===_a?void 0:_a.find((function(value){return value.default})))||void 0===_b?void 0:_b.value);return DetailsPreview_assign({value:defaultDropdownValue||(null==field?void 0:field.default)||""},field)})))||[],validationSchema=yup_es.Ik().shape(DetailsPreview_assign({attributes:yup_es.YO().of(yup_es.Ik().shape({value:yup_es.Yj().when("isRequired",{is:1,then:yup_es.Yj().required("This field is required"),otherwise:yup_es.Yj()})})),title:yup_es.Yj().trim().required("Title is required").matches(/^[^.]*$/,"Title should not contain a dot (.)")},isAutomotive?{videoRequest:yup_es.Ik().shape({advisorId:yup_es.Yj().when([],{is:function(){return isTechnician},then:yup_es.Yj().nullable().required("Advisor ID is required"),otherwise:yup_es.Yj()}),repairOrderNumber:yup_es.Yj().when([],{is:function(){return isTechnician},then:yup_es.Yj().required("Repair Order Number is required"),otherwise:yup_es.Yj()})})}:{}));if(isLoading||isGettingAutomotiveUsers||null===videoUrl)return(0,jsx_runtime.jsx)(LoadingIndicator,{isLoading:!0});if(isSubmittingForm)return(0,jsx_runtime.jsx)(RecorderLoaderWrapper,DetailsPreview_assign({style:{width:isMobileDevice?"100%":770}},{children:(0,jsx_runtime.jsx)(UploadLoader,{progressState,encodeProgress,uploadToS3Progress,createProgress})}));var INITIAL_VALUES=DetailsPreview_assign({title:initialCovideoName,folder:DEFAULT_UPLOAD_FOLDER,videoTags:[],attributes},isAutomotive?{videoRequest:{customerName:"",videoType:"",vehicle:{vin:"",stockNumber:""},advisorId:isAutomotiveService&&!isTechnician?userId:"",repairOrderNumber:"",note:""}}:{});return(0,jsx_runtime.jsxs)(DetailsPreview_Container,{children:[(0,jsx_runtime.jsx)(formik_esm.l1,DetailsPreview_assign({initialValues:INITIAL_VALUES,validateOnMount:!0,onSubmit:function(values){var fileName=function(fileExt,userData){var randomSuffix=(Math.random()+1).toString(36).substring(2);return"".concat(userData.userId,"_").concat(userData.customerId,"_").concat(randomSuffix,".").concat(fileExt)}("webm",userData),videoFile=new File([videoBlob],fileName,{type:videoBlob.type});setRecordingFormData(DetailsPreview_assign(DetailsPreview_assign({},values),{file:videoFile}))},validationSchema},{children:function(_a){var values=_a.values,setFieldValue=_a.setFieldValue;return(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(DetailsPreviewHeader,{handleGoToRecordHome,setContineToInsert}),(0,jsx_runtime.jsxs)(FormBody,DetailsPreview_assign({flexDirection:"column",width:"100%",gap:"36px"},{children:[(0,jsx_runtime.jsxs)(FormStyles,{children:[(0,jsx_runtime.jsx)(FormikInputField,{name:"title",label:"Video Title",isRequired:!0}),(0,jsx_runtime.jsx)(formik_esm.D0,{name:"folder",component:recordv1_VideoUploadFolderDropdown,value:values.folder,setValue:function(val){return setFieldValue("folder",val)},showAllFolderOption:!1}),(0,jsx_runtime.jsx)(DetailsRecordPreviewTags,{}),(0,jsx_runtime.jsx)(DetailsPreviewAttributesHeader,{}),(0,jsx_runtime.jsx)(VideoRequestDetails,{results,fetchSoldVehiclesForAutomotive:!1}),(0,jsx_runtime.jsx)(DetailsPreviewVideoAttributes,{})]}),(0,jsx_runtime.jsx)(DetailsPreview_VideoWrapper,{children:(0,jsx_runtime.jsx)(VideoPlayer,{videoRef:ref,videoSource:videoUrl})})]}))]})}})),(0,jsx_runtime.jsx)(components_RouteLeavingGuard,{when:!0,stay:!0,navigate:function(path){return history.push(path)},shouldBlockNavigation:function(){return!0},title:"Leave without saving the recording?",text:"Your recording will not be saved. This action can’t be undone.",confirmButtonText:"Continue",discardButtonText:"Leave"})]})},RecordBoth=function(_a){var screenStream=_a.screenStream,stopAllStreams=_a.stopAllStreams,handleGoToRecordHome=_a.handleGoToRecordHome,_b=_a.showPreview,showPreview=void 0===_b||_b,onStartUpladingVoiceOverHandler=_a.onStartUpladingVoiceOverHandler,videoRef=(0,react.useRef)(null),_c=recordv1_useRecorder({screenStream,stopAllStreams,onStartUpladingVoiceOverHandler,videoRef,shouldStartCountdown:!browserChecks_isSafari,handleGoToRecordHome}),stopRecording=_c.stopRecording,pauseRecording=_c.pauseRecording,startCountDown=_c.startCountDown,stopCountDown=_c.stopCountDown,status=_c.status,recordedBlob=_c.recordedBlob,countdown=_c.countdown,timeInSeconds=_c.timeInSeconds;return status===RECORDING_STATUS.DONE&&recordedBlob&&showPreview?(0,jsx_runtime.jsx)(DetailsRecordingPreview,{videoBlob:recordedBlob,handleGoToRecordHome:function(){handleGoToRecordHome()}}):(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(RecordingHeaderWithRouteGuard,{status,handleGoToRecordHome}),(0,jsx_runtime.jsx)(RecorderBody,{videoRef,countdown,status}),(0,jsx_runtime.jsx)(recordv1_VideoRecorderActions,{startCountDown,stopCountDown,pauseRecording,stopRecording,status,timeInSeconds})]})},ScreenRecorder=function(_a){var screenStream=_a.screenStream,stopAllStreams=_a.stopAllStreams,handleGoToRecordHome=_a.handleGoToRecordHome,_b=_a.showPreview,showPreview=void 0===_b||_b,onStartUpladingVoiceOverHandler=_a.onStartUpladingVoiceOverHandler,videoRef=(0,react.useRef)(null),_c=recordv1_useRecorder({screenStream,stopAllStreams,onStartUpladingVoiceOverHandler,shouldStartCountdown:!0,videoRef,handleGoToRecordHome}),stopRecording=_c.stopRecording,pauseRecording=_c.pauseRecording,startCountDown=_c.startCountDown,stopCountDown=_c.stopCountDown,status=_c.status,recordedBlob=_c.recordedBlob,countdown=_c.countdown,timeInSeconds=_c.timeInSeconds;return status===RECORDING_STATUS.DONE&&recordedBlob&&showPreview?(0,jsx_runtime.jsx)(DetailsRecordingPreview,{videoBlob:recordedBlob,handleGoToRecordHome:function(){handleGoToRecordHome()}}):(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(RecordingHeaderWithRouteGuard,{status,handleGoToRecordHome}),(0,jsx_runtime.jsx)(RecorderBody,{videoRef,countdown,status}),(0,jsx_runtime.jsx)(recordv1_VideoRecorderActions,{startCountDown,stopCountDown,pauseRecording,stopRecording,status,timeInSeconds})]})},teleprompter_provider_assign=function(){return teleprompter_provider_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},teleprompter_provider_assign.apply(this,arguments)},teleprompter_provider_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},TeleprompterContext=(0,react.createContext)({}),TeleprompterProvider=function(_a){var children=_a.children,_b=teleprompter_provider_read((0,react.useState)(!1),2),isUsingTeleprompter=_b[0],setIsUsingTeleprompter=_b[1],_c=teleprompter_provider_read((0,react.useState)(!1),2),showTeleprompterModal=_c[0],setShowTeleprompterModal=_c[1],_d=teleprompter_provider_read((0,react.useState)(function(){var settingsFromStorage=localStorage.getItem("TeleprompterSettings");if(null===settingsFromStorage)return null;try{return JSON.parse(settingsFromStorage)}catch(error){return console.error("Error parsing localStorage data:",error),null}}()),2),teleprompterSettings=_d[0],setTeleprompterSettings=_d[1],_e=teleprompter_provider_read((0,react.useState)(!1),2),isTeleprompterPlaying=_e[0],setIsTeleprompterPlaying=_e[1],_f=teleprompter_provider_read((0,react.useState)(!1),2),isTeleprompterDisabled=_f[0],setTeleprompterDisabled=_f[1];return(0,jsx_runtime.jsx)(TeleprompterContext.Provider,teleprompter_provider_assign({value:{isUsingTeleprompter,showTeleprompterModal,teleprompterSettings,isTeleprompterPlaying,isTeleprompterDisabled,saveTeleprompterSettingsHandler:function(currentSettings){var data;setTeleprompterSettings(currentSettings),data=teleprompter_provider_assign(teleprompter_provider_assign({},currentSettings),{activeScriptId:"",content:""}),localStorage.setItem("TeleprompterSettings",JSON.stringify(data)),setShowTeleprompterModal(!1)},onEditOrTurnOnTeleprompterHandler:function(){isTeleprompterDisabled||(setIsUsingTeleprompter(!0),setShowTeleprompterModal(!0))},onDropdownTeleprompterSpeedChange:function(newValue){setIsTeleprompterPlaying(!1),setTeleprompterSettings(teleprompter_provider_assign(teleprompter_provider_assign({},teleprompterSettings),{speed:newValue,scriptSize:(null==teleprompterSettings?void 0:teleprompterSettings.scriptSize)||""})),setIsTeleprompterPlaying(!0)},turnOnTeleprompterPlaying:function(){setIsTeleprompterPlaying(!0)},toggleTeleprompterPlaying:function(){setIsTeleprompterPlaying(!isTeleprompterPlaying)},onTeleprompterModalClose:function(){setShowTeleprompterModal(!1),setIsUsingTeleprompter(!1)},turnOffTeleprompter:function(){setIsUsingTeleprompter(!1)},turnOnTeleprompter:function(){setIsUsingTeleprompter(!0)},disableOrEnableTeleprompter:function(isEnabled){setTeleprompterDisabled(isEnabled)}}},{children}))},useTeleprompter=function(){var context=(0,react.useContext)(TeleprompterContext);if(void 0===context)throw new Error("useTeleprompter must be used within a TeleprompterProvider");return context},BaseTeleprompterActions_assign=function(){return BaseTeleprompterActions_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},BaseTeleprompterActions_assign.apply(this,arguments)},BaseTeleprompterActions=function(_a){var status=_a.status,_b=(0,styled_components_browser_esm.DP)(),colors=_b.colors,isCdkEnviroment=_b.isCdkEnviroment,_c=useTeleprompter(),turnOffTeleprompter=_c.turnOffTeleprompter,onEditOrTurnOnTeleprompterHandler=_c.onEditOrTurnOnTeleprompterHandler,isUsingTeleprompter=_c.isUsingTeleprompter,isTeleprompterDisabled=_c.isTeleprompterDisabled;return(0,jsx_runtime.jsxs)(Gap,{children:[(0,jsx_runtime.jsxs)(Gap,BaseTeleprompterActions_assign({gap:"4px"},{children:[(0,jsx_runtime.jsx)(md_index_esm.zZ_,{color:colors.neutral[60],size:20}),(0,jsx_runtime.jsx)(ParagraphSmallBold,BaseTeleprompterActions_assign({color:colors.neutral[60]},{children:"Teleprompter"}))]})),(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{variant:"secondary",disabled:isTeleprompterDisabled||status===RECORDING_STATUS.COUNTDOWN,text:isUsingTeleprompter?"Edit":"Turn on",onClick:onEditOrTurnOnTeleprompterHandler}),isUsingTeleprompter&&(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{title:"Turn Off Teleprompter",icon:(0,jsx_runtime.jsx)(md_index_esm.Im6,{size:20}),onClick:turnOffTeleprompter,variant:isCdkEnviroment?"text":"destructive"})]})},RecordingTeleprompterActions_assign=function(){return RecordingTeleprompterActions_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},RecordingTeleprompterActions_assign.apply(this,arguments)},RecordingTeleprompterActions=function(){var _a=useTeleprompter(),teleprompterSettings=_a.teleprompterSettings,isUsingTeleprompter=_a.isUsingTeleprompter,toggleTeleprompterPlaying=_a.toggleTeleprompterPlaying,isTeleprompterPlaying=_a.isTeleprompterPlaying,onDropdownTeleprompterSpeedChange=_a.onDropdownTeleprompterSpeedChange;return isUsingTeleprompter?(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:(0,jsx_runtime.jsxs)(Gap,RecordingTeleprompterActions_assign({m:"0 0 0 auto"},{children:[(0,jsx_runtime.jsx)(Dropdown,{placeholder:"Set teleprompter speed",value:null==teleprompterSettings?void 0:teleprompterSettings.speed,onChange:function(newValue){return onDropdownTeleprompterSpeedChange(newValue)},options:handleScriptSpeedUsingScriptSize(null==teleprompterSettings?void 0:teleprompterSettings.scriptSize),isSearchable:!1,height:40,zIndexProp:9999,menuZIndexProp:9,extendStyles:{container:{width:180}},creatable:!1}),(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{text:"".concat(isTeleprompterPlaying?"Pause":"Play"," Teleprompter"),icon:isTeleprompterPlaying?(0,jsx_runtime.jsx)(md_index_esm.QG6,{size:20}):(0,jsx_runtime.jsx)(md_index_esm.XKH,{size:20}),onClick:toggleTeleprompterPlaying})]}))}):(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{})},TeleprompterActions=function(_a){var status=_a.status,isRecording=status===RECORDING_STATUS.RECORDING||status===RECORDING_STATUS.PAUSED;return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:isRecording?(0,jsx_runtime.jsx)(RecordingTeleprompterActions,{}):(0,jsx_runtime.jsx)(BaseTeleprompterActions,{status})})},modules=__webpack_require__("./node_modules/react-scroll/modules/index.js"),Scroller_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},Scroller_assign=function(){return Scroller_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},Scroller_assign.apply(this,arguments)},ScrollContainer=styled_components_browser_esm.Ay.div(Scroller_templateObject_1||(Scroller_templateObject_1=Scroller_makeTemplateObject(["\n overflow-wrap: break-word;\n max-width: 600px;\n font-size: ",";\n"],["\n overflow-wrap: break-word;\n max-width: 600px;\n font-size: ",";\n"])),(function(props){return props.fontSize})),Scroller=function(_a){var content=_a.content,fontSize=_a.fontSize;return react.useEffect((function(){}),[]),(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:(0,jsx_runtime.jsx)(ScrollContainer,Scroller_assign({fontSize},{children:content}))})},TeleprompterDisplay_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},TeleprompterDisplay_assign=function(){return TeleprompterDisplay_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},TeleprompterDisplay_assign.apply(this,arguments)},TeleprompterShadow=styled_components_browser_esm.Ay.div(TeleprompterDisplay_templateObject_1||(TeleprompterDisplay_templateObject_1=TeleprompterDisplay_makeTemplateObject(["\n position: absolute;\n left: 0;\n right: 0;\n z-index: 1;\n &.top {\n top: 0;\n bottom: 55%;\n background: linear-gradient(\n 180deg,\n rgba(39, 42, 50, 0.54) 0%,\n rgba(39, 42, 50, 0.48) 47.4%,\n rgba(39, 42, 50, 0) 100%\n );\n }\n &.bottom {\n top: 30%;\n bottom: 0;\n background: linear-gradient(\n 180deg,\n rgba(39, 42, 50, 0) 0%,\n rgba(39, 42, 50, 0.48) 47.4%,\n rgba(39, 42, 50, 0.54) 100%\n );\n }\n overflow: hidden;\n"],["\n position: absolute;\n left: 0;\n right: 0;\n z-index: 1;\n &.top {\n top: 0;\n bottom: 55%;\n background: linear-gradient(\n 180deg,\n rgba(39, 42, 50, 0.54) 0%,\n rgba(39, 42, 50, 0.48) 47.4%,\n rgba(39, 42, 50, 0) 100%\n );\n }\n &.bottom {\n top: 30%;\n bottom: 0;\n background: linear-gradient(\n 180deg,\n rgba(39, 42, 50, 0) 0%,\n rgba(39, 42, 50, 0.48) 47.4%,\n rgba(39, 42, 50, 0.54) 100%\n );\n }\n overflow: hidden;\n"]))),TeleprompterContainer=styled_components_browser_esm.Ay.div(TeleprompterDisplay_templateObject_2||(TeleprompterDisplay_templateObject_2=TeleprompterDisplay_makeTemplateObject(["\n scroll-behavior: smooth;\n box-sizing: border-box;\n font-style: normal;\n font-weight: bold;\n font-size: 20px;\n line-height: 32px;\n color: #fff;\n z-index: 2;\n border-radius: 8px;\n padding: 32px 128px;\n text-shadow: 0px 4px 4px rgba(0, 0, 0, 0.1);\n white-space: pre-line;\n position: absolute;\n overflow: auto;\n width: 100%;\n display: flex;\n justify-content: center;\n overflow: hidden;\n max-height: 300px;\n @media screen and (max-width: 768px) {\n width: 100%;\n padding: 16px;\n max-height: 135px;\n }\n /* this will hide the scrollbar in mozilla based browsers */\n overflow: -moz-scrollbars-none;\n scrollbar-width: none;\n\n /* this will hide the scrollbar in internet explorers */\n -ms-overflow-style: none;\n ::-webkit-scrollbar {\n width: 0 !important;\n display: none;\n }\n .marquee-container {\n width: 500px;\n }\n .marquee-container:not(.horizontal)::before {\n background: transparent;\n }\n .marquee-container:not(.horizontal)::after {\n background: transparent;\n }\n"],["\n scroll-behavior: smooth;\n box-sizing: border-box;\n font-style: normal;\n font-weight: bold;\n font-size: 20px;\n line-height: 32px;\n color: #fff;\n z-index: 2;\n border-radius: 8px;\n padding: 32px 128px;\n text-shadow: 0px 4px 4px rgba(0, 0, 0, 0.1);\n white-space: pre-line;\n position: absolute;\n overflow: auto;\n width: 100%;\n display: flex;\n justify-content: center;\n overflow: hidden;\n max-height: 300px;\n @media screen and (max-width: 768px) {\n width: 100%;\n padding: 16px;\n max-height: 135px;\n }\n /* this will hide the scrollbar in mozilla based browsers */\n overflow: -moz-scrollbars-none;\n scrollbar-width: none;\n\n /* this will hide the scrollbar in internet explorers */\n -ms-overflow-style: none;\n ::-webkit-scrollbar {\n width: 0 !important;\n display: none;\n }\n .marquee-container {\n width: 500px;\n }\n .marquee-container:not(.horizontal)::before {\n background: transparent;\n }\n .marquee-container:not(.horizontal)::after {\n background: transparent;\n }\n"])));const Teleprompter_TeleprompterDisplay=function(_a){var status=_a.status,_b=useTeleprompter(),teleprompterSettings=_b.teleprompterSettings,isUsingTeleprompter=_b.isUsingTeleprompter,isTeleprompterPlaying=_b.isTeleprompterPlaying,play=function(){modules.Nk.scrollMore(20,{containerId:"teleprompter",duration:50,smooth:!0,offset:50})};return(0,react.useEffect)((function(){var _a,interval;return isTeleprompterPlaying&&status===RECORDING_STATUS.RECORDING?(interval&&clearInterval(interval),interval=setInterval(play,(null===(_a=null==teleprompterSettings?void 0:teleprompterSettings.speed)||void 0===_a?void 0:_a.value)||100)):interval&&clearInterval(interval),function(){interval&&clearInterval(interval)}}),[isTeleprompterPlaying,null==teleprompterSettings?void 0:teleprompterSettings.speed,status]),isUsingTeleprompter?(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(TeleprompterShadow,{className:null==teleprompterSettings?void 0:teleprompterSettings.scriptPosition}),(0,jsx_runtime.jsx)(TeleprompterContainer,TeleprompterDisplay_assign({id:"teleprompter",style:{top:"top"===(null==teleprompterSettings?void 0:teleprompterSettings.scriptPosition)?"0px":"30%"}},{children:(0,jsx_runtime.jsx)(Scroller,{content:decodeAndReplaceText((null==teleprompterSettings?void 0:teleprompterSettings.content)||""),fontSize:(null==teleprompterSettings?void 0:teleprompterSettings.scriptSize)||"16px"})}))]}):(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{})};var TeleprompterDisplay_templateObject_1,TeleprompterDisplay_templateObject_2,RecordCamLoader_templateObject_1,virtualBackground_path,RecordCamLoader_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},RecordCamLoaderWrapper=styled_components_browser_esm.Ay.div(RecordCamLoader_templateObject_1||(RecordCamLoader_templateObject_1=RecordCamLoader_makeTemplateObject(["\n height: 440px;\n width: 100%;\n z-index: 4;\n background: rgb(246, 247, 249);\n position: absolute;\n border-radius: 6;\n display: flex;\n align-items: center;\n justify.content: center;\n top: 0;\n"],["\n height: 440px;\n width: 100%;\n z-index: 4;\n background: rgb(246, 247, 249);\n position: absolute;\n border-radius: 6;\n display: flex;\n align-items: center;\n justify.content: center;\n top: 0;\n"]))),RecordCamLoader=function(_a){var text=_a.text;return(0,jsx_runtime.jsx)(RecordCamLoaderWrapper,{children:(0,jsx_runtime.jsx)("div",{children:(0,jsx_runtime.jsx)(LoadingIndicator,{isLoading:!0,text})})})},virtualBackgrounds_assign=function(){return virtualBackgrounds_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},virtualBackgrounds_assign.apply(this,arguments)},initialVirtualBgState={url:"",type:"none",index:-1,privacy:"PUBLIC",id:""},saveVirtualBackgroundToStorage=function(currentVirtualBackground,id){var _a,currentVb=function(){var vbSelection=localStorage.getItem("covideoVirtualBackground")||"";try{var savedVirtualBackground=JSON.parse(vbSelection);return savedVirtualBackground&&"object"==typeof savedVirtualBackground?savedVirtualBackground:{}}catch(ex){return{}}}(),newItems=virtualBackgrounds_assign(virtualBackgrounds_assign({},currentVb),((_a={})[id]=currentVirtualBackground,_a));localStorage.setItem("covideoVirtualBackground",JSON.stringify(newItems))},customVirtualBackgroundKeys_all=function(){return["CUSTOM_VIRTUAL_BACKGROUND"]},useCustomVirtualBackgroundQuery_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},useCustomVirtualBackgroundQuery_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},useCustomVirtualBackgroundQuery=function(){var toast=useToastNotifications().toast,_a=(0,es.useQuery)(customVirtualBackgroundKeys_all(),(function(){return useCustomVirtualBackgroundQuery_awaiter(void 0,void 0,Promise,(function(){return useCustomVirtualBackgroundQuery_generator(this,(function(_a){switch(_a.label){case 0:return[4,config_EXPRESS_API.get("custom-virtual-background")];case 1:return[2,_a.sent().data]}}))}))}),{refetchOnMount:!0,onError:function(){toast({message:"We're currently experiencing difficulties fetching custom virtual backgrounds"})}});return{data:_a.data||[],isLoading:_a.isLoading,refetch:_a.refetch}};function virtualBackground_extends(){return virtualBackground_extends=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},virtualBackground_extends.apply(null,arguments)}const virtualBackground=function SvgVirtualBackground(props){return react.createElement("svg",virtualBackground_extends({width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props),virtualBackground_path||(virtualBackground_path=react.createElement("path",{d:"M2 3C2 2.45 2.45 2 3 2H8C8.55 2 9 1.55 9 1C9 0.45 8.55 0 8 0H2C0.9 0 0 0.9 0 2V8C0 8.55 0.45 9 1 9C1.55 9 2 8.55 2 8V3ZM7.61 11.49L4.65 15.19C4.39 15.52 4.62 16 5.04 16H15C15.41 16 15.65 15.53 15.4 15.2L13.4 12.53C13.2 12.26 12.8 12.26 12.6 12.53L10.97 14.71L8.39 11.49C8.19 11.24 7.81 11.24 7.61 11.49ZM15 6.5C15 5.67 14.33 5 13.5 5C12.67 5 12 5.67 12 6.5C12 7.33 12.67 8 13.5 8C14.33 8 15 7.33 15 6.5ZM18 0H12C11.45 0 11 0.45 11 1C11 1.55 11.45 2 12 2H17C17.55 2 18 2.45 18 3V8C18 8.55 18.45 9 19 9C19.55 9 20 8.55 20 8V2C20 0.9 19.1 0 18 0ZM18 17C18 17.55 17.55 18 17 18H12C11.45 18 11 18.45 11 19C11 19.55 11.45 20 12 20H18C19.1 20 20 19.1 20 18V12C20 11.45 19.55 11 19 11C18.45 11 18 11.45 18 12V17ZM1 11C0.45 11 0 11.45 0 12V18C0 19.1 0.9 20 2 20H8C8.55 20 9 19.55 9 19C9 18.45 8.55 18 8 18H3C2.45 18 2 17.55 2 17V12C2 11.45 1.55 11 1 11Z",fill:"#272A32"})))};var VirtualBgIcon_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked};const VirtualBgIcon=(0,styled_components_browser_esm.Ay)(virtualBackground)(VirtualBgIcon_templateObject_1||(VirtualBgIcon_templateObject_1=VirtualBgIcon_makeTemplateObject(["\n width: ",";\n height: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"])),(function(props){return props.width||"16px"}),(function(props){return props.height||"16px"}),(function(props){return props.color||"currentColor"}),(function(props){return props.opacity||"inherit"}));var VirtualBgIcon_templateObject_1,droplrAuth_client,DROPTYPE_OPTIONS,vision_bundle=__webpack_require__("./node_modules/@mediapipe/tasks-vision/vision_bundle.mjs"),createShader=function(gl,type,source){var shader=gl.createShader(type);return gl.shaderSource(shader,source),gl.compileShader(shader),gl.getShaderParameter(shader,gl.COMPILE_STATUS)?shader:(console.error("Error compiling shader:",gl.getShaderInfoLog(shader)),gl.deleteShader(shader),null)},updateTexture=function(gl,texture,source,width,height){gl.bindTexture(gl.TEXTURE_2D,texture),source instanceof Uint8Array?gl.texImage2D(gl.TEXTURE_2D,0,gl.ALPHA,width,height,0,gl.ALPHA,gl.UNSIGNED_BYTE,source):gl.texImage2D(gl.TEXTURE_2D,0,gl.RGBA,gl.RGBA,gl.UNSIGNED_BYTE,source)},createTexture=function(gl){var texture=gl.createTexture();return gl.bindTexture(gl.TEXTURE_2D,texture),gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_S,gl.CLAMP_TO_EDGE),gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_T,gl.CLAMP_TO_EDGE),gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.LINEAR),gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,gl.LINEAR),texture},initWebGL=function(canvas){var gl=canvas.getContext("webgl2");if(!gl)return console.error("WebGL not supported"),{gl:null,program:null};gl.viewport(0,0,1280,720);var program=function(gl,vertexShaderSource,fragmentShaderSource){var vertexShader=createShader(gl,gl.VERTEX_SHADER,vertexShaderSource),fragmentShader=createShader(gl,gl.FRAGMENT_SHADER,fragmentShaderSource);if(!vertexShader||!fragmentShader)return null;var program=gl.createProgram();return gl.attachShader(program,vertexShader),gl.attachShader(program,fragmentShader),gl.linkProgram(program),gl.getProgramParameter(program,gl.LINK_STATUS)?(gl.useProgram(program),program):(console.error("Error linking program:",gl.getProgramInfoLog(program)),gl.deleteProgram(program),null)}(gl,"\n precision highp float;\n\n attribute vec4 a_position;\n attribute vec2 a_texCoord;\n varying vec2 v_texCoord;\n\n void main() {\n gl_Position = a_position; // Pass the position through to gl_Position\n // Flip the texture coordinates vertically by inverting the Y axis\n v_texCoord = vec2(a_texCoord.x, 1.0 - a_texCoord.y);\n }\n ","\n precision highp float;\n\n uniform sampler2D u_foreground;\n uniform sampler2D u_background;\n uniform sampler2D u_confidenceMask;\n uniform sampler2D u_confidenceMaskHair;\n uniform sampler2D u_confidenceMaskBody;\n uniform sampler2D u_confidenceMaskFace;\n uniform sampler2D u_confidenceMaskClothes;\n uniform sampler2D u_confidenceMaskOther;\n uniform vec2 u_backgroundScale;\n\n varying vec2 v_texCoord;\n\n // Function to blend two colors\n vec4 blendColors(vec4 base, vec4 added) {\n float mixAlpha = 1.0 - (1.0 - added.a) * (1.0 - base.a);\n\n vec3 mixRGB;\n if (mixAlpha == 0.0) {\n mixRGB = vec3(0.0, 0.0, 0.0);\n } else {\n mixRGB.r = (added.r * added.a / mixAlpha) + (base.r * base.a * (1.0 - added.a) / mixAlpha);\n mixRGB.g = (added.g * added.a / mixAlpha) + (base.g * base.a * (1.0 - added.a) / mixAlpha);\n mixRGB.b = (added.b * added.a / mixAlpha) + (base.b * base.a * (1.0 - added.a) / mixAlpha);\n }\n\n return vec4(mixRGB, 1.0);\n }\n\n void main() {\n\n // Adjust texture coordinates to scale the background, ensuring it's centered\n vec2 centeredCoord = (v_texCoord - 0.5) * u_backgroundScale + 0.5;\n\n vec4 fgColor = texture2D(u_foreground, v_texCoord); // Foreground color\n vec4 bgColor = texture2D(u_background, centeredCoord); // Scaled and centered background color\n\n //float confidence = 1.0 - texture2D(u_confidenceMask, v_texCoord).r;\n float confidenceSum = texture2D(u_confidenceMaskHair, v_texCoord).r + texture2D(u_confidenceMaskBody, v_texCoord).r + texture2D(u_confidenceMaskFace, v_texCoord).r + texture2D(u_confidenceMaskClothes, v_texCoord).r + texture2D(u_confidenceMaskOther, v_texCoord).r;\n float confidence = min(confidenceSum, 1.0);\n float minConfidence = 0.1;\n float maxConfidence = 0.95;\n\n // Full background when below min confidence\n if (confidence < minConfidence) {\n gl_FragColor = bgColor;\n } \n // Full foreground when above max confidence\n else if (confidence > maxConfidence) {\n gl_FragColor = fgColor;\n } \n // Blending between foreground and background\n else {\n vec4 blended = blendColors(vec4(fgColor.rgb, confidence), vec4(bgColor.rgb, 1.0 - confidence));\n gl_FragColor = blended;\n }\n }\n ");return program?{gl,program}:(console.error("Failed to create WebGL program"),{gl:null,program:null})},useImageSegmenter_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},useImageSegmenter_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},bgImgCanvasElement=document.createElement("canvas"),bgImgCanvasCtx=bgImgCanvasElement.getContext("2d"),lastTimestamp=0,calculateBackgroundScale=function(canvasWidth,canvasHeight,backgroundWidth,backgroundHeight){var canvasAspect=canvasWidth/canvasHeight,backgroundAspect=backgroundWidth/backgroundHeight,scaleX=1,scaleY=1;return backgroundAspect<canvasAspect?scaleY=backgroundAspect/canvasAspect:scaleX=canvasAspect/backgroundAspect,[scaleX,scaleY]},useImageSegmenter=function(canvasRef,videoRef,setIsLoading){var fgTexture,imageSegmenterRef=(0,react.useRef)(null),isFirstFrameRef=(0,react.useRef)(!0),resultimageRef=(0,react.useRef)(null),imageRef=(0,react.useRef)(null),webGlRef=(0,react.useRef)({gl:null,program:null}),bgTexture=(0,react.useRef)(),backgroundScale=(0,react.useRef)([1,1]),initWebGLContext=function(){var gl;canvasRef.current&&(webGlRef.current=initWebGL(canvasRef.current),webGlRef.current.gl&&(gl=webGlRef.current.gl,fgTexture=createTexture(gl),bgTexture.current=createTexture(gl),imageRef.current&&(updateTexture(webGlRef.current.gl,bgTexture.current,imageRef.current,canvasRef.current.width,canvasRef.current.height),backgroundScale.current=calculateBackgroundScale(1280,720,imageRef.current.width,imageRef.current.height))))},drawSegmentationResult=function(result){if(result.confidenceMasks&&canvasRef.current&&resultimageRef.current&&imageRef.current&&videoRef.current){var _a=webGlRef.current,gl=_a.gl,program=_a.program;if(gl&&program){!function(gl,program){var positionLocation=gl.getAttribLocation(program,"a_position"),texCoordLocation=gl.getAttribLocation(program,"a_texCoord"),positionBuffer=gl.createBuffer();gl.bindBuffer(gl.ARRAY_BUFFER,positionBuffer);var positions=new Float32Array([-1,-1,1,-1,-1,1,1,1]);gl.bufferData(gl.ARRAY_BUFFER,positions,gl.STATIC_DRAW),gl.enableVertexAttribArray(positionLocation),gl.vertexAttribPointer(positionLocation,2,gl.FLOAT,!1,0,0);var texCoordBuffer=gl.createBuffer();gl.bindBuffer(gl.ARRAY_BUFFER,texCoordBuffer);var texCoords=new Float32Array([0,0,1,0,0,1,1,1]);gl.bufferData(gl.ARRAY_BUFFER,texCoords,gl.STATIC_DRAW),gl.enableVertexAttribArray(texCoordLocation),gl.vertexAttribPointer(texCoordLocation,2,gl.FLOAT,!1,0,0)}(gl,program);var confidenceMaskTexture=result.confidenceMasks[0].getAsWebGLTexture(),confidenceMaskHairTexture=result.confidenceMasks[1].getAsWebGLTexture(),confidenceMaskBodyTexture=result.confidenceMasks[2].getAsWebGLTexture(),confidenceMaskFaceTexture=result.confidenceMasks[3].getAsWebGLTexture(),confidenceMaskClothesTexture=result.confidenceMasks[4].getAsWebGLTexture(),confidenceMaskOtherTexture=result.confidenceMasks[5].getAsWebGLTexture();!function(gl,program,fgTexture,bgTexture,confidenceMaskTexture,confidenceMaskHairTexture,confidenceMaskBodyTexture,confidenceMaskFaceTexture,confidenceMaskClothesTexture,confidenceMaskOtherTexture,backgroundScale){void 0===backgroundScale&&(backgroundScale=[1,1]),gl.useProgram(program),gl.activeTexture(gl.TEXTURE0),gl.bindTexture(gl.TEXTURE_2D,fgTexture),gl.activeTexture(gl.TEXTURE1),gl.bindTexture(gl.TEXTURE_2D,bgTexture),gl.activeTexture(gl.TEXTURE2),gl.bindTexture(gl.TEXTURE_2D,confidenceMaskTexture),gl.activeTexture(gl.TEXTURE3),gl.bindTexture(gl.TEXTURE_2D,confidenceMaskHairTexture),gl.activeTexture(gl.TEXTURE4),gl.bindTexture(gl.TEXTURE_2D,confidenceMaskBodyTexture),gl.activeTexture(gl.TEXTURE5),gl.bindTexture(gl.TEXTURE_2D,confidenceMaskFaceTexture),gl.activeTexture(gl.TEXTURE6),gl.bindTexture(gl.TEXTURE_2D,confidenceMaskClothesTexture),gl.activeTexture(gl.TEXTURE7),gl.bindTexture(gl.TEXTURE_2D,confidenceMaskOtherTexture);var fgLocation=gl.getUniformLocation(program,"u_foreground"),bgLocation=gl.getUniformLocation(program,"u_background"),maskLocation=gl.getUniformLocation(program,"u_confidenceMask"),maskLocationHair=gl.getUniformLocation(program,"u_confidenceMaskHair"),maskLocationBody=gl.getUniformLocation(program,"u_confidenceMaskBody"),maskLocationFace=gl.getUniformLocation(program,"u_confidenceMaskFace"),maskLocationClothes=gl.getUniformLocation(program,"u_confidenceMaskClothes"),maskLocationOther=gl.getUniformLocation(program,"u_confidenceMaskOther");gl.uniform1i(fgLocation,0),gl.uniform1i(bgLocation,1),gl.uniform1i(maskLocation,2),gl.uniform1i(maskLocationHair,3),gl.uniform1i(maskLocationBody,4),gl.uniform1i(maskLocationFace,5),gl.uniform1i(maskLocationClothes,6),gl.uniform1i(maskLocationOther,7),gl.clear(gl.COLOR_BUFFER_BIT);var backgroundScaleLocation=gl.getUniformLocation(program,"u_backgroundScale");gl.uniform2fv(backgroundScaleLocation,backgroundScale),gl.drawArrays(gl.TRIANGLE_STRIP,0,4)}(gl,program,fgTexture,bgTexture.current,confidenceMaskTexture,confidenceMaskHairTexture,confidenceMaskBodyTexture,confidenceMaskFaceTexture,confidenceMaskClothesTexture,confidenceMaskOtherTexture,backgroundScale.current),window.requestAnimationFrame(predictWebcam),result.close()}}else result.close()},getCavansBgImage=function(){var imgElement,videoWidth,videoHeight,newWidth,newHeight,startX,startY;canvasRef.current&&videoRef.current&&imageRef.current&&(resultimageRef.current=(imgElement=imageRef.current,videoWidth=canvasRef.current.width,videoHeight=canvasRef.current.height,newWidth=videoWidth,newHeight=videoHeight,startX=0,startY=0,videoWidth/videoHeight<imgElement.width/imgElement.height?startX=((newWidth=videoHeight*(imgElement.width/imgElement.height))-videoWidth)/2:startY=((newHeight=videoWidth*imgElement.height/imgElement.width)-videoHeight)/2,bgImgCanvasElement.width=newWidth,bgImgCanvasElement.height=newHeight,bgImgCanvasCtx.drawImage(imgElement,0,0,newWidth,newHeight),bgImgCanvasCtx.getImageData(startX,startY,videoWidth,videoHeight).data),webGlRef.current.gl&&(backgroundScale.current=calculateBackgroundScale(1280,720,imageRef.current.width,imageRef.current.height),updateTexture(webGlRef.current.gl,bgTexture.current,imageRef.current,canvasRef.current.width,canvasRef.current.height)))};var predictWebcam=function(){return useImageSegmenter_awaiter(void 0,void 0,void 0,(function(){var width,height,nowInMs;return useImageSegmenter_generator(this,(function(_a){return canvasRef.current&&videoRef.current&&imageSegmenterRef.current&&imageRef.current&&(width=videoRef.current.videoWidth,height=videoRef.current.videoHeight,isFirstFrameRef.current&&(isFirstFrameRef.current=!1,canvasRef.current.width=width,canvasRef.current.height=height,getCavansBgImage()),nowInMs=function getTimestamp(){var currentTimestamp=Math.floor(performance.now());return currentTimestamp<=lastTimestamp?lastTimestamp+=1:lastTimestamp=currentTimestamp,lastTimestamp}(),webGlRef.current.gl&&updateTexture(webGlRef.current.gl,fgTexture,videoRef.current,width,height),imageSegmenterRef.current.segmentForVideo(videoRef.current,nowInMs,drawSegmentationResult)),[2]}))}))};return{imageRef,onDestroyVirtualBackgroundHandler:function(){var gl;if(imageSegmenterRef.current&&(imageSegmenterRef.current.close(),imageSegmenterRef.current=null),webGlRef.current.gl&&((gl=webGlRef.current.gl).useProgram(null),gl.clearColor(0,0,0,0),gl.clear(gl.COLOR_BUFFER_BIT)),canvasRef.current){var canvasRefCtx=canvasRef.current.getContext("2d");canvasRefCtx&&canvasRefCtx.clearRect(0,0,canvasRef.current.width,canvasRef.current.height)}},getCavansBgImage,onCreateVirtualBackgroundHandler:function(){return useImageSegmenter_awaiter(void 0,void 0,void 0,(function(){var audio,segmenter;return useImageSegmenter_generator(this,(function(_a){switch(_a.label){case 0:return imageSegmenterRef.current?[2]:[4,vision_bundle.Ps.forVisionTasks("https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@0.10.2/wasm")];case 1:return audio=_a.sent(),initWebGLContext(),[4,vision_bundle.yq.createFromOptions(audio,{baseOptions:{modelAssetPath:"https://storage.googleapis.com/mediapipe-models/image_segmenter/selfie_multiclass_256x256/float32/latest/selfie_multiclass_256x256.tflite",delegate:"GPU"},runningMode:"VIDEO",outputCategoryMask:!1,outputConfidenceMasks:!0,canvas:canvasRef.current})];case 2:return segmenter=_a.sent(),imageSegmenterRef.current=segmenter,setIsLoading(!1),predictWebcam(),[2]}}))}))}}},dist_es=__webpack_require__("./node_modules/react-dropzone/dist/es/index.js"),index_es=__webpack_require__("./node_modules/react-infinite-scroll-component/dist/index.es.js"),js_cookie=__webpack_require__("./node_modules/js-cookie/src/js.cookie.js"),js_cookie_default=__webpack_require__.n(js_cookie),droplrAuth_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},droplrAuth_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},Droplr=__webpack_require__("./node_modules/droplr-api/index.js"),droplrAuth_checkDropAuth=function(){return droplrAuth_awaiter(void 0,void 0,void 0,(function(){var data;return droplrAuth_generator(this,(function(_a){switch(_a.label){case 0:return droplrAuth_client?[3,2]:[4,config_EXPRESS_API.get("/droplr/auth")];case 1:data=_a.sent().data,js_cookie_default().set("jwtToken",data.jwt,{domain:".covideo.com",sameSite:"strict",secure:!0}),(droplrAuth_client=new Droplr.Client({auth:new Droplr.JwtAuth(data.jwt)})).sharedDrop=new SharedDrop(droplrAuth_client),_a.label=2;case 2:return[2]}}))}))},SharedDrop=function(){function SharedDrop(client){this.client=client,this.path="drops/groups/shared"}return SharedDrop.prototype.get=function(id,options){return void 0===options&&(options={}),droplrAuth_awaiter(this,void 0,void 0,(function(){return droplrAuth_generator(this,(function(_a){switch(_a.label){case 0:return[4,this.client.get("".concat(this.path,"/").concat(id),options)];case 1:return[2,_a.sent().data]}}))}))},SharedDrop.prototype.list=function(params,options){return void 0===params&&(params={}),void 0===options&&(options={}),droplrAuth_awaiter(this,void 0,void 0,(function(){var localOptions,response;return droplrAuth_generator(this,(function(_a){switch(_a.label){case 0:return localOptions={params},[4,this.client.get(this.path,Object.assign(localOptions,options))];case 1:return[2,{count:(response=_a.sent()).headers["x-results-count"],hasMore:response.headers["x-has-more"],results:response.data}]}}))}))},SharedDrop}(),uploadDrop_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},uploadDrop_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},getBoards_assign=function(){return getBoards_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},getBoards_assign.apply(this,arguments)},getBoards_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},getBoards_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},getBoards=function(params){return getBoards_awaiter(void 0,void 0,Promise,(function(){var droplrResponse,droplrBoards,covideoResponse,covideoBoards,boards;return getBoards_generator(this,(function(_a){switch(_a.label){case 0:return[4,droplrAuth_checkDropAuth()];case 1:return _a.sent(),[4,droplrAuth_client.boards.list()];case 2:return droplrResponse=_a.sent(),droplrBoards=(null==droplrResponse?void 0:droplrResponse.results)||[],[4,config_EXPRESS_API.get("/board/all",{params})];case 3:return covideoResponse=_a.sent().data,covideoBoards=(null==covideoResponse?void 0:covideoResponse.boards)||[],boards=[],droplrBoards.forEach((function(droplrBoard){var covideoBoard=covideoBoards.find((function(cb){return cb.droplrBoardId===droplrBoard.id}));boards.push(getBoards_assign(getBoards_assign({},droplrBoard),{thumbnailUrl:(null==covideoBoard?void 0:covideoBoard.thumbnailUrl)||""}))})),[2,{boards,count:boards.length}]}}))}))},getDrop_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},getDrop_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},getDrop=function(dropId){return getDrop_awaiter(void 0,void 0,void 0,(function(){return getDrop_generator(this,(function(_a){switch(_a.label){case 0:return dropId?[4,droplrAuth_checkDropAuth()]:[2];case 1:return _a.sent(),[2,droplrAuth_client.drops.get(dropId)]}}))}))},getDrops_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},getDrops_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},DropType_FILE="FILE";!function(DROPTYPE_OPTIONS){DROPTYPE_OPTIONS.SHARED="shared",DROPTYPE_OPTIONS.OWNED="owned"}(DROPTYPE_OPTIONS||(DROPTYPE_OPTIONS={}));var FilesTabContent_templateObject_1,FilesTabContent_templateObject_2,FilesTabContent_templateObject_3,FilesTabContent_templateObject_4,FilesTabContent_templateObject_5,FilesTabContent_templateObject_6,FilesTabContent_templateObject_7,FilesTabContent_templateObject_8,FilesTabContent_templateObject_9,FilesTabContent_templateObject_10,FilesTabContent_templateObject_11,FilesTabContent_templateObject_12,FilesTabContent_templateObject_13,FilesTabContent_templateObject_14,FilesTabContent_templateObject_15,FilesTabContent_templateObject_16,VirtualBackgroundLibraryModal_templateObject_1,VirtualBackgroundLibraryModal_templateObject_2,VirtualBackgroundLibraryModal_templateObject_3,VirtualBackgroundLibraryModal_templateObject_4,VirtualBackgrounds_templateObject_1,VirtualBackgrounds_templateObject_2,VirtualBackgrounds_templateObject_3,VirtualBackgrounds_templateObject_4,VirtualBackgrounds_templateObject_5,VirtualBackgrounds_templateObject_6,VirtualBackgroundsButton_templateObject_1,VirtualBackgroundsButton_templateObject_2,lib_components_Search_templateObject_1,lib_components_Search_templateObject_2,lib_components_Search_templateObject_3,lib_components_Search_templateObject_4,Search_templateObject_5,DroplrFilesTabContent_templateObject_1,DroplrFilesTabContent_templateObject_2,DroplrFilesTabContent_templateObject_3,DroplrFilesTabContent_templateObject_4,DroplrFilesTabContent_templateObject_5,DroplrFilesTabContent_templateObject_6,DroplrFilesTabContent_templateObject_7,DroplrFilesTabContent_templateObject_8,DroplrFilesTabContent_templateObject_9,DroplrFilesTabContent_templateObject_10,DroplrFilesTabContent_templateObject_11,DroplrFilesTabContent_templateObject_12,DroplrFilesTabContent_templateObject_13,DroplrFilesTabContent_templateObject_14,DroplrFilesTabContent_templateObject_15,DroplrFilesTabContent_templateObject_16,DroplrFilesTabContent_templateObject_17,covideoSmallLogoActive_path,covideoSmallLogoActive_path2,covideoSmallLogoActive_path3,getDrops=function(params){return getDrops_awaiter(void 0,void 0,void 0,(function(){var order,sort,_a,page,_b,size,_c,type,_d,variant,_e,search,boardId,body,response;return getDrops_generator(this,(function(_f){switch(_f.label){case 0:return[4,droplrAuth_checkDropAuth()];case 1:return _f.sent(),order=params.order,sort=params.sort,_a=params.page,page=void 0===_a?0:_a,_b=params.size,size=void 0===_b?10:_b,_c=params.type,type=void 0===_c?"":_c,_d=params.variant,variant=void 0===_d?"":_d,_e=params.search,search=void 0===_e?"":_e,boardId=params.boardId,body={order,sort_by:sort,offset:page*size,amount:size,board:""},type&&(body.type=type,type===DropType_FILE&&variant&&(body.variant=variant)),search&&(body.search=search),boardId&&(body.board=boardId),[4,droplrAuth_client.drops.list(body)];case 2:return[2,{drops:(response=_f.sent()).results,count:Number(response.count)||0,hasMore:(null==response?void 0:response.hasMore)||!1}]}}))}))},FilesTabContent_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},FilesTabContent_assign=function(){return FilesTabContent_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},FilesTabContent_assign.apply(this,arguments)},FilesTabContent_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},FilesTabContent_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},FilesTabContent_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},FilesTabContent_spreadArray=function(to,from,pack){if(pack||2===arguments.length)for(var ar,i=0,l=from.length;i<l;i++)!ar&&i in from||(ar||(ar=Array.prototype.slice.call(from,0,i)),ar[i]=from[i]);return to.concat(ar||Array.prototype.slice.call(from))},DropContent=styled_components_browser_esm.Ay.div(FilesTabContent_templateObject_1||(FilesTabContent_templateObject_1=FilesTabContent_makeTemplateObject(["\n margin-top: 24px;\n padding: 0 32px;\n width: 100%;\n height: 120px;\n box-sizing: border-box;\n border-radius: 4px;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n background: ",";\n border: 1px dashed #d0d3d9;\n > p {\n font-style: normal;\n font-weight: normal;\n font-size: 16px;\n line-height: 24px;\n text-align: center;\n color: ",";\n }\n"],["\n margin-top: 24px;\n padding: 0 32px;\n width: 100%;\n height: 120px;\n box-sizing: border-box;\n border-radius: 4px;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n background: ",";\n border: 1px dashed #d0d3d9;\n > p {\n font-style: normal;\n font-weight: normal;\n font-size: 16px;\n line-height: 24px;\n text-align: center;\n color: ",";\n }\n"])),(function(props){return props.isDragActive,"#F6F7F9"}),palette_coal),UploadFileContent=styled_components_browser_esm.Ay.div(FilesTabContent_templateObject_2||(FilesTabContent_templateObject_2=FilesTabContent_makeTemplateObject(["\n margin-top: 24px;\n background: #f6f7f9;\n border-radius: 4px;\n display: flex;\n padding: 16px 32px;\n"],["\n margin-top: 24px;\n background: #f6f7f9;\n border-radius: 4px;\n display: flex;\n padding: 16px 32px;\n"]))),UploadFileDescription=styled_components_browser_esm.Ay.div(FilesTabContent_templateObject_3||(FilesTabContent_templateObject_3=FilesTabContent_makeTemplateObject(["\n width: 90%;\n"],["\n width: 90%;\n"]))),UploadFileAction=styled_components_browser_esm.Ay.div(FilesTabContent_templateObject_4||(FilesTabContent_templateObject_4=FilesTabContent_makeTemplateObject(["\n width: 10%;\n"],["\n width: 10%;\n"]))),UploadFileTitle=styled_components_browser_esm.Ay.div(FilesTabContent_templateObject_5||(FilesTabContent_templateObject_5=FilesTabContent_makeTemplateObject(["\n background: #ffffff;\n border: 1px solid #d0d3d9;\n box-sizing: border-box;\n border-radius: 4px;\n\n font-style: normal;\n font-weight: normal;\n font-size: 16px;\n line-height: 24px;\n color: ",";\n padding: 8px 12px;\n"],["\n background: #ffffff;\n border: 1px solid #d0d3d9;\n box-sizing: border-box;\n border-radius: 4px;\n\n font-style: normal;\n font-weight: normal;\n font-size: 16px;\n line-height: 24px;\n color: ",";\n padding: 8px 12px;\n"])),palette_coal),UploadFileProgress=styled_components_browser_esm.Ay.progress(FilesTabContent_templateObject_6||(FilesTabContent_templateObject_6=FilesTabContent_makeTemplateObject(["\n background-color: ",";\n border: none;\n border-radius: 2px;\n height: 4px;\n width: 100%;\n &::-webkit-progress-bar {\n margin: 0 auto;\n background-color: ",";\n border-radius: 2px;\n height: 4px;\n }\n &::-moz-progress-bar {\n margin: 0 auto;\n background-color: #ff8b22;\n border-radius: 2px;\n height: 4px;\n }\n &::-webkit-progress-value {\n display: inline-block;\n float: left;\n height: 4px;\n background: #ff8b22;\n border-radius: 2px;\n }\n"],["\n background-color: ",";\n border: none;\n border-radius: 2px;\n height: 4px;\n width: 100%;\n &::-webkit-progress-bar {\n margin: 0 auto;\n background-color: ",";\n border-radius: 2px;\n height: 4px;\n }\n &::-moz-progress-bar {\n margin: 0 auto;\n background-color: #ff8b22;\n border-radius: 2px;\n height: 4px;\n }\n &::-webkit-progress-value {\n display: inline-block;\n float: left;\n height: 4px;\n background: #ff8b22;\n border-radius: 2px;\n }\n"])),palette_lightgray,palette_lightgray),UploadFileDetails=styled_components_browser_esm.Ay.div(FilesTabContent_templateObject_7||(FilesTabContent_templateObject_7=FilesTabContent_makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n margin-top: 8px;\n"],["\n display: flex;\n justify-content: space-between;\n margin-top: 8px;\n"]))),FileStatus=styled_components_browser_esm.Ay.div(FilesTabContent_templateObject_8||(FilesTabContent_templateObject_8=FilesTabContent_makeTemplateObject(["\n font-style: normal;\n font-weight: normal;\n font-size: 16px;\n line-height: 24px;\n color: ",";\n"],["\n font-style: normal;\n font-weight: normal;\n font-size: 16px;\n line-height: 24px;\n color: ",";\n"])),(function(props){return props.color?props.color:"#9297A2"})),FileSize=styled_components_browser_esm.Ay.div(FilesTabContent_templateObject_9||(FilesTabContent_templateObject_9=FilesTabContent_makeTemplateObject(["\n font-style: normal;\n font-weight: normal;\n font-size: 16px;\n line-height: 24px;\n text-align: right;\n color: ",";\n"],["\n font-style: normal;\n font-weight: normal;\n font-size: 16px;\n line-height: 24px;\n text-align: right;\n color: ",";\n"])),palette_coal),LibraryContainer=styled_components_browser_esm.Ay.div(FilesTabContent_templateObject_10||(FilesTabContent_templateObject_10=FilesTabContent_makeTemplateObject(["\n margin-top: 24px;\n width: 100%;\n"],["\n margin-top: 24px;\n width: 100%;\n"]))),FilesTabContent_Menu=styled_components_browser_esm.Ay.div(FilesTabContent_templateObject_11||(FilesTabContent_templateObject_11=FilesTabContent_makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n margin-top: 8px;\n"],["\n display: flex;\n justify-content: space-between;\n margin-top: 8px;\n"]))),DropdownContainer=styled_components_browser_esm.Ay.div(FilesTabContent_templateObject_12||(FilesTabContent_templateObject_12=FilesTabContent_makeTemplateObject(["\n width: 200px;\n"],["\n width: 200px;\n"]))),FilesSelector=styled_components_browser_esm.Ay.div(FilesTabContent_templateObject_13||(FilesTabContent_templateObject_13=FilesTabContent_makeTemplateObject(["\n margin-top: 24px;\n height: 300px;\n overflow-y: auto;\n"],["\n margin-top: 24px;\n height: 300px;\n overflow-y: auto;\n"]))),EmptyFiles=styled_components_browser_esm.Ay.div(FilesTabContent_templateObject_14||(FilesTabContent_templateObject_14=FilesTabContent_makeTemplateObject(["\n display: flex;\n justify-content: center;\n align-items: center;\n height: 100px;\n\n font-style: normal;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n color: #272a32;\n"],["\n display: flex;\n justify-content: center;\n align-items: center;\n height: 100px;\n\n font-style: normal;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n color: #272a32;\n"]))),Grid=styled_components_browser_esm.Ay.div(FilesTabContent_templateObject_15||(FilesTabContent_templateObject_15=FilesTabContent_makeTemplateObject(["\n display: grid;\n grid-gap: 16.5px;\n grid-template-columns: 166px 166px 166px;\n .selected {\n border: 3px solid "," !important;\n }\n"],["\n display: grid;\n grid-gap: 16.5px;\n grid-template-columns: 166px 166px 166px;\n .selected {\n border: 3px solid "," !important;\n }\n"])),(function(_a){return _a.theme.colors.primary[100]})),GridItem=styled_components_browser_esm.Ay.div(FilesTabContent_templateObject_16||(FilesTabContent_templateObject_16=FilesTabContent_makeTemplateObject(["\n background: url('","');\n background-color: white;\n background-repeat: no-repeat;\n background-size: cover;\n background-position: center;\n width: 100%;\n height: 100px;\n border-radius: 3px;\n cursor: pointer;\n justify-content: center;\n align-items: center;\n border: 1px solid rgba(39, 42, 50, 0.1);\n"],["\n background: url('","');\n background-color: white;\n background-repeat: no-repeat;\n background-size: cover;\n background-position: center;\n width: 100%;\n height: 100px;\n border-radius: 3px;\n cursor: pointer;\n justify-content: center;\n align-items: center;\n border: 1px solid rgba(39, 42, 50, 0.1);\n"])),(function(props){return props.backgroundUrl?props.backgroundUrl:""})),ItemTypes=[{value:"file",text:"Files"},{value:"board",text:"Boards"}],FilesTabContent=function(props){var handleModalClose=props.handleModalClose,onSelect=props.onSelect,selectedFile=props.selectedFile,selectedVirtualBackgroundUrl=props.selectedVirtualBackgroundUrl,_a=FilesTabContent_read(react.useState({name:"",sizeText:"",size:0,currentUpload:0,status:"",progress:0}),2),file=_a[0],setFile=_a[1],toast=useToastNotifications().toast,_b=FilesTabContent_read(react.useState(0),2),page=_b[0],setPage=_b[1],_c=FilesTabContent_read(react.useState({count:"0",hasMore:"false"}),2),res=_c[0],setRes=_c[1],_d=FilesTabContent_read(react.useState([]),2),drops=_d[0],setDrops=_d[1],_e=FilesTabContent_read(react.useState(""),2),searchQuery=_e[0],_f=(_e[1],FilesTabContent_read(react.useState(!0),2)),loading=_f[0],setLoading=_f[1],_g=FilesTabContent_read(react.useState([{label:"All",value:""}]),2),fields=_g[0],setFields=_g[1],_h=FilesTabContent_read(react.useState(fields[0]),2),field=_h[0],setField=_h[1],_j=FilesTabContent_read(react.useState([]),2),boards=_j[0],setBoards=_j[1],userData=useAuthorizationContext().userData,itemType=(null==selectedFile?void 0:selectedFile.itemType)||ItemTypes[0].value,onDrop=(0,react.useCallback)((function(acceptedFiles){return FilesTabContent_awaiter(void 0,void 0,void 0,(function(){var f,reader;return FilesTabContent_generator(this,(function(_a){return f={name:acceptedFiles[0].name,status:statuses_WAITING,sizeText:formatBytes(acceptedFiles[0].size,2),size:acceptedFiles[0].size,progress:0,currentUpload:0},setFile(f),(reader=new FileReader).onabort=function(){return console.log("file reading was aborted")},reader.onerror=function(){return console.log("file reading has failed")},reader.onload=function(){return FilesTabContent_awaiter(void 0,void 0,void 0,(function(){var uploadedDrop;return FilesTabContent_generator(this,(function(_a){switch(_a.label){case 0:f=FilesTabContent_assign(FilesTabContent_assign({},f),{status:statuses_UPLOADING}),setFile(f),_a.label=1;case 1:return _a.trys.push([1,6,,7]),[4,(title=acceptedFiles[0].name,type=acceptedFiles[0].type,content=reader.result,uploadDrop_awaiter(void 0,void 0,void 0,(function(){return uploadDrop_generator(this,(function(_a){switch(_a.label){case 0:return[4,droplrAuth_checkDropAuth()];case 1:return _a.sent(),[2,droplrAuth_client.drops.create({type:"FILE",variant:type,title,content},{onUploadProgress:function(progressEvent){var progress=progressEvent.loaded/progressEvent.total,percentage=100*Number(progress.toFixed(2));void 0!==progressUpdate&&progressUpdate(progressEvent.total,progressEvent.loaded,percentage)}})]}}))})))];case 2:return uploadedDrop=_a.sent(),(null==uploadedDrop?void 0:uploadedDrop.previewMedium)||""?[3,4]:uploadedDrop&&uploadedDrop.code?(f=FilesTabContent_assign(FilesTabContent_assign({},f),{status:statuses_GENERATING_PREVIEW,progress:90}),setFile(f),[4,getPreviewLink(file,uploadedDrop.code,1500)]):(toast({message:"Error while uploading file, please try again later."}),[2]);case 3:return _a.sent()||"",f=FilesTabContent_assign(FilesTabContent_assign({},f),{status:statuses_FINISHED,progress:100}),setFile(f),setTimeout((function(){refreshDropsAndBoards()}),150),[3,5];case 4:f=FilesTabContent_assign(FilesTabContent_assign({},f),{status:statuses_FINISHED,progress:100}),setFile(f),setTimeout((function(){refreshDropsAndBoards()}),100),_a.label=5;case 5:return[3,7];case 6:return _a.sent(),toast({message:"Error while uploading file, please try again later."}),[3,7];case 7:return[2]}var title,type,content,progressUpdate}))}))},reader.readAsArrayBuffer(acceptedFiles[0]),[2]}))}))}),[]),getPreviewLink=function(file,dropId,timeout){return FilesTabContent_awaiter(void 0,void 0,void 0,(function(){return FilesTabContent_generator(this,(function(_a){return[2,new Promise((function(resolve){getDrop(dropId).then((function(dropDetails){return dropDetails&&dropDetails.previewMedium?resolve(dropDetails.previewMedium):helper(dropId,timeout)})).then((function(previewUrl){return resolve(previewUrl)})).catch((function(){}))}))]}))}))},helper=function(dropId,timeout){return new Promise((function(resolve){setTimeout((function(){getDrop(dropId).then((function(dropDetails){return dropDetails&&dropDetails.previewMedium?resolve(dropDetails.previewMedium):resolve(timeout>=96e3?"":helper(dropId,2*timeout))})).catch((function(){}))}),timeout)}))},_k=(0,dist_es.V)({onDrop,multiple:!1,accept:["image/png","image/jpeg"]}),getRootProps=_k.getRootProps,getInputProps=_k.getInputProps,isDragActive=_k.isDragActive,refreshDropsAndBoards=function(){return FilesTabContent_awaiter(void 0,void 0,void 0,(function(){var response,boardsResponse,boardFields;return FilesTabContent_generator(this,(function(_a){switch(_a.label){case 0:return"file"!==itemType?[2]:(setLoading(!0),[4,getDrops({boardId:field.value||"",search:searchQuery,type:"IMAGE",dropType:DROPTYPE_OPTIONS.OWNED})]);case 1:return response=_a.sent(),!boards||boards.length<=1?[4,getBoards({userId:Number(userData.id),customerId:Number(userData.customerId)}).catch((function(){}))]:[3,3];case 2:(boardsResponse=_a.sent())&&boardsResponse.boards&&(setBoards(boardsResponse.boards||[]),boardFields=generateBoardFields(boardsResponse.boards),setFields(FilesTabContent_spreadArray(FilesTabContent_spreadArray([],FilesTabContent_read(fields),!1),FilesTabContent_read(boardFields),!1))),_a.label=3;case 3:return setRes(response),setLoading(!1),setDrops(response.drops),[2]}}))}))};react.useEffect((function(){"file"===itemType&&refreshDropsAndBoards()}),[field,searchQuery,itemType]);var uploadingFiles=!!file.name,generateBoardFields=function(boards){return boards.map((function(board){return{label:board.name,value:board.id}}))||[]};return(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[!uploadingFiles&&(0,jsx_runtime.jsxs)(DropContent,FilesTabContent_assign({isDragActive},getRootProps(),{children:[(0,jsx_runtime.jsx)("input",FilesTabContent_assign({},getInputProps())),!isDragActive&&(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)("p",{children:"Drag and drop files here to upload new file"}),(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{text:"Browse files...",variant:"ghost"})]}),isDragActive&&(0,jsx_runtime.jsx)("p",{children:"Drop files here"})]})),uploadingFiles&&(0,jsx_runtime.jsxs)(UploadFileContent,{children:[(0,jsx_runtime.jsxs)(UploadFileDescription,{children:[(0,jsx_runtime.jsx)(UploadFileTitle,{children:file.name}),(0,jsx_runtime.jsx)(UploadFileProgress,{value:file.progress,max:100}),(0,jsx_runtime.jsxs)(UploadFileDetails,{children:[(0,jsx_runtime.jsx)(FileStatus,FilesTabContent_assign({color:getStatusColor(file.status)},{children:getStatusText(file.status)})),(0,jsx_runtime.jsx)(FileSize,{children:getStatusSize(file)})]})]}),(0,jsx_runtime.jsx)(UploadFileAction,{})]}),loading&&(0,jsx_runtime.jsx)(LoadingIndicator,{isLoading:loading,height:"200px"}),!loading&&(0,jsx_runtime.jsxs)(LibraryContainer,{children:[(0,jsx_runtime.jsxs)(FilesTabContent_Menu,{children:[(0,jsx_runtime.jsx)("div",{style:{width:"280px"}}),(0,jsx_runtime.jsx)("div",FilesTabContent_assign({style:{display:"flex"}},{children:(0,jsx_runtime.jsx)(DropdownContainer,{children:(0,jsx_runtime.jsx)(Dropdown,{value:field,onChange:function(newValue){setField(newValue)},options:fields,placeholder:"All",isSearchable:!1,creatable:!1})})}))]}),(0,jsx_runtime.jsx)(FilesSelector,{children:(0,jsx_runtime.jsxs)(index_es.A,FilesTabContent_assign({dataLength:page*parseInt(res.count),next:function(){return FilesTabContent_awaiter(void 0,void 0,void 0,(function(){var response;return FilesTabContent_generator(this,(function(_a){switch(_a.label){case 0:return[4,getDrops({boardId:field.value||"",search:searchQuery,page:page+1,type:"IMAGE",dropType:DROPTYPE_OPTIONS.OWNED})];case 1:return response=_a.sent(),setPage(page+1),setRes(response),setDrops(FilesTabContent_spreadArray(FilesTabContent_spreadArray([],FilesTabContent_read(drops),!1),FilesTabContent_read(response.drops),!1)),[2]}}))}))},hasMore:"true"===res.hasMore,loader:(0,jsx_runtime.jsx)("h4",{children:"Loading..."}),height:300,endMessage:(0,jsx_runtime.jsx)("p",FilesTabContent_assign({style:{textAlign:"center"}},{children:(0,jsx_runtime.jsx)("b",{children:"No more files"})}))},{children:[(0,jsx_runtime.jsx)(Grid,{children:drops.map((function(drop){return(0,jsx_runtime.jsx)(GridItem,{backgroundUrl:drop.previewMedium,onClick:function(){onSelect(drop.previewMedium,"custom",-1,drop.privacy,drop.code),handleModalClose()},className:selectedVirtualBackgroundUrl===drop.previewMedium?"selected":""},drop.code)}))}),!drops.length&&(0,jsx_runtime.jsx)(EmptyFiles,{children:"No files found."})]}))})]})]})},VirtualBackgroundLibraryModal_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},VirtualBackgroundLibraryModal_assign=function(){return VirtualBackgroundLibraryModal_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},VirtualBackgroundLibraryModal_assign.apply(this,arguments)},VirtualBackgroundLibraryModal_Container=styled_components_browser_esm.Ay.div(VirtualBackgroundLibraryModal_templateObject_1||(VirtualBackgroundLibraryModal_templateObject_1=VirtualBackgroundLibraryModal_makeTemplateObject(["\n width: 592px;\n height: 648px;\n background: #ffffff;\n border: 1px solid #f7f8fa;\n box-shadow: 0px 4px 12px rgba(29, 30, 36, 0.04);\n borde-rradius: 4px;\n padding: 25px;\n box-sizing: border-box;\n"],["\n width: 592px;\n height: 648px;\n background: #ffffff;\n border: 1px solid #f7f8fa;\n box-shadow: 0px 4px 12px rgba(29, 30, 36, 0.04);\n borde-rradius: 4px;\n padding: 25px;\n box-sizing: border-box;\n"]))),VirtualBackgroundLibraryModal_Header=styled_components_browser_esm.Ay.div(VirtualBackgroundLibraryModal_templateObject_2||(VirtualBackgroundLibraryModal_templateObject_2=VirtualBackgroundLibraryModal_makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n"],["\n display: flex;\n align-items: center;\n justify-content: space-between;\n"]))),VirtualBackgroundLibraryModal_Title=styled_components_browser_esm.Ay.div(VirtualBackgroundLibraryModal_templateObject_3||(VirtualBackgroundLibraryModal_templateObject_3=VirtualBackgroundLibraryModal_makeTemplateObject(["\n width: 275px;\n height: 24px;\n\n font-style: normal;\n font-weight: bold;\n font-size: 18px;\n line-height: 24px;\n color: #272a32;\n"],["\n width: 275px;\n height: 24px;\n\n font-style: normal;\n font-weight: bold;\n font-size: 18px;\n line-height: 24px;\n color: #272a32;\n"]))),VirtualBackgroundLibraryModal_CloseButtonWrap=styled_components_browser_esm.Ay.div(VirtualBackgroundLibraryModal_templateObject_4||(VirtualBackgroundLibraryModal_templateObject_4=VirtualBackgroundLibraryModal_makeTemplateObject(["\n margin-left: 20px;\n color: ",";\n height: 24px;\n width: 24px;\n &:hover {\n opacity: 0.7;\n cursor: pointer;\n }\n"],["\n margin-left: 20px;\n color: ",";\n height: 24px;\n width: 24px;\n &:hover {\n opacity: 0.7;\n cursor: pointer;\n }\n"])),palette_white),VirtualBackgroundLibraryModal=function(_a){var handleModalClose=_a.handleModalClose,selectedVirtualBackgroundUrl=_a.selectedVirtualBackgroundUrl,onSelect=_a.onSelect;return(0,jsx_runtime.jsx)(Modal_Modal,VirtualBackgroundLibraryModal_assign({style:{position:"fixed"}},{children:(0,jsx_runtime.jsxs)(VirtualBackgroundLibraryModal_Container,VirtualBackgroundLibraryModal_assign({style:{width:"592px",height:"648px",background:"#FFFFFF",border:"1px solid #F7F8FA",boxShadow:"0px 4px 12px rgba(29, 30, 36, 0.04)",borderRadius:"4px"}},{children:[(0,jsx_runtime.jsxs)(VirtualBackgroundLibraryModal_Header,{children:[(0,jsx_runtime.jsx)(VirtualBackgroundLibraryModal_Title,{children:"Select your virtual background"}),(0,jsx_runtime.jsx)(VirtualBackgroundLibraryModal_CloseButtonWrap,VirtualBackgroundLibraryModal_assign({title:"Close"},{children:(0,jsx_runtime.jsx)(io_index_esm.WQq,{size:24,onClick:handleModalClose,color:palette_label})}))]}),(0,jsx_runtime.jsx)("br",{}),(0,jsx_runtime.jsx)(FilesTabContent,{onSelect,handleModalClose,selectedVirtualBackgroundUrl})]}))}))},VirtualBackgrounds_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},VirtualBackgrounds_assign=function(){return VirtualBackgrounds_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},VirtualBackgrounds_assign.apply(this,arguments)},VirtualBackgrounds_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},VirtualBackgrounds_spreadArray=function(to,from,pack){if(pack||2===arguments.length)for(var ar,i=0,l=from.length;i<l;i++)!ar&&i in from||(ar||(ar=Array.prototype.slice.call(from,0,i)),ar[i]=from[i]);return to.concat(ar||Array.prototype.slice.call(from))},VirtualBackgrounds_Container=styled_components_browser_esm.Ay.div(VirtualBackgrounds_templateObject_1||(VirtualBackgrounds_templateObject_1=VirtualBackgrounds_makeTemplateObject(["\n display: flex;\n width: 100%;\n height: auto;\n background: #f6f7f9;\n border-radius: 5px;\n padding: 15px;\n flex-direction: column;\n box-sizing: border-box;\n .selected {\n border: 3px solid "," !important;\n }\n"],["\n display: flex;\n width: 100%;\n height: auto;\n background: #f6f7f9;\n border-radius: 5px;\n padding: 15px;\n flex-direction: column;\n box-sizing: border-box;\n .selected {\n border: 3px solid "," !important;\n }\n"])),(function(_a){return _a.theme.colors.primary[100]})),VirtualBackgrounds_Header=styled_components_browser_esm.Ay.div(VirtualBackgrounds_templateObject_2||(VirtualBackgrounds_templateObject_2=VirtualBackgrounds_makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n box-sizing: border-box;\n"],["\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n box-sizing: border-box;\n"]))),VirtualBackgrounds_Title=styled_components_browser_esm.Ay.div(VirtualBackgrounds_templateObject_3||(VirtualBackgrounds_templateObject_3=VirtualBackgrounds_makeTemplateObject(["\n height: 24px;\n\n font-style: normal;\n font-weight: 500;\n font-size: 14px;\n line-height: 24px;\n color: #4e5461;\n"],["\n height: 24px;\n\n font-style: normal;\n font-weight: 500;\n font-size: 14px;\n line-height: 24px;\n color: #4e5461;\n"]))),GridContainer=styled_components_browser_esm.Ay.div(VirtualBackgrounds_templateObject_4||(VirtualBackgrounds_templateObject_4=VirtualBackgrounds_makeTemplateObject(["\n display: flex;\n width: 100%;\n height: 278px;\n box-sizing: border-box;\n overflow-y: scroll;\n margin-top: 20px;\n flex-wrap: wrap;\n"],["\n display: flex;\n width: 100%;\n height: 278px;\n box-sizing: border-box;\n overflow-y: scroll;\n margin-top: 20px;\n flex-wrap: wrap;\n"]))),VirtualBackgrounds_Grid=styled_components_browser_esm.Ay.div(VirtualBackgrounds_templateObject_5||(VirtualBackgrounds_templateObject_5=VirtualBackgrounds_makeTemplateObject(["\n display: grid;\n width: 100%;\n grid-gap: 16.5px;\n grid-template-columns: 1fr 1fr 1fr 1fr;\n @media screen and (max-width: 768px) {\n grid-template-columns: 1fr 1fr;\n }\n"],["\n display: grid;\n width: 100%;\n grid-gap: 16.5px;\n grid-template-columns: 1fr 1fr 1fr 1fr;\n @media screen and (max-width: 768px) {\n grid-template-columns: 1fr 1fr;\n }\n"]))),VirtualBackgrounds_GridItem=styled_components_browser_esm.Ay.div(VirtualBackgrounds_templateObject_6||(VirtualBackgrounds_templateObject_6=VirtualBackgrounds_makeTemplateObject(["\n background: url('","');\n background-color: white;\n background-repeat: no-repeat;\n background-size: cover;\n background-position: center;\n width: 100%;\n height: 100px;\n border-radius: 3px;\n cursor: pointer;\n justify-content: center;\n align-items: center;\n border: 1px solid rgba(39, 42, 50, 0.1);\n box-sizing: border-box;\n"],["\n background: url('","');\n background-color: white;\n background-repeat: no-repeat;\n background-size: cover;\n background-position: center;\n width: 100%;\n height: 100px;\n border-radius: 3px;\n cursor: pointer;\n justify-content: center;\n align-items: center;\n border: 1px solid rgba(39, 42, 50, 0.1);\n box-sizing: border-box;\n"])),(function(props){return props.backgroundUrl?props.backgroundUrl:""})),VirtualBackgroundImages=["https://virtualbackgrounds.s3.amazonaws.com/Embed/vb1.webp","https://virtualbackgrounds.s3.amazonaws.com/Embed/vb2.webp","https://virtualbackgrounds.s3.amazonaws.com/Embed/vb3.webp","https://virtualbackgrounds.s3.amazonaws.com/Embed/vb4.webp","https://virtualbackgrounds.s3.amazonaws.com/Embed/vb5.webp","https://virtualbackgrounds.s3.amazonaws.com/Embed/vb6.webp","https://virtualbackgrounds.s3.amazonaws.com/Embed/vb7.webp","https://virtualbackgrounds.s3.amazonaws.com/Embed/vb8.webp","https://virtualbackgrounds.s3.amazonaws.com/Embed/vb9.webp","https://virtualbackgrounds.s3.amazonaws.com/Embed/vb10.webp","https://virtualbackgrounds.s3.amazonaws.com/Embed/vb11.webp","https://virtualbackgrounds.s3.amazonaws.com/Embed/vb12.webp","https://virtualbackgrounds.s3.amazonaws.com/Embed/vb13.webp","https://virtualbackgrounds.s3.amazonaws.com/Embed/vb14.webp","https://virtualbackgrounds.s3.amazonaws.com/Embed/vb15.webp","https://virtualbackgrounds.s3.amazonaws.com/Embed/vb16.webp","https://virtualbackgrounds.s3.amazonaws.com/Embed/vb17.webp","https://virtualbackgrounds.s3.amazonaws.com/Embed/vb18.webp","https://virtualbackgrounds.s3.amazonaws.com/Embed/vb19.webp","https://virtualbackgrounds.s3.amazonaws.com/Embed/vb20.webp","https://virtualbackgrounds.s3.amazonaws.com/Embed/vb21.webp"],VirtualBackgrounds=function(_a){var onSelect=_a.onSelect,onMainButtonClick=_a.onMainButtonClick,selectedVirtualBackgroundUrl=_a.selectedVirtualBackgroundUrl,customVirtualBackgrounds=_a.customVirtualBackgrounds,colors=(0,styled_components_browser_esm.DP)().colors,_b=VirtualBackgrounds_read(react.useState(!1),2),showLibraryModal=_b[0],setShowLibraryModal=_b[1],customVbUrls=(null==customVirtualBackgrounds?void 0:customVirtualBackgrounds.map((function(vb){return vb.url})))||[],userData=useAuthorizationContext().userData,virtualBackgrounds=VirtualBackgrounds_spreadArray(VirtualBackgrounds_spreadArray([],VirtualBackgrounds_read(customVbUrls),!1),VirtualBackgrounds_read(VirtualBackgroundImages),!1);return(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[showLibraryModal&&(0,jsx_runtime.jsx)(VirtualBackgroundLibraryModal,{selectedVirtualBackgroundUrl,onSelect,handleModalClose:function(){setShowLibraryModal(!1)}}),(0,jsx_runtime.jsxs)(VirtualBackgrounds_Container,{children:[(0,jsx_runtime.jsxs)(VirtualBackgrounds_Header,{children:[(0,jsx_runtime.jsx)(VirtualBackgrounds_Title,{children:"Select a virtual background"}),(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{variant:"primary",text:"Done",icon:(0,jsx_runtime.jsx)(md_index_esm.g9_,{size:24}),onClick:onMainButtonClick})]}),(0,jsx_runtime.jsx)(GridContainer,{children:(0,jsx_runtime.jsxs)(VirtualBackgrounds_Grid,{children:[(0,jsx_runtime.jsx)(VirtualBackgrounds_GridItem,VirtualBackgrounds_assign({onClick:function(){onSelect("","none",-1)}},{children:(0,jsx_runtime.jsx)("div",VirtualBackgrounds_assign({style:{display:"flex",color:colors.primary[100],justifyContent:"center",alignItems:"center",height:"100px",fontSize:"34px",borderRadius:"3px",boxSizing:"border-box"},className:""===selectedVirtualBackgroundUrl?"selected":""},{children:(0,jsx_runtime.jsx)(fa_index_esm.Rqy,{})}))})),userData.droplrAccess&&(0,jsx_runtime.jsx)(VirtualBackgrounds_GridItem,VirtualBackgrounds_assign({onClick:function(){setShowLibraryModal(!0)}},{children:(0,jsx_runtime.jsxs)("div",VirtualBackgrounds_assign({style:{display:"flex",flexDirection:"column",color:"#FF8B22",justifyContent:"center",alignItems:"center",height:"100px",fontSize:"28px",borderRadius:"3px",boxSizing:"border-box"}},{children:[(0,jsx_runtime.jsx)(md_index_esm.dZJ,{color:colors.primary[100]}),(0,jsx_runtime.jsx)("div",VirtualBackgrounds_assign({style:{marginTop:"5px",width:"auto",display:"flex",color:colors.primary[100],justifyContent:"center",alignItems:"center",height:"auto",fontSize:"14px",boxSizing:"border-box"}},{children:"Select your own"}))]}))})),virtualBackgrounds.map((function(image,index){return(0,jsx_runtime.jsx)(VirtualBackgrounds_GridItem,{backgroundUrl:image,className:selectedVirtualBackgroundUrl===image?"selected":"",onClick:function(){image.includes("https://cv-custom-virtual-backgrounds.s3.amazonaws.com/")?onSelect(image,"custom",-1):onSelect(image,"default",index)}},image+index)}))]})})]})]})},VirtualBackgroundsButton_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},VirtualBackgroundsButton_assign=function(){return VirtualBackgroundsButton_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},VirtualBackgroundsButton_assign.apply(this,arguments)},VirtualBackgroundsButton_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},VirtualBackgroundsButton_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},VirtualBackgroundsButton_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},VirtualBackgroundsWrapper=styled_components_browser_esm.Ay.div(VirtualBackgroundsButton_templateObject_1||(VirtualBackgroundsButton_templateObject_1=VirtualBackgroundsButton_makeTemplateObject(["\n max-width: 770px;\n margin-top: 25px;\n"],["\n max-width: 770px;\n margin-top: 25px;\n"]))),VirtualBackgroundButtonWrapper=styled_components_browser_esm.Ay.div(VirtualBackgroundsButton_templateObject_2||(VirtualBackgroundsButton_templateObject_2=VirtualBackgroundsButton_makeTemplateObject(["\n position: absolute;\n bottom: 25px;\n right: 20px;\n z-index: 2;\n"],["\n position: absolute;\n bottom: 25px;\n right: 20px;\n z-index: 2;\n"]))),DisabledTooltipPopup=function(){return(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(ParagraphSmallBold,{children:"Virtual Backgrounds"}),(0,jsx_runtime.jsx)(ParagraphSmall,{children:"Select from a library of high-resolution images, or upload your own for extra personalization."})]})},VirtualBackgroundsButton=function(_a){var videoRef=_a.videoRef,canvasRef=_a.canvasRef,isSegmenterActive=_a.isSegmenterActive,setIsSegmenterActive=_a.setIsSegmenterActive,status=_a.status,initialImage=_a.initialImage,setIsLoadingVB=_a.setIsLoadingVB,isLoadingVb=_a.isLoadingVb,_b=(0,styled_components_browser_esm.DP)(),colors=_b.colors,isCdkEnviroment=_b.isCdkEnviroment,_c=VirtualBackgroundsButton_read((0,react.useState)(!1),2),showVirtualBackgrounds=_c[0],setShowVirtualBackgrounds=_c[1],userData=useAuthorizationContext().userData,_d=VirtualBackgroundsButton_read((0,react.useState)(!0),2),showVirtualBackgroundButton=_d[0],setShowVirtualBackgroundButton=_d[1],_e=VirtualBackgroundsButton_read((0,react.useState)(initialImage),2),selectedVirtualBackground=_e[0],setSelectedVirtualBackground=_e[1],_f=useImageSegmenter(canvasRef,videoRef,setIsLoadingVB),onCreateVirtualBackgroundHandler=_f.onCreateVirtualBackgroundHandler,onDestroyVirtualBackgroundHandler=_f.onDestroyVirtualBackgroundHandler,imageRef=_f.imageRef,getCavansBgImage=_f.getCavansBgImage,customVirtualBackgrounds=useCustomVirtualBackgroundQuery().data,startVirtualBg=function(){var _a,_b,_c;(null===(_a=canvasRef.current)||void 0===_a?void 0:_a.width)&&(null===(_b=canvasRef.current)||void 0===_b?void 0:_b.height)&&(null===(_c=videoRef.current)||void 0===_c?void 0:_c.videoWidth)&&videoRef.current.videoHeight&&(onCreateVirtualBackgroundHandler(),setIsSegmenterActive(!0))},onSelectImageSaveToLocalStorageHandler=function(_a){var saveParams={url:_a.url,type:_a.type,index:_a.index,privacy:_a.privacy,id:_a.id};setSelectedVirtualBackground(saveParams),saveVirtualBackgroundToStorage(saveParams,userData.id)};return(0,react.useEffect)((function(){var _a,_b,_c,_d;if(0==(null===(_b=null===(_a=userData.user)||void 0===_a?void 0:_a.packageDetails)||void 0===_b?void 0:_b.id))setShowVirtualBackgroundButton(!0);else if(null===(_d=null===(_c=userData.user)||void 0===_c?void 0:_c.packageDetails)||void 0===_d?void 0:_d.products){var status_1=checkIfFeatureIsEnabled(userData,productFeature_VIRTUAL_BACKGROUNDS);setShowVirtualBackgroundButton(status_1)}}),[]),(0,react.useEffect)((function(){if(status===RECORDING_STATUS.CAMERA_READY){var url=selectedVirtualBackground.url;if(url&&imageRef.current){var imageElement_2=imageRef.current;return imageElement_2.crossOrigin="Anonymous",imageElement_2.src="".concat(url,"?t=virtual"),imageElement_2.onload=function(){return VirtualBackgroundsButton_awaiter(void 0,void 0,void 0,(function(){return VirtualBackgroundsButton_generator(this,(function(_a){return isSegmenterActive||(null==getCavansBgImage||getCavansBgImage(),startVirtualBg()),[2]}))}))},function(){imageElement_2.onload=null}}}}),[status]),(0,react.useEffect)((function(){return function(){onDestroyVirtualBackgroundHandler()}}),[]),(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[!showVirtualBackgrounds&&(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[isLoadingVb&&(0,jsx_runtime.jsx)(RecordCamLoader,{text:"Applying Virtual Background"}),status===RECORDING_STATUS.CAMERA_READY&&(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:!isLoadingVb&&(0,jsx_runtime.jsx)(VirtualBackgroundButtonWrapper,{children:(0,jsx_runtime.jsx)(react_covideo_common_esm.m_,{position:"bottom",children:(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{icon:(0,jsx_runtime.jsx)(VirtualBgIcon,{}),variant:isCdkEnviroment?"text":"white",disabled:!showVirtualBackgroundButton,text:"Virtual Backgrounds",onClick:function(){setShowVirtualBackgrounds(!showVirtualBackgrounds)}}),popup:showVirtualBackgroundButton?null:(0,jsx_runtime.jsx)(DisabledTooltipPopup,{}),extendStyles:{popup:showVirtualBackgroundButton?{display:"none"}:VirtualBackgroundsButton_assign({width:210,gap:8,display:"flex",flexDirection:"column",padding:"10px 24px"},isCdkEnviroment?{color:colors.white[100],background:colors.black[100]}:{})}})})})]}),(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:(0,jsx_runtime.jsx)(VirtualBackgroundsWrapper,VirtualBackgroundsButton_assign({hidden:!showVirtualBackgrounds||status===RECORDING_STATUS.RECORDING},{children:(0,jsx_runtime.jsx)(VirtualBackgrounds,{selectedVirtualBackgroundUrl:selectedVirtualBackground.url,customVirtualBackgrounds,onMainButtonClick:function(){setShowVirtualBackgrounds(!1)},onSelect:function(url,type,index,privacy,id){void 0===url&&(url=""),void 0===privacy&&(privacy="PUBLIC"),void 0===id&&(id="");var saveParams={url,type,index,privacy,id};if("none"===type)return onDestroyVirtualBackgroundHandler(),setIsSegmenterActive(!1),void onSelectImageSaveToLocalStorageHandler(saveParams);onSelectImageSaveToLocalStorageHandler(saveParams),function(url,getCavansBgImage){if(imageRef.current){var imageElement_1=imageRef.current;imageElement_1.src="".concat(url,"?t=virtual"),imageElement_1.crossOrigin="Anonymous",imageElement_1.onload=function(){null==getCavansBgImage||getCavansBgImage(),isSegmenterActive||startVirtualBg()}}}(url,getCavansBgImage)}})}))}),(0,jsx_runtime.jsx)("img",{ref:imageRef,crossOrigin:"anonymous",alt:"Segmentation",style:{display:"none"}})]})},teleprompterApi_assign=function(){return teleprompterApi_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},teleprompterApi_assign.apply(this,arguments)},teleprompterApi_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},teleprompterApi_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},createScript=function(_a){var data=_a.data;return teleprompterApi_awaiter(void 0,void 0,void 0,(function(){return teleprompterApi_generator(this,(function(_b){switch(_b.label){case 0:return[4,config_EXPRESS_API.post("/teleprompter",data)];case 1:return[2,_b.sent().data]}}))}))},updateScript=function(_a){var scriptId=_a.scriptId,data=_a.data;return teleprompterApi_awaiter(void 0,void 0,Promise,(function(){return teleprompterApi_generator(this,(function(_b){switch(_b.label){case 0:return[4,config_EXPRESS_API.put("/teleprompter/".concat(scriptId),data)];case 1:return[2,_b.sent().data]}}))}))},lib_components_Search_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},Search_assign=function(){return Search_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},Search_assign.apply(this,arguments)},Search_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},Search_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},lib_components_Search_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},SearchBarWrapper=styled_components_browser_esm.Ay.div(lib_components_Search_templateObject_1||(lib_components_Search_templateObject_1=lib_components_Search_makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n ","\n font-size: ",";\n color: black;\n border: 1px solid ",";\n background-color: ",";\n border-radius: 4px;\n box-sizing: border-box;\n width: ",";\n height: 40px;\n opacity: ",";\n\n "," {\n width: ",";\n }\n"],["\n display: flex;\n justify-content: space-between;\n ","\n font-size: ",";\n color: black;\n border: 1px solid ",";\n background-color: ",";\n border-radius: 4px;\n box-sizing: border-box;\n width: ",";\n height: 40px;\n opacity: ",";\n\n "," {\n width: ",";\n }\n"])),fontNormal500,fontSizes_md,palette_grayBorder,(function(props){return props.bgColor?props.bgColor:"#F2F4F6"}),(function(props){return props.width?props.width:"200px"}),(function(props){return props.disabled?.6:1}),mediaQueryMinWidth.lg,(function(props){return props.width})),Search_Icon=styled_components_browser_esm.Ay.div(lib_components_Search_templateObject_2||(lib_components_Search_templateObject_2=lib_components_Search_makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n width: 34px;\n cursor: ",";\n border-radius: 5px;\n background-color: ",";\n color: ",";\n font-size: 34px;\n opacity: 0.6;\n &:hover {\n opacity: 1;\n }\n"],["\n display: flex;\n align-items: center;\n justify-content: center;\n width: 34px;\n cursor: ",";\n border-radius: 5px;\n background-color: ",";\n color: ",";\n font-size: 34px;\n opacity: 0.6;\n &:hover {\n opacity: 1;\n }\n"])),(function(props){return props.disabled?"normal":"pointer"}),(function(props){return props.bgColor?props.bgColor:"#F2F4F6"}),palette_themeDark),Search_Input=styled_components_browser_esm.Ay.input(lib_components_Search_templateObject_3||(lib_components_Search_templateObject_3=lib_components_Search_makeTemplateObject(["\n background-color: ",";\n box-sizing: border-box;\n ",";\n border-radius: 5px;\n font-size: ",";\n border: 0;\n padding: 12px 8px 12px 12px;\n flex: 1;\n &:focus {\n outline: 0;\n }\n"],["\n background-color: ",";\n box-sizing: border-box;\n ",";\n border-radius: 5px;\n font-size: ",";\n border: 0;\n padding: 12px 8px 12px 12px;\n flex: 1;\n &:focus {\n outline: 0;\n }\n"])),(function(props){return props.bgColor?props.bgColor:"#F2F4F6"}),fontNormal500,fontSizes_md),TagOptions=styled_components_browser_esm.Ay.div(lib_components_Search_templateObject_4||(lib_components_Search_templateObject_4=lib_components_Search_makeTemplateObject(["\n position: absolute;\n background-color: white;\n width: 266px;\n margin-top: 42px;\n max-height: 200px;\n z-index: 3;\n border-radius: 4px;\n border: 1px solid ",";\n max-height: 100px;\n overflow: auto;\n &::-webkit-scrollbar {\n display: none;\n }\n -ms-overflow-style: none; /* IE and Edge */\n scrollbar-width: none; /* Firefox */\n"],["\n position: absolute;\n background-color: white;\n width: 266px;\n margin-top: 42px;\n max-height: 200px;\n z-index: 3;\n border-radius: 4px;\n border: 1px solid ",";\n max-height: 100px;\n overflow: auto;\n &::-webkit-scrollbar {\n display: none;\n }\n -ms-overflow-style: none; /* IE and Edge */\n scrollbar-width: none; /* Firefox */\n"])),palette_lightgray),Search_TagOption=styled_components_browser_esm.Ay.div(Search_templateObject_5||(Search_templateObject_5=lib_components_Search_makeTemplateObject(["\n padding: 6px 12px;\n &:hover {\n cursor: pointer;\n background-color: ",";\n }\n"],["\n padding: 6px 12px;\n &:hover {\n cursor: pointer;\n background-color: ",";\n }\n"])),(function(_a){return _a.theme.colors.primary[10]})),lib_components_Search_Search=react.memo((function(_a){var onSearch=_a.onSearch,placeholder=_a.placeholder,onChange=_a.onChange,disabled=_a.disabled,prevSearch=_a.prevSearch,_b=_a.width,width=void 0===_b?"100%":_b,currentFolder=_a.currentFolder,_c=_a.useTags,useTags=void 0!==_c&&_c,_d=_a.className,className=void 0===_d?"":_d,_e=_a.bgColor,bgColor=void 0===_e?"":_e,_f=_a.dataCy,dataCy=void 0===_f?"":_f,_g=lib_components_Search_read((0,react.useState)(!1),2),focused=_g[0],setFocused=_g[1],_h=lib_components_Search_read((0,react.useState)([]),2),initialTags=_h[0],setInitialTags=_h[1],_j=lib_components_Search_read((0,react.useState)([]),2),tags=_j[0],setTags=_j[1],_k=lib_components_Search_read(react.useState(prevSearch||""),2),searchTerm=_k[0],setSearchTerm=_k[1];react.useEffect((function(){useTags&&Search_awaiter(void 0,void 0,void 0,(function(){var tags,data;return Search_generator(this,(function(_a){switch(_a.label){case 0:return[4,getTags({all:"Company"===(null==currentFolder?void 0:currentFolder.name),refresh:!1})];case 1:return tags=_a.sent(),data=(tags||[]).map((function(t){return{value:t.tagId,label:t.tag}})).filter((function(t){return searchTerm!==t.value})),setTags(data),setInitialTags(data),[2]}}))}))}),[currentFolder]),react.useEffect((function(){void 0!==prevSearch&&setSearchTerm(prevSearch)}),[prevSearch]);return(0,jsx_runtime.jsxs)(SearchBarWrapper,Search_assign({},""!==className?{className}:{},{disabled,width,bgColor},{children:[(0,jsx_runtime.jsx)(Search_Input,{"data-cy":dataCy,disabled,type:"text",placeholder,value:searchTerm,onChange:function(e){setSearchTerm(e.currentTarget.value),setTags(initialTags.filter((function(tag){return tag.label.match(new RegExp(e.currentTarget.value,"ig"))}))),onChange&&onChange(e)},onKeyUp:function(e){"Enter"===e.key&&onSearch(searchTerm)},onFocus:function(){return setFocused(!0)},onBlur:function(){setTimeout((function(){setFocused(!1)}),300)},bgColor}),focused&&tags&&!!tags.length&&(0,jsx_runtime.jsx)(TagOptions,{children:tags.map((function(tag){return(0,jsx_runtime.jsx)(Search_TagOption,Search_assign({onClick:function(){return onSearch(tag.label)}},{children:tag.label}),tag.value)}))}),searchTerm&&(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(Search_Icon,Search_assign({onClick:function(){setSearchTerm(""),onSearch("")},style:{width:20,backgroundColor:"transparent"}},{children:(0,jsx_runtime.jsx)(md_index_esm.uDv,{size:"18px",color:"#e84c3d"})})),(0,jsx_runtime.jsx)("div",{style:{margin:"8px 0 8px 6px",width:1,background:palette_grayBorder}})]}),(0,jsx_runtime.jsx)(Search_Icon,Search_assign({disabled,onClick:disabled?function(){}:function(){onSearch(searchTerm)},bgColor,"data-cy":dataCy?"".concat(dataCy,"-icon"):""},{children:(0,jsx_runtime.jsx)(io_index_esm.uG9,{size:"24px",color:"#4e5461"})}))]}))})),DroplrFilesTabContent_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},DroplrFilesTabContent_assign=function(){return DroplrFilesTabContent_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},DroplrFilesTabContent_assign.apply(this,arguments)},DroplrFilesTabContent_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},DroplrFilesTabContent_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},DroplrFilesTabContent_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},DroplrFilesTabContent_spreadArray=function(to,from,pack){if(pack||2===arguments.length)for(var ar,i=0,l=from.length;i<l;i++)!ar&&i in from||(ar||(ar=Array.prototype.slice.call(from,0,i)),ar[i]=from[i]);return to.concat(ar||Array.prototype.slice.call(from))},fields=[{value:"createdAtASC",label:"Uploaded on (ASC)",order:"ASC",key:"CREATION"},{value:"createdAtDESC",label:"Uploaded on (DESC)",order:"DESC",key:"CREATION"}],DroplrFilesTabContent_DropContent=styled_components_browser_esm.Ay.div(DroplrFilesTabContent_templateObject_1||(DroplrFilesTabContent_templateObject_1=DroplrFilesTabContent_makeTemplateObject(["\n margin-top: 24px;\n padding: 0 32px;\n width: 100%;\n height: 120px;\n box-sizing: border-box;\n border-radius: 4px;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n background: ",";\n border: 1px dashed #d0d3d9;\n > p {\n font-style: normal;\n font-weight: normal;\n font-size: 16px;\n line-height: 24px;\n text-align: center;\n color: ",";\n }\n"],["\n margin-top: 24px;\n padding: 0 32px;\n width: 100%;\n height: 120px;\n box-sizing: border-box;\n border-radius: 4px;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n background: ",";\n border: 1px dashed #d0d3d9;\n > p {\n font-style: normal;\n font-weight: normal;\n font-size: 16px;\n line-height: 24px;\n text-align: center;\n color: ",";\n }\n"])),(function(props){return props.isDragActive,"#F6F7F9"}),palette_coal),DroplrFilesTabContent_UploadFileContent=styled_components_browser_esm.Ay.div(DroplrFilesTabContent_templateObject_2||(DroplrFilesTabContent_templateObject_2=DroplrFilesTabContent_makeTemplateObject(["\n margin-top: 24px;\n background: #f6f7f9;\n border-radius: 4px;\n display: flex;\n padding: 16px 32px;\n"],["\n margin-top: 24px;\n background: #f6f7f9;\n border-radius: 4px;\n display: flex;\n padding: 16px 32px;\n"]))),DroplrFilesTabContent_UploadFileDescription=styled_components_browser_esm.Ay.div(DroplrFilesTabContent_templateObject_3||(DroplrFilesTabContent_templateObject_3=DroplrFilesTabContent_makeTemplateObject(["\n width: 90%;\n"],["\n width: 90%;\n"]))),DroplrFilesTabContent_UploadFileAction=styled_components_browser_esm.Ay.div(DroplrFilesTabContent_templateObject_4||(DroplrFilesTabContent_templateObject_4=DroplrFilesTabContent_makeTemplateObject(["\n width: 10%;\n"],["\n width: 10%;\n"]))),DroplrFilesTabContent_UploadFileTitle=styled_components_browser_esm.Ay.div(DroplrFilesTabContent_templateObject_5||(DroplrFilesTabContent_templateObject_5=DroplrFilesTabContent_makeTemplateObject(["\n background: #ffffff;\n border: 1px solid #d0d3d9;\n box-sizing: border-box;\n border-radius: 4px;\n font-style: normal;\n font-weight: normal;\n font-size: 16px;\n line-height: 24px;\n color: ",";\n padding: 8px 12px;\n"],["\n background: #ffffff;\n border: 1px solid #d0d3d9;\n box-sizing: border-box;\n border-radius: 4px;\n font-style: normal;\n font-weight: normal;\n font-size: 16px;\n line-height: 24px;\n color: ",";\n padding: 8px 12px;\n"])),palette_coal),DroplrFilesTabContent_UploadFileProgress=styled_components_browser_esm.Ay.progress(DroplrFilesTabContent_templateObject_6||(DroplrFilesTabContent_templateObject_6=DroplrFilesTabContent_makeTemplateObject(["\n background-color: ",";\n border: none;\n border-radius: 2px;\n height: 4px;\n width: 100%;\n &::-webkit-progress-bar {\n margin: 0 auto;\n background-color: ",";\n border-radius: 2px;\n height: 4px;\n }\n &::-moz-progress-bar {\n margin: 0 auto;\n background-color: #ff8b22;\n border-radius: 2px;\n height: 4px;\n }\n &::-webkit-progress-value {\n display: inline-block;\n float: left;\n height: 4px;\n background: #ff8b22;\n border-radius: 2px;\n }\n"],["\n background-color: ",";\n border: none;\n border-radius: 2px;\n height: 4px;\n width: 100%;\n &::-webkit-progress-bar {\n margin: 0 auto;\n background-color: ",";\n border-radius: 2px;\n height: 4px;\n }\n &::-moz-progress-bar {\n margin: 0 auto;\n background-color: #ff8b22;\n border-radius: 2px;\n height: 4px;\n }\n &::-webkit-progress-value {\n display: inline-block;\n float: left;\n height: 4px;\n background: #ff8b22;\n border-radius: 2px;\n }\n"])),palette_lightgray,palette_lightgray),DroplrFilesTabContent_UploadFileDetails=styled_components_browser_esm.Ay.div(DroplrFilesTabContent_templateObject_7||(DroplrFilesTabContent_templateObject_7=DroplrFilesTabContent_makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n margin-top: 8px;\n"],["\n display: flex;\n justify-content: space-between;\n margin-top: 8px;\n"]))),DroplrFilesTabContent_FileStatus=styled_components_browser_esm.Ay.div(DroplrFilesTabContent_templateObject_8||(DroplrFilesTabContent_templateObject_8=DroplrFilesTabContent_makeTemplateObject(["\n font-style: normal;\n font-weight: normal;\n font-size: 16px;\n line-height: 24px;\n color: ",";\n"],["\n font-style: normal;\n font-weight: normal;\n font-size: 16px;\n line-height: 24px;\n color: ",";\n"])),(function(props){return props.color?props.color:"#9297A2"})),DroplrFilesTabContent_FileSize=styled_components_browser_esm.Ay.div(DroplrFilesTabContent_templateObject_9||(DroplrFilesTabContent_templateObject_9=DroplrFilesTabContent_makeTemplateObject(["\n font-style: normal;\n font-weight: normal;\n font-size: 16px;\n line-height: 24px;\n text-align: right;\n color: ",";\n"],["\n font-style: normal;\n font-weight: normal;\n font-size: 16px;\n line-height: 24px;\n text-align: right;\n color: ",";\n"])),palette_coal),DroplrFilesTabContent_LibraryContainer=styled_components_browser_esm.Ay.div(DroplrFilesTabContent_templateObject_10||(DroplrFilesTabContent_templateObject_10=DroplrFilesTabContent_makeTemplateObject(["\n margin-top: 24px;\n width: 100%;\n"],["\n margin-top: 24px;\n width: 100%;\n"]))),DroplrFilesTabContent_Menu=styled_components_browser_esm.Ay.div(DroplrFilesTabContent_templateObject_11||(DroplrFilesTabContent_templateObject_11=DroplrFilesTabContent_makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n margin-top: 8px;\n column-gap: 12px;\n"],["\n display: flex;\n justify-content: space-between;\n margin-top: 8px;\n column-gap: 12px;\n"]))),DroplrFilesTabContent_DropdownContainer=styled_components_browser_esm.Ay.div(DroplrFilesTabContent_templateObject_12||(DroplrFilesTabContent_templateObject_12=DroplrFilesTabContent_makeTemplateObject(["\n width: 258px;\n height: 40px;\n"],["\n width: 258px;\n height: 40px;\n"]))),DroplrFilesTabContent_FilesSelector=styled_components_browser_esm.Ay.div(DroplrFilesTabContent_templateObject_13||(DroplrFilesTabContent_templateObject_13=DroplrFilesTabContent_makeTemplateObject(["\n margin-top: 24px;\n height: 300px;\n overflow-y: auto;\n"],["\n margin-top: 24px;\n height: 300px;\n overflow-y: auto;\n"]))),DroplrFilesTabContent_EmptyFiles=styled_components_browser_esm.Ay.div(DroplrFilesTabContent_templateObject_14||(DroplrFilesTabContent_templateObject_14=DroplrFilesTabContent_makeTemplateObject(["\n display: flex;\n justify-content: center;\n align-items: center;\n height: 100px;\n font-style: normal;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n color: #272a32;\n"],["\n display: flex;\n justify-content: center;\n align-items: center;\n height: 100px;\n font-style: normal;\n font-weight: 600;\n font-size: 15px;\n line-height: 24px;\n color: #272a32;\n"]))),DroplrFilesTabContent_Grid=styled_components_browser_esm.Ay.div(DroplrFilesTabContent_templateObject_15||(DroplrFilesTabContent_templateObject_15=DroplrFilesTabContent_makeTemplateObject(["\n display: flex;\n flex-direction: column;\n row-gap: 8px;\n"],["\n display: flex;\n flex-direction: column;\n row-gap: 8px;\n"]))),ListFileItem=styled_components_browser_esm.Ay.div(DroplrFilesTabContent_templateObject_16||(DroplrFilesTabContent_templateObject_16=DroplrFilesTabContent_makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n .file-title {\n position: relative;\n display: flex;\n justify-content: start;\n align-items: center;\n cursor: pointer;\n font-weight: bold;\n }\n .FileItem {\n position: relative;\n display: flex;\n justify-content: start;\n align-items: center;\n column-gap: 15px;\n .FilePreview {\n width: 96px;\n height: 64px;\n }\n .FileLaunch {\n opacity: 0;\n position: absolute;\n display: flex;\n justify-content: center;\n align-items: center;\n top: 0px;\n left: 0px;\n background-color: #0000002e;\n width: 96px;\n height: 64px;\n &:hover {\n opacity: 1;\n cursor: pointer;\n }\n }\n }\n &:hover {\n border: 2px solid ",";\n border-radius: 4px;\n }\n"],["\n display: flex;\n justify-content: space-between;\n align-items: center;\n .file-title {\n position: relative;\n display: flex;\n justify-content: start;\n align-items: center;\n cursor: pointer;\n font-weight: bold;\n }\n .FileItem {\n position: relative;\n display: flex;\n justify-content: start;\n align-items: center;\n column-gap: 15px;\n .FilePreview {\n width: 96px;\n height: 64px;\n }\n .FileLaunch {\n opacity: 0;\n position: absolute;\n display: flex;\n justify-content: center;\n align-items: center;\n top: 0px;\n left: 0px;\n background-color: #0000002e;\n width: 96px;\n height: 64px;\n &:hover {\n opacity: 1;\n cursor: pointer;\n }\n }\n }\n &:hover {\n border: 2px solid ",";\n border-radius: 4px;\n }\n"])),(function(_a){return _a.theme.colors.primary[10]})),ButtonWrapper=styled_components_browser_esm.Ay.div(DroplrFilesTabContent_templateObject_17||(DroplrFilesTabContent_templateObject_17=DroplrFilesTabContent_makeTemplateObject(["\n button {\n margin: 0px 5px 0px 2px;\n }\n"],["\n button {\n margin: 0px 5px 0px 2px;\n }\n"]))),DroplrFilesTabContent_ItemTypes=[{value:"file",text:"Files"},{value:"board",text:"Boards"}],DroplrFilesTabContent=function(props){var handleModalClose=props.handleModalClose,onSelect=props.onSelect,selectedFile=props.selectedFile,_a=DroplrFilesTabContent_read(react.useState({name:"",sizeText:"",size:0,currentUpload:0,status:"",progress:0}),2),file=_a[0],setFile=_a[1],_b=DroplrFilesTabContent_read(react.useState(0),2),page=_b[0],setPage=_b[1],_c=DroplrFilesTabContent_read(react.useState({count:"0",hasMore:"false"}),2),res=_c[0],setRes=_c[1],_d=DroplrFilesTabContent_read(react.useState([]),2),drops=_d[0],setDrops=_d[1],_e=DroplrFilesTabContent_read(react.useState(""),2),searchQuery=_e[0],setSearchQuery=_e[1],_f=DroplrFilesTabContent_read(react.useState(!0),2),loading=_f[0],setLoading=_f[1],_g=DroplrFilesTabContent_read(react.useState(fields[0]),2),field=_g[0],setField=_g[1],itemType=(null==selectedFile?void 0:selectedFile.itemType)||DroplrFilesTabContent_ItemTypes[0].value,onDrop=(0,react.useCallback)((function(acceptedFiles){return DroplrFilesTabContent_awaiter(void 0,void 0,void 0,(function(){var f,reader;return DroplrFilesTabContent_generator(this,(function(_a){return f={name:acceptedFiles[0].name,status:statuses_WAITING,sizeText:formatBytes(acceptedFiles[0].size,2),size:acceptedFiles[0].size,progress:0,currentUpload:0},setFile(f),(reader=new FileReader).onabort=function(){return console.log("file reading was aborted")},reader.onerror=function(){return console.log("file reading has failed")},reader.onload=function(){return DroplrFilesTabContent_awaiter(void 0,void 0,void 0,(function(){return DroplrFilesTabContent_generator(this,(function(_a){return f=DroplrFilesTabContent_assign(DroplrFilesTabContent_assign({},f),{status:statuses_UPLOADING}),setFile(f),f=DroplrFilesTabContent_assign(DroplrFilesTabContent_assign({},f),{status:statuses_FINISHED,progress:100}),setFile(f),setTimeout((function(){setFile({name:"",sizeText:"",size:0,currentUpload:0,status:"",progress:0}),refreshDropsAndBoards()}),1500),[2]}))}))},reader.readAsArrayBuffer(acceptedFiles[0]),[2]}))}))}),[]),_h=(0,dist_es.V)({onDrop,multiple:!1}),getRootProps=_h.getRootProps,getInputProps=_h.getInputProps,isDragActive=_h.isDragActive,refreshDropsAndBoards=function(){return DroplrFilesTabContent_awaiter(void 0,void 0,void 0,(function(){var response;return DroplrFilesTabContent_generator(this,(function(_a){switch(_a.label){case 0:return"file"!==itemType?[2]:(setLoading(!0),[4,getDrops({sort:field.key||"",order:field.order||"",search:searchQuery,type:"FILE",variant:"text/plain",dropType:DROPTYPE_OPTIONS.OWNED})]);case 1:return response=_a.sent(),setRes(response),setLoading(!1),setDrops(response.drops),[2]}}))}))};react.useEffect((function(){"file"===itemType&&refreshDropsAndBoards()}),[field,searchQuery,itemType]);var uploadingFiles=!!file.name;return(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[!uploadingFiles&&(0,jsx_runtime.jsxs)(DroplrFilesTabContent_DropContent,DroplrFilesTabContent_assign({isDragActive},getRootProps(),{children:[(0,jsx_runtime.jsx)("input",DroplrFilesTabContent_assign({},getInputProps())),!isDragActive&&(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)("p",{children:"Drag and drop files here to upload new file"}),(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{text:"Browse files...",variant:"white"})]}),isDragActive&&(0,jsx_runtime.jsx)("p",{children:"Drop files here"})]})),uploadingFiles&&(0,jsx_runtime.jsxs)(DroplrFilesTabContent_UploadFileContent,{children:[(0,jsx_runtime.jsxs)(DroplrFilesTabContent_UploadFileDescription,{children:[(0,jsx_runtime.jsx)(DroplrFilesTabContent_UploadFileTitle,{children:file.name}),(0,jsx_runtime.jsx)(DroplrFilesTabContent_UploadFileProgress,{value:file.progress,max:100}),(0,jsx_runtime.jsxs)(DroplrFilesTabContent_UploadFileDetails,{children:[(0,jsx_runtime.jsx)(DroplrFilesTabContent_FileStatus,DroplrFilesTabContent_assign({color:getStatusColor(file.status)},{children:getStatusText(file.status)})),(0,jsx_runtime.jsx)(DroplrFilesTabContent_FileSize,{children:getStatusSize(file)})]})]}),(0,jsx_runtime.jsx)(DroplrFilesTabContent_UploadFileAction,{})]}),loading&&(0,jsx_runtime.jsx)(LoadingIndicator,{isLoading:loading,height:"200px"}),!loading&&(0,jsx_runtime.jsxs)(DroplrFilesTabContent_LibraryContainer,{children:[(0,jsx_runtime.jsxs)(DroplrFilesTabContent_Menu,{children:[(0,jsx_runtime.jsx)("div",DroplrFilesTabContent_assign({style:{width:"280px"}},{children:(0,jsx_runtime.jsx)(lib_components_Search_Search,{placeholder:"Search files...",onSearch:function(query){setSearchQuery(query.toLowerCase())},prevSearch:searchQuery})})),(0,jsx_runtime.jsx)("div",DroplrFilesTabContent_assign({style:{display:"flex"}},{children:(0,jsx_runtime.jsx)(DroplrFilesTabContent_DropdownContainer,{children:(0,jsx_runtime.jsx)(Dropdown,{value:field,onChange:function(newValue){setField(newValue)},options:fields,dropdownHeight:450,height:40,creatable:!1})})}))]}),(0,jsx_runtime.jsx)(DroplrFilesTabContent_FilesSelector,{children:(0,jsx_runtime.jsxs)(index_es.A,DroplrFilesTabContent_assign({dataLength:page*parseInt(res.count),next:function(){return DroplrFilesTabContent_awaiter(void 0,void 0,void 0,(function(){var response;return DroplrFilesTabContent_generator(this,(function(_a){switch(_a.label){case 0:return[4,getDrops({sort:field.key||"",order:field.order||"",search:searchQuery,page:page+1,type:"FILE",variant:"text/plain",dropType:DROPTYPE_OPTIONS.OWNED})];case 1:return response=_a.sent(),setPage(page+1),setRes(response),setDrops(DroplrFilesTabContent_spreadArray(DroplrFilesTabContent_spreadArray([],DroplrFilesTabContent_read(drops),!1),DroplrFilesTabContent_read(response.drops),!1)),[2]}}))}))},hasMore:"true"===res.hasMore,loader:(0,jsx_runtime.jsx)("h4",{children:"Loading..."}),height:300,endMessage:(0,jsx_runtime.jsx)("p",DroplrFilesTabContent_assign({style:{textAlign:"center"}},{children:(0,jsx_runtime.jsx)("b",{children:"No more files"})}))},{children:[(0,jsx_runtime.jsx)(DroplrFilesTabContent_Grid,{children:drops.map((function(drop){return(0,jsx_runtime.jsxs)(ListFileItem,{children:[(0,jsx_runtime.jsxs)("div",DroplrFilesTabContent_assign({className:"FileItem"},{children:[drop.previewMedium?(0,jsx_runtime.jsx)("img",{className:"FilePreview",alt:"preview",src:drop.previewMedium}):(0,jsx_runtime.jsx)(md_index_esm.n$u,{size:32}),(0,jsx_runtime.jsx)("div",DroplrFilesTabContent_assign({className:"FileLaunch"},{children:(0,jsx_runtime.jsx)(md_index_esm.Hn8,{size:18,color:"white",onClick:function(){window.open(drop.shortlink,"_blank")}})})),(0,jsx_runtime.jsx)("div",DroplrFilesTabContent_assign({className:"file-title",onClick:function(){onSelect(drop.content,drop.code),handleModalClose()}},{children:drop.title}))]})),(0,jsx_runtime.jsx)(ButtonWrapper,{children:(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{text:"Select File",variant:"secondary",onClick:function(){onSelect(drop.content,drop.code),handleModalClose()}})})]},"file-item-".concat(drop.code))}))}),!drops.length&&(0,jsx_runtime.jsx)(DroplrFilesTabContent_EmptyFiles,{children:"No files found."})]}))})]})]})};function covideoSmallLogoActive_extends(){return covideoSmallLogoActive_extends=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},covideoSmallLogoActive_extends.apply(null,arguments)}const covideoSmallLogoActive=function SvgCovideoSmallLogoActive(props){return react.createElement("svg",covideoSmallLogoActive_extends({width:15,height:14,viewBox:"0 0 15 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props),covideoSmallLogoActive_path||(covideoSmallLogoActive_path=react.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.31556 1.25854L0 4.66606V9.33212L3.31662 12.7638L6.49739 9.94768V3.954L3.31556 1.25854Z",fill:"#09534A"})),covideoSmallLogoActive_path2||(covideoSmallLogoActive_path2=react.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.0001 6.74778V4.66606L10.4863 0H4.54083L3.50781 1.06115L10.2023 6.74778H15.0001Z",fill:"#09534A"})),covideoSmallLogoActive_path3||(covideoSmallLogoActive_path3=react.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.2012 7.02661L3.50781 12.9614L4.51217 13.9999H10.4863L15.0001 9.33204V7.02661H10.2012Z",fill:"#09534A"})))};var CovideoSmallLogoActive_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked};const images_CovideoSmallLogoActive=(0,styled_components_browser_esm.Ay)(covideoSmallLogoActive)(CovideoSmallLogoActive_templateObject_1||(CovideoSmallLogoActive_templateObject_1=CovideoSmallLogoActive_makeTemplateObject(["\n width: ",";\n height: ",";\n fill: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n fill: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"])),(function(props){return props.width||"21px"}),(function(props){return props.height||"21px"}),(function(props){return props.color||"currentColor"}),(function(props){return props.color||"currentColor"}),(function(props){return props.opacity||"inherit"}));var CovideoSmallLogoActive_templateObject_1,cdkSmallLogoActive_g,cdkSmallLogoActive_defs;function cdkSmallLogoActive_extends(){return cdkSmallLogoActive_extends=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},cdkSmallLogoActive_extends.apply(null,arguments)}const cdkSmallLogoActive=function SvgCdkSmallLogoActive(props){return react.createElement("svg",cdkSmallLogoActive_extends({width:144,height:145,viewBox:"0 0 144 145",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props),cdkSmallLogoActive_g||(cdkSmallLogoActive_g=react.createElement("g",{clipPath:"url(#clip0_16_1167)"},react.createElement("path",{d:"M70.94 64.3999H65.67V79.9099H70.94C73.83 79.9099 75.3 79.2599 76.56 78.0499C78.03 76.6199 78.85 74.8499 78.85 72.2199C78.85 69.7599 78.12 67.9399 76.78 66.5199C75.53 65.1799 74.06 64.3999 70.95 64.3999H70.94Z",fill:"#231F20"}),react.createElement("path",{d:"M72 0.23999C32.34 0.23999 0.0799866 32.5 0.0799866 72.16C0.0799866 111.82 32.34 144.08 72 144.08C111.66 144.08 143.92 111.82 143.92 72.16C143.92 32.5 111.66 0.23999 72 0.23999ZM38.5 87.12C29.04 87.12 22.77 80.38 22.77 72.13C22.77 63.88 29.08 57.18 38.28 57.18C43.46 57.18 48.73 59.17 52.36 62.02L47.82 66.94C45.18 64.78 41.77 63.53 39.22 63.53C33.99 63.53 30.62 67.46 30.62 72.17C30.62 76.88 34.08 80.81 39.43 80.81C42.71 80.81 46.13 78.87 48.63 76.53L53.21 81.37C49.8 84.39 44.7 87.12 38.48 87.12H38.5ZM82.7 82.24C80.24 84.66 76.7 86.26 71.12 86.26H58.12V58.05H71.12C76.39 58.05 80.28 59.52 82.91 62.28C85.33 64.83 86.67 68.28 86.67 72.13C86.67 75.98 85.29 79.69 82.7 82.24ZM113.45 86.26L103.82 74.12L100.41 77.36V86.26H92.81V58.05H100.41V68.63L111.51 58.05H121.1L109.13 69.24L122.82 86.26H113.45Z",fill:"#231F20"}))),cdkSmallLogoActive_defs||(cdkSmallLogoActive_defs=react.createElement("defs",null,react.createElement("clipPath",{id:"clip0_16_1167"},react.createElement("rect",{width:144,height:145,fill:"white"})))))};var CdkSmallLogoActive_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked};const images_CdkSmallLogoActive=(0,styled_components_browser_esm.Ay)(cdkSmallLogoActive)(CdkSmallLogoActive_templateObject_1||(CdkSmallLogoActive_templateObject_1=CdkSmallLogoActive_makeTemplateObject(["\n width: ",";\n height: ",";\n fill: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"],["\n width: ",";\n height: ",";\n fill: ",";\n path {\n fill: ",";\n opacity: ",";\n }\n"])),(function(props){return props.width||"21px"}),(function(props){return props.height||"21px"}),(function(props){return props.color||"currentColor"}),(function(props){return props.color||"currentColor"}),(function(props){return props.opacity||"inherit"}));var CdkSmallLogoActive_templateObject_1,Views,ModalTeleprompterRecord_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},ModalTeleprompterRecord_assign=function(){return ModalTeleprompterRecord_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},ModalTeleprompterRecord_assign.apply(this,arguments)},ModalTeleprompterRecord_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},ModalTeleprompterRecord_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},ModalTeleprompterRecord_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},ModalTeleprompterRecord_spreadArray=function(to,from,pack){if(pack||2===arguments.length)for(var ar,i=0,l=from.length;i<l;i++)!ar&&i in from||(ar||(ar=Array.prototype.slice.call(from,0,i)),ar[i]=from[i]);return to.concat(ar||Array.prototype.slice.call(from))},ModalTeleprompterRecord_ModalItem=styled_components_browser_esm.Ay.div(ModalTeleprompterRecord_templateObject_1||(ModalTeleprompterRecord_templateObject_1=ModalTeleprompterRecord_makeTemplateObject(["\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n position: relative;\n width: auto;\n background-color: #fff;\n padding: 32px;\n width: 100%;\n"],["\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n position: relative;\n width: auto;\n background-color: #fff;\n padding: 32px;\n width: 100%;\n"]))),ContentHeaderWrap=styled_components_browser_esm.Ay.div(ModalTeleprompterRecord_templateObject_2||(ModalTeleprompterRecord_templateObject_2=ModalTeleprompterRecord_makeTemplateObject(["\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 28px;\n &.list {\n width: 100%;\n justify-content: center;\n margin-bottom: 20px;\n }\n"],["\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 28px;\n &.list {\n width: 100%;\n justify-content: center;\n margin-bottom: 20px;\n }\n"]))),ModalTeleprompterRecord_ContentHeader=styled_components_browser_esm.Ay.div(ModalTeleprompterRecord_templateObject_3||(ModalTeleprompterRecord_templateObject_3=ModalTeleprompterRecord_makeTemplateObject(["\n ","\n font-size: ",";\n color: ",";\n"],["\n ","\n font-size: ",";\n color: ",";\n"])),fontBold700,fontSizes_lg,palette_themeDark),TabHeader=styled_components_browser_esm.Ay.div(ModalTeleprompterRecord_templateObject_4||(ModalTeleprompterRecord_templateObject_4=ModalTeleprompterRecord_makeTemplateObject(["\n display: flex;\n width: 100%;\n padding: 4px;\n align-items: center;\n background: linear-gradient(\n 0deg,\n rgba(0, 27, 83, 0.05),\n rgba(0, 27, 83, 0.05)\n ),\n #ffffff;\n border-radius: 24px;\n .scriptTab,\n .appearanceTab {\n display: flex;\n justify-content: center;\n align-items: center;\n width: 50%;\n color: ",";\n opacity: 0.5;\n font-weight: 600;\n font-size: 14px;\n cursor: pointer;\n &.active {\n background: #ffffff;\n height: 32px;\n border-radius: 16px;\n box-shadow: 0px 2px 4px rgba(29, 30, 36, 0.04);\n opacity: 1;\n }\n }\n"],["\n display: flex;\n width: 100%;\n padding: 4px;\n align-items: center;\n background: linear-gradient(\n 0deg,\n rgba(0, 27, 83, 0.05),\n rgba(0, 27, 83, 0.05)\n ),\n #ffffff;\n border-radius: 24px;\n .scriptTab,\n .appearanceTab {\n display: flex;\n justify-content: center;\n align-items: center;\n width: 50%;\n color: ",";\n opacity: 0.5;\n font-weight: 600;\n font-size: 14px;\n cursor: pointer;\n &.active {\n background: #ffffff;\n height: 32px;\n border-radius: 16px;\n box-shadow: 0px 2px 4px rgba(29, 30, 36, 0.04);\n opacity: 1;\n }\n }\n"])),palette_primaryDarkBlue),StyledIoIosCheckmarkCircle=(0,styled_components_browser_esm.Ay)(io_index_esm.v_8)(ModalTeleprompterRecord_templateObject_5||(ModalTeleprompterRecord_templateObject_5=ModalTeleprompterRecord_makeTemplateObject(["\n background: white;\n border-radius: 50%;\n"],["\n background: white;\n border-radius: 50%;\n"]))),SelectContent=styled_components_browser_esm.Ay.div(ModalTeleprompterRecord_templateObject_6||(ModalTeleprompterRecord_templateObject_6=ModalTeleprompterRecord_makeTemplateObject(["\n display: flex;\n width: 100%;\n margin: 16px 0;\n align-items: baseline;\n justify-content: space-between;\n .scriptList {\n width: 70%;\n }\n .fullWidth {\n width: 100%;\n }\n"],["\n display: flex;\n width: 100%;\n margin: 16px 0;\n align-items: baseline;\n justify-content: space-between;\n .scriptList {\n width: 70%;\n }\n .fullWidth {\n width: 100%;\n }\n"]))),ModalTeleprompterRecord_ContentBody=styled_components_browser_esm.Ay.section(ModalTeleprompterRecord_templateObject_7||(ModalTeleprompterRecord_templateObject_7=ModalTeleprompterRecord_makeTemplateObject(["\n display: flex;\n flex-direction: column;\n width: 528px;\n max-width: 100%;\n gap: 12px;\n justify-content: flex-end;\n align-items: right;\n"],["\n display: flex;\n flex-direction: column;\n width: 528px;\n max-width: 100%;\n gap: 12px;\n justify-content: flex-end;\n align-items: right;\n"]))),ModalTeleprompterRecord_CloseButtonWrap=styled_components_browser_esm.Ay.div(ModalTeleprompterRecord_templateObject_8||(ModalTeleprompterRecord_templateObject_8=ModalTeleprompterRecord_makeTemplateObject(["\n margin-left: 10px;\n color: ",";\n height: 24px;\n width: 24px;\n position: ",";\n &.list--bth--wrap {\n left: 0;\n display: flex;\n align-items: center;\n width: 150px;\n }\n &:hover {\n opacity: 0.7;\n cursor: pointer;\n }\n"],["\n margin-left: 10px;\n color: ",";\n height: 24px;\n width: 24px;\n position: ",";\n &.list--bth--wrap {\n left: 0;\n display: flex;\n align-items: center;\n width: 150px;\n }\n &:hover {\n opacity: 0.7;\n cursor: pointer;\n }\n"])),palette_black_1_100,(function(props){return props.position?props.position:"relative"})),ModalTeleprompterRecord_ButtonContainer=styled_components_browser_esm.Ay.div(ModalTeleprompterRecord_templateObject_9||(ModalTeleprompterRecord_templateObject_9=ModalTeleprompterRecord_makeTemplateObject(["\n display: flex;\n width: 100%;\n gap: 15px;\n justify-content: space-between;\n margin-top: 15px;\n .newScriptDiv {\n display: flex;\n justify-content: space-between;\n width: 100%;\n }\n .saveNewScript {\n display: flex;\n column-gap: 8px;\n width: 100%;\n .closeCreateScriptView {\n background: #eeeff2;\n display: flex;\n align-items: center;\n padding: 5px;\n cursor: pointer;\n border-radius: 5px;\n }\n }\n"],["\n display: flex;\n width: 100%;\n gap: 15px;\n justify-content: space-between;\n margin-top: 15px;\n .newScriptDiv {\n display: flex;\n justify-content: space-between;\n width: 100%;\n }\n .saveNewScript {\n display: flex;\n column-gap: 8px;\n width: 100%;\n .closeCreateScriptView {\n background: #eeeff2;\n display: flex;\n align-items: center;\n padding: 5px;\n cursor: pointer;\n border-radius: 5px;\n }\n }\n"]))),ModalTeleprompterRecord_Label=styled_components_browser_esm.Ay.label(ModalTeleprompterRecord_templateObject_10||(ModalTeleprompterRecord_templateObject_10=ModalTeleprompterRecord_makeTemplateObject(["\n font-weight: 500;\n"],["\n font-weight: 500;\n"]))),ModalTeleprompterRecord_Textarea=styled_components_browser_esm.Ay.textarea(ModalTeleprompterRecord_templateObject_11||(ModalTeleprompterRecord_templateObject_11=ModalTeleprompterRecord_makeTemplateObject(["\n display: block;\n width: 100%;\n height: 200px;\n background: #ffffff;\n border: 1px solid #d0d3d9;\n box-sizing: border-box;\n border-radius: 4px;\n padding: 16px;\n"],["\n display: block;\n width: 100%;\n height: 200px;\n background: #ffffff;\n border: 1px solid #d0d3d9;\n box-sizing: border-box;\n border-radius: 4px;\n padding: 16px;\n"]))),ModalTeleprompterRecord_Row=styled_components_browser_esm.Ay.div(ModalTeleprompterRecord_templateObject_12||(ModalTeleprompterRecord_templateObject_12=ModalTeleprompterRecord_makeTemplateObject(["\n float: left;\n width: 100%;\n display: flex;\n flex-direction: row;\n &:nth-child(1) {\n margin-top: 24px;\n }\n &:nth-child(2) {\n margin-top: 42px;\n margin-bottom: 36px;\n }\n"],["\n float: left;\n width: 100%;\n display: flex;\n flex-direction: row;\n &:nth-child(1) {\n margin-top: 24px;\n }\n &:nth-child(2) {\n margin-top: 42px;\n margin-bottom: 36px;\n }\n"]))),ModalTeleprompterRecord_Col=styled_components_browser_esm.Ay.div(ModalTeleprompterRecord_templateObject_13||(ModalTeleprompterRecord_templateObject_13=ModalTeleprompterRecord_makeTemplateObject(["\n flex: 100%;\n min-height: 60px;\n display: flex;\n flex-direction: column;\n row-gap: 8px;\n .scriptSizeContainer {\n display: flex;\n justify-content: space-between;\n align-items: center;\n div {\n position: relative;\n display: flex;\n justify-content: center;\n align-items: center;\n text-align: center;\n height: 65px;\n width: 32%;\n border-radius: 4px;\n border: solid 1px #d0d3d9;\n font-stretch: normal;\n font-style: normal;\n line-height: 1.5;\n letter-spacing: normal;\n color: black;\n cursor: pointer;\n font-weight: 700;\n &.smallSize {\n font-size: 14px;\n }\n &.mediumSize {\n font-size: 18px;\n }\n &.largeSize {\n font-size: 24px;\n }\n &.active {\n border: solid 1px ",";\n outline: 0;\n }\n svg {\n position: absolute;\n top: -10px;\n right: -10px;\n }\n }\n }\n"],["\n flex: 100%;\n min-height: 60px;\n display: flex;\n flex-direction: column;\n row-gap: 8px;\n .scriptSizeContainer {\n display: flex;\n justify-content: space-between;\n align-items: center;\n div {\n position: relative;\n display: flex;\n justify-content: center;\n align-items: center;\n text-align: center;\n height: 65px;\n width: 32%;\n border-radius: 4px;\n border: solid 1px #d0d3d9;\n font-stretch: normal;\n font-style: normal;\n line-height: 1.5;\n letter-spacing: normal;\n color: black;\n cursor: pointer;\n font-weight: 700;\n &.smallSize {\n font-size: 14px;\n }\n &.mediumSize {\n font-size: 18px;\n }\n &.largeSize {\n font-size: 24px;\n }\n &.active {\n border: solid 1px ",";\n outline: 0;\n }\n svg {\n position: absolute;\n top: -10px;\n right: -10px;\n }\n }\n }\n"])),(function(props){return props.theme.colors.primary[100]})),FieldWrapper=styled_components_browser_esm.Ay.div(ModalTeleprompterRecord_templateObject_14||(ModalTeleprompterRecord_templateObject_14=ModalTeleprompterRecord_makeTemplateObject(["\n width: ",";\n > div {\n margin-left: 0;\n width: 90%;\n }\n"],["\n width: ",";\n > div {\n margin-left: 0;\n width: 90%;\n }\n"])),(function(props){return props.width?props.width:"auto"})),ModalTeleprompterRecord_Form=styled_components_browser_esm.Ay.form(ModalTeleprompterRecord_templateObject_15||(ModalTeleprompterRecord_templateObject_15=ModalTeleprompterRecord_makeTemplateObject(["\n float: left;\n width: 100%;\n color: #9297a2;\n"],["\n float: left;\n width: 100%;\n color: #9297a2;\n"]))),ModalTeleprompterRecord_Container=styled_components_browser_esm.Ay.div(ModalTeleprompterRecord_templateObject_16||(ModalTeleprompterRecord_templateObject_16=ModalTeleprompterRecord_makeTemplateObject(["\n width: 592px;\n height: 648px;\n background: #ffffff;\n border: 1px solid #f7f8fa;\n box-shadow: 0px 4px 12px rgba(29, 30, 36, 0.04);\n border-radius: 4px;\n padding: 25px;\n box-sizing: border-box;\n"],["\n width: 592px;\n height: 648px;\n background: #ffffff;\n border: 1px solid #f7f8fa;\n box-shadow: 0px 4px 12px rgba(29, 30, 36, 0.04);\n border-radius: 4px;\n padding: 25px;\n box-sizing: border-box;\n"]))),ModalTeleprompterRecord_Header=styled_components_browser_esm.Ay.div(ModalTeleprompterRecord_templateObject_17||(ModalTeleprompterRecord_templateObject_17=ModalTeleprompterRecord_makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n"],["\n display: flex;\n align-items: center;\n justify-content: space-between;\n"]))),ModalTeleprompterRecord_Title=styled_components_browser_esm.Ay.div(ModalTeleprompterRecord_templateObject_18||(ModalTeleprompterRecord_templateObject_18=ModalTeleprompterRecord_makeTemplateObject(["\n width: 275px;\n height: 24px;\n font-style: normal;\n font-weight: bold;\n font-size: 18px;\n line-height: 24px;\n color: #272a32;\n"],["\n width: 275px;\n height: 24px;\n font-style: normal;\n font-weight: bold;\n font-size: 18px;\n line-height: 24px;\n color: #272a32;\n"]))),CloseButtonWrap2=styled_components_browser_esm.Ay.div(ModalTeleprompterRecord_templateObject_19||(ModalTeleprompterRecord_templateObject_19=ModalTeleprompterRecord_makeTemplateObject(["\n margin-left: 20px;\n color: ",";\n height: 24px;\n width: 24px;\n &:hover {\n opacity: 0.7;\n cursor: pointer;\n }\n"],["\n margin-left: 20px;\n color: ",";\n height: 24px;\n width: 24px;\n &:hover {\n opacity: 0.7;\n cursor: pointer;\n }\n"])),palette_white),CovideoScriptTitle=styled_components_browser_esm.Ay.div(ModalTeleprompterRecord_templateObject_20||(ModalTeleprompterRecord_templateObject_20=ModalTeleprompterRecord_makeTemplateObject(["\n display: flex;\n gap: 8px;\n flex-direction: row;\n align-items: center;\n"],["\n display: flex;\n gap: 8px;\n flex-direction: row;\n align-items: center;\n"])));!function(Views){Views[Views.LIST=1]="LIST",Views[Views.FILES=2]="FILES",Views[Views.CANCEL=3]="CANCEL"}(Views||(Views={}));var ModalTeleprompterRecord_templateObject_1,ModalTeleprompterRecord_templateObject_2,ModalTeleprompterRecord_templateObject_3,ModalTeleprompterRecord_templateObject_4,ModalTeleprompterRecord_templateObject_5,ModalTeleprompterRecord_templateObject_6,ModalTeleprompterRecord_templateObject_7,ModalTeleprompterRecord_templateObject_8,ModalTeleprompterRecord_templateObject_9,ModalTeleprompterRecord_templateObject_10,ModalTeleprompterRecord_templateObject_11,ModalTeleprompterRecord_templateObject_12,ModalTeleprompterRecord_templateObject_13,ModalTeleprompterRecord_templateObject_14,ModalTeleprompterRecord_templateObject_15,ModalTeleprompterRecord_templateObject_16,ModalTeleprompterRecord_templateObject_17,ModalTeleprompterRecord_templateObject_18,ModalTeleprompterRecord_templateObject_19,ModalTeleprompterRecord_templateObject_20,ChooseRecordingOptions_templateObject_1,ChooseRecordingOptions_templateObject_2,ChooseRecordingOptions_templateObject_3,ChooseRecordingOptions_templateObject_4,ChooseRecordingOptions_templateObject_5,ChooseRecordingOptions_templateObject_6,ChooseRecordingOptions_templateObject_7,ChooseRecordingOptions_templateObject_8,RecordHome_templateObject_1,scriptPositions=[{value:"top",text:"Top"},{value:"bottom",text:"Bottom"}],ModalTeleprompterRecord=function(_a){var _b,_c,handleModalClose=_a.handleModalClose,handleSubmit=_a.handleSubmit,settings=_a.settings,isCdkEnviroment=(0,styled_components_browser_esm.DP)().isCdkEnviroment,env=useConfigurationContext().env,userData=useAuthorizationContext().userData,toast=useToastNotifications().toast,isAutomotiveServiceRole=checkIfAutomotiveServiceRole(userData),isAutomotiveSalesRole=checkIfAutomotiveSalesRole(userData),isAutomotive=checkIfAutomotive(userData),isIMSEnabled=checkIsIMSEnabled(userData),defaultOptions=[{title:"Create a new script",scriptId:-1}],_d=ModalTeleprompterRecord_read((0,react.useState)(Views.LIST),2),currentView=_d[0],setCurrentView=_d[1],_e=ModalTeleprompterRecord_read((0,react.useState)(0),2),currentTab=_e[0],setCurrentTab=_e[1],_f=ModalTeleprompterRecord_read((0,react.useState)(!1),2),scriptTextTouched=_f[0],setScriptTextTouched=_f[1],_g=ModalTeleprompterRecord_read((0,react.useState)({speed:(null==settings?void 0:settings.speed)||sizeToSpeedRatioMedium[2],scriptSize:(null==settings?void 0:settings.scriptSize)||"large",scriptPosition:(null==settings?void 0:settings.scriptPosition)||scriptPositions[0].value,content:decodeAndReplaceText((null==settings?void 0:settings.content)||""),activeScriptId:(null==settings?void 0:settings.activeScriptId)||-1}),2),appearanceConfig=_g[0],setAppearanceConfig=_g[1],_h=ModalTeleprompterRecord_read((0,react.useState)(decodeAndReplaceText(appearanceConfig.content||"")),2),scriptText=_h[0],setScriptText=_h[1],defaultScriptTitle="New Script ".concat(dayjs_min_default()(new Date).format("YYYY-MM-DD")),_j=ModalTeleprompterRecord_read((0,react.useState)(!1),2),isNewScript=_j[0],setIsNewScript=_j[1],_k=ModalTeleprompterRecord_read((0,react.useState)(defaultScriptTitle),2),scriptTitleText=_k[0],setScriptTitleText=_k[1],_l=ModalTeleprompterRecord_read((0,react.useState)({url:"",id:""}),2),selectedScriptFile=_l[0],setSelectedScriptFile=_l[1],_m=ModalTeleprompterRecord_read((0,react.useState)(!1),2),scriptLoading=_m[0],setScriptLoading=_m[1],_o=ModalTeleprompterRecord_read((0,react.useState)(defaultOptions),2),scriptArray=_o[0],setScriptArray=_o[1],themes=(0,styled_components_browser_esm.DP)(),sortScripts=function(unsortedScripts){return unsortedScripts.sort((function(a,b){return a.title.localeCompare(b.title)}))},handleScriptSize=function(ele){setAppearanceConfig(ModalTeleprompterRecord_assign(ModalTeleprompterRecord_assign({},appearanceConfig),{scriptSize:ele}))},updateOldScript=function(){return ModalTeleprompterRecord_awaiter(void 0,void 0,void 0,(function(){var content,res,scriptArrayLocal,indexOfListedEle;return ModalTeleprompterRecord_generator(this,(function(_a){switch(_a.label){case 0:return content=encodeURIComponent(scriptText||""),[4,updateScript({scriptId:appearanceConfig.activeScriptId,data:{content}})];case 1:return(res=_a.sent())&&(scriptArrayLocal=JSON.parse(JSON.stringify(scriptArray)),-1!=(indexOfListedEle=scriptArrayLocal.findIndex((function(element){return element.scriptId==appearanceConfig.activeScriptId})))&&(scriptArrayLocal[indexOfListedEle].content=decodeAndReplaceText(res.content)),setScriptArray(scriptArrayLocal),setIsNewScript(!1),setAppearanceConfig(ModalTeleprompterRecord_assign(ModalTeleprompterRecord_assign({},appearanceConfig),{content})),setScriptTextTouched(!1),toast({message:"Script updated sucessfully."})),[2]}}))}))},defaultPromptUseCase=function(isAutomotive){return isAutomotive?PROMPT_USE_CASE.INITIAL_REACH_OUT:PROMPT_USE_CASE.NONE}(isAutomotive);(0,react.useEffect)((function(){ModalTeleprompterRecord_awaiter(void 0,void 0,void 0,(function(){var scriptsArrayObj,scriptOptions_1,exp_1;return ModalTeleprompterRecord_generator(this,(function(_a){switch(_a.label){case 0:return _a.trys.push([0,2,,3]),setScriptLoading(!0),[4,(params={},teleprompterApi_awaiter(void 0,void 0,Promise,(function(){return teleprompterApi_generator(this,(function(_a){switch(_a.label){case 0:return[4,config_EXPRESS_API.get("/teleprompter",{params:teleprompterApi_assign(teleprompterApi_assign({},params),{field:"createdAt",order:"desc"})})];case 1:return[2,_a.sent().data]}}))})))];case 1:return scriptsArrayObj=_a.sent(),sortScripts(scriptsArrayObj.scripts),scriptsArrayObj.count||setScriptLoading(!1),scriptOptions_1=JSON.parse(JSON.stringify(scriptArray)),scriptsArrayObj.scripts.forEach((function(e){scriptOptions_1=ModalTeleprompterRecord_spreadArray(ModalTeleprompterRecord_spreadArray([],ModalTeleprompterRecord_read(scriptOptions_1),!1),[e],!1)})),scriptOptions_1=(0,lodash.uniqBy)(scriptOptions_1,"scriptId"),setScriptArray(scriptOptions_1),setScriptLoading(!1),[3,3];case 2:return exp_1=_a.sent(),console.log("exp at get scripts",exp_1),[3,3];case 3:return[2]}var params}))}))}),[]);var sortedScriptArray=ModalTeleprompterRecord_spreadArray(ModalTeleprompterRecord_spreadArray([],ModalTeleprompterRecord_read(scriptArray.filter((function(script){return!script.sharedWithAll}))),!1),ModalTeleprompterRecord_read(scriptArray.filter((function(script){return script.sharedWithAll}))),!1),List=(0,jsx_runtime.jsxs)(ModalTeleprompterRecord_ModalItem,{children:[(0,jsx_runtime.jsxs)(ContentHeaderWrap,{children:[(0,jsx_runtime.jsx)(ModalTeleprompterRecord_ContentHeader,{children:"Teleprompter"}),(0,jsx_runtime.jsx)(ModalTeleprompterRecord_CloseButtonWrap,ModalTeleprompterRecord_assign({title:"Close"},{children:(0,jsx_runtime.jsx)(io_index_esm.WQq,{size:24,onClick:function(){return setCurrentView(Views.CANCEL)},color:palette_label})}))]}),(0,jsx_runtime.jsxs)(ModalTeleprompterRecord_ContentBody,{children:[(0,jsx_runtime.jsxs)(TabHeader,{children:[(0,jsx_runtime.jsx)("div",ModalTeleprompterRecord_assign({className:" scriptTab ".concat(0==currentTab?"active":""),onClick:function(){return setCurrentTab(0)}},{children:"Script"})),(0,jsx_runtime.jsx)("div",ModalTeleprompterRecord_assign({className:" appearanceTab ".concat(1==currentTab?"active":""),onClick:function(){setCurrentTab(1),setIsNewScript(!1)}},{children:"Appearance"}))]}),1==currentTab?(0,jsx_runtime.jsxs)(ModalTeleprompterRecord_Form,{children:[(0,jsx_runtime.jsxs)(ModalTeleprompterRecord_Row,{children:[(0,jsx_runtime.jsxs)(ModalTeleprompterRecord_Col,{children:[(0,jsx_runtime.jsx)(ModalTeleprompterRecord_Label,ModalTeleprompterRecord_assign({htmlFor:"audioSource"},{children:"Speed"})),(0,jsx_runtime.jsx)(Dropdown,{name:"videoSource",value:appearanceConfig.speed,placeholder:"Select script...",options:handleScriptSpeedUsingScriptSize(appearanceConfig.scriptSize),onChange:function(ele){setAppearanceConfig(ModalTeleprompterRecord_assign(ModalTeleprompterRecord_assign({},appearanceConfig),{speed:ele}))},dropdownHeight:140,height:40,isSearchable:!1,creatable:!1})]})," ",(0,jsx_runtime.jsxs)(ModalTeleprompterRecord_Col,{children:[(0,jsx_runtime.jsx)(ModalTeleprompterRecord_Label,ModalTeleprompterRecord_assign({htmlFor:"audioSource"},{children:"Position"})),(0,jsx_runtime.jsx)("div",{children:(0,jsx_runtime.jsx)(FieldWrapper,ModalTeleprompterRecord_assign({width:"150px"},{children:(0,jsx_runtime.jsx)(ButtonSwitch,{defaultValue:appearanceConfig.scriptPosition,values:scriptPositions,onChange:function(ele){setAppearanceConfig(ModalTeleprompterRecord_assign(ModalTeleprompterRecord_assign({},appearanceConfig),{scriptPosition:ele}))}})}))})]})]}),(0,jsx_runtime.jsx)(ModalTeleprompterRecord_Row,{children:(0,jsx_runtime.jsxs)(ModalTeleprompterRecord_Col,{children:[(0,jsx_runtime.jsx)(ModalTeleprompterRecord_Label,{children:"Text size"}),(0,jsx_runtime.jsxs)("div",ModalTeleprompterRecord_assign({className:"scriptSizeContainer"},{children:[(0,jsx_runtime.jsxs)("div",ModalTeleprompterRecord_assign({className:" smallSize ".concat("small"==appearanceConfig.scriptSize?"active":""),onClick:function(){handleScriptSize("small")}},{children:["Small","small"==appearanceConfig.scriptSize?(0,jsx_runtime.jsx)(StyledIoIosCheckmarkCircle,{fill:themes.colors.primary[100],size:22}):null]})),(0,jsx_runtime.jsxs)("div",ModalTeleprompterRecord_assign({className:" mediumSize ".concat("large"==appearanceConfig.scriptSize?"active":""),onClick:function(){handleScriptSize("large")}},{children:["Medium","large"==appearanceConfig.scriptSize?(0,jsx_runtime.jsx)(StyledIoIosCheckmarkCircle,{fill:themes.colors.primary[100],size:22}):null]})),(0,jsx_runtime.jsxs)("div",ModalTeleprompterRecord_assign({className:" largeSize ".concat("x-large"==appearanceConfig.scriptSize?"active":""),onClick:function(){handleScriptSize("x-large")}},{children:["Large","x-large"==appearanceConfig.scriptSize?(0,jsx_runtime.jsx)(StyledIoIosCheckmarkCircle,{fill:themes.colors.primary[100],size:22}):null]}))]}))]})})]}):(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsxs)(Gap,ModalTeleprompterRecord_assign({flexWrap:"no-wrap",alignItems:"center"},{children:[(0,jsx_runtime.jsx)(SelectContent,{children:(0,jsx_runtime.jsx)("div",ModalTeleprompterRecord_assign({className:"scriptList ".concat(userData.droplrAccess?"":"fullWidth")},{children:(0,jsx_runtime.jsx)(Dropdown,{options:sortedScriptArray,menuPortalTarget:document.body,menuPosition:"fixed",menuPlacement:"bottom",placeholder:"Select a script",value:sortedScriptArray.find((function(ele){return ele.scriptId==appearanceConfig.activeScriptId})),onChange:function(ele){var _a;if(""!==ele.scriptId&&ele.scriptId>-1){var content=decodeAndReplaceText(ele.content||"");setScriptTitleText(ele.title),setScriptText(content),setAppearanceConfig(ModalTeleprompterRecord_assign(ModalTeleprompterRecord_assign({},appearanceConfig),{content,activeScriptId:ele.sharedWithAll?-1:ele.scriptId}))}else setScriptText(""),setAppearanceConfig(ModalTeleprompterRecord_assign(ModalTeleprompterRecord_assign({},appearanceConfig),{content:"",activeScriptId:ele.sharedWithAll?-1:ele.scriptId})),setScriptTitleText(null!==(_a=ele.title)&&void 0!==_a?_a:defaultScriptTitle);setScriptTextTouched(!1),setScriptLoading(!1)},getOptionLabel:function(option){return option.title},getOptionValue:function(option){return option.scriptId},isLoading:scriptLoading,onMenuClose:function(){return setScriptLoading(!1)},isSearchable:!1,creatable:!1,disabled:scriptLoading,customComponents:{SingleValue:function(props){var data=props.data;return(0,jsx_runtime.jsx)(index_75b02bac_browser_esm.F.SingleValue,ModalTeleprompterRecord_assign({},props,{children:data.sharedWithAll?(0,jsx_runtime.jsxs)(CovideoScriptTitle,{children:[isCdkEnviroment?(0,jsx_runtime.jsx)(images_CdkSmallLogoActive,{width:"20px",height:"20px","aria-label":"CDK Logo"}):(0,jsx_runtime.jsx)(images_CovideoSmallLogoActive,{width:"20px",height:"20px","aria-label":"Covideo Logo"}),data.title]}):(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:data.title})}))},Option:function(props){var data=props.data,innerRef=props.innerRef,innerProps=props.innerProps;return(0,jsx_runtime.jsx)("div",ModalTeleprompterRecord_assign({ref:innerRef},innerProps,{style:{padding:"10px 15px",fontSize:"14px",lineHeight:"20px",fontWeight:500,color:"##001B53",display:"flex",alignItems:"center",gap:"8px",cursor:"pointer",whiteSpace:"nowrap",textOverflow:"ellipsis"}},{children:data.sharedWithAll?(0,jsx_runtime.jsxs)(CovideoScriptTitle,{children:[isCdkEnviroment?(0,jsx_runtime.jsx)(images_CdkSmallLogoActive,{width:"20px",height:"20px","aria-label":"CDK Logo"}):(0,jsx_runtime.jsx)(images_CovideoSmallLogoActive,{width:"20px",height:"20px","aria-label":"Covideo Logo"}),data.title]}):data.title}))}}})}))}),(0,jsx_runtime.jsx)(react_covideo_ai_assist_esm.LN,{userInput:scriptText,defaultPromptType:PROMPT_TYPE.TELEPROPTER_SCRIPT,defaultPromptUseCase,handleSubmitGeneratedContent:function(generatedContent){setScriptText(generatedContent),setScriptTextTouched(!0)},variant:"gradient",token,userData:{customer:{business:userData.customer.business,hasCovideoMagic:"1"===(null===(_c=null===(_b=null==userData?void 0:userData.customer)||void 0===_b?void 0:_b.hasCovideoMagic)||void 0===_c?void 0:_c.toString()),markVideosAsSent:getMarkAsSentValue(userData)},firstName:userData.firstName,isAutomotiveSalesRole,isAutomotiveServiceRole,isIMSEnabled,isCompanyAdmin:userData.isCompanyAdmin,isAutomotive},aiAssistTheme:"branding",env,apiKey,size:"small"})]})),(0,jsx_runtime.jsx)(ModalTeleprompterRecord_Textarea,{value:scriptText,onChange:function(event){setScriptText(event.target.value),setScriptTextTouched(!0)},placeholder:"Type or paste your script here..."})]})]}),(0,jsx_runtime.jsx)(ModalTeleprompterRecord_ButtonContainer,{children:isNewScript?(0,jsx_runtime.jsxs)("div",ModalTeleprompterRecord_assign({className:"saveNewScript"},{children:[(0,jsx_runtime.jsx)(NewTextInput,{style:{boxSizing:"border-box",width:"75%"},onChange:function(e){return setScriptTitleText(e.target.value)},value:scriptTitleText}),(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{text:"Save",icon:(0,jsx_runtime.jsx)(md_index_esm.rZB,{}),onClick:function(){return ModalTeleprompterRecord_awaiter(void 0,void 0,void 0,(function(){return ModalTeleprompterRecord_generator(this,(function(_a){switch(_a.label){case 0:return[4,ModalTeleprompterRecord_awaiter(void 0,void 0,void 0,(function(){var content,res,newList;return ModalTeleprompterRecord_generator(this,(function(_a){switch(_a.label){case 0:return content=encodeURIComponent(scriptText||""),[4,createScript({data:{title:scriptTitleText,content}})];case 1:return(res=_a.sent())&&(newList=scriptArray.filter((function(option){return!!option.scriptId})),newList=ModalTeleprompterRecord_spreadArray(ModalTeleprompterRecord_spreadArray([],ModalTeleprompterRecord_read(newList),!1),[res],!1),sortScripts(newList),newList=ModalTeleprompterRecord_spreadArray(ModalTeleprompterRecord_spreadArray([],ModalTeleprompterRecord_read(defaultOptions),!1),ModalTeleprompterRecord_read(newList),!1),setScriptArray(newList),setIsNewScript(!1),setAppearanceConfig(ModalTeleprompterRecord_assign(ModalTeleprompterRecord_assign({},appearanceConfig),{activeScriptId:res.scriptId,content})),setScriptTextTouched(!1),toast({message:"Script saved as ".concat(scriptTitleText,".")}),setScriptTitleText("New Script ".concat(dayjs_min_default()(new Date).format("YYYY-MM-DD")))),[2]}}))}))];case 1:return _a.sent(),[2]}}))}))}}),(0,jsx_runtime.jsx)("div",ModalTeleprompterRecord_assign({className:"closeCreateScriptView"},{children:(0,jsx_runtime.jsx)(md_index_esm.OZi,{size:"24px",color:"#272A32",onClick:function(){setIsNewScript(!1)}})}))]})):(0,jsx_runtime.jsxs)("div",ModalTeleprompterRecord_assign({className:"newScriptDiv"},{children:[1!=currentTab?(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{disabled:!appearanceConfig.activeScriptId||!scriptText||scriptText&&!scriptTextTouched||""===scriptText.trim(),variant:"secondary",text:"Save To My Scripts",icon:(0,jsx_runtime.jsx)(md_index_esm.rZB,{size:18}),onClick:function(){return ModalTeleprompterRecord_awaiter(void 0,void 0,void 0,(function(){return ModalTeleprompterRecord_generator(this,(function(_a){switch(_a.label){case 0:return appearanceConfig.activeScriptId<0?(setIsNewScript(!0),[3,3]):[3,1];case 1:return[4,updateOldScript()];case 2:_a.sent(),_a.label=3;case 3:return[2]}}))}))}}):(0,jsx_runtime.jsx)("div",{children:" "}),(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{text:"Turn On",disabled:-1!==appearanceConfig.activeScriptId&&!appearanceConfig.content||-1===appearanceConfig.activeScriptId&&(!scriptText||""===scriptText.trim()||scriptText&&!scriptTextTouched),onClick:function(){var data=appearanceConfig;-1===data.activeScriptId&&(data.content=scriptText),handleSubmit&&handleSubmit(data)}})]}))})]}),DroplrFilesView=(0,jsx_runtime.jsx)(Modal_Modal,ModalTeleprompterRecord_assign({disableFullScreen:!0,style:{position:"fixed",zIndex:9}},{children:(0,jsx_runtime.jsxs)(ModalTeleprompterRecord_Container,ModalTeleprompterRecord_assign({style:{width:"592px",height:"648px",background:"#FFFFFF",border:"1px solid #F7F8FA",boxShadow:"0px 4px 12px rgba(29, 30, 36, 0.04)",borderRadius:"4px"}},{children:[(0,jsx_runtime.jsxs)(ModalTeleprompterRecord_Header,{children:[(0,jsx_runtime.jsx)(ModalTeleprompterRecord_Title,{children:"Select file"}),(0,jsx_runtime.jsx)(CloseButtonWrap2,ModalTeleprompterRecord_assign({title:"Close"},{children:(0,jsx_runtime.jsx)(io_index_esm.WQq,{size:24,onClick:function(){return setCurrentView(Views.LIST)},color:palette_label})}))]}),(0,jsx_runtime.jsx)("br",{}),(0,jsx_runtime.jsx)(DroplrFilesTabContent,{selectedVirtualBackgroundUrl:selectedScriptFile.url,onSelect:function(url,id){var source;void 0===url&&(url=""),void 0===id&&(id=""),setSelectedScriptFile({url,id}),setCurrentTab(1),source=url,ModalTeleprompterRecord_awaiter(void 0,void 0,void 0,(function(){return ModalTeleprompterRecord_generator(this,(function(_a){return fetch(source).then((function(response){response.text().then((function(text){setAppearanceConfig(ModalTeleprompterRecord_assign(ModalTeleprompterRecord_assign({},appearanceConfig),{content:text}))}))})),[2]}))}))},handleModalClose:function(){setCurrentView(Views.LIST)}})]}))})),CancelView=(0,jsx_runtime.jsxs)(ModalTeleprompterRecord_ModalItem,{children:[(0,jsx_runtime.jsx)(ContentHeaderWrap,{children:(0,jsx_runtime.jsx)(ModalTeleprompterRecord_ContentHeader,{children:"Cancel Teleprompter?"})}),(0,jsx_runtime.jsx)(ModalTeleprompterRecord_ContentBody,{children:"You will lose all changes for the Teleprompter."}),(0,jsx_runtime.jsxs)(ModalTeleprompterRecord_ButtonContainer,ModalTeleprompterRecord_assign({style:{justifyContent:"end"}},{children:[(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{text:"Yes, cancel",onClick:function(){return handleModalClose()},variant:isCdkEnviroment?"text":"destructive"}),(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{text:"Back to editing",onClick:function(){return setCurrentView(Views.LIST)}})]}))]}),CurrentVievComponent=null;switch(currentView){case Views.LIST:CurrentVievComponent=List;break;case Views.FILES:CurrentVievComponent=DroplrFilesView;break;case Views.CANCEL:CurrentVievComponent=CancelView}return(0,jsx_runtime.jsx)(Modal_Modal,ModalTeleprompterRecord_assign({disableFullScreen:!0,style:{position:"fixed",zIndex:9}},{children:CurrentVievComponent}))},RecordCam_assign=function(){return RecordCam_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},RecordCam_assign.apply(this,arguments)},RecordCam_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},RecordCam=function(_a){var screenStream=_a.screenStream,stopAllStreams=_a.stopAllStreams,handleGoToRecordHome=_a.handleGoToRecordHome,_b=_a.showPreview,showPreview=void 0===_b||_b,onStartUpladingVoiceOverHandler=_a.onStartUpladingVoiceOverHandler,toggleCamera=_a.toggleCamera,isCameraToggled=_a.isCameraToggled,canvasRef=(0,react.useRef)(null),videoRef=(0,react.useRef)(null),userData=useAuthorizationContext().userData,_c=useConfigurationContext(),showVirtualBgFeature=_c.showVirtualBgFeature,showTeleprompterFeature=_c.showTeleprompterFeature,initialImage=function(id){var vbSelection=localStorage.getItem("covideoVirtualBackground")||"";try{var savedVirtualBackground=JSON.parse(vbSelection);return savedVirtualBackground&&"object"==typeof savedVirtualBackground&&(null==savedVirtualBackground?void 0:savedVirtualBackground[id])||initialVirtualBgState}catch(ex){return initialVirtualBgState}}(userData.id),_d=RecordCam_read((0,react.useState)(!!initialImage.url),2),isLoadingVB=_d[0],setIsLoadingVB=_d[1],_e=RecordCam_read((0,react.useState)(!1),2),isSegmenterActive=_e[0],setIsSegmenterActive=_e[1],isMobileDevice=checkIfMobileDevice(),_f=useTeleprompter(),disableOrEnableTeleprompter=_f.disableOrEnableTeleprompter,turnOnTeleprompterPlaying=_f.turnOnTeleprompterPlaying,saveTeleprompterSettingsHandler=_f.saveTeleprompterSettingsHandler,onTeleprompterModalClose=_f.onTeleprompterModalClose,showTeleprompterModal=_f.showTeleprompterModal,isUsingTeleprompter=_f.isUsingTeleprompter,teleprompterSettings=_f.teleprompterSettings,_g=recordv1_useRecorder({isSegmenterActive,canvasRef,videoRef,screenStream,stopAllStreams,onStartUpladingVoiceOverHandler,shouldStartCountdown:!1,handleGoToRecordHome,isCameraToggled}),stopRecording=_g.stopRecording,pauseRecording=_g.pauseRecording,startCountDown=_g.startCountDown,stopCountDown=_g.stopCountDown,status=_g.status,recordedBlob=_g.recordedBlob,countdown=_g.countdown,timeInSeconds=_g.timeInSeconds;return(0,react.useEffect)((function(){0===countdown&&status===RECORDING_STATUS.COUNTDOWN&&isUsingTeleprompter&&turnOnTeleprompterPlaying()}),[countdown,status]),(0,react.useEffect)((function(){var _a,_b;if(null===(_b=null===(_a=null==userData?void 0:userData.user)||void 0===_a?void 0:_a.packageDetails)||void 0===_b?void 0:_b.id){var status_1=!checkIfFeatureIsEnabled(userData,productFeature_TELEPROMPTER);disableOrEnableTeleprompter(status_1)}}),[]),status===RECORDING_STATUS.DONE&&recordedBlob&&showPreview?(0,jsx_runtime.jsx)(DetailsRecordingPreview,{videoBlob:recordedBlob,handleGoToRecordHome:function(){handleGoToRecordHome()}}):(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(RecordingHeaderWithRouteGuard,{status,handleGoToRecordHome:function(){handleGoToRecordHome()},teleprompterActions:showTeleprompterFeature?(0,jsx_runtime.jsx)(TeleprompterActions,{status}):(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{})}),(0,jsx_runtime.jsxs)("div",RecordCam_assign({style:{position:"relative"}},{children:[status===RECORDING_STATUS.IDLE&&(0,jsx_runtime.jsx)(RecordCamLoader,{text:"Loading camera"}),(0,jsx_runtime.jsx)(RecorderBody,{videoRef,canvasRef,countdown,status,teleprompter:(0,jsx_runtime.jsx)(Teleprompter_TeleprompterDisplay,{status}),toggleCamera}),!isMobileDevice&&showVirtualBgFeature&&(0,jsx_runtime.jsx)(VirtualBackgroundsButton,{setIsLoadingVB,isLoadingVb:isLoadingVB,initialImage,videoRef,canvasRef,isSegmenterActive,setIsSegmenterActive,status})]})),(0,jsx_runtime.jsx)(recordv1_VideoRecorderActions,{startCountDown,stopCountDown,pauseRecording,stopRecording,status,timeInSeconds,isLoadingVB}),showTeleprompterModal&&(0,jsx_runtime.jsx)(ModalTeleprompterRecord,{handleModalClose:onTeleprompterModalClose,handleSubmit:saveTeleprompterSettingsHandler,settings:teleprompterSettings})]})},recorderSettings_assign=function(){return recorderSettings_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},recorderSettings_assign.apply(this,arguments)},QUALITY_MAP={low:{width:{ideal:640},height:{ideal:360}},standard:{width:{ideal:1280},height:{ideal:720}},high:{width:{ideal:1920},height:{ideal:1080}}},ChooseRecordingOptions_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},ChooseRecordingOptions_assign=function(){return ChooseRecordingOptions_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},ChooseRecordingOptions_assign.apply(this,arguments)},ChooseRecordingOptions_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},ChooseRecordingOptions_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},ChooseRecordingOptions_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},RecordOption=styled_components_browser_esm.Ay.div(ChooseRecordingOptions_templateObject_1||(ChooseRecordingOptions_templateObject_1=ChooseRecordingOptions_makeTemplateObject(["\n display: flex;\n flex-direction: column;\n width: 176px;\n height: 176px;\n padding: 32px;\n border-radius: 4px;\n border: solid 2px #eeeff2;\n background-color: white;\n justify-content: space-between;\n align-items: center;\n color: ",";\n\n &:hover {\n cursor: ",";\n border: solid 2px #d0d3d9;\n }\n"],["\n display: flex;\n flex-direction: column;\n width: 176px;\n height: 176px;\n padding: 32px;\n border-radius: 4px;\n border: solid 2px #eeeff2;\n background-color: white;\n justify-content: space-between;\n align-items: center;\n color: ",";\n\n &:hover {\n cursor: ",";\n border: solid 2px #d0d3d9;\n }\n"])),(function(_a){return _a.theme.colors.neutral[80]}),(function(_a){return _a.error?"not-allowed":"pointer"})),MainRecordContentWrapper=(0,styled_components_browser_esm.Ay)(Gap)(ChooseRecordingOptions_templateObject_3||(ChooseRecordingOptions_templateObject_3=ChooseRecordingOptions_makeTemplateObject(["\n border-radius: 8px;\n margin: 56px auto 0 auto;\n background-color: ",";\n\n ","\n"],["\n border-radius: 8px;\n margin: 56px auto 0 auto;\n background-color: ",";\n\n ","\n"])),(function(_a){return _a.theme.colors.neutral[10]}),(function(_a){return _a.theme.containerWidth<screenSizes_sm&&(0,styled_components_browser_esm.AH)(ChooseRecordingOptions_templateObject_2||(ChooseRecordingOptions_templateObject_2=ChooseRecordingOptions_makeTemplateObject(["\n width: 100%;\n padding: 24px 0;\n "],["\n width: 100%;\n padding: 24px 0;\n "])))})),RecordingOptionWrapper=(0,styled_components_browser_esm.Ay)(Gap)(ChooseRecordingOptions_templateObject_5||(ChooseRecordingOptions_templateObject_5=ChooseRecordingOptions_makeTemplateObject(["\n ","\n"],["\n ","\n"])),(function(_a){return _a.theme.containerWidth<screenSizes_sm&&(0,styled_components_browser_esm.AH)(ChooseRecordingOptions_templateObject_4||(ChooseRecordingOptions_templateObject_4=ChooseRecordingOptions_makeTemplateObject(["\n flex-direction: column;\n "],["\n flex-direction: column;\n "])))})),ShowRecorderWrapper=styled_components_browser_esm.Ay.div(ChooseRecordingOptions_templateObject_7||(ChooseRecordingOptions_templateObject_7=ChooseRecordingOptions_makeTemplateObject(["\n ","\n"],["\n ","\n"])),(function(_a){return _a.theme.containerWidth<screenSizes_sm&&(0,styled_components_browser_esm.AH)(ChooseRecordingOptions_templateObject_6||(ChooseRecordingOptions_templateObject_6=ChooseRecordingOptions_makeTemplateObject(["\n width: 100%;\n padding: 0 16px;\n "],["\n width: 100%;\n padding: 0 16px;\n "])))})),IoPersonCircleWrapper=styled_components_browser_esm.Ay.div(ChooseRecordingOptions_templateObject_8||(ChooseRecordingOptions_templateObject_8=ChooseRecordingOptions_makeTemplateObject(["\n background-color: white;\n border-radius: 50px;\n position: absolute;\n border: 2px solid white;\n bottom: 65px;\n left: 35px;\n"],["\n background-color: white;\n border-radius: 50px;\n position: absolute;\n border: 2px solid white;\n bottom: 65px;\n left: 35px;\n"]))),ChooseRecordingOptions=function(_a){var extendStyles=_a.extendStyles,showPreview=(_a.showHelpDesk,_a.showPreview),onStartUpladingVoiceOverHandler=_a.onStartUpladingVoiceOverHandler,_b=(_a.showLegacyRecorderSwitch,useConfigurationContext()),showRecordBothFeature=_b.showRecordBothFeature,showRecordCamFeature=_b.showRecordCamFeature,showRecordScreenFeature=_b.showRecordScreenFeature,history=(0,react_router.W6)(),_c=ChooseRecordingOptions_read((0,react.useState)(!1),2),settingsOpen=_c[0],setSettingsOpen=_c[1],_d=useRecordSettings(),recordingError=_d.recordingError,updateErrorMessage=_d.updateErrorMessage,userSettings=_d.userSettings,recorderSettings=_d.recorderSettings,colors=(0,styled_components_browser_esm.DP)().colors,_e=ChooseRecordingOptions_read((0,react.useState)(),2),isFrontCamera=_e[0],setIsFrontCamera=_e[1],_f=ChooseRecordingOptions_read((0,react.useState)(null),2),showRecordOption=_f[0],setShowRecordOption=_f[1],_g=ChooseRecordingOptions_read((0,react.useState)(!1),2),isPromptOpen=_g[0],setIsPromptOpen=_g[1],_h=ChooseRecordingOptions_read((0,react.useState)(null),2),screenStream=_h[0],setScreenStream=_h[1],displayMediaRef=(0,react.useRef)(null),cameraStreamRef=(0,react.useRef)(null),videoCameraPipRef=(0,react.useRef)(null),isCameraToggled=(0,react.useRef)(!1),audioSettings=function(userSettings){var _a,deviceId=null===(_a=null==userSettings?void 0:userSettings.audioSource)||void 0===_a?void 0:_a.value;return!!deviceId&&{deviceId}}(userSettings),videoSettings=function(userSettings){var _a,_b,quality=(null==userSettings?void 0:userSettings.videoQuality)?QUALITY_MAP[userSettings.videoQuality]:QUALITY_MAP.standard;return recorderSettings_assign(recorderSettings_assign({},quality),{frameRate:24,deviceId:(null===(_a=null==userSettings?void 0:userSettings.videoSource)||void 0===_a?void 0:_a.value)?null===(_b=null==userSettings?void 0:userSettings.videoSource)||void 0===_b?void 0:_b.value:void 0})}(userSettings),stopAllStreams=function(){return ChooseRecordingOptions_awaiter(void 0,void 0,void 0,(function(){return ChooseRecordingOptions_generator(this,(function(_a){switch(_a.label){case 0:return displayMediaRef.current&&displayMediaRef.current.getTracks().forEach((function(track){return track.stop()})),cameraStreamRef.current&&(cameraStreamRef.current.getTracks().forEach((function(track){return track.stop()})),cameraStreamRef.current=null),screenStream&&screenStream.getTracks().forEach((function(track){return track.stop()})),document.pictureInPictureElement?[4,document.exitPictureInPicture()]:[3,2];case 1:_a.sent(),_a.label=2;case 2:return videoCameraPipRef.current&&videoCameraPipRef.current.srcObject&&(videoCameraPipRef.current.srcObject.getTracks().forEach((function(track){return track.stop()})),videoCameraPipRef.current.srcObject=null),[2]}}))}))},handleGoToRecordHome=function(){setShowRecordOption(null),stopAllStreams()},isMobileDevice=checkIfMobileDevice();return(0,react.useEffect)((function(){handleGoToRecordHome()}),[history.location]),(0,react.useEffect)((function(){var _a,_b,_c,checkIfIsFrontCamera=!!(null===(_c=null===(_b=null===(_a=null==userSettings?void 0:userSettings.videoSource)||void 0===_a?void 0:_a.label)||void 0===_b?void 0:_b.toLowerCase())||void 0===_c?void 0:_c.includes("front"));setIsFrontCamera(checkIfIsFrontCamera)}),[userSettings]),(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsxs)(Stack,ChooseRecordingOptions_assign({gap:"32px"},{children:[null===showRecordOption&&(0,jsx_runtime.jsxs)(MainRecordContentWrapper,ChooseRecordingOptions_assign({flexDirection:"column",gap:"44px",style:null==extendStyles?void 0:extendStyles.mainRecordContentWrapper},{children:[(0,jsx_runtime.jsx)(Heading,ChooseRecordingOptions_assign({color:colors.black[100]},{children:"Choose recording option"})),(0,jsx_runtime.jsxs)(RecordingOptionWrapper,ChooseRecordingOptions_assign({gap:"32px"},{children:[showRecordBothFeature&&!isOpera&&!isFirefox&&!isMobileDevice&&(0,jsx_runtime.jsxs)(RecordOption,ChooseRecordingOptions_assign({onClick:function(){return ChooseRecordingOptions_awaiter(void 0,void 0,void 0,(function(){var _a,error_4;return ChooseRecordingOptions_generator(this,(function(_b){switch(_b.label){case 0:if(recordingError||null===videoCameraPipRef.current||isPromptOpen)return[2];_b.label=1;case 1:return _b.trys.push([1,6,,7]),setIsPromptOpen(!0),browserChecks_isSafari?[3,3]:[4,getScreenAndCameraStreams(displayMediaRef,cameraStreamRef,audioSettings,videoSettings,videoCameraPipRef)];case 2:return _a=_b.sent(),[3,5];case 3:return[4,getSafariScreenAndCameraStreams(displayMediaRef,cameraStreamRef,audioSettings,videoSettings,videoCameraPipRef)];case 4:_a=_b.sent(),_b.label=5;case 5:return setScreenStream(_a),setShowRecordOption("both"),setIsPromptOpen(!1),[3,7];case 6:return error_4=_b.sent(),stopAllStreams(),console.log(error_4,"enableCameraHandler"),setIsPromptOpen(!1),[3,7];case 7:return[2]}}))}))},style:{position:"relative"},error:!!recordingError},{children:[(0,jsx_runtime.jsx)(md_index_esm.A5v,{size:72}),(0,jsx_runtime.jsx)(IoPersonCircleWrapper,{children:(0,jsx_runtime.jsx)(io5_index_esm.yap,{size:28})}),(0,jsx_runtime.jsx)(ParagraphNormal,ChooseRecordingOptions_assign({color:colors.black[100]},{children:"Screen+Cam"}))]})),showRecordScreenFeature&&!isMobileDevice&&(0,jsx_runtime.jsxs)(RecordOption,ChooseRecordingOptions_assign({onClick:function(){return ChooseRecordingOptions_awaiter(void 0,void 0,void 0,(function(){var stream,error_1;return ChooseRecordingOptions_generator(this,(function(_a){switch(_a.label){case 0:if(recordingError||isPromptOpen)return[2];_a.label=1;case 1:return _a.trys.push([1,3,,4]),setIsPromptOpen(!0),[4,handleScreenCapture(displayMediaRef,audioSettings,videoSettings)];case 2:return(stream=_a.sent())&&(setScreenStream(stream),setShowRecordOption("screen")),setIsPromptOpen(!1),[3,4];case 3:return error_1=_a.sent(),stopAllStreams(),setIsPromptOpen(!1),console.log(error_1,"screenCaptureHandler"),[3,4];case 4:return[2]}}))}))},error:!!recordingError},{children:[(0,jsx_runtime.jsx)(md_index_esm.A5v,{size:72}),(0,jsx_runtime.jsx)(ParagraphNormal,ChooseRecordingOptions_assign({color:colors.black[100]},{children:"Screen Only"}))]})),showRecordCamFeature&&(0,jsx_runtime.jsxs)(RecordOption,ChooseRecordingOptions_assign({onClick:function(){return ChooseRecordingOptions_awaiter(void 0,void 0,void 0,(function(){var stream,error_2;return ChooseRecordingOptions_generator(this,(function(_a){switch(_a.label){case 0:if(recordingError||isPromptOpen)return[2];_a.label=1;case 1:return _a.trys.push([1,3,,4]),setIsPromptOpen(!0),[4,enableCamera(cameraStreamRef,audioSettings,videoSettings)];case 2:return(stream=_a.sent())&&(setScreenStream(stream),setShowRecordOption("cam")),setIsPromptOpen(!1),[3,4];case 3:return error_2=_a.sent(),stopAllStreams(),setIsPromptOpen(!1),console.log(error_2,"enableCameraHandler"),updateErrorMessage(),[3,4];case 4:return[2]}}))}))},error:!!recordingError},{children:[(0,jsx_runtime.jsx)(md_index_esm.LTk,{size:72}),(0,jsx_runtime.jsx)(ParagraphNormal,ChooseRecordingOptions_assign({color:colors.black[100]},{children:"Cam Only"}))]}))]}))]})),!!recordingError&&null===showRecordOption&&(0,jsx_runtime.jsx)(ParagraphSmallBold,{children:recordingError}),"screen"===showRecordOption&&screenStream instanceof MediaStream&&(0,jsx_runtime.jsx)(ShowRecorderWrapper,ChooseRecordingOptions_assign({style:null==extendStyles?void 0:extendStyles.showRecorderWrapper},{children:(0,jsx_runtime.jsx)(ScreenRecorder,{screenStream,stopAllStreams,handleGoToRecordHome,showPreview,onStartUpladingVoiceOverHandler})})),"cam"===showRecordOption&&screenStream instanceof MediaStream&&(0,jsx_runtime.jsx)(ShowRecorderWrapper,ChooseRecordingOptions_assign({style:null==extendStyles?void 0:extendStyles.showRecorderWrapper},{children:(0,jsx_runtime.jsx)(TeleprompterProvider,{children:(0,jsx_runtime.jsx)(RecordCam,{screenStream,stopAllStreams,handleGoToRecordHome,showPreview,onStartUpladingVoiceOverHandler,toggleCamera:function(){return ChooseRecordingOptions_awaiter(void 0,void 0,void 0,(function(){var nextIsFrontCamera_1,toggledCamera,stream,error_3,_a,_b;return ChooseRecordingOptions_generator(this,(function(_c){switch(_c.label){case 0:return _c.trys.push([0,3,,4]),isCameraToggled.current=!0,nextIsFrontCamera_1=!isFrontCamera,toggledCamera=recorderSettings.videoSource.filter((function(source){return nextIsFrontCamera_1?source.label.toLowerCase().includes("front"):source.label.toLowerCase().includes("back")})),[4,stopAllStreams()];case 1:return _c.sent(),[4,enableCamera(cameraStreamRef,audioSettings,ChooseRecordingOptions_assign(ChooseRecordingOptions_assign({},videoSettings),{deviceId:(null===(_a=toggledCamera[0])||void 0===_a?void 0:_a.value)?null===(_b=toggledCamera[0])||void 0===_b?void 0:_b.value:void 0}))];case 2:return(stream=_c.sent())&&(setScreenStream(stream),setShowRecordOption("cam")),setIsFrontCamera(nextIsFrontCamera_1),[3,4];case 3:return error_3=_c.sent(),console.error("Error toggling camera:",error_3),[3,4];case 4:return[2]}}))}))},isCameraToggled:isCameraToggled.current})})})),"both"===showRecordOption&&screenStream instanceof MediaStream&&(0,jsx_runtime.jsx)(ShowRecorderWrapper,ChooseRecordingOptions_assign({style:null==extendStyles?void 0:extendStyles.showRecorderWrapper},{children:(0,jsx_runtime.jsx)(RecordBoth,{screenStream,stopAllStreams,handleGoToRecordHome,showPreview,onStartUpladingVoiceOverHandler})})),(0,jsx_runtime.jsx)("video",{ref:videoCameraPipRef,style:{display:"none"}}),null===showRecordOption&&(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{icon:(0,jsx_runtime.jsx)(md_index_esm.hgV,{size:18}),variant:"secondary",text:"Recording settings",onClick:function(){return setSettingsOpen(!0)}})]})),settingsOpen&&(0,jsx_runtime.jsx)(ModalRecordingVideosSettings,{handleModalClose:function(){return setSettingsOpen(!1)}})]})},RecordHome_makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},RecordHome_Wrapper=styled_components_browser_esm.Ay.div(RecordHome_templateObject_1||(RecordHome_templateObject_1=RecordHome_makeTemplateObject(["\n background: ",";\n"],["\n background: ",";\n"])),palette_gray10),RecordHome=function(){var history=(0,react_router.W6)(),userData=useAuthorizationContext().userData;return(0,react.useEffect)((function(){pushToDataLayer({event:"covideo-pageview",page_application:"CRM Video Lite",page_url:"https://video.connectcdk.com/embed/record/home",page_location:"Home",page_section:"Videos",user_id:userData.email,is_internal_user:userData.email.includes("cdk")||userData.email.includes("covideo")})}),[]),(0,jsx_runtime.jsxs)(RecordHome_Wrapper,{children:[(0,jsx_runtime.jsx)(TopBar,{left:(0,jsx_runtime.jsx)(react_covideo_common_esm.$n,{text:"Back",variant:"transparent",icon:(0,jsx_runtime.jsx)(md_index_esm.MGo,{size:"18"}),onClick:function(){return history.push("/")},style:{color:"white"}}),center:(0,jsx_runtime.jsx)(TitleWrapper,{children:"Record Video"})}),(0,jsx_runtime.jsx)(RecordSettingsProvider,{children:(0,jsx_runtime.jsx)(ChooseRecordingOptions,{showHelpDesk:!0,showLegacyRecorderSwitch:!0})})]})},RecordingRoutes=function(){return(0,jsx_runtime.jsx)(react_router.dO,{children:(0,jsx_runtime.jsx)(react_router.qh,{path:"/record/home",component:RecordHome})})},App_assign=function(){return App_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},App_assign.apply(this,arguments)},App_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},App_generator=function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},App_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},initialUser={id:"",verified:0,access:0,customerId:0,customer:{automotiveAccess:0}};const app_App=function App(){var _this=this,_a=App_read((0,react.useState)(!0),2),isLoading=_a[0],setIsLoading=_a[1],_b=App_read((0,react.useState)(initialUser),2),user=_b[0],setUser=_b[1],loadUser=function(){return App_awaiter(_this,void 0,void 0,(function(){var user_1;return App_generator(this,(function(_a){switch(_a.label){case 0:if(!token)return setUser(initialUser),setIsLoading(!1),[2];setIsLoading(!0),_a.label=1;case 1:return _a.trys.push([1,3,,4]),[4,__awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(_a){switch(_a.label){case 0:return[4,config_EXPRESS_API.get("/auth/user")];case 1:return[2,_a.sent().data]}}))}))];case 2:return user_1=_a.sent(),setUser(user_1),[3,4];case 3:return _a.sent(),[3,4];case 4:return setIsLoading(!1),[2]}}))}))},onUpdateToken=function(jwt){return App_awaiter(_this,void 0,void 0,(function(){return App_generator(this,(function(_a){switch(_a.label){case 0:return config_updateToken(jwt),[4,loadUser()];case 1:return _a.sent(),[2]}}))}))};(0,react.useEffect)((function(){loadUser()}),[]);var isLoggedIn=!!(null==user?void 0:user.id);return isLoading?(0,jsx_runtime.jsx)(MainWrapper,{children:(0,jsx_runtime.jsx)(LoadingIndicator,{height:400,isLoading:!0,hideLoaderText:!0})}):(0,jsx_runtime.jsx)(AuthorizationContextProvider,App_assign({initialUser:user},{children:(0,jsx_runtime.jsx)(ActionDispatchProvider,{children:(0,jsx_runtime.jsx)(ToastNotificationsProvider,{children:(0,jsx_runtime.jsx)(MainWrapper,{children:(0,jsx_runtime.jsxs)(react_router.fS,{children:[isLoggedIn&&(0,jsx_runtime.jsxs)(react_router.dO,{children:[(0,jsx_runtime.jsx)(react_router.qh,{path:"/merge",component:Merge,exact:!0}),(0,jsx_runtime.jsx)(react_router.qh,{path:"/voiceover/:videoId",component:VoiceOver,exact:!0}),(0,jsx_runtime.jsx)(react_router.qh,{path:"/insert-video/:videoId",component:InsertVideo,exact:!0}),(0,jsx_runtime.jsx)(react_router.qh,{path:"/wheels-tv",component:WheelsTV}),(0,jsx_runtime.jsx)(react_router.qh,{path:"/lesa-tv",component:LesaTV}),(0,jsx_runtime.jsx)(react_router.qh,{exact:!0,path:"/preview-upload/:videoId",component:previewUpload_PreviewUpload}),(0,jsx_runtime.jsx)(react_router.qh,{exact:!0,path:"/",component:function(){return(0,jsx_runtime.jsx)(Library,{handleUpdateToken:onUpdateToken})}}),(0,jsx_runtime.jsx)(react_router.qh,{path:"/record",component:RecordingRoutes})]}),!isLoggedIn&&(0,jsx_runtime.jsx)(react_router.dO,{children:(0,jsx_runtime.jsx)(react_router.qh,{exact:!0,path:"/",component:function(){return(0,jsx_runtime.jsx)(Login,{handleUpdateToken:onUpdateToken})}})})]})})})})}))};var Feature,Environment,src_assign=function(){return src_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},src_assign.apply(this,arguments)},src_read=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},queryClient=new es.QueryClient({defaultOptions:{queries:{retry:0},mutations:{retry:0}}});!function(Feature){Feature.UPLOAD="upload",Feature.FOLDER="folder",Feature.RECORD_SCREEN="recordScreen",Feature.MERGE="merge",Feature.RECORD_CAM="recordCam",Feature.WHEELS_TV="wheelsTV",Feature.RECORD_BOTH="recordBoth",Feature.TRIM="trim",Feature.INSERT="insert",Feature.LANDING_PAGE="landingPage",Feature.QUICKSHARE="quickshare",Feature.CTA="CTA",Feature.VOICEOVER="voiceover",Feature.REACTIONS="reactions",Feature.AI_ASSIST="aiAssist",Feature.UPGRADE_MESSAGE="upgradeMessage",Feature.LESA_TV="lesaTV",Feature.MULTI_LOCATION="multiLocation",Feature.TELEPROMPTER="teleprompter",Feature.VIRTUAL_BG="virtualBg",Feature.WEBSITE_OVERLAY="websiteOverlay"}(Feature||(Feature={})),function(Environment){Environment.DEVELOPMENT="development",Environment.SANDBOX="sandbox",Environment.STAGING="staging",Environment.PRODUCTION="production"}(Environment||(Environment={}));var CovideoEmbed=function(props){var _a=src_read((0,react.useState)(0),2),render=_a[0],setRender=_a[1];return(null==props?void 0:props.apikey)?(function useGoogleTagManager(gtmId){(0,react.useEffect)((function(){if("undefined"!=typeof window){var hostname=window.location.hostname;if((hostname.includes("localhost")||hostname.includes("cdk"))&&!document.getElementById("gtm-script")){var script=document.createElement("script");script.id="gtm-script",script.innerHTML="\n (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':\n new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],\n j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=\n 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);\n })(window,document,'script','dataLayer','".concat(gtmId,"');\n "),document.head.appendChild(script);var noscript=document.createElement("noscript");noscript.id="gtm-noscript",noscript.innerHTML='\n <iframe src="https://www.googletagmanager.com/ns.html?id='.concat(gtmId,'"\n height="0" width="0" style="display:none;visibility:hidden"></iframe>\n '),document.body.appendChild(noscript)}}}),[gtmId])}(props.whitelabel===WHITELABEL.CDK?"GTM-WDMKC9RF":""),(0,jsx_runtime.jsx)(es.QueryClientProvider,src_assign({client:queryClient},{children:(0,jsx_runtime.jsx)(ConfigurationProvider,src_assign({},props,{reRender:function(){return setRender((function(prev){return prev+1}))}},{children:(0,jsx_runtime.jsx)(app_App,{},"".concat(null==props?void 0:props.env).concat(null==props?void 0:props.token).concat(null==props?void 0:props.apikey).concat(render))}))}))):(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"Apikey is required."})},cjs_js_stories_CovideoEmbed=__webpack_require__("./node_modules/css-loader/dist/cjs.js!./stories/CovideoEmbed.css"),CovideoEmbed_options={};CovideoEmbed_options.styleTagTransform=styleTagTransform_default(),CovideoEmbed_options.setAttributes=setAttributesWithoutAttributes_default(),CovideoEmbed_options.insert=insertBySelector_default().bind(null,"head"),CovideoEmbed_options.domAPI=styleDomAPI_default(),CovideoEmbed_options.insertStyleElement=insertStyleElement_default();injectStylesIntoStyleTag_default()(cjs_js_stories_CovideoEmbed.A,CovideoEmbed_options);cjs_js_stories_CovideoEmbed.A&&cjs_js_stories_CovideoEmbed.A.locals&&cjs_js_stories_CovideoEmbed.A.locals;var CovideoEmbed_stories_assign=function(){return CovideoEmbed_stories_assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},CovideoEmbed_stories_assign.apply(this,arguments)};const CovideoEmbed_stories={title:"CovideoEmbed",component:CovideoEmbed,parameters:{controls:{exclude:["onVideoInsert","onVideoInsertError"]}},argTypes:{env:{options:Object.values(Environment),control:{type:"inline-radio"}},hideFeatures:{options:Object.values(Feature),control:{type:"inline-check"}}}};var handleClearVideoInsert=function(){document.getElementById("video-insert").innerHTML="Insert video to populate this area..."},CovideoEmbedStory={args:{env:Environment.PRODUCTION,onVideoInsert:function(data){console.log("handleVideoInsert data",data),document.getElementById("video-insert").innerHTML=data.html},onVideoInsertError:console.log,hideFeatures:["websiteOverlay"],token:"",apikey:"apikey",whitelabel:"cdk"},render:function(args){return(0,jsx_runtime.jsxs)("div",CovideoEmbed_stories_assign({className:"consumer-app"},{children:[(0,jsx_runtime.jsxs)("div",{children:[(0,jsx_runtime.jsx)("div",CovideoEmbed_stories_assign({id:"video-insert"},{children:"Insert video to populate this area..."})),(0,jsx_runtime.jsx)("button",CovideoEmbed_stories_assign({onClick:handleClearVideoInsert},{children:"Clear"}))]}),(0,jsx_runtime.jsx)("div",CovideoEmbed_stories_assign({className:"covideo-container"},{children:(0,jsx_runtime.jsx)(CovideoEmbed,CovideoEmbed_stories_assign({},args))}))]}))}};CovideoEmbedStory.parameters={...CovideoEmbedStory.parameters,docs:{...CovideoEmbedStory.parameters?.docs,source:{originalSource:"{\n args: {\n env: Environment.PRODUCTION,\n onVideoInsert: handleVideoInsert,\n onVideoInsertError: console.log,\n hideFeatures: ['websiteOverlay'],\n token: '',\n apikey: 'apikey',\n whitelabel: 'cdk'\n },\n render: args => <div className='consumer-app'>\n <div>\n <div id={videoInsertDivId}>{videoInsertPlaceholder}</div>\n <button onClick={handleClearVideoInsert}>Clear</button>\n </div>\n <div className='covideo-container'>\n <CovideoEmbed {...args} />\n </div>\n </div>\n}",...CovideoEmbedStory.parameters?.docs?.source}}}},"?0ac7":()=>{}}]);
|