@lucida-analytics/browser 0.0.0-stage → 0.1.0

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 (108) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +228 -2
  3. package/dist/autocapture.d.ts +78 -0
  4. package/dist/autocapture.js +1 -0
  5. package/dist/banner-CGEWCIGP.js +1 -0
  6. package/dist/chunk-3PWTJFHH.js +1 -0
  7. package/dist/chunk-AWIQCFGN.js +1 -0
  8. package/dist/chunk-GVYMMTQM.js +1 -0
  9. package/dist/chunk-MCWQHOEV.js +1 -0
  10. package/dist/chunk-MI35SSIT.js +1 -0
  11. package/dist/client-ts5YMCoB.d.ts +8 -0
  12. package/dist/consent.d.ts +84 -0
  13. package/dist/consent.js +1 -0
  14. package/dist/core.d.ts +9 -0
  15. package/dist/core.js +3 -0
  16. package/dist/correlate.d.ts +15 -0
  17. package/dist/correlate.js +1 -0
  18. package/dist/early-access.d.ts +12 -0
  19. package/dist/early-access.js +1 -0
  20. package/dist/experiments.d.ts +199 -0
  21. package/dist/experiments.js +1 -0
  22. package/dist/flags.d.ts +13 -0
  23. package/dist/flags.js +3 -0
  24. package/dist/forms.d.ts +13 -0
  25. package/dist/forms.js +1 -0
  26. package/dist/guides.d.ts +1158 -0
  27. package/dist/guides.js +1 -0
  28. package/dist/heatmaps.d.ts +17 -0
  29. package/dist/heatmaps.js +1 -0
  30. package/dist/host-headers.d.ts +16 -0
  31. package/dist/host-headers.js +1 -0
  32. package/dist/index.d.ts +89 -0
  33. package/dist/index.js +3 -0
  34. package/dist/inspector.d.ts +13 -0
  35. package/dist/inspector.js +1 -0
  36. package/dist/lucida.js +3 -0
  37. package/dist/modules-FANMZRDJ.js +1 -0
  38. package/dist/persistent-XLGNSZQR.js +1 -0
  39. package/dist/recommendations.d.ts +2 -0
  40. package/dist/recommendations.js +1 -0
  41. package/dist/recorder-LFUTDRP4.js +78 -0
  42. package/dist/replay.d.ts +18 -0
  43. package/dist/replay.js +1 -0
  44. package/dist/static/v0/autocapture.js +1 -0
  45. package/dist/static/v0/banner-CGEWCIGP.js +1 -0
  46. package/dist/static/v0/chunk-3PWTJFHH.js +1 -0
  47. package/dist/static/v0/chunk-AWIQCFGN.js +1 -0
  48. package/dist/static/v0/chunk-GVYMMTQM.js +1 -0
  49. package/dist/static/v0/chunk-MCWQHOEV.js +1 -0
  50. package/dist/static/v0/chunk-MI35SSIT.js +1 -0
  51. package/dist/static/v0/consent.js +1 -0
  52. package/dist/static/v0/core.js +3 -0
  53. package/dist/static/v0/correlate.js +1 -0
  54. package/dist/static/v0/early-access.js +1 -0
  55. package/dist/static/v0/experiments.js +1 -0
  56. package/dist/static/v0/flags.js +3 -0
  57. package/dist/static/v0/forms.js +1 -0
  58. package/dist/static/v0/guides.js +1 -0
  59. package/dist/static/v0/heatmaps.js +1 -0
  60. package/dist/static/v0/host-headers.js +1 -0
  61. package/dist/static/v0/index.js +3 -0
  62. package/dist/static/v0/inspector.js +1 -0
  63. package/dist/static/v0/lucida.js +3 -0
  64. package/dist/static/v0/modules-FANMZRDJ.js +1 -0
  65. package/dist/static/v0/persistent-XLGNSZQR.js +1 -0
  66. package/dist/static/v0/recommendations.js +1 -0
  67. package/dist/static/v0/recorder-LFUTDRP4.js +78 -0
  68. package/dist/static/v0/replay.js +1 -0
  69. package/dist/static/v0/toolbar.js +4 -0
  70. package/dist/static/v0/validation-ENITEP6V.js +1 -0
  71. package/dist/static/v0/webmcp.js +1 -0
  72. package/dist/static/v0.1.0/autocapture.js +1 -0
  73. package/dist/static/v0.1.0/banner-CGEWCIGP.js +1 -0
  74. package/dist/static/v0.1.0/chunk-3PWTJFHH.js +1 -0
  75. package/dist/static/v0.1.0/chunk-AWIQCFGN.js +1 -0
  76. package/dist/static/v0.1.0/chunk-GVYMMTQM.js +1 -0
  77. package/dist/static/v0.1.0/chunk-MCWQHOEV.js +1 -0
  78. package/dist/static/v0.1.0/chunk-MI35SSIT.js +1 -0
  79. package/dist/static/v0.1.0/consent.js +1 -0
  80. package/dist/static/v0.1.0/core.js +3 -0
  81. package/dist/static/v0.1.0/correlate.js +1 -0
  82. package/dist/static/v0.1.0/early-access.js +1 -0
  83. package/dist/static/v0.1.0/experiments.js +1 -0
  84. package/dist/static/v0.1.0/flags.js +3 -0
  85. package/dist/static/v0.1.0/forms.js +1 -0
  86. package/dist/static/v0.1.0/guides.js +1 -0
  87. package/dist/static/v0.1.0/heatmaps.js +1 -0
  88. package/dist/static/v0.1.0/host-headers.js +1 -0
  89. package/dist/static/v0.1.0/index.js +3 -0
  90. package/dist/static/v0.1.0/inspector.js +1 -0
  91. package/dist/static/v0.1.0/integrity.json +30 -0
  92. package/dist/static/v0.1.0/lucida.js +3 -0
  93. package/dist/static/v0.1.0/modules-FANMZRDJ.js +1 -0
  94. package/dist/static/v0.1.0/persistent-XLGNSZQR.js +1 -0
  95. package/dist/static/v0.1.0/recommendations.js +1 -0
  96. package/dist/static/v0.1.0/recorder-LFUTDRP4.js +78 -0
  97. package/dist/static/v0.1.0/replay.js +1 -0
  98. package/dist/static/v0.1.0/toolbar.js +4 -0
  99. package/dist/static/v0.1.0/validation-ENITEP6V.js +1 -0
  100. package/dist/static/v0.1.0/webmcp.js +1 -0
  101. package/dist/toolbar.d.ts +193 -0
  102. package/dist/toolbar.js +4 -0
  103. package/dist/types-BWd9sbCh.d.ts +1071 -0
  104. package/dist/types-Cv4pBbPu.d.ts +898 -0
  105. package/dist/validation-ENITEP6V.js +1 -0
  106. package/dist/webmcp.d.ts +21 -0
  107. package/dist/webmcp.js +1 -0
  108. package/package.json +104 -3
