@elu-labs/analytics-browser 1.410.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +245 -0
- package/NOTICE-ELU +6 -0
- package/README.md +200 -0
- package/THIRD_PARTY_NOTICES.txt +48 -0
- package/dist/cold-session.mjs +3 -0
- package/dist/cold-session.mjs.map +1 -0
- package/dist/elu.js +3 -0
- package/dist/elu.js.map +1 -0
- package/dist/index.d.ts +122 -0
- package/dist/main.cjs +3 -0
- package/dist/main.cjs.map +1 -0
- package/dist/module.mjs +3 -0
- package/dist/module.mjs.map +1 -0
- package/dist/recorder.js +2 -0
- package/dist/recorder.js.map +1 -0
- package/dist/recorder.mjs +3 -0
- package/dist/recorder.mjs.map +1 -0
- package/dist/storage.js +3 -0
- package/dist/storage.js.map +1 -0
- package/package.json +33 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
Copyright 2020 Posthog / Hiberly, Inc.
|
|
2
|
+
|
|
3
|
+
Copyright 2015 Mixpanel, Inc.
|
|
4
|
+
|
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
you may not use this work except in compliance with the License.
|
|
7
|
+
You may obtain a copy of the License below, or at:
|
|
8
|
+
|
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
See the License for the specific language governing permissions and
|
|
15
|
+
limitations under the License.
|
|
16
|
+
|
|
17
|
+
Apache License
|
|
18
|
+
Version 2.0, January 2004
|
|
19
|
+
http://www.apache.org/licenses/
|
|
20
|
+
|
|
21
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
22
|
+
|
|
23
|
+
1. Definitions.
|
|
24
|
+
|
|
25
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
26
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
27
|
+
|
|
28
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
29
|
+
the copyright owner that is granting the License.
|
|
30
|
+
|
|
31
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
32
|
+
other entities that control, are controlled by, or are under common
|
|
33
|
+
control with that entity. For the purposes of this definition,
|
|
34
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
35
|
+
direction or management of such entity, whether by contract or
|
|
36
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
37
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
38
|
+
|
|
39
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
40
|
+
exercising permissions granted by this License.
|
|
41
|
+
|
|
42
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
43
|
+
including but not limited to software source code, documentation
|
|
44
|
+
source, and configuration files.
|
|
45
|
+
|
|
46
|
+
"Object" form shall mean any form resulting from mechanical
|
|
47
|
+
transformation or translation of a Source form, including but
|
|
48
|
+
not limited to compiled object code, generated documentation,
|
|
49
|
+
and conversions to other media types.
|
|
50
|
+
|
|
51
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
52
|
+
Object form, made available under the License, as indicated by a
|
|
53
|
+
copyright notice that is included in or attached to the work
|
|
54
|
+
(an example is provided in the Appendix below).
|
|
55
|
+
|
|
56
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
57
|
+
form, that is based on (or derived from) the Work and for which the
|
|
58
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
59
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
60
|
+
of this License, Derivative Works shall not include works that remain
|
|
61
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
62
|
+
the Work and Derivative Works thereof.
|
|
63
|
+
|
|
64
|
+
"Contribution" shall mean any work of authorship, including
|
|
65
|
+
the original version of the Work and any modifications or additions
|
|
66
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
67
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
68
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
69
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
70
|
+
means any form of electronic, verbal, or written communication sent
|
|
71
|
+
to the Licensor or its representatives, including but not limited to
|
|
72
|
+
communication on electronic mailing lists, source code control systems,
|
|
73
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
74
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
75
|
+
excluding communication that is conspicuously marked or otherwise
|
|
76
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
77
|
+
|
|
78
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
79
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
80
|
+
subsequently incorporated within the Work.
|
|
81
|
+
|
|
82
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
83
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
84
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
85
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
86
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
87
|
+
Work and such Derivative Works in Source or Object form.
|
|
88
|
+
|
|
89
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
90
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
91
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
92
|
+
(except as stated in this section) patent license to make, have made,
|
|
93
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
94
|
+
where such license applies only to those patent claims licensable
|
|
95
|
+
by such Contributor that are necessarily infringed by their
|
|
96
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
97
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
98
|
+
institute patent litigation against any entity (including a
|
|
99
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
100
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
101
|
+
or contributory patent infringement, then any patent licenses
|
|
102
|
+
granted to You under this License for that Work shall terminate
|
|
103
|
+
as of the date such litigation is filed.
|
|
104
|
+
|
|
105
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
106
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
107
|
+
modifications, and in Source or Object form, provided that You
|
|
108
|
+
meet the following conditions:
|
|
109
|
+
|
|
110
|
+
(a) You must give any other recipients of the Work or
|
|
111
|
+
Derivative Works a copy of this License; and
|
|
112
|
+
|
|
113
|
+
(b) You must cause any modified files to carry prominent notices
|
|
114
|
+
stating that You changed the files; and
|
|
115
|
+
|
|
116
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
117
|
+
that You distribute, all copyright, patent, trademark, and
|
|
118
|
+
attribution notices from the Source form of the Work,
|
|
119
|
+
excluding those notices that do not pertain to any part of
|
|
120
|
+
the Derivative Works; and
|
|
121
|
+
|
|
122
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
123
|
+
distribution, then any Derivative Works that You distribute must
|
|
124
|
+
include a readable copy of the attribution notices contained
|
|
125
|
+
within such NOTICE file, excluding those notices that do not
|
|
126
|
+
pertain to any part of the Derivative Works, in at least one
|
|
127
|
+
of the following places: within a NOTICE text file distributed
|
|
128
|
+
as part of the Derivative Works; within the Source form or
|
|
129
|
+
documentation, if provided along with the Derivative Works; or,
|
|
130
|
+
within a display generated by the Derivative Works, if and
|
|
131
|
+
wherever such third-party notices normally appear. The contents
|
|
132
|
+
of the NOTICE file are for informational purposes only and
|
|
133
|
+
do not modify the License. You may add Your own attribution
|
|
134
|
+
notices within Derivative Works that You distribute, alongside
|
|
135
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
136
|
+
that such additional attribution notices cannot be construed
|
|
137
|
+
as modifying the License.
|
|
138
|
+
|
|
139
|
+
You may add Your own copyright statement to Your modifications and
|
|
140
|
+
may provide additional or different license terms and conditions
|
|
141
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
142
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
143
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
144
|
+
the conditions stated in this License.
|
|
145
|
+
|
|
146
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
147
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
148
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
149
|
+
this License, without any additional terms or conditions.
|
|
150
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
151
|
+
the terms of any separate license agreement you may have executed
|
|
152
|
+
with Licensor regarding such Contributions.
|
|
153
|
+
|
|
154
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
155
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
156
|
+
except as required for reasonable and customary use in describing the
|
|
157
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
158
|
+
|
|
159
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
160
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
161
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
162
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
163
|
+
implied, including, without limitation, any warranties or conditions
|
|
164
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
165
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
166
|
+
appropriateness of using or redistributing the Work and assume any
|
|
167
|
+
risks associated with Your exercise of permissions under this License.
|
|
168
|
+
|
|
169
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
170
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
171
|
+
unless required by applicable law (such as deliberate and grossly
|
|
172
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
173
|
+
liable to You for damages, including any direct, indirect, special,
|
|
174
|
+
incidental, or consequential damages of any character arising as a
|
|
175
|
+
result of this License or out of the use or inability to use the
|
|
176
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
177
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
178
|
+
other commercial damages or losses), even if such Contributor
|
|
179
|
+
has been advised of the possibility of such damages.
|
|
180
|
+
|
|
181
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
182
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
183
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
184
|
+
or other liability obligations and/or rights consistent with this
|
|
185
|
+
License. However, in accepting such obligations, You may act only
|
|
186
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
187
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
188
|
+
defend, and hold each Contributor harmless for any liability
|
|
189
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
190
|
+
of your accepting any such warranty or additional liability.
|
|
191
|
+
|
|
192
|
+
END OF TERMS AND CONDITIONS
|
|
193
|
+
|
|
194
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
195
|
+
|
|
196
|
+
To apply the Apache License to your work, attach the following
|
|
197
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
198
|
+
replaced with your own identifying information. (Don't include
|
|
199
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
200
|
+
comment syntax for the file format. We also recommend that a
|
|
201
|
+
file or class name and description of purpose be included on the
|
|
202
|
+
same "printed page" as the copyright notice for easier
|
|
203
|
+
identification within third-party archives.
|
|
204
|
+
|
|
205
|
+
Copyright [yyyy] [name of copyright owner]
|
|
206
|
+
|
|
207
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
208
|
+
you may not use this file except in compliance with the License.
|
|
209
|
+
You may obtain a copy of the License at
|
|
210
|
+
|
|
211
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
212
|
+
|
|
213
|
+
Unless required by applicable law or agreed to in writing, software
|
|
214
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
215
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
216
|
+
See the License for the specific language governing permissions and
|
|
217
|
+
limitations under the License.
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
Some files in this codebase contain code from getsentry/sentry-javascript.
|
|
223
|
+
In such cases it is explicitly stated in the file header. This license only applies to the relevant code in such cases.
|
|
224
|
+
|
|
225
|
+
MIT License
|
|
226
|
+
|
|
227
|
+
Copyright (c) 2012 Functional Software, Inc. dba Sentry
|
|
228
|
+
|
|
229
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
230
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
231
|
+
the Software without restriction, including without limitation the rights to
|
|
232
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
233
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
|
234
|
+
so, subject to the following conditions:
|
|
235
|
+
|
|
236
|
+
The above copyright notice and this permission notice shall be included in all
|
|
237
|
+
copies or substantial portions of the Software.
|
|
238
|
+
|
|
239
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
240
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
241
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
242
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
243
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
244
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
245
|
+
SOFTWARE.
|
package/NOTICE-ELU
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
# ELU Analytics for the web
|
|
2
|
+
|
|
3
|
+
Capture product events, connect activity to users and organizations, evaluate
|
|
4
|
+
feature flags, and record sessions according to your ELU privacy settings.
|
|
5
|
+
|
|
6
|
+
Use one installation method per page: the ELU script or the NPM client. Both use
|
|
7
|
+
your ELU **site key**. Keep account credentials and server secrets out of browser
|
|
8
|
+
code.
|
|
9
|
+
|
|
10
|
+
## Script installation
|
|
11
|
+
|
|
12
|
+
Copy the Web snippet from your ELU integration settings into your site's
|
|
13
|
+
`<head>`. Keep the supplied URL and site key:
|
|
14
|
+
|
|
15
|
+
```html
|
|
16
|
+
<script async src="https://elu.dev/v1/YOUR_SITE_KEY.js"></script>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The script initializes ELU for that site. Do not call `init()`. After the loader
|
|
20
|
+
has run, use `window.elu`:
|
|
21
|
+
|
|
22
|
+
```js
|
|
23
|
+
window.elu?.capture('checkout_started', { source: 'pricing_page' })
|
|
24
|
+
window.elu?.identify('user_123', { plan: 'pro' })
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The script loads asynchronously. Optional chaining prevents an error if it has
|
|
28
|
+
not loaded, but **does not queue that call**. Connect important early calls to
|
|
29
|
+
the script's `load` event, or use the NPM client below. Once the loader has
|
|
30
|
+
created `window.elu`, state-changing calls can wait for SDK startup; getters may
|
|
31
|
+
still return `undefined`.
|
|
32
|
+
|
|
33
|
+
## NPM installation
|
|
34
|
+
|
|
35
|
+
The NPM interface below documents version 1.410.0, being prepared for release. Use
|
|
36
|
+
the script from ELU settings until ELU makes an NPM version available for your
|
|
37
|
+
project; these examples do not announce registry availability.
|
|
38
|
+
|
|
39
|
+
```sh
|
|
40
|
+
npm install @elu-labs/analytics-browser
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Initialize once in browser code and reuse the returned client:
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
import { createEluClient } from '@elu-labs/analytics-browser'
|
|
47
|
+
|
|
48
|
+
const elu = createEluClient('YOUR_SITE_KEY', {
|
|
49
|
+
capture_pageview: 'history_change',
|
|
50
|
+
autocapture: true,
|
|
51
|
+
capture_exceptions: false,
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
elu.capture('checkout_started', { source: 'pricing_page' })
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
The package exports `createEluClient` and the TypeScript type `EluClient`. ESM
|
|
58
|
+
and CommonJS root imports are supported. Importing the package does not
|
|
59
|
+
initialize analytics. Call the factory only in a browser, never while rendering
|
|
60
|
+
on the server. In a component framework, retain one client for the page rather
|
|
61
|
+
than creating one on every render or mount. The NPM client does not create
|
|
62
|
+
`window.elu`; keep the returned object.
|
|
63
|
+
|
|
64
|
+
### Initialization options
|
|
65
|
+
|
|
66
|
+
| Option | Default | Behavior |
|
|
67
|
+
| --- | --- | --- |
|
|
68
|
+
| `capture_pageview` | `'history_change'` | Initial pageview plus History API and hash-route changes. `true` captures the initial pageview only; `false` disables automatic pageviews. |
|
|
69
|
+
| `autocapture` | `true` | Enables automatic interaction capture, subject to site policy and consent. |
|
|
70
|
+
| `capture_exceptions` | `false` | Set `true` for unhandled errors and promise rejections. Manual `captureException()` remains available. |
|
|
71
|
+
| `capture_performance` | Off unless enabled in ELU | `true` enables memory and long-task samples; `false` disables both. An object overrides individual settings; see below. |
|
|
72
|
+
| `loaded(client)` | None | Runs after local startup and before the initial automatic pageview. It does not mean configuration, flags or delivery have completed. An async callback is not awaited. |
|
|
73
|
+
|
|
74
|
+
The script loader chooses its startup options; changing NPM options does not
|
|
75
|
+
configure a script installation. Replay and privacy settings come from ELU.
|
|
76
|
+
There is no public `startSessionRecording()`, `stopSessionRecording()`,
|
|
77
|
+
`set_config()` or custom endpoint option on this client.
|
|
78
|
+
|
|
79
|
+
## Optional performance samples
|
|
80
|
+
|
|
81
|
+
Performance sampling is off when neither your ELU site configuration nor local
|
|
82
|
+
initialization options enable it. For the NPM client, you can opt in explicitly:
|
|
83
|
+
|
|
84
|
+
```ts
|
|
85
|
+
const elu = createEluClient('YOUR_SITE_KEY', {
|
|
86
|
+
capture_performance: {
|
|
87
|
+
memory: true,
|
|
88
|
+
long_tasks: true,
|
|
89
|
+
sample_interval_ms: 30_000,
|
|
90
|
+
},
|
|
91
|
+
})
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
The TypeScript options type is `PerformanceCaptureConfig`. Each local setting
|
|
95
|
+
overrides its remote counterpart; `true` enables both metrics and `false`
|
|
96
|
+
disables both. The interval defaults to 30 seconds, with a five-second minimum.
|
|
97
|
+
If a renewed site configuration omits performance settings, previous remote
|
|
98
|
+
opt-ins end; explicit local overrides still require valid capture authority.
|
|
99
|
+
|
|
100
|
+
Samples use the normal `$performance_sample` event queue. Memory measurements
|
|
101
|
+
are available only when the browser exposes heap statistics; long-task
|
|
102
|
+
measurements require `PerformanceObserver` support. Unsupported measurements
|
|
103
|
+
are omitted. Collection pauses while the page is hidden and discards the old
|
|
104
|
+
measurement window when identity, consent or capture configuration changes.
|
|
105
|
+
Opt-out, blocked capture and expired configuration prevent sampling.
|
|
106
|
+
|
|
107
|
+
A final sample on hide or navigation is best-effort. Browser lifecycle and
|
|
108
|
+
consent checks still apply; closing a tab or process can prevent enqueue or
|
|
109
|
+
delivery. This feature does not guarantee an unload sample or process-death
|
|
110
|
+
recovery.
|
|
111
|
+
|
|
112
|
+
## Identify users and organizations
|
|
113
|
+
|
|
114
|
+
Use your application's stable internal ID, not an email address, name or phone
|
|
115
|
+
number. Identify after sign-in and before related custom events:
|
|
116
|
+
|
|
117
|
+
```ts
|
|
118
|
+
elu.identify('user_123', { plan: 'pro' }, { signup_source: 'website' })
|
|
119
|
+
elu.group('organization', 'org_456', { plan: 'pro' })
|
|
120
|
+
elu.capture('project_created', { template: 'blank' })
|
|
121
|
+
|
|
122
|
+
// On sign-out:
|
|
123
|
+
elu.reset()
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
The third argument to `identify` sets person properties only if absent. Use
|
|
127
|
+
`setPersonProperties` for later changes. `group` associates subsequent activity
|
|
128
|
+
with that group type; `resetGroups` clears group associations.
|
|
129
|
+
|
|
130
|
+
`reset()` begins a new anonymous identity and clears super properties, groups
|
|
131
|
+
and flag context. It preserves the visitor's opt-out choice. Identity reset is
|
|
132
|
+
not consent to resume capture; use your consent manager for that decision.
|
|
133
|
+
|
|
134
|
+
## Consent and privacy
|
|
135
|
+
|
|
136
|
+
If consent is required before any SDK activity, wait to load the script or call
|
|
137
|
+
`createEluClient` until consent is granted. Initialization can open browser
|
|
138
|
+
storage and request configuration; opting out afterward cannot undo those
|
|
139
|
+
initial actions.
|
|
140
|
+
|
|
141
|
+
For an initialized client:
|
|
142
|
+
|
|
143
|
+
```ts
|
|
144
|
+
elu.opt_out_capturing()
|
|
145
|
+
|
|
146
|
+
// Only when the visitor explicitly opts back in:
|
|
147
|
+
elu.opt_in_capturing({ captureEventName: false })
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Calling `opt_in_capturing()` without options also requests an `$opt_in` event.
|
|
151
|
+
Opt-out suppresses capture, flag evaluation and replay. It does not delete data
|
|
152
|
+
already delivered to ELU.
|
|
153
|
+
|
|
154
|
+
Keep passwords, payment details, tokens and sensitive personal data out of
|
|
155
|
+
event properties, IDs and exception messages. Replay masking does not sanitize
|
|
156
|
+
arbitrary custom event properties.
|
|
157
|
+
|
|
158
|
+
Replay requires a site configuration that permits it and an eligible browser
|
|
159
|
+
and session. Installing the package does not guarantee a recording. Review the
|
|
160
|
+
site's input, text, image and blocked-element settings in ELU; do not assume all
|
|
161
|
+
visible text and images are masked by default.
|
|
162
|
+
|
|
163
|
+
## Feature flags
|
|
164
|
+
|
|
165
|
+
Flags load asynchronously. `undefined` means no usable value is available;
|
|
166
|
+
handle it separately from an explicit `false`:
|
|
167
|
+
|
|
168
|
+
```ts
|
|
169
|
+
const unsubscribe = elu.onFeatureFlags((_keys, _variants, context) => {
|
|
170
|
+
if (context?.errorsLoading) return
|
|
171
|
+
const enabled = elu.isFeatureEnabled('new_checkout', { defaultValue: false })
|
|
172
|
+
// Render the new checkout only when enabled === true.
|
|
173
|
+
})
|
|
174
|
+
|
|
175
|
+
// When the component is disposed:
|
|
176
|
+
unsubscribe()
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Use `getFeatureFlag` for a boolean or string variant, `getFeatureFlagPayload` for
|
|
180
|
+
its JSON payload, or `getFeatureFlagResult` for `{ key, enabled, variant,
|
|
181
|
+
payload }`. Flag reads can report exposure; pass `{ send_event: false }` to a
|
|
182
|
+
flag/feature read when you do not want that exposure event. Use
|
|
183
|
+
`reloadFeatureFlags()` to request new values. Feature flags are not a
|
|
184
|
+
server-side authorization boundary.
|
|
185
|
+
|
|
186
|
+
## Other common operations
|
|
187
|
+
|
|
188
|
+
```ts
|
|
189
|
+
elu.register({ app_area: 'dashboard' }) // Properties on later events
|
|
190
|
+
elu.register_once({ first_campaign: 'docs' })
|
|
191
|
+
elu.unregister('app_area')
|
|
192
|
+
elu.setPersonProperties({ plan: 'business' })
|
|
193
|
+
elu.captureException(new Error('Upload failed'), { operation: 'upload' })
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
`capture()` returns no delivery receipt or Promise. Confirm integration with a
|
|
197
|
+
non-sensitive test event in ELU; a script download or method return alone does
|
|
198
|
+
not prove ingestion.
|
|
199
|
+
|
|
200
|
+
The package includes `LICENSE`, `NOTICE-ELU`, and `THIRD_PARTY_NOTICES.txt`.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
Third-party notices for the ELU JavaScript SDK
|
|
2
|
+
|
|
3
|
+
This distribution contains modified portions of the PostHog JavaScript SDK
|
|
4
|
+
(posthog-js), Copyright 2020 Posthog / Hiberly, Inc. and Copyright 2015
|
|
5
|
+
Mixpanel, Inc., licensed under the Apache License, Version 2.0. Portions of
|
|
6
|
+
that SDK are derived from getsentry/sentry-javascript, Copyright (c) 2012
|
|
7
|
+
Functional Software, Inc. dba Sentry, licensed under the MIT License, as
|
|
8
|
+
stated in the relevant file headers. The complete license terms are
|
|
9
|
+
included in LICENSE.
|
|
10
|
+
|
|
11
|
+
Source release: `posthog-js@1.409.5`
|
|
12
|
+
Source commit: `b9596a3c922a0c21fc6874f8d93988a8437d28d0`
|
|
13
|
+
|
|
14
|
+
Copyright (c) 2026 ELU.
|
|
15
|
+
|
|
16
|
+
ELU modifications include an ELU-branded CDN entrypoint and customer-visible
|
|
17
|
+
surfaces, runtime host enforcement, and deterministic release verification.
|
|
18
|
+
Source files changed by ELU state so in their first line, and generated
|
|
19
|
+
JavaScript files carry the ELU modification banner. This notice is
|
|
20
|
+
informational and does not alter the license terms.
|
|
21
|
+
|
|
22
|
+
The recorder carries the original isWebKit and includes utility implementations
|
|
23
|
+
from the upstream core package in its own browser-detection module. The original
|
|
24
|
+
implementation and applicable license terms are preserved.
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
fflate 0.4.8
|
|
28
|
+
MIT License
|
|
29
|
+
|
|
30
|
+
Copyright (c) 2020 Arjun Barrett
|
|
31
|
+
|
|
32
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
33
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
34
|
+
in the Software without restriction, including without limitation the rights
|
|
35
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
36
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
37
|
+
furnished to do so, subject to the following conditions:
|
|
38
|
+
|
|
39
|
+
The above copyright notice and this permission notice shall be included in all
|
|
40
|
+
copies or substantial portions of the Software.
|
|
41
|
+
|
|
42
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
43
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
44
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
45
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
46
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
47
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
48
|
+
SOFTWARE.
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! ELU-modified distribution. Notices and license terms: https://elu.dev/sdk/licenses */
|
|
2
|
+
function r(r,e,n,t,a,i,o){try{var u=r[i](o),s=u.value}catch(r){return void n(r)}u.done?e(s):Promise.resolve(s).then(t,a)}function e(e){return function(){var n=this,t=arguments;return new Promise((function(a,i){var o=e.apply(n,t);function u(e){r(o,a,i,u,s,"next",e)}function s(e){r(o,a,i,u,s,"throw",e)}u(void 0)}))}}function n(){return n=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var t in n)({}).hasOwnProperty.call(n,t)&&(r[t]=n[t])}return r},n.apply(null,arguments)}var t,a=(r,e,n)=>{var t=()=>{throw new Error("Invalid internal text data")};(!Number.isSafeInteger(e)||e<1||e>1e6||!Number.isSafeInteger(n)||n<1||n>1e4||r.length>2e6||r.length%4!=0)&&t();for(var a=r.endsWith("==")?2:r.endsWith("=")?1:0,i=new Uint8Array(r.length/4*3-a),o=0,u=0,s=0,f=0;f<r.length-a;f++){var v="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(r.charAt(f));v<0&&t(),s=s<<6|v,(u+=6)>=8&&(u-=8,i[o++]=s>>>u&255)}u&&s&(1<<u)-1&&t();for(var l,c,d=new Uint8Array(e),h=0,y=0,m=r=>{y+r>8*i.length&&t();var e=y>>>3,n=(i[e]|i[e+1]<<8|i[e+2]<<16)>>>(7&y)&(1<<r)-1;return y+=r,n},b=(r,e,n)=>{for(var a=new Uint16Array(16),i=0,o=0;o<r.length;o++){var u=r[o];u>15&&t(),u&&(a[u]++,i=Math.max(i,u))}for(var s=1,f=1;f<=15;f++)(s=2*s-a[f])<0&&t();(i?!s||e&&1===i&&1===a[1]:n)||t();for(var v=new Uint16Array(16),l=1;l<15;l++)v[l+1]=v[l]+a[l];for(var c=new Uint16Array(r.length),d=0;d<r.length;d++){var h=r[d];h&&(c[v[h]++]=d)}return{counts:a,symbols:c,maximum:i}},p=r=>{for(var e=0,n=0,a=0,i=1;i<=r.maximum;i++){e=e<<1|m(1);var o=r.counts[i];if(e>=n&&e-n<o)return r.symbols[a+e-n];a+=o,n=n+o<<1}return t()},w=0,k=0;!w;){++k>1024&&t(),w=m(1);var M=m(2);if(0===M){y=y+7&-8;var g=m(16);(65535!=(g^m(16))||h+g>e||y+8*g>8*i.length)&&t(),d.set(i.subarray(y>>>3,(y>>>3)+g),h),h+=g,y+=8*g}else{var S=void 0,A=void 0;if(1===M){if(!l||!c){for(var O=new Uint8Array(288),q=0;q<O.length;q++)O[q]=q<144?8:q<256?9:q<280?7:8;l=b(O,!1,!1);for(var j=new Uint8Array(32),P=0;P<j.length;P++)j[P]=5;c=b(j,!1,!1)}S=l,A=c}else{if(2!==M)return t();var E=m(5)+257,N=m(5)+1,R=m(4)+4;E>286&&t();for(var U=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],B=new Uint8Array(19),J=0;J<R;J++)B[U[J]]=m(3);for(var z=b(B,!1,!1),K=new Uint8Array(E+N),W=0;W<K.length;){var Y=p(z);if(Y<16)K[W++]=Y;else{16!==Y||W||t();var x=16===Y?K[W-1]:0,C=16===Y?m(2)+3:17===Y?m(3)+3:m(7)+11;W+C>K.length&&t();for(var I=W+C;W<I;W++)K[W]=x}}K[256]||t(),S=b(K.subarray(0,E),!0,!1),A=b(K.subarray(E),!0,!0)}for(;;){var D=p(S);if(256===D)break;if(D<256)h===e&&t(),d[h++]=D;else{D>285&&t();var X=D-257,H=(X>>>2)-1,Z=X<8?X+3:28===X?258:3+(4+(3&X)<<H)+m(H),T=p(A);T>29&&t();var V=(T>>>1)-1,Q=T<4?T+1:1+(2+(1&T)<<V)+m(V);(Q>h||h+Z>e)&&t();for(var G=0;G<Z;G++)d[h]=d[h-Q],h++}}}}h===e&&Math.ceil(y/8)===i.length||t();for(var F="",L=0;L<h;L+=4096)F+=String.fromCharCode.apply(null,d.subarray(L,Math.min(L+4096,h)));var $=JSON.parse(F);return Array.isArray($)&&$.length===n&&!$.some((r=>"string"!=typeof r))||t(),Object.freeze($)},i=r=>(t||(t=a("jVZdV9w2EP0rc/za9Sns8vlISEigJSFA0jY9fRhLY1tZWXI08sLy63sk2d7txkDffDR35Pm4dzR/Z6fz+WJxPN9bHJ0cHhwfH57sHWezidOTbJadvTl/++7i/YfLq99+v/746ebz7d39l69//PnXNyyEpLKq1felboxtfzj23erhcf20tz9fHBweHZ+c/vJrNsuu7j59BNM1BTkQaIz1UFD4skYJ1OqJ5A5KMdjOs5IEviYolVGeoFAG3froAKRtUJlslt19OMvnh0cgVUXsoSJDDr2yJtzQGVyh0lhoymbZ1/0775TwV2zNO+esC2fza+SlMtWNs6XSNHVuy83pLbUa12diaeyDJllRQ8bvmm9wrS3KM9koZrX9s2S/pR8d8egmrPGoDAMaUGaFWkmIpdDKk0O9DfEOlVamAokes1kmSVhJEtr0y5C08ky6hOpJtbmwTeuIOZZ3Ahsa8eX+Ij/ZmPNi7SnXqlE+m2Wku7xw9oHJ5dI2+Wq/PxTMOZMm4a3bnLqYX96k2uVMMfpgYbkcrC6ln6/mwfYoiCTHJjf4qJquSckbYh8TpdbX2SwL+cD57Xm+mIO0lGJv0Is6+g7Jheh5gF/eXX579xJak6k2t9OjdwilIh2L411nBPpYu2ivCSU5YO9CYJFfnlyjzASoY2JwxORWJKHUWI1RNRQZPoalTKnR046ZjITWsprm8jZyKtTIk59tA71SJ0CZKrADbBHijLLZgPJQIpFzjW34444guWtb6zxJoNaKGhyaKsC+szV537uRRdpWQea5I2GdHI8DTWgMJhm5Pw8VbpMmQTVY0W0XE//JZtrOP2NrOvbQSwes0WtgUVODuaRSmdCW0OqpP7YafWldc4FaFyiWZ22rFcl0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yi0bZJNfE1KkYWsjBDVKJuOwffkskWHwzSliJCy9AQzQXLXqfjs01clBaUT+2YKSq6Su/LggX5g0qEnGJdy6vfcSrzsHuYb34/PnzXxcM4e3Y84Lmr4JHt60lbH117llDBym+UgKfMr6fCrtFSUm0OdWlVyI50pchxvFm9BZLM1kov8gXDnKQ37RjMBPHvOCdQBnP5wumA/5ixDc4Z5skepdyjiMCc3yWRL6LWDjk5mQELkZtGyeE8cBiACFXDQ+nWYToCv/y3UoUhTEhC2PNrcEGuLcsPBxxqJKxEBcsPhD9q1S+s15lfn6aXDuXRf+YHJ86Y+zeRYmf/ISbEsVtJuOQ7d1s5MfRmQbDKJkipynNi0K+Rdw03/so/8BGNPJ2WCsaGtOMRXEMWWWue5r9B9cYRWgUo3ILNHimItxD94qRlBtsVyxerI3B6F+feQ/phmtkyq1UflDr5AQGearaiMOB1eXXtu6Tif63rPbD11VNODwGj6UD3ja1Ug8JvbVG92V0qK7fBykOpUO06f8Cn96UkVxMdWP5938B",6362,353),u=o[0];o[1];var s=o[2],f=o[3];o[4],o[5],o[6];var v=o[7],l=o[8];o[9],o[10],o[11],o[12],o[13],o[14],o[15],o[16],o[17],o[18],o[19],o[20],o[21];var c=o[22],d=o[23];o[24],o[25],o[26],o[27],o[28],o[29],o[30],o[31],o[32],o[33];var h=o[34];o[35],o[36];var y=o[37],m=o[38];o[39],o[40],o[41],o[42],o[43],o[44];var b=o[45];o[46],o[47];var p=o[48];o[49],o[50],o[51];var w=o[52],k=o[53];o[54],o[55],o[56],o[57],o[58],o[59];var M=o[60];o[61],o[62],o[63],o[64];var g=o[65];o[66],o[67],o[68],o[69],o[70],o[71],o[72],o[73],o[74],o[75],o[76],o[77],o[78],o[79],o[80],o[81],o[82];var S=o[83];o[84];var A=o[85],O=o[86];o[87],o[88],o[89],o[90];var q=o[91];o[92],o[93],o[94];var j=o[95];o[96],o[97],o[98],o[99],o[100],o[101],o[102],o[103],o[104],o[105],o[106],o[107],o[108],o[109],o[110];var P=o[111];o[112];var E=o[113];o[114],o[115],o[116],o[117];var N=o[118];o[119],o[120],o[121],o[122],o[123],o[124],o[125],o[126],o[127],o[128],o[129],o[130],o[131];var R=o[132],U=o[133],B=o[134],J=o[135],z=o[136];o[137],o[138];var K=o[139];o[140],o[141],o[142],o[143],o[144],o[145],o[146];var W=o[147];o[148],o[149],o[150];var Y=o[151];o[152],o[153],o[154],o[155],o[156],o[157],o[158],o[159],o[160],o[161],o[162],o[163],o[164],o[165],o[166],o[167],o[168],o[169],o[170];var x=o[171];o[172],o[173],o[174],o[175],o[176],o[177],o[178],o[179];var C=o[180];o[181],o[182];var I=o[183];o[184],o[185],o[186],o[187],o[188],o[189],o[190],o[191],o[192],o[193],o[194];var D=o[195],X=o[196];o[197],o[198],o[199],o[200],o[201],o[202];var H=o[203];o[204],o[205],o[206],o[207],o[208],o[209],o[210],o[211];var Z=o[212];o[213],o[214];var T=o[215],V=o[216],Q=o[217];o[218],o[219];var G=o[220],F=o[221];o[222],o[223],o[224];var L=o[225];o[226],o[227];var $=o[228];o[229];var _=o[230];o[231];var rr=o[232],er=o[233];o[234],o[235];var nr=o[236];o[237];var tr=o[238];o[239],o[240],o[241],o[242],o[243];var ar=o[244];o[245],o[246],o[247],o[248],o[249],o[250],o[251];var ir=o[252],or=o[253];o[254],o[255],o[256],o[257],o[258],o[259],o[260],o[261];var ur=o[262];o[263],o[264],o[265],o[266],o[267],o[268];var sr=o[269];o[270],o[271];var fr=o[272];o[273],o[274];var vr=o[275];o[276],o[277],o[278],o[279],o[280],o[281],o[282],o[283],o[284],o[285],o[286],o[287],o[288];var lr=o[289];o[290],o[291],o[292],o[293],o[294],o[295],o[296],o[297],o[298],o[299],o[300],o[301],o[302],o[303],o[304];var cr=o[305];o[306],o[307];var dr=o[308];o[309],o[310],o[311],o[312],o[313],o[314],o[315],o[316];var hr=o[317];o[318],o[319],o[320],o[321],o[322];var yr=o[323],mr=o[324];o[325],o[326],o[327],o[328],o[329],o[330],o[331],o[332],o[333];var br=o[334];o[335],o[336],o[337],o[338],o[339],o[340],o[341],o[342],o[343],o[344],o[345],o[346],o[347];var pr=o[348];o[349],o[350];var wr=o[351];o[352];var kr=Array.isArray,Mr=r=>kr(r),gr=r=>"object"==typeof r&&null!=r&&!Mr(r),Sr=r=>"string"==typeof r,Ar=r=>!0===r||!1===r,Or=r=>"function"==typeof r,qr=r=>{for(var e=0,n=0;n<r[rr];n+=1){var t=r[A](n);if(t>=55296&&t<=56319){var a=r[A](n+1);if(n+1>=r[rr]||a<56320||a>57343)return null;n+=1}else if(t>=56320&&t<=57343)return null;e+=1}return e},jr=r=>"number"==typeof r&&Number[yr](r),Pr=r=>jr(r)&&Number[v](r)&&r>=0,Er=r=>Object.is(r,null),Nr=(r,e)=>Object.prototype[U].call(r,e),Rr=(r,e)=>Object.prototype[U].call(r,e),Ur=(r,e)=>{var n=new Set(e);return Object.keys(r).every((r=>n.has(r)))},Br=r=>Object.freeze(r),Jr=(r,e,n,t)=>Br({[E]:r[E],[R]:e,chunkStartedAtMs:e,chunkBytes:n,chunkEvents:1,[G]:t}),zr=a("lVZNk9xEDP0rqj3H1IaCXDhtskAlB0hlFjhQHDTdst1MW2rU8nzw66luj+2Z2U2A44xtfbz39KTf79rRRiVoI3bg0PUE2fU0IIQMI+cxJVEjf/fqTg5M2nTEpGhBuKFjj2OeHiaVPXHDYo2TYQg2/U3HRM7IP8mwzSZMPy6f3726c8Jt6ICOKegJnIzRA4vBliCR5nCOPYScA3eAo/WiwU4woO5I717dBd5jDH4qf3leQmMqfdWCzv//XYMp/TUGpdy4UZXYGiXaYxznmuaX629ggSjckcKA5nrK4EfFbaSrZBN4MRBbgc1FyTVXNlHsaFMB/bV0VFMMeAzDODyOExAbcsI+l248sZX+nLDR0UBpH84ftWSun0jBPYZYiwgM1ocMxPugwgOxXYD+bupwQ7nEeF8qiuIwguuROwJxFQP/YBWXFPEEaEZDMpDRnAxUK8HAGZAv5QBtoOhv4do4SfRbMKacVw4+qpg4ibfUL3Fn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bpLE4JaLYT1hP3dlz56+vlm7NaAjudEuTgRIxL7cGEpR0Ff3z2MRBvkbV5rJKF6I1yb/zAhnta+H7B//AA==",3110,85);zr[0],zr[1],zr[2],zr[3],zr[4],zr[5],zr[6],zr[7],zr[8],zr[9],zr[10],zr[11],zr[12],zr[13],zr[14],zr[15],zr[16],zr[17],zr[18];var Kr=zr[19];zr[20],zr[21],zr[22];var Wr=zr[23];zr[24],zr[25],zr[26],zr[27],zr[28],zr[29],zr[30],zr[31],zr[32],zr[33],zr[34],zr[35],zr[36],zr[37],zr[38],zr[39],zr[40],zr[41],zr[42],zr[43],zr[44],zr[45],zr[46],zr[47],zr[48],zr[49],zr[50],zr[51],zr[52],zr[53],zr[54],zr[55],zr[56],zr[57],zr[58],zr[59],zr[60],zr[61],zr[62],zr[63],zr[64],zr[65],zr[66],zr[67],zr[68],zr[69],zr[70],zr[71],zr[72],zr[73],zr[74],zr[75],zr[76],zr[77],zr[78],zr[79],zr[80],zr[81],zr[82],zr[83],zr[84];var Yr="https://ingest.elu.dev";Br({[pr]:Br([Yr]),[ar]:Br([Yr]),[fr]:Br([Yr]),assets:Br(["https://assets.elu.dev"])});var xr=Br({[pr]:"/v1/events",[ar]:"/v1/replay",[fr]:"/v1/flags",assets:"/sdk/"}),Cr=Br({[pr]:"/v1/events",[ar]:"/v2/replay",[fr]:"/v1/flags",assets:"/sdk/"});Br({1:xr,2:Cr}),Br({1:"/sdk/v1/",2:"/sdk/v2/"});var Ir=/^(\d{4})-(\d{2})-(\d{2})[Tt](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(?:[Zz]|([+-])(\d{2}):(\d{2}))$/,Dr=(r,e)=>{throw new Error(r+" "+e)},Xr=function(r,e,t){var a;if(!Sr(r))return Dr(e,i(52));var o=qr(r);if(Er(o)||o<1||o>t)return Dr(e,"must contain between 1 and "+t+" Unicode scalars");var u=Ir.exec(r);if(!u)return Dr(e,i(51));var s=Number(u[1]),f=Number(u[2]),c=Number(u[3]),d=Number(u[4]),h=Number(u[5]),y=Number(u[6]),m=(null!=(a=u[7])?a:"").replace(/0+$/,""),b=u[9]?Number(u[9]):0,p=u[10]?Number(u[10]):0;(f<1||f>12||c<1||c>((r,e)=>{var n=new Date(0);return n[B](r,e,0),n.getUTCDate()})(s,f)||d>23||h>59||y>60||b>23||p>59)&&Dr(e,i(49));var w=new Date(0);w[B](s,f-1,c),w.setUTCHours(d,h,Math.min(y,59),0);var k=w.getTime()/1e3-("-"===u[8]?-1:1)*(60*b+p)*60;jr(k)&&Number[v](k)||Dr(e,i(33));var M=60===y;if(M){var g=new Date(1e3*(k+1));0===g.getUTCHours()&&0===g.getUTCMinutes()&&0===g.getUTCSeconds()&&1===g.getUTCDate()&&(0===g.getUTCMonth()||6===g.getUTCMonth())||Dr(e,i(54))}var S=(r=>{var e=Math.floor(r/86400);return Br({epochDay:e,[N]:r-86400*e})})(k);return Br(n({source:r},S,{[O]:M,[l]:m}))},Hr=G,Zr=vr;Br({base:1,[fr]:2,[ar]:3}),Br([{name:"installations",keyPath:T,[ur]:1,indexes:[]},{name:Zr,keyPath:["siteKey","sequence"],[ur]:1,indexes:[]},{name:"flagCache",keyPath:[m,"recordKind"],[ur]:2,indexes:[]},{name:"replayChunks",keyPath:["siteKey",c],[ur]:3,indexes:[{name:"chunk",keyPath:["siteKey","replayId","chunkId"],unique:!0},{name:Hr,keyPath:["siteKey","replayId","sequence"],unique:!0}]},{name:"replayStreams",keyPath:["siteKey","replayId"],[ur]:3,indexes:[]},{name:"replayResolutions",keyPath:["siteKey","replayId","chunkId"],[ur]:3,indexes:[{name:Hr,keyPath:["siteKey","replayId","sequence"],unique:!0}]}]);var Tr=/^[a-f0-9]{64}$/,Vr=function(){var r=e((function*(r){var e="undefined"==typeof globalThis?void 0:globalThis.crypto;if(null==e||!e.subtle)return null;try{var n=yield e.subtle.digest("SHA-256",r),t="";for(var a of new Uint8Array(n))t+=a.toString(16).padStart(2,"0");return t}catch(r){return null}}));return function(e){return r.apply(this,arguments)}}(),Qr=function(){var r=e((function*(r,e){void 0===e&&(e=Vr);var n=yield e(r);if(!Sr(n)||!Tr.test(n[z]()))throw new Error(i(5));return n[z]()}));return function(e,n){return r.apply(this,arguments)}}(),Gr=r=>Sr(r)&&/^sha256:[a-f0-9]{64}$/.test(r),Fr=r=>(new TextEncoder).encode(r);Br({wallNow:()=>(new Date)[J](),monotonicNowMs:()=>{var r="undefined"==typeof globalThis?void 0:globalThis.performance;return r?r.now():Number.NaN}});var Lr=Uint8Array,$r=Uint16Array,_r=Uint32Array,re=new Lr([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),ee=new Lr([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),ne=new Lr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),te=function(r,e){for(var n=new $r(31),t=0;t<31;++t)n[t]=e+=1<<r[t-1];var a=new _r(n[30]);for(t=1;t<30;++t)for(var i=n[t];i<n[t+1];++i)a[i]=i-n[t]<<5|t;return[n,a]},ae=te(re,2),ie=ae[0],oe=ae[1];ie[28]=258,oe[258]=28;for(var ue=te(ee,0)[1],se=new $r(32768),fe=0;fe<32768;++fe){var ve=(43690&fe)>>>1|(21845&fe)<<1;ve=(61680&(ve=(52428&ve)>>>2|(13107&ve)<<2))>>>4|(3855&ve)<<4,se[fe]=((65280&ve)>>>8|(255&ve)<<8)>>>1}var le=function(r,e,n){for(var t=r.length,a=0,i=new $r(e);a<t;++a)++i[r[a]-1];var o,u=new $r(e);for(a=0;a<e;++a)u[a]=u[a-1]+i[a-1]<<1;if(n){o=new $r(1<<e);var s=15-e;for(a=0;a<t;++a)if(r[a])for(var f=a<<4|r[a],v=e-r[a],l=u[r[a]-1]++<<v,c=l|(1<<v)-1;l<=c;++l)o[se[l]>>>s]=f}else for(o=new $r(t),a=0;a<t;++a)o[a]=se[u[r[a]-1]++]>>>15-r[a];return o},ce=new Lr(288);for(fe=0;fe<144;++fe)ce[fe]=8;for(fe=144;fe<256;++fe)ce[fe]=9;for(fe=256;fe<280;++fe)ce[fe]=7;for(fe=280;fe<288;++fe)ce[fe]=8;var de=new Lr(32);for(fe=0;fe<32;++fe)de[fe]=5;var he=le(ce,9,0),ye=le(de,5,0),me=function(r){return(r/8>>0)+(7&r&&1)},be=function(r,e,n){n<<=7&e;var t=e/8>>0;r[t]|=n,r[t+1]|=n>>>8},pe=function(r,e,n){n<<=7&e;var t=e/8>>0;r[t]|=n,r[t+1]|=n>>>8,r[t+2]|=n>>>16},we=function(r,e){for(var n=[],t=0;t<r.length;++t)r[t]&&n.push({s:t,f:r[t]});var a=n.length,i=n.slice();if(!a)return[new Lr(0),0];if(1==a){var o=new Lr(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort((function(r,e){return r.f-e.f})),n.push({s:-1,f:25001});var u=n[0],s=n[1],f=0,v=1,l=2;for(n[0]={s:-1,f:u.f+s.f,l:u,r:s};v!=a-1;)u=n[n[f].f<n[l].f?f++:l++],s=n[f!=v&&n[f].f<n[l].f?f++:l++],n[v++]={s:-1,f:u.f+s.f,l:u,r:s};var c=i[0].s;for(t=1;t<a;++t)i[t].s>c&&(c=i[t].s);var d=new $r(c+1),h=ke(n[v-1],d,0);if(h>e){t=0;var y=0,m=h-e,b=1<<m;for(i.sort((function(r,e){return d[e.s]-d[r.s]||r.f-e.f}));t<a;++t){var p=i[t].s;if(!(d[p]>e))break;y+=b-(1<<h-d[p]),d[p]=e}for(y>>>=m;y>0;){var w=i[t].s;d[w]<e?y-=1<<e-d[w]++-1:++t}for(;t>=0&&y;--t){var k=i[t].s;d[k]==e&&(--d[k],++y)}h=e}return[new Lr(d),h]},ke=function(r,e,n){return-1==r.s?Math.max(ke(r.l,e,n+1),ke(r.r,e,n+1)):e[r.s]=n},Me=function(r){for(var e=r.length;e&&!r[--e];);for(var n=new $r(++e),t=0,a=r[0],i=1,o=function(r){n[t++]=r},u=1;u<=e;++u)if(r[u]==a&&u!=e)++i;else{if(!a&&i>2){for(;i>138;i-=138)o(32754);i>2&&(o(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(o(a),--i;i>6;i-=6)o(8304);i>2&&(o(i-3<<5|8208),i=0)}for(;i--;)o(a);i=1,a=r[u]}return[n.subarray(0,t),e]},ge=function(r,e){for(var n=0,t=0;t<e.length;++t)n+=r[t]*e[t];return n},Se=function(r,e,n){var t=n.length,a=me(e+2);r[a]=255&t,r[a+1]=t>>>8,r[a+2]=255^r[a],r[a+3]=255^r[a+1];for(var i=0;i<t;++i)r[a+i+4]=n[i];return 8*(a+4+t)},Ae=function(r,e,n,t,a,i,o,u,s,f,v){be(e,v++,n),++a[256];for(var l=we(a,15),c=l[0],d=l[1],h=we(i,15),y=h[0],m=h[1],b=Me(c),p=b[0],w=b[1],k=Me(y),M=k[0],g=k[1],S=new $r(19),A=0;A<p.length;++A)S[31&p[A]]++;for(A=0;A<M.length;++A)S[31&M[A]]++;for(var O=we(S,7),q=O[0],j=O[1],P=19;P>4&&!q[ne[P-1]];--P);var E,N,R,U,B=f+5<<3,J=ge(a,ce)+ge(i,de)+o,z=ge(a,c)+ge(i,y)+o+14+3*P+ge(S,q)+(2*S[16]+3*S[17]+7*S[18]);if(B<=J&&B<=z)return Se(e,v,r.subarray(s,s+f));if(be(e,v,1+(z<J)),v+=2,z<J){E=le(c,d,0),N=c,R=le(y,m,0),U=y;var K=le(q,j,0);for(be(e,v,w-257),be(e,v+5,g-1),be(e,v+10,P-4),v+=14,A=0;A<P;++A)be(e,v+3*A,q[ne[A]]);v+=3*P;for(var W=[p,M],Y=0;Y<2;++Y){var x=W[Y];for(A=0;A<x.length;++A){var C=31&x[A];be(e,v,K[C]),v+=q[C],C>15&&(be(e,v,x[A]>>>5&127),v+=x[A]>>>12)}}}else E=he,N=ce,R=ye,U=de;for(A=0;A<u;++A)if(t[A]>255){C=t[A]>>>18&31,pe(e,v,E[C+257]),v+=N[C+257],C>7&&(be(e,v,t[A]>>>23&31),v+=re[C]);var I=31&t[A];pe(e,v,R[I]),v+=U[I],I>3&&(pe(e,v,t[A]>>>5&8191),v+=ee[I])}else pe(e,v,E[t[A]]),v+=N[t[A]];return pe(e,v,E[256]),v+N[256]},Oe=new _r([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),qe=function(){for(var r=new _r(256),e=0;e<256;++e){for(var n=e,t=9;--t;)n=(1&n&&3988292384)^n>>>1;r[e]=n}return r}(),je=function(r,e,n){for(;n;++e)r[e]=n,n>>>=8};function Pe(r,e){void 0===e&&(e={});var n=function(){var r=4294967295;return{p:function(e){for(var n=r,t=0;t<e.length;++t)n=qe[255&n^e[t]]^n>>>8;r=n},d:function(){return 4294967295^r}}}(),t=r.length;n.p(r);var a,i,o,u,s=(a=r,i=e,o=10+((u=e).filename&&u.filename.length+1||0),8,function(r,e,n,t,a,i){var o=r.length,u=new Lr(t+o+5*(1+Math.floor(o/7e3))+a),s=u.subarray(t,u.length-a),f=0;if(!e||o<8)for(var v=0;v<=o;v+=65535){var l=v+65535;l<o?f=Se(s,f,r.subarray(v,l)):(s[v]=i,f=Se(s,f,r.subarray(v,o)))}else{for(var c=Oe[e-1],d=c>>>13,h=8191&c,y=(1<<n)-1,m=new $r(32768),b=new $r(y+1),p=Math.ceil(n/3),w=2*p,k=function(e){return(r[e]^r[e+1]<<p^r[e+2]<<w)&y},M=new _r(25e3),g=new $r(288),S=new $r(32),A=0,O=0,q=(v=0,0),j=0,P=0;v<o;++v){var E=k(v),N=32767&v,R=b[E];if(m[N]=R,b[E]=N,j<=v){var U=o-v;if((A>7e3||q>24576)&&U>423){f=Ae(r,s,0,M,g,S,O,q,P,v-P,f),q=A=O=0,P=v;for(var B=0;B<286;++B)g[B]=0;for(B=0;B<30;++B)S[B]=0}var J=2,z=0,K=h,W=N-R&32767;if(U>2&&E==k(v-W))for(var Y=Math.min(d,U)-1,x=Math.min(32767,v),C=Math.min(258,U);W<=x&&--K&&N!=R;){if(r[v+J]==r[v+J-W]){for(var I=0;I<C&&r[v+I]==r[v+I-W];++I);if(I>J){if(J=I,z=W,I>Y)break;var D=Math.min(W,I-2),X=0;for(B=0;B<D;++B){var H=v-W+B+32768&32767,Z=H-m[H]+32768&32767;Z>X&&(X=Z,R=H)}}}W+=(N=R)-(R=m[N])+32768&32767}if(z){M[q++]=268435456|oe[J]<<18|ue[z];var T=31&oe[J],V=31&ue[z];O+=re[T]+ee[V],++g[257+T],++S[V],j=v+J,++A}else M[q++]=r[v],++g[r[v]]}}f=Ae(r,s,i,M,g,S,O,q,P,v-P,f)}return function(r,e,n){(null==n||n>r.length)&&(n=r.length);var t=new(r instanceof $r?$r:r instanceof _r?_r:Lr)(n-0);return t.set(r.subarray(0,n)),t}(u,0,t+me(f)+a)}(a,null==i.level?6:i.level,null==i.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(a.length)))):12+i.mem,o,8,!0)),f=s.length;return function(r,e){var n=e.filename;if(r[0]=31,r[1]=139,r[2]=8,r[8]=e.level<2?4:9==e.level?2:0,r[9]=3,0!=e.mtime&&je(r,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),n){r[3]=8;for(var t=0;t<=n.length;++t)r[t+10]=n.charCodeAt(t)}}(s,e),je(s,f-8,n.d()),je(s,f-4,t),s}class Ee extends Error{constructor(r,e){super(e),this.code=void 0,this.name=i(10),this.code=r}}class Ne extends Error{constructor(r){super(r),this.name=i(7)}}class Re extends Error{constructor(r){super(r),this.name=i(8)}}class Ue extends Error{constructor(r){super(r),this.name=i(11)}}for(var Be="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Je=new Int16Array(128).fill(-1),ze=0;ze<Be[rr];ze+=1)Je[Be[A](ze)]=ze;var Ke=r=>{for(var e="",n=0;n+2<r[rr];n+=3){var t=r[n]<<16|r[n+1]<<8|r[n+2];e+=Be[t>>18]+Be[t>>12&63]+Be[t>>6&63]+Be[63&t]}var a=r[rr]-n;if(1===a){var i=r[n]<<16;e+=Be[i>>18]+Be[i>>12&63]+"=="}else if(2===a){var o=r[n]<<16|r[n+1]<<8;e+=Be[o>>18]+Be[o>>12&63]+Be[o>>6&63]+"="}return e},We=Br({maximumReplayDecodedBytes:16777216,[Z]:1e4,maximumJsonNestingDepth:256});function Ye(r,e){throw new Ee(r,e)}var xe=(r,e)=>{Er(qr(r))&&Ye("invalid-unicode",e+" contains an unpaired Unicode surrogate")},Ce=r=>void 0===r||Or(r)||"symbol"==typeof r,Ie=(r,e,n,t,a)=>{if(Er(r))return"null";switch(typeof r){case"string":return xe(r,n),JSON[tr](r);case"number":return Number[yr](r)||Ye(hr,n+" must be a finite number"),JSON[tr](r);case"boolean":return r?"true":"false";case"object":break;default:return Ye(hr,n+" has an unsupported "+typeof r+" value")}var o=e+1;if(o>t&&Ye(i(34),n+" exceeds the maximum JSON nesting depth of "+t),o>a.depth&&(a.depth=o),Mr(r)){for(var u=[],s=0;s<r[rr];s+=1){Rr(r,s)||Ye(hr,n+"["+s+"] is a sparse array hole");var f=r[s];u.push(Ce(f)?"null":Ie(f,o,n+"["+s+"]",t,a))}return"["+u.join(",")+"]"}if(!(r=>{var e=Object[M](r);return Er(e)||e===Object.prototype})(r))return Ye(hr,n+" must be a plain JSON object or array");var v=r,l=Object.keys(v).sort(),c=[];for(var d of l){var h=v[d];Ce(h)||(xe(d,n+"."+d),c.push(JSON[tr](d)+":"+Ie(h,o,n+"."+d,t,a)))}return"{"+c.join(",")+"}"},De=function(r,e,n){return void 0===n&&(n=256),Ce(r)&&Ye(hr,e+" must be a JSON value"),Ie(r,0,e,n,{depth:0})},Xe="elu-css-selector-v1",He=[s,W,"textRule","inputRule","imageRule",P,Wr,Y,K],Ze=["all","sensitive"],Te=["all","sensitive"],Ve=["block","allow"];function Qe(r){throw new Ne(r)}var Ge=(r,e,n)=>(Sr(r)&&e.includes(r)||Qe(n+" must be one of "+e.join(", ")),r),Fe=(r,e)=>{var n=Sr(r)?qr(r):null;return Er(n)||n<1||n>512?Qe(e+" must be a selector of 1 to 512 Unicode scalars"):r},Le=(r,e)=>{Mr(r)||Qe(e+" must be an array of selectors");for(var n=new Set,t=0;t<r[rr];t+=1)Rr(r,t)||Qe(e+" must not be sparse"),n.add(Fe(r[t],e+"["+t+"]"));return n.size>128&&Qe(e+" may carry at most 128 selectors"),Br([...n].sort())},$e=Symbol("elu-replay-masking-seal");class _e{constructor(r,e,n,t,a,o,u){if(this.profile=void 0,this.profileHash=void 0,this.canonicalPayload=void 0,this.payloadByteLength=void 0,this.logicalRecords=void 0,this.nestingDepth=void 0,r!==$e)throw new Re(i(45));this.profile=e,this[D]=n,this.canonicalPayload=t,this.payloadByteLength=a,this[H]=o,this.nestingDepth=u,Object.freeze(this)}static seal(r,e){var n;if(!Or(r))throw new Re(i(46));if(!Mr(e[pr]))throw new Re(i(47));var t=(r=>{for(var e of(gr(r)&&Ur(r,He)||Qe(i(39)),He))Nr(r,e)||Qe("masking profile "+e+" is required");return 1!==r[s]&&Qe("masking profile schemaVersion must be 1"),r[W]!==Xe&&Qe("masking profile targetDialect must be "+Xe),!0!==r[P]&&Qe(i(43)),Ar(r[d])||Qe(i(40)),Br({[s]:1,[W]:Xe,textRule:Ge(r.textRule,Ze,i(44)),inputRule:Ge(r.inputRule,Te,i(38)),imageRule:Ge(r.imageRule,Ve,i(37)),[P]:!0,[d]:r[d],[Y]:Le(r[Y],i(42)),[K]:Le(r[K],i(41))})})(e.profile);if(!Gr(e[D]))throw new Re(i(48));var a=function(r,e,n){void 0===n&&(n=We),Mr(r)||Ye(i(32),e+" must be an array of replay records"),r[rr]>n[Z]&&Ye(i(35),e+" carries "+r[rr]+" records; the maximum is "+n[Z]);var t={depth:0},a=Ie(r,0,e,n.maximumJsonNestingDepth,t),o=(r=>{for(var e=0,n=0;n<r[rr];n+=1){var t=r[A](n);if(t<=127)e+=1;else if(t<=2047)e+=2;else if(t>=55296&&t<=56319&&n+1<r[rr]){var a=r[A](n+1);a>=56320&&a<=57343?(e+=4,n+=1):e+=3}else e+=3}return e})(a);return o>n.maximumReplayDecodedBytes&&Ye(i(16),e+" serializes to "+o+" bytes; the maximum is "+n.maximumReplayDecodedBytes),Br({[L]:a,bytes:Fr(a),[H]:r[rr],nestingDepth:t.depth})}(e[pr].map((e=>r(e,t))),i(36),null!=(n=e[wr])?n:We);return new _e($e,t,e[D],a[L],a.bytes[rr],a[H],a.nestingDepth)}}var rn=r=>r instanceof _e;(()=>{for(var r=new Int32Array(256),e=0;e<256;e+=1){for(var n=e,t=0;t<8;t+=1)n=1&n?n>>>1^3988292384:n>>>1;r[e]=n}})();var en=new Set(["password","email","tel","hidden"]),nn=["src","srcset"],tn=new Set(["img","picture","source"]),an=r=>"object"==typeof r&&null!==r&&!Array.isArray(r),on=(r,e,t)=>{var a=n({},e),i="string"==typeof a.type?a.type[z]():"";if(("all"===t.inputRule||en.has(i)||"textarea"===r)&&"value"in a&&delete a.value,"block"===t.imageRule&&tn.has(r))for(var o of nn)o in a&&delete a[o];return a},un=(r,e)=>{if(!an(r))return r;var t=n({},r),a=t.type;if(5===a)t.textContent="";else if(3===a&&"all"===e.textRule)!0!==t.isStyle&&(t.textContent="");else if(2===a){var i="string"==typeof t.tagName?t.tagName[z]():"";an(t[C])&&(t[C]=on(i,t[C],e))}return Array.isArray(t.childNodes)&&(t.childNodes=t.childNodes.map((r=>un(r,e)))),t},sn=(r,e)=>{var t=n({},r);return"all"===e.textRule&&Array.isArray(t.texts)&&(t.texts=t.texts.map((r=>an(r)?n({},r,{value:""}):r))),Array.isArray(t[C])&&(t[C]=t[C].map((r=>an(r)&&an(r[C])?n({},r,{[C]:on("",r[C],e)}):r))),Array.isArray(t.adds)&&(t.adds=t.adds.map((r=>an(r)?n({},r,{node:un(r.node,e)}):r))),t},fn=(r,e)=>{if(!an(r))return r;var t=r.data;if(!an(t))return r;if(2===r.type)return n({},r,{data:n({},t,{node:un(t.node,e)})});if(3!==r.type)return r;if(0===t.source)return n({},r,{data:sn(t,e)});if(5===t.source){var a=n({},t);return"all"===e.inputRule&&"string"==typeof a.text&&(a.text=""),n({},r,{data:a})}return r},vn="2.0.0",ln=5242880,cn=/^elu-[a-z0-9][a-z0-9.-]{0,63}$/,dn=/^elu-[a-z0-9-]+$/,hn=/^[A-Za-z][A-Za-z0-9._-]+$/,yn=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,mn=[s,_,$,dr,G,nr,"endedAt",V,u,"codec",h,"contentEncoding","payload",sr,er],bn=[k,lr,F],pn=[S,y,x,"appliedBeforeSerialization",P,Wr],wn=[s,q,or,br,"facade","build"],kn=["name",ur];function Mn(r){throw new Ue(r)}var gn=function(r,e,n,t){void 0===t&&(t=1);var a=Sr(r)?qr(r):null;return Er(a)||a<t||a>n?Mn(e+" must be a string of "+t+" to "+n+" Unicode scalars"):r},Sn=(r,e)=>(Pr(r)||Mn(e+" must be a safe non-negative integer"),r),An=(r,e)=>(Gr(r)||Mn(e+" must be a lowercase sha256 hash"),r),On=function(r,e,n,t){for(var a of(void 0===t&&(t=[]),gr(r)&&Ur(r,e)||Mn(n+" must contain only schema-defined fields"),e))t.includes(a)||Nr(r,a)||Mn(n+" "+a+" is required");return r},qn=(r,e)=>{var n=On(r,bn,e);return Br({[k]:gn(n[k],e+" anonymousId",256),[lr]:Er(n[lr])?null:gn(n[lr],e+" userId",512),[F]:Sn(n[F],e+" revision")})},jn=(r,e)=>{var n=On(r,pn,e);return!0!==n.appliedBeforeSerialization&&Mn(e+" appliedBeforeSerialization must be true"),!0!==n[P]&&Mn(e+" secureInputsMasked must be true"),Ar(n[d])||Mn(e+" platformFallbackApplied must be a boolean"),Br({[S]:gn(n[S],e+" policyRevision",128),[y]:An(n[y],e+" effectivePolicyHash"),[x]:An(n[x],e+" maskingProfileHash"),appliedBeforeSerialization:!0,[P]:!0,[d]:n[d]})},Pn=(r,e,n)=>{var t=On(r,kn,e),a=gn(t.name,e+" name",256);return n.test(a)||Mn(e+" name is invalid"),Br({name:a,[ur]:gn(t[ur],e+" version",64)})},En=function(r,e){void 0===e&&(e="replay versions");var t=On(r,wn,e,["build"]);2!==t[s]&&Mn(e+" schemaVersion must be 2"),t[q]!==vn&&Mn(e+" contractVersion must be "+vn),"browser"!==t[or]&&"android"!==t[or]&&"ios"!==t[or]&&Mn(e+" platform is unsupported");var a=Pn(t[br],e+" runtime",dn),i=Pn(t.facade,e+" facade",hn);return Br(n({[s]:2,[q]:vn,[or]:t[or],[br]:a,facade:i},Nr(t,"build")?{build:gn(t.build,e+" build",128)}:{}))},Nn=function(r,e){void 0===e&&(e="replay chunk");var n=On(r,mn,e);2!==n[s]&&Mn(e+" schemaVersion must be 2");var t=gn(n[nr],e+" startedAt",64),a=gn(n.endedAt,e+" endedAt",64);((r,e)=>{if(r.epochDay!==e.epochDay)return r.epochDay<e.epochDay?-1:1;if(r[N]!==e[N])return r[N]<e[N]?-1:1;if(r[O]!==e[O])return r[O]?1:-1;for(var n=Math.max(r[l][rr],e[l][rr]),t=0;t<n;t+=1){var a=r[l][A](t)||48,i=e[l][A](t)||48;if(a!==i)return a<i?-1:1}return 0})(Xr(t,e+" startedAt",64),Xr(a,e+" endedAt",64))>0&&Mn(e+" endedAt must not precede startedAt");var i=gn(n.codec,e+" codec",68);return cn.test(i)||Mn(e+" codec is invalid"),"none"!==n[h]&&"gzip"!==n[h]&&Mn(e+" compression is unsupported"),"base64"!==n.contentEncoding&&Mn(e+" contentEncoding must be base64"),Sr(n.payload)&&0!==n.payload[rr]&&yn.test(n.payload)||Mn(e+" payload must be non-empty canonical base64"),Br({[s]:2,[_]:gn(n[_],e+" replayId",256),[$]:gn(n[$],e+" sessionId",256),[dr]:gn(n[dr],e+" chunkId",256),[G]:Sn(n[G],e+" sequence"),[nr]:t,endedAt:a,[V]:qn(n[V],e+" identity"),[u]:Sn(n[u],e+" contextRevision"),codec:i,[h]:n[h],contentEncoding:"base64",payload:n.payload,[sr]:jn(n[sr],e+" privacy"),[er]:En(n[er],e+" versions")})},Rn=function(){var r=e((function*(r,e){var n=(r=>Fr(De(Nn(r),"replay chunk")))(r),t=yield Qr((r=>{var e=Fr("elu-sdk-replay-request-v2"),n=new Uint8Array(e[rr]+1+4+r[rr]);n.set(e,0),n[e[rr]]=0;var t=r[rr];return n[e[rr]+1]=t>>>24&255,n[e[rr]+2]=t>>>16&255,n[e[rr]+3]=t>>>8&255,n[e[rr]+4]=255&t,n.set(r,e[rr]+5),n})(n),e);return Br({[Q]:"request_"+t,canonicalChunk:n})}));return function(e,n){return r.apply(this,arguments)}}(),Un=function(){var r=e((function*(r,e){gr(e)||Mn(i(76));var n,t=gn(e[b],Kr,128),a=void 0===(n=e[j])?ln:!Pr(n)||n<1?Mn(i(77)):Math.min(n,ln),o=Nn(r),u=yield Rn(o,e[mr]),f=Br({[s]:2,[Q]:u[Q],chunk:o}),v=Fr(De(f,"replay request"));v[rr]>a&&Mn("replay request is "+v[rr]+" bytes; the effective limit is "+a);var l=yield Qr(v,e[mr]);return Br({[b]:t,[cr]:f,[I]:v,canonicalRequestSha256:"sha256:"+l,[w]:v[rr]})}));return function(e,n){return r.apply(this,arguments)}}(),Bn=function(){var r=e((function*(r){var e=(r=>{if(!rn(r))throw new Ee(i(32),i(65));var e,n=Fr(r.canonicalPayload);try{e=Pe(n,{mtime:0})}catch(r){return function(r,e){throw new Ee("invalid-gzip",e)}(0,i(62))}return Object.freeze({codec:"elu-browser-dom-v1",[h]:"gzip",contentEncoding:"base64",payload:Ke(e),compressedByteLength:e[rr],decodedByteLength:n[rr],[H]:r[H],proof:r})})(_e.seal(fn,{profile:r.profile,[D]:r[D],[pr]:r[pr]})),t=(r=>{gr(r)&&gr(r.payload)&&rn(r.payload.proof)||Mn(i(69));var e=r.payload;return Nn({[s]:2,[_]:r[_],[$]:r[$],[dr]:r[dr],[G]:r[G],[nr]:r[nr],endedAt:r.endedAt,[V]:r[V],[u]:r[u],codec:e.codec,[h]:e[h],contentEncoding:e.contentEncoding,payload:e.payload,[sr]:{[S]:r[S],[y]:r[y],[x]:e.proof[D],appliedBeforeSerialization:!0,[P]:!0,[d]:e.proof.profile[d]},[er]:r[er]})})({[_]:r[_],[$]:r[$],[dr]:r[dr],[G]:r[G],[nr]:r[nr],endedAt:r.endedAt,[V]:r[V],[u]:r[u],payload:e,[S]:r[S],[y]:r[y],[er]:r[er]});return Un(t,n({[b]:r[b]},void 0===r[j]?{}:{[j]:r[j]},void 0===r[mr]?{}:{[mr]:r[mr]}))}));return function(e){return r.apply(this,arguments)}}(),Jn=r=>{if(!Number[v](r[X])||r[X]<1)throw new Error(i(68));var t=Math.min(r[X],268435456),a=Br({[E]:null,[R]:null,chunkStartedAtMs:null,chunkBytes:0,chunkEvents:0,[G]:0}),o=null,u=!1,s=r[V][_](),l=null,c=null,d=()=>{if(!l){var e=s;l=Promise.resolve().then((()=>null==r.onReplayClosed?void 0:r.onReplayClosed(e)))}return l},h=0===r.policy[g],y=!1,m=[],b=0,k=0,M=0,S=Promise[ir](),A=function(e,n){void 0===n&&(n=!1);try{null==r.onSealFailure||r.onSealFailure(null!=e?e:new Error(i(70)),n)}catch(r){}},O=()=>{m=[],b=0},q=()=>{u=!0,o=null,O(),k=0,M=0},P=r=>{q(),A(r,!0)},N=function(){var n=e((function*(){for(;!u&&h&&m[rr]>0;){var e=m.shift();b-=e.prepared[w];try{yield r.sink(e.prepared,{discarded:!1,[G]:e[G]}),y=!0}catch(r){P(r)}}}));return function(){return n.apply(this,arguments)}}(),U=function(){var a=e((function*(e,a){var f=o;if(o=null,!u&&f&&0!==f[pr][rr]){if(e)return k-=f.estimatedBytes,void(M-=f[pr][rr]);try{var v=yield Bn(n({},r.seal,{[j]:r.policy[j],[pr]:f[pr],[_]:s,[$]:r[$],[dr]:r[V][dr](),[G]:a,[nr]:r[V].instant(f.startedAtMs),endedAt:r[V].instant(f.endedAtMs)}));u||e||(h?(yield r.sink(v,{discarded:!1,[G]:a}),y=!0):v[w]>t-b||m[rr]>=1e4?P(new Error(i(72))):(m.push({prepared:v,[G]:a}),b+=v[w]))}catch(e){u||(!h||r.policy[g]>0&&!y?P(e):A(e))}finally{k=Math.max(0,k-f.estimatedBytes),M=Math.max(0,M-f[pr][rr])}}}));return function(r,e){return a.apply(this,arguments)}}();return{record(c,m,b){if(u)return Promise[ir]();if(!Number[yr](m)||m<0||!Er(a[R])&&m<a[R]||!Number[v](b)||b<1)return P(new Error(i(31))),S;if(b>t-k||M>=1e4)return P(new Error(i(71))),S;k+=b,M+=1;var A=((r,e,t)=>{var a,i=e.atMs,o=e.byteLength;if(null===r[E]||null===r[R])return Br({action:"buffer",discardSealedChunk:!1,state:Br(n({},Jr(r,i,o,0),{[E]:i}))});var u=i-r[R],s=i-r[E];if(u>=1e3*t[p]||s>=1e3*t[f]){var v,l=r[R]-(null!=(v=r[E])?v:r[R]);return Br({action:"cut-session",discardSealedChunk:l<1e3*t[g],state:Br(n({},Jr(r,i,o,0),{[E]:i}))})}return r.chunkEvents>0&&r.chunkBytes+o>t[j]?Br({action:"cut-chunk",discardSealedChunk:!1,state:Jr(r,i,o,r[G]+1)}):Br({action:"buffer",discardSealedChunk:!1,state:Br(n({},r,{[R]:i,chunkStartedAtMs:null!=(a=r.chunkStartedAtMs)?a:i,chunkBytes:r.chunkBytes+o,chunkEvents:r.chunkEvents+1}))})})(a,{atMs:m,[w]:b},r.policy),q=a[G];return a=A.state,S=S.then(e((function*(){if(!u){if("buffer"!==A.action){if(yield U(A.discardSealedChunk,q),u)return;if("cut-session"===A.action){try{yield d()}catch(r){throw P(r),r}if(u)return;O(),h=0===r.policy[g],y=!1,s=r[V][_](),l=null}}((r,e,n)=>{if(o)return o[pr].push(r),o.endedAtMs=e,void(o.estimatedBytes+=n);o={[pr]:[r],startedAtMs:e,endedAtMs:e,estimatedBytes:n}})(c,m,b),!h&&!Er(A.state[E])&&m-A.state[E]>=1e3*r.policy[g]&&(h=!0,yield N())}}))),S},flush(){if(u)return Promise[ir]();var r=a[G];return a.chunkEvents>0&&(a=Object.freeze(n({},a,{chunkStartedAtMs:null,chunkBytes:0,chunkEvents:0,[G]:a[G]+1}))),S=S.then((()=>U(!1,r)))},hasBufferedWork:()=>!u&&(M>0||m[rr]>0||!Er(o)),close:()=>(q(),c||(c=S.then(d,function(){var r=e((function*(r){throw yield d(),r}));return function(e){return r.apply(this,arguments)}}())),c)}};export{Jn as createV2ReplaySessionDriver};
|
|
3
|
+
//# sourceMappingURL=cold-session.mjs.map
|