@lucida-analytics/browser 0.1.5 → 0.1.6

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 (71) hide show
  1. package/README.md +14 -4
  2. package/dist/autocapture.d.ts +1 -1
  3. package/dist/autocapture.js +1 -1
  4. package/dist/{client-DZX6o-eI.d.ts → client-pxkkaWtR.d.ts} +2 -2
  5. package/dist/consent.d.ts +2 -2
  6. package/dist/core.d.ts +3 -3
  7. package/dist/core.js +2 -2
  8. package/dist/correlate.d.ts +8 -2
  9. package/dist/correlate.js +1 -1
  10. package/dist/early-access.d.ts +1 -1
  11. package/dist/experiments.d.ts +1 -1
  12. package/dist/flags.d.ts +1 -1
  13. package/dist/forms.d.ts +1 -1
  14. package/dist/guides.d.ts +1 -1
  15. package/dist/heatmaps.d.ts +1 -1
  16. package/dist/host-headers.d.ts +1 -1
  17. package/dist/index.d.ts +10 -4
  18. package/dist/index.js +2 -2
  19. package/dist/inspector.d.ts +1 -1
  20. package/dist/lucida.js +3 -3
  21. package/dist/recommendations.d.ts +1 -1
  22. package/dist/replay.d.ts +2 -2
  23. package/dist/replay.js +1 -1
  24. package/dist/static/v0/autocapture.js +1 -1
  25. package/dist/static/v0/core.js +2 -2
  26. package/dist/static/v0/correlate.js +1 -1
  27. package/dist/static/v0/index.js +2 -2
  28. package/dist/static/v0/lucida.js +3 -3
  29. package/dist/static/v0/manifest.json +24 -24
  30. package/dist/static/v0/replay.js +1 -1
  31. package/dist/static/v0.1.6/autocapture.js +1 -0
  32. package/dist/static/v0.1.6/core.js +3 -0
  33. package/dist/static/v0.1.6/correlate.js +1 -0
  34. package/dist/static/v0.1.6/index.js +3 -0
  35. package/dist/static/v0.1.6/lucida.js +3 -0
  36. package/dist/static/v0.1.6/manifest.json +28 -0
  37. package/dist/static/v0.1.6/replay.js +1 -0
  38. package/dist/toolbar.d.ts +1 -1
  39. package/dist/{types-Dng5ldZO.d.ts → types-QPJGHOv0.d.ts} +17 -2
  40. package/dist/webmcp.d.ts +1 -1
  41. package/package.json +1 -1
  42. package/storage.json +1 -1
  43. package/dist/static/v0.1.5/autocapture.js +0 -1
  44. package/dist/static/v0.1.5/core.js +0 -3
  45. package/dist/static/v0.1.5/correlate.js +0 -1
  46. package/dist/static/v0.1.5/index.js +0 -3
  47. package/dist/static/v0.1.5/lucida.js +0 -3
  48. package/dist/static/v0.1.5/manifest.json +0 -28
  49. package/dist/static/v0.1.5/replay.js +0 -1
  50. /package/dist/static/{v0.1.5 → v0.1.6}/banner-7LEREYUH.js +0 -0
  51. /package/dist/static/{v0.1.5 → v0.1.6}/chunk-536QABLP.js +0 -0
  52. /package/dist/static/{v0.1.5 → v0.1.6}/chunk-AWIQCFGN.js +0 -0
  53. /package/dist/static/{v0.1.5 → v0.1.6}/chunk-EFNCQJI3.js +0 -0
  54. /package/dist/static/{v0.1.5 → v0.1.6}/chunk-FUE3SDQU.js +0 -0
  55. /package/dist/static/{v0.1.5 → v0.1.6}/chunk-UPPUYIIH.js +0 -0
  56. /package/dist/static/{v0.1.5 → v0.1.6}/consent.js +0 -0
  57. /package/dist/static/{v0.1.5 → v0.1.6}/early-access.js +0 -0
  58. /package/dist/static/{v0.1.5 → v0.1.6}/experiments.js +0 -0
  59. /package/dist/static/{v0.1.5 → v0.1.6}/flags.js +0 -0
  60. /package/dist/static/{v0.1.5 → v0.1.6}/forms.js +0 -0
  61. /package/dist/static/{v0.1.5 → v0.1.6}/guides.js +0 -0
  62. /package/dist/static/{v0.1.5 → v0.1.6}/heatmaps.js +0 -0
  63. /package/dist/static/{v0.1.5 → v0.1.6}/host-headers.js +0 -0
  64. /package/dist/static/{v0.1.5 → v0.1.6}/inspector.js +0 -0
  65. /package/dist/static/{v0.1.5 → v0.1.6}/modules-FANMZRDJ.js +0 -0
  66. /package/dist/static/{v0.1.5 → v0.1.6}/persistent-SLVINN5A.js +0 -0
  67. /package/dist/static/{v0.1.5 → v0.1.6}/recommendations.js +0 -0
  68. /package/dist/static/{v0.1.5 → v0.1.6}/recorder-4WIMQCLR.js +0 -0
  69. /package/dist/static/{v0.1.5 → v0.1.6}/toolbar.js +0 -0
  70. /package/dist/static/{v0.1.5 → v0.1.6}/validation-HGJXZ553.js +0 -0
  71. /package/dist/static/{v0.1.5 → v0.1.6}/webmcp.js +0 -0
@@ -1,28 +1,28 @@
1
1
  {
2
- "version": "0.1.5",
2
+ "version": "0.1.6",
3
3
  "files": {
4
- "modules/autocapture.js": "sha384-+5q1xqzlVG0FEFn6fQPyU4CtVoM3C/OU53mp+sRYE90EYonpBbAq1FEOh+zuiOMN",
5
- "modules/banner-7LEREYUH.js": "sha384-Qp/NqT/ErMxTXljd3BTWMnbB8lmjwU6tHN92KxosOvQ+jODaakgrhiMPGp2HUssl",
6
- "modules/consent.js": "sha384-gfpx8znG/5LuNJA6KpFlTtTeo7O4W/4Pt7jageTPD4l8mq3MMjDMeZM+BwCj0Gzs",
7
- "modules/core.js": "sha384-u4L18ofoRzsNfp2sEM1cl2dDLCV/A99PBF8m5j/e+o753K6L1y+wDQMBuLjiXx97",
8
- "modules/correlate.js": "sha384-GBRoLCX2uGUNdY119jf/Kdaw7pbXJOQ6gthHVo/p9T2WN/czR6uAk39QrCdPOOsV",
9
- "modules/early-access.js": "sha384-5JZ6DWRYgfoeu7QgSPi8kvVlys4CZ6H2wWuvEEggc83iau5z0sJ8RQD1AXtLCjGQ",
10
- "modules/experiments.js": "sha384-5smoFlAcR2T1XmBgazy5HGun22PvX5Pa7IKIKtONtN/CpNy6U9SDWb7W7Di9d5fR",
11
- "modules/flags.js": "sha384-leEfAfEPD56SEaTBA0frnZvRvDk8p/tOilnGeNDqoRLUuR4e0uoVSY2z96lInBHN",
12
- "modules/forms.js": "sha384-G61YPp3pr3ZeyhVNhHSjYIexf3/bmgQjZEUJrPrY5qP0ykMnXfk5PAgDK2ErLqF+",
13
- "modules/guides.js": "sha384-ojyyhBUHcWeLxnIuFqEe/K8+CgHJCFT0Q85LsBpZtG+p+8k7jsGzDjPJon2SZQg1",
14
- "modules/heatmaps.js": "sha384-drg7hBMqgcVNdV3zVr2Df+LJ+CMsf9lbeWugFixjEpyMBvEgEci5A1hWEjLZX5Vn",
15
- "modules/host-headers.js": "sha384-8OsSDIVDEo3Lsk3G+L5xNJ4pkAYXDEAz+ggBK7sG1cj7tOITAXDKaM2EFtQCHGiF",
16
- "modules/index.js": "sha384-3YsvZp1lkNbu7czPe6OJ80iyuSZkBmD9Sn1Wuy73GHzt3utmEvCAeHuzD0CvWsqh",
17
- "modules/inspector.js": "sha384-wCjcdzjbZ1mAYS3w19Io8NOJQfrnlmfDkinoan/0LUTqCw6M7OSR9QDwxDp6M5+T",
18
- "lucida.js": "sha384-TAeLhDXpW+SSNNw+4Lfak659C3WhewE4DHrFRgyD686cOl8GQsRhOg4trITiHoya",
19
- "modules/modules-FANMZRDJ.js": "sha384-UjLSth+cPZTIxwMGFgoUEocqFSHXnM7IgYpICNSRRU7NTlFkfCg3WUNUbu8u04EP",
20
- "modules/persistent-SLVINN5A.js": "sha384-DUvReNmdZNyY7aEE/oFQW7ZOS4J1CyyqE6eheXPBOv/zXqCViscg3GE74E9OSdRQ",
21
- "modules/recommendations.js": "sha384-6XyPo/sQd1LNvQ87+vlgOLYe/ecapP9mmDeKlkTRx15d9gTAmDRwCPrX+n6zy2lx",
22
- "modules/recorder-4WIMQCLR.js": "sha384-7OIwHRXGKBAgkMw+adAxAXZ51mTlhVaig1Srek5OkdY2F9nqfRWLvpAg+WJ+4lOf",
23
- "modules/replay.js": "sha384-UxRymVyZcmoSPDutEK6duQi+F6P9Zpk7Vvb08X8madMU8TWM1rzapRJnEMGBNswv",
24
- "modules/toolbar.js": "sha384-5RaMXlQzkpgbv3L9JX67X8YdRd9s5/Kt5usUm4uqC0afaZkXTYbBkdInD2b0ORP3",
25
- "modules/validation-HGJXZ553.js": "sha384-NmKcVVwg5IWD+ctqpalFATPXleIm4PFPkcQgQ3d/iUILxmjIC8tENjXFPibdEVTX",
26
- "modules/webmcp.js": "sha384-Vs+fImvLlnbEZtId9H/pA4VXB1bVaxEjOYY+DcAUTN5pXXuNNFOYQfltuj2giALZ"
4
+ "autocapture.js": "sha384-DDAGXR+vbOxKtn81H2qUkWbf/AKTUT4EK46i8sdH7jhe5cdqGiQQli0zjBQfOHEG",
5
+ "banner-7LEREYUH.js": "sha384-Qp/NqT/ErMxTXljd3BTWMnbB8lmjwU6tHN92KxosOvQ+jODaakgrhiMPGp2HUssl",
6
+ "consent.js": "sha384-gfpx8znG/5LuNJA6KpFlTtTeo7O4W/4Pt7jageTPD4l8mq3MMjDMeZM+BwCj0Gzs",
7
+ "core.js": "sha384-pGqIvhY6/6kZVhlqY9984JqEHxcMXOjKLTgvUND2UBLDeArnu3x0gkshTPQhmOnz",
8
+ "correlate.js": "sha384-v9vUN2naMNMTe8neR1TILpaXrVpdAYeyiZs9YL8UmzS/QDDvlHUpO8RtL5oPiXop",
9
+ "early-access.js": "sha384-5JZ6DWRYgfoeu7QgSPi8kvVlys4CZ6H2wWuvEEggc83iau5z0sJ8RQD1AXtLCjGQ",
10
+ "experiments.js": "sha384-5smoFlAcR2T1XmBgazy5HGun22PvX5Pa7IKIKtONtN/CpNy6U9SDWb7W7Di9d5fR",
11
+ "flags.js": "sha384-leEfAfEPD56SEaTBA0frnZvRvDk8p/tOilnGeNDqoRLUuR4e0uoVSY2z96lInBHN",
12
+ "forms.js": "sha384-G61YPp3pr3ZeyhVNhHSjYIexf3/bmgQjZEUJrPrY5qP0ykMnXfk5PAgDK2ErLqF+",
13
+ "guides.js": "sha384-ojyyhBUHcWeLxnIuFqEe/K8+CgHJCFT0Q85LsBpZtG+p+8k7jsGzDjPJon2SZQg1",
14
+ "heatmaps.js": "sha384-drg7hBMqgcVNdV3zVr2Df+LJ+CMsf9lbeWugFixjEpyMBvEgEci5A1hWEjLZX5Vn",
15
+ "host-headers.js": "sha384-8OsSDIVDEo3Lsk3G+L5xNJ4pkAYXDEAz+ggBK7sG1cj7tOITAXDKaM2EFtQCHGiF",
16
+ "index.js": "sha384-1CYQ8dFo94HLDb4YnLPKo9h08i2Px03KsRKFNgEMiiq4x5+I0CAoUVb4QoGkTgV3",
17
+ "inspector.js": "sha384-wCjcdzjbZ1mAYS3w19Io8NOJQfrnlmfDkinoan/0LUTqCw6M7OSR9QDwxDp6M5+T",
18
+ "lucida.js": "sha384-toDyt2ORHqXnDcQ8IzvDZA7ggrWxrFULySEgott3RgOZoH9686tKsCcvVLij5WHt",
19
+ "modules-FANMZRDJ.js": "sha384-UjLSth+cPZTIxwMGFgoUEocqFSHXnM7IgYpICNSRRU7NTlFkfCg3WUNUbu8u04EP",
20
+ "persistent-SLVINN5A.js": "sha384-DUvReNmdZNyY7aEE/oFQW7ZOS4J1CyyqE6eheXPBOv/zXqCViscg3GE74E9OSdRQ",
21
+ "recommendations.js": "sha384-6XyPo/sQd1LNvQ87+vlgOLYe/ecapP9mmDeKlkTRx15d9gTAmDRwCPrX+n6zy2lx",
22
+ "recorder-4WIMQCLR.js": "sha384-7OIwHRXGKBAgkMw+adAxAXZ51mTlhVaig1Srek5OkdY2F9nqfRWLvpAg+WJ+4lOf",
23
+ "replay.js": "sha384-mv7Sg2RyfNP/UTCuS6Vg6QxjvcJIv031WMOz0wKgXjaYTPFzx/8VUTv7MLs/PLDl",
24
+ "toolbar.js": "sha384-5RaMXlQzkpgbv3L9JX67X8YdRd9s5/Kt5usUm4uqC0afaZkXTYbBkdInD2b0ORP3",
25
+ "validation-HGJXZ553.js": "sha384-NmKcVVwg5IWD+ctqpalFATPXleIm4PFPkcQgQ3d/iUILxmjIC8tENjXFPibdEVTX",
26
+ "webmcp.js": "sha384-Vs+fImvLlnbEZtId9H/pA4VXB1bVaxEjOYY+DcAUTN5pXXuNNFOYQfltuj2giALZ"
27
27
  }
28
28
  }