package/dist/lucida.js ADDED
@@ -0,0 +1,3 @@
1
+ "use strict";(()=>{var R=(t,e)=>()=>(t&&(e=t(t=0)),e);var Wt,Ye,ue,W,Je=R(()=>{"use strict";Wt="lc_consent",Ye=["analytics","replay","marketing"],ue=class{constructor(e){this.o=e;this.modeNow=e.mode??"opt_out",this.queueBeforeConsent=e.queueBeforeConsent??!1;let n=this.opens();this.state={analytics:n,replay:n,marketing:n},this.key=e.storageKey||Wt;let r=e.storage.get(this.key);if(r)try{let s=JSON.parse(r);for(let o of Ye)typeof s[o]=="boolean"&&(this.state[o]=s[o]);this.decided=Ye.some(o=>typeof s[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 n=!this.geoCookieless&&this.opens();return this.state={analytics:n,replay:n,marketing:n},n}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 n=this.get();for(let r of Ye)e[r]!==void 0&&(this.state[r]=e[r]);this.decided=!0,this.waiting=!1,this.o.storage.set(this.key,JSON.stringify(this.state));for(let r of this.listeners)r(this.get(),n)}onChange(e){this.listeners.push(e)}},W=class{constructor(e,n){this.inner=e;this.allowed=n}inner;allowed;mem=new Map;get(e){return this.mem.has(e)?this.mem.get(e)??null:this.inner.get(e)}set(e,n){this.allowed()?this.inner.set(e,n):this.mem.set(e,n)}remove(e){this.allowed()?this.inner.remove(e):this.mem.set(e,null)}flushBuffered(){for(let[e,n]of this.mem)n===null?this.inner.remove(e):this.inner.set(e,n);this.mem.clear()}discardBuffered(){this.mem.clear()}}});function Kt(t){let e=new Uint8Array(t),n=globalThis.crypto;if(n?.getRandomValues)n.getRandomValues(e);else for(let r=0;r<t;r++)e[r]=Math.floor(Math.random()*256);return e}function B(t=Date.now()){if(t>we){we=t;let o=Kt(2);ne=((o[0]??0)<<8|(o[1]??0))&1023}else ne++,ne>4095&&(we++,ne=0);let e=Kt(8),n=new Uint8Array(16),r=we;n[0]=Math.floor(r/2**40)&255,n[1]=Math.floor(r/2**32)&255,n[2]=Math.floor(r/2**24)&255,n[3]=Math.floor(r/2**16)&255,n[4]=Math.floor(r/2**8)&255,n[5]=r&255,n[6]=112|ne>>8,n[7]=ne&255,n[8]=128|(e[0]??0)&63;for(let o=1;o<8;o++)n[8+o]=e[o]??0;let s=Array.from(n,o=>o.toString(16).padStart(2,"0")).join("");return`${s.slice(0,8)}-${s.slice(8,12)}-${s.slice(12,16)}-${s.slice(16,20)}-${s.slice(20)}`}var we,ne,Se=R(()=>{"use strict";we=0,ne=0});var Gt,Re,zt=R(()=>{"use strict";Se();Gt="lc_identity",Re=class{constructor(e,n,r=!1,s=!1){this.storage=e;this.cookieless=r;let o=e.get(Gt),i;try{i=o?JSON.parse(o):void 0}catch{i=void 0}if(i?.distinct_id)this.s=i;else if(r)this.s={distinct_id:"",anon_id:"",identified:!1};else{let a=n??B();this.s={distinct_id:a,anon_id:a,identified:s&&!!n},this.save()}}storage;cookieless;s;save(){this.storage.set(Gt,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 n=this.s.distinct_id,r=!this.s.identified;return this.s={...this.s,distinct_id:e,identified:!0},this.save(),r&&n?{event:"$identify",anonDistinctId:n}:{event:"$identify"}}aliasProps(e,n){return{alias:e,distinct_id:n??this.s.distinct_id}}reset(e=!1){if(this.cookieless){this.s={distinct_id:"",anon_id:"",identified:!1};return}let n=e&&this.s.anon_id||B();this.s={distinct_id:n,anon_id:n,identified:!1},this.save()}}});function Y(t,e={}){let n=Math.min(e.maxMs??3e4,(e.baseMs??1e3)*2**t);return Math.round(n*(.5+.5*(e.random??Math.random)()))}function Xt(t){return t===0||t===408||t===429||t>=500}var Ce=R(()=>{"use strict"});var Ee,Yt=R(()=>{"use strict";Ce();Ee=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;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 n=this.items.splice(0,this.batchMax),r=(this.o.clock??Date).now(),s=JSON.stringify({api_key:this.o.apiKey,batch:n,sent_at:new Date(r).toISOString()});this.o.log?.("send batch",n.length);let o=this.o.transport.send(this.o.url,s,e.beacon?{beacon:!0}:{}).then(i=>i.status,()=>0).then(i=>this.settle(n,i,!!e.beacon)).finally(()=>{this.inflight=void 0});return this.inflight=o,o}settle(e,n,r){if(n>=200&&n<300){this.attempt=0,this.items.length>=this.flushAt?this.flush():this.items.length&&this.arm(this.intervalMs);return}if(!Xt(n)||r||this.attempt>=this.maxRetries){this.o.onDrop?.(e,`status_${n}`),this.attempt=0;return}this.items.unshift(...e);let s=Y(this.attempt++,this.o.backoff);this.o.log?.("retry in",s,"ms"),this.arm(s)}clear(){this.items=[],this.disarm()}async shutdown(){await this.flush(),this.closed=!0,this.disarm()}}});function Jt(t,e,n){return typeof t=="number"&&Number.isInteger(t)&&t>=e&&t<=n?t*6e4:void 0}var Qe,Pe,Qt=R(()=>{"use strict";Se();Qe="lc_session";Pe=class{constructor(e,n={}){this.storage=e;this.o=n;this.idleMs=n.idleMs??30*6e4,this.maxMs=n.maxMs??24*36e5,this.newOn=n.newOnEvents??[],this.clock=n.clock??Date,this.bootstrapId=n.bootstrapId}storage;o;windowId=B();idleMs;maxMs;newOn;clock;bootstrapId;configure(e){this.o.idleMs===void 0&&(this.idleMs=Jt(e.session_idle_minutes,1,1440)??this.idleMs),this.o.maxMs===void 0&&(this.maxMs=Jt(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(n=>typeof n=="string"&&n!==""))}read(){try{let e=this.storage.get(Qe);return e?JSON.parse(e):void 0}catch{return}}touch(e,n){let r=this.clock.now(),s=this.read(),o=!!(s?.campaign&&e&&s.campaign!==e),i=n!==void 0&&this.newOn.includes(n),a=!s||r-s.last>this.idleMs||r-s.start>this.maxMs||o||i;return(a||!s)&&(s={id:!s&&this.bootstrapId||B(r),start:r,last:r}),this.bootstrapId=void 0,s.last=r,e&&(s.campaign=e),this.storage.set(Qe,JSON.stringify(s)),{sessionId:s.id,windowId:this.windowId,isNew:a}}startedAt(){return this.read()?.start}reset(){this.storage.remove(Qe)}}});function Zt(t,e){let n=t.get(e);if(n)try{return JSON.parse(n)}catch{return}}var $e,Oe,en=R(()=>{"use strict";$e=class{constructor(e,n="lc_props",r){this.storage=e;this.key=n;this.persist=r;this.p=Zt(e,n)??{}}storage;key;persist;p;save(){let e=this.persist;this.storage.set(this.key,JSON.stringify(e?Object.fromEntries(Object.entries(this.p).filter(([n])=>e(n))):this.p))}register(e){Object.assign(this.p,e),this.save()}registerOnce(e){for(let[n,r]of Object.entries(e))n in this.p||(this.p[n]=r);this.save()}unregister(e){delete this.p[e],this.save()}all(){return{...this.p}}clear(){this.p={},this.storage.remove(this.key)}},Oe=class{constructor(e){this.storage=e;this.g=Zt(e,"lc_groups")??{}}storage;g;set(e,n){this.g[e]=n,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 Jr(t,e){let n=new Date(t??e);return(Number.isNaN(n.getTime())?new Date(e):n).toISOString()}var de,tn=R(()=>{"use strict";Je();zt();Yt();Qt();en();Se();de=class{constructor(e){this.c=e;this.clock=e.clock??Date,this.consent=new ue({...e.consent,storage:e.consentStorage??e.storage}),this.gated=new W(e.storage,()=>this.consent.has("analytics")),this.storage=this.gated,this.identity=new Re(this.gated,e.bootstrapDistinctId,e.cookieless,e.bootstrapIdentified),this.session=new Pe(this.gated,{clock:this.clock,...e.session}),this.props=new $e(this.gated,void 0,e.persistProperty),this.groupState=new Oe(this.gated),this.queue=new Ee({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")||B(),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 n=this.session.touch(this.c.campaignKey?.(),e);if(n.sessionId!==this.lastSession){this.lastSession=n.sessionId;for(let r of this.sessionListeners)r(n.sessionId,n.windowId)}return n}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 n of this.listeners)n(e)}consentStatus(){return this.consent.status()}get anonymousOnReject(){return!!this.c.consent?.cookielessOnReject&&this.consent.status()==="denied"}capture(e,n={},r={}){let s=this.consent.has("analytics"),o=!s&&(this.anonymousOnReject||this.consent.anonymous),i=this.consent.pending&&(this.consent.queueBeforeConsent||this.consent.resolving);if(!s&&!o&&!i){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 a=this.touchSession(e),l=this.c.enrich?.(e,n),c=this.consent.status()!=="pending",u=o?{}:{...l?.$set,...r.$set,...e==="$consent_updated"&&c?{$consent:this.consent.get()}:{}},f=o?{}:{...l?.$set_once,...r.$set_once},g=this.groupState.all(),h=o?"":this.identity.distinctId,_={uuid:B(this.clock.now()),event:e,...h?{distinct_id:h}:{},timestamp:Jr(r.timestamp,this.clock.now()),properties:{...this.props.all(),...l?.properties,...n,$session_id:a.sessionId,$window_id:a.windowId,$lib:this.c.library.name,$lib_version:this.c.library.version,...c?{$consent:this.consent.get()}:{}},...Object.keys(u).length?{$set:u}:{},...Object.keys(f).length?{$set_once:f}:{},...!o&&r.$unset?.length?{$unset:r.$unset}:{},...g?{$groups:g}:{}},y=this.filter?this.filter(_):_;if(!y){this.c.log?.("dropped (policy)",e);return}this.c.log?.("capture",e,y),this.c.onCapture?.(y);for(let w of this.captureListeners)w(y);return s||o?this.queue.enqueue(y):this.pre.length<(this.c.queue?.maxQueueSize??1e3)&&this.pre.push(y),y}identify(e,n,r){let s=this.identity.identify(e);(s.event||n||r)&&this.capture("$identify",s.anonDistinctId?{$anon_distinct_id:s.anonDistinctId}:{},{...n?{$set:n}:{},...r?{$set_once:r}:{}}),this.emit("identify")}alias(e,n){this.capture("$create_alias",this.identity.aliasProps(e,n))}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,n,r){this.groupState.set(e,n),this.capture("$groupidentify",{$group_type:e,$group_key:n,$group_set:r??{}}),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 n=this.consent.has("analytics"),r=e.analytics??n;if(n&&!r&&(this.capture("$opt_out"),this.queue.flush()),!n&&r&&(this.anonymousOnReject||this.consent.anonymous)&&this.queue.flush(),this.consent.set(e),!n&&r){this.gated.flushBuffered();for(let s of this.pre.splice(0))this.queue.enqueue(s);this.capture("$opt_in")}else n&&!r&&this.queue.clear();r||(this.pre.length=0),this.emit("consent")}applyRemote(e){this.session.configure(e);let n=e.consent_default;this.resolveConsent(n==="opt_in"||n==="opt_out"||n==="cookieless"?n:void 0)}resolveConsent(e){if(!this.consent.resolving)return;let n=this.consent.resolve(e),r=this.pre.splice(0);if(n){this.gated.flushBuffered();for(let s of r)this.queue.enqueue(s)}else if(this.consent.anonymous){this.gated.discardBuffered();for(let s of r){if(s.event==="$identify"||s.event==="$create_alias")continue;let o={...s};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(...r);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(t){let e="";return n=>{for(e+=n;;){let r=/\r?\n\r?\n/.exec(e);if(!r)return;let s=e.slice(0,r.index);e=e.slice(r.index+r[0].length);let o="message",i,a=[];for(let l of s.split(/\r?\n/)){if(l.startsWith(":"))continue;let c=l.indexOf(":"),[u,f]=c<0?[l,""]:[l.slice(0,c),l.slice(c+1).replace(/^ /,"")];u==="event"?o=f??"":u==="data"?a.push(f??""):u==="id"&&(i=f)}a.length&&t(i===void 0?{event:o,data:a.join(`
2
+ `)}:{event:o,data:a.join(`
3
+ `),id:i})}}}var Ie,et=R(()=>{"use strict";Ce();Ie=class{constructor(e){this.o=e}o;ctl;stopped=!0;timer;start(){this.stopped&&(this.stopped=!1,this.loop())}stop(){this.stopped=!0,this.ctl?.abort(),this.timer&&clearTimeout(this.timer),this.o.onState?.(!1)}async loop(){let e=0;for(;!this.stopped;){try{await this.connectOnce()&&(e=0)}catch(r){this.stopped||this.o.log?.("flag stream error",r)}if(this.o.onState?.(!1),this.stopped)return;let n=Y(e++,this.o.backoff);await new Promise(r=>{this.timer=setTimeout(r,n),this.timer.unref?.()})}}async connectOnce(){this.ctl=new AbortController;let e=await this.o.fetch(this.o.url,{headers:{Authorization:`Bearer ${this.o.secretKey}`,Accept:"text/event-stream"},signal:this.ctl.signal});if(!e.ok||!e.body)throw new Error(`stream status ${e.status}`);this.o.onState?.(!0);let n=Ze(s=>{if(s.event==="definitions")try{this.o.onChange(JSON.parse(s.data).etag)}catch{this.o.onChange(void 0)}}),r=e.body.pipeThrough(new TextDecoderStream).getReader();for(;;){let{done:s,value:o}=await r.read();if(s)return!0;n(o)}}}});function tt(t){let e=!1,n,r=new Ie({url:`${t.apiHost}/v1/flags/stream`,secretKey:t.apiKey,fetch:t.fetch,...t.backoff?{backoff:t.backoff}:{},...t.log?{log:t.log}:{},onState:c=>e=c,onChange:c=>{c!==void 0&&c===n||(n=c,t.reload())}}),s=()=>t.visibility?.hidden()??!1,o=t.pollMs??6e4,i=o>0?setInterval(()=>!e&&!s()&&t.reload(),o):void 0,a=()=>{s()?r.stop():(r.start(),t.reload())};s()||r.start();let l=t.visibility?.subscribe(a);return()=>{r.stop(),l?.(),i&&clearInterval(i)}}var nn=R(()=>{"use strict";et()});function nt(t,e){let n=new Set,{whenConsented:r,disabled:s,...o}=e,i=new Ae({...o,distinctId:()=>t.distinctId,onIntervention:l=>{for(let c of[...n])c(l)}}),a=!1;return t.onChange(l=>{a&&((l==="identify"||l==="reset")&&i.restart(),l==="consent"&&(t.hasConsent("analytics")?i.start():i.stop()))}),{on(l){return n.add(l),!a&&!s&&(a=!0,r(()=>i.start())),()=>{n.delete(l)}},stop:()=>i.stop()}}var Ae,rn=R(()=>{"use strict";et();Ce();Ae=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(n){this.o.log?.("onIntervention threw",n)}}}url(e){let n=`distinct_id=${encodeURIComponent(this.o.distinctId())}${this.cursor?`&cursor=${this.cursor}`:""}`;return`${this.o.apiHost}${e}?${n}`}sleep(e){return new Promise(n=>{this.timer=setTimeout(n,e),this.timer.unref?.()})}async loop(e){let n=0;for(;this.live(e);){let r;try{let s=await this.connectOnce(e);if(s==="gone")return this.stop();s==="poll"?(n=0,r=this.o.pollMs??15e3):(s==="streamed"&&(n=0),r=Y(n++,this.o.backoff))}catch(s){this.live(e)&&this.o.log?.("intervention stream error",s),r=Y(n++,this.o.backoff)}if(!this.live(e))return;await this.sleep(r)}}async connectOnce(e){if(this.polling)return this.pollOnce(e);this.ctl=new AbortController;let n={Authorization:`Bearer ${this.o.apiKey}`,Accept:"text/event-stream"},r=await this.o.fetch(this.url("/v1/interventions/stream"),{headers:n,signal:this.ctl.signal});if(r.status===404)return"gone";if(!r.ok)return"failed";let s=r.body;if(!s||typeof TextDecoderStream>"u")return this.ctl.abort(),this.polling=!0,this.pollOnce(e);let o=Ze(a=>{if(!(a.event!=="intervention"||!this.live(e)))try{this.deliver(JSON.parse(a.data))}catch{this.o.log?.("bad intervention payload")}}),i=s.pipeThrough(new TextDecoderStream).getReader();for(;;){let{done:a,value:l}=await i.read();if(a)return"streamed";o(l)}}async pollOnce(e){this.ctl=new AbortController;let n=await this.o.fetch(this.url("/v1/interventions"),{headers:{Authorization:`Bearer ${this.o.apiKey}`},signal:this.ctl.signal});if(n.status===404)return"gone";if(!n.ok)return"failed";let r=await n.json();if(this.live(e))for(let s of r.data??[])this.deliver(s);return"poll"}}});function rt(t,e,n={}){let r=n.key??"lc_offline",s=n.maxBatches??50,o=n.maxBytes??1e6,i=n.isOnline??(()=>!0),a,l,c=()=>{try{let h=JSON.parse(e.get(r)??"[]");return Array.isArray(h)?h:[]}catch{return[]}},u=h=>{let _=h.reduce((y,w)=>y+w.body.length,0);for(;h.length>s||_>o&&h.length>1;)_-=h.shift().body.length;h.length?e.set(r,JSON.stringify(h)):e.remove(r)},f=h=>{u([...c(),...h]),a??=setTimeout(()=>{a=void 0,g.drain()},n.retryMs??3e4)},g={async send(h,_,y){if(!i())return f([{url:h,body:_}]),{status:200};let w=await t.send(h,_,y);return w.status!==0?w:(f([{url:h,body:_}]),{status:200})},drain(){return l??=(async()=>{let h=c();if(!h.length||!i())return;e.remove(r);let _=[];for(let[y,w]of h.entries())if((await t.send(w.url,w.body)).status===0){_.push(...h.slice(y));break}_.length&&f(_)})().finally(()=>{l=void 0}),l}};return g}var sn=R(()=>{"use strict"});function on(t){let e=new TextEncoder().encode(t),n=e.length+9+63>>6<<6,r=new Uint8Array(n);r.set(e),r[e.length]=128;let s=new DataView(r.buffer);s.setUint32(n-8,Math.floor(e.length*8/2**32)),s.setUint32(n-4,e.length*8>>>0);let o=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],i=new Uint32Array(64);for(let a=0;a<n;a+=64){for(let c=0;c<16;c++)i[c]=s.getUint32(a+c*4);for(let c=16;c<64;c++){let u=i[c-15],f=i[c-2],g=N(u,7)^N(u,18)^u>>>3,h=N(f,17)^N(f,19)^f>>>10;i[c]=i[c-16]+g+i[c-7]+h|0}let l=o.slice();for(let c=0;c<64;c++){let[u,f,g,,h,_,y,w]=l,P=w+(N(h,6)^N(h,11)^N(h,25))+(h&_^~h&y)+Qr[c]+i[c]|0,E=(N(u,2)^N(u,13)^N(u,22))+(u&f^u&g^f&g)|0;l.pop(),l.unshift(P+E|0),l[4]=l[4]+P|0}for(let c=0;c<8;c++)o[c]=o[c]+l[c]|0}return o.map(a=>(a>>>0).toString(16).padStart(8,"0")).join("")}var Qr,N,an=R(()=>{"use strict";Qr=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),N=(t,e)=>t>>>e|t<<32-e});function ln(t){let e=t.split(".");if(e.length!==4)return;let n=[];for(let r of e){if(!Zr.test(r)||Number(r)>255)return;n.push(Number(r))}return n}function ns(t){if(t.includes("%"))return;let e=t,n=t.lastIndexOf(":"),r=t.slice(n+1);if(r.includes(".")){let u=ln(r);if(!u)return;e=`${t.slice(0,n+1)}${(u[0]<<8|u[1]).toString(16)}:${(u[2]<<8|u[3]).toString(16)}`}let s=e.split("::");if(s.length>2)return;let o=u=>{if(u==="")return[];let f=[];for(let g of u.split(":")){if(!es.test(g))return;f.push(parseInt(g,16))}return f},i=o(s[0]),a=s.length===2?o(s[1]):[];if(!i||!a)return;let l=i.length+a.length;return(s.length===2?l>7:l!==8)?void 0:[...i,...Array(8-l).fill(0),...a].flatMap(u=>[u>>8,u&255])}function cn(t){return t.includes(":")?ns(t):ln(t)}function un(t){if(typeof t!="string")return;let e=cn(t.trim());return e&&rs(e)?e.slice(12):e}function ss(t){let e=typeof t=="string"?[t]:Array.isArray(t)?t:[],n=[];for(let r of e){if(typeof r!="string")continue;let s=r.trim(),o=s.indexOf("/");if(o<0){let l=un(s);l&&n.push({bytes:l,bits:l.length*8});continue}let i=cn(s.slice(0,o)),a=s.slice(o+1);!i||!ts.test(a)||Number(a)>i.length*8||n.push({bytes:i,bits:Number(a)})}return n}function os(t,e){if(t.bytes.length!==e.length)return!1;for(let n=0;n<t.bits;n+=8){let s=255<<8-Math.min(8,t.bits-n)&255,o=n/8;if((t.bytes[o]&s)!==(e[o]&s))return!1}return!0}function dn(t,e,n,r){switch(t){case"array_contains_any":case"array_contains_all":case"array_contains_none":{if(!Array.isArray(e)||!Array.isArray(n))return!1;let s=n.filter(o=>e.some(i=>r(i,o))).length;return t==="array_contains_any"?s>0:t==="array_contains_all"?s===n.length:s===0}case"ip_in_cidr":case"ip_not_in_cidr":{let s=un(e),o=ss(n);return!s||!o.length?!1:o.some(i=>os(i,s))===(t==="ip_in_cidr")}}return!1}var Zr,es,ts,rs,pn=R(()=>{"use strict";Zr=/^(0|[1-9]\d{0,2})$/,es=/^[0-9a-fA-F]{1,4}$/,ts=/^(0|[1-9]\d*)$/;rs=t=>t.length===16&&t.slice(0,10).every(e=>e===0)&&t[10]===255&&t[11]===255});function cs(t){let e=as.exec(t.trim());return e?Number(e[1])*ls[e[2]]:void 0}function gn(t,e,n){if(typeof t=="number")return t*1e3;if(typeof t!="string")return;let r=t.trim();if(n){let o=cs(r);if(o!==void 0)return e-o*1e3}if(!is.test(r)&&!fn.test(r))return;let s=Date.parse(fn.test(r)?`${r}T00:00:00Z`:r);return Number.isNaN(s)?void 0:s}function mn(t,e){for(let n=0;n<Math.max(t.length,e.length);n++){let r=t[n]??0,s=e[n]??0;if(r!==s)return r<s?-1:1}return 0}function us(t,e,n){if(typeof e!="string")return;let r=e.trim().replace(/^v/,"").split(".");if(t==="semver_wildcard"){let c=r[r.length-1];if(c!=="*"&&c!=="x"&&c!=="X")return;if(r.length===1)return[[0],[2**30]];let u=n.parseVersion(r.slice(0,-1).join("."));if(!u)return;let f=[...u];return f[f.length-1]=f[f.length-1]+1,[u,f]}let s=n.parseVersion(e);if(!s)return;for(;s.length<3;)s.push(0);let[o,i,a]=s,l;return t==="semver_tilde"&&r.length===1?l=[o+1,0,0]:t==="semver_tilde"||o===0&&i>0?l=[o,i+1,0]:o>0?l=[o+1,0,0]:l=[0,0,a+1],[s,l]}function hn(t,e,n,r,s){switch(t){case"icontains":case"not_icontains":case"starts_with":case"not_starts_with":case"ends_with":case"not_ends_with":return typeof e!="string"||typeof n!="string"?!1:t.endsWith("icontains")?e.toLowerCase().includes(n.toLowerCase())===(t==="icontains"):t.endsWith("starts_with")?e.startsWith(n)===(t==="starts_with"):e.endsWith(n)===(t==="ends_with");case"between":case"not_between":{let o=s.toFloat(e);if(!Array.isArray(n)||n.length!==2||o===void 0)return!1;let[i,a]=n;return typeof i!="number"||typeof a!="number"?!1:(o>=i&&o<=a)==(t==="between")}case"is_date_before":case"is_date_after":{let o=gn(e,r,!1),i=gn(n,r,!0);return o===void 0||i===void 0?!1:t==="is_date_before"?o<i:o>i}case"semver_eq":case"semver_neq":case"semver_gt":case"semver_gte":case"semver_lt":case"semver_lte":{let o=s.cmpVersion(e,n);if(o===void 0)return!1;let i=t.slice(7);return i==="eq"?o===0:i==="neq"?o!==0:i==="gt"?o>0:i==="gte"?o>=0:i==="lt"?o<0:o<=0}case"semver_tilde":case"semver_caret":case"semver_wildcard":{let o=s.parseVersion(e),i=us(t,n,s);return!!o&&!!i&&mn(o,i[0])>=0&&mn(o,i[1])<0}}return!1}var is,fn,as,ls,yn=R(()=>{"use strict";is=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})$/,fn=/^\d{4}-\d{2}-\d{2}$/,as=/^-?(\d{1,6})([hdwmy])$/,ls={h:3600,d:86400,w:604800,m:2592e3,y:31536e3}});function st(t){if(typeof t=="number")return t;if(typeof t=="string"&&ds.test(t.trim()))return Number(t.trim())}function ot(t,e){let n=typeof t=="number",r=typeof e=="number";return n||r?n&&r&&t===e:t===e}function at(t){if(typeof t!="string")return;let e=t.trim().replace(/^v/,""),n=e.search(/[-+]/);n>=0&&(e=e.slice(0,n));let r=[];for(let s of e.split(".")){if(!/^[+-]?\d+$/.test(s))return;let o=parseInt(s,10);if(o<0)return;r.push(o)}return r}function it(t,e){let n=at(t),r=at(e);if(!(!n||!r)){for(let s=0;s<Math.max(n.length,r.length);s++){let o=n[s]??0,i=r[s]??0;if(o!==i)return o<i?-1:1}return 0}}function K(t,e,n,r,s,o=Date.now()){let i=n&&e!==null&&e!==void 0;if(t==="is_set")return i;if(t==="is_not_set")return!i;if(!i)return!1;switch(t){case"eq":case"neq":{let a;if(s){let l=it(e,r);if(l===void 0)return!1;a=l===0}else a=ot(e,r);return a===(t==="eq")}case"contains":case"ncontains":case"regex":case"nregex":{if(typeof e!="string"||typeof r!="string")return!1;if(t==="contains"||t==="ncontains")return e.includes(r)===(t==="contains");let a;try{a=new RegExp(r)}catch{return!1}return a.test(e)===(t==="regex")}case"gt":case"gte":case"lt":case"lte":{let a;if(s)a=it(e,r);else{let l=st(e),c=st(r);a=l===void 0||c===void 0?void 0:ps(l,c)}return a===void 0?!1:t==="gt"?a>0:t==="gte"?a>=0:t==="lt"?a<0:a<=0}case"in":case"not_in":return Array.isArray(r)?r.some(a=>ot(e,a))===(t==="in"):!1}return t.startsWith("array_")||t.startsWith("ip_")?dn(t,e,r,ot):hn(t,e,r,o,{toFloat:st,parseVersion:at,cmpVersion:it})}var ds,ps,lt=R(()=>{"use strict";pn();yn();ds=/^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/;ps=(t,e)=>t<e?-1:t>e?1:0});function ut(t){return t.properties?.length?`${t.key}|${JSON.stringify(t.properties.map(e=>[e.key,e.op,e.value??null]))}`:t.key}function vn(t,e,n=Date.now()){return(t.properties??[]).every(r=>K(r.op,e[r.key],Object.hasOwn(e,r.key),r.value,!1,n))}function dt(t,e){let n=e[t.scope??"session"]?.[ut(t)]??0;return t.op==="is_set"?n>0:t.op==="is_not_set"?n===0:K(t.op,n,!0,t.value,!1)}function _n(t,e,n){for(let o of t.runtime??[])if(o.filters.every(a=>{if(a.type!=="flag")return dt(a,e);let l=n(a.key);return!!l&&K(a.op,l.value,!0,a.value,!1)}))return _n(o.result,e,n);if(!t.runtime)return t;let{runtime:r,...s}=t;return s}function pt(t,e){let n={},r=new Map,s=o=>{if(r.get(o)===2)return n[o];let i=t[o];if(!i||r.get(o)===1)return;r.set(o,1);let a=_n(i,e,s);return n[o]=a,r.set(o,2),a};for(let o of Object.keys(t))s(o);return n}function Me(t,e){let n=[],r=o=>{o.type==="event"&&o.properties?.length&&n.push(o)};for(let o of t??[])for(let i of o.conditions)for(let a of i.filters??[])r(a);let s=o=>{for(let i of o.runtime??[])i.filters.forEach(r),s(i.result)};return Object.values(e).forEach(s),n}function Te(t,e){if(!ct(e))return e;let n=ct(t)?{...t}:{};for(let[r,s]of Object.entries(e))s===null?delete n[r]:n[r]=Te(n[r],s);return n}var bn,ct,pe,ft=R(()=>{"use strict";lt();bn=t=>(t??[]).filter(e=>e.type==="event");ct=t=>typeof t=="object"&&t!==null&&!Array.isArray(t);pe=class{session={};page={};sid="";constructor(e){if(e&&typeof e.sid=="string"&&ct(e.session)){this.sid=e.sid;for(let[n,r]of Object.entries(e.session))typeof r=="number"&&r>0&&(this.session[n]=r)}}record(e,n,r={},s=[]){n!==this.sid&&(this.sid=n,this.session={},this.page={}),e==="$pageview"&&(this.page={});let o=new Set([e]);for(let i of s)i.type==="event"&&i.key===e&&i.properties?.length&&vn(i,r)&&o.add(ut(i));for(let i of o)this.session[i]=(this.session[i]??0)+1,this.page[i]=(this.page[i]??0)+1}counts(e){return e===this.sid?{session:{...this.session},page:{...this.page}}:{session:{},page:{}}}saved(){return{sid:this.sid,session:{...this.session}}}}});function xn(t,e){let n=e?t.contexts?.[e]:void 0;if(n)return n;if(e==="user")return{key:t.bucketing_key||t.distinct_id,properties:t.person_properties};if(e==="device")return{key:t.device_id,properties:t.device_properties}}function fe(t,e,n,r=!1){let s=r?`${t}.${e}.variant.${n}`:`${t}.${e}.${n}`;return parseInt(on(s).slice(0,13),16)/gs}function ms(t,e){return typeof e=="boolean"?typeof t=="boolean"?t===e:e:t===e}function hs(t,e,n){let r=e.now?Date.parse(e.now):NaN,s=Number.isNaN(r)?Date.now():r,o;switch(t.type){case"person":o=e.person_properties;break;case"group":o=e.group_properties?.[t.group_type??""];break;case"device":o=e.device_properties;break;case"geo":o=e.geo_properties;break;case"context":if(!fs.includes(t.context_kind??""))return!1;o=xn(e,t.context_kind)?.properties;break;case"app_version":return K(t.op,e.app_version,!!e.app_version,t.value,!0,s);case"flag":{let i=n[t.key];return!!i&&K(t.op,i.value,!0,t.value,!1,s)}default:return!1}return K(t.op,o?.[t.key],!!o&&Object.hasOwn(o,t.key),t.value,!1,s)}function ys(t,e,n){let r=t.variants;if(e.variant_override){let i=r.find(a=>a.key===e.variant_override);if(i)return i}let s=fe(t.key,t.salt,n,!0)*100,o=0;for(let i of r)if(o+=i.rollout_pct,s<o)return i;return r[r.length-1]}function kn(t,e){return wn(t.aggregation,e)}function wn(t,e){return t.kind==="group"?e.groups?.[t.group_type??""]:t.kind==="device"?e.device_id:t.kind==="context"?xn(e,t.context_kind)?.key:e.bucketing_key||e.distinct_id}function vs(t,e,n,r){let s=t.sticky?r.sticky_assignments?.[t.key]:void 0;if(s===void 0)return;let o={value:!0,reason:"sticky_bucket",condition_index:n};if(t.type==="multivariate"&&t.variants?.length){if(t.variants.some(a=>a.key===e.variant_override))return;let i=t.variants.find(a=>a.key===s);return i?(o.value=o.variant=i.key,Fe(o,i.payload,e)):void 0}if(s===!0)return Fe(o,t.type==="json"?t.payload:void 0,e)}function Fe(t,e,n){let r=n.payload_patch===void 0||n.payload_patch===null?e:Te(e,n.payload_patch);return r!==void 0&&(t.payload=r),t}function bs(t,e){return!t.app_contexts?.length||!e.app_contexts?.length?!0:t.app_contexts.some(n=>e.app_contexts?.includes(n))}function Sn(t,e,n={}){if(!bs(t,e))return A("app_context_excluded");if(!t.active)return A("inactive");if(t.kill_switch)return A("kill_switch");let r=!1;for(let l of t.prerequisites??[]){let c=n[l.flag];if(!c)return A("prerequisite_missing");if(c.reason==="requires_server")r=!0;else if(c.reason==="prerequisite_cycle"||!ms(c.value,l.value))return A("prerequisite_failed")}if(r)return A("requires_server");let s=kn(t,e),o=t.conditions.some(l=>l.aggregation);if(!s&&(!o||t.holdout||t.namespace))return A("no_bucketing_key");if(t.holdout&&fe("holdout",t.holdout.salt,s??"")*100<t.holdout.percentage)return A("holdout");if(t.namespace&&t.namespace.total>0){let l=Math.floor(fe("namespace",t.namespace.salt,s??"")*t.namespace.total);if(l<t.namespace.start||l>=t.namespace.end)return A("namespace_excluded")}let i=0,a=[];for(let[l,c]of t.conditions.entries()){let u=c.aggregation?wn(c.aggregation,e):s;if(!u){i++;continue}let f=!1,g=!0,h=!1;for(let y of c.filters??[]){if(y.type==="event"){if(e.runtime_events===void 0)h=!0;else if(!dt(y,e.runtime_events)){g=!1;break}continue}let w=y.type==="cohort"?e.cohorts?.[y.key]:void 0;if(w!==void 0){if(w===(y.op==="not_in"||y.op==="neq")){g=!1;break}}else if(y.type==="cohort"||y.type==="flag"&&n[y.key]?.reason==="requires_server")f=!0;else if(!hs(y,e,n)){g=!1;break}}if(!g)continue;if(f)return gt(A("requires_server",l),a);let _=_s(t,c,l,e,u);if(_)if(h)a.push({filters:bn(c.filters),result:_});else return gt(_,a)}return gt(A(i>0&&i===t.conditions.length?"no_bucketing_key":"no_condition_match"),a)}function _s(t,e,n,r,s){let o=e.aggregation?void 0:vs(t,e,n,r);if(o)return o;if(fe(t.key,t.salt,s)*100>=e.rollout_pct)return t.early_exit?A("out_of_rollout",n):void 0;let i={value:!0,reason:"condition_match",condition_index:n};if(t.type==="multivariate"&&t.variants?.length){let a=ys(t,e,s);return i.value=i.variant=a.key,Fe(i,a.payload,e)}return Fe(i,t.type==="json"?t.payload:void 0,e)}function Rn(t){return[...(t.prerequisites??[]).map(e=>e.flag),...t.conditions.flatMap(e=>(e.filters??[]).filter(n=>n.type==="flag").map(n=>n.key))]}function ht(t,e){let n=new Map(t.map(i=>[i.key,i])),r={},s=new Map,o=i=>{let a=n.get(i);if(!a||s.has(i))return;s.set(i,1);let l=!1;for(let c of Rn(a))o(c),(s.get(c)===1||r[c]?.reason==="prerequisite_cycle")&&(l=!0);r[i]=l?A("prerequisite_cycle"):ks(a,e,r),s.set(i,2)};for(let i of t)o(i.key);return r}function ks(t,e,n){let r=[];for(let s of Rn(t))!r.includes(s)&&n[s]?.runtime?.length&&r.length<xs&&r.push(s);return mt(t,e,n,r)}function mt(t,e,n,r){let[s,...o]=r;if(s===void 0)return Sn(t,e,n);let i=mt(t,e,n,o),a=n[s],l=new Set([a.value]),c=[];for(let h of Cn(a)){if(l.has(h.value))continue;l.add(h.value);let _=mt(t,e,{...n,[s]:h},o);En(_,i)||c.push({filters:[{type:"flag",key:s,op:"eq",value:h.value}],result:_})}let u=[...c,...i.runtime??[]],{runtime:f,...g}=i;return u.length?{...g,runtime:u}:g}function Cn(t){return(t.runtime??[]).flatMap(e=>{let{runtime:n,...r}=e.result;return[r,...Cn(e.result)]})}function En(t,e){if(t===e)return!0;if(typeof t!="object"||typeof e!="object"||t===null||e===null||Array.isArray(t)!==Array.isArray(e))return!1;let n=t,r=e,s=new Set([...Object.keys(n),...Object.keys(r)]);for(let o of s)if(!En(n[o],r[o]))return!1;return!0}var fs,gs,A,gt,xs,yt,vt,Pn=R(()=>{"use strict";lt();ft();an();fs=["user","device","org"],gs=16**13;A=(t,e=-1)=>({value:!1,reason:t,condition_index:e});gt=(t,e)=>e.length?{...t,runtime:e}:t;xs=4;yt=t=>t.reason==="requires_server",vt=t=>t.reason!=="app_context_excluded"});function bt(t){let e=Object.keys(t);if(e.length===0)return{};let n={};for(let r of e)n[`$feature/${r}`]=t[r];return n.$active_feature_flags=e.filter(r=>t[r]!==!1).sort(),n}var $n=R(()=>{"use strict"});function me(t,e,n,r){return{key:t,value:e,enabled:e!==void 0&&e!==!1,...typeof e=="string"?{variant:e}:{},...n!==void 0?{payload:n}:{},reason:e===void 0?"not_found":r}}var ge,On=R(()=>{"use strict";ge=class{constructor(e,n=Date.now){this.ttlMs=e;this.now=n}ttlMs;now;stamp;mark(e){return this.stamp={at:this.now(),id:e}}restore(e){typeof e?.at=="number"&&typeof e.id=="string"&&(this.stamp={at:e.at,id:e.id})}fresh(e){return!!this.ttlMs&&this.ttlMs>0&&!!this.stamp&&this.stamp.id===e&&this.now()-this.stamp.at<this.ttlMs}clear(){this.stamp=void 0}}});function Os(t){let e=Cs;for(let n of $s.encode(t))e=(e^BigInt(n))*Es&Ps;return e}function Tn(t){let e=(t.toLowerCase().match(/[\p{L}\p{N}]+/gu)??[]).filter(s=>ve(s).length>=2);if(!e.length)return;let n=new Array(64).fill(0);for(let s of e){let o=Os(s);for(let i=0;i<64;i++)n[i]=(n[i]??0)+((o>>BigInt(i)&1n)===1n?1:-1)}let r=0n;for(let s=0;s<64;s++)(n[s]??0)>0&&(r|=1n<<BigInt(s));return r.toString(16).padStart(16,"0")}function Fn(t){let n=` ${t.toLowerCase().replace(/’/g,"'").replace(/[.,!?;:]/g," ").replace(/\s+/g," ").trim()} `,r=0;for(let o of An)n.includes(` ${o} `)&&(r++,n=n.split(` ${o} `).join(" "));let s=Mn.filter(o=>n.includes(` ${o} `)).length;return r>s?-1:s>r?1:0}function Is(t){let e=jn(t);if(e.length<13||e.length>19)return!1;let n=0;return e.reverse().forEach((r,s)=>n+=s%2===1?r>4?r*2-9:r*2:r),n%10===0}function Ms(t){let e=jn(t).length;return e>=10&&e<=15}function kt(t){let e=t;for(let[n,r]of As)e=e.replace(n,s=>r(s)?Ts(s):s);return e===t?void 0:e}function Ln(t){if(typeof t!="string")return;let e=t.toLowerCase();return/^[0-9a-f]{32}$/.test(e)?e:void 0}function Fs(t,e,n){let r=xt(e,n),s=kt(r);return s===void 0?{[t]:r}:{[t]:s,$ai_text_redacted:!0}}function Nn(t,e,n,r){if(t!=="user"&&t!=="assistant")return;let s={$ai_role:t,$ai_message_index:n,$ai_text_length:ve(e).length};if(t==="user"){let o=Tn(e);o!==void 0&&(s.$ai_text_hash=o),s.$ai_sentiment=Fn(e)}return r?{...s,...Fs("$ai_text",e,Ss)}:s}function Hn(t,e){let n=t.value;if(t.kind==="thumbs"&&n!==1&&n!==-1||t.kind==="rating"&&!(Number.isInteger(n)&&n>=1&&n<=5)||t.kind!=="thumbs"&&t.kind!=="rating"&&t.kind!=="comment")return;let r={$ai_feedback_kind:t.kind};if(t.kind!=="comment"&&(r.$ai_feedback_value=n),t.comment&&e){let s=xt(t.comment,Rs);r.$ai_feedback_comment=kt(s)??s}return t.messageIndex!==void 0&&(r.$ai_message_index=t.messageIndex),r}function _t(t,e){let n=Dn(t),r=he(e,64);return{...n?{$ai_outcome:n}:{},...r?{$ai_resolution:r}:{}}}function js(){let t=globalThis.crypto,e=new Uint8Array(16);if(t?.getRandomValues)t.getRandomValues(e);else for(let r=0;r<16;r++)e[r]=Math.floor(Math.random()*256);e[6]=(e[6]??0)&15|64,e[8]=(e[8]??0)&63|128;let n=Array.from(e,r=>r.toString(16).padStart(2,"0")).join("");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}function qn(t={}){let e={$ai_conversation_id:t.conversationId||js()},n=(r,s)=>{s!==void 0&&(e[r]=s)};return n("$ai_agent_name",he(t.agentName,128)),n("$ai_agent_version",he(t.agentVersion,64)),n("$ai_topic",he(t.topic,128)),n("$ai_use_case",he(t.useCase,128)),n("$ai_trace_id",Ln(t.traceId)),e}var re,ws,Ss,Rs,An,Mn,ve,xt,Cs,Es,Ps,$s,jn,In,As,Ts,Dn,he,ye,Bn=R(()=>{"use strict";re={started:"$ai_conversation_started",message:"$ai_message",feedback:"$ai_feedback",ended:"$ai_conversation_ended",outcome:"$ai_outcome"},ws=["resolved","unresolved","escalated","abandoned","error"],Ss=4e3,Rs=2e3,An=["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"],Mn=["thanks","thank you","great","perfect","awesome","helpful","that worked","works now","solved","exactly"],ve=t=>Array.from(t),xt=(t,e)=>ve(t).slice(0,e).join(""),Cs=0xcbf29ce484222325n,Es=0x100000001b3n,Ps=0xffffffffffffffffn,$s=new TextEncoder;jn=t=>ve(t).filter(e=>e>="0"&&e<="9").map(Number);In=String.raw`[\p{Alphabetic}\p{M}\p{Nd}\p{Pc}\p{Join_Control}]`,As=[[new RegExp(String.raw`(?<!${In})\p{Nd}(?:[ -]?\p{Nd}){12,18}(?!${In})`,"gu"),Is],[/[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,Ms]];Ts=t=>ve(t).map(e=>/\s/u.test(e)?e:"*").join("");Dn=t=>typeof t=="string"&&ws.includes(t)?t:void 0,he=(t,e)=>typeof t=="string"&&t?xt(t,e):void 0;ye=class{next=0;common;emit;captureText;constructor(e,n={},r=!1){this.emit=e,this.captureText=r,this.common=qn(n)}get id(){return this.common.$ai_conversation_id}send(e,n){this.emit(e,{...this.common,...n})}start(){return this.send(re.started,{}),this}message(e,n,r={}){let s=r.index??this.next,o=Nn(e,n,s,this.captureText);return o?(this.next=s+1,this.send(re.message,o),!0):!1}feedback(e){let n=Hn(e,this.captureText);return n?(this.send(re.feedback,n),!0):!1}end(e,n){this.send(re.ended,_t(e,n))}outcome(e,n){let r=_t(e,n);return r.$ai_outcome?(this.send(re.outcome,r),!0):!1}}});var je=R(()=>{"use strict";tn();Je();nn();rn();sn();Pn();ft();$n();On();Bn()});function rr(t,e=Date.now){let n=t.eventsPerSecond??10,r=t.burst??100,s=r,o=e();return()=>{let i=e();return s=Math.min(r,s+(i-o)/1e3*n),o=i,s<1?!1:(s-=1,!0)}}var sr=R(()=>{"use strict"});function Wo(t){return t.startsWith("re:")?t.slice(3):t.split("*").map(e=>e.replace(/[.+?^${}()|[\]\\]/g,"\\$&")).join(".*")}function Dt(t,e){return!!t?.some(n=>{try{return new RegExp(Wo(n),"i").test(e)}catch{return!1}})}var Rr=R(()=>{"use strict"});je();var Ls=["bot","crawl","spider","slurp","headlesschrome","phantomjs","puppeteer","playwright","lighthouse","pingdom","uptimerobot","facebookexternalhit","preview","scrapy","python-requests","go-http-client"];function Vn(t){let e=t.toLowerCase();return Ls.some(n=>e.includes(n))&&!/\bcubot\b/.test(e)}var J=["gclid","gad_source","gclsrc","dclid","gbraid","wbraid","fbclid","igshid","msclkid","ttclid","li_fat_id","twclid","mc_cid"],Un="lc_click_ids";function Wn(t,e=90,n=Date.now){let r,s=()=>{try{return JSON.parse(t.get(Un)??"{}")}catch{return{}}};return()=>{let o=s();if(location.search!==r){r=location.search;let a=new URLSearchParams(r),l=!1;for(let c of J){let u=a.get(c);u&&(o[c]={v:u.slice(0,512),t:n()},l=!0)}l&&t.set(Un,JSON.stringify(o))}let i={};for(let a of J){let l=o[a];l&&n()-l.t<e*864e5&&(i[a]=l.v)}return i}}function Ds(){return Array.from(document.querySelectorAll("meta[http-equiv]")).filter(t=>t.getAttribute("http-equiv")?.toLowerCase()==="content-security-policy").map(t=>t.getAttribute("content")??"")}function Ns(t){let e=new Map;for(let r of t.split(";")){let[s,...o]=r.trim().toLowerCase().split(/\s+/);s&&!e.has(s)&&e.set(s,o)}let n=e.get("style-src-elem")??e.get("style-src")??e.get("default-src");return!!n&&!(n.includes("'unsafe-inline'")&&!n.some(r=>r.startsWith("'nonce-")||r.startsWith("'sha")))}function Gn(t,e){if(typeof document>"u")return()=>{};!e&&Ds().some(Ns)&&t("CSP hint: this page's Content-Security-Policy blocks inline <style>; set the `nonce` option so guides and the experiment veil render (docs/guides/csp.md)");let n=r=>{let s=r;/^style-src/.test(s.effectiveDirective??"")&&s.blockedURI==="inline"&&t(`CSP hint: an inline style was blocked by ${s.effectiveDirective}${e?" (check that `nonce` matches the page's nonce)":"; set the `nonce` option"}`)};return document.addEventListener("securitypolicyviolation",n),()=>document.removeEventListener("securitypolicyviolation",n)}var Hs=(t,e)=>t.slice(0,e);function Kn(t){try{let e=new URL(t);return e.protocol==="data:"||e.protocol==="blob:"?e.protocol:e.origin+e.pathname}catch{return Hs(t,64)}}function zn(t,e={}){if(typeof document>"u")return()=>{};let n=e.maxPerPage??20,r=new Set,s=o=>{let i=o,a={$csp_directive:i.effectiveDirective??i.violatedDirective,$csp_blocked_uri:Kn(i.blockedURI??""),$csp_source_file:i.sourceFile?Kn(i.sourceFile):void 0,$csp_line:i.lineNumber||void 0,$csp_column:i.columnNumber||void 0,$csp_disposition:i.disposition},l=[a.$csp_directive,a.$csp_blocked_uri,a.$csp_source_file,a.$csp_line].join("|");r.has(l)||r.size>=n||(r.add(l),t("$csp_violation",Object.fromEntries(Object.entries(a).filter(([,c])=>c!==void 0))))};return document.addEventListener("securitypolicyviolation",s),()=>document.removeEventListener("securitypolicyviolation",s)}var qs=["chrome-extension:","moz-extension:","safari-web-extension:","ms-browser-extension:"],Le=()=>typeof location<"u"&&qs.includes(location.protocol),Bs=(t,e,n)=>`${t.replace(/\/+$/,"")}/static/v${e}/${n}`,Vs={replay:"replay",heatmaps:"heatmaps",forms:"forms",toolbar:"toolbar",guides:"guides",inspector:"inspector",experiments:"visualChanges","early-access":"earlyAccess",consent:"consentBanner"},Us=t=>import(t);async function Xn(t,e,n,r=Us){return(await Promise.all(t.map(async o=>{let i=Vs[o];if(!i)return n("unknown module",o);try{let a=(await r(Bs(e.assetHost,e.version,`${o}.js`)))[i];return typeof a=="function"?a:n("module has no export",o,i)}catch(a){return n("module failed to load",o,a)}}))).filter(o=>!!o)}function Ws(t,e,n){let r=e.find(i=>t.startsWith(`${i}/`));if(!r)return t;let s=t.slice(r.length),o=s.search(/[?#]/);return r+n(o<0?s:s.slice(0,o))+(o<0?"":s.slice(o))}function Yn(t,e,n,r){if(!r)return{transport:t,fetch:e};let s=o=>Ws(o,n,r);return{transport:{send:(o,i,a)=>t.send(s(o),i,a)},fetch:((o,i)=>e(typeof o=="string"?s(o):o instanceof URL?s(o.href):o,i))}}var Ks="__LUCIDA_DEVTOOLS_HOOK__";function Jn(t,e,n){let r=globalThis[Ks];if(!(!r||typeof r.emit!="function"||typeof r.attach!="function")){t.onCapture(s=>{try{r.emit(s)}catch{}});try{r.attach({projectKeyPrefix:t.apiKey.slice(0,8),apiHost:n,distinctId:()=>e.distinctId,loadToolbar:s=>e.loadToolbar(s),startReplay:async()=>t.replay?(await t.replay.start(!0),t.replay.isRecording()):!1,replayUrl:()=>e.getReplayUrl()})}catch{}}}var be=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"];function Gs(t){let e={},n=new URLSearchParams(location.search);for(let r of[...be,...J,...t]){let s=n.get(r);s&&(e[`$${r}`]=s)}return e}function Qn(){let t=new URLSearchParams(location.search),e=be.map(n=>t.get(n)??"");return e.some(Boolean)?e.join("|"):void 0}function zs(t){try{return t?new URL(t).hostname:""}catch{return""}}var Xs=()=>location.href.replace(/([?&])__lc_toolbar=[^&#]*&?/,"$1").replace(/[?&]$/,"");function Ys(){let t=location.hash;return t.length>1?location.pathname+t.split("?")[0]:location.pathname}function Zn(t,e,n=[],r=!1){let s={$current_url:Xs(),$host:location.host,$pathname:r?Ys():location.pathname,$referrer:document.referrer,$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&&(s.$touch_points=navigator.maxTouchPoints),t!=="$pageview")return{properties:s};let o=Gs(n);Object.assign(s,o);let i=e.$current_url??location.href,a=e.$referrer??document.referrer,l={$initial_referrer:a||"$direct",$initial_referring_domain:zs(a)||"$direct",$initial_current_url:i};for(let[c,u]of Object.entries(o))l[`$initial_${c.slice(1)}`]=u;return{properties:s,$set_once:l}}var wt="_lcid";var er=(t,e)=>e.some(n=>{let r=n.replace(/^\./,"").toLowerCase();return t.toLowerCase()===r||t.toLowerCase().endsWith(`.${r}`)}),Js=(t,e=Date.now(),n)=>`${t}.${e.toString(36)}${n?`_${n}`:""}`;function Qs(t,e=Date.now()){let n=t.lastIndexOf("."),[r="",s]=t.slice(n+1).split("_",2),o=/^[0-9a-z]+$/.test(r)?parseInt(r,36):NaN,i=t.slice(0,n);if(n>0&&i.length<=200&&o<=e+5e3&&e-o<=12e4)return s&&/^[\w-]{1,64}$/.test(s)?{distinctId:i,sessionId:s}:{distinctId:i}}function tr(t){if(!t?.length)return;let e=new URL(location.href),n=e.searchParams.get(wt);if(n!==null){e.searchParams.delete(wt),history.replaceState(history.state,"",e.toString());try{if(document.referrer&&!er(new URL(document.referrer).hostname,t))return}catch{return}return Qs(n)}}var nr=t=>{let e=t.config.crossDomains;if(!e?.length)return;let n=r=>{let s=r.target instanceof Element?r.target.closest("a[href]"):null;if(!s||!t.core.hasConsent("analytics"))return;let o=s;if(!/^https?:$/.test(o.protocol)||o.host===location.host||!er(o.hostname,e))return;let i=new URL(o.href);i.searchParams.set(wt,Js(t.client.distinctId,Date.now(),t.core.sessionId)),o.href=i.toString()};return document.addEventListener("click",n,!0),document.addEventListener("auxclick",n,!0),()=>{document.removeEventListener("click",n,!0),document.removeEventListener("auxclick",n,!0)}};sr();function Zs(t,e,n){let r=e;for(let s of t)try{let o=s(r);if(o==null)return null;r=o}catch(o){n("beforeSend hook threw, keeping event:",o)}return r}function eo(t,e=Math.random){return n=>t>=1?n:t<=0||e()>=t?null:{...n,properties:{...n.properties,$sample_rate:t}}}function to(t){let e=new Set(t),n=r=>Object.fromEntries(Object.entries(r).filter(([s])=>!e.has(s)));return r=>({...r,properties:n(r.properties),...r.$set?{$set:n(r.$set)}:{},...r.$set_once?{$set_once:n(r.$set_once)}:{}})}var St="lc_person_identified",De="lc_pending_set_once",or=new Set(["$identify","$create_alias","$groupidentify"]),ir="$$client_ingestion_warning",no=6e4,Rt=class{constructor(e,n){this.mode=e;this.storage=n;this.identified=n.get(St)==="1";try{this.pending=JSON.parse(n.get(De)??"{}")}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(St,"1"))}personless(e){return this.mode==="always"?!1:(this.mode==="never"||!this.identified)&&!or.has(e)}stash(e){if(this.mode!=="identified_only"||!e)return;let n=Object.entries(e).filter(([r])=>!(r in this.pending));n.length&&(this.pending={...this.pending,...Object.fromEntries(n)},this.storage.set(De,JSON.stringify(this.pending)))}take(){if(!Object.keys(this.pending).length)return;let e=this.pending;return this.pending={},this.storage.remove(De),e}reset(){this.identified=!1,this.pending={},this.storage.remove(St),this.storage.remove(De)}};function ro(t,e){let n=e,r;if(t.person.personless(e.event)){t.person.stash(e.$set_once);let{$set:o,$set_once:i,$unset:a,...l}=e;n={...l,properties:{...e.properties,$process_person_profile:!1}}}else(r=t.person.take())&&(n={...e,$set_once:{...e.$set_once,...r}});let s=t.hooks.length?Zs(t.hooks,n,t.log):n;return s&&t.limit&&!t.limit()&&(t.log("rate limited, dropped",s.event),t.onLimited?.(),s=null),!s&&r&&t.person.stash(r),s}function so(t){let e=t.beforeSend?Array.isArray(t.beforeSend)?t.beforeSend:[t.beforeSend]:[];return[...t.propertyDenylist?.length?[to(t.propertyDenylist)]:[],...t.sampleRate!==void 0?[eo(t.sampleRate)]:[],...e]}function ar(t,e,n,r=Date.now){let s=new Rt(e.personProfiles??"always",t.storage),o,i,a=0,l=-1/0,c=()=>{a+=1,!(r()-l<no)&&(l=r(),queueMicrotask(()=>{let u=a;a=0,t.capture(ir,{$$client_ingestion_warning_message:`client rate limit dropped ${u} event(s)`,$dropped_count:u})}))};return t.setFilter(u=>(e.rateLimit!==o&&(o=e.rateLimit,i=o?rr(o):void 0),ro({hooks:so(e),person:s,limit:u.event===ir?void 0:i,log:n,onLimited:c},u))),s}var Ct=class{m=new Map;get(e){return this.m.get(e)??null}set(e,n){this.m.set(e,n)}remove(e){this.m.delete(e)}},oo=365,io=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(" ")),ao=new Set("co com net org edu gov gob go ac or ne ltd plc sch mil nom".split(" "));function lo(t){let e=t.toLowerCase().split(".");for(let n=1;n<e.length-1;n++)if(io.has(e.slice(n).join("."))||n===e.length-2&&e[n+1].length===2&&ao.has(e[n]))return e.slice(n-1).join(".")}function co(t=location.hostname){if(/^[\d.]+$/.test(t)||t.includes(":"))return;let e=t.split(".");for(let n=e.length-2;n>=0;n--){let r=e.slice(n).join(".");if(document.cookie=`__lc_probe=1; Domain=${r}; Path=/; Max-Age=10; SameSite=Lax`,document.cookie.includes("__lc_probe=1"))return document.cookie=`__lc_probe=; Domain=${r}; Path=/; Max-Age=0`,r}return lo(t)}var Ne=class{constructor(e={}){this.o=e}o;domain=null;attr(){return this.domain===null&&(this.domain=this.o.domain??(this.o.crossSubdomain?co():void 0)),this.domain?`; Domain=${this.domain}`:""}get(e){for(let n of document.cookie.split("; ")){let r=n.indexOf("=");if(n.slice(0,r)===e)try{return decodeURIComponent(n.slice(r+1))}catch{return null}}return null}set(e,n){let r=this.o.secure??location.protocol==="https:"?"; Secure":"",s=Math.round((this.o.expiryDays??oo)*86400);document.cookie=`${e}=${encodeURIComponent(n)}; Max-Age=${s}; Path=/${this.attr()}; SameSite=Lax${r}`}remove(e){document.cookie=`${e}=; Max-Age=0; Path=/${this.attr()}; SameSite=Lax`}},se=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,n){try{this.store()?.setItem(e,n)}catch{}}remove(e){try{this.store()?.removeItem(e)}catch{}}},Et=class extends se{constructor(){super("localStorage")}},uo=["lc_identity","lc_session","lc_device_id","lc_consent","lc_person_identified"],Pt=class{constructor(e,n,r){this.cookie=e;this.local=n;this.cookieKeys=r}cookie;local;cookieKeys;get(e){let[n,r]=this.cookieKeys(e)?[this.cookie,this.local]:[this.local,this.cookie];return n.get(e)??r.get(e)}set(e,n){this.local.set(e,n),this.cookieKeys(e)?this.cookie.set(e,n):this.cookie.remove(e)}remove(e){this.local.remove(e),this.cookie.remove(e)}},He=class{constructor(e,n){this.inner=e;this.delayMs=n}inner;delayMs;pending=new Map;timer;get(e){return this.pending.has(e)?this.pending.get(e)??null:this.inner.get(e)}set(e,n){this.queue(e,n)}remove(e){this.queue(e,null)}queue(e,n){this.pending.set(e,n),this.timer??=setTimeout(()=>this.flush(),this.delayMs)}flush(){clearTimeout(this.timer),this.timer=void 0;for(let[e,n]of this.pending)n===null?this.inner.remove(e):this.inner.set(e,n);this.pending.clear()}},$t=class{constructor(e,n){this.inner=e;this.suffix=n}inner;suffix;get(e){return this.inner.get(e+this.suffix)}set(e,n){this.inner.set(e+this.suffix,n)}remove(e){this.inner.remove(e+this.suffix)}},Ot=t=>`_${t.replace(/\W/g,"").slice(-8)}`;function qe(t,e,n){if(t==="memory"||t==="none")return new Ct;let r=Ot(e),s=t==="cookie"?new Ne(n):t==="localStorage+cookie"?new Pt(new Ne(n),new Et,o=>uo.some(i=>o===i+r)):new se(t);return new $t(s,r)}async function po(t){if(!(typeof CompressionStream>"u"||typeof Response>"u"))try{let e=new Response(t).body?.pipeThrough(new CompressionStream("gzip"));return e?new Uint8Array(await new Response(e).arrayBuffer()):void 0}catch{return}}function lr(t,e={}){let n=e.compress??!0,r=(s,o)=>(e.onError?.({url:s,status:o}),{status:o});return{async send(s,o,i){if(i?.beacon&&!e.disableBeacon&&typeof navigator<"u"&&navigator.sendBeacon)return navigator.sendBeacon(s,new Blob([o],{type:"text/plain"}))?{status:200}:r(s,0);try{let a=n&&o.length>=1024?await po(o):void 0,l=await t(a?`${s}${s.includes("?")?"&":"?"}compression=gzip`:s,{method:"POST",body:a??o,headers:{...e.headers,"Content-Type":"text/plain;charset=UTF-8"},credentials:"omit",keepalive:(a?.length??o.length)<6e4});return l.status>=400?r(s,l.status):{status:l.status}}catch{return r(s,0)}}}}var It={send:async()=>({status:200})};var fo="lucida-browser",Tt="0.1.0",At="lc_internal",go=3e3,Be="https://app.lucida.dev",Mt=t=>!!t&&typeof t=="object"&&Object.getPrototypeOf(t)===Object.prototype;function cr(t,e={},n=[]){let r=!!e.debug||typeof location<"u"&&/[?&]__(lc|lucida)_debug=(1|true)/.test(location.search),s=(...d)=>{r&&console.debug("[lucida]",...d)},o=(e.apiHost??Be).replace(/\/+$/,""),i=Object.fromEntries(Object.entries(e).map(([d,m])=>[d,Mt(m)?{...m}:m]));i.apiHost=o;let a=e.extension??Le(),l=d=>a&&(d==="cookie"||d==="localStorage+cookie")?e.extensionPersistence??"localStorage":d,c=l(e.cookieless==="always"?"none":e.persistence??"cookie"),u=[o,...e.flagsApiHost?[e.flagsApiHost.replace(/\/+$/,"")]:[]],f=e.fetch??((...d)=>fetch(...d)),g=d=>Yn(d,f,u,e.rewritePath),h=g(It).fetch,_=e.consent?.respectDnt,y=navigator.globalPrivacyControl===!0,w=(e.respectDnt??_)===!0&&navigator.doNotTrack==="1"||(e.respectGpc??_)===!0&&y,P=e.blockBots!==!1&&typeof navigator<"u"&&Vn(navigator.userAgent??""),E=!!e.disabled||P;P&&s("bot user agent: capture disabled");let oe,M=g(e.transport??lr(f,{headers:i.requestHeaders,onError:e.onRequestError,disableBeacon:e.disableBeacon})).transport;if(!e.transport&&e.offlineQueue!==!1&&c!=="memory"&&c!=="none"){let d=new W(new se(c==="sessionStorage"?"sessionStorage":"localStorage"),()=>b.hasConsent("analytics"));M=oe=rt(M,d,{key:`lc_offline${Ot(t)}`,isOnline:()=>navigator.onLine!==!1})}let C=E?void 0:tr(e.crossDomains),T=qe(E?"memory":c,t,e.cookie),Q=(e.storageWriteDelayMs??0)>0?new He(T,e.storageWriteDelayMs):void 0,ie=C?.sessionId??e.bootstrap?.sessionId,Z,F=!1,j,ee=[],b=new de({apiKey:t,apiHost:o,transport:E?It:M,storage:Q??T,...e.consentPersistence&&!E?{consentStorage:qe(l(e.consentPersistence),t,e.cookie)}:{},persistProperty:d=>!i.persistedProperties||i.persistedProperties.includes(d),...c==="none"?{cookieless:!0}:{},library:{name:fo,version:Tt},consent:{...e.cookieless==="on_reject"?{cookielessOnReject:!0}:{},...e.consent,...e.consent?.geo&&!E?{awaitRemote:!0}:{},respectDnt:!0,dnt:w},queue:{...e.flushAt?{flushAt:e.flushAt}:{},...e.flushIntervalMs?{flushIntervalMs:e.flushIntervalMs}:{}},...C||e.bootstrap?.distinctId?{bootstrapDistinctId:C?.distinctId??e.bootstrap?.distinctId}:{},...e.bootstrap?.isIdentified&&!C?{bootstrapIdentified:!0}:{},session:{...e.session,...ie?{bootstrapId:ie}:{}},enrich:(d,m)=>{let p=Zn(d,m,i.customCampaignParams,e.capturePageview==="hash");if(o!==Be&&(p.properties={...p.properties,$lib_custom_api_host:o}),ee.length){let S=b.sessionId;for(let $ of ee)p.properties={...p.properties,...$(S)}}let v=j?.()??{},k=Object.keys(v);return k.length&&(p.properties={...p.properties,$click_ids:v},d==="$pageview"&&(p.$set_once={...Object.fromEntries(k.map(S=>[`$initial_${S}`,v[S]])),...p.$set_once},p.$set=Object.fromEntries(k.map(S=>[`$last_${S}`,v[S]])))),i.sendFeatureFlags!==!1&&d!=="$snapshot"&&Z&&(p.properties={...bt(Z.all()),...p.properties}),F?{...p,properties:{...p.properties,$internal:!0}}:p},campaignKey:Qn,log:s});F=b.storage.get(At)==="1",e.clickIds!==!1&&(j=Wn(b.storage,e.clickIds?.expiryDays));let O=ar(b,i,s);e.bootstrap?.isIdentified&&O.markIdentified();let U=d=>O.blocksPersonWrites?(s(`personProfiles=never: ${d} ignored`),!0):!1,ae=[],H=[Gn(s,e.nonce)],te=b.storage;if(e.flagPersistence&&!E){let d=new W(qe(l(e.flagPersistence),t,e.cookie),()=>b.hasConsent("analytics"));b.onChange(m=>{m==="consent"&&(b.hasConsent("analytics")?d.flushBuffered():d.discardBuffered())}),te=d}let G=d=>{if(E)return;if(b.hasConsent("analytics"))return d();let m=!1;b.onChange(p=>{!m&&p==="consent"&&b.hasConsent("analytics")&&(m=!0,d())})},le,x={core:b,client:void 0,config:i,flagStorage:te,apiKey:t,log:s,fetch:h,onUnload:d=>{ae.push(d)},whenConsented:G,onCapture:d=>b.onCaptured(d),eventExtras:ee,clickExtras:[],flagPersonProps:[],loadConfig:()=>le??=new Promise(d=>G(()=>{h(`${o}/v1/config?api_key=${encodeURIComponent(t)}`).then(m=>m.ok?m.json():null).then(m=>(m&&b.applyRemote(m),m)).then(d,()=>d(null))}))};if(b.consent.resolving){let d=h(`${o}/v1/config?api_key=${encodeURIComponent(t)}`,{credentials:"omit"}).then(p=>p.ok?p.json():null).catch(()=>null);le=d;let m=setTimeout(()=>b.applyRemote({}),go);d.then(p=>{clearTimeout(m),b.applyRemote(p??{})})}let ce=nt(b,{apiHost:o,apiKey:t,fetch:h,whenConsented:G,log:s,disabled:E});H.push(()=>ce.stop());let q={get distinctId(){return b.distinctId},capture:(d,m,p)=>{b.capture(d,m,p?.timestamp!==void 0?{timestamp:p.timestamp}:{})&&(p?.sendInstantly||p?.transport)&&b.flush(p.transport==="beacon"?{beacon:!0}:{})},identify:(d,m,p)=>{U("identify")||(O.markIdentified(),b.identify(d,m,p))},alias:(d,m)=>{U("alias")||(O.markIdentified(),b.alias(d,m))},reset:d=>{b.reset({resetDeviceId:!!d,reuseAnonymousId:!!e.reuseAnonymousId}),O.reset()},createPersonProfile:()=>{U("createPersonProfile")||O.isProfile||(O.markIdentified(),b.capture("$set",{}))},setConfig:d=>{let m=i;for(let[p,v]of Object.entries(d)){let k=m[p];Mt(k)&&Mt(v)?Object.assign(k,v):m[p]=v}"debug"in d&&(r=!!d.debug)},setPersonProperties:(d,m)=>{!d&&!m||U("setPersonProperties")||(O.markIdentified(),b.capture("$set",{},{...d?{$set:d}:{},...m?{$set_once:m}:{}}))},unsetPersonProperties:d=>{!d.length||U("unsetPersonProperties")||(O.markIdentified(),b.capture("$set",{},{$unset:d}))},getSessionId:()=>b.sessionId,onSessionId:d=>b.onSessionId(m=>d(m)),getProperty:d=>b.getProperty(d),hasOptedOut:()=>!b.hasConsent("analytics"),getReplayUrl:d=>{let p=`${(e.uiHost??o).replace(/\/+$/,"")}/replays/${encodeURIComponent(b.sessionId)}`,v=b.sessionStart;return!d?.withTimestamp||v===void 0?p:`${p}?t=${Math.max(0,Math.round((Date.now()-v)/1e3-(d.timestampLookBackSeconds??10)))}`},debug:(d=!0)=>{r=d},featureView:(d,m)=>{b.capture("$feature_view",{...m,$feature_flag:d},{$set:{[`$feature_view/${d}`]:!0}})},featureInteraction:(d,m)=>{b.capture("$feature_interaction",{...m,$feature_flag:d},{$set:{[`$feature_interaction/${d}`]:!0}})},updateFlags:(d,m,p)=>x.flags?.update(d,m,p?.merge??!0),register:d=>b.register(d),registerOnce:d=>b.registerOnce(d),unregister:d=>b.unregister(d),group:(d,m,p)=>{O.markIdentified(),b.group(d,m,p)},optIn:()=>b.optIn(),optOut:()=>b.optOut(),optOutInternal:(d=!0)=>{F=d,d?b.storage.set(At,"1"):b.storage.remove(At)},get isInternal(){return F},setConsent:d=>b.setConsent(d),getConsent:()=>b.getConsent(),getConsentStatus:d=>b.getConsentStatus(d),consentStatus:()=>b.consentStatus(),getFlag:d=>x.flags?.get(d),getFlagPayload:d=>x.flags?.payload(d),getFlagResult:(d,m)=>x.flags?.result(d,m)??me(d,void 0,void 0,"not_found"),getLayerParam:(d,m,p)=>x.flags?.layerParam(d,m)??p,isFeatureEnabled:d=>{let m=x.flags?.get(d);return m!==void 0&&m!==!1},onFlags:d=>x.flags?.onChange(d)??(()=>{}),onIntervention:d=>ce.on(d),reloadFlags:()=>x.flags?.reload()??Promise.resolve(),getAllFlags:()=>x.flags?.all()??{},overrideFlags:(d,m)=>x.flags?.override(d,m),setPersonPropertiesForFlags:(d,m)=>x.flags?.setPersonProperties(d,m),resetPersonPropertiesForFlags:()=>x.flags?.resetPersonProperties(),setGroupPropertiesForFlags:(d,m)=>x.flags?.setGroupProperties(d,m),resetGroupPropertiesForFlags:()=>x.flags?.resetGroupProperties(),setContext:(d,m,p)=>x.flags?.setContext(d,m,p),clearContext:d=>x.flags?.clearContext(d),guides:{showChangelog:()=>x.guides?.showChangelog()??0,show:d=>x.guides?.show(d)??!1,reset:d=>x.guides?.reset(d)},ai:{startConversation:d=>new ye((m,p)=>q.capture(m,p),d,i.ai?.captureText===!0).start()},earlyAccess:{list:()=>x.earlyAccess?.list()??Promise.resolve([]),optIn:d=>x.earlyAccess?.optIn(d),optOut:d=>x.earlyAccess?.optOut(d)},replay:{start:d=>x.replay?.start(d)??Promise.resolve(),stop:()=>x.replay?.stop(),pause:()=>x.replay?.pause(),resume:()=>x.replay?.resume(),tag:d=>x.replay?.tag(d),isRecording:()=>x.replay?.isRecording()??!1},consent:{showBanner:d=>x.consentUi?.showBanner(d)??Promise.resolve(null),hideBanner:()=>x.consentUi?.hideBanner()},loadToolbar:d=>x.toolbar?.load(typeof d=="string"?d:d.token)??Promise.resolve(!1),activateExperiment:d=>x.experiments?.activate(d),recommendations:(d,m)=>x.recs?.get(d,m)??Promise.resolve({placement:d,strategy:"",items:[],shown(){},clicked(){}}),flush:()=>b.flush(),shutdown:async()=>{for(let d of H)d();Q?.flush(),await b.shutdown()}};if(x.client=q,!E){let d=()=>{for(let p of ae)p();Q?.flush(),b.flush({beacon:!0})};window.addEventListener("pagehide",d);let m=()=>{document.visibilityState==="hidden"&&b.flush({beacon:!0})};if(document.addEventListener("visibilitychange",m),H.push(()=>{window.removeEventListener("pagehide",d),document.removeEventListener("visibilitychange",m)}),oe){let p=()=>{oe.drain()};window.addEventListener("online",p),H.push(()=>window.removeEventListener("online",p)),G(p)}if(e.captureCspViolations){let p=typeof e.captureCspViolations=="object"?e.captureCspViolations:{};H.push(zn((v,k)=>{b.capture(v,k)},p))}for(let p of n){let v=p(x);v&&H.push(v)}Z=x.flags,Jn(x,q,o)}return s("initialised",{apiHost:o,consent:b.getConsent()}),q}var mo='[data-lc-region="article"]';function ur(t,e,n){if(e.articles===!1)return()=>{};let r;t.loadConfig().then(y=>{typeof y?.article_selector=="string"&&(r=y.article_selector)});let s=()=>{for(let y of[e.articleSelector,r,mo])if(y)try{let w=document.querySelector(y);if(w)return w}catch{}return null},o=location.href,i=location.pathname,a=null,l=0,c=!1,u=()=>{if(a??=s(),!a)return;let y=a.getBoundingClientRect();if(y.height<=0)return;let w=Math.round(Math.min(100,Math.max(0,(window.innerHeight-y.top)/y.height*100)));l=Math.max(l,w);let P=a.querySelector("h1,h2");P&&P.getBoundingClientRect().bottom<0&&(c=!0)},f=()=>{!a||!n()||(u(),t.client.capture("$article_read",{$article_id:(a.getAttribute("data-lc-article-id")??"").trim().slice(0,200)||i,$article_depth:l,$article_finished:l>=90,$article_headline_exit:!c&&l<25}),a=null)},g=()=>{f(),a=null,l=0,c=!1,o=location.href,i=location.pathname},h=()=>location.href!==o?g():u(),_=new MutationObserver(h);return _.observe(document.documentElement,{childList:!0,subtree:!0}),window.addEventListener("scroll",h,{passive:!0}),t.onUnload(f),u(),()=>{_.disconnect(),window.removeEventListener("scroll",h)}}var Ve="data-lc-content",ho="data-lc-content-piece",yo="data-lc-content-target";var Ft=(t,e)=>(t.getAttribute(e)??"").trim().slice(0,200);function dr(t,e,n){if(e.contentBlocks===!1||typeof IntersectionObserver>"u")return()=>{};let r=new WeakSet,s=u=>{let f={$content_name:Ft(u,Ve)},g=Ft(u,ho),h=Ft(u,yo);return g&&(f.$content_piece=g),h&&(f.$content_target=h),f},o=location.href,i=new IntersectionObserver(u=>{for(let f of u)!f.isIntersecting||r.has(f.target)||!n()||(r.add(f.target),t.client.capture("$content_impression",s(f.target)))},{threshold:.5}),a=u=>u.querySelectorAll(`[${Ve}]`).forEach(f=>i.observe(f));a(document);let l=new MutationObserver(()=>{location.href!==o&&(o=location.href,i.disconnect(),document.querySelectorAll(`[${Ve}]`).forEach(u=>r.delete(u))),a(document)});l.observe(document.documentElement,{childList:!0,subtree:!0});let c=u=>{let f=u.target?.closest?.(`[${Ve}]`);f&&n()&&t.client.capture("$content_interaction",{...s(f),$content_interaction_type:"click"})};return document.addEventListener("click",c,!0),()=>{i.disconnect(),l.disconnect(),document.removeEventListener("click",c,!0)}}var vo=new Set(["input","textarea","select","option"]),bo=["name","type","role","aria-label","title","alt","placeholder"],_o=/(?:\d[ -]?){9,}/;function xo(t){if(vo.has(t.tagName.toLowerCase())||t.isContentEditable)return;let e="";for(let n of Array.from(t.childNodes))n.nodeType===3&&(e+=n.textContent??"");if(e=e.replace(/\s+/g," ").trim(),!(!e||_o.test(e)))return e.slice(0,255)}function pr(t){if(!t?.length)return()=>!1;let e=t.map(n=>n.toLowerCase());return n=>e.some(r=>r.endsWith("*")?n.startsWith(r.slice(0,-1)):n===r)}var ko="***";function We(t){let e={};for(let n=t,r=0;n&&r<10;n=n.parentElement,r++)for(let s of Array.from(n.attributes)){let o=s.name.startsWith("data-lc-attr-")?s.name.slice(13):"";o&&!(o in e)&&!o.startsWith("$")&&(e[o]=s.value.slice(0,255))}return e}function wo(t,e,n,r){let s=t.parentElement,o=s?Array.from(s.children):[t],i={tag_name:t.tagName.toLowerCase(),nth_child:o.indexOf(t)+1,nth_of_type:o.filter(u=>u.tagName===t.tagName).indexOf(t)+1},a=(t.getAttribute("class")??"").split(/\s+/).filter(Boolean);a.length&&!n("class")&&(i.classes=a),t.id&&!n("id")&&(i.attr__id=r("id",t.id));let l=t.getAttribute("href");l&&!n("href")&&(i.href=r("href",l.slice(0,1024)));let c={};for(let u of Array.from(t.attributes))(u.name.startsWith("data-lc-")||bo.includes(u.name))&&!n(u.name)&&(c[u.name]=r(u.name,u.value.slice(0,255)));if(Object.keys(c).length&&(i.attrs=c),e){let u=xo(t);u&&(i.text=u)}return i}function Ke(t,e,n,r,s={}){let o=[],i=pr(r),a=pr(s.allow),l=s.maskAll?(u,f)=>a(u)?f:ko:(u,f)=>f,c=e;for(let u=t;u&&o.length<10;u=u.parentElement)o.push(wo(u,c,i,l)),(u===n||!n)&&(c=!1);return o}var Ue=t=>t.replace(/(["\\])/g,"\\$1");function Ge(t){return t.map(e=>{let n=e.tag_name+(e.classes?"."+e.classes.join("."):"")+":";e.attr__id&&(n+=`attr__id="${Ue(e.attr__id)}"`),e.href&&(n+=`href="${Ue(e.href)}"`),e.text&&(n+=`text="${Ue(e.text)}"`);for(let[r,s]of Object.entries(e.attrs??{}))n+=`attr__${r}="${Ue(s)}"`;return n+`nth-child="${e.nth_child}"nth-of-type="${e.nth_of_type}"`}).join(";")}var V=[],So=/^[+\-−–‹›<>«»←→↑↓▲▼▶◀^ˇ˄˅]$/,Ro=/\b(increase|decrease|increment|decrement|plus|minus|add one|remove one|next|prev|previous|scroll (left|right))\b/i,Co=/(^|[-_\s])(stepper|spinner|quantity|qty|increment|decrement|inc|dec|plus|minus|carousel|slider|swiper|slick|glide|splide|arrow|next|prev)([-_\s]|$)/i,Eo="button,[role=button],a,input[type=button],input[type=submit],[role=spinbutton]";function Po(t,e=[]){if(e.length&&t.closest(e.join(","))||t.closest("input[type=number],[role=spinbutton],[role=slider]"))return!0;let n=t.closest(Eo)??t,r=`${n.getAttribute("aria-label")??""} ${n.getAttribute("title")??""}`;if(So.test((n.textContent??"").trim())||Ro.test(r))return!0;for(let s=n,o=0;s&&o<3;s=s.parentElement,o++)if(Co.test(s.getAttribute("class")??""))return!0;return!1}var $o=()=>typeof getSelection=="function"?(getSelection()?.toString()??"")!=="":!1;function fr(t,e=Date.now(),n={},r){if(r&&n.ignoreSelectors?.length&&r.closest(n.ignoreSelectors.join(",")))return{};if(r&&n.suppressSteppers!==!1&&Po(r,n.stepperSelectors))return{};if(n.ignoreTextSelection!==!1&&$o())return{};let s=n.windowMs??1e3,o=n.radiusPx??30;for(V.length&&e<V[V.length-1].t&&(V.length=0),V.push({t:e,x:t.clientX,y:t.clientY});V.length&&e-V[0].t>s;)V.shift();let i=V.filter(a=>Math.hypot(a.x-t.clientX,a.y-t.clientY)<=o).length;return i>=(n.count??3)?{$rageclick:!0,$rageclick_count:i}:{}}function gr(t,e,n=700){if(typeof MutationObserver>"u")return;let r=!1,s=new MutationObserver(()=>r=!0);s.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,characterData:!0});let o=()=>{r=!0};window.addEventListener("scroll",o,{capture:!0,passive:!0}),document.addEventListener("selectionchange",o);let i=()=>{s.disconnect(),window.removeEventListener("scroll",o,{capture:!0}),document.removeEventListener("selectionchange",o)},a=setTimeout(()=>{i(),!r&&document.visibilityState!=="hidden"&&t.client.capture("$deadclick_hint",{$selector:e,$no_mutation_ms:n})},n);t.onUnload(()=>{clearTimeout(a),i()})}var mr=/^[A-Za-z_][\w-]*$/,Oo=5;function Io(t){let e=[];for(let n=t;n&&e.length<Oo;n=n.parentElement){let r=n.tagName.toLowerCase();if(n.id&&mr.test(n.id)){e.unshift(`${r}#${n.id}`);break}let s=(n.getAttribute("class")??"").split(/\s+/).filter(o=>mr.test(o)).slice(0,2);e.unshift(r+s.map(o=>`.${o}`).join(""))}return e.join(" ")}function hr(t,e,n,r,s={}){let o={$selector:Io(n),$el_interactive:r};(e.clientX||e.clientY||e.detail)&&(o.$click_x=Math.round(e.clientX+(window.scrollX||0)),o.$click_y=Math.round(e.clientY+(window.scrollY||0))),s.rageClicks!==!1&&!n.closest(".lc-no-rageclick,[data-lc-no-rageclick]")&&Object.assign(o,fr(e,Date.now(),s.rageClicks||{},n));let i=s.deadClicks;!r&&e.isTrusted&&i!==!1&&!(i?.ignoreSelectors?.length&&n.closest(i.ignoreSelectors.join(",")))&&gr(t,o.$selector,i?.waitMs);for(let a of t.clickExtras)Object.assign(o,a(e,n));return o}var Ao="a,button,input,select,textarea,label,summary,[role=button],[role=link],[data-lc-capture]",Mo="[data-lc-ignore]",jt=t=>t.some(e=>typeof e=="string"?location.href.includes(e):e.test(location.href)),To=t=>!t?.length||jt(t),Lt=t=>({maskAll:t.maskAllAttributes,allow:t.attributeAllowlist}),_e=(t,e)=>!!t.closest(Mo)||!!(e.denySelectors?.length&&t.closest(e.denySelectors.join(",")));function yr(t,e,n){let r=e.events??["click","change","submit"],s=0,o=l=>{let c=l.target;!n()||l.isComposing||!(c instanceof Element)||_e(c,e)||c instanceof HTMLInputElement&&c.type==="password"||(s+=1)},i=l=>c=>{if(!n())return;let u=c.target;if(!(u instanceof Element)||_e(u,e)||e.allowSelectors?.length&&!u.closest(e.allowSelectors.join(","))||e.elementAllowlist?.length&&!u.closest(e.elementAllowlist.join(","))||!To(e.urlAllowlist)||l==="change"&&!/^(input|select|textarea)$/i.test(u.tagName)||u instanceof HTMLInputElement&&u.type==="password")return;let f=u.closest(Ao);if(l==="click"&&!f&&!e.allowSelectors?.length)return;let g=Ke(u,e.captureText??!0,f??void 0,e.attributeIgnore,Lt(e)),h=g.find(y=>y.text)?.text,_=s;s=0,t.client.capture("$autocapture",{...We(u),$event_type:l,..._>0?{$keystroke_count:_}:{},$elements:g,$elements_chain:Ge(g),...h?{$el_text:h}:{},...l==="click"?hr(t,c,u,!!f,e):{}})};t.autocaptureClicks=r.includes("click");let a=r.map(l=>[l,i(l)]);for(let[l,c]of a)document.addEventListener(l,c,!0);return document.addEventListener("keydown",o,!0),()=>{for(let[l,c]of a)document.removeEventListener(l,c,!0);document.removeEventListener("keydown",o,!0)}}var Fo='[contenteditable]:not([contenteditable="false"])',vr="input,textarea,select",jo=255;function Lo(t){return t.replace(/\d(?:[ -]?\d){5,}/g,"***").replace(/[^\s@]+@[^\s@]+\.[^\s@]+/g,"***").replace(/\s+/g," ").trim().slice(0,jo)}var Do=t=>t?t instanceof Element?t:t.parentElement:null;function br(t,e,n){let r=e.events??["click","change","submit"],s=e.contentEditable!==!1&&r.includes("change"),o=new WeakSet,i=f=>{let g=Ke(f,!1,f,e.attributeIgnore,Lt(e));return{...We(f),$elements:g,$elements_chain:Ge(g)}},a=f=>{let g=f instanceof Element?f.closest(Fo):null;return g&&!_e(g,e)?g:null},l=f=>{let g=n()?a(f.target):null;g&&o.add(g)},c=f=>{let g=a(f.target);!g||!o.has(g)||f.relatedTarget instanceof Node&&g.contains(f.relatedTarget)||(o.delete(g),n()&&t.client.capture("$autocapture",{$event_type:"change",$el_contenteditable:!0,...i(g)}))},u=f=>{if(!n()||!e.copyCut)return;let g=typeof getSelection=="function"?getSelection():null,h=f.target instanceof Element?f.target:null,_=Do(g?.anchorNode)??h;if(!_||_e(_,e)||_.closest(vr)||h?.closest(vr))return;let y=e.captureCopiedText?Lo(g?.toString()??""):"";t.client.capture("$copy_autocapture",{$copy_type:f.type,...i(_),...y?{$selected_content:y}:{}})};return s&&(document.addEventListener("input",l,!0),document.addEventListener("focusout",c,!0)),document.addEventListener("copy",u,!0),document.addEventListener("cut",u,!0),()=>{document.removeEventListener("input",l,!0),document.removeEventListener("focusout",c,!0),document.removeEventListener("copy",u,!0),document.removeEventListener("cut",u,!0)}}var No="[data-lc-ignore]",Ho=["pdf","zip","gz","tar","rar","7z","doc","docx","xls","xlsx","ppt","pptx","csv","epub","dmg","exe","msi","pkg","apk","iso","mp3","mp4","mov"],qo=["q","s","search","query"],_r=t=>t.origin+t.pathname;function xr(t,e,n){let r=Array.isArray(e.fileDownloads)?e.fileDownloads.map(o=>o.toLowerCase()):Ho,s=[];if(e.outboundLinks!==!1||e.fileDownloads!==!1){let o=i=>{let a=i.target instanceof Element?i.target.closest("a[href]"):null;if(!a||!n()||a.closest(No))return;let l;try{l=new URL(a.href,location.href)}catch{return}if(l.protocol!=="http:"&&l.protocol!=="https:")return;let c=decodeURIComponent(l.pathname.split("/").pop()??""),u=c.includes(".")?c.split(".").pop().toLowerCase():"";e.fileDownloads!==!1&&(a.hasAttribute("download")||r.includes(u))?t.client.capture("$file_download",{$url:_r(l),$file_name:c,$file_extension:u}):e.outboundLinks!==!1&&l.host!==location.host&&t.client.capture("$outbound_click",{$url:_r(l),$outbound_host:l.host})};document.addEventListener("click",o,!0),s.push(()=>document.removeEventListener("click",o,!0))}if(e.siteSearch!==!1){let o=typeof e.siteSearch=="object"&&e.siteSearch.params?e.siteSearch.params:qo,i=!0;s.push(()=>{i=!1}),t.onCapture(a=>{if(!i||a.event!=="$pageview"||!n())return;let l=new URLSearchParams(location.search);for(let c of o){let u=l.get(c)?.trim();if(u)return void t.client.capture("$site_search",{$search_term:u.slice(0,200),$search_param:c})}})}return()=>s.forEach(o=>o())}var Bo=[25,50,75],Vo="data-lc-media-title";function kr(t){let e=t.currentSrc||t.src;if(!e||e.startsWith("blob:")||e.startsWith("data:"))return"";try{let n=new URL(e,location.href);return`${n.origin}${n.pathname}`}catch{return""}}var Uo=t=>(t.getAttribute(Vo)??t.getAttribute("title")??t.getAttribute("aria-label")??"").trim().slice(0,200);function wr(t,e,n){if(e.media===!1)return()=>{};let r=new WeakMap,s=l=>{let c={$media_type:l instanceof HTMLVideoElement?"video":"audio",$media_src:kr(l)},u=Uo(l);return u&&(c.$media_title=u),Number.isFinite(l.duration)&&(c.$media_duration=Math.round(l.duration)),c},o=l=>{let c=kr(l);if(!c)return null;let u=r.get(l);return(!u||u.src!==c)&&r.set(l,u={src:c,played:!1,reached:new Set,done:!1}),u},i=l=>{let c=l.target;if(!(c instanceof HTMLMediaElement)||!n())return;let u=o(c);if(u)if(l.type==="play"){if(u.done&&Object.assign(u,{played:!1,reached:new Set,done:!1}),u.played)return;u.played=!0,t.client.capture("$media_play",s(c))}else if(l.type==="timeupdate"){if(!u.played||u.done||!Number.isFinite(c.duration)||c.duration<=0)return;let f=c.currentTime/c.duration*100;for(let g of Bo)f>=g&&!u.reached.has(g)&&(u.reached.add(g),t.client.capture("$media_progress",{...s(c),$media_progress:g}))}else l.type==="ended"&&u.played&&!u.done&&(u.done=!0,t.client.capture("$media_complete",s(c)))},a=["play","timeupdate","ended"];return a.forEach(l=>document.addEventListener(l,i,!0)),()=>a.forEach(l=>document.removeEventListener(l,i,!0))}function Sr(t=()=>performance.now()){let e=()=>document.visibilityState!=="hidden",n=0,r=e()?t():null,s=()=>{e()?r===null&&(r=t()):(r!==null&&(n+=t()-r),r=null)};return document.addEventListener("visibilitychange",s),{read:()=>Math.round(n+(r===null?0:t()-r)),reset:()=>{n=0,r=e()?t():null},stop:()=>document.removeEventListener("visibilitychange",s)}}Rr();var Cr=255,Ko=new Set(["input","textarea","select","option"]),Go="[data-lc-mask],.lc-mask,[data-lc-no-capture],.lc-no-capture,[data-lc-block]",zo=new Set(["value","password","autocomplete"]),Xo=/(?:\d[ -]?){9,}/,xe=new WeakMap;function Yo(t){return Array.isArray(t)?t.filter(e=>{if(!e||typeof e!="object")return!1;let n=e;return typeof n.name=="string"&&n.name!==""&&!n.name.startsWith("$")&&typeof n.selector=="string"&&(n.source==="text"||n.source==="attribute"&&typeof n.attribute=="string")&&Array.isArray(n.events)}):[]}function Jo(t){if(!t||Ko.has(t.tagName.toLowerCase())||t.isContentEditable)return!1;try{return!t.closest(Go)}catch{return!1}}function Qo(t,e){if(t.source==="attribute"){let r=(t.attribute??"").toLowerCase();if(!r||zo.has(r)||r.startsWith("on"))return;let s=e.getAttribute(r);return s===null?void 0:s.slice(0,Cr)}let n=(e.textContent??"").replace(/\s+/g," ").trim();if(!(!n||Xo.test(n)))return n.slice(0,Cr)}function Er(t,e,n,r=location.href){let s={};for(let o of t){if(!o.events.includes(e)||o.url&&!Dt([o.url],r))continue;let i=null;try{i=o.scope==="target"?e==="click"&&n?n.closest(o.selector):null:document.querySelector(o.selector)}catch{continue}if(!Jo(i))continue;let a=Qo(o,i);a!==void 0&&(s[o.name]=a)}return s}function Pr(t){let e=!0;return t.loadConfig().then(n=>{e&&xe.set(t,Yo(n?.snapshot_properties))}),t.clickExtras.push((n,r)=>e?Er(xe.get(t)??[],"click",r):{}),()=>{e=!1,xe.delete(t)}}function $r(t){let e=xe.get(t);return e?.length?Er(e,"pageview"):{}}function Or(t){return!!xe.get(t)?.some(e=>e.events.includes("pageview"))}function Ir(){let t=0,e=0,n=()=>{let r=document.documentElement,s=Math.max(r.scrollHeight,document.body?.scrollHeight??0),o=Math.min(s,(window.scrollY||window.pageYOffset||0)+window.innerHeight);o>t&&(t=o,e=s>0?Math.min(100,Math.round(o/s*100)):0)};return n(),window.addEventListener("scroll",n,{passive:!0}),{read:()=>({pct:e,px:t}),stop:()=>window.removeEventListener("scroll",n)}}function ze(t,e,n={}){let r=n.views??!0,s=n.leave??!0,o=location.href,i=Ir(),a=Sr(),l,c=()=>{if(!s||l===o)return;l=o;let{pct:y,px:w}=i.read();t.client.capture("$pageleave",{$current_url:o,$scroll_depth:y,$scroll_depth_px:w,$engagement_time_ms:a.read()})},u=!1,f=y=>{if(!r)return;let{core:w}=t;if(!w.hasConsent("analytics")&&!w.anonymousOnReject&&!(w.consent.pending&&w.consent.queueBeforeConsent)){if(!u){u=!0;let P=()=>{u&&(u=!1,f())};t.whenConsented(P),w.onChange(E=>{E==="consent"&&w.anonymousOnReject&&P()})}return}t.client.capture("$pageview",{...$r(t),...y===void 0?{}:{$referrer:y}})},g=()=>{if(location.href===o)return;let y=o;c(),i.stop(),o=location.href,i=Ir(),a.reset(),Or(t)?setTimeout(()=>f(y),0):f(y)};if(t.onUnload(c),f(),e!=="history"&&e!=="hash")return()=>(i.stop(),a.stop());let{pushState:h,replaceState:_}=history;return history.pushState=function(...y){h.apply(this,y),g()},history.replaceState=function(...y){_.apply(this,y),g()},window.addEventListener("popstate",g),e==="hash"&&window.addEventListener("hashchange",g),()=>{window.removeEventListener("hashchange",g),history.pushState=h,history.replaceState=_,window.removeEventListener("popstate",g),i.stop(),a.stop()}}var Ar=t=>{let e=[],n=t.config.autocapture,r=!1;if(n!==!1){let i=typeof n=="object"?n:{},a=()=>!r&&!(i.urlIgnorelist?.length&&jt(i.urlIgnorelist));e.push(yr(t,i,a),br(t,i,a),xr(t,i,a),dr(t,i,a),ur(t,i,a),wr(t,i,a),Pr(t)),n===void 0&&t.loadConfig().then(l=>r=l?.autocapture===!1)}let s=t.config.capturePageview??"history",o=t.config.capturePageleave??"if_capture_pageview";return s!==!1&&o!==!1?e.push(ze(t,s)):s!==!1?e.push(ze(t,s,{leave:!1})):o===!0&&e.push(ze(t,"history",{views:!1})),()=>e.forEach(i=>i())};je();var Zo="lc_preview",Nt="lc_preview";function ei(t){let e={};for(let n of(t??"").split(",")){let r=n.indexOf(":");r>0&&r<n.length-1&&(e[n.slice(0,r)]=n.slice(r+1))}return e}function Mr(t){let e=new URL(t).searchParams.get(Zo),n=null;try{n=sessionStorage.getItem(Nt)}catch{}return{forced:ei(e==="off"?null:e??n),persist(){try{e==="off"?sessionStorage.removeItem(Nt):e&&sessionStorage.setItem(Nt,e)}catch{}}}}var Ht="lc_flag_initial";function ti(t){try{return t?new URL(t).hostname:""}catch{return""}}function ni(){let t=new URLSearchParams(location.search),e={$initial_referrer:document.referrer||"$direct",$initial_referring_domain:ti(document.referrer)||"$direct",$initial_current_url:location.href.split("#")[0]};for(let n of[...be,...J]){let r=t.get(n);r&&(e[`$initial_${n}`]=r)}return e}function jr(t,e){if(typeof location>"u")return{};let n=t.get(Ht);if(n)try{return JSON.parse(n)}catch{}let r=ni();return e(()=>{t.get(Ht)||t.set(Ht,JSON.stringify(r))}),r}function ri(){let t=navigator.userAgent,e=/Edg\//.test(t)?"Edge":/OPR\/|Opera/.test(t)?"Opera":/Firefox\//.test(t)?"Firefox":/Chrome\/|CriOS/.test(t)?"Chrome":/Safari\//.test(t)?"Safari":"Other",n=/Windows/.test(t)?"Windows":/Android/.test(t)?"Android":/iPhone|iPad|iPod/.test(t)?"iOS":/Mac OS X/.test(t)?"Mac OS X":/CrOS/.test(t)?"Chrome OS":/Linux/.test(t)?"Linux":"Other";return{browser:e,os:n}}function Lr(){if(typeof location>"u"||typeof navigator>"u")return{};let t={},e=new URLSearchParams(location.search);for(let s of[...be,...J]){let o=e.get(s);o&&(t[`$${s}`]=o)}let{browser:n,os:r}=ri();return t.$browser=n,t.$os=r,t.$device_type=String(qt().$device_type??"Desktop"),t}function qt(){if(typeof window>"u")return{};let t=window.innerWidth;return{$viewport_width:t,$viewport_height:window.innerHeight,$screen_width:screen.width,$screen_height:screen.height,$browser_language:navigator.language,$device_type:t<768?"Mobile":t<1024?"Tablet":"Desktop"}}var si=/^[A-Za-z0-9_.-]{1,100}$/,oi=/^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*){0,5}$/,ii=new Set(["__proto__","prototype","constructor"]),ai=50,Dr=200;function Tr(t,e){if(!oi.test(e))return;let n=t;for(let r of e.split(".")){if(ii.has(r)||n===null||typeof n!="object"||typeof Node<"u"&&n instanceof Node)return;n=n[r]}if(typeof n=="string")return n.slice(0,Dr);if(typeof n=="number"&&Number.isFinite(n)||typeof n=="boolean")return n}function li(){let t=new Map;for(let e of(typeof document>"u"?"":document.cookie).split(";")){let n=e.indexOf("=");if(n<1)continue;let r=e.slice(0,n).trim(),s=e.slice(n+1).trim();try{s=decodeURIComponent(s)}catch{}t.has(r)||t.set(r,s.slice(0,Dr))}return t}function Fr(t){let e={};if(!t||typeof window>"u")return e;let n=o=>Array.isArray(o)?o.filter(i=>typeof i=="string").slice(0,ai):[],r=n(t.cookies).filter(o=>si.test(o));if(r.length){let o=li();for(let i of r){let a=o.get(i);a!==void 0&&(e[`$cookie/${i}`]=a)}}for(let o of n(t.globals)){let i=Tr(window,o);i!==void 0&&(e[`$global/${o}`]=i)}let s=window.dataLayer;if(Array.isArray(s))for(let o of n(t.data_layer))for(let i=s.length-1;i>=0;i--){let a=Tr(s[i],o);if(a!==void 0){e[`$datalayer/${o}`]=a;break}}return e}var Nr=t=>{if(t.config.flagOptions?.disableRemote&&!t.config.localFlags?.length)return;let e;t.flagPersonProps.push(()=>e&&t.core.hasConsent("analytics")?Fr(e):{}),t.loadConfig().then(n=>{let r=n?.flag_targeting_sources;!r||typeof r!="object"||(e=r,Object.keys(Fr(r)).length&&t.flags?.reload())})};je();function Bt(t){return typeof t=="object"?t.value??t.variant??!!t.enabled:t}function Vt(t){let e={value:Bt(t),reason:t.reason??"remote",condition_index:t.condition_index??-1};return t.variant&&(e.variant=t.variant),t.payload!==void 0&&(e.payload=t.payload),t.runtime?.length&&(e.runtime=t.runtime.map(n=>({filters:n.filters,result:Vt(n.result)}))),e}var Hr="lc_rt_events",qr=t=>!!t?.some(e=>e.conditions.some(n=>n.filters?.some(r=>r.type==="event")));function Br(t,e){let n;try{let i=t.flagStorage.get(Hr);i&&(n=JSON.parse(i))}catch{}let r=new pe(n),s={},o=Me(e,s);return{counts:()=>r.counts(t.core.sessionId),setServer(i){s=i,o=Me(e,s)},server:()=>s,drop(i){for(let a of i)delete s[a]},resolved(){return pt(s,r.counts(t.core.sessionId))},record(i,a,l){r.record(i,t.core.sessionId,a,o),l&&t.whenConsented(()=>t.flagStorage.set(Hr,JSON.stringify(r.saved())))}}}var Vr="lc_flags",Ut="lc_flag_overrides_api";function Ur(t){try{let e=localStorage.getItem("lc_flag_overrides");return e?JSON.parse(e)[t]:void 0}catch{return}}var Wr=t=>{let{core:e,config:n}=t,r={},s={},o={},i,a=!1,l=0,c=new Set,u=new Set,f="",g={},h=()=>Object.keys(g).length>0,_={},y={},w={},P=new Set,E=typeof location>"u"?{forced:{},persist(){}}:Mr(location.href),oe=Object.keys(E.forced).length>0,M=()=>({...r,...w}),C=t.config.flagOptions??{},T=new ge(C.cacheTtlMs),Q=(t.config.flagsApiHost??t.config.apiHost).replace(/\/+$/,""),ie=C.keys?.length?new Set(C.keys):void 0,Z=p=>ie?Object.fromEntries(Object.entries(p).filter(([v])=>ie.has(v))):p,F=(p,v,k=!0)=>{if(r=Z(p),s=Z(v),a=!0,k)for(let S of P)S(M())},j=Br(t,n.localFlags),ee=t.flagStorage.get(Vr);if(ee)try{let p=JSON.parse(ee);r=p.values,s=p.payloads,o=Object.fromEntries(Object.keys(r).map(v=>[v,"cached"])),p.rt&&j.setServer(p.rt),T.restore(p)}catch{}let b=t.flagStorage.get(Ut);if(b)try{w=JSON.parse(b)}catch{}let O=n.bootstrap;if(O?.flags){F({...O.flags},{...O.payloads});for(let p of Object.keys(O.flags))o[p]="bootstrap"}let U={},ae=()=>({...C.autoProperties===!1?{}:Lr(),...jr(e.storage,t.whenConsented),...Object.assign({},...t.flagPersonProps.map(p=>p())),..._}),H=C.evaluationContexts?.length?{app_contexts:C.evaluationContexts}:{},te=(p=!0)=>{let v=n.localFlags;if(!v?.length)return!0;let k=n.localFlagsContext,S=ht(v,{runtime_events:j.counts(),distinct_id:e.distinctId,...e.groups?{groups:e.groups}:{},...e.deviceId?{device_id:e.deviceId}:{},...h()?{contexts:g}:{},...H,...k,person_properties:{...ae(),...k?.person_properties},group_properties:{...k?.group_properties,...y}}),$={},I={},z=!1;for(let[X,L]of Object.entries(S))yt(L)?z=!0:vt(L)&&($[X]=L.value,o[X]=L.reason,L.payload!==void 0&&(I[X]=L.payload));return U=$,F({...r,...$},{...s,...I},p),z},G=p=>{let v={...r},k={...s};for(let[S,$]of Object.entries(j.resolved()))v[S]=$.value,o[S]=$.reason,$.payload!==void 0?k[S]=$.payload:delete k[S];F(v,k,p)},le=qr(n.localFlags);t.onCapture(p=>{let v=le||Object.keys(j.server()).length>0;if(j.record(p.event,p.properties,v),!v)return;let k=JSON.stringify([M(),s]);if(le&&te(!1),G(!1),JSON.stringify([M(),s])!==k)for(let S of P)S(M())});let x=(p=!0)=>{let v=++l;return!te()||C.disableRemote||!p&&T.fresh(e.distinctId)?Promise.resolve():new Promise(k=>{t.whenConsented(()=>{if(v!==l)return k();E.persist();let S=new AbortController,$=setTimeout(()=>S.abort(),C.timeoutMs??1e4);t.fetch(`${Q}/v1/flags`,{method:"POST",headers:{"Content-Type":"text/plain;charset=UTF-8"},credentials:"omit",signal:S.signal,body:JSON.stringify({api_key:t.apiKey,...e.distinctId?{distinct_id:e.distinctId}:{},...e.anonDistinctId?{anon_distinct_id:e.anonDistinctId}:{},groups:e.groups??{},person_properties:ae(),...Object.keys(y).length?{group_properties:y}:{},device_properties:qt(),...e.deviceId?{device_id:e.deviceId}:{},...h()?{contexts:g}:{},...H,...oe?{preview:E.forced}:{},...C.keys?.length?{flag_keys:C.keys}:{}})}).then(I=>I.ok?I.json():Promise.reject(new Error(`status ${I.status}`))).then(I=>{if(v!==l)return;if(I.quota_limited)return t.log("flags quota limited; keeping cached values");let z={},X={},L={};for(let[ke,D]of Object.entries(I.flags??{}))z[ke]=Bt(D),typeof D=="object"&&D.payload!==void 0&&(X[ke]=D.payload),o[ke]=typeof D=="object"&&typeof D.reason=="string"?D.reason:"remote",typeof D=="object"&&D.runtime?.length&&(L[ke]=Vt(D));i=I.request_id,j.setServer(L),F({...U,...z},X,!1),G(!0),t.flagStorage.set(Vr,JSON.stringify({values:z,payloads:X,rt:L,...T.mark(e.distinctId)})),t.log("flags loaded",z)}).catch(I=>t.log("flags fetch failed",I)).finally(()=>{clearTimeout($),k()})})})},ce=p=>w[p]??Ur(p)??r[p];t.flags={get(p){let v=ce(p);if(v===void 0)return;if(p in E.forced||p in w)return v;let k=e.sessionId;k!==f&&(c.clear(),u.clear(),f=k),u.has(p)||(u.add(p),e.capture("$exposure",{$feature_flag:p,$feature_flag_response:v,...typeof v=="string"?{$feature_flag_variant:v}:{},...i?{$feature_flag_request_id:i}:{}}));let S=`${p}:${String(v)}`;return c.has(S)||(c.add(S),e.capture("$feature_flag_called",{$feature_flag:p,$feature_flag_response:v,...i?{$feature_flag_request_id:i}:{}})),v},all:()=>a||Object.keys(r).length||Object.keys(w).length?M():{},payload:p=>s[p],result(p,v){let k=v?.sendExposure===!1?ce(p):this.get(p),S=p in w||Ur(p)!==void 0?"override":p in E.forced?"preview":o[p]??"remote";return me(p,k,s[p],S)},layerParam(p,v){for(let[k,S]of Object.entries(s)){let $=S;if($?.lc_layer!==p||!$.lc_params||!(v in $.lc_params))continue;let I=this.get(k);if(I!==void 0&&I!==!1)return $.lc_params[v]}},onChange(p){return P.add(p),a&&p(M()),()=>{P.delete(p)}},reload:x,update(p,v,k=!0){for(let S of Object.keys(p))o[S]="pushed";j.drop(Object.keys(p)),F(k?{...r,...p}:{...p},k?{...s,...v}:{...v})},override(p,v){w=p?{...p}:{},p?v?.persist&&t.whenConsented(()=>t.flagStorage.set(Ut,JSON.stringify(w))):t.flagStorage.remove(Ut);for(let k of P)k(M())},setPersonProperties(p,v=!0){T.clear(),_={..._,...p},v&&x()},resetPersonProperties(){_={}},setGroupProperties(p,v=!0){T.clear();for(let[k,S]of Object.entries(p))y[k]={...y[k],...S};v&&x()},resetGroupProperties(){y={}},setContext(p,v,k){T.clear(),g={...g,[p]:{key:v,properties:k??{}}},x()},clearContext(p){T.clear();let{[p]:v,...k}=g;g=k,x()}},e.onChange(p=>{p==="reset"&&(g={},_={},y={}),(p==="identify"||p==="reset"||p==="group")&&x()}),n.disableFlagsOnFirstLoad?te():x(!1);let q=n.flagStream,d;q&&!C.disableRemote&&t.whenConsented(()=>{d=tt({apiHost:Q,apiKey:t.apiKey,fetch:t.fetch,reload:()=>{x()},visibility:{hidden:()=>document.visibilityState==="hidden",subscribe:p=>(document.addEventListener("visibilitychange",p),()=>document.removeEventListener("visibilitychange",p))},...typeof q=="object"&&q.pollMs!==void 0?{pollMs:q.pollMs}:{},log:t.log})});let m=C.refreshMs&&C.refreshMs>0&&!C.disableRemote?setInterval(()=>document.visibilityState!=="hidden"&&void x(!1),C.refreshMs):void 0;return()=>{d?.(),m&&clearInterval(m)}};function Xe(t){let e=window.fetch;window.fetch=function(i,a){let l=i instanceof Request?i.url:String(i),c=new Headers(a?.headers??(i instanceof Request?i.headers:void 0)),u=[...c.entries()].join("|");return t(l,c),[...c.entries()].join("|")===u?e.call(this,i,a):e.call(this,i,{...a,headers:c})};let n=XMLHttpRequest.prototype,{open:r,send:s}=n,o=new WeakMap;return n.open=function(i,a,...l){return o.set(this,String(a)),r.call(this,i,a,...l)},n.send=function(i){let a=o.get(this);if(a){let l=new Headers;t(a,l),l.forEach((c,u)=>this.setRequestHeader(u,c))}return s.call(this,i)},()=>{window.fetch=e,n.open=r,n.send=s}}var Kr="lucida.session_id";function ci(t,e){return[...(t??"").split(",").map(r=>r.trim()).filter(r=>r&&!r.startsWith(`${Kr}=`)),`${Kr}=${encodeURIComponent(e)}`].join(",")}function ui(t,e=[]){let n;try{n=new URL(t,location.href)}catch{return!1}return n.origin===location.origin||e.some(r=>typeof r=="string"?n.origin===r:r.test(n.href))}var Gr=t=>{let e=t.config.watchtower;if(!e?.correlate)return;let{core:n}=t,r=n.sessionId;t.onCapture(o=>r=String(o.properties.$session_id??r));let s=o=>n.hasConsent("analytics")&&!o.startsWith(t.config.apiHost)&&ui(o,e.origins);return Xe((o,i)=>{s(o)&&i.set("baggage",ci(i.get("baggage"),r))})};var di="X-Lucida-Distinct-Id",pi="X-Lucida-Session-Id";function fi(t,e){let n;try{n=new URL(t,location.href).hostname.toLowerCase()}catch{return!1}return e.some(r=>{let s=r.toLowerCase();return s.startsWith(".")?n===s.slice(1)||n.endsWith(s):n===s})}var zr=t=>/^[\x20-\x7e]*$/.test(t)?t:encodeURIComponent(t),Xr=t=>{let e=t.config.tracingHeaders;if(!e?.length)return;let{core:n}=t;return Xe((r,s)=>{!n.hasConsent("analytics")||r.startsWith(t.config.apiHost)||!fi(r,e)||(n.distinctId&&s.set(di,zr(n.distinctId)),s.set(pi,zr(n.sessionId)))})};function Yr(t,e={},n=[]){return cr(t,e,[Ar,Wr,Nr,Gr,Xr,nr,...n])}function gi(t,e){if(!t.modules?.length)return Promise.resolve([]);if(t.extension??Le())return console.warn("[lucida] extension mode: `modules` are not loaded remotely; bundle them with createClient"),Promise.resolve([]);let n=t.assetHost??t.apiHost??Be;return Xn(t.modules,{assetHost:n,version:Tt},(...r)=>console.warn("[lucida]",...r),e)}function mi(t,e){let n=t.lucidaQueue??[],r=[],s=Promise.resolve(),o=!1,i=l=>{let[c,...u]=l;if(c==="init"){if(t.lucida||o)return;o=!0;let g=u[1]??{},h=_=>{t.lucida=Yr(String(u[0]),g,_);let y=r;r=[],y.forEach(i)};g.modules?.length?s=gi(g,e).then(h):h([]);return}if(!t.lucida){r.push(l);return}let f=t.lucida[c];typeof f=="function"&&f.apply(t.lucida,u)},a=n.splice(0);return n.push=(...l)=>(l.forEach(i),n.length),t.lucidaQueue=n,a.forEach(i),s}typeof window<"u"&&mi(window);})();
@@ -0,0 +1 @@
1
+ var b=!1,E=()=>{b=!1},C=n=>{try{let t=new URL(n);return t.protocol==="https:"?t.href:null}catch{return null}},w=new Set(["tour","checklist","modal","slideout"]),k=new Set(["announcement","banner"]);function e(n,t){let s=document.createElement(n);return t!==void 0&&(s.textContent=t),s}function v(n,t){return n.guide_ids?.length?n.guide_ids.flatMap(s=>t.find(o=>o.id===s)??[]):t.filter(s=>w.has(s.kind))}function M(n,t){if(!n.search_url||!t.trim())return null;try{let s=new URL(n.search_url.replace("{q}",encodeURIComponent(t.trim())));return s.protocol==="https:"?s.href:null}catch{return null}}function L(n,t){let s=e("section");if(s.setAttribute("aria-label",n.title??n.module??"Module"),s.append(e("h2",n.title??"")),n.body&&s.append(e("p",n.body)),n.module==="guides"){let o=e("ul");for(let l of v(n,t.library)){let i=e("button",l.name);i.type="button",i.onclick=()=>(t.opened(),t.launch(l.id));let r=e("li");r.append(i),o.append(r)}s.append(o.childElementCount?o:e("p","No guides yet."))}else if(n.module==="announcements"){let o=t.library.filter(i=>k.has(i.kind)&&i.steps[0]).sort((i,r)=>(r.published_at??"").localeCompare(i.published_at??"")),l=e("ul");for(let i of o.slice(0,10)){let r=e("li");r.append(e("strong",i.steps[0].title??i.name)),i.steps[0].body&&r.append(e("p",i.steps[0].body)),l.append(r)}s.append(l.childElementCount?l:e("p","Nothing new."))}else if(n.module==="search"){let o=e("form");o.setAttribute("role","search");let l=e("label","Search help"),i=e("input");i.type="search",l.append(i);let r=e("button","Search");r.type="submit";let f=e("ul");o.append(l,r,f);let p=e("div");p.setAttribute("aria-live","polite"),o.onsubmit=m=>{m.preventDefault(),t.opened();let h=i.value.trim(),u=h.toLowerCase();f.replaceChildren();let a=t.library.filter(c=>w.has(c.kind)&&u&&(c.name+" "+c.steps.map(g=>`${g.title??""} ${g.body??""}`).join(" ")).toLowerCase().includes(u)).slice(0,5);for(let c of a)f.append(y(c,t));p.replaceChildren(),t.assist&&!b&&h?A(h,a.length,t,p):t.assist?.searched({query:h,results:a.length,answered:!1});let d=M(n,i.value);d&&window.open(d,"_blank","noopener,noreferrer")},o.append(p),s.append(o)}return s}function y(n,t){let s=e("button",n.name);s.type="button",s.onclick=()=>t.launch(n.id);let o=e("li");return o.append(s),o}async function A(n,t,s,o){let l=s.assist;o.textContent="Finding an answer...";let i=await l.ask(n.slice(0,500));if(o.replaceChildren(),i==="unavailable"&&(b=!0),!i||i==="unavailable")return l.searched({query:n,results:t,answered:!1});let r=!!i.answer.trim();if(l.searched({query:n,results:t,answered:r}),!r)return;o.append(e("h3","Answer"),e("p",i.answer));let f=e("ul");for(let u of(i.citations??[]).slice(0,5)){let a=C(u.url);if(!a)continue;let d=e("a",u.title||a);Object.assign(d,{href:a,target:"_blank",rel:"noopener noreferrer"});let c=e("li");c.append(d),f.append(c)}f.childElementCount&&o.append(e("p","Sources"),f);let p=e("ul");for(let u of(i.guide_ids??[]).slice(0,3)){let a=s.library.find(d=>d.id===u);a&&p.append(y(a,s))}p.childElementCount&&o.append(e("p","Suggested guides"),p);let m=e("div"),h=(u,a)=>{let d=e("button",u);return d.type="button",d.onclick=()=>{l.searched({query:n,results:t,answered:r,feedback:a}),m.replaceChildren(e("p","Thanks for the feedback."))},d};m.append(h("Helpful","up"),h("Not helpful","down")),o.append(m)}export{v as listed,L as renderModule,E as resetAssist,M as searchHref};
@@ -0,0 +1 @@
1
+ import{a as k}from"./chunk-AWIQCFGN.js";import{b as y,k as w}from"./chunk-MCWQHOEV.js";var L="button{font:13px system-ui;cursor:pointer}.d,.b,.l,.o{position:fixed;z-index:2147482000}.d{width:16px;height:16px;padding:0;border-radius:50%;border:2px solid #fff;background:#e5484d;animation:p 1.6s infinite}.o{z-index:2147481000;border:2px solid #e5484d;border-radius:6px;pointer-events:none}.b{padding:1px 8px;border:0;border-radius:10px;background:#e5484d;color:#fff;font-size:11px}.l{right:16px;bottom:16px;padding:10px 16px;border:0;border-radius:24px;background:#111;color:#fff;box-shadow:0 4px 16px rgba(0,0,0,.3)}@keyframes p{0%{box-shadow:0 0 0 0 rgba(229,72,77,.6)}100%{box-shadow:0 0 0 14px rgba(229,72,77,0)}}@media (prefers-reduced-motion:reduce){.d{animation:none}}";function x(e,r,a){let i=document.createElement(e);return i.className=r,a&&(i.textContent=a),i}function T(e,r,a,i={}){let p=document.createElement("div");p.setAttribute("data-lc-ignore","");let h=p.attachShadow({mode:"open"});h.append(y(L,i.nonce));let l=e.steps[0],v=l.title??e.name,c=!1,u=!1,g=!1,f=()=>{g||(g=!0,clearInterval(G),removeEventListener("scroll",s,!0),removeEventListener("resize",s),p.remove(),a())},E=()=>{let o=k();if(!o||c)return o?.();c=!0;let t=e.kind==="launcher",m={...r,shown(){},dismissed:(b,H)=>t?void 0:(u=!0,r.dismissed(b,H)),completed:()=>(u=!t,r.completed())};w({...e,kind:t?"resource_center":"tooltip"},m,()=>{c=!1,o(),u&&f()},i)},n=e.kind==="badge"?x("button","b",v):x("button",e.kind==="launcher"?"l":"d",e.kind==="launcher"?e.appearance?.launcher_label??e.name:void 0);n.type="button",n.setAttribute("aria-label",e.kind==="launcher"?String(e.appearance?.launcher_label??e.name):v);let d=e.kind==="hotspot"?x("div","o"):void 0;n.onclick=()=>{e.kind==="badge"?(r.dismissed(0,l.id),f()):E()},h.append(...d?[d]:[],n);function s(){if(e.kind==="launcher")return;let o=l.selector?document.querySelector(l.selector):null;if(n.hidden=!o,d&&(d.hidden=!o),!o)return;let t=o.getBoundingClientRect(),[m,b]=e.kind==="badge"?[t.right-n.offsetWidth/2,t.top-n.offsetHeight/2]:[t.right-8,t.top-8];n.style.left=`${m}px`,n.style.top=`${b}px`,d&&Object.assign(d.style,{left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`})}let G=setInterval(s,500);return addEventListener("scroll",s,!0),addEventListener("resize",s),document.body.append(p),s(),r.shown(),f}export{T as renderPersistent};
@@ -0,0 +1,2 @@
1
+ export { R as RECS_PAYLOAD_KEY, q as RecommendationItem, r as RecommendationOptions, s as Recommendations, t as RecsService, x as placementFlag, y as recommendations } from './types-BWd9sbCh.js';
2
+ import '@lucida-analytics/sdk-core';
@@ -0,0 +1 @@
1
+ var S="lc_recs",E="lc_recs_recent";function C(t,s,m,c){for(let d of c?[c]:m){let r=s(d)?.[S];if(r&&typeof r=="object"&&(r.placement===t||c!==void 0&&r.placement===void 0))return{flag:d,cfg:r}}}var I=t=>{let{core:s}=t,m=t.config.recommendations??{},c=m.viewEvent??"$product_viewed",d=m.itemIdProperty??"item_id",r=[];try{let n=JSON.parse(s.storage.get(E)??"[]");Array.isArray(n)&&(r=n.filter(e=>typeof e=="string").slice(0,20))}catch{}let p=()=>s.hasConsent("analytics"),_=n=>{n&&(r=[n,...r.filter(e=>e!==n)].slice(0,20),p()&&s.storage.set(E,JSON.stringify(r)))};t.onCapture(n=>{let e=n.properties?.[d];n.event===c&&(typeof e=="string"||typeof e=="number")&&_(String(e))}),t.recs={viewed:_,async get(n,e={}){let k=Object.keys(t.flags?.all()??{}),o=C(n,i=>t.flags?.payload(i),k,e.flag),g=o?t.flags?.get(o.flag):void 0,a=new URLSearchParams({api_key:t.apiKey,placement:n});e.itemId&&a.set("item_id",e.itemId),p()&&r.length&&a.set("recent",r.filter(i=>i!==e.itemId).slice(0,10).join(","));let u=o?.cfg.strategy;typeof u=="string"&&a.set("strategy",u);let y=e.limit??o?.cfg.limit;typeof y=="number"&&y>0&&a.set("limit",String(Math.min(50,Math.floor(y)))),e.exclude?.length&&a.set("exclude",e.exclude.slice(0,50).join(","));let l={};try{let i=await t.fetch(`${t.config.apiHost}/v1/recommendations?${a}`,{credentials:"omit"});i.ok?l=await i.json():t.log("recommendations failed",i.status)}catch(i){t.log("recommendations failed",i)}let f=Array.isArray(l.items)?l.items:[],w=l.strategy??u??"",v={$recommendation_placement:n,$recommendation_strategy:w,...o?{$recommendation_flag:o.flag}:{},...g!==void 0?{$recommendation_variant:String(g)}:{}},R=!1,b={placement:n,strategy:w,items:f,...o?{flag:o.flag}:{},...g!==void 0?{variant:g}:{},shown(){R||!f.length||(R=!0,s.capture("$recommendation_shown",{...v,$recommendation_items:f.map(i=>i.item_id)}))},clicked(i){let x=f.findIndex($=>$.item_id===i);s.capture("$recommendation_clicked",{...v,$recommendation_item:i,...x>=0?{$recommendation_position:x+1}:{}})}};return e.autoShown!==!1&&b.shown(),b}}};export{S as RECS_PAYLOAD_KEY,C as placementFlag,I as recommendations};