@nuxt/scripts 1.0.0-beta.2 → 1.0.0-beta.20

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 (165) hide show
  1. package/README.md +3 -3
  2. package/dist/client/200.html +1 -1
  3. package/dist/client/404.html +1 -1
  4. package/dist/client/_nuxt/{B66N9HCo.js → 9LJPrOyI.js} +1 -1
  5. package/dist/client/_nuxt/DFEfk2pB.js +162 -0
  6. package/dist/client/_nuxt/{DvH517bE.js → DMlY-BNa.js} +1 -1
  7. package/dist/client/_nuxt/{DfLgoB--.js → __ZZTkMj.js} +1 -1
  8. package/dist/client/_nuxt/builds/latest.json +1 -1
  9. package/dist/client/_nuxt/builds/meta/8212d4fa-7985-421b-815a-03a886e667d4.json +1 -0
  10. package/dist/client/_nuxt/entry.CACgbLJl.css +1 -0
  11. package/dist/client/_nuxt/error-404.CHeaW3dp.css +1 -0
  12. package/dist/client/_nuxt/error-500.DvOvWme_.css +1 -0
  13. package/dist/client/index.html +1 -1
  14. package/dist/module.d.mts +27 -18
  15. package/dist/module.d.ts +178 -0
  16. package/dist/module.json +1 -1
  17. package/dist/module.mjs +747 -527
  18. package/dist/registry.d.ts +6 -0
  19. package/dist/registry.mjs +74 -21
  20. package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.d.vue.ts +2 -2
  21. package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.vue +7 -7
  22. package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.vue.d.ts +2 -2
  23. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.vue +6 -6
  24. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsCircle.vue +7 -7
  25. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsHeatmapLayer.vue +6 -6
  26. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsInfoWindow.vue +12 -12
  27. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarker.vue +6 -6
  28. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.d.vue.ts +1 -1
  29. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.vue +6 -6
  30. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.vue.d.ts +1 -1
  31. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPinElement.vue +5 -5
  32. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolygon.vue +7 -7
  33. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolyline.vue +7 -7
  34. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsRectangle.vue +7 -7
  35. package/dist/runtime/components/ScriptCrisp.vue +1 -1
  36. package/dist/runtime/components/ScriptGoogleAdsense.vue +1 -1
  37. package/dist/runtime/components/ScriptGravatar.d.vue.ts +22 -0
  38. package/dist/runtime/components/ScriptGravatar.vue +46 -0
  39. package/dist/runtime/components/ScriptGravatar.vue.d.ts +22 -0
  40. package/dist/runtime/components/ScriptInstagramEmbed.vue +1 -1
  41. package/dist/runtime/components/ScriptIntercom.vue +4 -3
  42. package/dist/runtime/components/ScriptPayPalButtons.d.vue.ts +43 -32
  43. package/dist/runtime/components/ScriptPayPalButtons.vue +48 -79
  44. package/dist/runtime/components/ScriptPayPalButtons.vue.d.ts +43 -32
  45. package/dist/runtime/components/ScriptPayPalMessages.d.vue.ts +37 -23
  46. package/dist/runtime/components/ScriptPayPalMessages.vue +46 -50
  47. package/dist/runtime/components/ScriptPayPalMessages.vue.d.ts +37 -23
  48. package/dist/runtime/components/ScriptStripePricingTable.vue +2 -2
  49. package/dist/runtime/components/ScriptVimeoPlayer.d.vue.ts +9 -0
  50. package/dist/runtime/components/ScriptVimeoPlayer.vue +13 -10
  51. package/dist/runtime/components/ScriptVimeoPlayer.vue.d.ts +9 -0
  52. package/dist/runtime/components/ScriptXEmbed.d.vue.ts +1 -1
  53. package/dist/runtime/components/ScriptXEmbed.vue +1 -1
  54. package/dist/runtime/components/ScriptXEmbed.vue.d.ts +1 -1
  55. package/dist/runtime/components/ScriptYouTubePlayer.d.vue.ts +2 -2
  56. package/dist/runtime/components/ScriptYouTubePlayer.vue +11 -5
  57. package/dist/runtime/components/ScriptYouTubePlayer.vue.d.ts +2 -2
  58. package/dist/runtime/composables/useScript.js +11 -6
  59. package/dist/runtime/composables/useScriptEventPage.js +2 -2
  60. package/dist/runtime/composables/useScriptTriggerConsent.js +1 -1
  61. package/dist/runtime/composables/useScriptTriggerElement.js +1 -1
  62. package/dist/runtime/composables/useScriptTriggerIdleTimeout.js +1 -1
  63. package/dist/runtime/registry/clarity.d.ts +10 -15
  64. package/dist/runtime/registry/clarity.js +22 -31
  65. package/dist/runtime/registry/cloudflare-web-analytics.d.ts +2 -13
  66. package/dist/runtime/registry/cloudflare-web-analytics.js +2 -14
  67. package/dist/runtime/registry/crisp.d.ts +9 -39
  68. package/dist/runtime/registry/crisp.js +2 -33
  69. package/dist/runtime/registry/databuddy-analytics.d.ts +2 -35
  70. package/dist/runtime/registry/databuddy-analytics.js +20 -45
  71. package/dist/runtime/registry/fathom-analytics.d.ts +6 -25
  72. package/dist/runtime/registry/fathom-analytics.js +2 -24
  73. package/dist/runtime/registry/google-adsense.d.ts +2 -10
  74. package/dist/runtime/registry/google-adsense.js +2 -11
  75. package/dist/runtime/registry/google-analytics.d.ts +3 -5
  76. package/dist/runtime/registry/google-analytics.js +3 -8
  77. package/dist/runtime/registry/google-maps.d.ts +3 -9
  78. package/dist/runtime/registry/google-maps.js +2 -8
  79. package/dist/runtime/registry/google-recaptcha.d.ts +2 -6
  80. package/dist/runtime/registry/google-recaptcha.js +4 -12
  81. package/dist/runtime/registry/google-sign-in.d.ts +2 -13
  82. package/dist/runtime/registry/google-sign-in.js +2 -22
  83. package/dist/runtime/registry/google-tag-manager.d.ts +3 -28
  84. package/dist/runtime/registry/google-tag-manager.js +4 -27
  85. package/dist/runtime/registry/gravatar.d.ts +25 -0
  86. package/dist/runtime/registry/gravatar.js +32 -0
  87. package/dist/runtime/registry/hotjar.d.ts +3 -5
  88. package/dist/runtime/registry/hotjar.js +2 -5
  89. package/dist/runtime/registry/instagram-embed.d.ts +2 -17
  90. package/dist/runtime/registry/instagram-embed.js +4 -19
  91. package/dist/runtime/registry/intercom.d.ts +3 -11
  92. package/dist/runtime/registry/intercom.js +2 -12
  93. package/dist/runtime/registry/matomo-analytics.d.ts +2 -11
  94. package/dist/runtime/registry/matomo-analytics.js +3 -12
  95. package/dist/runtime/registry/meta-pixel.d.ts +3 -5
  96. package/dist/runtime/registry/meta-pixel.js +2 -4
  97. package/dist/runtime/registry/npm.d.ts +2 -6
  98. package/dist/runtime/registry/npm.js +2 -9
  99. package/dist/runtime/registry/paypal.d.ts +4 -25
  100. package/dist/runtime/registry/paypal.js +3 -66
  101. package/dist/runtime/registry/plausible-analytics.js +18 -13
  102. package/dist/runtime/registry/posthog.d.ts +10 -11
  103. package/dist/runtime/registry/posthog.js +7 -20
  104. package/dist/runtime/registry/reddit-pixel.d.ts +4 -5
  105. package/dist/runtime/registry/reddit-pixel.js +2 -4
  106. package/dist/runtime/registry/rybbit-analytics.d.ts +2 -14
  107. package/dist/runtime/registry/rybbit-analytics.js +7 -19
  108. package/dist/runtime/registry/schemas.d.ts +946 -0
  109. package/dist/runtime/registry/schemas.js +901 -0
  110. package/dist/runtime/registry/segment.d.ts +2 -5
  111. package/dist/runtime/registry/segment.js +2 -5
  112. package/dist/runtime/registry/snapchat-pixel.d.ts +3 -32
  113. package/dist/runtime/registry/snapchat-pixel.js +2 -20
  114. package/dist/runtime/registry/stripe.d.ts +3 -4
  115. package/dist/runtime/registry/stripe.js +2 -4
  116. package/dist/runtime/registry/tiktok-pixel.d.ts +3 -6
  117. package/dist/runtime/registry/tiktok-pixel.js +2 -6
  118. package/dist/runtime/registry/umami-analytics.d.ts +2 -31
  119. package/dist/runtime/registry/umami-analytics.js +2 -36
  120. package/dist/runtime/registry/vercel-analytics.d.ts +29 -0
  121. package/dist/runtime/registry/vercel-analytics.js +84 -0
  122. package/dist/runtime/registry/vimeo-player.d.ts +2 -2
  123. package/dist/runtime/registry/vimeo-player.js +1 -1
  124. package/dist/runtime/registry/x-embed.d.ts +2 -16
  125. package/dist/runtime/registry/x-embed.js +2 -17
  126. package/dist/runtime/registry/x-pixel.d.ts +3 -6
  127. package/dist/runtime/registry/x-pixel.js +2 -5
  128. package/dist/runtime/registry/youtube-player.d.ts +7 -7
  129. package/dist/runtime/registry/youtube-player.js +1 -1
  130. package/dist/runtime/server/google-static-maps-proxy.js +1 -1
  131. package/dist/runtime/server/{sw-handler.d.ts → gravatar-proxy.d.ts} +1 -1
  132. package/dist/runtime/server/gravatar-proxy.js +62 -0
  133. package/dist/runtime/server/instagram-embed-asset.js +2 -1
  134. package/dist/runtime/server/instagram-embed-image.js +2 -1
  135. package/dist/runtime/server/instagram-embed.js +22 -13
  136. package/dist/runtime/server/proxy-handler.js +161 -117
  137. package/dist/runtime/server/utils/privacy.d.ts +45 -1
  138. package/dist/runtime/server/utils/privacy.js +103 -40
  139. package/dist/runtime/server/x-embed.js +3 -2
  140. package/dist/runtime/types.d.ts +30 -24
  141. package/dist/runtime/utils/pure.d.ts +0 -4
  142. package/dist/runtime/utils/pure.js +0 -67
  143. package/dist/runtime/utils.d.ts +3 -3
  144. package/dist/runtime/utils.js +12 -7
  145. package/dist/shared/scripts.Crpn87WB.mjs +318 -0
  146. package/dist/stats.d.mts +39 -0
  147. package/dist/stats.d.ts +39 -0
  148. package/dist/stats.mjs +772 -0
  149. package/dist/types-source.d.mts +19 -0
  150. package/dist/types-source.d.ts +19 -0
  151. package/dist/types-source.mjs +975 -0
  152. package/package.json +42 -31
  153. package/dist/client/_nuxt/B8XOar-X.js +0 -162
  154. package/dist/client/_nuxt/builds/meta/133a46c5-a5c1-4a63-87d1-037947a5bcdb.json +0 -1
  155. package/dist/client/_nuxt/entry.D45OuV0w.css +0 -1
  156. package/dist/client/_nuxt/error-404.B57D-jUQ.css +0 -1
  157. package/dist/client/_nuxt/error-500.DTHUW7BI.css +0 -1
  158. package/dist/runtime/components/ScriptPayPalMarks.d.vue.ts +0 -52
  159. package/dist/runtime/components/ScriptPayPalMarks.vue +0 -69
  160. package/dist/runtime/components/ScriptPayPalMarks.vue.d.ts +0 -52
  161. package/dist/runtime/plugins/sw-register.client.d.ts +0 -2
  162. package/dist/runtime/plugins/sw-register.client.js +0 -12
  163. package/dist/runtime/server/sw-handler.js +0 -25
  164. package/dist/runtime/sw/proxy-sw.template.d.ts +0 -1
  165. package/dist/runtime/sw/proxy-sw.template.js +0 -54
