PageSourceSearch

https://yamaha-motor.com/_next/static/chunks/6825-cb7b5cff593e3644.js

js yamaha-motor.com collected 2026-10-01 10:19:18 UTC 18,403 bytes, 3 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6825],{86825:(t,e,o)=>{o.d(e,{A:()=>i});function i(t,e){let o={implementationType:"module",repositoryLocation:"npm",KountSDKVersion:"2.2.3",kountClientID:null,isSinglePageApp:!1,collectorURL:null,sessionID:null,kddcgid:null,FPCV_COOKIE_NAME:"clientside-cookie",FPCV_LOCAL_STORAGE_KEY:"clientside-local",FPCV_SESSION_STORAGE_KEY:"kountCookie",SESSION_STORAGE_KEY_SESSION_ID:"KountSessionID",collectBehaviorData:!1,callbacks:{},error:[],isDebugEnabled:!1,LOG_PREFIX:"k:",serverConfig:null,orchestrateTimeoutId:null,updateSDKServerConfigTimeoutInMS:3e3,orchestrateSemaphoreLocked:!1,start(t,e){if(void 0===t)return window.console&&window.console.log&&console.log(`${this.LOG_PREFIX}SDK Disabled: config required.`),!1;this.isDebugEnabled=void 0!==t.isDebugEnabled&&"boolean"==typeof t.isDebugEnabled&&t.isDebugEnabled,this.log(`SDK isDebugEnabled=${this.isDebugEnabled}`),this.log("SDK starting...");let o=t.clientID;if(void 0===o||0===o.length)return this.log("SDK Disabled: clientID required."),!1;this.kountClientID=o,void 0!==t.callbacks&&(this.callbacks=t.callbacks);let i=this._getHostname(t);if(null==i)return this.log("SDK Disabled: unresolved hostname."),!1;this.collectorURL=`https://${i}`,this.log(`collectorURL=${this.collectorURL}`);let s=t.isSinglePageApp;return void 0===s||!0!==s&&!1!==s?(this.log(`SDK Disabled: invalid isSinglePageApp:${s}`),!1):(this.isSinglePageApp=s,this.log(`isSinglePageApp=${this.isSinglePageApp}`),void 0===e||0===e.length)?(this.log("SDK Disabled: sessionID required."),!1):(this.sessionID=e,this.kddcgid=this._newKDDCGID(),this._communicateLatestSessionData(),this._orchestrate(),this.log(`SDK Version=${this.KountSDKVersion}`),this.log(`SDK Implementation=${this.implementationType}`),this.log(`SDK Repository=${this.repositoryLocation}`),this.log("SDK started."),!0)},_orchestrate:async function(t){let e="_orchestrate",o=!1;try{if(this.orchestrateSemaphoreLocked)return void this.log(`${e} gated by semaphore. Skipping...`);this.orchestrateSemaphoreLocked=!0,o=!0,this.log(`${e} start...`),t&&(this.kddcgid=this._newKDDCGID()),this.serverConfig=await this._getServerConfig(),this.serverConfig.collector.run?(this.log(`${e} runCollector start...`),this.runCollector(),this.log(`${e} runCollector end...`)):(this.log(`${e} runCollector skipped...`),this.callback("collect-begin",{SessionID:this.sessionID,KountClientID:this.kountClientID}),this.callback("collect-end",{SessionID:this.sessionID,KountClientID:this.kountClientID}))}catch(o){let t=`${e} unexpected error: ${o}`;this.log(t),this.addError(t)}finally{if(!o)return;clearTimeout(this.orchestrateTimeoutId),this.log(`${e} config:${JSON.stringify(this.serverConfig)}`);let t=this.serverConfig.ttlms;this.orchestrateTimeoutId=setTimeout(this._orchestrate.bind(this,!0),t),this.log(`${e} scheduled for ${t} ms`),this.log(`${e} end...`),this.orchestrateSemaphoreLocked=!1}},_wrapPromiseInTimeout:(t,e)=>new Promise((o,i)=>{let s=setTimeout(()=>{i(Error(`Timeout after ${t}ms.`))},t);e.then(t=>{clearTimeout(s),o(t)}).catch(t=>{clearTimeout(s),i(t)})}),async _getServerConfig(){let t="_getServerConfig";var e=null;try{this.log(`${t} start...`);let o=this.buildUrl({base:this.collectorURL,path:"/cs/config",parameters:{m:this.kountClientID,s:this.sessionID,sv:this.KountSDKVersion,kddcgid:this.kddcgid,impl:this.implementationType,repo:this.repositoryLocation}}),i=await this._wrapPromiseInTimeout(this.updateSDKServerConfigTimeoutInMS,fetch(o));if(!i.ok)throw`response not ok: ${i.status}`;let s=await i.json();e=this._translateJSONToServerConfig(s)}catch(o){let e=`${t} error caught. e:${o}`;this.log(e),this.addError(e)}finally{return null==e&&(e={ttlms:9e5,collector:{run:!0,featureFlags:{app:!0,battery:!0,browser:!0,exp:!0,page:!0,ui:!0}}}),this.log(`${t} config: ${JSON.stringify(e)}`),this.log(`${t} end...`),e}},_translateJSONToServerConfig(t){return{ttlms:this._translateTTLMSConfig(t),collector:this._translateCollectorConfig(t)}},_translateTTLMSConfig:t=>"number"!=typeof t.ttlms?9e5:t.ttlms,_translateCollectorConfig(t){let e="_translateCollectorConfig",o=null;try{if(this.log(`${e} start...`),void 0===t.collection||void 0===t.collection.feature_flags)throw`invali
1d response JSON:${JSON.stringify(t)}`;if("boolean"!=typeof t.collection.collect)throw`collect is not boolean: ${typeof collection.collect}`;let i=t.collection.collect;if(i){let e=t.collection.feature_flags;if("boolean"!=typeof e.app)throw`app feature flag is not boolean: ${typeof e.app}`;if("boolean"!=typeof e.battery)throw`battery feature flag is not boolean: ${typeof e.battery}`;if("boolean"!=typeof e.browser)throw`browser feature flag is not boolean: ${typeof e.browser}`;if("boolean"!=typeof e.exp)throw`exp feature flag is not boolean: ${typeof e.exp}`;if("boolean"!=typeof e.page)throw`page feature flag is not boolean: ${typeof e.page}`;if("boolean"!=typeof e.ui)throw`ui feature flag is not boolean: ${typeof e.ui}`;if("boolean"!=typeof e.passLoc)throw`passLoc feature flag is not boolean: ${typeof e.passLoc}`;o={run:i,featureFlags:t.collection.feature_flags}}else o={run:i}}catch(o){let t=`${e} error caught. e:${o}`;this.log(t),this.addError(t)}finally{return null==o&&(o={run:!0,featureFlags:{app:!0,battery:!0,browser:!0,exp:!0,page:!0,ui:!0}}),this.log(`${e} end...`),o}},_newKDDCGID(){let t="invalid";try{if("undefined"!=typeof crypto&&void 0!==crypto.randomUUID)t=crypto.randomUUID();else{let e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-1234567890",o="";for(let t=0;t<36;t++)o+=e.charAt(Math.floor(Math.random()*e.length));t=o}}catch(t){this.log(`_newKDDCGID error:${t}`)}finally{this.log(`SDK kddcgid=${t}`)}return t},_getHostname(t){let e=t.hostname;if(void 0!==e){if(this._isHostnameValid(e)){let o=t.environment;return o&&this.log(`warning:both 'environment':${o} and deprecated 'hostname':${e} configs were specified. using hostname.`),e}return this.log(`invalid configuredHostname:${e}`),null}let o=t.environment;switch(o&&(o=o.toUpperCase()),o){case"TEST":return"tst.kaptcha.com";case"PROD":return"ssl.kaptcha.com";default:return this.log(`invalid configuredEnvironment:${o}`),null}},_isHostnameValid(t){return"string"!=typeof t?(this.log(`Invalid hostname: not a string: ${typeof t}`),!1):0===t.length?(this.log("Invalid hostname: length 0."),!1):!!/^[a-zA-Z0-9.]*$/g.test(t)||(this.log(`Invalid hostname:${t}`),!1)},_communicateLatestSessionData(){try{this.log("communicateLatestSessionData running...");let t=sessionStorage.getItem(this.SESSION_STORAGE_KEY_SESSION_ID);null===t?this.postNewSession(this.sessionID):t!==this.sessionID&&this.postChangeSession(this.sessionID,t),sessionStorage.setItem(this.SESSION_STORAGE_KEY_SESSION_ID,this.sessionID)}catch(t){this.addError(`communicateLatestSessionData error:${t}`)}finally{this.log("communicateLatestSessionData ending...")}},async postNewSession(t){try{this.log("postNewSession running...");let e=await fetch(this.buildUrl({base:this.collectorURL,path:`/session/${t}`,parameters:{kddcgid:this.kddcgid,impl:this.implementationType,repo:this.repositoryLocation}}),{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","client-id":this.kountClientID}});200===e.status||201===e.status?this.log("postNewSession success"):this.addError(`postNewSession unknown response: ${e.status}`)}catch(t){this.addError(`postNewSession error:${t}`)}finally{this.log("postNewSession ending...")}},async postChangeSession(t,e){try{this.log(`postChangeSession running: newSession: ${t} prevSession: ${e}`);let o=await fetch(this.buildUrl({base:this.collectorURL,path:`/session/${t}`,parameters:{previousSessionID:e,kddcgid:this.kddcgid,impl:this.implementationType,repo:this.repositoryLocation}}),{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","client-id":this.kountClientID}});200===o.status||201===o.status?this.log("postChangeSession success"):this.addError(`postChangeSession unknown response: ${o.status}`)}catch(t){this.addError(`postChangeSession error:${t}`)}finally{this.log("postChangeSession ending...")}},getFPCVFromLocalStorage(){try{this.log("getFPCVFromLocalStorage running...");let t=localStorage.getItem(this.FPCV_LOCAL_STORAGE_KEY);if(null==t)return"";return t}catch(t){return this.addError(`getFPCVFromLocalStorage: error${t}`),""}},getFPCVFromCookie(){try{this.log("getFPCVFromCookie running...");let t=decodeURIComponent(document.cookie).split(";"),e="";for(let o=0;o<t.length;o++){let i=t[o].trim().split("=");if(2===i.length&&i[0]===this.FPCV_COOKIE_NAME){[,e]=i,this.log(`getFPCVFromCookie: found new first party cookie: ${e}`);break}}if(""===e){let o=/(cdn[.][a-z]+[.][0-9]+[.]ka.ck)/g;for(let i=0;i<t.length;i++){let s=t[i].trim();if(!0===o.test(s)){let t=s.split("=");if(2===t.length){[,e]=t,this.log(`getFPCVFromCookie: found old first party cookie: ${e}`),this.storeFPCVInCookie(e);break}}}}return e}catch(t){return this.addError(`getFPCVFromCookie error:${t}`),""}},storeFPCVInLocalStore(t){try{this.log("storeFPCVInLocalStore running..."),localStorage.setItem(this.FPCV_LOCAL_STORAGE_KEY,t)}catch(t){this.addError(`storeFPCVInLocalStore error:${t}`)}finally{this.log("storeFPCVInLocalStore ending...")}},storeFPCVInCookie(t){try{this.log("storeFPCVInCookie running...");let e=new Date;e.setTime(e.getTime()+31536e6);let o=`expires=${e.toUTCString()}`,i="; SameSite=None; Secure";"https:"!==window.location.protocol&&(i="; SameSite=Lax"),document.cookie=`${this.FPCV_COOKIE_NAME}=${t};${o};path=/${i}`}catch(t){this.addError(`storeFPCVInCookie error:${t}`)}finally{this.log("storeFPCVInCookie ending...")}},storeFPCVInSession(t){try{this.log("storeFPCVInSession running..."),sessionStorage.setItem(o.FPCV_SESSION_STORAGE_KEY,t)}catch(t){this.addError(`storeFPCVInSession error:${t}`)}},coordinateFirstPartyCookieValues(){this.log("coordinateFirstPartyCookieValues running...");let t="",e=this.getFPCVFromCookie(),o=this.getFPCVFromLocalStorage();
1this.storeFPCVInSession(""),""===e&&""===o?t="":""!==e&&""===o?(this.storeFPCVInLocalStore(e),t=e):""!==o&&""===e?(this.storeFPCVInCookie(o),t=o):o===e&&""!==o&&""!==e?t=o:o!==e&&""!==o&&""!==e&&(this.storeFPCVInCookie(o),t=o),""===t?this.establishNewFPCV():this.communicateExistingFPCV(t)},async establishNewFPCV(){try{this.log("establishNewFPCV running...");let t=this.buildUrl({base:this.collectorURL,path:"/cs/generatecookie",parameters:{m:this.kountClientID,s:this.sessionID,sv:this.KountSDKVersion,kddcgid:this.kddcgid,impl:this.implementationType,repo:this.repositoryLocation}}),e=await fetch(t),o=await e.json();if(o.value.length>0){let t=o.value;this.storeFPCVInCookie(t),this.storeFPCVInLocalStore(t),this.storeFPCVInSession(t)}}catch(t){this.addError(`establishNewFPCV error:${t}`)}finally{this.log("establishNewFPCV ending...")}},async communicateExistingFPCV(t){try{this.log("communicateExistingFPCV running...");let e=await fetch(this.buildUrl({base:this.collectorURL,path:"/cs/storecookie"}),{method:"POST",body:this.buildParams({m:this.kountClientID,s:this.sessionID,sv:this.KountSDKVersion,k:t,kddcgid:this.kddcgid,impl:this.implementationType,repo:this.repositoryLocation}),headers:{"Content-Type":"application/x-www-form-urlencoded"}});500===e.status&&(this.log("communicateExistingFPCV: invalid cookie"),o.establishNewFPCV()),200===e.status&&(this.log("communicateExistingFPCV: valid cookie"),o.storeFPCVInSession(t))}catch(t){this.addError(`communicateExistingFPCV error:${t}`)}},_passiveLoc(){let t="_passiveLoc";try{this.log(`${t} start...`),this.serverConfig.collector.featureFlags.passLoc?navigator.geolocation?navigator.permissions.query({name:"geolocation"}).then(t=>{"granted"===t.state?navigator.geolocation.getCurrentPosition(t=>{this._handleCurrentPosition(t)},t=>{console.error("navigator.geolocation error:",t)},{enableHighAccuracy:!0,timeout:5e3,maximumAge:0}):this.log("navigator.geolocation bypassed:"+t.state)}):this.log("navigator.geolocation unavailable"):this.log("passLoc disabled")}catch(e){this.addError(`${t} error:${e}`)}finally{this.log(`${t} ending...`)}},async _handleCurrentPosition(t){let e="__handleCurrentPosition";try{this.log(`${e} start...`);let o=this.buildUrl({base:this.collectorURL,path:"/cs/location"}),i=Date.now(),s=JSON.stringify({merchant_id:this.kountClientID,session_id:this.sessionID,ddcGroupID:this.kddcgid,collection_timestamp:i,location_data:{collection_timestamp:t.timestamp,latitude:t.coords.latitude,longitude:t.coords.longitude,location_accuracy:t.coords.accuracy,altitude:t.coords.altitude,altitude_accuracy:t.coords.altitudeAccuracy,speed:t.coords.speed,heading:t.coords.heading}}),n=await fetch(o,{method:"POST",body:s,headers:{"Content-Type":"application/json"}});200!=n.status&&this.log(`${e} ${o} had response status:${n.status}`)}catch(t){this.addError(`${e} error:${t}`)}finally{this.log(`${e} ending...`)}},_createIframe(){let t="_createIframe";try{this.log(`${t} running...`);let e="ibody",o=document.getElementById(e);null!==o&&o.remove();let i=this.buildUrl({base:this.collectorURL,path:"/logo.htm",parameters:{m:this.kountClientID,s:this.sessionID,sv:this.KountSDKVersion,kddcgid:this.kddcgid,impl:this.implementationType,repo:this.repositoryLocation}});this.isDebugEnabled&&(i.hash="#console");let s=document.createElement("iframe");if(s.id=e,s.style.border="0px",s.style.height="1px",s.style.width="1px",s.style.position="absolute",s.setAttribute("aria-hidden","true"),s.src=i.toString(),document.getElementsByTagName("body")[0].appendChild(s),void 0!==this.callbacks&&this.callback("collect-begin",{SessionID:this.sessionID,KountClientID:this.kountClientID}),"undefined"!==window.postMessage&&"undefined"!==window.onmessage){let t=t=>{try{if(t.origin!==this.collectorURL)return void this.log(`window.onmessage doesn't handle event origin:[type:${t.type}, origin:${t.origin}]`);if(!t.data)throw Error(`window.onmessage event has missing event.data:[type:${t.type}, origin:${t.origin}]`);let e=JSON.parse(t.data);if(this.isSinglePageApp||"collect-end"!==e.event||this.detach(window,"unload",this.unloadHandler),!e)throw Error(`window.onmessage event has missing data:[type:${t.type}, origin:${t.origin}]`);if(!e.params)throw Error(`window.onmessage event has missing data.params:[type:${t.type}, origin:${t.origin}, data:${t.data}]`);let o={};
1Object.keys(e.params).forEach(t=>{if(Object.prototype.hasOwnProperty.call(e.params,t))switch(t){case"s":o.SessionID=e.params[t];break;case"m":o.KountClientID=e.params[t];break;default:o[t]=e.params[t]}}),this.callback(e.event,o),this.log(`window.onmessage executed for event:[type:${t.type}, origin:${t.origin}, data:${t.data}]`)}catch(t){this.log(`window.onmessage encountered an error: ${t}`)}};window.onmessage=t,this.isSinglePageApp||this.attach(window,"unload",this.unloadHandler)}else window.setTimeout(()=>{this.callback("collect-end",{SessionID:this.sessionID,KountClientID:this.kountClientID})},3e3)}catch(e){this.addError(`${t} error:${e}`)}finally{this.log(`${t} ending...`)}},runCollector(){let t="runCollector";try{this.log(`${t} running...`),this.coordinateFirstPartyCookieValues();let e=(t,e)=>new Promise((o,i)=>{let s=()=>{""!==sessionStorage.getItem(this.FPCV_SESSION_STORAGE_KEY)?(this._passiveLoc(),this._createIframe(),o()):(t-=e)<0?i():setTimeout(s,e)};setTimeout(s,e)});(async()=>{e(2e3,10).then(()=>this.log(`${t}: Collection Initiated`)).catch(()=>this.log(`${t}: Invalid/Missing First Party cookie`))})()}catch(e){this.addError(`${t} error:${e}`)}finally{this.log(`${t} ending...`)}},AttachToForm(t,e=new Map){this.log("AttachToForm running...");let o="kountDecisionPointUUID";this.collectBehaviorData,this.log("AttachToForm: Attaching to form...");let i=document.getElementById(t);if(null!=e&&e.has("CustomFieldName")&&e.get("CustomFieldName").length>0&&(this.log(`AttachToForm: Overriding decisionPointField name to: ${e.get("CustomFieldName")}`),o=e.get("CustomFieldName")),null!=i){if(void 0===i[o]){let t=document.createElement("input");t.setAttribute("type","hidden"),t.setAttribute("name",o),t.setAttribute("value",this.sessionID),i.appendChild(t),this.log(`AttachToForm: Field ${o} NOT found. \
2                    Created and attached to form with value: ${this.sessionID}`)}else this.log(`AttachToForm: Field ${o} found, setting value to: ${this.sessionID}`),i[o].setAttribute("value",this.sessionID);this.log(`AttachToForm: Attached to form successfully using ${this.sessionID} \
3                value in ${o} hidden field.`)}else this.addError(`AttachToForm: FormID: ${t} is not valid. Skipping attachment to form and collection.`)},NewSession(t){void 0===t?this.addError("NewSession: Invalid sessionID.  You must set the 'sessionID' for collection. Disabling Kount SDK"):(this.log(`NewSession: SessionID set to: ${t}`),sessionStorage.clear(),this.sessionID=t,this._communicateLatestSessionData(),this._orchestrate(!0))},log(t){this.isDebugEnabled&&window.console&&window.console.debug&&console.debug(`${this.LOG_PREFIX}${t}`)},addError(t){this.error.push(t),this.log(t)},callback(t,e){if(void 0!==this.callbacks[t]){let o=this.callbacks[t];this.callbacks[t]=void 0,o(e)}},unloadHandler(t){let e={n:"collect-end",com:"false",et:0,s:this.sessionID,m:this.kountClientID};try{this.getXMLHttpRequest("fin","POST").send(e)}catch(t){}},getXMLHttpRequest(t,e){let o=null,i=encodeURIComponent||escape,s=`${this.collectorURL}/${t}`;if(window.XMLHttpRequest){try{o=new window.XMLHttpRequest}catch(t){}"withCredentials"in o?o.open(e,s,!1):void 0!==window.XDomainRequest?(o=new window.XDomainRequest).open(e,s):o=null}else o=null;return{send(t){if(!o)return;o.setRequestHeader("Content-Type","application/x-www-form-urlencoded");let e="";Object.keys(t).forEach(o=>{Object.prototype.hasOwnProperty.call(t,o)&&(e+=`&${i(o)}=${i(t[o])}`)}),e=e.substring(1),o.send(e)}}},buildUrl({base:t,path:e,parameters:o={}}){let i=this.buildParams(o);return new URL(e=0==[...i].length?e:e+"?"+i.toString(),t)},buildParams(t={}){let e=new URLSearchParams;for(let[o,i]of Object.entries(t))e.append(o,i);return e},attach:void 0!==document.addEventListener?function(t,e,o){t.addEventListener(e,o,!1)}:void 0!==document.attachEvent?function(t,e,o){t.attachEvent(`on${e}`,o)}:function(t,e,o){},detach:void 0!==document.removeEventListener?function(t,e,o){t.removeEventListener(e,o,!1)}:void 0!==document.detachEvent?function(t,e,o){t.detach(`on${e}`,o)}:function(t,e,o){}};try{if(o.start(t,e))return o}catch(t){}return null}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.