1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/startRecording-DXv-b9EQ.js","assets/custom-element-hzWv1yaB.js","assets/profiler-BP8ijunQ.js"])))=>i.map(i=>d[i]); 2var pl=Object.defineProperty;var ds=e=>{throw TypeError(e)};var gl=(e,t,n)=>t in e?pl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var w=(e,t,n)=>gl(e,typeof t!="symbol"?t+"":t,n),Yr=(e,t,n)=>t.has(e)||ds("Cannot "+n);var R=(e,t,n)=>(Yr(e,t,"read from private field"),n?n.call(e):t.get(e)),P=(e,t,n)=>t.has(e)?ds("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),V=(e,t,n,r)=>(Yr(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),C=(e,t,n)=>(Yr(e,t,"access private method"),n);import{a as bl,i as xi,x as vl,t as po}from"./custom-element-hzWv1yaB.js";/*! 3Turbo 8.0.13 4Copyright © 2025 37signals LLC 5 */(function(e){if(typeof e.requestSubmit=="function")return;e.requestSubmit=function(r){r?(t(r,this),r.click()):(r=document.createElement("input"),r.type="submit",r.hidden=!0,this.appendChild(r),r.click(),this.removeChild(r))};function t(r,i){r instanceof HTMLElement||n(TypeError,"parameter 1 is not of type 'HTMLElement'"),r.type=="submit"||n(TypeError,"The specified element is not a submit button"),r.form==i||n(DOMException,"The specified element is not owned by this form element","NotFoundError")}function n(r,i,s){throw new r("Failed to execute 'requestSubmit' on 'HTMLFormElement': "+i+".",s)}})(HTMLFormElement.prototype);const go=new WeakMap;function yl(e){const t=e instanceof Element?e:e instanceof Node?e.parentElement:null,n=t?t.closest("input, button"):null;return(n==null?void 0:n.type)=="submit"?n:null}function El(e){const t=yl(e.target);t&&t.form&&go.set(t.form,t)}(function(){if("submitter"in Event.prototype)return;let e=window.Event.prototype;if("SubmitEvent"in window){const t=window.SubmitEvent.prototype;if(/Apple Computer/.test(navigator.vendor)&&!("submitter"in t))e=t;else return}addEventListener("click",El,!0),Object.defineProperty(e,"submitter",{get(){if(this.type=="submit"&&this.target instanceof HTMLFormElement)return go.get(this.target)}})})();const ot={eager:"eager",lazy:"lazy"},vr=class vr extends HTMLElement{constructor(){super();w(this,"loaded",Promise.resolve());this.delegate=new vr.delegateConstructor(this)}static get observedAttributes(){return["disabled","loading","src"]}connectedCallback(){this.delegate.connect()}disconnectedCallback(){this.delegate.disconnect()}reload(){return this.delegate.sourceURLReloaded()}attributeChangedCallback(n){n=="loading"?this.delegate.loadingStyleChanged():n=="src"?this.delegate.sourceURLChanged():n=="disabled"&&this.delegate.disabledChanged()}get src(){return this.getAttribute("src")}set src(n){n?this.setAttribute("src",n):this.removeAttribute("src")}get refresh(){return this.getAttribute("refresh")}set refresh(n){n?this.setAttribute("refresh",n):this.removeAttribute("refresh")}get shouldReloadWithMorph(){return this.src&&this.refresh==="morph"}get loading(){return Sl(this.getAttribute("loading")||"")}set loading(n){n?this.setAttribute("loading",n):this.removeAttribute("loading")}get disabled(){return this.hasAttribute("disabled")}set disabled(n){n?this.setAttribute("disabled",""):this.removeAttribute("disabled")}get autoscroll(){return this.hasAttribute("autoscroll")}set autoscroll(n){n?this.setAttribute("autoscroll",""):this.removeAttribute("autoscroll")}get complete(){return!this.delegate.isLoading}get isActive(){return this.ownerDocument===document&&!this.isPreview}get isPreview(){var n,r;return(r=(n=this.ownerDocument)==null?void 0:n.documentElement)==null?void 0:r.hasAttribute("data-turbo-preview")}};w(vr,"delegateConstructor");let ve=vr;function Sl(e){switch(e.toLowerCase()){case"lazy":return ot.lazy;default:return ot.eager}}const _l={enabled:!0,progressBarDelay:500,unvisitableExtensions:new Set([".7z",".aac",".apk",".avi",".bmp",".bz2",".css",".csv",".deb",".dmg",".doc",".docx",".exe",".gif",".gz",".heic",".heif",".ico",".iso",".jpeg",".jpg",".js",".json",".m4a",".mkv",".mov",".mp3",".mp4",".mpeg",".mpg",".msi",".ogg",".ogv",".pdf",".pkg",".png",".ppt",".pptx",".rar",".rtf",".svg",".tar",".tif",".tiff",".txt",".wav",".webm",".webp",".wma",".wmv",".xls",".xlsx",".xml",".zip"])};function gn(e){if(e.getAttribute("data-turbo-eval")=="false")return e;{const t=document.createElement("script"),n=_o();return n&&(t.nonce=n),t.textContent=e.textContent,t.async=!1,wl(t,e),t}}function wl(e,t){for(const{name:n,value:r}of t.attributes)e.setAttribute(n,r)}function Tl(e){const t=document.createElement("template");return t.innerHTML=e,t.content}function z(e,{target:t,cancelable:n,detail:r}={}){const i=new CustomEvent(e,{cancelable:n,bubbles:!0,composed:!0,detail:r});return t&&t.isConnected?t.dispatchEvent(i):document.documentElement.dispatchEvent(i),i}function hs(e){e.preventDefault(),e.stopImmediatePropagation()}function dn(){return document.visibilityState==="hidden"?vo():bo()}function bo(){return new Promise(e=>requestAnimationFrame(()=>e()))}function vo(){return new Promise(e=>setTimeout(()=>e(),0))}function Al(){return Promise.resolve()}function yo(e=""){return new DOMParser().parseFromString(e,"text/html")}function Eo(e,...t){const n=Rl(e,t).replace(/^\n/,"").split(` 6`),r=n[0].match(/^\s+/),i=r?r[0].length:0;return n.map(s=>s.slice(i)).join(` 7`)}function Rl(e,t){return e.reduce((n,r,i)=>{const s=t[i]==null?"":t[i];return n+r+s},"")}function je(){return Array.from({length:36}).map((e,t)=>t==8||t==13||t==18||t==23?"-":t==14?"4":t==19?(Math.floor(Math.random()*4)+8).toString(16):Math.floor(Math.random()*15).toString(16)).join("")}function cr(e,...t){for(const n of t.map(r=>r==null?void 0:r.getAttribute(e)))if(typeof n=="string")return n;return null}function Cl(e,...t){return t.some(n=>n&&n.hasAttribute(e))}function lr(...e){for(const t of e)t.localName=="turbo-frame"&&t.setAttribute("busy",""),t.setAttribute("aria-busy","true")}function ur(...e){for(const t of e)t.localName=="turbo-frame"&&t.removeAttribute("busy"),t.removeAttribute("aria-busy")}function Il(e,t=2e3){return new Promise(n=>{const r=()=>{e.removeEventListener("error",r),e.removeEventListener("load",r),n()};e.addEventListener("load",r,{once:!0}),e.addEventListener("error",r,{once:!0}),setTimeout(n,t)})}function So(e){switch(e){case"replace":return history.replaceState;case"advance":case"restore":return history.pushState}}function kl(e){return e=="advance"||e=="replace"||e=="restore"}function dt(...e){const t=cr("data-turbo-action",...e);return kl(t)?t:null}function Ni(e){return document.querySelector(`meta[name="${e}"]`)}function dr(e){const t=Ni(e);return t&&t.content}function _o(){const e=Ni("csp-nonce");if(e){const{nonce:t,content:n}=e;return t==""?n:t}}function Ll(e,t){let n=Ni(e);return n||(n=document.createElement("meta"),n.setAttribute("name",e),document.head.appendChild(n)),n.setAttribute("content",t),n}function xt(e,t){var n;if(e instanceof Element)return e.closest(t)||xt(e.assignedSlot||((n=e.getRootNode())==null?void 0:n.host),t)}function Pi(e){return!!e&&e.closest("[inert], :disabled, [hidden], details:not([open]), dialog:not([open])")==null&&typeof e.focus=="function"}function wo(e){return Array.from(e.querySelectorAll("[autofocus]")).find(Pi)}async function Ol(e,t){const n=t();e(),await bo();const r=t();return[n,r]}function To(e){if(e==="_blank")return!1;if(e){for(const t of document.getElementsByName(e))if(t instanceof HTMLIFrameElement)return!1;return!0}else return!0}function Ao(e){return xt(e,"a[href]:not([target^=_]):not([download])")}function Ro(e){return Z(e.getAttribute("href")||"")}function Ml(e,t){let n=null;return(...r)=>{const i=()=>e.apply(this,r);clearTimeout(n),n=setTimeout(i,t)}}const xl={"aria-disabled":{beforeSubmit:e=>{e.setAttribute("aria-disabled","true"),e.addEventListener("click",hs)},afterSubmit:e=>{e.removeAttribute("aria-disabled"),e.removeEventListener("click",hs)}},disabled:{beforeSubmit:e=>e.disabled=!0,afterSubmit:e=>e.disabled=!1}};var _n;class Nl{constructor(t){P(this,_n,null);Object.assign(this,t)}get submitter(){return R(this,_n)}set submitter(t){V(this,_n,xl[t]||t)}}_n=new WeakMap;const Pl=new Nl({mode:"on",submitter:"disabled"}),K={drive:_l,forms:Pl};function Z(e){return new URL(e.toString(),document.baseURI)}function ht(e){let t;if(e.hash)return e.hash.slice(1);if(t=e.href.match(/#(.*)$/))return t[1]}function Di(e,t){const n=(t==null?void 0:t.getAttribute("formaction"))||e.getAttribute("action")||e.action;return Z(n)}function Dl(e){return(Bl(e).match(/\.[^.]*$/)||[])[0]||""}function Fl(e,t){const n=ql(t);return e.href===Z(n).href||e.href.startsWith(n)}function Ue(e,t){return Fl(e,t)&&!K.drive.unvisitableExtensions.has(Dl(e))}function vi(e){const t=ht(e);return t!=null?e.href.slice(0,-(t.length+1)):e.href}function Wn(e){return vi(e)}function Vl(e,t){return Z(e).href==Z(t).href}function Ul(e){return e.pathname.split("/").slice(1)}function Bl(e){return Ul(e).slice(-1)[0]}function ql(e){return Hl(e.origin+e.pathname)}function Hl(e){return e.endsWith("/")?e:e+"/"}class Sr{constructor(t){this.response=t}get succeeded(){return this.response.ok}get failed(){return!this.succeeded}get clientError(){return this.statusCode>=400&&this.statusCode<=499}get serverError(){return this.statusCode>=500&&this.statusCode<=599}get redirected(){return this.response.redirected}get location(){return Z(this.response.url)}get isHTML(){return this.contentType&&this.contentType.match(/^(?:text\/([^\s;,]+\b)?html|application\/xhtml\+xml)\b/)}get statusCode(){return this.response.status}get contentType(){return this.header("Content-Type")}get responseText(){return this.response.clone().text()}get responseHTML(){return this.isHTML?this.response.clone().text():Promise.resolve(void 0)}header(t){return this.response.headers.get(t)}}class zl extends Set{constructor(t){super(),this.maxSize=t}add(t){if(this.size>=this.maxSize){const r=this.values().next().value;this.delete(r)}super.add(t)}}const Co=new zl(20),$l=window.fetch;function Fi(e,t={}){const n=new Headers(t.headers||{}),r=je();return Co.add(r),n.append("X-Turbo-Request-Id",r),$l(e,{...t,headers:n})}function _r(e){switch(e.toLowerCase()){case"get":return ue.get;case"post":return ue.post;case"put":return ue.put;case"patch":return ue.patch;case"delete":return ue.delete}}const ue={get:"get",post:"post",put:"put",patch:"patch",delete:"delete"};function Io(e){switch(e.toLowerCase()){case Be.multipart:return Be.multipart;case Be.plain:return Be.plain;default:return Be.urlEncoded}}const Be={urlEncoded:"application/x-www-form-urlencoded",multipart:"multipart/form-data",plain:"text/plain"};var wn,Kt,ko,Lo;class Zt{constructor(t,n,r,i=new URLSearchParams,s=null,o=Be.urlEncoded){P(this,Kt);w(this,"abortController",new AbortController);P(this,wn,t=>{});var l;const[a,c]=fs(Z(r),n,i,o);this.delegate=t,this.url=a,this.target=s,this.fetchOptions={credentials:"same-origin",redirect:"follow",method:n.toUpperCase(),headers:{...this.defaultHeaders}
7,body:c,signal:this.abortSignal,referrer:(l=this.delegate.referrer)==null?void 0:l.href},this.enctype=o}get method(){return this.fetchOptions.method}set method(t){const n=this.isSafe?this.url.searchParams:this.fetchOptions.body||new FormData,r=_r(t)||ue.get;this.url.search="";const[i,s]=fs(this.url,r,n,this.enctype);this.url=i,this.fetchOptions.body=s,this.fetchOptions.method=r.toUpperCase()}get headers(){return this.fetchOptions.headers}set headers(t){this.fetchOptions.headers=t}get body(){return this.isSafe?this.url.searchParams:this.fetchOptions.body}set body(t){this.fetchOptions.body=t}get location(){return this.url}get params(){return this.url.searchParams}get entries(){return this.body?Array.from(this.body.entries()):[]}cancel(){this.abortController.abort()}async perform(){const{fetchOptions:t}=this;this.delegate.prepareRequest(this);const n=await C(this,Kt,ko).call(this,t);try{this.delegate.requestStarted(this),n.detail.fetchRequest?this.response=n.detail.fetchRequest.response:this.response=Fi(this.url.href,t);const r=await this.response;return await this.receive(r)}catch(r){if(r.name!=="AbortError")throw C(this,Kt,Lo).call(this,r)&&this.delegate.requestErrored(this,r),r}finally{this.delegate.requestFinished(this)}}async receive(t){const n=new Sr(t);return z("turbo:before-fetch-response",{cancelable:!0,detail:{fetchResponse:n},target:this.target}).defaultPrevented?this.delegate.requestPreventedHandlingResponse(this,n):n.succeeded?this.delegate.requestSucceededWithResponse(this,n):this.delegate.requestFailedWithResponse(this,n),n}get defaultHeaders(){return{Accept:"text/html, application/xhtml+xml"}}get isSafe(){return wr(this.method)}get abortSignal(){return this.abortController.signal}acceptResponseType(t){this.headers.Accept=[t,this.headers.Accept].join(", ")}}wn=new WeakMap,Kt=new WeakSet,ko=async function(t){const n=new Promise(i=>V(this,wn,i)),r=z("turbo:before-fetch-request",{cancelable:!0,detail:{fetchOptions:t,url:this.url,resume:R(this,wn)},target:this.target});return this.url=r.detail.url,r.defaultPrevented&&await n,r},Lo=function(t){return!z("turbo:fetch-request-error",{target:this.target,cancelable:!0,detail:{request:this,error:t}}).defaultPrevented};function wr(e){return _r(e)==ue.get}function fs(e,t,n,r){const i=Array.from(n).length>0?new URLSearchParams(Oo(n)):e.searchParams;return wr(t)?[Wl(e,i),null]:r==Be.urlEncoded?[e,i]:[e,n]}function Oo(e){const t=[];for(const[n,r]of e)r instanceof File||t.push([n,r]);return t}function Wl(e,t){const n=new URLSearchParams(Oo(t));return e.search=n.toString(),e}class Gl{constructor(t,n){w(this,"started",!1);w(this,"intersect",t=>{const n=t.slice(-1)[0];n!=null&&n.isIntersecting&&this.delegate.elementAppearedInViewport(this.element)});this.delegate=t,this.element=n,this.intersectionObserver=new IntersectionObserver(this.intersect)}start(){this.started||(this.started=!0,this.intersectionObserver.observe(this.element))}stop(){this.started&&(this.started=!1,this.intersectionObserver.unobserve(this.element))}}class mt{static wrap(t){return typeof t=="string"?new this(Tl(t)):t}constructor(t){this.fragment=jl(t)}}w(mt,"contentType","text/vnd.turbo-stream.html");function jl(e){for(const t of e.querySelectorAll("turbo-stream")){const n=document.importNode(t,!0);for(const r of n.templateElement.content.querySelectorAll("script"))r.replaceWith(gn(r));t.replaceWith(n)}return e}const Kl=100;var lt,ke;class Yl{constructor(){P(this,lt,null);P(this,ke,null)}get(t){if(R(this,ke)&&R(this,ke).url===t&&R(this,ke).expire>Date.now())return R(this,ke).request}setLater(t,n,r){this.clear(),V(this,lt,setTimeout(()=>{n.perform(),this.set(t,n,r),V(this,lt,null)},Kl))}set(t,n,r){V(this,ke,{url:t,request:n,expire:new Date(new Date().getTime()+r)})}clear(){R(this,lt)&&clearTimeout(R(this,lt)),V(this,ke,null)}}lt=new WeakMap,ke=new WeakMap;const Xl=10*1e3,kt=new Yl,Et={initialized:"initialized",requesting:"requesting",waiting:"waiting",receiving:"receiving",stopping:"stopping",stopped:"stopped"};class Tr{constructor(t,n,r,i=!1){w(this,"state",Et.initialized);const s=nu(n,r),o=tu(eu(n,r),s),a=Zl(n,r),c=ru(n,r);this.delegate=t,this.formElement=n,this.submitter=r,this.fetchRequest=new Zt(this,s,o,a,n,c),this.mustRedirect=i}static confirmMethod(t){return Promise.resolve(confirm(t))}get method(){return this.fetchRequest.method}set method(t){this.fetchRequest.method=t}get action(){return this.fetchRequest.url.toString()}set action(t){this.fetchRequest.url=Z(t)}get body(){return this.fetchRequest.body}get enctype(){return this.fetchRequest.enctype}get isSafe(){return this.fetchRequest.isSafe}get location(){return this.fetchRequest.url}async start(){const{initialized:t,requesting:n}=Et,r=cr("data-turbo-confirm",this.submitter,this.formElement);if(!(typeof r=="string"&&!await(typeof K.forms.confirm=="function"?K.forms.confirm:Tr.confirmMethod)(r,this.formElement,this.submitter))&&this.state==t)return this.state=n,this.fetchRequest.perform()}stop(){const{stopping:t,stopped:n}=Et;if(this.state!=t&&this.state!=n)return this.state=t,this.fetchRequest.cancel(),!0}
7prepareRequest(t){if(!t.isSafe){const n=Jl(dr("csrf-param"))||dr("csrf-token");n&&(t.headers["X-CSRF-Token"]=n)}this.requestAcceptsTurboStreamResponse(t)&&t.acceptResponseType(mt.contentType)}requestStarted(t){this.state=Et.waiting,this.submitter&&K.forms.submitter.beforeSubmit(this.submitter),this.setSubmitsWith(),lr(this.formElement),z("turbo:submit-start",{target:this.formElement,detail:{formSubmission:this}}),this.delegate.formSubmissionStarted(this)}requestPreventedHandlingResponse(t,n){kt.clear(),this.result={success:n.succeeded,fetchResponse:n}}requestSucceededWithResponse(t,n){if(n.clientError||n.serverError){this.delegate.formSubmissionFailedWithResponse(this,n);return}if(kt.clear(),this.requestMustRedirect(t)&&Ql(n)){const r=new Error("Form responses must redirect to another location");this.delegate.formSubmissionErrored(this,r)}else this.state=Et.receiving,this.result={success:!0,fetchResponse:n},this.delegate.formSubmissionSucceededWithResponse(this,n)}requestFailedWithResponse(t,n){this.result={success:!1,fetchResponse:n},this.delegate.formSubmissionFailedWithResponse(this,n)}requestErrored(t,n){this.result={success:!1,error:n},this.delegate.formSubmissionErrored(this,n)}requestFinished(t){this.state=Et.stopped,this.submitter&&K.forms.submitter.afterSubmit(this.submitter),this.resetSubmitterText(),ur(this.formElement),z("turbo:submit-end",{target:this.formElement,detail:{formSubmission:this,...this.result}}),this.delegate.formSubmissionFinished(this)}setSubmitsWith(){if(!(!this.submitter||!this.submitsWith)){if(this.submitter.matches("button"))this.originalSubmitText=this.submitter.innerHTML,this.submitter.innerHTML=this.submitsWith;else if(this.submitter.matches("input")){const t=this.submitter;this.originalSubmitText=t.value,t.value=this.submitsWith}}}resetSubmitterText(){if(!(!this.submitter||!this.originalSubmitText)){if(this.submitter.matches("button"))this.submitter.innerHTML=this.originalSubmitText;else if(this.submitter.matches("input")){const t=this.submitter;t.value=this.originalSubmitText}}}requestMustRedirect(t){return!t.isSafe&&this.mustRedirect}requestAcceptsTurboStreamResponse(t){return!t.isSafe||Cl("data-turbo-stream",this.submitter,this.formElement)}get submitsWith(){var t;return(t=this.submitter)==null?void 0:t.getAttribute("data-turbo-submits-with")}}function Zl(e,t){const n=new FormData(e),r=t==null?void 0:t.getAttribute("name"),i=t==null?void 0:t.getAttribute("value");return r&&n.append(r,i||""),n}function Jl(e){if(e!=null){const n=(document.cookie?document.cookie.split("; "):[]).find(r=>r.startsWith(e));if(n){const r=n.split("=").slice(1).join("=");return r?decodeURIComponent(r):void 0}}}function Ql(e){return e.statusCode==200&&!e.redirected}function eu(e,t){const n=typeof e.action=="string"?e.action:null;return t!=null&&t.hasAttribute("formaction")?t.getAttribute("formaction")||"":e.getAttribute("action")||n||""}function tu(e,t){const n=Z(e);return wr(t)&&(n.search=""),n}function nu(e,t){const n=(t==null?void 0:t.getAttribute("formmethod"))||e.getAttribute("method")||"";return _r(n.toLowerCase())||ue.get}function ru(e,t){return Io((t==null?void 0:t.getAttribute("formenctype"))||e.enctype)}class Ar{constructor(t){this.element=t}get activeElement(){return this.element.ownerDocument.activeElement}get children(){return[...this.element.children]}hasAnchor(t){return this.getElementForAnchor(t)!=null}getElementForAnchor(t){return t?this.element.querySelector(`[id='${t}'], a[name='${t}']`):null}get isConnected(){return this.element.isConnected}get firstAutofocusableElement(){return wo(this.element)}get permanentElements(){return xo(this.element)}getPermanentElementById(t){return Mo(this.element,t)}getPermanentElementMapForSnapshot(t){const n={};for(const r of this.permanentElements){const{id:i}=r,s=t.getPermanentElementById(i);s&&(n[i]=[r,s])}return n}}function Mo(e,t){return e.querySelector(`#${t}[data-turbo-permanent]`)}function xo(e){return e.querySelectorAll("[id][data-turbo-permanent]")}class Vi{constructor(t,n){w(this,"started",!1);w(this,"submitCaptured",()=>{this.eventTarget.removeEventListener("submit",this.submitBubbled,!1),this.eventTarget.addEventListener("submit",this.submitBubbled,!1)});w(this,"submitBubbled",t=>{if(!t.defaultPrevented){const n=t.target instanceof HTMLFormElement?t.target:void 0,r=t.submitter||void 0;n&&iu(n,r)&&su(n,r)&&this.delegate.willSubmitForm(n,r)&&(t.preventDefault(),t.stopImmediatePropagation(),this.delegate.formSubmitted(n,r))}});this.delegate=t,this.eventTarget=n}start(){this.started||(this.eventTarget.addEventListener("submit",this.submitCaptured,!0),this.started=!0)}stop(){this.started&&(this.eventTarget.removeEventListener("submit",this.submitCaptured,!0),this.started=!1)}}function iu(e,t){return((t==null?void 0:t.getAttribute("formmethod"))||e.getAttribute("method"))!="dialog"}function su(e,t){const n=(t==null?void 0:t.getAttribute("formtarget"))||e.getAttribute("target");return To(n)}var Tn,An;class No{constructor(t,n){P(this,Tn,t=>{});P(this,An,t=>{});this.delegate=t,this.element=n}scrollToAnchor(t){const n=this.snapshot.getElementForAnchor(t);n?(this.scrollToElement(n),this.focusElement(n)):this.scrollToPosition({x:0,y:0})}scrollToAnchorFromLocation(t){this.scrollToAnchor(ht(t))}scrollToElement(t){t.scrollIntoView()}focusElement(t){t instanceof HTMLElement&&(t.hasAttribute("tabindex")?t.focus():(t.setAttribute("tabindex","-1"),t.focu
7s(),t.removeAttribute("tabindex")))}scrollToPosition({x:t,y:n}){this.scrollRoot.scrollTo(t,n)}scrollToTop(){this.scrollToPosition({x:0,y:0})}get scrollRoot(){return window}async render(t){const{isPreview:n,shouldRender:r,willRender:i,newSnapshot:s}=t,o=i;if(r)try{this.renderPromise=new Promise(h=>V(this,Tn,h)),this.renderer=t,await this.prepareToRenderSnapshot(t);const a=new Promise(h=>V(this,An,h)),c={resume:R(this,An),render:this.renderer.renderElement,renderMethod:this.renderer.renderMethod};this.delegate.allowsImmediateRender(s,c)||await a,await this.renderSnapshot(t),this.delegate.viewRenderedSnapshot(s,n,this.renderer.renderMethod),this.delegate.preloadOnLoadLinksForView(this.element),this.finishRenderingSnapshot(t)}finally{delete this.renderer,R(this,Tn).call(this,void 0),delete this.renderPromise}else o&&this.invalidate(t.reloadReason)}invalidate(t){this.delegate.viewInvalidated(t)}async prepareToRenderSnapshot(t){this.markAsPreview(t.isPreview),await t.prepareToRender()}markAsPreview(t){t?this.element.setAttribute("data-turbo-preview",""):this.element.removeAttribute("data-turbo-preview")}markVisitDirection(t){this.element.setAttribute("data-turbo-visit-direction",t)}unmarkVisitDirection(){this.element.removeAttribute("data-turbo-visit-direction")}async renderSnapshot(t){await t.render()}finishRenderingSnapshot(t){t.finishRendering()}}Tn=new WeakMap,An=new WeakMap;class ou extends No{missing(){this.element.innerHTML='<strong class="turbo-frame-error">Content missing</strong>'}get snapshot(){return new Ar(this.element)}}class Po{constructor(t,n){w(this,"clickBubbled",t=>{this.clickEventIsSignificant(t)?this.clickEvent=t:delete this.clickEvent});w(this,"linkClicked",t=>{this.clickEvent&&this.clickEventIsSignificant(t)&&this.delegate.shouldInterceptLinkClick(t.target,t.detail.url,t.detail.originalEvent)&&(this.clickEvent.preventDefault(),t.preventDefault(),this.delegate.linkClickIntercepted(t.target,t.detail.url,t.detail.originalEvent)),delete this.clickEvent});w(this,"willVisit",t=>{delete this.clickEvent});this.delegate=t,this.element=n}start(){this.element.addEventListener("click",this.clickBubbled),document.addEventListener("turbo:click",this.linkClicked),document.addEventListener("turbo:before-visit",this.willVisit)}stop(){this.element.removeEventListener("click",this.clickBubbled),document.removeEventListener("turbo:click",this.linkClicked),document.removeEventListener("turbo:before-visit",this.willVisit)}clickEventIsSignificant(t){var i;const n=t.composed?(i=t.target)==null?void 0:i.parentElement:t.target,r=Ao(n)||n;return r instanceof Element&&r.closest("turbo-frame, html")==this.element}}class Do{constructor(t,n){w(this,"started",!1);w(this,"clickCaptured",()=>{this.eventTarget.removeEventListener("click",this.clickBubbled,!1),this.eventTarget.addEventListener("click",this.clickBubbled,!1)});w(this,"clickBubbled",t=>{if(t instanceof MouseEvent&&this.clickEventIsSignificant(t)){const n=t.composedPath&&t.composedPath()[0]||t.target,r=Ao(n);if(r&&To(r.target)){const i=Ro(r);this.delegate.willFollowLinkToLocation(r,i,t)&&(t.preventDefault(),this.delegate.followedLinkToLocation(r,i))}}});this.delegate=t,this.eventTarget=n}start(){this.started||(this.eventTarget.addEventListener("click",this.clickCaptured,!0),this.started=!0)}stop(){this.started&&(this.eventTarget.removeEventListener("click",this.clickCaptured,!0),this.started=!1)}clickEventIsSignificant(t){return!(t.target&&t.target.isContentEditable||t.defaultPrevented||t.which>1||t.altKey||t.ctrlKey||t.metaKey||t.shiftKey)}}class Fo{constructor(t,n){this.delegate=t,this.linkInterceptor=new Do(this,n)}start(){this.linkInterceptor.start()}stop(){this.linkInterceptor.stop()}canPrefetchRequestToLocation(t,n){return!1}prefetchAndCacheRequestToLocation(t,n){}willFollowLinkToLocation(t,n,r){return this.delegate.willSubmitFormLinkToLocation(t,n,r)&&(t.hasAttribute("data-turbo-method")||t.hasAttribute("data-turbo-stream"))}followedLinkToLocation(t,n){const r=document.createElement("form"),i="hidden";for(const[d,u]of n.searchParams)r.append(Object.assign(document.createElement("input"),{type:i,name:d,value:u}));const s=Object.assign(n,{search:""});r.setAttribute("data-turbo","true"),r.setAttribute("action",s.href),r.setAttribute("hidden","");const o=t.getAttribute("data-turbo-method");o&&r.setAttribute("method",o);const a=t.getAttribute("data-turbo-frame");a&&r.setAttribute("data-turbo-frame",a);const c=dt(t);c&&r.setAttribute("data-turbo-action",c);const l=t.getAttribute("data-turbo-confirm");l&&r.setAttribute("data-turbo-confirm",l),t.hasAttribute("data-turbo-stream")&&r.setAttribute("data-turbo-stream",""),this.delegate.submittedFormLinkToLocation(t,n,r),document.body.appendChild(r),r.addEventListener("turbo:submit-end",()=>r.remove(),{once:!0}),requestAnimationFrame(()=>r.requestSubmit())}}class Vo{static async preservingPermanentElements(t,n,r){const i=new this(t,n);i.enter(),await r(),i.leave()}constructor(t,n){this.delegate=t,this.permanentElementMap=n}enter(){for(const t in this.permanentElementMap){const[n,r]=this.permanentElementMap[t];this.delegate.enteringBardo(n,r),this.replaceNewPermanentElementWithPlaceholder(r)}}leave(){for(const t in this.permanentElementMap){const[n]=this.permanentElementMap[t];this.replaceCurrentPermanentElementWithClone(n),this.replacePlaceholderWithPermanentElement(n),this.delegate.leavingBardo(n)}}replaceNewPermanentElementWithPlaceholder(t){const n=au(t);t.replaceWith(n)}replaceCurrentPermanentElementWithClone(t){const n=t.cloneNode(!0);t.replaceWith(n)}replacePlaceholderWithPermanentElement(t){const n=this.getPlaceholderById(t.id);n==null||n.replaceWith(t)}getPlaceholderById(t){return this.placeholders.find(n=>n.content==t)}get placeholders(){return[...document.querySelectorAll("meta[name=turbo-permanent-placeholder][content]")]}}function au(e){const t=document.createElement("meta");return t.setAttribute("name","turbo-permanent-placeholder"),t.setAttribute("content",e.id),t}var Le;class Ui{constructor(t,n,r,i=!0){P(this,Le,null);
7this.currentSnapshot=t,this.newSnapshot=n,this.isPreview=r,this.willRender=i,this.renderElement=this.constructor.renderElement,this.promise=new Promise((s,o)=>this.resolvingFunctions={resolve:s,reject:o})}static renderElement(t,n){}get shouldRender(){return!0}get shouldAutofocus(){return!0}get reloadReason(){}prepareToRender(){}render(){}finishRendering(){this.resolvingFunctions&&(this.resolvingFunctions.resolve(),delete this.resolvingFunctions)}async preservingPermanentElements(t){await Vo.preservingPermanentElements(this,this.permanentElementMap,t)}focusFirstAutofocusableElement(){if(this.shouldAutofocus){const t=this.connectedSnapshot.firstAutofocusableElement;t&&t.focus()}}enteringBardo(t){R(this,Le)||t.contains(this.currentSnapshot.activeElement)&&V(this,Le,this.currentSnapshot.activeElement)}leavingBardo(t){t.contains(R(this,Le))&&R(this,Le)instanceof HTMLElement&&(R(this,Le).focus(),V(this,Le,null))}get connectedSnapshot(){return this.newSnapshot.isConnected?this.newSnapshot:this.currentSnapshot}get currentElement(){return this.currentSnapshot.element}get newElement(){return this.newSnapshot.element}get permanentElementMap(){return this.currentSnapshot.getPermanentElementMapForSnapshot(this.newSnapshot)}get renderMethod(){return"replace"}}Le=new WeakMap;class Rr extends Ui{static renderElement(t,n){var o;const r=document.createRange();r.selectNodeContents(t),r.deleteContents();const i=n,s=(o=i.ownerDocument)==null?void 0:o.createRange();s&&(s.selectNodeContents(i),t.appendChild(s.extractContents()))}constructor(t,n,r,i,s,o=!0){super(n,r,i,s,o),this.delegate=t}get shouldRender(){return!0}async render(){await dn(),this.preservingPermanentElements(()=>{this.loadFrameElement()}),this.scrollFrameIntoView(),await dn(),this.focusFirstAutofocusableElement(),await dn(),this.activateScriptElements()}loadFrameElement(){this.delegate.willRenderFrame(this.currentElement,this.newElement),this.renderElement(this.currentElement,this.newElement)}scrollFrameIntoView(){if(this.currentElement.autoscroll||this.newElement.autoscroll){const t=this.currentElement.firstElementChild,n=cu(this.currentElement.getAttribute("data-autoscroll-block"),"end"),r=lu(this.currentElement.getAttribute("data-autoscroll-behavior"),"auto");if(t)return t.scrollIntoView({block:n,behavior:r}),!0}return!1}activateScriptElements(){for(const t of this.newScriptElements){const n=gn(t);t.replaceWith(n)}}get newScriptElements(){return this.currentElement.querySelectorAll("script")}}function cu(e,t){return e=="end"||e=="start"||e=="center"||e=="nearest"?e:t}function lu(e,t){return e=="auto"||e=="smooth"?e:t}var uu=function(){const e=()=>{},t={morphStyle:"outerHTML",callbacks:{beforeNodeAdded:e,afterNodeAdded:e,beforeNodeMorphed:e,afterNodeMorphed:e,beforeNodeRemoved:e,afterNodeRemoved:e,beforeAttributeUpdated:e},head:{style:"merge",shouldPreserve:u=>u.getAttribute("im-preserve")==="true",shouldReAppend:u=>u.getAttribute("im-re-append")==="true",shouldRemove:e,afterHeadMorphed:e},restoreFocus:!0};function n(u,f,m={}){u=h(u);const v=d(f),S=l(u,v,m),T=i(S,()=>a(S,u,v,E=>E.morphStyle==="innerHTML"?(s(E,u,v),Array.from(u.childNodes)):r(E,u,v)));return S.pantry.remove(),T}function r(u,f,m){const v=d(f);let S=Array.from(v.childNodes);const T=S.indexOf(f),E=S.length-(T+1);return s(u,v,m,f,f.nextSibling),S=Array.from(v.childNodes),S.slice(T,S.length-E)}function i(u,f){var _;if(!u.config.restoreFocus)return f();let m=document.activeElement;if(!(m instanceof HTMLInputElement||m instanceof HTMLTextAreaElement))return f();const{id:v,selectionStart:S,selectionEnd:T}=m,E=f();return v&&v!==((_=document.activeElement)==null?void 0:_.id)&&(m=u.target.querySelector(`#${v}`),m==null||m.focus()),m&&!m.selectionEnd&&T&&m.setSelectionRange(S,T),E}const s=function(){function u(p,b,g,y=null,A=null){b instanceof HTMLTemplateElement&&g instanceof HTMLTemplateElement&&(b=b.content,g=g.content),y||(y=b.firstChild);for(const O of g.childNodes){if(y&&y!=A){const B=m(p,O,y,A);if(B){B!==y&&S(p,y,B),o(B,O,p),y=B.nextSibling;continue}}if(O instanceof Element&&p.persistentIds.has(O.id)){const B=T(b,O.id,y,p);o(B,O,p),y=B.nextSibling;continue}const q=f(b,O,y,p);q&&(y=q.nextSibling)}for(;y&&y!=A;){const O=y;y=y.nextSibling,v(p,O)}}function f(p,b,g,y){if(y.callbacks.beforeNodeAdded(b)===!1)return null;if(y.idMap.has(b)){const A=document.createElement(b.tagName);return p.insertBefore(A,g),o(A,b,y),y.callbacks.afterNodeAdded(A),A}else{const A=document.importNode(b,!0);return p.insertBefore(A,g),y.callbacks.afterNodeAdded(A),A}}const m=function(){function p(y,A,O,q){let B=null,Ee=A.nextSibling,Je=0,re=O;
7for(;re&&re!=q;){if(g(re,A)){if(b(y,re,A))return re;B===null&&(y.idMap.has(re)||(B=re))}if(B===null&&Ee&&g(re,Ee)&&(Je++,Ee=Ee.nextSibling,Je>=2&&(B=void 0)),re.contains(document.activeElement))break;re=re.nextSibling}return B||null}function b(y,A,O){let q=y.idMap.get(A),B=y.idMap.get(O);if(!B||!q)return!1;for(const Ee of q)if(B.has(Ee))return!0;return!1}function g(y,A){const O=y,q=A;return O.nodeType===q.nodeType&&O.tagName===q.tagName&&(!O.id||O.id===q.id)}return p}();function v(p,b){var g;if(p.idMap.has(b))_(p.pantry,b,null);else{if(p.callbacks.beforeNodeRemoved(b)===!1)return;(g=b.parentNode)==null||g.removeChild(b),p.callbacks.afterNodeRemoved(b)}}function S(p,b,g){let y=b;for(;y&&y!==g;){let A=y;y=y.nextSibling,v(p,A)}return y}function T(p,b,g,y){const A=y.target.querySelector(`#${b}`)||y.pantry.querySelector(`#${b}`);return E(A,y),_(p,A,g),A}function E(p,b){const g=p.id;for(;p=p.parentNode;){let y=b.idMap.get(p);y&&(y.delete(g),y.size||b.idMap.delete(p))}}function _(p,b,g){if(p.moveBefore)try{p.moveBefore(b,g)}catch{p.insertBefore(b,g)}else p.insertBefore(b,g)}return u}(),o=function(){function u(E,_,p){return p.ignoreActive&&E===document.activeElement?null:(p.callbacks.beforeNodeMorphed(E,_)===!1||(E instanceof HTMLHeadElement&&p.head.ignore||(E instanceof HTMLHeadElement&&p.head.style!=="morph"?c(E,_,p):(f(E,_,p),T(E,p)||s(p,E,_))),p.callbacks.afterNodeMorphed(E,_)),E)}function f(E,_,p){let b=_.nodeType;if(b===1){const g=E,y=_,A=g.attributes,O=y.attributes;for(const q of O)S(q.name,g,"update",p)||g.getAttribute(q.name)!==q.value&&g.setAttribute(q.name,q.value);for(let q=A.length-1;0<=q;q--){const B=A[q];if(B&&!y.hasAttribute(B.name)){if(S(B.name,g,"remove",p))continue;g.removeAttribute(B.name)}}T(g,p)||m(g,y,p)}(b===8||b===3)&&E.nodeValue!==_.nodeValue&&(E.nodeValue=_.nodeValue)}function m(E,_,p){if(E instanceof HTMLInputElement&&_ instanceof HTMLInputElement&&_.type!=="file"){let b=_.value,g=E.value;v(E,_,"checked",p),v(E,_,"disabled",p),_.hasAttribute("value")?g!==b&&(S("value",E,"update",p)||(E.setAttribute("value",b),E.value=b)):S("value",E,"remove",p)||(E.value="",E.removeAttribute("value"))}else if(E instanceof HTMLOptionElement&&_ instanceof HTMLOptionElement)v(E,_,"selected",p);else if(E instanceof HTMLTextAreaElement&&_ instanceof HTMLTextAreaElement){let b=_.value,g=E.value;if(S("value",E,"update",p))return;b!==g&&(E.value=b),E.firstChild&&E.firstChild.nodeValue!==b&&(E.firstChild.nodeValue=b)}}function v(E,_,p,b){const g=_[p],y=E[p];if(g!==y){const A=S(p,E,"update",b);A||(E[p]=_[p]),g?A||E.setAttribute(p,""):S(p,E,"remove",b)||E.removeAttribute(p)}}function S(E,_,p,b){return E==="value"&&b.ignoreActiveValue&&_===document.activeElement?!0:b.callbacks.beforeAttributeUpdated(E,_,p)===!1}function T(E,_){return!!_.ignoreActiveValue&&E===document.activeElement&&E!==document.body}return u}();function a(u,f,m,v){if(u.head.block){const S=f.querySelector("head"),T=m.querySelector("head");if(S&&T){const E=c(S,T,u);return Promise.all(E).then(()=>{const _=Object.assign(u,{head:{block:!1,ignore:!0}});return v(_)})}}return v(u)}function c(u,f,m){let v=[],S=[],T=[],E=[],_=new Map;for(const b of f.children)_.set(b.outerHTML,b);for(const b of u.children){let g=_.has(b.outerHTML),y=m.head.shouldReAppend(b),A=m.head.shouldPreserve(b);g||A?y?S.push(b):(_.delete(b.outerHTML),T.push(b)):m.head.style==="append"?y&&(S.push(b),E.push(b)):m.head.shouldRemove(b)!==!1&&S.push(b)}E.push(..._.values());let p=[];for(const b of E){let g=document.createRange().createContextualFragment(b.outerHTML).firstChild;if(m.callbacks.beforeNodeAdded(g)!==!1){if("href"in g&&g.href||"src"in g&&g.src){let y,A=new Promise(function(O){y=O});g.addEventListener("load",function(){y()}),p.push(A)}u.appendChild(g),m.callbacks.afterNodeAdded(g),v.push(g)}}for(const b of S)m.callbacks.beforeNodeRemoved(b)!==!1&&(u.removeChild(b),m.callbacks.afterNodeRemoved(b));return m.head.afterHeadMorphed(u,{added:v,kept:T,removed:S}),p}const l=function(){function u(_,p,b){const{persistentIds:g,idMap:y}=T(_,p),A=f(b),O=A.morphStyle||"outerHTML";if(!["innerHTML","outerHTML"].includes(O))throw`Do not understand how to morph style ${O}`;return{target:_,newContent:p,config:A,morphStyle:O,ignoreActive:A.ignoreActive,ignoreActiveValue:A.ignoreActiveValue,restoreFocus:A.restoreFocus,idMap:y,persistentIds:g,pantry:m(),callbacks:A.callbacks,head:A.head}}function f(_){let p=Object.assign({},t);return Object.assign(p,_),p.callbacks=Object.assign({},t.callbacks,_.callbacks),p.head=Object.assign({},t.head,_.head),p}function m(){const _=document.createElement("div");return _.hidden=!0,document.body.insertAdjacentElement("afterend",_),_}function v(_){let p=Array.from(_.querySelectorAll("[id]"));return _.id&&p.push(_),p}function S(_,p,b,g){for(const y of g)if(p.has(y.id)){let A=y;for(;A;){let O=_.get(A);if(O==null&&(O=new Set,_.set(A,O)),O.add(y.id),A===b)break;A=A.parentElement}}}function T(_,p){const b=v(_),g=v(p),y=E(b,g);let A=new Map;S(A,y,_,b);const O=p.__idiomorphRoot||p;return S(A,y,O,g),{persistentIds:y,idMap:A}}function E(_,p){let b=new Set,g=new Map;for(const{id:A,tagName:O}of _)g.has(A)?b.add(A):g.set(A,O);let y=new Set;for(const{id:A,tagName:O}of p)y.has(A)?b.add(A):g.get(A)===O&&y.add(A);for(const A of b)y.delete(A);return y}return u}(),{normalizeElement:h,normalizeParent:d}=function(){const u=new WeakSet;function f(T){return T instanceof Document?T.documentElement:T}function m(T){if(T==null)return document.createElement("div");if(typeof T=="string")return m(S(T));if(u.has(T))return T;if(T instanceof Node){if(T.parentNode)return v(T);{const E=document.createElement("div");return E.append(T),E}}else{const E=document.createElement("div");for(const _ of[...T])E.append(_);return E}}function v(T){return{childNodes:[T],querySelectorAll:E=>{const _=T.querySelectorAll(E);return T.matches(E)?[T,..._]:_},insertBefore:(E,_)=>T.parentNode.insertBefore(E,_),moveBefore:(E,_)=>T.parentNode.moveBefore(E,_),get __idiomorphRoot(){return T}}}function S(T){let E=new DOMParser,_=T.replace(/<svg(\s[^>]*>|>)([\s\S]*?)<\/svg>/gim,"");if(_.match(/<\/html>/)||_.match(/<\/head>/)||_.match(/<\/body>/)){let p=E.parseFromString(T,"text/html");if(_.match(/<\/html>/))return u.add(p),p;{let b=p.firstChild;return b&&u.add(b),b}}else{let b=E.parseFromString("<body><template>"+T+"</template></body>","text/html").body.querySelector("template").content;return u.add(b),b}}return{normalizeElement:f,normalizeParent:m}}();return{morph:n,defaults:t}}();function Bi(e,t,{callbacks:n,...r}={}){uu.morph(e,t,{...r,callbacks:new du(n)})}function Uo(e,t){Bi(e,t.childNodes,{morphStyle:"innerHTML"})}var Rn;class du{constructor({beforeNodeMorphed:t}={}){P(this,Rn);w(this,"beforeNodeAdded",t=>!(t.id&&t.hasAttribute("data-turbo-permanent")&&document.getElementById(t.id)));w(this,"beforeNodeMorphed",(t,n)=>{if(t instanceof Element)return!t.hasAttribute("data-turbo-permanent")&&R(this,Rn).call(this,t,n)?!z("turbo:before-morph-element",{cancelable:!0,target:t,detail
7:{currentElement:t,newElement:n}}).defaultPrevented:!1});w(this,"beforeAttributeUpdated",(t,n,r)=>!z("turbo:before-morph-attribute",{cancelable:!0,target:n,detail:{attributeName:t,mutationType:r}}).defaultPrevented);w(this,"beforeNodeRemoved",t=>this.beforeNodeMorphed(t));w(this,"afterNodeMorphed",(t,n)=>{t instanceof Element&&z("turbo:morph-element",{target:t,detail:{currentElement:t,newElement:n}})});V(this,Rn,t||(()=>!0))}}Rn=new WeakMap;class hu extends Rr{static renderElement(t,n){z("turbo:before-frame-morph",{target:t,detail:{currentElement:t,newElement:n}}),Uo(t,n)}async preservingPermanentElements(t){return await t()}}const Ie=class Ie{constructor(){w(this,"hiding",!1);w(this,"value",0);w(this,"visible",!1);w(this,"trickle",()=>{this.setValue(this.value+Math.random()/100)});this.stylesheetElement=this.createStylesheetElement(),this.progressElement=this.createProgressElement(),this.installStylesheetElement(),this.setValue(0)}static get defaultCSS(){return Eo` 8 .turbo-progress-bar { 9 position: fixed; 10 display: block; 11 top: 0; 12 left: 0; 13 height: 3px; 14 background: #0076ff; 15 z-index: 2147483647; 16 transition: 17 width ${Ie.animationDuration}ms ease-out, 18 opacity ${Ie.animationDuration/2}ms ${Ie.animationDuration/2}ms ease-in; 19 transform: translate3d(0, 0, 0); 20 } 21 `}show(){this.visible||(this.visible=!0,this.installProgressElement(),this.startTrickling())}hide(){this.visible&&!this.hiding&&(this.hiding=!0,this.fadeProgressElement(()=>{this.uninstallProgressElement(),this.stopTrickling(),this.visible=!1,this.hiding=!1}))}setValue(t){this.value=t,this.refresh()}installStylesheetElement(){document.head.insertBefore(this.stylesheetElement,document.head.firstChild)}installProgressElement(){this.progressElement.style.width="0",this.progressElement.style.opacity="1",document.documentElement.insertBefore(this.progressElement,document.body),this.refresh()}fadeProgressElement(t){this.progressElement.style.opacity="0",setTimeout(t,Ie.animationDuration*1.5)}uninstallProgressElement(){this.progressElement.parentNode&&document.documentElement.removeChild(this.progressElement)}startTrickling(){this.trickleInterval||(this.trickleInterval=window.setInterval(this.trickle,Ie.animationDuration))}stopTrickling(){window.clearInterval(this.trickleInterval),delete this.trickleInterval}refresh(){requestAnimationFrame(()=>{this.progressElement.style.width=`${10+this.value*90}%`})}createStylesheetElement(){const t=document.createElement("style");t.type="text/css",t.textContent=Ie.defaultCSS;const n=_o();return n&&(t.nonce=n),t}createProgressElement(){const t=document.createElement("div");return t.className="turbo-progress-bar",t}};w(Ie,"animationDuration",300);let yi=Ie;class fu extends Ar{constructor(){super(...arguments);w(this,"detailsByOuterHTML",this.children.filter(n=>!bu(n)).map(n=>Eu(n)).reduce((n,r)=>{const{outerHTML:i}=r,s=i in n?n[i]:{type:mu(r),tracked:pu(r),elements:[]};return{...n,[i]:{...s,elements:[...s.elements,r]}}},{}))}get trackedElementSignature(){return Object.keys(this.detailsByOuterHTML).filter(n=>this.detailsByOuterHTML[n].tracked).join("")}getScriptElementsNotInSnapshot(n){return this.getElementsMatchingTypeNotInSnapshot("script",n)}getStylesheetElementsNotInSnapshot(n){return this.getElementsMatchingTypeNotInSnapshot("stylesheet",n)}getElementsMatchingTypeNotInSnapshot(n,r){return Object.keys(this.detailsByOuterHTML).filter(i=>!(i in r.detailsByOuterHTML)).map(i=>this.detailsByOuterHTML[i]).filter(({type:i})=>i==n).map(({elements:[i]})=>i)}get provisionalElements(){return Object.keys(this.detailsByOuterHTML).reduce((n,r)=>{const{type:i,tracked:s,elements:o}=this.detailsByOuterHTML[r];return i==null&&!s?[...n,...o]:o.length>1?[...n,...o.slice(1)]:n},[])}getMetaValue(n){const r=this.findMetaElementByName(n);return r?r.getAttribute("content"):null}findMetaElementByName(n){return Object.keys(this.detailsByOuterHTML).reduce((r,i)=>{const{elements:[s]}=this.detailsByOuterHTML[i];return yu(s,n)?s:r},void 0|void 0)}}function mu(e){if(gu(e))return"script";if(vu(e))return"stylesheet"}function pu(e){return e.getAttribute("data-turbo-track")=="reload"}function gu(e){return e.localName=="script"}function bu(e){return e.localName=="noscript"}function vu(e){const t=e.localName;return t=="style"||t=="link"&&e.getAttribute("rel")=="stylesheet"}function yu(e,t){return e.localName=="meta"&&e.getAttribute("name")==t}function Eu(e){return e.hasAttribute("nonce")&&e.setAttribute("nonce",""),e}class ge extends Ar{static fromHTMLString(t=""){return this.fromDocument(yo(t))}static fromElement(t){return this.fromDocument(t.ownerDocument)}static fromDocument({documentElement:t,body:n,head:r}){return new this(t,n,new fu(r))}constructor(t,n,r){super(n),this.documentElement=t,this.headSnapshot=r}clone(){const t=this.element.cloneNode(!0),n=this.element.querySelectorAll("select"),r=t.querySelectorAll("select");for(const[i,s]of n.entries()){const o=r[i];for(const a of o.selectedOptions)a.selected=!1;for(const a of s.selectedOptions)o.options[a.index].selected=!0}for(const i of t.querySelectorAll('input[type="password"]'))i.value="";return new ge(this.documentElement,t,this.headSnapshot)}get lang(){return this.documentElement.getAttribute("lang")}get headElement(){return this.headSnapshot.element}get rootLocation(){const t=this.getSetting("root")??"/";return Z(t)}
21get cacheControlValue(){return this.getSetting("cache-control")}get isPreviewable(){return this.cacheControlValue!="no-preview"}get isCacheable(){return this.cacheControlValue!="no-cache"}get isVisitable(){return this.getSetting("visit-control")!="reload"}get prefersViewTransitions(){return this.headSnapshot.getMetaValue("view-transition")==="same-origin"}get shouldMorphPage(){return this.getSetting("refresh-method")==="morph"}get shouldPreserveScrollPosition(){return this.getSetting("refresh-scroll")==="preserve"}getSetting(t){return this.headSnapshot.getMetaValue(`turbo-${t}`)}}var Cn,qe;class Su{constructor(){P(this,Cn,!1);P(this,qe,Promise.resolve())}renderChange(t,n){return t&&this.viewTransitionsAvailable&&!R(this,Cn)?(V(this,Cn,!0),V(this,qe,R(this,qe).then(async()=>{await document.startViewTransition(n).finished}))):V(this,qe,R(this,qe).then(n)),R(this,qe)}get viewTransitionsAvailable(){return document.startViewTransition}}Cn=new WeakMap,qe=new WeakMap;const _u={action:"advance",historyChanged:!1,visitCachedSnapshot:()=>{},willRender:!0,updateHistory:!0,shouldCacheSnapshot:!0,acceptsStreamResponse:!1},Gn={visitStart:"visitStart",requestStart:"requestStart",requestEnd:"requestEnd",visitEnd:"visitEnd"},Ce={initialized:"initialized",started:"started",canceled:"canceled",failed:"failed",completed:"completed"},Nt={networkFailure:0,timeoutFailure:-1,contentTypeMismatch:-2},wu={advance:"forward",restore:"back",replace:"none"};class Tu{constructor(t,n,r,i={}){w(this,"identifier",je());w(this,"timingMetrics",{});w(this,"followedRedirect",!1);w(this,"historyChanged",!1);w(this,"scrolled",!1);w(this,"shouldCacheSnapshot",!0);w(this,"acceptsStreamResponse",!1);w(this,"snapshotCached",!1);w(this,"state",Ce.initialized);w(this,"viewTransitioner",new Su);this.delegate=t,this.location=n,this.restorationIdentifier=r||je();const{action:s,historyChanged:o,referrer:a,snapshot:c,snapshotHTML:l,response:h,visitCachedSnapshot:d,willRender:u,updateHistory:f,shouldCacheSnapshot:m,acceptsStreamResponse:v,direction:S}={..._u,...i};this.action=s,this.historyChanged=o,this.referrer=a,this.snapshot=c,this.snapshotHTML=l,this.response=h,this.isSamePage=this.delegate.locationWithActionIsSamePage(this.location,this.action),this.isPageRefresh=this.view.isPageRefresh(this),this.visitCachedSnapshot=d,this.willRender=u,this.updateHistory=f,this.scrolled=!u,this.shouldCacheSnapshot=m,this.acceptsStreamResponse=v,this.direction=S||wu[s]}get adapter(){return this.delegate.adapter}get view(){return this.delegate.view}get history(){return this.delegate.history}get restorationData(){return this.history.getRestorationDataForIdentifier(this.restorationIdentifier)}get silent(){return this.isSamePage}start(){this.state==Ce.initialized&&(this.recordTimingMetric(Gn.visitStart),this.state=Ce.started,this.adapter.visitStarted(this),this.delegate.visitStarted(this))}cancel(){this.state==Ce.started&&(this.request&&this.request.cancel(),this.cancelRender(),this.state=Ce.canceled)}complete(){this.state==Ce.started&&(this.recordTimingMetric(Gn.visitEnd),this.adapter.visitCompleted(this),this.state=Ce.completed,this.followRedirect(),this.followedRedirect||this.delegate.visitCompleted(this))}fail(){this.state==Ce.started&&(this.state=Ce.failed,this.adapter.visitFailed(this),this.delegate.visitCompleted(this))}changeHistory(){var t;if(!this.historyChanged&&this.updateHistory){const n=this.location.href===((t=this.referrer)==null?void 0:t.href)?"replace":this.action,r=So(n);this.history.update(r,this.location,this.restorationIdentifier),this.historyChanged=!0}}issueRequest(){this.hasPreloadedResponse()?this.simulateRequest():this.shouldIssueRequest()&&!this.request&&(this.request=new Zt(this,ue.get,this.location),this.request.perform())}simulateRequest(){this.response&&(this.startRequest(),this.recordResponse(),this.finishRequest())}startRequest(){this.recordTimingMetric(Gn.requestStart),this.adapter.visitRequestStarted(this)}recordResponse(t=this.response){if(this.response=t,t){const{statusCode:n}=t;ms(n)?this.adapter.visitRequestCompleted(this):this.adapter.visitRequestFailedWithStatusCode(this,n)}}finishRequest(){this.recordTimingMetric(Gn.requestEnd),this.adapter.visitRequestFinished(this)}loadResponse(){if(this.response){const{statusCode:t,responseHTML:n}=this.response;this.render(async()=>
21{if(this.shouldCacheSnapshot&&this.cacheSnapshot(),this.view.renderPromise&&await this.view.renderPromise,ms(t)&&n!=null){const r=ge.fromHTMLString(n);await this.renderPageSnapshot(r,!1),this.adapter.visitRendered(this),this.complete()}else await this.view.renderError(ge.fromHTMLString(n),this),this.adapter.visitRendered(this),this.fail()})}}getCachedSnapshot(){const t=this.view.getCachedSnapshotForLocation(this.location)||this.getPreloadedSnapshot();if(t&&(!ht(this.location)||t.hasAnchor(ht(this.location)))&&(this.action=="restore"||t.isPreviewable))return t}getPreloadedSnapshot(){if(this.snapshotHTML)return ge.fromHTMLString(this.snapshotHTML)}hasCachedSnapshot(){return this.getCachedSnapshot()!=null}loadCachedSnapshot(){const t=this.getCachedSnapshot();if(t){const n=this.shouldIssueRequest();this.render(async()=>{this.cacheSnapshot(),this.isSamePage||this.isPageRefresh?this.adapter.visitRendered(this):(this.view.renderPromise&&await this.view.renderPromise,await this.renderPageSnapshot(t,n),this.adapter.visitRendered(this),n||this.complete())})}}followRedirect(){var t;this.redirectedToLocation&&!this.followedRedirect&&((t=this.response)!=null&&t.redirected)&&(this.adapter.visitProposedToLocation(this.redirectedToLocation,{action:"replace",response:this.response,shouldCacheSnapshot:!1,willRender:!1}),this.followedRedirect=!0)}goToSamePageAnchor(){this.isSamePage&&this.render(async()=>{this.cacheSnapshot(),this.performScroll(),this.changeHistory(),this.adapter.visitRendered(this)})}prepareRequest(t){this.acceptsStreamResponse&&t.acceptResponseType(mt.contentType)}requestStarted(){this.startRequest()}requestPreventedHandlingResponse(t,n){}async requestSucceededWithResponse(t,n){const r=await n.responseHTML,{redirected:i,statusCode:s}=n;r==null?this.recordResponse({statusCode:Nt.contentTypeMismatch,redirected:i}):(this.redirectedToLocation=n.redirected?n.location:void 0,this.recordResponse({statusCode:s,responseHTML:r,redirected:i}))}async requestFailedWithResponse(t,n){const r=await n.responseHTML,{redirected:i,statusCode:s}=n;r==null?this.recordResponse({statusCode:Nt.contentTypeMismatch,redirected:i}):this.recordResponse({statusCode:s,responseHTML:r,redirected:i})}requestErrored(t,n){this.recordResponse({statusCode:Nt.networkFailure,redirected:!1})}requestFinished(){this.finishRequest()}performScroll(){!this.scrolled&&!this.view.forceReloaded&&!this.view.shouldPreserveScrollPosition(this)&&(this.action=="restore"?this.scrollToRestoredPosition()||this.scrollToAnchor()||this.view.scrollToTop():this.scrollToAnchor()||this.view.scrollToTop(),this.isSamePage&&this.delegate.visitScrolledToSamePageLocation(this.view.lastRenderedLocation,this.location),this.scrolled=!0)}scrollToRestoredPosition(){const{scrollPosition:t}=this.restorationData;if(t)return this.view.scrollToPosition(t),!0}scrollToAnchor(){const t=ht(this.location);if(t!=null)return this.view.scrollToAnchor(t),!0}recordTimingMetric(t){this.timingMetrics[t]=new Date().getTime()}getTimingMetrics(){return{...this.timingMetrics}}hasPreloadedResponse(){return typeof this.response=="object"}shouldIssueRequest(){return this.isSamePage?!1:this.action=="restore"?!this.hasCachedSnapshot():this.willRender}cacheSnapshot(){this.snapshotCached||(this.view.cacheSnapshot(this.snapshot).then(t=>t&&this.visitCachedSnapshot(t)),this.snapshotCached=!0)}async render(t){this.cancelRender(),await new Promise(n=>{this.frame=document.visibilityState==="hidden"?setTimeout(()=>n(),0):requestAnimationFrame(()=>n())}),await t(),delete this.frame}async renderPageSnapshot(t,n){await this.viewTransitioner.renderChange(this.view.shouldTransitionTo(t),async()=>{await this.view.renderPage(t,n,this.willRender,this),this.performScroll()})}cancelRender(){this.frame&&(cancelAnimationFrame(this.frame),delete this.frame)}}function ms(e){return e>=200&&e<300}class Au{constructor(t){w(this,"progressBar",new yi);w(this,"showProgressBar",()=>{this.progressBar.show()});this.session=t}visitProposedToLocation(t,n){Ue(t,this.navigator.rootLocation)?this.navigator.startVisit(t,(n==null?void 0:n.restorationIdentifier)||je(),n):window.location.href=t.toString()}visitStarted(t){this.location=t.location,t.loadCachedSnapshot(),t.issueRequest(),t.goToSamePageAnchor()}visitRequestStarted(t){this.progressBar.setValue(0),t.hasCachedSnapshot()||t.action!="restore"?this.showVisitProgressBarAfterDelay():this.showProgressBar()}visitRequestCompleted(t){t.loadResponse()}visitRequestFailedWithStatusCode(t,n){switch(n){case Nt.networkFailure:case Nt.timeoutFailure:case Nt.contentTypeMismatch:return this.reload({reason:"request_failed",context:{statusCode:n}});default:return t.loadResponse()}}visitRequestFinished(t){}visitCompleted(t){this.progressBar.setValue(1),this.hideVisitProgressBar()}pageInvalidated(t){this.reload(t)}visitFailed(t){this.progressBar.setValue(1),this.hideVisitProgressBar()}visitRendered(t){}linkPrefetchingIsEnabledForLocation(t){return!0}
21formSubmissionStarted(t){this.progressBar.setValue(0),this.showFormProgressBarAfterDelay()}formSubmissionFinished(t){this.progressBar.setValue(1),this.hideFormProgressBar()}showVisitProgressBarAfterDelay(){this.visitProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay)}hideVisitProgressBar(){this.progressBar.hide(),this.visitProgressBarTimeout!=null&&(window.clearTimeout(this.visitProgressBarTimeout),delete this.visitProgressBarTimeout)}showFormProgressBarAfterDelay(){this.formProgressBarTimeout==null&&(this.formProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay))}hideFormProgressBar(){this.progressBar.hide(),this.formProgressBarTimeout!=null&&(window.clearTimeout(this.formProgressBarTimeout),delete this.formProgressBarTimeout)}reload(t){var n;z("turbo:reload",{detail:t}),window.location.href=((n=this.location)==null?void 0:n.toString())||window.location.href}get navigator(){return this.session.navigator}}class Ru{constructor(){w(this,"selector","[data-turbo-temporary]");w(this,"deprecatedSelector","[data-turbo-cache=false]");w(this,"started",!1);w(this,"removeTemporaryElements",t=>{for(const n of this.temporaryElements)n.remove()})}start(){this.started||(this.started=!0,addEventListener("turbo:before-cache",this.removeTemporaryElements,!1))}stop(){this.started&&(this.started=!1,removeEventListener("turbo:before-cache",this.removeTemporaryElements,!1))}get temporaryElements(){return[...document.querySelectorAll(this.selector),...this.temporaryElementsWithDeprecation]}get temporaryElementsWithDeprecation(){const t=document.querySelectorAll(this.deprecatedSelector);return t.length&&console.warn(`The ${this.deprecatedSelector} selector is deprecated and will be removed in a future version. Use ${this.selector} instead.`),[...t]}}var be,Bo,Qn,er;class Cu{constructor(t,n){P(this,be);this.session=t,this.element=n,this.linkInterceptor=new Po(this,n),this.formSubmitObserver=new Vi(this,n)}start(){this.linkInterceptor.start(),this.formSubmitObserver.start()}stop(){this.linkInterceptor.stop(),this.formSubmitObserver.stop()}shouldInterceptLinkClick(t,n,r){return C(this,be,Qn).call(this,t)}linkClickIntercepted(t,n,r){const i=C(this,be,er).call(this,t);i&&i.delegate.linkClickIntercepted(t,n,r)}willSubmitForm(t,n){return t.closest("turbo-frame")==null&&C(this,be,Bo).call(this,t,n)&&C(this,be,Qn).call(this,t,n)}formSubmitted(t,n){const r=C(this,be,er).call(this,t,n);r&&r.delegate.formSubmitted(t,n)}}be=new WeakSet,Bo=function(t,n){const r=Di(t,n),i=this.element.ownerDocument.querySelector('meta[name="turbo-root"]'),s=Z((i==null?void 0:i.content)??"/");return C(this,be,Qn).call(this,t,n)&&Ue(r,s)},Qn=function(t,n){if(t instanceof HTMLFormElement?this.session.submissionIsNavigatable(t,n):this.session.elementIsNavigatable(t)){const i=C(this,be,er).call(this,t,n);return i?i!=t.closest("turbo-frame"):!1}else return!1},er=function(t,n){const r=(n==null?void 0:n.getAttribute("data-turbo-frame"))||t.getAttribute("data-turbo-frame");if(r&&r!="_top"){const i=this.element.querySelector(`#${r}:not([disabled])`);if(i instanceof ve)return i}};let Iu=class{constructor(t){w(this,"location");w(this,"restorationIdentifier",je());w(this,"restorationData",{});w(this,"started",!1);w(this,"pageLoaded",!1);w(this,"currentIndex",0);w(this,"onPopState",t=>{if(this.shouldHandlePopState()){const{turbo:n}=t.state||{};if(n){this.location=new URL(window.location.href);const{restorationIdentifier:r,restorationIndex:i}=n;this.restorationIdentifier=r;const s=i>this.currentIndex?"forward":"back";this.delegate.historyPoppedToLocationWithRestorationIdentifierAndDirection(this.location,r,s),this.currentIndex=i}}});w(this,"onPageLoad",async t=>{await Al(),this.pageLoaded=!0});this.delegate=t}start(){var t,n;this.started||(addEventListener("popstate",this.onPopState,!1),addEventListener("load",this.onPageLoad,!1),this.currentIndex=((n=(t=history.state)==null?void 0:t.turbo)==null?void 0:n.restorationIndex)||0,this.started=!0,this.replace(new URL(window.location.href)))}stop(){this.started&&(removeEventListener("popstate",this.onPopState,!1),removeEventListener("load",this.onPageLoad,!1),this.started=!1)}push(t,n){this.update(history.pushState,t,n)}replace(t,n){this.update(history.replaceState,t,n)}update(t,n,r=je()){t===history.pushState&&++this.currentIndex;const i={turbo:{restorationIdentifier:r,restorationIndex:this.currentIndex}};t.call(history,i,"",n.href),this.location=n,this.restorationIdentifier=r}getRestorationDataForIdentifier(t){return this.restorationData[t]||{}}updateRestorationData(t){const{restorationIdentifier:n}=this,r=this.restorationData[n];this.restorationData[n]={...r,...t}}assumeControlOfScrollRestoration(){this.previousScrollRestoration||(this.previousScrollRestoration=history.scrollRestoration??"auto",history.scrollRestoration="manual")}relinquishControlOfScrollRestoration(){this.previousScrollRestoration&&(history.scrollRestoration=this.previousScrollRestoration,delete this.previousScrollRestoration)}shouldHandlePopState(){return this.pageIsLoaded()}pageIsLoaded(){return this.pageLoaded||document.readyState=="complete"}};var Ft,In,kn,Ln,yr,On,Yt,qo,Ho;
21class ku{constructor(t,n){P(this,Yt);w(this,"started",!1);P(this,Ft,null);P(this,In,()=>{this.eventTarget.addEventListener("mouseenter",R(this,kn),{capture:!0,passive:!0}),this.eventTarget.addEventListener("mouseleave",R(this,Ln),{capture:!0,passive:!0}),this.eventTarget.addEventListener("turbo:before-fetch-request",R(this,On),!0),this.started=!0});P(this,kn,t=>{if(dr("turbo-prefetch")==="false")return;const n=t.target;if(n.matches&&n.matches("a[href]:not([target^=_]):not([download])")&&C(this,Yt,Ho).call(this,n)){const i=n,s=Ro(i);if(this.delegate.canPrefetchRequestToLocation(i,s)){V(this,Ft,i);const o=new Zt(this,ue.get,s,new URLSearchParams,n);kt.setLater(s.toString(),o,R(this,Yt,qo))}}});P(this,Ln,t=>{t.target===R(this,Ft)&&R(this,yr).call(this)});P(this,yr,()=>{kt.clear(),V(this,Ft,null)});P(this,On,t=>{if(t.target.tagName!=="FORM"&&t.detail.fetchOptions.method==="GET"){const n=kt.get(t.detail.url.toString());n&&(t.detail.fetchRequest=n),kt.clear()}});this.delegate=t,this.eventTarget=n}start(){this.started||(this.eventTarget.readyState==="loading"?this.eventTarget.addEventListener("DOMContentLoaded",R(this,In),{once:!0}):R(this,In).call(this))}stop(){this.started&&(this.eventTarget.removeEventListener("mouseenter",R(this,kn),{capture:!0,passive:!0}),this.eventTarget.removeEventListener("mouseleave",R(this,Ln),{capture:!0,passive:!0}),this.eventTarget.removeEventListener("turbo:before-fetch-request",R(this,On),!0),this.started=!1)}prepareRequest(t){const n=t.target;t.headers["X-Sec-Purpose"]="prefetch";const r=n.closest("turbo-frame"),i=n.getAttribute("data-turbo-frame")||(r==null?void 0:r.getAttribute("target"))||(r==null?void 0:r.id);i&&i!=="_top"&&(t.headers["Turbo-Frame"]=i)}requestSucceededWithResponse(){}requestStarted(t){}requestErrored(t){}requestFinished(t){}requestPreventedHandlingResponse(t,n){}requestFailedWithResponse(t,n){}}Ft=new WeakMap,In=new WeakMap,kn=new WeakMap,Ln=new WeakMap,yr=new WeakMap,On=new WeakMap,Yt=new WeakSet,qo=function(){return Number(dr("turbo-prefetch-cache-time"))||Xl},Ho=function(t){return!(!t.getAttribute("href")||Lu(t)||Ou(t)||Mu(t)||xu(t)||Pu(t))};const Lu=e=>e.origin!==document.location.origin||!["http:","https:"].includes(e.protocol)||e.hasAttribute("target"),Ou=e=>e.pathname+e.search===document.location.pathname+document.location.search||e.href.startsWith("#"),Mu=e=>{if(e.getAttribute("data-turbo-prefetch")==="false"||e.getAttribute("data-turbo")==="false")return!0;const t=xt(e,"[data-turbo-prefetch]");return!!(t&&t.getAttribute("data-turbo-prefetch")==="false")},xu=e=>{const t=e.getAttribute("data-turbo-method");return!!(t&&t.toLowerCase()!=="get"||Nu(e)||e.hasAttribute("data-turbo-confirm")||e.hasAttribute("data-turbo-stream"))},Nu=e=>e.hasAttribute("data-remote")||e.hasAttribute("data-behavior")||e.hasAttribute("data-confirm")||e.hasAttribute("data-method"),Pu=e=>z("turbo:before-prefetch",{target:e,cancelable:!0}).defaultPrevented;var Xt,zo,$o;class Du{constructor(t){P(this,Xt);this.delegate=t}proposeVisit(t,n={}){this.delegate.allowsVisitingLocationWithAction(t,n.action)&&this.delegate.visitProposedToLocation(t,n)}startVisit(t,n,r={}){this.stop(),this.currentVisit=new Tu(this,Z(t),n,{referrer:this.location,...r}),this.currentVisit.start()}submitForm(t,n){this.stop(),this.formSubmission=new Tr(this,t,n,!0),this.formSubmission.start()}stop(){this.formSubmission&&(this.formSubmission.stop(),delete this.formSubmission),this.currentVisit&&(this.currentVisit.cancel(),delete this.currentVisit)}get adapter(){return this.delegate.adapter}get view(){return this.delegate.view}get rootLocation(){return this.view.snapshot.rootLocation}get history(){return this.delegate.history}formSubmissionStarted(t){typeof this.adapter.formSubmissionStarted=="function"&&this.adapter.formSubmissionStarted(t)}async formSubmissionSucceededWithResponse(t,n){if(t==this.formSubmission){const r=await n.responseHTML;if(r){const i=t.isSafe;i||this.view.clearSnapshotCache();const{statusCode:s,redirected:o}=n,c={action:C(this,Xt,zo).call(this,t,n),shouldCacheSnapshot:i,response:{statusCode:s,responseHTML:r,redirected:o}};this.proposeVisit(n.location,c)}}}async formSubmissionFailedWithResponse(t,n){const r=await n.responseHTML;if(r){const i=ge.fromHTMLString(r);n.serverError?await this.view.renderError(i,this.currentVisit):await this.view.renderPage(i,!1,!0,this.currentVisit),i.shouldPreserveScrollPosition||this.view.scrollToTop(),this.view.clearSnapshotCache()}}formSubmissionErrored(t,n){console.error(n)}formSubmissionFinished(t){typeof this.adapter.formSubmissionFinished=="function"&&this.adapter.formSubmissionFinished(t)}linkPrefetchingIsEnabledForLocation(t){return typeof this.adapter.linkPrefetchingIsEnabledForLocation=="function"?this.adapter.linkPrefetchingIsEnabledForLocation(t):!0}visitStarted(t){this.delegate.visitStarted(t)}visitCompleted(t){this.delegate.visitCompleted(t),delete this.currentVisit}locationWithActionIsSamePage(t,n){const r=ht(t),i=ht(this.view.lastRenderedLocation),s=n==="restore"&&typeof r>"u";return n!=="replace"&&vi(t)===vi(this.view.lastRenderedLocation)&&(s||r!=null&&r!==i)}visitScrolledToSamePageLocation(t,n){this.delegate.visitScrolledToSamePageLocation(t,n)}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}}Xt=new WeakSet,zo=function(t,n){const{submitter:r,formElement:i}=t;return dt(r,i)||C(this,Xt,$o).call(this,n)},$o=function(t){var r;return t.redirected&&t.location.href===((r=this.location)==null?void 0:r.href)?"replace":"advance"};const et={initial:0,loading:1,interactive:2,complete:3};class Fu{constructor(t){w(this,"stage",et.initial);w(this,"started",!1);w(this,"interpretReadyState",()=>{const{readyState:t}=this;t=="interactive"?this.pageIsInteractive():t=="complete"&&this.pageIsComplete()});w(this,"pageWillUnload",()=>{this.delegate.pageWillUnload()});this.delegate=t}start(){this.started||(this.stage==et.initial&&(this.stage=et.loading),document.addEventListener("readystatechange",this.interpretReadyState,!1),addEventListener("pagehide",this.pageWillUnload,!1),this.started=!0)}stop(){this.started&&(document.removeEventListener("readystatechange",this.interpretReadyState,!1),removeEventListener("pagehide",this.pageWillUnload,!1),this.started=!1)}pageIsInteractive(){this.stage==et.loading&&(this.stage=et.interactive,this.delegate.pageBecameInteractive())}pageIsComplete(){this.pageIsInteractive(),this.stage==et.interactive&&(this.stage=et.complete,this.delegate.pageLoaded())}get readyState(){return document.readyState}}class Vu{constructor(t){w(this,"started",!1);w(this,"onScroll",()=>{this.updatePosition({x:window.pageXOffset,y:window.pageYOffset})});this.delegate=t}start(){this.started||(addEventListener("scroll",this.onScroll,!1),this.onScroll(),this.started=!0)}stop(){this.started&&(removeEventListener("scroll",this.onScroll,!1),this.started=!1)}updatePosition(t){this.delegate.scrollPositionChanged(t)}}class Uu{render({fragment:t}){Vo.preservingPermanentElements(this,Bu(t),()=>{qu(t,()=>{Hu(()=>{document.documentElement.appendChild(t)})})})}enteringBardo(t,n){n.replaceWith(t.cloneNode(!0))}leavingBardo(){}}function Bu(e){const t=xo(document.documentElement),n={};for(const r of t){const{id:i}=r;for(const s of e.querySelectorAll("turbo-stream")){const o=Mo(s.templateElement.content,i);o&&(n[i]=[r,o])}}return n}async function qu(e,t){const n=`turbo-stream-autofocus-${je()}`,r=e.querySelectorAll("turbo-stream"),i=zu(r);let s=null;if(i&&(i.id?s=i.id:s=n,i.id=s),t(),await dn(),(document.activeElement==null||document.activeElement==document.body)&&s){const a=document.getElementById(s);Pi(a)&&a.focus(),a&&a.id==n&&a.removeAttribute("id")}}async function Hu(e){const[t,n]=await Ol(e,()=>document.activeElement),r=t&&t.id;if(r){const i=document.getElementById(r);Pi(i)&&i!=n&&i.focus()}}function zu(e){for(const t of e){const n=wo(t.templateElement.content);if(n)return n}return null}var He;class $u{constructor(t){w(this,"sources",new Set);P(this,He,!1);w(this,"inspectFetchResponse",t=>{const n=Wu(t);n&&Gu(n)&&(t.preventDefault(),this.receiveMessageResponse(n))});w(this,"receiveMessageEvent",t=>
21{R(this,He)&&typeof t.data=="string"&&this.receiveMessageHTML(t.data)});this.delegate=t}start(){R(this,He)||(V(this,He,!0),addEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}stop(){R(this,He)&&(V(this,He,!1),removeEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}connectStreamSource(t){this.streamSourceIsConnected(t)||(this.sources.add(t),t.addEventListener("message",this.receiveMessageEvent,!1))}disconnectStreamSource(t){this.streamSourceIsConnected(t)&&(this.sources.delete(t),t.removeEventListener("message",this.receiveMessageEvent,!1))}streamSourceIsConnected(t){return this.sources.has(t)}async receiveMessageResponse(t){const n=await t.responseHTML;n&&this.receiveMessageHTML(n)}receiveMessageHTML(t){this.delegate.receivedMessageFromStream(mt.wrap(t))}}He=new WeakMap;function Wu(e){var n;const t=(n=e.detail)==null?void 0:n.fetchResponse;if(t instanceof Sr)return t}function Gu(e){return(e.contentType??"").startsWith(mt.contentType)}class ju extends Ui{static renderElement(t,n){const{documentElement:r,body:i}=document;r.replaceChild(n,i)}async render(){this.replaceHeadAndBody(),this.activateScriptElements()}replaceHeadAndBody(){const{documentElement:t,head:n}=document;t.replaceChild(this.newHead,n),this.renderElement(this.currentElement,this.newElement)}activateScriptElements(){for(const t of this.scriptElements){const n=t.parentNode;if(n){const r=gn(t);n.replaceChild(r,t)}}}get newHead(){return this.newSnapshot.headSnapshot.element}get scriptElements(){return document.documentElement.querySelectorAll("script")}}var Er,Wo;class Cr extends Ui{constructor(){super(...arguments);P(this,Er)}static renderElement(n,r){document.body&&r instanceof HTMLBodyElement?document.body.replaceWith(r):document.documentElement.appendChild(r)}get shouldRender(){return this.newSnapshot.isVisitable&&this.trackedElementsAreIdentical}get reloadReason(){if(!this.newSnapshot.isVisitable)return{reason:"turbo_visit_control_is_reload"};if(!this.trackedElementsAreIdentical)return{reason:"tracked_element_mismatch"}}async prepareToRender(){C(this,Er,Wo).call(this),await this.mergeHead()}async render(){this.willRender&&await this.replaceBody()}finishRendering(){super.finishRendering(),this.isPreview||this.focusFirstAutofocusableElement()}get currentHeadSnapshot(){return this.currentSnapshot.headSnapshot}get newHeadSnapshot(){return this.newSnapshot.headSnapshot}get newElement(){return this.newSnapshot.element}async mergeHead(){const n=this.mergeProvisionalElements(),r=this.copyNewHeadStylesheetElements();this.copyNewHeadScriptElements(),await n,await r,this.willRender&&this.removeUnusedDynamicStylesheetElements()}async replaceBody(){await this.preservingPermanentElements(async()=>{this.activateNewBody(),await this.assignNewBody()})}get trackedElementsAreIdentical(){return this.currentHeadSnapshot.trackedElementSignature==this.newHeadSnapshot.trackedElementSignature}async copyNewHeadStylesheetElements(){const n=[];for(const r of this.newHeadStylesheetElements)n.push(Il(r)),document.head.appendChild(r);await Promise.all(n)}copyNewHeadScriptElements(){for(const n of this.newHeadScriptElements)document.head.appendChild(gn(n))}removeUnusedDynamicStylesheetElements(){for(const n of this.unusedDynamicStylesheetElements)document.head.removeChild(n)}async mergeProvisionalElements(){const n=[...this.newHeadProvisionalElements];for(const r of this.currentHeadProvisionalElements)this.isCurrentElementInElementList(r,n)||document.head.removeChild(r);for(const r of n)document.head.appendChild(r)}isCurrentElementInElementList(n,r){for(const[i,s]of r.entries()){if(n.tagName=="TITLE"){if(s.tagName!="TITLE")continue;if(n.innerHTML==s.innerHTML)return r.splice(i,1),!0}if(s.isEqualNode(n))return r.splice(i,1),!0}return!1}removeCurrentHeadProvisionalElements(){for(const n of this.currentHeadProvisionalElements)document.head.removeChild(n)}copyNewHeadProvisionalElements(){for(const n of this.newHeadProvisionalElements)document.head.appendChild(n)}activateNewBody(){document.adoptNode(this.newElement),this.activateNewBodyScriptElements()}activateNewBodyScriptElements(){for(const n of this.newBodyScriptElements){const r=gn(n);n.replaceWith(r)}}async assignNewBody(){await this.renderElement(this.currentElement,this.newElement)}get unusedDynamicStylesheetElements(){return this.oldHeadStylesheetElements.filter(n=>n.getAttribute("data-turbo-track")==="dynamic")}get oldHeadStylesheetElements(){return this.currentHeadSnapshot.getStylesheetElementsNotInSnapshot(this.newHeadSnapshot)}get newHeadStylesheetElements(){return this.newHeadSnapshot.getStylesheetElementsNotInSnapshot(this.currentHeadSnapshot)}get newHeadScriptElements(){return this.newHeadSnapshot.getScriptElementsNotInSnapshot(this.currentHeadSnapshot)}get currentHeadProvisionalElements(){return this.currentHeadSnapshot.provisionalElements}get newHeadProvisionalElements(){return this.newHeadSnapshot.provisionalElements}get newBodyScriptElements(){return this.newElement.querySelectorAll("script")}}Er=new WeakSet,Wo=function(){const{documentElement:n}=this.currentSnapshot,{lang:r}
21=this.newSnapshot;r?n.setAttribute("lang",r):n.removeAttribute("lang")};class Ku extends Cr{static renderElement(t,n){Bi(t,n,{callbacks:{beforeNodeMorphed:r=>!ps(r)}});for(const r of t.querySelectorAll("turbo-frame"))ps(r)&&r.reload();z("turbo:morph",{detail:{currentElement:t,newElement:n}})}async preservingPermanentElements(t){return await t()}get renderMethod(){return"morph"}get shouldAutofocus(){return!1}}function ps(e){return e instanceof ve&&e.src&&e.refresh==="morph"&&!e.closest("[data-turbo-permanent]")}class Yu{constructor(t){w(this,"keys",[]);w(this,"snapshots",{});this.size=t}has(t){return Wn(t)in this.snapshots}get(t){if(this.has(t)){const n=this.read(t);return this.touch(t),n}}put(t,n){return this.write(t,n),this.touch(t),n}clear(){this.snapshots={}}read(t){return this.snapshots[Wn(t)]}write(t,n){this.snapshots[Wn(t)]=n}touch(t){const n=Wn(t),r=this.keys.indexOf(n);r>-1&&this.keys.splice(r,1),this.keys.unshift(n),this.trim()}trim(){for(const t of this.keys.splice(this.size))delete this.snapshots[t]}}class Xu extends No{constructor(){super(...arguments);w(this,"snapshotCache",new Yu(10));w(this,"lastRenderedLocation",new URL(location.href));w(this,"forceReloaded",!1)}shouldTransitionTo(n){return this.snapshot.prefersViewTransitions&&n.prefersViewTransitions}renderPage(n,r=!1,i=!0,s){const a=this.isPageRefresh(s)&&this.snapshot.shouldMorphPage?Ku:Cr,c=new a(this.snapshot,n,r,i);return c.shouldRender?s==null||s.changeHistory():this.forceReloaded=!0,this.render(c)}renderError(n,r){r==null||r.changeHistory();const i=new ju(this.snapshot,n,!1);return this.render(i)}clearSnapshotCache(){this.snapshotCache.clear()}async cacheSnapshot(n=this.snapshot){if(n.isCacheable){this.delegate.viewWillCacheSnapshot();const{lastRenderedLocation:r}=this;await vo();const i=n.clone();return this.snapshotCache.put(r,i),i}}getCachedSnapshotForLocation(n){return this.snapshotCache.get(n)}isPageRefresh(n){return!n||this.lastRenderedLocation.pathname===n.location.pathname&&n.action==="replace"}shouldPreserveScrollPosition(n){return this.isPageRefresh(n)&&this.snapshot.shouldPreserveScrollPosition}get snapshot(){return ge.fromElement(this.element)}}var Mn;class Zu{constructor(t,n){w(this,"selector","a[data-turbo-preload]");P(this,Mn,()=>{this.preloadOnLoadLinksForView(document.body)});this.delegate=t,this.snapshotCache=n}start(){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",R(this,Mn)):this.preloadOnLoadLinksForView(document.body)}stop(){document.removeEventListener("DOMContentLoaded",R(this,Mn))}preloadOnLoadLinksForView(t){for(const n of t.querySelectorAll(this.selector))this.delegate.shouldPreloadLink(n)&&this.preloadURL(n)}async preloadURL(t){const n=new URL(t.href);if(this.snapshotCache.has(n))return;await new Zt(this,ue.get,n,new URLSearchParams,t).perform()}prepareRequest(t){t.headers["X-Sec-Purpose"]="prefetch"}async requestSucceededWithResponse(t,n){try{const r=await n.responseHTML,i=ge.fromHTMLString(r);this.snapshotCache.put(t.url,i)}catch{}}requestStarted(t){}requestErrored(t){}requestFinished(t){}requestPreventedHandlingResponse(t,n){}requestFailedWithResponse(t,n){}}Mn=new WeakMap;var Vt,tr;class Ju{constructor(t){P(this,Vt);this.session=t}clear(){this.session.clearCache()}resetCacheControl(){C(this,Vt,tr).call(this,"")}exemptPageFromCache(){C(this,Vt,tr).call(this,"no-cache")}exemptPageFromPreview(){C(this,Vt,tr).call(this,"no-preview")}}Vt=new WeakSet,tr=function(t){Ll("turbo-cache-control",t)};var xn;class Qu{constructor(t){w(this,"navigator",new Du(this));w(this,"history",new Iu(this));w(this,"view",new Xu(this,document.documentElement));w(this,"adapter",new Au(this));w(this,"pageObserver",new Fu(this));w(this,"cacheObserver",new Ru);w(this,"linkPrefetchObserver",new ku(this,document));w(this,"linkClickObserver",new Do(this,window));w(this,"formSubmitObserver",new Vi(this,document));w(this,"scrollObserver",new Vu(this));w(this,"streamObserver",new $u(this));w(this,"formLinkClickObserver",new Fo(this,document.documentElement));w(this,"frameRedirector",new Cu(this,document.documentElement));w(this,"streamMessageRenderer",new Uu);
21w(this,"cache",new Ju(this));w(this,"enabled",!0);w(this,"started",!1);P(this,xn,150);this.recentRequests=t,this.preloader=new Zu(this,this.view.snapshotCache),this.debouncedRefresh=this.refresh,this.pageRefreshDebouncePeriod=this.pageRefreshDebouncePeriod}start(){this.started||(this.pageObserver.start(),this.cacheObserver.start(),this.linkPrefetchObserver.start(),this.formLinkClickObserver.start(),this.linkClickObserver.start(),this.formSubmitObserver.start(),this.scrollObserver.start(),this.streamObserver.start(),this.frameRedirector.start(),this.history.start(),this.preloader.start(),this.started=!0,this.enabled=!0)}disable(){this.enabled=!1}stop(){this.started&&(this.pageObserver.stop(),this.cacheObserver.stop(),this.linkPrefetchObserver.stop(),this.formLinkClickObserver.stop(),this.linkClickObserver.stop(),this.formSubmitObserver.stop(),this.scrollObserver.stop(),this.streamObserver.stop(),this.frameRedirector.stop(),this.history.stop(),this.preloader.stop(),this.started=!1)}registerAdapter(t){this.adapter=t}visit(t,n={}){const r=n.frame?document.getElementById(n.frame):null;if(r instanceof ve){const i=n.action||dt(r);r.delegate.proposeVisitIfNavigatedWithAction(r,i),r.src=t.toString()}else this.navigator.proposeVisit(Z(t),n)}refresh(t,n){const r=n&&this.recentRequests.has(n),i=t===document.baseURI;!r&&!this.navigator.currentVisit&&i&&this.visit(t,{action:"replace",shouldCacheSnapshot:!1})}connectStreamSource(t){this.streamObserver.connectStreamSource(t)}disconnectStreamSource(t){this.streamObserver.disconnectStreamSource(t)}renderStreamMessage(t){this.streamMessageRenderer.render(mt.wrap(t))}clearCache(){this.view.clearSnapshotCache()}setProgressBarDelay(t){console.warn("Please replace `session.setProgressBarDelay(delay)` with `session.progressBarDelay = delay`. The function is deprecated and will be removed in a future version of Turbo.`"),this.progressBarDelay=t}set progressBarDelay(t){K.drive.progressBarDelay=t}get progressBarDelay(){return K.drive.progressBarDelay}set drive(t){K.drive.enabled=t}get drive(){return K.drive.enabled}set formMode(t){K.forms.mode=t}get formMode(){return K.forms.mode}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}get pageRefreshDebouncePeriod(){return R(this,xn)}set pageRefreshDebouncePeriod(t){this.refresh=Ml(this.debouncedRefresh.bind(this),t),V(this,xn,t)}shouldPreloadLink(t){const n=t.hasAttribute("data-turbo-method"),r=t.hasAttribute("data-turbo-stream"),i=t.getAttribute("data-turbo-frame"),s=i=="_top"?null:document.getElementById(i)||xt(t,"turbo-frame:not([disabled])");if(n||r||s instanceof ve)return!1;{const o=new URL(t.href);return this.elementIsNavigatable(t)&&Ue(o,this.snapshot.rootLocation)}}historyPoppedToLocationWithRestorationIdentifierAndDirection(t,n,r){this.enabled?this.navigator.startVisit(t,n,{action:"restore",historyChanged:!0,direction:r}):this.adapter.pageInvalidated({reason:"turbo_disabled"})}scrollPositionChanged(t){this.history.updateRestorationData({scrollPosition:t})}willSubmitFormLinkToLocation(t,n){return this.elementIsNavigatable(t)&&Ue(n,this.snapshot.rootLocation)}submittedFormLinkToLocation(){}canPrefetchRequestToLocation(t,n){return this.elementIsNavigatable(t)&&Ue(n,this.snapshot.rootLocation)&&this.navigator.linkPrefetchingIsEnabledForLocation(n)}willFollowLinkToLocation(t,n,r){return this.elementIsNavigatable(t)&&Ue(n,this.snapshot.rootLocation)&&this.applicationAllowsFollowingLinkToLocation(t,n,r)}followedLinkToLocation(t,n){const r=this.getActionForLink(t),i=t.hasAttribute("data-turbo-stream");this.visit(n.href,{action:r,acceptsStreamResponse:i})}allowsVisitingLocationWithAction(t,n){return this.locationWithActionIsSamePage(t,n)||this.applicationAllowsVisitingLocation(t)}visitProposedToLocation(t,n){gs(t),this.adapter.visitProposedToLocation(t,n)}visitStarted(t){t.acceptsStreamResponse||(lr(document.documentElement),this.view.markVisitDirection(t.direction)),gs(t.location),t.silent||this.notifyApplicationAfterVisitingLocation(t.location,t.action)}visitCompleted(t){this.view.unmarkVisitDirection(),ur(document.documentElement),this.notifyApplicationAfterPageLoad(t.getTimingMetrics())}locationWithActionIsSamePage(t,n){return this.navigator.locationWithActionIsSamePage(t,n)}visitScrolledToSamePageLocation(t,n){this.notifyApplicationAfterVisitingSamePageLocation(t,n)}willSubmitForm(t,n){const r=Di(t,n);return this.submissionIsNavigatable(t,n)&&Ue(Z(r),this.snapshot.rootLocation)}formSubmitted(t,n){this.navigator.submitForm(t,n)}pageBecameInteractive(){this.view.lastRenderedLocation=this.location,this.notifyApplicationAfterPageLoad()}
21pageLoaded(){this.history.assumeControlOfScrollRestoration()}pageWillUnload(){this.history.relinquishControlOfScrollRestoration()}receivedMessageFromStream(t){this.renderStreamMessage(t)}viewWillCacheSnapshot(){var t;(t=this.navigator.currentVisit)!=null&&t.silent||this.notifyApplicationBeforeCachingSnapshot()}allowsImmediateRender({element:t},n){const r=this.notifyApplicationBeforeRender(t,n),{defaultPrevented:i,detail:{render:s}}=r;return this.view.renderer&&s&&(this.view.renderer.renderElement=s),!i}viewRenderedSnapshot(t,n,r){this.view.lastRenderedLocation=this.history.location,this.notifyApplicationAfterRender(r)}preloadOnLoadLinksForView(t){this.preloader.preloadOnLoadLinksForView(t)}viewInvalidated(t){this.adapter.pageInvalidated(t)}frameLoaded(t){this.notifyApplicationAfterFrameLoad(t)}frameRendered(t,n){this.notifyApplicationAfterFrameRender(t,n)}applicationAllowsFollowingLinkToLocation(t,n,r){return!this.notifyApplicationAfterClickingLinkToLocation(t,n,r).defaultPrevented}applicationAllowsVisitingLocation(t){return!this.notifyApplicationBeforeVisitingLocation(t).defaultPrevented}notifyApplicationAfterClickingLinkToLocation(t,n,r){return z("turbo:click",{target:t,detail:{url:n.href,originalEvent:r},cancelable:!0})}notifyApplicationBeforeVisitingLocation(t){return z("turbo:before-visit",{detail:{url:t.href},cancelable:!0})}notifyApplicationAfterVisitingLocation(t,n){return z("turbo:visit",{detail:{url:t.href,action:n}})}notifyApplicationBeforeCachingSnapshot(){return z("turbo:before-cache")}notifyApplicationBeforeRender(t,n){return z("turbo:before-render",{detail:{newBody:t,...n},cancelable:!0})}notifyApplicationAfterRender(t){return z("turbo:render",{detail:{renderMethod:t}})}notifyApplicationAfterPageLoad(t={}){return z("turbo:load",{detail:{url:this.location.href,timing:t}})}notifyApplicationAfterVisitingSamePageLocation(t,n){dispatchEvent(new HashChangeEvent("hashchange",{oldURL:t.toString(),newURL:n.toString()}))}notifyApplicationAfterFrameLoad(t){return z("turbo:frame-load",{target:t})}notifyApplicationAfterFrameRender(t,n){return z("turbo:frame-render",{detail:{fetchResponse:t},target:n,cancelable:!0})}submissionIsNavigatable(t,n){if(K.forms.mode=="off")return!1;{const r=n?this.elementIsNavigatable(n):!0;return K.forms.mode=="optin"?r&&t.closest('[data-turbo="true"]')!=null:r&&this.elementIsNavigatable(t)}}elementIsNavigatable(t){const n=xt(t,"[data-turbo]"),r=xt(t,"turbo-frame");return K.drive.enabled||r?n?n.getAttribute("data-turbo")!="false":!0:n?n.getAttribute("data-turbo")=="true":!1}getActionForLink(t){return dt(t)||"advance"}get snapshot(){return this.view.snapshot}}xn=new WeakMap;function gs(e){Object.defineProperties(e,ed)}const ed={absoluteURL:{get(){return this.toString()}}},W=new Qu(Co),{cache:Go,navigator:jo}=W;function qi(){W.start()}function Ko(e){W.registerAdapter(e)}function Yo(e,t){W.visit(e,t)}function Ir(e){W.connectStreamSource(e)}function kr(e){W.disconnectStreamSource(e)}function Xo(e){W.renderStreamMessage(e)}function Zo(){console.warn("Please replace `Turbo.clearCache()` with `Turbo.cache.clear()`. The top-level function is deprecated and will be removed in a future version of Turbo.`"),W.clearCache()}function Jo(e){console.warn("Please replace `Turbo.setProgressBarDelay(delay)` with `Turbo.config.drive.progressBarDelay = delay`. The top-level function is deprecated and will be removed in a future version of Turbo.`"),K.drive.progressBarDelay=e}function Qo(e){console.warn("Please replace `Turbo.setConfirmMethod(confirmMethod)` with `Turbo.config.forms.confirm = confirmMethod`. The top-level function is deprecated and will be removed in a future version of Turbo.`"),K.forms.confirm=e}function ea(e){console.warn("Please replace `Turbo.setFormMode(mode)` with `Turbo.config.forms.mode = mode`. The top-level function is deprecated and will be removed in a future version of Turbo.`"),K.forms.mode=e}var td=Object.freeze({__proto__:null,navigator:jo,session:W,cache:Go,PageRenderer:Cr,PageSnapshot:ge,FrameRenderer:Rr,fetch:Fi,config:K,start:qi,registerAdapter:Ko,visit:Yo,connectStreamSource:Ir,disconnectStreamSource:kr,render
21StreamMessage:Xo,clearCache:Zo,setProgressBarDelay:Jo,setConfirmMethod:Qo,setFormMode:ea});class nd extends Error{}var Ut,Se,ze,Nn,Bt,qt,k,Rt,ta,na,ra,ia,sa,oa,aa,Ei,Ct,ca,nr,la,ua,da;class rd{constructor(t){P(this,k);w(this,"fetchResponseLoaded",t=>Promise.resolve());P(this,Ut,null);P(this,Se,()=>{});P(this,ze,!1);P(this,Nn,!1);P(this,Bt,new Set);P(this,qt,!1);w(this,"action",null);w(this,"visitCachedSnapshot",({element:t})=>{const n=t.querySelector("#"+this.element.id);n&&this.previousFrameElement&&n.replaceChildren(...this.previousFrameElement.children),delete this.previousFrameElement});this.element=t,this.view=new ou(this,this.element),this.appearanceObserver=new Gl(this,this.element),this.formLinkClickObserver=new Fo(this,this.element),this.linkInterceptor=new Po(this,this.element),this.restorationIdentifier=je(),this.formSubmitObserver=new Vi(this,this.element)}connect(){R(this,ze)||(V(this,ze,!0),this.loadingStyle==ot.lazy?this.appearanceObserver.start():C(this,k,Rt).call(this),this.formLinkClickObserver.start(),this.linkInterceptor.start(),this.formSubmitObserver.start())}disconnect(){R(this,ze)&&(V(this,ze,!1),this.appearanceObserver.stop(),this.formLinkClickObserver.stop(),this.linkInterceptor.stop(),this.formSubmitObserver.stop())}disabledChanged(){this.loadingStyle==ot.eager&&C(this,k,Rt).call(this)}sourceURLChanged(){C(this,k,la).call(this,"src")||(this.element.isConnected&&(this.complete=!1),(this.loadingStyle==ot.eager||R(this,Nn))&&C(this,k,Rt).call(this))}sourceURLReloaded(){const{refresh:t,src:n}=this.element;return V(this,qt,n&&t==="morph"),this.element.removeAttribute("complete"),this.element.src=null,this.element.src=n,this.element.loaded}loadingStyleChanged(){this.loadingStyle==ot.lazy?this.appearanceObserver.start():(this.appearanceObserver.stop(),C(this,k,Rt).call(this))}async loadResponse(t){(t.redirected||t.succeeded&&t.isHTML)&&(this.sourceURL=t.response.url);try{const n=await t.responseHTML;if(n){const r=yo(n);ge.fromDocument(r).isVisitable?await C(this,k,ta).call(this,t,r):await C(this,k,ia).call(this,t)}}finally{V(this,qt,!1),this.fetchResponseLoaded=()=>Promise.resolve()}}elementAppearedInViewport(t){this.proposeVisitIfNavigatedWithAction(t,dt(t)),C(this,k,Rt).call(this)}willSubmitFormLinkToLocation(t){return C(this,k,nr).call(this,t)}submittedFormLinkToLocation(t,n,r){const i=C(this,k,Ct).call(this,t);i&&r.setAttribute("data-turbo-frame",i.id)}shouldInterceptLinkClick(t,n,r){return C(this,k,nr).call(this,t)}linkClickIntercepted(t,n){C(this,k,ra).call(this,t,n)}willSubmitForm(t,n){return t.closest("turbo-frame")==this.element&&C(this,k,nr).call(this,t,n)}formSubmitted(t,n){this.formSubmission&&this.formSubmission.stop(),this.formSubmission=new Tr(this,t,n);const{fetchRequest:r}=this.formSubmission;this.prepareRequest(r),this.formSubmission.start()}prepareRequest(t){var n;t.headers["Turbo-Frame"]=this.id,(n=this.currentNavigationElement)!=null&&n.hasAttribute("data-turbo-stream")&&t.acceptResponseType(mt.contentType)}requestStarted(t){lr(this.element)}requestPreventedHandlingResponse(t,n){R(this,Se).call(this)}async requestSucceededWithResponse(t,n){await this.loadResponse(n),R(this,Se).call(this)}async requestFailedWithResponse(t,n){await this.loadResponse(n),R(this,Se).call(this)}requestErrored(t,n){console.error(n),R(this,Se).call(this)}requestFinished(t){ur(this.element)}formSubmissionStarted({formElement:t}){lr(t,C(this,k,Ct).call(this,t))}formSubmissionSucceededWithResponse(t,n){const r=C(this,k,Ct).call(this,t.formElement,t.submitter);r.delegate.proposeVisitIfNavigatedWithAction(r,dt(t.submitter,t.formElement,r)),r.delegate.loadResponse(n),t.isSafe||W.clearCache()}formSubmissionFailedWithResponse(t,n){this.element.delegate.loadResponse(n),W.clearCache()}formSubmissionErrored(t,n){console.error(n)}formSubmissionFinished({formElement:t}){ur(t,C(this,k,Ct).call(this,t))}allowsImmediateRender({element:t},n){const r=z("turbo:before-frame-render",{target:this.element,detail:{newFrame:t,...n},cancelable:!0}),{defaultPrevented:i,detail:{render:s}}=r;return this.view.renderer&&s&&(this.view.renderer.renderElement=s),!i}viewRenderedSnapshot(t,n,r){}preloadOnLoadLinksForView(t){W.preloadOnLoadLinksForView(t)}viewInvalidated(){}
21willRenderFrame(t,n){this.previousFrameElement=t.cloneNode(!0)}proposeVisitIfNavigatedWithAction(t,n=null){if(this.action=n,this.action){const r=ge.fromElement(t).clone(),{visitCachedSnapshot:i}=t.delegate;t.delegate.fetchResponseLoaded=async s=>{if(t.src){const{statusCode:o,redirected:a}=s,c=await s.responseHTML,h={response:{statusCode:o,redirected:a,responseHTML:c},visitCachedSnapshot:i,willRender:!1,updateHistory:!1,restorationIdentifier:this.restorationIdentifier,snapshot:r};this.action&&(h.action=this.action),W.visit(t.src,h)}}}}changeHistory(){if(this.action){const t=So(this.action);W.history.update(t,Z(this.element.src||""),this.restorationIdentifier)}}async extractForeignFrameElement(t){let n;const r=CSS.escape(this.id);try{if(n=vs(t.querySelector(`turbo-frame#${r}`),this.sourceURL),n)return n;if(n=vs(t.querySelector(`turbo-frame[src][recurse~=${r}]`),this.sourceURL),n)return await n.loaded,await this.extractForeignFrameElement(n)}catch(i){return console.error(i),new ve}return null}get id(){return this.element.id}get enabled(){return!this.element.disabled}get sourceURL(){if(this.element.src)return this.element.src}set sourceURL(t){C(this,k,ua).call(this,"src",()=>{this.element.src=t??null})}get loadingStyle(){return this.element.loading}get isLoading(){return this.formSubmission!==void 0||R(this,Se).call(this)!==void 0}get complete(){return this.element.hasAttribute("complete")}set complete(t){t?this.element.setAttribute("complete",""):this.element.removeAttribute("complete")}get isActive(){return this.element.isActive&&R(this,ze)}get rootLocation(){const t=this.element.ownerDocument.querySelector('meta[name="turbo-root"]'),n=(t==null?void 0:t.content)??"/";return Z(n)}}Ut=new WeakMap,Se=new WeakMap,ze=new WeakMap,Nn=new WeakMap,Bt=new WeakMap,qt=new WeakMap,k=new WeakSet,Rt=async function(){this.enabled&&this.isActive&&!this.complete&&this.sourceURL&&(this.element.loaded=C(this,k,na).call(this,Z(this.sourceURL)),this.appearanceObserver.stop(),await this.element.loaded,V(this,Nn,!0))},ta=async function(t,n){const r=await this.extractForeignFrameElement(n.body),i=R(this,qt)?hu:Rr;if(r){const s=new Ar(r),o=new i(this,this.view.snapshot,s,!1,!1);this.view.renderPromise&&await this.view.renderPromise,this.changeHistory(),await this.view.render(o),this.complete=!0,W.frameRendered(t,this.element),W.frameLoaded(this.element),await this.fetchResponseLoaded(t)}else C(this,k,sa).call(this,t)&&C(this,k,oa).call(this,t)},na=async function(t){var r;const n=new Zt(this,ue.get,t,new URLSearchParams,this.element);return(r=R(this,Ut))==null||r.cancel(),V(this,Ut,n),new Promise(i=>{V(this,Se,()=>{V(this,Se,()=>{}),V(this,Ut,null),i()}),n.perform()})},ra=function(t,n,r){const i=C(this,k,Ct).call(this,t,r);i.delegate.proposeVisitIfNavigatedWithAction(i,dt(r,t,i)),C(this,k,da).call(this,t,()=>{i.src=n})},ia=async function(t){console.warn(`The response (${t.statusCode}) from <turbo-frame id="${this.element.id}"> is performing a full page visit due to turbo-visit-control.`),await C(this,k,Ei).call(this,t.response)},sa=function(t){this.element.setAttribute("complete","");const n=t.response,r=async(s,o)=>{s instanceof Response?C(this,k,Ei).call(this,s):W.visit(s,o)};return!z("turbo:frame-missing",{target:this.element,detail:{response:n,visit:r},cancelable:!0}).defaultPrevented},oa=function(t){this.view.missing(),C(this,k,aa).call(this,t)},aa=function(t){const n=`The response (${t.statusCode}) did not contain the expected <turbo-frame id="${this.element.id}"> and will be ignored. To perform a full page visit instead, set turbo-visit-control to reload.`;throw new nd(n)},Ei=async function(t){const n=new Sr(t),r=await n.responseHTML,{location:i,redirected:s,statusCode:o}=n;return W.visit(i,{response:{redirected:s,statusCode:o,responseHTML:r}})},Ct=function(t,n){const r=cr("data-turbo-frame",n,t)||this.element.getAttribute("target");return bs(r)??this.element},ca=function(t,n){const r=Di(t,n);return Ue(Z(r),this.rootLocation)},nr=function(t,n){const r=cr("data-turbo-frame",n,t)||this.element.getAttribute("target");if(t instanceof HTMLFormElement&&!C(this,k,ca).call(this,t,n)||!this.enabled||r=="_top")return!1;if(r){const i=bs(r);if(i)return!i.disabled}return!(!W.elementIsNavigatable(t)||n&&!W.elementIsNavigatable(n))},la=function(t){return R(this,Bt).has(t)},ua=function(t,n){R(this,Bt).add(t),n(),R(this,Bt).delete(t)},da=function(t,n){this.currentNavigationElement=t,n(),delete this.currentNavigationElement};function bs(e){if(e!=null){const t=document.getElementById(e);if(t instanceof ve)return t}}function vs(e,t){if(e){const n=e.getAttribute("src");if(n!=null&&t!=null&&Vl(n,t))throw new Error(`Matching <turbo-frame id="${e.id}"> element has a source URL which references itself`);if(e.ownerDocument!==document&&(e=document.importNode(e,!0)),e instanceof ve)return e.connectedCallback(),e.disconnectedCallback(),e}}
21const Hi={after(){this.targetElements.forEach(e=>{var t;return(t=e.parentElement)==null?void 0:t.insertBefore(this.templateContent,e.nextSibling)})},append(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(e=>e.append(this.templateContent))},before(){this.targetElements.forEach(e=>{var t;return(t=e.parentElement)==null?void 0:t.insertBefore(this.templateContent,e)})},prepend(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(e=>e.prepend(this.templateContent))},remove(){this.targetElements.forEach(e=>e.remove())},replace(){const e=this.getAttribute("method");this.targetElements.forEach(t=>{e==="morph"?Bi(t,this.templateContent):t.replaceWith(this.templateContent)})},update(){const e=this.getAttribute("method");this.targetElements.forEach(t=>{e==="morph"?Uo(t,this.templateContent):(t.innerHTML="",t.append(this.templateContent))})},refresh(){W.refresh(this.baseURI,this.requestId)}};var ut,un;const us=class us extends HTMLElement{constructor(){super(...arguments);P(this,ut)}static async renderElement(n){await n.performAction()}async connectedCallback(){try{await this.render()}catch(n){console.error(n)}finally{this.disconnect()}}async render(){return this.renderPromise??(this.renderPromise=(async()=>{const n=this.beforeRenderEvent;this.dispatchEvent(n)&&(await dn(),await n.detail.render(this))})())}disconnect(){try{this.remove()}catch{}}removeDuplicateTargetChildren(){this.duplicateChildren.forEach(n=>n.remove())}get duplicateChildren(){var i;const n=this.targetElements.flatMap(s=>[...s.children]).filter(s=>!!s.getAttribute("id")),r=[...((i=this.templateContent)==null?void 0:i.children)||[]].filter(s=>!!s.getAttribute("id")).map(s=>s.getAttribute("id"));return n.filter(s=>r.includes(s.getAttribute("id")))}get performAction(){if(this.action){const n=Hi[this.action];if(n)return n;C(this,ut,un).call(this,"unknown action")}C(this,ut,un).call(this,"action attribute is missing")}get targetElements(){if(this.target)return this.targetElementsById;if(this.targets)return this.targetElementsByQuery;C(this,ut,un).call(this,"target or targets attribute is missing")}get templateContent(){return this.templateElement.content.cloneNode(!0)}get templateElement(){if(this.firstElementChild===null){const n=this.ownerDocument.createElement("template");return this.appendChild(n),n}else if(this.firstElementChild instanceof HTMLTemplateElement)return this.firstElementChild;C(this,ut,un).call(this,"first child element must be a <template> element")}get action(){return this.getAttribute("action")}get target(){return this.getAttribute("target")}get targets(){return this.getAttribute("targets")}get requestId(){return this.getAttribute("request-id")}get description(){return(this.outerHTML.match(/<[^>]+>/)??[])[0]??"<turbo-stream>"}get beforeRenderEvent(){return new CustomEvent("turbo:before-stream-render",{bubbles:!0,cancelable:!0,detail:{newStream:this,render:us.renderElement}})}get targetElementsById(){var r;const n=(r=this.ownerDocument)==null?void 0:r.getElementById(this.target);return n!==null?[n]:[]}get targetElementsByQuery(){var r;const n=(r=this.ownerDocument)==null?void 0:r.querySelectorAll(this.targets);return n.length!==0?Array.prototype.slice.call(n):[]}};ut=new WeakSet,un=function(n){throw new Error(`${this.description}: ${n}`)};let hr=us;class ha extends HTMLElement{constructor(){super(...arguments);w(this,"streamSource",null)}connectedCallback(){this.streamSource=this.src.match(/^ws{1,2}:/)?new WebSocket(this.src):new EventSource(this.src),Ir(this.streamSource)}disconnectedCallback(){this.streamSource&&(this.streamSource.close(),kr(this.streamSource))}get src(){return this.getAttribute("src")||""}}ve.delegateConstructor=rd;customElements.get("turbo-frame")===void 0&&customElements.define("turbo-frame",ve);customElements.get("turbo-stream")===void 0&&customElements.define("turbo-stream",hr);customElements.get("turbo-stream-source")===void 0&&customElements.define("turbo-stream-source",ha);(()=>{let e=document.currentScript;if(e&&!e.hasAttribute("data-turbo-suppress-warning"))for(e=e.parentElement;e;){if(e==document.body)return console.warn(Eo` 22 You are loading Turbo from a <script> element inside the <body> element. This is probably not what you meant to do! 23 24 Load your applicationâs JavaScript bundle inside the <head> element instead. <script> elements in <body> are evaluated with each page change. 25 26 For more information, see: https://turbo.hotwired.dev/handbook/building#working-with-script-elements 27 28 ââ 29 Suppress this warning by adding a "data-turbo-suppress-warning" attribute to: %s 30 `,e.outerHTML);e=e.parentElement}})();window.Turbo={...td,StreamActions:Hi};qi();const id=Object.freeze(Object.defineProperty({__proto__:null,FetchEnctype:Be,FetchMethod:ue,FetchRequest:Zt,FetchResponse:Sr,FrameElement:ve,FrameLoadingStyle:ot,FrameRenderer:Rr,PageRenderer:Cr,PageSnapshot:ge,StreamActions:Hi,StreamElement:hr,StreamSourceElement:ha,cache:Go,clearCache:Zo,config:K,connectStreamSource:Ir,disconnectStreamSource:kr,fetch:Fi,fetchEnctypeFromString:Io,fetchMethodFromString:_r,isSafe:wr,navigator:jo,registerAdapter
30:Ko,renderStreamMessage:Xo,session:W,setConfirmMethod:Qo,setFormMode:ea,setProgressBarDelay:Jo,start:qi,visit:Yo},Symbol.toStringTag,{value:"Module"})),sd="modulepreload",od=function(e){return"/kin_portal-vite/"+e},ys={},zi=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.allSettled(n.map(c=>{if(c=od(c),c in ys)return;ys[c]=!0;const l=c.endsWith(".css"),h=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${h}`))return;const d=document.createElement("link");if(d.rel=l?"stylesheet":sd,l||(d.as="script"),d.crossOrigin="",d.href=c,a&&d.setAttribute("nonce",a),document.head.appendChild(d),l)return new Promise((u,f)=>{d.addEventListener("load",u),d.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${c}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return t().catch(s)})};let fa;async function ad(){return fa||Es(cd().then(Es))}function Es(e){return fa=e}async function cd(){const{createConsumer:e}=await zi(async()=>{const{createConsumer:t}=await import("./index-lVzqX2jn.js");return{createConsumer:t}},[]);return e()}async function ld(e,t){const{subscriptions:n}=await ad();return n.create(e,t)}function Si(e){return!e||typeof e!="object"||e instanceof Date||e instanceof RegExp?e:Array.isArray(e)?e.map(Si):Object.keys(e).reduce(function(t,n){var r=n[0].toLowerCase()+n.slice(1).replace(/([A-Z]+)/g,function(i,s){return"_"+s.toLowerCase()});return t[r]=Si(e[n]),t},{})}class ma extends HTMLElement{async connectedCallback(){Ir(this),this.subscription=await ld(this.channel,{received:this.dispatchMessageEvent.bind(this),connected:this.subscriptionConnected.bind(this),disconnected:this.subscriptionDisconnected.bind(this)})}disconnectedCallback(){kr(this),this.subscription&&this.subscription.unsubscribe(),this.subscriptionDisconnected()}attributeChangedCallback(){this.subscription&&(this.disconnectedCallback(),this.connectedCallback())}dispatchMessageEvent(t){const n=new MessageEvent("message",{data:t});return this.dispatchEvent(n)}subscriptionConnected(){this.setAttribute("connected","")}subscriptionDisconnected(){this.removeAttribute("connected")}get channel(){const t=this.getAttribute("channel"),n=this.getAttribute("signed-stream-name");return{channel:t,signed_stream_name:n,...Si({...this.dataset})}}}w(ma,"observedAttributes",["channel","signed-stream-name"]);customElements.get("turbo-cable-stream-source")===void 0&&customElements.define("turbo-cable-stream-source",ma);function ud(e){if(e.target instanceof HTMLFormElement){const{target:t,detail:{fetchOptions:n}}=e;t.addEventListener("turbo:submit-start",({detail:{formSubmission:{submitter:r}}})=>{const i=fd(n.body)?n.body:new URLSearchParams,s=dd(r,i,t);/get/i.test(s)||(/post/i.test(s)?i.delete("_method"):i.set("_method",s),n.method="post")},{once:!0})}}function dd(e,t,n){const r=hd(e),i=t.get("_method"),s=n.getAttribute("method")||"get";return typeof r=="string"?r:typeof i=="string"?i:s}function hd(e){return e instanceof HTMLButtonElement||e instanceof HTMLInputElement?e.name==="_method"?e.value:e.hasAttribute("formmethod")?e.formMethod:null:null}function fd(e){return e instanceof FormData||e instanceof URLSearchParams}window.Turbo=id;addEventListener("turbo:before-fetch-request",ud);const Lr={log:"log",debug:"debug",info:"info",warn:"warn",error:"error"},Oe=console,It={};Object.keys(Lr).forEach(e=>{It[e]=Oe[e]});const rn="Datadog Browser SDK:",L={debug:It.debug.bind(Oe,rn),log:It.log.bind(Oe,rn),info:It.info.bind(Oe,rn),warn:It.warn.bind(Oe,rn),error:It.error.bind(Oe,rn)},Or="https://docs.datadoghq.com",md=`${Or}/real_user_monitoring/browser/troubleshooting`,$i="More details:";function pa(e,t){return(...n)=>{try{return e(...n)}catch(r){L.error(t,r)}}}function at(e){return e!==0&&Math.random()*100<=e}function hn(e,t){return+e.toFixed(t)}function pd(e){return Pn(e)&&e>=0&&e<=100}function Pn(e){return typeof e=="number"}const ne=1e3,ce=60*ne,ga=60*ce,gd=24*ga,ba=365*gd;function Mr(e){return{relative:e,timeStamp:vd(e)}}function bd(e){return{relative:Wi(e),timeStamp:e}}function vd(e){const t=ae()-performance.now();return t>Dn()?Math.round(Jt(t,e)):Ed(e)}function yd(){return Math.round(ae()-Jt(Dn(),performance.now()))}function M(e){return Pn(e)?hn(e*1e6,0):e}function ae(){return new Date().getTime()}function J(){return ae()}function de(){return performance.now()}function Q(){return{relative:de(),timeStamp:J()}}function va(){return{relative:0,timeStamp:Dn()}}function G(e,t){return t-e}function Jt(e,t){return e+t}function Wi(e){return e-Dn()}function Ed(e){return Math.round(Jt(Dn(),e))}function Sd(e){return e<ba}let Xr;function Dn(){var e,t;return Xr===void 0&&(Xr=(t=(e=performance.timing)===null||e===void 0?void 0:e.navigationStart)!==null&&t!==void 0?t:performance.timeOrigin),Xr}const Ht=1024,ya=1024*Ht,_d=/[^\u0000-\u007F]/;function Ea(e){return _d.test(e)?window.TextEncoder!==void 0?new TextEncoder().encode(e).length:new Blob([e]).size:e.length}function wd(e){const t=e.reduce((i,s)=>i+s.length,0),n=new Uint8Array(t);let r=0;for(const i of e)n.set(i,r),r+=i.length;return n}function bn(e){return{...e}}function fr(e,t){return Object.keys(e).some(n=>e[n]===t)}function Ze(e){return Object.keys(e).length===0}function Sa(e,t){const n={};for(const r of Object.keys(e))n[r]=t(e[r]);return n}function ye(){if(typeof globalThis=="object")return globalThis;Object.defineProperty(Object.prototype,"_dd_temp_",{get(){return this},configurable:!0});let e=_dd_temp_;return delete Object.prototype._dd_temp_,typeof e!="object"&&(typeof self=="object"?e=self:typeof window=="object"?e=window:e={}),e}const we=ye(),mr="WorkerGlobalScope"in we;function Ke(e,t){const n=ye();let r;return n.Zone&&typeof n.Zone.__symbol__=="function"&&(r=e[n.Zone.__symbol__(t)]),r||(r=e[t]),r}let _i,_a=!1;function Td(e){_i=e}function Ad(e){_a=e}function I(e){return function(){return We(e,this,arguments)}}function We(e,t,n){try{return e.apply(t,n)}catch(r){ft(r)}}function ft(e){if(wi(e),_i)try{_i(e)}catch(t){wi(t)}}function wi(...e){_a&&L.error("[MONITOR]",...e)}function ee(e,t){return Ke(ye(),"setTimeout")(I(e),t)}function pe(e){Ke(ye(),"clearTimeout")(e)}function Qt(e,t){return Ke(ye(),"setInterval")(I(e),t)}function xr(e){Ke(ye(),"clearInterval")(e)}function Ss(e){var t;const n=(t=we.queueMicrotask)===null||t===void 0?void 0:t.bind(we);typeof n=="function"?n(I(e)):Promise.resolve().then(I(e))}class D{constructor(t){this.onFirstSubscribe=t,this.observers=[]}subscribe(t){return this.addObserver(t),{unsubscribe:()=>this.removeObserver(t)}}
30notify(t){this.observers.forEach(n=>n(t))}addObserver(t){this.observers.push(t),this.observers.length===1&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe(this)||void 0)}removeObserver(t){this.observers=this.observers.filter(n=>t!==n),!this.observers.length&&this.onLastUnsubscribe&&this.onLastUnsubscribe()}}function wa(...e){return new D(t=>{const n=e.map(r=>r.subscribe(i=>t.notify(i)));return()=>n.forEach(r=>r.unsubscribe())})}class Ta extends D{constructor(t){super(),this.maxBufferSize=t,this.buffer=[]}notify(t){this.buffer.push(t),this.buffer.length>this.maxBufferSize&&this.buffer.shift(),super.notify(t)}subscribe(t){let n=!1;const r={unsubscribe:()=>{n=!0,this.removeObserver(t)}};return Ss(()=>{for(const i of this.buffer){if(n)return;t(i)}n||this.addObserver(t)}),r}unbuffer(){Ss(()=>{this.maxBufferSize=this.buffer.length=0})}}function Nr(e,t,n){const r=n&&n.leading!==void 0?n.leading:!0,i=n&&n.trailing!==void 0?n.trailing:!0;let s=!1,o,a;return{throttled:(...c)=>{if(s){o=c;return}r?e(...c):o=c,s=!0,a=ee(()=>{i&&o&&e(...o),s=!1,o=void 0},t)},cancel:()=>{pe(a),s=!1,o=void 0}}}function U(){}function te(e){return e?(parseInt(e,10)^Math.random()*16>>parseInt(e,10)/4).toString(16):`10000000-1000-4000-8000-${1e11}`.replace(/[018]/g,te)}const zt=/([\w-]+)\s*=\s*([^;]+)/g;function vn(e,t){for(zt.lastIndex=0;;){const n=zt.exec(e);if(n){if(n[1]===t)return n[2]}else break}}function Rd(e){const t=new Map;for(zt.lastIndex=0;;){const n=zt.exec(e);if(n){const r=n[1],i=n[2];t.has(r)?t.get(r).push(i):t.set(r,[i])}else break}return t}function Cd(e){const t=new Map;for(zt.lastIndex=0;;){const n=zt.exec(e);if(n)t.set(n[1],n[2]);else break}return t}function Gi(e,t,n=""){const r=e.charCodeAt(t-1),s=r>=55296&&r<=56319?t+1:t;return e.length<=s?e:`${e.slice(0,s)}${n}`}var Te;(function(e){e.TRACK_INTAKE_REQUESTS="track_intake_requests",e.USE_TREE_WALKER_FOR_ACTION_NAME="use_tree_walker_for_action_name",e.FEATURE_OPERATION_VITAL="feature_operation_vital",e.SHORT_SESSION_INVESTIGATION="short_session_investigation",e.ENCODE_COOKIE_OPTIONS="encode_cookie_options",e.AVOID_FETCH_KEEPALIVE="avoid_fetch_keepalive"})(Te||(Te={}));const ji=new Set;function Id(e){Array.isArray(e)&&kd(e.filter(t=>fr(Te,t)))}function kd(e){e.forEach(t=>{ji.add(t)})}function pt(e){return ji.has(e)}function Ld(){return ji}function Od(){return Aa()===0}function TE(){return Aa()===1}let jn;function Aa(){return jn??(jn=Md())}function Md(e=window){var t;const n=e.navigator.userAgent;return e.chrome||/HeadlessChrome/.test(n)?0:((t=e.navigator.vendor)===null||t===void 0?void 0:t.indexOf("Apple"))===0||/safari/i.test(n)&&!/chrome|android/i.test(n)?1:2}function Ki(e){return Pr(e,location.href).href}function xd(e){try{return!!Pr(e)}catch{return!1}}function Nd(e){const t=Pr(e).pathname;return t[0]==="/"?t:`/${t}`}function Pr(e,t){const{URL:n}=Pd();try{return t!==void 0?new n(e,t):new n(e)}catch(r){throw new Error(`Failed to construct URL: ${String(r)}`)}}let Zr;function Pd(){if(!Zr){let e,t;try{e=document.createElement("iframe"),e.style.display="none",document.body.appendChild(e),t=e.contentWindow}catch{t=we}Zr={URL:t.URL},e==null||e.remove()}return Zr}function Dr(e,t,n=0,r){const i=new Date;i.setTime(i.getTime()+n);const s=`expires=${i.toUTCString()}`,o=r&&r.crossSite?"none":"strict",a=r&&r.domain?`;domain=${r.domain}`:"",c=r&&r.secure?";secure":"",l=r&&r.partitioned?";partitioned":"";document.cookie=`${e}=${t};${s};path=/;samesite=${o}${a}${c}${l}`}function Fr(e){return vn(document.cookie,e)}function Dd(e){return Rd(document.cookie).get(e)||[]}let Jr;function $e(e){return Jr||(Jr=Cd(document.cookie)),Jr.get(e)}function Ra(e,t){Dr(e,"",0,t)}function Fd(e){if(document.cookie===void 0||document.cookie===null)return!1;try{const t=`dd_cookie_test_${te()}`,n="test";Dr(t,n,ce,e);const r=Fr(t)===n;return Ra(t,e),r}catch(t){return L.error(t),!1}}let Qr;function Ca(e=location.hostname,t=document.referrer){if(Qr===void 0){const n=Vd(e,t);if(n){const r=`dd_site_test_${te()}`,i="test",s=n.split(".");let o=s.pop();for(;s.length&&!Fr(r);)o=`${s.pop()}.${o}`,Dr(r,i,ne,{domain:o});Ra(r,{domain:o}),Qr=o}}return Qr}function Vd(e,t){try{return e||Pr(t).hostname}catch{}}const xe="_dd_s";function Ia(e,t){for(let n=e.length-1;n>=0;n-=1){const r=e[n];if(t(r,n,e))return r}}function ka(e){return Object.values(e)}function Yi(e){return Object.entries(e)}
30const gt=4*ga,La=15*ce,Ud=ba,Oa="0",$t={COOKIE:"cookie",LOCAL_STORAGE:"local-storage"},Ma=/^([a-zA-Z]+)=([a-z0-9-]+)$/,Xi="&";function Bd(e){return!!e&&(e.indexOf(Xi)!==-1||Ma.test(e))}const qd="1";function nt(e,t){const n={isExpired:qd};return t.trackAnonymousUser&&(e!=null&&e.anonymousId)&&(n.anonymousId=e==null?void 0:e.anonymousId),n}function rr(e){return Ze(e)}function xa(e){return!rr(e)}function fn(e){return e.isExpired!==void 0||!Hd(e)}function Hd(e){return(e.created===void 0||ae()-Number(e.created)<gt)&&(e.expire===void 0||ae()<Number(e.expire))}function Na(e){e.expire=String(ae()+La)}function Ti(e){return Yi(e).map(([t,n])=>t==="anonymousId"?`aid=${n}`:`${t}=${n}`).join(Xi)}function Vr(e){const t={};return Bd(e)&&e.split(Xi).forEach(n=>{const r=Ma.exec(n);if(r!==null){const[,i,s]=r;i==="aid"?t.anonymousId=s:t[i]=s}}),t}const zd="_dd",$d="_dd_r",Wd="_dd_l",Gd="rum",jd="logs";function Kd(e){if(!$e(xe)){const n=$e(zd),r=$e($d),i=$e(Wd),s={};n&&(s.id=n),i&&/^[01]$/.test(i)&&(s[jd]=i),r&&/^[012]$/.test(r)&&(s[Gd]=r),xa(s)&&(Na(s),e.persistSession(s))}}const Yd=0;function _s(e){const t=Zd(e);return t&&Fd(t)?{type:$t.COOKIE,cookieOptions:t}:void 0}function Xd(e,t){const n={isLockEnabled:Od(),persistSession:r=>ws(t,e,r,La),retrieveSession:()=>Pa(t),expireSession:r=>ws(t,e,nt(r,e),gt)};return Kd(n),n}function ws(e,t,n,r){let i=Ti(n);pt(Te.ENCODE_COOKIE_OPTIONS)&&(i=Ti({...n,...Ze(n)?{}:{c:Da(e)}})),Dr(xe,i,t.trackAnonymousUser?Ud:r,e)}function Pa(e){if(pt(Te.ENCODE_COOKIE_OPTIONS))return Jd(e);const t=Fr(xe);return Vr(t)}function Zd(e){const t={};if(t.secure=!!e.useSecureSessionCookie||!!e.usePartitionedCrossSiteSessionCookie,t.crossSite=!!e.usePartitionedCrossSiteSessionCookie,t.partitioned=!!e.usePartitionedCrossSiteSessionCookie,e.trackSessionAcrossSubdomains){const n=Ca();if(!n)return;t.domain=n}return t}function Da(e){const t=e.domain?e.domain.split(".").length-1:0;let n=0;return n|=Yd<<5,n|=t<<1,n|=e.crossSite?1:0,n.toString(16)}function Jd(e){const t=Dd(xe),n=Da(e);let r;for(const i of t.reverse())if(r=Vr(i),r.c===n)break;return r==null||delete r.c,r??{}}const Qd="_dd_test_";function Ts(){try{const e=te(),t=`${Qd}${e}`;localStorage.setItem(t,e);const n=localStorage.getItem(t);return localStorage.removeItem(t),e===n?{type:$t.LOCAL_STORAGE}:void 0}catch{return}}function eh(e){return{isLockEnabled:!1,persistSession:Fa,retrieveSession:Va,expireSession:t=>th(t,e)}}function Fa(e){localStorage.setItem(xe,Ti(e))}function Va(){const e=localStorage.getItem(xe);return Vr(e)}function th(e,t){Fa(nt(e,t))}const nh=10,rh=100,ih=ne,Ua="--",Ba=[];let ir;function rt(e,t,n=0){var r;const{isLockEnabled:i,persistSession:s,expireSession:o}=t,a=u=>s({...u,lock:l}),c=()=>{const{lock:u,...f}=t.retrieveSession();return{session:f,lock:u&&!oh(u)?u:void 0}};if(ir||(ir=e),e!==ir){Ba.push(e);return}if(i&&n>=rh){As(t);return}let l,h=c();if(i){if(h.lock){Kn(e,t,n);return}if(l=sh(),a(h.session),h=c(),h.lock!==l){Kn(e,t,n);return}}let d=e.process(h.session);if(i&&(h=c(),h.lock!==l)){Kn(e,t,n);return}if(d&&(fn(d)?o(d):(Na(d),i?a(d):s(d))),i&&!(d&&fn(d))){if(h=c(),h.lock!==l){Kn(e,t,n);return}s(h.session),d=h.session}(r=e.after)===null||r===void 0||r.call(e,d||h.session),As(t)}function Kn(e,t,n){ee(()=>{rt(e,t,n+1)},nh)}function As(e){ir=void 0;const t=Ba.shift();t&&rt(t,e)}function sh(){return te()+Ua+J()}function oh(e){const[,t]=e.split(Ua);return!t||G(Number(t),J())>ih}const Rs=ne;function ah(e){switch(e.sessionPersistence){case $t.COOKIE:return _s(e);case $t.LOCAL_STORAGE:return Ts();case void 0:{let t=_s(e);return!t&&e.allowFallbackToLocalStorage&&(t=Ts()),t}default:L.error(`Invalid session persistence '${String(e.sessionPersistence)}'`)}}function ch(e,t){return e.type===$t.COOKIE?Xd(t,e.cookieOptions):eh(t)}function lh(e,t,n,r,i=ch(e,t)){const s=new D,o=new D,a=new D,c=Qt(f,Rs);let l;v();const{throttled:h,cancel:d}=Nr(()=>{rt({process:g=>{if(rr(g))return;const y=m(g);return S(y),y},after:g=>{xa(g)&&!T()&&p(g),l=g}},i)},Rs);function u(){rt({process:g=>T()?m(g):void 0},i)}function f(){const g=i.retrieveSession();fn(g)?rt({process:y=>fn(y)?nt(y,t):void 0,after:m},i):m(g)}function m(g){return fn(g)&&(g=nt(g,t)),T()&&(E(g)?_():(a.notify({previousState:l,newState:g}),l=g)),g}function v(){rt({process:g=>{if(rr(g))return g.anonymousId=te(),nt(g,t)},after:g=>{l=g}},i)}function S(g){if(rr(g))return!1;const y=r(g[n]);
30g[n]=y,delete g.isExpired,y!==Oa&&!g.id&&(g.id=te(),g.created=String(ae()))}function T(){return(l==null?void 0:l[n])!==void 0}function E(g){return l.id!==g.id||l[n]!==g[n]}function _(){l=nt(l,t),o.notify()}function p(g){l=g,s.notify()}function b(g){rt({process:y=>({...y,...g}),after:m},i)}return{expandOrRenewSession:h,expandSession:u,getSession:()=>l,renewObservable:s,expireObservable:o,sessionStateUpdateObservable:a,restartSession:v,expire:g=>{d(),g===!1&&l&&delete l.anonymousId,i.expireSession(l),m(nt(l,t))},stop:()=>{xr(c)},updateSessionState:b}}const Ai={GRANTED:"granted",NOT_GRANTED:"not-granted"};function uh(e){const t=new D;return{tryToInit(n){e||(e=n)},update(n){e=n,t.notify()},isGranted(){return e===Ai.GRANTED},observable:t}}function bt(e){return e===null?"null":Array.isArray(e)?"array":typeof e}function yn(e){const t=bt(e);return t==="string"||t==="function"||e instanceof RegExp}function Ur(e,t,n=!1){return e.some(r=>{try{if(typeof r=="function")return r(t);if(r instanceof RegExp)return r.test(t);if(typeof r=="string")return n?t.startsWith(r):r===t}catch(i){L.error(i)}return!1})}const dh=["chrome-extension://","moz-extension://"];function Cs(e){return dh.some(t=>e.includes(t))}function hh(e,t=""){if(Cs(e))return!1;const r=t.split(` 31`).filter(i=>{const s=i.trim();return s.length&&/^at\s+|@/.test(s)})[1]||"";return Cs(r)}const fh="Running the Browser SDK in a Web extension content script is forbidden unless the `allowedTrackingOrigins` option is provided.",mh="SDK initialized on a non-allowed domain.";function ph(e,t,n=typeof location<"u"?location.origin:""){const r=e.allowedTrackingOrigins;if(!r)return hh(n,t)?(L.error(fh),!1):!0;const i=Ur(r,n);return i||L.error(mh),i}const qa="datad0g.com",gh="dd0g-gov.com",ct="datadoghq.com",bh="datadoghq.eu",vh="ddog-gov.com",yh="pci.browser-intake-datadoghq.com",Eh=["ddsource","dd-api-key","dd-request-id"];function it(e,t,n){const r=Sh(e,t);return{build(i,s){const o=_h(e,t,i,s,n);return r(o)},trackType:t}}function Sh(e,t){const n=`/api/v2/${t}`,r=e.proxy;if(typeof r=="string"){const s=Ki(r);return o=>`${s}?ddforward=${encodeURIComponent(`${n}?${o}`)}`}if(typeof r=="function")return s=>r({path:n,parameters:s});const i=Ha(t,e);return s=>`https://${i}${n}?${s}`}function Ha(e,t){const{site:n=ct,internalAnalyticsSubdomain:r}=t;if(e==="logs"&&t.usePciIntake&&n===ct)return yh;if(r&&n===ct)return`${r}.${ct}`;if(n===gh)return`http-intake.logs.${n}`;const i=n.split("."),s=i.pop();return`browser-intake-${i.join("-")}.${s}`}function _h({clientToken:e,internalAnalyticsSubdomain:t,source:n="browser"},r,i,{retry:s,encoding:o},a=[]){const c=[`ddsource=${n}`,`dd-api-key=${e}`,`dd-evp-origin-version=${encodeURIComponent("6.23.0")}`,"dd-evp-origin=browser",`dd-request-id=${te()}`].concat(a);return o&&c.push(`dd-evp-encoding=${o}`),r==="rum"&&(c.push(`batch_time=${J()}`,`_dd.api=${i}`),s&&c.push(`_dd.retry_count=${s.count}`,`_dd.retry_after=${s.lastFailureStatus}`)),t&&c.reverse(),c.join("&")}function wh(e){const t=e.site||ct,n=Th(e.source),r=Ah({...e,site:t,source:n});return{replica:Rh({...e,site:t,source:n}),site:t,source:n,...r}}function Th(e){return e==="flutter"||e==="unity"?e:"browser"}function Ah(e){return{logsEndpointBuilder:it(e,"logs"),rumEndpointBuilder:it(e,"rum"),profilingEndpointBuilder:it(e,"profile"),sessionReplayEndpointBuilder:it(e,"replay"),exposuresEndpointBuilder:it(e,"exposures")}}function Rh(e){if(!e.replica)return;const t={...e,site:ct,clientToken:e.replica.clientToken};return{logsEndpointBuilder:it(t,"logs"),rumEndpointBuilder:it(t,"rum",[`application.id=${e.replica.applicationId}`])}}function Ch(e){return Eh.every(t=>e.includes(t))}const Lt={ALLOW:"allow",MASK:"mask",MASK_USER_INPUT:"mask-user-input",MASK_UNLESS_ALLOWLISTED:"mask-unless-allowlisted"},Ri={ALL:"all",SAMPLED:"sampled"};function ei(e,t){return e!=null&&typeof e!="string"?(L.error(`${t} must be defined as a string`),!1):!0}function Ih(e){return e&&typeof e=="string"&&!/(datadog|ddog|datad0g|dd0g)/.test(e)?(L.error(`Site should be a valid Datadog site. ${$i} ${Or}/getting_started/site/.`),!1):!0}function Ot(e,t){return e!==void 0&&!pd(e)?(L.error(`${t} Sample Rate should be a number between 0 and 100`),!1):!0}function kh(e,t){var n,r,i,s,o,a,c,l,h,d;
31if(!e||!e.clientToken){L.error("Client Token is not configured, we will not send any data.");return}if(e.allowedTrackingOrigins!==void 0&&!Array.isArray(e.allowedTrackingOrigins)){L.error("Allowed Tracking Origins must be an array");return}if(!(!Ih(e.site)||!Ot(e.sessionSampleRate,"Session")||!Ot(e.telemetrySampleRate,"Telemetry")||!Ot(e.telemetryConfigurationSampleRate,"Telemetry Configuration")||!Ot(e.telemetryUsageSampleRate,"Telemetry Usage")||!ei(e.version,"Version")||!ei(e.env,"Env")||!ei(e.service,"Service")||!ph(e,t??""))){if(e.trackingConsent!==void 0&&!fr(Ai,e.trackingConsent)){L.error('Tracking Consent should be either "granted" or "not-granted"');return}return{beforeSend:e.beforeSend&&pa(e.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:mr?void 0:ah(e),sessionSampleRate:(n=e.sessionSampleRate)!==null&&n!==void 0?n:100,telemetrySampleRate:(r=e.telemetrySampleRate)!==null&&r!==void 0?r:20,telemetryConfigurationSampleRate:(i=e.telemetryConfigurationSampleRate)!==null&&i!==void 0?i:5,telemetryUsageSampleRate:(s=e.telemetryUsageSampleRate)!==null&&s!==void 0?s:5,service:(o=e.service)!==null&&o!==void 0?o:void 0,env:(a=e.env)!==null&&a!==void 0?a:void 0,version:(c=e.version)!==null&&c!==void 0?c:void 0,datacenter:(l=e.datacenter)!==null&&l!==void 0?l:void 0,silentMultipleInit:!!e.silentMultipleInit,allowUntrustedEvents:!!e.allowUntrustedEvents,trackingConsent:(h=e.trackingConsent)!==null&&h!==void 0?h:Ai.GRANTED,trackAnonymousUser:(d=e.trackAnonymousUser)!==null&&d!==void 0?d:!0,storeContextsAcrossPages:!!e.storeContextsAcrossPages,batchBytesLimit:16*Ht,eventRateLimiterThreshold:3e3,maxTelemetryEventsPerPage:15,flushTimeout:30*ne,batchMessagesLimit:mr?1:50,messageBytesLimit:256*Ht,variant:e.variant,sdkVersion:e.sdkVersion,...wh(e)}}}function Lh(e){return{session_sample_rate:e.sessionSampleRate,telemetry_sample_rate:e.telemetrySampleRate,telemetry_configuration_sample_rate:e.telemetryConfigurationSampleRate,telemetry_usage_sample_rate:e.telemetryUsageSampleRate,use_before_send:!!e.beforeSend,use_partitioned_cross_site_session_cookie:e.usePartitionedCrossSiteSessionCookie,use_secure_session_cookie:e.useSecureSessionCookie,use_proxy:!!e.proxy,silent_multiple_init:e.silentMultipleInit,track_session_across_subdomains:e.trackSessionAcrossSubdomains,track_anonymous_user:e.trackAnonymousUser,session_persistence:e.sessionPersistence,allow_fallback_to_local_storage:!!e.allowFallbackToLocalStorage,store_contexts_across_pages:!!e.storeContextsAcrossPages,allow_untrusted_events:!!e.allowUntrustedEvents,tracking_consent:e.trackingConsent,use_allowed_tracking_origins:Array.isArray(e.allowedTrackingOrigins),source:e.source,sdk_version:e.sdkVersion,variant:e.variant}}const Wt="?";function Fn(e){var t,n;const r=[];let i=ti(e,"stack");const s=String(e);if(i&&i.startsWith(s)&&(i=i.slice(s.length)),i&&i.split(` 32`).forEach(o=>{const a=xh(o)||Ph(o)||Fh(o)||Bh(o);a&&(!a.func&&a.line&&(a.func=Wt),r.push(a))}),r.length>0&&$h()&&e instanceof Error){const o=[];let a=e;for(;(a=Object.getPrototypeOf(a))&&$a(a);){const c=((t=a.constructor)===null||t===void 0?void 0:t.name)||Wt;o.push(c)}for(let c=o.length-1;c>=0&&((n=r[0])===null||n===void 0?void 0:n.func)===o[c];c--)r.shift()}return{message:ti(e,"message"),name:ti(e,"name"),stack:r}}const za="((?:file|https?|blob|chrome-extension|electron|native|eval|webpack|snippet|<anonymous>|\\w+\\.|\\/).*?)",Gt="(?::(\\d+))",Oh=new RegExp(`^\\s*at (.*?) ?\\(${za}${Gt}?${Gt}?\\)?\\s*$`,"i"),Mh=new RegExp(`\\((\\S*)${Gt}${Gt}\\)`);function xh(e){const t=Oh.exec(e);if(!t)return;const n=t[2]&&t[2].indexOf("native")===0,r=t[2]&&t[2].indexOf("eval")===0,i=Mh.exec(t[2]);return r&&i&&(t[2]=i[1],t[3]=i[2],t[4]=i[3]),{args:n?[t[2]]:[],column:t[4]?+t[4]:void 0,func:t[1]||Wt,line:t[3]?+t[3]:void 0,url:n?void 0:t[2]}}const Nh=new RegExp(`^\\s*at ?${za}${Gt}?${Gt}??\\s*$`,"i");function Ph(e){const t=Nh.exec(e);if(t)return{args:[],column:t[3]?+t[3]:void 0,func:Wt,line:t[2]?+t[2]:void 0,url:t[1]}}const Dh=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function Fh(e){const t=Dh.exec(e);if(t)return{args:[],column:t[4]?+t[4]:void 0,func:t[1]||Wt,line:+t[3],url:t[2]}}
32const Vh=/^\s*(.*?)(?:\((.*?)\))?(?:(?:(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle|\[wasm code\])(?::(\d+))?(?::(\d+))?)|@)\s*$/i,Uh=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function Bh(e){const t=Vh.exec(e);if(!t)return;const n=t[3]&&t[3].indexOf(" > eval")>-1,r=Uh.exec(t[3]);return n&&r&&(t[3]=r[1],t[4]=r[2],t[5]=void 0),{args:t[2]?t[2].split(","):[],column:t[5]?+t[5]:void 0,func:t[1]||Wt,line:t[4]?+t[4]:void 0,url:t[3]}}function ti(e,t){if(typeof e!="object"||!e||!(t in e))return;const n=e[t];return typeof n=="string"?n:void 0}function qh(e,t,n,r){if(t===void 0)return;const{name:i,message:s}=zh(e);return{name:i,message:s,stack:[{url:t,column:r,line:n}]}}const Hh=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\s\S]*)$/;function zh(e){let t,n;return{}.toString.call(e)==="[object String]"&&([,t,n]=Hh.exec(e)),{name:t,message:n}}function $a(e){return String(e.constructor).startsWith("class ")}let Yn;function $h(){if(Yn!==void 0)return Yn;class e extends Error{constructor(){super(),this.name="Error"}}const[t,n]=[e,Error].map(r=>new r);return Yn=$a(Object.getPrototypeOf(t))&&n.stack!==t.stack,Yn}function pr(e){const n=new Error(e);n.name="HandlingStack";let r;return We(()=>{const i=Fn(n);i.stack=i.stack.slice(2),r=Vn(i)}),r}function Vn(e){let t=Wa(e);return e.stack.forEach(n=>{const r=n.func==="?"?"<anonymous>":n.func,i=n.args&&n.args.length>0?`(${n.args.join(", ")})`:"",s=n.line?`:${n.line}`:"",o=n.line&&n.column?`:${n.column}`:"";t+=` 33 at ${r}${i} @ ${n.url}${s}${o}`}),t}function Wa(e){return`${e.name||"Error"}: ${e.message}`}function _e(e,t,n,{computeHandlingStack:r}={}){let i=e[t];if(typeof i!="function")if(t in e&&t.startsWith("on"))i=U;else return{stop:U};let s=!1;const o=function(){if(s)return i.apply(this,arguments);const a=Array.from(arguments);let c;We(n,null,[{target:this,parameters:a,onPostCall:h=>{c=h},handlingStack:r?pr("instrumented method"):void 0}]);const l=i.apply(this,a);return c&&We(c,null,[l]),l};return e[t]=o,{stop:()=>{s=!0,e[t]===o&&(e[t]=i)}}}function AE(e,t,n){const r=Object.getOwnPropertyDescriptor(e,t);if(!r||!r.set||!r.configurable)return{stop:U};const i=U;let s=(a,c)=>{ee(()=>{s!==i&&n(a,c)},0)};const o=function(a){r.set.call(this,a),s(this,a)};return Object.defineProperty(e,t,{set:o}),{stop:()=>{var a;((a=Object.getOwnPropertyDescriptor(e,t))===null||a===void 0?void 0:a.set)===o&&Object.defineProperty(e,t,r),s=i}}}function Un(e,t,n){if(typeof e!="object"||e===null)return JSON.stringify(e);const r=Mt(Object.prototype),i=Mt(Array.prototype),s=Mt(Object.getPrototypeOf(e)),o=Mt(e);try{return JSON.stringify(e,t,n)}catch{return"<error: unable to serialize object>"}finally{r(),i(),s(),o()}}function Mt(e){const t=e,n=t.toJSON;return n?(delete t.toJSON,()=>{t.toJSON=n}):U}const Wh=220*Ht,Gh="$",jh=3;function H(e,t=Wh){const n=Mt(Object.prototype),r=Mt(Array.prototype),i=[],s=new WeakMap,o=ni(e,Gh,void 0,i,s),a=JSON.stringify(o);let c=a?a.length:0;if(c>t){ri(t,"discarded",e);return}for(;i.length>0&&c<t;){const l=i.shift();let h=0;if(Array.isArray(l.source))for(let d=0;d<l.source.length;d++){const u=ni(l.source[d],l.path,d,i,s);if(u!==void 0?c+=JSON.stringify(u).length:c+=4,c+=h,h=1,c>t){ri(t,"truncated",e);break}l.target[d]=u}else for(const d in l.source)if(Object.prototype.hasOwnProperty.call(l.source,d)){const u=ni(l.source[d],l.path,d,i,s);if(u!==void 0&&(c+=JSON.stringify(u).length+h+d.length+jh,h=1),c>t){ri(t,"truncated",e);break}l.target[d]=u}}return n(),r(),o}function ni(e,t,n,r,i){const s=Xh(e);if(!s||typeof s!="object")return Kh(s);const o=Ci(s);if(o!=="[Object]"&&o!=="[Array]"&&o!=="[Error]")return o;const a=e;if(i.has(a))return`[Reference seen at ${i.get(a)}]`;const c=n!==void 0?`${t}.${n}`:t,l=Array.isArray(s)?[]:{};return i.set(a,c),r.push({source:s,target:l,path:c}),l}function Kh(e){return typeof e=="bigint"?`[BigInt] ${e.toString()}`:typeof e=="function"?`[Function] ${e.name||"unknown"}`:typeof e=="symbol"?`[Symbol] ${e.description||e.toString()}`:e}function Ci(e){try{if(e instanceof Event)return Yh(e);if(e instanceof RegExp)return`[RegExp] ${e.toString()}`;const n=Object.prototype.toString.call(e).match(/\[object (.*)\]/);if(n&&n[1])return`[${n[1]}]`}catch{}return"[Unserializable]"}function Yh(e){return{type:e.type,isTrusted:e.isTrusted,currentTarget:e.currentTarget?Ci(e.currentTarget):null,target:e.target?Ci(e.target):null}}function Xh(e){const t=e;if(t&&typeof t.toJSON=="function")try{return t.toJSON()}catch{}return e}function ri(e,t,n){L.warn(`The data provided has been ${t} as it is over the limit of ${e} characters:`,n)}const Ga="No stack, consider using an instance of Error";function Zi({stackTrace:e,originalError:t,handlingStack:n,componentStack:r,startClocks:i,nonErrorPrefix:s,useFallbackStack:o=!0,source:a,handling:c}){const l=vt(t);return!e&&l&&(e=Fn(t)),{startClocks:i,source:a,handling:c,handlingStack:n,componentStack:r,originalError:t,type:e?e.name:void 0,message:Zh(e,l,s,t),stack:e?
33Vn(e):o?Ga:void 0,causes:l?ef(t,a):void 0,fingerprint:Jh(t),context:Qh(t)}}function Zh(e,t,n,r){return e!=null&&e.message&&(e!=null&&e.name)?e.message:t?"Empty message":`${n} ${Un(H(r))}`}function Jh(e){return vt(e)&&"dd_fingerprint"in e?String(e.dd_fingerprint):void 0}function Qh(e){if(e!==null&&typeof e=="object"&&"dd_context"in e)return e.dd_context}function vt(e){return e instanceof Error||Object.prototype.toString.call(e)==="[object Error]"}function ef(e,t){let n=e;const r=[];for(;vt(n==null?void 0:n.cause)&&r.length<10;){const i=Fn(n.cause);r.push({message:n.cause.message,source:t,type:i==null?void 0:i.name,stack:i&&Vn(i)}),n=n.cause}return r.length?r:void 0}const en={AGENT:"agent",CONSOLE:"console",CUSTOM:"custom",LOGGER:"logger",NETWORK:"network",SOURCE:"source",REPORT:"report"};function tf(){return new D(e=>{const t=(i,s)=>{const o=Zi({stackTrace:s,originalError:i,startClocks:Q(),nonErrorPrefix:"Uncaught",source:en.SOURCE,handling:"unhandled"});e.notify(o)},{stop:n}=nf(t),{stop:r}=rf(t);return()=>{n(),r()}})}function nf(e){return _e(ye(),"onerror",({parameters:[t,n,r,i,s]})=>{let o;vt(s)||(o=qh(t,n,r,i)),e(s??t,o)})}function rf(e){return _e(ye(),"onunhandledrejection",({parameters:[t]})=>{e(t.reason||"Empty reason")})}function sf(e){const t={version:"6.23.0",onReady(n){n()},...e};return Object.defineProperty(t,"_setDebug",{get(){return Ad},enumerable:!1}),t}function of(e,t,n){const r=e[t];r&&!r.q&&r.version&&L.warn("SDK is loaded more than once. This is unsupported and might have unexpected behavior."),e[t]=n,r&&r.q&&r.q.forEach(i=>pa(i,"onReady callback threw an error:")())}function ja(e,t){t.silentMultipleInit||L.error(`${e} is already initialized.`)}function $(e,t,n,r,i){return Ye(e,t,[n],r,i)}function Ye(e,t,n,r,{once:i,capture:s,passive:o}={}){const a=I(u=>{!u.isTrusted&&!u.__ddIsTrusted&&!e.allowUntrustedEvents||(i&&d(),r(u))}),c=o?{capture:s,passive:o}:s,l=window.EventTarget&&t instanceof EventTarget?window.EventTarget.prototype:t,h=Ke(l,"addEventListener");n.forEach(u=>h.call(t,u,a,c));function d(){const u=Ke(l,"removeEventListener");n.forEach(f=>u.call(t,f,a,c))}return{stop:d}}const En={intervention:"intervention",cspViolation:"csp_violation"};function af(e,t){const n=[];t.includes(En.cspViolation)&&n.push(lf(e));const r=t.filter(i=>i!==En.cspViolation);return r.length&&n.push(cf(r)),wa(...n)}function cf(e){return new D(t=>{if(!window.ReportingObserver)return;const n=I((i,s)=>i.forEach(o=>t.notify(uf(o)))),r=new window.ReportingObserver(n,{types:e,buffered:!0});return r.observe(),()=>{r.disconnect()}})}function lf(e){return new D(t=>{const{stop:n}=$(e,document,"securitypolicyviolation",r=>{t.notify(df(r))});return n})}function uf(e){const{type:t,body:n}=e;return Ka({type:n.id,message:`${t}: ${n.message}`,originalError:e,stack:Ya(n.id,n.message,n.sourceFile,n.lineNumber,n.columnNumber)})}function df(e){const t=`'${e.blockedURI}' blocked by '${e.effectiveDirective}' directive`;return Ka({type:e.effectiveDirective,message:`${En.cspViolation}: ${t}`,originalError:e,csp:{disposition:e.disposition},stack:Ya(e.effectiveDirective,e.originalPolicy?`${t} of the policy "${Gi(e.originalPolicy,100,"...")}"`:"no policy",e.sourceFile,e.lineNumber,e.columnNumber)})}function Ka(e){return{startClocks:Q(),source:en.REPORT,handling:"unhandled",...e}}function Ya(e,t,n,r,i){return n?Vn({name:e,message:t,stack:[{func:"?",url:n,line:r??void 0,column:i??void 0}]}):void 0}const hf=200;function Xa(e){const{env:t,service:n,version:r,datacenter:i,sdkVersion:s,variant:o}=e,a=[St("sdk_version",s??"6.23.0")];return t&&a.push(St("env",t)),n&&a.push(St("service",n)),r&&a.push(St("version",r)),i&&a.push(St("datacenter",i)),o&&a.push(St("variant",o)),a}function St(e,t){const n=t?`${e}:${t}`:e;return(n.length>hf||mf(n))&&L.warn(`Tag ${n} doesn't meet tag requirements and will be sanitized. ${$i} ${Or}/getting_started/tagging/#defining-tags`),ff(n)}function ff(e){return e.replace(/,/g,"_")}function mf(e){return pf()?new RegExp("[^\\p{Ll}\\p{Lo}0-9_:./-]","u").test(e):!1}function pf(){try{return new RegExp("[\\p{Ll}]","u"),!0}catch{return!1}}function Za(e,t){const n=we.__ddBrowserSdkExtensionCallback;n&&n({type:e,payload:t})}function gr(e,t,n=gf()){if(t===void 0)return e;if(typeof t!="object"||t===null)return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){const i=t.flags||[t.global?"g":"",t.ignoreCase?"i":"",t.multiline?"m":"",t.sticky?"y":"",t.unicode?"u":""].join("");return new RegExp(t.source,i)}if(n.hasAlreadyBeenSeen(t))return;if(Array.isArray(t)){const i=Array.isArray(e)?e:[];for(let s=0;s<t.length;
33++s)i[s]=gr(i[s],t[s],n);return i}const r=bt(e)==="object"?e:{};for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=gr(r[i],t[i],n));return r}function Ji(e){return gr(void 0,e)}function Ne(...e){let t;for(const n of e)n!=null&&(t=gr(t,n));return t}function gf(){if(typeof WeakSet<"u"){const t=new WeakSet;return{hasAlreadyBeenSeen(n){const r=t.has(n);return r||t.add(n),r}}}const e=[];return{hasAlreadyBeenSeen(t){const n=e.indexOf(t)>=0;return n||e.push(t),n}}}function Ja(){var e;const t=we.navigator;return{status:t.onLine?"connected":"not_connected",interfaces:t.connection&&t.connection.type?[t.connection.type]:void 0,effective_type:(e=t.connection)===null||e===void 0?void 0:e.effectiveType}}function bf(e){return e>=500}function vf(e){try{return e.clone()}catch{return}}const yf=80*Ht,Ef=32,Qa=20*ya,Sf=ce,ec=ne;function tc(e,t,n,r,i,s){t.transportStatus===0&&t.queuedPayloads.size()===0&&t.bandwidthMonitor.canHandle(e)?rc(e,t,n,s,{onSuccess:()=>ic(0,t,n,r,i,s),onFailure:()=>{t.queuedPayloads.enqueue(e)||s.notify({type:"queue-full",bandwidth:t.bandwidthMonitor.stats(),payload:e}),nc(t,n,r,i,s)}}):t.queuedPayloads.enqueue(e)||s.notify({type:"queue-full",bandwidth:t.bandwidthMonitor.stats(),payload:e})}function nc(e,t,n,r,i){e.transportStatus===2&&ee(()=>{const s=e.queuedPayloads.first();rc(s,e,t,i,{onSuccess:()=>{e.queuedPayloads.dequeue(),e.currentBackoffTime=ec,ic(1,e,t,n,r,i)},onFailure:()=>{e.currentBackoffTime=Math.min(Sf,e.currentBackoffTime*2),nc(e,t,n,r,i)}})},e.currentBackoffTime)}function rc(e,t,n,r,{onSuccess:i,onFailure:s}){t.bandwidthMonitor.add(e),n(e,o=>{t.bandwidthMonitor.remove(e),_f(o)?(t.transportStatus=t.bandwidthMonitor.ongoingRequestCount>0?1:2,e.retry={count:e.retry?e.retry.count+1:1,lastFailureStatus:o.status},r.notify({type:"failure",bandwidth:t.bandwidthMonitor.stats(),payload:e}),s()):(t.transportStatus=0,r.notify({type:"success",bandwidth:t.bandwidthMonitor.stats(),payload:e}),i())})}function ic(e,t,n,r,i,s){e===0&&t.queuedPayloads.isFull()&&!t.queueFullReported&&(i({message:`Reached max ${r} events size queued for upload: ${Qa/ya}MiB`,source:en.AGENT,startClocks:Q()}),t.queueFullReported=!0);const o=t.queuedPayloads;for(t.queuedPayloads=sc();o.size()>0;)tc(o.dequeue(),t,n,r,i,s)}function _f(e){return e.type!=="opaque"&&(e.status===0&&!navigator.onLine||e.status===408||e.status===429||bf(e.status))}function wf(){return{transportStatus:0,currentBackoffTime:ec,bandwidthMonitor:Tf(),queuedPayloads:sc(),queueFullReported:!1}}function sc(){const e=[];return{bytesCount:0,enqueue(t){return this.isFull()?!1:(e.push(t),this.bytesCount+=t.bytesCount,!0)},first(){return e[0]},dequeue(){const t=e.shift();return t&&(this.bytesCount-=t.bytesCount),t},size(){return e.length},isFull(){return this.bytesCount>=Qa}}}function Tf(){return{ongoingRequestCount:0,ongoingByteCount:0,canHandle(e){return this.ongoingRequestCount===0||this.ongoingByteCount+e.bytesCount<=yf&&this.ongoingRequestCount<Ef},add(e){this.ongoingRequestCount+=1,this.ongoingByteCount+=e.bytesCount},remove(e){this.ongoingRequestCount-=1,this.ongoingByteCount-=e.bytesCount},stats(){return{ongoingByteCount:this.ongoingByteCount,ongoingRequestCount:this.ongoingRequestCount}}}}function oc(e,t,n){const r=new D,i=wf();return{observable:r,send:s=>{for(const o of e)tc(s,i,(a,c)=>{pt(Te.AVOID_FETCH_KEEPALIVE)?br(o,a,c):Cf(o,t,a,c)},o.trackType,n,r)},sendOnExit:s=>{for(const o of e)Af(o,t,s)}}}function Af(e,t,n){if(!!navigator.sendBeacon&&n.bytesCount<t)try{const i=e.build("beacon",n);if(navigator.sendBeacon(i,n.data))return}catch(i){Rf(i)}br(e,n)}let Is=!1;function Rf(e){Is||(Is=!0,ft(e))}function Cf(e,t,n,r){if(If()&&n.bytesCount<t){const s=e.build("fetch-keepalive",n);fetch(s,{method:"POST",body:n.data,keepalive:!0,mode:"cors"}).then(I(o=>r==null?void 0:r({status:o.status,type:o.type}))).catch(I(()=>br(e,n,r)))}else br(e,n,r)}function br(e,t,n){const r=e.build("fetch",t);fetch(r,{method:"POST",body:t.data,mode:"cors"}).then(I(i=>n==null?void 0:n({status:i.status,type:i.type}))).catch(I(()=>n==null?void 0:n({status:0})))}function If(){try{return window.Request&&"keepalive"in new Request
33("http://a")}catch{return!1}}function Bn(){const e=kf();if(e)return{getCapabilities(){var t;return JSON.parse(((t=e.getCapabilities)===null||t===void 0?void 0:t.call(e))||"[]")},getPrivacyLevel(){var t;return(t=e.getPrivacyLevel)===null||t===void 0?void 0:t.call(e)},getAllowedWebViewHosts(){return JSON.parse(e.getAllowedWebViewHosts())},send(t,n,r){const i=r?{id:r}:void 0;e.send(JSON.stringify({eventType:t,event:n,view:i}))}}}function ac(e){const t=Bn();return!!t&&t.getCapabilities().includes(e)}function jt(e){var t;e===void 0&&(e=(t=ye().location)===null||t===void 0?void 0:t.hostname);const n=Bn();return!!n&&n.getAllowedWebViewHosts().some(r=>e===r||e.endsWith(`.${r}`))}function kf(){return ye().DatadogEventBridge}const Pt={HIDDEN:"visibility_hidden",UNLOADING:"before_unload",PAGEHIDE:"page_hide",FROZEN:"page_frozen"};function Lf(e){return new D(t=>{const{stop:n}=Ye(e,window,["visibilitychange","freeze"],i=>{i.type==="visibilitychange"&&document.visibilityState==="hidden"?t.notify({reason:Pt.HIDDEN}):i.type==="freeze"&&t.notify({reason:Pt.FROZEN})},{capture:!0}),r=$(e,window,"beforeunload",()=>{t.notify({reason:Pt.UNLOADING})}).stop;return()=>{n(),r()}})}function Of(e){return ka(Pt).includes(e)}function cc({encoder:e,request:t,flushController:n,messageBytesLimit:r}){let i={};const s=n.flushObservable.subscribe(d=>h(d));function o(d,u,f){n.notifyBeforeAddMessage(u),f!==void 0?(i[f]=d,n.notifyAfterAddMessage()):e.write(e.isEmpty?d:` 34${d}`,m=>{n.notifyAfterAddMessage(m-u)})}function a(d){return d!==void 0&&i[d]!==void 0}function c(d){const u=i[d];delete i[d];const f=e.estimateEncodedBytesCount(u);n.notifyAfterRemoveMessage(f)}function l(d,u){const f=Un(d),m=e.estimateEncodedBytesCount(f);if(m>=r){L.warn(`Discarded a message whose size was bigger than the maximum allowed size ${r}KB. ${$i} ${md}/#technical-limitations`);return}a(u)&&c(u),o(f,m,u)}function h(d){const u=ka(i).join(` 35`);i={};const f=Of(d.reason),m=f?t.sendOnExit:t.send;if(f&&e.isAsync){const v=e.finishSync();v.outputBytesCount&&m(ks(v));const S=[v.pendingData,u].filter(Boolean).join(` 36`);S&&m({data:S,bytesCount:Ea(S)})}else u&&e.write(e.isEmpty?u:` 37${u}`),e.finish(v=>{m(ks(v))})}return{flushController:n,add:l,upsert:l,stop:s.unsubscribe}}function ks(e){let t;return typeof e.output=="string"?t=e.output:t=new Blob([e.output],{type:"text/plain"}),{data:t,bytesCount:e.outputBytesCount,encoding:e.encoding}}function lc({messagesLimit:e,bytesLimit:t,durationLimit:n,pageMayExitObservable:r,sessionExpireObservable:i}){const s=r.subscribe(m=>h(m.reason)),o=i.subscribe(()=>h("session_expire")),a=new D(()=>()=>{s.unsubscribe(),o.unsubscribe()});let c=0,l=0;function h(m){if(l===0)return;const v=l,S=c;l=0,c=0,f(),a.notify({reason:m,messagesCount:v,bytesCount:S})}let d;function u(){d===void 0&&(d=ee(()=>{h("duration_limit")},n))}function f(){pe(d),d=void 0}return{flushObservable:a,get messagesCount(){return l},notifyBeforeAddMessage(m){c+m>=t&&h("bytes_limit"),l+=1,c+=m,u()},notifyAfterAddMessage(m=0){c+=m,l>=e?h("messages_limit"):c>=t&&h("bytes_limit")},notifyAfterRemoveMessage(m){c-=m,l-=1,l===0&&f()}}}const Xe="DISCARDED",he="SKIPPED";function Mf(){const e={};return{register(t,n){return e[t]||(e[t]=[]),e[t].push(n),{unregister:()=>{e[t]=e[t].filter(r=>r!==n)}}},triggerHook(t,n){const r=e[t]||[],i=[];for(const s of r){const o=s(n);if(o===Xe)return Xe;o!==he&&i.push(o)}return Ne(...i)}}}const Ge={LOG:"log",CONFIGURATION:"configuration",USAGE:"usage"},xf=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],Nf=1,Pf=[vh];let ii;function tn(){return ii||(ii=new Ta(100)),ii}function Df(e,t,n,r,i,s){const o=new D,{stop:a}=Vf(t,r,i,s,o),{enabled:c,metricsEnabled:l}=Ff(e,t,n,o);return{stop:a,enabled:c,metricsEnabled:l}}function Ff(e,t,n,r,i=Nf){const s={},o=!Pf.includes(t.site)&&at(t.telemetrySampleRate),a={[Ge.LOG]:o,[Ge.CONFIGURATION]:o&&at(t.telemetryConfigurationSampleRate),[Ge.USAGE]:o&&at(t.telemetryUsageSampleRate),metric:o&&at(i)},c=Uf(),l=tn();return l.subscribe(({rawEvent:d,metricName:u})=>
37{if(u&&!a.metric||!a[d.type])return;const f=u||d.status||d.type;let m=s[f];if(m||(m=s[f]=new Set),m.size>=t.maxTelemetryEventsPerPage)return;const v=Un(d);if(m.has(v))return;const S=n.triggerHook(1,{startTime:Q().relative});if(S===Xe)return;const T=h(S,e,d,c);r.notify(T),Za("telemetry",T),m.add(v)}),l.unbuffer(),Td(Qi),{enabled:o,metricsEnabled:a.metric};function h(d,u,f,m){const S={type:"telemetry",date:Q().timeStamp,service:u,version:"6.23.0",source:"browser",_dd:{format_version:2},telemetry:Ne(f,{runtime_env:m,connectivity:Ja(),sdk_setup:"npm"}),ddtags:Xa(t).join(","),experimental_features:Array.from(Ld())};return Ne(S,d)}}function Vf(e,t,n,r,i){const s=[];if(jt()){const o=Bn(),a=i.subscribe(c=>o.send("internal_telemetry",c));s.push(a.unsubscribe)}else{const o=[e.rumEndpointBuilder];e.replica&&Bf(e)&&o.push(e.replica.rumEndpointBuilder);const a=cc({encoder:r(4),request:oc(o,e.batchBytesLimit,t),flushController:lc({messagesLimit:e.batchMessagesLimit,bytesLimit:e.batchBytesLimit,durationLimit:e.flushTimeout,pageMayExitObservable:n,sessionExpireObservable:new D}),messageBytesLimit:e.messageBytesLimit});s.push(a.stop);const c=i.subscribe(a.add);s.push(c.unsubscribe)}return{stop:()=>s.forEach(o=>o())}}function Uf(){var e;return{is_local_file:((e=we.location)===null||e===void 0?void 0:e.protocol)==="file:",is_worker:mr}}function Bf(e){return e.site===qa}function qn(e,t){wi(Lr.debug,e,t),tn().notify({rawEvent:{type:Ge.LOG,message:e,status:"debug",...t}})}function Qi(e,t){tn().notify({rawEvent:{type:Ge.LOG,status:"error",...Hf(e),...t}})}function qf(e){tn().notify({rawEvent:{type:Ge.CONFIGURATION,configuration:e}})}function Br(e,t){tn().notify({rawEvent:{type:Ge.LOG,message:e,status:"debug",...t},metricName:e})}function Y(e){tn().notify({rawEvent:{type:Ge.USAGE,usage:e}})}function Hf(e){if(vt(e)){const t=Fn(e);return{error:{kind:t.name,stack:Vn(zf(t))},message:t.message}}return{error:{stack:Ga},message:`Uncaught ${Un(e)}`}}function zf(e){return e.stack=e.stack.filter(t=>!t.url||xf.some(n=>t.url.startsWith(n))),e}function uc(e,t){const n=e.indexOf(t);n>=0&&e.splice(n,1)}function mn(e){return Array.isArray(e)&&e.length>0}const Xn=1/0,$f=ce;let sn=null;const sr=new Set;function Wf(){sr.forEach(e=>e())}function nn({expireDelay:e,maxEntries:t}){let n=[];sn||(sn=Qt(()=>Wf(),$f));const r=()=>{const h=de()-e;for(;n.length>0&&n[n.length-1].endTime<h;)n.pop()};sr.add(r);function i(h,d){const u={value:h,startTime:d,endTime:Xn,remove:()=>{uc(n,u)},close:f=>{u.endTime=f}};return t&&n.length>=t&&n.pop(),n.unshift(u),u}function s(h=Xn,d={returnInactive:!1}){for(const u of n)if(u.startTime<=h){if(d.returnInactive||h<=u.endTime)return u.value;break}}function o(h){const d=n[0];d&&d.endTime===Xn&&d.close(h)}function a(h=Xn,d=0){const u=Jt(h,d);return n.filter(f=>f.startTime<=u&&h<=f.endTime).map(f=>f.value)}function c(){n=[]}function l(){sr.delete(r),sr.size===0&&sn&&(xr(sn),sn=null)}return{add:i,find:s,closeActive:o,findAll:a,reset:c,stop:l}}const Gf="datadog-synthetics-public-id",jf="datadog-synthetics-result-id",Kf="datadog-synthetics-injects-rum";function dc(){return mr?!1:!!(we._DATADOG_SYNTHETICS_INJECTS_RUM||$e(Kf))}function hc(){const e=window._DATADOG_SYNTHETICS_PUBLIC_ID||$e(Gf);return typeof e=="string"?e:void 0}function fc(){const e=window._DATADOG_SYNTHETICS_RESULT_ID||$e(jf);return typeof e=="string"?e:void 0}function mc(){return!!(hc()&&fc())}const Yf=ce,Xf=gt;function Zf(e,t,n,r){const i=new D,s=new D,o=lh(e.sessionStoreStrategyType,e,t,n),a=nn({expireDelay:Xf});if(o.renewObservable.subscribe(()=>{a.add(c(),de()),i.notify()}),o.expireObservable.subscribe(()=>{s.notify(),a.closeActive(de())}),o.expandOrRenewSession(),a.add(c(),va().relative),pt(Te.SHORT_SESSION_INVESTIGATION)){const l=o.getSession();l&&nm(e,l)}r.observable.subscribe(()=>{r.isGranted()?o.expandOrRenewSession():o.expire(!1)}),Jf(e,()=>{r.isGranted()&&o.expandOrRenewSession()}),Qf(e,()=>o.expandSession()),em(e,()=>o.restartSession());function c(){const l=o.getSession();return l?{id:l.id,trackingType:l[t],isReplayForced:!!l.forcedReplay,anonymousId:l.anonymousId}:(tm(e).catch(()=>{}),{id:"invalid",trackingType:Oa,isReplayForced:!1,anonymousId:void 0})}return{findSession:(l,h)=>a.find(l,h),renewObservable:i,expireObservable:s,sessionStateUpdateOb
37servable:o.sessionStateUpdateObservable,expire:o.expire,updateSessionState:o.updateSessionState}}function Jf(e,t){const{stop:n}=Ye(e,window,["click","touchstart","keydown","scroll"],t,{capture:!0,passive:!0})}function Qf(e,t){const n=()=>{document.visibilityState==="visible"&&t()},{stop:r}=$(e,document,"visibilitychange",n);Qt(n,Yf)}function em(e,t){const{stop:n}=$(e,window,"resume",t,{capture:!0})}async function tm(e){const t=e.sessionStoreStrategyType;if(!t)return;let n,r;t.type===$t.COOKIE?(n=Pa(t.cookieOptions),r={cookie:await pc(),currentDomain:`${window.location.protocol}//${window.location.hostname}`}):n=Va(),qn("Unexpected session state",{sessionStoreStrategyType:t.type,session:n,isSyntheticsTest:mc(),createdTimestamp:n==null?void 0:n.created,expireTimestamp:n==null?void 0:n.expire,...r})}function nm(e,t){if(!window.cookieStore||!t.created)return;const n=Number(t.created),r=ae(),{stop:i}=$(e,cookieStore,"change",s);function s(o){const a=Ia(o.changed,l=>l.name===xe);if(!a)return;const c=ae()-n;if(c>14*ce)i();else{const l=Vr(a.value);if(l.id&&l.id!==t.id){i();const h=ae()-r;pc().then(d=>{qn("Session cookie changed",{time:h,session_age:c,old:t,new:l,cookie:d})}).catch(ft)}}}}async function pc(){let e;return"cookieStore"in window?e=await window.cookieStore.getAll(xe):e=document.cookie.split(/\s*;\s*/).filter(t=>t.startsWith(xe)),{count:e.length,domain:Ca()||"undefined",...e}}function rm(){let e="",t=0;return{isAsync:!1,get isEmpty(){return!e},write(n,r){const i=Ea(n);t+=i,e+=n,r&&r(i)},finish(n){n(this.finishSync())},finishSync(){const n={output:e,outputBytesCount:t,rawBytesCount:t,pendingData:""};return e="",t=0,n},estimateEncodedBytesCount(n){return n.length}}}class im{constructor(){this.callbacks={}}notify(t,n){const r=this.callbacks[t];r&&r.forEach(i=>i(n))}subscribe(t,n){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(n),{unsubscribe:()=>{this.callbacks[t]=this.callbacks[t].filter(r=>n!==r)}}}}function si(e,t,n){let r=0,i=!1;return{isLimitReached(){if(r===0&&ee(()=>{r=0},ce),r+=1,r<=t||i)return i=!1,!1;if(r===t+1){i=!0;try{n({message:`Reached max number of ${e}s by minute: ${t}`,source:en.AGENT,startClocks:Q()})}finally{i=!1}}return!0}}}
37function es(e,t,n){return document.readyState===t||document.readyState==="complete"?(n(),{stop:U}):$(e,window,t==="complete"?"load":"DOMContentLoaded",n,{once:!0})}function sm(e,t){return new Promise(n=>{es(e,t,n)})}let oi;const ts=new WeakMap;function om(e){return oi||(oi=am(e)),oi}function am(e){return new D(t=>{const{stop:n}=_e(XMLHttpRequest.prototype,"open",cm),{stop:r}=_e(XMLHttpRequest.prototype,"send",s=>{lm(s,e,t)},{computeHandlingStack:!0}),{stop:i}=_e(XMLHttpRequest.prototype,"abort",um);return()=>{n(),r(),i()}})}function cm({target:e,parameters:[t,n]}){ts.set(e,{state:"open",method:String(t).toUpperCase(),url:Ki(String(n))})}function lm({target:e,parameters:[t],handlingStack:n},r,i){const s=ts.get(e);if(!s)return;const o=s;o.state="start",o.startClocks=Q(),o.isAborted=!1,o.xhr=e,o.handlingStack=n,o.body=t;let a=!1;const{stop:c}=_e(e,"onreadystatechange",()=>{e.readyState===XMLHttpRequest.DONE&&l()}),l=()=>{if(h(),c(),a)return;a=!0;const d=s;d.state="complete",d.duration=G(o.startClocks.timeStamp,J()),d.status=e.status,i.notify(bn(d))},{stop:h}=$(r,e,"loadend",l);i.notify(o)}function um({target:e}){const t=ts.get(e);t&&(t.isAborted=!0)}let ai;function gc(){return ai||(ai=dm()),ai}function dm(){return new D(e=>{if(!we.fetch)return;const{stop:t}=_e(we,"fetch",n=>hm(n,e),{computeHandlingStack:!0});return t})}function hm({parameters:e,onPostCall:t,handlingStack:n},r){const[i,s]=e;let o=s&&s.method;o===void 0&&i instanceof Request&&(o=i.method);const a=o!==void 0?String(o).toUpperCase():"GET",c=i instanceof Request?i.url:Ki(String(i)),l=Q(),h={state:"start",init:s,input:i,method:a,startClocks:l,url:c,handlingStack:n};r.notify(h),e[0]=h.input,e[1]=h.init,t(d=>fm(r,d,h))}function fm(e,t,n){const r=n;function i(s){r.state="resolve",Object.assign(r,s),e.notify(r)}t.then(I(s=>{i({response:s,responseType:s.type,status:s.status,isAborted:!1})}),I(s=>{var o,a;i({status:0,isAborted:((a=(o=r.init)===null||o===void 0?void 0:o.signal)===null||a===void 0?void 0:a.aborted)||s instanceof DOMException&&s.code===DOMException.ABORT_ERR,error:s})}))}function mm(e,t){if(window.requestIdleCallback&&window.cancelIdleCallback){const n=window.requestIdleCallback(I(e),t);return()=>window.cancelIdleCallback(n)}return gm(e)}const pm=50;function gm(e){const t=ae(),n=ee(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,pm-(ae()-t))})}
37,0);return()=>pe(n)}const bm=ne,vm=30;function ym(){const e=[];function t(r){let i;if(r.didTimeout){const s=performance.now();i=()=>vm-(performance.now()-s)}else i=r.timeRemaining.bind(r);for(;i()>0&&e.length;)e.shift()();e.length&&n()}function n(){mm(t,{timeout:bm})}return{push(r){e.push(r)===1&&n()},stop(){e.length=0}}}let ci={};function Em(e){const t=e.map(n=>(ci[n]||(ci[n]=Sm(n)),ci[n]));return wa(...t)}function Sm(e){return new D(t=>{const n=Oe[e];return Oe[e]=(...r)=>{n.apply(console,r);const i=pr("console error");We(()=>{t.notify(_m(r,e,i))})},()=>{Oe[e]=n}})}function _m(e,t,n){const r=e.map(i=>wm(i)).join(" ");if(t===Lr.error){const i=e.find(vt),s=Zi({originalError:i,handlingStack:n,startClocks:Q(),source:en.CONSOLE,handling:"handled",nonErrorPrefix:"Provided",useFallbackStack:!1});return s.message=r,{api:t,message:r,handlingStack:n,error:s}}return{api:t,message:r,error:void 0,handlingStack:n}}function wm(e){return typeof e=="string"?H(e):vt(e)?Wa(Fn(e)):Un(H(e),void 0,2)}const Tm=500;function Am(){const e=[];return{add:i=>{e.push(i)>Tm&&e.splice(0,1)},remove:i=>{uc(e,i)},drain:i=>{e.forEach(s=>s(i)),e.length=0}}}function Rm(e){const t=bt(e)==="object";return t||L.error("Unsupported context:",e),t}function li(e,t,n){const r={...e};for(const[i,{required:s,type:o}]of Object.entries(t))o==="string"&&!Ls(r[i])&&(r[i]=String(r[i])),s&&Ls(r[i])&&L.warn(`The property ${i} of ${n} is required; context will not be sent to the intake.`);return r}function Ls(e){return e==null||e===""}function qr(e="",{propertiesConfig:t={}}={}){let n={};const r=new D,i={getContext:()=>Ji(n),setContext:s=>{Rm(s)?n=H(li(s,t,e)):i.clearContext(),r.notify()},setContextProperty:(s,o)=>{n=H(li({...n,[s]:o},t,e)),r.notify()},removeContextProperty:s=>{delete n[s],li(n,t,e),r.notify()},clearContext:()=>{n={},r.notify()},changeObservable:r};return i}function ie(e,t,n,r){return I((...i)=>(r&&Y({feature:r}),e()[t][n](...i)))}const Cm="_dd_c",Im=[];function ns(e,t,n,r){const i=km(n,r);Im.push($(e,window,"storage",({key:l})=>{i===l&&o()})),t.changeObservable.subscribe(a);const s=Ne(c(),t.getContext());Ze(s)||t.setContext(s);function o(){t.setContext(c())}function a(){localStorage.setItem(i,JSON.stringify(t.getContext()))}function c(){const l=localStorage.getItem(i);return l?JSON.parse(l):{}}}function km(e,t){return`${Cm}_${e}_${t}`}function Lm(e,t,n){const r=bc();return t.storeContextsAcrossPages&&ns(t,r,n,4),e.register(0,()=>{const i=r.getContext();return Ze(i)||!i.id?he:{account:i}}),r}function bc(){return qr("account",{propertiesConfig:{id:{type:"string",required:!0},name:{type:"string"}}})}function Om(e,t,n,r){const i=vc();return t.storeContextsAcrossPages&&ns(t,i,n,2),e.register(0,()=>({context:i.getContext()})),i}function vc(){return qr("global context")}function Mm(e,t,n,r){const i=yc();return t.storeContextsAcrossPages&&ns(t,i,r,1),e.register(0,({eventType:s,startTime:o})=>{const a=i.getContext(),c=n.findTrackedSession(o);return c&&c.anonymousId&&!a.anonymous_id&&t.trackAnonymousUser&&(a.anonymous_id=c.anonymousId),Ze(a)?he:{type:s,usr:a}}),e.register(1,({startTime:s})=>{var o;return{anonymous_id:(o=n.findTrackedSession(s))===null||o===void 0?void 0:o.anonymousId}}),i}function yc(){return qr("user",{propertiesConfig:{id:{type:"string"},name:{type:"string"},email:{type:"string"}}})}const X={userContext:"userContext",globalContext:"globalContext",accountContext:"accountContext"},se={getContext:"getContext",setContext:"setContext",setContextProperty:"setContextProperty",removeContextProperty:"removeContextProperty",clearContext:"clearContext"};function xm(e,t,n){const r=e.getReader();let i=0;s();function s(){r.read().then(I(a=>{if(a.done){o();return}i+=a.value.length,i>n.bytesLimit?o():s()}),I(a=>t(a)))}function o(){r.cancel().catch(U),t(void 0,void 0,void 0)}}const oe={DOCUMENT:"document",XHR:"xhr",BEACON:"beacon",FETCH:"fetch",CSS:"css",JS:"js",IMAGE:"image",FONT:"font",MEDIA:"media",OTHER:"other"},Hr={FETCH:oe.FETCH,XHR:oe.XHR},Nm=500;function Pm(e=tf){const t=new Ta(Nm),n=e().subscribe(r=>{t.notify({type:0,error:r})});return{observable:t,stop:()=>{n.unsubscribe()}}}function Dm(){try{return new Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}const x={ACTION:"action",ERROR:"error",LONG_TASK:"long_task",VIEW:"view",RESOURCE:"resource",VITAL:"vital"},Ec={LONG_TASK:"long-task",LONG_ANIMATION_FRAME:"long-animation-frame"},Me={INITIAL_LOAD:"initial_load",ROUTE_CHANGE:"route_change",BF_CACHE:"bf_cache"},rs={CLICK:"click",CUSTOM:"custom"},on={RAGE_CLICK:"rage_click",ERROR_CLICK:"error_click",DEAD_CLICK:"dead_click"}
37,Sn={DURATION:"duration",OPERATION_STEP:"operation_step"};function Fm(){return{vitalsByName:new Map,vitalsByReference:new WeakMap}}function Vm(e,t,n){function r(o){return!t.wasInPageStateDuringPeriod("frozen",o.startClocks.relative,o.duration)}function i(o){r(o)&&e.notify(12,Os(o))}function s(o,a,c,l){if(!pt(Te.FEATURE_OPERATION_VITAL))return;const{operationKey:h,context:d,description:u}=c||{},f={name:o,type:Sn.OPERATION_STEP,operationKey:h,failureReason:l,stepType:a,startClocks:Q(),context:H(d),description:u};e.notify(12,Os(f))}return{addOperationStepVital:s,addDurationVital:i,startDurationVital:(o,a={})=>Sc(n,o,a),stopDurationVital:(o,a={})=>{_c(i,n,o,a)}}}function Sc({vitalsByName:e,vitalsByReference:t},n,r={}){const i={name:n,startClocks:Q(),...r},s={__dd_vital_reference:!0};return e.set(n,i),t.set(s,i),s}function _c(e,{vitalsByName:t,vitalsByReference:n},r,i={}){const s=typeof r=="string"?t.get(r):n.get(r);s&&(e(Um(s,s.startClocks,i,Q())),typeof r=="string"?t.delete(r):n.delete(r))}function Um(e,t,n,r){var i;return{name:e.name,type:Sn.DURATION,startClocks:t,duration:G(t.timeStamp,r.timeStamp),context:Ne(e.context,n.context),description:(i=n.description)!==null&&i!==void 0?i:e.description}}function Os(e){const{startClocks:t,type:n,name:r,description:i,context:s}=e,o={id:te(),type:n,name:r,description:i,...n===Sn.DURATION?{duration:M(e.duration)}:{step_type:e.stepType,operation_key:e.operationKey,failure_reason:e.failureReason}};return{rawRumEvent:{date:t.timeStamp,vital:o,type:x.VITAL,context:s},startTime:t.relative,duration:n===Sn.DURATION?e.duration:void 0,domainContext:{}}}function wc(e,t,n){if(e)for(const r of e){const i=r[t];i&&i(n)}}const Ms=new Map;function Tc(e,t){if(t===100)return!0;if(t===0)return!1;const n=Ms.get(t);if(n&&e===n.sessionId)return n.decision;let r;return window.BigInt?r=Bm(BigInt(`0x${e.split("-")[4]}`),t):r=at(t),Ms.set(t,{sessionId:e,decision:r}),r}function Bm(e,t){const n=BigInt("1111111111111111111"),r=BigInt("0x10000000000000000"),i=e*n%r;return Number(i)<=t/100*Number(r)}function qm(){return Rc(64)}function Ac(){return Rc(63)}function Rc(e){const t=crypto.getRandomValues(new Uint32Array(2));return e===63&&(t[t.length-1]>>>=1),{toString(n=10){let r=t[1],i=t[0],s="";do{const o=r%n*4294967296+i;r=Math.floor(r/n),i=Math.floor(o/n),s=(o%n).toString(n)+s}while(r||i);return s}}}function _t(e){return e.toString(16).padStart(16,"0")}function Hm(e){const t=e;return bt(t)==="object"&&yn(t.match)&&Array.isArray(t.propagatorTypes)}function zm(e){e.status===0&&!e.isAborted&&(e.traceId=void 0,e.spanId=void 0,e.traceSampled=void 0)}function $m(e,t,n,r){return{clearTracingIfNeeded:zm,traceFetch:i=>xs(e,i,t,n,r,s=>{var o;if(i.input instanceof Request&&!(!((o=i.init)===null||o===void 0)&&o.headers))i.input=new Request(i.input),Object.keys(s).forEach(a=>{i.input.headers.append(a,s[a])});else{i.init=bn(i.init);const a=[];i.init.headers instanceof Headers?i.init.headers.forEach((c,l)=>{a.push([l,c])}):Array.isArray(i.init.headers)?i.init.headers.forEach(c=>{a.push(c)}):i.init.headers&&Object.keys(i.init.headers).forEach(c=>{a.push([c,i.init.headers[c]])}),i.init.headers=a.concat(Yi(s))}}),traceXhr:(i,s)=>xs(e,i,t,n,r,o=>{Object.keys(o).forEach(a=>{s.setRequestHeader(a,o[a])})})}}function xs(e,t,n,r,i,s){const o=n.findTrackedSession();if(!o)return;const a=e.allowedTracingUrls.find(h=>Ur([h.match],t.url,!0));if(!a)return;const c=Tc(o.id,e.traceSampleRate);(c||e.traceContextInjection===Ri.ALL)&&(t.traceSampled=c,t.traceId=qm(),t.spanId=Ac(),s(Wm(t.traceId,t.spanId,t.traceSampled,o.id,a.propagatorTypes,r,i,e)))}function Wm(e,t,n,r,i,s,o,a){const c={};if(i.forEach(l=>{switch(l){case"datadog":{Object.assign(c,{"x-datadog-origin":"rum","x-datadog-parent-id":t.toString(),"x-datadog-sampling-priority":n?"1":"0","x-datadog-trace-id":e.toString()});break}case"tracecontext":{Object.assign(c,{traceparent:`00-0000000000000000${_t(e)}-${_t(t)}-0${n?"1":"0"}`,tracestate:`dd=s:${n?"1":"0"};o:rum`});break}case"b3":{Object.assign(c,{b3:`${_t(e)}-${_t(t)}-${n?"1":"0"}`});break}case"b3multi":{Object.assign(c,{"X-B3-TraceId":_t(e),"X-B3-SpanId":_t(t),"X-B3-Sampled":n?"1":"0"});break}}}),a.propagateTraceBaggage){const l={"session.id":r},h=s.getContext().id;typeof h=="string"&&(l["user.id"]=h);const d=o.getContext().id;
37typeof d=="string"&&(l["account.id"]=d);const u=Object.entries(l).map(([f,m])=>`${f}=${encodeURIComponent(m)}`).join(",");u&&(c.baggage=u)}return c}const Cc=["tracecontext","datadog"];function Gm(e,t){var n,r,i,s,o,a,c;if(e.trackFeatureFlagsForEvents!==void 0&&!Array.isArray(e.trackFeatureFlagsForEvents)&&L.warn("trackFeatureFlagsForEvents should be an array"),!e.applicationId){L.error("Application ID is not configured, no RUM data will be collected.");return}if(!Ot(e.sessionReplaySampleRate,"Session Replay")||!Ot(e.traceSampleRate,"Trace"))return;if(e.excludedActivityUrls!==void 0&&!Array.isArray(e.excludedActivityUrls)){L.error("Excluded Activity Urls should be an array");return}const l=jm(e);if(!l)return;const h=kh(e,t),d=Ym(e);if(!h)return;const u=(n=e.sessionReplaySampleRate)!==null&&n!==void 0?n:0;return{applicationId:e.applicationId,actionNameAttribute:e.actionNameAttribute,sessionReplaySampleRate:u,startSessionReplayRecordingManually:e.startSessionReplayRecordingManually!==void 0?!!e.startSessionReplayRecordingManually:u===0,traceSampleRate:(r=e.traceSampleRate)!==null&&r!==void 0?r:100,rulePsr:Pn(e.traceSampleRate)?e.traceSampleRate/100:void 0,allowedTracingUrls:l,excludedActivityUrls:(i=e.excludedActivityUrls)!==null&&i!==void 0?i:[],workerUrl:e.workerUrl,compressIntakeRequests:!!e.compressIntakeRequests,trackUserInteractions:!!(!((s=e.trackUserInteractions)!==null&&s!==void 0)||s),trackViewsManually:!!e.trackViewsManually,trackResources:!!(!((o=e.trackResources)!==null&&o!==void 0)||o),trackLongTasks:!!(!((a=e.trackLongTasks)!==null&&a!==void 0)||a),trackBfcacheViews:!!e.trackBfcacheViews,trackEarlyRequests:!!e.trackEarlyRequests,subdomain:e.subdomain,defaultPrivacyLevel:fr(Lt,e.defaultPrivacyLevel)?e.defaultPrivacyLevel:Lt.MASK,enablePrivacyForActionName:!!e.enablePrivacyForActionName,traceContextInjection:fr(Ri,e.traceContextInjection)?e.traceContextInjection:Ri.SAMPLED,plugins:e.plugins||[],trackFeatureFlagsForEvents:e.trackFeatureFlagsForEvents||[],profilingSampleRate:(c=e.profilingSampleRate)!==null&&c!==void 0?c:0,prop
37agateTraceBaggage:!!e.propagateTraceBaggage,allowedGraphQlUrls:d,...h}}function jm(e){if(e.allowedTracingUrls===void 0)return[];if(!Array.isArray(e.allowedTracingUrls)){L.error("Allowed Tracing URLs should be an array");return}if(e.allowedTracingUrls.length!==0&&e.service===void 0){L.error("Service needs to be configured when tracing is enabled");return}const t=[];return e.allowedTracingUrls.forEach(n=>{yn(n)?t.push({match:n,propagatorTypes:Cc}):Hm(n)?t.push(n):L.warn("Allowed Tracing Urls parameters should be a string, RegExp, function, or an object. Ignoring parameter",n)}),t}function Km(e){const t=new Set;return mn(e.allowedTracingUrls)&&e.allowedTracingUrls.forEach(n=>{yn(n)?Cc.forEach(r=>t.add(r)):bt(n)==="object"&&Array.isArray(n.propagatorTypes)&&n.propagatorTypes.forEach(r=>t.add(r))}),Array.from(t)}function Ym(e){if(!e.allowedGraphQlUrls)return[];if(!Array.isArray(e.allowedGraphQlUrls))return L.warn("allowedGraphQlUrls should be an array"),[];const t=[];return e.allowedGraphQlUrls.forEach(n=>{yn(n)?t.push({match:n,trackPayload:!1}):n&&typeof n=="object"&&"match"in n&&yn(n.match)&&t.push({match:n.match,trackPayload:!!n.trackPayload})}),t}function Xm(e){return mn(e)&&e.some(t=>typeof t=="object"&&"trackPayload"in t?!!t.trackPayload:!1)}function Zm(e){var t;const n=Lh(e);return{session_replay_sample_rate:e.sessionReplaySampleRate,start_session_replay_recording_manually:e.startSessionReplayRecordingManually,trace_sample_rate:e.traceSampleRate,trace_context_injection:e.traceContextInjection,propagate_trace_baggage:e.propagateTraceBaggage,action_name_attribute:e.actionNameAttribute,use_allowed_tracing_urls:mn(e.allowedTracingUrls),use_allowed_graph_ql_urls:mn(e.allowedGraphQlUrls),use_track_graph_ql_payload:Xm(e.allowedGraphQlUrls),selected_tracing_propagators:Km(e),default_privacy_level:e.defaultPrivacyLevel,enable_privacy_for_action_name:e.enablePrivacyForActionName,use_excluded_activity_urls:mn(e.excludedActivityUrls),use_worker_url:!!e.workerUrl,compress_intake_requests:e.compressIntakeRequests,track_views_manually:e.trackViewsManually,track_user_interactions:e.trackUserInteractions,track_resources:e.trackResources,track_long_task:e.trackLongTasks,track_bfcache_views:e.trackBfcacheViews,track_early_requests:e.trackEarlyRequests,plugins:(t=e.plugins)===null||t===void 0?void 0:t.map(r=>{var i;return{name:r.name,...(i=r.getConfigurationTelemetry)===null||i===void 0?void 0:i.call(r)}}),track_feature_flags_for_events:e.trackFeatureFlagsForEvents,remote_configuration_id:e.remoteConfigurationId,profiling_sample_rate:e.profilingSampleRate,use_remote_configuration_proxy:!!e.remoteConfigurationProxy,...n}}function Jm(e){const t=[];let n=0,r;const i={quote:void 0,escapeSequence:void 0};let s="";for(const o of e){if(r=Ns[n].find(a=>ip[a](o,i)),!r)return[];if(i.escapeSequence!==void 0&&r!==12){if(!ap(i.escapeSequence))return[];s+=lp(i.escapeSequence),i.escapeSequence=void 0}sp.includes(r)?s+=o:op.includes(r)&&s!==""?(t.push(s),s=""):r===12?i.escapeSequence=i.escapeSequence?`${i.escapeSequence}${o}`:o:r===8?i.quote=o:r===9&&(i.quote=void 0),n=r}return Ns[n].includes(1)?(s!==""&&t.push(s),t):[]}const Qm=/[a-zA-Z_$]/,ep=/[a-zA-Z0-9_$]/,tp=/[0-9]/,np=/[a-fA-F0-9]/,rp=`'"`,ip={0:()=>!1,1:()=>!1,2:e=>Qm.test(e),3:e=>ep.test(e),4:e=>e===".",5:e=>e==="[",6:e=>e==="]",7:e=>tp.test(e),8:e=>rp.includes(e),9:(e,t)=>e===t.quote,10:()=>!0,11:e=>e==="\\",12:(e,t)=>t.escapeSequence===void 0?`${t.quote}/\\bfnrtu`.includes(e):t.escapeSequence.startsWith("u")&&t.escapeSequence.length<5?np.test(e):!1},Ns={0:[2,5],1:[],2:[3,4,5,1],3:[3,4,5,1],4:[2],5:[8,7],6:[4,5,1],7:[7,6],8:[11,9,10],9:[6],10:[11,9,10],11:[12],12:[12,11,9,10]},sp=[2,3,7,10],op=[4,5,6];function ap(e){return`"'/\\bfnrt`.includes(e)||e.startsWith("u")&&e.length===5}const cp={'"':'"',"'":"'","/":"/","\\":"\\",b:"\b",f:"\f",n:` 38`,r:"\r",t:" "};function lp(e){return e.startsWith("u")?String.fromCharCode(parseInt(e.slice(1),16)):cp[e]}const up="v1",dp=["applicationId","service","env","version","sessionSampleRate","sessionReplaySampleRate","defaultPrivacyLevel","enablePrivacyForActionName","traceSampleRate","trackSessionAcrossSubdomains","allowedTracingUrls","allowedTrackingOrigins"];async function hp(e,t){let n;const r=mp(),i=await vp(e);
38return i.ok?(r.increment("fetch","success"),n=fp(e,i.value,t,r)):(r.increment("fetch","failure"),L.error(i.error)),Br("remote configuration metrics",{metrics:r.get()}),n}function fp(e,t,n,r){const i={...e};return dp.forEach(u=>{u in t&&(i[u]=s(t[u]))}),Object.keys(n).forEach(u=>{t[u]!==void 0&&o(n[u],t[u])}),i;function s(u){if(Array.isArray(u))return u.map(s);if(pp(u)){if(gp(u)){const f=u.rcSerializedType;switch(f){case"string":return u.value;case"regex":return Ic(u.value);case"dynamic":return a(u);default:L.error(`Unsupported remote configuration: "rcSerializedType": "${f}"`);return}}return Sa(u,s)}return u}function o(u,f){f.forEach(({key:m,value:v})=>{u.setContextProperty(m,s(v))})}function a(u){const f=u.strategy;let m;switch(f){case"cookie":m=c(u);break;case"dom":m=l(u);break;case"js":m=d(u);break;default:L.error(`Unsupported remote configuration: "strategy": "${f}"`);return}const v=u.extractor;return v!==void 0&&typeof m=="string"?bp(v,m):m}function c({name:u}){const f=Fr(u);return r.increment("cookie",f!==void 0?"success":"missing"),f}function l({selector:u,attribute:f}){let m;try{m=document.querySelector(u)}catch{L.error(`Invalid selector in the remote configuration: '${u}'`),r.increment("dom","failure");return}if(!m){r.increment("dom","missing");return}if(h(m,f)){L.error(`Forbidden element selected by the remote configuration: '${u}'`),r.increment("dom","failure");return}const v=f!==void 0?m.getAttribute(f):m.textContent;if(v===null){r.increment("dom","missing");return}return r.increment("dom","success"),v}function h(u,f){return u.getAttribute("type")==="password"&&f==="value"}function d({path:u}){let f=window;const m=Jm(u);if(m.length===0){L.error(`Invalid JSON path in the remote configuration: '${u}'`),r.increment("js","failure");return}for(const v of m){if(!(v in f)){r.increment("js","missing");return}try{f=f[v]}catch(S){L.error(`Error accessing: '${u}'`,S),r.increment("js","failure");return}}return r.increment("js","success"),f}}function mp(){const e={fetch:{}};return{get:()=>e,increment:(t,n)=>{e[t]||(e[t]={}),e[t][n]||(e[t][n]=0),e[t][n]=e[t][n]+1}}}function pp(e){return typeof e=="object"&&e!==null}function gp(e){return"rcSerializedType"in e}function Ic(e){try{return new RegExp(e)}catch{L.error(`Invalid regex in the remote configuration: '${e}'`)}}function bp(e,t){const n=Ic(e.value);if(n===void 0)return;const r=n.exec(t);if(r===null)return;const[i,s]=r;return s||i}async function vp(e){let t;try{t=await fetch(yp(e))}catch{t=void 0}if(!t||!t.ok)return{ok:!1,error:new Error("Error fetching the remote configuration.")};const n=await t.json();return n.rum?{ok:!0,value:n.rum}:{ok:!1,error:new Error("No remote configuration for RUM.")}}function yp(e){return e.remoteConfigurationProxy?e.remoteConfigurationProxy:`https://sdk-configuration.${Ha("rum",e)}/${up}/${encodeURIComponent(e.remoteConfigurationId)}.json`}function Ep({ignoreInitIfSyntheticsWillInjectRum:e=!0,startDeflateWorker:t},n,r,i){const s=Am(),o=vc();ui(o,X.globalContext,s);const a=yc();ui(a,X.userContext,s);const c=bc();ui(c,X.accountContext,s);let l,h,d,u;const f=n.observable.subscribe(v),m={};function v(){if(!d||!u||!n.isGranted())return;f.unsubscribe();let p;if(u.trackViewsManually){if(!l)return;s.remove(l.callback),p=l.options}const b=i(u,h,p);s.drain(b)}function S(p,b){const g=jt();if(g&&(p=Sp(p)),d=p,qf(Zm(p)),u){ja("DD_RUM",p);return}const y=Gm(p,b);if(y){if(!g&&!y.sessionStoreStrategyType){L.warn("No storage available for session. We will not send any data.");return}y.compressIntakeRequests&&!g&&t&&(h=t(y,"Datadog RUM",U),!h)||(u=y,gc().subscribe(U),n.tryToInit(y.trackingConsent),v())}}const T=p=>{s.add(b=>b.addDurationVital(p))};return{init(p,b,g){if(!p){L.error("Missing configuration");return}Id(p.enableExperimentalFeatures),d=p,!(e&&dc())&&(wc(p.plugins,"onInit",{initConfiguration:p,publicApi:b}),p.remoteConfigurationId?hp(p,{user:a,context:o}).then(y=>{y&&S(y,g)}).catch(ft):S(p,g))},get initConfiguration(){return d},getInternalContext:U,stopSession:U,addTiming(p,b=J()){s.add(g=>g.addTiming(p,b))},startView(p,b=Q()){const g=y=>{y.startView(p,b)};s.add(g),l||(l={options:p,callback:g},v())}
38,setViewName(p){s.add(b=>b.setViewName(p))},setViewContext(p){s.add(b=>b.setViewContext(p))},setViewContextProperty(p,b){s.add(g=>g.setViewContextProperty(p,b))},getViewContext:()=>m,globalContext:o,userContext:a,accountContext:c,addAction(p){s.add(b=>b.addAction(p))},addError(p){s.add(b=>b.addError(p))},addFeatureFlagEvaluation(p,b){s.add(g=>g.addFeatureFlagEvaluation(p,b))},startDurationVital(p,b){return Sc(r,p,b)},stopDurationVital(p,b){_c(T,r,p,b)},addDurationVital:T,addOperationStepVital:(p,b,g,y)=>{s.add(A=>A.addOperationStepVital(H(p),b,H(g),H(y)))}}}function Sp(e){var t,n;return{...e,applicationId:"00000000-aaaa-0000-aaaa-000000000000",clientToken:"empty",sessionSampleRate:100,defaultPrivacyLevel:(t=e.defaultPrivacyLevel)!==null&&t!==void 0?t:(n=Bn())===null||n===void 0?void 0:n.getPrivacyLevel()}}function ui(e,t,n){e.changeObservable.subscribe(()=>{const r=e.getContext();n.add(i=>i[t].setContext(r))})}function _p(e,t,n,r={}){const i=uh(),s=Fm(),o=Pm().observable;let a=Ep(r,i,s,(d,u,f)=>{const m=u&&r.createDeflateEncoder?S=>r.createDeflateEncoder(d,u,S):rm,v=e(d,t,n,f,m,i,s,o,r.sdkName);return t.onRumStart(v.lifeCycle,d,v.session,v.viewHistory,u,v.telemetry),n.onRumStart(v.lifeCycle,v.hooks,d,v.session,v.viewHistory,m),a=wp(a,v),wc(d.plugins,"onRumStart",{strategy:a,addEvent:v.addEvent}),v});const c=()=>a,l=I(d=>{const u=typeof d=="object"?d:{name:d};a.startView(u),Y({feature:"start-view"})}),h=sf({init:d=>{const u=new Error().stack;We(()=>a.init(d,h,u))},setTrackingConsent:I(d=>{i.update(d),Y({feature:"set-tracking-consent",tracking_consent:d})}),setViewName:I(d=>{a.setViewName(d),Y({feature:"set-view-name"})}),setViewContext:I(d=>{a.setViewContext(d),Y({feature:"set-view-context"})}),setViewContextProperty:I((d,u)=>{a.setViewContextProperty(d,u),Y({feature:"set-view-context-property"})}),getViewContext:I(()=>(Y({feature:"set-view-context-property"}),a.getViewContext())),getInternalContext:I(d=>a.getInternalContext(d)),getInitConfiguration:I(()=>Ji(a.initConfiguration)),addAction:(d,u)=>{const f=pr("action");We(()=>{a.addAction({name:H(d),context:H(u),startClocks:Q(),type:rs.CUSTOM,handlingStack:f}),Y({feature:"add-action"})})},addError:(d,u)=>{const f=pr("error");We(()=>{a.addError({error:d,handlingStack:f,context:H(u),startClocks:Q()}),Y({feature:"add-error"})})},addTiming:I((d,u)=>{a.addTiming(H(d),u)}),setGlobalContext:ie(c,X.globalContext,se.setContext,"set-global-context"),getGlobalContext:ie(c,X.globalContext,se.getContext,"get-global-context"),setGlobalContextProperty:ie(c,X.globalContext,se.setContextProperty,"set-global-context-property"),removeGlobalContextProperty:ie(c,X.globalContext,se.removeContextProperty,"remove-global-context-property"),clearGlobalContext:ie(c,X.globalContext,se.clearContext,"clear-global-context"),setUser:ie(c,X.userContext,se.setContext,"set-user"),getUser:ie(c,X.userContext,se.getContext,"get-user"),setUserProperty:ie(c,X.userContext,se.setContextProperty,"set-user-property"),removeUserProperty:ie(c,X.userContext,se.removeContextProperty,"remove-user-property"),clearUser:ie(c,X.userContext,se.clearContext,"clear-user"),setAccount:ie(c,X.accountContext,se.setContext,"set-account"),getAccount:ie(c,X.accountContext,se.getContext,"get-account"),setAccountProperty:ie(c,X.accountContext,se.setContextProperty,"set-account-property"),removeAccountProperty:ie(c,X.accountContext,se.removeContextProperty,"remove-account-property"),clearAccount:ie(c,X.accountContext,se.clearContext,"clear-account"),startView:l,stopSession:I(()=>{a.stopSession(),Y({feature:"stop-session"})}),addFeatureFlagEvaluation:I((d,u)=>{a.addFeatureFlagEvaluation(H(d),H(u)),Y({feature:"add-feature-flag-evaluation"})}),getSessionReplayLink:I(()=>t.getSessionReplayLink()),startSessionReplayRecording:I(d=>{t.start(d),Y({feature:"start-session-replay-recording",force:d&&d.force})}),stopSessionReplayRecording:I(()=>t.stop()),addDurationVital:I((d,u)=>{Y({feature:"add-duration-vital"}),a.addDurationVital({name:H(d),type:Sn.DURATION,startClocks:bd(u.startTime),duration:u.duration,context:H(u&&u.context),description:H(u&&u.description)})}),startDurationVital:I((d,u)=>(Y({feature:"start-duration-vital"}),a.startDurationVital(H(d),{context:H(u&&u.context),description:H(u&&u.description)}))),stopDurationVital:I((d,u)=>{Y({feature:"stop-duration-vital"}
38),a.stopDurationVital(typeof d=="string"?H(d):d,{context:H(u&&u.context),description:H(u&&u.description)})}),startFeatureOperation:I((d,u)=>{Y({feature:"add-operation-step-vital",action_type:"start"}),a.addOperationStepVital(d,"start",u)}),succeedFeatureOperation:I((d,u)=>{Y({feature:"add-operation-step-vital",action_type:"succeed"}),a.addOperationStepVital(d,"end",u)}),failFeatureOperation:I((d,u,f)=>{Y({feature:"add-operation-step-vital",action_type:"fail"}),a.addOperationStepVital(d,"end",f,u)})});return h}function wp(e,t){return{init:n=>{ja("DD_RUM",n)},initConfiguration:e.initConfiguration,...t}}function Tp(){const e=Ap();return new D(t=>{if(!e)return;const n=new e(I(r=>t.notify(r)));return n.observe(document,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),()=>n.disconnect()})}function Ap(){let e;const t=window;if(t.Zone&&(e=Ke(t,"MutationObserver"),t.MutationObserver&&e===t.MutationObserver)){const n=new t.MutationObserver(U),r=Ke(n,"originalInstance");e=r&&r.constructor}return e||(e=t.MutationObserver),e}function Rp(){const e=new D,{stop:t}=_e(window,"open",()=>e.notify());return{observable:e,stop:t}}function Cp(e,t,n,r,i){return{get:s=>{const o=n.findView(s),a=i.findUrl(s),c=t.findTrackedSession(s);if(c&&o&&a){const l=r.findActionId(s);return{application_id:e,session_id:c.id,user_action:l?{id:l}:void 0,view:{id:o.id,name:o.name,referrer:a.referrer,url:a.url}}}}}}const Ip=im,kp=gt;function Lp(e){const t=nn({expireDelay:kp});e.subscribe(1,r=>{t.add(n(r),r.startClocks.relative)}),e.subscribe(6,({endClocks:r})=>{t.closeActive(r.relative)}),e.subscribe(3,r=>{const i=t.find(r.startClocks.relative);i&&(r.name&&(i.name=r.name),r.context&&(i.context=r.context),i.sessionIsActive=r.sessionIsActive)}),e.subscribe(10,()=>{t.reset()});function n(r){return{service:r.service,version:r.version,context:r.context,id:r.id,name:r.name,startClocks:r.startClocks}}return{findView:r=>t.find(r),stop:()=>{t.stop()}}}const kc="initial_document",Op=[[oe.DOCUMENT,e=>kc===e],[oe.XHR,e=>e==="xmlhttprequest"],[oe.FETCH,e=>e==="fetch"],[oe.BEACON,e=>e==="beacon"],[oe.CSS,(e,t)=>/\.css$/i.test(t)],[oe.JS,(e,t)=>/\.js$/i.test(t)],[oe.IMAGE,(e,t)=>["image","img","icon"].includes(e)||/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(t)!==null],[oe.FONT,(e,t)=>/\.(woff|eot|woff2|ttf)$/i.exec(t)!==null],[oe.MEDIA,(e,t)=>["audio","video"].includes(e)||/\.(mp3|mp4)$/i.exec(t)!==null]];function Mp(e){const t=e.name;if(!xd(t))return oe.OTHER;const n=Nd(t);for(const[r,i]of Op)if(i(e.initiatorType,n))return r;return oe.OTHER}function Ps(...e){for(let t=1;t<e.length;t+=1)if(e[t-1]>e[t])return!1;return!0}function Lc(e){return e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch"}function xp(e){const{duration:t,startTime:n,responseEnd:r}=e;return t===0&&n<r?G(n,r):t}function Np(e){if(!Mc(e))return;const{startTime:t,fetchStart:n,workerStart:r,redirectStart:i,redirectEnd:s,domainLookupStart:o,domainLookupEnd:a,connectStart:c,secureConnectionStart:l,connectEnd:h,requestStart:d,responseStart:u,responseEnd:f}=e,m={download:tt(t,u,f),first_byte:tt(t,d,u)};return 0<r&&r<n&&(m.worker=tt(t,r,n)),n<h&&(m.connect=tt(t,c,h),c<=l&&l<=h&&(m.ssl=tt(t,l,h))),n<a&&(m.dns=tt(t,o,a)),t<s&&(m.redirect=tt(t,i,s)),m}function Oc(e){return e.duration>=0}function Mc(e){const t=Ps(e.startTime,e.fetchStart,e.domainLookupStart,e.domainLookupEnd,e.connectStart,e.connectEnd,e.requestStart,e.responseStart,e.responseEnd),n=Pp(e)?Ps(e.startTime,e.redirectStart,e.redirectEnd,e.fetchStart):!0;return t&&n}function Pp(e){return e.redirectEnd>e.startTime}function tt(e,t,n){if(e<=t&&t<=n)return{duration:M(G(t,n)),start:M(G(e,t))}}function Dp(e){return e.nextHopProtocol===""?void 0:e.nextHopProtocol}function Fp(e){return e.deliveryType===""?"other":e.deliveryType}function Vp(e){if(e.startTime<e.responseStart){const{encodedBodySize:t,decodedBodySize:n,transferSize:r}=e;return{size:n,encoded_body_size:t,decoded_body_size:n,transfer_size:r}}return{size:void 0,encoded_body_size:void 0,decoded_body_size:void 0,transfer_size:void 0}}function is(e){return e&&(!Ch(e)||pt(Te.TRACK_INTAKE_REQUESTS))}const Up=/data:(.+)?(;base64)?,/g,Bp=24e3;
38function qp(e,t=Bp){if(e.length<=t||!e.startsWith("data:"))return e;const n=e.substring(0,100).match(Up);return n?`${n[0]}[...]`:e}let Ds=1;function Hp(e,t,n,r,i){const s=$m(t,n,r,i);zp(e,t,s),$p(e,s)}function zp(e,t,n){const r=om(t).subscribe(i=>{const s=i;if(is(s.url))switch(s.state){case"start":n.traceXhr(s,s.xhr),s.requestIndex=xc(),e.notify(7,{requestIndex:s.requestIndex,url:s.url});break;case"complete":n.clearTracingIfNeeded(s),e.notify(8,{duration:s.duration,method:s.method,requestIndex:s.requestIndex,spanId:s.spanId,startClocks:s.startClocks,status:s.status,traceId:s.traceId,traceSampled:s.traceSampled,type:Hr.XHR,url:s.url,xhr:s.xhr,isAborted:s.isAborted,handlingStack:s.handlingStack,body:s.body});break}});return{stop:()=>r.unsubscribe()}}function $p(e,t){const n=gc().subscribe(r=>{const i=r;if(is(i.url))switch(i.state){case"start":t.traceFetch(i),i.requestIndex=xc(),e.notify(7,{requestIndex:i.requestIndex,url:i.url});break;case"resolve":Wp(i,s=>{var o;t.clearTracingIfNeeded(i),e.notify(8,{duration:s,method:i.method,requestIndex:i.requestIndex,responseType:i.responseType,spanId:i.spanId,startClocks:i.startClocks,status:i.status,traceId:i.traceId,traceSampled:i.traceSampled,type:Hr.FETCH,url:i.url,response:i.response,init:i.init,input:i.input,isAborted:i.isAborted,handlingStack:i.handlingStack,body:(o=i.init)===null||o===void 0?void 0:o.body})});break}});return{stop:()=>n.unsubscribe()}}function xc(){const e=Ds;return Ds+=1,e}function Wp(e,t){const n=e.response&&vf(e.response);!n||!n.body?t(G(e.startClocks.timeStamp,J())):xm(n.body,()=>{t(G(e.startClocks.timeStamp,J()))},{bytesLimit:Number.POSITIVE_INFINITY})}function Nc(e){return Pn(e)&&e<0?void 0:e}function Pc({lifeCycle:e,isChildEvent:t,onChange:n=U}){const r={errorCount:0,longTaskCount:0,resourceCount:0,actionCount:0,frustrationCount:0},i=e.subscribe(13,s=>{var o;if(!(s.type==="view"||s.type==="vital"||!t(s)))switch(s.type){case x.ERROR:r.errorCount+=1,n();break;case x.ACTION:r.actionCount+=1,s.action.frustration&&(r.frustrationCount+=s.action.frustration.type.length),n();break;case x.LONG_TASK:r.longTaskCount+=1,n();break;case x.RESOURCE:!((o=s._dd)===null||o===void 0)&&o.discarded||(r.resourceCount+=1,n());break}});return{stop:()=>{i.unsubscribe()},eventCounts:r}}function Gp(e,t){const n=ae();let r=!1;const{stop:i}=Ye(e,window,["click","mousedown","keydown","touchstart","pointerdown"],a=>{if(!a.cancelable)return;const c={entryType:"first-input",processingStart:de(),processingEnd:de(),startTime:a.timeStamp,duration:0,name:"",cancelable:!1,target:null,toJSON:()=>({})};a.type==="pointerdown"?s(e,c):o(c)},{passive:!0,capture:!0});return{stop:i};function s(a,c){Ye(a,window,["pointerup","pointercancel"],l=>{l.type==="pointerup"&&o(c)},{once:!0})}function o(a){if(!r){r=!0,i();const c=a.processingStart-a.startTime;c>=0&&c<ae()-n&&t(a)}}}var F;(function(e){e.EVENT="event",e.FIRST_INPUT="first-input",e.LARGEST_CONTENTFUL_PAINT="largest-contentful-paint",e.LAYOUT_SHIFT="layout-shift",e.LONG_TASK="longtask",e.LONG_ANIMATION_FRAME="long-animation-frame",e.NAVIGATION="navigation",e.PAINT="paint",e.RESOURCE="resource",e.VISIBILITY_STATE="visibility-state"})(F||(F={}));function Ae(e,t){return new D(n=>{if(!window.PerformanceObserver)return;const r=c=>{const l=Yp(c);l.length>0&&n.notify(l)};let i,s=!0;const o=new PerformanceObserver(I(c=>{s?i=ee(()=>r(c.getEntries())):r(c.getEntries())}));try{o.observe(t)}catch{if([F.RESOURCE,F.NAVIGATION,F.LONG_TASK,F.PAINT].includes(t.type)){t.buffered&&(i=ee(()=>r(performance.getEntriesByType(t.type))));try{o.observe({entryTypes:[t.type]})}catch{return}}}s=!1,jp(e);let a;return!yt(F.FIRST_INPUT)&&t.type===F.FIRST_INPUT&&({stop:a}=Gp(e,c=>{r([c])})),()=>{o.disconnect(),a&&a(),pe(i)}})}let an;function jp(e){return!an&&Kp()&&"addEventListener"in performance&&(an=$(e,performance,"resourcetimingbufferfull",()=>{performance.clearResourceTimings()})),()=>{an==null||an.stop()}}function Kp(){return window.performance!==void 0&&"getEntries"in performance}function yt(e){return window.PerformanceObserver&&PerformanceObserver.supportedEntryTypes!==void 0&&PerformanceObserver.supportedEntryTypes.includes(e)}function Yp(e){return e.filter(t=>!Xp(t))}function Xp(e){return e.entryType===F.RESOURCE&&(!is(e.name)||!Oc(e))}
38function Ii(e){return e.nodeType===Node.TEXT_NODE}function Zp(e){return e.nodeType===Node.COMMENT_NODE}function Pe(e){return e.nodeType===Node.ELEMENT_NODE}function Dc(e){return Pe(e)&&!!e.shadowRoot}function Jp(e){const t=e;return!!t.host&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&Pe(t.host)}function RE(e){return e.childNodes.length>0||Dc(e)}function CE(e,t){let n=e.firstChild;for(;n;)t(n),n=n.nextSibling;Dc(e)&&t(e.shadowRoot)}function Qp(e){return Jp(e)?e.host:e.parentNode}const Fc=100,eg=100,Fs="data-dd-excluded-activity-mutations";function ss(e,t,n,r,i,s){const o=ng(e,t,n,r);return tg(o,i,s)}function tg(e,t,n){let r,i=!1;const s=ee(I(()=>l({hadActivity:!1})),Fc),o=n!==void 0?ee(I(()=>l({hadActivity:!0,end:J()})),n):void 0,a=e.subscribe(({isBusy:h})=>{pe(s),pe(r);const d=J();h||(r=ee(I(()=>l({hadActivity:!0,end:d})),eg))}),c=()=>{i=!0,pe(s),pe(r),pe(o),a.unsubscribe()};function l(h){i||(c(),t(h))}return{stop:c}}function ng(e,t,n,r){return new D(i=>{const s=[];let o,a=0;return s.push(t.subscribe(l=>{l.every(rg)||c()}),n.subscribe(c),Ae(r,{type:F.RESOURCE}).subscribe(l=>{l.some(h=>!di(r,h.name))&&c()}),e.subscribe(7,l=>{di(r,l.url)||(o===void 0&&(o=l.requestIndex),a+=1,c())}),e.subscribe(8,l=>{di(r,l.url)||o===void 0||l.requestIndex<o||(a-=1,c())})),()=>{s.forEach(l=>l.unsubscribe())};function c(){i.notify({isBusy:a>0})}})}function di(e,t){return Ur(e.excludedActivityUrls,t)}function rg(e){const t=e.type==="characterData"?e.target.parentElement:e.target;return!!(t&&Pe(t)&&t.matches(`[${Fs}], [${Fs}] *`))}const zr="data-dd-action-name",ig="Masked Element",sg=[zr,"data-testid","data-test","data-qa","data-cy","data-test-id","data-qa-id","data-testing","data-component","data-element","data-source-file"],og=[Uc,cg],ag=[Uc,lg,ug];function Hn(e,t){if(!e.isConnected)return;let n,r=e;for(;r&&r.nodeName!=="HTML";){const i=Vs(r,og,hg,t,n);if(i)return i;
38n=Vs(r,ag,fg,t,n)||$r(dg(r),n),r=r.parentElement}return n}function Vc(e){return/[0-9]/.test(e)}function cg(e){if(e.id&&!Vc(e.id))return`#${CSS.escape(e.id)}`}function lg(e){if(e.tagName==="BODY")return;const t=e.classList;for(let n=0;n<t.length;n+=1){const r=t[n];if(!Vc(r))return`${CSS.escape(e.tagName)}.${CSS.escape(r)}`}}function ug(e){return CSS.escape(e.tagName)}function Uc(e,t){if(t){const r=n(t);if(r)return r}for(const r of sg){const i=n(r);if(i)return i}function n(r){if(e.hasAttribute(r))return`${CSS.escape(e.tagName)}[${r}="${CSS.escape(e.getAttribute(r))}"]`}}function dg(e){let t=e.parentElement.firstElementChild,n=1;for(;t&&t!==e;)t.tagName===e.tagName&&(n+=1),t=t.nextElementSibling;return`${CSS.escape(e.tagName)}:nth-of-type(${n})`}function Vs(e,t,n,r,i){for(const s of t){const o=s(e,r);if(o&&n(e,o,i))return $r(o,i)}}function hg(e,t,n){return e.ownerDocument.querySelectorAll($r(t,n)).length===1}function fg(e,t,n){let r;if(n===void 0)r=o=>o.matches(t);else{const o=$r(`${t}:scope`,n);r=a=>a.querySelector(o)!==null}let s=e.parentElement.firstElementChild;for(;s;){if(s!==e&&r(s))return!1;s=s.nextElementSibling}return!0}function $r(e,t){return t?`${e}>${t}`:e}const N={IGNORE:"ignore",HIDDEN:"hidden",ALLOW:Lt.ALLOW,MASK:Lt.MASK,MASK_USER_INPUT:Lt.MASK_USER_INPUT,MASK_UNLESS_ALLOWLISTED:Lt.MASK_UNLESS_ALLOWLISTED},mg="data-dd-privacy",IE="hidden",pg="dd-privacy-",hi="***",kE="data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",gg={INPUT:!0,OUTPUT:!0,TEXTAREA:!0,SELECT:!0,OPTION:!0,DATALIST:!0,OPTGROUP:!0},bg="x";function st(e){return`[${mg}="${e}"], .${pg}${e}`}function os(e,t,n){if(n&&n.has(e))return n.get(e);const r=Qp(e),i=r?os(r,t,n):t,s=yg(e),o=vg(s,i);return n&&n.set(e,o),o}function vg(e,t){switch(t){case N.HIDDEN:case N.IGNORE:return t}switch(e){case N.ALLOW:case N.MASK:case N.MASK_USER_INPUT:case N.MASK_UNLESS_ALLOWLISTED:case N.HIDDEN:case N.IGNORE:return e;default:return t}}function yg(e){if(Pe(e)){if(e.tagName==="BASE")return N.ALLOW;if(e.tagName==="INPUT"){const t=e;if(t.type==="password"||t.type==="email"||t.type==="tel"||t.type==="hidden")return N.MASK;const n=t.getAttribute("autocomplete");if(n&&(n.startsWith("cc-")||n.endsWith("-password")))return N.MASK}if(e.matches(st(N.HIDDEN)))return N.HIDDEN;if(e.matches(st(N.MASK)))return N.MASK;if(e.matches(st(N.MASK_UNLESS_ALLOWLISTED)))return N.MASK_UNLESS_ALLOWLISTED;if(e.matches(st(N.MASK_USER_INPUT)))return N.MASK_USER_INPUT;if(e.matches(st(N.ALLOW)))return N.ALLOW;if(Eg(e))return N.IGNORE}}function Bc(e,t){switch(t){case N.MASK:case N.HIDDEN:case N.IGNORE:return!0;case N.MASK_UNLESS_ALLOWLISTED:return Ii(e)?Zn(e.parentNode)?!0:!Hc(e.textContent||""):Zn(e);case N.MASK_USER_INPUT:return Ii(e)?Zn(e.parentNode):Zn(e);default:return!1}}function Zn(e){if(!e||e.nodeType!==e.ELEMENT_NODE)return!1;const t=e;if(t.tagName==="INPUT")switch(t.type){case"button":case"color":case"reset":case"submit":return!1}return!!gg[t.tagName]}const qc=e=>e.replace(/\S/g,bg);function LE(e,t){var n;const r=(n=e.parentElement)===null||n===void 0?void 0:n.tagName;let i=e.textContent||"";if(r==="HEAD"&&!i.trim())return;const o=t;if(r==="SCRIPT")i=hi;else if(o===N.HIDDEN)i=hi;else if(Bc(e,o))if(r==="DATALIST"||r==="SELECT"||r==="OPTGROUP"){if(!i.trim())return}else r==="OPTION"?i=hi:o===N.MASK_UNLESS_ALLOWLISTED?i=Sg(i):i=qc(i);return i}function Eg(e){if(e.nodeName==="SCRIPT")return!0;if(e.nodeName==="LINK"){const n=t("rel");return/preload|prefetch/i.test(n)&&t("as")==="script"||n==="shortcut icon"||n==="icon"}if(e.nodeName==="META"){const n=t("name"),r=t("rel"),i=t("property");return/^msapplication-tile(image|color)$/.test(n)||n==="application-name"||r==="icon"||r==="apple-touch-icon"||r==="shortcut icon"||n==="keywords"||n==="description"||/^(og|twitter|fb):/.test(i)||/^(og|twitter):/.test(n)||n==="pinterest"||n==="robots"||n==="googlebot"||n==="bingbot"||e.hasAttribute("http-equiv")||n==="author"||n==="generator"||n==="framework"||n==="publisher"||n==="progid"||/^article:/.test(i)||/^product:/.test(i)||n==="google-site-verification"||n==="yandex-verification"||n==="csrf-token"||n==="p:domain_verify"||n==="verify-v1"||n==="verification"||n==="shopify-checkout-api-token"}function t(n){return(e.getAttribute(n)||"").toLowerCase()}return!1}function Hc(e){var t;return!e||!e.trim()?!0:((t=window.$DD_ALLOW)===null||t===void 0?void 0:t.has(e.toLocaleLowerCase()))||!1}function Sg(e,t){return Hc(e)?e:t||qc(e)}const zc=ne,_g=100;function wg(e,t){const n=[];let r=0,i;s(e);function s(c){c.stopObservable.subscribe(o),n.push(c),pe(i),i=ee(a,zc)}function o(){r===1&&n.every(c=>c.isStopped())&&(r=2,t(n))}function a(){pe(i),r===0&&(r=1,o())}return{tryAppend:c=>r!==0?!1:n.length>0&&!Tg(n[n.length-1].event,c.event)?(a(),!1):(s(c),!0),stop:()=>{a()}}}function Tg(e,t){return e.target===t.target&&Ag(e,t)<=_g&&e.timeStamp-t.timeStamp<=zc}function Ag(e,t){return Math.sqrt(Math.pow(e.clientX-t.clientX,2)+Math.pow(e.clientY-t.clientY,2))}function Rg(e,t,n=N.ALLOW){const{actionNameAttribute:r}=t,i=Us(e,zr)||r&&Us(e,r);return i?{name:i,nameSource:"custom_attribute"}
38:n===N.MASK?{name:ig,nameSource:"mask_placeholder"}:Bs(e,Cg,t)||Bs(e,Ig,t)||{name:"",nameSource:"blank"}}function Us(e,t){const n=e.closest(`[${t}]`);if(!n)return;const r=n.getAttribute(t);return Wc($c(r.trim()))}const Cg=[(e,t)=>{if("labels"in e&&e.labels&&e.labels.length>0)return or(e.labels[0],t)},e=>{if(e.nodeName==="INPUT"){const t=e,n=t.getAttribute("type");if(n==="button"||n==="submit"||n==="reset")return{name:t.value,nameSource:"text_content"}}},(e,t)=>{if(e.nodeName==="BUTTON"||e.nodeName==="LABEL"||e.getAttribute("role")==="button")return or(e,t)},e=>cn(e,"aria-label"),(e,t)=>{const n=e.getAttribute("aria-labelledby");if(n)return{name:n.split(/\s+/).map(r=>Lg(e,r)).filter(r=>!!r).map(r=>Gc(r,t)).join(" "),nameSource:"text_content"}},e=>cn(e,"alt"),e=>cn(e,"name"),e=>cn(e,"title"),e=>cn(e,"placeholder"),(e,t)=>{if("options"in e&&e.options.length>0)return or(e.options[0],t)}],Ig=[(e,t)=>or(e,t)],kg=10;function Bs(e,t,n){let r=e,i=0;for(;i<=kg&&r&&r.nodeName!=="BODY"&&r.nodeName!=="HTML"&&r.nodeName!=="HEAD";){for(const s of t){const o=s(r,n);if(o){const{name:a,nameSource:c}=o,l=a&&a.trim();if(l)return{name:Wc($c(l)),nameSource:c}}}if(r.nodeName==="FORM")break;r=r.parentElement,i+=1}}function $c(e){return e.replace(/\s+/g," ")}function Wc(e){return e.length>100?`${Gi(e,100)} [...]`:e}function Lg(e,t){return e.ownerDocument?e.ownerDocument.getElementById(t):null}function cn(e,t){return{name:e.getAttribute(t)||"",nameSource:"standard_attribute"}}function or(e,t){return{name:Gc(e,t)||"",nameSource:"text_content"}}function Gc(e,t){if(e.isContentEditable)return;const{enablePrivacyForActionName:n,actionNameAttribute:r,defaultPrivacyLevel:i}=t;if(pt(Te.USE_TREE_WALKER_FOR_ACTION_NAME))return Og(e,r,n,i);if("innerText"in e){let s=e.innerText;const o=a=>{const c=e.querySelectorAll(a);for(let l=0;l<c.length;l+=1){const h=c[l];if("innerText"in h){const d=h.innerText;d&&d.trim().length>0&&(s=s.replace(d,""))}}};return o(`[${zr}]`),r&&o(`[${r}
38]`),n&&o(`${st(N.HIDDEN)}, ${st(N.MASK)}`),s}return e.textContent}function Og(e,t,n,r){const i=new Map,s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,a);let o="";for(;s.nextNode();){const c=s.currentNode;if(Pe(c)){(c.nodeName==="BR"||c.nodeName==="P"||["block","flex","grid","list-item","table","table-caption"].includes(getComputedStyle(c).display))&&(o+=" ");continue}o+=c.textContent||""}return o.replace(/\s+/g," ").trim();function a(c){const l=os(c,r,i);if(n&&l&&Bc(c,l))return NodeFilter.FILTER_REJECT;if(Pe(c)){if(c.hasAttribute(zr)||t&&c.hasAttribute(t))return NodeFilter.FILTER_REJECT;const h=getComputedStyle(c);if(h.visibility!=="visible"||h.display==="none"||h.contentVisibility&&h.contentVisibility!=="visible")return NodeFilter.FILTER_REJECT}return NodeFilter.FILTER_ACCEPT}}function Mg(e,{onPointerDown:t,onPointerUp:n}){let r,i={selection:!1,input:!1,scroll:!1},s;const o=[$(e,window,"pointerdown",a=>{Hs(a)&&(r=qs(),i={selection:!1,input:!1,scroll:!1},s=t(a))},{capture:!0}),$(e,window,"selectionchange",()=>{(!r||!qs())&&(i.selection=!0)},{capture:!0}),$(e,window,"scroll",()=>{i.scroll=!0},{capture:!0,passive:!0}),$(e,window,"pointerup",a=>{if(Hs(a)&&s){const c=i;n(s,a,()=>c),s=void 0}},{capture:!0}),$(e,window,"input",()=>{i.input=!0},{capture:!0})];return{stop:()=>{o.forEach(a=>a.stop())}}}function qs(){const e=window.getSelection();return!e||e.isCollapsed}function Hs(e){return e.target instanceof Element&&e.isPrimary!==!1}const zs=3;function xg(e,t){if(Ng(e))return t.addFrustration(on.RAGE_CLICK),e.some($s)&&t.addFrustration(on.DEAD_CLICK),t.hasError&&t.addFrustration(on.ERROR_CLICK),{isRage:!0};const n=e.some(r=>r.getUserActivity().selection);return e.forEach(r=>{r.hasError&&r.addFrustration(on.ERROR_CLICK),$s(r)&&!n&&r.addFrustration(on.DEAD_CLICK)}),{isRage:!1}}function Ng(e){if(e.some(t=>t.getUserActivity().selection||t.getUserActivity().scroll))return!1;for(let t=0;t<e.length-(zs-1);t+=1)if(e[t+zs-1].event.timeStamp-e[t].event.timeStamp<=ne)return!0;return!1}const Pg='input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="range"]),textarea,select,[contenteditable],[contenteditable] *,canvas,a[href],a[href] *';function $s(e){if(e.hasPageActivity||e.getUserActivity().input||e.getUserActivity().scroll)return!1;let t=e.event.target;return t.tagName==="LABEL"&&t.hasAttribute("for")&&(t=document.getElementById(t.getAttribute("for"))),!t||!t.matches(Pg)}const jc=10*ne,pn=new Map;function Dg(e){const t=pn.get(e);return pn.delete(e),t}function Kc(e,t){pn.set(e,t),pn.forEach((n,r)=>{G(r,de())>jc&&pn.delete(r)})}const Fg=5*ce;function Vg(e,t,n,r){const i=nn({expireDelay:Fg}),s=new D;let o;e.subscribe(10,()=>{i.reset()}),e.subscribe(5,h),e.subscribe(11,d=>{d.reason===Pt.UNLOADING&&h()});const{stop:a}=Mg(r,{onPointerDown:d=>Ug(r,e,t,d,n),onPointerUp:({clickActionBase:d,hadActivityOnPointerDown:u},f,m)=>{Bg(r,e,t,n,i,s,l,d,f,m,u)}});return{stop:()=>{h(),s.notify(),a()},actionContexts:{findActionId:d=>i.findAll(d)}};function l(d){if(!o||!o.tryAppend(d)){const u=d.clone();o=wg(d,f=>{Hg(f,u)})}}function h(){o&&o.stop()}}function Ug(e,t,n,r,i){let s;if(e.enablePrivacyForActionName?s=os(r.target,e.defaultPrivacyLevel):s=N.ALLOW,s===N.HIDDEN)return;const o=qg(r,s,e);let a=!1;return ss(t,n,i,e,c=>{a=c.hadActivity},Fc),{clickActionBase:o,hadActivityOnPointerDown:()=>a}}function Bg(e,t,n,r,i,s,o,a,c,l,h){var d;const u=Yc(t,i,l,a,c);o(u);const f=(d=a==null?void 0:a.target)===null||d===void 0?void 0:d.selector;f&&Kc(c.timeStamp,f);const{stop:m}=ss(t,n,r,e,T=>{T.hadActivity&&T.end<u.startClocks.timeStamp?u.discard():T.hadActivity?u.stop(T.end):h()?u.stop(u.startClocks.timeStamp):u.stop()},jc),v=t.subscribe(5,({endClocks:T})=>{u.stop(T.timeStamp)}),S=s.subscribe(()=>{u.stop()});u.stopObservable.subscribe(()=>{v.unsubscribe(),m(),S.unsubscribe()})}function qg(e,t,n){const r=e.target.getBoundingClientRect(),i=Hn(e.target,n.actionNameAttribute);i&&Kc(e.timeStamp,i);const{name:s,nameSource:o}=Rg(e.target,n,t);return{type:rs.CLICK,target:{width:Math.round(r.width),height:Math.round(r.height),selector:i},position:{x:Math.round(e.clientX-r.left),y:Math.round(e.clientY-r.top)},name:s,nameSource:o}}function Yc(e,t,n,r,i){const s=te(),o=Q(),a=t.add(s,o.relative),c=Pc({lifeCycle:e,isChildEvent:m=>m.action!==void 0&&(Array.isArray(m.action.id)?m.action.id.includes(s):m.action.id===s)});let l=0,h;const d=[],u=new D;function f(m){l===0&&(h=m,l=1,h?a.close(Wi(h)):a.remove(),c.stop(),u.notify())}return{event:i,stop:f,stopObservable:u,get hasError(){return c.eventCounts.errorCount>0},get hasPageActivity(){return h!==void 0},getUserActivity:n,addFrustration:m=>{d.push(m)},startClocks:o,isStopped:()=>l===1||l===2,clone:()=>
38Yc(e,t,n,r,i),validate:m=>{if(f(),l!==1)return;const{resourceCount:v,errorCount:S,longTaskCount:T}=c.eventCounts,E={duration:h&&G(o.timeStamp,h),startClocks:o,id:s,frustrationTypes:d,counts:{resourceCount:v,errorCount:S,longTaskCount:T},events:m??[i],event:i,...r};e.notify(0,E),l=2},discard:()=>{f(),l=2}}}function Hg(e,t){const{isRage:n}=xg(e,t);n?(e.forEach(r=>r.discard()),t.stop(J()),t.validate(e.map(r=>r.event))):(t.discard(),e.forEach(r=>r.validate()))}function zg(e,t,n,r,i){const{unsubscribe:s}=e.subscribe(0,c=>{e.notify(12,Ws(c))});t.register(0,({startTime:c,eventType:l})=>{if(l!==x.ERROR&&l!==x.RESOURCE&&l!==x.LONG_TASK)return he;const h=o.findActionId(c);return h?{type:l,action:{id:h}}:he}),t.register(1,({startTime:c})=>({action:{id:o.findActionId(c)}}));let o={findActionId:U},a=U;return i.trackUserInteractions&&({actionContexts:o,stop:a}=Vg(e,n,r,i)),{addAction:c=>{e.notify(12,Ws(c))},actionContexts:o,stop:()=>{s(),a()}}}function Ws(e){const t=fi(e)?{action:{id:e.id,loading_time:Nc(M(e.duration)),frustration:{type:e.frustrationTypes},error:{count:e.counts.errorCount},long_task:{count:e.counts.longTaskCount},resource:{count:e.counts.resourceCount}},_dd:{action:{target:e.target,position:e.position,name_source:e.nameSource}}}:{context:e.context},n=Ne({action:{id:te(),target:{name:e.name},type:e.type},date:e.startClocks.timeStamp,type:x.ACTION},t),r=fi(e)?e.duration:void 0,i=fi(e)?{events:e.events}:{handlingStack:e.handlingStack};return{rawRumEvent:n,duration:r,startTime:e.startClocks.relative,domainContext:i}}function fi(e){return e.type!==rs.CUSTOM}function $g(e){const t=Em([Lr.error]).subscribe(n=>e.notify(n.error));return{stop:()=>{t.unsubscribe()}}}function Wg(e,t){const n=af(e,[En.cspViolation,En.intervention]).subscribe(r=>t.notify(r));return{stop:()=>{n.unsubscribe()}}}function Gg(e,t,n){const r=new D;return n.subscribe(i=>{i.type===0&&r.notify(i.error)}),$g(r),Wg(t,r),r.subscribe(i=>e.notify(14,{error:i})),jg(e)}function jg(e){return e.subscribe(14,({error:t})=>{e.notify(12,Kg(t))}),{addError:({error:t,handlingStack:n,componentStack:r,startClocks:i,context:s})=>{const o=Zi({originalError:t,handlingStack:n,componentStack:r,startClocks:i,nonErrorPrefix:"Provided",source:en.CUSTOM,handling:"handled"});o.context=Ne(o.context,s),e.notify(14,{error:o})}}}function Kg(e){const t={date:e.startClocks.timeStamp,error:{id:te(),message:e.message,source:e.source,stack:e.stack,handling_stack:e.handlingStack,component_stack:e.componentStack,type:e.type,handling:e.handling,causes:e.causes,source_type:"browser",fingerprint:e.fingerprint,csp:e.csp},type:x.ERROR,context:e.context},n={error:e.originalError,handlingStack:e.handlingStack};return{rawRumEvent:t,startTime:e.startClocks.relative,domainContext:n}}const Gs=new WeakSet;function Yg(e){if(!performance||!("getEntriesByName"in performance))return;const t=performance.getEntriesByName(e.url,"resource");if(!t.length||!("toJSON"in t[0]))return;const n=t.filter(r=>!Gs.has(r)).filter(r=>Oc(r)&&Mc(r)).filter(r=>Xg(r,e.startClocks.relative,Xc({startTime:e.startClocks.relative,duration:e.duration})));if(n.length===1)return Gs.add(n[0]),n[0].toJSON()}function Xc(e){return Jt(e.startTime,e.duration)}function Xg(e,t,n){return e.startTime>=t-1&&Xc(e)<=Jt(n,1)}const Zg=2*ce;function Jg(e){const t=Qg(e)||eb(e);if(!(!t||t.traceTime<=ae()-Zg))return t.traceId}function Qg(e){const t=e.querySelector("meta[name=dd-trace-id]"),n=e.querySelector("meta[name=dd-trace-time]");return Zc(t&&t.content,n&&n.content)}function eb(e){const t=tb(e);if(t)return Zc(vn(t,"trace-id"),vn(t,"trace-time"))}function Zc(e,t){const n=t&&Number(t);if(!(!e||!n))return{traceId:e,traceTime:n}}function tb(e){for(let t=0;t<e.childNodes.length;t+=1){const n=js(e.childNodes[t]);if(n)return n}if(e.body)for(let t=e.body.childNodes.length-1;t>=0;t-=1){const n=e.body.childNodes[t],r=js(n);if(r)return r;if(!Ii(n))break}}function js(e){if(e&&Zp(e)){const t=/^\s*DATADOG;(.*?)\s*$/.exec(e.data);if(t)return t[1]}}function Jc(){if(yt(F.NAVIGATION)){const n=performance.getEntriesByType(F.NAVIGATION)[0];if(n)return n}const e=nb(),t={entryType:F.NAVIGATION,initiatorType:"navigation",name:window.location.href,startTime:0,duration:e.loadEventEnd,decodedBodySize:0,encodedBodySize:0,transferSize:0,workerStart:0,toJSON:()=>({...t,toJSON:void 0}),...e};return t}function nb(){const e={},t=performance.timing;for(const n in t)if(Pn(t[n])){const r=n,i=t[r];e[r]=i===0?0:Wi(i)}return e}function rb(e,t,n=Jc){es(e,"interactive",()=>{const r=n(),i=Object.assign(r.toJSON(),{entryType:F.RESOURCE,initiatorType:kc,duration:r.responseEnd,traceId:Jg(document),toJSON:()=>({...i,toJSON:void 0})});t(i)})}const ib=1e3;
38function sb(e){const t=new Set,n=e.subscribe(8,r=>{t.add(r),t.size>ib&&(qn("Too many requests"),t.delete(t.values().next().value))});return{getMatchingRequest(r){let i=1/0,s;for(const o of t){const a=r.startTime-o.startClocks.relative;0<=a&&a<i&&o.url===r.name&&(i=Math.abs(a),s=o)}return s&&t.delete(s),s},stop(){n.unsubscribe()}}}const ob=32*Ht;function ab(e,t){return t.allowedGraphQlUrls.find(n=>Ur([n.match],e))}function cb(e,t=!1){if(!e||typeof e!="string")return;let n;try{n=JSON.parse(e)}catch{return}if(!n||!n.query)return;const r=n.query.trim(),i=lb(r),s=n.operationName;if(!i)return;let o;return n.variables&&(o=JSON.stringify(n.variables)),{operationType:i,operationName:s,variables:o,payload:t?Gi(r,ob,"..."):void 0}}function lb(e){var t;return(t=e.match(/^\s*(query|mutation|subscription)\b/i))===null||t===void 0?void 0:t[1]}function ub(e,t,n,r=ym(),i=rb){let s;const o=t.trackEarlyRequests;o?s=sb(e):e.subscribe(8,l=>{c(()=>db(l,t,n))});const a=Ae(t,{type:F.RESOURCE,buffered:!0}).subscribe(l=>{for(const h of l)(o||!Lc(h))&&c(()=>Ks(h,t,n,s))});i(t,l=>{c(()=>Ks(l,t,n,s))});function c(l){r.push(()=>{const h=l();h&&e.notify(12,h)})}return{stop:()=>{r.stop(),a.unsubscribe()}}}function db(e,t,n){const r=Yg(e);return Qc(r,e,n,t)}function Ks(e,t,n,r){const i=Lc(e)&&r?r.getMatchingRequest(e):void 0;return Qc(e,i,n,t)}function Qc(e,t,n,r){if(!e&&!t)return;const i=t?pb(t,r):gb(e,r);if(!r.trackResources&&!i)return;const s=e?Mr(e.startTime):t.startClocks,o=e?xp(e):bb(n,s,t.duration),a=t&&hb(t,r),c=Ne({date:s.timeStamp,resource:{id:te(),duration:M(o),type:t?t.type===Hr.XHR?oe.XHR:oe.FETCH:Mp(e),method:t?t.method:void 0,status_code:t?t.status:vb(e.responseStatus),url:t?qp(t.url):e.name,protocol:e&&Dp(e),delivery_type:e&&Fp(e),graphql:a},type:x.RESOURCE,_dd:{discarded:!r.trackResources}},i,e&&mb(e));return{startTime:s.relative,duration:o,rawRumEvent:c,domainContext:fb(e,t)}}function hb(e,t){const n=ab(e.url,t);if(n)return cb(e.body,n.trackPayload)}function fb(e,t){if(t){const n={performanceEntry:e,isAborted:t.isAborted,handlingStack:t.handlingStack};return t.type===Hr.XHR?{xhr:t.xhr,...n}:{requestInput:t.input,requestInit:t.init,response:t.response,error:t.error,...n}}return{performanceEntry:e}}function mb(e){const{renderBlockingStatus:t}=e;return{resource:{render_blocking_status:t,...Vp(e),...Np(e)}}}function pb(e,t){if(e.traceSampled&&e.traceId&&e.spanId)return{_dd:{span_id:e.spanId.toString(),trace_id:e.traceId.toString(),rule_psr:t.rulePsr}}}function gb(e,t){if(e.traceId)return{_dd:{trace_id:e.traceId,span_id:Ac().toString(),rule_psr:t.rulePsr}}}function bb(e,t,n){return e.wasInPageStateDuringPeriod("frozen",t.relative,n)?void 0:n}function vb(e){return e===0?void 0:e}function yb(e,t,n){const{stop:r,eventCounts:i}=Pc({lifeCycle:e,isChildEvent:s=>s.view.id===t,onChange:n});return{stop:r,eventCounts:i}}const Eb=10*ce;function Sb(e,t,n){return{stop:Ae(e,{type:F.PAINT,buffered:!0}).subscribe(i=>{const s=i.find(o=>o.name==="first-contentful-paint"&&o.startTime<t.timeStamp&&o.startTime<Eb);s&&n(s.startTime)}).unsubscribe}}function _b(e,t){requestAnimationFrame(()=>{requestAnimationFrame(()=>{t(G(e,de()))})})}function wb(e,t,n){const r=Ae(e,{type:F.FIRST_INPUT,buffered:!0}).subscribe(i=>{const s=i.find(o=>o.startTime<t.timeStamp);if(s){const o=G(s.startTime,s.processingStart);let a;s.target&&Pe(s.target)&&(a=Hn(s.target,e.actionNameAttribute)),n({delay:o>=0?o:0,time:s.startTime,targetSelector:a})}});return{stop:()=>{r.unsubscribe()}}}function Tb(e,t,n=Jc){return Cb(e,()=>{const r=n();Rb(r)||t(Ab(r))})}function Ab(e){return{domComplete:e.domComplete,domContentLoaded:e.domContentLoadedEventEnd,domInteractive:e.domInteractive,loadEvent:e.loadEventEnd,firstByte:e.responseStart>=0&&e.responseStart<=de()?e.responseStart:void 0}}function Rb(e){return e.loadEventEnd<=0}function Cb(e,t){let n;const{stop:r}=es(e,"complete",()=>{n=ee(()=>t())});return{stop:()=>{r(),pe(n)}}}const Ib=10*ce;function kb(e,t,n,r){let i=1/0;const{stop:s}=Ye(e,n,["pointerdown","keydown"],c=>{i=c.timeStamp},{capture:!0,once:!0});let o=0;const a=Ae(e,{type:F.LARGEST_CONTENTFUL_PAINT,buffered:!0}).subscribe(c=>{const l=Ia(c,h=>h.entryType===F.LARGEST_CONTENTFUL_PAINT&&h.startTime<i&&h.startTime<t.timeStamp&&h.startTime<Ib&&h.size>o);if(l){let h;l.element&&(h=Hn(l.element,e.actionNameAttribute)),r({value:l.startTime,targetSelector:h,resourceUrl:Lb(l)}),o=l.size}});return{stop:()=>{s(),a.unsubscribe()}}}
38function Lb(e){return e.url===""?void 0:e.url}function el(e,t,n=window){if(document.visibilityState==="hidden")return{timeStamp:0,stop:U};if(yt(F.VISIBILITY_STATE)){const s=performance.getEntriesByType(F.VISIBILITY_STATE).filter(o=>o.name==="hidden").find(o=>o.startTime>=t.relative);if(s)return{timeStamp:s.startTime,stop:U}}let r=1/0;const{stop:i}=Ye(e,n,["pagehide","visibilitychange"],s=>{(s.type==="pagehide"||document.visibilityState==="hidden")&&(r=s.timeStamp,i())},{capture:!0});return{get timeStamp(){return r},stop:i}}function Ob(e,t,n,r){const i={},{stop:s}=Tb(e,d=>{n(d.loadEvent),i.navigationTimings=d,r()}),o=el(e,t),{stop:a}=Sb(e,o,d=>{i.firstContentfulPaint=d,r()}),{stop:c}=kb(e,o,window,d=>{i.largestContentfulPaint=d,r()}),{stop:l}=wb(e,o,d=>{i.firstInput=d,r()});function h(){s(),a(),c(),l(),o.stop()}return{stop:h,initialViewMetrics:i}}const ki=(e,t)=>e*t,Mb=(e,t)=>{const n=Math.max(e.left,t.left),r=Math.max(e.top,t.top),i=Math.min(e.right,t.right),s=Math.min(e.bottom,t.bottom);return n>=i||r>=s?0:ki(i-n,s-r)},Ys=e=>{const t=ki(e.previousRect.width,e.previousRect.height),n=ki(e.currentRect.width,e.currentRect.height),r=Mb(e.previousRect,e.currentRect);return t+n-r};function xb(e,t,n){if(!Vb())return{stop:U};let r=0,i;n({value:0});const s=Fb(),o=Ae(e,{type:F.LAYOUT_SHIFT,buffered:!0}).subscribe(a=>{var c;for(const l of a){if(l.hadRecentInput||l.startTime<t)continue;const{cumulatedValue:h,isMaxValue:d}=s.update(l);if(d){const u=Nb(l.sources);i={target:u!=null&&u.node?new WeakRef(u.node):void 0,time:G(t,l.startTime),previousRect:u==null?void 0:u.previousRect,currentRect:u==null?void 0:u.currentRect,devicePixelRatio:window.devicePixelRatio}}if(h>r){r=h;const u=(c=i==null?void 0:i.target)===null||c===void 0?void 0:c.deref();n({value:hn(r,4),targetSelector:u&&Hn(u,e.actionNameAttribute),time:i==null?void 0:i.time,previousRect:i!=null&&i.previousRect?Xs(i.previousRect):void 0,currentRect:i!=null&&i.currentRect?Xs(i.currentRect):void 0,devicePixelRatio:i==null?void 0:i.devicePixelRatio})}}});return{stop:()=>{o.unsubscribe()}}}function Nb(e){let t;for(const n of e)if(n.node&&Pe(n.node)){const r=Ys(n);(!t||Ys(t)<r)&&(t=n)}return t}function Xs({x:e,y:t,width:n,height:r}){return{x:e,y:t,width:n,height:r}}const Pb=5*ne,Db=ne;function Fb(){let e=0,t,n,r=0;return{update:i=>{const s=t===void 0||i.startTime-n>=Db||i.startTime-t>=Pb;let o;return s?(t=n=i.startTime,r=e=i.value,o=!0):(e+=i.value,n=i.startTime,o=i.value>r,o&&(r=i.value)),{cumulatedValue:e,isMaxValue:o}}}}function Vb(){return yt(F.LAYOUT_SHIFT)&&"WeakRef"in window}let ar,tl=0,mi=1/0,pi=0;function Ub(){"interactionCount"in performance||ar||(ar=new window.PerformanceObserver(I(e=>{e.getEntries().forEach(t=>{const n=t;n.interactionId&&(mi=Math.min(mi,n.interactionId),pi=Math.max(pi,n.interactionId),tl=(pi-mi)/7+1)})})),ar.observe({type:"event",buffered:!0,durationThreshold:0}))}const Zs=()=>ar?tl:window.performance.interactionCount||0,Js=10,Bb=1*ce;function qb(e,t,n){if(!$b())return{getInteractionToNextPaint:()=>{},setViewEnd:U,stop:U};const{getViewInteractionCount:r,stopViewInteractionCount:i}=zb(n);let s=1/0;const o=Hb(r);let a=-1,c,l;function h(f){for(const v of f)v.interactionId&&v.startTime>=t&&v.startTime<=s&&o.process(v);const m=o.estimateP98Interaction();m&&m.duration!==a&&(a=m.duration,l=G(t,m.startTime),c=Dg(m.startTime),!c&&m.target&&Pe(m.target)&&(c=Hn(m.target,e.actionNameAttribute)))}const d=Ae(e,{type:F.FIRST_INPUT,buffered:!0}).subscribe(h),u=Ae(e,{type:F.EVENT,durationThreshold:40,buffered:!0}).subscribe(h);return{getInteractionToNextPaint:()=>{if(a>=0)return{value:Math.min(a,Bb),targetSelector:c,time:l};if(r())return{value:0}}
38,setViewEnd:f=>{s=f,i()},stop:()=>{u.unsubscribe(),d.unsubscribe()}}}function Hb(e){const t=[];function n(){t.sort((r,i)=>i.duration-r.duration).splice(Js)}return{process(r){const i=t.findIndex(o=>r.interactionId===o.interactionId),s=t[t.length-1];i!==-1?r.duration>t[i].duration&&(t[i]=r,n()):(t.length<Js||r.duration>s.duration)&&(t.push(r),n())},estimateP98Interaction(){const r=Math.min(t.length-1,Math.floor(e()/50));return t[r]}}}function zb(e){Ub();const t=e===Me.INITIAL_LOAD?0:Zs();let n={stopped:!1};function r(){return Zs()-t}return{getViewInteractionCount:()=>n.stopped?n.interactionCount:r(),stopViewInteractionCount:()=>{n={stopped:!0,interactionCount:r()}}}}function $b(){return yt(F.EVENT)&&window.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype}function Wb(e,t,n,r,i,s,o){let a=i===Me.INITIAL_LOAD,c=!0;const l=[],h=el(r,s);function d(){if(!c&&!a&&l.length>0){const f=Math.max(...l);f<h.timeStamp-s.relative&&o(f)}}const{stop:u}=ss(e,t,n,r,f=>{c&&(c=!1,f.hadActivity&&l.push(G(s.timeStamp,f.end)),d())});return{stop:()=>{u(),h.stop()},setLoadEvent:f=>{a&&(a=!1,l.push(f),d())}}}function OE(){let e;const t=window.visualViewport;return t?e=t.pageLeft-t.offsetLeft:window.scrollX!==void 0?e=window.scrollX:e=window.pageXOffset||0,Math.round(e)}function Gb(){let e;const t=window.visualViewport;return t?e=t.pageTop-t.offsetTop:window.scrollY!==void 0?e=window.scrollY:e=window.pageYOffset||0,Math.round(e)}let gi;function jb(e){return gi||(gi=Kb(e)),gi}function Kb(e){return new D(t=>{const{throttled:n}=Nr(()=>{t.notify(as())},200);return $(e,window,"resize",n,{capture:!0,passive:!0}).stop})}function as(){const e=window.visualViewport;return e?{width:Number(e.width*e.scale),height:Number(e.height*e.scale)}:{width:Number(window.innerWidth||0),height:Number(window.innerHeight||0)}}const Yb=ne;function Xb(e,t,n,r=Jb(e)){let i=0,s=0,o=0;const a=r.subscribe(({scrollDepth:c,scrollTop:l,scrollHeight:h})=>{let d=!1;if(c>i&&(i=c,d=!0),h>s){s=h;const u=de();o=G(t.relative,u),d=!0}d&&n({maxDepth:Math.min(i,s),maxDepthScrollTop:l,maxScrollHeight:s,maxScrollHeightTime:o})});return{stop:()=>a.unsubscribe()}}function Zb(){const e=Gb(),{height:t}=as(),n=Math.round((document.scrollingElement||document.documentElement).scrollHeight),r=Math.round(t+e);return{scrollHeight:n,scrollDepth:r,scrollTop:e}}function Jb(e,t=Yb){return new D(n=>{function r(){n.notify(Zb())}if(window.ResizeObserver){const i=Nr(r,t,{leading:!1,trailing:!0}),s=document.scrollingElement||document.documentElement,o=new ResizeObserver(I(i.throttled));s&&o.observe(s);const a=$(e,window,"scroll",i.throttled,{passive:!0});return()=>{i.cancel(),o.disconnect(),a.stop()}}})}function Qb(e,t,n,r,i,s,o){const a={},{stop:c,setLoadEvent:l}=Wb(e,t,n,r,s,o,v=>{a.loadingTime=v,i()}),{stop:h}=Xb(r,o,v=>{a.scroll=v}),{stop:d}=xb(r,o.relative,v=>{a.cumulativeLayoutShift=v,i()}),{stop:u,getInteractionToNextPaint:f,setViewEnd:m}=qb(r,o.relative,s);return{stop:()=>{c(),d(),h()},stopINPTracking:u,setLoadEvent:l,setViewEnd:m,getCommonViewMetrics:()=>(a.interactionToNextPaint=f(),a)}}function ev(e,t){const{stop:n}=$(e,window,"pageshow",r=>{r.persisted&&t(r)},{capture:!0});return n}function tv(e,t,n){_b(e.relative,r=>{t.firstContentfulPaint=r,t.largestContentfulPaint={value:r},n()})}const nv=3e3,rv=5*ce,iv=5*ce;function sv(e,t,n,r,i,s,o,a){const c=new Set;let l=u(Me.INITIAL_LOAD,va(),a),h;f();let d;o&&(d=m(s),i.trackBfcacheViews&&(h=ev(i,v=>{l.end();const S=Mr(v.timeStamp);l=u(Me.BF_CACHE,S,void 0)})));function u(v,S,T){const E=ov(t,n,r,i,e,v,S,T);return c.add(E),E.stopObservable.subscribe(()=>{c.delete(E)}),E}function f(){t.subscribe(10,()=>{l=u(Me.ROUTE_CHANGE,void 0,{name:l.name,service:l.service,version:l.version,context:l.contextManager.getContext()})}),t.subscribe(9,()=>{l.end({sessionIsActive:!1})})}function m(v){return v.subscribe(({oldLocation:S,newLocation:T})=>{cv(S,T)&&(l.end(),l=u(Me.ROUTE_CHANGE))})}return{addTiming:(v,S=J())=>{l.addTiming(v,S)},startView:(v,S)=>{l.end({endClocks:S}),l=u(Me.ROUTE_CHANGE,S,v)},setViewContext:v=>{l.contextManager.setContext(v)}
38,setViewContextProperty:(v,S)=>{l.contextManager.setContextProperty(v,S)},setViewName:v=>{l.setViewName(v)},getViewContext:()=>l.contextManager.getContext(),stop:()=>{d&&d.unsubscribe(),h&&h(),l.end(),c.forEach(v=>v.stop())}}}function ov(e,t,n,r,i,s,o=Q(),a){const c=te(),l=new D,h={};let d=0,u;const f=bn(i),m=qr();let v=!0,S=a==null?void 0:a.name;const T=(a==null?void 0:a.service)||r.service,E=(a==null?void 0:a.version)||r.version,_=a==null?void 0:a.context;_&&m.setContext(_);const p={id:c,name:S,startClocks:o,service:T,version:E,context:_};e.notify(1,p),e.notify(2,p);const{throttled:b,cancel:g}=Nr(Ve,nv,{leading:!1}),{setLoadEvent:y,setViewEnd:A,stop:O,stopINPTracking:q,getCommonViewMetrics:B}=Qb(e,t,n,r,Fe,s,o),{stop:Ee,initialViewMetrics:Je}=s===Me.INITIAL_LOAD?Ob(r,o,y,Fe):{stop:U,initialViewMetrics:{}};s===Me.BF_CACHE&&tv(o,Je,Fe);const{stop:re,eventCounts:Gr}=yb(e,c,Fe),jr=Qt(Ve,rv),Kr=e.subscribe(11,fe=>{fe.reason===Pt.UNLOADING&&Ve()});Ve(),m.changeObservable.subscribe(Fe);function zn(){e.notify(3,{id:c,name:S,context:m.getContext(),startClocks:o,sessionIsActive:v})}function Fe(){zn(),b()}function Ve(){g(),zn(),d+=1;const fe=u===void 0?J():u.timeStamp;e.notify(4,{customTimings:h,documentVersion:d,id:c,name:S,service:T,version:E,context:m.getContext(),loadingType:s,location:f,startClocks:o,commonViewMetrics:B(),initialViewMetrics:Je,duration:G(o.timeStamp,fe),isActive:u===void 0,sessionIsActive:v,eventCounts:Gr})}return{get name(){return S},service:T,version:E,contextManager:m,stopObservable:l,end(fe={}){var Re,Qe;u||(u=(Re=fe.endClocks)!==null&&Re!==void 0?Re:Q(),v=(Qe=fe.sessionIsActive)!==null&&Qe!==void 0?Qe:!0,e.notify(5,{endClocks:u}),e.notify(6,{endClocks:u}),xr(jr),A(u.relative),O(),Kr.unsubscribe(),Ve(),ee(()=>{this.stop()},iv))},stop(){Ee(),re(),q(),l.notify()},addTiming(fe,Re){if(u)return;const Qe=Sd(Re)?Re:G(o.timeStamp,Re);h[av(fe)]=Qe,Fe()}
38,setViewName(fe){S=fe,Ve()}}}function av(e){const t=e.replace(/[^a-zA-Z0-9-_.@$]/g,"_");return t!==e&&L.warn(`Invalid timing name: ${e}, sanitized to: ${t}`),t}function cv(e,t){return e.pathname!==t.pathname||!lv(t.hash)&&Qs(t.hash)!==Qs(e.hash)}function lv(e){const t=e.substring(1);return t!==""&&!!document.getElementById(t)}function Qs(e){const t=e.indexOf("?");return t<0?e:e.slice(0,t)}function uv(e,t,n,r,i,s,o,a,c,l){return e.subscribe(4,h=>e.notify(12,dv(h,n,a))),t.register(0,({startTime:h,eventType:d})=>{const u=c.findView(h);return u?{type:d,service:u.service,version:u.version,context:u.context,view:{id:u.id,name:u.name}}:Xe}),t.register(1,({startTime:h})=>{var d;return{view:{id:(d=c.findView(h))===null||d===void 0?void 0:d.id}}}),sv(r,e,i,s,n,o,!n.trackViewsManually,l)}function dv(e,t,n){var r,i,s,o,a,c,l,h,d,u,f,m,v,S,T,E,_,p;const b=n.getReplayStats(e.id),g=(i=(r=e.commonViewMetrics)===null||r===void 0?void 0:r.cumulativeLayoutShift)===null||i===void 0?void 0:i.devicePixelRatio,y={_dd:{document_version:e.documentVersion,replay_stats:b,cls:g?{device_pixel_ratio:g}:void 0,configuration:{start_session_replay_recording_manually:t.startSessionReplayRecordingManually}},date:e.startClocks.timeStamp,type:x.VIEW,view:{action:{count:e.eventCounts.actionCount},frustration:{count:e.eventCounts.frustrationCount},cumulative_layout_shift:(s=e.commonViewMetrics.cumulativeLayoutShift)===null||s===void 0?void 0:s.value,cumulative_layout_shift_time:M((o=e.commonViewMetrics.cumulativeLayoutShift)===null||o===void 0?void 0:o.time),cumulative_layout_shift_target_selector:(a=e.commonViewMetrics.cumulativeLayoutShift)===null||a===void 0?void 0:a.targetSelector,first_byte:M((c=e.initialViewMetrics.navigationTimings)===null||c===void 0?void 0:c.firstByte),dom_complete:M((l=e.initialViewMetrics.navigationTimings)===null||l===void 0?void 0:l.domComplete),dom_content_loaded:M((h=e.initialViewMetrics.navigationTimings)===null||h===void 0?void 0:h.domContentLoaded),dom_interactive:M((d=e.initialViewMetrics.navigationTimings)===null||d===void 0?void 0:d.domInteractive),error:{count:e.eventCounts.errorCount},first_contentful_paint:M(e.initialViewMetrics.firstContentfulPaint),first_input_delay:M((u=e.initialViewMetrics.firstInput)===null||u===void 0?void 0:u.delay),first_input_time:M((f=e.initialViewMetrics.firstInput)===null||f===void 0?void 0:f.time),first_input_target_selector:(m=e.initialViewMetrics.firstInput)===null||m===void 0?void 0:m.targetSelector,interaction_to_next_paint:M((v=e.commonViewMetrics.interactionToNextPaint)===null||v===void 0?void 0:v.value),interaction_to_next_paint_time:M((S=e.commonViewMetrics.interactionToNextPaint)===null||S===void 0?void 0:S.time),interaction_to_next_paint_target_selector:(T=e.commonViewMetrics.interactionToNextPaint)===null||T===void 0?void 0:T.targetSelector,is_active:e.isActive,name:e.name,largest_contentful_paint:M((E=e.initialViewMetrics.largestContentfulPaint)===null||E===void 0?void 0:E.value),largest_contentful_paint_target_selector:(_=e.initialViewMetrics.largestContentfulPaint)===null||_===void 0?void 0:_.targetSelector,load_event:M((p=e.initialViewMetrics.navigationTimings)===null||p===void 0?void 0:p.loadEvent),loading_time:Nc(M(e.commonViewMetrics.loadingTime)),loading_type:e.loadingType,long_task:{count:e.eventCounts.longTaskCount},performance:hv(e.commonViewMetrics,e.initialViewMetrics),resource:{count:e.eventCounts.resourceCount},time_spent:M(e.duration)},display:e.commonViewMetrics.scroll?{scroll:{max_depth:e.commonViewMetrics.scroll.maxDepth,max_depth_scroll_top:e.commonViewMetrics.scroll.maxDepthScrollTop,max_scroll_height:e.commonViewMetrics.scroll.maxScrollHeight,max_scroll_height_time:M(e.commonViewMetrics.scroll.maxScrollHeightTime)}}:void 0,privacy:{replay_level:t.defaultPrivacyLevel},device:{locale:navigator.language,locales:navigator.languages,time_zone:Dm()}};return Ze(e.customTimings)||(y.view.custom_timings=Sa(e.customTimings,M)),{rawRumEvent:y,startTime:e.startClocks.relative,duration:e.duration,domainContext:{location:e.location}}}function hv({cumulativeLayoutShift:e,interactionToNextPaint:t},{firstContentfulPaint:n,firstInput:r,largestContentfulPaint:i}){return{cls:e&&{score:e.value,timestamp:M(e.time),target_selector:e.targetSelector,previous_rect:e.previousRect,current_rect:e.currentRect},fcp:n&&{timestamp:M(n)},fid:r&&{duration:M(r.delay),timestamp:M(r.time),target_selector:r.targetSelector},inp:t&&{duration:M(t.value),timestamp:M(t.time),target_selector:t.targetSelector},lcp:i&&{timestamp:M(i.value),target_selector:i.targetSelector,resource_url:i.resourceUrl}}}const fv="rum";function mv(e,t,n){const r=Zf(e,fv,i=>gv(e,i),n);return r.expireObservable.subscribe(()=>{t.notify(9)}
38),r.renewObservable.subscribe(()=>{t.notify(10)}),r.sessionStateUpdateObservable.subscribe(({previousState:i,newState:s})=>{if(!i.forcedReplay&&s.forcedReplay){const o=r.findSession();o&&(o.isReplayForced=!0)}}),{findTrackedSession:i=>{const s=r.findSession(i);if(!(!s||s.trackingType==="0"))return{id:s.id,sessionReplay:s.trackingType==="1"?1:s.isReplayForced?2:0,anonymousId:s.anonymousId}},expire:r.expire,expireObservable:r.expireObservable,setForcedReplay:()=>r.updateSessionState({forcedReplay:"1"})}}function pv(){const e={id:"00000000-aaaa-0000-aaaa-000000000000",sessionReplay:ac("records")?1:0};return{findTrackedSession:()=>e,expire:U,expireObservable:new D,setForcedReplay:U}}function gv(e,t){return bv(t)?t:at(e.sessionSampleRate)?at(e.sessionReplaySampleRate)?"1":"2":"0"}function bv(e){return e==="0"||e==="1"||e==="2"}function vv(e,t,n,r,i,s){const o=[e.rumEndpointBuilder];e.replica&&o.push(e.replica.rumEndpointBuilder);const a=cc({encoder:s(2),request:oc(o,e.batchBytesLimit,n),flushController:lc({messagesLimit:e.batchMessagesLimit,bytesLimit:e.batchBytesLimit,durationLimit:e.flushTimeout,pageMayExitObservable:r,sessionExpireObservable:i}),messageBytesLimit:e.messageBytesLimit});return t.subscribe(13,c=>{c.type===x.VIEW?a.upsert(c,c.view.id):a.add(c)}),a}function yv(e){const t=Bn();e.subscribe(13,n=>{t.send("rum",n)})}const Ev=gt;function Sv(e,t,n,r){const i=nn({expireDelay:Ev});let s;e.subscribe(1,({startClocks:c})=>{const l=r.href;i.add(a({url:l,referrer:s||document.referrer}),c.relative),s=l}),e.subscribe(6,({endClocks:c})=>{i.closeActive(c.relative)});const o=n.subscribe(({newLocation:c})=>{const l=i.find();if(l){const h=de();i.closeActive(h),i.add(a({url:c.href,referrer:l.referrer}),h)}});function a({url:c,referrer:l}){return{url:c,referrer:l}}return t.register(0,({startTime:c,eventType:l})=>{const h=i.find(c);return h?{type:l,view:{url:h.url,referrer:h.referrer}}:Xe}),{findUrl:c=>i.find(c),stop:()=>{o.unsubscribe(),i.stop()}}}function _v(e,t){let n=bn(t);return new D(r=>{const{stop:i}=wv(e,o),{stop:s}=Tv(e,o);function o(){if(n.href===t.href)return;const a=bn(t);r.notify({newLocation:a,oldLocation:n}),n=a}return()=>{i(),s()}})}function wv(e,t){const{stop:n}=_e(eo("pushState"),"pushState",({onPostCall:s})=>{s(t)}),{stop:r}=_e(eo("replaceState"),"replaceState",({onPostCall:s})=>{s(t)}),{stop:i}=$(e,window,"popstate",t);return{stop:()=>{n(),r(),i()}}}function Tv(e,t){return $(e,window,"hashchange",t)}function eo(e){return Object.prototype.hasOwnProperty.call(history,e)?history:History.prototype}const Av=gt;function Rv(e,t,n){const r=nn({expireDelay:Av});return e.subscribe(1,({startClocks:i})=>{r.add({},i.relative)}),e.subscribe(6,({endClocks:i})=>{r.closeActive(i.relative)}),t.register(0,({startTime:i,eventType:s})=>{if(!n.trackFeatureFlagsForEvents.concat([x.VIEW,x.ERROR]).includes(s))return he;const a=r.find(i);return!a||Ze(a)?he:{type:s,feature_flags:a}}),{addFeatureFlagEvaluation:(i,s)=>{const o=r.find();o&&(o[i]=s)}}}const Cv=10*ne;let Dt,Jn;function Iv(e,t,n){e.metricsEnabled&&(nl(),Jn=!1,t.subscribe(13,()=>{Jn=!0}),n.subscribe(({bytesCount:r,messagesCount:i})=>{Jn&&(Jn=!1,Dt.batchCount+=1,no(Dt.batchBytesCount,r),no(Dt.batchMessagesCount,i))}),Qt(kv,Cv))}function kv(){Dt.batchCount!==0&&(Br("Customer data measures",Dt),nl())}function to(){return{min:1/0,max:0,sum:0}}function no(e,t){e.sum+=t,e.min=Math.min(e.min,t),e.max=Math.max(e.max,t)}function nl(){Dt={batchCount:0,batchBytesCount:to(),batchMessagesCount:to()}}const Lv=4e3,Ov=500,Mv=gt;function xv(e,t,n=Ov){const r=nn({expireDelay:Mv,maxEntries:Lv});let i;yt(F.VISIBILITY_STATE)&&performance.getEntriesByType(F.VISIBILITY_STATE).forEach(l=>{const h=l.name==="hidden"?"hidden":"active";o(h,l.startTime)}),o(rl(),de());const{stop:s}=Ye(t,window,["pageshow","focus","blur","visibilitychange","resume","freeze","pagehide"],c=>{o(Pv(c),c.timeStamp)},{capture:!0});function o(c,l=de()){c!==i&&(i=c,r.closeActive(l),r.add({state:i,startTime:l},l))}function a(c,l,h){return r.findAll(l,h).some(d=>d.state===c)}return e.register(0,({startTime:c,duration:l=0,eventType:h})=>{if(h===x.VIEW){const d=r.findAll(c,l);return{type:h,_dd:{page_states:Nv(d,c,n)}}}return h===x.ACTION||h===x.ERROR?{type:h,view:{in_foreground:a("active",c,0)}}:he}),{wasInPageStateDuringPeriod:a,addPageState:o,stop:()=>{s(),r.stop()}}}function Nv(e,t,n){if(e.length!==0)return e.slice(-n).reverse().map(({state:r,startTime:i})=>({state:r,start:M(G(t,i))}
38))}function Pv(e){return e.type==="freeze"?"frozen":e.type==="pagehide"?e.persisted?"frozen":"terminated":rl()}function rl(){return document.visibilityState==="hidden"?"hidden":document.hasFocus()?"active":"passive"}function Dv(e,t){let n;const r=requestAnimationFrame(I(()=>{n=as()})),i=jb(t).subscribe(s=>{n=s}).unsubscribe;return e.register(0,({eventType:s})=>({type:s,display:n?{viewport:n}:void 0})),{stop:()=>{i(),r&&cancelAnimationFrame(r)}}}function Fv(e,t){const n=window.cookieStore?Vv(e):Bv;return new D(r=>n(t,i=>r.notify(i)))}function Vv(e){return(t,n)=>$(e,window.cookieStore,"change",i=>{const s=i.changed.find(o=>o.name===t)||i.deleted.find(o=>o.name===t);s&&n(s.value)}).stop}const Uv=ne;function Bv(e,t){const n=vn(document.cookie,e),r=Qt(()=>{const i=vn(document.cookie,e);i!==n&&t(i)},Uv);return()=>{xr(r)}}const ro="datadog-ci-visibility-test-execution-id";function qv(e,t,n=Fv(e,ro)){var r;let i=$e(ro)||((r=window.Cypress)===null||r===void 0?void 0:r.env("traceId"));const s=n.subscribe(o=>{i=o});return t.register(0,({eventType:o})=>typeof i!="string"?he:{type:o,session:{type:"ci_test"},ci_test:{test_execution_id:i}}),{stop:()=>{s.unsubscribe()}}}function Hv(e,t){const n=Ae(t,{type:F.LONG_ANIMATION_FRAME,buffered:!0}).subscribe(r=>{for(const i of r){const s=Mr(i.startTime),o={date:s.timeStamp,long_task:{id:te(),entry_type:Ec.LONG_ANIMATION_FRAME,duration:M(i.duration),blocking_duration:M(i.blockingDuration),first_ui_event_timestamp:M(i.firstUIEventTimestamp),render_start:M(i.renderStart),style_and_layout_start:M(i.styleAndLayoutStart),start_time:M(i.startTime),scripts:i.scripts.map(a=>({duration:M(a.duration),pause_duration:M(a.pauseDuration),forced_style_and_layout_duration:M(a.forcedStyleAndLayoutDuration),start_time:M(a.startTime),execution_start:M(a.executionStart),source_url:a.sourceURL,source_function_name:a.sourceFunctionName,source_char_position:a.sourceCharPosition,invoker:a.invoker,invoker_type:a.invokerType,window_attribution:a.windowAttribution}))},type:x.LONG_TASK,_dd:{discarded:!1}};e.notify(12,{rawRumEvent:o,startTime:s.relative,duration:i.duration,domainContext:{performanceEntry:i}})}});return{stop:()=>n.unsubscribe()}}function zv(e,t){const n=Ae(t,{type:F.LONG_TASK,buffered:!0}).subscribe(r=>{for(const i of r){if(i.entryType!==F.LONG_TASK||!t.trackLongTasks)break;const s=Mr(i.startTime),o={date:s.timeStamp,long_task:{id:te(),entry_type:Ec.LONG_TASK,duration:M(i.duration)},type:x.LONG_TASK,_dd:{discarded:!1}};e.notify(12,{rawRumEvent:o,startTime:s.relative,duration:i.duration,domainContext:{performanceEntry:i}})}});return{stop(){n.unsubscribe()}}}function $v(e){e.register(0,({eventType:t})=>{if(!mc())return he;const n=hc(),r=fc();return{type:t,session:{type:"synthetics"},synthetics:{test_id:n,result_id:r,injected:dc()}}})}function Wv(e,t,n){const r=Ji(e),i=n(r);return Yi(t).forEach(([s,o])=>Li(e,r,s.split(/\.|(?=\[\])/),o)),i}function Li(e,t,n,r){const[i,...s]=n;if(i==="[]"){Array.isArray(e)&&Array.isArray(t)&&e.forEach((o,a)=>Li(o,t[a],s,r));return}if(!(!io(e)||!io(t))){if(s.length>0)return Li(e[i],t[i],s,r);Gv(e,i,t[i],r)}}function Gv(e,t,n,r){const i=bt(n);i===r?e[t]=H(n):r==="object"&&(i==="undefined"||i==="null")&&(e[t]={})}function io(e){return bt(e)==="object"}const wt={"view.name":"string","view.url":"string","view.referrer":"string"},Tt={context:"object"},At={service:"string",version:"string"};let il;function jv(e,t,n,r){il={[x.VIEW]:{"view.performance.lcp.resource_url":"string",...Tt,...wt,...At},[x.ERROR]:{"error.message":"string","error.stack":"string","error.resource.url":"string","error.fingerprint":"string",...Tt,...wt,...At},[x.RESOURCE]:{"resource.url":"string",...Tt,...wt,...At},[x.ACTION]:{"action.target.name":"string",...Tt,...wt,...At},[x.LONG_TASK]:{"long_task.scripts[].source_url":"string","long_task.scripts[].invoker":"string",...Tt,...wt,...At},[x.VITAL]:{...Tt,...wt,...At}};const i={[x.ERROR]:si(x.ERROR,e.eventRateLimiterThreshold,r),[x.ACTION]:si(x.ACTION,e.eventRateLimiterThreshold,r),[x.VITAL]:si(x.VITAL,e.eventRateLimiterThreshold,r)};t.subscribe(12,({startTime:s,duration:o,rawRumEvent:a,domainContext:c})=>{const l=n.triggerHook(0,{eventType:a.type,startTime:s,duration:o});if(l===Xe)return;const h=Ne(l,a,{ddtags:Xa(e).join(",")});Kv(h,e.beforeSend,c,i)&&(Ze(h.context)&&delete h.context,t.notify(13,h))})}function Kv(e,t,n,r){var i;if(t){const o=Wv(e,il[e.type],a=>t(a,n));if(o===!1&&e.type!==x.VIEW)return!1;o===!1&&L.warn("Can't dismiss view events using beforeSend!")}return!((i=r[e.type])===null||i===void 0?void 0:i.isLimitReached())}function Yv(e,t,n,r){e.register(0,({eventType:i,startTime:s})=>{const o=t.findTrackedSession(s),a=r.findView(s);if(!o||!a)return Xe;let c,l,h;return i===x.VIEW?(c=n.getReplayStats(a.id)?!0:void 0,l=o.sessionReplay===1,h=a.sessionIsActive?void 0:!1):c=n.isRecording()?!0:void 0,{type:i,session:{id:o.id,type:"user",has_replay:c,sampled_for_replay:l,is_active:h}}}),e.register(1,({startTime:i})=>{const s=t.findTrackedSession(i);return s?{session:{id:s.id}}:he})}function Xv(e){e.register(0,({eventType:t})=>({type:t,connectivity:Ja()}))}function Zv(e,t,n){e.register(0,({eventType:r})=>{const i=t.source;return{type:r,_dd:{format_version:2,drift:yd(),configuration:{session_sample_rate:hn(t.sessionSampleRate,3),session_replay_sample_rate:hn(t.sessionReplaySampleRate,3),profiling_sample_rate:hn(t.profilingSampleRate,3)},browser_sdk_version:jt()?"6.23.0":void 0,sdk_name:n},application:{id:t.applicationId},date:J(),source:i}}),e.register(1,()=>({application:{id:t.applicationId}}))}function Jv(e,t){e.register(1,()=>t.isGranted()?he:Xe)}const Qv=Mf,ey=[x.ACTION,x.ERROR,x.LONG_TASK,x.RESOURCE,x.VITAL];function ty(e){return{addEvent:(t,n,r,i)=>
38{ey.includes(n.type)&&e.notify(12,{startTime:t,rawRumEvent:n,domainContext:r,duration:i})}}}function ny(e,t){if(!t.metricsEnabled)return{stop:U};const{unsubscribe:n}=e.subscribe(4,({initialViewMetrics:r})=>{!r.largestContentfulPaint||!r.navigationTimings||(Br("Initial view metrics",{metrics:ry(r.largestContentfulPaint,r.navigationTimings)}),n())});return{stop:n}}function ry(e,t){return{lcp:{value:e.value},navigation:{domComplete:t.domComplete,domContentLoaded:t.domContentLoaded,domInteractive:t.domInteractive,firstByte:t.firstByte,loadEvent:t.loadEvent}}}function iy(e,t,n,r,i,s,o,a,c){const l=[],h=new Ip,d=Qv();h.subscribe(13,le=>Za("rum",le));const u=le=>{h.notify(14,{error:le}),qn("Error reported to customer",{"error.message":le.message})},f=Lf(e),m=f.subscribe(le=>{h.notify(11,le)});l.push(()=>m.unsubscribe());const v=Df("browser-rum-sdk",e,d,u,f,i);l.push(v.stop);const S=jt()?pv():mv(e,h,s);if(jt())yv(h);else{const le=vv(e,h,u,f,S.expireObservable,i);l.push(()=>le.stop()),Iv(v,h,le.flushController.flushObservable)}const T=Tp(),E=_v(e,location),{observable:_,stop:p}=Rp();l.push(p),Zv(d,e,c);const b=xv(d,e),g=Lp(h);l.push(()=>g.stop());const y=Sv(h,d,E,location);l.push(()=>y.stop());const A=Rv(h,d,e);Yv(d,S,t,g),Xv(d),Jv(d,s);const O=Om(d,e,"rum"),q=Mm(d,e,S,"rum"),B=Lm(d,e,"rum"),{actionContexts:Ee,addAction:Je,addEvent:re,stop:Gr}=sy(h,d,e,b,T,_,u);l.push(Gr);const{addTiming:jr,startView:Kr,setViewName:zn,setViewContext:Fe,setViewContextProperty:Ve,getViewContext:fe,stop:Re}=uv(h,d,e,location,T,_,E,t,g,r);l.push(Re);const{stop:Qe}=ny(h,v);l.push(Qe);const{stop:hl}=ub(h,e,b);if(l.push(hl),e.trackLongTasks)if(yt(F.LONG_ANIMATION_FRAME)){const{stop:le}=Hv(h,e);l.push(le)}else zv(h,e);const{addError:fl}=Gg(h,e,a);a.unbuffer(),Hp(h,e,S,q,B);const $n=Vm(h,b,o),ml=Cp(e.applicationId,S,g,Ee,y);return l.push(()=>n.stop()),{addAction:Je,addEvent:re,addError:fl,addTiming:jr,addFeatureFlagEvaluation:A.addFeatureFlagEvaluation,startView:Kr,setViewContext:Fe,setViewContextProperty:Ve,getViewContext:fe,setViewName:zn,lifeCycle:h,viewHistory:g,session:S,stopSession:()=>S.expire(),getInternalContext:ml.get,startDurationVital:$n.startDurationVital,stopDurationVital:$n.stopDurationVital,addDurationVital:$n.addDurationVital,addOperationStepVital:$n.addOperationStepVital,globalContext:O,userContext:q,accountContext:B,telemetry:v,stop:()=>{l.forEach(le=>le())},hooks:d}}function sy(e,t,n,r,i,s,o){const a=zg(e,t,i,s,n),c=ty(e),l=Dv(t,n),h=qv(n,t);return $v(t),jv(n,e,t,o),{pageStateHistory:r,addAction:a.addAction,addEvent:c.addEvent,actionContexts:a.actionContexts,stop:()=>{a.stop(),h.stop(),l.stop(),r.stop()}}}function oy(e,{session:t,viewContext:n,errorType:r}){const i=t?t.id:"no-session-id",s=[];r!==void 0&&s.push(`error-type=${r}`),n&&(s.push(`seed=${n.id}`),s.push(`from=${n.startClocks.timeStamp}`));const o=ay(e),a=`/rum/replay/sessions/${i}`;return`${o}${a}?${s.join("&")}`}function ay(e){const t=e.site,n=e.subdomain||cy(e);return`https://${n?`${n}.`:""}${t}`}function cy(e){switch(e.site){case ct:case bh:return"app";case qa:return"dd";default:return}}const ly=1e3;let me;function ME(e){return Wr(e).segments_count}function xE(e){Wr(e).segments_count+=1}function NE(e){Wr(e).records_count+=1}function PE(e,t){Wr(e).segments_total_raw_size+=t}function uy(e){return me==null?void 0:me.get(e)}function Wr(e){me||(me=new Map);let t;return me.has(e)?t=me.get(e):(t={records_count:0,segments_count:0,segments_total_raw_size:0},me.set(e,t),me.size>ly&&dy()),t}function dy(){if(!me)return;const e=me.keys().next().value;e&&me.delete(e)}function sl(e,t,n){let r=0,i=[],s,o=!0,a=0;const c=[],{stop:l}=$(e,t,"message",({data:u})=>{if(u.type!=="wrote"||u.streamId!==n)return;const f=c[0];f&&(f.id===u.id?(c.shift(),r+=u.additionalBytesCount,i.push(u.result),s=u.trailer,f.writeCallback?f.writeCallback(u.result.byteLength):f.finishCallback&&f.finishCallback()):f.id<u.id&&l())});function h(){const u=i.length===0?new Uint8Array(0):wd(i.concat(s)),f={rawBytesCount:r,output:u,outputBytesCount:u.byteLength,encoding:"deflate"};return r=0,i=[],f}function d(){o||(t.postMessage({action:"reset",streamId:n}),o=!0)}return{isAsync:!0,get isEmpty(){return o},write(u,f){t.postMessage({action:"write",id:a,data:u,streamId:n}),c.push({id:a,writeCallback:f,data:u}),o=!1,a+=1},finish(u){d(),c.length?(c.forEach(f=>{delete f.writeCallback}),c[c.length-1].finishCallback=()=>
38u(h())):u(h())},finishSync(){d();const u=c.map(f=>f.data).join("");return c.length=0,{...h(),pendingData:u}},estimateEncodedBytesCount(u){return u.length/8},stop(){l()}}}function cs({configuredUrl:e,error:t,source:n,scriptType:r}){if(L.error(`${n} failed to start: an error occurred while initializing the ${r}:`,t),t instanceof Event||t instanceof Error&&hy(t.message)){let i;e?i=`Please make sure the ${r} URL ${e} is correct and CSP is correctly configured.`:i="Please make sure CSP is correctly configured.",L.error(`${i} See documentation at ${Or}/integrations/content_security_policy_logs/#use-csp-with-real-user-monitoring-and-session-replay`)}else r==="worker"&&Qi(t)}function hy(e){return e.includes("Content Security Policy")||e.includes("requires 'TrustedScriptURL'")}const fy=30*ne;function ol(e){return new Worker(e.workerUrl||URL.createObjectURL(new Blob(['(()=>{function t(t){const e=t.reduce((t,e)=>t+e.length,0),a=new Uint8Array(e);let n=0;for(const e of t)a.set(e,n),n+=e.length;return a}function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),n=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),r=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),i=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=Array(576);e(s);var h=Array(60);e(h);var l=Array(512);e(l);var _=Array(256);e(_);var o=Array(29);e(o);var d,u,f,c=Array(30);function p(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function g(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(c);var v=function(t){return t<256?l[t]:l[256+(t>>>7)]},w=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},m=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,w(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},b=function(t,e,a){m(t,a[2*e],a[2*e+1])},y=function(t,e){var a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},z=function(t,e,a){var n,r,i=Array(16),s=0;for(n=1;n<=15;n++)i[n]=s=s+a[n-1]<<1;for(r=0;r<=e;r++){var h=t[2*r+1];0!==h&&(t[2*r]=y(i[h]++,h))}},k=function(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},x=function(t){t.bi_valid>8?w(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},A=function(t,e,a,n){var r=2*e,i=2*a;return t[r]<t[i]||t[r]===t[i]&&n[e]<=n[a]},U=function(t,e,a){for(var n=t.heap[a],r=a<<1;r<=t.heap_len&&(r<t.heap_len&&A(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!A(e,n,t.heap[r],t.depth));)t.heap[a]=t.heap[r],a=r,r<<=1;t.heap[a]=n},B=function(t,e,r){var i,s,h,l,d=0;if(0!==t.last_lit)do{i=t.pending_buf[t.d_buf+2*d]<<8|t.pending_buf[t.d_buf+2*d+1],s=t.pending_buf[t.l_buf+d],d++,0===i?b(t,s,e):(h=_[s],b(t,h+256+1,e),0!==(l=a[h])&&(s-=o[h],m(t,s,l)),i--,h=v(i),b(t,h,r),0!==(l=n[h])&&(i-=c[h],m(t,i,l)))}while(d<t.last_lit);b(t,256,e)},I=function(t,e){var a,n,r,i=e.dyn_tree,s=e.stat_desc.static_tree,h=e.stat_desc.has_stree,l=e.stat_desc.elems,_=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<l;a++)0!==i[2*a]?(t.heap[++t.heap_len]=_=a,t.depth[a]=0):i[2*a+1]=0;for(;t.heap_len<2;)i[2*(r=t.heap[++t.heap_len]=_<2?++_:0)]=1,t.depth[r]=0,t.opt_len--,h&&(t.static_len-=s[2*r+1]);for(e.max_code=_,a=t.heap_len>>1;a>=1;a--)U(t,i,a);r=l;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],U(t,i,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,i[2*r]=i[2*a]+i[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,i[2*a+1]=i[2*n+1]=r,t.heap[1]=r++,U(t,i,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,r,i,s,h,l=e.dyn_tree,_=e.max_code,o=e.stat_desc.static_tree,d=e.stat_desc.has_stree,u=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,c=e.stat_desc.max_length,p=0;for(i=0;i<=15;i++)t.bl_count[i]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(i=l[2*l[2*(n=t.heap[a])+1]+1]+1)>c&&(i=c,p++),l[2*n+1]=i,n>_||(t.bl_count[i]++,s=0,n>=f&&(s=u[n-f]),h=l[2*n],t.opt_len+=h*(i+s),d&&(t.static_len+=h*(o[2*n+1]+s)));if(0!==p){do{for(i=c-1;0===t.bl_count[i];)i--;t.bl_count[i]--,t.bl_count[i+1]+=2,t.bl_count[c]--,p-=2}while(p>0);for(i=c;0!==i;i--)for(n=t.bl_count[i];0!==n;
vendor: 4,849 bytes, line 38
38)(r=t.heap[--a])>_||(l[2*r+1]!==i&&(t.opt_len+=(i-l[2*r+1])*l[2*r],l[2*r+1]=i),n--)}}(t,e),z(i,_,t.bl_count)},E=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++h<l&&r===s||(h<_?t.bl_tree[2*r]+=h:0!==r?(r!==i&&t.bl_tree[2*r]++,t.bl_tree[32]++):h<=10?t.bl_tree[34]++:t.bl_tree[36]++,h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4))},C=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),n=0;n<=a;n++)if(r=s,s=e[2*(n+1)+1],!(++h<l&&r===s)){if(h<_)do{b(t,r,t.bl_tree)}while(0!==--h);else 0!==r?(r!==i&&(b(t,r,t.bl_tree),h--),b(t,16,t.bl_tree),m(t,h-3,2)):h<=10?(b(t,17,t.bl_tree),m(t,h-3,3)):(b(t,18,t.bl_tree),m(t,h-11,7));h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4)}},D=!1,M=function(t,e,a,n){m(t,0+(n?1:0),3),function(t,e,a){x(t),w(t,a),w(t,~a),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a}(t,e,a)},j=M,L=function(t,e,a,n){for(var r=65535&t,i=t>>>16&65535,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{i=i+(r=r+e[n++]|0)|0}while(--s);r%=65521,i%=65521}return r|i<<16},S=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),T=function(t,e,a,n){var r=S,i=n+a;t^=-1;for(var s=n;s<i;s++)t=t>>>8^r[255&(t^e[s])];return-1^t},O={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},q=j,F=function(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(_[a]+256+1)]++,t.dyn_dtree[2*v(e)]++),t.last_lit===t.lit_bufsize-1},G=-2,H=258,J=262,K=103,N=113,P=666,Q=function(t,e){return t.msg=O[e],e},R=function(t){return(t<<1)-(t>4?9:0)},V=function(t){for(var e=t.length;--e>=0;)t[e]=0},W=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},X=function(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},Y=function(t,e){(function(t,e,a,n){var r,l,_=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),I(t,t.l_desc),I(t,t.d_desc),_=function(t){var e;for(E(t,t.dyn_ltree,t.l_desc.max_code),E(t,t.dyn_dtree,t.d_desc.max_code),I(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*i[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),r=t.opt_len+3+7>>>3,(l=t.static_len+3+7>>>3)<=r&&(r=l)):r=l=a+5,a+4<=r&&-1!==e?M(t,e,a,n):4===t.strategy||l===r?(m(t,2+(n?1:0),3),B(t,s,h)):(m(t,4+(n?1:0),3),function(t,e,a,n){var r;for(m(t,e-257,5),m(t,a-1,5),m(t,n-4,4),r=0;r<n;r++)m(t,t.bl_tree[2*i[r]+1],3);C(t,t.dyn_ltree,e-1),C(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,_+1),B(t,t.dyn_ltree,t.dyn_dtree)),k(t),n&&x(t)})(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,X(t.strm)},Z=function(t,e){t.pending_buf[t.pending++]=e},$=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},tt=function(t,e,a,n){var r=t.avail_in;return r>n&&(r=n),0===r?0:(t.avail_in-=r,e.set(t.input.subarray(t.next_in,t.next_in+r),a),1===t.state.wrap?t.adler=L(t.adler,e,r,a):2===t.state.wrap&&(t.adler=T(t.adler,e,r,a)),t.next_in+=r,t.total_in+=r,r)},et=function(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,h=t.nice_match,l=t.strstart>t.w_size-J?t.strstart-(t.w_size-J):0,_=t.window,o=t.w_mask,d=t.prev,u=t.strstart+H,f=_[i+s-1],c=_[i+s];t.prev_length>=t.good_match&&(r>>=2),h>t.lookahead&&(h=t.lookahead);do{if(_[(a=e)+s]===c&&_[a+s-1]===f&&_[a]===_[i]&&_[++a]===_[i+1]){i+=2,a++;do{}while(_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&i<u);if(n=H-(u-i),i=u-H,n>s){if(t.match_start=e,s=n,n>=h)break;f=_[i+s-1],c=_[i+s]}}}while((e=d[e&o])>l&&0!==--r);return s<=t.lookahead?s:t.lookahead},at=function(t){var e,a,n,r,i,s=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=s+(s-J)){t.window.set(t.window.subarray(s,s+s),0),t.match_start-=s,t.strstart-=s,t.block_start-=s,e=a=t.hash_size;do{n=t.head[--e],t.head[e]=n>=s?n-s:0}while(--a);e=a=s;do{n=t.prev[--e],t.prev[e]=n>=s?n-s:0}while(--a);r+=s}if(0===t.strm.avail_in)break;if(a=tt(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=a,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=W(t,t.ins_h,t.window[i+1]
vendor: 6,774 bytes, line 38
38);t.insert&&(t.ins_h=W(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<J&&0!==t.strm.avail_in)},nt=function(t,e){for(var a,n;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-J&&(t.match_length=et(t,a)),t.match_length>=3)if(n=F(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!==--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=W(t,t.ins_h,t.window[t.strstart+1]);else n=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2},rt=function(t,e){for(var a,n,r;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-J&&(t.match_length=et(t,a),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=F(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!==--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(Y(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=F(t,0,t.window[t.strstart-1]))&&Y(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=F(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2};function it(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}var st=[new it(0,0,0,0,function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(at(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,Y(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-J&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(Y(t,!1),t.strm.avail_out),1)}),new it(4,4,8,4,nt),new it(4,5,16,8,nt),new it(4,6,32,32,nt),new it(4,4,16,16,rt),new it(8,16,32,32,rt),new it(8,16,128,128,rt),new it(8,32,128,256,rt),new it(32,128,258,1024,rt),new it(32,258,258,4096,rt)];function ht(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),V(this.dyn_ltree),V(this.dyn_dtree),V(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),V(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),V(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}for(var lt=function(t){var e,i=function(t){if(!t||!t.state)return Q(t,G);t.total_in=t.total_out=0,t.data_type=2;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:N,t.adler=2===e.wrap?0:1,e.last_flush=0,function(t){D||(function(){var t,e,i,g,v,w=Array(16);for(i=0,g=0;g<28;g++)for(o[g]=i,t=0;t<1<<a[g];t++)_[i++]=g;for(_[i-1]=g,v=0,g=0;g<16;g++)for(c[g]=v,t=0;t<1<<n[g];t++)l[v++]=g;for(v>>=7;g<30;g++)for(c[g]=v<<7,t=0;t<1<<n[g]-7;t++)l[256+v++]=g;for(e=0;e<=15;e++)w[e]=0;for(t=0;t<=143;)s[2*t+1]=8,t++,w[8]++;for(;t<=255;)s[2*t+1]=9,t++,w[9]++;for(;t<=279;)s[2*t+1]=7,t++,w[7]++;for(;t<=287;)s[2*t+1]=8,t++,w[8]++;for(z(s,287,w),t=0;t<30;t++)h[2*t+1]=5,h[2*t]=y(t,5);d=new p(s,a,257,286,15),u=new p(h,n,0,30,15),f=new p([],r,0,19,7)}(),D=!0),t.l_desc=new g(t.dyn_ltree,d),t.d_desc=new g(t.dyn_dtree,u),t.bl_desc=new g(t.bl_tree,f),t.bi_buf=0,t.bi_valid=0,k(t)}(e),0}(t);return 0===i&&((e=t.state).window_size=2*e.w_size,V(e.head),e.max_lazy_match=st[e.level].max_lazy,e.good_match=st[e.level].good_length,e.nice_match=st[e.level].nice_length,e.max_chain_length=st[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),i},_t=function(t,e){var a,n;if(!t||!t.state||e>5||e<0)return t?Q(t,G):G;var r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===P&&4!==e)return Q(t,0===t.avail_out?-5:G);r.strm=t;var i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,Z(r,31),Z(r,139),Z(r,8),r.gzhead?(Z(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Z(r,255&r.gzhead.time),Z(r,r.gzhead.time>>8&255),Z(r,r.gzhead.time>>16&255),Z(r,r.gzhead.time>>24&255),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Z(r,255&r.gzhead.extra.length),Z(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=T(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,3),r.status=N);else{var h=8+(r.w_bits-8<<4)<<8;h|=(r.strategy>
vendor: 5,925 bytes, line 38
38=2||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(h|=32),h+=31-h%31,r.status=N,$(r,h),0!==r.strstart&&($(r,t.adler>>>16),$(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending!==r.pending_buf_size));)Z(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=K)}else r.status=K;if(r.status===K&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&X(t),r.pending+2<=r.pending_buf_size&&(Z(r,255&t.adler),Z(r,t.adler>>8&255),t.adler=0,r.status=N)):r.status=N),0!==r.pending){if(X(t),0===t.avail_out)return r.last_flush=-1,0}else if(0===t.avail_in&&R(e)<=R(i)&&4!==e)return Q(t,-5);if(r.status===P&&0!==t.avail_in)return Q(t,-5);if(0!==t.avail_in||0!==r.lookahead||0!==e&&r.status!==P){var l=2===r.strategy?function(t,e){for(var a;;){if(0===t.lookahead&&(at(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):3===r.strategy?function(t,e){for(var a,n,r,i,s=t.window;;){if(t.lookahead<=H){if(at(t),t.lookahead<=H&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[r=t.strstart-1])===s[++r]&&n===s[++r]&&n===s[++r]){i=t.strstart+H;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&r<i);t.match_length=H-(i-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=F(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):st[r.level].func(r,e);if(3!==l&&4!==l||(r.status=P),1===l||3===l)return 0===t.avail_out&&(r.last_flush=-1),0;if(2===l&&(1===e?function(t){m(t,2,3),b(t,256,s),function(t){16===t.bi_valid?(w(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}(r):5!==e&&(q(r,0,0,!1),3===e&&(V(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),X(t),0===t.avail_out))return r.last_flush=-1,0}return 4!==e?0:r.wrap<=0?1:(2===r.wrap?(Z(r,255&t.adler),Z(r,t.adler>>8&255),Z(r,t.adler>>16&255),Z(r,t.adler>>24&255),Z(r,255&t.total_in),Z(r,t.total_in>>8&255),Z(r,t.total_in>>16&255),Z(r,t.total_in>>24&255)):($(r,t.adler>>>16),$(r,65535&t.adler)),X(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?0:1)},ot=function(t){if(!t||!t.state)return G;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==K&&e!==N&&e!==P?Q(t,G):(t.state=null,e===N?Q(t,-3):0)},dt=new Uint8Array(256),ut=0;ut<256;ut++)dt[ut]=ut>=252?6:ut>=248?5:ut>=240?4:ut>=224?3:ut>=192?2:1;dt[254]=dt[254]=1;var ft=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},ct=Object.prototype.toString;function pt(){this.options={level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0};var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ft,this.strm.avail_out=0;var e,a,n=function(t,e,a,n,r,i){if(!t)return G;var s=1;if(-1===e&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||8!==a||n<8||n>15||e<0||e>9||i<0||i>4)return Q(t,G);8===n&&(n=9);var h=new ht;return t.state=h,h.strm=t,h.wrap=s,h.gzhead=null,h.w_bits=n,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=r+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new Uint8Array(2*h.w_size),h.head=new Uint16Array(h.hash_size),h.prev=new Uint16Array(h.w_size),h.lit_bufsize=1<<r+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new Uint8Array(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=i,h.method=a,lt(t)}(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==n)throw Error(O[n]);if(t.header&&(e=this.strm,a=t.header,e&&e.state&&(2!==e.state.wrap||(e.state.gzhead=a))),t.dictionary){var r;if(r="[object ArrayBuffer]"===ct.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(n=function(t,e){var a=e.length;if(!t||!t.state)return G;var n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return G;if(1===r&&(t.adler=L(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(V(n.head),n.strstart=0,n.block_start=0,n.insert=0);var i=new Uint8Array(n.w_size);
38i.set(e.subarray(a-n.w_size,a),0),e=i,a=n.w_size}var s=t.avail_in,h=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,at(n);n.lookahead>=3;){var _=n.strstart,o=n.lookahead-2;do{n.ins_h=W(n,n.ins_h,n.window[_+3-1]),n.prev[_&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=_,_++}while(--o);n.strstart=_,n.lookahead=2,at(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=h,t.input=l,t.avail_in=s,n.wrap=r,0}(this.strm,r)))throw Error(O[n]);this._dict_set=!0}}function gt(t,e,a){try{t.postMessage({type:"errored",error:e,streamId:a})}catch(n){t.postMessage({type:"errored",error:e+"",streamId:a})}}function vt(t){const e=t.strm.adler;return new Uint8Array([3,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e])}pt.prototype.push=function(t,e){var a,n,r=this.strm,i=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?4:0,"[object ArrayBuffer]"===ct.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(2===n||3===n)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(1===(a=_t(r,n)))return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=ot(this.strm),this.onEnd(a),this.ended=!0,0===a;if(0!==r.avail_out){if(n>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},pt.prototype.onData=function(t){this.chunks.push(t)},pt.prototype.onEnd=function(t){0===t&&(this.result=function(t){for(var e=0,a=0,n=t.length;a<n;a++)e+=t[a].length;for(var r=new Uint8Array(e),i=0,s=0,h=t.length;i<h;i++){var l=t[i];r.set(l,s),s+=l.length}return r}(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},function(e=self){try{const a=new Map;e.addEventListener("message",n=>{try{const r=function(e,a){switch(a.action){case"init":return{type:"initialized",version:"6.23.0"};case"write":{let n=e.get(a.streamId);n||(n=new pt,e.set(a.streamId,n));const r=n.chunks.length,i=function(t){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,n,r,i,s=t.length,h=0;for(r=0;r<s;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),h+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(h),i=0,r=0;i<h;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),a<128?e[i++]=a:a<2048?(e[i++]=192|a>>>6,e[i++]=128|63&a):a<65536?(e[i++]=224|a>>>12,e[i++]=128|a>>>6&63,e[i++]=128|63&a):(e[i++]=240|a>>>18,e[i++]=128|a>>>12&63,e[i++]=128|a>>>6&63,e[i++]=128|63&a);return e}(a.data);return n.push(i,2),{type:"wrote",id:a.id,streamId:a.streamId,result:t(n.chunks.slice(r)),trailer:vt(n),additionalBytesCount:i.length}}case"reset":e.delete(a.streamId)}}(a,n.data);r&&e.postMessage(r)}catch(t){gt(e,t,n.data&&"streamId"in n.data?n.data.streamId:void 0)}})}catch(t){gt(e,t)}}()})();'])))}let j={status:0};function al(e,t,n,r=ol){switch(j.status===0&&my(e,t,r),j.status){case 1:return j.initializationFailureCallbacks.push(n),j.worker;case 3:return j.worker}}function so(){return j.status}function my(e,t,n=ol){try{const r=n(e),{stop:i}=$(e,r,"error",a=>{bi(e,t,a)}),{stop:s}=$(e,r,"message",({data:a})=>{a.type==="errored"?bi(e,t,a.error,a.streamId):a.type==="initialized"&&gy(a.version)});r.postMessage({action:"init"}),ee(()=>py(t),fy),j={status:1,worker:r,stop:()=>{i(),s()},initializationFailureCallbacks:[]}}catch(r){bi(e,t,r)}}function py(e){j.status===1&&(L.error(`${e} failed to start: a timeout occurred while initializing the Worker`),j.initializationFailureCallbacks.forEach(t=>t()),j={status:2})}function gy(e){j.status===1&&(j={status:3,worker:j.worker,stop:j.stop,version:e})}function bi(e,t,n,r){j.status===1||j.status===0?(cs({configuredUrl:e.workerUrl,error:n,source:t,scriptType:"worker"}),j.status===1&&j.initializationFailureCallbacks.forEach(i=>i()),j={status:2}):Qi(n,{worker_version:j.status===3&&j.version,stream_id:r})}function cl(){return typeof Array.from=="function"&&typeof CSSSupportsRule=="function"&&typeof URL.createObjectURL=="function"&&"forEach"in NodeList.prototype}function by(e,t,n,r){const i=t.findTrackedSession(),s=vy(i,r),o=n.findView();return oy(e,{viewContext:o,errorType:s,session:i})}function vy(e,t){if(!cl())return"browser-not-supported";if(!e)return"rum-not-tracked";if(e.sessionReplay===0)return"incorrect-session-plan";if(!t)return"replay-not-started"}function yy(e,t){if(!e.metricsEnabled)return{stop:U};let n,r,i;const{unsubscribe:s}=t.subscribe(o=>{switch(o.type){case"start":n={forced:o.forced,timestamp:J()},r=void 0,i=void 0;break;case"document-ready":n&&(r=G(n.timestamp,J()));break;
38case"recorder-settled":n&&(i=G(n.timestamp,J()));break;case"aborted":case"deflate-encoder-load-failed":case"recorder-load-failed":case"succeeded":s(),n&&Br("Recorder init metrics",{metrics:Ey(n.forced,i,G(n.timestamp,J()),o.type,r)});break}});return{stop:s}}function Ey(e,t,n,r,i){return{forced:e,loadRecorderModuleDuration:t,recorderInitDuration:n,result:r,waitForDocReadyDuration:i}}function Sy(e,t,n,r,i,s,o){let a=0,c;t.subscribe(9,()=>{(a===2||a===3)&&(u(),a=1)}),t.subscribe(10,()=>{a===1&&d()});const l=new D;yy(o,l);const h=async f=>{l.notify({type:"start",forced:f});const[m]=await Promise.all([oo(l,{type:"recorder-settled"},i()),oo(l,{type:"document-ready"},sm(e,"interactive"))]);if(a!==2){l.notify({type:"aborted"});return}if(!m){a=0,l.notify({type:"recorder-load-failed"});return}const v=s();if(!v){a=0,l.notify({type:"deflate-encoder-load-failed"});return}({stop:c}=m(t,e,n,r,v,o)),a=3,l.notify({type:"succeeded"})};function d(f){const m=n.findTrackedSession();if(_y(m,f)){a=1;return}if(wy(a))return;a=2;const v=Ty(m,f)||!1;h(v).catch(ft),v&&n.setForcedReplay()}function u(){a===3&&(c==null||c()),a=0}return{start:d,stop:u,getSessionReplayLink(){return by(e,n,r,a!==0)},isRecording:()=>a===3}}function _y(e,t){return!e||e.sessionReplay===0&&(!t||!t.force)}function wy(e){return e===2||e===3}function Ty(e,t){return t&&t.force&&e.sessionReplay===0}async function oo(e,t,n){try{return await n}finally{e.notify(t)}}function Ay(){let e=0;return{strategy:{start(){e=1},stop(){e=2},isRecording:()=>!1,getSessionReplayLink:U},shouldStartImmediately(t){return e===1||e===0&&!t.startSessionReplayRecordingManually}}}function Ry(e,t){if(jt()&&!ac("records")||!cl())return{start:U,stop:U,getReplayStats:()=>{},onRumStart:U,isRecording:()=>!1,getSessionReplayLink:()=>{}};let{strategy:n,shouldStartImmediately:r}=Ay();return{start:s=>n.start(s),stop:()=>n.stop(),getSessionReplayLink:()=>n.getSessionReplayLink(),onRumStart:i,isRecording:()=>so()===3&&n.isRecording(),getReplayStats:s=>so()===3?uy(s):void 0};function i(s,o,a,c,l,h){let d;function u(){return d||(l??(l=al(o,"Datadog Session Replay",()=>{n.stop()},t)),l&&(d=sl(o,l,1))),d}n=Sy(o,s,a,c,e,u,h),r(o)&&n.start()}}async function Cy(e=Iy){try{return await e()}catch(t){cs({error:t,source:"Recorder",scriptType:"module"})}}async function Iy(){return(await zi(()=>import("./startRecording-DXv-b9EQ.js"),__vite__mapDeps([0,1]))).startRecording}function ky(){return ye().Profiler!==void 0}const Ly=e=>{let t={status:"starting"};return e.register(0,({eventType:n})=>n!==x.VIEW&&n!==x.LONG_TASK?he:{type:n,_dd:{profiling:t}}),{get:()=>t,set:n=>{t=n}}};async function Oy(e=My){try{return await e()}catch(t){cs({error:t,source:"Profiler",scriptType:"module"})}}async function My(){return(await zi(()=>import("./profiler-BP8ijunQ.js"),__vite__mapDeps([2,1]))).createRumProfiler}function xy(){let e;function t(n,r,i,s,o,a){const c=s.findTrackedSession();if(!c||!Tc(c.id,i.profilingSampleRate))return;const l=Ly(r);if(!ky()){l.set({status:"error",error_reason:"not-supported-by-browser"});return}Oy().then(h=>{if(!h){qn("[DD_RUM] Failed to lazy load the RUM Profiler"),l.set({status:"error",error_reason:"failed-to-lazy-load"});return}e=h(i,n,s,l,a),e.start(o.findView())}).catch(ft)}return{onRumStart:t,stop:()=>{e==null||e.stop().catch(ft)}}}const Ny=Ry(Cy),Py=xy(),ll=_p(iy,Ny,Py,{startDeflateWorker:al,createDeflateEncoder:sl,sdkName:"rum"});of(ye(),"DD_RUM",ll);function Dy(){return!location.host||location.host.endsWith("localhost")||location.host.endsWith("127.0.0.1")?"local":location.host.endsWith(".kin.insure")||location.host.endsWith(".kin.com")?"production":location.host.endsWith("app.dev.kin.co")?"development":location.host.endsWith(".kin.haus")?"staging":"unknown"}function DE(){ll.init({applicationId:"7d763868-eb83-4d5f-9c46-1c2663930f80",clientToken:"pub4792edf2a6f0264df3201eeb9a004426",site:"datadoghq.com",service:"portal",env:Dy(),sessionSampleRate:100,sessionReplaySampleRate:20,trackBfcacheViews:!0,trackUserInteractions:!0,defaultPrivacyLevel:"mask-user-input",allowedTracingUrls:["https://app.kin.com/kin_portal","https://app.kin.insure/kin_portal","https://app.kin.haus/kin_portal"]})}var Fy=Object.getOwnPropertyDescriptor,Vy=(e,t,n,r)=>{for(var i=r>1?void 0:r?Fy(t,n):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(i=o(i)||i);return i};let Oi=class extends xi{connectedCallback(){super.connectedCallback();const e=document.createElement("script");e.src="https://cdn.kustomerapp.com/chat-web/widget.js",e.setAttribute("data-kustomer-api-key","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVmN2YyNDBmYTQxMzRlMDA5NjlhNTBiMSIsInVzZXIiOiI1ZjdmMjQwZjk3YTdkMzYwMmFlMzAwODciLCJvcmciOiI1ZjZiZTRiYWFjMWI1NzAwMWEzOTRmMzEiLCJvcmdOYW1lIjoia2luIiwidXNlclR5cGUiOiJtYWNoaW5lIiwicG9kIjoicHJvZDEiLCJyb2xlcyI6WyJvcmcudHJhY2tpbmciXSwiYXVkIjoidXJuOmNvbnN1bWVyIiwiaXNzIjoidXJuOmFwaSIsInN1YiI6IjVmN2YyNDBmOTdhN2QzNjAyYWUzMDA4NyJ9.rb5EFsCvPArF8qQ8uVFBDc5Z3-8ATygUncd_30zCSpA"),this.insertAdjacentElement("afterend",e),window.addEventListener("kustomerLoaded",()=>{Kustomer.start({hideChatIcon:!0})})}startChat(){console.log("click"),Kustomer.open()}render(){return vl`<button @click=${this.startChat} id="startChatButton"> 39 <svg 40 width="55" 41 height="55"
42 viewBox="0 0 51 51" 43 fill="none" 44 xmlns="http://www.w3.org/2000/svg" 45 > 46 <path 47 d="M25.5039 1C39.037 1 50.0078 11.9708 50.0078 25.5039C50.0078 39.037 39.037 50.0078 25.5039 50.0078C11.9708 50.0078 1 39.037 1 25.5039C1.00001 11.9708 11.9708 1.00001 25.5039 1Z" 48 fill="white" 49 /> 50 <path 51 d="M25.5039 1C39.037 1 50.0078 11.9708 50.0078 25.5039C50.0078 39.037 39.037 50.0078 25.5039 50.0078C11.9708 50.0078 1 39.037 1 25.5039C1.00001 11.9708 11.9708 1.00001 25.5039 1Z" 52 stroke="#DADADA" 53 stroke-width="2" 54 /> 55 <path 56 d="M21.9 33.0079C23.8086 33.9869 26.0041 34.2521 28.0909 33.7556C30.1777 33.2592 32.0186 32.0337 33.2818 30.3C34.545 28.5664 35.1474 26.4386 34.9806 24.3C34.8137 22.1615 33.8886 20.1528 32.3718 18.6361C30.855 17.1193 28.8464 16.1941 26.7078 16.0273C24.5693 15.8604 22.4415 16.4629 20.7078 17.7261C18.9742 18.9893 17.7487 20.8302 17.2522 22.917C16.7558 25.0038 17.0209 27.1993 18 29.1079L16 35.0079L21.9 33.0079Z" 57 fill="#FFC857" 58 stroke="#12120F" 59 stroke-width="2" 60 stroke-linecap="round" 61 stroke-linejoin="round" 62 /> 63 </svg> 64 </button>`}};Oi.styles=bl` 65 :host { 66 display: contents; 67 } 68 button { 69 appearance: none; 70 -webkit-appearance: none; 71 -moz-appearance: none; 72 background: none; 73 border: 0; 74 display: inline-flex; 75 cursor: pointer; 76 transition: transform 0.125s ease; 77 } 78 button svg { 79 border-radius: 50%; 80 } 81 button svg path { 82 fill: #fff; 83 } 84 button svg > path:nth-child(2) { 85 stroke: #fff; 86 } 87 88 @media (min-width: 767px) { 89 :host { 90 position: fixed; 91 bottom: 80px; 92 right: 110px; 93 z-index: 999; 94 } 95 button svg > path:nth-child(3) { 96 fill: var(--color-primary); 97 } 98 button svg > path:nth-child(2) { 99 stroke: #dadada; 100 } 101 button:hover { 102 transform: scale(1.1); 103 } 104 button:hover > svg { 105 box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); 106 } 107 } 108 `;Oi=Vy([po("portal-kustomer-chat")],Oi);document.addEventListener("turbo:before-cache",()=>{var e;(e=document.querySelector("kin-toast-group"))==null||e.querySelectorAll("kin-toast").forEach(t=>t.hide()),document.querySelectorAll("show-toast").forEach(t=>t.remove())});class Uy{static show(t,n="info",r=5e3){const i=document.querySelector("kin-toast-group");i?i.addToast(t,n,r):console.warn("kin-toast-group not found in DOM")}static success(t,n=5e3){this.show(t,"success",n)}static info(t,n=5e3){this.show(t,"info",n)}static error(t,n=5e3){this.show(t,"error",n)}static warning(t,n=5e3){this.show(t,"warning",n)}}class By extends xi{connectedCallback(){super.connectedCallback();const t=this.dataset.content||"",n=this.dataset.variant||"info";requestAnimationFrame(()=>{Uy.show(t,n),this.remove()})}}customElements.define("show-toast",By);const ls={phonePattern:/^\(?([2-9][0-9]{2})\)?[-. ]?([2-9](?!11)[0-9]{2})[-. ]?([0-9]{4})$/,emailPattern:/[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\.)+[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?/,vinPattern:/^[0-9A-HJ-NPR-Za-hj-npr-z]{8}[0-9Xx][0-9A-HJ-NPR-Za-hj-npr-z]{8}$/};function ul(e,t){return Array.from(e.querySelectorAll(`[name="${t.name}"]`)).find(n=>n.checked===!0)}function Mi(e){return e.querySelector(".checkbox--group").querySelectorAll("input:checked")}const qy=11,Hy={A:1,B:2,C:3,D:4,E:5,F:6,G:7,H:8,I:0,J:1,K:2,L:3,M:4,N:5,O:0,P:7,Q:0,R:9,S:2,T:3,U:4,V:5,W:6,X:7,Y:8,Z:9},zy=[8,7,6,5,4,3,2,10,0,9,8,7,6,5,4,3,2];function $y(e){return e.match(/[0-9]/)?parseInt(e):Hy[e]}function Wy(e,t){return $y(e)*zy[t]}function Gy(e){let t=0;return e.split("").map((n,r)=>{t+=Wy(n,r)}),t%qy}function ln(e,t){let n=e.field;const r={type:t,message:e.message||"The value does not match the length required."},i=n.minLength>0,s=n.maxLength>0,o=n.value.length;return i&&o<n.minLength||s&&o>n.maxLength?r:null}function jy(e,t){let n=e.field;const r={type:t,message:e.message||"The input provided does not match expectations."};return n.validity.patternMismatch?r:null}function ao(e,t){let n=e.field;const r=RegExp(ls.emailPattern),i={type:t,message:e.message||"Please enter a valid e-mail address."};return n.value!==""?n.validity.valid&&r.test(n.value)?null:i:null}function Ky(e,t){const n={type:t,message:e.message||"Please enter a valid VIN."}
108,r={type:t,message:e.message||"VIN check digit is invalid."},i=RegExp(ls.vinPattern);if(e.field.value=="")return null;if(!i.test(e.field.value))return n;let s=Gy(e.field.value);return e.field.value[8].toUpperCase()=="X"?s==10?null:r:s==parseInt(e.field.value[8])?null:r}function co(e,t){const n={type:t,message:e.message||"This field is required."};return(e.field instanceof HTMLInputElement||e.field instanceof HTMLTextAreaElement)&&e.field.dataset.component!=="multiple-autocomplete"?e.field.value.length===0?n:null:e.field instanceof HTMLSelectElement?e.field.multiple?e.field.selectedOptions.length===0?n:null:e.field.value.length===0?n:null:null}function Yy(e,t){const n={type:t,message:e.message||"This field is required."};return ul(e.field.form,e.field)?null:n}function Xy(e,t){const n={type:t,message:e.message||"At least one checkbox must be selected"};return Mi(e).length>0?null:n}function Zy(e,t){let n=e.field,r=n.min||null,i=n.max||null;return i!==null&&Number.parseFloat(n.value)>Number.parseFloat(i)?{type:t,message:"The input is higher than the maximum allows."}:r!==null&&Number.parseFloat(n.value)<Number.parseFloat(r)?{type:t,message:"The input is lower than the minimum allows."}:null}function Jy(e,t){let n=e.field.dataset.validateNumericRangeMin,r=e.field.value.replace(/[^0-9.]/g,"");const i={type:t,message:e.message||"The input supplied is lower than accepted."};return Number.parseFloat(n)>Number.parseFloat(r)?i:null}function Qy(e,t){let n=e.field.dataset.validateNumericRangeMax,r=e.field.value.replace(/[^0-9.]/g,""),i={type:t,message:e.message||"The input supplied is higher than accepted."};return Number.parseFloat(n)<Number.parseFloat(r)?i:null}function eE(e,t){const n={type:t,message:e.message||"The phone number entered is not valid."};return RegExp(ls.phonePattern).test(e.field.value)?null:n}function dl(e){const t=e.replace(/\D/g,"");if(t.length<13||t.length>19)return!1;let n=0,r=!1;for(let i=t.length-1;i>=0;i--){let s=parseInt(t.charAt(i));r&&(s*=2,s>9&&(s=s%10+1)),n+=s,r=!r}return n%10===0}function lo(e,t){let n=e.field.value;const r={type:t,message:e.message||"This is not a valid credit card."},i=n.replace(/[\s-]/g,"");return i?dl(i)?null:r:null}function tE(e,t){let n=new RegExp(/^\d+$/);const r={type:t,message:e.message||"The value must only contain numeric digits."};return n.test(e.field.value)?null:r}function uo(e,t,n){let r={type:n,message:e.message||"This does not match the associated field's input."};return e.field.value===t.field.value?null:r}function De(e,t=!1){let n=e.toUTCString(),r=e.getTimezoneOffset()/60;if(Number.isInteger(r)){let s=r<10&&r>0?"0"+r:r;n=n+(r<0?"+":"-")+s+"00"}let i=new Date(n);return t&&(i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0)),i}function ho(e){if(typeof e=="string"){let t=new Date(e),n=e.split("/"),r=[];return n.forEach((i,s)=>r[s]=Number.parseInt(i)),r[0]!==0&&(r[0]=r[0]-1),t.getFullYear()<1e3?!1:t.getMonth()===r[0]&&t.getFullYear()===r[2]&&t.getDate()===r[1]}else return!isNaN(Number(e))}function nE(e){const t="00"+e;return t.slice(t.length-2,t.length)}function rE(e){return e.reduce((t,n)=>{const r=new Date(n);return r instanceof Date&&!isNaN(r.getTime())&&t.push(r),t},[])}function iE(e,t){for(let n of e)if(t.getTime()===n.getTime())return!0;return!1}function sE(e,t){let n={type:t,message:"This is not a valid date."};return e.field.valueAsDate?ho(e.field.valueAsDate)?null:n:ho(e.field.value)?null:n}function oE(e,t){let n=new Date(e.field.value),r={type:t,message:e.message||"The date provided is not within the range required."};return n instanceof Date&&e.options.minDate<=n&&n<=e.options.maxDate?null:r}function aE(e,t){let n=new Date(e.field.value),r={type:t,message:e.message||"The date provided is disallowed."};return n instanceof Date?iE(e.options.disallowedDatesParsed,n)?r:null:r}function cE(e,t){let n=new Date(e.field.value),r=Number.parseInt(e.field.dataset.validateMinAge.valueOf()),i=new Date,s=i.getFullYear()-r,o={type:t,message:e.message||`Age of applicant must be older than ${r}.`};return i.setFullYear(s),n>i?o:null}function lE(e,t){let n=new Date(e.field.value),r=Number.parseInt(e.field.dataset.validateMaxAge.valueOf()),i=new Date,s=i.getFullYear()-r,o={type:t,message:e.message||`Age of applicant must be younger than ${r}.`};return i.setFullYear(s),n<i?o:null}function uE(e,t){var s;let n=new Date(e.field.value),r=((s=e.options)==null?void 0:s.minDate)||new Date,i={type:t,message:e.message||"The date entered is earlier than what is accepted."};return De(n)<De(r)?i:null}function dE(e,t){var s;let n=new Date(e.field.value),r=((s=e.options)==null?void 0:s.maxDate)||new Date,i={type:t,message:e.message||"The date entered is later than what is accepted."};return De(n)>De(r)?i:null}function hE(e,t){let n=e.field.value,r=e.field.dataset.validateMinYear,i={type:t,message:e.message||"The year supplied is earlier than what is accepted."};return n<r?i:null}function fE(e,t){let n=e.field.value,r=e.field.dataset.validateMaxYear,i={type:t,message:e.message||"The year supplied is later than what is accepted."};return n>r?i:null}
108function mE(e,t){let n=e.field.value.split("/"),r=De(new Date),i=e.options.minDate?e.options.minDate:De(new Date),s={type:t,message:e.message||"The month and year supplied are not valid."};return parseInt(n[0])===0?s:n[0].length===2&&parseInt(n[0])<13&&n[1].length===4&&parseInt(n[0])<i.getFullYear()+30?(r.setDate(1),r.setFullYear(parseInt(n[1])),r.setMonth(parseInt(n[0])-1),r.getFullYear()>i.getFullYear()||r.getFullYear()===i.getFullYear()&&r.getMonth()>=i.getMonth()?null:s):s}function pE(e,t,n,r){const i=nE(e);let s=De(new Date),o=De(new Date),a={type:n,message:r||"The month and year supplied are not valid."};return parseInt(i)===0?a:i.length===2&&parseInt(i)<13&&t.length===4&&parseInt(t)<o.getFullYear()+30?(s.setDate(1),s.setFullYear(parseInt(t)),s.setMonth(parseInt(i)-1),s.getFullYear()>o.getFullYear()||s.getFullYear()===o.getFullYear()&&s.getMonth()>=o.getMonth()?null:a):a}const gE=["/","-","(",")"," ","+","$",","];function fo(e,t,n){let r=e.field,i=e.field.dataset.mask.split(""),s=[],o=[],a=/[^0-9]/g;i.filter((c,l)=>{gE.indexOf(c)!==-1&&(o.push(l),s.push(i[l]))}),r.value.length>0&&(r.value=r.value.replace(a,""),o&&r.value.length>0&&o.forEach((c,l)=>{r.value.length>c&&(r.value=[r.value.slice(0,c),s[l],r.value.slice(c)].join(""))})),t&&(r.selectionEnd=t)}function bE(e,t){let r=e.field.value.matchAll(/(\d{13,19}|\d{4}([^a-zA-Z]|\s)\d{4,6}([^a-zA-Z]|\s)\d{4,5}([^a-zA-Z]|\s)\d{4,5}|\d{4}([^a-zA-Z]|\s)\d{4,6}([^a-zA-Z]|\s)\d{4,5})/g),i=[];r&&Array.from(r).forEach(o=>{const a=o[0].replace(/\D/g,"");dl(a)&&i.push(o[0])});const s={type:t,message:"<b>PII Warning: Credit card number found and removed.</b><br>If you feel that this was not PII (such as a number similar to a credit card), please inform #production-support."};return i&&i.forEach(o=>{e.field.value=e.field.value.replace(o,"")}),i.length>0?s:null}var vE=Object.getOwnPropertyDescriptor,yE=(e,t,n,r)=>{for(var i=r>1?void 0:r?vE(t,n):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(i=o(i)||i);return i};const EE=["input:not([type=hidden]):not([type=submit]):not(.hidden)","select:not(.sr-only):not(.hidden)","textarea:not(.sr-only):not(.hidden):not([hidden])"].toString();let mo=class extends xi{constructor(){super(...arguments),this.fields=[],this.pauseValidation=!1,this.callbacks={visibilityToggled:()=>{this.findFields()}}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),setTimeout(()=>{if(this.closest("form"))this.form=this.closest("form"),this.form.querySelector('[type="submit"]')?this.submit=this.form.querySelector('[type="submit"]'):this.submit=null;else return;this.form&&this.findFields(),this.form.querySelector(".checkbox--group")&&Mi(this.form).length===0&&(this.submit.disabled=!0)},5)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListeners()}findFields(){this.form&&(this.submit===null&&(this.form.querySelector('[type="submit"]')?this.submit=this.form.querySelector('[type="submit"]'):this.submit=null),this.fields=[],this.form.querySelectorAll(EE).forEac
108h((e,t)=>{if(this.fields.push({field:e,errors:[],valid:!1,options:{}}),e.setCustomValidity(""),(e.value&&e.type!=="radio"&&!e.dataset.validateCheckbox||e.dataset.validateCheckbox&&e.checked)&&(!this.isAutocomplete(e)||this.isAutocomplete(e)&&e.disabled===!0)&&(this.fields[t].valid=!0,this.fields[t].dirty=!0),e.dataset.skipValidation==="true"&&(this.fields[t].valid=!0,this.fields[t].dirty=!1),e.required&&e.value.length===0&&e.disabled===!1&&(this.fields[t].valid=!1),e.type==="radio"){let n=ul(this.form,e);e.required&&e.type==="radio"&&e.checked===!1&&!n?this.fields[t].valid=!1:this.fields[t].valid=!0}(!e.required&&e.value.length===0||e.disabled===!0)&&(this.fields[t].valid=!0)}),this.closest("details")||(this.fields=this.fields.filter(e=>e.field.getClientRects().length!==0)),this.runPreValidation(),this.initiateComponentEventListeners(),this.fields.filter(e=>e.dirty).length>0?this.verifyFieldValidity():this.verifyValidity(),this.validationReadyEvent=new CustomEvent("kin-form-validation:ready",{bubbles:!0,detail:{validationElement:this}}),this.dispatchEvent(this.validationReadyEvent))}initiateComponentEventListeners(){if(this.form&&this.form.addEventListener("kin-form-validation:triggerRefresh",()=>this.triggerRefresh()),this.form&&this.fields){let e=this.fields.filter(i=>i.field.closest("kin-autocomplete, kin-remote-autocomplete")),t=this.fields.filter(i=>i.field.closest("kin-date-input-mask"));e.forEach(i=>{i.customValidator=!0,i.field.disabled&&(i.valid=!0),this.form.addEventListener("kin-autocomplete:change",s=>{i.dirty=!0,i.field.id.includes(s.detail.id)&&this.handleAutocompleteField(i,s)})}),t.forEach(i=>{document.addEventListener("kin-datepicker:change",s=>{i.field.id.includes(s.detail.id)&&(i.dirty=!0,this.handleDirtyField(i))})}),!!this.form.querySelector("kin-dialog")&&(this.form.addEventListener("kin-dialog-show",this.callbacks.visibilityToggled),this.form.addEventListener("kin-dialog-hide",this.callbacks.visibilityToggled));const r=this.form.closest("kin-tabs");r&&r.addEventListener("kin-tabs-select",this.callbacks.visibilityToggled)}this.initiateEventListeners()}initiateEventListeners(){this.submit&&(this.submit.addEventListener("click",e=>this.handleOnSubmit(e)),this.form.addEventListener("keydown",e=>{e.key&&e.key==="Enter"&&this.handleOnSubmit(e)})),this.fields.forEach(e=>{e.customValidator||(e.field.addEventListener("invalid",t=>this.handleInvalid(e),!0),e.field.addEventListener("input",t=>this.handleInput(e,!0,t)),e.field.addEventListener("change",t=>this.handleDirtyField(e)),e.field.addEventListener("focus",t=>{e.dirty=!0},!0),e.field.dataset.validatePiiCompliance?e.field.addEventListener("blur",t=>this.handlePII(e)):e.field.addEventListener("blur",t=>this.handleDirtyField(e)),this.form.querySelector(".checkbox--group")&&this.form.querySelector(".checkbox--group").querySelectorAll('input[type="checkbox"]').forEach(r=>{r.addEventListener("change",i=>this.handleCheckboxGroup(r))}))})}removeComponentEventListeners(){if(this.form&&(this.form.removeEventListener("kin-form-validation:triggerRefresh",()=>this.triggerRefresh()),this.form.removeEventListener("keydown",e=>{e.key&&e.key==="Enter"&&this.handleOnSubmit(e)})),this.form&&this.fields){let e=this.fields.filter(i=>i.field.closest("kin-autocomplete, kin-remote-autocomplete")),t=this.fields.filter(i=>i.field.closest("kin-date-input-mask"));e.forEach(i=>{this.form.removeEventListener("kin-autocomplete:change",s=>{i.dirty=!0,i.field.id.includes(s.detail.id)&&this.handleAutocompleteField(i,s)})}),t.forEach(i=>{document.removeEventListener("kin-datepicker:change",s=>{i.field.id.includes(s.detail.id)&&(i.dirty=!0,this.handleDirtyField(i))})}),!!this.form.querySelector("kin-dialog")&&(this.form.removeEventListener("kin-dialog-show",this.callbacks.visibilityToggled),this.form.removeEventListener("kin-dialog-hide",this.callbacks.visibilityToggled));const r=this.form.closest("kin-tabs");r&&r.removeEventListener("kin-tabs-select",this.callbacks.visibilityToggled)}}removeEventListeners(){this.removeComponentEventListeners(),this.submit&&this.submit.removeEventListener("click",e=>
108this.handleOnSubmit(e)),this.fields.forEach(e=>{e.customValidator||(e.field.removeEventListener("change",t=>this.handleDirtyField(e)),e.field.removeEventListener("invalid",t=>this.handleInvalid(e),!0),e.field.removeEventListener("input",t=>this.handleInput(e,!0,t)),e.field.dataset.validatePiiCompliance?e.field.removeEventListener("blur",t=>this.handlePII(e)):e.field.removeEventListener("blur",t=>this.handleDirtyField(e)),e.field.removeEventListener("focus",t=>{e.dirty=!0},!0))})}verifyValidity(){this.pauseValidation||(this.submit!==null&&(this.valid?(this.clearFormErrors(),this.submit.disabled=!1):this.submit.disabled=!0),this.valid!==null&&(this.onChangeEvent=new CustomEvent("kin-form-validation:change",{bubbles:!0,detail:{fields:this.fields,form:{valid:this.valid,element:this.form,validationElement:this}}}),this.dispatchEvent(this.onChangeEvent)))}runPreValidation(){this.fields.forEach(e=>{if(e.field.type==="tel"){let n=e.field;n.minLength=14,n.maxLength=14,n.inputMode="tel",e.options.noAlpha=!0,n.placeholder="(000) 000-0000",n.value=e.field.value.replace("+1 ",""),n.value=e.field.value.replace("+1",""),this.handleMasking(e)}if((e.field.dataset.validateMinAge||e.field.dataset.validateMaxAge)&&(e.field.autocomplete="bday"),e.field.dataset.validateCreditCard&&(e.field.autocomplete="cc-number"),e.field.type==="date"||e.field.dataset.validateDate||e.field.dataset.validateMinAge||e.field.dataset.validateMaxAge||e.field.dataset.validateMaxDate||e.field.dataset.validationRange){let n=e.field;n.inputMode="decimal"}this.isAutocomplete(e.field)&&this.handleAutocompleteField(e),e.field.dataset.validateCurrency})}verifyFieldValidity(){this.pauseValidation||(this.fields.forEach(e=>{e.field.dataset.validatePiiCompliance&&this.handlePII(e),this.handleBlur(e),this.handleInput(e,!1),(e.field.type==="text"||!0)&&e.field.minLength>0&&e.field.required&&!this.isDatepicker(e.field)&&(!this.form.dataset.validateOnInteraction||e.dirty)&&this.handleValidation(e,"MinimumLengthError",ln)}),this.submit&&this.verifyValidity())}handleOnSubmit(e){this.pauseValidation||(e.isTrusted&&this.verifyFieldValidity(),this.valid||(e.stopPropagation(),e.preventDefault(),setTimeout(()=>this.displayGlobalError("<b>The form is not valid. Please try again.</b>"),200)))}handleInvalid(e){e.field.setCustomValidity(""),e.dirty=!0,this.handleInput(e),this.handleBlur(e)}handleCheckboxGroup(e){this.isCheckboxGroup(e)&&(Mi(e.form).length>0?this.submit.disabled=!1:(Xy(e.form,"CheckboxRequiredError"),this.submit.disabled=!0))}handleAutocompleteField(e,t){if(this.isAutocomplete(e.field))if(t){let n=`${t.detail.id}__input`;if(t.detail&&n===e.field.id){this.handleDirtyField(e),this.verifyFieldValidity();return}}else{let n=e.field.closest("kin-autocomplete, kin-remote-autocomplete");if(n.consideredValid){e.valid=!0,e.dirty=!1,this.verifyFieldValidity();return}else n.skipValidation||this.handleDirtyField(e)}}handleCurrency(e){let t=e.field.selectionStart,n=Number(e.field.dataset.validateCurrencyDigits)||2;e.field.value.length!==0&&e.field.value.lastIndexOf(".")!==e.field.value.length-1&&(e.field.value=Number(e.field.value.replace(/[^0-9.]/g,"")).toLocaleString("en-US",{style:"currency",currency:"USD",minimumFractionDigits:0,maximumFractionDigits:n}),t!==e.field.value.length-1&&(e.field.selectionEnd=t))}handleDirtyField(e,t){if(!this.pauseValidation){if(e.externalValidity&&e.field.dataset.mask&&this.handleMasking(e),e.field.dataset.validatePiiCompliance&&this.handlePII(e),e.dirty){e.field.type,e.field.required&&e.field.minLength&&e.field.value.length<=e.field.minLength&&this.handleValidation(e,"MinimumLengthError",ln),e.field.required&&e.field.maxLength&&e.field.value.length>=e.field.maxLength&&this.handleValidation(e,"MaximumLengthError",ln),e.field&&e.field.type==="radio"&&e.field.required===!0&&this.handleValidation(e,"RadioButtonRequiredError",Yy),this.handleBlur(e),this.handleInput(e,!1);return}!e.dirty&&e.field.required&&e.field.value.length===0&&this.submit!==null&&(this.submit.disabled=!0),this.handleBlur(e),e.dirty=!0,this.handleInput(e,!1)}}handleBlur(e){e.field.type==="email"&&this.handleValidation(e,"InvalidEmailError",ao),e.field.id==="vin"&&this.handleValidation(e,"InvalidVinError",Ky)}handleMasking(e){e.field.selectionStart!==e.field.value.length?fo(e,e.field.selectionStart):fo(e,null)}handlePII(e){let t=bE(e,"PIICreditCardError");t&&this.displayGlobalError(t.message,"warning")}
108handleInput(e,t=!0,n){if(!(!e.dirty&&!e.field.dataset.validateOnInput||e.field.type==="checkbox"&&!e.field.dataset.validateCheckbox||e.externalValidity||e.field.dataset.skipValidation==="true"||this.pauseValidation)){if(this.clearGlobalError(),t&&(e.errors=[]),e.field.dataset.validationMessage?e.message=e.field.dataset.validationMessage:e.message="",e.field.required&&this.handleValidation(e,"EmptyRequiredFieldError",co),e.field.type==="checkbox"&&e.field.dataset.validateCheckbox){let r="RequiredCheckboxError",i={type:r,message:"To continue, you need to agree."};e.field.checked?this.handleSuccess(e,r):this.handleError(e,i)}if(e.field instanceof HTMLInputElement&&e.field.value.length>0&&(e.field.pattern&&this.handleValidation(e,"InputPatternError",jy),e.field.dataset.validateOnInput&&e.field.dataset.validateOnInput==="email"&&this.handleValidation(e,"InvalidEmailError",ao),(e.field.max||e.field.min)&&this.handleValidation(e,"MinMaxError",Zy),e.field.type==="tel"&&(e.options.mask="(000) 000-0000",this.handleMasking(e),e.field.value.length===14&&this.handleValidation(e,"InvalidTelephoneError",eE))),e.field instanceof(HTMLInputElement||HTMLTextAreaElement)&&e.field.value.length>0){if(e.field.dataset.mask&&e.field.type!=="tel"&&(e.options.mask=e.field.dataset.mask,this.handleMasking(e)),e.field.dataset.validateCurrency,e.field.dataset.validateCompareField){let s="FieldMatchError",o=this.fields.find(c=>c.field.id===e.field.dataset.validateCompareField),a=uo(e,o,s);a?this.handleError(e,a):this.handleSuccess(e,s)}const r=this.fields.find(s=>s.field.dataset.validateCompareField===e.field.id);if(r&&r.dirty){let s="FieldMatchError",o=uo(r,e,s);o?this.handleError(r,o):this.handleSuccess(r,s),this.handleErrorState(r)}if((e.field.type==="date"||e.field.dataset.validateDate||e.field.dataset.validateMinAge||e.field.dataset.validateMaxAge||e.field.dataset.validateMaxDate||e.field.dataset.validationRange||e.field.dataset.validateDateNotDisallowedDate)&&(e.field.maxLength=10,e.field.minLength=10,new Date(e.field.value)instanceof Date&&e.field.value.length===10&&this.handleValidation(e,"InvalidDateError",sE)),e.field.dataset.validateMinAge&&new Date(e.field.value)instanceof Date&&e.field.value.length===10&&this.handleValidation(e,"MinimumAgeError",cE),e.field.dataset.validateMaxAge&&new Date(e.field.value)instanceof Date&&e.field.value.length===10&&this.handleValidation(e,"MaximumAgeError",lE),e.field.dataset.validateMinDate&&!e.field.dataset.validateRange&&new Date(e.field.value)instanceof Date&&e.field.value.length===10&&(e.options.minDate=new Date(e.field.dataset.validateMinDate),this.handleValidation(e,"MinDateError",uE)),e.field.dataset.validateMaxDate&&!e.field.dataset.validateRange&&new Date(e.field.value)instanceof Date&&e.field.value.length===10&&(e.options.maxDate=new Date(e.field.dataset.validateMaxDate),this.handleValidation(e,"MaxDateError",dE)),e.field.dataset.validateMinYear&&new Date(e.field.value)instanceof Date&&e.field.value.length===4&&this.handleValidation(e,"MinimumYearError",hE),e.field.dataset.validateMaxYear&&new Date(e.field.value)instanceof Date&&e.field.value.length===4&&this.handleValidation(e,"MaximumYearError",fE),e.field.dataset.validateRange&&e.field.value.length===10&&(e.options.minDate=new Date(e.field.dataset.validateMinDate.replace(/[^ -~]/g,"")),e.options.maxDate=new Date(e.field.dataset.validateMaxDate.replace(/[^ -~]/g,"")),this.handleValidation(e,"DateRangeError",oE)),e.field.dataset.validateNotDisallowedDate&&e.field.value.length===10){let s;try{s=JSON.parse(e.field.dataset.validateDisallowedDates)}catch{return}e.options.disallowedDatesParsed=rE(s),this.handleValidation(e,"DateDisallowedError",aE)}if(e.field.dataset.validateCreditCard){const s=this.fields.find(o=>o.field.dataset.validateSecurityCode);e.field.value.startsWith("34")||e.field.value.startsWith("37")?(e.field.dataset.mask="0000 000000 00000",e.field.maxLength=17,e.field.value.length===17&&this.handleValidation(e,"CreditCardValidityError",lo),s&&(s.field.maxLength=4,s.field.minLength=4,s.field.value&&s.dirty&&this.handleDirtyField(s))):(e.field.dataset.mask="0000 0000 0000 0000",e.field.maxLength=19,e.field.value.length===19&&this.handleValidation(e,"CreditCardValidityError",lo),s&&(s.field.minLength=3,s.field.maxLength=3,s.field.value&&s.dirty&&this.handleDirtyField(s)))}if(e.field.dataset.validateMinMonthYear&&(e.field.minLength=7,e.field.maxLength=7,e.options.minDate=De(new Date(e.field.dataset.validateMinMonthYear)),e.options.minDate.setDate(1),e.field.value.length===7?(e.field.dataset.minMonthYearValidationMessage&&(e.message=e.field.dataset.minMonthYearValidationMessage),this.handleValidation(e,"MinMonthYearError",mE)):(e.field.dataset.inputLengthValidationMessage&&(e.message=e.field.dataset.inputLengthValidationMessage),this.handleValidation(e,"MinimumLengthError",ln))),e.field.dataset.validateTextAsNumeric&&this.handleValidation(e,"NaNError",tE),e.field.dataset.validateNumericRangeMin){let s=e.field.dataset.validateNumericRangeMin.length;e.field.value.length>=s&&this.handleValidation(e,"NumericValueMinError",Jy)}if(e.field.dataset.validateNumericRangeMax){let s=e.field.dataset.validateNumericRangeMax.length;e.field.value.length>=s&&this.handleValidation(e,"NumericValueMaxError",Qy)}(e.field.type==="text"||!0)&&e.field.minLength&&e.field.dataset.validateStrict&&this.handleValidation(e,"MinimumLengthError",ln)}if(e.field.dataset.requiredNonEmptyGroup){const r=e.field.dataset.requiredNonEmptyGroup,i=this.fields.filter(a=>a.field.dataset.requiredNonEmptyGroup===r),s="RequiredNonEmptyGroupError";let o={type:s,message:e.field.dataset.requiredNonEmptyGroupMessage||"At least one of these fields is required."};
108i.forEach(a=>{o=co(a,s)&&o}),o?i.forEach(a=>this.handleError(a,o)):i.forEach(a=>this.handleSuccess(a,s)),i.forEach(a=>this.handleErrorState(a))}if(e.field instanceof HTMLSelectElement&&e.field.value.length>0&&e.field.dataset.validateMonthYearSet){const r=e.field.dataset.validateMonthYearSet,i=this.fields.filter(c=>c.field.dataset.validateMonthYearSet===r),s=i.find(c=>c.field.dataset.validateMonthYearSetType==="month"),o=i.find(c=>c.field.dataset.validateMonthYearSetType==="year"),a=s.field.dataset.validateMonthYearSetMessage||o.field.dataset.validateMonthYearSetMessage;if(s.dirty&&o.dirty){const c=pE(s.field.value,o.field.value,"MinMonthYearSetError",a);c?[s,o].forEach(l=>{this.handleError(l,c)}):[s,o].forEach(l=>{this.handleSuccess(l,"MinMonthYearSetError")}),[s,o].forEach(l=>{this.handleErrorState(l)})}}}}handleValidation(e,t,n){let r=n(e,t);r?this.handleError(e,r):this.handleSuccess(e,t),this.handleErrorState(e)}handleError(e,t){e.errors.find(n=>n.type===t.type)||(e.valid=!1,e.errors.push(t)),this.verifyValidity()}handleSuccess(e,t){e.valid=!0,t&&(e.errors=e.errors.filter(n=>n.type!==t)),this.verifyValidity()}triggerRefresh(){this.removeEventListeners(),this.findFields(),this.verifyFieldValidity()}triggerFieldRefresh(e){if(!e)return;let t=this.fields.find(n=>n.field.id===e);this.handleDirtyField(t)}disableForm(){setTimeout(()=>{this.fields.forEach(e=>{e.field.disabled===!1&&(e.field.disabled=!0,e.options.disabledByUser=!0)}),this.submit.disabled=!0})}enableForm(){setTimeout(()=>{this.fields.forEach(e=>{e.options.disabledByUser&&(e.field.disabled=!1),e.options.disabledByUser=null}),this.submit.disabled=!1})}disableSubmit(e){this.submit.disabled=!0,this.pauseValidation=!0,e&&(this.displayGlobalError(e),super.requestUpdate())}enableSubmit(){this.pauseValidation=!1,this.submit.disabled=!1,this.verifyValidity(),this.form.querySelectorAll("[data-form-validation-error]").forEach(e=>e.remove()),super.requestUpdate()}get valid(){return!this.fields.find(e=>e.valid===!1)}throwError(e,t,n){let r=this.fields.find(i=>i.field.id===e);r&&t&&(r.errors=r.errors.filter(i=>i.type!==t.type),r.valid=!1,r.externalValidity=!0,r.errors.push(t),this.handleError(r,t),this.handleErrorState(r,!1,n))}clearError(e,t){let n=this.fields.find(r=>r.field.id===e);n&&(n.valid=!0,n.errors=[],n.externalValidity=!1,this.handleSuccess(n),this.handleErrorState(n,!1,t))}displayGlobalError(e,t="error"){this.form.querySelectorAll("[data-form-validation-error]").forEach(r=>r.remove()),this.globalError=document.createElement("div"),this.globalError.setAttribute("role","alert"),t==="error"?this.globalError.classList.add("alert","alert--error"):t==="warning"&&this.globalError.classList.add("alert","alert--general"),this.globalError.dataset.formValidationError="true";let n=document.createElement("span");n.innerHTML=e,n.classList.add("alert__content","vr"),this.globalError.appendChild(n),this.fields.length>0&&(this.fields[0].field.closest(".k-modal__content__body")?this.fields[0].field.closest(".k-modal__content__body").prepend(this.globalError):this.form.prepend(this.globalError))}clearFormErrors(){this.fields.forEach(e=>this.handleErrorState(e,!0))}clearGlobalError(){this.form.querySelectorAll("[data-form-validation-error]").forEach(e=>e.remove())}handleErrorState(e,t=!1,n){let r=null;if(n?r=this.form.querySelector(n):r=e.field.parentElement,e.errors.length>0){e.valid=!1,r!==null&&(r.classList.add("is-error"),r.classList.add("error-spacing"),r.classList.add(`${e.field.tagName.toLowerCase()}--invalid`));let i=document.createElement("span");if(i.classList.add("errors"),i.id=e.field.id+"__errors",i.setAttribute("aria-live","polite"),r!==null&&r.querySelector(".errors")){let o=r.querySelector(".errors");r.removeChild(o),r.appendChild(i)}else r.appendChild(i);let s=document.createElement("span");s.classList.add("errors-1"),s.textContent=e.errors[0].message,e.field.setAttribute("aria-describedby",i.id),i.appendChild(s)}else e.valid=!0,e.field.setAttribute("aria-describedby",""),e.field.type==="radio"&&Array.from(this.form.querySelectorAll(`[name="${e.field.name}
108"]`)).forEach(i=>{let s=this.fields.find(o=>o.field===i);s.valid=!0});e.valid&&r!==null&&(r.querySelector(".errors")&&r.querySelector(".errors").remove(),r.classList.remove("is-error"),r.classList.remove("error-spacing"),r.classList.remove(`${e.field.tagName.toLowerCase()}--invalid`)),t||this.verifyValidity()}isAutocomplete(e){return!!(e.closest("kin-autocomplete")||e.closest("kin-remote-autocomplete"))}isDatepicker(e){return!!e.closest("kin-date-input-mask")}isCheckboxGroup(e){return!!e.closest(".checkbox--group")}};mo=yE([po("kin-form-validation")],mo);export{qn as $,rs as A,AE as B,hi as C,mm as D,Ap as E,I as F,Qp as G,as as H,Za as I,NE as J,ME as K,xE as L,PE as M,N,Of as O,mg as P,pe as Q,x as R,sg as S,Uy as T,ee as U,ne as V,Br as W,Bn as X,oc as Y,jt as Z,zi as _,Dc as a,Un as a0,Yi as a1,Xa as a2,yd as a3,yt as a4,F as a5,Q as a6,ye as a7,ft as a8,L as a9,va as aa,Mr as ab,Nr as b,Ye as c,Gb as d,OE as e,$ as f,os as g,jb as h,DE as i,_e as j,Pr as k,kE as l,qp as m,U as n,TE as o,LE as p,yg as q,vg as r,Bc as s,J as t,IE as u,Yo as v,RE as w,Jp as x,CE as y,G as z}; 109//# sourceMappingURL=form-validation-CVQXXMlu.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.