package/dist/stats.mjs ADDED
@@ -0,0 +1,772 @@
1
+ import { g as getAllProxyConfigs } from './shared/scripts.Crpn87WB.mjs';
2
+
3
+ const scriptMeta = {
4
+ // Analytics
5
+ plausibleAnalytics: {
6
+ urls: ["https://plausible.io/js/script.js"],
7
+ trackedData: ["page-views", "events", "conversions"]
8
+ },
9
+ cloudflareWebAnalytics: {
10
+ urls: ["https://static.cloudflareinsights.com/beacon.min.js"],
11
+ trackedData: ["page-views"]
12
+ },
13
+ postHog: {
14
+ urls: [],
15
+ // NPM-only, no CDN script
16
+ trackedData: ["page-views", "events", "conversions", "user-identity", "session-replay", "heatmaps", "ab-testing"]
17
+ },
18
+ fathomAnalytics: {
19
+ urls: ["https://cdn.usefathom.com/script.js"],
20
+ trackedData: ["page-views", "events", "conversions"]
21
+ },
22
+ matomoAnalytics: {
23
+ urls: ["https://cdn.matomo.cloud/demo.matomo.cloud/matomo.js"],
24
+ trackedData: ["page-views", "events", "conversions", "user-identity", "heatmaps", "ab-testing"]
25
+ },
26
+ rybbitAnalytics: {
27
+ urls: ["https://app.rybbit.io/api/script.js"],
28
+ trackedData: ["page-views", "events"]
29
+ },
30
+ databuddyAnalytics: {
31
+ urls: ["https://cdn.databuddy.cc/databuddy.js"],
32
+ trackedData: ["page-views", "events"]
33
+ },
34
+ segment: {
35
+ urls: ["https://cdn.segment.com/analytics.js/v1/KBXOGxgqMFjm2mxtJDJg0iDn5AnGYb9C/analytics.min.js"],
36
+ trackedData: ["page-views", "events", "conversions", "user-identity"]
37
+ },
38
+ googleAnalytics: {
39
+ urls: ["https://www.googletagmanager.com/gtag/js?id=G-TR58L0EF8P"],
40
+ trackedData: ["page-views", "events", "conversions", "user-identity", "audiences"]
41
+ },
42
+ umamiAnalytics: {
43
+ urls: ["https://cloud.umami.is/script.js"],
44
+ trackedData: ["page-views", "events"]
45
+ },
46
+ // Ads / Pixels
47
+ metaPixel: {
48
+ urls: ["https://connect.facebook.net/en_US/fbevents.js"],
49
+ trackedData: ["page-views", "conversions", "retargeting", "audiences"]
50
+ },
51
+ xPixel: {
52
+ urls: ["https://static.ads-twitter.com/uwt.js"],
53
+ trackedData: ["page-views", "conversions", "retargeting", "audiences"]
54
+ },
55
+ tikTokPixel: {
56
+ urls: ["https://analytics.tiktok.com/i18n/pixel/events.js"],
57
+ trackedData: ["page-views", "conversions", "retargeting", "audiences"]
58
+ },
59
+ snapchatPixel: {
60
+ urls: ["https://sc-static.net/scevent.min.js"],
61
+ trackedData: ["page-views", "conversions", "retargeting", "audiences"]
62
+ },
63
+ redditPixel: {
64
+ urls: ["https://www.redditstatic.com/ads/pixel.js"],
65
+ trackedData: ["page-views", "conversions", "retargeting", "audiences"]
66
+ },
67
+ googleAdsense: {
68
+ urls: ["https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"],
69
+ trackedData: ["page-views", "retargeting", "audiences"]
70
+ },
71
+ carbonAds: {
72
+ urls: ["https://cdn.carbonads.com/carbon.js?serve=CW7DTKJL&placement=unlighthousedev&format=cover"],
73
+ trackedData: ["page-views"]
74
+ },
75
+ // Session replay / Heatmaps
76
+ hotjar: {
77
+ urls: ["https://static.hotjar.com/c/hotjar-3925006.js?sv=6"],
78
+ trackedData: ["page-views", "session-replay", "heatmaps", "clicks", "scrolls", "form-submissions"]
79
+ },
80
+ clarity: {
81
+ urls: ["https://www.clarity.ms/tag/mqk2m9dr2v"],
82
+ trackedData: ["page-views", "session-replay", "heatmaps", "clicks", "scrolls"]
83
+ },
84
+ // Tag Manager
85
+ googleTagManager: {
86
+ urls: ["https://www.googletagmanager.com/gtm.js?id=GTM-MWW974PF"],
87
+ trackedData: ["tag-injection"]
88
+ },
89
+ // Support
90
+ intercom: {
91
+ urls: ["https://widget.intercom.io/widget/akg5rmxb"],
92
+ trackedData: ["user-identity", "events"]
93
+ },
94
+ crisp: {
95
+ urls: ["https://client.crisp.chat/l.js"],
96
+ trackedData: ["user-identity", "events"]
97
+ },
98
+ // Payments
99
+ stripe: {
100
+ urls: ["https://js.stripe.com/v3/"],
101
+ trackedData: ["transactions"]
102
+ },
103
+ lemonSqueezy: {
104
+ urls: ["https://assets.lemonsqueezy.com/lemon.js"],
105
+ trackedData: ["transactions"]
106
+ },
107
+ payPal: {
108
+ urls: ["https://www.paypal.com/web-sdk/v6/core"],
109
+ trackedData: ["transactions"]
110
+ },
111
+ // Video
112
+ vimeoPlayer: {
113
+ urls: ["https://player.vimeo.com/api/player.js"],
114
+ trackedData: ["video-engagement"]
115
+ },
116
+ youTubePlayer: {
117
+ urls: ["https://www.youtube.com/iframe_api"],
118
+ trackedData: ["video-engagement"]
119
+ },
120
+ // Content
121
+ googleMaps: {
122
+ urls: [],
123
+ // Dynamic URL with API key
124
+ trackedData: []
125
+ },
126
+ // CDN
127
+ npm: {
128
+ urls: [],
129
+ // Dynamic per package
130
+ trackedData: []
131
+ },
132
+ // Utility
133
+ googleRecaptcha: {
134
+ urls: ["https://www.google.com/recaptcha/api.js"],
135
+ trackedData: []
136
+ },
137
+ googleSignIn: {
138
+ urls: ["https://accounts.google.com/gsi/client"],
139
+ trackedData: ["user-identity"]
140
+ }
141
+ };
142
+
143
+ const plausibleAnalytics = {
144
+ totalTransferKb: 1.9,
145
+ totalDecodedKb: 2.9,
146
+ loadTimeMs: 79,
147
+ scripts: [
148
+ {
149
+ url: "https://plausible.io/js/script.js",
150
+ transferKb: 1.9,
151
+ decodedKb: 2.9,
152
+ encoding: "zstd",
153
+ durationMs: 79,
154
+ initiatorType: "script",
155
+ protocol: "unknown"
156
+ }
157
+ ]
158
+ };
159
+ const cloudflareWebAnalytics = {
160
+ totalTransferKb: 10.8,
161
+ totalDecodedKb: 30.4,
162
+ loadTimeMs: 100,
163
+ scripts: [
164
+ {
165
+ url: "https://static.cloudflareinsights.com/beacon.min.js",
166
+ transferKb: 10.8,
167
+ decodedKb: 30.4,
168
+ encoding: "gzip",
169
+ durationMs: 100,
170
+ initiatorType: "script",
171
+ protocol: "unknown"
172
+ }
173
+ ]
174
+ };
175
+ const postHog = {
176
+ totalTransferKb: 0,
177
+ totalDecodedKb: 0,
178
+ loadTimeMs: 0,
179
+ scripts: [
180
+ ]
181
+ };
182
+ const fathomAnalytics = {
183
+ totalTransferKb: 3,
184
+ totalDecodedKb: 6.7,
185
+ loadTimeMs: 340,
186
+ scripts: [
187
+ {
188
+ url: "https://cdn.usefathom.com/script.js",
189
+ transferKb: 2.7,
190
+ decodedKb: 6.7,
191
+ encoding: "zstd",
192
+ durationMs: 340,
193
+ initiatorType: "script",
194
+ protocol: "unknown"
195
+ },
196
+ {
197
+ url: "https://cdn.usefathom.com/?h=http%3A%2F%2F127.0.0.1&p=%2FfathomAnalytics&r=&sid=null&qs=%7B%7D&cid=22238330",
198
+ transferKb: 0.3,
199
+ decodedKb: 0,
200
+ encoding: "none",
201
+ durationMs: 304,
202
+ initiatorType: "img",
203
+ protocol: "unknown"
204
+ }
205
+ ]
206
+ };
207
+ const matomoAnalytics = {
208
+ totalTransferKb: 60.4,
209
+ totalDecodedKb: 218.6,
210
+ loadTimeMs: 101,
211
+ scripts: [
212
+ {
213
+ url: "https://cdn.matomo.cloud/demo.matomo.cloud/matomo.js",
214
+ transferKb: 60.4,
215
+ decodedKb: 218.6,
216
+ encoding: "br",
217
+ durationMs: 101,
218
+ initiatorType: "script",
219
+ protocol: "unknown"
220
+ }
221
+ ]
222
+ };
223
+ const rybbitAnalytics = {
224
+ totalTransferKb: 9,
225
+ totalDecodedKb: 25.3,
226
+ loadTimeMs: 1127,
227
+ scripts: [
228
+ {
229
+ url: "https://app.rybbit.io/api/script.js",
230
+ transferKb: 9,
231
+ decodedKb: 25.3,
232
+ encoding: "zstd",
233
+ durationMs: 1127,
234
+ initiatorType: "script",
235
+ protocol: "unknown"
236
+ }
237
+ ]
238
+ };
239
+ const databuddyAnalytics = {
240
+ totalTransferKb: 10.6,
241
+ totalDecodedKb: 29.2,
242
+ loadTimeMs: 83,
243
+ scripts: [
244
+ {
245
+ url: "https://cdn.databuddy.cc/databuddy.js",
246
+ transferKb: 10.6,
247
+ decodedKb: 29.2,
248
+ encoding: "zstd",
249
+ durationMs: 83,
250
+ initiatorType: "script",
251
+ protocol: "unknown"
252
+ }
253
+ ]
254
+ };
255
+ const segment = {
256
+ totalTransferKb: 29.4,
257
+ totalDecodedKb: 107,
258
+ loadTimeMs: 597,
259
+ scripts: [
260
+ {
261
+ url: "https://cdn.segment.com/analytics.js/v1/KBXOGxgqMFjm2mxtJDJg0iDn5AnGYb9C/analytics.min.js",
262
+ transferKb: 28.2,
263
+ decodedKb: 106.4,
264
+ encoding: "br",
265
+ durationMs: 597,
266
+ initiatorType: "script",
267
+ protocol: "unknown"
268
+ },
269
+ {
270
+ url: "https://cdn.segment.com/v1/projects/KBXOGxgqMFjm2mxtJDJg0iDn5AnGYb9C/settings",
271
+ transferKb: 1.2,
272
+ decodedKb: 0.6,
273
+ encoding: "none",
274
+ durationMs: 83,
275
+ initiatorType: "fetch",
276
+ protocol: "unknown"
277
+ }
278
+ ]
279
+ };
280
+ const googleAnalytics = {
281
+ totalTransferKb: 151.5,
282
+ totalDecodedKb: 446,
283
+ loadTimeMs: 537,
284
+ scripts: [
285
+ {
286
+ url: "https://www.googletagmanager.com/gtag/js?id=G-TR58L0EF8P",
287
+ transferKb: 151.5,
288
+ decodedKb: 446,
289
+ encoding: "zstd",
290
+ durationMs: 537,
291
+ initiatorType: "script",
292
+ protocol: "unknown"
293
+ }
294
+ ]
295
+ };
296
+ const umamiAnalytics = {
297
+ totalTransferKb: 2.4,
298
+ totalDecodedKb: 2.6,
299
+ loadTimeMs: 99,
300
+ scripts: [
301
+ {
302
+ url: "https://cloud.umami.is/script.js",
303
+ transferKb: 2.4,
304
+ decodedKb: 2.6,
305
+ encoding: "br",
306
+ durationMs: 99,
307
+ initiatorType: "script",
308
+ protocol: "unknown"
309
+ }
310
+ ]
311
+ };
312
+ const metaPixel = {
313
+ totalTransferKb: 93.9,
314
+ totalDecodedKb: 353.3,
315
+ loadTimeMs: 123,
316
+ scripts: [
317
+ {
318
+ url: "https://connect.facebook.net/en_US/fbevents.js",
319
+ transferKb: 93.9,
320
+ decodedKb: 353.3,
321
+ encoding: "gzip",
322
+ durationMs: 123,
323
+ initiatorType: "script",
324
+ protocol: "h2"
325
+ }
326
+ ]
327
+ };
328
+ const xPixel = {
329
+ totalTransferKb: 9.5,
330
+ totalDecodedKb: 32.3,
331
+ loadTimeMs: 72,
332
+ scripts: [
333
+ {
334
+ url: "https://static.ads-twitter.com/uwt.js",
335
+ transferKb: 9.5,
336
+ decodedKb: 32.3,
337
+ encoding: "gzip",
338
+ durationMs: 72,
339
+ initiatorType: "script",
340
+ protocol: "unknown"
341
+ }
342
+ ]
343
+ };
344
+ const tikTokPixel = {
345
+ totalTransferKb: 2.7,
346
+ totalDecodedKb: 7.6,
347
+ loadTimeMs: 473,
348
+ scripts: [
349
+ {
350
+ url: "https://analytics.tiktok.com/i18n/pixel/events.js",
351
+ transferKb: 2.7,
352
+ decodedKb: 7.6,
353
+ encoding: "gzip",
354
+ durationMs: 473,
355
+ initiatorType: "script",
356
+ protocol: "unknown"
357
+ }
358
+ ]
359
+ };
360
+ const snapchatPixel = {
361
+ totalTransferKb: 24.7,
362
+ totalDecodedKb: 57.4,
363
+ loadTimeMs: 569,
364
+ scripts: [
365
+ {
366
+ url: "https://sc-static.net/scevent.min.js",
367
+ transferKb: 24.7,
368
+ decodedKb: 57.4,
369
+ encoding: "gzip",
370
+ durationMs: 569,
371
+ initiatorType: "script",
372
+ protocol: "unknown"
373
+ }
374
+ ]
375
+ };
376
+ const redditPixel = {
377
+ totalTransferKb: 20,
378
+ totalDecodedKb: 79.6,
379
+ loadTimeMs: 122,
380
+ scripts: [
381
+ {
382
+ url: "https://www.redditstatic.com/ads/pixel.js",
383
+ transferKb: 20,
384
+ decodedKb: 79.6,
385
+ encoding: "gzip",
386
+ durationMs: 122,
387
+ initiatorType: "script",
388
+ protocol: "unknown"
389
+ }
390
+ ]
391
+ };
392
+ const googleAdsense = {
393
+ totalTransferKb: 63.4,
394
+ totalDecodedKb: 193.1,
395
+ loadTimeMs: 401,
396
+ scripts: [
397
+ {
398
+ url: "https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js",
399
+ transferKb: 63.4,
400
+ decodedKb: 193.1,
401
+ encoding: "br",
402
+ durationMs: 401,
403
+ initiatorType: "script",
404
+ protocol: "h2"
405
+ }
406
+ ]
407
+ };
408
+ const carbonAds = {
409
+ totalTransferKb: 10.8,
410
+ totalDecodedKb: 37.1,
411
+ loadTimeMs: 55,
412
+ scripts: [
413
+ {
414
+ url: "https://cdn.carbonads.com/carbon.js?serve=CW7DTKJL&placement=unlighthousedev&format=cover",
415
+ transferKb: 10.8,
416
+ decodedKb: 37.1,
417
+ encoding: "gzip",
418
+ durationMs: 55,
419
+ initiatorType: "script",
420
+ protocol: "unknown"
421
+ }
422
+ ]
423
+ };
424
+ const hotjar = {
425
+ totalTransferKb: 6.1,
426
+ totalDecodedKb: 14.7,
427
+ loadTimeMs: 346,
428
+ scripts: [
429
+ {
430
+ url: "https://static.hotjar.com/c/hotjar-3925006.js?sv=6",
431
+ transferKb: 6.1,
432
+ decodedKb: 14.7,
433
+ encoding: "br",
434
+ durationMs: 346,
435
+ initiatorType: "script",
436
+ protocol: "unknown"
437
+ }
438
+ ]
439
+ };
440
+ const clarity = {
441
+ totalTransferKb: 0.8,
442
+ totalDecodedKb: 0.6,
443
+ loadTimeMs: 365,
444
+ scripts: [
445
+ {
446
+ url: "https://www.clarity.ms/tag/mqk2m9dr2v",
447
+ transferKb: 0.8,
448
+ decodedKb: 0.6,
449
+ encoding: "none",
450
+ durationMs: 365,
451
+ initiatorType: "script",
452
+ protocol: "unknown"
453
+ }
454
+ ]
455
+ };
456
+ const googleTagManager = {
457
+ totalTransferKb: 106.4,
458
+ totalDecodedKb: 295.9,
459
+ loadTimeMs: 483,
460
+ scripts: [
461
+ {
462
+ url: "https://www.googletagmanager.com/gtm.js?id=GTM-MWW974PF",
463
+ transferKb: 106.4,
464
+ decodedKb: 295.9,
465
+ encoding: "zstd",
466
+ durationMs: 483,
467
+ initiatorType: "script",
468
+ protocol: "unknown"
469
+ }
470
+ ]
471
+ };
472
+ const intercom = {
473
+ totalTransferKb: 3.6,
474
+ totalDecodedKb: 7.4,
475
+ loadTimeMs: 735,
476
+ scripts: [
477
+ {
478
+ url: "https://widget.intercom.io/widget/akg5rmxb",
479
+ transferKb: 3.6,
480
+ decodedKb: 7.4,
481
+ encoding: "gzip",
482
+ durationMs: 735,
483
+ initiatorType: "script",
484
+ protocol: "unknown"
485
+ }
486
+ ]
487
+ };
488
+ const crisp = {
489
+ totalTransferKb: 3.3,
490
+ totalDecodedKb: 7.6,
491
+ loadTimeMs: 92,
492
+ scripts: [
493
+ {
494
+ url: "https://client.crisp.chat/l.js",
495
+ transferKb: 3.3,
496
+ decodedKb: 7.6,
497
+ encoding: "br",
498
+ durationMs: 92,
499
+ initiatorType: "script",
500
+ protocol: "unknown"
501
+ }
502
+ ]
503
+ };
504
+ const stripe = {
505
+ totalTransferKb: 212.4,
506
+ totalDecodedKb: 916.7,
507
+ loadTimeMs: 170,
508
+ scripts: [
509
+ {
510
+ url: "https://js.stripe.com/v3/",
511
+ transferKb: 212.4,
512
+ decodedKb: 916.7,
513
+ encoding: "br",
514
+ durationMs: 170,
515
+ initiatorType: "script",
516
+ protocol: "h2"
517
+ }
518
+ ]
519
+ };
520
+ const lemonSqueezy = {
521
+ totalTransferKb: 1.8,
522
+ totalDecodedKb: 3.8,
523
+ loadTimeMs: 84,
524
+ scripts: [
525
+ {
526
+ url: "https://assets.lemonsqueezy.com/lemon.js",
527
+ transferKb: 1.8,
528
+ decodedKb: 3.8,
529
+ encoding: "br",
530
+ durationMs: 84,
531
+ initiatorType: "script",
532
+ protocol: "unknown"
533
+ }
534
+ ]
535
+ };
536
+ const payPal = {
537
+ totalTransferKb: 49.6,
538
+ totalDecodedKb: 150.9,
539
+ loadTimeMs: 182,
540
+ scripts: [
541
+ {
542
+ url: "https://www.paypal.com/web-sdk/v6/core",
543
+ transferKb: 49.6,
544
+ decodedKb: 150.9,
545
+ encoding: "gzip",
546
+ durationMs: 182,
547
+ initiatorType: "script",
548
+ protocol: "unknown"
549
+ }
550
+ ]
551
+ };
552
+ const vimeoPlayer = {
553
+ totalTransferKb: 8.9,
554
+ totalDecodedKb: 23.8,
555
+ loadTimeMs: 107,
556
+ scripts: [
557
+ {
558
+ url: "https://player.vimeo.com/api/player.js",
559
+ transferKb: 8.9,
560
+ decodedKb: 23.8,
561
+ encoding: "gzip",
562
+ durationMs: 107,
563
+ initiatorType: "script",
564
+ protocol: "unknown"
565
+ }
566
+ ]
567
+ };
568
+ const youTubePlayer = {
569
+ totalTransferKb: 14,
570
+ totalDecodedKb: 32.4,
571
+ loadTimeMs: 293,
572
+ scripts: [
573
+ {
574
+ url: "https://www.youtube.com/iframe_api",
575
+ transferKb: 3.4,
576
+ decodedKb: 1,
577
+ encoding: "br",
578
+ durationMs: 293,
579
+ initiatorType: "script",
580
+ protocol: "unknown"
581
+ },
582
+ {
583
+ url: "https://www.youtube.com/s/player/99f55c01/www-widgetapi.vflset/www-widgetapi.js",
584
+ transferKb: 10.6,
585
+ decodedKb: 31.4,
586
+ encoding: "br",
587
+ durationMs: 20,
588
+ initiatorType: "script",
589
+ protocol: "unknown"
590
+ }
591
+ ]
592
+ };
593
+ const googleMaps = {
594
+ totalTransferKb: 0,
595
+ totalDecodedKb: 0,
596
+ loadTimeMs: 0,
597
+ scripts: [
598
+ ]
599
+ };
600
+ const npm = {
601
+ totalTransferKb: 0,
602
+ totalDecodedKb: 0,
603
+ loadTimeMs: 0,
604
+ scripts: [
605
+ ]
606
+ };
607
+ const googleRecaptcha = {
608
+ totalTransferKb: 360.6,
609
+ totalDecodedKb: 844.4,
610
+ loadTimeMs: 252,
611
+ scripts: [
612
+ {
613
+ url: "https://www.google.com/recaptcha/api.js",
614
+ transferKb: 1.5,
615
+ decodedKb: 1.6,
616
+ encoding: "gzip",
617
+ durationMs: 252,
618
+ initiatorType: "script",
619
+ protocol: "unknown"
620
+ },
621
+ {
622
+ url: "https://www.gstatic.com/recaptcha/releases/QvLuXwupqtKMva7GIh5eGl3U/recaptcha__en.js",
623
+ transferKb: 359.1,
624
+ decodedKb: 842.8,
625
+ encoding: "gzip",
626
+ durationMs: 227,
627
+ initiatorType: "script",
628
+ protocol: "h2"
629
+ }
630
+ ]
631
+ };
632
+ const googleSignIn = {
633
+ totalTransferKb: 91.8,
634
+ totalDecodedKb: 246.7,
635
+ loadTimeMs: 916,
636
+ scripts: [
637
+ {
638
+ url: "https://accounts.google.com/gsi/client",
639
+ transferKb: 91.8,
640
+ decodedKb: 246.7,
641
+ encoding: "gzip",
642
+ durationMs: 916,
643
+ initiatorType: "script",
644
+ protocol: "unknown"
645
+ }
646
+ ]
647
+ };
648
+ const vercelAnalytics = {
649
+ totalTransferKb: 1.5,
650
+ totalDecodedKb: 3.8,
651
+ loadTimeMs: 80,
652
+ scripts: [
653
+ {
654
+ url: "https://va.vercel-scripts.com/v1/script.js",
655
+ transferKb: 1.5,
656
+ decodedKb: 3.8,
657
+ encoding: "gzip",
658
+ durationMs: 80,
659
+ initiatorType: "script",
660
+ protocol: "h2"
661
+ }
662
+ ]
663
+ };
664
+ const scriptSizes = {
665
+ plausibleAnalytics: plausibleAnalytics,
666
+ cloudflareWebAnalytics: cloudflareWebAnalytics,
667
+ postHog: postHog,
668
+ fathomAnalytics: fathomAnalytics,
669
+ matomoAnalytics: matomoAnalytics,
670
+ rybbitAnalytics: rybbitAnalytics,
671
+ databuddyAnalytics: databuddyAnalytics,
672
+ segment: segment,
673
+ googleAnalytics: googleAnalytics,
674
+ umamiAnalytics: umamiAnalytics,
675
+ metaPixel: metaPixel,
676
+ xPixel: xPixel,
677
+ tikTokPixel: tikTokPixel,
678
+ snapchatPixel: snapchatPixel,
679
+ redditPixel: redditPixel,
680
+ googleAdsense: googleAdsense,
681
+ carbonAds: carbonAds,
682
+ hotjar: hotjar,
683
+ clarity: clarity,
684
+ googleTagManager: googleTagManager,
685
+ intercom: intercom,
686
+ crisp: crisp,
687
+ stripe: stripe,
688
+ lemonSqueezy: lemonSqueezy,
689
+ payPal: payPal,
690
+ vimeoPlayer: vimeoPlayer,
691
+ youTubePlayer: youTubePlayer,
692
+ googleMaps: googleMaps,
693
+ npm: npm,
694
+ googleRecaptcha: googleRecaptcha,
695
+ googleSignIn: googleSignIn,
696
+ vercelAnalytics: vercelAnalytics
697
+ };
698
+
699
+ const DOMAIN_RE = /^https?:\/\/([^/]+)/;
700
+ const USE_SCRIPT_RE = /^useScript/;
701
+ const WORD_SPLIT_RE = /[\s-]+/;
702
+ function computePrivacyLevel(privacy) {
703
+ if (!privacy)
704
+ return "unknown";
705
+ const flags = Object.values(privacy);
706
+ if (flags.every(Boolean))
707
+ return "full";
708
+ if (flags.some(Boolean))
709
+ return "partial";
710
+ return "none";
711
+ }
712
+ function extractDomains(routes) {
713
+ const domains = /* @__PURE__ */ new Set();
714
+ for (const { proxy } of Object.values(routes)) {
715
+ const match = proxy.match(DOMAIN_RE);
716
+ if (match?.[1])
717
+ domains.add(match[1]);
718
+ }
719
+ return [...domains].sort();
720
+ }
721
+ function deriveMetaKey(importName, label) {
722
+ if (importName) {
723
+ const stripped = importName.replace(USE_SCRIPT_RE, "");
724
+ return stripped.charAt(0).toLowerCase() + stripped.slice(1);
725
+ }
726
+ if (label) {
727
+ const words = label.split(WORD_SPLIT_RE);
728
+ return words.map(
729
+ (w, i) => i === 0 ? w.toLowerCase() : w.charAt(0).toUpperCase() + w.slice(1).toLowerCase()
730
+ ).join("");
731
+ }
732
+ return "";
733
+ }
734
+ async function getScriptStats() {
735
+ const { registry } = await import('./registry.mjs');
736
+ const entries = await registry();
737
+ const proxyConfigs = getAllProxyConfigs("/_scripts");
738
+ const sizes = scriptSizes;
739
+ return entries.map((entry) => {
740
+ const metaKey = deriveMetaKey(entry.import?.name, entry.label);
741
+ const meta = scriptMeta[metaKey];
742
+ const size = sizes[metaKey];
743
+ const proxyConfig = entry.proxy ? proxyConfigs[entry.proxy] : void 0;
744
+ let loadingMethod = "cdn";
745
+ if (entry.src === false)
746
+ loadingMethod = "npm";
747
+ else if (!entry.src && typeof entry.scriptBundling === "function")
748
+ loadingMethod = "dynamic";
749
+ const privacy = proxyConfig?.privacy ?? null;
750
+ const routes = proxyConfig?.routes ?? {};
751
+ const domains = extractDomains(routes);
752
+ const endpoints = Object.keys(routes).length;
753
+ return {
754
+ id: metaKey,
755
+ label: entry.label || metaKey,
756
+ category: entry.category || "unknown",
757
+ scripts: size?.scripts ?? [],
758
+ totalTransferKb: size?.totalTransferKb ?? 0,
759
+ totalDecodedKb: size?.totalDecodedKb ?? 0,
760
+ trackedData: meta?.trackedData ?? [],
761
+ hasBundling: entry.scriptBundling !== false && entry.scriptBundling !== void 0,
762
+ hasProxy: !!entry.proxy,
763
+ domains,
764
+ endpoints,
765
+ privacy,
766
+ privacyLevel: computePrivacyLevel(privacy),
767
+ loadingMethod
768
+ };
769
+ });
770
+ }
771
+
772
+ export { getScriptStats };