@nuxt/scripts 1.0.0-rc.1 → 1.0.0-rc.11
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/bin/cli.mjs +2 -0
- package/dist/cli.d.mts +2 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.mjs +50 -0
- package/dist/devtools-client/200.html +1 -1
- package/dist/devtools-client/404.html +1 -1
- package/dist/devtools-client/_nuxt/{ajngqPCs.js → BgPDxVUn.js} +1 -1
- package/dist/devtools-client/_nuxt/{DKL6PHO3.js → BmlapxLP.js} +1 -1
- package/dist/devtools-client/_nuxt/CM2vefXI.js +188 -0
- package/dist/devtools-client/_nuxt/{CfOsp0mU.js → DAF5Qk9P.js} +1 -1
- package/dist/devtools-client/_nuxt/{B3kN3DAy.js → Dx6HhVmj.js} +1 -1
- package/dist/devtools-client/_nuxt/{dlaR8P-P.js → S8LiR9M1.js} +1 -1
- package/dist/devtools-client/_nuxt/builds/latest.json +1 -1
- package/dist/devtools-client/_nuxt/builds/meta/d788053e-f511-4867-b557-1952fcbcae82.json +1 -0
- package/dist/devtools-client/_nuxt/{entry.BwpOBArY.css → entry.BKkVrcJj.css} +1 -1
- package/dist/devtools-client/_nuxt/error-404.d44aGwWI.css +1 -0
- package/dist/devtools-client/_nuxt/error-500.NthMfIEt.css +1 -0
- package/dist/devtools-client/_nuxt/index.DZD1lwyI.css +1 -0
- package/dist/devtools-client/_nuxt/vBkR1GJq.js +1 -0
- package/dist/devtools-client/docs/index.html +1 -1
- package/dist/devtools-client/first-party/index.html +1 -1
- package/dist/devtools-client/index.html +1 -1
- package/dist/devtools-client/registry/index.html +1 -1
- package/dist/module.d.mts +66 -2
- package/dist/module.d.ts +66 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +151 -30
- package/dist/registry.d.mts +1 -0
- package/dist/registry.d.ts +1 -0
- package/dist/registry.mjs +14 -14
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.d.vue.ts +73 -97
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.vue +81 -58
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.vue.d.ts +73 -97
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsInfoWindow.d.vue.ts +2 -3
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsInfoWindow.vue +1 -0
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsInfoWindow.vue.d.ts +2 -3
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarker.d.vue.ts +2 -3
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarker.vue +2 -1
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarker.vue.d.ts +2 -3
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.d.vue.ts +10 -43
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.vue +3 -1
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.vue.d.ts +10 -43
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.d.vue.ts +50 -30
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.vue +145 -104
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.vue.d.ts +50 -30
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsStaticMap.vue +7 -2
- package/dist/runtime/components/GoogleMaps/types.d.ts +42 -0
- package/dist/runtime/components/GoogleMaps/types.js +1 -0
- package/dist/runtime/components/GoogleMaps/useGoogleMapsResource.d.ts +50 -0
- package/dist/runtime/components/GoogleMaps/useGoogleMapsResource.js +76 -1
- package/dist/runtime/components/ScriptBlueskyEmbed.d.vue.ts +10 -12
- package/dist/runtime/components/ScriptBlueskyEmbed.vue +13 -10
- package/dist/runtime/components/ScriptBlueskyEmbed.vue.d.ts +10 -12
- package/dist/runtime/components/ScriptCarbonAds.d.vue.ts +4 -7
- package/dist/runtime/components/ScriptCarbonAds.vue +1 -0
- package/dist/runtime/components/ScriptCarbonAds.vue.d.ts +4 -7
- package/dist/runtime/components/ScriptCrisp.d.vue.ts +7 -11
- package/dist/runtime/components/ScriptCrisp.vue +1 -0
- package/dist/runtime/components/ScriptCrisp.vue.d.ts +7 -11
- package/dist/runtime/components/ScriptGoogleAdsense.d.vue.ts +4 -7
- package/dist/runtime/components/ScriptGoogleAdsense.vue +1 -0
- package/dist/runtime/components/ScriptGoogleAdsense.vue.d.ts +4 -7
- package/dist/runtime/components/ScriptInstagramEmbed.d.vue.ts +11 -13
- package/dist/runtime/components/ScriptInstagramEmbed.vue +4 -1
- package/dist/runtime/components/ScriptInstagramEmbed.vue.d.ts +11 -13
- package/dist/runtime/components/ScriptIntercom.d.vue.ts +7 -11
- package/dist/runtime/components/ScriptIntercom.vue +1 -0
- package/dist/runtime/components/ScriptIntercom.vue.d.ts +7 -11
- package/dist/runtime/components/ScriptLemonSqueezy.d.vue.ts +2 -3
- package/dist/runtime/components/ScriptLemonSqueezy.vue +1 -0
- package/dist/runtime/components/ScriptLemonSqueezy.vue.d.ts +2 -3
- package/dist/runtime/components/ScriptPayPalButtons.d.vue.ts +8 -13
- package/dist/runtime/components/ScriptPayPalButtons.vue +1 -0
- package/dist/runtime/components/ScriptPayPalButtons.vue.d.ts +8 -13
- package/dist/runtime/components/ScriptPayPalMessages.d.vue.ts +8 -13
- package/dist/runtime/components/ScriptPayPalMessages.vue +1 -0
- package/dist/runtime/components/ScriptPayPalMessages.vue.d.ts +8 -13
- package/dist/runtime/components/ScriptStripePricingTable.d.vue.ts +5 -9
- package/dist/runtime/components/ScriptStripePricingTable.vue +1 -0
- package/dist/runtime/components/ScriptStripePricingTable.vue.d.ts +5 -9
- package/dist/runtime/components/ScriptVimeoPlayer.d.vue.ts +8 -11
- package/dist/runtime/components/ScriptVimeoPlayer.vue +1 -0
- package/dist/runtime/components/ScriptVimeoPlayer.vue.d.ts +8 -11
- package/dist/runtime/components/ScriptXEmbed.d.vue.ts +10 -12
- package/dist/runtime/components/ScriptXEmbed.vue +12 -9
- package/dist/runtime/components/ScriptXEmbed.vue.d.ts +10 -12
- package/dist/runtime/components/ScriptYouTubePlayer.d.vue.ts +8 -13
- package/dist/runtime/components/ScriptYouTubePlayer.vue +1 -0
- package/dist/runtime/components/ScriptYouTubePlayer.vue.d.ts +8 -13
- package/dist/runtime/composables/useScript.js +17 -6
- package/dist/runtime/composables/useScriptProxyToken.d.ts +12 -0
- package/dist/runtime/composables/useScriptProxyToken.js +4 -0
- package/dist/runtime/composables/useScriptProxyUrl.d.ts +12 -0
- package/dist/runtime/composables/useScriptProxyUrl.js +27 -0
- package/dist/runtime/plugins/proxy-token.server.d.ts +10 -0
- package/dist/runtime/plugins/proxy-token.server.js +17 -0
- package/dist/runtime/registry/bing-uet.d.ts +189 -11
- package/dist/runtime/registry/bing-uet.js +16 -2
- package/dist/runtime/registry/bluesky-embed.d.ts +0 -4
- package/dist/runtime/registry/bluesky-embed.js +0 -4
- package/dist/runtime/registry/clarity.d.ts +6 -2
- package/dist/runtime/registry/clarity.js +12 -1
- package/dist/runtime/registry/google-analytics.d.ts +6 -2
- package/dist/runtime/registry/google-analytics.js +12 -1
- package/dist/runtime/registry/google-tag-manager.d.ts +6 -2
- package/dist/runtime/registry/google-tag-manager.js +10 -1
- package/dist/runtime/registry/gravatar.js +10 -13
- package/dist/runtime/registry/matomo-analytics.d.ts +9 -3
- package/dist/runtime/registry/matomo-analytics.js +28 -1
- package/dist/runtime/registry/meta-pixel.d.ts +8 -2
- package/dist/runtime/registry/meta-pixel.js +10 -1
- package/dist/runtime/registry/mixpanel-analytics.d.ts +12 -2
- package/dist/runtime/registry/mixpanel-analytics.js +16 -4
- package/dist/runtime/registry/posthog.d.ts +8 -2
- package/dist/runtime/registry/posthog.js +15 -4
- package/dist/runtime/registry/schemas.d.ts +65 -0
- package/dist/runtime/registry/schemas.js +75 -8
- package/dist/runtime/registry/tiktok-pixel.d.ts +16 -2
- package/dist/runtime/registry/tiktok-pixel.js +22 -1
- package/dist/runtime/registry/x-embed.d.ts +0 -4
- package/dist/runtime/registry/x-embed.js +0 -4
- package/dist/runtime/server/bluesky-embed-image.d.ts +1 -1
- package/dist/runtime/server/bluesky-embed.d.ts +1 -15
- package/dist/runtime/server/bluesky-embed.js +25 -6
- package/dist/runtime/server/google-maps-geocode-proxy.js +12 -8
- package/dist/runtime/server/google-static-maps-proxy.d.ts +1 -1
- package/dist/runtime/server/google-static-maps-proxy.js +17 -11
- package/dist/runtime/server/gravatar-proxy.d.ts +1 -1
- package/dist/runtime/server/gravatar-proxy.js +10 -10
- package/dist/runtime/server/instagram-embed-asset.d.ts +1 -1
- package/dist/runtime/server/instagram-embed-image.d.ts +1 -1
- package/dist/runtime/server/instagram-embed.d.ts +1 -16
- package/dist/runtime/server/instagram-embed.js +26 -125
- package/dist/runtime/server/proxy-handler.js +1 -2
- package/dist/runtime/server/utils/cached-upstream.d.ts +55 -0
- package/dist/runtime/server/utils/cached-upstream.js +65 -0
- package/dist/runtime/server/utils/embed-rewriters.d.ts +19 -0
- package/dist/runtime/server/utils/embed-rewriters.js +41 -0
- package/dist/runtime/server/utils/image-proxy.d.ts +3 -1
- package/dist/runtime/server/utils/image-proxy.js +11 -8
- package/dist/runtime/server/utils/instagram-embed.d.ts +16 -0
- package/dist/runtime/server/utils/instagram-embed.js +153 -0
- package/dist/runtime/server/utils/proxy-url.d.ts +9 -0
- package/dist/runtime/server/utils/proxy-url.js +21 -0
- package/dist/runtime/server/utils/sign-constants.d.ts +16 -0
- package/dist/runtime/server/utils/sign-constants.js +5 -0
- package/dist/runtime/server/utils/sign.d.ts +101 -0
- package/dist/runtime/server/utils/sign.js +91 -0
- package/dist/runtime/server/utils/withSigning.d.ts +23 -0
- package/dist/runtime/server/utils/withSigning.js +19 -0
- package/dist/runtime/server/x-embed-image.d.ts +1 -1
- package/dist/runtime/server/x-embed.js +23 -4
- package/dist/runtime/types.d.ts +41 -6
- package/dist/runtime/types.js +1 -0
- package/dist/stats.mjs +298 -338
- package/dist/types-source.mjs +537 -164
- package/dist/types.d.mts +2 -2
- package/package.json +10 -6
- package/dist/devtools-client/_nuxt/C8jhSQ8l.js +0 -1
- package/dist/devtools-client/_nuxt/CJD6wrkT.js +0 -188
- package/dist/devtools-client/_nuxt/builds/meta/b800a0be-5cab-4ea6-89e3-dd3a85690a73.json +0 -1
- package/dist/devtools-client/_nuxt/error-404.CvOVjXeC.css +0 -1
- package/dist/devtools-client/_nuxt/error-500.BIm53nmx.css +0 -1
- package/dist/devtools-client/_nuxt/index.CA-OpSj0.css +0 -1
package/dist/types.d.mts
CHANGED
|
@@ -6,6 +6,6 @@ declare module '@nuxt/schema' {
|
|
|
6
6
|
|
|
7
7
|
export { type FirstPartyPrivacy } from '../dist/runtime/types.js'
|
|
8
8
|
|
|
9
|
-
export { type applyAutoInject, default, type isProxyDisabled } from './module.mjs'
|
|
9
|
+
export { type applyAutoInject, default, type isProxyDisabled, type resolveProxySecret } from './module.mjs'
|
|
10
10
|
|
|
11
|
-
export { type ModuleHooks, type ModuleOptions } from './module.mjs'
|
|
11
|
+
export { type ModuleHooks, type ModuleOptions, type ResolvedProxySecret } from './module.mjs'
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxt/scripts",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.0-rc.
|
|
4
|
+
"version": "1.0.0-rc.11",
|
|
5
5
|
"description": "Load third-party scripts with better performance, privacy and DX in Nuxt Apps.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Harlan Wilton",
|
|
@@ -45,7 +45,11 @@
|
|
|
45
45
|
]
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
|
+
"bin": {
|
|
49
|
+
"nuxt-scripts": "./bin/cli.mjs"
|
|
50
|
+
},
|
|
48
51
|
"files": [
|
|
52
|
+
"bin",
|
|
49
53
|
"dist"
|
|
50
54
|
],
|
|
51
55
|
"build": {
|
|
@@ -67,7 +71,7 @@
|
|
|
67
71
|
"peerDependencies": {
|
|
68
72
|
"@googlemaps/markerclusterer": "^2.6.2",
|
|
69
73
|
"@paypal/paypal-js": "^8.1.2 || ^9.0.0",
|
|
70
|
-
"@stripe/stripe-js": "^7.0.0 || ^8.0.0",
|
|
74
|
+
"@stripe/stripe-js": "^7.0.0 || ^8.0.0 || ^9.0.0",
|
|
71
75
|
"@types/google.maps": "^3.58.1",
|
|
72
76
|
"@types/vimeo__player": "^2.18.3",
|
|
73
77
|
"@types/youtube": "^0.1.0",
|
|
@@ -103,17 +107,17 @@
|
|
|
103
107
|
"@vueuse/core": "^14.2.1",
|
|
104
108
|
"@vueuse/shared": "^14.2.1",
|
|
105
109
|
"consola": "^3.4.2",
|
|
106
|
-
"defu": "^6.1.
|
|
107
|
-
"h3": "^1.15.
|
|
110
|
+
"defu": "^6.1.7",
|
|
111
|
+
"h3": "^1.15.11",
|
|
108
112
|
"magic-string": "^0.30.21",
|
|
109
113
|
"ofetch": "^1.5.1",
|
|
110
114
|
"ohash": "^2.0.11",
|
|
111
|
-
"oxc-parser": "^0.
|
|
115
|
+
"oxc-parser": "^0.125.0",
|
|
112
116
|
"oxc-walker": "^0.7.0",
|
|
113
117
|
"pathe": "^2.0.3",
|
|
114
118
|
"pkg-types": "^2.3.0",
|
|
115
119
|
"sirv": "^3.0.2",
|
|
116
|
-
"std-env": "^4.
|
|
120
|
+
"std-env": "^4.1.0",
|
|
117
121
|
"ufo": "^1.6.3",
|
|
118
122
|
"ultrahtml": "^1.6.0",
|
|
119
123
|
"unplugin": "^3.0.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{f as j,o as s,c as n,n as k,h as o,a as e,t as r,x as $,_ as F,b as y,j as D,d as v,m as x,y as A,z as K,F as _,l as G,w as C,r as S,g as z,A as M,B as Z,C as X,D as q,E as tt,G as W,H as P,I as et,J,K as R,L as st,M as Q,N as at,O as ot,P as I,Q as nt,i as lt,R as V,S as rt,T as it}from"./CJD6wrkT.js";const ct={class:"capitalize"},dt=j({__name:"ScriptStatus",props:{status:{},error:{}},setup(l){const p=$(()=>l.error?l.error==="TypeError: Failed to fetch"?"CORS Error":l.error:l.status||"unknown"),u=$(()=>{if(l.error||l.status==="error")return"status-error";switch(l.status){case"loaded":return"status-loaded";case"loading":return"status-loading";case"awaitingLoad":return"status-awaiting";case"validation-failed":return"status-validation";default:return"status-unknown"}});return(g,h)=>(s(),n("div",{class:k(["script-status",o(u)])},[h[0]||(h[0]=e("span",{class:"script-status-dot"},null,-1)),e("span",ct,r(o(p)),1)],2))}}),ut=Object.assign(F(dt,[["__scopeId","data-v-5cf865ba"]]),{__name:"ScriptStatus"}),mt={key:0,class:"script-metric"},pt=j({__name:"ScriptSize",props:{size:{}},setup(l){return(p,u)=>{const g=D;return l.size?(s(),n("span",mt,[y(g,{name:"i-carbon-meter",class:"text-[10px] opacity-50"}),v(" "+r(l.size),1)])):x("",!0)}}}),_t=Object.assign(F(pt,[["__scopeId","data-v-b147450b"]]),{__name:"ScriptSize"}),xt={key:0,class:"script-metric"},ft=j({__name:"ScriptLoadTime",props:{loadTime:{}},setup(l){return(p,u)=>{const g=D;return l.loadTime?(s(),n("span",xt,[y(g,{name:"i-carbon-timer",class:"text-[10px] opacity-50"}),v(" "+r(l.loadTime),1)])):x("",!0)}}}),yt=Object.assign(F(ft,[["__scopeId","data-v-c6837c50"]]),{__name:"ScriptLoadTime"}),vt={key:0,class:"panel-grids flex flex-col items-center justify-center py-8 gap-1.5 rounded-b-xl"},gt={key:1,class:"waterfall-container"},bt={class:"waterfall-stats"},ht={class:"waterfall-stat"},kt={class:"waterfall-stat-value"},wt={class:"waterfall-stat"},$t={class:"waterfall-stat-value"},St={class:"waterfall-stat"},Lt={class:"waterfall-stat-value"},Ct={class:"waterfall-proxied-badge"},Tt={class:"waterfall-stat-value"},jt={class:"text-xs space-y-1 max-w-60"},zt={class:"opacity-70"},Bt={class:"px-1 py-px rounded bg-white/10 text-[10px]"},Pt={key:0,class:"opacity-70"},Rt={class:"flex items-center gap-1"},Ft={class:"text-xs space-y-0.5"},Mt={class:"font-mono font-semibold"},It={class:"opacity-70"},Dt={key:0,class:"opacity-60"},Ot={key:1,class:"text-emerald-400"},Nt={class:"waterfall-table"},Ut={class:"waterfall-legend"},Ht={class:"waterfall-rows"},Et={class:"waterfall-url"},At={class:"waterfall-bar-track"},Kt={class:"waterfall-duration"},Wt={class:"text-xs space-y-1.5 max-w-80"},Vt={class:"font-mono text-[11px] break-all opacity-90"},Jt={class:"flex items-center gap-2 opacity-70"},Qt={class:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5"},Gt={class:"flex items-center gap-1 opacity-60"},Xt={class:"tabular-nums text-right"},Yt={key:0,class:"flex items-center gap-1 text-emerald-400"},Zt=j({__name:"NetworkWaterfall",props:{requests:{},domains:{default:()=>[]},proxyRoutes:{default:()=>[]},privacyLevel:{},proxyPrefix:{},isFirstParty:{type:Boolean,default:!1}},setup(l){const p=[{key:"dns",label:"DNS",color:"oklch(70% 0.15 165)"},{key:"connect",label:"Connect",color:"oklch(72% 0.14 75)"},{key:"ssl",label:"SSL",color:"oklch(65% 0.15 300)"},{key:"ttfb",label:"TTFB",color:"oklch(65% 0.13 250)"},{key:"download",label:"Download",color:"oklch(72% 0.12 200)"}],u=$(()=>[...l.requests].sort((i,t)=>i.startTime-t.startTime)),g=$(()=>{if(!u.value.length)return{min:0,max:1};const i=u.value[0].startTime,t=Math.max(...u.value.map(d=>d.startTime+d.duration));return{min:i,max:t||i+1}}),h=$(()=>l.requests.reduce((i,t)=>i+t.transferSize,0)),B=$(()=>g.value.max-g.value.min),b=$(()=>l.requests.filter(i=>i.isProxied).length),m=$(()=>{const i=new Map;for(const t of l.requests){const d=T(t.url),f=i.get(d)||{count:0,transfer:0,proxied:!1};f.count++,f.transfer+=t.transferSize,t.isProxied&&(f.proxied=!0),i.set(d,f)}return[...i.entries()].sort((t,d)=>d[1].transfer-t[1].transfer).map(([t,d])=>({domain:t,...d,isKnown:l.domains.includes(t),proxyRoute:l.proxyRoutes.find(f=>f.target.includes(t))}))}),w=/\/_scripts\/p\/([^/]+)/;function T(i){try{return new URL(i).hostname}catch{return i.match(w)?.[1]||"localhost"}}function O(i){const{min:t,max:d}=g.value,f=d-t;return{left:`${(i.startTime-t)/f*100}%`,width:`${Math.max(i.duration/f*100,.5)}%`}}function N(i,t){if(i.duration===0)return"0%";const d=i[t.key];return`${Math.max(d/i.duration*100,d>0?2:0)}%`}function U(i){try{const t=new URL(i),d=t.pathname+t.search;return d.length>50?`${d.slice(0,47)}...`:d}catch{return i.length>50?`${i.slice(0,47)}...`:i}}function H(i){return{script:"Script",xmlhttprequest:"XHR",fetch:"Fetch",img:"Image",css:"Stylesheet",beacon:"Beacon"}[i]||i}function E(i){return{script:"i-carbon-code",xmlhttprequest:"i-carbon-send-alt",fetch:"i-carbon-send-alt",img:"i-carbon-image",css:"i-carbon-paint-brush",beacon:"i-carbon-satellite-radar"}[i]||"i-carbon-document"}function a(i){return i.transferSize===0&&i.decodedBodySize>0?304:200}return(i,t)=>{const d=D,f=G;return l.requests.length?(s(),n("div",gt,[e("div",bt,[e("span",ht,[e("span",kt,r(l.requests.length),1),t[1]||(t[1]=e("span",{class:"waterfall-stat-label"},"req",-1))]),t[7]||(t[7]=e("span",{class:"waterfall-sep"},null,-1)),e("span",wt,[e("span",$t,r(o(A)(o(h))),1)]),t[8]||(t[8]=e("span",{class:"waterfall-sep"},null,-1)),e("span",St,[e("span",Lt,r(o(K)(Math.round(o(B)))),1)]),l.isFirstParty&&o(b)>0?(s(),n(_,{key:0},[t[5]||(t[5]=e("span",{class:"waterfall-sep"},null,-1)),y(f,null,{content:C(()=>[e("div",jt,[t[4]||(t[4]=e("div",{class:"font-semibold"}," First-Party Proxy ",-1)),e("div",zt,[v(r(o(b))+" request"+r(o(b)!==1?"s":"")+" routed through ",1),e("code",Bt,r(l.proxyPrefix||"/_scripts/p"),1)]),l.privacyLevel?(s(),n("div",Pt,[t[3]||(t[3]=v(" Privacy: ",-1)),e("span",{class:k(l.privacyLevel==="full"?"text-emerald-400":l.privacyLevel==="partial"?"text-amber-400":"")},r(l.privacyLevel),3)])):x("",!0)])]),default:C(()=>[e("span",Ct,[y(d,{name:"i-carbon-security",class:"text-[10px]"}),e("span",Tt,r(o(b))+"/"+r(l.requests.length),1),t[2]||(t[2]=v(" proxied ",-1))])]),_:1})],64)):x("",!0),o(m).length>1?(s(),n(_,{key:1},[t[6]||(t[6]=e("span",{class:"waterfall-sep"},null,-1)),e("div",Rt,[(s(!0),n(_,null,S(o(m),c=>(s(),z(f,{key:c.domain},{content:C(()=>[e("div",Ft,[e("div",Mt,r(c.domain),1),e("div",It,r(c.count)+" req · "+r(o(A)(c.transfer)),1),c.proxyRoute?(s(),n("div",Dt,r(c.proxyRoute.target)+" → "+r(c.proxyRoute.local),1)):x("",!0),c.proxied?(s(),n("div",Ot," Proxied through first-party ")):x("",!0)])]),default:C(()=>[e("span",{class:k(["domain-pill",c.proxied?"domain-pill-proxied":""])},[c.proxied?(s(),z(d,{key:0,name:"i-carbon-security",class:"text-[8px]"})):x("",!0),v(" "+r(c.domain),1)],2)]),_:2},1024))),128))])],64)):x("",!0)]),e("div",Nt,[e("div",Ut,[(s(),n(_,null,S(p,c=>e("div",{key:c.key,class:"waterfall-legend-item"},[e("span",{class:"waterfall-legend-dot",style:M({background:c.color})},null,4),v(" "+r(c.label),1)])),64))]),e("div",Ht,[(s(!0),n(_,null,S(o(u),(c,Y)=>(s(),z(f,{key:Y},{content:C(()=>[e("div",Wt,[e("div",Vt,r(c.url),1),e("div",Jt,[e("span",null,r(H(c.initiatorType)),1),t[10]||(t[10]=e("span",{class:"opacity-30"},"·",-1)),e("span",null,r(o(K)(Math.round(c.duration))),1),c.transferSize>0?(s(),n(_,{key:0},[t[9]||(t[9]=e("span",{class:"opacity-30"},"·",-1)),e("span",null,r(o(A)(c.transferSize)),1)],64)):x("",!0)]),e("div",Qt,[(s(),n(_,null,S(p,L=>(s(),n(_,{key:L.key},[c[L.key]>.1?(s(),n(_,{key:0},[e("div",Gt,[e("span",{class:"w-1.5 h-1.5 rounded-sm inline-block",style:M({background:L.color})},null,4),v(" "+r(L.label),1)]),e("div",Xt,r(c[L.key].toFixed(1))+"ms ",1)],64)):x("",!0)],64))),64))]),c.isProxied?(s(),n("div",Yt,[y(d,{name:"i-carbon-security",class:"text-[10px]"}),t[11]||(t[11]=v(" Proxied through first-party ",-1))])):x("",!0)])]),default:C(()=>[e("div",{class:k(["waterfall-row",c.isProxied?"waterfall-row-proxied":""])},[e("div",{class:k(["waterfall-status",a(c)===304?"waterfall-status-304":"waterfall-status-200"])},r(a(c)),3),y(d,{name:c.isProxied?"i-carbon-security":E(c.initiatorType),class:k(["waterfall-row-icon",c.isProxied?"waterfall-row-icon-proxied":""])},null,8,["name","class"]),e("div",Et,r(U(c.url)),1),e("div",At,[e("div",{class:"waterfall-bar",style:M(O(c))},[(s(),n(_,null,S(p,L=>e("div",{key:L.key,style:M({width:N(c,L),background:L.color}),class:"h-full"},null,4)),64))],4)]),e("div",Kt,r(o(K)(Math.round(c.duration))),1)],2)]),_:2},1024))),128))])])])):(s(),n("div",vt,[y(d,{name:"i-carbon-network-4",class:"text-xl text-(--color-text-subtle)"}),t[0]||(t[0]=e("p",{class:"text-xs text-(--color-text-subtle)"}," Requests appear as the script loads ",-1))]))}}}),qt=Object.assign(F(Zt,[["__scopeId","data-v-a64c8d9a"]]),{__name:"NetworkWaterfall"});function te(l=2e3){const{copy:p,copied:u}=Z({legacy:!0,copiedDuring:l});return{copy:p,copied:u}}const ee=j({__name:"DevtoolsCopyButton",props:{text:{}},setup(l){const{copy:p,copied:u}=te();return(g,h)=>{const B=X,b=G;return s(),z(b,{text:o(u)?"Copied!":"Copy"},{default:C(()=>[y(B,{icon:o(u)?"carbon:checkmark":"carbon:copy","aria-label":o(u)?"Copied":"Copy to clipboard",class:k(o(u)?"text-[var(--seo-green)]":""),onClick:h[0]||(h[0]=m=>o(p)(l.text))},null,8,["icon","aria-label","class"])]),_:1},8,["text"])}}}),se=Object.assign(ee,{__name:"DevtoolsCopyButton"}),ae=["innerHTML"],oe=j({__name:"OCodeBlock",props:{code:{},lang:{},lines:{type:Boolean,default:!1},transformRendered:{type:Function}},setup(l){const p=q(()=>l.code,l.lang),u=$(()=>l.transformRendered?l.transformRendered(p.value||""):p.value);return(g,h)=>(s(),n("pre",{class:k(["code-block p-5",l.lines?"code-block-lines":""]),innerHTML:o(u)},null,10,ae))}}),ne=Object.assign(oe,{__name:"OCodeBlock"}),le={class:"devtools-snippet"},re={key:0,class:"devtools-snippet-header"},ie={class:"devtools-snippet-label"},ce=j({__name:"DevtoolsSnippet",props:{label:{},code:{},lang:{default:"js"}},setup(l){return(p,u)=>{const g=se,h=ne;return s(),n("div",le,[l.label||p.$slots.header?(s(),n("div",re,[tt(p.$slots,"header",{},()=>[e("code",ie,r(l.label),1)],!0),y(g,{text:l.code},null,8,["text"])])):x("",!0),y(h,{code:l.code,lang:l.lang,class:"devtools-snippet-block"},null,8,["code","lang"])])}}}),de=Object.assign(F(ce,[["__scopeId","data-v-265ccc31"]]),{__name:"DevtoolsSnippet"}),ue={class:"py-1"},me={key:0,class:"panel-grids rounded-xl flex flex-col items-center justify-center py-16 gap-3"},pe={class:"w-12 h-12 rounded-xl bg-(--color-surface-elevated) border border-(--color-border) flex items-center justify-center"},_e={class:"filter-bar"},xe=["onClick"],fe={class:"filter-chip-count"},ye={class:"stagger-children space-y-3"},ve={class:"px-4 py-3 flex items-center justify-between gap-3"},ge={class:"flex items-center gap-2.5 min-w-0"},be={class:"w-7 h-7 rounded-lg bg-(--color-surface-sunken) border border-(--color-border-subtle) flex items-center justify-center flex-shrink-0 overflow-hidden"},he=["src"],ke=["innerHTML"],we=["src"],$e={class:"min-w-0"},Se={class:"flex items-center gap-2"},Le=["href","title"],Ce=["href"],Te={class:"px-4 pb-3 flex items-center gap-2 flex-wrap"},je={key:0,class:"status-enabled"},ze={key:1,class:"inline-flex items-center gap-1 text-[11px] text-(--color-text-subtle) font-mono"},Be={class:"border-t border-(--color-border-subtle)"},Pe={class:"flex items-center border-b border-(--color-border-subtle)"},Re=["onClick"],Fe={key:0,class:"text-[9px] px-1 py-px rounded-full bg-(--color-surface-sunken) tabular-nums font-mono"},Me={key:0,class:"p-3"},Ie={key:0,class:"text-xs text-(--color-text-subtle) py-2 text-center"},De={key:1,class:"event-timeline"},Oe={class:"event-time"},Ne={key:0,class:"flex items-center gap-2 min-w-0"},Ue={class:"text-[11px] text-(--color-text-subtle) truncate"},He={key:1,class:"event-fn"},Ee={key:1},Ae={key:2,class:"p-3"},Ke=j({__name:"index",setup(l){const p=[{label:"Events",value:"events",icon:"i-carbon-list"},{label:"Network",value:"network",icon:"i-carbon-network-4"},{label:"API",value:"api",icon:"i-carbon-code"}],u=it("all"),g=$(()=>{const b=Object.values(W.value||{}),m=b.filter(T=>R(T)!=="awaitingLoad").length,w=b.filter(T=>R(T)==="awaitingLoad").length;return{total:b.length,active:m,awaiting:w}}),h=$(()=>{const b=W.value||{};return u.value==="all"?b:Object.fromEntries(Object.entries(b).filter(([,m])=>{const w=R(m);return u.value==="active"?w!=="awaitingLoad":w==="awaitingLoad"}))});function B(b){switch(b){case"loaded":return"status-badge-loaded";case"loading":return"status-badge-loading";case"awaitingLoad":return"status-badge-awaiting";case"removed":case"error":return"status-badge-error";case"validation-failed":return"status-badge-validation";default:return"status-badge-default"}}return(b,m)=>{const w=D,T=X,O=ut,N=_t,U=yt,H=qt,E=de;return s(),n("div",ue,[Object.keys(o(W)||{}).length?(s(),n(_,{key:1},[e("div",_e,[(s(!0),n(_,null,S([{key:"all",label:"All",count:o(g).total},{key:"active",label:"Active",count:o(g).active},{key:"awaiting",label:"Awaiting",count:o(g).awaiting}],a=>(s(),n("button",{key:a.key,class:k(["filter-chip",o(u)===a.key?"filter-chip-active":""]),onClick:i=>u.value=a.key},[v(r(a.label)+" ",1),e("span",fe,r(a.count),1)],10,xe))),128))]),e("div",ye,[(s(!0),n(_,null,S(o(h),(a,i)=>(s(),n("div",{key:i,class:"card overflow-hidden"},[e("div",ve,[e("div",ge,[e("div",be,[o(P)(a)&&typeof o(P)(a)=="string"&&o(P)(a).startsWith("http")?(s(),n("img",{key:0,class:"w-5 h-5 object-contain",src:o(P)(a),alt:""},null,8,he)):o(P)(a)?(s(),n("div",{key:1,class:"w-5 h-5 flex items-center [&>svg]:max-w-5 [&>svg]:max-h-5",innerHTML:o(P)(a)},null,8,ke)):a.src&&!a.src.startsWith("/")?(s(),n("img",{key:2,src:`https://www.google.com/s2/favicons?domain=${o(et)(a.src)}`,class:"w-4 h-4 rounded-sm",alt:""},null,8,we)):(s(),z(w,{key:3,name:"i-carbon-script",class:"text-sm text-(--color-text-subtle)"}))]),e("div",$e,[e("div",Se,[e("a",{href:a.src,target:"_blank",class:"text-sm font-semibold tracking-tight truncate link-external",title:a.src},r(a.registry?.label||a.key||a.src),9,Le),a.docs?(s(),n("a",{key:0,href:a.docs,target:"_blank",class:"text-[10px] font-medium text-(--color-text-subtle) hover:text-(--color-text-muted) transition-colors"}," docs ",8,Ce)):x("",!0)])])]),o(J)(a)&&o(R)(a)==="awaitingLoad"?(s(),z(T,{key:0,size:"xs",color:"primary",variant:"soft",icon:"i-carbon-play-filled-alt",onClick:t=>a.$script.load()},{default:C(()=>[...m[2]||(m[2]=[v(" Load ",-1)])]),_:1},8,["onClick"])):o(J)(a)&&o(R)(a)==="loaded"?(s(),z(T,{key:1,size:"xs",color:"neutral",variant:"ghost",icon:"i-carbon-close",onClick:t=>a.$script.remove()},{default:C(()=>[...m[3]||(m[3]=[v(" Remove ",-1)])]),_:1},8,["onClick"])):x("",!0)]),e("div",Te,[y(O,{status:o(R)(a),error:o(st)[a.src]},null,8,["status","error"]),o(Q)(a.registryKey)?(s(),n("span",je,[y(w,{name:"i-carbon-security",class:"text-xs"}),m[4]||(m[4]=v(" First-Party ",-1))])):x("",!0),y(N,{size:o(at)[a.src]},null,8,["size"]),y(U,{"load-time":a.loadTime},null,8,["load-time"]),a.loadedFrom&&a.loadedFrom!=="unknown"?(s(),n("span",ze,[m[5]||(m[5]=e("svg",{xmlns:"http://www.w3.org/2000/svg",height:"10",viewBox:"0 0 256 221",class:"opacity-60"},[e("path",{fill:"#41B883",d:"M204.8 0H256L128 220.8L0 0h97.92L128 51.2L157.44 0z"}),e("path",{fill:"#41B883",d:"m0 0l128 220.8L256 0h-51.2L128 132.48L50.56 0z"}),e("path",{fill:"#35495E",d:"M50.56 0L128 133.12L204.8 0h-47.36L128 51.2L97.92 0z"})],-1)),v(" "+r(a.loadedFrom),1)])):x("",!0),(s(!0),n(_,null,S(Object.keys(a.registryMeta||{}),t=>(s(),n("span",{key:t,class:"text-[11px] text-(--color-text-subtle) font-mono"},r(t)+": "+r(a.registryMeta[t]),1))),128))]),e("div",Be,[e("div",Pe,[(s(),n(_,null,S(p,t=>e("button",{key:t.value,class:k(["sub-tab",o(I)(a.src)===t.value?"sub-tab-active":""]),onClick:d=>o(ot)(a.src,t.value)},[y(w,{name:t.icon,class:"text-xs"},null,8,["name"]),v(" "+r(t.label)+" ",1),t.value==="network"&&a.networkRequests?.length?(s(),n("span",Fe,r(a.networkRequests.length),1)):x("",!0)],10,Re)),64))]),o(I)(a.src)==="events"?(s(),n("div",Me,[a.events?.length?(s(),n("div",De,[(s(!0),n(_,null,S(a.events,(t,d)=>(s(),n("div",{key:d,class:"event-row"},[e("div",Oe,r(o(nt)(t.at)),1),t.type==="status"?(s(),n(_,{key:0},[t.status==="validation-failed"?(s(),n("div",Ne,[e("span",{class:k(["event-badge",B(t.status)])},r(t.status),3),e("span",Ue,r(t.args.issues.map(f=>`${f.path?.map(c=>c.key).join(".")}: ${f.message}`).join(", ")),1)])):(s(),n("span",{key:1,class:k(["event-badge",B(t.status)])},r(t.status),3))],64)):t.type==="fn-call"?(s(),n("span",He,[t.args?(s(),n(_,{key:0},[v(r(`${t.fn}(${t.args?.map(f=>JSON.stringify(f,null,2)).join(", ")||""})`),1)],64)):(s(),n(_,{key:1},[m[6]||(m[6]=e("span",{class:"opacity-40"},"QUEUED",-1)),v(" "+r(t.fn),1)],64))])):x("",!0)]))),128))])):(s(),n("div",Ie," No events recorded "))])):o(I)(a.src)==="network"?(s(),n("div",Ee,[y(H,{requests:a.networkRequests||[],domains:o(V)(a.registryKey)?.domains,"proxy-routes":o(V)(a.registryKey)?.routes,"privacy-level":o(V)(a.registryKey)?.privacyLevel,"proxy-prefix":o(lt)?.proxyPrefix,"is-first-party":o(Q)(a.registryKey)},null,8,["requests","domains","proxy-routes","privacy-level","proxy-prefix","is-first-party"])])):o(I)(a.src)==="api"?(s(),n("div",Ae,[y(E,{code:o(rt)(a.$script?.instance),lang:"js"},null,8,["code"])])):x("",!0)])]))),128))])],64)):(s(),n("div",me,[e("div",pe,[y(w,{name:"i-carbon-script",class:"text-2xl text-(--color-text-subtle)"})]),m[0]||(m[0]=e("p",{class:"text-sm font-medium text-(--color-text-muted)"}," No scripts loaded ",-1)),m[1]||(m[1]=e("p",{class:"text-xs text-(--color-text-subtle)"}," Scripts will appear here as they are registered ",-1))]))])}}}),Ve=F(Ke,[["__scopeId","data-v-1d33b8c9"]]);export{Ve as default};
|