UNPKG

@shopify/cli

Version:

A CLI tool to build for the Shopify platform

39 lines (35 loc) • 21.6 kB
import{c as Ae}from"./chunk-ZR76GGZ6.js";import"./chunk-PIBY5DDZ.js";import{a as w,c as g,g as l}from"./chunk-VPRTJUIN.js";var re=g((ft,D)=>{"use strict";l();var qe=Object.prototype.hasOwnProperty,_="~";function C(){}Object.create&&(C.prototype=Object.create(null),new C().__proto__||(_=!1));function Be(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function te(e,t,r,s,o){if(typeof r!="function")throw new TypeError("The listener must be a function");var n=new Be(r,s||e,o),i=_?_+t:t;return e._events[i]?e._events[i].fn?e._events[i]=[e._events[i],n]:e._events[i].push(n):(e._events[i]=n,e._eventsCount++),e}function j(e,t){--e._eventsCount===0?e._events=new C:delete e._events[t]}function v(){this._events=new C,this._eventsCount=0}v.prototype.eventNames=function(){var t=[],r,s;if(this._eventsCount===0)return t;for(s in r=this._events)qe.call(r,s)&&t.push(_?s.slice(1):s);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(r)):t};v.prototype.listeners=function(t){var r=_?_+t:t,s=this._events[r];if(!s)return[];if(s.fn)return[s.fn];for(var o=0,n=s.length,i=new Array(n);o<n;o++)i[o]=s[o].fn;return i};v.prototype.listenerCount=function(t){var r=_?_+t:t,s=this._events[r];return s?s.fn?1:s.length:0};v.prototype.emit=function(t,r,s,o,n,i){var c=_?_+t:t;if(!this._events[c])return!1;var a=this._events[c],h=arguments.length,u,f;if(a.fn){switch(a.once&&this.removeListener(t,a.fn,void 0,!0),h){case 1:return a.fn.call(a.context),!0;case 2:return a.fn.call(a.context,r),!0;case 3:return a.fn.call(a.context,r,s),!0;case 4:return a.fn.call(a.context,r,s,o),!0;case 5:return a.fn.call(a.context,r,s,o,n),!0;case 6:return a.fn.call(a.context,r,s,o,n,i),!0}for(f=1,u=new Array(h-1);f<h;f++)u[f-1]=arguments[f];a.fn.apply(a.context,u)}else{var d=a.length,p;for(f=0;f<d;f++)switch(a[f].once&&this.removeListener(t,a[f].fn,void 0,!0),h){case 1:a[f].fn.call(a[f].context);break;case 2:a[f].fn.call(a[f].context,r);break;case 3:a[f].fn.call(a[f].context,r,s);break;case 4:a[f].fn.call(a[f].context,r,s,o);break;default:if(!u)for(p=1,u=new Array(h-1);p<h;p++)u[p-1]=arguments[p];a[f].fn.apply(a[f].context,u)}}return!0};v.prototype.on=function(t,r,s){return te(this,t,r,s,!1)};v.prototype.once=function(t,r,s){return te(this,t,r,s,!0)};v.prototype.removeListener=function(t,r,s,o){var n=_?_+t:t;if(!this._events[n])return this;if(!r)return j(this,n),this;var i=this._events[n];if(i.fn)i.fn===r&&(!o||i.once)&&(!s||i.context===s)&&j(this,n);else{for(var c=0,a=[],h=i.length;c<h;c++)(i[c].fn!==r||o&&!i[c].once||s&&i[c].context!==s)&&a.push(i[c]);a.length?this._events[n]=a.length===1?a[0]:a:j(this,n)}return this};v.prototype.removeAllListeners=function(t){var r;return t?(r=_?_+t:t,this._events[r]&&j(this,r)):(this._events=new C,this._eventsCount=0),this};v.prototype.off=v.prototype.removeListener;v.prototype.addListener=v.prototype.on;v.prefixed=_;v.EventEmitter=v;typeof D<"u"&&(D.exports=v)});var ne=g((ct,se)=>{"use strict";l();se.exports=function(t,r){if(r=r.split(":")[0],t=+t,!t)return!1;switch(r){case"http":case"ws":return t!==80;case"https":case"wss":return t!==443;case"ftp":return t!==21;case"gopher":return t!==70;case"file":return!1}return t!==0}});var N=g(oe=>{l();var E=oe,Ue=w("url"),ie=Object.assign,je=ne(),Ne=/(^|,)\s*upgrade\s*($|,)/i,k=/^https|wss/;E.isSSL=k;E.setupOutgoing=function(e,t,r,s){e.port=t[s||"target"].port||(k.test(t[s||"target"].protocol)?443:80),["host","hostname","socketPath","pfx","key","passphrase","cert","ca","ciphers","secureProtocol"].forEach(function(c){e[c]=t[s||"target"][c]}),e.method=t.method||r.method,e.headers=ie({},r.headers),t.headers&&ie(e.headers,t.headers),t.auth&&(e.auth=t.auth),t.ca&&(e.ca=t.ca),k.test(t[s||"target"].protocol)&&(e.rejectUnauthorized=typeof t.secure>"u"?!0:t.secure),e.agent=t.agent||!1,e.localAddress=t.localAddress,e.agent||(e.headers=e.headers||{},(typeof e.headers.connection!="string"||!Ne.test(e.headers.connection))&&(e.headers.connection="close"));var o=t[s||"target"],n=o&&t.prependPath!==!1&&o.path||"",i=t.toProxy?r.url:Ue.parse(r.url).path||"";return i=t.ignorePath?"":i,e.path=E.urlJoin(n,i),t.changeOrigin&&(e.headers.host=je(e.port,t[s||"target"].protocol)&&!Me(e.host)?e.host+":"+e.port:e.host),e};E.setupSocket=function(e){return e.setTimeout(0),e.setNoDelay(!0),e.setKeepAlive(!0,0),e};E.getPort=function(e){var t=e.headers.host?e.headers.host.match(/:(\d+)/):"";return t?t[1]:E.hasEncryptedConnection(e)?"443":"80"};E.hasEncryptedConnection=function(e){return!!(e.connection.encrypted||e.connection.pair)};E.urlJoin=function(){var e=Array.prototype.slice.call(arguments),t=[],r="",s;return e.forEach((o,n)=>{var i=o.indexOf("?");i!==-1&&(t.push(o.substring(i+1)),e[n]=o.substring(0,i))}),r=t.filter(Boolean).join("&"),s=e.filter(Boolean).join("/").replace(/\/+/g,"/").replace("http:/","http://").replace("https:/","https://"),r?s+"?"+r:s};E.rewriteCookieProperty=function e(t,r,s){return Array.isArray(t)?t.map(function(o){return e(o,r,s)}):t.replace(new RegExp("(;\\s*"+s+"=)([^;]+)","i"),function(o,n,i){var c;if(i in r)c=r[i];else if("*"in r)c=r["*"];else return o;return c?n+c:""})};function Me(e){return!!~e.indexOf(":")}});var he=g((vt,fe)=>{l();var ae=w("url"),ue=N(),De=/^201|30(1|2|7|8)$/;fe.exports={removeChunked:function(t,r,s){t.httpVersion==="1.0"&&delete s.headers["transfer-encoding"]},setConnection:function(t,r,s){t.httpVersion==="1.0"?s.headers.connection=t.headers.connection||"close":t.httpVersion!=="2.0"&&!s.headers.connection&&(s.headers.connection=t.headers.connection||"keep-alive")},setRedirectHostRewrite:function(t,r,s,o){if((o.hostRewrite||o.autoRewrite||o.protocolRewrite)&&s.headers.location&&De.test(s.statusCode)){var n=ae.parse(o.target),i=ae.parse(s.headers.location);if(n.host!=i.host)return;o.hostRewrite?i.host=o.hostRewrite:o.autoRewrite&&(i.host=t.headers.host),o.protocolRewrite&&(i.protocol=o.protocolRewrite),s.headers.location=i.format()}},writeHeaders:function(t,r,s,o){var n=o.cookieDomainRewrite,i=o.cookiePathRewrite,c=o.preserveHeaderKeyCase,a,h=function(d,p){p!=null&&(n&&d.toLowerCase()==="set-cookie"&&(p=ue.rewriteCookieProperty(p,n,"domain")),i&&d.toLowerCase()==="set-cookie"&&(p=ue.rewriteCookieProperty(p,i,"path")),r.setHeader(String(d).trim(),p))};if(typeof n=="string"&&(n={"*":n}),typeof i=="string"&&(i={"*":i}),c&&s.rawHeaders!=null){a={};for(var u=0;u<s.rawHeaders.length;u+=2){var f=s.rawHeaders[u];a[f.toLowerCase()]=f}}Object.keys(s.headers).forEach(function(d){var p=s.headers[d];c&&a&&(d=a[d]||d),h(d,p)})},writeStatusCode:function(t,r,s){s.statusMessage?(r.statusCode=s.statusCode,r.statusMessage=s.statusMessage):r.statusCode=s.statusCode}}});var de=g((wt,ce)=>{l();var T;ce.exports=function(){if(!T){try{T=Ae()("follow-redirects")}catch{}typeof T!="function"&&(T=function(){})}T.apply(null,arguments)}});var we=g((yt,Q)=>{l();var S=w("url"),H=S.URL,ke=w("http"),Ie=w("https"),$=w("stream").Writable,X=w("assert"),le=de();(function(){var t=typeof process<"u",r=typeof window<"u"&&typeof document<"u",s=x(Error.captureStackTrace);!t&&(r||!s)&&console.warn("The follow-redirects package should be excluded from browser builds.")})();var z=!1;try{X(new H(""))}catch(e){z=e.code==="ERR_INVALID_URL"}var Fe=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],K=["abort","aborted","connect","error","socket","timeout"],G=Object.create(null);K.forEach(function(e){G[e]=function(t,r,s){this._redirectable.emit(e,t,r,s)}});var F=A("ERR_INVALID_URL","Invalid URL",TypeError),V=A("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),Ve=A("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",V),We=A("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),$e=A("ERR_STREAM_WRITE_AFTER_END","write after end"),Xe=$.prototype.destroy||ve;function y(e,t){$.call(this),this._sanitizeOptions(e),this._options=e,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],t&&this.on("response",t);var r=this;this._onNativeResponse=function(s){try{r._processResponse(s)}catch(o){r.emit("error",o instanceof V?o:new V({cause:o}))}},this._performRequest()}y.prototype=Object.create($.prototype);y.prototype.abort=function(){Y(this._currentRequest),this._currentRequest.abort(),this.emit("abort")};y.prototype.destroy=function(e){return Y(this._currentRequest,e),Xe.call(this,e),this};y.prototype.write=function(e,t,r){if(this._ending)throw new $e;if(!P(e)&&!Ge(e))throw new TypeError("data should be a string, Buffer or Uint8Array");if(x(t)&&(r=t,t=null),e.length===0){r&&r();return}this._requestBodyLength+e.length<=this._options.maxBodyLength?(this._requestBodyLength+=e.length,this._requestBodyBuffers.push({data:e,encoding:t}),this._currentRequest.write(e,t,r)):(this.emit("error",new We),this.abort())};y.prototype.end=function(e,t,r){if(x(e)?(r=e,e=t=null):x(t)&&(r=t,t=null),!e)this._ended=this._ending=!0,this._currentRequest.end(null,null,r);else{var s=this,o=this._currentRequest;this.write(e,t,function(){s._ended=!0,o.end(null,null,r)}),this._ending=!0}};y.prototype.setHeader=function(e,t){this._options.headers[e]=t,this._currentRequest.setHeader(e,t)};y.prototype.removeHeader=function(e){delete this._options.headers[e],this._currentRequest.removeHeader(e)};y.prototype.setTimeout=function(e,t){var r=this;function s(i){i.setTimeout(e),i.removeListener("timeout",i.destroy),i.addListener("timeout",i.destroy)}function o(i){r._timeout&&clearTimeout(r._timeout),r._timeout=setTimeout(function(){r.emit("timeout"),n()},e),s(i)}function n(){r._timeout&&(clearTimeout(r._timeout),r._timeout=null),r.removeListener("abort",n),r.removeListener("error",n),r.removeListener("response",n),r.removeListener("close",n),t&&r.removeListener("timeout",t),r.socket||r._currentRequest.removeListener("socket",o)}return t&&this.on("timeout",t),this.socket?o(this.socket):this._currentRequest.once("socket",o),this.on("socket",s),this.on("abort",n),this.on("error",n),this.on("response",n),this.on("close",n),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(e){y.prototype[e]=function(t,r){return this._currentRequest[e](t,r)}});["aborted","connection","socket"].forEach(function(e){Object.defineProperty(y.prototype,e,{get:function(){return this._currentRequest[e]}})});y.prototype._sanitizeOptions=function(e){if(e.headers||(e.headers={}),e.host&&(e.hostname||(e.hostname=e.host),delete e.host),!e.pathname&&e.path){var t=e.path.indexOf("?");t<0?e.pathname=e.path:(e.pathname=e.path.substring(0,t),e.search=e.path.substring(t))}};y.prototype._performRequest=function(){var e=this._options.protocol,t=this._options.nativeProtocols[e];if(!t)throw new TypeError("Unsupported protocol "+e);if(this._options.agents){var r=e.slice(0,-1);this._options.agent=this._options.agents[r]}var s=this._currentRequest=t.request(this._options,this._onNativeResponse);s._redirectable=this;for(var o of K)s.on(o,G[o]);if(this._currentUrl=/^\//.test(this._options.path)?S.format(this._options):this._options.path,this._isRedirect){var n=0,i=this,c=this._requestBodyBuffers;(function a(h){if(s===i._currentRequest)if(h)i.emit("error",h);else if(n<c.length){var u=c[n++];s.finished||s.write(u.data,u.encoding,a)}else i._ended&&s.end()})()}};y.prototype._processResponse=function(e){var t=e.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:t});var r=e.headers.location;if(!r||this._options.followRedirects===!1||t<300||t>=400){e.responseUrl=this._currentUrl,e.redirects=this._redirects,this.emit("response",e),this._requestBodyBuffers=[];return}if(Y(this._currentRequest),e.destroy(),++this._redirectCount>this._options.maxRedirects)throw new Ve;var s,o=this._options.beforeRedirect;o&&(s=Object.assign({Host:e.req.getHeader("host")},this._options.headers));var n=this._options.method;((t===301||t===302)&&this._options.method==="POST"||t===303&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],I(/^content-/i,this._options.headers));var i=I(/^host$/i,this._options.headers),c=J(this._currentUrl),a=i||c.host,h=/^\w+:/.test(r)?this._currentUrl:S.format(Object.assign(c,{host:a})),u=ze(r,h);if(le("redirecting to",u.href),this._isRedirect=!0,W(u,this._options),(u.protocol!==c.protocol&&u.protocol!=="https:"||u.host!==a&&!Ke(u.host,a))&&I(/^(?:(?:proxy-)?authorization|cookie)$/i,this._options.headers),x(o)){var f={headers:e.headers,statusCode:t},d={url:h,method:n,headers:s};o(this._options,f,d),this._sanitizeOptions(this._options)}this._performRequest()};function pe(e){var t={maxRedirects:21,maxBodyLength:10485760},r={};return Object.keys(e).forEach(function(s){var o=s+":",n=r[o]=e[s],i=t[s]=Object.create(n);function c(h,u,f){return Je(h)?h=W(h):P(h)?h=W(J(h)):(f=u,u=me(h),h={protocol:o}),x(u)&&(f=u,u=null),u=Object.assign({maxRedirects:t.maxRedirects,maxBodyLength:t.maxBodyLength},h,u),u.nativeProtocols=r,!P(u.host)&&!P(u.hostname)&&(u.hostname="::1"),X.equal(u.protocol,o,"protocol mismatch"),le("options",u),new y(u,f)}function a(h,u,f){var d=i.request(h,u,f);return d.end(),d}Object.defineProperties(i,{request:{value:c,configurable:!0,enumerable:!0,writable:!0},get:{value:a,configurable:!0,enumerable:!0,writable:!0}})}),t}function ve(){}function J(e){var t;if(z)t=new H(e);else if(t=me(S.parse(e)),!P(t.protocol))throw new F({input:e});return t}function ze(e,t){return z?new H(e,t):J(S.resolve(t,e))}function me(e){if(/^\[/.test(e.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(e.hostname))throw new F({input:e.href||e});if(/^\[/.test(e.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(e.host))throw new F({input:e.href||e});return e}function W(e,t){var r=t||{};for(var s of Fe)r[s]=e[s];return r.hostname.startsWith("[")&&(r.hostname=r.hostname.slice(1,-1)),r.port!==""&&(r.port=Number(r.port)),r.path=r.search?r.pathname+r.search:r.pathname,r}function I(e,t){var r;for(var s in t)e.test(s)&&(r=t[s],delete t[s]);return r===null||typeof r>"u"?void 0:String(r).trim()}function A(e,t,r){function s(o){x(Error.captureStackTrace)&&Error.captureStackTrace(this,this.constructor),Object.assign(this,o||{}),this.code=e,this.message=this.cause?t+": "+this.cause.message:t}return s.prototype=new(r||Error),Object.defineProperties(s.prototype,{constructor:{value:s,enumerable:!1},name:{value:"Error ["+e+"]",enumerable:!1}}),s}function Y(e,t){for(var r of K)e.removeListener(r,G[r]);e.on("error",ve),e.destroy(t)}function Ke(e,t){X(P(e)&&P(t));var r=e.length-t.length-1;return r>0&&e[r]==="."&&e.endsWith(t)}function P(e){return typeof e=="string"||e instanceof String}function x(e){return typeof e=="function"}function Ge(e){return typeof e=="object"&&"length"in e}function Je(e){return H&&e instanceof H}Q.exports=pe({http:ke,https:Ie});Q.exports.wrap=pe});var ye=g((Et,_e)=>{l();var Ye=w("http"),Qe=w("https"),q=he(),M=N(),Ze=we();q=Object.keys(q).map(function(e){return q[e]});var et={http:Ye,https:Qe};var tt=(function(){var e=process.versions.node.split(".").map(Number);return e[0]<=14||e[0]===15&&e[1]<=4})();_e.exports={deleteLength:function(t,r,s){(t.method==="DELETE"||t.method==="OPTIONS")&&!t.headers["content-length"]&&(t.headers["content-length"]="0",delete t.headers["transfer-encoding"])},timeout:function(t,r,s){s.timeout&&t.socket.setTimeout(s.timeout)},XHeaders:function(t,r,s){if(s.xfwd){var o=t.isSpdy||M.hasEncryptedConnection(t),n={for:t.connection.remoteAddress||t.socket.remoteAddress,port:M.getPort(t),proto:o?"https":"http"};["for","port","proto"].forEach(function(i){t.headers["x-forwarded-"+i]=(t.headers["x-forwarded-"+i]||"")+(t.headers["x-forwarded-"+i]?",":"")+n[i]}),t.headers["x-forwarded-host"]=t.headers["x-forwarded-host"]||t.headers.host||""}},stream:function(t,r,s,o,n,i){n.emit("start",t,r,s.target||s.forward);var c=s.followRedirects?Ze:et,a=c.http,h=c.https;if(s.forward){var u=(s.forward.protocol==="https:"?h:a).request(M.setupOutgoing(s.ssl||{},s,t,"forward")),f=R(u,s.forward);if(t.on("error",f),u.on("error",f),(s.buffer||t).pipe(u),!s.target)return r.end()}var d=(s.target.protocol==="https:"?h:a).request(M.setupOutgoing(s.ssl||{},s,t));d.on("socket",function(m){n&&!d.getHeader("expect")&&n.emit("proxyReq",d,t,r,s)}),s.proxyTimeout&&d.setTimeout(s.proxyTimeout,function(){d.abort()}),tt?t.on("aborted",function(){d.abort()}):r.on("close",function(){var m=!r.writableFinished;m&&d.abort()});var p=R(d,s.target);t.on("error",p),d.on("error",p);function R(m,b){return function(U){if(t.socket.destroyed&&U.code==="ECONNRESET")return n.emit("econnreset",U,t,r,b),m.abort();i?i(U,t,r,b):n.emit("error",U,t,r,b)}}(s.buffer||t).pipe(d),d.on("response",function(m){if(n&&n.emit("proxyRes",m,t,r),!r.headersSent&&!s.selfHandleResponse)for(var b=0;b<q.length&&!q[b](t,r,m,s);b++);r.finished?n&&n.emit("end",t,r,m):(m.on("end",function(){n&&n.emit("end",t,r,m)}),s.selfHandleResponse||m.pipe(r))})}}});var Ee=g((bt,ge)=>{l();var rt=w("http"),st=w("https"),O=N();ge.exports={checkMethodAndHeader:function(t,r){if(t.method!=="GET"||!t.headers.upgrade||t.headers.upgrade.toLowerCase()!=="websocket")return r.destroy(),!0},XHeaders:function(t,r,s){if(s.xfwd){var o={for:t.connection.remoteAddress||t.socket.remoteAddress,port:O.getPort(t),proto:O.hasEncryptedConnection(t)?"wss":"ws"};["for","port","proto"].forEach(function(n){t.headers["x-forwarded-"+n]=(t.headers["x-forwarded-"+n]||"")+(t.headers["x-forwarded-"+n]?",":"")+o[n]})}},stream:function(t,r,s,o,n,i){var c=function(u,f){return Object.keys(f).reduce(function(d,p){var R=f[p];if(!Array.isArray(R))return d.push(p+": "+R),d;for(var m=0;m<R.length;m++)d.push(p+": "+R[m]);return d},[u]).join(`\r `)+`\r \r `};O.setupSocket(r),o&&o.length&&r.unshift(o);var a=(O.isSSL.test(s.target.protocol)?st:rt).request(O.setupOutgoing(s.ssl||{},s,t));return n&&n.emit("proxyReqWs",a,t,r,s,o),a.on("error",h),a.on("response",function(u){u.upgrade||(r.write(c("HTTP/"+u.httpVersion+" "+u.statusCode+" "+u.statusMessage,u.headers)),u.pipe(r))}),a.on("upgrade",function(u,f,d){f.on("error",h),f.on("end",function(){n.emit("close",u,f,d)}),r.on("error",function(){f.destroy()}),O.setupSocket(f),d&&d.length&&f.unshift(d),r.write(c("HTTP/1.1 101 Switching Protocols",u.headers)),f.pipe(r).pipe(f),n.emit("open",f),n.emit("proxySocket",f)}),a.end();function h(u){i?i(u,t,r):n.emit("error",u,t,r),r.end()}}}});var Ce=g((xt,Oe)=>{l();var xe=Oe.exports,Re=Object.assign,nt=w("url").parse,Le=re(),it=w("http"),ot=w("https"),be=ye(),Pe=Ee();xe.Server=L;function Z(e){return function(t){return function(r,s){var o=e==="ws"?this.wsPasses:this.webPasses,n=[].slice.call(arguments),i=n.length-1,c,a;typeof n[i]=="function"&&(a=n[i],i--);var h=t;if(!(n[i]instanceof Buffer)&&n[i]!==s&&(h=Re({},t),Re(h,n[i]),i--),n[i]instanceof Buffer&&(c=n[i]),["target","forward"].forEach(function(f){typeof h[f]=="string"&&(h[f]=nt(h[f]))}),!h.target&&!h.forward)return this.emit("error",new Error("Must provide a proper URL as target"));for(var u=0;u<o.length&&!o[u](r,s,h,c,this,a);u++);}}}xe.createRightProxy=Z;function L(e){Le.call(this),e=e||{},e.prependPath=e.prependPath!==!1,this.web=this.proxyRequest=Z("web")(e),this.ws=this.proxyWebsocketRequest=Z("ws")(e),this.options=e,this.webPasses=Object.keys(be).map(function(t){return be[t]}),this.wsPasses=Object.keys(Pe).map(function(t){return Pe[t]}),this.on("error",this.onError,this)}w("util").inherits(L,Le);L.prototype.onError=function(e){if(this.listeners("error").length===1)throw e};L.prototype.listen=function(e,t){var r=this,s=function(o,n){r.web(o,n)};return this._server=this.options.ssl?ot.createServer(this.options.ssl,s):it.createServer(s),this.options.ws&&this._server.on("upgrade",function(o,n,i){r.ws(o,n,i)}),this._server.listen(e,t),this};L.prototype.close=function(e){var t=this;this._server&&this._server.close(r);function r(){t._server=null,e&&e.apply(null,arguments)}};L.prototype.before=function(e,t,r){if(e!=="ws"&&e!=="web")throw new Error("type must be `web` or `ws`");var s=e==="ws"?this.wsPasses:this.webPasses,o=!1;if(s.forEach(function(n,i){n.name===t&&(o=i)}),o===!1)throw new Error("No such pass");s.splice(o,0,r)};L.prototype.after=function(e,t,r){if(e!=="ws"&&e!=="web")throw new Error("type must be `web` or `ws`");var s=e==="ws"?this.wsPasses:this.webPasses,o=!1;if(s.forEach(function(n,i){n.name===t&&(o=i)}),o===!1)throw new Error("No such pass");s.splice(o++,0,r)}});var He=g((Ot,Te)=>{l();var B=Ce().Server;function ee(e){return new B(e)}B.createProxyServer=ee;B.createServer=ee;B.createProxy=ee;Te.exports=B});var at=g((Tt,Se)=>{l();Se.exports=He()});export default at(); /*! Bundled license information: http-proxy-node16/lib/http-proxy/passes/web-outgoing.js: http-proxy-node16/lib/http-proxy/passes/web-incoming.js: (*! * Array of passes. * * A `pass` is just a function that is executed on `req, res, options` * so that you can easily add new checks while still keeping the base * flexible. *) http-proxy-node16/lib/http-proxy/passes/ws-incoming.js: (*! * Array of passes. * * A `pass` is just a function that is executed on `req, socket, options` * so that you can easily add new checks while still keeping the base * flexible. *) http-proxy-node16/index.js: (*! * Caron dimonio, con occhi di bragia * loro accennando, tutte le raccoglie; * batte col remo qualunque s’adagia * * Charon the demon, with the eyes of glede, * Beckoning to them, collects them all together, * Beats with his oar whoever lags behind * * Dante - The Divine Comedy (Canto III) *) */