@lucida-analytics/browser 0.1.12 → 0.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/{client-C9F2fWI4.d.ts → client-fHMBaIXD.d.ts} +1 -1
  3. package/dist/consent.d.ts +4 -0
  4. package/dist/consent.js +1 -1
  5. package/dist/core.d.ts +1 -1
  6. package/dist/core.js +1 -1
  7. package/dist/index.d.ts +1 -1
  8. package/dist/index.js +1 -1
  9. package/dist/lucida.js +1 -1
  10. package/dist/{recorder-AJ7XX7OZ.js → recorder-MHNUIAAP.js} +1 -1
  11. package/dist/replay.js +1 -1
  12. package/dist/static/v0/consent.js +1 -1
  13. package/dist/static/v0/core.js +1 -1
  14. package/dist/static/v0/index.js +1 -1
  15. package/dist/static/v0/lucida.js +1 -1
  16. package/dist/static/v0/manifest.json +7 -7
  17. package/dist/static/{v0.1.12/recorder-AJ7XX7OZ.js → v0/recorder-MHNUIAAP.js} +1 -1
  18. package/dist/static/v0/replay.js +1 -1
  19. package/dist/static/v0.1.13/consent.js +1 -0
  20. package/dist/static/{v0.1.12 → v0.1.13}/core.js +1 -1
  21. package/dist/static/v0.1.13/index.js +3 -0
  22. package/dist/static/v0.1.13/lucida.js +3 -0
  23. package/dist/static/{v0.1.12 → v0.1.13}/manifest.json +7 -7
  24. package/dist/static/{v0/recorder-AJ7XX7OZ.js → v0.1.13/recorder-MHNUIAAP.js} +1 -1
  25. package/dist/static/{v0.1.12 → v0.1.13}/replay.js +1 -1
  26. package/package.json +1 -1
  27. package/storage.json +1 -1
  28. package/dist/static/v0.1.12/consent.js +0 -1
  29. package/dist/static/v0.1.12/index.js +0 -3
  30. package/dist/static/v0.1.12/lucida.js +0 -3
  31. /package/dist/static/{v0.1.12 → v0.1.13}/autocapture.js +0 -0
  32. /package/dist/static/{v0.1.12 → v0.1.13}/banner-TXLAMTQM.js +0 -0
  33. /package/dist/static/{v0.1.12 → v0.1.13}/chunk-AWIQCFGN.js +0 -0
  34. /package/dist/static/{v0.1.12 → v0.1.13}/chunk-B722OERZ.js +0 -0
  35. /package/dist/static/{v0.1.12 → v0.1.13}/chunk-EFNCQJI3.js +0 -0
  36. /package/dist/static/{v0.1.12 → v0.1.13}/chunk-IXDYCBAD.js +0 -0
  37. /package/dist/static/{v0.1.12 → v0.1.13}/chunk-UPPUYIIH.js +0 -0
  38. /package/dist/static/{v0.1.12 → v0.1.13}/correlate.js +0 -0
  39. /package/dist/static/{v0.1.12 → v0.1.13}/early-access.js +0 -0
  40. /package/dist/static/{v0.1.12 → v0.1.13}/experiments.js +0 -0
  41. /package/dist/static/{v0.1.12 → v0.1.13}/flags.js +0 -0
  42. /package/dist/static/{v0.1.12 → v0.1.13}/forms.js +0 -0
  43. /package/dist/static/{v0.1.12 → v0.1.13}/guides.js +0 -0
  44. /package/dist/static/{v0.1.12 → v0.1.13}/heatmaps.js +0 -0
  45. /package/dist/static/{v0.1.12 → v0.1.13}/host-headers.js +0 -0
  46. /package/dist/static/{v0.1.12 → v0.1.13}/inspector.js +0 -0
  47. /package/dist/static/{v0.1.12 → v0.1.13}/modules-FANMZRDJ.js +0 -0
  48. /package/dist/static/{v0.1.12 → v0.1.13}/persistent-G2OR2L2N.js +0 -0
  49. /package/dist/static/{v0.1.12 → v0.1.13}/recommendations.js +0 -0
  50. /package/dist/static/{v0.1.12 → v0.1.13}/toolbar.js +0 -0
  51. /package/dist/static/{v0.1.12 → v0.1.13}/validation-S6TYVWAI.js +0 -0
  52. /package/dist/static/{v0.1.12 → v0.1.13}/webmcp.js +0 -0
