1import{a as e}from"./csrf-BaHFh0fD.js";function t(e,t){return function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(e,t)?e[t]:void 0}function n(e,t,n,r){let i=document,a=`securitypolicyviolation`,o,s=t=>{let n=new URL(e,location.href),{blockedURI:r}=t;r!==n.href&&r!==n.protocol.slice(0,-1)&&r!==n.origin||(o=t,c())};i.addEventListener(a,s);let c=()=>i.removeEventListener(a,s);return r?.then(c,c),Promise.resolve().then(t).then((e=>(c(),e)),(e=>new Promise((e=>{let t=new MessageChannel;t.port1.onmessage=()=>e(),t.port2.postMessage(null)})).then((()=>{if(c(),o)return n(o);throw e}))))}function r(e){let t=``;for(let n=0;n<e.length;++n)if(n>0){let r=e[n].toLowerCase();r===e[n]?t+=e[n]:t+=` ${r}`}else t+=e[n].toUpperCase();return t}var i={default:`endpoint`},a={default:`tlsEndpoint`},o=`Client timeout`,s=`Network connection error`,c=`Network request aborted`,l=`Response cannot be parsed`,u=`Blocked by CSP`,d=`The endpoint parameter is not a valid URL`,f=`Handle on demand agent data error`,p=r(`WrongRegion`),m=r(`SubscriptionNotActive`),h=r(`UnsupportedVersion`),g=r(`InstallationMethodRestricted`),_=r(`HostnameRestricted`),v=r(`IntegrationFailed`),y=r(`NetworkRestricted`),b=r(`InvalidProxyIntegrationSecret`),x=r(`InvalidProxyIntegrationHeaders`),S=r(`ProxyIntegrationSecretEnvironmentMismatch`),C=`API key required`,w=`API key not found`,T=`API key expired`,E=`Request cannot be parsed`,D=`Request failed`,O=`Request failed to process`,k=`Too many requests, rate limit exceeded`,A=`Not available for this origin`,j=`Not available with restricted header`,M=C,N=w,P=T,F=`3.12.6`,I=`Failed to load the JS script of the agent`,L=`9319`;function R(e,t){let n=[],[r,i]=function(e){let t=function(e){let t=[...e];return{current:()=>t[0],postpone(){let e=t.shift();e!==void 0&&t.push(e)},exclude(){t.shift()}}}(e),n=function(e,t){let n=0;return()=>Math.random()*Math.min(t,e*2**n++)}(100,3e3),r=new Set;return[t.current(),(e,i)=>{let a,o=i instanceof Error?i.message:``;if(o===`Blocked by CSP`||o===`The endpoint parameter is not a valid URL`)t.exclude(),a=0;else if(o===L)t.exclude();else if(o===`Failed to load the JS script of the agent`){let n=Date.now()-e.getTime()<50,i=t.current();i&&n&&!r.has(i)&&(r.add(i),a=0),t.postpone()}else t.postpone();let s=t.current();return s===void 0?void 0:[s,a??e.getTime()+n()-Date.now()]}]}(e),a;if(r===void 0)return Promise.reject(TypeError(`The list of script URL patterns is empty`));let o=e=>{let r=new Date,s=t=>n.push({url:e,startedAt:r,finishedAt:new Date,error:t}),c=t(e);return c.then((()=>s()),s),c.catch((e=>{if(a??=e,n.length>=5)throw a;let t=i(r,e);if(!t)throw a;let[s,c]=t;return(l=c,new Promise((e=>setTimeout(e,l)))).then((()=>o(s)));var l}))};return o(r).then((e=>[e,n]))}var z=`https://fpnpmcdn.net/v<version>/<apiKey>/loader_v<loaderVersion>.js`,B=z;function V(e){let{picked:n,rest:r}=function(e,t){let n={},r={};for(let[i,a]of Object.entries(e))t.includes(i)?n[i]=a:r[i]=a;return{picked:n,rest:r}}(e,[`scriptUrlPattern`,`token`,`apiKey`]),i=n.token,a=n.apiKey??i,o=t(e,`scriptUrlPattern`)??z,[s,c]=function(){let e=[],t=()=>{e.push({time:new Date,state:document.visibilityState})},n=function(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}(document,`visibilitychange`,t);return t(),[e,n]}();return Promise.resolve().then((()=>
1{if(!a||typeof a!=`string`)throw Error(C);return R(function(e,t){return(Array.isArray(e)?e:[e]).map((e=>function(e,t){let n=encodeURIComponent;return e.replace(/<[^<>]+>/g,(e=>e===`<version>`?`3`:e===`<apiKey>`?n(t):e===`<loaderVersion>`?n(F):e))}(String(e),t)))}(o,a),H)})).catch((e=>{throw c(),function(e){return e instanceof Error&&e.message===L?Error(I):e}(e)})).then((([e,t])=>(c(),e.load({...r,ldi:{attempts:t,visibilityStates:s}}))))}function H(e){return n(e,(()=>function(e){return new Promise(((t,n)=>{if(function(e){if(URL.prototype)try{return new URL(e,location.href),!1}catch(e){if(e instanceof Error&&e.name===`TypeError`)return!0;throw e}}(e))throw Error(d);let r=document.createElement(`script`),i=()=>r.parentNode?.removeChild(r),a=document.head||document.getElementsByTagName(`head`)[0];r.onload=()=>{i(),t()},r.onerror=()=>{i(),n(Error(I))},r.async=!0,r.src=e,a.appendChild(r)}))}(e)),(()=>{throw Error(u)})).then(U)}function U(){let e=window,t=`__fpjs_p_l_b`,n=e[t];if(function(e,t){let n=Object.getOwnPropertyDescriptor?.call(Object,e,t);n?.configurable?delete e[t]:n&&!n.writable||(e[t]=void 0)}(e,t),typeof n?.load!=`function`)throw Error(L);return n}var W={load:V,defaultScriptUrlPattern:B,ERROR_SCRIPT_LOAD_FAIL:I,ERROR_API_KEY_EXPIRED:T,ERROR_API_KEY_INVALID:w,ERROR_API_KEY_MISSING:C,ERROR_BAD_REQUEST_FORMAT:E,ERROR_BAD_RESPONSE_FORMAT:l,ERROR_CLIENT_TIMEOUT:o,ERROR_CSP_BLOCK:u,ERROR_FORBIDDEN_ENDPOINT:_,ERROR_FORBIDDEN_HEADER:j,ERROR_FORBIDDEN_ORIGIN:A,ERROR_GENERAL_SERVER_FAILURE:D,ERROR_HANDLE_AGENT_DATA:f,ERROR_INSTALLATION_METHOD_RESTRICTED:g,ERROR_INTEGRATION_FAILURE:v,ERROR_INVALID_ENDPOINT:d,ERROR_INVALID_PROXY_INTEGRATION_HEADERS:x,ERROR_INVALID_PROXY_INTEGRATION_SECRET:b,ERROR_NETWORK_ABORT:c,ERROR_NETWORK_CONNECTION:s,ERROR_NETWORK_RESTRICTED:y,ERROR_PROXY_INTEGRATION_SECRET_ENVIRONMENT_MISMATCH:S,ERROR_RATE_LIMIT:k,ERROR_SERVER_TIMEOUT:O,ERROR_SUBSCRIPTION_NOT_ACTIVE:m,ERROR_TOKEN_EXPIRED:P,ERROR_TOKEN_INVALID:N,ERROR_TOKEN_MISSING:M,ERROR_UNSUPPORTED_VERSION:h,ERROR_WRONG_REGION:p,defaultEndpoint:i,defaultTlsEndpoint:a},G=`fp_simplero_v1`,K=async()=>{try{let e=localStorage.getItem(G);
1if(!e){let t=await(await W.load({apiKey:`wk95f63YZiTPf7b8JuPW`})).get();e=JSON.stringify(t),localStorage.setItem(G,e)}let t=JSON.parse(e);return t.confidence.score>.8?t.visitorId:null}catch(e){return console.error(`error getting fingerprint`,e),null}},q=[`click`,`scroll`,`mousemove`,`touchstart`],J=e=>{let t=!1,n=()=>{t||(t=!0,e())};q.forEach(e=>{window.addEventListener(e,n,{once:!0,passive:!0})})},Y=`actor_id`,X=`/actors`,Z=`/events`;new class{constructor(e=null,t=null,n=null,r=null){this.url=e,this.signedUserId=t,this.signedCustomerId=n,this.signedSessionId=r,this.fingerprint=null,this.actorIdKey=[Y,t,n,r].join(`_`),this.sessionStartTime=null,this.totalActiveTime=0,this.trackedAssetPlayStarts=new Set,this.assetPlayTracking=new Map}async init(){this.actorId=localStorage.getItem(this.actorIdKey),this.actorId?this.startTracking():J(()=>this.resolveActorThenTrack())}async resolveActorThenTrack(){this.actorId=await this.getActorIdFromServer(),this.actorId&&(localStorage.setItem(this.actorIdKey,this.actorId),this.startTracking())}startTracking(){this.initPageView(),this.initClickTracking(),this.initSessionTracking(),this.initPopupTracking(),this.initPageScrollTracking(),this.initInputTracking(),this.initAssetPlayTracking()}async getActorIdFromServer(){try{this.fingerprint=await K();let t=await fetch(this.urlFor(X),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({...e(),signed_user_id:this.signedUserId,signed_customer_id:this.signedCustomerId,signed_session_id:this.signedSessionId,fingerprint:this.fingerprint})});return t.ok&&(await t.json()).actor_id||null}catch{return null}}async sendEvent(e,t){try{let n=this.getBuilderDocData(),r=n.object_type||document.body.dataset.objectType,i=n.object_id||document.body.dataset.objectId,a=n.funnel_step_id||document.body.dataset.funnelStepId,o={...t,...n.payload,...window.metrics.dimensions||{},client_context:this.collectClientContext()},s=JSON.stringify({actor_id:this.actorId,event:e,payload:o,url:window.location.href,object_type:r,object_id:i,funnel_step_id:a,timestamp_epoch:Math.floor(Date.now()/1e3)});if(navigator.sendBeacon){let e=new Blob([s],{type:`application/json`});if(navigator.sendBeacon(this.urlFor(Z),e))return}await fetch(this.urlFor(Z),{method:`POST`,headers:{"Content-Type":`application/json`},body:s})}catch(e){console.error(e)}}getBuilderDocData(){let e=document.querySelector(`.builder-doc-wrapper[data-builder-doc-version-id]`);return e?{object_id:e.dataset.objectId,object_type:e.dataset.objectType,funnel_step_id:e.dataset.funnelStepId,payload:{builder_doc_version_id:e.dataset.builderDocVersionId}}:{}}async initPageView(){let e={referrer:document.referrer,title:document.title};this.sendEvent(`page_view`,e)}async initClickTracking(){document.addEventListener(`click`,e=>{let t=e.target.closest(`[data-metrics], input[type="submit"], button[type="submit"]`)||e.target;if(!t)return;let n={...this.getNodeInfo(t),page_x:e.pageX,page_y:e.pageY};this.sendEvent(`click`,n)},{capture:!0})}getNodeInfo(e){return{label:e.innerText||null,id:e.id||null,name:e.name||null,type:e.type||null,css_selector:this.getCSSSelector(e),node_id:e.closest(`.builder-node`)?.id}}async initSessionTracking(){document.hidden||this.startSessionTimer(),document.addEventListener(`visibilitychange`,()=>{document.hidden?this.pauseSessionTimer():this.startSessionTimer()}),window.addEventListener(`beforeunload`,()=>{this.pauseSessionTimer(),this.sendEvent(`session`,{duration:this.totalActiveTime})})}startSessionTimer(){this.sessionStartTime||=Date.now()}pauseSessionTimer(){if(this.sessionStartTime){let e=(Date.now()-this.sessionStartTime)/1e3;this.totalActiveTime+=e,this.sessionStartTime=null}}async initPopupTracking(){let e=document.querySelector(`.js-builder-node.builder-popup.js-modal`);e&&(e.addEventListener(`modal:show`,()=>{this.sendEvent(`popup_open`)}),e.addEventListener(`modal:hidden`,()=>{this.sendEvent(`popup_close`)}))}async initPageScrollTracking(){let e=0;document.addEventListener(`scroll`,()=>{let t=(window.pageYOffset||document.documentElement.scrollTop)/(document.documentElement.scrollHeight-document.documentElement.clientHeight)*100,n=Math.round(t/10)*10;t>=n&&n>e&&(this.sendEvent(`page_scroll`,{percentage:n}),e=n)})}async initInputTracking(){document.addEventListener(`input`,e=>{this.sendEvent(`input`,this.getNodeInfo(e.target))},{once:!0})}async initAssetPlayTracking(){document.addEventListener(`simplero:asset:play:start`,e=>{let t=e.detail.asset_id;this.assetPlayTracking.set(t,{time:e.detail.time,epoch:Math.floor(Date.now()/1e3)}),this.trackedAssetPlayStarts.has(t)||(this.trackedAssetPlayStarts.add(t),this.sendEvent(`asset_play_start`,{asset_id:t,start_epoch:Math.floor(Date.now()/1e3)}))},{capture:!0}),document.addEventListener(`simplero:asset:play:end`,e=>{let t=e.detail.asset_id,n=this.assetPlayTracking.get(t);if(!n){console.error(`simplero:asset:play:end event without play event`,e,n);return}let r=e.detail.time;r??=n.lastKnownTime,this.#e({asset_id:t,start_second:n.time,end_second:r,start_epoch:n.epoch,end_epoch:Math.floor(Date.now()/1e3)}),this.assetPlayTracking.delete(t)},{capture:!0}),document.addEventListener(`simplero:asset:play:timeupdate`,e=>{let t=e.detail.asset_id,n=e.detail.time,r=this.assetPlayTracking.get(t);r&&(r.lastKnownTime=n)},{capture:!0}),window.addEventListener(`beforeunload`,()=>{for(let[e,t]of this.assetPlayTracking.entries())t.lastKnownTime!==void 0&&this.#e({asset_id:e,start_second:t.t
1ime,end_second:t.lastKnownTime,start_epoch:t.epoch,end_epoch:Math.floor(Date.now()/1e3)})})}#e(e){e.start_second===void 0||e.end_second===void 0||e.start_second===null||e.end_second===null||e.end_second-e.start_second<.3||this.sendEvent(`asset_play`,e)}urlFor(e){return`${this.url}${e}`}collectClientContext(){let e={viewport:{width:window.innerWidth,height:window.innerHeight},screen:{width:screen.width,height:screen.height},browser:{language:navigator.language,user_agent:navigator.userAgent,cookie_enabled:navigator.cookieEnabled,do_not_track:navigator.doNotTrack},locale:{timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,locale:Intl.DateTimeFormat().resolvedOptions().locale}},t=new URLSearchParams(window.location.search),n={};for(let[e,r]of t.entries())(e.startsWith(`utm_`)||e.startsWith(`gclid`)||e.startsWith(`fbclid`))&&(n[e]=r);return Object.keys(n).length>0&&(e.utm=n),e.media={is_mobile:window.matchMedia(`(max-width: 768px)`).matches,is_tablet:window.matchMedia(`(min-width: 769px) and (max-width: 1024px)`).matches,is_desktop:window.matchMedia(`(min-width: 1025px)`).matches,is_touch:`ontouchstart`in window||navigator.maxTouchPoints>0},e}getCSSSelector(e){if(e.id)return`#${e.id}`;let t=[];for(;e.nodeType===Node.ELEMENT_NODE;){let n=e.tagName.toLowerCase();e.className&&(n+=`.`+e.className.trim().split(/\s+/).join(`.`));let r=1,i=e.previousSibling;for(;i;)i.nodeType===Node.ELEMENT_NODE&&i.tagName===e.tagName&&r++,i=i.previousSibling;r!==1&&(n+=`:nth-of-type(${r})`),t.unshift(n),e=e.parentNode}return t.join(` > `)}}(window.metrics.url,window.metrics.signed_user_id,window.metrics.signed_customer_id,window.metrics.signed_session_id).init(); 2//# sourceMappingURL=metrics-CyrBOaEn.js.map
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.