@@ -1 +1 @@
1
- import{a as g,c as v,d as O,e as b,f as P,g as R,i as W,j as D}from"./chunk-UPPUYIIH.js";import"./chunk-EFNCQJI3.js";var x="lc_replay_ack",U=()=>{try{let e=sessionStorage.getItem(x);return e?[e]:[]}catch{return[]}};function $(){let e={status:"awaiting_config",disabledReason:void 0,startReason:void 0,sampleRate:void 0,minDurationMs:void 0,triggers:void 0,matchedGroups:void 0,bufferLength:void 0,flushedBytes:0,confirmed:new Set(U()),rrwebError:void 0,rrwebErrors:0,bufferBytes:void 0,throttled:void 0};return Object.assign(e,{ack(t){if(!e.confirmed.has(t)){e.confirmed.add(t);try{sessionStorage.setItem(x,t)}catch{}}},props(t){let i=e.triggers?.(),r={$recording_status:e.status,$has_recording:e.confirmed.has(t)};e.disabledReason&&(r.$replay_disabled_reason=e.disabledReason),e.startReason&&(r.$session_recording_start_reason=e.startReason),e.sampleRate!==void 0&&(r.$replay_sample_rate=e.sampleRate),e.minDurationMs!==void 0&&(r.$replay_minimum_duration=e.minDurationMs),i&&(r.$replay_url_trigger_status=i.url,r.$replay_event_trigger_status=i.event,r.$replay_linked_flag_trigger_status=i.flag);let d=e.matchedGroups?.();d?.length&&(r.$replay_trigger_groups_matched=d),e.bufferLength&&(r.$replay_buffer_length=e.bufferLength()),e.flushedBytes&&(r.$replay_flushed_size=e.flushedBytes),e.rrwebError&&(r.$replay_rrweb_error=e.rrwebError),e.rrwebErrors&&(r.$replay_rrweb_error_count=e.rrwebErrors);let p=e.bufferBytes?.();p&&(r.$replay_buffer_size=p);let a=e.throttled?.();return a&&(r.$replay_throttled_mutations=a),r}})}var k="lucida_replay_url";function j(e,t,i,r=2e3){let d={},p=()=>{if(!i())return;let s=globalThis,o=t();try{e.intercom&&typeof s.Intercom=="function"&&d.intercom!==o&&(s.Intercom("update",{[k]:o}),d.intercom=o),e.crisp&&typeof s.$crisp?.push=="function"&&d.crisp!==o&&(s.$crisp.push(["set","session:data",[[[k,o]]]]),d.crisp=o)}catch{}};p();let a=setInterval(p,r);return()=>clearInterval(a)}var N=e=>{let t=$();e.eventExtras.push(n=>t.props(n));let i=e.config.replay??{},r=n=>{t.status="disabled",t.disabledReason=n};if(i.enabled===!1)return r("disabled_locally");let d=e.config.replayOwner??i.owner;if(!b(d))return d||console.warn("[lucida] replay is off: Watchtower is already recording this page. Set replayOwner: 'lucida' (or 'both') to record with Lucida too."),r("owner_watchtower");if(navigator.connection?.saveData)return r("data_saver");let a="idle",s,o=0,m=!1,C=location.href,h=()=>e.core.hasConsent("analytics")&&e.core.hasConsent("replay"),y=async n=>{if(a!=="idle")return;if(!h())return r("no_consent");a="starting",t.status="awaiting_config";let u=++o,l=await e.loadConfig(),f=g(l?.replay_never_record,C)||!!n&&g(l?.replay_never_record,location.href),c=f?null:v(i,l);if(u!==o)return void(a="idle");if(!c)return r(f?"never_record_page":"remote_disabled"),void(a="idle");let M=e.core.sessionId,S=c.trigger_groups.length>0,T=!!n?.sampling||S||R(M,"",c.sample_rate);if(t.sampleRate=S?void 0:c.sample_rate,t.minDurationMs=c.min_duration_ms,!T)return t.status="sampled",void(a="idle");t.status="lazy_loading",t.disabledReason=void 0;let{startRecorder:I}=await import("./recorder-4WIMQCLR.js");if(u!==o)return void(a="idle");s=I(e,c,t,n),a="on"},w=()=>{o++,s?.stop(),s=void 0,a="idle"};e.replay={start:async n=>{m=!1;let u=n===!0,l=f=>u||typeof n=="object"&&!!n[f];await y({sampling:n===void 0||l("sampling"),url_trigger:l("url_trigger"),event_trigger:l("event_trigger"),linked_flag:l("linked_flag")})},stop:()=>{m=!0,w(),r("stopped_manually")},pause:()=>s?.pause(),resume:()=>s?.resume(),tag:n=>e.client.capture("$replay_tag",{name:n,session_id:e.core.sessionId}),isRecording:()=>a==="on"&&!s?.paused()},e.core.onChange(n=>{n==="consent"&&(h()?m||y():(w(),r("no_consent")))}),y();let _=i.supportWidgets,E=_?.intercom||_?.crisp?j(_,()=>e.client.getReplayUrl(),()=>a==="on"&&!s?.paused()):void 0;return()=>{o++,s?.stop(),E?.()}};export{P as fnv1a32,b as lucidaRecords,D as pagePrivacy,g as policyMatches,N as replay,v as resolveReplay,R as sampled,O as urlAllowed,W as urlRules};
1
+ import{a as g,c as v,d as O,e as b,f as P,g as R,i as W,j as D}from"./chunk-UPPUYIIH.js";import"./chunk-EFNCQJI3.js";var x="lc_replay_ack",U=()=>{try{let e=sessionStorage.getItem(x);return e?[e]:[]}catch{return[]}};function $(){let e={status:"awaiting_config",disabledReason:void 0,startReason:void 0,sampleRate:void 0,minDurationMs:void 0,triggers:void 0,matchedGroups:void 0,bufferLength:void 0,flushedBytes:0,confirmed:new Set(U()),rrwebError:void 0,rrwebErrors:0,bufferBytes:void 0,throttled:void 0};return Object.assign(e,{ack(t){if(!e.confirmed.has(t)){e.confirmed.add(t);try{sessionStorage.setItem(x,t)}catch{}}},props(t){let i=e.triggers?.(),r={$recording_status:e.status,$has_recording:e.confirmed.has(t)};e.disabledReason&&(r.$replay_disabled_reason=e.disabledReason),e.startReason&&(r.$session_recording_start_reason=e.startReason),e.sampleRate!==void 0&&(r.$replay_sample_rate=e.sampleRate),e.minDurationMs!==void 0&&(r.$replay_minimum_duration=e.minDurationMs),i&&(r.$replay_url_trigger_status=i.url,r.$replay_event_trigger_status=i.event,r.$replay_linked_flag_trigger_status=i.flag);let d=e.matchedGroups?.();d?.length&&(r.$replay_trigger_groups_matched=d),e.bufferLength&&(r.$replay_buffer_length=e.bufferLength()),e.flushedBytes&&(r.$replay_flushed_size=e.flushedBytes),e.rrwebError&&(r.$replay_rrweb_error=e.rrwebError),e.rrwebErrors&&(r.$replay_rrweb_error_count=e.rrwebErrors);let p=e.bufferBytes?.();p&&(r.$replay_buffer_size=p);let a=e.throttled?.();return a&&(r.$replay_throttled_mutations=a),r}})}var k="lucida_replay_url";function j(e,t,i,r=2e3){let d={},p=()=>{if(!i())return;let o=globalThis,s=t();try{e.intercom&&typeof o.Intercom=="function"&&d.intercom!==s&&(o.Intercom("update",{[k]:s}),d.intercom=s),e.crisp&&typeof o.$crisp?.push=="function"&&d.crisp!==s&&(o.$crisp.push(["set","session:data",[[[k,s]]]]),d.crisp=s)}catch{}};p();let a=setInterval(p,r);return()=>clearInterval(a)}var N=e=>{let t=$();e.eventExtras.push(n=>t.props(n));let i=e.config.replay??{},r=n=>{t.status="disabled",t.disabledReason=n};if(i.enabled===!1)return r("disabled_locally");let d=e.config.replayOwner??i.owner;if(!b(d))return d||console.warn("[lucida] replay is off: Watchtower is already recording this page. Set replayOwner: 'lucida' (or 'both') to record with Lucida too."),e.loadConfig(),r("owner_watchtower");if(navigator.connection?.saveData)return r("data_saver");let a="idle",o,s=0,m=!1,C=location.href,h=()=>e.core.hasConsent("analytics")&&e.core.hasConsent("replay"),y=async n=>{if(a!=="idle")return;if(!h())return r("no_consent");a="starting",t.status="awaiting_config";let u=++s,l=await e.loadConfig(),f=g(l?.replay_never_record,C)||!!n&&g(l?.replay_never_record,location.href),c=f?null:v(i,l);if(u!==s)return void(a="idle");if(!c)return r(f?"never_record_page":"remote_disabled"),void(a="idle");let M=e.core.sessionId,S=c.trigger_groups.length>0,T=!!n?.sampling||S||R(M,"",c.sample_rate);if(t.sampleRate=S?void 0:c.sample_rate,t.minDurationMs=c.min_duration_ms,!T)return t.status="sampled",void(a="idle");t.status="lazy_loading",t.disabledReason=void 0;let{startRecorder:I}=await import("./recorder-4WIMQCLR.js");if(u!==s)return void(a="idle");o=I(e,c,t,n),a="on"},w=()=>{s++,o?.stop(),o=void 0,a="idle"};e.replay={start:async n=>{m=!1;let u=n===!0,l=f=>u||typeof n=="object"&&!!n[f];await y({sampling:n===void 0||l("sampling"),url_trigger:l("url_trigger"),event_trigger:l("event_trigger"),linked_flag:l("linked_flag")})},stop:()=>{m=!0,w(),r("stopped_manually")},pause:()=>o?.pause(),resume:()=>o?.resume(),tag:n=>e.client.capture("$replay_tag",{name:n,session_id:e.core.sessionId}),isRecording:()=>a==="on"&&!o?.paused()},e.core.onChange(n=>{n==="consent"&&(h()?m||y():(w(),r("no_consent")))}),y();let _=i.supportWidgets,E=_?.intercom||_?.crisp?j(_,()=>e.client.getReplayUrl(),()=>a==="on"&&!o?.paused()):void 0;return()=>{s++,o?.stop(),E?.()}};export{P as fnv1a32,b as lucidaRecords,D as pagePrivacy,g as policyMatches,N as replay,v as resolveReplay,R as sampled,O as urlAllowed,W as urlRules};
@@ -0,0 +1 @@
1
+ var ve=(e,t)=>()=>(e&&(t=e(e=0)),t);function Ke(e){return e.startsWith("re:")?e.slice(3):e.split("*").map(t=>t.replace(/[.+?^${}()|[\]\\]/g,"\\$&")).join(".*")}function j(e,t){return!!e?.some(n=>{try{return new RegExp(Ke(n),"i").test(t)}catch{return!1}})}var pe=ve(()=>{"use strict"});var be='[data-lc-region="article"]';function K(e,t,n){if(t.articles===!1)return()=>{};let o;e.loadConfig().then(m=>{typeof m?.article_selector=="string"&&(o=m.article_selector)});let i=()=>{for(let m of[t.articleSelector,o,be])if(m)try{let g=document.querySelector(m);if(g)return g}catch{}return null},s=location.href,u=location.pathname,c=null,a=0,l=!1,r=()=>{if(c??=i(),!c)return;let m=c.getBoundingClientRect();if(m.height<=0)return;let g=Math.round(Math.min(100,Math.max(0,(window.innerHeight-m.top)/m.height*100)));a=Math.max(a,g);let v=c.querySelector("h1,h2");v&&v.getBoundingClientRect().bottom<0&&(l=!0)},p=()=>{!c||!n()||(r(),e.client.capture("$article_read",{$article_id:(c.getAttribute("data-lc-article-id")??"").trim().slice(0,200)||u,$article_depth:a,$article_finished:a>=90,$article_headline_exit:!l&&a<25}),c=null)},d=()=>{p(),c=null,a=0,l=!1,s=location.href,u=location.pathname},f=()=>location.href!==s?d():r(),h=new MutationObserver(f);return h.observe(document.documentElement,{childList:!0,subtree:!0}),window.addEventListener("scroll",f,{passive:!0}),e.onUnload(p),r(),()=>{h.disconnect(),window.removeEventListener("scroll",f)}}var T="data-lc-content",Ee="data-lc-content-piece",we="data-lc-content-target";var O=(e,t)=>(e.getAttribute(t)??"").trim().slice(0,200);function G(e,t,n){if(t.contentBlocks===!1||typeof IntersectionObserver>"u")return()=>{};let o=new WeakSet,i=r=>{let p={$content_name:O(r,T)},d=O(r,Ee),f=O(r,we);return d&&(p.$content_piece=d),f&&(p.$content_target=f),p},s=location.href,u=new IntersectionObserver(r=>{for(let p of r)!p.isIntersecting||o.has(p.target)||!n()||(o.add(p.target),e.client.capture("$content_impression",i(p.target)))},{threshold:.5}),c=r=>r.querySelectorAll(`[${T}]`).forEach(p=>u.observe(p));c(document);let a=new MutationObserver(()=>{location.href!==s&&(s=location.href,u.disconnect(),document.querySelectorAll(`[${T}]`).forEach(r=>o.delete(r))),c(document)});a.observe(document.documentElement,{childList:!0,subtree:!0});let l=r=>{let p=r.target?.closest?.(`[${T}]`);p&&n()&&e.client.capture("$content_interaction",{...i(p),$content_interaction_type:"click"})};return document.addEventListener("click",l,!0),()=>{u.disconnect(),a.disconnect(),document.removeEventListener("click",l,!0)}}var ke=new Set(["input","textarea","select","option"]),xe=["name","type","role","aria-label","title","alt","placeholder"],Ce=/(?:\d[ -]?){9,}/;function Re(e){if(ke.has(e.tagName.toLowerCase())||e.isContentEditable)return;let t="";for(let n of Array.from(e.childNodes))n.nodeType===3&&(t+=n.textContent??"");if(t=t.replace(/\s+/g," ").trim(),!(!t||Ce.test(t)))return t.slice(0,255)}function Y(e){if(!e?.length)return()=>!1;let t=e.map(n=>n.toLowerCase());return n=>t.some(o=>o.endsWith("*")?n.startsWith(o.slice(0,-1)):n===o)}var B="***";function w(e){let t={};for(let n=e,o=0;n&&o<10;n=n.parentElement,o++)for(let i of Array.from(n.attributes)){let s=i.name.startsWith("data-lc-attr-")?i.name.slice(13):"";s&&!(s in t)&&!s.startsWith("$")&&(t[s]=i.value.slice(0,255))}return t}function Se(e,t,n,o){let i=e.parentElement,s=i?Array.from(i.children):[e],u={tag_name:e.tagName.toLowerCase(),nth_child:s.indexOf(e)+1,nth_of_type:s.filter(r=>r.tagName===e.tagName).indexOf(e)+1},c=(e.getAttribute("class")??"").split(/\s+/).filter(Boolean);c.length&&!n("class")&&(u.classes=c),e.id&&!n("id")&&(u.attr__id=o("id",e.id));let a=e.getAttribute("href");a&&!n("href")&&(u.href=o("href",a.slice(0,1024)));let l={};for(let r of Array.from(e.attributes))(r.name.startsWith("data-lc-")||xe.includes(r.name))&&!n(r.name)&&(l[r.name]=o(r.name,r.value.slice(0,255)));if(Object.keys(l).length&&(u.attrs=l),t){let r=Re(e);r&&(u.text=r)}return u}function k(e,t,n,o,i={}){let s=[],u=Y(o),c=Y(i.allow),a=i.maskAll?(r,p)=>c(r)?p:B:(r,p)=>p,l=t;for(let r=e;r&&s.length<10;r=r.parentElement)s.push(Se(r,l,u,a)),(r===n||!n)&&(l=!1);return s}var $=e=>e.replace(/(["\\])/g,"\\$1");function x(e){return e.map(t=>{let n=t.tag_name+(t.classes?"."+t.classes.join("."):"")+":";t.attr__id&&(n+=`attr__id="${$(t.attr__id)}"`),t.href&&(n+=`href="${$(t.href)}"`),t.text&&(n+=`text="${$(t.text)}"`);for(let[o,i]of Object.entries(t.attrs??{}))n+=`attr__${o}="${$(i)}"`;return n+`nth-child="${t.nth_child}"nth-of-type="${t.nth_of_type}"`}).join(";")}var b=[],Ae=/^[+\-−–‹›<>«»←→↑↓▲▼▶◀^ˇ˄˅]$/,Me=/\b(increase|decrease|increment|decrement|plus|minus|add one|remove one|next|prev|previous|scroll (left|right))\b/i,Te=/(^|[-_\s])(stepper|spinner|quantity|qty|increment|decrement|inc|dec|plus|minus|carousel|slider|swiper|slick|glide|splide|arrow|next|prev)([-_\s]|$)/i,$e="button,[role=button],a,input[type=button],input[type=submit],[role=spinbutton]";function z(e,t=[]){if(t.length&&e.closest(t.join(","))||e.closest("input[type=number],[role=spinbutton],[role=slider]"))return!0;let n=e.closest($e)??e,o=`${n.getAttribute("aria-label")??""} ${n.getAttribute("title")??""}`;if(Ae.test((n.textContent??"").trim())||Me.test(o))return!0;for(let i=n,s=0;i&&s<3;i=i.parentElement,s++)if(Te.test(i.getAttribute("class")??""))return!0;return!1}var Le=()=>typeof getSelection=="function"?(getSelection()?.toString()??"")!=="":!1;function V(e,t=Date.now(),n={},o){if(o&&n.ignoreSelectors?.length&&o.closest(n.ignoreSelectors.join(",")))return{};if(o&&n.suppressSteppers!==!1&&z(o,n.stepperSelectors))return{};if(n.ignoreTextSelection!==!1&&Le())return{};let i=n.windowMs??1e3,s=n.radiusPx??30;for(b.length&&t<b[b.length-1].t&&(b.length=0),b.push({t,x:e.clientX,y:e.clientY});b.length&&t-b[0].t>i;)b.shift();let u=b.filter(c=>Math.hypot(c.x-e.clientX,c.y-e.clientY)<=s).length;return u>=(n.count??3)?{$rageclick:!0,$rageclick_count:u}:{}}function Q(e,t,n=700){if(typeof MutationObserver>"u")return;let o=!1,i=new MutationObserver(()=>o=!0);i.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,characterData:!0});let s=()=>{o=!0};window.addEventListener("scroll",s,{capture:!0,passive:!0}),document.addEventListener("selectionchange",s);let u=()=>{i.disconnect(),window.removeEventListener("scroll",s,{capture:!0}),document.removeEventListener("selectionchange",s)},c=setTimeout(()=>{u(),!o&&document.visibilityState!=="hidden"&&e.client.capture("$deadclick_hint",{$selector:t,$no_mutation_ms:n})},n);e.onUnload(()=>{clearTimeout(c),u()})}var Z=/^[A-Za-z_][\w-]*$/,Oe=5;function J(e){let t=[];for(let n=e;n&&t.length<Oe;n=n.parentElement){let o=n.tagName.toLowerCase();if(n.id&&Z.test(n.id)){t.unshift(`${o}#${n.id}`);break}let i=(n.getAttribute("class")??"").split(/\s+/).filter(s=>Z.test(s)).slice(0,2);t.unshift(o+i.map(s=>`.${s}`).join(""))}return t.join(" ")}function ee(e,t,n,o,i={}){let s={$selector:J(n),$el_interactive:o};(t.clientX||t.clientY||t.detail)&&(s.$click_x=Math.round(t.clientX+(window.scrollX||0)),s.$click_y=Math.round(t.clientY+(window.scrollY||0))),i.rageClicks!==!1&&!n.closest(".lc-no-rageclick,[data-lc-no-rageclick]")&&Object.assign(s,V(t,Date.now(),i.rageClicks||{},n));let u=i.deadClicks;!o&&t.isTrusted&&u!==!1&&!(u?.ignoreSelectors?.length&&n.closest(u.ignoreSelectors.join(",")))&&Q(e,s.$selector,u?.waitMs);for(let c of e.clickExtras)Object.assign(s,c(t,n));return s}var He="a,button,input,select,textarea,label,summary,[role=button],[role=link],[data-lc-capture]",Ie="[data-lc-ignore]",H=e=>e.some(t=>typeof t=="string"?location.href.includes(t):t.test(location.href)),Pe=e=>!e?.length||H(e),I=e=>({maskAll:e.maskAllAttributes,allow:e.attributeAllowlist}),C=(e,t)=>!!e.closest(Ie)||!!(t.denySelectors?.length&&e.closest(t.denySelectors.join(",")));function te(e,t,n,o=()=>!0){let i=t.events??["click","change","submit"],s=0,u=l=>{let r=l.target;!n()||!o()||l.isComposing||!(r instanceof Element)||C(r,t)||r instanceof HTMLInputElement&&r.type==="password"||(s+=1)},c=l=>r=>{if(!n()||l!=="click"&&!o())return;let p=r.target;if(!(p instanceof Element)||C(p,t)||t.allowSelectors?.length&&!p.closest(t.allowSelectors.join(","))||t.elementAllowlist?.length&&!p.closest(t.elementAllowlist.join(","))||!Pe(t.urlAllowlist)||l==="change"&&!/^(input|select|textarea)$/i.test(p.tagName)||p instanceof HTMLInputElement&&p.type==="password")return;let d=p.closest(He);if(l==="click"&&!d&&!t.allowSelectors?.length)return;let f=k(p,t.captureText??!0,d??void 0,t.attributeIgnore,I(t)),h=f.find(g=>g.text)?.text,m=s;s=0,e.client.capture("$autocapture",{...w(p),$event_type:l,...m>0?{$keystroke_count:m}:{},$elements:f,$elements_chain:x(f),...h?{$el_text:h}:{},...l==="click"?ee(e,r,p,!!d,t):{}})};e.autocaptureClicks=i.includes("click");let a=i.map(l=>[l,c(l)]);for(let[l,r]of a)document.addEventListener(l,r,!0);return document.addEventListener("keydown",u,!0),()=>{for(let[l,r]of a)document.removeEventListener(l,r,!0);document.removeEventListener("keydown",u,!0)}}var je='[contenteditable]:not([contenteditable="false"])',ne="input,textarea,select",Ne=255;function re(e){return e.replace(/\d(?:[ -]?\d){5,}/g,"***").replace(/[^\s@]+@[^\s@]+\.[^\s@]+/g,"***").replace(/\s+/g," ").trim().slice(0,Ne)}var We=e=>e?e instanceof Element?e:e.parentElement:null;function oe(e,t,n,o=()=>!0){let i=t.events??["click","change","submit"],s=t.contentEditable!==!1&&i.includes("change"),u=new WeakSet,c=d=>{let f=k(d,!1,d,t.attributeIgnore,I(t));return{...w(d),$elements:f,$elements_chain:x(f)}},a=d=>{let f=d instanceof Element?d.closest(je):null;return f&&!C(f,t)?f:null},l=d=>{let f=n()&&o()?a(d.target):null;f&&u.add(f)},r=d=>{let f=a(d.target);!f||!u.has(f)||d.relatedTarget instanceof Node&&f.contains(d.relatedTarget)||(u.delete(f),n()&&o()&&e.client.capture("$autocapture",{$event_type:"change",$el_contenteditable:!0,...c(f)}))},p=d=>{if(!n()||!t.copyCut)return;let f=typeof getSelection=="function"?getSelection():null,h=d.target instanceof Element?d.target:null,m=We(f?.anchorNode)??h;if(!m||C(m,t)||m.closest(ne)||h?.closest(ne))return;let g=t.captureCopiedText?re(f?.toString()??""):"";e.client.capture("$copy_autocapture",{$copy_type:d.type,...c(m),...g?{$selected_content:g}:{}})};return s&&(document.addEventListener("input",l,!0),document.addEventListener("focusout",r,!0)),document.addEventListener("copy",p,!0),document.addEventListener("cut",p,!0),()=>{document.removeEventListener("input",l,!0),document.removeEventListener("focusout",r,!0),document.removeEventListener("copy",p,!0),document.removeEventListener("cut",p,!0)}}var De="[data-lc-ignore]",ie=["pdf","zip","gz","tar","rar","7z","doc","docx","xls","xlsx","ppt","pptx","csv","epub","dmg","exe","msi","pkg","apk","iso","mp3","mp4","mov"],ae=["q","s","search","query"],se=e=>e.origin+e.pathname;function le(e,t,n){let o=Array.isArray(t.fileDownloads)?t.fileDownloads.map(s=>s.toLowerCase()):ie,i=[];if(t.outboundLinks!==!1||t.fileDownloads!==!1){let s=u=>{let c=u.target instanceof Element?u.target.closest("a[href]"):null;if(!c||!n()||c.closest(De))return;let a;try{a=new URL(c.href,location.href)}catch{return}if(a.protocol!=="http:"&&a.protocol!=="https:")return;let l=decodeURIComponent(a.pathname.split("/").pop()??""),r=l.includes(".")?l.split(".").pop().toLowerCase():"";t.fileDownloads!==!1&&(c.hasAttribute("download")||o.includes(r))?e.client.capture("$file_download",{$url:se(a),$file_name:l,$file_extension:r}):t.outboundLinks!==!1&&a.host!==location.host&&e.client.capture("$outbound_click",{$url:se(a),$outbound_host:a.host})};document.addEventListener("click",s,!0),i.push(()=>document.removeEventListener("click",s,!0))}if(t.siteSearch!==!1){let s=typeof t.siteSearch=="object"&&t.siteSearch.params?t.siteSearch.params:ae,u=!0;i.push(()=>{u=!1}),e.onCapture(c=>{if(!u||c.event!=="$pageview"||!n())return;let a=new URLSearchParams(location.search);for(let l of s){let r=a.get(l)?.trim();if(r)return void e.client.capture("$site_search",{$search_term:r.slice(0,200),$search_param:l})}})}return()=>i.forEach(s=>s())}function Ue(e,t={}){e.capture("$page_not_found",{$status:404,...t})}var Xe=[25,50,75],Fe="data-lc-media-title";function P(e){let t=e.currentSrc||e.src;if(!t||t.startsWith("blob:")||t.startsWith("data:"))return"";try{let n=new URL(t,location.href);return`${n.origin}${n.pathname}`}catch{return""}}var qe=e=>(e.getAttribute(Fe)??e.getAttribute("title")??e.getAttribute("aria-label")??"").trim().slice(0,200);function ce(e,t,n){if(t.media===!1)return()=>{};let o=new WeakMap,i=a=>{let l={$media_type:a instanceof HTMLVideoElement?"video":"audio",$media_src:P(a)},r=qe(a);return r&&(l.$media_title=r),Number.isFinite(a.duration)&&(l.$media_duration=Math.round(a.duration)),l},s=a=>{let l=P(a);if(!l)return null;let r=o.get(a);return(!r||r.src!==l)&&o.set(a,r={src:l,played:!1,reached:new Set,done:!1}),r},u=a=>{let l=a.target;if(!(l instanceof HTMLMediaElement)||!n())return;let r=s(l);if(r)if(a.type==="play"){if(r.done&&Object.assign(r,{played:!1,reached:new Set,done:!1}),r.played)return;r.played=!0,e.client.capture("$media_play",i(l))}else if(a.type==="timeupdate"){if(!r.played||r.done||!Number.isFinite(l.duration)||l.duration<=0)return;let p=l.currentTime/l.duration*100;for(let d of Xe)p>=d&&!r.reached.has(d)&&(r.reached.add(d),e.client.capture("$media_progress",{...i(l),$media_progress:d}))}else a.type==="ended"&&r.played&&!r.done&&(r.done=!0,e.client.capture("$media_complete",i(l)))},c=["play","timeupdate","ended"];return c.forEach(a=>document.addEventListener(a,u,!0)),()=>c.forEach(a=>document.removeEventListener(a,u,!0))}function ue(e=()=>performance.now()){let t=()=>document.visibilityState!=="hidden",n=0,o=t()?e():null,i=()=>{t()?o===null&&(o=e()):(o!==null&&(n+=e()-o),o=null)};return document.addEventListener("visibilitychange",i),{read:()=>Math.round(n+(o===null?0:e()-o)),reset:()=>{n=0,o=t()?e():null},stop:()=>document.removeEventListener("visibilitychange",i)}}pe();var de=255,Ge=new Set(["input","textarea","select","option"]),Ye="[data-lc-mask],.lc-mask,[data-lc-no-capture],.lc-no-capture,[data-lc-block]",Be=new Set(["value","password","autocomplete"]),ze=/(?:\d[ -]?){9,}/,R=new WeakMap,N=new WeakMap;function fe(e,t){let n=N.get(e);if(n)return new Promise(o=>{let i=setTimeout(o,t);n.then(()=>(clearTimeout(i),o()))})}function me(e){return Array.isArray(e)?e.filter(t=>{if(!t||typeof t!="object")return!1;let n=t;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 Ve(e){if(!e||Ge.has(e.tagName.toLowerCase())||e.isContentEditable)return!1;try{return!e.closest(Ye)}catch{return!1}}function Qe(e,t){if(e.source==="attribute"){let o=(e.attribute??"").toLowerCase();if(!o||Be.has(o)||o.startsWith("on"))return;let i=t.getAttribute(o);return i===null?void 0:i.slice(0,de)}let n=(t.textContent??"").replace(/\s+/g," ").trim();if(!(!n||ze.test(n)))return n.slice(0,de)}function W(e,t,n,o=location.href){let i={};for(let s of e){if(!s.events.includes(t)||s.url&&!j([s.url],o))continue;let u=null;try{u=s.scope==="target"?t==="click"&&n?n.closest(s.selector):null:document.querySelector(s.selector)}catch{continue}if(!Ve(u))continue;let c=Qe(s,u);c!==void 0&&(i[s.name]=c)}return i}function ge(e){let t=!0,n=e.loadConfig().then(o=>{t&&R.set(e,me(o?.snapshot_properties)),N.delete(e)});return N.set(e,n),e.clickExtras.push((o,i)=>t?W(R.get(e)??[],"click",i):{}),()=>{t=!1,R.delete(e)}}function he(e){let t=R.get(e);return t?.length?W(t,"pageview"):{}}function ye(e){return!!R.get(e)?.some(t=>t.events.includes("pageview"))}var Ze=e=>{try{return new URL(e).pathname}catch{return e}};function Je(e){for(let t of e===void 0?[]:Array.isArray(e)?e:[e])try{let n=document.querySelector(t);if(n)return n}catch{}}function _e(e){let t=0,n=0,o=()=>{let i=Je(e),s=document.documentElement,u=i?i.scrollHeight:Math.max(s.scrollHeight,document.body?.scrollHeight??0),c=i?i.scrollTop:window.scrollY||window.pageYOffset||0,a=Math.min(u,c+(i?i.clientHeight:window.innerHeight));a>t&&(t=a,n=u>0?Math.min(100,Math.round(a/u*100)):0)};return o(),window.addEventListener("scroll",o,{passive:!0,capture:!0}),window.addEventListener("resize",o,{passive:!0}),{read:()=>({pct:n,px:t}),stop:()=>{window.removeEventListener("scroll",o,{capture:!0}),window.removeEventListener("resize",o)}}}var et=800,tt=e=>e.core.hasConsent("analytics")||e.core.consent.resolving;function nt(e){return e==="history"?{path:!0,search:!0}:e==="hash"?{path:!0,search:!0,hash:!0}:typeof e=="object"?e:void 0}function rt(e,t,n){try{let o=new URL(e),i=new URL(t);return!!(n.path&&o.pathname!==i.pathname||n.search&&o.search!==i.search||n.hash&&o.hash!==i.hash)}catch{return e!==t}}function L(e,t,n={}){let o=n.views??!0,i=n.leave??!0,s=nt(t),u=e.config.scrollRoot,c=location.href,a=c,l=Date.now(),r=_e(u),p=ue(),d,f=()=>{if(!i||d===c)return;d=c;let{pct:y,px:E}=r.read();e.client.capture("$pageleave",{$current_url:c,$scroll_depth:y,$scroll_depth_px:E,$engagement_time_ms:p.read()})},h=!1,m=(y,E={})=>{if(!o)return;let{core:_}=e;if(!_.hasConsent("analytics")&&!_.anonymousOnReject&&!(_.consent.pending&&_.consent.queueBeforeConsent)){if(!h){h=!0;let A=()=>{h&&(h=!1,m())};e.whenConsented(A),_.onChange(M=>{M==="consent"&&_.anonymousOnReject&&A()})}return}e.client.capture("$pageview",{...he(e),...y===void 0?{}:{$referrer:y},...E})},g,v=()=>{let y=g;g=void 0,y?.()},S=y=>{if(location.href===a)return;let E=a;if(a=location.href,!s||!rt(E,a,s))return;let _=c;f(),r.stop();let A=new Date(l);c=location.href,l=Date.now(),r=_e(u),p.reset();let M={$navigation_type:y,$prev_pageview_pathname:Ze(_),$prev_pageview_duration:Math.round((l-A.getTime())/100)/10};ye(e)?setTimeout(()=>m(_,M),0):(v(),g=()=>m(_,M),queueMicrotask(v))};e.onUnload(f);let D=tt(e)?fe(e,et):void 0;if(D?(g=()=>m(),e.onUnload(v),D.then(v)):m(),!s)return()=>(r.stop(),p.stop());let{pushState:U,replaceState:X}=history;history.pushState=function(...y){v(),U.apply(this,y),S("pushState")},history.replaceState=function(...y){v(),X.apply(this,y),S("replaceState")};let F=()=>S("popstate"),q=()=>S("hashchange");return window.addEventListener("popstate",F),s.hash&&window.addEventListener("hashchange",q),()=>{window.removeEventListener("hashchange",q),history.pushState=U,history.replaceState=X,window.removeEventListener("popstate",F),r.stop(),p.stop()}}var Wt=e=>{let t=[],n=e.config.autocapture,o=!1,i=!1;if(n!==!1){let c=typeof n=="object"?n:{},a=()=>!o&&!(c.urlIgnorelist?.length&&H(c.urlIgnorelist)),l=()=>!i;t.push(te(e,c,a,l),oe(e,c,a,l),le(e,c,a),G(e,c,a),K(e,c,a),ce(e,c,a),ge(e)),n===void 0&&e.loadConfig().then(r=>o=r?.autocapture===!1),e.loadConfig().then(r=>i=r?.autocapture_inputs===!1)}let s=e.config.capturePageview??"history",u=e.config.capturePageleave??"if_capture_pageview";return s!==!1&&u!==!1?t.push(L(e,s)):s!==!1?t.push(L(e,s,{leave:!1})):u===!0&&t.push(L(e,"history",{views:!1})),()=>t.forEach(c=>c())};export{ie as DOWNLOAD_EXTENSIONS,B as MASKED,ae as SEARCH_PARAMS,w as attrProps,Wt as autocapture,k as buildChain,x as chainToString,J as cssSelector,z as isStepper,re as maskCopied,P as mediaSrc,W as readSnapshot,me as snapshotRules,Ue as tag404};
@@ -0,0 +1,3 @@
1
+ var Y="lc_consent";function he(n,e,t){return e==="opt_in"?"opt_in":t==="opt_in"||t==="opt_out"||t==="cookieless"?t:e==="opt_out"?n:void 0}var ge=["analytics","replay","marketing"],L=class{constructor(e){this.o=e;this.modeNow=e.mode??"opt_out",this.queueBeforeConsent=e.queueBeforeConsent??!1;let t=this.opens();this.state={analytics:t,replay:t,marketing:t},this.key=e.storageKey||Y;let s=e.storage.get(this.key);if(s)try{let o=JSON.parse(s);for(let i of ge)typeof o[i]=="boolean"&&(this.state[i]=o[i]);this.decided=ge.some(i=>typeof o[i]=="boolean")}catch{}this.waiting=!!e.awaitRemote&&!this.decided,this.waiting&&(this.state={analytics:!1,replay:!1,marketing:!1})}o;modeNow;queueBeforeConsent;state;decided=!1;waiting;geoCookieless=!1;key;listeners=[];opens(){return this.modeNow==="opt_out"&&!(this.o.respectDnt&&this.o.dnt)}get mode(){return this.modeNow}get resolving(){return this.waiting}get anonymous(){return this.geoCookieless&&!this.decided}resolve(e){if(!this.waiting)return this.state.analytics;this.waiting=!1,(e==="opt_in"||e==="opt_out")&&(this.modeNow=e),this.geoCookieless=e==="cookieless";let t=!this.geoCookieless&&this.opens();return this.state={analytics:t,replay:t,marketing:t},t}get(){return{...this.state}}has(e){return this.state[e]}status(e="analytics"){return this.decided?this.state[e]?"granted":"denied":"pending"}get pending(){return this.waiting||this.modeNow==="opt_in"&&!this.state.analytics}set(e){let t=this.get();for(let s of ge)e[s]!==void 0&&(this.state[s]=e[s]);this.decided=!0,this.waiting=!1,this.o.storage.set(this.key,JSON.stringify(this.state));for(let s of this.listeners)s(this.get(),t)}onChange(e){this.listeners.push(e)}},$=class{constructor(e,t){this.inner=e;this.allowed=t}inner;allowed;mem=new Map;get(e){return this.mem.has(e)?this.mem.get(e)??null:this.inner.get(e)}set(e,t){this.allowed()?this.inner.set(e,t):this.mem.set(e,t)}remove(e){this.allowed()?this.inner.remove(e):this.mem.set(e,null)}flushBuffered(){for(let[e,t]of this.mem)t===null?this.inner.remove(e):this.inner.set(e,t);this.mem.clear()}discardBuffered(){this.mem.clear()}};var J=0,R=0;function He(n){let e=new Uint8Array(n),t=globalThis.crypto;if(t?.getRandomValues)t.getRandomValues(e);else for(let s=0;s<n;s++)e[s]=Math.floor(Math.random()*256);return e}function C(n=Date.now()){if(n>J){J=n;let i=He(2);R=((i[0]??0)<<8|(i[1]??0))&1023}else R++,R>4095&&(J++,R=0);let e=He(8),t=new Uint8Array(16),s=J;t[0]=Math.floor(s/2**40)&255,t[1]=Math.floor(s/2**32)&255,t[2]=Math.floor(s/2**24)&255,t[3]=Math.floor(s/2**16)&255,t[4]=Math.floor(s/2**8)&255,t[5]=s&255,t[6]=112|R>>8,t[7]=R&255,t[8]=128|(e[0]??0)&63;for(let i=1;i<8;i++)t[8+i]=e[i]??0;let o=Array.from(t,i=>i.toString(16).padStart(2,"0")).join("");return`${o.slice(0,8)}-${o.slice(8,12)}-${o.slice(12,16)}-${o.slice(16,20)}-${o.slice(20)}`}var We="lc_identity",Q=class{constructor(e,t,s=!1,o=!1){this.storage=e;this.cookieless=s;let i=e.get(We),a;try{a=i?JSON.parse(i):void 0}catch{a=void 0}if(a?.distinct_id)this.s=a;else if(s)this.s={distinct_id:"",anon_id:"",identified:!1};else{let d=t??C();this.s={distinct_id:d,anon_id:d,identified:o&&!!t},this.save()}}storage;cookieless;s;save(){this.storage.set(We,JSON.stringify(this.s))}get distinctId(){return this.s.distinct_id}get priorAnonId(){return this.s.identified&&this.s.anon_id&&this.s.anon_id!==this.s.distinct_id?this.s.anon_id:void 0}get isIdentified(){return this.s.identified}identify(e){if(!e||e===this.s.distinct_id)return e&&!this.s.identified&&(this.s.identified=!0,this.save()),{event:null};let t=this.s.distinct_id,s=!this.s.identified;return this.s={...this.s,distinct_id:e,identified:!0},this.save(),s&&t?{event:"$identify",anonDistinctId:t}:{event:"$identify"}}aliasProps(e,t){return{alias:e,distinct_id:t??this.s.distinct_id}}reset(e=!1){if(this.cookieless){this.s={distinct_id:"",anon_id:"",identified:!1};return}let t=e&&this.s.anon_id||C();this.s={distinct_id:t,anon_id:t,identified:!1},this.save()}};function F(n,e={}){let t=Math.min(e.maxMs??3e4,(e.baseMs??1e3)*2**n);return Math.round(t*(.5+.5*(e.random??Math.random)()))}function Ve(n){return n===0||n===408||n===429||n>=500}var X=class{constructor(e){this.o=e;this.flushAt=e.flushAt??20,this.intervalMs=e.flushIntervalMs??5e3,this.maxSize=e.maxQueueSize??1e3,this.maxRetries=e.maxRetries??5,this.batchMax=Math.max(1,Math.min(e.maxBatchSize??1e3,1e3))}o;items=[];timer;attempt=0;inflight;closed=!1;warned404=!1;flushAt;intervalMs;maxSize;maxRetries;batchMax;get size(){return this.items.length}enqueue(e){this.closed||(this.items.push(e),this.items.length>this.maxSize&&this.o.onDrop?.(this.items.splice(0,this.items.length-this.maxSize),"queue_full"),this.items.length>=this.flushAt?this.flush():this.arm(this.intervalMs))}arm(e){this.timer===void 0&&(this.timer=setTimeout(()=>{this.timer=void 0,this.flush()},e))}disarm(){this.timer!==void 0&&clearTimeout(this.timer),this.timer=void 0}flush(e={}){if(this.disarm(),this.inflight)return this.inflight.then(()=>this.items.length?this.flush(e):void 0);if(!this.items.length)return Promise.resolve();let t=this.items.splice(0,this.batchMax),s=(this.o.clock??Date).now(),o=JSON.stringify({api_key:this.o.apiKey,batch:t,sent_at:new Date(s).toISOString()});this.o.log?.("send batch",t.length);let i=this.o.transport.send(this.o.url,o,e.beacon?{beacon:!0}:{}).then(a=>a,()=>({status:0,retryAfterMs:void 0})).then(a=>this.settle(t,a.status,!!e.beacon,a.retryAfterMs)).finally(()=>{this.inflight=void 0});return this.inflight=i,i}settle(e,t,s,o){if(t>=200&&t<300){this.attempt=0,this.items.length>=this.flushAt?this.flush():this.items.length&&this.arm(this.intervalMs);return}if(!Ve(t)||s||this.attempt>=this.maxRetries){t===404&&!this.warned404&&(this.warned404=!0,console.warn(`[lucida] ${this.o.url} returned 404, so events are being dropped. apiHost is probably wrong: use https://capture.lucidace.com (or your own capture host), not the app host.`)),this.o.onDrop?.(e,`status_${t}`),this.attempt=0;return}this.items.unshift(...e);let i=Math.max(F(this.attempt++,this.o.backoff),Math.min(o??0,6e4));this.o.log?.("retry in",i,"ms"),this.arm(i)}clear(){this.items=[],this.disarm()}async shutdown(){await this.flush(),this.closed=!0,this.disarm()}};var me="lc_session";function ze(n,e,t){return typeof n=="number"&&Number.isInteger(n)&&n>=e&&n<=t?n*6e4:void 0}var Tt=6e4,Mt=10*36e5,jt=24*36e5,Dt=/^([0-9a-f]{8})-?([0-9a-f]{4})-7[0-9a-f]{3}-/i;function Lt(n,e){let t=Dt.exec(n);if(!t)return!0;let s=parseInt(t[1]+t[2],16);return s-e<=6e4&&e-s<=jt}var Z=class{constructor(e,t={}){this.storage=e;this.o=t;this.idleMs=Math.min(Mt,Math.max(Tt,t.idleMs??30*6e4)),this.maxMs=t.maxMs??24*36e5,this.newOn=t.newOnEvents??[],this.clock=t.clock??{now:()=>Date.now()},this.bootstrapId=t.bootstrapId}storage;o;windowId=C();idleMs;maxMs;newOn;clock;bootstrapId;configure(e){this.o.idleMs===void 0&&(this.idleMs=ze(e.session_idle_minutes,1,600)??this.idleMs),this.o.maxMs===void 0&&(this.maxMs=ze(e.session_max_minutes,5,10080)??this.maxMs),this.o.newOnEvents===void 0&&Array.isArray(e.session_new_on_events)&&(this.newOn=e.session_new_on_events.filter(t=>typeof t=="string"&&t!==""))}read(){try{let e=this.storage.get(me);return e?JSON.parse(e):void 0}catch{return}}touch(e,t){let s=this.clock.now(),o=this.read(),i=!!(o?.campaign&&e&&o.campaign!==e),a=t!==void 0&&this.newOn.includes(t),d=!o||Math.abs(s-o.last)>this.idleMs||Math.abs(s-o.start)>this.maxMs||i||a;return(d||!o)&&(o={id:!o&&this.bootstrapId&&Lt(this.bootstrapId,s)?this.bootstrapId:C(s),start:s,last:s}),this.bootstrapId=void 0,o.last=s,e&&(o.campaign=e),this.storage.set(me,JSON.stringify(o)),{sessionId:o.id,windowId:this.windowId,isNew:d}}startedAt(){return this.read()?.start}reset(){this.storage.remove(me)}};function Ke(n,e){let t=n.get(e);if(t)try{return JSON.parse(t)}catch{return}}var ee=class{constructor(e,t="lc_props",s){this.storage=e;this.key=t;this.persist=s;this.p=Ke(e,t)??{}}storage;key;persist;p;save(){let e=this.persist;this.storage.set(this.key,JSON.stringify(e?Object.fromEntries(Object.entries(this.p).filter(([t])=>e(t))):this.p))}register(e){Object.assign(this.p,e),this.save()}registerOnce(e){for(let[t,s]of Object.entries(e))t in this.p||(this.p[t]=s);this.save()}unregister(e){delete this.p[e],this.save()}all(){return{...this.p}}clear(){this.p={},this.storage.remove(this.key)}},te=class{constructor(e){this.storage=e;this.g=Ke(e,"lc_groups")??{}}storage;g;set(e,t){this.g[e]=t,this.storage.set("lc_groups",JSON.stringify(this.g))}all(){return Object.keys(this.g).length?{...this.g}:void 0}clear(){this.g={},this.storage.remove("lc_groups")}};function Ft(n,e){let t=new Date(n??e);return(Number.isNaN(t.getTime())?new Date(e):t).toISOString()}var N=class{constructor(e){this.c=e;this.clock=e.clock??{now:()=>Date.now()},this.consent=new L({...e.consent,storage:e.consentStorage??e.storage}),this.gated=new $(e.storage,()=>this.consent.has("analytics")),this.storage=this.gated,this.identity=new Q(this.gated,e.bootstrapDistinctId,e.cookieless,e.bootstrapIdentified),this.session=new Z(this.gated,{clock:this.clock,...e.session}),this.props=new ee(this.gated,void 0,e.persistProperty),this.groupState=new te(this.gated),this.queue=new X({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")||C(),this.gated.set("lc_device_id",this.device)),this.device)}get groups(){return this.groupState.all()}get sessionId(){return this.touchSession().sessionId}touchSession(e){let t=this.session.touch(this.c.campaignKey?.(),e);if(t.sessionId!==this.lastSession){this.lastSession=t.sessionId;for(let s of this.sessionListeners)s(t.sessionId,t.windowId)}return t}onSessionId(e){return this.sessionListeners.push(e),()=>{this.sessionListeners.splice(this.sessionListeners.indexOf(e),1)}}get sessionStart(){return this.session.startedAt()}getProperty(e){return this.props.all()[e]}setFilter(e){this.filter=e}onChange(e){this.listeners.push(e)}onCaptured(e){this.captureListeners.push(e)}emit(e){for(let t of this.listeners)t(e)}consentStatus(){return this.consent.status()}get anonymousOnReject(){return!!this.c.consent?.cookielessOnReject&&this.consent.status()==="denied"}capture(e,t={},s={}){let o=this.consent.has("analytics"),i=!o&&(this.anonymousOnReject||this.consent.anonymous),a=this.consent.pending&&(this.consent.queueBeforeConsent||this.consent.resolving);if(!o&&!i&&!a){this.c.log?.("dropped (no consent)",e);return}if(i&&(e==="$identify"||e==="$create_alias")){this.c.log?.("withheld (declined, anonymous mode)",e);return}let d=this.touchSession(e),p=this.c.enrich?.(e,t),h=this.consent.status()!=="pending",m=i?{}:{...p?.$set,...s.$set,...e==="$consent_updated"&&h?{$consent:this.consent.get()}:{}},_=i?{}:{...p?.$set_once,...s.$set_once},P=this.groupState.all(),g=i?"":this.identity.distinctId,v={uuid:C(this.clock.now()),event:e,...g?{distinct_id:g}:{},timestamp:Ft(s.timestamp,this.clock.now()),properties:{...this.props.all(),...p?.properties,...t,$session_id:d.sessionId,$window_id:d.windowId,$lib:this.c.library.name,$lib_version:this.c.library.version,...h?{$consent:this.consent.get()}:{}},...Object.keys(m).length?{$set:m}:{},...Object.keys(_).length?{$set_once:_}:{},...!i&&s.$unset?.length?{$unset:s.$unset}:{},...P?{$groups:P}:{}},b=this.filter?this.filter(v):v;if(!b){this.c.log?.("dropped (policy)",e);return}this.c.log?.("capture",e,b),this.c.onCapture?.(b);for(let S of this.captureListeners)S(b);return o||i?this.queue.enqueue(b):this.pre.length<(this.c.queue?.maxQueueSize??1e3)&&this.pre.push(b),b}identify(e,t,s){let o=this.identity.identify(e);(o.event||t||s)&&this.capture("$identify",o.anonDistinctId?{$anon_distinct_id:o.anonDistinctId}:{},{...t?{$set:t}:{},...s?{$set_once:s}:{}}),this.emit("identify")}alias(e,t){this.capture("$create_alias",this.identity.aliasProps(e,t))}reset(e={}){this.identity.reset(e.reuseAnonymousId),e.resetDeviceId&&(this.device=void 0,this.gated.remove("lc_device_id")),this.props.clear(),this.groupState.clear(),this.session.reset(),this.lastSession="",this.emit("reset")}register(e){this.props.register(e)}registerOnce(e){this.props.registerOnce(e)}unregister(e){this.props.unregister(e)}group(e,t,s){this.groupState.set(e,t),this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:s??{}}),this.emit("group")}getConsent(){return this.consent.get()}getConsentStatus(e="analytics"){return this.consent.status(e)}hasConsent(e){return this.consent.has(e)}setConsent(e){let t=this.consent.has("analytics"),s=e.analytics??t;if(t&&!s&&(this.capture("$opt_out"),this.queue.flush()),!t&&s&&(this.anonymousOnReject||this.consent.anonymous)&&this.queue.flush(),this.consent.set(e),!t&&s){this.gated.flushBuffered();for(let o of this.pre.splice(0))this.queue.enqueue(o);this.capture("$opt_in")}else t&&!s&&this.queue.clear();s||(this.pre.length=0),this.emit("consent")}applyRemote(e){this.session.configure(e),this.resolveConsent(he(this.consent.mode,e.consent_mode,e.consent_default))}resolveConsent(e){if(!this.consent.resolving)return;let t=this.consent.resolve(e),s=this.pre.splice(0);if(t){this.gated.flushBuffered();for(let o of s)this.queue.enqueue(o)}else if(this.consent.anonymous){this.gated.discardBuffered();for(let o of s){if(o.event==="$identify"||o.event==="$create_alias")continue;let i={...o};delete i.distinct_id,delete i.$set,delete i.$set_once,delete i.$unset,this.queue.enqueue(i)}}else this.consent.queueBeforeConsent&&this.pre.push(...s);this.emit("consent")}optIn(){this.setConsent({analytics:!0,replay:!0,marketing:!0})}optOut(){this.setConsent({analytics:!1,replay:!1,marketing:!1})}flush(e){return this.queue.flush(e)}shutdown(){return this.queue.shutdown()}};function Ge(n){let e="";return t=>{for(e+=t;;){let s=/\r?\n\r?\n/.exec(e);if(!s)return;let o=e.slice(0,s.index);e=e.slice(s.index+s[0].length);let i="message",a,d=[];for(let p of o.split(/\r?\n/)){if(p.startsWith(":"))continue;let h=p.indexOf(":"),[m,_]=h<0?[p,""]:[p.slice(0,h),p.slice(h+1).replace(/^ /,"")];m==="event"?i=_??"":m==="data"?d.push(_??""):m==="id"&&(a=_)}d.length&&n(a===void 0?{event:i,data:d.join(`
2
+ `)}:{event:i,data:d.join(`
3
+ `),id:a})}}}var ne=class{constructor(e){this.o=e}o;ctl;stopped=!0;timer;cursor=0;gen=0;polling=!1;start(){this.stopped&&(this.stopped=!1,this.loop(++this.gen))}stop(){this.stopped=!0,this.gen++,this.ctl?.abort(),this.timer&&clearTimeout(this.timer)}restart(){let e=!this.stopped;this.stop(),this.cursor=0,e&&this.start()}live(e){return!this.stopped&&e===this.gen}deliver(e){if(e.seq>this.cursor){this.cursor=e.seq;try{this.o.onIntervention(e)}catch(t){this.o.log?.("onIntervention threw",t)}}}url(e){let t=`distinct_id=${encodeURIComponent(this.o.distinctId())}${this.cursor?`&cursor=${this.cursor}`:""}`;return`${this.o.apiHost}${e}?${t}`}sleep(e){return new Promise(t=>{this.timer=setTimeout(t,e),this.timer.unref?.()})}async loop(e){let t=0;for(;this.live(e);){let s;try{let o=await this.connectOnce(e);if(o==="gone")return this.stop();o==="poll"?(t=0,s=this.o.pollMs??15e3):(o==="streamed"&&(t=0),s=F(t++,this.o.backoff))}catch(o){this.live(e)&&this.o.log?.("intervention stream error",o),s=F(t++,this.o.backoff)}if(!this.live(e))return;await this.sleep(s)}}async connectOnce(e){if(this.polling)return this.pollOnce(e);this.ctl=new AbortController;let t={Authorization:`Bearer ${this.o.apiKey}`,Accept:"text/event-stream"},s=await this.o.fetch(this.url("/v1/interventions/stream"),{headers:t,signal:this.ctl.signal});if(s.status===404)return"gone";if(!s.ok)return"failed";let o=s.body;if(!o||typeof TextDecoderStream>"u")return this.ctl.abort(),this.polling=!0,this.pollOnce(e);let i=Ge(d=>{if(!(d.event!=="intervention"||!this.live(e)))try{this.deliver(JSON.parse(d.data))}catch{this.o.log?.("bad intervention payload")}}),a=o.pipeThrough(new TextDecoderStream).getReader();for(;;){let{done:d,value:p}=await a.read();if(d)return"streamed";i(p)}}async pollOnce(e){this.ctl=new AbortController;let t=await this.o.fetch(this.url("/v1/interventions"),{headers:{Authorization:`Bearer ${this.o.apiKey}`},signal:this.ctl.signal});if(t.status===404)return"gone";if(!t.ok)return"failed";let s=await t.json();if(this.live(e))for(let o of s.data??[])this.deliver(o);return"poll"}};function ye(n,e){let t=new Set,{whenConsented:s,disabled:o,...i}=e,a=new ne({...i,distinctId:()=>n.distinctId,onIntervention:p=>{for(let h of[...t])h(p)}}),d=!1;return n.onChange(p=>{d&&((p==="identify"||p==="reset")&&a.restart(),p==="consent"&&(n.hasConsent("analytics")?a.start():a.stop()))}),{on(p){return t.add(p),!d&&!o&&(d=!0,s(()=>a.start())),()=>{t.delete(p)}},stop:()=>a.stop()}}function ve(n,e,t={}){let s=t.key??"lc_offline",o=t.maxBatches??50,i=t.maxBytes??1e6,a=t.isOnline??(()=>!0),d,p,h=()=>{try{let g=JSON.parse(e.get(s)??"[]");return Array.isArray(g)?g:[]}catch{return[]}},m=g=>{let v=g.reduce((b,S)=>b+S.body.length,0);for(;g.length>o||v>i&&g.length>1;)v-=g.shift().body.length;g.length?e.set(s,JSON.stringify(g)):e.remove(s)},_=g=>{m([...h(),...g]),d??=setTimeout(()=>{d=void 0,P.drain()},t.retryMs??3e4)},P={async send(g,v,b){if(!a())return _([{url:g,body:v}]),{status:200};let S=await n.send(g,v,b);return S.status!==0?S:(_([{url:g,body:v}]),{status:200})},drain(){return p??=(async()=>{let g=h();if(!g.length||!a())return;e.remove(s);let v=[];for(let[b,S]of g.entries())if((await n.send(S.url,S.body)).status===0){v.push(...g.slice(b));break}v.length&&_(v)})().finally(()=>{p=void 0}),p}};return P}function be(n){let e=Object.keys(n);if(e.length===0)return{};let t={};for(let s of e)t[`$feature/${s}`]=n[s];return t.$active_feature_flags=e.filter(s=>n[s]!==!1).sort(),t}function B(n,e,t,s){return{key:n,value:e,enabled:e!==void 0&&e!==!1,...typeof e=="string"?{variant:e}:{},...t!==void 0?{payload:t}:{},reason:e===void 0?"not_found":s}}var A={started:"$ai_conversation_started",message:"$ai_message",feedback:"$ai_feedback",ended:"$ai_conversation_ended",outcome:"$ai_outcome"},Nt=["resolved","unresolved","escalated","abandoned","error"],Bt=4e3,Ut=2e3,Je=["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"],Qe=["thanks","thank you","great","perfect","awesome","helpful","that worked","works now","solved","exactly"],H=n=>Array.from(n),Se=(n,e)=>H(n).slice(0,e).join(""),qt=0xcbf29ce484222325n,Ht=0x100000001b3n,Wt=0xffffffffffffffffn,Vt=new TextEncoder;function zt(n){let e=qt;for(let t of Vt.encode(n))e=(e^BigInt(t))*Ht&Wt;return e}function Xe(n){let e=(n.toLowerCase().match(/[\p{L}\p{N}]+/gu)??[]).filter(o=>H(o).length>=2);if(!e.length)return;let t=new Array(64).fill(0);for(let o of e){let i=zt(o);for(let a=0;a<64;a++)t[a]=(t[a]??0)+((i>>BigInt(a)&1n)===1n?1:-1)}let s=0n;for(let o=0;o<64;o++)(t[o]??0)>0&&(s|=1n<<BigInt(o));return s.toString(16).padStart(16,"0")}function Ze(n){let t=` ${n.toLowerCase().replace(/’/g,"'").replace(/[.,!?;:]/g," ").replace(/\s+/g," ").trim()} `,s=0;for(let i of Je)t.includes(` ${i} `)&&(s++,t=t.split(` ${i} `).join(" "));let o=Qe.filter(i=>t.includes(` ${i} `)).length;return s>o?-1:o>s?1:0}var et=n=>H(n).filter(e=>e>="0"&&e<="9").map(Number);function Kt(n){let e=et(n);if(e.length<13||e.length>19)return!1;let t=0;return e.reverse().forEach((s,o)=>t+=o%2===1?s>4?s*2-9:s*2:s),t%10===0}var Ye=String.raw`[\p{Alphabetic}\p{M}\p{Nd}\p{Pc}\p{Join_Control}]`,Gt=[[new RegExp(String.raw`(?<!${Ye})\p{Nd}(?:[ -]?\p{Nd}){12,18}(?!${Ye})`,"gu"),Kt],[/[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,Yt]];function Yt(n){let e=et(n).length;return e>=10&&e<=15}var Jt=n=>H(n).map(e=>/\s/u.test(e)?e:"*").join("");function we(n){let e=n;for(let[t,s]of Gt)e=e.replace(t,o=>s(o)?Jt(o):o);return e===n?void 0:e}function tt(n){if(typeof n!="string")return;let e=n.toLowerCase();return/^[0-9a-f]{32}$/.test(e)?e:void 0}var nt=n=>typeof n=="string"&&Nt.includes(n)?n:void 0,U=(n,e)=>typeof n=="string"&&n?Se(n,e):void 0;function Qt(n,e,t){let s=Se(e,t),o=we(s);return o===void 0?{[n]:s}:{[n]:o,$ai_text_redacted:!0}}function st(n,e,t,s){if(n!=="user"&&n!=="assistant")return;let o={$ai_role:n,$ai_message_index:t,$ai_text_length:H(e).length};if(n==="user"){let i=Xe(e);i!==void 0&&(o.$ai_text_hash=i),o.$ai_sentiment=Ze(e)}return s?{...o,...Qt("$ai_text",e,Bt)}:o}function ot(n,e){let t=n.value;if(n.kind==="thumbs"&&t!==1&&t!==-1||n.kind==="rating"&&!(Number.isInteger(t)&&t>=1&&t<=5)||n.kind!=="thumbs"&&n.kind!=="rating"&&n.kind!=="comment")return;let s={$ai_feedback_kind:n.kind};if(n.kind!=="comment"&&(s.$ai_feedback_value=t),n.comment&&e){let o=Se(n.comment,Ut);s.$ai_feedback_comment=we(o)??o}return n.messageIndex!==void 0&&(s.$ai_message_index=n.messageIndex),s}function _e(n,e){let t=nt(n),s=U(e,64);return{...t?{$ai_outcome:t}:{},...s?{$ai_resolution:s}:{}}}function Xt(){let n=globalThis.crypto,e=new Uint8Array(16);if(n?.getRandomValues)n.getRandomValues(e);else for(let s=0;s<16;s++)e[s]=Math.floor(Math.random()*256);e[6]=(e[6]??0)&15|64,e[8]=(e[8]??0)&63|128;let t=Array.from(e,s=>s.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}function rt(n={}){let e={$ai_conversation_id:n.conversationId||Xt()},t=(s,o)=>{o!==void 0&&(e[s]=o)};return t("$ai_agent_name",U(n.agentName,128)),t("$ai_agent_version",U(n.agentVersion,64)),t("$ai_topic",U(n.topic,128)),t("$ai_use_case",U(n.useCase,128)),t("$ai_trace_id",tt(n.traceId)),e}var q=class{next=0;common;emit;captureText;constructor(e,t={},s=!1){this.emit=e,this.captureText=s,this.common=rt(t)}get id(){return this.common.$ai_conversation_id}send(e,t){this.emit(e,{...this.common,...t})}start(){return this.send(A.started,{}),this}message(e,t,s={}){let o=s.index??this.next,i=st(e,t,o,this.captureText);return i?(this.next=o+1,this.send(A.message,i),!0):!1}feedback(e){let t=ot(e,this.captureText);return t?(this.send(A.feedback,t),!0):!1}end(e,t){this.send(A.ended,_e(e,t))}outcome(e,t){let s=_e(e,t);return s.$ai_outcome?(this.send(A.outcome,s),!0):!1}};var Zt=["bot","crawl","spider","slurp","headlesschrome","phantomjs","puppeteer","playwright","lighthouse","pingdom","uptimerobot","facebookexternalhit","preview","scrapy","python-requests","go-http-client","cypress","lightpanda","hubspot","nessus","prerender","deepscan","screaming frog","sitebulb","turnitin","ia_archiver","chatgpt-user","app.hypefactors.com","google favicon","google web preview","-google","googleother","googleweblight","google-read-aloud","google-inspectiontool","google-hoteladsverifier","google-cloudvertexbot"];function it(n,e=[]){let t=n.toLowerCase();return e.some(s=>s&&t.includes(s.toLowerCase()))?!0:Zt.some(s=>t.includes(s))&&!/\bcubot\b/.test(t)}var O=["gclid","gad_source","gclsrc","dclid","gbraid","wbraid","fbclid","igshid","msclkid","ttclid","li_fat_id","twclid","mc_cid","rdt_cid","epik","qclid","sccid","oppref","bfcid","irclid","_kx"],at="lc_click_ids";function ct(n,e=90,t=Date.now){let s,o=()=>{try{return JSON.parse(n.get(at)??"{}")}catch{return{}}};return()=>{let i=o();if(location.search!==s){s=location.search;let d=new URLSearchParams(s),p=!1;for(let h of O){let m=d.get(h);m&&(i[h]={v:m.slice(0,512),t:t()},p=!0)}p&&n.set(at,JSON.stringify(i))}let a={};for(let d of O){let p=i[d];p&&t()-p.t<e*864e5&&(a[d]=p.v)}return a}}function en(){return Array.from(document.querySelectorAll("meta[http-equiv]")).filter(n=>n.getAttribute("http-equiv")?.toLowerCase()==="content-security-policy").map(n=>n.getAttribute("content")??"")}function tn(n){let e=new Map;for(let s of n.split(";")){let[o,...i]=s.trim().toLowerCase().split(/\s+/);o&&!e.has(o)&&e.set(o,i)}let t=e.get("style-src-elem")??e.get("style-src")??e.get("default-src");return!!t&&!(t.includes("'unsafe-inline'")&&!t.some(s=>s.startsWith("'nonce-")||s.startsWith("'sha")))}function dt(n,e){if(typeof document>"u")return()=>{};!e&&en().some(tn)&&n("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 t=s=>{let o=s;/^style-src/.test(o.effectiveDirective??"")&&o.blockedURI==="inline"&&n(`CSP hint: an inline style was blocked by ${o.effectiveDirective}${e?" (check that `nonce` matches the page's nonce)":"; set the `nonce` option"}`)};return document.addEventListener("securitypolicyviolation",t),()=>document.removeEventListener("securitypolicyviolation",t)}var nn=(n,e)=>n.slice(0,e);function lt(n){try{let e=new URL(n);return e.protocol==="data:"||e.protocol==="blob:"?e.protocol:e.origin+e.pathname}catch{return nn(n,64)}}function ut(n,e={}){if(typeof document>"u")return()=>{};let t=e.maxPerPage??20,s=new Set,o=i=>{let a=i,d={$csp_directive:a.effectiveDirective??a.violatedDirective,$csp_blocked_uri:lt(a.blockedURI??""),$csp_source_file:a.sourceFile?lt(a.sourceFile):void 0,$csp_line:a.lineNumber||void 0,$csp_column:a.columnNumber||void 0,$csp_disposition:a.disposition},p=[d.$csp_directive,d.$csp_blocked_uri,d.$csp_source_file,d.$csp_line].join("|");s.has(p)||s.size>=t||(s.add(p),n("$csp_violation",Object.fromEntries(Object.entries(d).filter(([,h])=>h!==void 0))))};return document.addEventListener("securitypolicyviolation",o),()=>document.removeEventListener("securitypolicyviolation",o)}var sn=["chrome-extension:","moz-extension:","safari-web-extension:","ms-browser-extension:"],pt=()=>typeof location<"u"&&sn.includes(location.protocol);function on(n,e,t){let s=e.find(a=>n.startsWith(`${a}/`));if(!s)return n;let o=n.slice(s.length),i=o.search(/[?#]/);return s+t(i<0?o:o.slice(0,i))+(i<0?"":o.slice(i))}function ft(n,e,t,s){if(!s)return{transport:n,fetch:e};let o=i=>on(i,t,s);return{transport:{send:(i,a,d)=>n.send(o(i),a,d)},fetch:((i,a)=>e(typeof i=="string"?o(i):i instanceof URL?o(i.href):i,a))}}var rn="__LUCIDA_DEVTOOLS_HOOK__";function gt(n,e,t){let s=globalThis[rn];if(!(!s||typeof s.emit!="function"||typeof s.attach!="function")){n.onCapture(o=>{try{s.emit(o)}catch{}});try{s.attach({projectKeyPrefix:n.apiKey.slice(0,8),apiHost:t,distinctId:()=>e.distinctId,loadToolbar:o=>e.loadToolbar(o),startReplay:async()=>n.replay?(await n.replay.start(!0),n.replay.isRecording()):!1,replayUrl:()=>e.getReplayUrl()})}catch{}}}var W=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"];function an(n){let e={},t=new URLSearchParams(location.search);for(let s of[...W,...O,...n]){let o=t.get(s);o&&(e[`$${s}`]=o)}return e}function ht(){let n=new URLSearchParams(location.search),e=W.map(t=>n.get(t)??"");return e.some(Boolean)?e.join("|"):void 0}function cn(n){try{return n?new URL(n).hostname:""}catch{return""}}var ln=()=>location.href.replace(/([?&])__lc_toolbar=[^&#]*&?/,"$1").replace(/[?&]$/,"");function dn(){let n=location.hash;return n.length>1?location.pathname+n.split("?")[0]:location.pathname}function mt(n,e,t=[],s=!1){let o={$current_url:ln(),$host:location.host,$pathname:s?dn():location.pathname,$referrer:document.referrer,$title:document.title,$screen_width:screen.width,$screen_height:screen.height,$viewport_width:window.innerWidth,$viewport_height:window.innerHeight,$browser_language:navigator.language,$timezone:Intl.DateTimeFormat().resolvedOptions().timeZone};if(navigator.maxTouchPoints>1&&(o.$touch_points=navigator.maxTouchPoints),n!=="$pageview")return{properties:o};let i=an(t);Object.assign(o,i);let a=e.$current_url??location.href,d=e.$referrer??document.referrer,p={$initial_referrer:d||"$direct",$initial_referring_domain:cn(d)||"$direct",$initial_current_url:a};for(let[h,m]of Object.entries(i))p[`$initial_${h.slice(1)}`]=m;return{properties:o,$set_once:p}}function yt(n,e,t=globalThis){e&&(t[typeof e=="string"?e:"lucida"]=n,typeof CustomEvent=="function"&&t.dispatchEvent?.(new CustomEvent("lucida:ready",{detail:n})))}var T=()=>{},ke=()=>Promise.resolve(),vt={isInternal:!1,hasOptedOut:()=>!1,hasOptedIn:()=>!1,consentStatus:()=>"pending",getConsentStatus:()=>"pending",getConsent:()=>({analytics:!1,replay:!1,marketing:!1}),getAllFlags:()=>({}),isFeatureEnabled:()=>!1,getFlagResult:n=>B(n,void 0,void 0,"not_found"),getReplayUrl:()=>"",onSessionId:()=>T,onFlags:()=>T,onIntervention:()=>T,onConsent:()=>T,flush:ke,shutdown:ke,reloadFlags:ke,loadToolbar:()=>Promise.resolve(!1),recommendations:n=>Promise.resolve({placement:n,strategy:"",items:[],shown:T,clicked:T})};function bt(n){return new Proxy(()=>{},{get:(e,t)=>{if(!(typeof t!="string"||t==="then"))return n&&Object.hasOwn(vt,t)?vt[t]:bt(!1)}})}var _t=()=>bt(!0);var St="_lcid";var un=(n,e)=>e.some(t=>{let s=t.replace(/^\./,"").toLowerCase();return n.toLowerCase()===s||n.toLowerCase().endsWith(`.${s}`)});function pn(n,e=Date.now()){let t=n.lastIndexOf("."),[s="",o]=n.slice(t+1).split("_",2),i=/^[0-9a-z]+$/.test(s)?parseInt(s,36):NaN,a=n.slice(0,t);if(t>0&&a.length<=200&&i<=e+5e3&&e-i<=12e4)return o&&/^[\w-]{1,64}$/.test(o)?{distinctId:a,sessionId:o}:{distinctId:a}}function wt(n){if(!n?.length)return;let e=new URL(location.href),t=e.searchParams.get(St);if(t!==null){e.searchParams.delete(St),history.replaceState(history.state,"",e.toString());try{if(document.referrer&&!un(new URL(document.referrer).hostname,n))return}catch{return}return pn(t)}}function kt(n,e=Date.now){let t=n.eventsPerSecond??10,s=n.burst??100,o=s,i=e();return()=>{let a=e();return o=Math.min(s,o+(a-i)/1e3*t),i=a,o<1?!1:(o-=1,!0)}}var xe="<masked>",fn=["password","passwd","pwd","pass","token","access_token","refresh_token","id_token","secret","client_secret","api_key","apikey","key","auth","authorization","code","otp","email","ssn"],gn=["$current_url","$referrer","$initial_referrer","$initial_current_url","$last_current_url"],xt=n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");function hn(n,e){let t=n,s=[...fn,...e.maskParams??[],...e.maskCampaignParams?[...W,...O]:[]];if(s.length){let o=t.indexOf("#"),i=o<0?t:t.slice(0,o),a=o<0?"":t.slice(o);t=i.replace(new RegExp(`([?&])(${s.map(xt).join("|")})=[^&]*`,"gi"),`$1$2=${xe}`)+a}return e.stripHash&&(t=t.replace(/#.*$/,"")),t}function Ct(n){let e=new RegExp(`^\\$(initial_|last_)?(${[...W,...O].map(xt).join("|")})$`),t=s=>{let o;if(n.maskCampaignParams)for(let[i,a]of Object.entries(s))typeof a=="string"&&e.test(i)?(o??={...s})[i]=xe:i==="$click_ids"&&a&&typeof a=="object"&&((o??={...s})[i]=Object.fromEntries(Object.keys(a).map(d=>[d,xe])));for(let i of gn){let a=(o??s)[i];if(typeof a!="string")continue;let d=hn(a,n);d!==a&&((o??={...s})[i]=d)}return o??s};return s=>({...s,properties:t(s.properties),...s.$set?{$set:t(s.$set)}:{},...s.$set_once?{$set_once:t(s.$set_once)}:{}})}function mn(n,e,t){let s=e;for(let o of n)try{let i=o(s);if(i==null)return null;if(typeof i!="object"||typeof i.event!="string")return t("beforeSend hook returned a non-event, dropping:",typeof i),null;s=i}catch(i){return t("beforeSend hook threw, dropping event:",i),null}return s}function yn(n,e=Math.random){return t=>n>=1?t:n<=0||e()>=n?null:{...t,properties:{...t.properties,$sample_rate:n}}}function vn(n){let e=new Set(n),t=s=>Object.fromEntries(Object.entries(s).filter(([o])=>!e.has(o)));return s=>({...s,properties:t(s.properties),...s.$set?{$set:t(s.$set)}:{},...s.$set_once?{$set_once:t(s.$set_once)}:{}})}var Ce="lc_person_identified",se="lc_pending_set_once",Pt=new Set(["$identify","$create_alias","$groupidentify"]),$t="$$client_ingestion_warning",bn=6e4,Pe=class{constructor(e,t){this.mode=e;this.storage=t;this.identified=t.get(Ce)==="1";try{this.pending=JSON.parse(t.get(se)??"{}")}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(Ce,"1"))}personless(e){return this.mode==="always"?!1:(this.mode==="never"||!this.identified)&&!Pt.has(e)}stash(e){if(this.mode!=="identified_only"||!e)return;let t=Object.entries(e).filter(([s])=>!(s in this.pending));t.length&&(this.pending={...this.pending,...Object.fromEntries(t)},this.storage.set(se,JSON.stringify(this.pending)))}take(){if(!Object.keys(this.pending).length)return;let e=this.pending;return this.pending={},this.storage.remove(se),e}reset(){this.identified=!1,this.pending={},this.storage.remove(Ce),this.storage.remove(se)}};function _n(n,e){let t=e,s;if(n.person.personless(e.event)){n.person.stash(e.$set_once);let{$set:i,$set_once:a,$unset:d,...p}=e;t={...p,properties:{...e.properties,$process_person_profile:!1}}}else(s=n.person.take())&&(t={...e,$set_once:{...e.$set_once,...s}});let o=n.hooks.length?mn(n.hooks,t,n.log):t;return o&&n.limit&&!n.limit()&&(n.log("rate limited, dropped",o.event),n.onLimited?.(),o=null),!o&&s&&n.person.stash(s),o}function Sn(n){let e=n.beforeSend?Array.isArray(n.beforeSend)?n.beforeSend:[n.beforeSend]:[];return[Ct(n.urlPrivacy??{}),...n.propertyDenylist?.length?[vn(n.propertyDenylist)]:[],...n.sampleRate!==void 0?[yn(n.sampleRate)]:[],...e]}function It(n,e,t,s=Date.now){let o=new Pe(e.personProfiles??"always",n.storage),i,a,d=0,p=-1/0,h=()=>{d+=1,!(s()-p<bn)&&(p=s(),queueMicrotask(()=>{let m=d;d=0,n.capture($t,{$$client_ingestion_warning_message:`client rate limit dropped ${m} event(s)`,$dropped_count:m})}))};return n.setFilter(m=>(e.rateLimit!==i&&(i=e.rateLimit,a=i?kt(i):void 0),_n({hooks:Sn(e),person:o,limit:m.event===$t?void 0:a,log:t,onLimited:h},m))),o}var $e=class{m=new Map;get(e){return this.m.get(e)??null}set(e,t){this.m.set(e,t)}remove(e){this.m.delete(e)}},wn=365,kn=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(" ")),xn=new Set("co com net org edu gov gob go ac or ne ltd plc sch mil nom".split(" "));function Cn(n){let e=n.toLowerCase().split(".");for(let t=1;t<e.length-1;t++)if(kn.has(e.slice(t).join("."))||t===e.length-2&&e[t+1].length===2&&xn.has(e[t]))return e.slice(t-1).join(".")}function Pn(n=location.hostname){if(/^[\d.]+$/.test(n)||n.includes(":"))return;let e=n.split(".");for(let t=e.length-2;t>=0;t--){let s=e.slice(t).join(".");if(document.cookie=`__lc_probe=1; Domain=${s}; Path=/; Max-Age=10; SameSite=Lax`,document.cookie.includes("__lc_probe=1"))return document.cookie=`__lc_probe=; Domain=${s}; Path=/; Max-Age=0`,s}return Cn(n)}var oe=class{constructor(e={}){this.o=e}o;domain=null;attr(){if(this.domain===null)try{this.domain=this.o.domain??(this.o.crossSubdomain?Pn():void 0)}catch{this.domain=void 0}return this.domain?`; Domain=${this.domain}`:""}held=new Map;read(e){try{for(let t of document.cookie.split("; ")){let s=t.indexOf("=");if(t.slice(0,s)===e)return decodeURIComponent(t.slice(s+1))}}catch{}return null}get(e){return this.read(e)??this.held.get(e)??null}set(e,t){let s=this.o.secure??location.protocol==="https:"?"; Secure":"",o=Math.round((this.o.expiryDays??wn)*86400);try{document.cookie=`${e}=${encodeURIComponent(t)}; Max-Age=${o}; Path=/${this.attr()}; SameSite=Lax${s}`}catch{}this.read(e)===t?this.held.delete(e):this.held.set(e,t)}remove(e){this.held.delete(e);try{document.cookie=`${e}=; Max-Age=0; Path=/${this.attr()}; SameSite=Lax`}catch{}}},M=class{constructor(e="localStorage"){this.kind=e}kind;store(){try{return globalThis[this.kind]}catch{return}}get(e){try{return this.store()?.getItem(e)??null}catch{return null}}set(e,t){try{this.store()?.setItem(e,t)}catch{}}remove(e){try{this.store()?.removeItem(e)}catch{}}},Ie=class extends M{constructor(){super("localStorage")}},$n=["lc_identity","lc_session","lc_device_id","lc_consent","lc_person_identified"],Oe=class{constructor(e,t,s){this.cookie=e;this.local=t;this.cookieKeys=s}cookie;local;cookieKeys;get(e){let[t,s]=this.cookieKeys(e)?[this.cookie,this.local]:[this.local,this.cookie];return t.get(e)??s.get(e)}set(e,t){this.local.set(e,t),this.cookieKeys(e)?this.cookie.set(e,t):this.cookie.remove(e)}remove(e){this.local.remove(e),this.cookie.remove(e)}},re=class{constructor(e,t){this.inner=e;this.delayMs=t}inner;delayMs;pending=new Map;timer;get(e){return this.pending.has(e)?this.pending.get(e)??null:this.inner.get(e)}set(e,t){this.queue(e,t)}remove(e){this.queue(e,null)}queue(e,t){this.pending.set(e,t),this.timer??=setTimeout(()=>this.flush(),this.delayMs)}flush(){clearTimeout(this.timer),this.timer=void 0;for(let[e,t]of this.pending)t===null?this.inner.remove(e):this.inner.set(e,t);this.pending.clear()}},Ee=class{constructor(e,t){this.inner=e;this.suffix=t}inner;suffix;get(e){return this.inner.get(e+this.suffix)}set(e,t){this.inner.set(e+this.suffix,t)}remove(e){this.inner.remove(e+this.suffix)}},ie=n=>`_${n.replace(/\W/g,"").slice(-8)}`;function ae(n,e,t){if(n==="memory"||n==="none")return new $e;let s=ie(e),o=n==="cookie"?new oe(t):n==="localStorage+cookie"?new Oe(new oe(t),new Ie,i=>$n.some(a=>i===a+s)):new M(n);return new Ee(o,s)}function Ot(n,e,t){let s=ie(e),o=new Set;try{for(let i of document.cookie.split("; "))o.add(i.split("=")[0]);for(let i of[globalThis.localStorage,globalThis.sessionStorage])for(let a=0;a<i.length;a++)o.add(i.key(a))}catch{}for(let i of o)if(!(!i.startsWith("lc_")||!i.endsWith(s)||i===t+s)){n.remove(i.slice(0,-s.length));try{localStorage.removeItem(i),sessionStorage.removeItem(i)}catch{}}}async function In(n){if(!(typeof CompressionStream>"u"||typeof Response>"u"))try{let e=new Response(n).body?.pipeThrough(new CompressionStream("gzip"));return e?new Uint8Array(await new Response(e).arrayBuffer()):void 0}catch{return}}function Et(n,e={}){let t=e.compress??!0,s=(o,i)=>(e.onError?.({url:o,status:i}),{status:i});return{async send(o,i,a){if(a?.beacon&&!e.disableBeacon&&typeof navigator<"u"&&navigator.sendBeacon)return navigator.sendBeacon(o,new Blob([i],{type:"text/plain"}))?{status:200}:s(o,0);try{let d=t&&i.length>=1024?await In(i):void 0,p=await n(d?`${o}${o.includes("?")?"&":"?"}compression=gzip`:o,{method:"POST",body:d??i,headers:{...e.headers,"Content-Type":"text/plain;charset=UTF-8"},credentials:"omit",keepalive:(d?.length??i.length)<6e4});return p.status>=400?s(o,p.status):{status:p.status}}catch{return s(o,0)}}}}var Re={send:async()=>({status:200})};var On="lucida-browser",En="0.1.6",Ae="lc_internal",Rn=3e3,Rt="https://capture.lucidace.com",Te=n=>!!n&&typeof n=="object"&&Object.getPrototypeOf(n)===Object.prototype;function Me(n,e={},t=[]){if(typeof window>"u"||typeof navigator>"u")return _t();let s=!!e.debug||typeof location<"u"&&/[?&]__(lc|lucida)_debug=(1|true)/.test(location.search),o=(...r)=>{s&&console.debug("[lucida]",...r)},i=(e.apiHost??Rt).replace(/\/+$/,""),a=Object.fromEntries(Object.entries(e).map(([r,c])=>[r,Te(c)?{...c}:c]));a.apiHost=i;let d=e.extension??pt(),p=r=>d&&(r==="cookie"||r==="localStorage+cookie")?e.extensionPersistence??"localStorage":r,h=p(e.cookieless==="always"?"none":e.persistence??"cookie"),m=[i,...e.flagsApiHost?[e.flagsApiHost.replace(/\/+$/,"")]:[]],_=e.fetch??((...r)=>fetch(...r)),P=r=>ft(r,_,m,e.rewritePath),g=P(Re).fetch,v=e.consent?.respectDnt,b=navigator.globalPrivacyControl===!0,S=(e.respectDnt??v)===!0&&navigator.doNotTrack==="1"||(e.respectGpc??v)===!0&&b,je=e.blockBots!==!1&&typeof navigator<"u"&&it(navigator.userAgent??"",e.blockedUserAgents),k=!!e.disabled||je;je&&o("bot user agent: capture disabled");let ce,le=P(e.transport??Et(_,{headers:a.requestHeaders,onError:e.onRequestError,disableBeacon:e.disableBeacon})).transport;if(!e.transport&&e.offlineQueue!==!1&&h!=="memory"&&h!=="none"){let r=new $(new M(h==="sessionStorage"?"sessionStorage":"localStorage"),()=>l.hasConsent("analytics"));le=ce=ve(le,r,{key:`lc_offline${ie(n)}`,isOnline:()=>navigator.onLine!==!1})}let V=k?void 0:wt(e.crossDomains),de=ae(k?"memory":h,n,e.cookie),z=(e.storageWriteDelayMs??0)>0?new re(de,e.storageWriteDelayMs):void 0,De=V?.sessionId??e.bootstrap?.sessionId,ue,K=!1,Le,pe=[],l=new N({apiKey:n,apiHost:i,transport:k?Re:le,storage:z??de,...e.consentPersistence&&!k?{consentStorage:ae(p(e.consentPersistence),n,e.cookie)}:{},persistProperty:r=>!a.persistedProperties||a.persistedProperties.includes(r),...h==="none"?{cookieless:!0}:{},library:{name:On,version:En},consent:{...e.cookieless==="on_reject"?{cookielessOnReject:!0}:{},...e.consent,...!k&&(e.consent?.geo||e.consent?.mode!=="opt_in")?{awaitRemote:!0}:{},respectDnt:!0,dnt:S},queue:{...e.flushAt?{flushAt:e.flushAt}:{},...e.flushIntervalMs?{flushIntervalMs:e.flushIntervalMs}:{}},...V||e.bootstrap?.distinctId?{bootstrapDistinctId:V?.distinctId??e.bootstrap?.distinctId}:{},...e.bootstrap?.isIdentified&&!V?{bootstrapIdentified:!0}:{},session:{...e.session,...De?{bootstrapId:De}:{}},enrich:(r,c)=>{let u=mt(r,c,a.customCampaignParams,e.capturePageview==="hash");if(i!==Rt&&(u.properties={...u.properties,$lib_custom_api_host:i}),pe.length){let I=l.sessionId;for(let At of pe)u.properties={...u.properties,...At(I)}}let y=Le?.()??{},w=Object.keys(y);return w.length&&(u.properties={...u.properties,$click_ids:y},r==="$pageview"&&(u.$set_once={...Object.fromEntries(w.map(I=>[`$initial_${I}`,y[I]])),...u.$set_once},u.$set=Object.fromEntries(w.map(I=>[`$last_${I}`,y[I]])))),a.sendFeatureFlags!==!1&&r!=="$snapshot"&&ue&&(u.properties={...be(ue.all()),...u.properties}),K?{...u,properties:{...u.properties,$internal:!0}}:u},campaignKey:ht,log:o});K=l.storage.get(Ae)==="1",e.clickIds!==!1&&(Le=ct(l.storage,e.clickIds?.expiryDays));let x=It(l,a,o);e.bootstrap?.isIdentified&&x.markIdentified();let j=r=>x.blocksPersonWrites?(o(`personProfiles=never: ${r} ignored`),!0):!1;k||l.onChange(r=>{r!=="consent"||l.hasConsent("analytics")||l.consentStatus()!=="denied"||(z?.flush(),Ot(de,n,e.consent?.storageKey||Y))});let fe=new Set;l.onChange(r=>{r==="consent"&&[...fe].forEach(c=>c())});let Fe=[],E=[dt(o,e.nonce)],Ne=l.storage;if(e.flagPersistence&&!k){let r=new $(ae(p(e.flagPersistence),n,e.cookie),()=>l.hasConsent("analytics"));l.onChange(c=>{c==="consent"&&(l.hasConsent("analytics")?r.flushBuffered():r.discardBuffered())}),Ne=r}let G=r=>{if(k)return;if(l.hasConsent("analytics"))return r();let c=!1;l.onChange(u=>{!c&&u==="consent"&&l.hasConsent("analytics")&&(c=!0,r())})},Be,f={core:l,client:void 0,config:a,flagStorage:Ne,apiKey:n,log:o,fetch:g,onUnload:r=>{Fe.push(r)},whenConsented:G,onCapture:r=>l.onCaptured(r),eventExtras:pe,clickExtras:[],flagPersonProps:[],loadConfig:()=>Be??=new Promise(r=>G(()=>{g(`${i}/v1/config?api_key=${encodeURIComponent(n)}`).then(c=>c.ok?c.json():null).then(c=>(c&&l.applyRemote(c),c)).then(r,()=>r(null))}))},Ue=Promise.resolve();if(l.consent.resolving){let r=!1,c=g(`${i}/v1/config?api_key=${encodeURIComponent(n)}`,{credentials:"omit"}).then(u=>(r=u.status>=500,u.ok?u.json():null)).catch(()=>(r=!0,null));Be=c,Ue=new Promise(u=>{let y=setTimeout(()=>(l.resolveConsent("opt_in"),u()),Rn);c.then(w=>{clearTimeout(y),w?l.applyRemote(w):r?l.resolveConsent("opt_in"):l.applyRemote({}),u()})})}let qe=ye(l,{apiHost:i,apiKey:n,fetch:g,whenConsented:G,log:o,disabled:k});E.push(()=>qe.stop());let D={get distinctId(){return l.distinctId},capture:(r,c,u)=>{l.capture(r,c,u?.timestamp!==void 0?{timestamp:u.timestamp}:{})&&(u?.sendInstantly||u?.transport)&&l.flush(u.transport==="beacon"?{beacon:!0}:{})},identify:(r,c,u)=>{j("identify")||(x.markIdentified(),l.identify(r,c,u))},alias:(r,c)=>{j("alias")||(x.markIdentified(),l.alias(r,c))},reset:r=>{l.reset({resetDeviceId:!!r,reuseAnonymousId:!!e.reuseAnonymousId}),x.reset()},createPersonProfile:()=>{j("createPersonProfile")||x.isProfile||(x.markIdentified(),l.capture("$set",{}))},setConfig:r=>{let c=a;for(let[u,y]of Object.entries(r)){let w=c[u];Te(w)&&Te(y)?Object.assign(w,y):c[u]=y}"debug"in r&&(s=!!r.debug)},setPersonProperties:(r,c)=>{!r&&!c||j("setPersonProperties")||(x.markIdentified(),l.capture("$set",{},{...r?{$set:r}:{},...c?{$set_once:c}:{}}))},unsetPersonProperties:r=>{!r.length||j("unsetPersonProperties")||(x.markIdentified(),l.capture("$set",{},{$unset:r}))},getDistinctId:()=>l.distinctId,getSessionId:()=>l.sessionId,onSessionId:r=>l.onSessionId(c=>r(c)),getProperty:r=>l.getProperty(r),hasOptedOut:()=>l.consentStatus()==="denied",hasOptedIn:()=>l.consentStatus()==="granted",onConsent:r=>(fe.add(r),()=>{fe.delete(r)}),getReplayUrl:r=>{let u=`${(e.uiHost??i).replace(/\/+$/,"")}/replays/${encodeURIComponent(l.sessionId)}`,y=l.sessionStart;return!r?.withTimestamp||y===void 0?u:`${u}?t=${Math.max(0,Math.round((Date.now()-y)/1e3-(r.timestampLookBackSeconds??10)))}`},debug:(r=!0)=>{s=r},featureView:(r,c)=>{l.capture("$feature_view",{...c,$feature_flag:r},{$set:{[`$feature_view/${r}`]:!0}})},featureInteraction:(r,c)=>{l.capture("$feature_interaction",{...c,$feature_flag:r},{$set:{[`$feature_interaction/${r}`]:!0}})},updateFlags:(r,c,u)=>f.flags?.update(r,c,u?.merge??!0),register:r=>l.register(r),registerOnce:r=>l.registerOnce(r),unregister:r=>l.unregister(r),group:(r,c,u)=>{x.markIdentified(),l.group(r,c,u)},optIn:(r=["analytics","replay"])=>l.setConsent({analytics:r.includes("analytics"),replay:r.includes("replay"),marketing:r.includes("marketing")}),optOut:()=>l.optOut(),optOutInternal:(r=!0)=>{K=r,r?l.storage.set(Ae,"1"):l.storage.remove(Ae)},get isInternal(){return K},setConsent:r=>l.setConsent(r),getConsent:()=>l.getConsent(),getConsentStatus:r=>l.getConsentStatus(r),consentStatus:()=>l.consentStatus(),getFlag:r=>f.flags?.get(r),getFlagPayload:r=>f.flags?.payload(r),getFlagResult:(r,c)=>f.flags?.result(r,c)??B(r,void 0,void 0,"not_found"),getLayerParam:(r,c,u)=>f.flags?.layerParam(r,c)??u,isFeatureEnabled:r=>{let c=f.flags?.get(r);return c!==void 0&&c!==!1},onFlags:r=>f.flags?.onChange(r)??(()=>{}),onIntervention:r=>qe.on(r),reloadFlags:()=>f.flags?.reload()??Promise.resolve(),getAllFlags:()=>f.flags?.all()??{},overrideFlags:(r,c)=>f.flags?.override(r,c),setPersonPropertiesForFlags:(r,c)=>f.flags?.setPersonProperties(r,c),resetPersonPropertiesForFlags:()=>f.flags?.resetPersonProperties(),setGroupPropertiesForFlags:(r,c)=>f.flags?.setGroupProperties(r,c),resetGroupPropertiesForFlags:()=>f.flags?.resetGroupProperties(),setContext:(r,c,u)=>f.flags?.setContext(r,c,u),clearContext:r=>f.flags?.clearContext(r),guides:{showChangelog:()=>f.guides?.showChangelog()??0,show:r=>f.guides?.show(r)??!1,reset:r=>f.guides?.reset(r)},ai:{startConversation:r=>new q((c,u)=>D.capture(c,u),r,a.ai?.captureText===!0).start()},earlyAccess:{list:()=>f.earlyAccess?.list()??Promise.resolve([]),optIn:r=>f.earlyAccess?.optIn(r),optOut:r=>f.earlyAccess?.optOut(r)},replay:{start:r=>f.replay?.start(r)??Promise.resolve(),stop:()=>f.replay?.stop(),pause:()=>f.replay?.pause(),resume:()=>f.replay?.resume(),tag:r=>f.replay?.tag(r),isRecording:()=>f.replay?.isRecording()??!1},consent:{showBanner:r=>f.consentUi?.showBanner(r)??Promise.resolve(null),hideBanner:()=>f.consentUi?.hideBanner()},loadToolbar:r=>f.toolbar?.load(typeof r=="string"?r:r.token)??Promise.resolve(!1),activateExperiment:r=>f.experiments?.activate(r),recommendations:(r,c)=>f.recs?.get(r,c)??Promise.resolve({placement:r,strategy:"",items:[],shown(){},clicked(){}}),flush:()=>Ue.then(()=>l.flush()),shutdown:async()=>{for(let r of E)r();z?.flush(),await l.shutdown()}};if(f.client=D,!k){let r=()=>{for(let u of Fe)u();z?.flush(),l.flush({beacon:!0})};window.addEventListener("pagehide",r);let c=()=>{document.visibilityState==="hidden"&&l.flush({beacon:!0})};if(document.addEventListener("visibilitychange",c),E.push(()=>{window.removeEventListener("pagehide",r),document.removeEventListener("visibilitychange",c)}),ce){let u=()=>{ce.drain()};window.addEventListener("online",u),E.push(()=>window.removeEventListener("online",u)),G(u)}if(e.captureCspViolations){let u=typeof e.captureCspViolations=="object"?e.captureCspViolations:{};E.push(ut((y,w)=>{l.capture(y,w)},u))}for(let u of t){let y=u(f);y&&E.push(y)}ue=f.flags,t.length||f.loadConfig(),gt(f,D,i)}return yt(D,e.exposeGlobal),o("initialised",{apiHost:i,consent:l.getConsent()}),D}function Qs(n,e={}){return Me(n,e)}export{Me as createClient,Qs as init};
@@ -0,0 +1 @@
1
+ function d(n){let o=window.fetch;window.fetch=function(r,s){let i=r instanceof Request?r.url:String(r),a=new Headers(s?.headers??(r instanceof Request?r.headers:void 0)),f=[...a.entries()].join("|");return n(i,a),[...a.entries()].join("|")===f?o.call(this,r,s):o.call(this,r,{...s,headers:a})};let t=XMLHttpRequest.prototype,{open:e,send:c}=t,u=new WeakMap;return t.open=function(r,s,...i){return u.set(this,String(s)),e.call(this,r,s,...i)},t.send=function(r){let s=u.get(this);if(s){let i=new Headers;n(s,i),i.forEach((a,f)=>this.setRequestHeader(f,a))}return c.call(this,r)},()=>{window.fetch=o,t.open=e,t.send=c}}var l="lucida.session_id";function p(n,o){return[...(n??"").split(",").map(e=>e.trim()).filter(e=>e&&!e.startsWith(`${l}=`)),`${l}=${encodeURIComponent(o)}`].join(",")}function g(n,o=[]){let t;try{t=new URL(n,location.href)}catch{return!1}return t.origin===location.origin||o.some(e=>typeof e=="string"?t.origin===e:e.test(t.href))}var q=n=>{let o=n.config.watchtower,{core:t}=n,e=h(n);if(!o?.correlate)return e;let c=t.sessionId;n.onCapture(s=>c=String(s.properties.$session_id??c));let u=s=>t.hasConsent("analytics")&&!s.startsWith(n.config.apiHost)&&g(s,o.origins),r=d((s,i)=>{u(s)&&i.set("baggage",p(i.get("baggage"),c))});return()=>(r(),e?.())};function h(n){let o=n.config.watchtower?.client??globalThis.watchtower;if(typeof o?.setAttribute!="function")return;let{core:t}=n,e=c=>{t.hasConsent("analytics")&&o.setAttribute(l,c)};return n.whenConsented(()=>e(t.sessionId)),t.onSessionId(e)}export{g as correlatable,q as correlate,h as stampSession,p as withBaggage};
@@ -0,0 +1,3 @@
1
+ var P=(t,e)=>()=>(t&&(e=t(t=0)),e);function it(t,e,n){return e==="opt_in"?"opt_in":n==="opt_in"||n==="opt_out"||n==="cookieless"?n:e==="opt_out"?t:void 0}var Oe,ot,ye,ne,at=P(()=>{"use strict";Oe="lc_consent";ot=["analytics","replay","marketing"],ye=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||Oe;let r=e.storage.get(this.key);if(r)try{let s=JSON.parse(r);for(let o of ot)typeof s[o]=="boolean"&&(this.state[o]=s[o]);this.decided=ot.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 ot)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)}},ne=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 _n(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 X(t=Date.now()){if(t>Ae){Ae=t;let o=_n(2);ue=((o[0]??0)<<8|(o[1]??0))&1023}else ue++,ue>4095&&(Ae++,ue=0);let e=_n(8),n=new Uint8Array(16),r=Ae;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|ue>>8,n[7]=ue&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 Ae,ue,Ie=P(()=>{"use strict";Ae=0,ue=0});var xn,Me,wn=P(()=>{"use strict";Ie();xn="lc_identity",Me=class{constructor(e,n,r=!1,s=!1){this.storage=e;this.cookieless=r;let o=e.get(xn),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??X();this.s={distinct_id:a,anon_id:a,identified:s&&!!n},this.save()}}storage;cookieless;s;save(){this.storage.set(xn,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||X();this.s={distinct_id:n,anon_id:n,identified:!1},this.save()}}});function ae(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 kn(t){return t===0||t===408||t===429||t>=500}var Te=P(()=>{"use strict"});var je,Sn=P(()=>{"use strict";Te();je=class{constructor(e){this.o=e;this.flushAt=e.flushAt??20,this.intervalMs=e.flushIntervalMs??5e3,this.maxSize=e.maxQueueSize??1e3,this.maxRetries=e.maxRetries??5,this.batchMax=Math.max(1,Math.min(e.maxBatchSize??1e3,1e3))}o;items=[];timer;attempt=0;inflight;closed=!1;warned404=!1;flushAt;intervalMs;maxSize;maxRetries;batchMax;get size(){return this.items.length}enqueue(e){this.closed||(this.items.push(e),this.items.length>this.maxSize&&this.o.onDrop?.(this.items.splice(0,this.items.length-this.maxSize),"queue_full"),this.items.length>=this.flushAt?this.flush():this.arm(this.intervalMs))}arm(e){this.timer===void 0&&(this.timer=setTimeout(()=>{this.timer=void 0,this.flush()},e))}disarm(){this.timer!==void 0&&clearTimeout(this.timer),this.timer=void 0}flush(e={}){if(this.disarm(),this.inflight)return this.inflight.then(()=>this.items.length?this.flush(e):void 0);if(!this.items.length)return Promise.resolve();let 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,retryAfterMs:void 0})).then(i=>this.settle(n,i.status,!!e.beacon,i.retryAfterMs)).finally(()=>{this.inflight=void 0});return this.inflight=o,o}settle(e,n,r,s){if(n>=200&&n<300){this.attempt=0,this.items.length>=this.flushAt?this.flush():this.items.length&&this.arm(this.intervalMs);return}if(!kn(n)||r||this.attempt>=this.maxRetries){n===404&&!this.warned404&&(this.warned404=!0,console.warn(`[lucida] ${this.o.url} returned 404, so events are being dropped. apiHost is probably wrong: use https://capture.lucidace.com (or your own capture host), not the app host.`)),this.o.onDrop?.(e,`status_${n}`),this.attempt=0;return}this.items.unshift(...e);let o=Math.max(ae(this.attempt++,this.o.backoff),Math.min(s??0,6e4));this.o.log?.("retry in",o,"ms"),this.arm(o)}clear(){this.items=[],this.disarm()}async shutdown(){await this.flush(),this.closed=!0,this.disarm()}}});function Cn(t,e,n){return typeof t=="number"&&Number.isInteger(t)&&t>=e&&t<=n?t*6e4:void 0}function Fs(t,e){let n=js.exec(t);if(!n)return!0;let r=parseInt(n[1]+n[2],16);return r-e<=6e4&&e-r<=Ts}var ct,Is,Ms,Ts,js,Fe,Rn=P(()=>{"use strict";Ie();ct="lc_session";Is=6e4,Ms=10*36e5,Ts=24*36e5,js=/^([0-9a-f]{8})-?([0-9a-f]{4})-7[0-9a-f]{3}-/i;Fe=class{constructor(e,n={}){this.storage=e;this.o=n;this.idleMs=Math.min(Ms,Math.max(Is,n.idleMs??30*6e4)),this.maxMs=n.maxMs??24*36e5,this.newOn=n.newOnEvents??[],this.clock=n.clock??{now:()=>Date.now()},this.bootstrapId=n.bootstrapId}storage;o;windowId=X();idleMs;maxMs;newOn;clock;bootstrapId;configure(e){this.o.idleMs===void 0&&(this.idleMs=Cn(e.session_idle_minutes,1,600)??this.idleMs),this.o.maxMs===void 0&&(this.maxMs=Cn(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(ct);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||Math.abs(r-s.last)>this.idleMs||Math.abs(r-s.start)>this.maxMs||o||i;return(a||!s)&&(s={id:!s&&this.bootstrapId&&Fs(this.bootstrapId,r)?this.bootstrapId:X(r),start:r,last:r}),this.bootstrapId=void 0,s.last=r,e&&(s.campaign=e),this.storage.set(ct,JSON.stringify(s)),{sessionId:s.id,windowId:this.windowId,isNew:a}}startedAt(){return this.read()?.start}reset(){this.storage.remove(ct)}}});function En(t,e){let n=t.get(e);if(n)try{return JSON.parse(n)}catch{return}}var Le,De,Pn=P(()=>{"use strict";Le=class{constructor(e,n="lc_props",r){this.storage=e;this.key=n;this.persist=r;this.p=En(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)}},De=class{constructor(e){this.storage=e;this.g=En(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 Ls(t,e){let n=new Date(t??e);return(Number.isNaN(n.getTime())?new Date(e):n).toISOString()}var ve,$n=P(()=>{"use strict";at();wn();Sn();Rn();Pn();Ie();ve=class{constructor(e){this.c=e;this.clock=e.clock??{now:()=>Date.now()},this.consent=new ye({...e.consent,storage:e.consentStorage??e.storage}),this.gated=new ne(e.storage,()=>this.consent.has("analytics")),this.storage=this.gated,this.identity=new Me(this.gated,e.bootstrapDistinctId,e.cookieless,e.bootstrapIdentified),this.session=new Fe(this.gated,{clock:this.clock,...e.session}),this.props=new Le(this.gated,void 0,e.persistProperty),this.groupState=new De(this.gated),this.queue=new je({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")||X(),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),c=this.c.enrich?.(e,n),l=this.consent.status()!=="pending",d=o?{}:{...c?.$set,...r.$set,...e==="$consent_updated"&&l?{$consent:this.consent.get()}:{}},f=o?{}:{...c?.$set_once,...r.$set_once},h=this.groupState.all(),g=o?"":this.identity.distinctId,x={uuid:X(this.clock.now()),event:e,...g?{distinct_id:g}:{},timestamp:Ls(r.timestamp,this.clock.now()),properties:{...this.props.all(),...c?.properties,...n,$session_id:a.sessionId,$window_id:a.windowId,$lib:this.c.library.name,$lib_version:this.c.library.version,...l?{$consent:this.consent.get()}:{}},...Object.keys(d).length?{$set:d}:{},...Object.keys(f).length?{$set_once:f}:{},...!o&&r.$unset?.length?{$unset:r.$unset}:{},...h?{$groups:h}:{}},y=this.filter?this.filter(x):x;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),this.resolveConsent(it(this.consent.mode,e.consent_mode,e.consent_default))}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 lt(t,e){return{event:On,props:{$feature_flag:t,$enrolled:e},extra:{$set:{[Ne(t)]:e}}}}var On,Ne,An=P(()=>{"use strict";On="$early_access_opt_in",Ne=t=>`$feature_enrollment/${t}`});function ut(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 c of s.split(/\r?\n/)){if(c.startsWith(":"))continue;let l=c.indexOf(":"),[d,f]=l<0?[c,""]:[c.slice(0,l),c.slice(l+1).replace(/^ /,"")];d==="event"?o=f??"":d==="data"?a.push(f??""):d==="id"&&(i=f)}a.length&&t(i===void 0?{event:o,data:a.join(`
2
+ `)}:{event:o,data:a.join(`
3
+ `),id:i})}}}var He,dt=P(()=>{"use strict";Te();He=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=ae(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=ut(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 pt(t){let e=!1,n,r=new He({url:`${t.apiHost}/v1/flags/stream`,secretKey:t.apiKey,fetch:t.fetch,...t.backoff?{backoff:t.backoff}:{},...t.log?{log:t.log}:{},onState:l=>e=l,onChange:l=>{l!==void 0&&l===n||(n=l,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 c=t.visibility?.subscribe(a);return()=>{r.stop(),c?.(),i&&clearInterval(i)}}var In=P(()=>{"use strict";dt()});function ft(t,e){let n=new Set,{whenConsented:r,disabled:s,...o}=e,i=new qe({...o,distinctId:()=>t.distinctId,onIntervention:c=>{for(let l of[...n])l(c)}}),a=!1;return t.onChange(c=>{a&&((c==="identify"||c==="reset")&&i.restart(),c==="consent"&&(t.hasConsent("analytics")?i.start():i.stop()))}),{on(c){return n.add(c),!a&&!s&&(a=!0,r(()=>i.start())),()=>{n.delete(c)}},stop:()=>i.stop()}}var qe,Mn=P(()=>{"use strict";dt();Te();qe=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=ae(n++,this.o.backoff))}catch(s){this.live(e)&&this.o.log?.("intervention stream error",s),r=ae(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=ut(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:c}=await i.read();if(a)return"streamed";o(c)}}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 gt(t,e,n={}){let r=n.key??"lc_offline",s=n.maxBatches??50,o=n.maxBytes??1e6,i=n.isOnline??(()=>!0),a,c,l=()=>{try{let g=JSON.parse(e.get(r)??"[]");return Array.isArray(g)?g:[]}catch{return[]}},d=g=>{let x=g.reduce((y,w)=>y+w.body.length,0);for(;g.length>s||x>o&&g.length>1;)x-=g.shift().body.length;g.length?e.set(r,JSON.stringify(g)):e.remove(r)},f=g=>{d([...l(),...g]),a??=setTimeout(()=>{a=void 0,h.drain()},n.retryMs??3e4)},h={async send(g,x,y){if(!i())return f([{url:g,body:x}]),{status:200};let w=await t.send(g,x,y);return w.status!==0?w:(f([{url:g,body:x}]),{status:200})},drain(){return c??=(async()=>{let g=l();if(!g.length||!i())return;e.remove(r);let x=[];for(let[y,w]of g.entries())if((await t.send(w.url,w.body)).status===0){x.push(...g.slice(y));break}x.length&&f(x)})().finally(()=>{c=void 0}),c}};return h}var Tn=P(()=>{"use strict"});function jn(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 l=0;l<16;l++)i[l]=s.getUint32(a+l*4);for(let l=16;l<64;l++){let d=i[l-15],f=i[l-2],h=K(d,7)^K(d,18)^d>>>3,g=K(f,17)^K(f,19)^f>>>10;i[l]=i[l-16]+h+i[l-7]+g|0}let c=o.slice();for(let l=0;l<64;l++){let[d,f,h,,g,x,y,w]=c,R=w+(K(g,6)^K(g,11)^K(g,25))+(g&x^~g&y)+Ds[l]+i[l]|0,E=(K(d,2)^K(d,13)^K(d,22))+(d&f^d&h^f&h)|0;c.pop(),c.unshift(R+E|0),c[4]=c[4]+R|0}for(let l=0;l<8;l++)o[l]=o[l]+c[l]|0}return o.map(a=>(a>>>0).toString(16).padStart(8,"0")).join("")}var Ds,K,Fn=P(()=>{"use strict";Ds=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]),K=(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(!Ns.test(r)||Number(r)>255)return;n.push(Number(r))}return n}function Us(t){if(t.includes("%"))return;let e=t,n=t.lastIndexOf(":"),r=t.slice(n+1);if(r.includes(".")){let d=Ln(r);if(!d)return;e=`${t.slice(0,n+1)}${(d[0]<<8|d[1]).toString(16)}:${(d[2]<<8|d[3]).toString(16)}`}let s=e.split("::");if(s.length>2)return;let o=d=>{if(d==="")return[];let f=[];for(let h of d.split(":")){if(!Hs.test(h))return;f.push(parseInt(h,16))}return f},i=o(s[0]),a=s.length===2?o(s[1]):[];if(!i||!a)return;let c=i.length+a.length;return(s.length===2?c>7:c!==8)?void 0:[...i,...Array(8-c).fill(0),...a].flatMap(d=>[d>>8,d&255])}function Dn(t){return t.includes(":")?Us(t):Ln(t)}function Nn(t){if(typeof t!="string")return;let e=Dn(t.trim());return e&&Ws(e)?e.slice(12):e}function Bs(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 c=Nn(s);c&&n.push({bytes:c,bits:c.length*8});continue}let i=Dn(s.slice(0,o)),a=s.slice(o+1);!i||!qs.test(a)||Number(a)>i.length*8||n.push({bytes:i,bits:Number(a)})}return n}function Vs(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 Hn(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=Nn(e),o=Bs(n);return!s||!o.length?!1:o.some(i=>Vs(i,s))===(t==="ip_in_cidr")}}return!1}var Ns,Hs,qs,Ws,qn=P(()=>{"use strict";Ns=/^(0|[1-9]\d{0,2})$/,Hs=/^[0-9a-fA-F]{1,4}$/,qs=/^(0|[1-9]\d*)$/;Ws=t=>t.length===16&&t.slice(0,10).every(e=>e===0)&&t[10]===255&&t[11]===255});function Xs(t){let e=Gs.exec(t.trim());return e?Number(e[1])*zs[e[2]]:void 0}function Wn(t,e,n){if(typeof t=="number")return t*1e3;if(typeof t!="string")return;let r=t.trim();if(n){let o=Xs(r);if(o!==void 0)return e-o*1e3}if(!Ks.test(r)&&!Un.test(r))return;let s=Date.parse(Un.test(r)?`${r}T00:00:00Z`:r);return Number.isNaN(s)?void 0:s}function Bn(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 Ys(t,e,n){if(typeof e!="string")return;let r=e.trim().replace(/^v/,"").split(".");if(t==="semver_wildcard"){let l=r[r.length-1];if(l!=="*"&&l!=="x"&&l!=="X")return;if(r.length===1)return[[0],[2**30]];let d=n.parseVersion(r.slice(0,-1).join("."));if(!d)return;let f=[...d];return f[f.length-1]=f[f.length-1]+1,[d,f]}let s=n.parseVersion(e);if(!s)return;for(;s.length<3;)s.push(0);let[o,i,a]=s,c;return t==="semver_tilde"&&r.length===1?c=[o+1,0,0]:t==="semver_tilde"||o===0&&i>0?c=[o,i+1,0]:o>0?c=[o+1,0,0]:c=[0,0,a+1],[s,c]}function Vn(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=Wn(e,r,!1),i=Wn(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=Ys(t,n,s);return!!o&&!!i&&Bn(o,i[0])>=0&&Bn(o,i[1])<0}}return!1}var Ks,Un,Gs,zs,Kn=P(()=>{"use strict";Ks=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})$/,Un=/^\d{4}-\d{2}-\d{2}$/,Gs=/^-?(\d{1,6})([hdwmy])$/,zs={h:3600,d:86400,w:604800,m:2592e3,y:31536e3}});function mt(t){if(typeof t=="number")return t;if(typeof t=="string"&&Js.test(t.trim()))return Number(t.trim())}function ht(t,e){let n=typeof t=="number",r=typeof e=="number";return n||r?n&&r&&t===e:t===e}function vt(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 yt(t,e){let n=vt(t),r=vt(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 re(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 c=yt(e,r);if(c===void 0)return!1;a=c===0}else a=ht(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=yt(e,r);else{let c=mt(e),l=mt(r);a=c===void 0||l===void 0?void 0:Zs(c,l)}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=>ht(e,a))===(t==="in"):!1}return t.startsWith("array_")||t.startsWith("ip_")?Hn(t,e,r,ht):Vn(t,e,r,o,{toFloat:mt,parseVersion:vt,cmpVersion:yt})}var Js,Zs,bt=P(()=>{"use strict";qn();Kn();Js=/^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/;Zs=(t,e)=>t<e?-1:t>e?1:0});function xt(t){return t.properties?.length?`${t.key}|${JSON.stringify(t.properties.map(e=>[e.key,e.op,e.value??null]))}`:t.key}function Gn(t,e,n=Date.now()){return(t.properties??[]).every(r=>re(r.op,e[r.key],Object.hasOwn(e,r.key),r.value,!1,n))}function wt(t,e){let n=e[t.scope??"session"]?.[xt(t)]??0;return t.op==="is_set"?n>0:t.op==="is_not_set"?n===0:re(t.op,n,!0,t.value,!1)}function Xn(t,e,n){for(let o of t.runtime??[])if(o.filters.every(a=>{if(a.type!=="flag")return wt(a,e);let c=n(a.key);return!!c&&re(a.op,c.value,!0,a.value,!1)}))return Xn(o.result,e,n);if(!t.runtime)return t;let{runtime:r,...s}=t;return s}function kt(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=Xn(i,e,s);return n[o]=a,r.set(o,2),a};for(let o of Object.keys(t))s(o);return n}function Ue(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 We(t,e){if(!_t(e))return e;let n=_t(t)?{...t}:{};for(let[r,s]of Object.entries(e))s===null?delete n[r]:n[r]=We(n[r],s);return n}var zn,_t,be,St=P(()=>{"use strict";bt();zn=t=>(t??[]).filter(e=>e.type==="event");_t=t=>typeof t=="object"&&t!==null&&!Array.isArray(t);be=class{session={};page={};sid="";constructor(e){if(e&&typeof e.sid=="string"&&_t(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&&Gn(i,r)&&o.add(xt(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 Yn(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 _e(t,e,n,r=!1){let s=r?`${t}.${e}.variant.${n}`:`${t}.${e}.${n}`;return parseInt(jn(s).slice(0,13),16)/eo}function to(t,e){return typeof e=="boolean"?typeof t=="boolean"?t===e:e:t===e}function no(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(!Qs.includes(t.context_kind??""))return!1;o=Yn(e,t.context_kind)?.properties;break;case"app_version":return re(t.op,e.app_version,!!e.app_version,t.value,!0,s);case"flag":{let i=n[t.key];return!!i&&re(t.op,i.value,!0,t.value,!1,s)}default:return!1}return re(t.op,o?.[t.key],!!o&&Object.hasOwn(o,t.key),t.value,!1,s)}function ro(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=_e(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 Jn(t,e){return Zn(t.aggregation,e)}function Zn(t,e){return t.kind==="group"?e.groups?.[t.group_type??""]:t.kind==="device"?e.device_id:t.kind==="context"?Yn(e,t.context_kind)?.key:e.bucketing_key||e.distinct_id}function so(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,Ve(o,i.payload,e)):void 0}if(s===!0)return Ve(o,t.type==="json"?t.payload:void 0,e)}function Ve(t,e,n){let r=n.payload_patch===void 0||n.payload_patch===null?e:We(e,n.payload_patch);return r!==void 0&&(t.payload=r),t}function oo(t,e){return!t.app_contexts?.length||!e.app_contexts?.length?!0:t.app_contexts.some(n=>e.app_contexts?.includes(n))}function Qn(t,e,n={}){if(!oo(t,e))return H("app_context_excluded");if(!t.active)return H("inactive");if(t.kill_switch)return H("kill_switch");let r=!1;for(let c of t.prerequisites??[]){let l=n[c.flag];if(!l)return H("prerequisite_missing");if(l.reason==="requires_server")r=!0;else if(l.reason==="prerequisite_cycle"||!to(l.value,c.value))return H("prerequisite_failed")}if(r)return H("requires_server");let s=Jn(t,e),o=t.conditions.some(c=>c.aggregation);if(!s&&(!o||t.holdout||t.namespace))return H("no_bucketing_key");if(t.holdout&&_e("holdout",t.holdout.salt,s??"")*100<t.holdout.percentage)return H("holdout");if(t.namespace&&t.namespace.total>0){let c=Math.floor(_e("namespace",t.namespace.salt,s??"")*t.namespace.total);if(c<t.namespace.start||c>=t.namespace.end)return H("namespace_excluded")}let i=0,a=[];for(let[c,l]of t.conditions.entries()){let d=l.aggregation?Zn(l.aggregation,e):s;if(!d){i++;continue}let f=!1,h=!0,g=!1;for(let y of l.filters??[]){if(y.type==="event"){if(e.runtime_events===void 0)g=!0;else if(!wt(y,e.runtime_events)){h=!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")){h=!1;break}}else if(y.type==="cohort"||y.type==="flag"&&n[y.key]?.reason==="requires_server")f=!0;else if(!no(y,e,n)){h=!1;break}}if(!h)continue;if(f)return Ct(H("requires_server",c),a);let x=io(t,l,c,e,d);if(x)if(g)a.push({filters:zn(l.filters),result:x});else return Ct(x,a)}return Ct(H(i>0&&i===t.conditions.length?"no_bucketing_key":"no_condition_match"),a)}function io(t,e,n,r,s){let o=e.aggregation?void 0:so(t,e,n,r);if(o)return o;if(_e(t.key,t.salt,s)*100>=e.rollout_pct)return t.early_exit?H("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=ro(t,e,s);return i.value=i.variant=a.key,Ve(i,a.payload,e)}return Ve(i,t.type==="json"?t.payload:void 0,e)}function er(t){return[...(t.prerequisites??[]).map(e=>e.flag),...t.conditions.flatMap(e=>(e.filters??[]).filter(n=>n.type==="flag").map(n=>n.key))]}function Rt(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 c=!1;for(let l of er(a))o(l),(s.get(l)===1||r[l]?.reason==="prerequisite_cycle")&&(c=!0);r[i]=c?H("prerequisite_cycle"):ao(a,e,r),s.set(i,2)};for(let i of t)o(i.key);return r}function ao(t,e,n){return Be(t,e,n,[],new Set)}function Be(t,e,n,r,s){let[o,...i]=r;if(o===void 0){let x=new Set,y=new Proxy(n,{get:(E,M)=>(x.add(String(M)),E[M])}),w=Qn(t,e,y),R=[];for(let E of er(t))x.has(E)&&!s.has(E)&&!R.includes(E)&&n[E]?.runtime?.length&&R.push(E);return R.length?Be(t,e,n,R,new Set([...s,...R])):w}let a=Be(t,e,n,i,s),c=n[o],l=new Set([c.value]),d=[];for(let x of tr(c)){if(l.has(x.value))continue;l.add(x.value);let y=Be(t,e,{...n,[o]:x},i,s);nr(y,a)||d.push({filters:[{type:"flag",key:o,op:"eq",value:x.value}],result:y})}let f=[...d,...a.runtime??[]],{runtime:h,...g}=a;return f.length?{...g,runtime:f}:g}function tr(t){return(t.runtime??[]).flatMap(e=>{let{runtime:n,...r}=e.result;return[r,...tr(e.result)]})}function nr(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(!nr(n[o],r[o]))return!1;return!0}var Qs,eo,H,Ct,Et,Pt,rr=P(()=>{"use strict";bt();St();Fn();Qs=["user","device","org"],eo=16**13;H=(t,e=-1)=>({value:!1,reason:t,condition_index:e});Ct=(t,e)=>e.length?{...t,runtime:e}:t;Et=t=>t.reason==="requires_server",Pt=t=>t.reason!=="app_context_excluded"});function $t(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 sr=P(()=>{"use strict"});function ce(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 xe,or=P(()=>{"use strict";xe=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 ho(t){let e=po;for(let n of mo.encode(t))e=(e^BigInt(n))*fo&go;return e}function lr(t){let e=(t.toLowerCase().match(/[\p{L}\p{N}]+/gu)??[]).filter(s=>Se(s).length>=2);if(!e.length)return;let n=new Array(64).fill(0);for(let s of e){let o=ho(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 ur(t){let n=` ${t.toLowerCase().replace(/’/g,"'").replace(/[.,!?;:]/g," ").replace(/\s+/g," ").trim()} `,r=0;for(let o of ar)n.includes(` ${o} `)&&(r++,n=n.split(` ${o} `).join(" "));let s=cr.filter(o=>n.includes(` ${o} `)).length;return r>s?-1:s>r?1:0}function yo(t){let e=dr(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 bo(t){let e=dr(t).length;return e>=10&&e<=15}function It(t){let e=t;for(let[n,r]of vo)e=e.replace(n,s=>r(s)?_o(s):s);return e===t?void 0:e}function pr(t){if(typeof t!="string")return;let e=t.toLowerCase();return/^[0-9a-f]{32}$/.test(e)?e:void 0}function xo(t,e,n){let r=At(e,n),s=It(r);return s===void 0?{[t]:r}:{[t]:s,$ai_text_redacted:!0}}function gr(t,e,n,r){if(t!=="user"&&t!=="assistant")return;let s={$ai_role:t,$ai_message_index:n,$ai_text_length:Se(e).length};if(t==="user"){let o=lr(e);o!==void 0&&(s.$ai_text_hash=o),s.$ai_sentiment=ur(e)}return r?{...s,...xo("$ai_text",e,lo)}:s}function mr(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=At(t.comment,uo);r.$ai_feedback_comment=It(s)??s}return t.messageIndex!==void 0&&(r.$ai_message_index=t.messageIndex),r}function Ot(t,e){let n=fr(t),r=we(e,64);return{...n?{$ai_outcome:n}:{},...r?{$ai_resolution:r}:{}}}function wo(){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 hr(t={}){let e={$ai_conversation_id:t.conversationId||wo()},n=(r,s)=>{s!==void 0&&(e[r]=s)};return n("$ai_agent_name",we(t.agentName,128)),n("$ai_agent_version",we(t.agentVersion,64)),n("$ai_topic",we(t.topic,128)),n("$ai_use_case",we(t.useCase,128)),n("$ai_trace_id",pr(t.traceId)),e}var de,co,lo,uo,ar,cr,Se,At,po,fo,go,mo,dr,ir,vo,_o,fr,we,ke,yr=P(()=>{"use strict";de={started:"$ai_conversation_started",message:"$ai_message",feedback:"$ai_feedback",ended:"$ai_conversation_ended",outcome:"$ai_outcome"},co=["resolved","unresolved","escalated","abandoned","error"],lo=4e3,uo=2e3,ar=["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"],cr=["thanks","thank you","great","perfect","awesome","helpful","that worked","works now","solved","exactly"],Se=t=>Array.from(t),At=(t,e)=>Se(t).slice(0,e).join(""),po=0xcbf29ce484222325n,fo=0x100000001b3n,go=0xffffffffffffffffn,mo=new TextEncoder;dr=t=>Se(t).filter(e=>e>="0"&&e<="9").map(Number);ir=String.raw`[\p{Alphabetic}\p{M}\p{Nd}\p{Pc}\p{Join_Control}]`,vo=[[new RegExp(String.raw`(?<!${ir})\p{Nd}(?:[ -]?\p{Nd}){12,18}(?!${ir})`,"gu"),yo],[/[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,bo]];_o=t=>Se(t).map(e=>/\s/u.test(e)?e:"*").join("");fr=t=>typeof t=="string"&&co.includes(t)?t:void 0,we=(t,e)=>typeof t=="string"&&t?At(t,e):void 0;ke=class{next=0;common;emit;captureText;constructor(e,n={},r=!1){this.emit=e,this.captureText=r,this.common=hr(n)}get id(){return this.common.$ai_conversation_id}send(e,n){this.emit(e,{...this.common,...n})}start(){return this.send(de.started,{}),this}message(e,n,r={}){let s=r.index??this.next,o=gr(e,n,s,this.captureText);return o?(this.next=s+1,this.send(de.message,o),!0):!1}feedback(e){let n=mr(e,this.captureText);return n?(this.send(de.feedback,n),!0):!1}end(e,n){this.send(de.ended,Ot(e,n))}outcome(e,n){let r=Ot(e,n);return r.$ai_outcome?(this.send(de.outcome,r),!0):!1}}});var pe=P(()=>{"use strict";$n();at();An();In();Mn();Tn();rr();St();sr();or();yr()});function _r(t,e=90,n=Date.now){let r,s=()=>{try{return JSON.parse(t.get(br)??"{}")}catch{return{}}};return()=>{let o=s();if(location.search!==r){r=location.search;let a=new URLSearchParams(r),c=!1;for(let l of G){let d=a.get(l);d&&(o[l]={v:d.slice(0,512),t:n()},c=!0)}c&&t.set(br,JSON.stringify(o))}let i={};for(let a of G){let c=o[a];c&&n()-c.t<e*864e5&&(i[a]=c.v)}return i}}var G,br,Ce=P(()=>{"use strict";G=["gclid","gad_source","gclsrc","dclid","gbraid","wbraid","fbclid","igshid","msclkid","ttclid","li_fat_id","twclid","mc_cid","rdt_cid","epik","qclid","sccid","oppref","bfcid","irclid","_kx"],br="lc_click_ids"});function To(t){let e={},n=new URLSearchParams(location.search);for(let r of[...se,...G,...t]){let s=n.get(r);s&&(e[`$${r}`]=s)}return e}function Er(){let t=new URLSearchParams(location.search),e=se.map(n=>t.get(n)??"");return e.some(Boolean)?e.join("|"):void 0}function jo(t){try{return t?new URL(t).hostname:""}catch{return""}}function Lo(){let t=location.hash;return t.length>1?location.pathname+t.split("?")[0]:location.pathname}function Pr(t,e,n=[],r=!1){let s={$current_url:Fo(),$host:location.host,$pathname:r?Lo():location.pathname,$referrer:document.referrer,$title:document.title,$screen_width:screen.width,$screen_height:screen.height,$viewport_width:window.innerWidth,$viewport_height:window.innerHeight,$browser_language:navigator.language,$timezone:Intl.DateTimeFormat().resolvedOptions().timeZone};if(navigator.maxTouchPoints>1&&(s.$touch_points=navigator.maxTouchPoints),t!=="$pageview")return{properties:s};let o=To(n);Object.assign(s,o);let i=e.$current_url??location.href,a=e.$referrer??document.referrer,c={$initial_referrer:a||"$direct",$initial_referring_domain:jo(a)||"$direct",$initial_current_url:i};for(let[l,d]of Object.entries(o))c[`$initial_${l.slice(1)}`]=d;return{properties:s,$set_once:c}}var se,Fo,Ke=P(()=>{"use strict";Ce();se=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"];Fo=()=>location.href.replace(/([?&])__lc_toolbar=[^&#]*&?/,"$1").replace(/[?&]$/,"")});function Mr(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 Tr=P(()=>{"use strict"});function Fr(t,e){let n=t,r=[...Ho,...e.maskParams??[],...e.maskCampaignParams?[...se,...G]:[]];if(r.length){let s=n.indexOf("#"),o=s<0?n:n.slice(0,s),i=s<0?"":n.slice(s);n=o.replace(new RegExp(`([?&])(${r.map(jr).join("|")})=[^&]*`,"gi"),`$1$2=${qt}`)+i}return e.stripHash&&(n=n.replace(/#.*$/,"")),n}function Ut(t){let e=new RegExp(`^\\$(initial_|last_)?(${[...se,...G].map(jr).join("|")})$`),n=r=>{let s;if(t.maskCampaignParams)for(let[o,i]of Object.entries(r))typeof i=="string"&&e.test(o)?(s??={...r})[o]=qt:o==="$click_ids"&&i&&typeof i=="object"&&((s??={...r})[o]=Object.fromEntries(Object.keys(i).map(a=>[a,qt])));for(let o of qo){let i=(s??r)[o];if(typeof i!="string")continue;let a=Fr(i,t);a!==i&&((s??={...r})[o]=a)}return s??r};return r=>({...r,properties:n(r.properties),...r.$set?{$set:n(r.$set)}:{},...r.$set_once?{$set_once:n(r.$set_once)}:{}})}var qt,Ho,qo,jr,Wt=P(()=>{"use strict";Ce();Ke();qt="<masked>",Ho=["password","passwd","pwd","pass","token","access_token","refresh_token","id_token","secret","client_secret","api_key","apikey","key","auth","authorization","code","otp","email","ssn"],qo=["$current_url","$referrer","$initial_referrer","$initial_current_url","$last_current_url"],jr=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")});function $i(t){return t.startsWith("re:")?t.slice(3):t.split("*").map(e=>e.replace(/[.+?^${}()|[\]\\]/g,"\\$&")).join(".*")}function sn(t,e){return!!t?.some(n=>{try{return new RegExp($i(n),"i").test(e)}catch{return!1}})}var ls=P(()=>{"use strict"});pe();var ko=["bot","crawl","spider","slurp","headlesschrome","phantomjs","puppeteer","playwright","lighthouse","pingdom","uptimerobot","facebookexternalhit","preview","scrapy","python-requests","go-http-client","cypress","lightpanda","hubspot","nessus","prerender","deepscan","screaming frog","sitebulb","turnitin","ia_archiver","chatgpt-user","app.hypefactors.com","google favicon","google web preview","-google","googleother","googleweblight","google-read-aloud","google-inspectiontool","google-hoteladsverifier","google-cloudvertexbot"];function vr(t,e=[]){let n=t.toLowerCase();return e.some(r=>r&&n.includes(r.toLowerCase()))?!0:ko.some(r=>n.includes(r))&&!/\bcubot\b/.test(n)}Ce();function So(t,e){let n=document.createElement("style");return e&&n.setAttribute("nonce",e),n.textContent=t,n}function Co(){return Array.from(document.querySelectorAll("meta[http-equiv]")).filter(t=>t.getAttribute("http-equiv")?.toLowerCase()==="content-security-policy").map(t=>t.getAttribute("content")??"")}function wr(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 kr(t,e){if(typeof document>"u")return()=>{};!e&&Co().some(wr)&&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 Ro=(t,e)=>t.slice(0,e);function xr(t){try{let e=new URL(t);return e.protocol==="data:"||e.protocol==="blob:"?e.protocol:e.origin+e.pathname}catch{return Ro(t,64)}}function Mt(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:xr(i.blockedURI??""),$csp_source_file:i.sourceFile?xr(i.sourceFile):void 0,$csp_line:i.lineNumber||void 0,$csp_column:i.columnNumber||void 0,$csp_disposition:i.disposition},c=[a.$csp_directive,a.$csp_blocked_uri,a.$csp_source_file,a.$csp_line].join("|");r.has(c)||r.size>=n||(r.add(c),t("$csp_violation",Object.fromEntries(Object.entries(a).filter(([,l])=>l!==void 0))))};return document.addEventListener("securitypolicyviolation",s),()=>document.removeEventListener("securitypolicyviolation",s)}var Eo=["chrome-extension:","moz-extension:","safari-web-extension:","ms-browser-extension:"],Tt=()=>typeof location<"u"&&Eo.includes(location.protocol),jt=(t,e,n)=>`${t.replace(/\/+$/,"")}/static/v${e}/${n}`,Po={replay:"replay",heatmaps:"heatmaps",forms:"forms",toolbar:"toolbar",guides:"guides",inspector:"inspector",experiments:"visualChanges","early-access":"earlyAccess",consent:"consentModule"},$o=t=>import(t);async function Oo(t,e,n=globalThis.fetch){try{let r=await n(jt(t,e,"manifest.json"),{credentials:"omit"});if(!r.ok)return;let s=await r.json();return s&&typeof s.files=="object"&&s.files?s:void 0}catch{return}}async function Ao(t){let e=new Uint8Array(await crypto.subtle.digest("SHA-384",t));return`sha384-${btoa(String.fromCharCode(...e))}`}async function Io(t,e,n,r=$o,s=globalThis.fetch){let o=t.length?await Oo(e.assetHost,e.version,s):void 0;return(await Promise.all(t.map(async a=>{let c=Po[a];if(!c)return n("unknown module",a);let l=jt(e.assetHost,e.version,`${a}.js`);try{if(o){let f=o.files[`${a}.js`],h=f?await s(l,{credentials:"omit",cache:"force-cache"}):void 0;if(!h?.ok||await Ao(await h.arrayBuffer())!==f)return n("module refused, it does not match the manifest",a)}let d=(await r(l))[c];return typeof d=="function"?d:n("module has no export",a,c)}catch(d){return n("module failed to load",a,d)}}))).filter(a=>!!a)}function Sr(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 Cr(t,e,n,r){if(!r)return{transport:t,fetch:e};let s=o=>Sr(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 Mo="__LUCIDA_DEVTOOLS_HOOK__";function Rr(t,e,n){let r=globalThis[Mo];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{}}}Ke();function Ft(t,e,n=globalThis){e&&(n[typeof e=="string"?e:"lucida"]=t,typeof CustomEvent=="function"&&n.dispatchEvent?.(new CustomEvent("lucida:ready",{detail:t})))}pe();var fe=()=>{},Lt=()=>Promise.resolve(),$r={isInternal:!1,hasOptedOut:()=>!1,hasOptedIn:()=>!1,consentStatus:()=>"pending",getConsentStatus:()=>"pending",getConsent:()=>({analytics:!1,replay:!1,marketing:!1}),getAllFlags:()=>({}),isFeatureEnabled:()=>!1,getFlagResult:t=>ce(t,void 0,void 0,"not_found"),getReplayUrl:()=>"",onSessionId:()=>fe,onFlags:()=>fe,onIntervention:()=>fe,onConsent:()=>fe,flush:Lt,shutdown:Lt,reloadFlags:Lt,loadToolbar:()=>Promise.resolve(!1),recommendations:t=>Promise.resolve({placement:t,strategy:"",items:[],shown:fe,clicked:fe})};function Or(t){return new Proxy(()=>{},{get:(e,n)=>{if(!(typeof n!="string"||n==="then"))return t&&Object.hasOwn($r,n)?$r[n]:Or(!1)}})}var Dt=()=>Or(!0);var Nt="_lcid";var Ar=(t,e)=>e.some(n=>{let r=n.replace(/^\./,"").toLowerCase();return t.toLowerCase()===r||t.toLowerCase().endsWith(`.${r}`)}),Do=(t,e=Date.now(),n)=>`${t}.${e.toString(36)}${n?`_${n}`:""}`;function No(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 Ir(t){if(!t?.length)return;let e=new URL(location.href),n=e.searchParams.get(Nt);if(n!==null){e.searchParams.delete(Nt),history.replaceState(history.state,"",e.toString());try{if(document.referrer&&!Ar(new URL(document.referrer).hostname,t))return}catch{return}return No(n)}}var Ht=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||!Ar(o.hostname,e))return;let i=new URL(o.href);i.searchParams.set(Nt,Do(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)}};Tr();Wt();function Uo(t,e,n){let r=e;for(let s of t)try{let o=s(r);if(o==null)return null;if(typeof o!="object"||typeof o.event!="string")return n("beforeSend hook returned a non-event, dropping:",typeof o),null;r=o}catch(o){return n("beforeSend hook threw, dropping event:",o),null}return r}function Nr(t,e=Math.random){return n=>t>=1?n:t<=0||e()>=t?null:{...n,properties:{...n.properties,$sample_rate:t}}}function Hr(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 Bt="lc_person_identified",Ge="lc_pending_set_once",Lr=new Set(["$identify","$create_alias","$groupidentify"]),Dr="$$client_ingestion_warning",Wo=6e4,Vt=class{constructor(e,n){this.mode=e;this.storage=n;this.identified=n.get(Bt)==="1";try{this.pending=JSON.parse(n.get(Ge)??"{}")}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(Bt,"1"))}personless(e){return this.mode==="always"?!1:(this.mode==="never"||!this.identified)&&!Lr.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(Ge,JSON.stringify(this.pending)))}take(){if(!Object.keys(this.pending).length)return;let e=this.pending;return this.pending={},this.storage.remove(Ge),e}reset(){this.identified=!1,this.pending={},this.storage.remove(Bt),this.storage.remove(Ge)}};function Bo(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,...c}=e;n={...c,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?Uo(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 Vo(t){let e=t.beforeSend?Array.isArray(t.beforeSend)?t.beforeSend:[t.beforeSend]:[];return[Ut(t.urlPrivacy??{}),...t.propertyDenylist?.length?[Hr(t.propertyDenylist)]:[],...t.sampleRate!==void 0?[Nr(t.sampleRate)]:[],...e]}function qr(t,e,n,r=Date.now){let s=new Vt(e.personProfiles??"always",t.storage),o,i,a=0,c=-1/0,l=()=>{a+=1,!(r()-c<Wo)&&(c=r(),queueMicrotask(()=>{let d=a;a=0,t.capture(Dr,{$$client_ingestion_warning_message:`client rate limit dropped ${d} event(s)`,$dropped_count:d})}))};return t.setFilter(d=>(e.rateLimit!==o&&(o=e.rateLimit,i=o?Mr(o):void 0),Bo({hooks:Vo(e),person:s,limit:d.event===Dr?void 0:i,log:n,onLimited:l},d))),s}var Kt=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)}},Ko=365,Go=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(" ")),zo=new Set("co com net org edu gov gob go ac or ne ltd plc sch mil nom".split(" "));function Xo(t){let e=t.toLowerCase().split(".");for(let n=1;n<e.length-1;n++)if(Go.has(e.slice(n).join("."))||n===e.length-2&&e[n+1].length===2&&zo.has(e[n]))return e.slice(n-1).join(".")}function Yo(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 Xo(t)}var ze=class{constructor(e={}){this.o=e}o;domain=null;attr(){if(this.domain===null)try{this.domain=this.o.domain??(this.o.crossSubdomain?Yo():void 0)}catch{this.domain=void 0}return this.domain?`; Domain=${this.domain}`:""}held=new Map;read(e){try{for(let n of document.cookie.split("; ")){let r=n.indexOf("=");if(n.slice(0,r)===e)return decodeURIComponent(n.slice(r+1))}}catch{}return null}get(e){return this.read(e)??this.held.get(e)??null}set(e,n){let r=this.o.secure??location.protocol==="https:"?"; Secure":"",s=Math.round((this.o.expiryDays??Ko)*86400);try{document.cookie=`${e}=${encodeURIComponent(n)}; Max-Age=${s}; Path=/${this.attr()}; SameSite=Lax${r}`}catch{}this.read(e)===n?this.held.delete(e):this.held.set(e,n)}remove(e){this.held.delete(e);try{document.cookie=`${e}=; Max-Age=0; Path=/${this.attr()}; SameSite=Lax`}catch{}}},ge=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{}}},Gt=class extends ge{constructor(){super("localStorage")}},Jo=["lc_identity","lc_session","lc_device_id","lc_consent","lc_person_identified"],zt=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)}},Xe=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()}},Xt=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)}},Ye=t=>`_${t.replace(/\W/g,"").slice(-8)}`;function Je(t,e,n){if(t==="memory"||t==="none")return new Kt;let r=Ye(e),s=t==="cookie"?new ze(n):t==="localStorage+cookie"?new zt(new ze(n),new Gt,o=>Jo.some(i=>o===i+r)):new ge(t);return new Xt(s,r)}function Ur(t,e,n){let r=Ye(e),s=new Set;try{for(let o of document.cookie.split("; "))s.add(o.split("=")[0]);for(let o of[globalThis.localStorage,globalThis.sessionStorage])for(let i=0;i<o.length;i++)s.add(o.key(i))}catch{}for(let o of s)if(!(!o.startsWith("lc_")||!o.endsWith(r)||o===n+r)){t.remove(o.slice(0,-r.length));try{localStorage.removeItem(o),sessionStorage.removeItem(o)}catch{}}}async function Zo(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 Wr(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 Zo(o):void 0,c=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 c.status>=400?r(s,c.status):{status:c.status}}catch{return r(s,0)}}}}var Yt={send:async()=>({status:200})};var Qo="lucida-browser",Br="0.1.6",Jt="lc_internal",ei=3e3,Qt="https://capture.lucidace.com",Zt=t=>!!t&&typeof t=="object"&&Object.getPrototypeOf(t)===Object.prototype;function en(t,e={},n=[]){if(typeof window>"u"||typeof navigator>"u")return Dt();let r=!!e.debug||typeof location<"u"&&/[?&]__(lc|lucida)_debug=(1|true)/.test(location.search),s=(...u)=>{r&&console.debug("[lucida]",...u)},o=(e.apiHost??Qt).replace(/\/+$/,""),i=Object.fromEntries(Object.entries(e).map(([u,m])=>[u,Zt(m)?{...m}:m]));i.apiHost=o;let a=e.extension??Tt(),c=u=>a&&(u==="cookie"||u==="localStorage+cookie")?e.extensionPersistence??"localStorage":u,l=c(e.cookieless==="always"?"none":e.persistence??"cookie"),d=[o,...e.flagsApiHost?[e.flagsApiHost.replace(/\/+$/,"")]:[]],f=e.fetch??((...u)=>fetch(...u)),h=u=>Cr(u,f,d,e.rewritePath),g=h(Yt).fetch,x=e.consent?.respectDnt,y=navigator.globalPrivacyControl===!0,w=(e.respectDnt??x)===!0&&navigator.doNotTrack==="1"||(e.respectGpc??x)===!0&&y,R=e.blockBots!==!1&&typeof navigator<"u"&&vr(navigator.userAgent??"",e.blockedUserAgents),E=!!e.disabled||R;R&&s("bot user agent: capture disabled");let M,U=h(e.transport??Wr(f,{headers:i.requestHeaders,onError:e.onRequestError,disableBeacon:e.disableBeacon})).transport;if(!e.transport&&e.offlineQueue!==!1&&l!=="memory"&&l!=="none"){let u=new ne(new ge(l==="sessionStorage"?"sessionStorage":"localStorage"),()=>v.hasConsent("analytics"));U=M=gt(U,u,{key:`lc_offline${Ye(t)}`,isOnline:()=>navigator.onLine!==!1})}let A=E?void 0:Ir(e.crossDomains),C=Je(E?"memory":l,t,e.cookie),I=(e.storageWriteDelayMs??0)>0?new Xe(C,e.storageWriteDelayMs):void 0,O=A?.sessionId??e.bootstrap?.sessionId,q,T=!1,N,F=[],v=new ve({apiKey:t,apiHost:o,transport:E?Yt:U,storage:I??C,...e.consentPersistence&&!E?{consentStorage:Je(c(e.consentPersistence),t,e.cookie)}:{},persistProperty:u=>!i.persistedProperties||i.persistedProperties.includes(u),...l==="none"?{cookieless:!0}:{},library:{name:Qo,version:Br},consent:{...e.cookieless==="on_reject"?{cookielessOnReject:!0}:{},...e.consent,...!E&&(e.consent?.geo||e.consent?.mode!=="opt_in")?{awaitRemote:!0}:{},respectDnt:!0,dnt:w},queue:{...e.flushAt?{flushAt:e.flushAt}:{},...e.flushIntervalMs?{flushIntervalMs:e.flushIntervalMs}:{}},...A||e.bootstrap?.distinctId?{bootstrapDistinctId:A?.distinctId??e.bootstrap?.distinctId}:{},...e.bootstrap?.isIdentified&&!A?{bootstrapIdentified:!0}:{},session:{...e.session,...O?{bootstrapId:O}:{}},enrich:(u,m)=>{let _=Pr(u,m,i.customCampaignParams,e.capturePageview==="hash");if(o!==Qt&&(_.properties={..._.properties,$lib_custom_api_host:o}),F.length){let S=v.sessionId;for(let $ of F)_.properties={..._.properties,...$(S)}}let p=N?.()??{},b=Object.keys(p);return b.length&&(_.properties={..._.properties,$click_ids:p},u==="$pageview"&&(_.$set_once={...Object.fromEntries(b.map(S=>[`$initial_${S}`,p[S]])),..._.$set_once},_.$set=Object.fromEntries(b.map(S=>[`$last_${S}`,p[S]])))),i.sendFeatureFlags!==!1&&u!=="$snapshot"&&q&&(_.properties={...$t(q.all()),..._.properties}),T?{..._,properties:{..._.properties,$internal:!0}}:_},campaignKey:Er,log:s});T=v.storage.get(Jt)==="1",e.clickIds!==!1&&(N=_r(v.storage,e.clickIds?.expiryDays));let L=qr(v,i,s);e.bootstrap?.isIdentified&&L.markIdentified();let J=u=>L.blocksPersonWrites?(s(`personProfiles=never: ${u} ignored`),!0):!1;E||v.onChange(u=>{u!=="consent"||v.hasConsent("analytics")||v.consentStatus()!=="denied"||(I?.flush(),Ur(C,t,e.consent?.storageKey||Oe))});let le=new Set;v.onChange(u=>{u==="consent"&&[...le].forEach(m=>m())});let Z=[],z=[kr(s,e.nonce)],me=v.storage;if(e.flagPersistence&&!E){let u=new ne(Je(c(e.flagPersistence),t,e.cookie),()=>v.hasConsent("analytics"));v.onChange(m=>{m==="consent"&&(v.hasConsent("analytics")?u.flushBuffered():u.discardBuffered())}),me=u}let oe=u=>{if(E)return;if(v.hasConsent("analytics"))return u();let m=!1;v.onChange(_=>{!m&&_==="consent"&&v.hasConsent("analytics")&&(m=!0,u())})},ie,k={core:v,client:void 0,config:i,flagStorage:me,apiKey:t,log:s,fetch:g,onUnload:u=>{Z.push(u)},whenConsented:oe,onCapture:u=>v.onCaptured(u),eventExtras:F,clickExtras:[],flagPersonProps:[],loadConfig:()=>ie??=new Promise(u=>oe(()=>{g(`${o}/v1/config?api_key=${encodeURIComponent(t)}`).then(m=>m.ok?m.json():null).then(m=>(m&&v.applyRemote(m),m)).then(u,()=>u(null))}))},he=Promise.resolve();if(v.consent.resolving){let u=!1,m=g(`${o}/v1/config?api_key=${encodeURIComponent(t)}`,{credentials:"omit"}).then(_=>(u=_.status>=500,_.ok?_.json():null)).catch(()=>(u=!0,null));ie=m,he=new Promise(_=>{let p=setTimeout(()=>(v.resolveConsent("opt_in"),_()),ei);m.then(b=>{clearTimeout(p),b?v.applyRemote(b):u?v.resolveConsent("opt_in"):v.applyRemote({}),_()})})}let Q=ft(v,{apiHost:o,apiKey:t,fetch:g,whenConsented:oe,log:s,disabled:E});z.push(()=>Q.stop());let ee={get distinctId(){return v.distinctId},capture:(u,m,_)=>{v.capture(u,m,_?.timestamp!==void 0?{timestamp:_.timestamp}:{})&&(_?.sendInstantly||_?.transport)&&v.flush(_.transport==="beacon"?{beacon:!0}:{})},identify:(u,m,_)=>{J("identify")||(L.markIdentified(),v.identify(u,m,_))},alias:(u,m)=>{J("alias")||(L.markIdentified(),v.alias(u,m))},reset:u=>{v.reset({resetDeviceId:!!u,reuseAnonymousId:!!e.reuseAnonymousId}),L.reset()},createPersonProfile:()=>{J("createPersonProfile")||L.isProfile||(L.markIdentified(),v.capture("$set",{}))},setConfig:u=>{let m=i;for(let[_,p]of Object.entries(u)){let b=m[_];Zt(b)&&Zt(p)?Object.assign(b,p):m[_]=p}"debug"in u&&(r=!!u.debug)},setPersonProperties:(u,m)=>{!u&&!m||J("setPersonProperties")||(L.markIdentified(),v.capture("$set",{},{...u?{$set:u}:{},...m?{$set_once:m}:{}}))},unsetPersonProperties:u=>{!u.length||J("unsetPersonProperties")||(L.markIdentified(),v.capture("$set",{},{$unset:u}))},getDistinctId:()=>v.distinctId,getSessionId:()=>v.sessionId,onSessionId:u=>v.onSessionId(m=>u(m)),getProperty:u=>v.getProperty(u),hasOptedOut:()=>v.consentStatus()==="denied",hasOptedIn:()=>v.consentStatus()==="granted",onConsent:u=>(le.add(u),()=>{le.delete(u)}),getReplayUrl:u=>{let _=`${(e.uiHost??o).replace(/\/+$/,"")}/replays/${encodeURIComponent(v.sessionId)}`,p=v.sessionStart;return!u?.withTimestamp||p===void 0?_:`${_}?t=${Math.max(0,Math.round((Date.now()-p)/1e3-(u.timestampLookBackSeconds??10)))}`},debug:(u=!0)=>{r=u},featureView:(u,m)=>{v.capture("$feature_view",{...m,$feature_flag:u},{$set:{[`$feature_view/${u}`]:!0}})},featureInteraction:(u,m)=>{v.capture("$feature_interaction",{...m,$feature_flag:u},{$set:{[`$feature_interaction/${u}`]:!0}})},updateFlags:(u,m,_)=>k.flags?.update(u,m,_?.merge??!0),register:u=>v.register(u),registerOnce:u=>v.registerOnce(u),unregister:u=>v.unregister(u),group:(u,m,_)=>{L.markIdentified(),v.group(u,m,_)},optIn:(u=["analytics","replay"])=>v.setConsent({analytics:u.includes("analytics"),replay:u.includes("replay"),marketing:u.includes("marketing")}),optOut:()=>v.optOut(),optOutInternal:(u=!0)=>{T=u,u?v.storage.set(Jt,"1"):v.storage.remove(Jt)},get isInternal(){return T},setConsent:u=>v.setConsent(u),getConsent:()=>v.getConsent(),getConsentStatus:u=>v.getConsentStatus(u),consentStatus:()=>v.consentStatus(),getFlag:u=>k.flags?.get(u),getFlagPayload:u=>k.flags?.payload(u),getFlagResult:(u,m)=>k.flags?.result(u,m)??ce(u,void 0,void 0,"not_found"),getLayerParam:(u,m,_)=>k.flags?.layerParam(u,m)??_,isFeatureEnabled:u=>{let m=k.flags?.get(u);return m!==void 0&&m!==!1},onFlags:u=>k.flags?.onChange(u)??(()=>{}),onIntervention:u=>Q.on(u),reloadFlags:()=>k.flags?.reload()??Promise.resolve(),getAllFlags:()=>k.flags?.all()??{},overrideFlags:(u,m)=>k.flags?.override(u,m),setPersonPropertiesForFlags:(u,m)=>k.flags?.setPersonProperties(u,m),resetPersonPropertiesForFlags:()=>k.flags?.resetPersonProperties(),setGroupPropertiesForFlags:(u,m)=>k.flags?.setGroupProperties(u,m),resetGroupPropertiesForFlags:()=>k.flags?.resetGroupProperties(),setContext:(u,m,_)=>k.flags?.setContext(u,m,_),clearContext:u=>k.flags?.clearContext(u),guides:{showChangelog:()=>k.guides?.showChangelog()??0,show:u=>k.guides?.show(u)??!1,reset:u=>k.guides?.reset(u)},ai:{startConversation:u=>new ke((m,_)=>ee.capture(m,_),u,i.ai?.captureText===!0).start()},earlyAccess:{list:()=>k.earlyAccess?.list()??Promise.resolve([]),optIn:u=>k.earlyAccess?.optIn(u),optOut:u=>k.earlyAccess?.optOut(u)},replay:{start:u=>k.replay?.start(u)??Promise.resolve(),stop:()=>k.replay?.stop(),pause:()=>k.replay?.pause(),resume:()=>k.replay?.resume(),tag:u=>k.replay?.tag(u),isRecording:()=>k.replay?.isRecording()??!1},consent:{showBanner:u=>k.consentUi?.showBanner(u)??Promise.resolve(null),hideBanner:()=>k.consentUi?.hideBanner()},loadToolbar:u=>k.toolbar?.load(typeof u=="string"?u:u.token)??Promise.resolve(!1),activateExperiment:u=>k.experiments?.activate(u),recommendations:(u,m)=>k.recs?.get(u,m)??Promise.resolve({placement:u,strategy:"",items:[],shown(){},clicked(){}}),flush:()=>he.then(()=>v.flush()),shutdown:async()=>{for(let u of z)u();I?.flush(),await v.shutdown()}};if(k.client=ee,!E){let u=()=>{for(let _ of Z)_();I?.flush(),v.flush({beacon:!0})};window.addEventListener("pagehide",u);let m=()=>{document.visibilityState==="hidden"&&v.flush({beacon:!0})};if(document.addEventListener("visibilitychange",m),z.push(()=>{window.removeEventListener("pagehide",u),document.removeEventListener("visibilitychange",m)}),M){let _=()=>{M.drain()};window.addEventListener("online",_),z.push(()=>window.removeEventListener("online",_)),oe(_)}if(e.captureCspViolations){let _=typeof e.captureCspViolations=="object"?e.captureCspViolations:{};z.push(Mt((p,b)=>{v.capture(p,b)},_))}for(let _ of n){let p=_(k);p&&z.push(p)}q=k.flags,n.length||k.loadConfig(),Rr(k,ee,o)}return Ft(ee,e.exposeGlobal),s("initialised",{apiHost:o,consent:v.getConsent()}),ee}var ti='[data-lc-region="article"]';function Vr(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,ti])if(y)try{let w=document.querySelector(y);if(w)return w}catch{}return null},o=location.href,i=location.pathname,a=null,c=0,l=!1,d=()=>{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)));c=Math.max(c,w);let R=a.querySelector("h1,h2");R&&R.getBoundingClientRect().bottom<0&&(l=!0)},f=()=>{!a||!n()||(d(),t.client.capture("$article_read",{$article_id:(a.getAttribute("data-lc-article-id")??"").trim().slice(0,200)||i,$article_depth:c,$article_finished:c>=90,$article_headline_exit:!l&&c<25}),a=null)},h=()=>{f(),a=null,c=0,l=!1,o=location.href,i=location.pathname},g=()=>location.href!==o?h():d(),x=new MutationObserver(g);return x.observe(document.documentElement,{childList:!0,subtree:!0}),window.addEventListener("scroll",g,{passive:!0}),t.onUnload(f),d(),()=>{x.disconnect(),window.removeEventListener("scroll",g)}}var Ze="data-lc-content",ni="data-lc-content-piece",ri="data-lc-content-target";var tn=(t,e)=>(t.getAttribute(e)??"").trim().slice(0,200);function Kr(t,e,n){if(e.contentBlocks===!1||typeof IntersectionObserver>"u")return()=>{};let r=new WeakSet,s=d=>{let f={$content_name:tn(d,Ze)},h=tn(d,ni),g=tn(d,ri);return h&&(f.$content_piece=h),g&&(f.$content_target=g),f},o=location.href,i=new IntersectionObserver(d=>{for(let f of d)!f.isIntersecting||r.has(f.target)||!n()||(r.add(f.target),t.client.capture("$content_impression",s(f.target)))},{threshold:.5}),a=d=>d.querySelectorAll(`[${Ze}]`).forEach(f=>i.observe(f));a(document);let c=new MutationObserver(()=>{location.href!==o&&(o=location.href,i.disconnect(),document.querySelectorAll(`[${Ze}]`).forEach(d=>r.delete(d))),a(document)});c.observe(document.documentElement,{childList:!0,subtree:!0});let l=d=>{let f=d.target?.closest?.(`[${Ze}]`);f&&n()&&t.client.capture("$content_interaction",{...s(f),$content_interaction_type:"click"})};return document.addEventListener("click",l,!0),()=>{i.disconnect(),c.disconnect(),document.removeEventListener("click",l,!0)}}var si=new Set(["input","textarea","select","option"]),oi=["name","type","role","aria-label","title","alt","placeholder"],ii=/(?:\d[ -]?){9,}/;function ai(t){if(si.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||ii.test(e)))return e.slice(0,255)}function Gr(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 ci="***";function et(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 li(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(d=>d.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 c=t.getAttribute("href");c&&!n("href")&&(i.href=r("href",c.slice(0,1024)));let l={};for(let d of Array.from(t.attributes))(d.name.startsWith("data-lc-")||oi.includes(d.name))&&!n(d.name)&&(l[d.name]=r(d.name,d.value.slice(0,255)));if(Object.keys(l).length&&(i.attrs=l),e){let d=ai(t);d&&(i.text=d)}return i}function tt(t,e,n,r,s={}){let o=[],i=Gr(r),a=Gr(s.allow),c=s.maskAll?(d,f)=>a(d)?f:ci:(d,f)=>f,l=e;for(let d=t;d&&o.length<10;d=d.parentElement)o.push(li(d,l,i,c)),(d===n||!n)&&(l=!1);return o}var Qe=t=>t.replace(/(["\\])/g,"\\$1");function nt(t){return t.map(e=>{let n=e.tag_name+(e.classes?"."+e.classes.join("."):"")+":";e.attr__id&&(n+=`attr__id="${Qe(e.attr__id)}"`),e.href&&(n+=`href="${Qe(e.href)}"`),e.text&&(n+=`text="${Qe(e.text)}"`);for(let[r,s]of Object.entries(e.attrs??{}))n+=`attr__${r}="${Qe(s)}"`;return n+`nth-child="${e.nth_child}"nth-of-type="${e.nth_of_type}"`}).join(";")}var Y=[],ui=/^[+\-−–‹›<>«»←→↑↓▲▼▶◀^ˇ˄˅]$/,di=/\b(increase|decrease|increment|decrement|plus|minus|add one|remove one|next|prev|previous|scroll (left|right))\b/i,pi=/(^|[-_\s])(stepper|spinner|quantity|qty|increment|decrement|inc|dec|plus|minus|carousel|slider|swiper|slick|glide|splide|arrow|next|prev)([-_\s]|$)/i,fi="button,[role=button],a,input[type=button],input[type=submit],[role=spinbutton]";function gi(t,e=[]){if(e.length&&t.closest(e.join(","))||t.closest("input[type=number],[role=spinbutton],[role=slider]"))return!0;let n=t.closest(fi)??t,r=`${n.getAttribute("aria-label")??""} ${n.getAttribute("title")??""}`;if(ui.test((n.textContent??"").trim())||di.test(r))return!0;for(let s=n,o=0;s&&o<3;s=s.parentElement,o++)if(pi.test(s.getAttribute("class")??""))return!0;return!1}var mi=()=>typeof getSelection=="function"?(getSelection()?.toString()??"")!=="":!1;function zr(t,e=Date.now(),n={},r){if(r&&n.ignoreSelectors?.length&&r.closest(n.ignoreSelectors.join(",")))return{};if(r&&n.suppressSteppers!==!1&&gi(r,n.stepperSelectors))return{};if(n.ignoreTextSelection!==!1&&mi())return{};let s=n.windowMs??1e3,o=n.radiusPx??30;for(Y.length&&e<Y[Y.length-1].t&&(Y.length=0),Y.push({t:e,x:t.clientX,y:t.clientY});Y.length&&e-Y[0].t>s;)Y.shift();let i=Y.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 Xr(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 Yr=/^[A-Za-z_][\w-]*$/,hi=5;function yi(t){let e=[];for(let n=t;n&&e.length<hi;n=n.parentElement){let r=n.tagName.toLowerCase();if(n.id&&Yr.test(n.id)){e.unshift(`${r}#${n.id}`);break}let s=(n.getAttribute("class")??"").split(/\s+/).filter(o=>Yr.test(o)).slice(0,2);e.unshift(r+s.map(o=>`.${o}`).join(""))}return e.join(" ")}function Jr(t,e,n,r,s={}){let o={$selector:yi(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,zr(e,Date.now(),s.rageClicks||{},n));let i=s.deadClicks;!r&&e.isTrusted&&i!==!1&&!(i?.ignoreSelectors?.length&&n.closest(i.ignoreSelectors.join(",")))&&Xr(t,o.$selector,i?.waitMs);for(let a of t.clickExtras)Object.assign(o,a(e,n));return o}var vi="a,button,input,select,textarea,label,summary,[role=button],[role=link],[data-lc-capture]",bi="[data-lc-ignore]",nn=t=>t.some(e=>typeof e=="string"?location.href.includes(e):e.test(location.href)),_i=t=>!t?.length||nn(t),rn=t=>({maskAll:t.maskAllAttributes,allow:t.attributeAllowlist}),Re=(t,e)=>!!t.closest(bi)||!!(e.denySelectors?.length&&t.closest(e.denySelectors.join(",")));function Zr(t,e,n,r=()=>!0){let s=e.events??["click","change","submit"],o=0,i=l=>{let d=l.target;!n()||!r()||l.isComposing||!(d instanceof Element)||Re(d,e)||d instanceof HTMLInputElement&&d.type==="password"||(o+=1)},a=l=>d=>{if(!n()||l!=="click"&&!r())return;let f=d.target;if(!(f instanceof Element)||Re(f,e)||e.allowSelectors?.length&&!f.closest(e.allowSelectors.join(","))||e.elementAllowlist?.length&&!f.closest(e.elementAllowlist.join(","))||!_i(e.urlAllowlist)||l==="change"&&!/^(input|select|textarea)$/i.test(f.tagName)||f instanceof HTMLInputElement&&f.type==="password")return;let h=f.closest(vi);if(l==="click"&&!h&&!e.allowSelectors?.length)return;let g=tt(f,e.captureText??!0,h??void 0,e.attributeIgnore,rn(e)),x=g.find(w=>w.text)?.text,y=o;o=0,t.client.capture("$autocapture",{...et(f),$event_type:l,...y>0?{$keystroke_count:y}:{},$elements:g,$elements_chain:nt(g),...x?{$el_text:x}:{},...l==="click"?Jr(t,d,f,!!h,e):{}})};t.autocaptureClicks=s.includes("click");let c=s.map(l=>[l,a(l)]);for(let[l,d]of c)document.addEventListener(l,d,!0);return document.addEventListener("keydown",i,!0),()=>{for(let[l,d]of c)document.removeEventListener(l,d,!0);document.removeEventListener("keydown",i,!0)}}var xi='[contenteditable]:not([contenteditable="false"])',Qr="input,textarea,select",wi=255;function ki(t){return t.replace(/\d(?:[ -]?\d){5,}/g,"***").replace(/[^\s@]+@[^\s@]+\.[^\s@]+/g,"***").replace(/\s+/g," ").trim().slice(0,wi)}var Si=t=>t?t instanceof Element?t:t.parentElement:null;function es(t,e,n,r=()=>!0){let s=e.events??["click","change","submit"],o=e.contentEditable!==!1&&s.includes("change"),i=new WeakSet,a=h=>{let g=tt(h,!1,h,e.attributeIgnore,rn(e));return{...et(h),$elements:g,$elements_chain:nt(g)}},c=h=>{let g=h instanceof Element?h.closest(xi):null;return g&&!Re(g,e)?g:null},l=h=>{let g=n()&&r()?c(h.target):null;g&&i.add(g)},d=h=>{let g=c(h.target);!g||!i.has(g)||h.relatedTarget instanceof Node&&g.contains(h.relatedTarget)||(i.delete(g),n()&&r()&&t.client.capture("$autocapture",{$event_type:"change",$el_contenteditable:!0,...a(g)}))},f=h=>{if(!n()||!e.copyCut)return;let g=typeof getSelection=="function"?getSelection():null,x=h.target instanceof Element?h.target:null,y=Si(g?.anchorNode)??x;if(!y||Re(y,e)||y.closest(Qr)||x?.closest(Qr))return;let w=e.captureCopiedText?ki(g?.toString()??""):"";t.client.capture("$copy_autocapture",{$copy_type:h.type,...a(y),...w?{$selected_content:w}:{}})};return o&&(document.addEventListener("input",l,!0),document.addEventListener("focusout",d,!0)),document.addEventListener("copy",f,!0),document.addEventListener("cut",f,!0),()=>{document.removeEventListener("input",l,!0),document.removeEventListener("focusout",d,!0),document.removeEventListener("copy",f,!0),document.removeEventListener("cut",f,!0)}}var Ci="[data-lc-ignore]",ns=["pdf","zip","gz","tar","rar","7z","doc","docx","xls","xlsx","ppt","pptx","csv","epub","dmg","exe","msi","pkg","apk","iso","mp3","mp4","mov"],rs=["q","s","search","query"],ts=t=>t.origin+t.pathname;function ss(t,e,n){let r=Array.isArray(e.fileDownloads)?e.fileDownloads.map(o=>o.toLowerCase()):ns,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(Ci))return;let c;try{c=new URL(a.href,location.href)}catch{return}if(c.protocol!=="http:"&&c.protocol!=="https:")return;let l=decodeURIComponent(c.pathname.split("/").pop()??""),d=l.includes(".")?l.split(".").pop().toLowerCase():"";e.fileDownloads!==!1&&(a.hasAttribute("download")||r.includes(d))?t.client.capture("$file_download",{$url:ts(c),$file_name:l,$file_extension:d}):e.outboundLinks!==!1&&c.host!==location.host&&t.client.capture("$outbound_click",{$url:ts(c),$outbound_host:c.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:rs,i=!0;s.push(()=>{i=!1}),t.onCapture(a=>{if(!i||a.event!=="$pageview"||!n())return;let c=new URLSearchParams(location.search);for(let l of o){let d=c.get(l)?.trim();if(d)return void t.client.capture("$site_search",{$search_term:d.slice(0,200),$search_param:l})}})}return()=>s.forEach(o=>o())}function os(t,e={}){t.capture("$page_not_found",{$status:404,...e})}var Ri=[25,50,75],Ei="data-lc-media-title";function is(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 Pi=t=>(t.getAttribute(Ei)??t.getAttribute("title")??t.getAttribute("aria-label")??"").trim().slice(0,200);function as(t,e,n){if(e.media===!1)return()=>{};let r=new WeakMap,s=c=>{let l={$media_type:c instanceof HTMLVideoElement?"video":"audio",$media_src:is(c)},d=Pi(c);return d&&(l.$media_title=d),Number.isFinite(c.duration)&&(l.$media_duration=Math.round(c.duration)),l},o=c=>{let l=is(c);if(!l)return null;let d=r.get(c);return(!d||d.src!==l)&&r.set(c,d={src:l,played:!1,reached:new Set,done:!1}),d},i=c=>{let l=c.target;if(!(l instanceof HTMLMediaElement)||!n())return;let d=o(l);if(d)if(c.type==="play"){if(d.done&&Object.assign(d,{played:!1,reached:new Set,done:!1}),d.played)return;d.played=!0,t.client.capture("$media_play",s(l))}else if(c.type==="timeupdate"){if(!d.played||d.done||!Number.isFinite(l.duration)||l.duration<=0)return;let f=l.currentTime/l.duration*100;for(let h of Ri)f>=h&&!d.reached.has(h)&&(d.reached.add(h),t.client.capture("$media_progress",{...s(l),$media_progress:h}))}else c.type==="ended"&&d.played&&!d.done&&(d.done=!0,t.client.capture("$media_complete",s(l)))},a=["play","timeupdate","ended"];return a.forEach(c=>document.addEventListener(c,i,!0)),()=>a.forEach(c=>document.removeEventListener(c,i,!0))}function cs(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)}}ls();var us=255,Oi=new Set(["input","textarea","select","option"]),Ai="[data-lc-mask],.lc-mask,[data-lc-no-capture],.lc-no-capture,[data-lc-block]",Ii=new Set(["value","password","autocomplete"]),Mi=/(?:\d[ -]?){9,}/,Ee=new WeakMap,on=new WeakMap;function ds(t,e){let n=on.get(t);if(n)return new Promise(r=>{let s=setTimeout(r,e);n.then(()=>(clearTimeout(s),r()))})}function Ti(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 ji(t){if(!t||Oi.has(t.tagName.toLowerCase())||t.isContentEditable)return!1;try{return!t.closest(Ai)}catch{return!1}}function Fi(t,e){if(t.source==="attribute"){let r=(t.attribute??"").toLowerCase();if(!r||Ii.has(r)||r.startsWith("on"))return;let s=e.getAttribute(r);return s===null?void 0:s.slice(0,us)}let n=(e.textContent??"").replace(/\s+/g," ").trim();if(!(!n||Mi.test(n)))return n.slice(0,us)}function ps(t,e,n,r=location.href){let s={};for(let o of t){if(!o.events.includes(e)||o.url&&!sn([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(!ji(i))continue;let a=Fi(o,i);a!==void 0&&(s[o.name]=a)}return s}function fs(t){let e=!0,n=t.loadConfig().then(r=>{e&&Ee.set(t,Ti(r?.snapshot_properties)),on.delete(t)});return on.set(t,n),t.clickExtras.push((r,s)=>e?ps(Ee.get(t)??[],"click",s):{}),()=>{e=!1,Ee.delete(t)}}function gs(t){let e=Ee.get(t);return e?.length?ps(e,"pageview"):{}}function ms(t){return!!Ee.get(t)?.some(e=>e.events.includes("pageview"))}var Li=t=>{try{return new URL(t).pathname}catch{return t}};function Di(t){for(let e of t===void 0?[]:Array.isArray(t)?t:[t])try{let n=document.querySelector(e);if(n)return n}catch{}}function hs(t){let e=0,n=0,r=()=>{let s=Di(t),o=document.documentElement,i=s?s.scrollHeight:Math.max(o.scrollHeight,document.body?.scrollHeight??0),a=s?s.scrollTop:window.scrollY||window.pageYOffset||0,c=Math.min(i,a+(s?s.clientHeight:window.innerHeight));c>e&&(e=c,n=i>0?Math.min(100,Math.round(c/i*100)):0)};return r(),window.addEventListener("scroll",r,{passive:!0,capture:!0}),window.addEventListener("resize",r,{passive:!0}),{read:()=>({pct:n,px:e}),stop:()=>{window.removeEventListener("scroll",r,{capture:!0}),window.removeEventListener("resize",r)}}}var Ni=800,Hi=t=>t.core.hasConsent("analytics")||t.core.consent.resolving;function qi(t){return t==="history"?{path:!0,search:!0}:t==="hash"?{path:!0,search:!0,hash:!0}:typeof t=="object"?t:void 0}function Ui(t,e,n){try{let r=new URL(t),s=new URL(e);return!!(n.path&&r.pathname!==s.pathname||n.search&&r.search!==s.search||n.hash&&r.hash!==s.hash)}catch{return t!==e}}function rt(t,e,n={}){let r=n.views??!0,s=n.leave??!0,o=qi(e),i=t.config.scrollRoot,a=location.href,c=a,l=Date.now(),d=hs(i),f=cs(),h,g=()=>{if(!s||h===a)return;h=a;let{pct:O,px:q}=d.read();t.client.capture("$pageleave",{$current_url:a,$scroll_depth:O,$scroll_depth_px:q,$engagement_time_ms:f.read()})},x=!1,y=(O,q={})=>{if(!r)return;let{core:T}=t;if(!T.hasConsent("analytics")&&!T.anonymousOnReject&&!(T.consent.pending&&T.consent.queueBeforeConsent)){if(!x){x=!0;let N=()=>{x&&(x=!1,y())};t.whenConsented(N),T.onChange(F=>{F==="consent"&&T.anonymousOnReject&&N()})}return}t.client.capture("$pageview",{...gs(t),...O===void 0?{}:{$referrer:O},...q})},w,R=()=>{let O=w;w=void 0,O?.()},E=O=>{if(location.href===c)return;let q=c;if(c=location.href,!o||!Ui(q,c,o))return;let T=a;g(),d.stop();let N=new Date(l);a=location.href,l=Date.now(),d=hs(i),f.reset();let F={$navigation_type:O,$prev_pageview_pathname:Li(T),$prev_pageview_duration:Math.round((l-N.getTime())/100)/10};ms(t)?setTimeout(()=>y(T,F),0):(R(),w=()=>y(T,F),queueMicrotask(R))};t.onUnload(g);let M=Hi(t)?ds(t,Ni):void 0;if(M?(w=()=>y(),t.onUnload(R),M.then(R)):y(),!o)return()=>(d.stop(),f.stop());let{pushState:U,replaceState:A}=history;history.pushState=function(...O){R(),U.apply(this,O),E("pushState")},history.replaceState=function(...O){R(),A.apply(this,O),E("replaceState")};let C=()=>E("popstate"),I=()=>E("hashchange");return window.addEventListener("popstate",C),o.hash&&window.addEventListener("hashchange",I),()=>{window.removeEventListener("hashchange",I),history.pushState=U,history.replaceState=A,window.removeEventListener("popstate",C),d.stop(),f.stop()}}var an=t=>{let e=[],n=t.config.autocapture,r=!1,s=!1;if(n!==!1){let a=typeof n=="object"?n:{},c=()=>!r&&!(a.urlIgnorelist?.length&&nn(a.urlIgnorelist)),l=()=>!s;e.push(Zr(t,a,c,l),es(t,a,c,l),ss(t,a,c),Kr(t,a,c),Vr(t,a,c),as(t,a,c),fs(t)),n===void 0&&t.loadConfig().then(d=>r=d?.autocapture===!1),t.loadConfig().then(d=>s=d?.autocapture_inputs===!1)}let o=t.config.capturePageview??"history",i=t.config.capturePageleave??"if_capture_pageview";return o!==!1&&i!==!1?e.push(rt(t,o)):o!==!1?e.push(rt(t,o,{leave:!1})):i===!0&&e.push(rt(t,"history",{views:!1})),()=>e.forEach(a=>a())};pe();var Wi="lc_preview",cn="lc_preview";function Bi(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 ys(t){let e=new URL(t).searchParams.get(Wi),n=null;try{n=sessionStorage.getItem(cn)}catch{}return{forced:Bi(e==="off"?null:e??n),persist(){try{e==="off"?sessionStorage.removeItem(cn):e&&sessionStorage.setItem(cn,e)}catch{}}}}Ce();Ke();var ln="lc_flag_initial";function Vi(t){try{return t?new URL(t).hostname:""}catch{return""}}function Ki(){let t=new URLSearchParams(location.search),e={$initial_referrer:document.referrer||"$direct",$initial_referring_domain:Vi(document.referrer)||"$direct",$initial_current_url:location.href.split("#")[0]};for(let n of[...se,...G]){let r=t.get(n);r&&(e[`$initial_${n}`]=r)}return e}function bs(t,e){if(typeof location>"u")return{};let n=t.get(ln);if(n)try{return JSON.parse(n)}catch{}let r=Ki();return e(()=>{t.get(ln)||t.set(ln,JSON.stringify(r))}),r}function Gi(){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 _s(){if(typeof location>"u"||typeof navigator>"u")return{};let t={},e=new URLSearchParams(location.search);for(let s of[...se,...G]){let o=e.get(s);o&&(t[`$${s}`]=o)}let{browser:n,os:r}=Gi();return t.$browser=n,t.$os=r,t.$device_type=String(dn().$device_type??"Desktop"),t}function dn(){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:zi(t)}}function zi(t,e=navigator){let n=e.userAgent??"";return/iPad|Tablet|PlayBook|Silk|Kindle/i.test(n)||/Macintosh/.test(n)&&(e.maxTouchPoints??0)>1?"Tablet":/Android/i.test(n)?/Mobile/i.test(n)?"Mobile":"Tablet":/iPhone|iPod|Mobile|Windows Phone|BlackBerry|Opera Mini/i.test(n)||e.userAgentData?.mobile?"Mobile":/Windows|Macintosh|X11|CrOS|Linux/i.test(n)?"Desktop":t<768?"Mobile":t<1024?"Tablet":"Desktop"}var Xi=/^[A-Za-z0-9_.-]{1,100}$/,Yi=/^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*){0,5}$/,Ji=new Set(["__proto__","prototype","constructor"]),Zi=50,xs=200;function vs(t,e){if(!Yi.test(e))return;let n=t;for(let r of e.split(".")){if(Ji.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,xs);if(typeof n=="number"&&Number.isFinite(n)||typeof n=="boolean")return n}function Qi(){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,xs))}return t}function un(t){let e={};if(!t||typeof window>"u")return e;let n=o=>Array.isArray(o)?o.filter(i=>typeof i=="string").slice(0,Zi):[],r=n(t.cookies).filter(o=>Xi.test(o));if(r.length){let o=Qi();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=vs(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=vs(s[i],o);if(a!==void 0){e[`$datalayer/${o}`]=a;break}}return e}var pn=t=>{if(t.config.flagOptions?.disableRemote&&!t.config.localFlags?.length)return;let e;t.flagPersonProps.push(()=>e&&t.core.hasConsent("analytics")?un(e):{}),t.loadConfig().then(n=>{let r=n?.flag_targeting_sources;!r||typeof r!="object"||(e=r,Object.keys(un(r)).length&&t.flags?.reload())})};pe();function fn(t){return typeof t=="object"?t.value??t.variant??!!t.enabled:t}function gn(t){let e={value:fn(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:gn(n.result)}))),e}var ws="lc_rt_events",ks=t=>!!t?.some(e=>e.conditions.some(n=>n.filters?.some(r=>r.type==="event")));function Ss(t,e){let n;try{let i=t.flagStorage.get(ws);i&&(n=JSON.parse(i))}catch{}let r=new be(n),s={},o=Ue(e,s);return{counts:()=>r.counts(t.core.sessionId),setServer(i){s=i,o=Ue(e,s)},server:()=>s,drop(i){for(let a of i)delete s[a]},resolved(){return kt(s,r.counts(t.core.sessionId))},record(i,a,c){r.record(i,t.core.sessionId,a,o),c&&t.whenConsented(()=>t.flagStorage.set(ws,JSON.stringify(r.saved())))}}}var mn="lc_flags",hn="lc_flag_overrides_api";function Cs(t){try{let e=localStorage.getItem("lc_flag_overrides");return e?JSON.parse(e)[t]:void 0}catch{return}}var yn=t=>{let{core:e,config:n}=t,r={},s={},o={},i,a,c=!1,l=0,d=new Set,f=new Set,h="",g={},x=()=>Object.keys(g).length>0,y={},w={},R={},E=new Set,M=typeof location>"u"?{forced:{},persist(){}}:ys(location.href),U=Object.keys(M.forced).length>0,A=()=>({...r,...R}),C=t.config.flagOptions??{},I=new xe(C.cacheTtlMs),O=(t.config.flagsApiHost??t.config.apiHost).replace(/\/+$/,""),q=C.keys?.length?new Set(C.keys):void 0,T=p=>q?Object.fromEntries(Object.entries(p).filter(([b])=>q.has(b))):p,N=(p,b,S=!0)=>{if(r=T(p),s=T(b),c=!0,S)for(let $ of E)$(A())},F=Ss(t,n.localFlags),v=!1,L=()=>{v||(v=!0,queueMicrotask(()=>{v=!1,Q()}))},J=t.flagStorage.get(mn);if(J)try{let p=JSON.parse(J);r=p.values,s=p.payloads,o=Object.fromEntries(Object.keys(r).map(b=>[b,"cached"])),p.rt&&F.setServer(p.rt),I.restore(p),c=Object.keys(r).length>0}catch{}let le=t.flagStorage.get(hn);if(le)try{R=JSON.parse(le)}catch{}let Z=n.bootstrap;if(Z?.flags||Z?.payloads){let p={...Z.flags};for(let b of Object.keys(Z.payloads??{}))p[b]??=!0;N({...r,...p},{...s,...Z.payloads});for(let b of Object.keys(p))o[b]="bootstrap"}let z={},me=()=>({...C.autoProperties===!1?{}:_s(),...bs(e.storage,t.whenConsented),...Object.assign({},...t.flagPersonProps.map(p=>p())),...y}),oe=C.evaluationContexts?.length?{app_contexts:C.evaluationContexts}:{},ie=(p=!0)=>{let b=n.localFlags;if(!b?.length)return!0;let S=n.localFlagsContext,$=Rt(b,{runtime_events:F.counts(),distinct_id:e.distinctId,...e.groups?{groups:e.groups}:{},...e.deviceId?{device_id:e.deviceId}:{},...x()?{contexts:g}:{},...oe,...S,person_properties:{...me(),...S?.person_properties},group_properties:{...S?.group_properties,...w}}),D={},j={},W=!1;for(let[te,B]of Object.entries($))Et(B)?W=!0:Pt(B)&&(D[te]=B.value,o[te]=B.reason,B.payload!==void 0&&(j[te]=B.payload));return z=D,N({...r,...D},{...s,...j},p),W},k=p=>{let b={...r},S={...s};for(let[$,D]of Object.entries(F.resolved()))b[$]=D.value,o[$]=D.reason,D.payload!==void 0?S[$]=D.payload:delete S[$];N(b,S,p)},he=ks(n.localFlags);t.onCapture(p=>{let b=he||Object.keys(F.server()).length>0;if(F.record(p.event,p.properties,b),!b)return;let S=JSON.stringify([A(),s]);if(he&&ie(!1),k(!1),JSON.stringify([A(),s])!==S)for(let $ of E)$(A())});let Q=(p=!0)=>{let b=++l;return!ie()||C.disableRemote||!p&&I.fresh(e.distinctId)?Promise.resolve():new Promise(S=>{t.whenConsented(()=>{if(b!==l)return S();M.persist();let $=new AbortController,D=setTimeout(()=>$.abort(),C.timeoutMs??1e4);t.fetch(`${O}/v1/flags`,{method:"POST",headers:{"Content-Type":"text/plain;charset=UTF-8"},credentials:"omit",signal:$.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:me(),...Object.keys(w).length?{group_properties:w}:{},device_properties:dn(),...e.deviceId?{device_id:e.deviceId}:{},...x()?{contexts:g}:{},...oe,...U?{preview:M.forced}:{},...C.keys?.length?{flag_keys:C.keys}:{}})}).then(j=>j.ok?j.json():Promise.reject(new Error(`status ${j.status}`))).then(j=>{if(b!==l)return;if(j.quota_limited)return a="quota_limited",t.log("flags quota limited; keeping cached values");a=j.errors_while_computing_flags?"errors_while_computing_flags":void 0;let W={},te={},B={};for(let[$e,V]of Object.entries(j.flags??{}))W[$e]=fn(V),typeof V=="object"&&V.payload!==void 0&&(te[$e]=V.payload),o[$e]=typeof V=="object"&&typeof V.reason=="string"?V.reason:"remote",typeof V=="object"&&V.runtime?.length&&(B[$e]=gn(V));i=j.request_id,F.setServer(B);let Pe=j.errors_while_computing_flags;N({...z,...Pe?r:{},...W},Pe?{...s,...te}:te,!1),k(!0),t.flagStorage.set(mn,JSON.stringify({values:{...Pe?r:{},...W},payloads:{...Pe?s:{},...te},rt:B,...I.mark(e.distinctId)})),t.log("flags loaded",W)}).catch(j=>{let W=/^status (\d+)/.exec(String(j?.message))?.[1];b===l&&(a=$.signal.aborted?"timeout":W?`api_error_${W}`:"connection_error"),t.log("flags fetch failed",j)}).finally(()=>{clearTimeout(D),S()})})})},ee=p=>R[p]??Cs(p)??r[p];t.flags={get(p){let b=ee(p);if(b===void 0)return;if(p in M.forced||p in R)return b;let S=e.sessionId;S!==h&&(d.clear(),f.clear(),h=S),f.has(p)||(f.add(p),e.capture("$exposure",{$feature_flag:p,$feature_flag_response:b,...typeof b=="string"?{$feature_flag_variant:b}:{},...i?{$feature_flag_request_id:i}:{}}));let $=`${p}:${String(b)}`;return d.has($)||(d.add($),e.capture("$feature_flag_called",{$feature_flag:p,$feature_flag_response:b,...i?{$feature_flag_request_id:i}:{},...o[p]?{$feature_flag_reason:o[p]}:{},...o[p]==="bootstrap"?{$used_bootstrap_value:!0}:{},...a?{$feature_flag_error:a}:{}})),b},all:()=>c||Object.keys(r).length||Object.keys(R).length?A():{},payload:p=>s[p],result(p,b){let S=b?.sendExposure===!1?ee(p):this.get(p),$=p in R||Cs(p)!==void 0?"override":p in M.forced?"preview":o[p]??"remote";return ce(p,S,s[p],$)},layerParam(p,b){for(let[S,$]of Object.entries(s)){let D=$;if(D?.lc_layer!==p||!D.lc_params||!(b in D.lc_params))continue;let j=this.get(S);if(j!==void 0&&j!==!1)return D.lc_params[b]}},onChange(p){return E.add(p),c&&p(A()),()=>{E.delete(p)}},reload:Q,update(p,b,S=!0){for(let $ of Object.keys(p))o[$]="pushed";F.drop(Object.keys(p)),N(S?{...r,...p}:{...p},S?{...s,...b}:{...b})},override(p,b){R=p?{...p}:{},p?b?.persist&&t.whenConsented(()=>t.flagStorage.set(hn,JSON.stringify(R))):t.flagStorage.remove(hn);for(let S of E)S(A())},setPersonProperties(p,b=!0){I.clear(),y={...y,...p},b&&L()},resetPersonProperties(){y={}},setGroupProperties(p,b=!0){I.clear();for(let[S,$]of Object.entries(p))w[S]={...w[S],...$};b&&L()},resetGroupProperties(){w={}},setContext(p,b,S){I.clear(),g={...g,[p]:{key:b,properties:S??{}}},L()},clearContext(p){I.clear();let{[p]:b,...S}=g;g=S,L()}},e.onChange(p=>{if(p==="reset"){g={},y={},w={},d.clear(),f.clear(),r={},s={},o={},i=void 0,a=void 0,F.setServer({}),I.clear(),t.flagStorage.remove(mn),ie(!1);for(let b of E)b(A())}(p==="identify"||p==="reset"||p==="group")&&L()}),n.disableFlagsOnFirstLoad?ie():Q(!1);let u=n.flagStream,m;u&&!C.disableRemote&&t.whenConsented(()=>{m=pt({apiHost:O,apiKey:t.apiKey,fetch:t.fetch,reload:()=>{Q()},visibility:{hidden:()=>document.visibilityState==="hidden",subscribe:p=>(document.addEventListener("visibilitychange",p),()=>document.removeEventListener("visibilitychange",p))},...typeof u=="object"&&u.pollMs!==void 0?{pollMs:u.pollMs}:{},log:t.log})});let _=C.refreshMs&&C.refreshMs>0&&!C.disableRemote?setInterval(()=>document.visibilityState!=="hidden"&&void Q(!1),C.refreshMs):void 0;return()=>{m?.(),_&&clearInterval(_)}};function st(t){let e=window.fetch;window.fetch=function(i,a){let c=i instanceof Request?i.url:String(i),l=new Headers(a?.headers??(i instanceof Request?i.headers:void 0)),d=[...l.entries()].join("|");return t(c,l),[...l.entries()].join("|")===d?e.call(this,i,a):e.call(this,i,{...a,headers:l})};let n=XMLHttpRequest.prototype,{open:r,send:s}=n,o=new WeakMap;return n.open=function(i,a,...c){return o.set(this,String(a)),r.call(this,i,a,...c)},n.send=function(i){let a=o.get(this);if(a){let c=new Headers;t(a,c),c.forEach((l,d)=>this.setRequestHeader(d,l))}return s.call(this,i)},()=>{window.fetch=e,n.open=r,n.send=s}}var vn="lucida.session_id";function ea(t,e){return[...(t??"").split(",").map(r=>r.trim()).filter(r=>r&&!r.startsWith(`${vn}=`)),`${vn}=${encodeURIComponent(e)}`].join(",")}function ta(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 Rs=t=>{let e=t.config.watchtower,{core:n}=t,r=na(t);if(!e?.correlate)return r;let s=n.sessionId;t.onCapture(a=>s=String(a.properties.$session_id??s));let o=a=>n.hasConsent("analytics")&&!a.startsWith(t.config.apiHost)&&ta(a,e.origins),i=st((a,c)=>{o(a)&&c.set("baggage",ea(c.get("baggage"),s))});return()=>(i(),r?.())};function na(t){let e=t.config.watchtower?.client??globalThis.watchtower;if(typeof e?.setAttribute!="function")return;let{core:n}=t,r=s=>{n.hasConsent("analytics")&&e.setAttribute(vn,s)};return t.whenConsented(()=>r(n.sessionId)),n.onSessionId(r)}var ra="X-Lucida-Distinct-Id",sa="X-Lucida-Session-Id";function oa(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 Es=t=>/^[\x20-\x7e]*$/.test(t)?t:encodeURIComponent(t),bn=t=>{let e=t.config.tracingHeaders;if(!e?.length)return;let{core:n}=t;return st((r,s)=>{!n.hasConsent("analytics")||r.startsWith(t.config.apiHost)||!oa(r,e)||(n.distinctId&&s.set(ra,Es(n.distinctId)),s.set(sa,Es(n.sessionId)))})};Wt();pe();var Ps="lc_early_access",ia=t=>{let{core:e}=t,n=()=>{try{return JSON.parse(e.storage.get(Ps)??"{}")}catch{return{}}},r=(s,o)=>{e.storage.set(Ps,JSON.stringify({...n(),[s]:o}));let i=lt(s,o);e.capture(i.event,i.props,i.extra),t.flags?.reload()};t.flagPersonProps.push(()=>Object.fromEntries(Object.entries(n()).map(([s,o])=>[Ne(s),o]))),t.earlyAccess={list:()=>new Promise(s=>t.whenConsented(()=>{t.fetch(`${t.config.apiHost}/v1/early-access?api_key=${encodeURIComponent(t.apiKey)}`,{credentials:"omit"}).then(o=>o.ok?o.json():Promise.reject(new Error(`status ${o.status}`))).then(o=>{let i=n();s((o.features??[]).map(a=>({...a,enrolled:i[a.flag_key]===!0})))}).catch(o=>{t.log("early access fetch failed",o),s([])})})),optIn:s=>r(s,!0),optOut:s=>r(s,!1)}};var Os="lc_recs",$s="lc_recs_recent";function As(t,e,n,r){for(let s of r?[r]:n){let o=e(s)?.[Os];if(o&&typeof o=="object"&&(o.placement===t||r!==void 0&&o.placement===void 0))return{flag:s,cfg:o}}}var aa=t=>{let{core:e}=t,n=t.config.recommendations??{},r=n.viewEvent??"$product_viewed",s=n.itemIdProperty??"item_id",o=[];try{let c=JSON.parse(e.storage.get($s)??"[]");Array.isArray(c)&&(o=c.filter(l=>typeof l=="string").slice(0,20))}catch{}let i=()=>e.hasConsent("analytics"),a=c=>{c&&(o=[c,...o.filter(l=>l!==c)].slice(0,20),i()&&e.storage.set($s,JSON.stringify(o)))};t.onCapture(c=>{let l=c.properties?.[s];c.event===r&&(typeof l=="string"||typeof l=="number")&&a(String(l))}),t.recs={viewed:a,async get(c,l={}){let d=Object.keys(t.flags?.all()??{}),f=As(c,C=>t.flags?.payload(C),d,l.flag),h=f?t.flags?.get(f.flag):void 0,g=new URLSearchParams({api_key:t.apiKey,placement:c});l.itemId&&g.set("item_id",l.itemId),i()&&o.length&&g.set("recent",o.filter(C=>C!==l.itemId).slice(0,10).join(","));let x=f?.cfg.strategy;typeof x=="string"&&g.set("strategy",x);let y=l.limit??f?.cfg.limit;typeof y=="number"&&y>0&&g.set("limit",String(Math.min(50,Math.floor(y)))),l.exclude?.length&&g.set("exclude",l.exclude.slice(0,50).join(","));let w={};try{let C=await t.fetch(`${t.config.apiHost}/v1/recommendations?${g}`,{credentials:"omit"});C.ok?w=await C.json():t.log("recommendations failed",C.status)}catch(C){t.log("recommendations failed",C)}let R=Array.isArray(w.items)?w.items:[],E=w.strategy??x??"",M={$recommendation_placement:c,$recommendation_strategy:E,...f?{$recommendation_flag:f.flag}:{},...h!==void 0?{$recommendation_variant:String(h)}:{}},U=!1,A={placement:c,strategy:E,items:R,...f?{flag:f.flag}:{},...h!==void 0?{variant:h}:{},shown(){U||!R.length||(U=!0,e.capture("$recommendation_shown",{...M,$recommendation_items:R.map(C=>C.item_id)}))},clicked(C){let I=R.findIndex(O=>O.item_id===C);e.capture("$recommendation_clicked",{...M,$recommendation_item:C,...I>=0?{$recommendation_position:I+1}:{}})}};return l.autoShown!==!1&&A.shown(),A}}};function tu(t,e={},n=[]){return en(t,e,[an,yn,pn,Rs,bn,Ht,...n])}export{Qt as DEFAULT_HOST,Br as LIB_VERSION,Os as RECS_PAYLOAD_KEY,jt as assetUrl,an as autocapture,wr as blocksInlineStyle,Mt as captureCspViolations,en as createClient,Ht as crossDomain,Hr as denylistHook,ia as earlyAccess,Ft as exposeGlobal,un as flagSourceProps,pn as flagSources,yn as flags,bn as hostHeaders,tu as init,Tt as isExtensionPage,Io as loadModules,Dt as noopClient,As as placementFlag,Fr as privatizeUrl,aa as recommendations,Sr as rewriteUrl,Nr as sampleHook,So as styleTag,os as tag404,Ut as urlPrivacyHook};