@@ -75,5 +75,5 @@ or you can use record.mirror to access the mirror instance during recording.`,mr
75
75
  };
76
76
  })();
77
77
  //# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map
78
- `,Cr=typeof self<"u"&&self.Blob&&new Blob([Zr],{type:"text/javascript;charset=utf-8"});function fi(e){let t;try{if(t=Cr&&(self.URL||self.webkitURL).createObjectURL(Cr),!t)throw"";let r=new Worker(t,{name:e?.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),r}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(Zr),{name:e?.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var Ut=class{constructor(t){v(this,"pendingCanvasMutations",new Map),v(this,"rafStamps",{latestId:0,invokeId:null}),v(this,"mirror"),v(this,"mutationCb"),v(this,"resetObservers"),v(this,"frozen",!1),v(this,"locked",!1),v(this,"processMutation",(l,c)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(c)});let{sampling:r="all",win:n,blockClass:o,blockSelector:i,recordCanvas:s,dataURLOptions:a}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&r==="all"&&this.initCanvasMutationObserver(n,o,i),s&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,o,i,{dataURLOptions:a})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,n,o,i){let s=br(r,n,o,!0),a=new Map,l=new fi;l.onmessage=m=>{let{id:f}=m.data;if(a.set(f,!1),!("base64"in m.data))return;let{base64:y,type:S,width:w,height:g}=m.data;this.mutationCb({id:f,type:Ue["2D"],commands:[{property:"clearRect",args:[0,0,w,g]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:y}],type:S}]},0,0]}]})};let c=1e3/t,u=0,p,d=()=>{let m=[];return r.document.querySelectorAll("canvas").forEach(f=>{le(f,n,o,!0)||m.push(f)}),m},h=m=>{if(u&&m-u<c){p=requestAnimationFrame(h);return}u=m,d().forEach(async f=>{var y;let S=this.mirror.getId(f);if(a.get(S)||f.width===0||f.height===0)return;if(a.set(S,!0),["webgl","webgl2"].includes(f.__context)){let g=f.getContext(f.__context);((y=g?.getContextAttributes())==null?void 0:y.preserveDrawingBuffer)===!1&&g.clear(g.COLOR_BUFFER_BIT)}let w=await createImageBitmap(f);l.postMessage({id:S,bitmap:w,width:f.width,height:f.height,dataURLOptions:i.dataURLOptions},[w])}),p=requestAnimationFrame(h)};p=requestAnimationFrame(h),this.resetObservers=()=>{s(),cancelAnimationFrame(p)}}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let o=br(t,r,n,!1),i=li(this.processMutation.bind(this),t,r,n),s=ci(this.processMutation.bind(this),t,r,n);this.resetObservers=()=>{o(),i(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{let n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;let n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;let o=n.map(s=>{let{type:a,...l}=s;return l}),{type:i}=n[0];this.mutationCb({id:r,type:i,commands:o}),this.pendingCanvasMutations.delete(t)}},$t=class{constructor(t){v(this,"trackedLinkElements",new WeakSet),v(this,"mutationCb"),v(this,"adoptedStyleSheetCb"),v(this,"styleMirror",new At),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,r){if(t.length===0)return;let n={id:r,styleIds:[]},o=[];for(let i of t){let s;this.styleMirror.has(i)?s=this.styleMirror.getId(i):(s=this.styleMirror.add(i),o.push({styleId:s,rules:Array.from(i.rules||CSSRule,(a,l)=>({rule:xr(a,i.href),index:l}))})),n.styleIds.push(s)}o.length>0&&(n.styles=o),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}},Bt=class{constructor(){v(this,"nodeMap",new WeakMap),v(this,"active",!1)}inOtherBuffer(t,r){let n=this.nodeMap.get(t);return n&&Array.from(n).some(o=>o!==r)}add(t,r){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(r))}destroy(){}},q,ct,xe,Ke=!1;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=((lr=e.contentWindow)==null?void 0:lr.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var ge=fo();function ue(e={}){let{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:o="rr-block",blockSelector:i=null,ignoreClass:s="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=!0,maskAllInputs:p,maskInputOptions:d,slimDOMOptions:h,maskInputFn:m,maskTextFn:f,hooks:y,packFn:S,sampling:w={},dataURLOptions:g={},mousemoveWait:b,recordDOM:k=!0,recordCanvas:R=!1,recordCrossOriginIframes:E=!1,recordAfter:I=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:x=!1,collectFonts:P=!1,inlineImages:H=!1,plugins:U,keepIframeSrcFn:T=()=>!1,ignoreCSSAttributes:X=new Set([]),errorHandler:K}=e;Go(K);let N=E?window.parent===window:!0,F=!1;if(!N)try{window.parent.document&&(F=!1)}catch{F=!0}if(N&&!t)throw new Error("emit function is required");if(!N&&!F)return()=>{};b!==void 0&&w.mousemove===void 0&&(w.mousemove=b),ge.reset();let W=p===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:d!==void 0?d:{password:!0},G=Ar(h);$o();let de,ne=0,ye=D=>{for(let Y of U||[])Y.eventProcessor&&(D=Y.eventProcessor(D));return S&&!F&&(D=S(D)),D};q=(D,Y)=>{let O=D;if(O.timestamp=Xe(),O.type!==L.FullSnapshot&&!(O.type===L.IncrementalSnapshot&&O.data.source===A.Mutation)){xe.unfreeze();for(let V of Pe)if(V.isFrozen())V.unfreeze();else break}if(N)t?.(ye(O),Y);else if(F){let V={type:"rrweb",event:ye(O),origin:window.location.origin,isCheckout:Y};window.parent.postMessage(V,"*")}if(O.type===L.FullSnapshot)de=O,ne=0;else if(O.type===L.IncrementalSnapshot){if(O.data.source===A.Mutation&&O.data.isAttachIframe)return;ne++;let V=n&&ne>=n,ae=r&&O.timestamp-de.timestamp>r;(V||ae)&&ct(!0)}};let te=D=>{q({type:L.IncrementalSnapshot,data:{source:A.Mutation,...D}})},oe=D=>q({type:L.IncrementalSnapshot,data:{source:A.Scroll,...D}}),j=D=>q({type:L.IncrementalSnapshot,data:{source:A.CanvasMutation,...D}}),ve=D=>q({type:L.IncrementalSnapshot,data:{source:A.AdoptedStyleSheet,...D}}),me=new $t({mutationCb:te,adoptedStyleSheetCb:ve}),ie=new zt({mirror:ge,mutationCb:te,stylesheetManager:me,recordCrossOriginIframes:E,wrappedEmit:q});for(let D of U||[])D.getMirror&&D.getMirror({nodeMirror:ge,crossOriginIframeMirror:ie.crossOriginIframeMirror,crossOriginIframeStyleMirror:ie.crossOriginIframeStyleMirror});let we=new Bt;xe=new Ut({recordCanvas:R,mutationCb:j,win:window,blockClass:o,blockSelector:i,mirror:ge,sampling:w.canvas,dataURLOptions:g});let se=new Pt({mutationCb:te,scrollCb:oe,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:W,dataURLOptions:g,maskTextFn:f,maskInputFn:m,recordCanvas:R,inlineImages:H,sampling:w,slimDOMOptions:G,iframeManager:ie,stylesheetManager:me,canvasManager:xe,keepIframeSrcFn:T,processedNodeManager:we},mirror:ge});ct=(D=!1)=>{if(!k)return;q({type:L.Meta,data:{href:window.location.href,width:Fr(),height:_r()}},D),me.reset(),se.init(),xe.lock(),Pe.forEach(O=>O.lock());let Y=Po(document,{mirror:ge,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:W,maskTextFn:f,maskInputFn:m,slimDOM:G,dataURLOptions:g,recordCanvas:R,inlineImages:H,onSerialize:O=>{Ur(O,ge)&&ie.addIframe(O),$r(O,ge)&&me.trackLinkElement(O),Lt(O)&&se.addShadowRoot(M.shadowRoot(O),document)},onIframeLoad:(O,V)=>{ie.attachIframe(O,V),se.observeAttachShadow(O)},onStylesheetLoad:(O,V)=>{me.attachLinkElement(O,V)},keepIframeSrcFn:T});if(!Y)return console.warn("Failed to snapshot the document");q({type:L.FullSnapshot,data:{node:Y,initialOffset:Dr(window)}},D),xe.unlock(),Pe.forEach(O=>O.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&me.adoptStyleSheets(document.adoptedStyleSheets,ge.getId(document))};try{let D=[],Y=ae=>{var J;return _(oi)({mutationCb:te,mousemoveCb:($,be)=>q({type:L.IncrementalSnapshot,data:{source:be,positions:$}}),mouseInteractionCb:$=>q({type:L.IncrementalSnapshot,data:{source:A.MouseInteraction,...$}}),scrollCb:oe,viewportResizeCb:$=>q({type:L.IncrementalSnapshot,data:{source:A.ViewportResize,...$}}),inputCb:$=>q({type:L.IncrementalSnapshot,data:{source:A.Input,...$}}),mediaInteractionCb:$=>q({type:L.IncrementalSnapshot,data:{source:A.MediaInteraction,...$}}),styleSheetRuleCb:$=>q({type:L.IncrementalSnapshot,data:{source:A.StyleSheetRule,...$}}),styleDeclarationCb:$=>q({type:L.IncrementalSnapshot,data:{source:A.StyleDeclaration,...$}}),canvasMutationCb:j,fontCb:$=>q({type:L.IncrementalSnapshot,data:{source:A.Font,...$}}),selectionCb:$=>{q({type:L.IncrementalSnapshot,data:{source:A.Selection,...$}})},customElementCb:$=>{q({type:L.IncrementalSnapshot,data:{source:A.CustomElement,...$}})},blockClass:o,ignoreClass:s,ignoreSelector:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:W,inlineStylesheet:u,sampling:w,recordDOM:k,recordCanvas:R,inlineImages:H,userTriggeredOnInput:x,collectFonts:P,doc:ae,maskInputFn:m,maskTextFn:f,keepIframeSrcFn:T,blockSelector:i,slimDOMOptions:G,dataURLOptions:g,mirror:ge,iframeManager:ie,stylesheetManager:me,shadowDomManager:se,processedNodeManager:we,canvasManager:xe,ignoreCSSAttributes:X,plugins:((J=U?.filter($=>$.observer))==null?void 0:J.map($=>({observer:$.observer,options:$.options,callback:be=>q({type:L.Plugin,data:{plugin:$.name,payload:be}})})))||[]},y)},O=new Map;ie.addLoadListener(ae=>{try{let J=ae.contentDocument;if(O.has(J))return;O.set(J,Y(J))}catch(J){console.warn(J)}}),ie.addUnloadListener(ae=>{let J=O.get(ae);J&&(O.delete(ae),J(),se.removeShadowRootsIn(ae),ge.removeNodeFromMap(ae))});let V=()=>{ct(),D.push(Y(document)),Ke=!0};return["interactive","complete"].includes(document.readyState)?V():(D.push(re("DOMContentLoaded",()=>{q({type:L.DomContentLoaded,data:{}}),I==="DOMContentLoaded"&&V()})),D.push(re("load",()=>{q({type:L.Load,data:{}}),I==="load"&&V()},window))),()=>{[...D,...O.values()].forEach(ae=>{try{ae()}catch(J){String(J).toLowerCase().includes("cross-origin")||console.warn(J)}}),O.clear(),ie.destroy(),we.destroy(),se.reset(),xe.reset(),Ke=!1,jo()}}catch(D){console.warn(D)}}ue.addCustomEvent=(e,t)=>{if(!Ke)throw new Error("please add custom event after start recording");q({type:L.Custom,data:{tag:e,payload:t}})};ue.addAnnotation=e=>{if(!Ke)throw new Error("please add annotation after recording started");q({type:L.Annotation,data:e})};ue.freezePage=()=>{xe.freeze(),Pe.forEach(e=>e.freeze())};ue.takeFullSnapshot=e=>{if(!Ke)throw new Error("please take full snapshot after start recording");ct(e)};ue.mirror=ge;var Kr=["gclid","gad_source","gclsrc","dclid","gbraid","wbraid","fbclid","igshid","msclkid","ttclid","li_fat_id","twclid","mc_cid","rdt_cid","epik","qclid","sccid","oppref","bfcid","irclid","_kx"];var Yr=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"];var di="<masked>",hi=["password","passwd","pwd","pass","token","access_token","refresh_token","id_token","secret","client_secret","api_key","apikey","key","auth","authorization","code","otp","email","ssn"];var pi=[/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,/^[0-9a-hjkmnp-tv-z]{26}$/i,/^\d{4,}$/,/^[0-9a-f]{16,}$/i,/^(?=.*\d)[a-z0-9_-]{20,}$/i],mi=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");function gi(e,t){let r=e;for(let n of t.pathRules??[])try{r=r.replace(typeof n.match=="string"?new RegExp(n.match):n.match,n.replace)}catch{}return t.maskPathIds?r.split("/").map(n=>pi.some(o=>o.test(n))?":id":n).join("/"):r}function Jr(e,t){let r=e;if(t.pathRules?.length||t.maskPathIds){let o=/^((?:[a-z][a-z0-9+.-]*:)?\/\/[^/?#]*)?([^?#]*)([\s\S]*)$/i.exec(r);o&&(r=(o[1]??"")+gi(o[2],t)+o[3])}let n=[...hi,...t.maskParams??[],...t.maskCampaignParams?[...Yr,...Kr]:[]];if(n.length){let o=r.indexOf("#"),i=o<0?r:r.slice(0,o),s=o<0?"":r.slice(o);r=i.replace(new RegExp(`([?&])(${n.map(mi).join("|")})=[^&]*`,"gi"),`$1$2=${di}`)+s}return t.stripHash&&(r=r.replace(/#.*$/,"")),r}var fe=Uint8Array,pe=Uint16Array,Zt=Int32Array,Kt=new fe([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,0,0,0]),Yt=new fe([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,0,0]),Qr=new fe([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),on=function(e,t){for(var r=new pe(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];for(var o=new Zt(r[30]),n=1;n<30;++n)for(var i=r[n];i<r[n+1];++i)o[i]=i-r[n]<<5|n;return{b:r,r:o}},sn=on(Kt,2),yi=sn.b,jt=sn.r;yi[28]=258,jt[258]=28;var an=on(Yt,0),ts=an.b,en=an.r,qt=new pe(32768);for(z=0;z<32768;++z)ke=(z&43690)>>1|(z&21845)<<1,ke=(ke&52428)>>2|(ke&13107)<<2,ke=(ke&61680)>>4|(ke&3855)<<4,qt[z]=((ke&65280)>>8|(ke&255)<<8)>>1;var ke,z,et=(function(e,t,r){for(var n=e.length,o=0,i=new pe(t);o<n;++o)e[o]&&++i[e[o]-1];var s=new pe(t);for(o=1;o<t;++o)s[o]=s[o-1]+i[o-1]<<1;var a;if(r){a=new pe(1<<t);var l=15-t;for(o=0;o<n;++o)if(e[o])for(var c=o<<4|e[o],u=t-e[o],p=s[e[o]-1]++<<u,d=p|(1<<u)-1;p<=d;++p)a[qt[p]>>l]=c}else for(a=new pe(n),o=0;o<n;++o)e[o]&&(a[o]=qt[s[e[o]-1]++]>>15-e[o]);return a}),Oe=new fe(288);for(z=0;z<144;++z)Oe[z]=8;var z;for(z=144;z<256;++z)Oe[z]=9;var z;for(z=256;z<280;++z)Oe[z]=7;var z;for(z=280;z<288;++z)Oe[z]=8;var z,bt=new fe(32);for(z=0;z<32;++z)bt[z]=5;var z,vi=et(Oe,9,0);var wi=et(bt,5,0);var ln=function(e){return(e+7)/8|0},un=function(e,t,r){return(t==null||t<0)&&(t=0),(r==null||r>e.length)&&(r=e.length),new fe(e.subarray(t,r))};var Me=function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8},Je=function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8,e[n+2]|=r>>16},Gt=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var o=r.length,i=r.slice();if(!o)return{t:fn,l:0};if(o==1){var s=new fe(r[0].s+1);return s[r[0].s]=1,{t:s,l:1}}r.sort(function(k,R){return k.f-R.f}),r.push({s:-1,f:25001});var a=r[0],l=r[1],c=0,u=1,p=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=o-1;)a=r[r[c].f<r[p].f?c++:p++],l=r[c!=u&&r[c].f<r[p].f?c++:p++],r[u++]={s:-1,f:a.f+l.f,l:a,r:l};for(var d=i[0].s,n=1;n<o;++n)i[n].s>d&&(d=i[n].s);var h=new pe(d+1),m=Vt(r[u-1],h,0);if(m>t){var n=0,f=0,y=m-t,S=1<<y;for(i.sort(function(R,E){return h[E.s]-h[R.s]||R.f-E.f});n<o;++n){var w=i[n].s;if(h[w]>t)f+=S-(1<<m-h[w]),h[w]=t;else break}for(f>>=y;f>0;){var g=i[n].s;h[g]<t?f-=1<<t-h[g]++-1:++n}for(;n>=0&&f;--n){var b=i[n].s;h[b]==t&&(--h[b],++f)}m=t}return{t:new fe(h),l:m}},Vt=function(e,t,r){return e.s==-1?Math.max(Vt(e.l,t,r+1),Vt(e.r,t,r+1)):t[e.s]=r},tn=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new pe(++t),n=0,o=e[0],i=1,s=function(l){r[n++]=l},a=1;a<=t;++a)if(e[a]==o&&a!=t)++i;else{if(!o&&i>2){for(;i>138;i-=138)s(32754);i>2&&(s(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(s(o),--i;i>6;i-=6)s(8304);i>2&&(s(i-3<<5|8208),i=0)}for(;i--;)s(o);i=1,o=e[a]}return{c:r.subarray(0,n),n:t}},Qe=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},cn=function(e,t,r){var n=r.length,o=ln(t+2);e[o]=n&255,e[o+1]=n>>8,e[o+2]=e[o]^255,e[o+3]=e[o+1]^255;for(var i=0;i<n;++i)e[o+i+4]=r[i];return(o+4+n)*8},rn=function(e,t,r,n,o,i,s,a,l,c,u){Me(t,u++,r),++o[256];for(var p=Gt(o,15),d=p.t,h=p.l,m=Gt(i,15),f=m.t,y=m.l,S=tn(d),w=S.c,g=S.n,b=tn(f),k=b.c,R=b.n,E=new pe(19),I=0;I<w.length;++I)++E[w[I]&31];for(var I=0;I<k.length;++I)++E[k[I]&31];for(var x=Gt(E,7),P=x.t,H=x.l,U=19;U>4&&!P[Qr[U-1]];--U);var T=c+5<<3,X=Qe(o,Oe)+Qe(i,bt)+s,K=Qe(o,d)+Qe(i,f)+s+14+3*U+Qe(E,P)+2*E[16]+3*E[17]+7*E[18];if(l>=0&&T<=X&&T<=K)return cn(t,u,e.subarray(l,l+c));var N,F,W,G;if(Me(t,u,1+(K<X)),u+=2,K<X){N=et(d,h,0),F=d,W=et(f,y,0),G=f;var de=et(P,H,0);Me(t,u,g-257),Me(t,u+5,R-1),Me(t,u+10,U-4),u+=14;for(var I=0;I<U;++I)Me(t,u+3*I,P[Qr[I]]);u+=3*U;for(var ne=[w,k],ye=0;ye<2;++ye)for(var te=ne[ye],I=0;I<te.length;++I){var oe=te[I]&31;Me(t,u,de[oe]),u+=P[oe],oe>15&&(Me(t,u,te[I]>>5&127),u+=te[I]>>12)}}else N=vi,F=Oe,W=wi,G=bt;for(var I=0;I<a;++I){var j=n[I];if(j>255){var oe=j>>18&31;Je(t,u,N[oe+257]),u+=F[oe+257],oe>7&&(Me(t,u,j>>23&31),u+=Kt[oe]);var ve=j&31;Je(t,u,W[ve]),u+=G[ve],ve>3&&(Je(t,u,j>>5&8191),u+=Yt[ve])}else Je(t,u,N[j]),u+=F[j]}return Je(t,u,N[256]),u+F[256]},bi=new Zt([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),fn=new fe(0),Si=function(e,t,r,n,o,i){var s=i.z||e.length,a=new fe(n+s+5*(1+Math.ceil(s/7e3))+o),l=a.subarray(n,a.length-o),c=i.l,u=(i.r||0)&7;if(t){u&&(l[0]=i.r>>3);for(var p=bi[t-1],d=p>>13,h=p&8191,m=(1<<r)-1,f=i.p||new pe(32768),y=i.h||new pe(m+1),S=Math.ceil(r/3),w=2*S,g=function(V){return(e[V]^e[V+1]<<S^e[V+2]<<w)&m},b=new Zt(25e3),k=new pe(288),R=new pe(32),E=0,I=0,x=i.i||0,P=0,H=i.w||0,U=0;x+2<s;++x){var T=g(x),X=x&32767,K=y[T];if(f[X]=K,y[T]=X,H<=x){var N=s-x;if((E>7e3||P>24576)&&(N>423||!c)){u=rn(e,l,0,b,k,R,I,P,U,x-U,u),P=E=I=0,U=x;for(var F=0;F<286;++F)k[F]=0;for(var F=0;F<30;++F)R[F]=0}var W=2,G=0,de=h,ne=X-K&32767;if(N>2&&T==g(x-ne))for(var ye=Math.min(d,N)-1,te=Math.min(32767,x),oe=Math.min(258,N);ne<=te&&--de&&X!=K;){if(e[x+W]==e[x+W-ne]){for(var j=0;j<oe&&e[x+j]==e[x+j-ne];++j);if(j>W){if(W=j,G=ne,j>ye)break;for(var ve=Math.min(ne,j-2),me=0,F=0;F<ve;++F){var ie=x-ne+F&32767,we=f[ie],se=ie-we&32767;se>me&&(me=se,K=ie)}}}X=K,K=f[X],ne+=X-K&32767}if(G){b[P++]=268435456|jt[W]<<18|en[G];var D=jt[W]&31,Y=en[G]&31;I+=Kt[D]+Yt[Y],++k[257+D],++R[Y],H=x+W,++E}else b[P++]=e[x],++k[e[x]]}}for(x=Math.max(x,H);x<s;++x)b[P++]=e[x],++k[e[x]];u=rn(e,l,c,b,k,R,I,P,U,x-U,u),c||(i.r=u&7|l[u/8|0]<<3,u-=7,i.h=y,i.p=f,i.i=x,i.w=H)}else{for(var x=i.w||0;x<s+c;x+=65535){var O=x+65535;O>=s&&(l[u/8|0]=c,O=s),u=cn(l,u+1,e.subarray(x,O))}i.i=s}return un(a,0,n+ln(u)+o)},Ci=(function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var r=t,n=9;--n;)r=(r&1&&-306674912)^r>>>1;e[t]=r}return e})(),ki=function(){var e=-1;return{p:function(t){for(var r=e,n=0;n<t.length;++n)r=Ci[r&255^t[n]]^r>>>8;e=r},d:function(){return~e}}};var Mi=function(e,t,r,n,o){if(!o&&(o={l:1},t.dictionary)){var i=t.dictionary.subarray(-32768),s=new fe(i.length+e.length);s.set(i),s.set(e,i.length),e=s,o.w=i.length}return Si(e,t.level==null?6:t.level,t.mem==null?o.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,r,n,o)};var Xt=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},Ri=function(e,t){var r=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:t.level==9?2:0,e[9]=3,t.mtime!=0&&Xt(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),r){e[3]=8;for(var n=0;n<=r.length;++n)e[n+10]=r.charCodeAt(n)}};var xi=function(e){return 10+(e.filename?e.filename.length+1:0)};function dn(e,t){t||(t={});var r=ki(),n=e.length;r.p(e);var o=Mi(e,t,xi(t),8),i=o.length;return Ri(o,t),Xt(o,i-8,r.d()),Xt(o,i-4,n),o}var nn=typeof TextEncoder<"u"&&new TextEncoder,Ii=typeof TextDecoder<"u"&&new TextDecoder,Ei=0;try{Ii.decode(fn,{stream:!0}),Ei=1}catch{}function hn(e,t){if(t){for(var r=new fe(e.length),n=0;n<e.length;++n)r[n]=e.charCodeAt(n);return r}if(nn)return nn.encode(e);for(var o=e.length,i=new fe(e.length+(e.length>>1)),s=0,a=function(u){i[s++]=u},n=0;n<o;++n){if(s+5>i.length){var l=new fe(s+8+(o-n<<1));l.set(i),i=l}var c=e.charCodeAt(n);c<128||t?a(c):c<2048?(a(192|c>>6),a(128|c&63)):c>55295&&c<57344?(c=65536+(c&1047552)|e.charCodeAt(++n)&1023,a(240|c>>18),a(128|c>>12&63),a(128|c>>6&63),a(128|c&63)):(a(224|c>>12),a(128|c>>6&63),a(128|c&63))}return un(i,0,s)}async function pn(e){if(typeof CompressionStream<"u"&&typeof Response<"u")try{let t=new Response(e).body?.pipeThrough(new CompressionStream("gzip"));if(t)return new Uint8Array(await new Response(t).arrayBuffer())}catch{}return Jt(e)}function Jt(e){return dn(hn(e))}var Ti=8e6,mn=6e4;function gn(e){let t=[],r=0,n=0,o,i=!!e.hold,s=!1,a,l,c=[],u=()=>c.reduce((w,g)=>w+g.json.length,0),p=()=>{if(!t.length)return;let{sessionId:w,windowId:g}=e.ids();o&&o!==w&&(n=0,e.onSessionChange?.()),o=w,c.push({json:d(w,g,n,t),parts:t,window:g,session:w,seq:n++,tries:0}),t=[],r=0},d=(w,g,b,k)=>`{"api_key":${JSON.stringify(e.apiKey)},"session_id":${JSON.stringify(w)},"window_id":${JSON.stringify(g)},"seq":${b},"events":[${k.join(",")}]}`,h=0,m=async w=>{try{let g=await pn(w.json),b=await e.fetch(`${e.url}?compression=gzip`,{method:"POST",body:g,headers:{"Content-Type":"text/plain;charset=UTF-8"},credentials:"omit",keepalive:g.length<mn}),k=b.headers?.get?.("Retry-After")?.trim()??"";return h=/^\d+$/.test(k)?Math.min(Number(k),300)*1e3:0,b.status}catch{return 0}},f=()=>i||s?Promise.resolve():(l??=(async()=>{for(;c.length&&!i&&!s;){let w=c[0],g=await m(w);g>=200&&g<300?(c.shift(),e.onSent?.(w.session,w.json.length)):!ir(g)||++w.tries>(e.maxRetries??5)?(e.log?.("replay chunk dropped",w.seq,g),c.shift(),e.onGap?.()):await new Promise(b=>setTimeout(b,Math.max(h,or(w.tries-1,e.backoff))))}})().finally(()=>{l=void 0}),l),y=()=>{a??=setTimeout(()=>{a=void 0,S()},e.flushMs)},S=()=>(a!==void 0&&clearTimeout(a),a=void 0,p(),i&&u()>Ti&&(i=!1),f());return{add(w){if(s)return;let g=JSON.stringify(w);if(g.length>rr-4096)return e.log?.("replay event too large",g.length);r&&r+g.length>e.chunkBytes&&S(),t.push(g),r+=g.length+1,r>=e.chunkBytes?S():y()},flush:S,beacon(){if(i||s)return;p();let w=c[0]?.seq??0,g=c[0]?.session;for(let b of c.splice(0)){b.session!==g&&([g,w]=[b.session,b.seq]);let k=R=>{let E=Jt(d(b.session,b.window,w,R));if(E.length>mn&&R.length>1){k(R.slice(0,R.length>>1)),k(R.slice(R.length>>1));return}w++,navigator.sendBeacon?.(`${e.url}?compression=gzip`,new Blob([E],{type:"text/plain"}))};k(b.parts)}n=Math.max(n,w)},release(){i=!1,S()},discard(){s=!0,t=[],c.length=0,a!==void 0&&clearTimeout(a)},get unsent(){return r+u()},get seq(){return n},get held(){return i}}}var yn=(e,t)=>{let r=e(t);return r&&r.nodeType===1?r:null};function $e(e,t,r){let n=o=>{o&&(o.type===2&&o.attributes&&r(o.attributes,(o.tagName??"").toLowerCase(),yn(t,o.id)),o.childNodes?.forEach(n))};if(e.type===2&&n(e.data?.node),!(e.type!==3||e.data?.source!==0)){e.data.adds?.forEach(o=>n(o.node));for(let o of e.data.attributes??[]){let i=yn(t,o.id);r(o.attributes,i?.tagName.toLowerCase()??"",i)}}}var Oi=["title","alt","placeholder","aria-label","aria-description","aria-placeholder","aria-roledescription","aria-valuetext"],Ni=new Set(["input","textarea","select"]),vn=e=>e.replace(/\S/g,"*");function wn(e,t){let r=o=>{try{return!!o?.closest(t)&&!o.closest(e)}catch{return!1}},n=(o,i,s)=>{if(!r(s))for(let a of Object.keys(o)){let l=o[a];(Oi.includes(a)||a==="value"&&!Ni.has(i))&&typeof l=="string"&&(o[a]=vn(l))}};return{maskTextFn:(o,i)=>r(i)?o:vn(o),scrub:(o,i)=>$e(o,i,n)}}var bn="data-lc-fixed";function Sn(e,t){$e(e,t,(r,n,o)=>{if(!(!o||bn in r))try{let i=getComputedStyle(o).position;(i==="fixed"||i==="sticky")&&(r[bn]="")}catch{}})}var Cn=()=>window.parent!==window;function Li(){let e=location.ancestorOrigins;if(e?.length)return e[0];try{return document.referrer?new URL(document.referrer).origin:void 0}catch{return}}var kn=e=>{let t=Li();return!!t&&e.includes(t)};function Mn(e){let t=r=>{let n=r.data;n&&typeof n=="object"&&n.type==="rrweb"&&!e.includes(r.origin)&&r.stopImmediatePropagation()};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)}var Ai=new Set(["Shift","Control","Alt","Meta","CapsLock","AltGraph"]);function Rn(e,t,r=1e3){let n=0,o,i=()=>{o=void 0,n>0&&e(n)&&(n=0)},s=l=>{if(!(l instanceof Element))return!1;if(l instanceof HTMLInputElement&&l.type==="password")return!0;let c=t();try{return!!c&&!!l.closest(c)}catch{return!1}},a=l=>{l.repeat||Ai.has(l.key)||s(l.target)||(n++,o??=setTimeout(i,r))};return document.addEventListener("keydown",a,{capture:!0,passive:!0}),{flush:i,stop(){document.removeEventListener("keydown",a,{capture:!0}),o!==void 0&&clearTimeout(o),i()}}}function xn(e,t=1e3){let r=0,n,o=()=>{n=void 0;let s=Math.max(document.documentElement.scrollHeight,document.body?.scrollHeight??0);s>0&&s!==r&&(r=s,e(s))},i=()=>{n??=setTimeout(o,t)};return window.addEventListener("load",i),window.addEventListener("resize",i),{schedule:i,reset(){r=0,n!==void 0&&clearTimeout(n),o()},stop(){window.removeEventListener("load",i),window.removeEventListener("resize",i),n!==void 0&&clearTimeout(n)}}}function In(){let e=[[]];return{push(t,r){r&&(e=[e[e.length-1],[]]),e[e.length-1].push(t)},drain(){let t=e.flat();return e=[[]],t},get size(){return e.reduce((t,r)=>t+r.length,0)}}}function En(e,t,r){if(!e)return null;let n=null;try{let o=e.proxy&&new URL(e.proxy.url,location.href);o&&/^https?:$/.test(o.protocol)&&r.includes(o.origin)&&e.proxy?.origins.length&&(n={url:o.toString(),origins:[...e.proxy.origins]})}catch{}return{inlineImages:!!e.inlineImages&&!t,maxInlineBytes:e.maxInlineBytes??256*1024,collectFonts:!!e.collectFonts,proxy:n}}var Di=new Set(["img","source","video","audio","track","image","input"]),_i=/url\(\s*(['"]?)([^'")]+)\1\s*\)/g;function Tn(e){let t=i=>{if(!e.proxy||i.startsWith("data:"))return i;try{let s=new URL(i,location.href);return e.proxy.origins.includes(s.origin)?`${e.proxy.url}${e.proxy.url.includes("?")?"&":"?"}url=${encodeURIComponent(s.toString())}`:i}catch{return i}},r=i=>i.replace(_i,(s,a,l)=>{let c=t(l.trim());return c===l.trim()?s:`url(${a}${c}${a})`}),n=i=>i.split(",").map(s=>{let[a,...l]=s.trim().split(/\s+/);return a?[t(a),...l].join(" "):s}).join(", "),o=(i,s)=>{if(s==="img"&&typeof i.rr_dataURL=="string"&&i.rr_dataURL.length>e.maxInlineBytes&&delete i.rr_dataURL,!!e.proxy)for(let[a,l]of Object.entries(i))typeof l=="string"&&(a==="_cssText"||a==="style"?i[a]=r(l):a==="srcset"?i[a]=n(l):(a==="poster"||a==="src"&&Di.has(s)||a==="href"&&s==="link"||a==="xlink:href"&&s==="image")&&(i[a]=t(l)))};return{scrub(i,s){if($e(i,s,o),e.proxy&&i.type===3&&i.data?.source===8)for(let a of i.data.adds??[])typeof a.rule=="string"&&(a.rule=r(a.rule))}}}function Fi(e,t,r){let n={x:0,y:0,width:e.width,height:e.height},o=[];try{o=r?.(e)??[]}catch{o=[n]}let i=t.flatMap(s=>{try{return e.matches(s.selector)?s.regions??[n]:[]}catch{return[n]}});return[...o,...i]}function On(e){let t=new Map,r=document.createElement("canvas"),n=()=>{for(let i of Array.from(document.querySelectorAll("canvas"))){let s=e.idOf(i);if(!(s<=0||!i.width||!i.height||i.closest(e.skip)))try{r.width=i.width,r.height=i.height;let a=r.getContext("2d");if(!a)return;a.drawImage(i,0,0),a.fillStyle="#000";for(let p of Fi(i,e.rules,e.regionsFn))a.fillRect(p.x,p.y,p.width,p.height);let l=r.toDataURL("image/jpeg",e.quality),c=l.slice(l.indexOf(",")+1);if(!c||t.get(s)===c)continue;t.set(s,c);let u={rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:c}],type:"image/jpeg"};e.emit({type:3,timestamp:Date.now(),data:{source:9,id:s,type:0,commands:[{property:"clearRect",args:[0,0,i.width,i.height]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[u]},0,0]}]}})}catch{}}},o=setInterval(n,Math.round(1e3/e.fps));return{reset:()=>t.clear(),tick:n,stop:()=>clearInterval(o)}}function Nn(e,t=Date.now){let r=e.eventsPerSecond??10,n=e.burst??100,o=n,i=t();return()=>{let s=t();return o=Math.min(n,o+(s-i)/1e3*r),i=s,o<1?!1:(o-=1,!0)}}var zi=1e4;function Ln(e,t=Date.now){let r=new Map,n=0;return{allow(o){let i=o.data;return o.type!==3||i?.source!==0||!i.attributes?.length?!0:(r.size>zi&&r.clear(),i.attributes=i.attributes.filter(s=>{let a=r.get(s.id);return a||r.set(s.id,a=Nn({burst:e.burst??100,eventsPerSecond:e.perSecond??10},t)),a()?!0:(n++,!1)}),!!(i.attributes.length||i.adds?.length||i.removes?.length||i.texts?.length))},get dropped(){return n}}}var Pi=new Set([1,2,3,4,5,6,7,12]);function An(e){let t,r=!1,n=0;return{check(o){if(e<=0)return{keep:!0,resumed:!1};let i=o.timestamp??Date.now();if(t??=i,o.type===3&&Pi.has(o.data?.source??-1)){t=i;let s=r&&n>0;return r=!1,n=0,{keep:!0,resumed:s}}return!r&&i-t>e&&(r=!0),r?(n++,{keep:!1,resumed:!1}):{keep:!0,resumed:!1}}}}function Dn(e,t,r){let n=[],o;switch(t.mode){case"on_event":e.onCapture(i=>t.events.includes(i.event)&&r());break;case"on_flag":{let i=e.flags?.onChange(s=>s[t.flag]&&r());i&&n.push(i);break}case"on_url":try{o=new RegExp(t.pattern)}catch{e.log("bad on_url pattern",t.pattern)}break;case"on_frustration":{let i=[],s=a=>{let l=Date.now();for(i.push({t:l,x:a.clientX,y:a.clientY});i.length&&l-i[0].t>1e3;)i.shift();i.filter(u=>Math.hypot(u.x-a.clientX,u.y-a.clientY)<=30).length>=3&&r()};document.addEventListener("click",s,!0),n.push(()=>document.removeEventListener("click",s,!0));break}default:}return{checkUrl:i=>o?.test(i)&&r(),stop:()=>n.forEach(i=>i())}}var St="[redacted]",Ui=/^(authorization|proxy-authorization|cookie|set-cookie|x-api-key|x-auth-token|x-csrf-token)$/i,er=/pass(word|wd|phrase)?|secret|token|api[-_]?key|card|cvv|cvc|ssn|authorization/i;var Re=(e,t=4096)=>e.length>t?`${e.slice(0,t)}...[truncated ${e.length-t}]`:e;function tt(e){let t={};for(let r of Object.keys(e))t[r]=Ui.test(r)?St:Re(e[r]??"",512);return t}function Qt(e,t){if(t>6||e===null||typeof e!="object")return e;if(Array.isArray(e))return e.map(n=>Qt(n,t+1));let r={};for(let[n,o]of Object.entries(e))r[n]=er.test(n)?St:Qt(o,t+1);return r}function Be(e){if(e==null)return;if(typeof e!="string")return typeof URLSearchParams<"u"&&e instanceof URLSearchParams?Be(e.toString()):"[binary]";let t=e.trim();if(t.startsWith("{")||t.startsWith("["))try{return Re(JSON.stringify(Qt(JSON.parse(t),0)))}catch{}if(/^[^\s=&]+=[^\s]*$/.test(t)){let r=new URLSearchParams(t);for(let n of[...r.keys()])er.test(n)&&r.set(n,St);return Re(r.toString())}return Re(e)}function _n(e,t=1e3){try{if(typeof e=="string")return Re(e,t);if(e instanceof Error)return Re(`${e.name}: ${e.message}${e.stack?`
78
+ `,Cr=typeof self<"u"&&self.Blob&&new Blob([Zr],{type:"text/javascript;charset=utf-8"});function fi(e){let t;try{if(t=Cr&&(self.URL||self.webkitURL).createObjectURL(Cr),!t)throw"";let r=new Worker(t,{name:e?.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),r}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(Zr),{name:e?.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var Ut=class{constructor(t){v(this,"pendingCanvasMutations",new Map),v(this,"rafStamps",{latestId:0,invokeId:null}),v(this,"mirror"),v(this,"mutationCb"),v(this,"resetObservers"),v(this,"frozen",!1),v(this,"locked",!1),v(this,"processMutation",(l,c)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(c)});let{sampling:r="all",win:n,blockClass:o,blockSelector:i,recordCanvas:s,dataURLOptions:a}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&r==="all"&&this.initCanvasMutationObserver(n,o,i),s&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,o,i,{dataURLOptions:a})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,n,o,i){let s=br(r,n,o,!0),a=new Map,l=new fi;l.onmessage=m=>{let{id:f}=m.data;if(a.set(f,!1),!("base64"in m.data))return;let{base64:y,type:S,width:w,height:g}=m.data;this.mutationCb({id:f,type:Ue["2D"],commands:[{property:"clearRect",args:[0,0,w,g]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:y}],type:S}]},0,0]}]})};let c=1e3/t,u=0,p,d=()=>{let m=[];return r.document.querySelectorAll("canvas").forEach(f=>{le(f,n,o,!0)||m.push(f)}),m},h=m=>{if(u&&m-u<c){p=requestAnimationFrame(h);return}u=m,d().forEach(async f=>{var y;let S=this.mirror.getId(f);if(a.get(S)||f.width===0||f.height===0)return;if(a.set(S,!0),["webgl","webgl2"].includes(f.__context)){let g=f.getContext(f.__context);((y=g?.getContextAttributes())==null?void 0:y.preserveDrawingBuffer)===!1&&g.clear(g.COLOR_BUFFER_BIT)}let w=await createImageBitmap(f);l.postMessage({id:S,bitmap:w,width:f.width,height:f.height,dataURLOptions:i.dataURLOptions},[w])}),p=requestAnimationFrame(h)};p=requestAnimationFrame(h),this.resetObservers=()=>{s(),cancelAnimationFrame(p)}}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let o=br(t,r,n,!1),i=li(this.processMutation.bind(this),t,r,n),s=ci(this.processMutation.bind(this),t,r,n);this.resetObservers=()=>{o(),i(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{let n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;let n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;let o=n.map(s=>{let{type:a,...l}=s;return l}),{type:i}=n[0];this.mutationCb({id:r,type:i,commands:o}),this.pendingCanvasMutations.delete(t)}},$t=class{constructor(t){v(this,"trackedLinkElements",new WeakSet),v(this,"mutationCb"),v(this,"adoptedStyleSheetCb"),v(this,"styleMirror",new At),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,r){if(t.length===0)return;let n={id:r,styleIds:[]},o=[];for(let i of t){let s;this.styleMirror.has(i)?s=this.styleMirror.getId(i):(s=this.styleMirror.add(i),o.push({styleId:s,rules:Array.from(i.rules||CSSRule,(a,l)=>({rule:xr(a,i.href),index:l}))})),n.styleIds.push(s)}o.length>0&&(n.styles=o),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}},Bt=class{constructor(){v(this,"nodeMap",new WeakMap),v(this,"active",!1)}inOtherBuffer(t,r){let n=this.nodeMap.get(t);return n&&Array.from(n).some(o=>o!==r)}add(t,r){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(r))}destroy(){}},q,ct,xe,Ke=!1;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=((lr=e.contentWindow)==null?void 0:lr.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var ge=fo();function ue(e={}){let{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:o="rr-block",blockSelector:i=null,ignoreClass:s="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=!0,maskAllInputs:p,maskInputOptions:d,slimDOMOptions:h,maskInputFn:m,maskTextFn:f,hooks:y,packFn:S,sampling:w={},dataURLOptions:g={},mousemoveWait:b,recordDOM:k=!0,recordCanvas:R=!1,recordCrossOriginIframes:E=!1,recordAfter:I=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:x=!1,collectFonts:P=!1,inlineImages:H=!1,plugins:U,keepIframeSrcFn:T=()=>!1,ignoreCSSAttributes:X=new Set([]),errorHandler:K}=e;Go(K);let N=E?window.parent===window:!0,F=!1;if(!N)try{window.parent.document&&(F=!1)}catch{F=!0}if(N&&!t)throw new Error("emit function is required");if(!N&&!F)return()=>{};b!==void 0&&w.mousemove===void 0&&(w.mousemove=b),ge.reset();let W=p===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:d!==void 0?d:{password:!0},G=Ar(h);$o();let de,ne=0,ye=D=>{for(let Y of U||[])Y.eventProcessor&&(D=Y.eventProcessor(D));return S&&!F&&(D=S(D)),D};q=(D,Y)=>{let O=D;if(O.timestamp=Xe(),O.type!==L.FullSnapshot&&!(O.type===L.IncrementalSnapshot&&O.data.source===A.Mutation)){xe.unfreeze();for(let V of Pe)if(V.isFrozen())V.unfreeze();else break}if(N)t?.(ye(O),Y);else if(F){let V={type:"rrweb",event:ye(O),origin:window.location.origin,isCheckout:Y};window.parent.postMessage(V,"*")}if(O.type===L.FullSnapshot)de=O,ne=0;else if(O.type===L.IncrementalSnapshot){if(O.data.source===A.Mutation&&O.data.isAttachIframe)return;ne++;let V=n&&ne>=n,ae=r&&O.timestamp-de.timestamp>r;(V||ae)&&ct(!0)}};let te=D=>{q({type:L.IncrementalSnapshot,data:{source:A.Mutation,...D}})},oe=D=>q({type:L.IncrementalSnapshot,data:{source:A.Scroll,...D}}),j=D=>q({type:L.IncrementalSnapshot,data:{source:A.CanvasMutation,...D}}),ve=D=>q({type:L.IncrementalSnapshot,data:{source:A.AdoptedStyleSheet,...D}}),me=new $t({mutationCb:te,adoptedStyleSheetCb:ve}),ie=new zt({mirror:ge,mutationCb:te,stylesheetManager:me,recordCrossOriginIframes:E,wrappedEmit:q});for(let D of U||[])D.getMirror&&D.getMirror({nodeMirror:ge,crossOriginIframeMirror:ie.crossOriginIframeMirror,crossOriginIframeStyleMirror:ie.crossOriginIframeStyleMirror});let we=new Bt;xe=new Ut({recordCanvas:R,mutationCb:j,win:window,blockClass:o,blockSelector:i,mirror:ge,sampling:w.canvas,dataURLOptions:g});let se=new Pt({mutationCb:te,scrollCb:oe,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:W,dataURLOptions:g,maskTextFn:f,maskInputFn:m,recordCanvas:R,inlineImages:H,sampling:w,slimDOMOptions:G,iframeManager:ie,stylesheetManager:me,canvasManager:xe,keepIframeSrcFn:T,processedNodeManager:we},mirror:ge});ct=(D=!1)=>{if(!k)return;q({type:L.Meta,data:{href:window.location.href,width:Fr(),height:_r()}},D),me.reset(),se.init(),xe.lock(),Pe.forEach(O=>O.lock());let Y=Po(document,{mirror:ge,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:W,maskTextFn:f,maskInputFn:m,slimDOM:G,dataURLOptions:g,recordCanvas:R,inlineImages:H,onSerialize:O=>{Ur(O,ge)&&ie.addIframe(O),$r(O,ge)&&me.trackLinkElement(O),Lt(O)&&se.addShadowRoot(M.shadowRoot(O),document)},onIframeLoad:(O,V)=>{ie.attachIframe(O,V),se.observeAttachShadow(O)},onStylesheetLoad:(O,V)=>{me.attachLinkElement(O,V)},keepIframeSrcFn:T});if(!Y)return console.warn("Failed to snapshot the document");q({type:L.FullSnapshot,data:{node:Y,initialOffset:Dr(window)}},D),xe.unlock(),Pe.forEach(O=>O.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&me.adoptStyleSheets(document.adoptedStyleSheets,ge.getId(document))};try{let D=[],Y=ae=>{var J;return _(oi)({mutationCb:te,mousemoveCb:($,be)=>q({type:L.IncrementalSnapshot,data:{source:be,positions:$}}),mouseInteractionCb:$=>q({type:L.IncrementalSnapshot,data:{source:A.MouseInteraction,...$}}),scrollCb:oe,viewportResizeCb:$=>q({type:L.IncrementalSnapshot,data:{source:A.ViewportResize,...$}}),inputCb:$=>q({type:L.IncrementalSnapshot,data:{source:A.Input,...$}}),mediaInteractionCb:$=>q({type:L.IncrementalSnapshot,data:{source:A.MediaInteraction,...$}}),styleSheetRuleCb:$=>q({type:L.IncrementalSnapshot,data:{source:A.StyleSheetRule,...$}}),styleDeclarationCb:$=>q({type:L.IncrementalSnapshot,data:{source:A.StyleDeclaration,...$}}),canvasMutationCb:j,fontCb:$=>q({type:L.IncrementalSnapshot,data:{source:A.Font,...$}}),selectionCb:$=>{q({type:L.IncrementalSnapshot,data:{source:A.Selection,...$}})},customElementCb:$=>{q({type:L.IncrementalSnapshot,data:{source:A.CustomElement,...$}})},blockClass:o,ignoreClass:s,ignoreSelector:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:W,inlineStylesheet:u,sampling:w,recordDOM:k,recordCanvas:R,inlineImages:H,userTriggeredOnInput:x,collectFonts:P,doc:ae,maskInputFn:m,maskTextFn:f,keepIframeSrcFn:T,blockSelector:i,slimDOMOptions:G,dataURLOptions:g,mirror:ge,iframeManager:ie,stylesheetManager:me,shadowDomManager:se,processedNodeManager:we,canvasManager:xe,ignoreCSSAttributes:X,plugins:((J=U?.filter($=>$.observer))==null?void 0:J.map($=>({observer:$.observer,options:$.options,callback:be=>q({type:L.Plugin,data:{plugin:$.name,payload:be}})})))||[]},y)},O=new Map;ie.addLoadListener(ae=>{try{let J=ae.contentDocument;if(O.has(J))return;O.set(J,Y(J))}catch(J){console.warn(J)}}),ie.addUnloadListener(ae=>{let J=O.get(ae);J&&(O.delete(ae),J(),se.removeShadowRootsIn(ae),ge.removeNodeFromMap(ae))});let V=()=>{ct(),D.push(Y(document)),Ke=!0};return["interactive","complete"].includes(document.readyState)?V():(D.push(re("DOMContentLoaded",()=>{q({type:L.DomContentLoaded,data:{}}),I==="DOMContentLoaded"&&V()})),D.push(re("load",()=>{q({type:L.Load,data:{}}),I==="load"&&V()},window))),()=>{[...D,...O.values()].forEach(ae=>{try{ae()}catch(J){String(J).toLowerCase().includes("cross-origin")||console.warn(J)}}),O.clear(),ie.destroy(),we.destroy(),se.reset(),xe.reset(),Ke=!1,jo()}}catch(D){console.warn(D)}}ue.addCustomEvent=(e,t)=>{if(!Ke)throw new Error("please add custom event after start recording");q({type:L.Custom,data:{tag:e,payload:t}})};ue.addAnnotation=e=>{if(!Ke)throw new Error("please add annotation after recording started");q({type:L.Annotation,data:e})};ue.freezePage=()=>{xe.freeze(),Pe.forEach(e=>e.freeze())};ue.takeFullSnapshot=e=>{if(!Ke)throw new Error("please take full snapshot after start recording");ct(e)};ue.mirror=ge;var Kr=["gclid","gad_source","gclsrc","dclid","gbraid","wbraid","fbclid","igshid","msclkid","ttclid","li_fat_id","twclid","mc_cid","rdt_cid","epik","qclid","sccid","oppref","bfcid","irclid","_kx"];var Yr=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"];var di="<masked>",hi=["password","passwd","pwd","pass","token","access_token","refresh_token","id_token","secret","client_secret","state","session","api_key","apikey","key","auth","authorization","code","otp","email","ssn"];var pi=[/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,/^[0-9a-hjkmnp-tv-z]{26}$/i,/^\d{4,}$/,/^[0-9a-f]{16,}$/i,/^(?=.*\d)[a-z0-9_-]{20,}$/i],mi=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");function gi(e,t){let r=e;for(let n of t.pathRules??[])try{r=r.replace(typeof n.match=="string"?new RegExp(n.match):n.match,n.replace)}catch{}return t.maskPathIds?r.split("/").map(n=>pi.some(o=>o.test(n))?":id":n).join("/"):r}function Jr(e,t){let r=e;if(t.pathRules?.length||t.maskPathIds){let o=/^((?:[a-z][a-z0-9+.-]*:)?\/\/[^/?#]*)?([^?#]*)([\s\S]*)$/i.exec(r);o&&(r=(o[1]??"")+gi(o[2],t)+o[3])}let n=[...hi,...t.maskParams??[],...t.maskCampaignParams?[...Yr,...Kr]:[]];if(n.length){let o=r.indexOf("#"),i=o<0?r:r.slice(0,o),s=o<0?"":r.slice(o);r=i.replace(new RegExp(`([?&])(${n.map(mi).join("|")})=[^&]*`,"gi"),`$1$2=${di}`)+s}return t.stripHash&&(r=r.replace(/#.*$/,"")),r}var fe=Uint8Array,pe=Uint16Array,Zt=Int32Array,Kt=new fe([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,0,0,0]),Yt=new fe([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,0,0]),Qr=new fe([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),on=function(e,t){for(var r=new pe(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];for(var o=new Zt(r[30]),n=1;n<30;++n)for(var i=r[n];i<r[n+1];++i)o[i]=i-r[n]<<5|n;return{b:r,r:o}},sn=on(Kt,2),yi=sn.b,jt=sn.r;yi[28]=258,jt[258]=28;var an=on(Yt,0),ts=an.b,en=an.r,qt=new pe(32768);for(z=0;z<32768;++z)ke=(z&43690)>>1|(z&21845)<<1,ke=(ke&52428)>>2|(ke&13107)<<2,ke=(ke&61680)>>4|(ke&3855)<<4,qt[z]=((ke&65280)>>8|(ke&255)<<8)>>1;var ke,z,et=(function(e,t,r){for(var n=e.length,o=0,i=new pe(t);o<n;++o)e[o]&&++i[e[o]-1];var s=new pe(t);for(o=1;o<t;++o)s[o]=s[o-1]+i[o-1]<<1;var a;if(r){a=new pe(1<<t);var l=15-t;for(o=0;o<n;++o)if(e[o])for(var c=o<<4|e[o],u=t-e[o],p=s[e[o]-1]++<<u,d=p|(1<<u)-1;p<=d;++p)a[qt[p]>>l]=c}else for(a=new pe(n),o=0;o<n;++o)e[o]&&(a[o]=qt[s[e[o]-1]++]>>15-e[o]);return a}),Oe=new fe(288);for(z=0;z<144;++z)Oe[z]=8;var z;for(z=144;z<256;++z)Oe[z]=9;var z;for(z=256;z<280;++z)Oe[z]=7;var z;for(z=280;z<288;++z)Oe[z]=8;var z,bt=new fe(32);for(z=0;z<32;++z)bt[z]=5;var z,vi=et(Oe,9,0);var wi=et(bt,5,0);var ln=function(e){return(e+7)/8|0},un=function(e,t,r){return(t==null||t<0)&&(t=0),(r==null||r>e.length)&&(r=e.length),new fe(e.subarray(t,r))};var Me=function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8},Je=function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8,e[n+2]|=r>>16},Gt=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var o=r.length,i=r.slice();if(!o)return{t:fn,l:0};if(o==1){var s=new fe(r[0].s+1);return s[r[0].s]=1,{t:s,l:1}}r.sort(function(k,R){return k.f-R.f}),r.push({s:-1,f:25001});var a=r[0],l=r[1],c=0,u=1,p=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=o-1;)a=r[r[c].f<r[p].f?c++:p++],l=r[c!=u&&r[c].f<r[p].f?c++:p++],r[u++]={s:-1,f:a.f+l.f,l:a,r:l};for(var d=i[0].s,n=1;n<o;++n)i[n].s>d&&(d=i[n].s);var h=new pe(d+1),m=Vt(r[u-1],h,0);if(m>t){var n=0,f=0,y=m-t,S=1<<y;for(i.sort(function(R,E){return h[E.s]-h[R.s]||R.f-E.f});n<o;++n){var w=i[n].s;if(h[w]>t)f+=S-(1<<m-h[w]),h[w]=t;else break}for(f>>=y;f>0;){var g=i[n].s;h[g]<t?f-=1<<t-h[g]++-1:++n}for(;n>=0&&f;--n){var b=i[n].s;h[b]==t&&(--h[b],++f)}m=t}return{t:new fe(h),l:m}},Vt=function(e,t,r){return e.s==-1?Math.max(Vt(e.l,t,r+1),Vt(e.r,t,r+1)):t[e.s]=r},tn=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new pe(++t),n=0,o=e[0],i=1,s=function(l){r[n++]=l},a=1;a<=t;++a)if(e[a]==o&&a!=t)++i;else{if(!o&&i>2){for(;i>138;i-=138)s(32754);i>2&&(s(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(s(o),--i;i>6;i-=6)s(8304);i>2&&(s(i-3<<5|8208),i=0)}for(;i--;)s(o);i=1,o=e[a]}return{c:r.subarray(0,n),n:t}},Qe=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},cn=function(e,t,r){var n=r.length,o=ln(t+2);e[o]=n&255,e[o+1]=n>>8,e[o+2]=e[o]^255,e[o+3]=e[o+1]^255;for(var i=0;i<n;++i)e[o+i+4]=r[i];return(o+4+n)*8},rn=function(e,t,r,n,o,i,s,a,l,c,u){Me(t,u++,r),++o[256];for(var p=Gt(o,15),d=p.t,h=p.l,m=Gt(i,15),f=m.t,y=m.l,S=tn(d),w=S.c,g=S.n,b=tn(f),k=b.c,R=b.n,E=new pe(19),I=0;I<w.length;++I)++E[w[I]&31];for(var I=0;I<k.length;++I)++E[k[I]&31];for(var x=Gt(E,7),P=x.t,H=x.l,U=19;U>4&&!P[Qr[U-1]];--U);var T=c+5<<3,X=Qe(o,Oe)+Qe(i,bt)+s,K=Qe(o,d)+Qe(i,f)+s+14+3*U+Qe(E,P)+2*E[16]+3*E[17]+7*E[18];if(l>=0&&T<=X&&T<=K)return cn(t,u,e.subarray(l,l+c));var N,F,W,G;if(Me(t,u,1+(K<X)),u+=2,K<X){N=et(d,h,0),F=d,W=et(f,y,0),G=f;var de=et(P,H,0);Me(t,u,g-257),Me(t,u+5,R-1),Me(t,u+10,U-4),u+=14;for(var I=0;I<U;++I)Me(t,u+3*I,P[Qr[I]]);u+=3*U;for(var ne=[w,k],ye=0;ye<2;++ye)for(var te=ne[ye],I=0;I<te.length;++I){var oe=te[I]&31;Me(t,u,de[oe]),u+=P[oe],oe>15&&(Me(t,u,te[I]>>5&127),u+=te[I]>>12)}}else N=vi,F=Oe,W=wi,G=bt;for(var I=0;I<a;++I){var j=n[I];if(j>255){var oe=j>>18&31;Je(t,u,N[oe+257]),u+=F[oe+257],oe>7&&(Me(t,u,j>>23&31),u+=Kt[oe]);var ve=j&31;Je(t,u,W[ve]),u+=G[ve],ve>3&&(Je(t,u,j>>5&8191),u+=Yt[ve])}else Je(t,u,N[j]),u+=F[j]}return Je(t,u,N[256]),u+F[256]},bi=new Zt([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),fn=new fe(0),Si=function(e,t,r,n,o,i){var s=i.z||e.length,a=new fe(n+s+5*(1+Math.ceil(s/7e3))+o),l=a.subarray(n,a.length-o),c=i.l,u=(i.r||0)&7;if(t){u&&(l[0]=i.r>>3);for(var p=bi[t-1],d=p>>13,h=p&8191,m=(1<<r)-1,f=i.p||new pe(32768),y=i.h||new pe(m+1),S=Math.ceil(r/3),w=2*S,g=function(V){return(e[V]^e[V+1]<<S^e[V+2]<<w)&m},b=new Zt(25e3),k=new pe(288),R=new pe(32),E=0,I=0,x=i.i||0,P=0,H=i.w||0,U=0;x+2<s;++x){var T=g(x),X=x&32767,K=y[T];if(f[X]=K,y[T]=X,H<=x){var N=s-x;if((E>7e3||P>24576)&&(N>423||!c)){u=rn(e,l,0,b,k,R,I,P,U,x-U,u),P=E=I=0,U=x;for(var F=0;F<286;++F)k[F]=0;for(var F=0;F<30;++F)R[F]=0}var W=2,G=0,de=h,ne=X-K&32767;if(N>2&&T==g(x-ne))for(var ye=Math.min(d,N)-1,te=Math.min(32767,x),oe=Math.min(258,N);ne<=te&&--de&&X!=K;){if(e[x+W]==e[x+W-ne]){for(var j=0;j<oe&&e[x+j]==e[x+j-ne];++j);if(j>W){if(W=j,G=ne,j>ye)break;for(var ve=Math.min(ne,j-2),me=0,F=0;F<ve;++F){var ie=x-ne+F&32767,we=f[ie],se=ie-we&32767;se>me&&(me=se,K=ie)}}}X=K,K=f[X],ne+=X-K&32767}if(G){b[P++]=268435456|jt[W]<<18|en[G];var D=jt[W]&31,Y=en[G]&31;I+=Kt[D]+Yt[Y],++k[257+D],++R[Y],H=x+W,++E}else b[P++]=e[x],++k[e[x]]}}for(x=Math.max(x,H);x<s;++x)b[P++]=e[x],++k[e[x]];u=rn(e,l,c,b,k,R,I,P,U,x-U,u),c||(i.r=u&7|l[u/8|0]<<3,u-=7,i.h=y,i.p=f,i.i=x,i.w=H)}else{for(var x=i.w||0;x<s+c;x+=65535){var O=x+65535;O>=s&&(l[u/8|0]=c,O=s),u=cn(l,u+1,e.subarray(x,O))}i.i=s}return un(a,0,n+ln(u)+o)},Ci=(function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var r=t,n=9;--n;)r=(r&1&&-306674912)^r>>>1;e[t]=r}return e})(),ki=function(){var e=-1;return{p:function(t){for(var r=e,n=0;n<t.length;++n)r=Ci[r&255^t[n]]^r>>>8;e=r},d:function(){return~e}}};var Mi=function(e,t,r,n,o){if(!o&&(o={l:1},t.dictionary)){var i=t.dictionary.subarray(-32768),s=new fe(i.length+e.length);s.set(i),s.set(e,i.length),e=s,o.w=i.length}return Si(e,t.level==null?6:t.level,t.mem==null?o.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,r,n,o)};var Xt=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},Ri=function(e,t){var r=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:t.level==9?2:0,e[9]=3,t.mtime!=0&&Xt(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),r){e[3]=8;for(var n=0;n<=r.length;++n)e[n+10]=r.charCodeAt(n)}};var xi=function(e){return 10+(e.filename?e.filename.length+1:0)};function dn(e,t){t||(t={});var r=ki(),n=e.length;r.p(e);var o=Mi(e,t,xi(t),8),i=o.length;return Ri(o,t),Xt(o,i-8,r.d()),Xt(o,i-4,n),o}var nn=typeof TextEncoder<"u"&&new TextEncoder,Ii=typeof TextDecoder<"u"&&new TextDecoder,Ei=0;try{Ii.decode(fn,{stream:!0}),Ei=1}catch{}function hn(e,t){if(t){for(var r=new fe(e.length),n=0;n<e.length;++n)r[n]=e.charCodeAt(n);return r}if(nn)return nn.encode(e);for(var o=e.length,i=new fe(e.length+(e.length>>1)),s=0,a=function(u){i[s++]=u},n=0;n<o;++n){if(s+5>i.length){var l=new fe(s+8+(o-n<<1));l.set(i),i=l}var c=e.charCodeAt(n);c<128||t?a(c):c<2048?(a(192|c>>6),a(128|c&63)):c>55295&&c<57344?(c=65536+(c&1047552)|e.charCodeAt(++n)&1023,a(240|c>>18),a(128|c>>12&63),a(128|c>>6&63),a(128|c&63)):(a(224|c>>12),a(128|c>>6&63),a(128|c&63))}return un(i,0,s)}async function pn(e){if(typeof CompressionStream<"u"&&typeof Response<"u")try{let t=new Response(e).body?.pipeThrough(new CompressionStream("gzip"));if(t)return new Uint8Array(await new Response(t).arrayBuffer())}catch{}return Jt(e)}function Jt(e){return dn(hn(e))}var Ti=8e6,mn=6e4;function gn(e){let t=[],r=0,n=0,o,i=!!e.hold,s=!1,a,l,c=[],u=()=>c.reduce((w,g)=>w+g.json.length,0),p=()=>{if(!t.length)return;let{sessionId:w,windowId:g}=e.ids();o&&o!==w&&(n=0,e.onSessionChange?.()),o=w,c.push({json:d(w,g,n,t),parts:t,window:g,session:w,seq:n++,tries:0}),t=[],r=0},d=(w,g,b,k)=>`{"api_key":${JSON.stringify(e.apiKey)},"session_id":${JSON.stringify(w)},"window_id":${JSON.stringify(g)},"seq":${b},"events":[${k.join(",")}]}`,h=0,m=async w=>{try{let g=await pn(w.json),b=await e.fetch(`${e.url}?compression=gzip`,{method:"POST",body:g,headers:{"Content-Type":"text/plain;charset=UTF-8"},credentials:"omit",keepalive:g.length<mn}),k=b.headers?.get?.("Retry-After")?.trim()??"";return h=/^\d+$/.test(k)?Math.min(Number(k),300)*1e3:0,b.status}catch{return 0}},f=()=>i||s?Promise.resolve():(l??=(async()=>{for(;c.length&&!i&&!s;){let w=c[0],g=await m(w);g>=200&&g<300?(c.shift(),e.onSent?.(w.session,w.json.length)):!ir(g)||++w.tries>(e.maxRetries??5)?(e.log?.("replay chunk dropped",w.seq,g),c.shift(),e.onGap?.()):await new Promise(b=>setTimeout(b,Math.max(h,or(w.tries-1,e.backoff))))}})().finally(()=>{l=void 0}),l),y=()=>{a??=setTimeout(()=>{a=void 0,S()},e.flushMs)},S=()=>(a!==void 0&&clearTimeout(a),a=void 0,p(),i&&u()>Ti&&(i=!1),f());return{add(w){if(s)return;let g=JSON.stringify(w);if(g.length>rr-4096)return e.log?.("replay event too large",g.length);r&&r+g.length>e.chunkBytes&&S(),t.push(g),r+=g.length+1,r>=e.chunkBytes?S():y()},flush:S,beacon(){if(i||s)return;p();let w=c[0]?.seq??0,g=c[0]?.session;for(let b of c.splice(0)){b.session!==g&&([g,w]=[b.session,b.seq]);let k=R=>{let E=Jt(d(b.session,b.window,w,R));if(E.length>mn&&R.length>1){k(R.slice(0,R.length>>1)),k(R.slice(R.length>>1));return}w++,navigator.sendBeacon?.(`${e.url}?compression=gzip`,new Blob([E],{type:"text/plain"}))};k(b.parts)}n=Math.max(n,w)},release(){i=!1,S()},discard(){s=!0,t=[],c.length=0,a!==void 0&&clearTimeout(a)},get unsent(){return r+u()},get seq(){return n},get held(){return i}}}var yn=(e,t)=>{let r=e(t);return r&&r.nodeType===1?r:null};function $e(e,t,r){let n=o=>{o&&(o.type===2&&o.attributes&&r(o.attributes,(o.tagName??"").toLowerCase(),yn(t,o.id)),o.childNodes?.forEach(n))};if(e.type===2&&n(e.data?.node),!(e.type!==3||e.data?.source!==0)){e.data.adds?.forEach(o=>n(o.node));for(let o of e.data.attributes??[]){let i=yn(t,o.id);r(o.attributes,i?.tagName.toLowerCase()??"",i)}}}var Oi=["title","alt","placeholder","aria-label","aria-description","aria-placeholder","aria-roledescription","aria-valuetext"],Ni=new Set(["input","textarea","select"]),vn=e=>e.replace(/\S/g,"*");function wn(e,t){let r=o=>{try{return!!o?.closest(t)&&!o.closest(e)}catch{return!1}},n=(o,i,s)=>{if(!r(s))for(let a of Object.keys(o)){let l=o[a];(Oi.includes(a)||a==="value"&&!Ni.has(i))&&typeof l=="string"&&(o[a]=vn(l))}};return{maskTextFn:(o,i)=>r(i)?o:vn(o),scrub:(o,i)=>$e(o,i,n)}}var bn="data-lc-fixed";function Sn(e,t){$e(e,t,(r,n,o)=>{if(!(!o||bn in r))try{let i=getComputedStyle(o).position;(i==="fixed"||i==="sticky")&&(r[bn]="")}catch{}})}var Cn=()=>window.parent!==window;function Li(){let e=location.ancestorOrigins;if(e?.length)return e[0];try{return document.referrer?new URL(document.referrer).origin:void 0}catch{return}}var kn=e=>{let t=Li();return!!t&&e.includes(t)};function Mn(e){let t=r=>{let n=r.data;n&&typeof n=="object"&&n.type==="rrweb"&&!e.includes(r.origin)&&r.stopImmediatePropagation()};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)}var Ai=new Set(["Shift","Control","Alt","Meta","CapsLock","AltGraph"]);function Rn(e,t,r=1e3){let n=0,o,i=()=>{o=void 0,n>0&&e(n)&&(n=0)},s=l=>{if(!(l instanceof Element))return!1;if(l instanceof HTMLInputElement&&l.type==="password")return!0;let c=t();try{return!!c&&!!l.closest(c)}catch{return!1}},a=l=>{l.repeat||Ai.has(l.key)||s(l.target)||(n++,o??=setTimeout(i,r))};return document.addEventListener("keydown",a,{capture:!0,passive:!0}),{flush:i,stop(){document.removeEventListener("keydown",a,{capture:!0}),o!==void 0&&clearTimeout(o),i()}}}function xn(e,t=1e3){let r=0,n,o=()=>{n=void 0;let s=Math.max(document.documentElement.scrollHeight,document.body?.scrollHeight??0);s>0&&s!==r&&(r=s,e(s))},i=()=>{n??=setTimeout(o,t)};return window.addEventListener("load",i),window.addEventListener("resize",i),{schedule:i,reset(){r=0,n!==void 0&&clearTimeout(n),o()},stop(){window.removeEventListener("load",i),window.removeEventListener("resize",i),n!==void 0&&clearTimeout(n)}}}function In(){let e=[[]];return{push(t,r){r&&(e=[e[e.length-1],[]]),e[e.length-1].push(t)},drain(){let t=e.flat();return e=[[]],t},get size(){return e.reduce((t,r)=>t+r.length,0)}}}function En(e,t,r){if(!e)return null;let n=null;try{let o=e.proxy&&new URL(e.proxy.url,location.href);o&&/^https?:$/.test(o.protocol)&&r.includes(o.origin)&&e.proxy?.origins.length&&(n={url:o.toString(),origins:[...e.proxy.origins]})}catch{}return{inlineImages:!!e.inlineImages&&!t,maxInlineBytes:e.maxInlineBytes??256*1024,collectFonts:!!e.collectFonts,proxy:n}}var Di=new Set(["img","source","video","audio","track","image","input"]),_i=/url\(\s*(['"]?)([^'")]+)\1\s*\)/g;function Tn(e){let t=i=>{if(!e.proxy||i.startsWith("data:"))return i;try{let s=new URL(i,location.href);return e.proxy.origins.includes(s.origin)?`${e.proxy.url}${e.proxy.url.includes("?")?"&":"?"}url=${encodeURIComponent(s.toString())}`:i}catch{return i}},r=i=>i.replace(_i,(s,a,l)=>{let c=t(l.trim());return c===l.trim()?s:`url(${a}${c}${a})`}),n=i=>i.split(",").map(s=>{let[a,...l]=s.trim().split(/\s+/);return a?[t(a),...l].join(" "):s}).join(", "),o=(i,s)=>{if(s==="img"&&typeof i.rr_dataURL=="string"&&i.rr_dataURL.length>e.maxInlineBytes&&delete i.rr_dataURL,!!e.proxy)for(let[a,l]of Object.entries(i))typeof l=="string"&&(a==="_cssText"||a==="style"?i[a]=r(l):a==="srcset"?i[a]=n(l):(a==="poster"||a==="src"&&Di.has(s)||a==="href"&&s==="link"||a==="xlink:href"&&s==="image")&&(i[a]=t(l)))};return{scrub(i,s){if($e(i,s,o),e.proxy&&i.type===3&&i.data?.source===8)for(let a of i.data.adds??[])typeof a.rule=="string"&&(a.rule=r(a.rule))}}}function Fi(e,t,r){let n={x:0,y:0,width:e.width,height:e.height},o=[];try{o=r?.(e)??[]}catch{o=[n]}let i=t.flatMap(s=>{try{return e.matches(s.selector)?s.regions??[n]:[]}catch{return[n]}});return[...o,...i]}function On(e){let t=new Map,r=document.createElement("canvas"),n=()=>{for(let i of Array.from(document.querySelectorAll("canvas"))){let s=e.idOf(i);if(!(s<=0||!i.width||!i.height||i.closest(e.skip)))try{r.width=i.width,r.height=i.height;let a=r.getContext("2d");if(!a)return;a.drawImage(i,0,0),a.fillStyle="#000";for(let p of Fi(i,e.rules,e.regionsFn))a.fillRect(p.x,p.y,p.width,p.height);let l=r.toDataURL("image/jpeg",e.quality),c=l.slice(l.indexOf(",")+1);if(!c||t.get(s)===c)continue;t.set(s,c);let u={rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:c}],type:"image/jpeg"};e.emit({type:3,timestamp:Date.now(),data:{source:9,id:s,type:0,commands:[{property:"clearRect",args:[0,0,i.width,i.height]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[u]},0,0]}]}})}catch{}}},o=setInterval(n,Math.round(1e3/e.fps));return{reset:()=>t.clear(),tick:n,stop:()=>clearInterval(o)}}function Nn(e,t=Date.now){let r=e.eventsPerSecond??10,n=e.burst??100,o=n,i=t();return()=>{let s=t();return o=Math.min(n,o+(s-i)/1e3*r),i=s,o<1?!1:(o-=1,!0)}}var zi=1e4;function Ln(e,t=Date.now){let r=new Map,n=0;return{allow(o){let i=o.data;return o.type!==3||i?.source!==0||!i.attributes?.length?!0:(r.size>zi&&r.clear(),i.attributes=i.attributes.filter(s=>{let a=r.get(s.id);return a||r.set(s.id,a=Nn({burst:e.burst??100,eventsPerSecond:e.perSecond??10},t)),a()?!0:(n++,!1)}),!!(i.attributes.length||i.adds?.length||i.removes?.length||i.texts?.length))},get dropped(){return n}}}var Pi=new Set([1,2,3,4,5,6,7,12]);function An(e){let t,r=!1,n=0;return{check(o){if(e<=0)return{keep:!0,resumed:!1};let i=o.timestamp??Date.now();if(t??=i,o.type===3&&Pi.has(o.data?.source??-1)){t=i;let s=r&&n>0;return r=!1,n=0,{keep:!0,resumed:s}}return!r&&i-t>e&&(r=!0),r?(n++,{keep:!1,resumed:!1}):{keep:!0,resumed:!1}}}}function Dn(e,t,r){let n=[],o;switch(t.mode){case"on_event":e.onCapture(i=>t.events.includes(i.event)&&r());break;case"on_flag":{let i=e.flags?.onChange(s=>s[t.flag]&&r());i&&n.push(i);break}case"on_url":try{o=new RegExp(t.pattern)}catch{e.log("bad on_url pattern",t.pattern)}break;case"on_frustration":{let i=[],s=a=>{let l=Date.now();for(i.push({t:l,x:a.clientX,y:a.clientY});i.length&&l-i[0].t>1e3;)i.shift();i.filter(u=>Math.hypot(u.x-a.clientX,u.y-a.clientY)<=30).length>=3&&r()};document.addEventListener("click",s,!0),n.push(()=>document.removeEventListener("click",s,!0));break}default:}return{checkUrl:i=>o?.test(i)&&r(),stop:()=>n.forEach(i=>i())}}var St="[redacted]",Ui=/^(authorization|proxy-authorization|cookie|set-cookie|x-api-key|x-auth-token|x-csrf-token)$/i,er=/pass(word|wd|phrase)?|secret|token|api[-_]?key|card|cvv|cvc|ssn|authorization/i;var Re=(e,t=4096)=>e.length>t?`${e.slice(0,t)}...[truncated ${e.length-t}]`:e;function tt(e){let t={};for(let r of Object.keys(e))t[r]=Ui.test(r)?St:Re(e[r]??"",512);return t}function Qt(e,t){if(t>6||e===null||typeof e!="object")return e;if(Array.isArray(e))return e.map(n=>Qt(n,t+1));let r={};for(let[n,o]of Object.entries(e))r[n]=er.test(n)?St:Qt(o,t+1);return r}function Be(e){if(e==null)return;if(typeof e!="string")return typeof URLSearchParams<"u"&&e instanceof URLSearchParams?Be(e.toString()):"[binary]";let t=e.trim();if(t.startsWith("{")||t.startsWith("["))try{return Re(JSON.stringify(Qt(JSON.parse(t),0)))}catch{}if(/^[^\s=&]+=[^\s]*$/.test(t)){let r=new URLSearchParams(t);for(let n of[...r.keys()])er.test(n)&&r.set(n,St);return Re(r.toString())}return Re(e)}function _n(e,t=1e3){try{if(typeof e=="string")return Re(e,t);if(e instanceof Error)return Re(`${e.name}: ${e.message}${e.stack?`
79
79
  ${e.stack}`:""}`,t);if(typeof Node<"u"&&e instanceof Node)return`<${e.nodeName.toLowerCase()}>`;if(typeof e=="function")return`[Function ${e.name||"anonymous"}]`;if(e===null||typeof e!="object")return String(e);let r=new WeakSet;return Re(JSON.stringify(e,(n,o)=>{if(typeof o=="bigint")return String(o);if(typeof Node<"u"&&o instanceof Node)return`<${o.nodeName.toLowerCase()}>`;if(o!==null&&typeof o=="object"){if(r.has(o))return"[Circular]";r.add(o)}return er.test(n)?St:o}),t)}catch{return"[unserializable]"}}var rt=(e,t)=>!!e?.some(r=>typeof r=="string"?t.includes(r):(r.lastIndex=0,r.test(t)));var Fn=["log","info","warn","error","debug"],$i=1e3,Bi=10;function zn(e,t){let r=0,n=!1,o=(c,u)=>{if(!(n||r>=$i)){n=!0;try{r++,e({level:c,args:t()?["[masked]"]:u.slice(0,Bi).map(p=>_n(p))})}catch{}finally{n=!1}}},i={},s={};for(let c of Fn){let u=console[c];i[c]=u,s[c]=function(...p){u.apply(this,p),o(c,p)},console[c]=s[c]}let a=c=>o("error",[c.error??c.message]),l=c=>o("error",["Unhandled rejection:",c.reason]);return window.addEventListener("error",a),window.addEventListener("unhandledrejection",l),()=>{for(let c of Fn)console[c]===s[c]&&(console[c]=i[c]);window.removeEventListener("error",a),window.removeEventListener("unhandledrejection",l)}}var Pn=e=>{let t={};return e.forEach((r,n)=>t[n]=r),t},Hi=e=>{let t={};for(let r of e.trim().split(/[\r\n]+/)){let n=r.indexOf(":");n>0&&(t[r.slice(0,n).trim().toLowerCase()]=r.slice(n+1).trim())}return t},nt=e=>{try{return new URL(e,location.href).href}catch{return e}};function Un(e,t,r){let n=d=>{try{if(r(d.url)||rt(t.deny,d.url)||t.allow&&!rt(t.allow,d.url))return;t.headers||(delete d.req?.headers,delete d.res?.headers),t.body||(delete d.req?.body,delete d.res?.body),d.req&&!d.req.headers&&!d.req.body&&delete d.req,d.res&&!d.res.headers&&!d.res.body&&delete d.res;let h=t.redact?t.redact(d):d;h&&e(h)}catch{}},o=d=>r(nt(d))||rt(t.deny,nt(d))||!!t.allow&&!rt(t.allow,nt(d)),i=window.fetch;window.fetch=function(d,h){let m=i.call(this,d,h);try{let f=nt(d instanceof Request?d.url:String(d));if(o(f))return m;let y=Date.now(),S=performance.now(),w=(h?.method??(d instanceof Request?d.method:"GET")).toUpperCase(),g=t.headers||t.body?{headers:tt(Pn(new Headers(h?.headers??(d instanceof Request?d.headers:void 0)))),body:Be(h?.body)}:void 0,b=k=>n({method:w,url:f,status:0,start:y,duration:Math.round(performance.now()-S),type:"fetch",req:g,...k});m.then(k=>{let R=Number(k.headers.get("content-length"))||void 0,E={status:k.status,size:R,res:t.headers?{headers:tt(Pn(k.headers))}:void 0};if(!t.body)return b(E);k.clone().text().then(I=>b({...E,size:R??I.length,res:{...E.res,body:Be(I)}}),()=>b(E))},k=>b({error:Re(String(k?.message??k),200)}))}catch{}return m};let s=window.fetch,a=XMLHttpRequest.prototype,{open:l,send:c,setRequestHeader:u}=a,p=new WeakMap;return a.open=function(d,h,...m){return p.set(this,{method:d.toUpperCase(),url:nt(String(h)),headers:{}}),l.call(this,d,h,...m)},a.setRequestHeader=function(d,h){let m=p.get(this);return m&&(m.headers[d.toLowerCase()]=h),u.call(this,d,h)},a.send=function(d){let h=p.get(this);if(h&&!o(h.url)){let m=Date.now(),f=performance.now();this.addEventListener("loadend",()=>{try{let y=t.body&&(this.responseType===""||this.responseType==="text")?this.responseText:void 0;n({method:h.method,url:h.url,status:this.status,start:m,duration:Math.round(performance.now()-f),size:Number(this.getResponseHeader("content-length"))||y?.length||void 0,type:"xhr",...this.status===0&&{error:"network error"},req:{headers:tt(h.headers),body:Be(d)},res:{headers:tt(Hi(this.getAllResponseHeaders())),body:y===void 0?void 0:Be(y)}})}catch{}})}return c.call(this,d)},()=>{window.fetch===s&&(window.fetch=i),a.open=l,a.send=c,a.setRequestHeader=u}}var Wi={on_event:"event_trigger_matched",on_url:"url_trigger_matched",on_flag:"linked_flag_matched",on_frustration:"frustration_detected"};function Gi(e){let t=parseInt(e.replace(/-/g,"").slice(0,12),16);return Number.isFinite(t)&&t>0?t:Date.now()}var ji=5*6e4,qi={$pageview:e=>({url:e.$current_url}),$pageleave:()=>({}),$form_start:e=>({form:e.form}),$form_submit:e=>({form:e.form}),$replay_tag:e=>({name:e.name})},Vi="********";function Ks(e,t,r,n){let{core:o}=e,i=e.config.apiHost,s=t.trigger_groups,a=t.trigger.mode,l=a==="on_url"&&n?.url_trigger||a==="on_event"&&n?.event_trigger||a==="on_flag"&&n?.linked_flag,u=!(s.length>0||a!=="always"&&!l),p=t.min_duration_ms,d=!!(n?.url_trigger||n?.event_trigger||n?.linked_flag);r.startReason=u?d?"trigger_overridden":n?.sampling?"sampling_overridden":"recording_initialized":void 0;let h=!1,m=!1,f=!1,y,S=!1,w=In(),g=t.min_duration_mode==="session"?Gi(o.sessionId):Date.now();r.bufferLength=()=>w.size;let b=()=>{r.status=S?"disabled":h?m?"excluded":"paused":u?"active":"buffering"},k=()=>{try{ue.takeFullSnapshot(!0)}catch{}},R=gn({url:`${i}/v1/replay`,apiKey:e.apiKey,fetch:e.fetch,ids:()=>({sessionId:o.sessionId,windowId:o.session.touch().windowId}),chunkBytes:t.chunk_bytes,flushMs:t.flush_interval_ms,hold:p>0||s.some(C=>(C.min_duration_ms??0)>0),onSent:(C,Z)=>{r.flushedBytes+=Z,r.ack(C)},onSessionChange:()=>k(),onGap:()=>k(),log:e.log}),E=xn(C=>{try{ue.addCustomEvent("page_height",{height:C})}catch{}}),I=ar(t.url_privacy_rules),x=kt(I,location.href),P="",H="",U,T=()=>{P=["[data-lc-mask]",...t.mask_selectors,...x.mask].join(","),H=["[data-lc-block]",...t.block_selectors,...x.block].join(","),U=t.mask_all_text||x.maskAllText?wn(P,["[data-lc-unmask]",...t.unmask_selectors].join(",")):void 0};T(),r.bufferBytes=()=>R.unsent;let X=t.mutationThrottle?Ln(t.mutationThrottle):void 0;r.throttled=()=>X?.dropped??0;let K=C=>{try{return C?[new URL(C).origin]:[]}catch{return[]}},N=En(t.assets,t.mask_all_text||I.some(C=>C.mask_all_text),[location.origin,...K(i),...K(e.config.uiHost)]),F=N&&(N.proxy||N.inlineImages)?Tn(N):void 0,W=!!t.canvas&&(t.canvasMask.length>0||!!t.canvasMaskRegions),G,de=t.maskUrlFn??(C=>Jr(C,e.config.urlPrivacy??{})),ne=An(t.idle_threshold_ms),ye=(C,Z)=>{if(h||S)return;let Q=ne.check(C);if(!Q.keep||(Q.resumed&&k(),X&&!X.allow(C)))return;C.type===2&&G?.reset();let Se=it=>ue.mirror.getNode(it);if(U?.scrub(C,Se),F?.scrub(C,Se),Sn(C,Se),de&&C.type===4&&typeof C.data?.href=="string"){let it=C.data;it.href=de(it.href)}C.type===3&&C.data?.source===0&&E.schedule(),u?R.add(C):w.push(C,!!Z)},te=t.crossOriginIframes,oe=!!te&&Cn(),j=oe&&!kn(te),ve=te&&!oe?Mn(te):void 0,me=j?void 0:Rn(C=>{try{return ue.addCustomEvent("keys",{n:C}),!0}catch{return!1}},()=>[P,H,"[data-lc-ignore]"].filter(Boolean).join(",")),ie=(C,Z)=>{if(!(h||S||!y))try{ue.addCustomEvent(C,Z)}catch{}},we=[];if(!j){let C=()=>t.mask_all_text||x.maskAllText;if(t.console&&we.push(zn(Z=>ie("console",Z),C)),t.network){let Z=`${(i??"").replace(/\/+$/,"")}/v1/`;we.push(Un(Q=>ie("network",{...Q,url:de?de(Q.url):Q.url}),t.network,Q=>Q.startsWith(Z)))}}let se=()=>{if(!(y||S||j)){try{y=D()}catch(C){r.status="rrweb_error",r.rrwebError=String(C).slice(0,200);return}W&&t.canvas&&(G=On({...t.canvas,skip:`${H},[data-lc-ignore]`,rules:t.canvasMask,regionsFn:t.canvasMaskRegions,idOf:C=>ue.mirror.getId(C),emit:C=>ye(C)})),E.reset(),b()}},D=()=>ue({emit:ye,checkoutEveryNms:u?ji:t.buffer_ms/2,maskAllInputs:t.mask_all_inputs,maskInputOptions:{...t.maskInputOptions,password:!0},maskInputFn:t.maskInputFn??(()=>Vi),maskTextSelector:U?"*":P,...U?{maskTextFn:U.maskTextFn}:t.maskTextFn&&{maskTextFn:t.maskTextFn},blockSelector:H,ignoreSelector:"[data-lc-ignore]",sampling:{mousemove:50,scroll:150,input:"last",...t.canvas&&!W&&{canvas:t.canvas.fps}},...t.canvas&&!W&&{dataURLOptions:{type:"image/jpeg",quality:t.canvas.quality}},...N?.inlineImages&&{inlineImages:!0},...N?.collectFonts&&{collectFonts:!0},errorHandler:C=>(r.rrwebErrors++,r.rrwebError=String(C).slice(0,200),!0),recordCrossOriginIframes:!!te,slimDOMOptions:{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0},recordCanvas:!!t.canvas&&!W})??void 0,Y=()=>{y?.(),y=void 0,G?.stop(),G=void 0},O=(C,Z)=>{if(!(u||S)){u=!0,r.startReason=C??Wi[a]??"recording_initialized",Z?.min_duration_ms!==void 0&&(p=Z.min_duration_ms),r.minDurationMs=p;for(let Q of w.drain())R.add(Q);Y(),h||se(),ae(),b()}},V,ae=()=>{!R.held||V!==void 0||(V=setTimeout(()=>R.release(),Math.max(0,p-(Date.now()-g))))},J=s.length?sr(e,s,()=>o.sessionId,C=>O("trigger_group_matched",C),{url:n?.url_trigger,event:n?.event_trigger,flag:n?.linked_flag,sampling:n?.sampling}):void 0,$=J??Dn(e,t.trigger,()=>O());J&&(r.triggers=J.states,r.matchedGroups=J.matched);let be="",He=()=>{if(location.href===be)return;be=location.href;let C=kt(I,be),Z=C.key!==x.key;Z&&(x=C,T());let Q=!!y,Se=nr(be,t.include_urls,t.exclude_urls);!Se&&!m?(m=h=!0,Y(),w.drain(),R.flush(),b()):Se&&m&&(m=!1,h=f,h||se(),b()),Se&&$.checkUrl(be),Z&&Q&&y&&(Y(),se())},$n=setInterval(He,1e3),Ct=window.navigation,ot=[],Ne=()=>He();if(Ct)Ct.addEventListener("currententrychange",Ne),ot.push(()=>Ct.removeEventListener("currententrychange",Ne));else for(let C of["pushState","replaceState"]){let Z=history[C],Q=function(...Se){Z.apply(this,Se),He()};history[C]=Q,ot.push(()=>{history[C]===Q&&(history[C]=Z)})}window.addEventListener("popstate",Ne),window.addEventListener("hashchange",Ne),ot.push(()=>(window.removeEventListener("popstate",Ne),window.removeEventListener("hashchange",Ne))),e.onCapture(C=>{C.event==="$pageview"&&He();let Z=qi[C.event];if(!(!Z||h||S||!y))try{let Q=Z(C.properties);de&&typeof Q.url=="string"&&(Q.url=de(Q.url)),ue.addCustomEvent(C.event,Q)}catch{}});let tr=()=>{document.visibilityState==="visible"?u&&y&&ue.takeFullSnapshot(!0):R.beacon()};return document.addEventListener("visibilitychange",tr),e.onUnload(()=>{R.held?R.discard():R.beacon()}),He(),J?.check(),h||se(),u&&ae(),b(),{stop:()=>{S=!0,Y(),clearInterval($n);for(let C of ot)C();clearTimeout(V),document.removeEventListener("visibilitychange",tr),ve?.(),E.stop(),me?.stop();for(let C of we)C();$.stop(),w.drain(),R.discard(),b()},paused:()=>h,pause(){f||S||(f=h=!0,Y(),w.drain(),R.flush(),b())},resume(){!f||S||(f=!1,h=m,h||se(),b())}}}export{Ks as startRecorder};
package/dist/replay.js CHANGED
@@ -1 +1 @@
1
- import{a as f,c as v,d as b,e as R,f as W,g as h,i as D,j as U}from"./chunk-UPPUYIIH.js";import"./chunk-EFNCQJI3.js";var k="lc_replay_ack",z=()=>{try{let e=sessionStorage.getItem(k);return e?[e]:[]}catch{return[]}};function j(){let e={status:"awaiting_config",disabledReason:void 0,startReason:void 0,sampleRate:void 0,minDurationMs:void 0,triggers:void 0,matchedGroups:void 0,bufferLength:void 0,flushedBytes:0,confirmed:new Set(z()),rrwebError:void 0,rrwebErrors:0,bufferBytes:void 0,throttled:void 0};return Object.assign(e,{ack(t){if(!e.confirmed.has(t)){e.confirmed.add(t);try{sessionStorage.setItem(k,t)}catch{}}},props(t){let i=e.triggers?.(),r={$recording_status:e.status,$has_recording:e.confirmed.has(t)};e.disabledReason&&(r.$replay_disabled_reason=e.disabledReason),e.startReason&&(r.$session_recording_start_reason=e.startReason),e.sampleRate!==void 0&&(r.$replay_sample_rate=e.sampleRate),e.minDurationMs!==void 0&&(r.$replay_minimum_duration=e.minDurationMs),i&&(r.$replay_url_trigger_status=i.url,r.$replay_event_trigger_status=i.event,r.$replay_linked_flag_trigger_status=i.flag);let d=e.matchedGroups?.();d?.length&&(r.$replay_trigger_groups_matched=d),e.bufferLength&&(r.$replay_buffer_length=e.bufferLength()),e.flushedBytes&&(r.$replay_flushed_size=e.flushedBytes),e.rrwebError&&(r.$replay_rrweb_error=e.rrwebError),e.rrwebErrors&&(r.$replay_rrweb_error_count=e.rrwebErrors);let c=e.bufferBytes?.();c&&(r.$replay_buffer_size=c);let a=e.throttled?.();return a&&(r.$replay_throttled_mutations=a),r}})}var C="lucida_replay_url";function E(e,t,i,r=2e3){let d={},c=()=>{if(!i())return;let o=globalThis,s=t();try{e.intercom&&typeof o.Intercom=="function"&&d.intercom!==s&&(o.Intercom("update",{[C]:s}),d.intercom=s),e.crisp&&typeof o.$crisp?.push=="function"&&d.crisp!==s&&(o.$crisp.push(["set","session:data",[[[C,s]]]]),d.crisp=s)}catch{}};c();let a=setInterval(c,r);return()=>clearInterval(a)}var Y=e=>{let t=j();e.eventExtras.push(n=>t.props(n));let i=e.config.replay??{},r=n=>{t.status="disabled",t.disabledReason=n};if(i.enabled===!1)return r("disabled_locally");let d=e.config.replayOwner??i.owner;if(!R(d))return d||console.warn("[lucida] replay is off: Watchtower is already recording this page. Set replayOwner: 'lucida' (or 'both') to record with Lucida too."),e.loadConfig(),r("owner_watchtower");if(navigator.connection?.saveData)return r("data_saver");let a="idle",o,s=0,g=!1,M=location.href,w=()=>e.core.hasConsent("analytics")&&e.core.hasConsent("replay"),m=async(n,_=!1)=>{if(a!=="idle")return;if(!w())return r("no_consent");a="starting",t.status="awaiting_config";let p=++s,u=await e.loadConfig(),x=f(u?.replay_never_record,M)||(!!n||_)&&f(u?.replay_never_record,location.href),l=x?null:v(i,u);if(p!==s)return void(a="idle");if(!l)return r(x?"never_record_page":"remote_disabled"),void(a="idle");let I=e.core.sessionId,$=l.trigger_groups.length>0,O=!!n?.sampling||$||h(I,"",l.sample_rate);if(t.sampleRate=$?void 0:l.sample_rate,t.minDurationMs=l.min_duration_ms,!O)return t.status=b(location.href,l.include_urls,l.exclude_urls)?"sampled":"excluded",void(a="idle");t.status="lazy_loading",t.disabledReason=void 0;let{startRecorder:P}=await import("./recorder-AJ7XX7OZ.js");if(p!==s)return void(a="idle");o=P(e,l,t,n),a="on"},S=()=>{s++,o?.stop(),o=void 0,a="idle"};e.replay={start:async n=>{g=!1;let _=n===!0,p=u=>_||typeof n=="object"&&!!n[u];await m({sampling:n===void 0||p("sampling"),url_trigger:p("url_trigger"),event_trigger:p("event_trigger"),linked_flag:p("linked_flag")})},stop:()=>{g=!0,S(),r("stopped_manually")},pause:()=>o?.pause(),resume:()=>o?.resume(),tag:n=>e.client.capture("$replay_tag",{name:n,session_id:e.core.sessionId}),isRecording:()=>a==="on"&&!o?.paused()},e.core.onChange(n=>{n==="consent"&&(w()?g||m(void 0,!0):(S(),r("no_consent")))}),m();let y=i.supportWidgets,T=y?.intercom||y?.crisp?E(y,()=>e.client.getReplayUrl(),()=>a==="on"&&!o?.paused()):void 0;return()=>{s++,o?.stop(),T?.()}};export{W as fnv1a32,R as lucidaRecords,U as pagePrivacy,f as policyMatches,Y as replay,v as resolveReplay,h as sampled,b as urlAllowed,D as urlRules};
1
+ import{a as f,c as v,d as b,e as R,f as W,g as h,i as D,j as U}from"./chunk-UPPUYIIH.js";import"./chunk-EFNCQJI3.js";var k="lc_replay_ack",z=()=>{try{let e=sessionStorage.getItem(k);return e?[e]:[]}catch{return[]}};function j(){let e={status:"awaiting_config",disabledReason:void 0,startReason:void 0,sampleRate:void 0,minDurationMs:void 0,triggers:void 0,matchedGroups:void 0,bufferLength:void 0,flushedBytes:0,confirmed:new Set(z()),rrwebError:void 0,rrwebErrors:0,bufferBytes:void 0,throttled:void 0};return Object.assign(e,{ack(t){if(!e.confirmed.has(t)){e.confirmed.add(t);try{sessionStorage.setItem(k,t)}catch{}}},props(t){let i=e.triggers?.(),r={$recording_status:e.status,$has_recording:e.confirmed.has(t)};e.disabledReason&&(r.$replay_disabled_reason=e.disabledReason),e.startReason&&(r.$session_recording_start_reason=e.startReason),e.sampleRate!==void 0&&(r.$replay_sample_rate=e.sampleRate),e.minDurationMs!==void 0&&(r.$replay_minimum_duration=e.minDurationMs),i&&(r.$replay_url_trigger_status=i.url,r.$replay_event_trigger_status=i.event,r.$replay_linked_flag_trigger_status=i.flag);let d=e.matchedGroups?.();d?.length&&(r.$replay_trigger_groups_matched=d),e.bufferLength&&(r.$replay_buffer_length=e.bufferLength()),e.flushedBytes&&(r.$replay_flushed_size=e.flushedBytes),e.rrwebError&&(r.$replay_rrweb_error=e.rrwebError),e.rrwebErrors&&(r.$replay_rrweb_error_count=e.rrwebErrors);let c=e.bufferBytes?.();c&&(r.$replay_buffer_size=c);let a=e.throttled?.();return a&&(r.$replay_throttled_mutations=a),r}})}var C="lucida_replay_url";function E(e,t,i,r=2e3){let d={},c=()=>{if(!i())return;let o=globalThis,s=t();try{e.intercom&&typeof o.Intercom=="function"&&d.intercom!==s&&(o.Intercom("update",{[C]:s}),d.intercom=s),e.crisp&&typeof o.$crisp?.push=="function"&&d.crisp!==s&&(o.$crisp.push(["set","session:data",[[[C,s]]]]),d.crisp=s)}catch{}};c();let a=setInterval(c,r);return()=>clearInterval(a)}var Y=e=>{let t=j();e.eventExtras.push(n=>t.props(n));let i=e.config.replay??{},r=n=>{t.status="disabled",t.disabledReason=n};if(i.enabled===!1)return r("disabled_locally");let d=e.config.replayOwner??i.owner;if(!R(d))return d||console.warn("[lucida] replay is off: Watchtower is already recording this page. Set replayOwner: 'lucida' (or 'both') to record with Lucida too."),e.loadConfig(),r("owner_watchtower");if(navigator.connection?.saveData)return r("data_saver");let a="idle",o,s=0,g=!1,M=location.href,w=()=>e.core.hasConsent("analytics")&&e.core.hasConsent("replay"),m=async(n,_=!1)=>{if(a!=="idle")return;if(!w())return r("no_consent");a="starting",t.status="awaiting_config";let p=++s,u=await e.loadConfig(),x=f(u?.replay_never_record,M)||(!!n||_)&&f(u?.replay_never_record,location.href),l=x?null:v(i,u);if(p!==s)return void(a="idle");if(!l)return r(x?"never_record_page":"remote_disabled"),void(a="idle");let I=e.core.sessionId,$=l.trigger_groups.length>0,O=!!n?.sampling||$||h(I,"",l.sample_rate);if(t.sampleRate=$?void 0:l.sample_rate,t.minDurationMs=l.min_duration_ms,!O)return t.status=b(location.href,l.include_urls,l.exclude_urls)?"sampled":"excluded",void(a="idle");t.status="lazy_loading",t.disabledReason=void 0;let{startRecorder:P}=await import("./recorder-MHNUIAAP.js");if(p!==s)return void(a="idle");o=P(e,l,t,n),a="on"},S=()=>{s++,o?.stop(),o=void 0,a="idle"};e.replay={start:async n=>{g=!1;let _=n===!0,p=u=>_||typeof n=="object"&&!!n[u];await m({sampling:n===void 0||p("sampling"),url_trigger:p("url_trigger"),event_trigger:p("event_trigger"),linked_flag:p("linked_flag")})},stop:()=>{g=!0,S(),r("stopped_manually")},pause:()=>o?.pause(),resume:()=>o?.resume(),tag:n=>e.client.capture("$replay_tag",{name:n,session_id:e.core.sessionId}),isRecording:()=>a==="on"&&!o?.paused()},e.core.onChange(n=>{n==="consent"&&(w()?g||m(void 0,!0):(S(),r("no_consent")))}),m();let y=i.supportWidgets,T=y?.intercom||y?.crisp?E(y,()=>e.client.getReplayUrl(),()=>a==="on"&&!o?.paused()):void 0;return()=>{s++,o?.stop(),T?.()}};export{W as fnv1a32,R as lucidaRecords,U as pagePrivacy,f as policyMatches,Y as replay,v as resolveReplay,h as sampled,b as urlAllowed,D as urlRules};
@@ -1 +1 @@
1
- import{a as M,b as c}from"./chunk-IXDYCBAD.js";import"./chunk-EFNCQJI3.js";var a={onlyIfChanged:!0,cookie:!0};function g(n){if(n.gdprApplies===!1)return;let e=n.purpose?.consents??{},t=!!e[1]&&!!e[7];return{analytics:t,replay:t&&!!e[8],marketing:!!e[1]&&!!e[4]}}function m(n){let e=i=>i in n?n[i]==="granted":void 0,t={},s=e("analytics_storage");s!==void 0&&(t.analytics=t.replay=s);let o=e("ad_storage"),r=e("ad_user_data");return o!==void 0&&(t.marketing=o&&r!==!1),t}function v(n){let e=typeof n=="string"?n.split(","):n,t=e.includes("C0002");return{analytics:t,replay:t,marketing:e.includes("C0004")}}function y(n){return{analytics:!!n.statistics,replay:!!n.statistics,marketing:!!n.marketing}}function w(n,e){for(let[t,s]of Object.entries(e))typeof s=="boolean"&&n.categoryGrants.set(t,s)}function k(n,e){return{analytics:!!n.statistics,replay:e?!!n[e]:!!n.statistics,marketing:!!n.marketing}}var O=n=>{let e,s=u(()=>{let o=window.__tcfapi;return typeof o!="function"?!1:(o("addEventListener",2,(r,i)=>{if(!i||r.eventStatus!=="tcloaded"&&r.eventStatus!=="useractioncomplete")return;e=r.listenerId;let d=g(r);d&&c(n,d,"tcf",a)}),!0)});return()=>{s();let o=window.__tcfapi;e!==void 0&&typeof o=="function"&&o("removeEventListener",2,()=>{},e)}},U=n=>{let e=window,t=e.dataLayer??=[],s=r=>{let i=r;i&&typeof i=="object"&&i[0]==="consent"&&(i[1]==="default"||i[1]==="update")&&i[2]&&typeof i[2]=="object"&&c(n,m(i[2]),"gcm",a)};t.forEach(s);let o=t.push;return t.push=function(...r){return r.forEach(s),o.apply(this,r)},()=>{t.push=o}},x=n=>{let e=o=>{(typeof o=="string"||Array.isArray(o))&&c(n,v(o),"onetrust",a)},t=window,s=o=>e(o.detail??t.OnetrustActiveGroups);return window.addEventListener("OneTrustGroupsUpdated",s),e(t.OnetrustActiveGroups),()=>window.removeEventListener("OneTrustGroupsUpdated",s)},_=n=>{let e=window,t=()=>{let o=e.Cookiebot;!o?.consent||o.hasResponse===!1||(w(n,o.consent),c(n,y(o.consent),"cookiebot",a))},s=["CookiebotOnConsentReady","CookiebotOnAccept","CookiebotOnDecline"];for(let o of s)window.addEventListener(o,t);return t(),()=>s.forEach(o=>window.removeEventListener(o,t))};function b(n){let e=n.ANALYTICS==="ACCEPT";return{analytics:e,replay:e,marketing:n.MARKETING==="ACCEPT"}}function u(n){if(n())return()=>{};let e=0,t=setInterval(()=>(n()||++e>40)&&clearInterval(t),250);return()=>clearInterval(t)}var f=["osano-cm-initialized","osano-cm-consent-saved","osano-cm-consent-changed"],L=n=>{let e,t=o=>{let r=o&&typeof o=="object"&&Object.keys(o).length?o:e?.getConsent?.();r&&Object.keys(r).length&&c(n,b(r),"osano",a)},s=u(()=>{if(e=window.Osano?.cm,!e)return!1;for(let o of f)e.addEventListener?.(o,t);return t(e.getConsent?.()),!0});return()=>{s();for(let o of f)e?.removeEventListener?.(o,t)}};function E(n,e="Lucida"){let t=n.find(r=>r.name.toLowerCase()===e.toLowerCase());if(!t)return;let s=t.consent?.status===!0,o=n.filter(r=>r.categorySlug==="marketing");return{analytics:s,replay:s,marketing:o.length>0&&o.every(r=>r.consent?.status===!0)}}var l=["UC_UI_INITIALIZED","UC_UI_CMP_EVENT","ucEvent","UC_CONSENT"];function h(n="Lucida"){return e=>{let t=()=>{let i=window.UC_UI?.getServicesBaseInfo?.();if(!i)return!1;let d=E(i,n);return d?c(e,d,"usercentrics",a):e.log(`usercentrics: no service named "${n}"; consent left unchanged`),!0},s=()=>{t()};for(let r of l)window.addEventListener(r,s);let o=u(t);return()=>{o();for(let r of l)window.removeEventListener(r,s)}}}var S=h(),C=["CookieMunchOnConsentReady","CookieMunchOnChange"];function A(n,e){let t=e?.detail??{};for(let s of[t.receiptId,t.consentReceiptId,t.consentId,t.ledgerId,n.receiptId,n.consentReceiptId,n.consentId,n.ledgerId])if(typeof s=="string"&&s)return s.slice(0,128)}function T(n={}){return e=>{let t=s=>{let o=window.CookieMunch;if(!o?.consent||o.hasResponse!==!0)return;w(e,o.consent);let r=A(o,s);c(e,k(o.consent,n.replayCategory),"cookiemunch",{...a,...r?{receiptId:r}:{}})};for(let s of C)window.addEventListener(s,t);return t(),()=>C.forEach(s=>window.removeEventListener(s,t))}}var p=T();var I=n=>{n.consentUi={showBanner:async e=>(await import("./banner-TXLAMTQM.js")).showBanner(n,e),hideBanner:()=>{import("./banner-TXLAMTQM.js").then(e=>e.hideBanner())}}};var D=n=>(I(n),p(n));export{M as CONSENT_EVENT,c as applyConsent,I as consentBanner,D as consentModule,T as cookieMunchBridge,p as cookieMunchConsent,k as cookieMunchToConsent,_ as cookiebotConsent,y as cookiebotToConsent,U as gcmConsent,m as gcmToConsent,x as oneTrustConsent,v as oneTrustToConsent,L as osanoConsent,b as osanoToConsent,O as tcfConsent,g as tcfToConsent,h as usercentricsBridge,S as usercentricsConsent,E as usercentricsToConsent};
1
+ import{a as M,b as c}from"./chunk-IXDYCBAD.js";import"./chunk-EFNCQJI3.js";var a={onlyIfChanged:!0,cookie:!0};function g(n){if(n.gdprApplies===!1)return;let e=n.purpose?.consents??{},o=!!e[1]&&!!e[7];return{analytics:o,replay:o&&!!e[8],marketing:!!e[1]&&!!e[4]}}function m(n){let e=i=>i in n?n[i]==="granted":void 0,o={},r=e("analytics_storage");r!==void 0&&(o.analytics=o.replay=r);let t=e("ad_storage"),s=e("ad_user_data");return t!==void 0&&(o.marketing=t&&s!==!1),o}function y(n){let e=typeof n=="string"?n.split(","):n,o=e.includes("C0002");return{analytics:o,replay:o,marketing:e.includes("C0004")}}function v(n){return{analytics:!!n.statistics,replay:!!n.statistics,marketing:!!n.marketing}}function w(n,e){for(let[o,r]of Object.entries(e))typeof r=="boolean"&&n.categoryGrants.set(o,r)}function k(n,e){return{analytics:!!n.statistics,replay:e?!!n[e]:!!n.statistics,marketing:!!n.marketing}}var O=n=>{let e,r=u(()=>{let t=window.__tcfapi;return typeof t!="function"?!1:(t("addEventListener",2,(s,i)=>{if(!i||s.eventStatus!=="tcloaded"&&s.eventStatus!=="useractioncomplete")return;e=s.listenerId;let d=g(s);d&&c(n,d,"tcf",a)}),!0)});return()=>{r();let t=window.__tcfapi;e!==void 0&&typeof t=="function"&&t("removeEventListener",2,()=>{},e)}},_=n=>{let e=window,o=e.dataLayer??=[],r=s=>{let i=s;i&&typeof i=="object"&&i[0]==="consent"&&(i[1]==="default"||i[1]==="update")&&i[2]&&typeof i[2]=="object"&&c(n,m(i[2]),"gcm",a)};o.forEach(r);let t=o.push;return o.push=function(...s){return s.forEach(r),t.apply(this,s)},()=>{o.push=t}},U=n=>{let e=t=>{(typeof t=="string"||Array.isArray(t))&&c(n,y(t),"onetrust",a)},o=window,r=t=>e(t.detail??o.OnetrustActiveGroups);return window.addEventListener("OneTrustGroupsUpdated",r),e(o.OnetrustActiveGroups),()=>window.removeEventListener("OneTrustGroupsUpdated",r)},x=n=>{let e=window,o=()=>{let t=e.Cookiebot;!t?.consent||t.hasResponse===!1||(w(n,t.consent),c(n,v(t.consent),"cookiebot",a))},r=["CookiebotOnConsentReady","CookiebotOnAccept","CookiebotOnDecline"];for(let t of r)window.addEventListener(t,o);return o(),()=>r.forEach(t=>window.removeEventListener(t,o))};function b(n){let e=n.ANALYTICS==="ACCEPT";return{analytics:e,replay:e,marketing:n.MARKETING==="ACCEPT"}}function u(n){if(n())return()=>{};let e=0,o=setInterval(()=>(n()||++e>40)&&clearInterval(o),250);return()=>clearInterval(o)}var p=["osano-cm-initialized","osano-cm-consent-saved","osano-cm-consent-changed"],S=n=>{let e,o=t=>{let s=t&&typeof t=="object"&&Object.keys(t).length?t:e?.getConsent?.();s&&Object.keys(s).length&&c(n,b(s),"osano",a)},r=u(()=>{if(e=window.Osano?.cm,!e)return!1;for(let t of p)e.addEventListener?.(t,o);return o(e.getConsent?.()),!0});return()=>{r();for(let t of p)e?.removeEventListener?.(t,o)}};function E(n,e="Lucida"){let o=n.find(s=>s.name.toLowerCase()===e.toLowerCase());if(!o)return;let r=o.consent?.status===!0,t=n.filter(s=>s.categorySlug==="marketing");return{analytics:r,replay:r,marketing:t.length>0&&t.every(s=>s.consent?.status===!0)}}var l=["UC_UI_INITIALIZED","UC_UI_CMP_EVENT","ucEvent","UC_CONSENT"];function h(n="Lucida"){return e=>{let o=()=>{let i=window.UC_UI?.getServicesBaseInfo?.();if(!i)return!1;let d=E(i,n);return d?c(e,d,"usercentrics",a):e.log(`usercentrics: no service named "${n}"; consent left unchanged`),!0},r=()=>{o()};for(let s of l)window.addEventListener(s,r);let t=u(o);return()=>{t();for(let s of l)window.removeEventListener(s,r)}}}var L=h(),C=["CookieMunchOnConsentReady","CookieMunchOnChange"];function A(n){let e=async()=>{try{let t=await window.CookieMunch?.getSubjectId?.();typeof t=="string"&&t&&n.client.setPersonProperties({$cm_subject_id:t})}catch{}},o=n.client,r=o.identify;return o.identify=(t,s,i)=>{r(t,s,i),s?.$cm_subject_id===void 0&&e()},n.core.identity.isIdentified&&e(),()=>{o.identify=r}}function R(n,e){let o=e?.detail??{};for(let r of[o.receiptId,o.consentReceiptId,o.consentId,o.ledgerId,n.receiptId,n.consentReceiptId,n.consentId,n.ledgerId])if(typeof r=="string"&&r)return r.slice(0,128)}function T(n={}){return e=>{let o=t=>{let s=window.CookieMunch;if(!s?.consent||s.hasResponse!==!0)return;w(e,s.consent);let i=R(s,t);c(e,k(s.consent,n.replayCategory),"cookiemunch",{...a,...i?{receiptId:i}:{}})};for(let t of C)window.addEventListener(t,o);o();let r=A(e);return()=>{r(),C.forEach(t=>window.removeEventListener(t,o))}}}var f=T();var I=n=>{n.consentUi={showBanner:async e=>(await import("./banner-TXLAMTQM.js")).showBanner(n,e),hideBanner:()=>{import("./banner-TXLAMTQM.js").then(e=>e.hideBanner())}}};var D=n=>(I(n),f(n));export{M as CONSENT_EVENT,c as applyConsent,I as consentBanner,D as consentModule,T as cookieMunchBridge,f as cookieMunchConsent,k as cookieMunchToConsent,x as cookiebotConsent,v as cookiebotToConsent,_ as gcmConsent,m as gcmToConsent,U as oneTrustConsent,y as oneTrustToConsent,S as osanoConsent,b as osanoToConsent,O as tcfConsent,g as tcfToConsent,h as usercentricsBridge,L as usercentricsConsent,E as usercentricsToConsent};
@@ -1,3 +1,3 @@
1
1
  var J="lc_consent";function ye(n,e,t){return e==="opt_in"?"opt_in":t==="opt_in"||t==="opt_out"||t==="cookieless"?t:e==="opt_out"?n:void 0}var me=["analytics","replay","marketing"],F=class{constructor(e){this.o=e;this.modeNow=e.mode??"opt_out",this.queueBeforeConsent=e.queueBeforeConsent??!1;let t=this.opens();this.state={analytics:t,replay:t,marketing:t},this.key=e.storageKey||J;let s=e.storage.get(this.key);if(s)try{let r=JSON.parse(s);for(let o of me)typeof r[o]=="boolean"&&(this.state[o]=r[o]);this.decided=me.some(o=>typeof r[o]=="boolean")}catch{}this.waiting=!!e.awaitRemote&&!this.decided,this.waiting&&(this.state={analytics:!1,replay:!1,marketing:!1})}o;modeNow;queueBeforeConsent;state;decided=!1;waiting;geoCookieless=!1;key;listeners=[];opens(){return this.modeNow==="opt_out"&&!(this.o.respectDnt&&this.o.dnt)}get mode(){return this.modeNow}get resolving(){return this.waiting}get anonymous(){return this.geoCookieless&&!this.decided}resolve(e){if(!this.waiting)return this.state.analytics;this.waiting=!1,(e==="opt_in"||e==="opt_out")&&(this.modeNow=e),this.geoCookieless=e==="cookieless";let t=!this.geoCookieless&&this.opens();return this.state={analytics:t,replay:t,marketing:t},t}get(){return{...this.state}}has(e){return this.state[e]}status(e="analytics"){return this.decided?this.state[e]?"granted":"denied":"pending"}get pending(){return this.waiting||this.modeNow==="opt_in"&&!this.state.analytics}set(e){let t=this.get();for(let s of me)e[s]!==void 0&&(this.state[s]=e[s]);this.decided=!0,this.waiting=!1,this.o.storage.set(this.key,JSON.stringify(this.state));for(let s of this.listeners)s(this.get(),t)}onChange(e){this.listeners.push(e)}},I=class{constructor(e,t){this.inner=e;this.allowed=t}inner;allowed;mem=new Map;get(e){return this.mem.has(e)?this.mem.get(e)??null:this.inner.get(e)}set(e,t){this.allowed()?this.inner.set(e,t):this.mem.set(e,t)}remove(e){this.allowed()?this.inner.remove(e):this.mem.set(e,null)}flushBuffered(){for(let[e,t]of this.mem)t===null?this.inner.remove(e):this.inner.set(e,t);this.mem.clear()}discardBuffered(){this.mem.clear()}};var Q=0,A=0;function Ge(n){let e=new Uint8Array(n),t=globalThis.crypto;if(t?.getRandomValues)t.getRandomValues(e);else for(let s=0;s<n;s++)e[s]=Math.floor(Math.random()*256);return e}function P(n=Date.now()){if(n>Q){Q=n;let o=Ge(2);A=((o[0]??0)<<8|(o[1]??0))&1023}else A++,A>4095&&(Q++,A=0);let e=Ge(8),t=new Uint8Array(16),s=Q;t[0]=Math.floor(s/2**40)&255,t[1]=Math.floor(s/2**32)&255,t[2]=Math.floor(s/2**24)&255,t[3]=Math.floor(s/2**16)&255,t[4]=Math.floor(s/2**8)&255,t[5]=s&255,t[6]=112|A>>8,t[7]=A&255,t[8]=128|(e[0]??0)&63;for(let o=1;o<8;o++)t[8+o]=e[o]??0;let r=Array.from(t,o=>o.toString(16).padStart(2,"0")).join("");return`${r.slice(0,8)}-${r.slice(8,12)}-${r.slice(12,16)}-${r.slice(16,20)}-${r.slice(20)}`}var Ye="lc_identity",X=class{constructor(e,t,s=!1,r=!1){this.storage=e;this.cookieless=s;let o=e.get(Ye),a;try{a=o?JSON.parse(o):void 0}catch{a=void 0}if(a?.distinct_id)this.s=a;else if(s)this.s={distinct_id:"",anon_id:"",identified:!1};else{let u=t??P();this.s={distinct_id:u,anon_id:u,identified:r&&!!t},this.save()}}storage;cookieless;s;save(){this.storage.set(Ye,JSON.stringify(this.s))}get distinctId(){return this.s.distinct_id}get priorAnonId(){return this.s.identified&&this.s.anon_id&&this.s.anon_id!==this.s.distinct_id?this.s.anon_id:void 0}get isIdentified(){return this.s.identified}identify(e){if(!e||e===this.s.distinct_id)return e&&!this.s.identified&&(this.s.identified=!0,this.save()),{event:null};let t=this.s.distinct_id,s=!this.s.identified;return this.s={...this.s,distinct_id:e,identified:!0},this.save(),s&&t?{event:"$identify",anonDistinctId:t}:{event:"$identify"}}aliasProps(e,t){return{alias:e,distinct_id:t??this.s.distinct_id}}reset(e=!1){if(this.cookieless){this.s={distinct_id:"",anon_id:"",identified:!1};return}let t=e&&this.s.anon_id||P();this.s={distinct_id:t,anon_id:t,identified:!1},this.save()}};function N(n,e={}){let t=Math.min(e.maxMs??3e4,(e.baseMs??1e3)*2**n);return Math.round(t*(.5+.5*(e.random??Math.random)()))}function Je(n){return n===0||n===408||n===429||n>=500}var Z=class{constructor(e){this.o=e;this.flushAt=e.flushAt??20,this.intervalMs=e.flushIntervalMs??5e3,this.maxSize=e.maxQueueSize??1e3,this.maxRetries=e.maxRetries??5,this.batchMax=Math.max(1,Math.min(e.maxBatchSize??1e3,1e3))}o;items=[];timer;attempt=0;inflight;closed=!1;warned404=!1;flushAt;intervalMs;maxSize;maxRetries;batchMax;get size(){return this.items.length}enqueue(e){this.closed||(this.items.push(e),this.items.length>this.maxSize&&this.o.onDrop?.(this.items.splice(0,this.items.length-this.maxSize),"queue_full"),this.items.length>=this.flushAt?this.flush():this.arm(this.intervalMs))}arm(e){this.timer===void 0&&(this.timer=setTimeout(()=>{this.timer=void 0,this.flush()},e))}disarm(){this.timer!==void 0&&clearTimeout(this.timer),this.timer=void 0}flush(e={}){if(this.disarm(),this.inflight)return this.inflight.then(()=>this.items.length?this.flush(e):void 0);if(!this.items.length)return Promise.resolve();let t=this.items.splice(0,this.batchMax),s=(this.o.clock??Date).now(),r=JSON.stringify({api_key:this.o.apiKey,batch:t,sent_at:new Date(s).toISOString()});this.o.log?.("send batch",t.length);let o=this.o.transport.send(this.o.url,r,e.beacon?{beacon:!0}:{}).then(a=>a,()=>({status:0,retryAfterMs:void 0})).then(a=>this.settle(t,a.status,!!e.beacon,a.retryAfterMs)).finally(()=>{this.inflight=void 0});return this.inflight=o,o}settle(e,t,s,r){if(t>=200&&t<300){this.attempt=0,this.items.length>=this.flushAt?this.flush():this.items.length&&this.arm(this.intervalMs);return}if(!Je(t)||s||this.attempt>=this.maxRetries){t===404&&!this.warned404&&(this.warned404=!0,console.warn(`[lucida] ${this.o.url} returned 404, so events are being dropped. apiHost is probably wrong: use https://capture.lucidace.com (or your own capture host), not the app host.`)),this.o.onDrop?.(e,`status_${t}`),this.attempt=0;return}this.items.unshift(...e);let o=Math.max(N(this.attempt++,this.o.backoff),Math.min(r??0,6e4));this.o.log?.("retry in",o,"ms"),this.arm(o)}clear(){this.items=[],this.disarm()}async shutdown(){await this.flush(),this.closed=!0,this.disarm()}};var ve="lc_session";function Qe(n,e,t){return typeof n=="number"&&Number.isInteger(n)&&n>=e&&n<=t?n*6e4:void 0}var Nt=6e4,Bt=10*36e5,Ut=24*36e5,qt=/^([0-9a-f]{8})-?([0-9a-f]{4})-7[0-9a-f]{3}-/i;function Ht(n,e){let t=qt.exec(n);if(!t)return!0;let s=parseInt(t[1]+t[2],16);return s-e<=6e4&&e-s<=Ut}var ee=class{constructor(e,t={}){this.storage=e;this.o=t;this.idleMs=Math.min(Bt,Math.max(Nt,t.idleMs??30*6e4)),this.maxMs=t.maxMs??24*36e5,this.newOn=t.newOnEvents??[],this.clock=t.clock??{now:()=>Date.now()},this.bootstrapId=t.bootstrapId}storage;o;windowId=P();idleMs;maxMs;newOn;clock;bootstrapId;configure(e){this.o.idleMs===void 0&&(this.idleMs=Qe(e.session_idle_minutes,1,600)??this.idleMs),this.o.maxMs===void 0&&(this.maxMs=Qe(e.session_max_minutes,5,10080)??this.maxMs),this.o.newOnEvents===void 0&&Array.isArray(e.session_new_on_events)&&(this.newOn=e.session_new_on_events.filter(t=>typeof t=="string"&&t!==""))}read(){try{let e=this.storage.get(ve);return e?JSON.parse(e):void 0}catch{return}}touch(e,t){let s=this.clock.now(),r=this.read(),o=!!(r?.campaign&&e&&r.campaign!==e),a=t!==void 0&&this.newOn.includes(t),u=!r||Math.abs(s-r.last)>this.idleMs||Math.abs(s-r.start)>this.maxMs||o||a;return(u||!r)&&(r={id:!r&&this.bootstrapId&&Ht(this.bootstrapId,s)?this.bootstrapId:P(s),start:s,last:s}),this.bootstrapId=void 0,r.last=s,e&&(r.campaign=e),this.storage.set(ve,JSON.stringify(r)),{sessionId:r.id,windowId:this.windowId,isNew:u}}startedAt(){return this.read()?.start}reset(){this.storage.remove(ve)}};function Xe(n,e){let t=n.get(e);if(t)try{return JSON.parse(t)}catch{return}}var te=class{constructor(e,t="lc_props",s){this.storage=e;this.key=t;this.persist=s;this.p=Xe(e,t)??{}}storage;key;persist;p;save(){let e=this.persist;this.storage.set(this.key,JSON.stringify(e?Object.fromEntries(Object.entries(this.p).filter(([t])=>e(t))):this.p))}register(e){Object.assign(this.p,e),this.save()}registerOnce(e){for(let[t,s]of Object.entries(e))t in this.p||(this.p[t]=s);this.save()}unregister(e){delete this.p[e],this.save()}all(){return{...this.p}}clear(){this.p={},this.storage.remove(this.key)}},ne=class{constructor(e){this.storage=e;this.g=Xe(e,"lc_groups")??{}}storage;g;set(e,t){this.g[e]=t,this.storage.set("lc_groups",JSON.stringify(this.g))}all(){return Object.keys(this.g).length?{...this.g}:void 0}clear(){this.g={},this.storage.remove("lc_groups")}};function Wt(n,e){let t=new Date(n??e);return(Number.isNaN(t.getTime())?new Date(e):t).toISOString()}var B=class{constructor(e){this.c=e;this.clock=e.clock??{now:()=>Date.now()},this.consent=new F({...e.consent,storage:e.consentStorage??e.storage}),this.gated=new I(e.storage,()=>this.consent.has("analytics")),this.storage=this.gated,this.identity=new X(this.gated,e.bootstrapDistinctId,e.cookieless,e.bootstrapIdentified),this.session=new ee(this.gated,{clock:this.clock,...e.session}),this.props=new te(this.gated,void 0,e.persistProperty),this.groupState=new ne(this.gated),this.queue=new Z({transport:e.transport,url:`${e.apiHost.replace(/\/+$/,"")}/v1/batch`,apiKey:e.apiKey,clock:this.clock,...e.log?{log:e.log}:{},...e.onDrop?{onDrop:e.onDrop}:{},...e.queue})}c;consent;identity;session;queue;storage;gated;props;groupState;clock;device;pre=[];listeners=[];captureListeners=[];sessionListeners=[];lastSession="";filter;get anonDistinctId(){return this.identity.priorAnonId}get distinctId(){return this.identity.distinctId}get deviceId(){return this.c.cookieless?"":(this.device||(this.device=this.gated.get("lc_device_id")||P(),this.gated.set("lc_device_id",this.device)),this.device)}get groups(){return this.groupState.all()}get sessionId(){return this.touchSession().sessionId}touchSession(e){let t=this.session.touch(this.c.campaignKey?.(),e);if(t.sessionId!==this.lastSession){this.lastSession=t.sessionId;for(let s of this.sessionListeners)s(t.sessionId,t.windowId)}return t}onSessionId(e){return this.sessionListeners.push(e),()=>{this.sessionListeners.splice(this.sessionListeners.indexOf(e),1)}}get sessionStart(){return this.session.startedAt()}getProperty(e){return this.props.all()[e]}setFilter(e){this.filter=e}onChange(e){this.listeners.push(e)}onCaptured(e){this.captureListeners.push(e)}emit(e){for(let t of this.listeners)t(e)}consentStatus(){return this.consent.status()}get anonymousOnReject(){return!!this.c.consent?.cookielessOnReject&&this.consent.status()==="denied"}capture(e,t={},s={}){let r=this.consent.has("analytics"),o=!r&&(this.anonymousOnReject||this.consent.anonymous),a=this.consent.pending&&(this.consent.queueBeforeConsent||this.consent.resolving);if(!r&&!o&&!a){this.c.log?.("dropped (no consent)",e);return}if(o&&(e==="$identify"||e==="$create_alias")){this.c.log?.("withheld (declined, anonymous mode)",e);return}let u=this.touchSession(e),p=this.c.enrich?.(e,t),h=this.consent.status()!=="pending",m=o?{}:{...p?.$set,...s.$set,...e==="$consent_updated"&&h?{$consent:this.consent.get()}:{}},_=o?{}:{...p?.$set_once,...s.$set_once},$=this.groupState.all(),g=o?"":this.identity.distinctId,v={uuid:P(this.clock.now()),event:e,...g?{distinct_id:g}:{},timestamp:Wt(s.timestamp,this.clock.now()),properties:{...this.props.all(),...p?.properties,...t,$session_id:u.sessionId,$window_id:u.windowId,$lib:this.c.library.name,$lib_version:this.c.library.version,...h?{$consent:this.consent.get()}:{}},...Object.keys(m).length?{$set:m}:{},...Object.keys(_).length?{$set_once:_}:{},...!o&&s.$unset?.length?{$unset:s.$unset}:{},...$?{$groups:$}:{}},b=this.filter?this.filter(v):v;if(!b){this.c.log?.("dropped (policy)",e);return}this.c.log?.("capture",e,b),this.c.onCapture?.(b);for(let w of this.captureListeners)w(b);return r||o?this.queue.enqueue(b):this.pre.length<(this.c.queue?.maxQueueSize??1e3)&&this.pre.push(b),b}identify(e,t,s){let r=this.identity.identify(e);(r.event||t||s)&&this.capture("$identify",r.anonDistinctId?{$anon_distinct_id:r.anonDistinctId}:{},{...t?{$set:t}:{},...s?{$set_once:s}:{}}),this.emit("identify")}alias(e,t){this.capture("$create_alias",this.identity.aliasProps(e,t))}reset(e={}){this.identity.reset(e.reuseAnonymousId),e.resetDeviceId&&(this.device=void 0,this.gated.remove("lc_device_id")),this.props.clear(),this.groupState.clear(),this.session.reset(),this.lastSession="",this.emit("reset")}register(e){this.props.register(e)}registerOnce(e){this.props.registerOnce(e)}unregister(e){this.props.unregister(e)}group(e,t,s){this.groupState.set(e,t),this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:s??{}}),this.emit("group")}getConsent(){return this.consent.get()}getConsentStatus(e="analytics"){return this.consent.status(e)}hasConsent(e){return this.consent.has(e)}setConsent(e){let t=this.consent.has("analytics"),s=e.analytics??t;if(t&&!s&&(this.capture("$opt_out"),this.queue.flush()),!t&&s&&(this.anonymousOnReject||this.consent.anonymous)&&this.queue.flush(),this.consent.set(e),!t&&s){this.gated.flushBuffered();for(let r of this.pre.splice(0))this.queue.enqueue(r);this.capture("$opt_in")}else t&&!s&&this.queue.clear();s||(this.pre.length=0),this.emit("consent")}applyRemote(e){this.session.configure(e),this.resolveConsent(ye(this.consent.mode,e.consent_mode,e.consent_default))}resolveConsent(e){if(!this.consent.resolving)return;let t=this.consent.resolve(e),s=this.pre.splice(0);if(t){this.gated.flushBuffered();for(let r of s)this.queue.enqueue(r)}else if(this.consent.anonymous){this.gated.discardBuffered();for(let r of s){if(r.event==="$identify"||r.event==="$create_alias")continue;let o={...r};delete o.distinct_id,delete o.$set,delete o.$set_once,delete o.$unset,this.queue.enqueue(o)}}else this.consent.queueBeforeConsent&&this.pre.push(...s);this.emit("consent")}optIn(){this.setConsent({analytics:!0,replay:!0,marketing:!0})}optOut(){this.setConsent({analytics:!1,replay:!1,marketing:!1})}flush(e){return this.queue.flush(e)}shutdown(){return this.queue.shutdown()}};function Ze(n){let e="";return t=>{for(e+=t;;){let s=/\r?\n\r?\n/.exec(e);if(!s)return;let r=e.slice(0,s.index);e=e.slice(s.index+s[0].length);let o="message",a,u=[];for(let p of r.split(/\r?\n/)){if(p.startsWith(":"))continue;let h=p.indexOf(":"),[m,_]=h<0?[p,""]:[p.slice(0,h),p.slice(h+1).replace(/^ /,"")];m==="event"?o=_??"":m==="data"?u.push(_??""):m==="id"&&(a=_)}u.length&&n(a===void 0?{event:o,data:u.join(`
2
2
  `)}:{event:o,data:u.join(`
3
- `),id:a})}}}var se=class{constructor(e){this.o=e}o;ctl;stopped=!0;timer;cursor=0;gen=0;polling=!1;start(){this.stopped&&(this.stopped=!1,this.loop(++this.gen))}stop(){this.stopped=!0,this.gen++,this.ctl?.abort(),this.timer&&clearTimeout(this.timer)}restart(){let e=!this.stopped;this.stop(),this.cursor=0,e&&this.start()}live(e){return!this.stopped&&e===this.gen}deliver(e){if(e.seq>this.cursor){this.cursor=e.seq;try{this.o.onIntervention(e)}catch(t){this.o.log?.("onIntervention threw",t)}}}url(e){let t=`distinct_id=${encodeURIComponent(this.o.distinctId())}${this.cursor?`&cursor=${this.cursor}`:""}`;return`${this.o.apiHost}${e}?${t}`}sleep(e){return new Promise(t=>{this.timer=setTimeout(t,e),this.timer.unref?.()})}async loop(e){let t=0;for(;this.live(e);){let s;try{let r=await this.connectOnce(e);if(r==="gone")return this.stop();r==="poll"?(t=0,s=this.o.pollMs??15e3):(r==="streamed"&&(t=0),s=N(t++,this.o.backoff))}catch(r){this.live(e)&&this.o.log?.("intervention stream error",r),s=N(t++,this.o.backoff)}if(!this.live(e))return;await this.sleep(s)}}async connectOnce(e){if(this.polling)return this.pollOnce(e);this.ctl=new AbortController;let t={Authorization:`Bearer ${this.o.apiKey}`,Accept:"text/event-stream"},s=await this.o.fetch(this.url("/v1/interventions/stream"),{headers:t,signal:this.ctl.signal});if(s.status===404)return"gone";if(!s.ok)return"failed";let r=s.body;if(!r||typeof TextDecoderStream>"u")return this.ctl.abort(),this.polling=!0,this.pollOnce(e);let o=Ze(u=>{if(!(u.event!=="intervention"||!this.live(e)))try{this.deliver(JSON.parse(u.data))}catch{this.o.log?.("bad intervention payload")}}),a=r.pipeThrough(new TextDecoderStream).getReader();for(;;){let{done:u,value:p}=await a.read();if(u)return"streamed";o(p)}}async pollOnce(e){this.ctl=new AbortController;let t=await this.o.fetch(this.url("/v1/interventions"),{headers:{Authorization:`Bearer ${this.o.apiKey}`},signal:this.ctl.signal});if(t.status===404)return"gone";if(!t.ok)return"failed";let s=await t.json();if(this.live(e))for(let r of s.data??[])this.deliver(r);return"poll"}};function be(n,e){let t=new Set,{whenConsented:s,disabled:r,...o}=e,a=new se({...o,distinctId:()=>n.distinctId,onIntervention:p=>{for(let h of[...t])h(p)}}),u=!1;return n.onChange(p=>{u&&((p==="identify"||p==="reset")&&a.restart(),p==="consent"&&(n.hasConsent("analytics")?a.start():a.stop()))}),{on(p){return t.add(p),!u&&!r&&(u=!0,s(()=>a.start())),()=>{t.delete(p)}},stop:()=>a.stop()}}function _e(n,e,t={}){let s=t.key??"lc_offline",r=t.maxBatches??50,o=t.maxBytes??1e6,a=t.isOnline??(()=>!0),u,p,h=()=>{try{let g=JSON.parse(e.get(s)??"[]");return Array.isArray(g)?g:[]}catch{return[]}},m=g=>{let v=g.reduce((b,w)=>b+w.body.length,0);for(;g.length>r||v>o&&g.length>1;)v-=g.shift().body.length;g.length?e.set(s,JSON.stringify(g)):e.remove(s)},_=g=>{m([...h(),...g]),u??=setTimeout(()=>{u=void 0,$.drain()},t.retryMs??3e4)},$={async send(g,v,b){if(!a())return _([{url:g,body:v}]),{status:200};let w=await n.send(g,v,b);return w.status!==0?w:(_([{url:g,body:v}]),{status:200})},drain(){return p??=(async()=>{let g=h();if(!g.length||!a())return;e.remove(s);let v=[];for(let[b,w]of g.entries())if((await n.send(w.url,w.body)).status===0){v.push(...g.slice(b));break}v.length&&_(v)})().finally(()=>{p=void 0}),p}};return $}function we(n){let e=Object.keys(n);if(e.length===0)return{};let t={};for(let s of e)t[`$feature/${s}`]=n[s];return t.$active_feature_flags=e.filter(s=>n[s]!==!1).sort(),t}function U(n,e,t,s){return{key:n,value:e,enabled:e!==void 0&&e!==!1,...typeof e=="string"?{variant:e}:{},...t!==void 0?{payload:t}:{},reason:e===void 0?"not_found":s}}var T={started:"$ai_conversation_started",message:"$ai_message",feedback:"$ai_feedback",ended:"$ai_conversation_ended",outcome:"$ai_outcome"},zt=["resolved","unresolved","escalated","abandoned","error"],Vt=4e3,Kt=2e3,tt=["wrong","useless","not helpful","unhelpful","doesn't work","does not work","didn't help","did not help","not what i asked","that's not it","stupid","terrible","awful","frustrating","frustrated","annoying","worst","hate","incorrect","nonsense","confusing","makes no sense","real person","human agent","talk to a human","speak to a human","wtf","ugh"],nt=["thanks","thank you","great","perfect","awesome","helpful","that worked","works now","solved","exactly"],W=n=>Array.from(n),ke=(n,e)=>W(n).slice(0,e).join(""),Gt=0xcbf29ce484222325n,Yt=0x100000001b3n,Jt=0xffffffffffffffffn,Qt=new TextEncoder;function Xt(n){let e=Gt;for(let t of Qt.encode(n))e=(e^BigInt(t))*Yt&Jt;return e}function st(n){let e=(n.toLowerCase().match(/[\p{L}\p{N}]+/gu)??[]).filter(r=>W(r).length>=2);if(!e.length)return;let t=new Array(64).fill(0);for(let r of e){let o=Xt(r);for(let a=0;a<64;a++)t[a]=(t[a]??0)+((o>>BigInt(a)&1n)===1n?1:-1)}let s=0n;for(let r=0;r<64;r++)(t[r]??0)>0&&(s|=1n<<BigInt(r));return s.toString(16).padStart(16,"0")}function rt(n){let t=` ${n.toLowerCase().replace(/’/g,"'").replace(/[.,!?;:]/g," ").replace(/\s+/g," ").trim()} `,s=0;for(let o of tt)t.includes(` ${o} `)&&(s++,t=t.split(` ${o} `).join(" "));let r=nt.filter(o=>t.includes(` ${o} `)).length;return s>r?-1:r>s?1:0}var ot=n=>W(n).filter(e=>e>="0"&&e<="9").map(Number);function Zt(n){let e=ot(n);if(e.length<13||e.length>19)return!1;let t=0;return e.reverse().forEach((s,r)=>t+=r%2===1?s>4?s*2-9:s*2:s),t%10===0}var et=String.raw`[\p{Alphabetic}\p{M}\p{Nd}\p{Pc}\p{Join_Control}]`,en=[[new RegExp(String.raw`(?<!${et})\p{Nd}(?:[ -]?\p{Nd}){12,18}(?!${et})`,"gu"),Zt],[/[A-Za-z0-9._%+-]+@[A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)*\.[A-Za-z]{2,}/g,()=>!0],[/\+?\p{Nd}[\p{Nd}\s().-]{7,}\p{Nd}/gu,tn]];function tn(n){let e=ot(n).length;return e>=10&&e<=15}var nn=n=>W(n).map(e=>/\s/u.test(e)?e:"*").join("");function xe(n){let e=n;for(let[t,s]of en)e=e.replace(t,r=>s(r)?nn(r):r);return e===n?void 0:e}function it(n){if(typeof n!="string")return;let e=n.toLowerCase();return/^[0-9a-f]{32}$/.test(e)?e:void 0}var at=n=>typeof n=="string"&&zt.includes(n)?n:void 0,q=(n,e)=>typeof n=="string"&&n?ke(n,e):void 0;function sn(n,e,t){let s=ke(e,t),r=xe(s);return r===void 0?{[n]:s}:{[n]:r,$ai_text_redacted:!0}}function ct(n,e,t,s){if(n!=="user"&&n!=="assistant")return;let r={$ai_role:n,$ai_message_index:t,$ai_text_length:W(e).length};if(n==="user"){let o=st(e);o!==void 0&&(r.$ai_text_hash=o),r.$ai_sentiment=rt(e)}return s?{...r,...sn("$ai_text",e,Vt)}:r}function lt(n,e){let t=n.value;if(n.kind==="thumbs"&&t!==1&&t!==-1||n.kind==="rating"&&!(Number.isInteger(t)&&t>=1&&t<=5)||n.kind!=="thumbs"&&n.kind!=="rating"&&n.kind!=="comment")return;let s={$ai_feedback_kind:n.kind};if(n.kind!=="comment"&&(s.$ai_feedback_value=t),n.comment&&e){let r=ke(n.comment,Kt);s.$ai_feedback_comment=xe(r)??r}return n.messageIndex!==void 0&&(s.$ai_message_index=n.messageIndex),s}function Se(n,e){let t=at(n),s=q(e,64);return{...t?{$ai_outcome:t}:{},...s?{$ai_resolution:s}:{}}}function rn(){let n=globalThis.crypto,e=new Uint8Array(16);if(n?.getRandomValues)n.getRandomValues(e);else for(let s=0;s<16;s++)e[s]=Math.floor(Math.random()*256);e[6]=(e[6]??0)&15|64,e[8]=(e[8]??0)&63|128;let t=Array.from(e,s=>s.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}function dt(n={}){let e={$ai_conversation_id:n.conversationId||rn()},t=(s,r)=>{r!==void 0&&(e[s]=r)};return t("$ai_agent_name",q(n.agentName,128)),t("$ai_agent_version",q(n.agentVersion,64)),t("$ai_topic",q(n.topic,128)),t("$ai_use_case",q(n.useCase,128)),t("$ai_trace_id",it(n.traceId)),e}var H=class{next=0;common;emit;captureText;constructor(e,t={},s=!1){this.emit=e,this.captureText=s,this.common=dt(t)}get id(){return this.common.$ai_conversation_id}send(e,t){this.emit(e,{...this.common,...t})}start(){return this.send(T.started,{}),this}message(e,t,s={}){let r=s.index??this.next,o=ct(e,t,r,this.captureText);return o?(this.next=r+1,this.send(T.message,o),!0):!1}feedback(e){let t=lt(e,this.captureText);return t?(this.send(T.feedback,t),!0):!1}end(e,t){this.send(T.ended,Se(e,t))}outcome(e,t){let s=Se(e,t);return s.$ai_outcome?(this.send(T.outcome,s),!0):!1}};var on=["bot","crawl","spider","slurp","headlesschrome","phantomjs","puppeteer","playwright","lighthouse","pingdom","uptimerobot","facebookexternalhit","preview","scrapy","python-requests","go-http-client","cypress","lightpanda","hubspot","nessus","prerender","deepscan","screaming frog","sitebulb","turnitin","ia_archiver","chatgpt-user","app.hypefactors.com","google favicon","google web preview","-google","googleother","googleweblight","google-read-aloud","google-inspectiontool","google-hoteladsverifier","google-cloudvertexbot"];function ut(n,e=[]){let t=n.toLowerCase();return e.some(s=>s&&t.includes(s.toLowerCase()))?!0:on.some(s=>t.includes(s))&&!/\bcubot\b/.test(t)}var O=["gclid","gad_source","gclsrc","dclid","gbraid","wbraid","fbclid","igshid","msclkid","ttclid","li_fat_id","twclid","mc_cid","rdt_cid","epik","qclid","sccid","oppref","bfcid","irclid","_kx"],pt="lc_click_ids";function ft(n,e=90,t=Date.now){let s,r=()=>{try{return JSON.parse(n.get(pt)??"{}")}catch{return{}}};return()=>{let o=r();if(location.search!==s){s=location.search;let u=new URLSearchParams(s),p=!1;for(let h of O){let m=u.get(h);m&&(o[h]={v:m.slice(0,512),t:t()},p=!0)}p&&n.set(pt,JSON.stringify(o))}let a={};for(let u of O){let p=o[u];p&&t()-p.t<e*864e5&&(a[u]=p.v)}return a}}function an(){return Array.from(document.querySelectorAll("meta[http-equiv]")).filter(n=>n.getAttribute("http-equiv")?.toLowerCase()==="content-security-policy").map(n=>n.getAttribute("content")??"")}function cn(n){let e=new Map;for(let s of n.split(";")){let[r,...o]=s.trim().toLowerCase().split(/\s+/);r&&!e.has(r)&&e.set(r,o)}let t=e.get("style-src-elem")??e.get("style-src")??e.get("default-src");return!!t&&!(t.includes("'unsafe-inline'")&&!t.some(s=>s.startsWith("'nonce-")||s.startsWith("'sha")))}function ht(n,e){if(typeof document>"u")return()=>{};!e&&an().some(cn)&&n("CSP hint: this page's Content-Security-Policy blocks inline <style>; set the `nonce` option so guides and the experiment veil render (see the Content Security Policy help page)");let t=s=>{let r=s;/^style-src/.test(r.effectiveDirective??"")&&r.blockedURI==="inline"&&n(`CSP hint: an inline style was blocked by ${r.effectiveDirective}${e?" (check that `nonce` matches the page's nonce)":"; set the `nonce` option"}`)};return document.addEventListener("securitypolicyviolation",t),()=>document.removeEventListener("securitypolicyviolation",t)}var ln=(n,e)=>n.slice(0,e);function gt(n){try{let e=new URL(n);return e.protocol==="data:"||e.protocol==="blob:"?e.protocol:e.origin+e.pathname}catch{return ln(n,64)}}function mt(n,e={}){if(typeof document>"u")return()=>{};let t=e.maxPerPage??20,s=new Set,r=o=>{let a=o,u={$csp_directive:a.effectiveDirective??a.violatedDirective,$csp_blocked_uri:gt(a.blockedURI??""),$csp_source_file:a.sourceFile?gt(a.sourceFile):void 0,$csp_line:a.lineNumber||void 0,$csp_column:a.columnNumber||void 0,$csp_disposition:a.disposition},p=[u.$csp_directive,u.$csp_blocked_uri,u.$csp_source_file,u.$csp_line].join("|");s.has(p)||s.size>=t||(s.add(p),n("$csp_violation",Object.fromEntries(Object.entries(u).filter(([,h])=>h!==void 0))))};return document.addEventListener("securitypolicyviolation",r),()=>document.removeEventListener("securitypolicyviolation",r)}var dn=["chrome-extension:","moz-extension:","safari-web-extension:","ms-browser-extension:"],yt=()=>typeof location<"u"&&dn.includes(location.protocol);function un(n,e,t){let s=e.find(a=>n.startsWith(`${a}/`));if(!s)return n;let r=n.slice(s.length),o=r.search(/[?#]/);return s+t(o<0?r:r.slice(0,o))+(o<0?"":r.slice(o))}function vt(n,e,t,s){if(!s)return{transport:n,fetch:e};let r=o=>un(o,t,s);return{transport:{send:(o,a,u)=>n.send(r(o),a,u)},fetch:((o,a)=>e(typeof o=="string"?r(o):o instanceof URL?r(o.href):o,a))}}var pn="__LUCIDA_DEVTOOLS_HOOK__";function bt(n,e,t){let s=globalThis[pn];if(!(!s||typeof s.emit!="function"||typeof s.attach!="function")){n.onCapture(r=>{try{s.emit(r)}catch{}});try{s.attach({projectKeyPrefix:n.apiKey.slice(0,8),apiHost:t,distinctId:()=>e.distinctId,loadToolbar:r=>e.loadToolbar(r),startReplay:async()=>n.replay?(await n.replay.start(!0),n.replay.isRecording()):!1,replayUrl:()=>e.getReplayUrl()})}catch{}}}var z=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"];function fn(n){let e={},t=new URLSearchParams(location.search);for(let s of[...z,...O,...n]){let r=t.get(s);r&&(e[`$${s}`]=r)}return e}var gn=["ref","referral","via","aff"];function _t(n){if(!n)return;let e=Array.isArray(n)?{params:n}:{params:n.params??gn,...n.category?{category:n.category}:{}};return e.params.length?e:void 0}function wt(n){let e=new URLSearchParams(location.search);for(let t of n){let s=e.get(t);if(s)return s.slice(0,256)}}function St(){let n=new URLSearchParams(location.search),e=z.map(t=>n.get(t)??"");return e.some(Boolean)?e.join("|"):void 0}function hn(n){try{return n?new URL(n).hostname:""}catch{return""}}var mn=()=>location.href.replace(/([?&])__lc_toolbar=[^&#]*&?/,"$1").replace(/[?&]$/,"");function yn(){let n=location.hash;return n.length>1?location.pathname+n.split("?")[0]:location.pathname}function kt(n,e,t=[],s=!1){let r={$current_url:mn(),$host:location.host,$pathname:s?yn():location.pathname,$referrer:document.referrer,$title:document.title,$screen_width:screen.width,$screen_height:screen.height,$viewport_width:window.innerWidth,$viewport_height:window.innerHeight,$browser_language:navigator.language,$timezone:Intl.DateTimeFormat().resolvedOptions().timeZone};if(navigator.maxTouchPoints>1&&(r.$touch_points=navigator.maxTouchPoints),n!=="$pageview")return{properties:r};let o=fn(t);Object.assign(r,o);let a=e.$current_url??location.href,u=e.$referrer??document.referrer,p={$initial_referrer:u||"$direct",$initial_referring_domain:hn(u)||"$direct",$initial_current_url:a};for(let[h,m]of Object.entries(o))p[`$initial_${h.slice(1)}`]=m;return{properties:r,$set_once:p}}function xt(n,e,t=globalThis){e&&(t[typeof e=="string"?e:"lucida"]=n,typeof CustomEvent=="function"&&t.dispatchEvent?.(new CustomEvent("lucida:ready",{detail:n})))}var M=()=>{},Ce=()=>Promise.resolve(),Ct={isInternal:!1,hasOptedOut:()=>!1,hasOptedIn:()=>!1,consentStatus:()=>"pending",getConsentStatus:()=>"pending",getConsent:()=>({analytics:!1,replay:!1,marketing:!1}),getAllFlags:()=>({}),isFeatureEnabled:()=>!1,getFlagResult:n=>U(n,void 0,void 0,"not_found"),getReplayUrl:()=>"",onSessionId:()=>M,onFlags:()=>M,onIntervention:()=>M,onConsent:()=>M,flush:Ce,shutdown:Ce,reloadFlags:Ce,loadToolbar:()=>Promise.resolve(!1),recommendations:n=>Promise.resolve({placement:n,strategy:"",items:[],shown:M,clicked:M})};function Pt(n){return new Proxy(()=>{},{get:(e,t)=>{if(!(typeof t!="string"||t==="then"))return n&&Object.hasOwn(Ct,t)?Ct[t]:Pt(!1)}})}var $t=()=>Pt(!0);var It="_lcid";var vn=(n,e)=>e.some(t=>{let s=t.replace(/^\./,"").toLowerCase();return n.toLowerCase()===s||n.toLowerCase().endsWith(`.${s}`)});function bn(n,e=Date.now()){let t=n.lastIndexOf("."),[s="",r]=n.slice(t+1).split("_",2),o=/^[0-9a-z]+$/.test(s)?parseInt(s,36):NaN,a=n.slice(0,t);if(t>0&&a.length<=200&&o<=e+5e3&&e-o<=12e4)return r&&/^[\w-]{1,64}$/.test(r)?{distinctId:a,sessionId:r}:{distinctId:a}}function Ot(n){if(!n?.length)return;let e=new URL(location.href),t=e.searchParams.get(It);if(t!==null){e.searchParams.delete(It),history.replaceState(history.state,"",e.toString());try{if(document.referrer&&!vn(new URL(document.referrer).hostname,n))return}catch{return}return bn(t)}}function Et(n,e=Date.now){let t=n.eventsPerSecond??10,s=n.burst??100,r=s,o=e();return()=>{let a=e();return r=Math.min(s,r+(a-o)/1e3*t),o=a,r<1?!1:(r-=1,!0)}}var $e="<masked>",_n=["password","passwd","pwd","pass","token","access_token","refresh_token","id_token","secret","client_secret","api_key","apikey","key","auth","authorization","code","otp","email","ssn"],wn=["$pathname","$current_url","$referrer","$initial_referrer","$initial_current_url","$last_current_url"],Sn=[/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,/^[0-9a-hjkmnp-tv-z]{26}$/i,/^\d{4,}$/,/^[0-9a-f]{16,}$/i,/^(?=.*\d)[a-z0-9_-]{20,}$/i],Rt=n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");function kn(n,e){let t=n;for(let s of e.pathRules??[])try{t=t.replace(typeof s.match=="string"?new RegExp(s.match):s.match,s.replace)}catch{}return e.maskPathIds?t.split("/").map(s=>Sn.some(r=>r.test(s))?":id":s).join("/"):t}function Pe(n,e){let t=n;if(e.pathRules?.length||e.maskPathIds){let r=/^((?:[a-z][a-z0-9+.-]*:)?\/\/[^/?#]*)?([^?#]*)([\s\S]*)$/i.exec(t);r&&(t=(r[1]??"")+kn(r[2],e)+r[3])}let s=[..._n,...e.maskParams??[],...e.maskCampaignParams?[...z,...O]:[]];if(s.length){let r=t.indexOf("#"),o=r<0?t:t.slice(0,r),a=r<0?"":t.slice(r);t=o.replace(new RegExp(`([?&])(${s.map(Rt).join("|")})=[^&]*`,"gi"),`$1$2=${$e}`)+a}return e.stripHash&&(t=t.replace(/#.*$/,"")),t}function At(n){let e=new RegExp(`^\\$(initial_|last_)?(${[...z,...O].map(Rt).join("|")})$`),t=s=>{let r;if(n.maskCampaignParams)for(let[o,a]of Object.entries(s))typeof a=="string"&&e.test(o)?(r??={...s})[o]=$e:o==="$click_ids"&&a&&typeof a=="object"&&((r??={...s})[o]=Object.fromEntries(Object.keys(a).map(u=>[u,$e])));for(let o of wn){let a=(r??s)[o];if(typeof a!="string")continue;let u=Pe(a,n);u!==a&&((r??={...s})[o]=u)}if(typeof s.$elements_chain=="string"){let o=s.$elements_chain.replace(/href="((?:[^"\\]|\\.)*)"/g,(a,u)=>`href="${Pe(u,n)}"`);o!==s.$elements_chain&&((r??={...s}).$elements_chain=o)}return Array.isArray(s.$elements)&&((r??={...s}).$elements=s.$elements.map(o=>typeof o?.href=="string"?{...o,href:Pe(o.href,n)}:o)),r??s};return s=>({...s,properties:t(s.properties),...s.$set?{$set:t(s.$set)}:{},...s.$set_once?{$set_once:t(s.$set_once)}:{}})}function xn(n,e,t){let s=e;for(let r of n)try{let o=r(s);if(o==null)return null;if(typeof o!="object"||typeof o.event!="string")return t("beforeSend hook returned a non-event, dropping:",typeof o),null;s=o}catch(o){return t("beforeSend hook threw, dropping event:",o),null}return s}function Cn(n,e=Math.random){return t=>n>=1?t:n<=0||e()>=n?null:{...t,properties:{...t.properties,$sample_rate:n}}}function Pn(n){let e=new Set(n),t=s=>Object.fromEntries(Object.entries(s).filter(([r])=>!e.has(r)));return s=>({...s,properties:t(s.properties),...s.$set?{$set:t(s.$set)}:{},...s.$set_once?{$set_once:t(s.$set_once)}:{}})}var Ie="lc_person_identified",re="lc_pending_set_once",Tt=new Set(["$identify","$create_alias","$groupidentify"]),Mt="$$client_ingestion_warning",$n=6e4,Oe=class{constructor(e,t){this.mode=e;this.storage=t;this.identified=t.get(Ie)==="1";try{this.pending=JSON.parse(t.get(re)??"{}")}catch{this.pending={}}}mode;storage;identified;pending;get blocksPersonWrites(){return this.mode==="never"}get isProfile(){return this.mode==="always"||this.mode==="identified_only"&&this.identified}markIdentified(){this.mode!=="identified_only"||this.identified||(this.identified=!0,this.storage.set(Ie,"1"))}personless(e){return this.mode==="always"?!1:(this.mode==="never"||!this.identified)&&!Tt.has(e)}stash(e){if(this.mode!=="identified_only"||!e)return;let t=Object.entries(e).filter(([s])=>!(s in this.pending));t.length&&(this.pending={...this.pending,...Object.fromEntries(t)},this.storage.set(re,JSON.stringify(this.pending)))}take(){if(!Object.keys(this.pending).length)return;let e=this.pending;return this.pending={},this.storage.remove(re),e}reset(){this.identified=!1,this.pending={},this.storage.remove(Ie),this.storage.remove(re)}};function In(n,e){let t=e,s;if(n.person.personless(e.event)){n.person.stash(e.$set_once);let{$set:o,$set_once:a,$unset:u,...p}=e;t={...p,properties:{...e.properties,$process_person_profile:!1}}}else(s=n.person.take())&&(t={...e,$set_once:{...e.$set_once,...s}});let r=n.hooks.length?xn(n.hooks,t,n.log):t;return r&&n.limit&&!n.limit()&&(n.log("rate limited, dropped",r.event),n.onLimited?.(),r=null),!r&&s&&n.person.stash(s),r}function On(n){let e=n.beforeSend?Array.isArray(n.beforeSend)?n.beforeSend:[n.beforeSend]:[];return[At(n.urlPrivacy??{}),...n.propertyDenylist?.length?[Pn(n.propertyDenylist)]:[],...n.sampleRate!==void 0?[Cn(n.sampleRate)]:[],...e]}function jt(n,e,t,s=Date.now){let r=new Oe(e.personProfiles??"always",n.storage),o,a,u=0,p=-1/0,h=()=>{u+=1,!(s()-p<$n)&&(p=s(),queueMicrotask(()=>{let m=u;u=0,n.capture(Mt,{$$client_ingestion_warning_message:`client rate limit dropped ${m} event(s)`,$dropped_count:m})}))};return n.setFilter(m=>(e.rateLimit!==o&&(o=e.rateLimit,a=o?Et(o):void 0),In({hooks:On(e),person:r,limit:m.event===Mt?void 0:a,log:t,onLimited:h},m))),r}var Ee=class{m=new Map;get(e){return this.m.get(e)??null}set(e,t){this.m.set(e,t)}remove(e){this.m.delete(e)}},En=365,Rn=new Set("co.uk org.uk ac.uk gov.uk me.uk ltd.uk plc.uk net.uk com.au net.au org.au edu.au gov.au co.nz org.nz net.nz co.jp ne.jp or.jp ac.jp go.jp co.kr or.kr com.cn net.cn org.cn com.hk com.tw com.sg com.my co.in net.in org.in co.id co.th com.ph com.vn com.br net.br org.br com.ar com.mx com.co com.pe com.tr com.ua com.pl co.za co.il com.eg com.sa com.ng co.ke github.io gitlab.io vercel.app netlify.app herokuapp.com pages.dev workers.dev web.app firebaseapp.com azurewebsites.net cloudfront.net appspot.com onrender.com fly.dev glitch.me repl.co blogspot.com wordpress.com myshopify.com vercel.dev netlify.com surge.sh render.com railway.app koyeb.app deno.dev ngrok.io ngrok-free.app trycloudflare.com cloudfunctions.net run.app s3.amazonaws.com elasticbeanstalk.com azurestaticapps.net wixsite.com webflow.io framer.app bubbleapps.io".split(" ")),An=new Set("co com net org edu gov gob go ac or ne ltd plc sch mil nom".split(" "));function Tn(n){let e=n.toLowerCase().split(".");for(let t=1;t<e.length-1;t++)if(Rn.has(e.slice(t).join("."))||t===e.length-2&&e[t+1].length===2&&An.has(e[t]))return e.slice(t-1).join(".")}function Mn(n=location.hostname){if(/^[\d.]+$/.test(n)||n.includes(":"))return;let e=n.split(".");for(let t=e.length-2;t>=0;t--){let s=e.slice(t).join(".");if(document.cookie=`__lc_probe=1; Domain=${s}; Path=/; Max-Age=10; SameSite=Lax`,document.cookie.includes("__lc_probe=1"))return document.cookie=`__lc_probe=; Domain=${s}; Path=/; Max-Age=0`,s}return Tn(n)}var oe=class{constructor(e={}){this.o=e}o;domain=null;attr(){if(this.domain===null)try{this.domain=this.o.domain??(this.o.crossSubdomain?Mn():void 0)}catch{this.domain=void 0}return this.domain?`; Domain=${this.domain}`:""}held=new Map;read(e){try{for(let t of document.cookie.split("; ")){let s=t.indexOf("=");if(t.slice(0,s)===e)return decodeURIComponent(t.slice(s+1))}}catch{}return null}get(e){return this.read(e)??this.held.get(e)??null}set(e,t){let s=this.o.secure??location.protocol==="https:"?"; Secure":"",r=Math.round((this.o.expiryDays??En)*86400);try{document.cookie=`${e}=${encodeURIComponent(t)}; Max-Age=${r}; Path=/${this.attr()}; SameSite=Lax${s}`}catch{}this.read(e)===t?this.held.delete(e):this.held.set(e,t)}remove(e){this.held.delete(e);try{document.cookie=`${e}=; Max-Age=0; Path=/${this.attr()}; SameSite=Lax`}catch{}}},j=class{constructor(e="localStorage"){this.kind=e}kind;store(){try{return globalThis[this.kind]}catch{return}}get(e){try{return this.store()?.getItem(e)??null}catch{return null}}set(e,t){try{this.store()?.setItem(e,t)}catch{}}remove(e){try{this.store()?.removeItem(e)}catch{}}},Re=class extends j{constructor(){super("localStorage")}},jn=["lc_identity","lc_session","lc_device_id","lc_consent","lc_person_identified"],Ae=class{constructor(e,t,s){this.cookie=e;this.local=t;this.cookieKeys=s}cookie;local;cookieKeys;get(e){let[t,s]=this.cookieKeys(e)?[this.cookie,this.local]:[this.local,this.cookie];return t.get(e)??s.get(e)}set(e,t){this.local.set(e,t),this.cookieKeys(e)?this.cookie.set(e,t):this.cookie.remove(e)}remove(e){this.local.remove(e),this.cookie.remove(e)}},ie=class{constructor(e,t){this.inner=e;this.delayMs=t}inner;delayMs;pending=new Map;timer;get(e){return this.pending.has(e)?this.pending.get(e)??null:this.inner.get(e)}set(e,t){this.queue(e,t)}remove(e){this.queue(e,null)}queue(e,t){this.pending.set(e,t),this.timer??=setTimeout(()=>this.flush(),this.delayMs)}flush(){clearTimeout(this.timer),this.timer=void 0;for(let[e,t]of this.pending)t===null?this.inner.remove(e):this.inner.set(e,t);this.pending.clear()}},Te=class{constructor(e,t){this.inner=e;this.suffix=t}inner;suffix;get(e){return this.inner.get(e+this.suffix)}set(e,t){this.inner.set(e+this.suffix,t)}remove(e){this.inner.remove(e+this.suffix)}},ae=n=>`_${n.replace(/\W/g,"").slice(-8)}`;function ce(n,e,t){if(n==="memory"||n==="none")return new Ee;let s=ae(e),r=n==="cookie"?new oe(t):n==="localStorage+cookie"?new Ae(new oe(t),new Re,o=>jn.some(a=>o===a+s)):new j(n);return new Te(r,s)}function Dt(n,e,t){let s=ae(e),r=new Set;try{for(let o of document.cookie.split("; "))r.add(o.split("=")[0]);for(let o of[globalThis.localStorage,globalThis.sessionStorage])for(let a=0;a<o.length;a++)r.add(o.key(a))}catch{}for(let o of r)if(!(!o.startsWith("lc_")||!o.endsWith(s)||o===t+s)){n.remove(o.slice(0,-s.length));try{localStorage.removeItem(o),sessionStorage.removeItem(o)}catch{}}}async function Dn(n){if(!(typeof CompressionStream>"u"||typeof Response>"u"))try{let e=new Response(n).body?.pipeThrough(new CompressionStream("gzip"));return e?new Uint8Array(await new Response(e).arrayBuffer()):void 0}catch{return}}function Lt(n,e={}){let t=e.compress??!0,s=(r,o)=>(e.onError?.({url:r,status:o}),{status:o});return{async send(r,o,a){if(a?.beacon&&!e.disableBeacon&&typeof navigator<"u"&&navigator.sendBeacon)return navigator.sendBeacon(r,new Blob([o],{type:"text/plain"}))?{status:200}:s(r,0);try{let u=t&&o.length>=1024?await Dn(o):void 0,p=await n(u?`${r}${r.includes("?")?"&":"?"}compression=gzip`:r,{method:"POST",body:u??o,headers:{...e.headers,"Content-Type":"text/plain;charset=UTF-8"},credentials:"omit",keepalive:(u?.length??o.length)<6e4});return p.status>=400?s(r,p.status):{status:p.status}}catch{return s(r,0)}}}}var Me={send:async()=>({status:200})};var Ln="lucida-browser",Fn="0.1.12",je="lc_internal",Nn=3e3,Ft="https://capture.lucidace.com",De=n=>!!n&&typeof n=="object"&&Object.getPrototypeOf(n)===Object.prototype;function Le(n,e={},t=[]){if(typeof window>"u"||typeof navigator>"u")return $t();let s=!!e.debug||typeof location<"u"&&/[?&]__(lc|lucida)_debug=(1|true)/.test(location.search),r=(...i)=>{s&&console.debug("[lucida]",...i)},o=(e.apiHost??Ft).replace(/\/+$/,""),a=Object.fromEntries(Object.entries(e).map(([i,c])=>[i,De(c)?{...c}:c]));a.apiHost=o;let u=e.extension??yt(),p=i=>u&&(i==="cookie"||i==="localStorage+cookie")?e.extensionPersistence??"localStorage":i,h=p(e.cookieless==="always"?"none":e.persistence??"cookie"),m=[o,...e.flagsApiHost?[e.flagsApiHost.replace(/\/+$/,"")]:[]],_=e.fetch??((...i)=>fetch(...i)),$=i=>vt(i,_,m,e.rewritePath),g=$(Me).fetch,v=e.consent?.respectDnt,b=navigator.globalPrivacyControl===!0,w=(e.respectDnt??v)===!0&&navigator.doNotTrack==="1"||(e.respectGpc??v)===!0&&b,Fe=e.blockBots!==!1&&typeof navigator<"u"&&ut(navigator.userAgent??"",e.blockedUserAgents),k=!!e.disabled||Fe;Fe&&r("bot user agent: capture disabled");let le,de=$(e.transport??Lt(_,{headers:a.requestHeaders,onError:e.onRequestError,disableBeacon:e.disableBeacon})).transport;if(!e.transport&&e.offlineQueue!==!1&&h!=="memory"&&h!=="none"){let i=new I(new j(h==="sessionStorage"?"sessionStorage":"localStorage"),()=>l.hasConsent("analytics"));de=le=_e(de,i,{key:`lc_offline${ae(n)}`,isOnline:()=>navigator.onLine!==!1})}let V=k?void 0:Ot(e.crossDomains),ue=ce(k?"memory":h,n,e.cookie),K=(e.storageWriteDelayMs??0)>0?new ie(ue,e.storageWriteDelayMs):void 0,Ne=V?.sessionId??e.bootstrap?.sessionId,pe,G=!1,Be,Ue=new Map,qe,fe=[],l=new B({apiKey:n,apiHost:o,transport:k?Me:de,storage:K??ue,...e.consentPersistence&&!k?{consentStorage:ce(p(e.consentPersistence),n,e.cookie)}:{},persistProperty:i=>!a.persistedProperties||a.persistedProperties.includes(i),...h==="none"?{cookieless:!0}:{},library:{name:Ln,version:Fn},consent:{...e.cookieless==="on_reject"?{cookielessOnReject:!0}:{},...e.consent,...!k&&(e.consent?.geo||e.consent?.mode!=="opt_in")?{awaitRemote:!0}:{},respectDnt:!0,dnt:w},queue:{...e.flushAt?{flushAt:e.flushAt}:{},...e.flushIntervalMs?{flushIntervalMs:e.flushIntervalMs}:{}},...V||e.bootstrap?.distinctId?{bootstrapDistinctId:V?.distinctId??e.bootstrap?.distinctId}:{},...e.bootstrap?.isIdentified&&!V?{bootstrapIdentified:!0}:{},session:{...e.session,...Ne?{bootstrapId:Ne}:{}},enrich:(i,c)=>{let d=kt(i,c,a.customCampaignParams,e.capturePageview==="hash");if(o!==Ft&&(d.properties={...d.properties,$lib_custom_api_host:o}),fe.length){let C=l.sessionId;for(let R of fe)d.properties={...d.properties,...R(C)}}if(i==="$pageview"){let C=l.sessionId;if(C!==Be){let R=_t(e.referralParams);if(R&&(!R.category||Ue.get(R.category)===!0)){Be=C;let he=wt(R.params);he&&(d.properties={...d.properties,$referral_code:he},d.$set_once={...d.$set_once,initial_referral_code:he})}}}let y=qe?.()??{},S=Object.keys(y);return S.length&&(d.properties={...d.properties,$click_ids:y},i==="$pageview"&&(d.$set_once={...Object.fromEntries(S.map(C=>[`$initial_${C}`,y[C]])),...d.$set_once},d.$set=Object.fromEntries(S.map(C=>[`$last_${C}`,y[C]])))),a.sendFeatureFlags!==!1&&i!=="$snapshot"&&pe&&(d.properties={...we(pe.all()),...d.properties}),G?{...d,properties:{...d.properties,$internal:!0}}:d},campaignKey:St,log:r});G=l.storage.get(je)==="1",e.clickIds!==!1&&(qe=ft(l.storage,e.clickIds?.expiryDays));let x=jt(l,a,r);e.bootstrap?.isIdentified&&x.markIdentified();let D=i=>x.blocksPersonWrites?(r(`personProfiles=never: ${i} ignored`),!0):!1;k||l.onChange(i=>{i!=="consent"||l.hasConsent("analytics")||l.consentStatus()!=="denied"||(K?.flush(),Dt(ue,n,e.consent?.storageKey||J))});let ge=new Set;l.onChange(i=>{i==="consent"&&[...ge].forEach(c=>c())});let He=[],E=[ht(r,e.nonce)],We=l.storage;if(e.flagPersistence&&!k){let i=new I(ce(p(e.flagPersistence),n,e.cookie),()=>l.hasConsent("analytics"));l.onChange(c=>{c==="consent"&&(l.hasConsent("analytics")?i.flushBuffered():i.discardBuffered())}),We=i}let Y=i=>{if(k)return;if(l.hasConsent("analytics"))return i();let c=!1;l.onChange(d=>{!c&&d==="consent"&&l.hasConsent("analytics")&&(c=!0,i())})},ze,f={core:l,client:void 0,config:a,flagStorage:We,apiKey:n,log:r,fetch:g,onUnload:i=>{He.push(i)},whenConsented:Y,onCapture:i=>l.onCaptured(i),eventExtras:fe,clickExtras:[],flagPersonProps:[],categoryGrants:Ue,loadConfig:()=>ze??=new Promise(i=>Y(()=>{g(`${o}/v1/config?api_key=${encodeURIComponent(n)}`).then(c=>c.ok?c.json():null).then(c=>(c&&l.applyRemote(c),c)).then(i,()=>i(null))}))},Ve=Promise.resolve();if(l.consent.resolving){let i=!1,c=g(`${o}/v1/config?api_key=${encodeURIComponent(n)}`,{credentials:"omit"}).then(d=>(i=d.status>=500,d.ok?d.json():null)).catch(()=>(i=!0,null));ze=c,Ve=new Promise(d=>{let y=setTimeout(()=>(l.resolveConsent("opt_in"),d()),Nn);c.then(S=>{clearTimeout(y),S?l.applyRemote(S):i?l.resolveConsent("opt_in"):l.applyRemote({}),d()})})}let Ke=be(l,{apiHost:o,apiKey:n,fetch:g,whenConsented:Y,log:r,disabled:k});E.push(()=>Ke.stop());let L={get distinctId(){return l.distinctId},capture:(i,c,d)=>{l.capture(i,c,d?.timestamp!==void 0?{timestamp:d.timestamp}:{})&&(d?.sendInstantly||d?.transport)&&l.flush(d.transport==="beacon"?{beacon:!0}:{})},identify:(i,c,d)=>{D("identify")||(x.markIdentified(),l.identify(i,c,d))},alias:(i,c)=>{D("alias")||(x.markIdentified(),l.alias(i,c))},reset:i=>{l.reset({resetDeviceId:!!i,reuseAnonymousId:!!e.reuseAnonymousId}),x.reset()},createPersonProfile:()=>{D("createPersonProfile")||x.isProfile||(x.markIdentified(),l.capture("$set",{}))},setConfig:i=>{let c=a;for(let[d,y]of Object.entries(i)){let S=c[d];De(S)&&De(y)?Object.assign(S,y):c[d]=y}"debug"in i&&(s=!!i.debug)},setPersonProperties:(i,c)=>{!i&&!c||D("setPersonProperties")||(x.markIdentified(),l.capture("$set",{},{...i?{$set:i}:{},...c?{$set_once:c}:{}}))},unsetPersonProperties:i=>{!i.length||D("unsetPersonProperties")||(x.markIdentified(),l.capture("$set",{},{$unset:i}))},getDistinctId:()=>l.distinctId,getSessionId:()=>l.sessionId,onSessionId:i=>l.onSessionId(c=>i(c)),getProperty:i=>l.getProperty(i),hasOptedOut:()=>l.consentStatus()==="denied",hasOptedIn:()=>l.consentStatus()==="granted",onConsent:i=>(ge.add(i),()=>{ge.delete(i)}),getReplayUrl:i=>{let d=`${(e.uiHost??o).replace(/\/+$/,"")}/replays/${encodeURIComponent(l.sessionId)}`,y=l.sessionStart;return!i?.withTimestamp||y===void 0?d:`${d}?t=${Math.max(0,Math.round((Date.now()-y)/1e3-(i.timestampLookBackSeconds??10)))}`},debug:(i=!0)=>{s=i},featureView:(i,c)=>{l.capture("$feature_view",{...c,$feature_flag:i},{$set:{[`$feature_view/${i}`]:!0}})},featureInteraction:(i,c)=>{l.capture("$feature_interaction",{...c,$feature_flag:i},{$set:{[`$feature_interaction/${i}`]:!0}})},updateFlags:(i,c,d)=>f.flags?.update(i,c,d?.merge??!0),register:i=>l.register(i),registerOnce:i=>l.registerOnce(i),unregister:i=>l.unregister(i),group:(i,c,d)=>{x.markIdentified(),l.group(i,c,d)},optIn:(i=["analytics","replay"])=>l.setConsent({analytics:i.includes("analytics"),replay:i.includes("replay"),marketing:i.includes("marketing")}),optOut:()=>l.optOut(),optOutInternal:(i=!0)=>{G=i,i?l.storage.set(je,"1"):l.storage.remove(je)},get isInternal(){return G},setConsent:i=>l.setConsent(i),getConsent:()=>l.getConsent(),getConsentStatus:i=>l.getConsentStatus(i),consentStatus:()=>l.consentStatus(),getFlag:i=>f.flags?.get(i),getFlagPayload:i=>f.flags?.payload(i),getFlagResult:(i,c)=>f.flags?.result(i,c)??U(i,void 0,void 0,"not_found"),getLayerParam:(i,c,d)=>f.flags?.layerParam(i,c)??d,isFeatureEnabled:i=>{let c=f.flags?.get(i);return c!==void 0&&c!==!1},onFlags:i=>f.flags?.onChange(i)??(()=>{}),onIntervention:i=>Ke.on(i),reloadFlags:()=>f.flags?.reload()??Promise.resolve(),getAllFlags:()=>f.flags?.all()??{},overrideFlags:(i,c)=>f.flags?.override(i,c),setPersonPropertiesForFlags:(i,c)=>f.flags?.setPersonProperties(i,c),resetPersonPropertiesForFlags:()=>f.flags?.resetPersonProperties(),setGroupPropertiesForFlags:(i,c)=>f.flags?.setGroupProperties(i,c),resetGroupPropertiesForFlags:()=>f.flags?.resetGroupProperties(),setContext:(i,c,d)=>f.flags?.setContext(i,c,d),clearContext:i=>f.flags?.clearContext(i),guides:{showChangelog:()=>f.guides?.showChangelog()??0,show:i=>f.guides?.show(i)??!1,reset:i=>f.guides?.reset(i)},ai:{startConversation:i=>new H((c,d)=>L.capture(c,d),i,a.ai?.captureText===!0).start()},earlyAccess:{list:()=>f.earlyAccess?.list()??Promise.resolve([]),optIn:i=>f.earlyAccess?.optIn(i),optOut:i=>f.earlyAccess?.optOut(i)},replay:{start:i=>f.replay?.start(i)??Promise.resolve(),stop:()=>f.replay?.stop(),pause:()=>f.replay?.pause(),resume:()=>f.replay?.resume(),tag:i=>f.replay?.tag(i),isRecording:()=>f.replay?.isRecording()??!1},consent:{showBanner:i=>f.consentUi?.showBanner(i)??Promise.resolve(null),hideBanner:()=>f.consentUi?.hideBanner()},loadToolbar:i=>f.toolbar?.load(typeof i=="string"?i:i.token)??Promise.resolve(!1),activateExperiment:i=>f.experiments?.activate(i),recommendations:(i,c)=>f.recs?.get(i,c)??Promise.resolve({placement:i,strategy:"",items:[],shown(){},clicked(){}}),flush:()=>Ve.then(()=>l.flush()),shutdown:async()=>{for(let i of E)i();K?.flush(),await l.shutdown()}};if(f.client=L,!k){let i=()=>{for(let d of He)d();K?.flush(),l.flush({beacon:!0})};window.addEventListener("pagehide",i);let c=()=>{document.visibilityState==="hidden"&&l.flush({beacon:!0})};if(document.addEventListener("visibilitychange",c),E.push(()=>{window.removeEventListener("pagehide",i),document.removeEventListener("visibilitychange",c)}),le){let d=()=>{le.drain()};window.addEventListener("online",d),E.push(()=>window.removeEventListener("online",d)),Y(d)}if(e.captureCspViolations){let d=typeof e.captureCspViolations=="object"?e.captureCspViolations:{};E.push(mt((y,S)=>{l.capture(y,S)},d))}for(let d of t){let y=d(f);y&&E.push(y)}pe=f.flags,t.length||f.loadConfig(),bt(f,L,o)}return xt(L,e.exposeGlobal),r("initialised",{apiHost:o,consent:l.getConsent()}),L}function or(n,e={}){return Le(n,e)}export{Le as createClient,or as init};
3
+ `),id:a})}}}var se=class{constructor(e){this.o=e}o;ctl;stopped=!0;timer;cursor=0;gen=0;polling=!1;start(){this.stopped&&(this.stopped=!1,this.loop(++this.gen))}stop(){this.stopped=!0,this.gen++,this.ctl?.abort(),this.timer&&clearTimeout(this.timer)}restart(){let e=!this.stopped;this.stop(),this.cursor=0,e&&this.start()}live(e){return!this.stopped&&e===this.gen}deliver(e){if(e.seq>this.cursor){this.cursor=e.seq;try{this.o.onIntervention(e)}catch(t){this.o.log?.("onIntervention threw",t)}}}url(e){let t=`distinct_id=${encodeURIComponent(this.o.distinctId())}${this.cursor?`&cursor=${this.cursor}`:""}`;return`${this.o.apiHost}${e}?${t}`}sleep(e){return new Promise(t=>{this.timer=setTimeout(t,e),this.timer.unref?.()})}async loop(e){let t=0;for(;this.live(e);){let s;try{let r=await this.connectOnce(e);if(r==="gone")return this.stop();r==="poll"?(t=0,s=this.o.pollMs??15e3):(r==="streamed"&&(t=0),s=N(t++,this.o.backoff))}catch(r){this.live(e)&&this.o.log?.("intervention stream error",r),s=N(t++,this.o.backoff)}if(!this.live(e))return;await this.sleep(s)}}async connectOnce(e){if(this.polling)return this.pollOnce(e);this.ctl=new AbortController;let t={Authorization:`Bearer ${this.o.apiKey}`,Accept:"text/event-stream"},s=await this.o.fetch(this.url("/v1/interventions/stream"),{headers:t,signal:this.ctl.signal});if(s.status===404)return"gone";if(!s.ok)return"failed";let r=s.body;if(!r||typeof TextDecoderStream>"u")return this.ctl.abort(),this.polling=!0,this.pollOnce(e);let o=Ze(u=>{if(!(u.event!=="intervention"||!this.live(e)))try{this.deliver(JSON.parse(u.data))}catch{this.o.log?.("bad intervention payload")}}),a=r.pipeThrough(new TextDecoderStream).getReader();for(;;){let{done:u,value:p}=await a.read();if(u)return"streamed";o(p)}}async pollOnce(e){this.ctl=new AbortController;let t=await this.o.fetch(this.url("/v1/interventions"),{headers:{Authorization:`Bearer ${this.o.apiKey}`},signal:this.ctl.signal});if(t.status===404)return"gone";if(!t.ok)return"failed";let s=await t.json();if(this.live(e))for(let r of s.data??[])this.deliver(r);return"poll"}};function be(n,e){let t=new Set,{whenConsented:s,disabled:r,...o}=e,a=new se({...o,distinctId:()=>n.distinctId,onIntervention:p=>{for(let h of[...t])h(p)}}),u=!1;return n.onChange(p=>{u&&((p==="identify"||p==="reset")&&a.restart(),p==="consent"&&(n.hasConsent("analytics")?a.start():a.stop()))}),{on(p){return t.add(p),!u&&!r&&(u=!0,s(()=>a.start())),()=>{t.delete(p)}},stop:()=>a.stop()}}function _e(n,e,t={}){let s=t.key??"lc_offline",r=t.maxBatches??50,o=t.maxBytes??1e6,a=t.isOnline??(()=>!0),u,p,h=()=>{try{let g=JSON.parse(e.get(s)??"[]");return Array.isArray(g)?g:[]}catch{return[]}},m=g=>{let v=g.reduce((b,w)=>b+w.body.length,0);for(;g.length>r||v>o&&g.length>1;)v-=g.shift().body.length;g.length?e.set(s,JSON.stringify(g)):e.remove(s)},_=g=>{m([...h(),...g]),u??=setTimeout(()=>{u=void 0,$.drain()},t.retryMs??3e4)},$={async send(g,v,b){if(!a())return _([{url:g,body:v}]),{status:200};let w=await n.send(g,v,b);return w.status!==0?w:(_([{url:g,body:v}]),{status:200})},drain(){return p??=(async()=>{let g=h();if(!g.length||!a())return;e.remove(s);let v=[];for(let[b,w]of g.entries())if((await n.send(w.url,w.body)).status===0){v.push(...g.slice(b));break}v.length&&_(v)})().finally(()=>{p=void 0}),p}};return $}function we(n){let e=Object.keys(n);if(e.length===0)return{};let t={};for(let s of e)t[`$feature/${s}`]=n[s];return t.$active_feature_flags=e.filter(s=>n[s]!==!1).sort(),t}function U(n,e,t,s){return{key:n,value:e,enabled:e!==void 0&&e!==!1,...typeof e=="string"?{variant:e}:{},...t!==void 0?{payload:t}:{},reason:e===void 0?"not_found":s}}var T={started:"$ai_conversation_started",message:"$ai_message",feedback:"$ai_feedback",ended:"$ai_conversation_ended",outcome:"$ai_outcome"},zt=["resolved","unresolved","escalated","abandoned","error"],Vt=4e3,Kt=2e3,tt=["wrong","useless","not helpful","unhelpful","doesn't work","does not work","didn't help","did not help","not what i asked","that's not it","stupid","terrible","awful","frustrating","frustrated","annoying","worst","hate","incorrect","nonsense","confusing","makes no sense","real person","human agent","talk to a human","speak to a human","wtf","ugh"],nt=["thanks","thank you","great","perfect","awesome","helpful","that worked","works now","solved","exactly"],W=n=>Array.from(n),ke=(n,e)=>W(n).slice(0,e).join(""),Gt=0xcbf29ce484222325n,Yt=0x100000001b3n,Jt=0xffffffffffffffffn,Qt=new TextEncoder;function Xt(n){let e=Gt;for(let t of Qt.encode(n))e=(e^BigInt(t))*Yt&Jt;return e}function st(n){let e=(n.toLowerCase().match(/[\p{L}\p{N}]+/gu)??[]).filter(r=>W(r).length>=2);if(!e.length)return;let t=new Array(64).fill(0);for(let r of e){let o=Xt(r);for(let a=0;a<64;a++)t[a]=(t[a]??0)+((o>>BigInt(a)&1n)===1n?1:-1)}let s=0n;for(let r=0;r<64;r++)(t[r]??0)>0&&(s|=1n<<BigInt(r));return s.toString(16).padStart(16,"0")}function rt(n){let t=` ${n.toLowerCase().replace(/’/g,"'").replace(/[.,!?;:]/g," ").replace(/\s+/g," ").trim()} `,s=0;for(let o of tt)t.includes(` ${o} `)&&(s++,t=t.split(` ${o} `).join(" "));let r=nt.filter(o=>t.includes(` ${o} `)).length;return s>r?-1:r>s?1:0}var ot=n=>W(n).filter(e=>e>="0"&&e<="9").map(Number);function Zt(n){let e=ot(n);if(e.length<13||e.length>19)return!1;let t=0;return e.reverse().forEach((s,r)=>t+=r%2===1?s>4?s*2-9:s*2:s),t%10===0}var et=String.raw`[\p{Alphabetic}\p{M}\p{Nd}\p{Pc}\p{Join_Control}]`,en=[[new RegExp(String.raw`(?<!${et})\p{Nd}(?:[ -]?\p{Nd}){12,18}(?!${et})`,"gu"),Zt],[/[A-Za-z0-9._%+-]+@[A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)*\.[A-Za-z]{2,}/g,()=>!0],[/\+?\p{Nd}[\p{Nd}\s().-]{7,}\p{Nd}/gu,tn]];function tn(n){let e=ot(n).length;return e>=10&&e<=15}var nn=n=>W(n).map(e=>/\s/u.test(e)?e:"*").join("");function xe(n){let e=n;for(let[t,s]of en)e=e.replace(t,r=>s(r)?nn(r):r);return e===n?void 0:e}function it(n){if(typeof n!="string")return;let e=n.toLowerCase();return/^[0-9a-f]{32}$/.test(e)?e:void 0}var at=n=>typeof n=="string"&&zt.includes(n)?n:void 0,q=(n,e)=>typeof n=="string"&&n?ke(n,e):void 0;function sn(n,e,t){let s=ke(e,t),r=xe(s);return r===void 0?{[n]:s}:{[n]:r,$ai_text_redacted:!0}}function ct(n,e,t,s){if(n!=="user"&&n!=="assistant")return;let r={$ai_role:n,$ai_message_index:t,$ai_text_length:W(e).length};if(n==="user"){let o=st(e);o!==void 0&&(r.$ai_text_hash=o),r.$ai_sentiment=rt(e)}return s?{...r,...sn("$ai_text",e,Vt)}:r}function lt(n,e){let t=n.value;if(n.kind==="thumbs"&&t!==1&&t!==-1||n.kind==="rating"&&!(Number.isInteger(t)&&t>=1&&t<=5)||n.kind!=="thumbs"&&n.kind!=="rating"&&n.kind!=="comment")return;let s={$ai_feedback_kind:n.kind};if(n.kind!=="comment"&&(s.$ai_feedback_value=t),n.comment&&e){let r=ke(n.comment,Kt);s.$ai_feedback_comment=xe(r)??r}return n.messageIndex!==void 0&&(s.$ai_message_index=n.messageIndex),s}function Se(n,e){let t=at(n),s=q(e,64);return{...t?{$ai_outcome:t}:{},...s?{$ai_resolution:s}:{}}}function rn(){let n=globalThis.crypto,e=new Uint8Array(16);if(n?.getRandomValues)n.getRandomValues(e);else for(let s=0;s<16;s++)e[s]=Math.floor(Math.random()*256);e[6]=(e[6]??0)&15|64,e[8]=(e[8]??0)&63|128;let t=Array.from(e,s=>s.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}function dt(n={}){let e={$ai_conversation_id:n.conversationId||rn()},t=(s,r)=>{r!==void 0&&(e[s]=r)};return t("$ai_agent_name",q(n.agentName,128)),t("$ai_agent_version",q(n.agentVersion,64)),t("$ai_topic",q(n.topic,128)),t("$ai_use_case",q(n.useCase,128)),t("$ai_trace_id",it(n.traceId)),e}var H=class{next=0;common;emit;captureText;constructor(e,t={},s=!1){this.emit=e,this.captureText=s,this.common=dt(t)}get id(){return this.common.$ai_conversation_id}send(e,t){this.emit(e,{...this.common,...t})}start(){return this.send(T.started,{}),this}message(e,t,s={}){let r=s.index??this.next,o=ct(e,t,r,this.captureText);return o?(this.next=r+1,this.send(T.message,o),!0):!1}feedback(e){let t=lt(e,this.captureText);return t?(this.send(T.feedback,t),!0):!1}end(e,t){this.send(T.ended,Se(e,t))}outcome(e,t){let s=Se(e,t);return s.$ai_outcome?(this.send(T.outcome,s),!0):!1}};var on=["bot","crawl","spider","slurp","headlesschrome","phantomjs","puppeteer","playwright","lighthouse","pingdom","uptimerobot","facebookexternalhit","preview","scrapy","python-requests","go-http-client","cypress","lightpanda","hubspot","nessus","prerender","deepscan","screaming frog","sitebulb","turnitin","ia_archiver","chatgpt-user","app.hypefactors.com","google favicon","google web preview","-google","googleother","googleweblight","google-read-aloud","google-inspectiontool","google-hoteladsverifier","google-cloudvertexbot"];function ut(n,e=[]){let t=n.toLowerCase();return e.some(s=>s&&t.includes(s.toLowerCase()))?!0:on.some(s=>t.includes(s))&&!/\bcubot\b/.test(t)}var O=["gclid","gad_source","gclsrc","dclid","gbraid","wbraid","fbclid","igshid","msclkid","ttclid","li_fat_id","twclid","mc_cid","rdt_cid","epik","qclid","sccid","oppref","bfcid","irclid","_kx"],pt="lc_click_ids";function ft(n,e=90,t=Date.now){let s,r=()=>{try{return JSON.parse(n.get(pt)??"{}")}catch{return{}}};return()=>{let o=r();if(location.search!==s){s=location.search;let u=new URLSearchParams(s),p=!1;for(let h of O){let m=u.get(h);m&&(o[h]={v:m.slice(0,512),t:t()},p=!0)}p&&n.set(pt,JSON.stringify(o))}let a={};for(let u of O){let p=o[u];p&&t()-p.t<e*864e5&&(a[u]=p.v)}return a}}function an(){return Array.from(document.querySelectorAll("meta[http-equiv]")).filter(n=>n.getAttribute("http-equiv")?.toLowerCase()==="content-security-policy").map(n=>n.getAttribute("content")??"")}function cn(n){let e=new Map;for(let s of n.split(";")){let[r,...o]=s.trim().toLowerCase().split(/\s+/);r&&!e.has(r)&&e.set(r,o)}let t=e.get("style-src-elem")??e.get("style-src")??e.get("default-src");return!!t&&!(t.includes("'unsafe-inline'")&&!t.some(s=>s.startsWith("'nonce-")||s.startsWith("'sha")))}function ht(n,e){if(typeof document>"u")return()=>{};!e&&an().some(cn)&&n("CSP hint: this page's Content-Security-Policy blocks inline <style>; set the `nonce` option so guides and the experiment veil render (see the Content Security Policy help page)");let t=s=>{let r=s;/^style-src/.test(r.effectiveDirective??"")&&r.blockedURI==="inline"&&n(`CSP hint: an inline style was blocked by ${r.effectiveDirective}${e?" (check that `nonce` matches the page's nonce)":"; set the `nonce` option"}`)};return document.addEventListener("securitypolicyviolation",t),()=>document.removeEventListener("securitypolicyviolation",t)}var ln=(n,e)=>n.slice(0,e);function gt(n){try{let e=new URL(n);return e.protocol==="data:"||e.protocol==="blob:"?e.protocol:e.origin+e.pathname}catch{return ln(n,64)}}function mt(n,e={}){if(typeof document>"u")return()=>{};let t=e.maxPerPage??20,s=new Set,r=o=>{let a=o,u={$csp_directive:a.effectiveDirective??a.violatedDirective,$csp_blocked_uri:gt(a.blockedURI??""),$csp_source_file:a.sourceFile?gt(a.sourceFile):void 0,$csp_line:a.lineNumber||void 0,$csp_column:a.columnNumber||void 0,$csp_disposition:a.disposition},p=[u.$csp_directive,u.$csp_blocked_uri,u.$csp_source_file,u.$csp_line].join("|");s.has(p)||s.size>=t||(s.add(p),n("$csp_violation",Object.fromEntries(Object.entries(u).filter(([,h])=>h!==void 0))))};return document.addEventListener("securitypolicyviolation",r),()=>document.removeEventListener("securitypolicyviolation",r)}var dn=["chrome-extension:","moz-extension:","safari-web-extension:","ms-browser-extension:"],yt=()=>typeof location<"u"&&dn.includes(location.protocol);function un(n,e,t){let s=e.find(a=>n.startsWith(`${a}/`));if(!s)return n;let r=n.slice(s.length),o=r.search(/[?#]/);return s+t(o<0?r:r.slice(0,o))+(o<0?"":r.slice(o))}function vt(n,e,t,s){if(!s)return{transport:n,fetch:e};let r=o=>un(o,t,s);return{transport:{send:(o,a,u)=>n.send(r(o),a,u)},fetch:((o,a)=>e(typeof o=="string"?r(o):o instanceof URL?r(o.href):o,a))}}var pn="__LUCIDA_DEVTOOLS_HOOK__";function bt(n,e,t){let s=globalThis[pn];if(!(!s||typeof s.emit!="function"||typeof s.attach!="function")){n.onCapture(r=>{try{s.emit(r)}catch{}});try{s.attach({projectKeyPrefix:n.apiKey.slice(0,8),apiHost:t,distinctId:()=>e.distinctId,loadToolbar:r=>e.loadToolbar(r),startReplay:async()=>n.replay?(await n.replay.start(!0),n.replay.isRecording()):!1,replayUrl:()=>e.getReplayUrl()})}catch{}}}var z=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"];function fn(n){let e={},t=new URLSearchParams(location.search);for(let s of[...z,...O,...n]){let r=t.get(s);r&&(e[`$${s}`]=r)}return e}var gn=["ref","referral","via","aff"];function _t(n){if(!n)return;let e=Array.isArray(n)?{params:n}:{params:n.params??gn,...n.category?{category:n.category}:{}};return e.params.length?e:void 0}function wt(n){let e=new URLSearchParams(location.search);for(let t of n){let s=e.get(t);if(s)return s.slice(0,256)}}function St(){let n=new URLSearchParams(location.search),e=z.map(t=>n.get(t)??"");return e.some(Boolean)?e.join("|"):void 0}function hn(n){try{return n?new URL(n).hostname:""}catch{return""}}var mn=()=>location.href.replace(/([?&])__lc_toolbar=[^&#]*&?/,"$1").replace(/[?&]$/,"");function yn(){let n=location.hash;return n.length>1?location.pathname+n.split("?")[0]:location.pathname}function kt(n,e,t=[],s=!1){let r={$current_url:mn(),$host:location.host,$pathname:s?yn():location.pathname,$referrer:document.referrer,$title:document.title,$screen_width:screen.width,$screen_height:screen.height,$viewport_width:window.innerWidth,$viewport_height:window.innerHeight,$browser_language:navigator.language,$timezone:Intl.DateTimeFormat().resolvedOptions().timeZone};if(navigator.maxTouchPoints>1&&(r.$touch_points=navigator.maxTouchPoints),n!=="$pageview")return{properties:r};let o=fn(t);Object.assign(r,o);let a=e.$current_url??location.href,u=e.$referrer??document.referrer,p={$initial_referrer:u||"$direct",$initial_referring_domain:hn(u)||"$direct",$initial_current_url:a};for(let[h,m]of Object.entries(o))p[`$initial_${h.slice(1)}`]=m;return{properties:r,$set_once:p}}function xt(n,e,t=globalThis){e&&(t[typeof e=="string"?e:"lucida"]=n,typeof CustomEvent=="function"&&t.dispatchEvent?.(new CustomEvent("lucida:ready",{detail:n})))}var M=()=>{},Ce=()=>Promise.resolve(),Ct={isInternal:!1,hasOptedOut:()=>!1,hasOptedIn:()=>!1,consentStatus:()=>"pending",getConsentStatus:()=>"pending",getConsent:()=>({analytics:!1,replay:!1,marketing:!1}),getAllFlags:()=>({}),isFeatureEnabled:()=>!1,getFlagResult:n=>U(n,void 0,void 0,"not_found"),getReplayUrl:()=>"",onSessionId:()=>M,onFlags:()=>M,onIntervention:()=>M,onConsent:()=>M,flush:Ce,shutdown:Ce,reloadFlags:Ce,loadToolbar:()=>Promise.resolve(!1),recommendations:n=>Promise.resolve({placement:n,strategy:"",items:[],shown:M,clicked:M})};function Pt(n){return new Proxy(()=>{},{get:(e,t)=>{if(!(typeof t!="string"||t==="then"))return n&&Object.hasOwn(Ct,t)?Ct[t]:Pt(!1)}})}var $t=()=>Pt(!0);var It="_lcid";var vn=(n,e)=>e.some(t=>{let s=t.replace(/^\./,"").toLowerCase();return n.toLowerCase()===s||n.toLowerCase().endsWith(`.${s}`)});function bn(n,e=Date.now()){let t=n.lastIndexOf("."),[s="",r]=n.slice(t+1).split("_",2),o=/^[0-9a-z]+$/.test(s)?parseInt(s,36):NaN,a=n.slice(0,t);if(t>0&&a.length<=200&&o<=e+5e3&&e-o<=12e4)return r&&/^[\w-]{1,64}$/.test(r)?{distinctId:a,sessionId:r}:{distinctId:a}}function Ot(n){if(!n?.length)return;let e=new URL(location.href),t=e.searchParams.get(It);if(t!==null){e.searchParams.delete(It),history.replaceState(history.state,"",e.toString());try{if(document.referrer&&!vn(new URL(document.referrer).hostname,n))return}catch{return}return bn(t)}}function Et(n,e=Date.now){let t=n.eventsPerSecond??10,s=n.burst??100,r=s,o=e();return()=>{let a=e();return r=Math.min(s,r+(a-o)/1e3*t),o=a,r<1?!1:(r-=1,!0)}}var $e="<masked>",_n=["password","passwd","pwd","pass","token","access_token","refresh_token","id_token","secret","client_secret","state","session","api_key","apikey","key","auth","authorization","code","otp","email","ssn"],wn=["$pathname","$current_url","$referrer","$initial_referrer","$initial_current_url","$last_current_url"],Sn=[/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,/^[0-9a-hjkmnp-tv-z]{26}$/i,/^\d{4,}$/,/^[0-9a-f]{16,}$/i,/^(?=.*\d)[a-z0-9_-]{20,}$/i],Rt=n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");function kn(n,e){let t=n;for(let s of e.pathRules??[])try{t=t.replace(typeof s.match=="string"?new RegExp(s.match):s.match,s.replace)}catch{}return e.maskPathIds?t.split("/").map(s=>Sn.some(r=>r.test(s))?":id":s).join("/"):t}function Pe(n,e){let t=n;if(e.pathRules?.length||e.maskPathIds){let r=/^((?:[a-z][a-z0-9+.-]*:)?\/\/[^/?#]*)?([^?#]*)([\s\S]*)$/i.exec(t);r&&(t=(r[1]??"")+kn(r[2],e)+r[3])}let s=[..._n,...e.maskParams??[],...e.maskCampaignParams?[...z,...O]:[]];if(s.length){let r=t.indexOf("#"),o=r<0?t:t.slice(0,r),a=r<0?"":t.slice(r);t=o.replace(new RegExp(`([?&])(${s.map(Rt).join("|")})=[^&]*`,"gi"),`$1$2=${$e}`)+a}return e.stripHash&&(t=t.replace(/#.*$/,"")),t}function At(n){let e=new RegExp(`^\\$(initial_|last_)?(${[...z,...O].map(Rt).join("|")})$`),t=s=>{let r;if(n.maskCampaignParams)for(let[o,a]of Object.entries(s))typeof a=="string"&&e.test(o)?(r??={...s})[o]=$e:o==="$click_ids"&&a&&typeof a=="object"&&((r??={...s})[o]=Object.fromEntries(Object.keys(a).map(u=>[u,$e])));for(let o of wn){let a=(r??s)[o];if(typeof a!="string")continue;let u=Pe(a,n);u!==a&&((r??={...s})[o]=u)}if(typeof s.$elements_chain=="string"){let o=s.$elements_chain.replace(/href="((?:[^"\\]|\\.)*)"/g,(a,u)=>`href="${Pe(u,n)}"`);o!==s.$elements_chain&&((r??={...s}).$elements_chain=o)}return Array.isArray(s.$elements)&&((r??={...s}).$elements=s.$elements.map(o=>typeof o?.href=="string"?{...o,href:Pe(o.href,n)}:o)),r??s};return s=>({...s,properties:t(s.properties),...s.$set?{$set:t(s.$set)}:{},...s.$set_once?{$set_once:t(s.$set_once)}:{}})}function xn(n,e,t){let s=e;for(let r of n)try{let o=r(s);if(o==null)return null;if(typeof o!="object"||typeof o.event!="string")return t("beforeSend hook returned a non-event, dropping:",typeof o),null;s=o}catch(o){return t("beforeSend hook threw, dropping event:",o),null}return s}function Cn(n,e=Math.random){return t=>n>=1?t:n<=0||e()>=n?null:{...t,properties:{...t.properties,$sample_rate:n}}}function Pn(n){let e=new Set(n),t=s=>Object.fromEntries(Object.entries(s).filter(([r])=>!e.has(r)));return s=>({...s,properties:t(s.properties),...s.$set?{$set:t(s.$set)}:{},...s.$set_once?{$set_once:t(s.$set_once)}:{}})}var Ie="lc_person_identified",re="lc_pending_set_once",Tt=new Set(["$identify","$create_alias","$groupidentify"]),Mt="$$client_ingestion_warning",$n=6e4,Oe=class{constructor(e,t){this.mode=e;this.storage=t;this.identified=t.get(Ie)==="1";try{this.pending=JSON.parse(t.get(re)??"{}")}catch{this.pending={}}}mode;storage;identified;pending;get blocksPersonWrites(){return this.mode==="never"}get isProfile(){return this.mode==="always"||this.mode==="identified_only"&&this.identified}markIdentified(){this.mode!=="identified_only"||this.identified||(this.identified=!0,this.storage.set(Ie,"1"))}personless(e){return this.mode==="always"?!1:(this.mode==="never"||!this.identified)&&!Tt.has(e)}stash(e){if(this.mode!=="identified_only"||!e)return;let t=Object.entries(e).filter(([s])=>!(s in this.pending));t.length&&(this.pending={...this.pending,...Object.fromEntries(t)},this.storage.set(re,JSON.stringify(this.pending)))}take(){if(!Object.keys(this.pending).length)return;let e=this.pending;return this.pending={},this.storage.remove(re),e}reset(){this.identified=!1,this.pending={},this.storage.remove(Ie),this.storage.remove(re)}};function In(n,e){let t=e,s;if(n.person.personless(e.event)){n.person.stash(e.$set_once);let{$set:o,$set_once:a,$unset:u,...p}=e;t={...p,properties:{...e.properties,$process_person_profile:!1}}}else(s=n.person.take())&&(t={...e,$set_once:{...e.$set_once,...s}});let r=n.hooks.length?xn(n.hooks,t,n.log):t;return r&&n.limit&&!n.limit()&&(n.log("rate limited, dropped",r.event),n.onLimited?.(),r=null),!r&&s&&n.person.stash(s),r}function On(n){let e=n.beforeSend?Array.isArray(n.beforeSend)?n.beforeSend:[n.beforeSend]:[];return[At(n.urlPrivacy??{}),...n.propertyDenylist?.length?[Pn(n.propertyDenylist)]:[],...n.sampleRate!==void 0?[Cn(n.sampleRate)]:[],...e]}function jt(n,e,t,s=Date.now){let r=new Oe(e.personProfiles??"always",n.storage),o,a,u=0,p=-1/0,h=()=>{u+=1,!(s()-p<$n)&&(p=s(),queueMicrotask(()=>{let m=u;u=0,n.capture(Mt,{$$client_ingestion_warning_message:`client rate limit dropped ${m} event(s)`,$dropped_count:m})}))};return n.setFilter(m=>(e.rateLimit!==o&&(o=e.rateLimit,a=o?Et(o):void 0),In({hooks:On(e),person:r,limit:m.event===Mt?void 0:a,log:t,onLimited:h},m))),r}var Ee=class{m=new Map;get(e){return this.m.get(e)??null}set(e,t){this.m.set(e,t)}remove(e){this.m.delete(e)}},En=365,Rn=new Set("co.uk org.uk ac.uk gov.uk me.uk ltd.uk plc.uk net.uk com.au net.au org.au edu.au gov.au co.nz org.nz net.nz co.jp ne.jp or.jp ac.jp go.jp co.kr or.kr com.cn net.cn org.cn com.hk com.tw com.sg com.my co.in net.in org.in co.id co.th com.ph com.vn com.br net.br org.br com.ar com.mx com.co com.pe com.tr com.ua com.pl co.za co.il com.eg com.sa com.ng co.ke github.io gitlab.io vercel.app netlify.app herokuapp.com pages.dev workers.dev web.app firebaseapp.com azurewebsites.net cloudfront.net appspot.com onrender.com fly.dev glitch.me repl.co blogspot.com wordpress.com myshopify.com vercel.dev netlify.com surge.sh render.com railway.app koyeb.app deno.dev ngrok.io ngrok-free.app trycloudflare.com cloudfunctions.net run.app s3.amazonaws.com elasticbeanstalk.com azurestaticapps.net wixsite.com webflow.io framer.app bubbleapps.io".split(" ")),An=new Set("co com net org edu gov gob go ac or ne ltd plc sch mil nom".split(" "));function Tn(n){let e=n.toLowerCase().split(".");for(let t=1;t<e.length-1;t++)if(Rn.has(e.slice(t).join("."))||t===e.length-2&&e[t+1].length===2&&An.has(e[t]))return e.slice(t-1).join(".")}function Mn(n=location.hostname){if(/^[\d.]+$/.test(n)||n.includes(":"))return;let e=n.split(".");for(let t=e.length-2;t>=0;t--){let s=e.slice(t).join(".");if(document.cookie=`__lc_probe=1; Domain=${s}; Path=/; Max-Age=10; SameSite=Lax`,document.cookie.includes("__lc_probe=1"))return document.cookie=`__lc_probe=; Domain=${s}; Path=/; Max-Age=0`,s}return Tn(n)}var oe=class{constructor(e={}){this.o=e}o;domain=null;attr(){if(this.domain===null)try{this.domain=this.o.domain??(this.o.crossSubdomain?Mn():void 0)}catch{this.domain=void 0}return this.domain?`; Domain=${this.domain}`:""}held=new Map;read(e){try{for(let t of document.cookie.split("; ")){let s=t.indexOf("=");if(t.slice(0,s)===e)return decodeURIComponent(t.slice(s+1))}}catch{}return null}get(e){return this.read(e)??this.held.get(e)??null}set(e,t){let s=this.o.secure??location.protocol==="https:"?"; Secure":"",r=Math.round((this.o.expiryDays??En)*86400);try{document.cookie=`${e}=${encodeURIComponent(t)}; Max-Age=${r}; Path=/${this.attr()}; SameSite=Lax${s}`}catch{}this.read(e)===t?this.held.delete(e):this.held.set(e,t)}remove(e){this.held.delete(e);try{document.cookie=`${e}=; Max-Age=0; Path=/${this.attr()}; SameSite=Lax`}catch{}}},j=class{constructor(e="localStorage"){this.kind=e}kind;store(){try{return globalThis[this.kind]}catch{return}}get(e){try{return this.store()?.getItem(e)??null}catch{return null}}set(e,t){try{this.store()?.setItem(e,t)}catch{}}remove(e){try{this.store()?.removeItem(e)}catch{}}},Re=class extends j{constructor(){super("localStorage")}},jn=["lc_identity","lc_session","lc_device_id","lc_consent","lc_person_identified"],Ae=class{constructor(e,t,s){this.cookie=e;this.local=t;this.cookieKeys=s}cookie;local;cookieKeys;get(e){let[t,s]=this.cookieKeys(e)?[this.cookie,this.local]:[this.local,this.cookie];return t.get(e)??s.get(e)}set(e,t){this.local.set(e,t),this.cookieKeys(e)?this.cookie.set(e,t):this.cookie.remove(e)}remove(e){this.local.remove(e),this.cookie.remove(e)}},ie=class{constructor(e,t){this.inner=e;this.delayMs=t}inner;delayMs;pending=new Map;timer;get(e){return this.pending.has(e)?this.pending.get(e)??null:this.inner.get(e)}set(e,t){this.queue(e,t)}remove(e){this.queue(e,null)}queue(e,t){this.pending.set(e,t),this.timer??=setTimeout(()=>this.flush(),this.delayMs)}flush(){clearTimeout(this.timer),this.timer=void 0;for(let[e,t]of this.pending)t===null?this.inner.remove(e):this.inner.set(e,t);this.pending.clear()}},Te=class{constructor(e,t){this.inner=e;this.suffix=t}inner;suffix;get(e){return this.inner.get(e+this.suffix)}set(e,t){this.inner.set(e+this.suffix,t)}remove(e){this.inner.remove(e+this.suffix)}},ae=n=>`_${n.replace(/\W/g,"").slice(-8)}`;function ce(n,e,t){if(n==="memory"||n==="none")return new Ee;let s=ae(e),r=n==="cookie"?new oe(t):n==="localStorage+cookie"?new Ae(new oe(t),new Re,o=>jn.some(a=>o===a+s)):new j(n);return new Te(r,s)}function Dt(n,e,t){let s=ae(e),r=new Set;try{for(let o of document.cookie.split("; "))r.add(o.split("=")[0]);for(let o of[globalThis.localStorage,globalThis.sessionStorage])for(let a=0;a<o.length;a++)r.add(o.key(a))}catch{}for(let o of r)if(!(!o.startsWith("lc_")||!o.endsWith(s)||o===t+s)){n.remove(o.slice(0,-s.length));try{localStorage.removeItem(o),sessionStorage.removeItem(o)}catch{}}}async function Dn(n){if(!(typeof CompressionStream>"u"||typeof Response>"u"))try{let e=new Response(n).body?.pipeThrough(new CompressionStream("gzip"));return e?new Uint8Array(await new Response(e).arrayBuffer()):void 0}catch{return}}function Lt(n,e={}){let t=e.compress??!0,s=(r,o)=>(e.onError?.({url:r,status:o}),{status:o});return{async send(r,o,a){if(a?.beacon&&!e.disableBeacon&&typeof navigator<"u"&&navigator.sendBeacon)return navigator.sendBeacon(r,new Blob([o],{type:"text/plain"}))?{status:200}:s(r,0);try{let u=t&&o.length>=1024?await Dn(o):void 0,p=await n(u?`${r}${r.includes("?")?"&":"?"}compression=gzip`:r,{method:"POST",body:u??o,headers:{...e.headers,"Content-Type":"text/plain;charset=UTF-8"},credentials:"omit",keepalive:(u?.length??o.length)<6e4});return p.status>=400?s(r,p.status):{status:p.status}}catch{return s(r,0)}}}}var Me={send:async()=>({status:200})};var Ln="lucida-browser",Fn="0.1.13",je="lc_internal",Nn=3e3,Ft="https://capture.lucidace.com",De=n=>!!n&&typeof n=="object"&&Object.getPrototypeOf(n)===Object.prototype;function Le(n,e={},t=[]){if(typeof window>"u"||typeof navigator>"u")return $t();let s=!!e.debug||typeof location<"u"&&/[?&]__(lc|lucida)_debug=(1|true)/.test(location.search),r=(...i)=>{s&&console.debug("[lucida]",...i)},o=(e.apiHost??Ft).replace(/\/+$/,""),a=Object.fromEntries(Object.entries(e).map(([i,c])=>[i,De(c)?{...c}:c]));a.apiHost=o;let u=e.extension??yt(),p=i=>u&&(i==="cookie"||i==="localStorage+cookie")?e.extensionPersistence??"localStorage":i,h=p(e.cookieless==="always"?"none":e.persistence??"cookie"),m=[o,...e.flagsApiHost?[e.flagsApiHost.replace(/\/+$/,"")]:[]],_=e.fetch??((...i)=>fetch(...i)),$=i=>vt(i,_,m,e.rewritePath),g=$(Me).fetch,v=e.consent?.respectDnt,b=navigator.globalPrivacyControl===!0,w=(e.respectDnt??v)===!0&&navigator.doNotTrack==="1"||(e.respectGpc??v)===!0&&b,Fe=e.blockBots!==!1&&typeof navigator<"u"&&ut(navigator.userAgent??"",e.blockedUserAgents),k=!!e.disabled||Fe;Fe&&r("bot user agent: capture disabled");let le,de=$(e.transport??Lt(_,{headers:a.requestHeaders,onError:e.onRequestError,disableBeacon:e.disableBeacon})).transport;if(!e.transport&&e.offlineQueue!==!1&&h!=="memory"&&h!=="none"){let i=new I(new j(h==="sessionStorage"?"sessionStorage":"localStorage"),()=>l.hasConsent("analytics"));de=le=_e(de,i,{key:`lc_offline${ae(n)}`,isOnline:()=>navigator.onLine!==!1})}let V=k?void 0:Ot(e.crossDomains),ue=ce(k?"memory":h,n,e.cookie),K=(e.storageWriteDelayMs??0)>0?new ie(ue,e.storageWriteDelayMs):void 0,Ne=V?.sessionId??e.bootstrap?.sessionId,pe,G=!1,Be,Ue=new Map,qe,fe=[],l=new B({apiKey:n,apiHost:o,transport:k?Me:de,storage:K??ue,...e.consentPersistence&&!k?{consentStorage:ce(p(e.consentPersistence),n,e.cookie)}:{},persistProperty:i=>!a.persistedProperties||a.persistedProperties.includes(i),...h==="none"?{cookieless:!0}:{},library:{name:Ln,version:Fn},consent:{...e.cookieless==="on_reject"?{cookielessOnReject:!0}:{},...e.consent,...!k&&(e.consent?.geo||e.consent?.mode!=="opt_in")?{awaitRemote:!0}:{},respectDnt:!0,dnt:w},queue:{...e.flushAt?{flushAt:e.flushAt}:{},...e.flushIntervalMs?{flushIntervalMs:e.flushIntervalMs}:{}},...V||e.bootstrap?.distinctId?{bootstrapDistinctId:V?.distinctId??e.bootstrap?.distinctId}:{},...e.bootstrap?.isIdentified&&!V?{bootstrapIdentified:!0}:{},session:{...e.session,...Ne?{bootstrapId:Ne}:{}},enrich:(i,c)=>{let d=kt(i,c,a.customCampaignParams,e.capturePageview==="hash");if(o!==Ft&&(d.properties={...d.properties,$lib_custom_api_host:o}),fe.length){let C=l.sessionId;for(let R of fe)d.properties={...d.properties,...R(C)}}if(i==="$pageview"){let C=l.sessionId;if(C!==Be){let R=_t(e.referralParams);if(R&&(!R.category||Ue.get(R.category)===!0)){Be=C;let he=wt(R.params);he&&(d.properties={...d.properties,$referral_code:he},d.$set_once={...d.$set_once,initial_referral_code:he})}}}let y=qe?.()??{},S=Object.keys(y);return S.length&&(d.properties={...d.properties,$click_ids:y},i==="$pageview"&&(d.$set_once={...Object.fromEntries(S.map(C=>[`$initial_${C}`,y[C]])),...d.$set_once},d.$set=Object.fromEntries(S.map(C=>[`$last_${C}`,y[C]])))),a.sendFeatureFlags!==!1&&i!=="$snapshot"&&pe&&(d.properties={...we(pe.all()),...d.properties}),G?{...d,properties:{...d.properties,$internal:!0}}:d},campaignKey:St,log:r});G=l.storage.get(je)==="1",e.clickIds!==!1&&(qe=ft(l.storage,e.clickIds?.expiryDays));let x=jt(l,a,r);e.bootstrap?.isIdentified&&x.markIdentified();let D=i=>x.blocksPersonWrites?(r(`personProfiles=never: ${i} ignored`),!0):!1;k||l.onChange(i=>{i!=="consent"||l.hasConsent("analytics")||l.consentStatus()!=="denied"||(K?.flush(),Dt(ue,n,e.consent?.storageKey||J))});let ge=new Set;l.onChange(i=>{i==="consent"&&[...ge].forEach(c=>c())});let He=[],E=[ht(r,e.nonce)],We=l.storage;if(e.flagPersistence&&!k){let i=new I(ce(p(e.flagPersistence),n,e.cookie),()=>l.hasConsent("analytics"));l.onChange(c=>{c==="consent"&&(l.hasConsent("analytics")?i.flushBuffered():i.discardBuffered())}),We=i}let Y=i=>{if(k)return;if(l.hasConsent("analytics"))return i();let c=!1;l.onChange(d=>{!c&&d==="consent"&&l.hasConsent("analytics")&&(c=!0,i())})},ze,f={core:l,client:void 0,config:a,flagStorage:We,apiKey:n,log:r,fetch:g,onUnload:i=>{He.push(i)},whenConsented:Y,onCapture:i=>l.onCaptured(i),eventExtras:fe,clickExtras:[],flagPersonProps:[],categoryGrants:Ue,loadConfig:()=>ze??=new Promise(i=>Y(()=>{g(`${o}/v1/config?api_key=${encodeURIComponent(n)}`).then(c=>c.ok?c.json():null).then(c=>(c&&l.applyRemote(c),c)).then(i,()=>i(null))}))},Ve=Promise.resolve();if(l.consent.resolving){let i=!1,c=g(`${o}/v1/config?api_key=${encodeURIComponent(n)}`,{credentials:"omit"}).then(d=>(i=d.status>=500,d.ok?d.json():null)).catch(()=>(i=!0,null));ze=c,Ve=new Promise(d=>{let y=setTimeout(()=>(l.resolveConsent("opt_in"),d()),Nn);c.then(S=>{clearTimeout(y),S?l.applyRemote(S):i?l.resolveConsent("opt_in"):l.applyRemote({}),d()})})}let Ke=be(l,{apiHost:o,apiKey:n,fetch:g,whenConsented:Y,log:r,disabled:k});E.push(()=>Ke.stop());let L={get distinctId(){return l.distinctId},capture:(i,c,d)=>{l.capture(i,c,d?.timestamp!==void 0?{timestamp:d.timestamp}:{})&&(d?.sendInstantly||d?.transport)&&l.flush(d.transport==="beacon"?{beacon:!0}:{})},identify:(i,c,d)=>{D("identify")||(x.markIdentified(),l.identify(i,c,d))},alias:(i,c)=>{D("alias")||(x.markIdentified(),l.alias(i,c))},reset:i=>{l.reset({resetDeviceId:!!i,reuseAnonymousId:!!e.reuseAnonymousId}),x.reset()},createPersonProfile:()=>{D("createPersonProfile")||x.isProfile||(x.markIdentified(),l.capture("$set",{}))},setConfig:i=>{let c=a;for(let[d,y]of Object.entries(i)){let S=c[d];De(S)&&De(y)?Object.assign(S,y):c[d]=y}"debug"in i&&(s=!!i.debug)},setPersonProperties:(i,c)=>{!i&&!c||D("setPersonProperties")||(x.markIdentified(),l.capture("$set",{},{...i?{$set:i}:{},...c?{$set_once:c}:{}}))},unsetPersonProperties:i=>{!i.length||D("unsetPersonProperties")||(x.markIdentified(),l.capture("$set",{},{$unset:i}))},getDistinctId:()=>l.distinctId,getSessionId:()=>l.sessionId,onSessionId:i=>l.onSessionId(c=>i(c)),getProperty:i=>l.getProperty(i),hasOptedOut:()=>l.consentStatus()==="denied",hasOptedIn:()=>l.consentStatus()==="granted",onConsent:i=>(ge.add(i),()=>{ge.delete(i)}),getReplayUrl:i=>{let d=`${(e.uiHost??o).replace(/\/+$/,"")}/replays/${encodeURIComponent(l.sessionId)}`,y=l.sessionStart;return!i?.withTimestamp||y===void 0?d:`${d}?t=${Math.max(0,Math.round((Date.now()-y)/1e3-(i.timestampLookBackSeconds??10)))}`},debug:(i=!0)=>{s=i},featureView:(i,c)=>{l.capture("$feature_view",{...c,$feature_flag:i},{$set:{[`$feature_view/${i}`]:!0}})},featureInteraction:(i,c)=>{l.capture("$feature_interaction",{...c,$feature_flag:i},{$set:{[`$feature_interaction/${i}`]:!0}})},updateFlags:(i,c,d)=>f.flags?.update(i,c,d?.merge??!0),register:i=>l.register(i),registerOnce:i=>l.registerOnce(i),unregister:i=>l.unregister(i),group:(i,c,d)=>{x.markIdentified(),l.group(i,c,d)},optIn:(i=["analytics","replay"])=>l.setConsent({analytics:i.includes("analytics"),replay:i.includes("replay"),marketing:i.includes("marketing")}),optOut:()=>l.optOut(),optOutInternal:(i=!0)=>{G=i,i?l.storage.set(je,"1"):l.storage.remove(je)},get isInternal(){return G},setConsent:i=>l.setConsent(i),getConsent:()=>l.getConsent(),getConsentStatus:i=>l.getConsentStatus(i),consentStatus:()=>l.consentStatus(),getFlag:i=>f.flags?.get(i),getFlagPayload:i=>f.flags?.payload(i),getFlagResult:(i,c)=>f.flags?.result(i,c)??U(i,void 0,void 0,"not_found"),getLayerParam:(i,c,d)=>f.flags?.layerParam(i,c)??d,isFeatureEnabled:i=>{let c=f.flags?.get(i);return c!==void 0&&c!==!1},onFlags:i=>f.flags?.onChange(i)??(()=>{}),onIntervention:i=>Ke.on(i),reloadFlags:()=>f.flags?.reload()??Promise.resolve(),getAllFlags:()=>f.flags?.all()??{},overrideFlags:(i,c)=>f.flags?.override(i,c),setPersonPropertiesForFlags:(i,c)=>f.flags?.setPersonProperties(i,c),resetPersonPropertiesForFlags:()=>f.flags?.resetPersonProperties(),setGroupPropertiesForFlags:(i,c)=>f.flags?.setGroupProperties(i,c),resetGroupPropertiesForFlags:()=>f.flags?.resetGroupProperties(),setContext:(i,c,d)=>f.flags?.setContext(i,c,d),clearContext:i=>f.flags?.clearContext(i),guides:{showChangelog:()=>f.guides?.showChangelog()??0,show:i=>f.guides?.show(i)??!1,reset:i=>f.guides?.reset(i)},ai:{startConversation:i=>new H((c,d)=>L.capture(c,d),i,a.ai?.captureText===!0).start()},earlyAccess:{list:()=>f.earlyAccess?.list()??Promise.resolve([]),optIn:i=>f.earlyAccess?.optIn(i),optOut:i=>f.earlyAccess?.optOut(i)},replay:{start:i=>f.replay?.start(i)??Promise.resolve(),stop:()=>f.replay?.stop(),pause:()=>f.replay?.pause(),resume:()=>f.replay?.resume(),tag:i=>f.replay?.tag(i),isRecording:()=>f.replay?.isRecording()??!1},consent:{showBanner:i=>f.consentUi?.showBanner(i)??Promise.resolve(null),hideBanner:()=>f.consentUi?.hideBanner()},loadToolbar:i=>f.toolbar?.load(typeof i=="string"?i:i.token)??Promise.resolve(!1),activateExperiment:i=>f.experiments?.activate(i),recommendations:(i,c)=>f.recs?.get(i,c)??Promise.resolve({placement:i,strategy:"",items:[],shown(){},clicked(){}}),flush:()=>Ve.then(()=>l.flush()),shutdown:async()=>{for(let i of E)i();K?.flush(),await l.shutdown()}};if(f.client=L,!k){let i=()=>{for(let d of He)d();K?.flush(),l.flush({beacon:!0})};window.addEventListener("pagehide",i);let c=()=>{document.visibilityState==="hidden"&&l.flush({beacon:!0})};if(document.addEventListener("visibilitychange",c),E.push(()=>{window.removeEventListener("pagehide",i),document.removeEventListener("visibilitychange",c)}),le){let d=()=>{le.drain()};window.addEventListener("online",d),E.push(()=>window.removeEventListener("online",d)),Y(d)}if(e.captureCspViolations){let d=typeof e.captureCspViolations=="object"?e.captureCspViolations:{};E.push(mt((y,S)=>{l.capture(y,S)},d))}for(let d of t){let y=d(f);y&&E.push(y)}pe=f.flags,t.length||f.loadConfig(),bt(f,L,o)}return xt(L,e.exposeGlobal),r("initialised",{apiHost:o,consent:l.getConsent()}),L}function or(n,e={}){return Le(n,e)}export{Le as createClient,or as init};