var FlickFusionExecutor=function(){"use strict";var _mediaHostURL="//media.flickfusion.net/",_verifyHostURL="//ver.ev5.ai/",_pageStatsServiceURL="https://jobserver-dot-concatlogsbigquery.appspot.com/app/stats/?event_type=",_getRefDomain=window.location.hostname,_getRefURL=encodeURIComponent(window.location.href),_documentTitle=encodeURIComponent(document.title),_referredFrom=encodeURIComponent(document.referrer),_displayButtonThumb,_displayButtonDefault,_button_image_path,_profilesBag={},_filterUnique={},_buttonsCount=0,_buttons_count=document.querySelectorAll("#evs_link")?.length?document.querySelectorAll("#evs_link")?.length:document.querySelectorAll("#ff_link")?.length,_domainName=window.location.hostname,_path=window.location.href,_custom_script_run,_allowDuplicates=false,_showSpanishBtn=false,notAllowInlineDuplicate=true,dataVDP={},dataVLP={},forceConfigRun=false,checkIsVLP,checkIsVDP,isSPA,checkFyuse="0",checkCDK="0",clientKey="F7AA26A0-E17E-DA32-1685-D4EA9A5BD282",checkDDC="0",dom="",clientKeyForTest=clientKey,clientData,siteConfig={VLP:{},VDP:{},EVC:{}},targetElementOnSRP,targetElementOnVDP,includeDDCAPIButtonsOnVDP="",includeDDCAPIButtonsOnVLP="",showDirectModal="1",isDDCFallBackRolled,ignoreGlobleVTBtn,isVinHit=false,aspectRatio,extVlpIndicator,isStock=0,nc_client="0",spanish_button_image_path,defaultSpanishButtonImages={},isFullScreen=false,runNextScript=false,modalEce,_custom_script_on_vin_response,gaTrackingIds,checkFFButton=document.querySelector("#ff_link")?true:false,EVSButton=!checkFFButton?"evs_":"ff_",testClient=getParameterByName("ff_test_client")?getParameterByName("ff_test_client"):getParameterByName("evs_test_client")?getParameterByName("evs_test_client"):"",testVin=getParameterByName("ff_test_vin")?getParameterByName("ff_test_vin"):getParameterByName("evs_test_vin")?getParameterByName("evs_test_vin"):""; // window.is360Video = ""; clientData = [] // json include siteConfig = { "VLP":{},"VDP":{}, "EVC":{} } // js include if(!siteConfig.VLP)siteConfig.VLP={};if(!siteConfig.VDP)siteConfig.VDP={};if(!Array.isArray(clientData)){if(!runNextScript){window["checkClientData"]=true}}else if(!document.querySelector("#"+EVSButton+"link")){return}if(siteConfig.VLP.isSPA||siteConfig.VDP.isSPA){loadFFScript("https://storage.googleapis.com/gcbimages/s/spa_script.min.js");return}if(siteConfig.EVC&&Object.keys(siteConfig.EVC).length){var trackLeadData=siteConfig.EVC;for(var i=0;i{let specialSymbols=encodeURIComponent(char);return!trademarkSymbolsPattern.test(specialSymbols)})).join("");return result}function removeVinSpecailCharacters(input){const trademarkSymbolsPattern=/%[a-zA-Z][a-zA-Z0-9]?/g;const result=input.replace(trademarkSymbolsPattern,"");return result}function checkVehicleData(buttonData){if(!buttonData.getAttribute(EVSButton+"client")&&Number(nc_client))buttonData.setAttribute(EVSButton+"client",clientKeyForTest);if(_profilesBag[buttonData.getAttribute(EVSButton+"client")]&&Number(_profilesBag[buttonData.getAttribute(EVSButton+"client")].flow_found)&&!buttonData.getAttribute(EVSButton+"vin")&&buttonData.getAttribute(EVSButton+"year")){buttonData.setAttribute(EVSButton+"vin",buttonData.getAttribute(EVSButton+"year")+"_"+buttonData.getAttribute(EVSButton+"make")+"_"+buttonData.getAttribute(EVSButton+"model")+"_"+(new Date).getMilliseconds())}var isDuplicateButton=_filterUnique[buttonData.getAttribute(EVSButton+"client")+"__"+buttonData.getAttribute(EVSButton+"vin")];if(checkCDK==="1"&&buttonData.getAttribute(EVSButton+"inline")&¬AllowInlineDuplicate)isDuplicateButton=false;if(!_allowDuplicates){if(isDuplicateButton||buttonData.hasAttribute("verified")){return false}}buttonData.innerHTML="";var evs_vin=buttonData.getAttribute(EVSButton+"vin")||"",evs_year=buttonData.getAttribute(EVSButton+"year")||"",evs_make=buttonData.getAttribute(EVSButton+"make")||"",evs_model=buttonData.getAttribute(EVSButton+"model")||"",evs_trim=buttonData.getAttribute(EVSButton+"trim")||"",evs_lp=buttonData.getAttribute(EVSButton+"lp")||"",evs_body_type=buttonData.getAttribute(EVSButton+"body_type")||"",clientKey=buttonData.getAttribute(EVSButton+"client")||"";var evs_new_car="&evs_year="+removeSpecialCharacters(evs_year)+"&evs_make="+removeSpecialCharacters(evs_make)+"&evs_model="+removeSpecialCharacters(evs_model)+"&evs_trim="+removeSpecialCharacters(evs_trim)+"&evs_body_type="+removeSpecialCharacters(evs_body_type)+"&evs_lp="+removeSpecialCharacters(evs_lp);for(var key in _profilesBag){if(_profilesBag.hasOwnProperty(key)){if(_profilesBag[key].disp_spanish_btn===1){_showSpanishBtn=true;break}}}if(testClient){clientKey=testClient;evs_vin=testVin}var checkVIN=_verifyHostURL+"evs_verify_vin.php?vin="+removeVinSpecailCharacters(evs_vin)+"&client_id="+clientKey+evs_new_car+(_showSpanishBtn?"&evs_spanish=1":"")+"&stk="+isStock;var inputData,outputData;var startTime=Date.now();fetchJsonp(checkVIN,{timeout:25e3,jsonpCallback:"jsoncallback"}).then((function(response){return response.json()})).then((function(videoData){var responseTime=Date.now()-startTime;checkVIN=checkVIN.split(" ").join("").replace(/(\r\n|\n|\r)/gm,"");checkVIN=checkVIN.slice(checkVIN.indexOf("php?vin")+1,checkVIN.length);checkVIN=checkVIN.replace(/\s/g,"");outputData=videoData;var fullData={client_key:clientKey,client_data:_profilesBag[videoData.data.client_fk],vin_output:outputData,response_time:responseTime,snippet_loaded:true,is_vlp:checkIsVLP,is_vdp:checkIsVDP,site_info:{url:window.location.hostname,full_url:window.location.href,referer:document.referrer,insident_time:Date.now()}};postData(fullData,"verify_vin").then((resp=>{}));if(videoData.code===200){if(checkFyuse=="1"&&(!videoData.data.popup||videoData.data.popup&&!(videoData.data.popup.is360==1))){return generateFyuseElements(buttonData,evs_vin)}if(!isVinHit){let popupScript;if(videoData?.data?.popup?.ece==1)popupScript="//storage.googleapis.com/gcbimages/s/ece_modal_popup.min.js";else if(videoData?.data?.popup?.ig==1)popupScript=checkIsVLP||!dataVDP.inlinePlayer?"https://ver.ev5.ai/s/ddc/prod/modal_v2.js":"";else popupScript="//storage.googleapis.com/gcbimages/s/ev5popup.min.js";loadFFScript(popupScript,(function(){if(getParameterByName("autoplay")==1&&showDirectModal=="1"&&Number(_profilesBag[videoData.data.client_fk].flow_found)){setTimeout((function(){enableDirectModalShow(videoData.data)}),2e3)}}))}isVinHit=true;return generateDisplayItems(videoData.data,buttonData,null)}else if(checkFyuse=="1"){return generateFyuseElements(buttonData,evs_vin)}else{if(_custom_script_on_vin_response){const performScriptRun=document.querySelector(_custom_script_on_vin_response.pageId);if(_custom_script_on_vin_response?.runOnVDP&&performScriptRun){_custom_script_on_vin_response.script(videoData,buttonData,null,dataVLP,dataVDP,checkIsVDP,checkIsVLP)}if(_custom_script_on_vin_response?.runOnVLP&&performScriptRun){_custom_script_on_vin_response.script(videoData,buttonData,null,dataVLP,dataVDP,checkIsVDP,checkIsVLP)}}}return false})).catch((function(reason){console.log("parsing failed",reason)}));_filterUnique[buttonData.getAttribute(EVSButton+"client")+"__"+buttonData.getAttribute(EVSButton+"vin")]=true}var generateFyuseElements=function(buttonData,fyuseVin){var getFyuseIdService="https://media.flickfusion.net/360/hn_360_client.php?vin="+fyuseVin;fetchJsonp(getFyuseIdService,{timeout:25e3,jsonpCallback:"jsoncallback"}).then((function(response){return response.json()})).then((function(fyuseData){if(fyuseData.code===200){var fyuseId=JSON.parse(fyuseData.fid)[0];if(checkIsVDP&&dataVDP.inlinePlayer){if(checkIsVDP&&dataVDP.siteStyle){createStyleTagAndAppend(dataVDP.siteStyle)}loadFFScript("https://fyu.se/embed?v=3.0",(function(){{var fyuseInlineWrapper=document.createElement("div");fyuseInlineWrapper.className="fyu_container fyu_horizontal";buttonData.appendChild(fyuseInlineWrapper);FYU.add(fyuseId,fyuseInlineWrapper);document.querySelector("#"+EVSButton+"link").addEventListener("mousedown, touchstart",(function(e){e.preventDefault();e.stopPropagation()}))}}));return}var spinElement=document.createElement("div");spinElement.id="spin";_displayButtonDefault=generateButton(null,buttonData,null,getButtonImagePath,null,"runFyusePlayer");buttonData.appendChild(_displayButtonDefault);insertBefore(spinElement,buttonData);buttonData.addEventListener("click",(function(e){e.preventDefault();e.stopPropagation();loadFyuse(fyuseId)}))}})).catch((function(reason){console.log("parsing failed",reason)}))};var isStyleAdded=false;var generateDisplayItems=function(videoData,buttonData){var getProfileData=_profilesBag[videoData.client_fk];if(!getProfileData)getProfileData=_profilesBag[clientKey];if(testClient)getProfileData=_profilesBag[clientKeyForTest];var isVDP=_buttons_count===1||checkIsVDP;let videoDataUrl=videoData?.popup?.url?videoData?.popup?.url:videoData?.nv.url?videoData?.nv.url:"";var videoFkey=getParameterByName("video_fkey",videoDataUrl)?getParameterByName("video_fkey",videoDataUrl):"";let thumbnailUrl=`//media.flickfusion.net/videos/global/thumbnail.php?video_fkey=${videoFkey}`;if(isVDP){if(isMobile()&&dataVDP.isMobileSiteStyle){createStyleTagAndAppend(dataVDP.isMobileSiteStyle)}else if(dataVDP.siteStyle&&videoData.popup){createStyleTagAndAppend(dataVDP.siteStyle)}}if(checkIsVLP&&!isStyleAdded){if(isMobile()&&dataVLP.isMobileSiteStyle){createStyleTagAndAppend(dataVLP.isMobileSiteStyle)}else if(dataVLP.siteStyle){createStyleTagAndAppend(dataVLP.siteStyle)}}isStyleAdded=true;if(getProfileData.vid_call===1){if(isVDP){var videoCallFromName=videoData.veh_year+" "+videoData.veh_make+" "+videoData.veh_model+" "+videoData.veh_trim;videoCallFromName=encodeURIComponent(videoCallFromName);if(getProfileData.vid_call_html){var createVideoWrapper=document.createElement("div");createVideoWrapper.innerHTML=getProfileData.vid_call_html;document.body.appendChild(createVideoWrapper)}else{var cardTitle="Have Questions?"||"Have Questions?";var cardDesc="Video Chat With Us Now And Get Real Answers, No Sales Pitch. No Pressure"||"Video Chat With Us Now And Get Real Answers, No Sales Pitch. No Pressure";loadFFScript("generate_video_call_card.js?externalCallEmbed=0&user_html_added=0&cardDesc="+cardDesc+"&cardTitle="+cardTitle+"&fromName="+videoCallFromName+"&roof_key="+getProfileData.client_fk)}}}var disableAutoPlay=buttonData.getAttribute("disable_auto_play")||"";var iframeElement,isLandingPage=Number(buttonData.getAttribute(EVSButton+"lp"))===1?true:getProfileData.lp===1?true:false,checkInline=buttonData.getAttribute(EVSButton+"inline")||0;if(videoData.popup?.sf==1&&dataVDP?.sfElement)generateSFGallery();function generateSFGallery(){loadFFScript("https://ver.ev5.ai/s/ddc/prod/modal_v2.js",(function(){let playerTarget=document.querySelector?.(dataVDP?.sfElement);let playerPos=dataVDP?.sfElementPos;const evsPlayer=document.createElement("div");evsPlayer.id="ff_link";evsPlayer.setAttribute("ff_inline","1");if(playerPos=="top")playerTarget.insertAdjacentElement("beforebegin",evsPlayer);else if(playerPos=="bottom")playerTarget.insertAdjacentElement("afterend",evsPlayer);else if(playerPos=="inside")playerTarget.insertAdjacentElement("afterbegin",evsPlayer);else playerTarget.insertAdjacentElement("beforeend",evsPlayer);new ConModalV2({iframeUrl:videoData.popup?.sf_url+"&referer="+_getRefDomain+"&h_p="+_getRefURL+"&h_p_r="+_referredFrom+"&h_t="+_documentTitle,inline:true})}))}if(Number(checkInline)===1||dataVDP&&dataVDP.vehicleTestInline&&document.querySelector(dataVDP.VDPIndicator)){if(videoData.popup?.ig==1){loadFFScript("https://ver.ev5.ai/s/ddc/prod/modal_v2.js",(function(){const evsPlayer=document.createElement("div");evsPlayer.id="ff_link";evsPlayer.setAttribute("ff_inline","1");if(videoData.popup?.ig==1){buttonData.appendChild(evsPlayer);new ConModalV2({iframeUrl:videoData.popup?.url+"&referer="+_getRefDomain+"&h_p="+_getRefURL+"&h_p_r="+_referredFrom+"&h_t="+_documentTitle,inline:true})}if(videoData.popup?.sf==1&&dataVDP?.sfElement){let playerTarget=document.querySelector?.(dataVDP.sfElement);let playerPos=dataVDP.sfElementPos;if(playerPos=="top")playerTarget.insertAdjacentElement("beforebegin",evsPlayer);else if(playerPos=="bottom")playerTarget.insertAdjacentElement("afterend",evsPlayer);else if(playerPos=="inside")playerTarget.insertAdjacentElement("afterbegin",evsPlayer);else playerTarget.insertAdjacentElement("beforeend",evsPlayer);new ConModalV2({iframeUrl:videoData.popup?.sf_url+"&referer="+_getRefDomain+"&h_p="+_getRefURL+"&h_p_r="+_referredFrom+"&h_t="+_documentTitle,inline:true})}}))}else{if(dataVDP.gallery_pro){loadFFScript("https://ver.ev5.ai/s/ddc/prod/modal_v2.js",(function(){let iframeURL=videoData?.popup?.url+(Number(disableAutoPlay)===1?"&disable_auto_play=1":"")+"&referer="+_getRefDomain+"&h_p="+_getRefURL+"&h_p_r="+_referredFrom+"&h_t="+_documentTitle;new ConModalV2({iframeUrl:iframeURL+"&inline_embed=1",inline:true})}))}else{if(videoData.popup?.sf==1&&dataVDP?.sfElement)generateSFGallery();var sameExistingInlineButton=buttonData;if(videoData.popup&&videoData.popup.type===2||videoData.nv&&videoData.nv.type===2)window.addEventListener("message",receiveMessage,false);var incomingURL=videoData.nv&&dataVDP&&dataVDP.vehicleTestInline?videoData.nv.url:videoData.popup.url;var iframeURL=incomingURL+(Number(disableAutoPlay)===1?"&disable_auto_play=1":"")+"&referer="+_getRefDomain+"&h_p="+_getRefURL+"&h_p_r="+_referredFrom+"&h_t="+_documentTitle;addJsonLdToHead(videoData.jsonLD,checkIsVDP,dataVDP.isIndex);iframeElement=document.createElement("iframe");let iframe_img_loader=document.createElement("img");let loaderGif=document.createElement("div");loaderGif.id="loader-img";loaderGif.innerHTML='';createStyleTagAndAppend(`#${EVSButton}link {position: relative;} .iframe_img_loader {max-width:100%;width:100%;position: absolute;top: 0;left: 0;opacity: 1;transition: opacity 1s ease;display:block;} #${EVSButton}link_iframe {opacity: 0;transition: opacity 1s ease;} #loader-img {position: absolute;top: 0;left: 0;width: 100%;aspect-ratio:16/9;opacity: 1;transition: opacity 1s ease;} #loader-img img{width:auto !important;position: absolute;top: 50%;left: 50%;transform: translate(-50%, -50%);opacity: 1;transition: opacity 1s ease;}`);iframe_img_loader.classList.add("iframe_img_loader");iframe_img_loader.src=thumbnailUrl;buttonData.appendChild(iframe_img_loader);iframe_img_loader.addEventListener("load",(function(){buttonData.appendChild(loaderGif)}));iframeElement.frameBorder=0;iframeElement.scrolling="no";iframeElement.setAttribute("allowFullScreen","");iframeElement.setAttribute("allow","accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture");iframeElement.src=iframeURL;if(videoData.nv&&dataVDP&&dataVDP.changePostionAfter)document.querySelector(dataVDP.changePostionAfter).parentNode.insertBefore(iframeElement,document.querySelector(dataVDP.changePostionAfter).nextSibling);else buttonData.appendChild(iframeElement);if(!iframeElement.src&&iframeElement.getAttribute("data-src")){iframeElement.src=iframeElement.getAttribute("data-src")}if(videoData.nv&&dataVDP&&dataVDP.vehicleTestInline)iframeElement.id=EVSButton+"link_iframe_vt";else iframeElement.id=EVSButton+"link_iframe";iframeElement.addEventListener("load",(function(){createStyleTagAndAppend(`#${EVSButton}link_iframe {opacity: 1;}`);loaderGif.style.cssText="z-index:-999;opacity:0";iframe_img_loader.style.cssText="z-index:-999;opacity:0"}));iframeElement.style.width="1px";iframeElement.style.minWidth="100%";var inlinePlayerOverlay=document.createElement("div");inlinePlayerOverlay.classList.add("flick_overlay_element");inlinePlayerOverlay.style.cssText="display:none;position: fixed; top: 0; bottom: 0; left: 0; right: 0; z-index: 100; width:100%; height:100%;background-color:rgb(0 0 0 / 66%);z-index:99999";buttonData.appendChild(inlinePlayerOverlay);let clearTimeInSec=6;let sendEmbedType=setInterval((function(){sendEmbedTypeFun(iframeElement)}),1e3);setTimeout((()=>{clearInterval(sendEmbedType);sendEmbedType=0}),clearTimeInSec*1e3);window.addEventListener("message",(function(e){try{var data=JSON.parse(e.data);if(data.action==="FFusion_open_popup_inline"){toggleFullScreenModeInline()}if(data.type==="player_4_3"){aspectRatio=.75}if(data.action==="FFusion_open_popup_inline"){isFullScreen=!isFullScreen;document.body.classList.toggle("fFusion_inline_fullscreen_enable");if(isMobile())document.body.classList.toggle("fFusion_inline_fullscreen_is_mobile");toggleFullScreenModeInline()}}catch(e){}}));document.addEventListener("click",(function(e){if(document.body.classList.contains("fFusion_inline_fullscreen_enable")&&document.querySelector("#"+EVSButton+"link iframe")!=e.target){iframeElement.contentWindow.postMessage(JSON.stringify({action:"exitFullScreen"}),"*");isFullScreen=!isFullScreen;document.body.classList.toggle("fFusion_inline_fullscreen_enable");if(isMobile())document.body.classList.toggle("fFusion_inline_fullscreen_is_mobile");toggleFullScreenModeInline()}}));if(videoData.popup&&videoData.popup.type===0||videoData.nv&&videoData.nv.type===0&&dataVDP&&dataVDP.vehicleTestInline){buttonData.style.cssText="position:relative; padding-bottom:60.2%; padding-top:25px; height:0;";iframeElement.style.cssText="position:absolute;top:0; left:0; width:100%; height:100%;"}if(dataVDP&&dataVDP.iframeRegenerateOnResize){window.addEventListener("resize",(function(){var postionTarget=document.querySelector(dataVDP.target);if(window.innerWidth<850){setTimeout((function(){if(!postionTarget.querySelector("#"+EVSButton+"link")){document.querySelector(dataVDP.target).append(sameExistingInlineButton)}}),1200)}else{setTimeout((function(){if(!postionTarget.querySelector("#"+EVSButton+"link")){document.querySelector(dataVDP.target).append(sameExistingInlineButton)}}),1200)}}))}if(checkIsVDP&&dataVDP.inlinePlayer){var iframeWraperClass,iframeWraperStyle,iframeClass,iframeStyle,iframeParentStyle,iframeParentClass;iframeParentClass=targetDeskOrMobile(dataVDP.mobileIframeParentClass,dataVDP.iframeParentClass);iframeParentClass&&(buttonData.className=iframeParentClass);iframeParentStyle=targetDeskOrMobile(dataVDP.mobileIframeParentStyle,dataVDP.iframeParentStyle);iframeParentStyle&&(buttonData.style.cssText=iframeParentStyle);iframeWraperClass=targetDeskOrMobile(dataVDP.mobileIframeWraperClass,dataVDP.iframeWraperClass);iframeWraperClass&&(iframeElement.closest(dataVDP.target).className=iframeWraperClass);iframeWraperStyle=targetDeskOrMobile(dataVDP.mobileIframeWraperStyle,dataVDP.iframeWraperStyle);iframeWraperStyle&&(iframeElement.closest(dataVDP.target).style.cssText=iframeWraperStyle);iframeClass=targetDeskOrMobile(dataVDP.mobileIframeClass,dataVDP.iframeClass);iframeClass&&(iframeElement.className=iframeClass);iframeStyle=targetDeskOrMobile(dataVDP.mobileIframeStyle,dataVDP.iframeStyle);iframeStyle&&(iframeElement.style.cssText="width:1px; min-width:100%;"+iframeStyle)}}}generateGoogleTracking(videoData);return false}function sendEmbedTypeFun(iframeElement){orientationType();iframeElement.contentWindow.postMessage(JSON.stringify({action:"fFusion_from_inline_iframe",parentHeight:window.innerHeight}),"*")}function openLargePopup(modalType){new ConModal({width:960,videoPage:modalType,modalTitle:"Video",iframeUrl:videoData.popup.url+"&referer="+_getRefDomain+"&h_p="+_getRefURL+"&h_p_r="+_referredFrom+"&h_t="+_documentTitle});var evs_iframe=document.getElementById(EVSButton+"link_iframe");evs_iframe.src=evs_iframe.src+"&disable_auto_play=1"}if(_custom_script_run!==undefined){if(_custom_script_run.add360SpinSingleTab){_custom_script_run.runAddTab360Spin();return false}else if(_custom_script_run.runSiteSpecifigScript){_custom_script_run.script(videoData,buttonData,getProfileData,dataVLP,dataVDP,checkIsVDP,checkIsVLP);if(_custom_script_run.stopProcess){return false}}_button_image_path=_custom_script_run.buttonImage;_displayButtonThumb=generateButton(videoData,buttonData,_custom_script_run,getButtonImagePath,_button_image_path);if(_custom_script_run.appendElement){if(_custom_script_run.replaceAsInlinePlayer){var makeInlinePlayer=buttonData.cloneNode(true);makeInlinePlayer.setAttribute(EVSButton+"inline",1);_custom_script_run.appendElement(buttonData).innerHTML=makeInlinePlayer.outerHTML}if(videoData.thumb&&!_custom_script_run.replaceAsInlinePlayer)_custom_script_run.appendElement(buttonData).appendChild(_displayButtonThumb);if(_custom_script_run.parentElementCSS)_custom_script_run.appendElement(buttonData).style.cssText=_custom_script_run.parentElementCSS;if(_custom_script_run.targetElementSectionForCSS)_custom_script_run.targetElementSectionForCSS(buttonData).style.cssText=_custom_script_run.targetElementSectionCSS;if(_custom_script_run.siteCustomCssInclude){var styleTag=document.createElement("style");styleTag.innerText=_custom_script_run.siteCustomCssInclude;document.head.appendChild(styleTag)}}_displayButtonThumb.addEventListener("click",(function(e){e.preventDefault();e.stopPropagation();new ConModal({width:videoData.nv?videoData.nv.button==="AF"?"90%":960:960,videoPage:videoData.thumb.type,modalTitle:"Video",iframeUrl:videoData.thumb.url+"&referer="+_getRefDomain+"&h_p="+_getRefURL+"&h_p_r="+_referredFrom+"&h_t="+_documentTitle,thumbnailUrl:thumbnailUrl})}))}if(videoData.popup){_displayButtonDefault=generateButton(videoData,buttonData,null,getButtonImagePath,null);if(_custom_script_run!==undefined&&_custom_script_run.showButton===false||checkIsVLP&&dataVLP.showButton===false||checkIsVDP&&dataVDP.showButton===false)return false;else buttonData.appendChild(_displayButtonDefault);defaultSpanishButtonImages={vid360:"//gcbimages.storage.googleapis.com/vidbtn/play_video_bt_spanish.png",vid:"//gcbimages.storage.googleapis.com/vidbtn/cc1_sp_grn.png",only360:"//gcbimages.storage.googleapis.com/vidbtn/espanol.png"};if(videoData.popup.spanish_client_fk){var spanis_profile=_profilesBag[videoData.popup.spanish_client_fk];if(checkIsVLP||!checkIsVDP&&_buttons_count>1){if(videoData.popup){if(videoData.popup.model_type==="vid360"){var vid360Button=spanis_profile!=undefined&&spanis_profile.img_srp_360?spanis_profile.img_srp_360:defaultSpanishButtonImages.vid360;spanish_button_image_path=vid360Button}if(videoData.popup.model_type==="vid"){var OnlyVid=spanis_profile!=undefined&&spanis_profile.srp_btn_img?spanis_profile.srp_btn_img:defaultSpanishButtonImages.vid;spanish_button_image_path=OnlyVid}if(Number(videoData.popup.model_type)===360){var only360=spanis_profile!=undefined&&spanis_profile.img_srp_360_only?spanis_profile.img_srp_360_only:defaultSpanishButtonImages.only360;spanish_button_image_path=only360}}}if(checkIsVDP||!checkIsVLP&&_buttons_count===1){if(videoData.popup){if(videoData.popup.model_type==="vid360"){var vid360ButtonVdp=spanis_profile!=undefined&&spanis_profile.img_vdp_360?spanis_profile.img_vdp_360:defaultSpanishButtonImages.vid360;spanish_button_image_path=vid360ButtonVdp}if(videoData.popup.model_type==="vid"){var OnlyVidVDP=spanis_profile!=undefined&&spanis_profile.vdp_btn_img?spanis_profile.vdp_btn_img:defaultSpanishButtonImages.vid;spanish_button_image_path=OnlyVidVDP}if(Number(videoData.popup.model_type)===360){var only360VDP=spanis_profile!=undefined&&spanis_profile.img_vdp_360_only?spanis_profile.img_vdp_360_only:defaultSpanishButtonImages.only360;spanish_button_image_path=only360VDP}}}}if(videoData.popup.spanish_url){var _display_spanish_btn=document.createElement("img");_display_spanish_btn.src=getProfileData.spanish_btn_url||spanish_button_image_path;_display_spanish_btn.style.cursor="pointer";var popupWidthSpanish=isLandingPage?"90%":960;var iframeURLSpanish=videoData.popup.spanish_url;_display_spanish_btn.addEventListener("click",(function(e){e.preventDefault();e.stopPropagation();new ConModal({width:popupWidthSpanish,videoPage:videoData.popup.type,modalTitle:"Video",iframeUrl:iframeURLSpanish+"&referer="+_getRefDomain+(!isLandingPage?"":"&full_screen=1")+"&h_p="+_getRefURL+"&h_p_r="+_referredFrom+"&h_t="+_documentTitle,fullscreen:videoData.popup.tab===1&&!isLandingPage?true:false,thumbnailUrl:thumbnailUrl})}));buttonData.appendChild(_display_spanish_btn)}var iframeURL=videoData.popup.url;let customWidth;if(document.querySelector(dataVLP.VLPIndicator))customWidth=dataVLP.customPopupWidth;else if(document.querySelector(dataVDP.VDPIndicator))customWidth=dataVDP.customPopupWidth;var popupWidth=isLandingPage?"90%":customWidth?customWidth:960;_displayButtonDefault.addEventListener("click",(function(e){e.preventDefault();e.stopPropagation();if(videoData.popup.ece==1){modalEce=new ConModalEce({width:"1154px",closeBtn:false,enableMobileFullHeight:true,closeOnOverlayClick:false,iframeUrl:videoData.popup.url+"&referer="+_getRefDomain+(!isLandingPage?"":"&full_screen=1")+"&h_p="+_getRefURL+"&h_p_r="+_referredFrom+"&h_t="+_documentTitle})}else if(videoData.popup?.ig==1){new ConModalV2({iframeUrl:videoData?.popup?.url+"&modal_embed=1"+"&referer="+_getRefDomain+"&h_p="+_getRefURL+"&h_p_r="+_referredFrom+"&h_t="+_documentTitle})}else{if(window.location.href.indexOf("www.mycars.com")>-1){document.body.scrollIntoView()}if(dataVDP.gallery_pro||dataVLP.gallery_pro){loadFFScript("https://ver.ev5.ai/s/ddc/prod/modal_v2.js",(function(){new ConModalV2({iframeUrl:iframeURL+"&modal_embed=1"+"&referer="+_getRefDomain+"&h_p="+_getRefURL+"&h_p_r="+_referredFrom+"&h_t="+_documentTitle})}))}else{new ConModal({width:popupWidth,videoPage:videoData.popup.type,modalTitle:"Video",iframeUrl:iframeURL+"&referer="+_getRefDomain+(!isLandingPage?"":"&full_screen=1")+"&h_p="+_getRefURL+"&h_p_r="+_referredFrom+"&h_t="+_documentTitle,fullscreen:videoData.popup.tab===1&&!isLandingPage?true:false,thumbnailUrl:thumbnailUrl})}generateGoogleTracking(videoData)}}))}if(videoData.nv){if(Number(getProfileData.flow_found)==1&&videoData.nv.type===0&&!(dataVLP.ignoreFlowFound||dataVDP.ignoreFlowFound))return;var vh_af_queryString="&vin="+videoData.veh_vin+"&year="+videoData.veh_year+"&make="+encodeURIComponent(videoData.veh_make)+"&model="+encodeURIComponent(videoData.veh_model)+"&trim="+encodeURIComponent(videoData.veh_trim)+"&body_type="+encodeURIComponent(videoData.veh_body);var _dislpay_nv_button_img=videoData.nv.button==="VT"?getProfileData.veh_test_img:getProfileData.af_img;if((_buttons_count===1||checkIsVDP)&&getProfileData.vdp_btn_img_VehFF&&ignoreGlobleVTBtn&&!(document.querySelector(extVlpIndicator)||document.querySelector(dataVLP.VLPIndicator))){_dislpay_nv_button_img=getProfileData.vdp_btn_img_VehFF}if(getProfileData.srp_btn_img_VehFF&&ignoreGlobleVTBtn&&(document.querySelector(extVlpIndicator)||document.querySelector(dataVLP.VLPIndicator))){_dislpay_nv_button_img=getProfileData.srp_btn_img_VehFF}var nv_evs_button=generateButton(videoData,buttonData,_custom_script_run,getButtonImagePath,_dislpay_nv_button_img,null,true);nv_evs_button.addEventListener("click",(function(e){e.preventDefault();e.stopPropagation();new ConModal({width:videoData.nv?videoData.nv.button==="AF"?"90%":960:960,videoPage:videoData.nv.type,modalTitle:"Video",iframeUrl:videoData.nv.url+vh_af_queryString+"&referer="+_getRefDomain+"&h_p="+_getRefURL+"&h_p_r="+_referredFrom+"&h_t="+_documentTitle,thumbnailUrl:thumbnailUrl});generateGoogleTracking(videoData)}));buttonData.appendChild(nv_evs_button)}buttonData.setAttribute("verified","")};window.addEventListener("orientationchange",(function(){orientationType();if(isFullScreen){setTimeout((function(){toggleFullScreenModeInline()}),200)}}));function orientationType(){if(document.querySelector("#"+EVSButton+"link_iframe"))sendOrientation("#"+EVSButton+"link_iframe");if(document.querySelector("#con-iframe"))sendOrientation("#con-iframe")}function toggleFullScreenModeInline(){if(!isMobile())return;var screenHeight,getWidth,aspectRatioVal;if(aspectRatio==.75){aspectRatioVal=4/3}else{aspectRatioVal=16/9}if(orientationType()==="landscape"){screenHeight=window.innerHeight;getWidth=Math.round(window.innerHeight*aspectRatioVal);document.querySelector("#"+EVSButton+"link_iframe").style.cssText="width:1px; min-width:"+getWidth+"px;"+"height:"+screenHeight+"px;"}else{document.querySelector("#"+EVSButton+"link_iframe").style.cssText=""}if(!isFullScreen){document.querySelector("#"+EVSButton+"link_iframe").style.width="1px";document.querySelector("#"+EVSButton+"link_iframe").style.minWidth="100%"}}function sendOrientation(id){switch(window.orientation){case-90:case 90:document.querySelector(id).contentWindow.postMessage(JSON.stringify({action:"fFusion_from_inline_orientation",value:"landscape"}),"*");return"landscape";default:document.querySelector(id).contentWindow.postMessage(JSON.stringify({action:"fFusion_from_inline_orientation",value:"portrait"}),"*");return"potrait"}}var generateButton=function(videoData,buttonData,options,getButtonImagePath,custom_button_image_path,isFyusePlayer,isVT){var createButton=document.createElement("div"),currentProfile,additionalStylesFromSiteConfig=null;if(!isFyusePlayer)currentProfile=_profilesBag[videoData.client_fk];if(!currentProfile)currentProfile=_profilesBag[clientKey];if(testClient)currentProfile=_profilesBag[clientKeyForTest];if(checkIsVDP&&dataVDP.fixedButtonText)currentProfile.btn_text=1;if(videoData)addJsonLdToHead(videoData.jsonLD,checkIsVDP,dataVDP.isIndex);if(Number(currentProfile.btn_text)==1&&!isVT||isVT&&(videoData.nv&&Number(currentProfile.btn_text_VehFF)==1)){_buttonsCount++;if(_buttonsCount===1)createStyleTagAndAppend("#"+EVSButton+"link a:hover{opacity:0.9}");if(dataVLP&&checkIsVLP){var additionalStylesFromSiteConfig={buttonClass:targetDeskOrMobile(dataVLP.mobileButtonClass,dataVLP.buttonClass),buttonStyle:targetDeskOrMobile(dataVLP.mobileButtonStyle,dataVLP.buttonStyle),buttonParentClass:targetDeskOrMobile(dataVLP.mobileButtonParentClass,dataVLP.buttonParentClass),buttonParentStyle:targetDeskOrMobile(dataVLP.mobileButtonParentStyle,dataVLP.buttonParentStyle),buttonWrapperClass:targetDeskOrMobile(dataVLP.mobileButtonWrapperClass,dataVLP.buttonWrapperClass),buttonWrapperStyle:targetDeskOrMobile(dataVLP.mobileButtonWrapperStyle,dataVLP.buttonWrapperStyle)}}if(dataVDP&&checkIsVDP&&!dataVDP.inlinePlayer){var additionalStylesFromSiteConfig={buttonClass:targetDeskOrMobile(dataVDP.mobileButtonClass,dataVDP.buttonClass),buttonStyle:targetDeskOrMobile(dataVDP.mobileButtonStyle,dataVDP.buttonStyle),buttonParentClass:targetDeskOrMobile(dataVDP.mobileButtonParentClass,dataVDP.buttonParentClass),buttonParentStyle:targetDeskOrMobile(dataVDP.mobileButtonParentStyle,dataVDP.buttonParentStyle),buttonWrapperClass:targetDeskOrMobile(dataVDP.mobileButtonWrapperClass,dataVDP.buttonWrapperClass),buttonWrapperStyle:targetDeskOrMobile(dataVDP.mobileButtonWrapperStyle,dataVDP.buttonWrapperStyle)}}createButton=getDesignedButton(videoData,buttonData,additionalStylesFromSiteConfig,currentProfile,isFyusePlayer,isVT);if(isFyusePlayer)return createButton}else{createButton=document.createElement("img");createButton.style.cursor="pointer";createButton.src=getButtonImagePath(videoData,buttonData,custom_button_image_path,currentProfile,isFyusePlayer)}if(videoData&&videoData.popup&&videoData.popup.alt){createButton.setAttribute("alt",videoData.popup.alt);createButton.setAttribute("title",videoData.popup.alt)}if(options){if(options.buttonText){createButton=document.createElement("span");createButton.innerText=options.buttonText}if(options.buttonCSS){createButton.style.cssText=options.buttonCSS;createButton.style.cursor="pointer"}}if(checkIsVDP&&Number(clientData.data[0].flow_found)&&document.querySelector("#"+EVSButton+"link")&&window.getComputedStyle(document.querySelector("#"+EVSButton+"link")).getPropertyValue("display")!="none"){var cssFFStyle=".ff-vr-video-button{display:none;}";createStyleTagAndAppend(cssFFStyle)}return createButton};function getDesignedButton(videoData,buttonData,additionalStyle,currentProfile,isFyusePlayer,isVT){_buttons_count=document.querySelectorAll("#"+EVSButton+"link").length;if(_buttons_count>1||checkIsVLP){if(videoData.nv&&isVT){return createButtonWithCss(currentProfile.srp_btn_text_VehFF,currentProfile.srp_btn_fontsize_VehFF,currentProfile.srp_btn_textcolor_VehFF,currentProfile.srp_btn_bgcolor_VehFF,additionalStyle,buttonData)}else if(isFyusePlayer){return createButtonWithCss(currentProfile.srp_btn_text_360_only,currentProfile.srp_btn_fontsize_360_only,currentProfile.srp_btn_textcolor_360_only,currentProfile.srp_btn_bgcolor_360_only,additionalStyle,buttonData,isFyusePlayer)}else if(videoData.popup){if(Number(videoData.popup.model_type)===360){return createButtonWithCss(currentProfile.srp_btn_text_360_only,currentProfile.srp_btn_fontsize_360_only,currentProfile.srp_btn_textcolor_360_only,currentProfile.srp_btn_bgcolor_360_only,additionalStyle,buttonData)}else if(videoData.popup.model_type==="vid360"){return createButtonWithCss(currentProfile.srp_btn_text_vid360,currentProfile.srp_btn_fontsize_vid360,currentProfile.srp_btn_textcolor_vid360,currentProfile.srp_btn_bgcolor_vid360,additionalStyle,buttonData)}else if(videoData.popup.model_type==="vid"){return createButtonWithCss(currentProfile.srp_btn_text_vid_only,currentProfile.srp_btn_fontsize_vid_only,currentProfile.srp_btn_textcolor_vid_only,currentProfile.srp_btn_bgcolor_vid_only,additionalStyle,buttonData)}}}if(_buttons_count===1||checkIsVDP){if(videoData.nv&&isVT){return createButtonWithCss(currentProfile.vdp_btn_text_VehFF,currentProfile.vdp_btn_fontsize_VehFF,currentProfile.vdp_btn_textcolor_VehFF,currentProfile.vdp_btn_bgcolor_VehFF,additionalStyle,buttonData)}else if(isFyusePlayer){return createButtonWithCss(currentProfile.vdp_btn_text_360_only,currentProfile.vdp_btn_fontsize_360_only,currentProfile.vdp_btn_textcolor_360_only,currentProfile.vdp_btn_bgcolor_360_only,additionalStyle,buttonData)}else if(videoData.popup){if(videoData.popup.model_type==="vid360"){return createButtonWithCss(currentProfile.vdp_btn_text_vid360,currentProfile.vdp_btn_fontsize_vid360,currentProfile.vdp_btn_textcolor_vid360,currentProfile.vdp_btn_bgcolor_vid360,additionalStyle,buttonData)}else if(videoData.popup.model_type==="vid"){return createButtonWithCss(currentProfile.vdp_btn_text_vid_only,currentProfile.vdp_btn_fontsize_vid_only,currentProfile.vdp_btn_textcolor_vid_only,currentProfile.vdp_btn_bgcolor_vid_only,additionalStyle,buttonData)}else if(Number(videoData.popup.model_type)===360){return createButtonWithCss(currentProfile.vdp_btn_text_360_only,currentProfile.vdp_btn_fontsize_360_only,currentProfile.vdp_btn_textcolor_360_only,currentProfile.vdp_btn_bgcolor_360_only,additionalStyle,buttonData)}}}}function createButtonWithCss(buttonText,fontSize,fontColor,backgroundColor,additionalStyle,buttonData){var buttonDesign=document.createElement("a");var defaultStyles="display:inline-block; padding:5px; cursor:pointer;text-decoration:none;text-align:center;";buttonDesign.href="#";buttonDesign.style.cssText=defaultStyles;if(additionalStyle){if(additionalStyle.buttonStyle){buttonDesign.style.cssText=defaultStyles+additionalStyle.buttonStyle}if(additionalStyle.buttonClass){var makeClassName=additionalStyle.buttonClass.split(" ").toString().replace(/\,/g," ");buttonDesign.className=makeClassName}if(additionalStyle.buttonParentClass){var parentClassName=additionalStyle.buttonParentClass.split(" ").toString().replace(/\,/g," ");buttonData.className=parentClassName}if(additionalStyle.buttonParentStyle){buttonData.style.cssText=additionalStyle.buttonParentStyle}if(additionalStyle.buttonWrapperClass&&buttonData.closest(dataVLP.container)){var buttonWrapperClass=additionalStyle.buttonWrapperClass.split(" ").toString().replace(/\,/g," ");buttonData.closest(dataVLP.container).className=buttonWrapperClass}if(additionalStyle.buttonWrapperStyle&&buttonData.closest(dataVLP.container)){buttonData.style.cssText=additionalStyle.buttonWrapperStyle;buttonData.closest(dataVLP.container).style.cssText=additionalStyle.buttonWrapperStyle}}if(checkIsVDP&&dataVDP.fixedButtonText)buttonText=dataVDP.fixedButtonText;buttonDesign.innerHTML=buttonText||"Watch Vidoe";if(checkIsVLP&&dataVLP.prependIconElement){buttonDesign.innerHTML=dataVLP.prependIconElement+"  "+buttonText+""}if(checkIsVDP&&dataVDP.prependIconElement){buttonDesign.innerHTML=dataVDP.prependIconElement+"  "+buttonText+""}if(checkIsVLP&&dataVLP.disableDefaultButtonStyles||checkIsVDP&&dataVDP.disableDefaultButtonStyles)return buttonDesign;buttonDesign.style.fontSize=fontSize+"px"||"16px";buttonDesign.style.color=fontColor||"#fff";buttonDesign.style.backgroundColor=backgroundColor;if(additionalStyle&&additionalStyle.buttonStyle&&additionalStyle.buttonStyle.indexOf("background-color")>-1)buttonDesign.style.backgroundColor=additionalStyle.buttonStyle.match(/background-color:\s*([^;}]*)/)[1];return buttonDesign}function getButtonImagePath(videoData,buttonData,custom_button_image_path,currentProfile,isFyusePlayer){_buttons_count=document.querySelectorAll("#"+EVSButton+"link").length;_button_image_path=buttonData.getAttribute(EVSButton+"img")||currentProfile.vid_button;var defaultButtonImages={vid360:"https://media.flickfusion.net/videos/global/images/play_video_360.png",vid:"https://media.flickfusion.net/videos/global/images/ff_play.png",only360:"https://media.flickfusion.net/videos/global/images/360_spin.png"};if(checkCDK=="1")defaultButtonImages.vid="https://media.flickfusion.net/videos/global/images/video_btn_red.png";if(isFyusePlayer){if(_buttons_count>1||checkIsVLP){var only360=currentProfile.img_srp_360_only==""?defaultButtonImages.only360:currentProfile.img_srp_360_only;_button_image_path=buttonData.getAttribute(EVSButton+"img")||only360}if(_buttons_count===1||checkIsVDP){var only360VDP=currentProfile.img_vdp_360_only==""?defaultButtonImages.only360:currentProfile.img_vdp_360_only;_button_image_path=only360VDP}return _button_image_path}if(custom_button_image_path){return _button_image_path=custom_button_image_path}if(checkIsVLP||!checkIsVDP&&_buttons_count>1){if(videoData.popup){if(videoData.popup.model_type==="vid360"){var vid360Button=currentProfile.img_srp_360==""?defaultButtonImages.vid360:currentProfile.img_srp_360;_button_image_path=buttonData.getAttribute(EVSButton+"img")||vid360Button}if(videoData.popup.model_type==="vid"){var OnlyVid=currentProfile.srp_btn_img==""?defaultButtonImages.vid:currentProfile.srp_btn_img;_button_image_path=buttonData.getAttribute(EVSButton+"img")||OnlyVid}if(Number(videoData.popup.model_type)===360){var only360=currentProfile.img_srp_360_only==""?defaultButtonImages.only360:currentProfile.img_srp_360_only;_button_image_path=buttonData.getAttribute(EVSButton+"img")||only360}}}if(checkIsVDP||!checkIsVLP&&_buttons_count===1){if(videoData.popup){if(videoData.popup.model_type==="vid360"){var vid360ButtonVdp=currentProfile.img_vdp_360==""?defaultButtonImages.vid360:currentProfile.img_vdp_360;_button_image_path=buttonData.getAttribute(EVSButton+"img")||vid360ButtonVdp}if(videoData.popup.model_type==="vid"){var OnlyVidVDP=currentProfile.vdp_btn_img==""?defaultButtonImages.vid:currentProfile.vdp_btn_img;_button_image_path=buttonData.getAttribute(EVSButton+"img")||OnlyVidVDP}if(Number(videoData.popup.model_type)===360){var only360VDP=currentProfile.img_vdp_360_only==""?defaultButtonImages.only360:currentProfile.img_vdp_360_only;_button_image_path=buttonData.getAttribute(EVSButton+"img")||only360VDP}}}if(currentProfile.exclusive_btn){_button_image_path=currentProfile.exclusive_btn}if(checkIsVLP&&dataVLP.thumnailPlayIcon||checkIsVDP&&dataVDP.thumnailPlayIcon)_button_image_path=currentProfile.thumb_paly_img;if(_button_image_path!=""){if(!_button_image_path.match(/\.(jpg|jpeg|png|gif)$/)){_button_image_path=currentProfile.vid_button;console.log("Not Image")}}return _button_image_path}function isHidden(el){if(el instanceof Element){var style=window.getComputedStyle(el);if(style.display==="none")return true;return el.offsetParent===null}return false}function isMobile(){if(navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/webOS/i)||navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/BlackBerry/i)||navigator.userAgent.match(/Windows Phone/i))return true;return false}var checkIsMobile=isMobile();function targetDeskOrMobile(mobile,desktop){return checkIsMobile?mobile:desktop}var defaultOptions={timeout:25e3,jsonpCallback:"jsoncallback",jsonpCallbackFunction:null};function generateCallbackFunction(){return"jsonp_"+(new Date).getTime()+"_"+Math.ceil(Math.random()*1e5)}function clearFunction(functionName){try{delete window[functionName]}catch(e){window[functionName]=undefined}}function removeScript(scriptId){var script=document.getElementById(scriptId);if(script){document.getElementsByTagName("head")[0].removeChild(script)}}function fetchJsonp(_url){var options=arguments.length<=1||arguments[1]===undefined?{}:arguments[1];var url=_url;var timeout=options.timeout||defaultOptions.timeout;var jsonpCallback=options.jsonpCallback||defaultOptions.jsonpCallback;var timeoutId=undefined;return new Promise((function(resolve,reject){var callbackFunction=options.jsonpCallbackFunction||generateCallbackFunction();var scriptId=jsonpCallback+"_"+callbackFunction;window[callbackFunction]=function(response){resolve({ok:true,json:function json(){return Promise.resolve(response)}});if(timeoutId)clearTimeout(timeoutId);removeScript(scriptId);clearFunction(callbackFunction)};url+=url.indexOf("?")===-1?"?":"&";var jsonpScript=document.createElement("script");jsonpScript.setAttribute("src",""+url+jsonpCallback+"="+callbackFunction);if(options.charset){jsonpScript.setAttribute("charset",options.charset)}jsonpScript.id=scriptId;document.getElementsByTagName("head")[0].appendChild(jsonpScript);timeoutId=setTimeout((function(){reject(new Error("JSONP request to "+_url+" timed out"));clearFunction(callbackFunction);removeScript(scriptId);window[callbackFunction]=function(){clearFunction(callbackFunction)}}),timeout);jsonpScript.onerror=function(){reject(new Error("JSONP request to "+_url+" failed"));clearFunction(callbackFunction);removeScript(scriptId);if(timeoutId)clearTimeout(timeoutId)}}))}function requestDataJSONP(url,key,callback){var doc=document,head=doc.head,script=doc.createElement("script"),callbackName="f"+Math.round(Math.random()*Date.now());script.setAttribute("src",url+(url.indexOf("?")>0?"&":"?")+key+"="+callbackName);window[callbackName]=function(json){window[callbackName]=undefined;setTimeout((function(){head.removeChild(script)}),0);callback(json)};head.appendChild(script)}async function postData(payload,type){return;const result=await fetch(_pageStatsServiceURL+type,{method:"POST",body:JSON.stringify(payload)});return result.json()}function enableDirectModalShow(videoData){if(!(videoData.nv||videoData.popup))return;var popupURL=videoData.nv?videoData.nv.url:videoData.popup.url;var playerObject,playerURL,validParams=["enable_auto_play","auto_resize","disable_auto_play"];playerObject=generatePlayerURL(getParameterByName("content_type"));playerURL=playerObject.url+getParameterByName(EVSButton+"video_key");validParams.map((param=>{if(getParameterByName(param))playerURL+="&"+param.toString()+"="+getParameterByName(param)}));new ConModal({width:playerObject.width,videoPage:playerObject.type,modalTitle:"Video",iframeUrl:popupURL+"&referer="+_getRefDomain+"&h_p="+_getRefURL+"&h_p_r="+_referredFrom+"&h_t="+_documentTitle});function generatePlayerURL(type){switch(type){case"tabbed":return{url:"//media.flickfusion.net/p/pt.php?video_fkey=",type:2,width:960};break;case"lp":return{url:"//media.flickfusion.net/NLP/?video_fkey=",type:1,width:"100%"};break;case"video":return{url:"//media.flickfusion.net/p/v.php?auto_resize=1&video_fkey=",type:0,width:"960"};break;default:return{url:"//media.flickfusion.net/p/v.php?auto_resize=1&video_fkey=",type:0,width:"960"};break}}}createStyleTagAndAppend(`.fFusion_inline_fullscreen_enable .flick_overlay_element { display:block !important; }.fFusion_inline_fullscreen_enable { overflow: hidden;} #${EVSButton}link_iframe{ width: 1px; min-width: 100%; } .fFusion_inline_fullscreen_enable:not(.fFusion_inline_fullscreen_is_mobile):not(.ff_fullscreen_enabled) #${EVSButton}link[${EVSButton}inline="1"] iframe{ display: flex;z-index:9999999; align-items: center; justify-content: center; overflow: none; position: fixed !important; top: 50% !important; left: 50% !important; width: 100%; max-width: 960px; width: 100% !important; /*max-width: 50% !important;*/ min-width: unset !important; -moz-transform: translateX(-50%) translateY(-50%); -webkit-transform: translateX(-50%) translateY(-50%); transform: translateX(-50%) translateY(-50%); } .fFusion_inline_fullscreen_is_mobile.fFusion_inline_fullscreen_is_mobile:not(.ff_fullscreen_enabled) #${EVSButton}link[${EVSButton}inline="1"] iframe{ position: fixed !important; display: flex; align-items: center; justify-content: center; transform: translate(-50%, -50%); left: 50%; top: 50%; width: unset ; min-width: 100%; overflow: auto; z-index:999999 } #conmodal-loader-gif {position: absolute;top: 0;left: 0;width: 100%;height: 100%;background-image:url("//media.flickfusion.net/videos/global/images/loading.gif"); background-position: center;background-repeat: no-repeat;background-size: auto;opacity: 1;transition: opacity 1s ease;z-index:-999;} .popup_loader_img {max-width:640px;opacity: 1;transition: opacity 1s ease;z-index:-999;width:100%;}`);["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","msfullscreenchange"].forEach((eventType=>document.addEventListener(eventType,onFullscreenToggle,false)));function onFullscreenToggle(){document.body.classList.toggle("ff_fullscreen_enabled");if(document.body.classList.contains("fFusion_inline_fullscreen_enable")&&document.body.classList.contains("fFusion_inline_fullscreen_is_mobile")){if(orientationType()==="landscape"){setTimeout((function(){toggleFullScreenModeInline()}),1200)}}}function removeFFSnippetsAddedOnPage(dataVLP){if(dataVLP.removeExistingButtons&&document.querySelector("#"+EVSButton+"link")){var existingFlickButton=document.querySelectorAll("#"+EVSButton+"link");for(var i=0;i0){dur+=days+"D"}if(hours>0){dur+=hours+"H"}dur+=durationInSeconds+"M";return dur}function receiveMessage(event){if(event!==null&&typeof event==="object"){if(event.origin.indexOf("media.flickfusion.net")>-1&&document.getElementById(EVSButton+"link_iframe")){let data=JSON.parse(event.data);if(document.body.classList.contains("fFusion_inline_fullscreen_enable")&&!isMobile()){var getWidth,aspectRatioVal=data.aspectRatio;var aspectHeight=window.innerHeight;if(window.innerHeight>window.innerWidth){aspectHeight=window.innerWidth}aspectHeight=aspectHeight-30;aspectHeight=aspectHeight-aspectHeight*4/100;getWidth=Math.round(aspectHeight*aspectRatioVal);if(getWidth<1200)document.querySelector(`.fFusion_inline_fullscreen_enable #${EVSButton}link[${EVSButton}inline="1"] iframe`).style.maxWidth=getWidth+"px"}if(data.body_height)document.getElementById(EVSButton+"link_iframe").style.height=data.body_height+"px"}if(event.origin.indexOf("media.flickfusion.net")>-1&&JSON.parse(event.data).action=="veh_test"){document.getElementById(EVSButton+"link_iframe_vt").style.height=JSON.parse(event.data).body_height_vt+"px"}}}if(!Array.prototype.filter){Array.prototype.filter=function(func,thisArg){"use strict";if(!((typeof func==="Function"||typeof func==="function")&&this))throw new TypeError;var len=this.length>>>0,res=new Array(len),t=this,c=0,i=-1;if(thisArg===undefined){while(++i!==len){if(i in this){if(func(t[i],i,t)){res[c++]=t[i]}}}}else{while(++i!==len){if(i in this){if(func.call(thisArg,t[i],i,t)){res[c++]=t[i]}}}}res.length=c;return res}}if(!Element.prototype.matches){Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector}if(!Element.prototype.closest){Element.prototype.closest=function(s){var el=this;do{if(el.matches(s))return el;el=el.parentElement||el.parentNode}while(el!==null&&el.nodeType===1);return null}}if("NodeList"in window&&!NodeList.prototype.forEach){NodeList.prototype.forEach=function(callback,thisArg){thisArg=thisArg||window;for(var i=0;i{gtag("js",new Date);gtag("config",track_id);if(!gtagScriptExists){let script=document.createElement("script");script.type="text/javascript";script.async=true;script.src=`//www.googletagmanager.com/gtag/js?id=${track_id}`;document.getElementsByTagName("head")[0].appendChild(script);gtagScriptExists=true}}));let ascAffiliation=window.asc_datalayer?window.asc_datalayer?.affiliation:"";let gaPageType=window.asc_datalayer?window.asc_datalayer?.page_type:"";let items=window.asc_datalayer?.items;let vehicleVin=videoData.veh_vin;let vehicleYear=videoData.veh_year;let vehicleMake=videoData.veh_make;let vehicleModel=videoData.veh_model;let vehicleTrim=videoData.veh_trim;let vehicleBodyType=videoData.veh_body;let vehiclePrice=videoData.veh_price;let vehicleCondition=videoData.vehicle_listing_type;let vehicleColor=videoData.veh_color;let EVSData={item_id:vehicleVin?vehicleVin:"",item_price:vehiclePrice?vehiclePrice:"",item_condition:vehicleCondition?vehicleCondition:"",item_color:vehicleColor?vehicleColor:"",item_year:vehicleYear?vehicleYear:"",item_make:vehicleMake?vehicleMake:"",item_model:vehicleModel?vehicleModel:"",item_variant:vehicleTrim?vehicleTrim:"",item_type:vehicleBodyType?vehicleBodyType:""};let targetItemId=videoData?.veh_vin;let vehicleDetails=items?filterItemsById(items,targetItemId)[0]:EVSData;if(videoData.popup?.type==2||videoData.nv?.type==2){window.addEventListener("message",(function(e){try{let data=JSON.parse(e.data);if(data.action=="video_ga_data"){if(data?.video_data){generateGA(data.video_data,vehicleDetails,ascAffiliation,gaPageType)}}if(data.action=="video_data"){let targetItemId=data?.vehicle_data.vin;let vehicleDetails=filterItemsById(items,targetItemId)[0];generateGA(data?.video_data,vehicleDetails,ascAffiliation,gaPageType)}if(data.action=="form_submit_data"){let formTargetItemId=data?.form_submit_data.vin;let formVehicleDetails=filterItemsById(items,formTargetItemId)[0];GAformSubmit(formVehicleDetails,gaPageType)}}catch(e){}}))}else{setTimeout((()=>{window.concat?.utils.Messages.receive("csi-mp",(function(ga_data){generateGA(ga_data,vehicleDetails,ascAffiliation,gaPageType)})).start()}),500)}}}catch(err){console.log("invalid tracking id's")}}function filterItemsById(items,itemId){return items.filter((item=>item.item_id===itemId))}function GAformSubmit(form_vehicle_data,gaPageType){let formObj={event_owner:"evs",comm_type:"form",department:"sales",form_type:"consumer_contact",page_type:gaPageType,send_to:gaTrackingIds};gtag("event","asc_form_submission_sales",{...formObj,...form_vehicle_data});gtag("event","asc_form_submission",{...formObj,...form_vehicle_data})}function generateGA(data,vehicle_data,ascAffiliation,gaPageType){let mediaObj={media_type:"video",event_owner:"evs",creative_name:data.message.video_title?data.message.video_title:"",affiliation:ascAffiliation,page_type:gaPageType,send_to:gaTrackingIds};if(data.message.action=="media-started")gtag("event","asc_media_interaction",{event_action_result:"start",...mediaObj,...vehicle_data});else if(data.message.action=="media-played")gtag("event","asc_media_interaction",{event_action_result:"play",...mediaObj,...vehicle_data});else if(data.message.action=="media-paused")gtag("event","asc_media_interaction",{event_action_result:"stop",...mediaObj,...vehicle_data});else if(data.message.action=="media-completed")gtag("event","asc_media_interaction",{event_action_result:"end",...mediaObj,...vehicle_data})}function replaceVehicleFirstImage(buttonContainer,vinNumber,imageTarget){let imageElement=(!checkIsVDP?buttonContainer:document)?.querySelector(imageTarget);if(!imageElement)return;requestDataJSONP("https://cdn.double4.ai/360player/i.php?VIN="+vinNumber,"jsoncallback",(function(data){if(Number(data.code)!==200){return}let mainImg=data.images[0].src;mainImg=mainImg.replace("gcbimages.s3.us-west-001.backblazeb2.com","gcb.vd.onl");imageElement.src=mainImg}))}};if(window._flickFusionScritpLoaded_Tag===undefined){if(!(typeof Promise!=="undefined"&&Promise.toString().indexOf("[native code]")!==-1)){loadFFScript("//storage.googleapis.com/gcbimages/s/es6-promise.polyfill.min.js",(function(){FlickFusionExecutor()}))}else{FlickFusionExecutor()}function createStyleTagAndAppend(cssStyles){if(cssStyles.includes("#ff_link")&&EVSButton!=="ff_"){cssStyles=cssStyles.replace(/#ff_link/g,"#evs_link")}var head=document.head||document.getElementsByTagName("head")[0];var style=document.createElement("style");style.innerText=cssStyles;head.appendChild(style)}function loadFFScript(url,callback){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.type="text/javascript";script.src=url;var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;callback();script.onload=script.onreadystatechange=null;head.removeChild(script)}};head.appendChild(script)}if(window.checkClientData)window._flickFusionScritpLoaded_Tag=true}