1import{p as F,o as N,_ as D,q as z}from"./app-Bf05AV0b.js";import"./index-DAEirE7a.js";import"./client-TiGLTElA.js";/* empty css */import"./x-D5RYmp0P.js";var k=function(e){return e===void 0?!1:typeof e=="boolean"?e:e.enabled!==!1},L=function(e){var t;return typeof e=="object"&&e!==null?{allowlist:(t=e.allowlist)!==null&&t!==void 0?t:[],excludelist:e.excludelist||e.blocklist||[]}:{allowlist:[],excludelist:[]}},M=function(e,t,r){if(t.length===0&&r.length===0)return e;var o=t.length>0?t:["/**"];try{var i=JSON.parse(e);return F(i,o,r),JSON.stringify(i)}catch{return e}},C=function(e,t,r,o){var i=L(t),a=i.allowlist,u=i.excludelist,n=M(e,a,u);return o(n,r)},T=10240,R=["image/","audio/","video/","application/octet-stream","font/"];function Y(e){return e?R.some(function(t){return e.toLowerCase().startsWith(t)}):!1}function I(e){if(e!=null){if(typeof e=="string")return e;if(e instanceof URLSearchParams)return e.toString();if(e instanceof FormData){var t=[];return e.forEach(function(r,o){t.push("".concat(o,"=").concat(typeof r=="string"?r:"[File]"))}),t.join("&")}}}function x(e,t){if(new Blob([e]).size<=t)return{value:e,truncated:!1};for(var r=0,o=Math.min(e.length,t);r<o;){var i=Math.ceil((r+o)/2);new Blob([e.slice(0,i)]).size<=t?r=i:o=i-1}return r>0&&e.charCodeAt(r-1)>=55296&&e.charCodeAt(r-1)<=56319&&(r-=1),{value:e.slice(0,r),truncated:!0}}var X=(function(){function e(){this.fetchObserver=null}return e.prototype.start=function(t,r){this.eventCallback=t,this.networkConfig=r,this.observeFetch()},e.prototype.stop=function(){var t;(t=this.fetchObserver)===null||t===void 0||t.call(this),this.fetchObserver=null,this.eventCallback=void 0,this.networkConfig=void 0},e.prototype.notifyEvent=function(t){var r;(r=this.eventCallback)===null||r===void 0||r.call(this,t)},e.prototype.observeFetch=function(){var t=this,r=N();if(r){var o=r.fetch;o&&(r.fetch=function(i,a){return D(t,void 0,void 0,function(){var u,n,s,h,B,l,f,v,_,E,p,f,y,g=this,m,b;return z(this,function(c){switch(c.label){case 0:u=Date.now(),n={timestamp:u,type:"fetch",method:a?.method||"GET",url:i.toString(),requestHeaders:a?.headers},s=(m=this.networkConfig)===null||m===void 0?void 0:m.body,s&&k(s.request)&&(h=I(a?.body),h!==void 0&&(B=(b=s.maxBodySizeBytes)!==null&&b!==void 0?b:T,n.requestBody=C(h,s.request,B,x).value)),c.label=1;case 1:return c.trys.push([1,3,,4]),[4,o(i,a)];case 2:return l=c.sent(),f=Date.now(),n.status=l.status,n.duration=f-u,v={},l.headers.forEach(function(w,d){v[d]=w}),n.responseHeaders=v,s&&k(s.response)?(_=v["content-type"]||null,Y(_)?(n.responseBodyStatus="skipped_binary",this.notifyEvent(n)):(E=l.clone(),E.text().then(function(w){var d,O=(d=s.maxBodySizeBytes)!==null&&d!==void 0?d:T,S=C(w,s.response,O,x),q=S.value,A=S.truncated;n.responseBody=q,n.responseBodyStatus=A?"truncated":"captured",g.notifyEvent(n)},function(){n.responseBodyStatus="error",g.notifyEvent(n)}))):this.notifyEvent(n),[2,l];case 3:throw p=c.sent(),f=Date.now(),n.duration=f-u,y=p,n.error={name:y.name||"UnknownError",message:y.message||"An unknown error occurred"},this.notifyEvent(n),p;case 4:return[2]}})})},this.fetchObserver=function(){r.fetch=o})}},e})();export{X as NetworkObservers};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.