astro-ghostcms/.pnpm-store/v3/files/00/807c0569898971ac0ad299a96c5...

20 lines
115 KiB
Plaintext
Raw Normal View History

2024-02-14 14:10:47 +00:00
"use strict";var hs=Object.defineProperty;var u=(c,l)=>hs(c,"name",{value:l,configurable:!0});var To=(c,l,d)=>{if(!l.has(c))throw TypeError("Cannot "+d)};var D=(c,l,d)=>(To(c,l,"read from private field"),d?d.call(c):l.get(c)),ye=(c,l,d)=>{if(l.has(c))throw TypeError("Cannot add the same private member more than once");l instanceof WeakSet?l.add(c):l.set(c,d)},ne=(c,l,d,b)=>(To(c,l,"write to private field"),b?b.call(c,d):l.set(c,d),d);var Ce,mt,ot,Zt,Ue,yt,gt,_t,oe,St,Me,xe,wt;Object.defineProperty(exports,"__esModule",{value:!0});const http=require("node:http"),https=require("node:https"),zlib=require("node:zlib"),Stream=require("node:stream"),require$$0=require("node:buffer"),require$$1=require("node:util"),_commonjsHelpers=require("./shared/node-fetch-native.61758d11.cjs"),require$$1$1=require("node:url"),require$$4=require("node:net"),node_fs=require("node:fs"),node_path=require("node:path");function _interopDefaultCompat(c){return c&&typeof c=="object"&&"default"in c?c.default:c}u(_interopDefaultCompat,"_interopDefaultCompat");const http__default=_interopDefaultCompat(http),https__default=_interopDefaultCompat(https),zlib__default=_interopDefaultCompat(zlib),Stream__default=_interopDefaultCompat(Stream);function dataUriToBuffer(c){if(!/^data:/i.test(c))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');c=c.replace(/\r?\n/g,"");const l=c.indexOf(",");if(l===-1||l<=4)throw new TypeError("malformed data: URI");const d=c.substring(5,l).split(";");let b="",g=!1;const S=d[0]||"text/plain";let T=S;for(let Q=1;Q<d.length;Q++)d[Q]==="base64"?g=!0:d[Q]&&(T+=`;${d[Q]}`,d[Q].indexOf("charset=")===0&&(b=d[Q].substring(8)));!d[0]&&!b.length&&(T+=";charset=US-ASCII",b="US-ASCII");const R=g?"base64":"ascii",F=unescape(c.substring(l+1)),B=Buffer.from(F,R);return B.type=S,B.typeFull=T,B.charset=b,B}u(dataUriToBuffer,"dataUriToBuffer");var ponyfill_es2018={exports:{}};/**
* @license
* web-streams-polyfill v3.3.2
* Copyright 2024 Mattias Buelens, Diwank Singh Tomer and other contributors.
* This code is released under the MIT license.
* SPDX-License-Identifier: MIT
*/var hasRequiredPonyfill_es2018;function requirePonyfill_es2018(){return hasRequiredPonyfill_es2018||(hasRequiredPonyfill_es2018=1,function(c,l){(function(d,b){b(l)})(_commonjsHelpers.commonjsGlobal,function(d){const b=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol:n=>`Symbol(${n})`;function g(){}u(g,"noop");function S(n){return typeof n=="object"&&n!==null||typeof n=="function"}u(S,"typeIsObject");const T=g;function R(n,o){try{Object.defineProperty(n,"name",{value:o,configurable:!0})}catch{}}u(R,"setFunctionName");const F=Promise,B=Promise.prototype.then,Q=Promise.reject.bind(F);function j(n){return new F(n)}u(j,"newPromise");function A(n){return j(o=>o(n))}u(A,"promiseResolvedWith");function C(n){return Q(n)}u(C,"promiseRejectedWith");function q(n,o,a){return B.call(n,o,a)}u(q,"PerformPromiseThen");function $(n,o,a){q(q(n,o,a),void 0,T)}u($,"uponPromise");function N(n,o){$(n,o)}u(N,"uponFulfillment");function J(n,o){$(n,void 0,o)}u(J,"uponRejection");function G(n,o,a){return q(n,o,a)}u(G,"transformPromiseWith");function Pe(n){q(n,void 0,T)}u(Pe,"setPromiseIsHandledToTrue");let M=u(n=>{if(typeof queueMicrotask=="function")M=queueMicrotask;else{const o=A(void 0);M=u(a=>q(o,a),"_queueMicrotask")}return M(n)},"_queueMicrotask");function H(n,o,a){if(typeof n!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(n,o,a)}u(H,"reflectCall");function U(n,o,a){try{return A(H(n,o,a))}catch(p){return C(p)}}u(U,"promiseCall");const it=16384,jr=class jr{constructor(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}get length(){return this._size}push(o){const a=this._back;let p=a;a._elements.length===it-1&&(p={_elements:[],_next:void 0}),a._elements.push(o),p!==a&&(this._back=p,a._next=p),++this._size}shift(){const o=this._front;let a=o;const p=this._cursor;let y=p+1;const _=o._elements,w=_[p];return y===it&&(a=o._next,y=0),--this._size,this._cursor=y,o!==a&&(this._front=a),_[p]=void 0,w}forEach(o){let a=this._cursor,p=this._front,y=p._elements;for(;(a!==y.length||p._next!==void 0)&&!(a===y.length&&(p=p._next,y=p._elements,a=0,y.length===0));)o(y[a]),++a}peek(){const o=this._front,a=this._cursor;return o._elements[a]}};u(jr,"SimpleQueue");let Y=jr;const nn=b("[[AbortSteps]]"),on=b("[[ErrorSteps]]"),er=b("[[CancelSteps]]"),tr=b("[[PullSteps]]"),rr=b("[[ReleaseSteps]]");function sn(n,o){n._ownerReadableStream=o,o._reader=n,o._state==="readable"?or(n):o._state==="closed"?Co(n):an(n,o._storedError)}u(sn,"ReadableStreamReaderGenericInitialize");function nr(n,o){const a=n._ownerReadableStream;return le(a,o)}u(nr,"ReadableStreamReaderGenericCancel");function ge(n){const o=n._ownerReadableStream;o._state==="readable"?ir(n,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):Po(n,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),o._readableStreamController[rr](),o._reader=void 0,n._ownerReadableStream=void 0}u(ge,"ReadableStreamReaderGenericRelease");function Rt(n){return new TypeError("Cannot "+n+" a stream using a released reader")}u(Rt,"readerLockException");function or(n){n._closedPromise=j((o,a)=>{n._closedPromise_resolve=o,n._closedPromise_reject=a})}u(or,"defaultReaderClosedPromiseInitialize");function an(n,o){or(n),ir(n,o)}u(an,"defaultReaderClosedPromiseInitializeAsRejected");function Co(n){or(n),un(n)}u(Co,"defaultReaderClosedPromiseInitializeAsResolved");function ir(n,o){n._closedPromise_reject!==void 0&&(Pe(n._closedPromise),n._closedPromise_reject(o),n._closedPromise_resolve=void 0,n._closedPromise_reject=void 0)}u(ir,"defaultReaderClosedPromiseReject");function Po(n,o){an(n,o)}u(Po,"defaultReaderClosedPromiseResetToRejected");function un(n){n._closedPromise_resolve!==void 0&&(n._closedPromise_resolve(void 0),n._closedPromise_resolve=void 0,n._closedPromise_reject=void 0)}u(un,"defaultReaderClosedPromiseResolve");const ln=Number.isFinite||function(n){return typeof n=="number"&&isFinite(n)},vo=Math.tru
`)).replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),"e$1"),x=u((c,l,d)=>{if(l.length<d)throw new TypeError(`Failed to execute '${c}' on 'FormData': ${d} arguments required, but only ${l.length} present.`)},"x");const FormData=(St=class{constructor(...l){ye(this,oe,[]);if(l.length)throw new TypeError("Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.")}get[t$1](){return"FormData"}[i](){return this.entries()}static[h](l){return l&&typeof l=="object"&&l[t$1]==="FormData"&&!m.some(d=>typeof l[d]!="function")}append(...l){x("append",arguments,2),D(this,oe).push(f(...l))}delete(l){x("delete",arguments,1),l+="",ne(this,oe,D(this,oe).filter(([d])=>d!==l))}get(l){x("get",arguments,1),l+="";for(var d=D(this,oe),b=d.length,g=0;g<b;g++)if(d[g][0]===l)return d[g][1];return null}getAll(l,d){return x("getAll",arguments,1),d=[],l+="",D(this,oe).forEach(b=>b[0]===l&&d.push(b[1])),d}has(l){return x("has",arguments,1),l+="",D(this,oe).some(d=>d[0]===l)}forEach(l,d){x("forEach",arguments,1);for(var[b,g]of this)l.call(d,g,b,this)}set(...l){x("set",arguments,2);var d=[],b=!0;l=f(...l),D(this,oe).forEach(g=>{g[0]===l[0]?b&&(b=!d.push(l)):d.push(g)}),b&&d.push(l),ne(this,oe,d)}*entries(){yield*D(this,oe)}*keys(){for(var[l]of this)yield l}*values(){for(var[,l]of this)yield l}},oe=new WeakMap,u(St,"FormData"),St);function formDataToBlob(c,l=r$1){var d=`${r()}${r()}`.replace(/\./g,"").slice(-28).padStart(32,"-"),b=[],g=`--${d}\r
Content-Disposition: form-data; name="`;return c.forEach((S,T)=>typeof S=="string"?b.push(g+e$1(T)+`"\r
\r
${S.replace(/\r(?!\n)|(?<!\r)\n/g,`\r
`)}\r
`):b.push(g+e$1(T)+`"; filename="${e$1(S.name,1)}"\r
Content-Type: ${S.type||"application/octet-stream"}\r
\r
`,S,`\r
`)),b.push(`--${d}--`),new l(b,{type:"multipart/form-data; boundary="+d})}u(formDataToBlob,"formDataToBlob");const Jr=class Jr extends Error{constructor(l,d){super(l),Error.captureStackTrace(this,this.constructor),this.type=d}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}};u(Jr,"FetchBaseError");let FetchBaseError=Jr;const Xr=class Xr extends FetchBaseError{constructor(l,d,b){super(l,d),b&&(this.code=this.errno=b.code,this.erroredSysCall=b.syscall)}};u(Xr,"FetchError");let FetchError=Xr;const NAME=Symbol.toStringTag,isURLSearchParameters=u(c=>typeof c=="object"&&typeof c.append=="function"&&typeof c.delete=="function"&&typeof c.get=="function"&&typeof c.getAll=="function"&&typeof c.has=="function"&&typeof c.set=="function"&&typeof c.sort=="function"&&c[NAME]==="URLSearchParams","isURLSearchParameters"),isBlob=u(c=>c&&typeof c=="object"&&typeof c.arrayBuffer=="function"&&typeof c.type=="string"&&typeof c.stream=="function"&&typeof c.constructor=="function"&&/^(Blob|File)$/.test(c[NAME]),"isBlob"),isAbortSignal=u(c=>typeof c=="object"&&(c[NAME]==="AbortSignal"||c[NAME]==="EventTarget"),"isAbortSignal"),isDomainOrSubdomain=u((c,l)=>{const d=new URL(l).hostname,b=new URL(c).hostname;return d===b||d.endsWith(`.${b}`)},"isDomainOrSubdomain"),isSameProtocol=u((c,l)=>{const d=new URL(l).protocol,b=new URL(c).protocol;return d===b},"isSameProtocol"),pipeline=require$$1.promisify(Stream__default.pipeline),INTERNALS$2=Symbol("Body internals"),en=class en{constructor(l,{size:d=0}={}){let b=null;l===null?l=null:isURLSearchParameters(l)?l=require$$0.Buffer.from(l.toString()):isBlob(l)||require$$0.Buffer.isBuffer(l)||(require$$1.types.isAnyArrayBuffer(l)?l=require$$0.Buffer.from(l):ArrayBuffer.isView(l)?l=require$$0.Buffer.from(l.buffer,l.byteOffset,l.byteLength):l instanceof Stream__default||(l instanceof FormData?(l=formDataToBlob(l),b=l.type.split("=")[1]):l=require$$0.Buffer.from(String(l))));let g=l;require$$0.Buffer.isBuffer(l)?g=Stream__default.Readable.from(l):isBlob(l)&&(g=Stream__default.Readable.from(l.stream())),this[INTERNALS$2]={body:l,stream:g,boundary:b,disturbed:!1,error:null},this.size=d,l instanceof Stream__default&&l.on("error",S=>{const T=S instanceof FetchBaseError?S:new FetchError(`Invalid response body while trying to fetch ${this.url}: ${S.message}`,"system",S);this[INTERNALS$2].error=T})}get body(){return this[INTERNALS$2].stream}get bodyUsed(){return this[INTERNALS$2].disturbed}async arrayBuffer(){const{buffer:l,byteOffset:d,byteLength:b}=await consumeBody(this);return l.slice(d,d+b)}async formData(){const l=this.headers.get("content-type");if(l.startsWith("application/x-www-form-urlencoded")){const b=new FormData,g=new URLSearchParams(await this.text());for(const[S,T]of g)b.append(S,T);return b}const{toFormData:d}=await import("./chunks/multipart-parser.cjs");return d(this.body,l)}async blob(){const l=this.headers&&this.headers.get("content-type")||this[INTERNALS$2].body&&this[INTERNALS$2].body.type||"",d=await this.arrayBuffer();return new r$1([d],{type:l})}async json(){const l=await this.text();return JSON.parse(l)}async text(){const l=await consumeBody(this);return new TextDecoder().decode(l)}buffer(){return consumeBody(this)}};u(en,"Body");let Body=en;Body.prototype.buffer=require$$1.deprecate(Body.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer"),Object.defineProperties(Body.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:require$$1.deprecate(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});async function consumeBody(c){if(c[INTERNALS$2].disturbed)throw new TypeError(`body used already for: ${c.url}`);if(c[INTERNALS$2].disturbed=!0,c[INTERNALS$2].error)throw c[INTERNALS$2].error;const{body:l}=c;if(l===null||!(l instanceof Stream__default))return require$$0.Buffer.alloc(0);const d=[];let b=0;
\r
`);let b=!1,g=!1,S;c.on("response",T=>{const{headers:R}=T;b=R["transfer-encoding"]==="chunked"&&!R["content-length"]}),c.on("socket",T=>{const R=u(()=>{if(b&&!g){const B=new Error("Premature close");B.code="ERR_STREAM_PREMATURE_CLOSE",l(B)}},"onSocketClose"),F=u(B=>{g=require$$0.Buffer.compare(B.slice(-5),d)===0,!g&&S&&(g=require$$0.Buffer.compare(S.slice(-3),d.slice(0,3))===0&&require$$0.Buffer.compare(B.slice(-2),d.slice(3))===0),S=B},"onData");T.prependListener("close",R),T.on("data",F),c.on("close",()=>{T.removeListener("close",R),T.removeListener("data",F)})})}u(fixResponseChunkedTransferBadEnding,"fixResponseChunkedTransferBadEnding");const privateData=new WeakMap,wrappers=new WeakMap;function pd(c){const l=privateData.get(c);return console.assert(l!=null,"'this' is expected an Event object, but got",c),l}u(pd,"pd");function setCancelFlag(c){if(c.passiveListener!=null){typeof console<"u"&&typeof console.error=="function"&&console.error("Unable to preventDefault inside passive event listener invocation.",c.passiveListener);return}c.event.cancelable&&(c.canceled=!0,typeof c.event.preventDefault=="function"&&c.event.preventDefault())}u(setCancelFlag,"setCancelFlag");function Event(c,l){privateData.set(this,{eventTarget:c,event:l,eventPhase:2,currentTarget:c,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:l.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});const d=Object.keys(l);for(let b=0;b<d.length;++b){const g=d[b];g in this||Object.defineProperty(this,g,defineRedirectDescriptor(g))}}u(Event,"Event"),Event.prototype={get type(){return pd(this).event.type},get target(){return pd(this).eventTarget},get currentTarget(){return pd(this).currentTarget},composedPath(){const c=pd(this).currentTarget;return c==null?[]:[c]},get NONE(){return 0},get CAPTURING_PHASE(){return 1},get AT_TARGET(){return 2},get BUBBLING_PHASE(){return 3},get eventPhase(){return pd(this).eventPhase},stopPropagation(){const c=pd(this);c.stopped=!0,typeof c.event.stopPropagation=="function"&&c.event.stopPropagation()},stopImmediatePropagation(){const c=pd(this);c.stopped=!0,c.immediateStopped=!0,typeof c.event.stopImmediatePropagation=="function"&&c.event.stopImmediatePropagation()},get bubbles(){return!!pd(this).event.bubbles},get cancelable(){return!!pd(this).event.cancelable},preventDefault(){setCancelFlag(pd(this))},get defaultPrevented(){return pd(this).canceled},get composed(){return!!pd(this).event.composed},get timeStamp(){return pd(this).timeStamp},get srcElement(){return pd(this).eventTarget},get cancelBubble(){return pd(this).stopped},set cancelBubble(c){if(!c)return;const l=pd(this);l.stopped=!0,typeof l.event.cancelBubble=="boolean"&&(l.event.cancelBubble=!0)},get returnValue(){return!pd(this).canceled},set returnValue(c){c||setCancelFlag(pd(this))},initEvent(){}},Object.defineProperty(Event.prototype,"constructor",{value:Event,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.Event<"u"&&(Object.setPrototypeOf(Event.prototype,window.Event.prototype),wrappers.set(window.Event.prototype,Event));function defineRedirectDescriptor(c){return{get(){return pd(this).event[c]},set(l){pd(this).event[c]=l},configurable:!0,enumerable:!0}}u(defineRedirectDescriptor,"defineRedirectDescriptor");function defineCallDescriptor(c){return{value(){const l=pd(this).event;return l[c].apply(l,arguments)},configurable:!0,enumerable:!0}}u(defineCallDescriptor,"defineCallDescriptor");function defineWrapper(c,l){const d=Object.keys(l);if(d.length===0)return c;function b(g,S){c.call(this,g,S)}u(b,"CustomEvent"),b.prototype=Object.create(c.prototype,{constructor:{value:b,configurable:!0,writable:!0}});for(let g=0;g<d.length;++g){const S=d[g];if(!(S in c.prototype)){const R=typeof Object.getOwnPropertyDescriptor(l,S).value=="function";Object.defineProperty(b.prototype,S,R?defineCallDescriptor(S):defineRedirectDescriptor(S))}}return b}u(defineWrapper,"defineWrapper");function getWrapper(c){if(c==null||c===Object.prototype)return Event;let l=wrappers.get(c);return l==null&&(l=defineWrapper(get