@d1g1tal/transportr 1.3.0 → 1.3.1
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/dist/transportr.js +1 -1
- package/dist/transportr.min.js +1 -1
- package/dist/transportr.min.js.map +2 -2
- package/package.json +2 -2
- package/src/transportr.js +1 -1
package/dist/transportr.js
CHANGED
package/dist/transportr.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
var Transportr=(()=>{var M=Object.defineProperty;var ae=Object.getOwnPropertyDescriptor;var oe=Object.getOwnPropertyNames;var ne=Object.prototype.hasOwnProperty;var ie=(r,e)=>{for(var t in e)M(r,t,{get:e[t],enumerable:!0})},ce=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of oe(e))!ne.call(r,a)&&a!==t&&M(r,a,{get:()=>e[a],enumerable:!(s=ae(e,a))||s.enumerable});return r};var le=r=>ce(M({},"__esModule",{value:!0}),r);var Ue={};ie(Ue,{default:()=>L});var j=class extends Map{set(e,t){return super.set(e,(super.get(e)??new Set).add(t)),this}hasValue(e,t){let s=super.get(e);return s?s.has(t):!1}deleteValue(e,t){let s=super.get(e);return s?s.delete(t):!1}get[Symbol.toStringTag](){return"SetMultiMap"}},W=j;var P=class extends Map{set(e,t){return super.set(e,(super.get(e)??new Set).add(t)),this}[Symbol.toStringTag](){return"SetMultiMap"}};var _=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t}handle(e,t){this.#t.call(this.#e,e,t)}get[Symbol.toStringTag](){return"ContextEventHandler"}};var A=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t}get eventName(){return this.#e}get contextEventHandler(){return this.#t}get[Symbol.toStringTag](){return"Subscription"}};var b=class{#e;constructor(){this.#e=new P}subscribe(e,t,s=t){let a=new _(s,t);return this.#e.set(e,a),new A(e,a)}unsubscribe({eventName:e,contextEventHandler:t}){let s=this.#e.get(e),a=s?.delete(t);return a&&s.size==0&&this.#e.delete(e),a}publish(e,t=new CustomEvent(e),s){s==null&&!(t instanceof Event)&&([s,t]=[t,new CustomEvent(e)]),this.#e.get(e)?.forEach(a=>a.handle(t,s))}isSubscribed({eventName:e,contextEventHandler:t}){return this.#e.get(e)?.has(t)}get[Symbol.toStringTag](){return"Subscribr"}};var C=class extends Error{#e;#t;constructor(e,{cause:t,status:s,entity:a}){super(e,{cause:t}),this.#e=a,this.#t=s}get entity(){return this.#e}get statusCode(){return this.#t?.code}get statusText(){return this.#t?.text}get name(){return"HttpError"}get[Symbol.toStringTag](){return"HttpError"}};var pe={AAC:"audio/aac",ABW:"application/x-abiword",ARC:"application/x-freearc",AVIF:"image/avif",AVI:"video/x-msvideo",AZW:"application/vnd.amazon.ebook",BIN:"application/octet-stream",BMP:"image/bmp",BZIP:"application/x-bzip",BZIP2:"application/x-bzip2",CDA:"application/x-cdf",CSH:"application/x-csh",CSS:"text/css",CSV:"text/csv",DOC:"application/msword",DOCX:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",EOT:"application/vnd.ms-fontobject",EPUB:"application/epub+zip",GZIP:"application/gzip",GIF:"image/gif",HTML:"text/html",ICO:"image/vnd.microsoft.icon",ICS:"text/calendar",JAR:"application/java-archive",JPEG:"image/jpeg",JAVA_SCRIPT:"text/javascript",JSON:"application/json",JSON_LD:"application/ld+json",JSON_MERGE_PATCH:"application/merge-patch+json",MID:"audio/midi",X_MID:"audio/x-midi",MP3:"audio/mpeg",MP4A:"audio/mp4",MP4:"video/mp4",MPEG:"video/mpeg",MPKG:"application/vnd.apple.installer+xml",ODP:"application/vnd.oasis.opendocument.presentation",ODS:"application/vnd.oasis.opendocument.spreadsheet",ODT:"application/vnd.oasis.opendocument.text",OGA:"audio/ogg",OGV:"video/ogg",OGX:"application/ogg",OPUS:"audio/opus",OTF:"font/otf",PNG:"image/png",PDF:"application/pdf",PHP:"application/x-httpd-php",PPT:"application/vnd.ms-powerpoint",PPTX:"application/vnd.openxmlformats-officedocument.presentationml.presentation",RAR:"application/vnd.rar",RTF:"application/rtf",SH:"application/x-sh",SVG:"image/svg+xml",TAR:"application/x-tar",TIFF:"image/tiff",TRANSPORT_STREAM:"video/mp2t",TTF:"font/ttf",TEXT:"text/plain",VSD:"application/vnd.visio",WAV:"audio/wav",WEBA:"audio/webm",WEBM:"video/webm",WEBP:"image/webp",WOFF:"font/woff",WOFF2:"font/woff2",FORM:"application/x-www-form-urlencoded",MULTIPART_FORM_DATA:"multipart/form-data",XHTML:"application/xhtml+xml",XLS:"application/vnd.ms-excel",XLSX:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",XML:"application/xml",XUL:"application/vnd.mozilla.xul+xml",ZIP:"application/zip","3GP":"video/3gpp","3G2":"video/3gpp2","7Z":"application/x-7z-compressed"},o=pe;var ue={ACCEPT:"accept",ACCEPT_CHARSET:"accept-charset",ACCEPT_ENCODING:"accept-encoding",ACCEPT_LANGUAGE:"accept-language",AUTHORIZATION:"authorization",CACHE_CONTROL:"cache-control",CONNECTION:"connection",COOKIE:"cookie",CONTENT_LENGTH:"content-length",CONTENT_MD5:"content-md5",CONTENT_TYPE:"content-type",DATE:"date",EXPECT:"expect",FROM:"from",HOST:"host",IF_MATCH:"if-match",IF_MODIFIED_SINCE:"if-modified-since",IF_NONE_MATCH:"if-none-match",IF_RANGE:"if-range",IF_UNMODIFIED_SINCE:"if-unmodified-since",MAX_FORWARDS:"max-forwards",ORIGIN:"origin",PRAGMA:"pragma",PROXY_AUTHORIZATION:"proxy-authorization",RANGE:"range",REFERER:"referer",TE:"te",USER_AGENT:"user-agent",UPGRADE:"upgrade",VIA:"via",WARNING:"warning",X_REQUESTED_WITH:"x-requested-with",DNT:"dnt",X_FORWARDED_FOR:"x-forwarded-for",X_FORWARDED_HOST:"x-forwarded-host",X_FORWARDED_PROTO:"x-forwarded-proto",FRONT_END_HTTPS:"front-end-https",X_HTTP_METHOD_OVERRIDE:"x-http-method-override",X_ATT_DEVICE_ID:"x-att-deviceid",X_WAP_PROFILE:"x-wap-profile"},p=ue;var de={OPTIONS:"OPTIONS",GET:"GET",HEAD:"HEAD",POST:"POST",PUT:"PUT",DELETE:"DELETE",TRACE:"TRACE",CONNECT:"CONNECT",PATCH:"PATCH"},d=de;var fe={PROXY_CONNECTION:"proxy-connection",X_UIDH:"x-uidh",X_CSRF_TOKEN:"x-csrf-token",ACCESS_CONTROL_ALLOW_ORIGIN:"access-control-allow-origin",ACCEPT_PATCH:"accept-patch",ACCEPT_RANGES:"accept-ranges",AGE:"age",ALLOW:"allow",CACHE_CONTROL:"cache-control",CONNECTION:"connection",CONTENT_DISPOSITION:"content-disposition",CONTENT_ENCODING:"content-encoding",CONTENT_LANGUAGE:"content-language",CONTENT_LENGTH:"content-length",CONTENT_LOCATION:"content-location",CONTENT_RANGE:"content-range",CONTENT_TYPE:"content-type",DATE:"date",ETAG:"etag",EXPIRES:"expires",LAST_MODIFIED:"last-modified",LINK:"link",LOCATION:"location",P3P:"p3p",PRAGMA:"pragma",PROXY_AUTHENTICATION:"proxy-authenticate",PUBLIC_KEY_PINS:"public-key-pins",RETRY_AFTER:"retry-after",SERVER:"server",SET_COOKIE:"set-cookie",STATUS:"status",STRICT_TRANSPORT_SECURITY:"strict-transport-security",TRAILER:"trailer",TRANSFER_ENCODING:"transfer-encoding",UPGRADE:"upgrade",VARY:"vary",VIA:"via",WARNING:"warning",WWW_AUTHENTICATE:"www-authenticate",X_XSS_PROTECTION:"x-xss-protection",CONTENT_SECURITY_POLICY:"content-security-policy",X_CONTENT_TYPE_OPTIONS:"x-content-type-options",X_POWERED_BY:"x-powered-by"},w=fe;var E=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t}get code(){return this.#e}get text(){return this.#t}get[Symbol.toStringTag](){return"ResponseStatus"}toString(){return`${this.#e} ${this.#t}`}};var O=class r extends Map{constructor(e={}){super();for(let[t,s]of r.#e(e))this.append(t,s)}set(e,t){let s=super.get(e);return s?.length>0?(s.length=0,s[0]=t):super.set(e,[t]),this}setAll(e){for(let[t,s]of r.#e(e))this.set(t,s);return this}get(e){return super.get(e)?.[0]}getAll(e){return super.get(e)}append(e,t){let s=super.get(e);return s?.length>0?s.push(t):super.set(e,[t]),this}appendAll(e){for(let[t,s]of r.#e(e))this.append(t,s);return this}hasValue(e){for(let t of super.values())if(t.includes(e))return!0;return!1}deleteValue(e){for(let t of this.values())if(t.includes(e))return t.splice(t.indexOf(e),1).length>0;return!1}isEmpty(){return this.size===0}toJSON(){let e=Object.create(null);for(let[t,s]of super.entries())e[t]=s.length===1?s[0]:s;return e}*entries(){for(let[e,t]of super.entries())for(let s of t)yield[e,s]}*[Symbol.iterator](){yield*this.entries()}static#e(e){return e[Symbol.iterator]?e:Object.entries(e)}get[Symbol.toStringTag](){return"ParameterMap"}};var me=[" "," ",`
|
|
2
|
-
`,"\r"],he=/^[ \t\n\r]+/u,X=/[ \t\n\r]+$/u,Te=/^[-!#$%&'*+.^_`|~A-Za-z0-9]*$/u,ge=/^[\t\u0020-\u007E\u0080-\u00FF]*$/u,k=r=>r.replace(he,"").replace(X,""),D=r=>r.replace(X,""),z=r=>me.includes(r),T=r=>Te.test(r),N=r=>ge.test(r),f=r=>{let e="";for(let[t,s=t.charCodeAt(0)]of r)e+=s>=65&&s<=90?String.fromCharCode(s+32):t;return e},B=(r,e)=>{let t="";for(let s=r.length,a;++e<s;)if(a=r[e],a=="\\")t+=++e<s?r[e]:a;else{if(a=='"')break;t+=a}return[t,e]};var R=class{#e;constructor(e){this.#e=new Map(e)}get size(){return this.#e.size}get(e){return this.#e.get(f(String(e)))}has(e){return this.#e.has(f(String(e)))}set(e,t){if(e=f(String(e)),t=String(t),!T(e))throw new Error(`Invalid media type parameter name "${e}": only HTTP token code points are valid.`);if(!N(t))throw new Error(`Invalid media type parameter value "${t}": only HTTP quoted-string token code points are valid.`);return this.#e.set(e,t),this}clear(){this.#e.clear()}delete(e){return e=f(String(e)),this.#e.delete(e)}forEach(e,t){this.#e.forEach(e,t)}keys(){return this.#e.keys()}values(){return this.#e.values()}entries(){return this.#e.entries()}[Symbol.iterator](){return this.#e[Symbol.iterator]()}[Symbol.toStringTag](){return"MediaTypeParameters"}};var Ee=r=>{r=k(r);let e=0,t="";for(;e<r.length&&r[e]!="/";)t+=r[e],++e;if(t.length===0||!T(t)||e>=r.length)return null;++e;let s="";for(;e<r.length&&r[e]!=";";)s+=r[e],++e;if(s=D(s),s.length===0||!T(s))return null;let a={type:f(t),subtype:f(s),parameters:new Map};for(;e<r.length;){for(++e;z(r[e]);)++e;let n="";for(;e<r.length&&r[e]!=";"&&r[e]!="=";)n+=r[e],++e;if(n=f(n),e<r.length){if(r[e]==";")continue;++e}let i=null;if(r[e]=='"')for([i,e]=B(r,e);e<r.length&&r[e]!=";";)++e;else{for(i="";e<r.length&&r[e]!=";";)i+=r[e],++e;if(i=D(i),i==="")continue}n.length>0&&T(n)&&N(i)&&!a.parameters.has(n)&&a.parameters.set(n,i)}return a},U=Ee;var Oe=r=>{let e=`${r.type}/${r.subtype}`;if(r.parameters.size===0)return e;for(let[t,s]of r.parameters)e+=`;${t}=`,(!T(s)||s.length===0)&&(s=`"${s.replace(/(["\\])/ug,"\\$1")}"`),e+=s;return e},G=Oe;var u=class r{#e;#t;#r;constructor(e,t={}){let{type:s,subtype:a,parameters:n}=U(e);this.#e=s,this.#t=a,this.#r=new R([...n,...Object.entries(t).map(([i,g])=>[f(i),f(g)])])}static parse(e){try{return new r(e)}catch{throw new Error(`Could not parse media type string '${e}'`)}}get essence(){return`${this.#e}/${this.#t}`}get type(){return this.#e}set type(e){if(e=f(String(e)),e.length===0)throw new Error("Invalid type: must be a non-empty string");if(!T(e))throw new Error(`Invalid type ${e}: must contain only HTTP token code points`);this.#e=e}get subtype(){return this.#t}set subtype(e){if(e=f(String(e)),e.length===0)throw new Error("Invalid subtype: must be a non-empty string");if(!T(e))throw new Error(`Invalid subtype ${e}: must contain only HTTP token code points`);this.#t=e}get parameters(){return this.#r}toString(){return G(this)}isJavaScript({prohibitParameters:e=!1}={}){switch(this.#e){case"text":switch(this.#t){case"ecmascript":case"javascript":case"javascript1.0":case"javascript1.1":case"javascript1.2":case"javascript1.3":case"javascript1.4":case"javascript1.5":case"jscript":case"livescript":case"x-ecmascript":case"x-javascript":return!e||this.#r.size===0;default:return!1}case"application":switch(this.#t){case"ecmascript":case"javascript":case"x-ecmascript":case"x-javascript":return!e||this.#r.size===0;default:return!1}default:return!1}}isXML(){return this.#t==="xml"&&(this.#e==="text"||this.#e==="application")||this.#t.endsWith("+xml")}isHTML(){return this.#t==="html"&&this.#e==="text"}get[Symbol.toStringTag](){return"MediaType"}};var x="utf-8",$=/\/$/,l=new Map([[o.PNG,new u(o.PNG)],[o.TEXT,new u(o.TEXT,{defaultCharset:x})],[o.JSON,new u(o.JSON,{defaultCharset:x})],[o.HTML,new u(o.HTML,{defaultCharset:x})],[o.JAVA_SCRIPT,new u(o.JAVA_SCRIPT,{defaultCharset:x})],[o.CSS,new u(o.CSS,{defaultCharset:x})],[o.XML,new u(o.XML,{defaultCharset:x})],[o.BIN,new u(o.BIN)]]),h=Object.freeze({CONFIGURED:"configured",SUCCESS:"success",ERROR:"error",ABORTED:"aborted",TIMEOUT:"timeout",COMPLETE:"complete",ALL_COMPLETE:"all-complete"}),y=Object.freeze({ABORT:"abort",TIMEOUT:"timeout"}),v=new CustomEvent(y.ABORT,{detail:{cause:new DOMException("The request was aborted","AbortError")}}),q=[d.POST,d.PUT,d.PATCH];var V=globalThis.AbortSignal,S=class r extends EventTarget{#e;#t;constructor(e){super(),this.#e=new AbortController,e?.addEventListener(y.ABORT,t=>this.#r(t))}static abort(){return V.abort()}static timeout(e){return V.timeout(e)}get aborted(){return this.#e.signal.aborted}get reason(){return this.#e.signal.reason}throwIfAborted(){this.#e.signal.throwIfAborted()}withTimeout(e){if(e<0)throw new RangeError("The timeout cannot be negative");return this.#t??=setTimeout(()=>this.#r(r.#i(e),!0),e),this.#e.signal}clearTimeout(){clearTimeout(this.#t)}addEventListener(e,t){this.#e.signal.addEventListener(e,t)}dispatchEvent(e){return this.#e.signal.dispatchEvent(e)}removeEventListener(e,t){this.#e.signal.removeEventListener(e,t)}abort(e){this.#r(e)}#r(e=v,t=!1){clearTimeout(this.#t),this.#e.abort(e.detail?.cause),t&&this.#e.signal.dispatchEvent(e)}static#i(e){return new CustomEvent(y.TIMEOUT,{detail:{timeout:e,cause:new DOMException(`The request timed-out after ${e/1e3} seconds`,"TimeoutError")}})}};var Re=r=>r?.constructor??r?.prototype?.constructor??globalThis[Object.prototype.toString.call(r).slice(8,-1)]??r,m=Re;var Y=(...r)=>{let e={};for(let t of r){if(m(t)!=Object)return;let s,a;for(let n of Object.getOwnPropertyNames(t))s=Object.getOwnPropertyDescriptor(t,n),s.enumerable&&(a=m(t[n]),a==Object?s.value=m(e[n])==Object?Y(e[n],t[n]):{...t[n]}:a==Array&&(s.value=Array.isArray(e[n])?[...new Set([...t[n],...e[n]])]:[...t[n]]),e[n]=s.value)}return e},I=Y;var He=async r=>await r.text(),Z=async r=>{let e=URL.createObjectURL(await r.blob());return document.head.removeChild(document.head.appendChild(Object.assign(document.createElement("script"),{src:e,type:o.JAVA_SCRIPT,async:!0}))),URL.revokeObjectURL(e),Promise.resolve()},Q=async r=>{let e=URL.createObjectURL(await r.blob());return document.head.appendChild(Object.assign(document.createElement("link"),{href:e,type:o.CSS,rel:"stylesheet"})),URL.revokeObjectURL(e),Promise.resolve()},K=async r=>await r.json(),Me=async r=>await r.blob(),ee=async r=>URL.createObjectURL(await r.blob()),je=async r=>await r.arrayBuffer(),te=async r=>r.body,re=async r=>new DOMParser().parseFromString(await r.text(),o.XML),se=async r=>new DOMParser().parseFromString(await r.text(),o.HTML),De=async r=>document.createRange().createContextualFragment(await r.text()),L=class r{#e;#t;#r;static#i=new b;static#c=new Set;static#d=new W([[ee,l.get(o.PNG).type],[He,l.get(o.TEXT).type],[K,l.get(o.JSON).subtype],[se,l.get(o.HTML).subtype],[Z,l.get(o.JAVA_SCRIPT).subtype],[Q,l.get(o.CSS).subtype],[re,l.get(o.XML).subtype],[te,l.get(o.BIN).subtype]]);constructor(e=globalThis.location.origin,t={}){m(e)==Object&&([e,t]=[globalThis.location.origin,e]),this.#e=r.#g(e),this.#t=r.#m(t,r.#f),this.#r=new b}static Method=Object.freeze(d);static MediaType=Object.freeze(o);static RequestHeader=Object.freeze(p);static ResponseHeader=Object.freeze(w);static CachingPolicy=Object.freeze({DEFAULT:"default",FORCE_CACHE:"force-cache",NO_CACHE:"no-cache",NO_STORE:"no-store",ONLY_IF_CACHED:"only-if-cached",RELOAD:"reload"});static CredentialsPolicy=Object.freeze({INCLUDE:"include",OMIT:"omit",SAME_ORIGIN:"same-origin"});static RequestMode=Object.freeze({CORS:"cors",NAVIGATE:"navigate",NO_CORS:"no-cors",SAME_ORIGIN:"same-origin"});static RedirectPolicy=Object.freeze({ERROR:"error",FOLLOW:"follow",MANUAL:"manual"});static ReferrerPolicy=Object.freeze({NO_REFERRER:"no-referrer",NO_REFERRER_WHEN_DOWNGRADE:"no-referrer-when-downgrade",ORIGIN:"origin",ORIGIN_WHEN_CROSS_ORIGIN:"origin-when-cross-origin",SAME_ORIGIN:"same-origin",STRICT_ORIGIN:"strict-origin",STRICT_ORIGIN_WHEN_CROSS_ORIGIN:"strict-origin-when-cross-origin",UNSAFE_URL:"unsafe-url"});static RequestEvents=h;static#f=Object.freeze({body:null,cache:r.CachingPolicy.NO_STORE,credentials:r.CredentialsPolicy.SAME_ORIGIN,headers:{[p.CONTENT_TYPE]:l.get(o.JSON).toString(),[p.ACCEPT]:l.get(o.JSON).toString()},searchParams:{},integrity:void 0,keepalive:void 0,method:d.GET,mode:r.RequestMode.CORS,redirect:r.RedirectPolicy.FOLLOW,referrer:"about:client",referrerPolicy:r.ReferrerPolicy.STRICT_ORIGIN_WHEN_CROSS_ORIGIN,signal:void 0,timeout:3e4,global:!0,window:null});static#l=new Map([[h.ABORTED,new E(499,"Aborted")],[h.TIMEOUT,new E(504,"Gateway Timeout")]]);static abortSignal(){return new S}static register(e,t,s){return r.#i.subscribe(e,t,s)}static unregister(e){return r.#i.unsubscribe(e)}static abortAll(){for(let e of this.#c)e.abort(v);this.#c.clear()}get baseUrl(){return this.#e}register(e,t,s){return this.#r.subscribe(e,t,s)}unregister(e){this.#r.unsubscribe(e)}async get(e,t){return this.#s(e,t)}async post(e,t,s){return this.#o(e,{...s,body:t},{method:d.POST})}async put(e,t){return this.#o(e,t,{method:d.PUT})}async patch(e,t){return this.#o(e,t,{method:d.PATCH})}async delete(e,t){return this.#o(e,t,{method:d.DELETE})}async head(e,t){return this.#o(e,t,{method:d.HEAD})}async options(e,t){return(await this.#o(e,t,{method:d.OPTIONS})).headers.get("allow").split(",").map(a=>a.trim())}async request(e,t){return this.#o(e,t,{},s=>s)}async getJson(e,t){return this.#s(e,t,{headers:{[p.ACCEPT]:l.get(o.JSON).toString()}},K)}async getXml(e,t){return this.#s(e,t,{headers:{[p.ACCEPT]:l.get(o.XML).toString()}},re)}async getHtml(e,t){return this.#s(e,t,{headers:{[p.ACCEPT]:l.get(o.HTML).toString()}},se)}async getHtmlFragment(e,t){return this.#s(e,t,{headers:{[p.ACCEPT]:l.get(o.HTML).toString()}},De)}async getScript(e,t){return this.#s(e,t,{headers:{[p.ACCEPT]:l.get(o.JAVA_SCRIPT).toString()}},Z)}async getStylesheet(e,t){return this.#s(e,t,{headers:{[p.ACCEPT]:l.get(o.CSS).toString()}},Q)}async getBlob(e,t){return this.#s(e,t,{headers:{[p.ACCEPT]:o.BIN}},Me)}async getImage(e,t){return this.#s(e,t,{headers:{[p.ACCEPT]:"image/*"}},ee)}async getBuffer(e,t){return this.#s(e,t,{headers:{[p.ACCEPT]:o.BIN}},je)}async getStream(e,t){return this.#s(e,t,{headers:{[p.ACCEPT]:o.BIN}},te)}async#s(e,t,s,a){return this.#o(e,t,{...s,method:d.GET},a)}async#o(e,t={},s={},a){m(e)==Object&&([e,t]=[void 0,e]);try{s=this.#h(t,s)}catch(c){return Promise.reject(new C("Unable to process request options",{cause:c}))}this.#n({name:h.CONFIGURED,data:s,global:s.global});let n=r.#E(this.#e,e);m(s.signal)!=S&&(s.signal=new S(s.signal)),s.signal.addEventListener(y.ABORT,c=>this.#n({name:h.ABORTED,event:c,global:s.global})),s.signal.addEventListener(y.TIMEOUT,c=>this.#n({name:h.TIMEOUT,event:c,global:s.global})),r.#c.add(s.signal);let i,g;try{if(i=await fetch(n,new Proxy(s,{get:r.#T(s.timeout)})),!a&&i.status!=204&&i.headers.has(w.CONTENT_TYPE)&&(a=this.#O(i.headers.get(w.CONTENT_TYPE))),g=await a?.(i)??i,!i.ok)return Promise.reject(this.#u(n,{status:r.#p("ResponseError",i),entity:g}));this.#n({name:h.SUCCESS,data:g,global:s.global})}catch(c){return Promise.reject(this.#u(n,{cause:c,status:r.#p(c.name,i)}))}finally{s.signal.clearTimeout(),s.signal.aborted||(this.#n({name:h.COMPLETE,data:i,global:s.global}),r.#c.delete(s.signal),r.#c.size===0&&this.#n({name:h.ALL_COMPLETE,global:s.global}))}return g}static#m({body:e,headers:t,searchParams:s,...a},{headers:n,searchParams:i,...g}){return I(g,a,{body:[FormData,URLSearchParams,Object].includes(m(e))?new O(e):e,headers:r.#a(new Headers,t,n),searchParams:r.#a(new URLSearchParams,s,i)})}static#a(e,t={},s={}){for(let a of[t,s])for(let[n,i]of a.entries?.()??Object.entries(a))e.set(n,i);return e}#h({body:e,headers:t,searchParams:s,...a},{headers:n,searchParams:i,...g}){let c=I(this.#t,a,g,{headers:r.#a(new Headers(this.#t.headers),t,n),searchParams:r.#a(new URLSearchParams(this.#t.searchParams),s,i)});if(q.includes(c.method))if([O,FormData,URLSearchParams,Object].includes(m(e))){let F=c.headers.get(p.CONTENT_TYPE),H=(l.get(F)??u.parse(F))?.subtype;H==o.MULTIPART_FORM_DATA?c.body=r.#a(new FormData(c.body),e):H==o.FORM?c.body=r.#a(new URLSearchParams(c.body),e):H.includes("json")?c.body=JSON.stringify(r.#a(new O(c.body),e)):c.body=r.#a(new O(c.body),e)}else c.body=e;else c.headers.delete(p.CONTENT_TYPE),c.body?.isEmpty()||r.#a(c.searchParams,c.body),c.body=void 0;return c}static#T(e){return(t,s)=>{let a=Reflect.get(t,s);return s=="signal"&&!a.aborted?a.withTimeout(e):a}}static#g(e){switch(m(e)){case URL:return e;case String:return new URL(e,e.startsWith("/")?globalThis.location.origin:void 0);default:throw new TypeError("Invalid URL")}}static#E(e,t){return t?new URL(`${e.pathname.replace($,"")}${t}`,e.origin):new URL(e)}static#p(e,t){switch(e){case"AbortError":return r.#l.get(h.ABORTED);case"TimeoutError":return r.#l.get(h.TIMEOUT);default:return t?new E(t.status,t.statusText):new E(500,"Internal Server Error")}}#u(e,t){let s=new C(`An error has occurred with your request to: '${e}'`,t);return this.#n({name:h.ERROR,data:s}),s}#n({name:e,event:t=new CustomEvent(e),data:s,global:a=!0}={}){a&&r.#i.publish(e,t,s),this.#r.publish(e,t,s)}#O(e){let t,s=u.parse(e);if(s){for(let[a,n]of r.#d)if(n.has(s.type)||n.has(s.subtype)){t=a;break}}return t}get[Symbol.toStringTag](){return"Transportr"}};return le(Ue);})();
|
|
2
|
+
`,"\r"],he=/^[ \t\n\r]+/u,X=/[ \t\n\r]+$/u,Te=/^[-!#$%&'*+.^_`|~A-Za-z0-9]*$/u,ge=/^[\t\u0020-\u007E\u0080-\u00FF]*$/u,k=r=>r.replace(he,"").replace(X,""),D=r=>r.replace(X,""),z=r=>me.includes(r),T=r=>Te.test(r),N=r=>ge.test(r),f=r=>{let e="";for(let[t,s=t.charCodeAt(0)]of r)e+=s>=65&&s<=90?String.fromCharCode(s+32):t;return e},B=(r,e)=>{let t="";for(let s=r.length,a;++e<s;)if(a=r[e],a=="\\")t+=++e<s?r[e]:a;else{if(a=='"')break;t+=a}return[t,e]};var R=class{#e;constructor(e){this.#e=new Map(e)}get size(){return this.#e.size}get(e){return this.#e.get(f(String(e)))}has(e){return this.#e.has(f(String(e)))}set(e,t){if(e=f(String(e)),t=String(t),!T(e))throw new Error(`Invalid media type parameter name "${e}": only HTTP token code points are valid.`);if(!N(t))throw new Error(`Invalid media type parameter value "${t}": only HTTP quoted-string token code points are valid.`);return this.#e.set(e,t),this}clear(){this.#e.clear()}delete(e){return e=f(String(e)),this.#e.delete(e)}forEach(e,t){this.#e.forEach(e,t)}keys(){return this.#e.keys()}values(){return this.#e.values()}entries(){return this.#e.entries()}[Symbol.iterator](){return this.#e[Symbol.iterator]()}[Symbol.toStringTag](){return"MediaTypeParameters"}};var Ee=r=>{r=k(r);let e=0,t="";for(;e<r.length&&r[e]!="/";)t+=r[e],++e;if(t.length===0||!T(t)||e>=r.length)return null;++e;let s="";for(;e<r.length&&r[e]!=";";)s+=r[e],++e;if(s=D(s),s.length===0||!T(s))return null;let a={type:f(t),subtype:f(s),parameters:new Map};for(;e<r.length;){for(++e;z(r[e]);)++e;let n="";for(;e<r.length&&r[e]!=";"&&r[e]!="=";)n+=r[e],++e;if(n=f(n),e<r.length){if(r[e]==";")continue;++e}let i=null;if(r[e]=='"')for([i,e]=B(r,e);e<r.length&&r[e]!=";";)++e;else{for(i="";e<r.length&&r[e]!=";";)i+=r[e],++e;if(i=D(i),i==="")continue}n.length>0&&T(n)&&N(i)&&!a.parameters.has(n)&&a.parameters.set(n,i)}return a},U=Ee;var Oe=r=>{let e=`${r.type}/${r.subtype}`;if(r.parameters.size===0)return e;for(let[t,s]of r.parameters)e+=`;${t}=`,(!T(s)||s.length===0)&&(s=`"${s.replace(/(["\\])/ug,"\\$1")}"`),e+=s;return e},G=Oe;var u=class r{#e;#t;#r;constructor(e,t={}){let{type:s,subtype:a,parameters:n}=U(e);this.#e=s,this.#t=a,this.#r=new R([...n,...Object.entries(t).map(([i,g])=>[f(i),f(g)])])}static parse(e){try{return new r(e)}catch{throw new Error(`Could not parse media type string '${e}'`)}}get essence(){return`${this.#e}/${this.#t}`}get type(){return this.#e}set type(e){if(e=f(String(e)),e.length===0)throw new Error("Invalid type: must be a non-empty string");if(!T(e))throw new Error(`Invalid type ${e}: must contain only HTTP token code points`);this.#e=e}get subtype(){return this.#t}set subtype(e){if(e=f(String(e)),e.length===0)throw new Error("Invalid subtype: must be a non-empty string");if(!T(e))throw new Error(`Invalid subtype ${e}: must contain only HTTP token code points`);this.#t=e}get parameters(){return this.#r}toString(){return G(this)}isJavaScript({prohibitParameters:e=!1}={}){switch(this.#e){case"text":switch(this.#t){case"ecmascript":case"javascript":case"javascript1.0":case"javascript1.1":case"javascript1.2":case"javascript1.3":case"javascript1.4":case"javascript1.5":case"jscript":case"livescript":case"x-ecmascript":case"x-javascript":return!e||this.#r.size===0;default:return!1}case"application":switch(this.#t){case"ecmascript":case"javascript":case"x-ecmascript":case"x-javascript":return!e||this.#r.size===0;default:return!1}default:return!1}}isXML(){return this.#t==="xml"&&(this.#e==="text"||this.#e==="application")||this.#t.endsWith("+xml")}isHTML(){return this.#t==="html"&&this.#e==="text"}get[Symbol.toStringTag](){return"MediaType"}};var x="utf-8",$=/\/$/,l=new Map([[o.PNG,new u(o.PNG)],[o.TEXT,new u(o.TEXT,{defaultCharset:x})],[o.JSON,new u(o.JSON,{defaultCharset:x})],[o.HTML,new u(o.HTML,{defaultCharset:x})],[o.JAVA_SCRIPT,new u(o.JAVA_SCRIPT,{defaultCharset:x})],[o.CSS,new u(o.CSS,{defaultCharset:x})],[o.XML,new u(o.XML,{defaultCharset:x})],[o.BIN,new u(o.BIN)]]),h=Object.freeze({CONFIGURED:"configured",SUCCESS:"success",ERROR:"error",ABORTED:"aborted",TIMEOUT:"timeout",COMPLETE:"complete",ALL_COMPLETE:"all-complete"}),y=Object.freeze({ABORT:"abort",TIMEOUT:"timeout"}),v=new CustomEvent(y.ABORT,{detail:{cause:new DOMException("The request was aborted","AbortError")}}),V=[d.POST,d.PUT,d.PATCH];var q=globalThis.AbortSignal,S=class r extends EventTarget{#e;#t;constructor(e){super(),this.#e=new AbortController,e?.addEventListener(y.ABORT,t=>this.#r(t))}static abort(){return q.abort()}static timeout(e){return q.timeout(e)}get aborted(){return this.#e.signal.aborted}get reason(){return this.#e.signal.reason}throwIfAborted(){this.#e.signal.throwIfAborted()}withTimeout(e){if(e<0)throw new RangeError("The timeout cannot be negative");return this.#t??=setTimeout(()=>this.#r(r.#i(e),!0),e),this.#e.signal}clearTimeout(){clearTimeout(this.#t)}addEventListener(e,t){this.#e.signal.addEventListener(e,t)}dispatchEvent(e){return this.#e.signal.dispatchEvent(e)}removeEventListener(e,t){this.#e.signal.removeEventListener(e,t)}abort(e){this.#r(e)}#r(e=v,t=!1){clearTimeout(this.#t),this.#e.abort(e.detail?.cause),t&&this.#e.signal.dispatchEvent(e)}static#i(e){return new CustomEvent(y.TIMEOUT,{detail:{timeout:e,cause:new DOMException(`The request timed-out after ${e/1e3} seconds`,"TimeoutError")}})}};var Re=r=>r?.constructor??r?.prototype?.constructor??globalThis[Object.prototype.toString.call(r).slice(8,-1)]??r,m=Re;var Y=(...r)=>{let e={};for(let t of r){if(m(t)!=Object)return;let s,a;for(let n of Object.getOwnPropertyNames(t))s=Object.getOwnPropertyDescriptor(t,n),s.enumerable&&(a=m(t[n]),a==Object?s.value=m(e[n])==Object?Y(e[n],t[n]):{...t[n]}:a==Array&&(s.value=Array.isArray(e[n])?[...new Set([...t[n],...e[n]])]:[...t[n]]),e[n]=s.value)}return e},I=Y;var He=async r=>await r.text(),Z=async r=>{let e=URL.createObjectURL(await r.blob());return document.head.removeChild(document.head.appendChild(Object.assign(document.createElement("script"),{src:e,type:o.JAVA_SCRIPT,async:!0}))),URL.revokeObjectURL(e),Promise.resolve()},Q=async r=>{let e=URL.createObjectURL(await r.blob());return document.head.appendChild(Object.assign(document.createElement("link"),{href:e,type:o.CSS,rel:"stylesheet"})),URL.revokeObjectURL(e),Promise.resolve()},K=async r=>await r.json(),Me=async r=>await r.blob(),ee=async r=>URL.createObjectURL(await r.blob()),je=async r=>await r.arrayBuffer(),te=async r=>r.body,re=async r=>new DOMParser().parseFromString(await r.text(),o.XML),se=async r=>new DOMParser().parseFromString(await r.text(),o.HTML),De=async r=>document.createRange().createContextualFragment(await r.text()),L=class r{#e;#t;#r;static#i=new b;static#c=new Set;static#d=new W([[ee,l.get(o.PNG).type],[He,l.get(o.TEXT).type],[K,l.get(o.JSON).subtype],[se,l.get(o.HTML).subtype],[Z,l.get(o.JAVA_SCRIPT).subtype],[Q,l.get(o.CSS).subtype],[re,l.get(o.XML).subtype],[te,l.get(o.BIN).subtype]]);constructor(e=globalThis.location.origin,t={}){m(e)==Object&&([e,t]=[globalThis.location.origin,e]),this.#e=r.#g(e),this.#t=r.#m(t,r.#f),this.#r=new b}static Method=Object.freeze(d);static MediaType=Object.freeze(o);static RequestHeader=Object.freeze(p);static ResponseHeader=Object.freeze(w);static CachingPolicy=Object.freeze({DEFAULT:"default",FORCE_CACHE:"force-cache",NO_CACHE:"no-cache",NO_STORE:"no-store",ONLY_IF_CACHED:"only-if-cached",RELOAD:"reload"});static CredentialsPolicy=Object.freeze({INCLUDE:"include",OMIT:"omit",SAME_ORIGIN:"same-origin"});static RequestMode=Object.freeze({CORS:"cors",NAVIGATE:"navigate",NO_CORS:"no-cors",SAME_ORIGIN:"same-origin"});static RedirectPolicy=Object.freeze({ERROR:"error",FOLLOW:"follow",MANUAL:"manual"});static ReferrerPolicy=Object.freeze({NO_REFERRER:"no-referrer",NO_REFERRER_WHEN_DOWNGRADE:"no-referrer-when-downgrade",ORIGIN:"origin",ORIGIN_WHEN_CROSS_ORIGIN:"origin-when-cross-origin",SAME_ORIGIN:"same-origin",STRICT_ORIGIN:"strict-origin",STRICT_ORIGIN_WHEN_CROSS_ORIGIN:"strict-origin-when-cross-origin",UNSAFE_URL:"unsafe-url"});static Events=h;static#f=Object.freeze({body:null,cache:r.CachingPolicy.NO_STORE,credentials:r.CredentialsPolicy.SAME_ORIGIN,headers:{[p.CONTENT_TYPE]:l.get(o.JSON).toString(),[p.ACCEPT]:l.get(o.JSON).toString()},searchParams:{},integrity:void 0,keepalive:void 0,method:d.GET,mode:r.RequestMode.CORS,redirect:r.RedirectPolicy.FOLLOW,referrer:"about:client",referrerPolicy:r.ReferrerPolicy.STRICT_ORIGIN_WHEN_CROSS_ORIGIN,signal:void 0,timeout:3e4,global:!0,window:null});static#l=new Map([[h.ABORTED,new E(499,"Aborted")],[h.TIMEOUT,new E(504,"Gateway Timeout")]]);static abortSignal(){return new S}static register(e,t,s){return r.#i.subscribe(e,t,s)}static unregister(e){return r.#i.unsubscribe(e)}static abortAll(){for(let e of this.#c)e.abort(v);this.#c.clear()}get baseUrl(){return this.#e}register(e,t,s){return this.#r.subscribe(e,t,s)}unregister(e){this.#r.unsubscribe(e)}async get(e,t){return this.#s(e,t)}async post(e,t,s){return this.#o(e,{...s,body:t},{method:d.POST})}async put(e,t){return this.#o(e,t,{method:d.PUT})}async patch(e,t){return this.#o(e,t,{method:d.PATCH})}async delete(e,t){return this.#o(e,t,{method:d.DELETE})}async head(e,t){return this.#o(e,t,{method:d.HEAD})}async options(e,t){return(await this.#o(e,t,{method:d.OPTIONS})).headers.get("allow").split(",").map(a=>a.trim())}async request(e,t){return this.#o(e,t,{},s=>s)}async getJson(e,t){return this.#s(e,t,{headers:{[p.ACCEPT]:l.get(o.JSON).toString()}},K)}async getXml(e,t){return this.#s(e,t,{headers:{[p.ACCEPT]:l.get(o.XML).toString()}},re)}async getHtml(e,t){return this.#s(e,t,{headers:{[p.ACCEPT]:l.get(o.HTML).toString()}},se)}async getHtmlFragment(e,t){return this.#s(e,t,{headers:{[p.ACCEPT]:l.get(o.HTML).toString()}},De)}async getScript(e,t){return this.#s(e,t,{headers:{[p.ACCEPT]:l.get(o.JAVA_SCRIPT).toString()}},Z)}async getStylesheet(e,t){return this.#s(e,t,{headers:{[p.ACCEPT]:l.get(o.CSS).toString()}},Q)}async getBlob(e,t){return this.#s(e,t,{headers:{[p.ACCEPT]:o.BIN}},Me)}async getImage(e,t){return this.#s(e,t,{headers:{[p.ACCEPT]:"image/*"}},ee)}async getBuffer(e,t){return this.#s(e,t,{headers:{[p.ACCEPT]:o.BIN}},je)}async getStream(e,t){return this.#s(e,t,{headers:{[p.ACCEPT]:o.BIN}},te)}async#s(e,t,s,a){return this.#o(e,t,{...s,method:d.GET},a)}async#o(e,t={},s={},a){m(e)==Object&&([e,t]=[void 0,e]);try{s=this.#h(t,s)}catch(c){return Promise.reject(new C("Unable to process request options",{cause:c}))}this.#n({name:h.CONFIGURED,data:s,global:s.global});let n=r.#E(this.#e,e);m(s.signal)!=S&&(s.signal=new S(s.signal)),s.signal.addEventListener(y.ABORT,c=>this.#n({name:h.ABORTED,event:c,global:s.global})),s.signal.addEventListener(y.TIMEOUT,c=>this.#n({name:h.TIMEOUT,event:c,global:s.global})),r.#c.add(s.signal);let i,g;try{if(i=await fetch(n,new Proxy(s,{get:r.#T(s.timeout)})),!a&&i.status!=204&&i.headers.has(w.CONTENT_TYPE)&&(a=this.#O(i.headers.get(w.CONTENT_TYPE))),g=await a?.(i)??i,!i.ok)return Promise.reject(this.#u(n,{status:r.#p("ResponseError",i),entity:g}));this.#n({name:h.SUCCESS,data:g,global:s.global})}catch(c){return Promise.reject(this.#u(n,{cause:c,status:r.#p(c.name,i)}))}finally{s.signal.clearTimeout(),s.signal.aborted||(this.#n({name:h.COMPLETE,data:i,global:s.global}),r.#c.delete(s.signal),r.#c.size===0&&this.#n({name:h.ALL_COMPLETE,global:s.global}))}return g}static#m({body:e,headers:t,searchParams:s,...a},{headers:n,searchParams:i,...g}){return I(g,a,{body:[FormData,URLSearchParams,Object].includes(m(e))?new O(e):e,headers:r.#a(new Headers,t,n),searchParams:r.#a(new URLSearchParams,s,i)})}static#a(e,t={},s={}){for(let a of[t,s])for(let[n,i]of a.entries?.()??Object.entries(a))e.set(n,i);return e}#h({body:e,headers:t,searchParams:s,...a},{headers:n,searchParams:i,...g}){let c=I(this.#t,a,g,{headers:r.#a(new Headers(this.#t.headers),t,n),searchParams:r.#a(new URLSearchParams(this.#t.searchParams),s,i)});if(V.includes(c.method))if([O,FormData,URLSearchParams,Object].includes(m(e))){let F=c.headers.get(p.CONTENT_TYPE),H=(l.get(F)??u.parse(F))?.subtype;H==o.MULTIPART_FORM_DATA?c.body=r.#a(new FormData(c.body),e):H==o.FORM?c.body=r.#a(new URLSearchParams(c.body),e):H.includes("json")?c.body=JSON.stringify(r.#a(new O(c.body),e)):c.body=r.#a(new O(c.body),e)}else c.body=e;else c.headers.delete(p.CONTENT_TYPE),c.body?.isEmpty()||r.#a(c.searchParams,c.body),c.body=void 0;return c}static#T(e){return(t,s)=>{let a=Reflect.get(t,s);return s=="signal"&&!a.aborted?a.withTimeout(e):a}}static#g(e){switch(m(e)){case URL:return e;case String:return new URL(e,e.startsWith("/")?globalThis.location.origin:void 0);default:throw new TypeError("Invalid URL")}}static#E(e,t){return t?new URL(`${e.pathname.replace($,"")}${t}`,e.origin):new URL(e)}static#p(e,t){switch(e){case"AbortError":return r.#l.get(h.ABORTED);case"TimeoutError":return r.#l.get(h.TIMEOUT);default:return t?new E(t.status,t.statusText):new E(500,"Internal Server Error")}}#u(e,t){let s=new C(`An error has occurred with your request to: '${e}'`,t);return this.#n({name:h.ERROR,data:s}),s}#n({name:e,event:t=new CustomEvent(e),data:s,global:a=!0}={}){a&&r.#i.publish(e,t,s),this.#r.publish(e,t,s)}#O(e){let t,s=u.parse(e);if(s){for(let[a,n]of r.#d)if(n.has(s.type)||n.has(s.subtype)){t=a;break}}return t}get[Symbol.toStringTag](){return"Transportr"}};return le(Ue);})();
|
|
3
3
|
window.Transportr = Transportr.default;
|
|
4
4
|
//# sourceMappingURL=transportr.min.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/transportr.js", "../node_modules/@d1g1tal/collections/src/set-multi-map.js", "../node_modules/@d1g1tal/subscribr/node_modules/@d1g1tal/collections/src/set-multi-map.js", "../node_modules/@d1g1tal/subscribr/src/context-event-handler.js", "../node_modules/@d1g1tal/subscribr/src/subscription.js", "../node_modules/@d1g1tal/subscribr/src/subscribr.js", "../src/http-error.js", "../src/http-media-type.js", "../src/http-request-headers.js", "../src/http-request-methods.js", "../src/http-response-headers.js", "../src/response-status.js", "../src/parameter-map.js", "../node_modules/@d1g1tal/media-type/src/utils.js", "../node_modules/@d1g1tal/media-type/src/media-type-parameters.js", "../node_modules/@d1g1tal/media-type/src/parser.js", "../node_modules/@d1g1tal/media-type/src/serializer.js", "../node_modules/@d1g1tal/media-type/src/media-type.js", "../src/constants.js", "../src/abort-signal.js", "../node_modules/@d1g1tal/chrysalis/src/esm/object-type.js", "../node_modules/@d1g1tal/chrysalis/src/esm/object-merge.js"],
|
|
4
|
-
"sourcesContent": ["import SetMultiMap from '@d1g1tal/collections/set-multi-map.js';\nimport Subscribr from '@d1g1tal/subscribr';\nimport HttpError from './http-error.js';\nimport HttpMediaType from './http-media-type.js';\nimport HttpRequestHeader from './http-request-headers.js';\nimport HttpRequestMethod from './http-request-methods.js';\nimport HttpResponseHeader from './http-response-headers.js';\nimport ResponseStatus from './response-status.js';\nimport ParameterMap from './parameter-map.js';\nimport AbortSignal from './abort-signal.js';\nimport { MediaType } from '@d1g1tal/media-type';\nimport { _objectMerge, _objectIsEmpty, _type } from '@d1g1tal/chrysalis';\nimport { mediaTypes, endsWithSlashRegEx, RequestEvents, SignalEvents, abortEvent, requestBodyMethods } from './constants.js';\n\n/**\n * @template T extends ResponseBody\n * @typedef {function(Response): Promise<T>} ResponseHandler<T>\n */\n\n/**\n * @typedef {Object} ContextEventHandler\n * @property {*} context The context object.\n * @property {function(*): void} eventHandler The event handler.\n */\n\n/**\n * @typedef {Object} EventRegistration\n * @property {string} eventName The name of the event to subscribe to.\n * @property {ContextEventHandler} contextEventHandler The context event handler.\n */\n\n/** @typedef {Object.prototype.constructor} Type */\n/** @typedef {Object<string, (boolean|string|number|Array)>} JsonObject */\n/** @typedef {'configured'|'success'|'error'|'aborted'|'timeout'|'complete'} TransportrEvent */\n/** @typedef {Blob|ArrayBuffer|TypedArray|DataView|FormData|URLSearchParams|string|ReadableStream} RequestBody */\n/** @typedef {JsonObject|Document|DocumentFragment|Blob|ArrayBuffer|FormData|string|ReadableStream<Uint8Array>} ResponseBody */\n/** @typedef {'default'|'force-cache'|'no-cache'|'no-store'|'only-if-cached'|'reload'} RequestCache */\n/** @typedef {'include'|'omit'|'same-origin'} RequestCredentials */\n/** @typedef {Headers|Object<string, string>} RequestHeaders */\n/** @typedef {'GET'|'POST'|'PUT'|'PATCH'|'DELETE'|'HEAD'|'OPTIONS'} RequestMethod */\n/** @typedef {'cors'|'navigate'|'no-cors'|'same-origin'} RequestMode */\n/** @typedef {'error'|'follow'|'manual'} RequestRedirect */\n/** @typedef {URLSearchParams|FormData|Object<string, string>|string} SearchParameters */\n/** @typedef {''|'no-referrer'|'no-referrer-when-downgrade'|'origin'|'origin-when-cross-origin'|'same-origin'|'strict-origin'|'strict-origin-when-cross-origin'|'unsafe-url'} ReferrerPolicy */\n/** @typedef {Int8Array|Uint8Array|Uint8ClampedArray|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array|BigInt64Array|BigUint64Array} TypedArray */\n\n/**\n * The options for a {@link Request} object or the second parameter of a {@link fetch} request\n *\n * @typedef {Object} RequestOptions\n * @property {RequestBody} body A RequestInit object or null to set request's body.\n * @property {RequestCache} cache A string indicating how the request will interact with the browser's cache to set request's cache.\n * @property {RequestCredentials} credentials A string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL. Sets request's credentials.\n * @property {RequestHeaders} headers A Headers object, an object literal, or an array of two-item arrays to set request's headers.\n * @property {SearchParameters} searchParams The parameters to be added to the URL for the request.\n * @property {string} integrity A cryptographic hash of the resource to be fetched by request. Sets request's integrity.\n * @property {boolean} keepalive A boolean to set request's keepalive.\n * @property {RequestMethod} method A string to set request's method.\n * @property {RequestMode} mode A string to indicate whether the request will use CORS, or will be restricted to same-origin URLs. Sets request's mode.\n * @property {RequestRedirect} redirect A string indicating whether request follows redirects, results in an error upon encountering a redirect, or returns the redirect (in an opaque fashion). Sets request's redirect.\n * @property {string} referrer A string whose value is a same-origin URL, \"about:client\", or the empty string, to set request's referrer.\n * @property {ReferrerPolicy} referrerPolicy A referrer policy to set request's referrerPolicy.\n * @property {AbortSignal} signal An AbortSignal to set request's signal.\n * @property {number} timeout A number representing a timeout in milliseconds for request.\n * @property {boolean} global If true, it will trigger the global event handlers. Defaults to true.\n * @property {null} window Can only be null. Used to disassociate request from any Window.\n */\n\n/** @type {ResponseHandler<string>} */\nconst _handleText = async (response) => await response.text();\n\n/** @type {ResponseHandler<void>} */\nconst _handleScript = async (response) => {\n\tconst objectURL = URL.createObjectURL(await response.blob());\n\n\tdocument.head.removeChild(document.head.appendChild(Object.assign(document.createElement('script'), { src: objectURL, type: HttpMediaType.JAVA_SCRIPT, async: true })));\n\n\tURL.revokeObjectURL(objectURL);\n\n\treturn Promise.resolve();\n};\n\n/** @type {ResponseHandler<void>} */\nconst _handleCss = async (response) => {\n\tconst objectURL = URL.createObjectURL(await response.blob());\n\n\tdocument.head.appendChild(Object.assign(document.createElement('link'), { href: objectURL, type: HttpMediaType.CSS, rel: 'stylesheet' }));\n\n\tURL.revokeObjectURL(objectURL);\n\n\treturn Promise.resolve();\n};\n\n/** @type {ResponseHandler<JsonObject>} */\nconst _handleJson = async (response) => await response.json();\n\n/** @type {ResponseHandler<Blob>} */\nconst _handleBlob = async (response) => await response.blob();\n\n/** @type {ResponseHandler<string>} */\nconst _handleImage = async (response) => URL.createObjectURL(await response.blob());\n\n/** @type {ResponseHandler<ArrayBuffer>} */\nconst _handleBuffer = async (response) => await response.arrayBuffer();\n\n/** @type {ResponseHandler<ReadableStream<Uint8Array>>} */\nconst _handleReadableStream = async (response) => response.body;\n\n/** @type {ResponseHandler<Document>} */\nconst _handleXml = async (response) => new DOMParser().parseFromString(await response.text(), HttpMediaType.XML);\n\n/** @type {ResponseHandler<Document>} */\nconst _handleHtml = async (response) => new DOMParser().parseFromString(await response.text(), HttpMediaType.HTML);\n\n/** @type {ResponseHandler<DocumentFragment>} */\nconst _handleHtmlFragment = async (response) => document.createRange().createContextualFragment(await response.text());\n\n/**\n * A wrapper around the fetch API that makes it easier to make HTTP requests.\n *\n * @module {Transportr} transportr\n * @author D1g1talEntr0py <jason.dimeo@gmail.com>\n */\nexport default class Transportr {\n\t/** @type {URL} */\n\t#baseUrl;\n\t/** @type {RequestOptions} */\n\t#options;\n\t/** @type {Subscribr} */\n\t#subscribr;\n\t/** @type {Subscribr} */\n\tstatic #globalSubscribr = new Subscribr();\n\t/** @type {Set<AbortSignal>} */\n\tstatic #activeRequests = new Set();\n\t/** @type {SetMultiMap<ResponseHandler<ResponseBody>, string>} */\n\tstatic #contentTypeHandlers = new SetMultiMap([\n\t\t[_handleImage, mediaTypes.get(HttpMediaType.PNG).type],\n\t\t[_handleText, mediaTypes.get(HttpMediaType.TEXT).type],\n\t\t[_handleJson, mediaTypes.get(HttpMediaType.JSON).subtype],\n\t\t[_handleHtml, mediaTypes.get(HttpMediaType.HTML).subtype],\n\t\t[_handleScript, mediaTypes.get(HttpMediaType.JAVA_SCRIPT).subtype],\n\t\t[_handleCss, mediaTypes.get(HttpMediaType.CSS).subtype],\n\t\t[_handleXml, mediaTypes.get(HttpMediaType.XML).subtype],\n\t\t[_handleReadableStream, mediaTypes.get(HttpMediaType.BIN).subtype]\n\t]);\n\n\t/**\n\t * Create a new Transportr instance with the provided location or origin and context path.\n\t *\n\t * @param {URL|string|RequestOptions} [url=location.origin] The URL for {@link fetch} requests.\n\t * @param {RequestOptions} [options={}] The default {@link RequestOptions} for this instance.\n\t */\n\tconstructor(url = globalThis.location.origin, options = {}) {\n\t\tif (_type(url) == Object) { [ url, options ] = [ globalThis.location.origin, url ] }\n\n\t\tthis.#baseUrl = Transportr.#getBaseUrl(url);\n\t\tthis.#options = Transportr.#createOptions(options, Transportr.#defaultRequestOptions);\n\t\tthis.#subscribr = new Subscribr();\n\t}\n\n\t/**\n\t * @static\n\t * @constant {Object<string, HttpRequestMethod>}\n\t */\n\tstatic Method = Object.freeze(HttpRequestMethod);\n\n\t/**\n\t * @static\n\t * @constant {Object<string, HttpMediaType>}\n\t */\n\tstatic MediaType = Object.freeze(HttpMediaType);\n\n\t/**\n\t * @static\n\t * @see {@link HttpRequestHeader}\n\t * @constant {Object<string, HttpRequestHeader>}\n\t */\n\tstatic RequestHeader = Object.freeze(HttpRequestHeader);\n\n\t/**\n\t * @static\n\t * @constant {Object<string, HttpResponseHeader>}\n\t */\n\tstatic ResponseHeader = Object.freeze(HttpResponseHeader);\n\n\t/**\n\t * @static\n\t * @constant {Object<string, RequestCache>}\n\t */\n\tstatic CachingPolicy = Object.freeze({\n\t\tDEFAULT: 'default',\n\t\tFORCE_CACHE: 'force-cache',\n\t\tNO_CACHE: 'no-cache',\n\t\tNO_STORE: 'no-store',\n\t\tONLY_IF_CACHED: 'only-if-cached',\n\t\tRELOAD: 'reload'\n\t});\n\n\t/**\n\t * @static\n\t * @constant {Object<string, RequestCredentials>}\n\t */\n\tstatic CredentialsPolicy = Object.freeze({\n\t\tINCLUDE: 'include',\n\t\tOMIT: 'omit',\n\t\tSAME_ORIGIN: 'same-origin'\n\t});\n\n\t/**\n\t * @static\n\t * @constant {Object<string, RequestMode>}\n\t */\n\tstatic RequestMode = Object.freeze({\n\t\tCORS: 'cors',\n\t\tNAVIGATE: 'navigate',\n\t\tNO_CORS: 'no-cors',\n\t\tSAME_ORIGIN: 'same-origin'\n\t});\n\n\t/**\n\t * @static\n\t * @constant {Object<string, RequestRedirect>}\n\t */\n\tstatic RedirectPolicy = Object.freeze({\n\t\tERROR: 'error',\n\t\tFOLLOW: 'follow',\n\t\tMANUAL: 'manual'\n\t});\n\n\t/**\n\t * @static\n\t * @constant {Object<string, ReferrerPolicy>}\n\t */\n\tstatic ReferrerPolicy = Object.freeze({\n\t\tNO_REFERRER: 'no-referrer',\n\t\tNO_REFERRER_WHEN_DOWNGRADE: 'no-referrer-when-downgrade',\n\t\tORIGIN: 'origin',\n\t\tORIGIN_WHEN_CROSS_ORIGIN: 'origin-when-cross-origin',\n\t\tSAME_ORIGIN: 'same-origin',\n\t\tSTRICT_ORIGIN: 'strict-origin',\n\t\tSTRICT_ORIGIN_WHEN_CROSS_ORIGIN: 'strict-origin-when-cross-origin',\n\t\tUNSAFE_URL: 'unsafe-url'\n\t});\n\n\t/**\n\t * @static\n\t * @constant {Object<string, TransportrEvent>}\n\t */\n\tstatic RequestEvents = RequestEvents;\n\n\t/**\n\t * @private\n\t * @static\n\t * @type {RequestOptions}\n\t */\n\tstatic #defaultRequestOptions = Object.freeze({\n\t\tbody: null,\n\t\tcache: Transportr.CachingPolicy.NO_STORE,\n\t\tcredentials: Transportr.CredentialsPolicy.SAME_ORIGIN,\n\t\theaders: { [HttpRequestHeader.CONTENT_TYPE]: mediaTypes.get(HttpMediaType.JSON).toString(), [HttpRequestHeader.ACCEPT]: mediaTypes.get(HttpMediaType.JSON).toString() },\n\t\tsearchParams: {},\n\t\tintegrity: undefined,\n\t\tkeepalive: undefined,\n\t\tmethod: HttpRequestMethod.GET,\n\t\tmode: Transportr.RequestMode.CORS,\n\t\tredirect: Transportr.RedirectPolicy.FOLLOW,\n\t\treferrer: 'about:client',\n\t\treferrerPolicy: Transportr.ReferrerPolicy.STRICT_ORIGIN_WHEN_CROSS_ORIGIN,\n\t\tsignal: undefined,\n\t\ttimeout: 30000,\n\t\tglobal: true,\n\t\twindow: null\n\t});\n\n\t/**\n\t * @private\n\t * @static\n\t * @type {Map<TransportrEvent, ResponseStatus>}\n\t */\n\tstatic #eventResponseStatuses = new Map([\n\t\t[RequestEvents.ABORTED, new ResponseStatus(499, 'Aborted')],\n\t\t[RequestEvents.TIMEOUT, new ResponseStatus(504, 'Gateway Timeout')]\n\t]);\n\n\t/**\n\t * Returns a {@link AbortSignal} used for aborting requests.\n\t *\n\t * @static\n\t * @returns {AbortSignal} A new {@link AbortSignal} instance.\n\t */\n\tstatic abortSignal() {\n\t\treturn new AbortSignal();\n\t}\n\n\t/**\n\t * Returns a {@link EventRegistration} used for subscribing to global events.\n\t *\n\t * @static\n\t * @param {TransportrEvent} event The event to subscribe to.\n\t * @param {function(Event, *): void} handler The event handler.\n\t * @param {*} context The context to bind the handler to.\n\t * @returns {EventRegistration} A new {@link EventRegistration} instance.\n\t */\n\tstatic register(event, handler, context) {\n\t\treturn Transportr.#globalSubscribr.subscribe(event, handler, context);\n\t}\n\n\t/**\n\t * Removes a {@link EventRegistration} from the global event handler.\n\t *\n\t * @static\n\t * @param {EventRegistration} eventRegistration The {@link EventRegistration} to remove.\n\t * @returns {boolean} True if the {@link EventRegistration} was removed, false otherwise.\n\t */\n\tstatic unregister(eventRegistration) {\n\t\treturn Transportr.#globalSubscribr.unsubscribe(eventRegistration);\n\t}\n\n\t/**\n\t * Aborts all active requests.\n\t * This is useful for when the user navigates away from the current page.\n\t * This will also clear the {@link Transportr#activeRequests} set.\n\t *\n\t * @static\n\t * @returns {void}\n\t */\n\tstatic abortAll() {\n\t\tfor (const abortSignal of this.#activeRequests) {\n\t\t\tabortSignal.abort(abortEvent);\n\t\t}\n\n\t\t// Clear the array after aborting all requests\n\t\tthis.#activeRequests.clear();\n\t}\n\n\t/**\n\t * It returns the base {@link URL} for the API.\n\t *\n\t * @returns {URL} The baseUrl property.\n\t */\n\tget baseUrl() {\n\t\treturn this.#baseUrl;\n\t}\n\n\t/**\n\t * Registers an event handler with a {@link Transportr} instance.\n\t *\n\t * @param {TransportrEvent} event The name of the event to listen for.\n\t * @param {function(Event, *): void} handler The function to call when the event is triggered.\n\t * @param {*} [context] The context to bind to the handler.\n\t * @returns {EventRegistration} An object that can be used to remove the event handler.\n\t */\n\tregister(event, handler, context) {\n\t\treturn this.#subscribr.subscribe(event, handler, context);\n\t}\n\n\t/**\n\t * Unregisters an event handler from a {@link Transportr} instance.\n\t *\n\t * @param {EventRegistration} eventRegistration The event registration to remove.\n\t * @returns {void}\n\t */\n\tunregister(eventRegistration) {\n\t\tthis.#subscribr.unsubscribe(eventRegistration);\n\t}\n\n\t/**\n\t * This function returns a promise that resolves to the result of a request to the specified path with\n\t * the specified options, where the method is GET.\n\t *\n\t * @async\n\t * @param {string} [path] The path to the resource you want to get.\n\t * @param {RequestOptions} [options] The options for the request.\n\t * @returns {Promise<ResponseBody>} A promise that resolves to the response of the request.\n\t */\n\tasync get(path, options) {\n\t\treturn this.#get(path, options);\n\t}\n\n\t/**\n\t * This function makes a POST request to the given path with the given body and options.\n\t *\n\t * @async\n\t * @param {string} [path] The path to the endpoint you want to call.\n\t * @param {RequestBody} body The body of the request.\n\t * @param {RequestOptions} [options] The options for the request.\n\t * @returns {Promise<ResponseBody>} A promise that resolves to the response body.\n\t */\n\tasync post(path, body, options) {\n\t\treturn this.#request(path, { ...options, body }, { method: HttpRequestMethod.POST });\n\t}\n\n\t/**\n\t * This function returns a promise that resolves to the result of a request to the specified path with\n\t * the specified options, where the method is PUT.\n\t *\n\t * @async\n\t * @param {string} [path] The path to the endpoint you want to call.\n\t * @param {RequestOptions} [options] The options for the request.\n\t * @returns {Promise<ResponseBody>} The return value of the #request method.\n\t */\n\tasync put(path, options) {\n\t\treturn this.#request(path, options, { method: HttpRequestMethod.PUT });\n\t}\n\n\t/**\n\t * It takes a path and options, and returns a request with the method set to PATCH.\n\t *\n\t * @async\n\t * @param {string} [path] The path to the endpoint you want to hit.\n\t * @param {RequestOptions} [options] The options for the request.\n\t * @returns {Promise<ResponseBody>} A promise that resolves to the response of the request.\n\t */\n\tasync patch(path, options) {\n\t\treturn this.#request(path, options, { method: HttpRequestMethod.PATCH });\n\t}\n\n\t/**\n\t * It takes a path and options, and returns a request with the method set to DELETE.\n\t *\n\t * @async\n\t * @param {string} [path] The path to the resource you want to access.\n\t * @param {RequestOptions} [options] The options for the request.\n\t * @returns {Promise<ResponseBody>} The result of the request.\n\t */\n\tasync delete(path, options) {\n\t\treturn this.#request(path, options, { method: HttpRequestMethod.DELETE });\n\t}\n\n\t/**\n\t * Returns the response headers of a request to the given path.\n\t *\n\t * @async\n\t * @param {string} [path] The path to the resource you want to access.\n\t * @param {RequestOptions} [options] The options for the request.\n\t * @returns {Promise<ResponseBody>} A promise that resolves to the response object.\n\t */\n\tasync head(path, options) {\n\t\treturn this.#request(path, options, { method: HttpRequestMethod.HEAD });\n\t}\n\n\t/**\n\t * It returns a promise that resolves to the allowed request methods for the given resource path.\n\t *\n\t * @async\n\t * @param {string} [path] The path to the resource.\n\t * @param {RequestOptions} [options] The options for the request.\n\t * @returns {Promise<string[]>} A promise that resolves to an array of allowed request methods for this resource.\n\t */\n\tasync options(path, options) {\n\t\tconst response = await this.#request(path, options, { method: HttpRequestMethod.OPTIONS });\n\n\t\treturn response.headers.get('allow').split(',').map((method) => method.trim());\n\t}\n\n\t/**\n\t * It takes a path and options, and makes a request to the server.\n\t *\n\t * @async\n\t * @param {string} [path] The path to the endpoint you want to hit.\n\t * @param {RequestOptions} [userOptions] The options for the request.\n\t * @returns {Promise<ResponseBody>} The return value of the function is the return value of the function that is passed to the `then` method of the promise returned by the `fetch` method.\n\t */\n\tasync request(path, userOptions) {\n\t\treturn this.#request(path, userOptions, {}, (response) => response);\n\t}\n\n\t/**\n\t * It gets a JSON resource from the server.\n\t *\n\t * @async\n\t * @param {string} [path] The path to the resource.\n\t * @param {RequestOptions} [options] The options object to pass to the request.\n\t * @returns {Promise<JsonObject>} A promise that resolves to the response body as a JSON object.\n\t */\n\tasync getJson(path, options) {\n\t\treturn this.#get(path, options, { headers: { [HttpRequestHeader.ACCEPT]: mediaTypes.get(HttpMediaType.JSON).toString() } }, _handleJson);\n\t}\n\n\t/**\n\t * It gets the XML representation of the resource at the given path.\n\t *\n\t * @async\n\t * @param {string} [path] The path to the resource you want to get.\n\t * @param {RequestOptions} [options] The options for the request.\n\t * @returns {Promise<Document>} The result of the function call to #get.\n\t */\n\tasync getXml(path, options) {\n\t\treturn this.#get(path, options, { headers: { [HttpRequestHeader.ACCEPT]: mediaTypes.get(HttpMediaType.XML).toString() } }, _handleXml);\n\t}\n\n\t/**\n\t * Get the HTML content of the specified path.\n\t *\n\t * @todo Add way to return portion of the retrieved HTML using a selector. Like jQuery.\n\t * @async\n\t * @param {string} [path] The path to the resource.\n\t * @param {RequestOptions} [options] The options for the request.\n\t * @returns {Promise<Document>} The return value of the function is the return value of the function passed to the `then`\n\t * method of the promise returned by the `#get` method.\n\t */\n\tasync getHtml(path, options) {\n\t\treturn this.#get(path, options, { headers: { [HttpRequestHeader.ACCEPT]: mediaTypes.get(HttpMediaType.HTML).toString() } }, _handleHtml);\n\t}\n\n\t/**\n\t * It returns a promise that resolves to the HTML fragment at the given path.\n\t *\n\t * @todo Add way to return portion of the retrieved HTML using a selector. Like jQuery.\n\t * @async\n\t * @param {string} [path] The path to the resource.\n\t * @param {RequestOptions} [options] The options for the request.\n\t * @returns {Promise<DocumentFragment>} A promise that resolves to an HTML fragment.\n\t */\n\tasync getHtmlFragment(path, options) {\n\t\treturn this.#get(path, options, { headers: { [HttpRequestHeader.ACCEPT]: mediaTypes.get(HttpMediaType.HTML).toString() } }, _handleHtmlFragment);\n\t}\n\n\t/**\n\t * It gets a script from the server, and appends the script to the {@link Document} {@link HTMLHeadElement}\n\t * CORS is enabled by default.\n\t *\n\t * @async\n\t * @param {string} [path] The path to the script.\n\t * @param {RequestOptions} [options] The options for the request.\n\t * @returns {Promise<void>} A promise that has been resolved.\n\t */\n\tasync getScript(path, options) {\n\t\treturn this.#get(path, options, { headers: { [HttpRequestHeader.ACCEPT]: mediaTypes.get(HttpMediaType.JAVA_SCRIPT).toString() } }, _handleScript);\n\t}\n\n\t/**\n\t * Gets a stylesheet from the server, and adds it as a {@link Blob} {@link URL}.\n\t *\n\t * @async\n\t * @param {string} [path] The path to the stylesheet.\n\t * @param {RequestOptions} [options] The options for the request.\n\t * @returns {Promise<void>} A promise that has been resolved.\n\t */\n\tasync getStylesheet(path, options) {\n\t\treturn this.#get(path, options, { headers: { [HttpRequestHeader.ACCEPT]: mediaTypes.get(HttpMediaType.CSS).toString() } }, _handleCss);\n\t}\n\n\t/**\n\t * It returns a blob from the specified path.\n\t *\n\t * @async\n\t * @param {string} [path] The path to the resource.\n\t * @param {RequestOptions} [options] The options for the request.\n\t * @returns {Promise<Blob>} A promise that resolves to a blob.\n\t */\n\tasync getBlob(path, options) {\n\t\treturn this.#get(path, options, { headers: { [HttpRequestHeader.ACCEPT]: HttpMediaType.BIN } }, _handleBlob);\n\t}\n\n\t/**\n\t * It returns a promise that resolves to an object URL.\n\t *\n\t * @async\n\t * @param {string|RequestOptions} [path] The path to the resource.\n\t * @param {RequestOptions} [options] The options for the request.\n\t * @returns {Promise<string>} A promise that resolves to an object URL.\n\t */\n\tasync getImage(path, options) {\n\t\treturn this.#get(path, options, { headers: { [HttpRequestHeader.ACCEPT]: 'image/*' } }, _handleImage);\n\t}\n\n\t/**\n\t * It gets a buffer from the specified path\n\t *\n\t * @async\n\t * @param {string} [path] The path to the resource.\n\t * @param {RequestOptions} [options] The options for the request.\n\t * @returns {Promise<ArrayBuffer>} A promise that resolves to a buffer.\n\t */\n\tasync getBuffer(path, options) {\n\t\treturn this.#get(path, options, { headers: { [HttpRequestHeader.ACCEPT]: HttpMediaType.BIN } }, _handleBuffer);\n\t}\n\n\t/**\n\t * It returns a readable stream of the response body from the specified path.\n\t *\n\t * @async\n\t * @param {string} [path] The path to the resource.\n\t * @param {RequestOptions} [options] The options for the request.\n\t * @returns {Promise<ReadableStream<Uint8Array>>} A readable stream.\n\t */\n\tasync getStream(path, options) {\n\t\treturn this.#get(path, options, { headers: { [HttpRequestHeader.ACCEPT]: HttpMediaType.BIN } }, _handleReadableStream);\n\t}\n\n\t/**\n\t * Makes a GET request to the given path, using the given options, and then calls the\n\t * given response handler with the response.\n\t *\n\t * @private\n\t * @async\n\t * @param {string} [path] The path to the endpoint you want to call.\n\t * @param {RequestOptions} [userOptions] The options passed to the public function to use for the request.\n\t * @param {RequestOptions} [options] The options for the request.\n\t * @param {ResponseHandler<ResponseBody>} [responseHandler] A function that will be called with the response object.\n\t * @returns {Promise<ResponseBody>} The result of the #request method.\n\t */\n\tasync #get(path, userOptions, options, responseHandler) {\n\t\treturn this.#request(path, userOptions, { ...options, method: HttpRequestMethod.GET }, responseHandler);\n\t}\n\n\t/**\n\t * It takes a path, options, and a response handler, and returns a promise that resolves to the\n\t * response entity.\n\t *\n\t * @private\n\t * @async\n\t * @param {string} [path] The path to the resource you want to access.\n\t * @param {RequestOptions} [userOptions={}] The options passed to the public function to use for the request.\n\t * @param {RequestOptions} [options={}] The options to use for the request.\n\t * @param {ResponseHandler<ResponseBody>} [responseHandler] A function that will be called with the response body as a parameter. This\n\t * is useful if you want to do something with the response body before returning it.\n\t * @returns {Promise<ResponseBody>} The response from the API call.\n\t */\n\tasync #request(path, userOptions = {}, options = {}, responseHandler) {\n\t\tif (_type(path) == Object) { [ path, userOptions ] = [ undefined, path ] }\n\n\t\ttry {\n\t\t\toptions = this.#processRequestOptions(userOptions, options);\n\t\t} catch (cause) {\n\t\t\treturn Promise.reject(new HttpError('Unable to process request options', { cause }));\n\t\t}\n\n\t\tthis.#publish({ name: RequestEvents.CONFIGURED, data: options, global: options.global });\n\n\t\tconst url = Transportr.#createUrl(this.#baseUrl, path);\n\t\tif (_type(options.signal) != AbortSignal) { options.signal = new AbortSignal(options.signal) }\n\t\toptions.signal.addEventListener(SignalEvents.ABORT, (event) => this.#publish({ name: RequestEvents.ABORTED, event, global: options.global }));\n\t\toptions.signal.addEventListener(SignalEvents.TIMEOUT, (event) => this.#publish({ name: RequestEvents.TIMEOUT, event, global: options.global }));\n\n\t\tTransportr.#activeRequests.add(options.signal);\n\n\t\tlet response, result;\n\t\ttry {\n\t\t\t// Proxy the options and trap for the signal to be accessed to start the timeout timer\n\t\t\tresponse = await fetch(url, new Proxy(options, { get: Transportr.#requestOptionsProxyHandler(options.timeout) }));\n\n\t\t\tif (!responseHandler && response.status != 204 && response.headers.has(HttpResponseHeader.CONTENT_TYPE)) {\n\t\t\t\tresponseHandler = this.#getResponseHandler(response.headers.get(HttpResponseHeader.CONTENT_TYPE));\n\t\t\t}\n\n\t\t\tresult = await responseHandler?.(response) ?? response;\n\n\t\t\tif (!response.ok) {\n\t\t\t\treturn Promise.reject(this.#handleError(url, { status: Transportr.#generateResponseStatusFromError('ResponseError', response), entity: result }));\n\t\t\t}\n\t\t\tthis.#publish({ name: RequestEvents.SUCCESS, data: result, global: options.global });\n\t\t} catch (error) {\n\t\t\treturn Promise.reject(this.#handleError(url, { cause: error, status: Transportr.#generateResponseStatusFromError(error.name, response) }));\n\t\t} finally {\n\t\t\toptions.signal.clearTimeout();\n\t\t\tif (!options.signal.aborted) {\n\t\t\t\tthis.#publish({ name: RequestEvents.COMPLETE, data: response, global: options.global });\n\n\t\t\t\tTransportr.#activeRequests.delete(options.signal);\n\n\t\t\t\tif (Transportr.#activeRequests.size === 0) {\n\t\t\t\t\tthis.#publish({ name: RequestEvents.ALL_COMPLETE, global: options.global });\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Creates the options for a {@link Transportr} instance.\n\t *\n\t * @private\n\t * @static\n\t * @param {RequestOptions} userOptions The {@link RequestOptions} to convert.\n\t * @param {RequestOptions} options The default {@link RequestOptions}.\n\t * @returns {RequestOptions} The converted {@link RequestOptions}.\n\t */\n\tstatic #createOptions({ body, headers: userHeaders, searchParams: userSearchParams, ...userOptions }, { headers, searchParams, ...options }) {\n\t\treturn _objectMerge(options, userOptions, {\n\t\t\tbody: [FormData, URLSearchParams, Object].includes(_type(body)) ? new ParameterMap(body) : body,\n\t\t\theaders: Transportr.#mergeOptions(new Headers(), userHeaders, headers),\n\t\t\tsearchParams: Transportr.#mergeOptions(new URLSearchParams(), userSearchParams, searchParams)\n\t\t});\n\t}\n\n\t/**\n\t * Merge the user options and request options into the target.\n\t *\n\t * @private\n\t * @static\n\t * @param {Headers|URLSearchParams|FormData} target The target to merge the options into.\n\t * @param {Headers|URLSearchParams|FormData|Object} userOption The user options to merge into the target.\n\t * @param {Headers|URLSearchParams|FormData|Object} requestOption The request options to merge into the target.\n\t * @returns {Headers|URLSearchParams} The target.\n\t */\n\tstatic #mergeOptions(target, userOption = {}, requestOption = {}) {\n\t\tfor (const option of [userOption, requestOption]) {\n\t\t\tfor (const [name, value] of option.entries?.() ?? Object.entries(option)) {\ttarget.set(name, value) }\n\t\t}\n\n\t\treturn target;\n\t}\n\n\t/**\n\t * Merges the user options and request options with the instance options into a new object that is used for the request.\n\t *\n\t * @private\n\t * @param {RequestOptions} userOptions The user options to merge into the request options.\n\t * @param {RequestOptions} options The request options to merge into the user options.\n\t * @returns {RequestOptions} The merged options.\n\t */\n\t#processRequestOptions({ body: userBody, headers: userHeaders, searchParams: userSearchParams, ...userOptions }, { headers, searchParams, ...options }) {\n\t\tconst requestOptions = _objectMerge(this.#options, userOptions, options, {\n\t\t\theaders: Transportr.#mergeOptions(new Headers(this.#options.headers), userHeaders, headers),\n\t\t\tsearchParams: Transportr.#mergeOptions(new URLSearchParams(this.#options.searchParams), userSearchParams, searchParams)\n\t\t});\n\n\t\tif (requestBodyMethods.includes(requestOptions.method)) {\n\t\t\tif ([ParameterMap, FormData, URLSearchParams, Object].includes(_type(userBody))) {\n\t\t\t\tconst contentType = requestOptions.headers.get(HttpRequestHeader.CONTENT_TYPE);\n\t\t\t\tconst mediaType = (mediaTypes.get(contentType) ?? MediaType.parse(contentType))?.subtype;\n\t\t\t\tif (mediaType == HttpMediaType.MULTIPART_FORM_DATA) {\n\t\t\t\t\trequestOptions.body = Transportr.#mergeOptions(new FormData(requestOptions.body), userBody);\n\t\t\t\t} else if (mediaType == HttpMediaType.FORM) {\n\t\t\t\t\trequestOptions.body = Transportr.#mergeOptions(new URLSearchParams(requestOptions.body), userBody);\n\t\t\t\t} else if (mediaType.includes('json')) {\n\t\t\t\t\trequestOptions.body = JSON.stringify(Transportr.#mergeOptions(new ParameterMap(requestOptions.body), userBody));\n\t\t\t\t} else {\n\t\t\t\t\trequestOptions.body = Transportr.#mergeOptions(new ParameterMap(requestOptions.body), userBody);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\trequestOptions.body = userBody;\n\t\t\t}\n\t\t} else {\n\t\t\trequestOptions.headers.delete(HttpRequestHeader.CONTENT_TYPE);\n\t\t\tif (!requestOptions.body?.isEmpty()) {\n\t\t\t\tTransportr.#mergeOptions(requestOptions.searchParams, requestOptions.body);\n\t\t\t}\n\t\t\trequestOptions.body = undefined;\n\t\t}\n\n\t\treturn requestOptions;\n\t}\n\n\t/**\n\t * Returns a Proxy of the options object that traps for 'signal' access.\n\t * If the signal has not been aborted, then it will return a new signal with a timeout.\n\t *\n\t * @private\n\t * @static\n\t * @param {number} timeout The timeout in milliseconds before the signal is aborted.\n\t * @returns {Proxy<RequestOptions>} A proxy for the options object.\n\t */\n\tstatic #requestOptionsProxyHandler(timeout) {\n\t\treturn (target, property) => {\n\t\t\tconst value = Reflect.get(target, property);\n\t\t\treturn property == 'signal' && !value.aborted ? value.withTimeout(timeout) : value;\n\t\t};\n\t}\n\n\t/**\n\t * It takes a url or a string, and returns a {@link URL} instance.\n\t * If the url is a string and starts with a slash, then the origin of the current page is used as the base url.\n\t *\n\t * @private\n\t * @static\n\t * @param {URL|string} url The URL to convert to a {@link URL} instance.\n\t * @returns {URL} A {@link URL} instance.\n\t * @throws {TypeError} If the url is not a string or {@link URL} instance.\n\t */\n\tstatic #getBaseUrl(url) {\n\t\tswitch (_type(url)) {\n\t\t\tcase URL: return url;\n\t\t\tcase String: return new URL(url, url.startsWith('/') ? globalThis.location.origin : undefined);\n\t\t\tdefault: throw new TypeError('Invalid URL');\n\t\t}\n\t}\n\n\t/**\n\t * It takes a URL, a path, and a set of search parameters, and returns a new URL with the path and\n\t * search parameters applied.\n\t *\n\t * @private\n\t * @static\n\t * @param {URL} url The URL to use as a base.\n\t * @param {string} [path] The optional, relative path to the resource. This MUST be a relative path, otherwise, you should create a new {@link Transportr} instance.\n\t * @returns {URL} A new URL object with the pathname and origin of the url parameter, and the path parameter\n\t * appended to the end of the pathname.\n\t */\n\tstatic #createUrl(url, path) {\n\t\treturn path ? new URL(`${url.pathname.replace(endsWithSlashRegEx, '')}${path}`, url.origin) : new URL(url);\n\t}\n\n\t/**\n\t * Generates a ResponseStatus object based on the error name and the response.\n\t *\n\t * @private\n\t * @static\n\t * @param {string} errorName The name of the error.\n\t * @param {Response} response The response object returned by the fetch API.\n\t * @returns {ResponseStatus} The response status object.\n\t */\n\tstatic #generateResponseStatusFromError(errorName, response) {\n\t\tswitch (errorName) {\n\t\t\tcase 'AbortError': return Transportr.#eventResponseStatuses.get(RequestEvents.ABORTED);\n\t\t\tcase 'TimeoutError': return Transportr.#eventResponseStatuses.get(RequestEvents.TIMEOUT);\n\t\t\tdefault: return response ? new ResponseStatus(response.status, response.statusText) : new ResponseStatus(500, 'Internal Server Error');\n\t\t}\n\t}\n\n\t/**\n\t * Handles an error by logging it and throwing it.\n\t *\n\t * @private\n\t * @param {URL} url The path to the resource you want to access.\n\t * @param {import('./http-error.js').HttpErrorOptions} options The options for the HttpError.\n\t * @returns {HttpError} The HttpError.\n\t */\n\t#handleError(url, options) {\n\t\tconst error = new HttpError(`An error has occurred with your request to: '${url}'`, options);\n\t\tthis.#publish({ name: RequestEvents.ERROR, data: error });\n\n\t\treturn error;\n\t}\n\n\t/**\n\t * Publishes an event to the global and instance subscribers.\n\t *\n\t * @private\n\t * @param {Object} options The options for the event.\n\t * @param {string} options.name The name of the event.\n\t * @param {Event} [options.event] The event object.\n\t * @param {*} [options.data] The data to pass to the subscribers.\n\t * @param {boolean} [options.global=true] Whether or not to publish the event to the global subscribers.\n\t * @returns {void}\n\t */\n\t#publish({ name, event = new CustomEvent(name), data, global = true } = {}) {\n\t\tif (global) {\tTransportr.#globalSubscribr.publish(name, event, data) }\n\t\tthis.#subscribr.publish(name, event, data);\n\t}\n\n\t/**\n\t * Returns a response handler for the given content type.\n\t *\n\t * @private\n\t * @param {string} contentType The content type of the response.\n\t * @returns {ResponseHandler<ResponseBody>} The response handler.\n\t */\n\t#getResponseHandler(contentType) {\n\t\tlet handler;\n\t\tconst mediaType = MediaType.parse(contentType);\n\n\t\tif (mediaType) {\n\t\t\tfor (const [responseHandler, contentTypes] of Transportr.#contentTypeHandlers) {\n\t\t\t\tif (contentTypes.has(mediaType.type) || contentTypes.has(mediaType.subtype)) {\n\t\t\t\t\thandler = responseHandler;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn handler;\n\t}\n\n\t/**\n\t * A String value that is used in the creation of the default string\n\t * description of an object. Called by the built-in method {@link Object.prototype.toString}.\n\t *\n\t * @returns {string} The default string description of this object.\n\t */\n\tget [Symbol.toStringTag]() {\n\t\treturn 'Transportr';\n\t}\n}", "/**\n * @template K\n * @template V\n * @typedef {Map<K, Set<V>>} SetMultiMap\n * @extends Map\n */\n\n/**\n * A {@link Map} that can contain multiple, unique, values for the same key.\n *\n * @template K\n * @template V\n * @type {SetMultiMap<K, V>}\n */\nclass SetMultiMap extends Map {\n\t/**\n\t * Adds a new element with a specified key and value to the SetMultiMap.\n\t * If an element with the same key already exists, the value will be added to the underlying {@link Set}.\n\t * If the value already exists in the {@link Set}, it will not be added again.\n\t *\n\t * @param {K} key The key to set.\n\t * @param {V} value The value to add to the SetMultiMap\n\t * @returns {SetMultiMap<K, V>} The SetMultiMap with the updated key and value.\n\t */\n\tset(key, value) {\n\t\tsuper.set(key, (super.get(key) ?? new Set()).add(value));\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Checks if a specific key has a specific value.\n\t *\n\t * @param {K} key The key to check.\n\t * @param {V} value The value to check.\n\t * @returns {boolean} True if the key has the value, false otherwise.\n\t */\n\thasValue(key, value) {\n\t\tconst values = super.get(key);\n\n\t\treturn values ? values.has(value) : false;\n\t}\n\n\t/**\n\t * Removes a specific value from a specific key.\n\t *\n\t * @param {K} key The key to remove the value from.\n\t * @param {V} value The value to remove.\n\t * @returns {boolean} True if the value was removed, false otherwise.\n\t */\n\tdeleteValue(key, value) {\n\t\tconst values = super.get(key);\n\t\tif (values) { return values.delete(value) }\n\n\t\treturn false;\n\t}\n\n\tget [Symbol.toStringTag]() {\n\t\treturn 'SetMultiMap';\n\t}\n}\n\nexport default SetMultiMap;", "/**\n *\n * @typedef {Map<*, *>} SetMultiMap\n * @extends Map\n */\nexport default class SetMultiMap extends Map {\n\t/**\n\t * Adds a new element with a specified key and value to the SetMultiMap. If an element with the same key already exists, the value will be added to the underlying {@link Set}.\n\t *\n\t * @param {*} key The key to set.\n\t * @param {*} value The value to add to the SetMultiMap\n\t * @returns {SetMultiMap} The SetMultiMap with the updated key and value.\n\t */\n\tset(key, value) {\n\t\tsuper.set(key, (super.get(key) ?? new Set()).add(value));\n\n\t\treturn this;\n\t}\n\n\t[Symbol.toStringTag]() {\n\t\treturn 'SetMultiMap';\n\t}\n}", "export default class ContextEventHandler {\n\t#context;\n\t#eventHandler;\n\n\t/**\n\t * @param {*} context The context to bind to the event handler.\n\t * @param {function(*): void} eventHandler The event handler to call when the event is published.\n\t */\n\tconstructor(context, eventHandler) {\n\t\tthis.#context = context;\n\t\tthis.#eventHandler = eventHandler;\n\t}\n\n\t/**\n\t * Call the event handler for the provided event.\n\t *\n\t * @param {Event} event The event to handle\n\t * @param {*} [data] The value to be passed to the event handler as a parameter.\n\t */\n\thandle(event, data) {\n\t\tthis.#eventHandler.call(this.#context, event, data);\n\t}\n\n\tget [Symbol.toStringTag]() {\n\t\treturn 'ContextEventHandler';\n\t}\n}", "/** @typedef { import('./context-event-handler.js').default } ContextEventHandler */\n\nexport default class Subscription {\n\t#eventName;\n\t#contextEventHandler;\n\n\t/**\n\t * @param {string} eventName The event name.\n\t * @param {ContextEventHandler} contextEventHandler Then context event handler.\n\t */\n\tconstructor(eventName, contextEventHandler) {\n\t\tthis.#eventName = eventName;\n\t\tthis.#contextEventHandler = contextEventHandler;\n\t}\n\n\t/**\n\t * Gets the event name for the subscription.\n\t *\n\t * @returns {string} The event name.\n\t */\n\tget eventName() {\n\t\treturn this.#eventName;\n\t}\n\n\t/**\n\t * Gets the context event handler.\n\t *\n\t * @returns {ContextEventHandler} The context event handler\n\t */\n\tget contextEventHandler() {\n\t\treturn this.#contextEventHandler;\n\t}\n\n\tget [Symbol.toStringTag]() {\n\t\treturn 'Subscription';\n\t}\n}", "import SetMultiMap from '@d1g1tal/collections/set-multi-map.js';\nimport ContextEventHandler from './context-event-handler.js';\nimport Subscription from './subscription.js';\n\nexport default class Subscribr {\n\t/** @type {SetMultiMap<string, ContextEventHandler>} */\n\t#subscribers;\n\n\tconstructor() {\n\t\tthis.#subscribers = new SetMultiMap();\n\t}\n\n\t/**\n\t * Subscribe to an event\n\t *\n\t * @param {string} eventName The event name to subscribe to.\n\t * @param {function(Event, *): void} eventHandler The event handler to call when the event is published.\n\t * @param {*} [context] The context to bind to the event handler.\n\t * @returns {Subscription} An object used to check if the subscription still exists and to unsubscribe from the event.\n\t */\n\tsubscribe(eventName, eventHandler, context = eventHandler) {\n\t\tconst contextEventHandler = new ContextEventHandler(context, eventHandler);\n\t\tthis.#subscribers.set(eventName, contextEventHandler);\n\n\t\treturn new Subscription(eventName, contextEventHandler);\n\t}\n\n\t/**\n\t * Unsubscribe from the event\n\t *\n\t * @param {Subscription} subscription The subscription to unsubscribe.\n\t * @param {string} subscription.eventName The event name to subscribe to.\n\t * @param {ContextEventHandler} subscription.contextEventHandler The event handler to call when the event is published.\n\t * @returns {boolean} true if eventListener has been removed successfully. false if the value is not found or if the value is not an object.\n\t */\n\tunsubscribe({ eventName, contextEventHandler }) {\n\t\tconst contextEventHandlers = this.#subscribers.get(eventName);\n\t\tconst removed = contextEventHandlers?.delete(contextEventHandler);\n\n\t\tif (removed && contextEventHandlers.size == 0) {\n\t\t\tthis.#subscribers.delete(eventName);\n\t\t}\n\n\t\treturn removed;\n\t}\n\n\t/**\n\t * Publish an event\n\t *\n\t * @param {string} eventName The name of the event.\n\t * @param {Event} event The event to be handled.\n\t * @param {*} [data] The value to be passed to the event handler as a parameter.\n\t */\n\tpublish(eventName, event = new CustomEvent(eventName), data) {\n\t\tif (data == null && !(event instanceof Event)) {\n\t\t\t// Swap the event and data parameters because only data was passed without an event object\n\t\t\t[data, event] = [event, new CustomEvent(eventName)];\n\t\t}\n\t\tthis.#subscribers.get(eventName)?.forEach((contextEventHandler) => contextEventHandler.handle(event, data));\n\t}\n\n\t/**\n\t * Check if the event and handler are subscribed.\n\t *\n\t * @param {Subscription} subscription The subscription object.\n\t * @param {string} subscription.eventName The name of the event to check.\n\t * @param {ContextEventHandler} subscription.contextEventHandler The event handler to check.\n\t * @returns {boolean} true if the event name and handler are subscribed, false otherwise.\n\t */\n\tisSubscribed({ eventName, contextEventHandler }) {\n\t\treturn this.#subscribers.get(eventName)?.has(contextEventHandler);\n\t}\n\n\tget [Symbol.toStringTag]() {\n\t\treturn 'Subscribr';\n\t}\n}", "/** @typedef {import('./transportr.js').ResponseBody} ResponseBody */\n/** @typedef {import('./response-status.js').default} ResponseStatus */\n\n/**\n * @typedef {Object} HttpErrorOptions\n * @property {any} cause The cause of the error.\n * @property {ResponseStatus} status The response status.\n * @property {ResponseBody} entity The error entity from the server, if any.\n */\n\n/**\n * @module HttpError\n * @extends Error\n * @author D1g1talEntr0py <jason.dimeo@gmail.com>\n */\nexport default class HttpError extends Error {\n\t/** @type {ResponseBody} */\n\t#entity;\n\t/** @type {ResponseStatus} */\n\t#responseStatus;\n\n\t/**\n\t * @param {string} [message] The error message.\n\t * @param {HttpErrorOptions} [httpErrorOptions] The http error options.\n\t * @param {any} [httpErrorOptions.cause] The cause of the error.\n\t * @param {ResponseStatus} [httpErrorOptions.status] The response status.\n\t * @param {ResponseBody} [httpErrorOptions.entity] The error entity from the server, if any.\n\t */\n\tconstructor(message, { cause, status, entity }) {\n\t\tsuper(message, { cause });\n\t\tthis.#entity = entity;\n\t\tthis.#responseStatus = status;\n\t}\n\n\t/**\n\t * It returns the value of the private variable #entity.\n\t *\n\t * @returns {ResponseBody} The entity property of the class.\n\t */\n\tget entity() {\n\t\treturn this.#entity;\n\t}\n\n\t/**\n\t * It returns the status code of the {@link Response}.\n\t *\n\t * @returns {number} The status code of the {@link Response}.\n\t */\n\tget statusCode() {\n\t\treturn this.#responseStatus?.code;\n\t}\n\n\t/**\n\t * It returns the status text of the {@link Response}.\n\t *\n\t * @returns {string} The status code and status text of the {@link Response}.\n\t */\n\tget statusText() {\n\t\treturn this.#responseStatus?.text;\n\t}\n\n\tget name() {\n\t\treturn 'HttpError';\n\t}\n\n\t/**\n\t * A String value that is used in the creation of the default string\n\t * description of an object. Called by the built-in method {@link Object.prototype.toString}.\n\t *\n\t * @returns {string} The default string description of this object.\n\t */\n\tget [Symbol.toStringTag]() {\n\t\treturn 'HttpError';\n\t}\n}", "/**\n * A constant object that contains all the media types that are supported by the browser.\n *\n * @module HttpMediaType\n * @constant {Object<string, string>}\n */\nconst HttpMediaType = {\n\t/** Advanced Audio Coding (AAC) */\n\tAAC: 'audio/aac',\n\t/** AbiWord */\n\tABW: 'application/x-abiword',\n\t/** Archive document (multiple files embedded) */\n\tARC: 'application/x-freearc',\n\t/** AVIF image */\n\tAVIF: 'image/avif',\n\t/** Audio Video Interleave (AVI) */\n\tAVI: 'video/x-msvideo',\n\t/** Amazon Kindle eBook format */\n\tAZW: 'application/vnd.amazon.ebook',\n\t/** Binary Data */\n\tBIN: 'application/octet-stream',\n\t/** Windows OS/2 Bitmap Graphics */\n\tBMP: 'image/bmp',\n\t/** Bzip Archive */\n\tBZIP: 'application/x-bzip',\n\t/** Bzip2 Archive */\n\tBZIP2: 'application/x-bzip2',\n\t/** CD audio */\n\tCDA: 'application/x-cdf',\n\t/** C Shell Script */\n\tCSH: 'application/x-csh',\n\t/** Cascading Style Sheets (CSS) */\n\tCSS: 'text/css',\n\t/** Comma-Separated Values */\n\tCSV: 'text/csv',\n\t/** Microsoft Office Word Document */\n\tDOC: 'application/msword',\n\t/** Microsoft Office Word Document (OpenXML) */\n\tDOCX: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n\t/** Microsoft Embedded OpenType */\n\tEOT: 'application/vnd.ms-fontobject',\n\t/** Electronic Publication (EPUB) */\n\tEPUB: 'application/epub+zip',\n\t/** GZip Compressed Archive */\n\tGZIP: 'application/gzip',\n\t/** Graphics Interchange Format */\n\tGIF: 'image/gif',\n\t/** HyperText Markup Language (HTML) */\n\tHTML: 'text/html',\n\t/** Icon Format */\n\tICO: 'image/vnd.microsoft.icon',\n\t/** iCalendar Format */\n\tICS: 'text/calendar',\n\t/** Java Archive (JAR) */\n\tJAR: 'application/java-archive',\n\t/** JPEG Image */\n\tJPEG: 'image/jpeg',\n\t/** JavaScript */\n\tJAVA_SCRIPT: 'text/javascript',\n\t/** JavaScript Object Notation Format (JSON) */\n\tJSON: 'application/json',\n\t/** JavaScript Object Notation LD Format */\n\tJSON_LD: 'application/ld+json',\n\t/** JavaScript Object Notation (JSON) Merge Patch */\n\tJSON_MERGE_PATCH: 'application/merge-patch+json',\n\t/** Musical Instrument Digital Interface (MIDI) */\n\tMID: 'audio/midi',\n\t/** Musical Instrument Digital Interface (MIDI) */\n\tX_MID: 'audio/x-midi',\n\t/** MP3 Audio */\n\tMP3: 'audio/mpeg',\n\t/** MPEG-4 Audio */\n\tMP4A: 'audio/mp4',\n\t/** MPEG-4 Video */\n\tMP4: 'video/mp4',\n\t/** MPEG Video */\n\tMPEG: 'video/mpeg',\n\t/** Apple Installer Package */\n\tMPKG: 'application/vnd.apple.installer+xml',\n\t/** OpenDocument Presentation Document */\n\tODP: 'application/vnd.oasis.opendocument.presentation',\n\t/** OpenDocument Spreadsheet Document */\n\tODS: 'application/vnd.oasis.opendocument.spreadsheet',\n\t/** OpenDocument Text Document */\n\tODT: 'application/vnd.oasis.opendocument.text',\n\t/** Ogg Audio */\n\tOGA: 'audio/ogg',\n\t/** Ogg Video */\n\tOGV: 'video/ogg',\n\t/** Ogg */\n\tOGX: 'application/ogg',\n\t/** Opus audio */\n\tOPUS: 'audio/opus',\n\t/** OpenType Font File */\n\tOTF: 'font/otf',\n\t/** Portable Network Graphics (PNG) */\n\tPNG: 'image/png',\n\t/** Adobe Portable Document Format */\n\tPDF: 'application/pdf',\n\t/** Hypertext Preprocessor (Personal Home Page) */\n\tPHP: 'application/x-httpd-php',\n\t/** Microsoft PowerPoint */\n\tPPT: 'application/vnd.ms-powerpoint',\n\t/** Microsoft Office Presentation (OpenXML) */\n\tPPTX: 'application/vnd.openxmlformats-officedocument.presentationml.presentation',\n\t/** RAR Archive */\n\tRAR: 'application/vnd.rar',\n\t/** Rich Text Format */\n\tRTF: 'application/rtf',\n\t/** Bourne Shell Script */\n\tSH: 'application/x-sh',\n\t/** Scalable Vector Graphics (SVG) */\n\tSVG: 'image/svg+xml',\n\t/** Tape Archive (TAR) */\n\tTAR: 'application/x-tar',\n\t/** Tagged Image File Format (TIFF) */\n\tTIFF: 'image/tiff',\n\t/** MPEG transport stream */\n\tTRANSPORT_STREAM: 'video/mp2t',\n\t/** TrueType Font */\n\tTTF: 'font/ttf',\n\t/** Text, (generally ASCII or ISO 8859-n) */\n\tTEXT: 'text/plain',\n\t/** Microsoft Visio */\n\tVSD: 'application/vnd.visio',\n\t/** Waveform Audio Format (WAV) */\n\tWAV: 'audio/wav',\n\t/** Open Web Media Project - Audio */\n\tWEBA: 'audio/webm',\n\t/** Open Web Media Project - Video */\n\tWEBM: 'video/webm',\n\t/** WebP Image */\n\tWEBP: 'image/webp',\n\t/** Web Open Font Format */\n\tWOFF: 'font/woff',\n\t/** Web Open Font Format */\n\tWOFF2: 'font/woff2',\n\t/** Form - Encoded */\n\tFORM: 'application/x-www-form-urlencoded',\n\t/** Multipart FormData */\n\tMULTIPART_FORM_DATA: 'multipart/form-data',\n\t/** XHTML - The Extensible HyperText Markup Language */\n\tXHTML: 'application/xhtml+xml',\n\t/** Microsoft Excel Document */\n\tXLS: 'application/vnd.ms-excel',\n\t/** Microsoft Office Spreadsheet Document (OpenXML) */\n\tXLSX: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n\t/** Extensible Markup Language (XML) */\n\tXML: 'application/xml',\n\t/** XML User Interface Language (XUL) */\n\tXUL: 'application/vnd.mozilla.xul+xml',\n\t/** Zip Archive */\n\tZIP: 'application/zip',\n\t/** 3GPP audio/video container */\n\t'3GP': 'video/3gpp',\n\t/** 3GPP2 audio/video container */\n\t'3G2': 'video/3gpp2',\n\t/** 7-Zip Archive */\n\t'7Z': 'application/x-7z-compressed',\n};\n\nexport default HttpMediaType;", "/**\n * Defining a constant object with all the HTTP request headers.\n *\n * @module HttpRequestHeader\n * @constant {Object<string, string>}\n */\nconst HttpRequestHeader = {\n\t/**\n\t * Content-Types that are acceptable for the response. See Content negotiation. Permanent.\n\t *\n\t * @example\n\t * <code>Accept: text/plain</code>\n\t */\n\tACCEPT: 'accept',\n\t/**\n\t * Character sets that are acceptable. Permanent.\n\t *\n\t * @example\n\t * <code>Accept-Charset: utf-8</code>\n\t */\n\tACCEPT_CHARSET: 'accept-charset',\n\t/**\n\t * List of acceptable encodings. See HTTP compression. Permanent.\n\t *\n\t * @example\n\t * <code>Accept-Encoding: gzip, deflate</code>\n\t */\n\tACCEPT_ENCODING: 'accept-encoding',\n\t/**\n\t * List of acceptable human languages for response. See Content negotiation. Permanent.\n\t *\n\t * @example\n\t * <code>Accept-Language: en-US</code>\n\t */\n\tACCEPT_LANGUAGE: 'accept-language',\n\t/**\n\t * Authentication credentials for HTTP authentication. Permanent.\n\t *\n\t * @example\n\t * <code>Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==</code>\n\t */\n\tAUTHORIZATION: 'authorization',\n\t/**\n\t * Used to specify directives that must be obeyed by all caching mechanisms along the request-response chain.\n\t * Permanent.\n\t *\n\t * @example\n\t * <code>Cache-Control: no-cache</code>\n\t */\n\tCACHE_CONTROL: 'cache-control',\n\t/**\n\t * Control options for the current connection and list of hop-by-hop request fields. Permanent.\n\t *\n\t * @example\n\t * <code>Connection: keep-alive</code>\n\t * <code>Connection: Upgrade</code>\n\t */\n\tCONNECTION: 'connection',\n\t/**\n\t * An HTTP cookie previously sent by the server with Set-Cookie (below). Permanent: standard.\n\t *\n\t * @example\n\t * <code>Cookie: $Version=1, Skin=new,</code>\n\t */\n\tCOOKIE: 'cookie',\n\t/**\n\t * The length of the request body in octets (8-bit bytes). Permanent.\n\t *\n\t * @example\n\t * <code>Content-Length: 348</code>\n\t */\n\tCONTENT_LENGTH: 'content-length',\n\t/**\n\t * A Base64-encoded binary MD5 sum of the content of the request body. Obsolete.\n\t *\n\t * @example\n\t * <code>Content-MD5: Q2hlY2sgSW50ZWdyaXR5IQ==</code>\n\t */\n\tCONTENT_MD5: 'content-md5',\n\t/**\n\t * The MIME type of the body of the request (used with POST and PUT requests). Permanent.\n\t * <code>Content-Type: application/x-www-form-urlencoded</code>\n\t */\n\tCONTENT_TYPE: 'content-type',\n\t/**\n\t * The date and time that the message was sent (in \"HTTP-date\" format as defined by RFC 7231 Date/Time Formats).\n\t * Permanent.\n\t *\n\t * @example\n\t * <code>Date: Tue, 15 Nov 1994 08:12:31 GMT</code>\n\t */\n\tDATE: 'date',\n\t/**\n\t * Indicates that particular server behaviors are required by the client. Permanent.\n\t *\n\t * @example\n\t * <code>Expect: 100-continue</code>\n\t */\n\tEXPECT: 'expect',\n\t/**\n\t * The email address of the user making the request. Permanent.\n\t *\n\t * @example\n\t * <code>From: user@example.com</code>\n\t */\n\tFROM: 'from',\n\t/**\n\t * The domain name of the server (for virtual hosting), and the TCP port number on which the server is listening. The\n\t * port number may be omitted if the port is the standard port for the service requested. Permanent. Mandatory since\n\t * HTTP/1.1.\n\t *\n\t * @example\n\t * <code>Host: en.wikipedia.org:80</code>\n\t * <code>Host: en.wikipedia.org</code>\n\t */\n\tHOST: 'host',\n\t/**\n\t * Only perform the action if the client supplied entity matches the same entity on the server. This is mainly for\n\t * methods like PUT to only update a resource if it has not been modified since the user last updated it. Permanent.\n\t *\n\t * @example\n\t * <code>If-Match: \"737060cd8c284d8af7ad3082f209582d\"</code>\n\t */\n\tIF_MATCH: 'if-match',\n\t/**\n\t * Allows a 304 Not Modified to be returned if content is unchanged. Permanent.\n\t *\n\t * @example\n\t * <code>If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT</code>\n\t */\n\tIF_MODIFIED_SINCE: 'if-modified-since',\n\t/**\n\t * Allows a 304 Not Modified to be returned if content is unchanged, see HTTP ETag. Permanent.\n\t *\n\t * @example\n\t * <code>If-None-Match: \"737060cd8c284d8af7ad3082f209582d\"</code>\n\t */\n\tIF_NONE_MATCH: 'if-none-match',\n\t/**\n\t * If the entity is unchanged, send me the part(s) that I am missing, otherwise, send me the entire new entity.\n\t * Permanent.\n\t *\n\t * @example\n\t * <code>If-Range: \"737060cd8c284d8af7ad3082f209582d\"</code>\n\t */\n\tIF_RANGE: 'if-range',\n\t/**\n\t * Only send the response if the entity has not been modified since a specific time. Permanent.\n\t *\n\t * @example\n\t * <code>If-Unmodified-Since: Sat, 29 Oct 1994 19:43:31 GMT</code>\n\t */\n\tIF_UNMODIFIED_SINCE: 'if-unmodified-since',\n\t/**\n\t * Limit the number of times the message can be forwarded through proxies or gateways. Permanent.\n\t *\n\t * @example\n\t * <code>Max-Forwards: 10</code>\n\t */\n\tMAX_FORWARDS: 'max-forwards',\n\t/**\n\t * Initiates a request for cross-origin resource sharing (asks server for an 'Access-Control-Allow-Origin' response\n\t * field). Permanent: standard.\n\t *\n\t * @example\n\t * <code>Origin: http://www.example-social-network.com</code>\n\t */\n\tORIGIN: 'origin',\n\t/**\n\t * Implementation-specific fields that may have various effects anywhere along the request-response chain. Permanent.\n\t *\n\t * @example\n\t * <code>Pragma: no-cache</code>\n\t */\n\tPRAGMA: 'pragma',\n\t/**\n\t * Authorization credentials for connecting to a proxy. Permanent.\n\t *\n\t * @example\n\t * <code>Proxy-Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==</code>\n\t */\n\tPROXY_AUTHORIZATION: 'proxy-authorization',\n\t/**\n\t * Request only part of an entity. Bytes are numbered from 0. See Byte serving. Permanent.\n\t *\n\t * @example\n\t * <code>Range: bytes=500-999</code>\n\t */\n\tRANGE: 'range',\n\t/**\n\t * This is the address of the previous web page from which a link to the currently requested page was followed. (The\n\t * word \"referrer\" has been misspelled in the RFC as well as in most implementations to the point that it has become\n\t * standard usage and is considered correct terminology). Permanent.\n\t *\n\t * @example\n\t * <code>Referer: http://en.wikipedia.org/wiki/Main_Page</code>\n\t */\n\tREFERER: 'referer',\n\t/**\n\t * The transfer encodings the user agent is willing to accept: the same values as for the response header field\n\t * Transfer-Encoding can be used, plus the \"trailers\" value (related to the \"chunked\" transfer method) to notify the\n\t * server it expects to receive additional fields in the trailer after the last, zero-sized, chunk. Permanent.\n\t *\n\t * @example\n\t * <code>TE: trailers, deflate</code>\n\t */\n\tTE: 'te',\n\t/**\n\t * The user agent string of the user agent. Permanent.\n\t *\n\t * @example\n\t * <code>User-Agent: Mozilla/5.0 (X11, Linux x86_64, rv:12.0) Gecko/20100101 Firefox/21.0</code>\n\t */\n\tUSER_AGENT: 'user-agent',\n\t/**\n\t * Ask the server to upgrade to another protocol. Permanent.\n\t *\n\t * @example\n\t * <code>Upgrade: HTTP/2.0, SHTTP/1.3, IRC/6.9, RTA/x11</code>\n\t */\n\tUPGRADE: 'upgrade',\n\t/**\n\t * Informs the server of proxies through which the request was sent. Permanent.\n\t *\n\t * @example\n\t * <code>Via: 1.0 fred, 1.1 example.com (Apache/1.1)</code>\n\t */\n\tVIA: 'via',\n\t/**\n\t * A general warning about possible problems with the entity body. Permanent.\n\t *\n\t * @example\n\t * <code>Warning: 199 Miscellaneous warning</code>\n\t */\n\tWARNING: 'warning',\n\t/**\n\t * mainly used to identify Ajax requests. Most JavaScript frameworks send this field with value of XMLHttpRequest.\n\t *\n\t * @example\n\t * <code>X-Requested-With: XMLHttpRequest</code>\n\t */\n\tX_REQUESTED_WITH: 'x-requested-with',\n\t/**\n\t * Requests a web application to disable their tracking of a user. This is Mozilla's version of the X-Do-Not-Track\n\t * header field (since Firefox 4.0 Beta 11). Safari and IE9 also have support for this field. On March 7, 2011, a\n\t * draft proposal was submitted to IETF. The W3C Tracking Protection Working Group is producing a specification.\n\t *\n\t * @example\n\t * <code>DNT: 1 (Do Not Track Enabled)</code>\n\t * <code>DNT: 0 (Do Not Track Disabled)</code>\n\t */\n\tDNT: 'dnt',\n\t/**\n\t * A de facto standard for identifying the originating IP address of a client connecting to a web server through an\n\t * HTTP proxy or load balancer.\n\t *\n\t * @example\n\t * <code>X-Forwarded-For: client1, proxy1, proxy2</code>\n\t * <code>X-Forwarded-For: 129.78.138.66, 129.78.64.103</code>\n\t */\n\tX_FORWARDED_FOR: 'x-forwarded-for',\n\t/**\n\t * A de facto standard for identifying the original host requested by the client in the Host HTTP request header, since\n\t * the host name and/or port of the reverse proxy (load balancer) may differ from the origin server handling the\n\t * request.\n\t *\n\t * @example\n\t * <code>X-Forwarded-Host: en.wikipedia.org:80</code>\n\t * <code>X-Forwarded-Host: en.wikipedia.org</code>\n\t */\n\tX_FORWARDED_HOST: 'x-forwarded-host',\n\t/**\n\t * A de facto standard for identifying the originating protocol of an HTTP request, since a reverse proxy (load\n\t * balancer) may communicate with a web server using HTTP even if the request to the reverse proxy is HTTPS. An\n\t * alternative form of the header (X-ProxyUser-Ip) is used by Google clients talking to Google servers.\n\t *\n\t * @example\n\t * <code>X-Forwarded-Proto: https</code>\n\t */\n\tX_FORWARDED_PROTO: 'x-forwarded-proto',\n\t/**\n\t * Non-standard header field used by Microsoft applications and load-balancers.\n\t *\n\t * @example\n\t * <code>Front-End-Https: on</code>\n\t */\n\tFRONT_END_HTTPS: 'front-end-https',\n\t/**\n\t * Requests a web application override the method specified in the request (typically POST) with the method given in\n\t * the header field (typically PUT or DELETE). Can be used when a user agent or firewall prevents PUT or DELETE methods\n\t * from being sent directly (note that this either a bug in the software component, which ought to be fixed, or an\n\t * intentional configuration, in which case bypassing it may be the wrong thing to do).\n\t *\n\t * @example\n\t * <code>X-HTTP-Method-Override: DELETE</code>\n\t */\n\tX_HTTP_METHOD_OVERRIDE: 'x-http-method-override',\n\t/**\n\t * Allows easier parsing of the MakeModel/Firmware that is usually found in the User-Agent String of AT&T Devices.\n\t *\n\t * @example\n\t * <code>X-Att-Deviceid: GT-P7320/P7320XXLPG</code>\n\t */\n\tX_ATT_DEVICE_ID: 'x-att-deviceid',\n\t/**\n\t * Links to an XML file on the Internet with a full description and details about the device currently connecting. In the example to the right is an XML file for an AT&T Samsung Galaxy S2.\n\t * x-wap-profile: http://wap.samsungmobile.com/uaprof/SGH-I777.xml\n\t */\n\tX_WAP_PROFILE: 'x-wap-profile',\n};\n\nexport default HttpRequestHeader;", "/**\n * Defining a constant object with the name HttpRequestMethod.\n *\n * @module HttpRequestMethod\n * @constant {Object<string, string>}\n */\nconst HttpRequestMethod = {\n\t/**\n\t * The OPTIONS method represents a request for information about the communication options available on the\n\t * request/response chain identified by the Request-URI. This method allows the client to determine the options and/or\n\t * requirements associated with a resource, or the capabilities of a server, without implying a resource action or\n\t * initiating a resource retrieval.\n\t *\n\t * Responses to this method are not cacheable.\n\t *\n\t * If the OPTIONS request includes an entity-body (as indicated by the presence of Content-Length or\n\t * Transfer-Encoding), then the media type MUST be indicated by a Content-Type field. Although this specification does\n\t * not define any use for such a body, future extensions to HTTP might use the OPTIONS body to make more detailed\n\t * queries on the server. A server that does not support such an extension MAY discard the request body.\n\t *\n\t * If the Request-URI is an asterisk (\"*\"), the OPTIONS request is intended to apply to the server in general rather\n\t * than to a specific resource. Since a server's communication options typically depend on the resource, the \"*\"\n\t * request is only useful as a \"ping\" or \"no-op\" type of method, it does nothing beyond allowing the client to test the\n\t * capabilities of the server. For example, this can be used to test a proxy for HTTP/1.1 compliance (or lack thereof).\n\t *\n\t * If the Request-URI is not an asterisk, the OPTIONS request applies only to the options that are available when\n\t * communicating with that resource.\n\t *\n\t * A 200 response SHOULD include any header fields that indicate optional features implemented by the server and\n\t * applicable to that resource (e.g., Allow), possibly including extensions not defined by this specification. The\n\t * response body, if any, SHOULD also include information about the communication options. The format for such a body\n\t * is not defined by this specification, but might be defined by future extensions to HTTP. Content negotiation MAY be\n\t * used to select the appropriate response format. If no response body is included, the response MUST include a\n\t * Content-Length field with a field-value of \"0\".\n\t *\n\t * The Max-Forwards request-header field MAY be used to target a specific proxy in the request chain. When a proxy\n\t * receives an OPTIONS request on an absoluteURI for which request forwarding is permitted, the proxy MUST check for a\n\t * Max-Forwards field. If the Max-Forwards field-value is zero (\"0\"), the proxy MUST NOT forward the message, instead,\n\t * the proxy SHOULD respond with its own communication options. If the Max-Forwards field-value is an integer greater\n\t * than zero, the proxy MUST decrement the field-value when it forwards the request. If no Max-Forwards field is\n\t * present in the request, then the forwarded request MUST NOT include a Max-Forwards field.\n\t */\n\tOPTIONS: 'OPTIONS',\n\t/**\n\t * The GET method means retrieve whatever information (in the form of an entity) is identified by the Request-URI. If\n\t * the Request-URI refers to a data-producing process, it is the produced data which shall be returned as the entity in\n\t * the response and not the source text of the process, unless that text happens to be the output of the process.\n\t *\n\t * The semantics of the GET method change to a \"conditional GET\" if the request message includes an If-Modified-Since;\n\t * If-Unmodified-Since, If-Match, If-None-Match, or If-Range header field. A conditional GET method requests that the\n\t * entity be transferred only under the circumstances described by the conditional header field(s). The conditional GET\n\t * method is intended to reduce unnecessary network usage by allowing cached entities to be refreshed without requiring\n\t * multiple requests or transferring data already held by the client.\n\t *\n\t * The semantics of the GET method change to a \"partial GET\" if the request message includes a Range header field. A\n\t * partial GET requests that only part of the entity be transferred, as described in section 14.35. The partial GET\n\t * method is intended to reduce unnecessary network usage by allowing partially-retrieved entities to be completed\n\t * without transferring data already held by the client.\n\t *\n\t * The response to a GET request is cacheable if and only if it meets the requirements for HTTP caching described in\n\t * section 13.\n\t *\n\t * See section 15.1.3 for security considerations when used for forms.\n\t */\n\tGET: 'GET',\n\t/**\n\t * The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. The\n\t * meta information contained in the HTTP headers in response to a HEAD request SHOULD be identical to the information\n\t * sent in response to a GET request. This method can be used for obtaining meta information about the entity implied by\n\t * the request without transferring the entity-body itself. This method is often used for testing hypertext links for\n\t * validity, accessibility, and recent modification.\n\t *\n\t * The response to a HEAD request MAY be cacheable in the sense that the information contained in the response MAY be\n\t * used to update a previously cached entity from that resource. If the new field values indicate that the cached\n\t * entity differs from the current entity (as would be indicated by a change in Content-Length, Content-MD5, ETag or\n\t * Last-Modified), then the cache MUST treat the cache entry as stale.\n\t */\n\tHEAD: 'HEAD',\n\t/**\n\t * The POST method is used to request that the origin server accept the entity enclosed in the request as a new\n\t * subordinate of the resource identified by the Request-URI in the Request-Line. POST is designed to allow a uniform\n\t * method to cover the following functions:\n\t * <ul>\n\t * <li>Annotation of existing resources,</li>\n\t * <li>Posting a message to a bulletin board, newsgroup, mailing list, or similar group of articles,</li>\n\t * <li>Providing a block of data, such as the result of submitting a form, to a data-handling process,</li>\n\t * <li>Extending a database through an append operation.</li>\n\t * </ul>\n\t *\n\t * The actual function performed by the POST method is determined by the server and is usually dependent on the\n\t * Request-URI. The posted entity is subordinate to that URI in the same way that a file is subordinate to a directory\n\t * containing it, a news article is subordinate to a newsgroup to which it is posted, or a record is subordinate to a\n\t * database.\n\t *\n\t * The action performed by the POST method might not result in a resource that can be identified by a URI. In this\n\t * case, either 200 (OK) or 204 (No Content) is the appropriate response status, depending on whether or not the\n\t * response includes an entity that describes the result.\n\t *\n\t * If a resource has been created on the origin server, the response SHOULD be 201 (Created) and contain an entity\n\t * which describes the status of the request and refers to the new resource, and a Location header (see section 14.30).\n\t *\n\t * Responses to this method are not cacheable, unless the response includes appropriate Cache-Control or Expires header\n\t * fields. However, the 303 (See Other) response can be used to direct the user agent to retrieve a cacheable resource.\n\t *\n\t * POST requests MUST obey the message transmission requirements set out in section 8.2.\n\t *\n\t * See section 15.1.3 for security considerations.\n\t */\n\tPOST: 'POST',\n\t/**\n\t * The PUT method requests that the enclosed entity be stored under the supplied Request-URI. If the Request-URI refers\n\t * to an already existing resource, the enclosed entity SHOULD be considered as a modified version of the one residing\n\t * on the origin server. If the Request-URI does not point to an existing resource, and that URI is capable of being\n\t * defined as a new resource by the requesting user agent, the origin server can create the resource with that URI. If\n\t * a new resource is created, the origin server MUST inform the user agent via the 201 (Created) response. If an\n\t * existing resource is modified, either the 200 (OK) or 204 (No Content) response codes SHOULD be sent to indicate\n\t * successful completion of the request. If the resource could not be created or modified with the Request-URI, an\n\t * appropriate error response SHOULD be given that reflects the nature of the problem. The recipient of the entity MUST\n\t * \\NOT ignore any Content-* (e.g. Content-Range) headers that it does not understand or implement and MUST return a\n\t * 501 (Not Implemented) response in such cases.\n\t *\n\t * If the request passes through a cache and the Request-URI identifies one or more currently cached entities, those\n\t * entries SHOULD be treated as stale. Responses to this method are not cacheable.\n\t *\n\t * The fundamental difference between the POST and PUT requests is reflected in the different meaning of the\n\t * Request-URI. The URI in a POST request identifies the resource that will handle the enclosed entity. That resource\n\t * might be a data-accepting process, a gateway to some other protocol, or a separate entity that accepts annotations.\n\t * In contrast, the URI in a PUT request identifies the entity enclosed with the request -- the user agent knows what\n\t * URI is intended and the server MUST NOT attempt to apply the request to some other resource. If the server desires\n\t * that the request be applied to a different URI, it MUST send a 301 (Moved Permanently) response, the user agent MAY\n\t * then make its own decision regarding whether or not to redirect the request.\n\t *\n\t * A single resource MAY be identified by many different URIs. For example, an article might have a URI for identifying\n\t * \"the current version\" which is separate from the URI identifying each particular version. In this case, a PUT\n\t * request on a general URI might result in several other URIs being defined by the origin server.\n\t *\n\t * HTTP/1.1 does not define how a PUT method affects the state of an origin server.\n\t *\n\t * PUT requests MUST obey the message transmission requirements set out in section 8.2.\n\t *\n\t * Unless otherwise specified for a particular entity-header, the entity-headers in the PUT request SHOULD be applied\n\t * to the resource created or modified by the PUT.\n\t */\n\tPUT: 'PUT',\n\t/**\n\t * The DELETE method requests that the origin server delete the resource identified by the Request-URI. This method MAY\n\t * be overridden by human intervention (or other means) on the origin server. The client cannot be guaranteed that the\n\t * operation has been carried out, even if the status code returned from the origin server indicates that the action\n\t * has been completed successfully. However, the server SHOULD NOT indicate success unless, at the time the response\n\t * is given, it intends to delete the resource or move it to an inaccessible location.\n\t *\n\t * A successful response SHOULD be 200 (OK) if the response includes an entity describing the status, 202 (Accepted) if\n\t * the action has not yet been enacted, or 204 (No Content) if the action has been enacted but the response does not\n\t * include an entity.\n\t *\n\t * If the request passes through a cache and the Request-URI identifies one or more currently cached entities, those\n\t * entries SHOULD be treated as stale. Responses to this method are not cacheable.\n\t */\n\tDELETE: 'DELETE',\n\t/**\n\t * The TRACE method is used to invoke a remote, application-layer loop- back of the request message. The final\n\t * recipient of the request SHOULD reflect the message received back to the client as the entity-body of a 200 (OK)\n\t * response. The final recipient is either the origin server or the first proxy or gateway to receive a Max-Forwards\n\t * value of zero (0) in the request (see section 14.31). A TRACE request MUST NOT include an entity.\n\t *\n\t * TRACE allows the client to see what is being received at the other end of the request chain and use that data for\n\t * testing or diagnostic information. The value of the Via header field (section 14.45) is of particular interest,\n\t * since it acts as a trace of the request chain. Use of the Max-Forwards header field allows the client to limit the\n\t * length of the request chain, which is useful for testing a chain of proxies forwarding messages in an infinite loop.\n\t *\n\t * If the request is valid, the response SHOULD contain the entire request message in the entity-body, with a\n\t * Content-Type of \"message/http\". Responses to this method MUST NOT be cached.\n\t */\n\tTRACE: 'TRACE',\n\t/**\n\t * This specification reserves the method name CONNECT for use with a proxy that can dynamically switch to being a\n\t * tunnel (e.g. SSL tunneling [44]).\n\t */\n\tCONNECT: 'CONNECT',\n\t/**\n\t * The PATCH method requests that a set of changes described in the\n\t * request entity be applied to the resource identified by the Request-\n\t * URI. The set of changes is represented in a format called a \"patch\n\t * document\" identified by a media type. If the Request-URI does not\n\t * point to an existing resource, the server MAY create a new resource,\n\t * depending on the patch document type (whether it can logically modify\n\t * a null resource) and permissions, etc.\n\t *\n\t * The difference between the PUT and PATCH requests is reflected in the\n\t * way the server processes the enclosed entity to modify the resource\n\t * identified by the Request-URI. In a PUT request, the enclosed entity\n\t * is considered to be a modified version of the resource stored on the\n\t * origin server, and the client is requesting that the stored version\n\t * be replaced. With PATCH, however, the enclosed entity contains a set\n\t * of instructions describing how a resource currently residing on the\n\t * origin server should be modified to produce a new version. The PATCH\n\t * method affects the resource identified by the Request-URI, and it\n\t * also MAY have side effects on other resources; i.e., new resources\n\t * may be created, or existing ones modified, by the application of a\n\t * PATCH.\n\t *\n\t * PATCH is neither safe nor idempotent as defined by [RFC2616], Section\n\t * 9.1.\n\t *\n\t * A PATCH request can be issued in such a way as to be idempotent,\n\t * which also helps prevent bad outcomes from collisions between two\n\t * PATCH requests on the same resource in a similar time frame.\n\t * Collisions from multiple PATCH requests may be more dangerous than\n\t * PUT collisions because some patch formats need to operate from a\n\t * known base-point or else they will corrupt the resource. Clients\n\t * using this kind of patch application SHOULD use a conditional request\n\t * such that the request will fail if the resource has been updated\n\t * since the client last accessed the resource. For example, the client\n\t * can use a strong ETag [RFC2616] in an If-Match header on the PATCH\n\t * request.\n\t *\n\t * There are also cases where patch formats do not need to operate from\n\t * a known base-point (e.g., appending text lines to log files, or non-\n\t * colliding rows to database tables), in which case the same care in\n\t * client requests is not needed.\n\t *\n\t * The server MUST apply the entire set of changes atomically and never\n\t * provide (e.g., in response to a GET during this operation) a\n\t * partially modified representation. If the entire patch document\n\t * cannot be successfully applied, then the server MUST NOT apply any of\n\t * the changes. The determination of what constitutes a successful\n\t * PATCH can vary depending on the patch document and the type of\n\t * resource(s) being modified. For example, the common 'diff' utility\n\t * can generate a patch document that applies to multiple files in a\n\t * directory hierarchy. The atomicity requirement holds for all\n\t * directly affected files. See \"Error Handling\", Section 2.2, for\n\t * details on status codes and possible error conditions.\n\t *\n\t * If the request passes through a cache and the Request-URI identifies\n\t * one or more currently cached entities, those entries SHOULD be\n\t * treated as stale. A response to this method is only cacheable if it\n\t * contains explicit freshness information (such as an Expires header or\n\t * \"Cache-Control: max-age\" directive) as well as the Content-Location\n\t * header matching the Request-URI, indicating that the PATCH response\n\t * body is a resource representation. A cached PATCH response can only\n\t * be used to respond to subsequent GET and HEAD requests; it MUST NOT\n\t * be used to respond to other methods (in particular, PATCH).\n\t *\n\t * Note that entity-headers contained in the request apply only to the\n\t * contained patch document and MUST NOT be applied to the resource\n\t * being modified. Thus, a Content-Language header could be present on\n\t * the request, but it would only mean (for whatever that's worth) that\n\t * the patch document had a language. Servers SHOULD NOT store such\n\t * headers except as trace information, and SHOULD NOT use such header\n\t * values the same way they might be used on PUT requests. Therefore,\n\t * this document does not specify a way to modify a document's Content-\n\t * Type or Content-Language value through headers, though a mechanism\n\t * could well be designed to achieve this goal through a patch document.\n\t *\n\t * There is no guarantee that a resource can be modified with PATCH.\n\t * Further, it is expected that different patch document formats will be\n\t * appropriate for different types of resources and that no single\n\t * format will be appropriate for all types of resources. Therefore,\n\t * there is no single default patch document format that implementations\n\t * are required to support. Servers MUST ensure that a received patch\n\t * document is appropriate for the type of resource identified by the\n\t * Request-URI.\n\t *\n\t * Clients need to choose when to use PATCH rather than PUT. For\n\t * example, if the patch document size is larger than the size of the\n\t * new resource data that would be used in a PUT, then it might make\n\t * sense to use PUT instead of PATCH. A comparison to POST is even more\n\t * difficult, because POST is used in widely varying ways and can\n\t * encompass PUT and PATCH-like operations if the server chooses. If\n\t * the operation does not modify the resource identified by the Request-\n\t * URI in a predictable way, POST should be considered instead of PATCH\n\t * or PUT.\n\t */\n\tPATCH: 'PATCH'\n};\n\nexport default HttpRequestMethod;", "/**\n * Defining a constant object with a bunch of properties.\n *\n * @module HttpResponseHeader\n * @constant {Object<string, string>}\n */\nconst HttpResponseHeader = {\n\t/**\n\t * Implemented as a misunderstanding of the HTTP specifications. Common because of mistakes in implementations of early HTTP versions. Has exactly the same functionality as standard Connection field.\n\t *\n\t * @example\n\t * proxy-connection: keep-alive\n\t */\n\tPROXY_CONNECTION: 'proxy-connection',\n\t/**\n\t * Server-side deep packet insertion of a unique ID identifying customers of Verizon Wireless, also known as \"perma-cookie\" or \"supercookie\"\n\t *\n\t * @example\n\t * x-uidh: ...\n\t */\n\tX_UIDH: 'x-uidh',\n\t/**\n\t * Used to prevent cross-site request forgery. Alternative header names are: X-CSRFToken and X-XSRF-TOKEN\n\t *\n\t * @example\n\t * x-csrf-token: i8XNjC4b8KVok4uw5RftR38Wgp2BFwql\n\t */\n\tX_CSRF_TOKEN: 'x-csrf-token',\n\t/**\n\t * Specifying which web sites can participate in cross-origin resource sharing\n\t *\n\t * @example\n\t * access-control-allow-origin: *\n\t * Provisional\n\t */\n\tACCESS_CONTROL_ALLOW_ORIGIN: 'access-control-allow-origin',\n\t/**\n\t * Specifies which patch document formats this server supports\n\t *\n\t * @example\n\t * accept-patch: text/example,charset=utf-8\n\t * Permanent\n\t */\n\tACCEPT_PATCH: 'accept-patch',\n\t/**\n\t * What partial content range types this server supports via byte serving\n\t *\n\t * @example\n\t * accept-ranges: bytes\n\t * Permanent\n\t */\n\tACCEPT_RANGES: 'accept-ranges',\n\t/**\n\t * The age the object has been in a proxy cache in seconds\n\t *\n\t * @example\n\t * age: 12\n\t * Permanent\n\t */\n\tAGE: 'age',\n\t/**\n\t * Valid actions for a specified resource. To be used for a 405 Method not allowed\n\t *\n\t * @example\n\t * allow: GET, HEAD\n\t * Permanent\n\t */\n\tALLOW: 'allow',\n\t/**\n\t * Tells all caching mechanisms from server to client whether they may cache this object. It is measured in seconds\n\t *\n\t * @example\n\t * cache-control: max-age=3600\n\t * Permanent\n\t */\n\tCACHE_CONTROL: 'cache-control',\n\t/**\n\t * Control options for the current connection and list of hop-by-hop response fields\n\t *\n\t * @example\n\t * connection: close\n\t * Permanent\n\t */\n\tCONNECTION: 'connection',\n\t/**\n\t * An opportunity to raise a \"File Download\" dialogue box for a known MIME type with binary format or suggest a filename for dynamic content. Quotes are necessary with special characters.\n\t *\n\t * @example\n\t * content-disposition: attachment, filename=\"fname.ext\"\n\t * Permanent\n\t */\n\tCONTENT_DISPOSITION: 'content-disposition',\n\t/**\n\t * The type of encoding used on the data. See HTTP compression.\n\t *\n\t * @example\n\t * content-encoding: gzip\n\t * Permanent\n\t */\n\tCONTENT_ENCODING: 'content-encoding',\n\t/**\n\t * The natural language or languages of the intended audience for the enclosed content\n\t *\n\t * @example\n\t * content-language: da\n\t * Permanent\n\t */\n\tCONTENT_LANGUAGE: 'content-language',\n\t/**\n\t * The length of the response body in octets (8-bit bytes)\n\t *\n\t * @example\n\t * content-length: 348\n\t * Permanent\n\t */\n\tCONTENT_LENGTH: 'content-length',\n\t/**\n\t * An alternate location for the returned data\n\t *\n\t * @example\n\t * content-location: /index.htm\n\t * Permanent\n\t */\n\tCONTENT_LOCATION: 'content-location',\n\t/**\n\t * Where in a full body message this partial message belongs\n\t *\n\t * @example\n\t * content-range: bytes 21010-47021/47022\n\t * Permanent\n\t */\n\tCONTENT_RANGE: 'content-range',\n\t/**\n\t * The MIME type of this content\n\t *\n\t * @example\n\t * content-type: text/html, charset=utf-8\n\t * Permanent\n\t */\n\tCONTENT_TYPE: 'content-type',\n\t/**\n\t * The date and time that the message was sent (in \"HTTP-date\" format as defined by RFC 7231)\n\t *\n\t * @example\n\t * date: Tue, 15 Nov 1994 08:12:31 GMT\n\t * Permanent\n\t */\n\tDATE: 'date',\n\t/**\n\t * An identifier for a specific version of a resource, often a message digest\n\t *\n\t * @example\n\t * etag: \"737060cd8c284d8af7ad3082f209582d\"\n\t * Permanent\n\t */\n\tETAG: 'etag',\n\t/**\n\t * Gives the date/time after which the response is considered stale (in \"HTTP-date\" format as defined by RFC 7231)\n\t *\n\t * @example\n\t * expires: Thu, 01 Dec 1994 16:00:00 GMT\n\t * Permanent\n\t */\n\tEXPIRES: 'expires',\n\t/**\n\t * The last modified date for the requested object (in \"HTTP-date\" format as defined by RFC 7231)\n\t *\n\t * @example\n\t * last-modified: Tue, 15 Nov 1994 12:45:26 GMT\n\t * Permanent\n\t */\n\tLAST_MODIFIED: 'last-modified',\n\t/**\n\t * Used to express a typed relationship with another resource, where the relation type is defined by RFC 5988\n\t *\n\t * @example\n\t * link: </feed>, rel=\"alternate\"\n\t * Permanent\n\t */\n\tLINK: 'link',\n\t/**\n\t * Used in redirection, or when a new resource has been created.\n\t *\n\t * @example\n\t * location: http://www.w3.org/pub/WWW/People.html\n\t * Permanent\n\t */\n\tLOCATION: 'location',\n\t/**\n\t * This field is supposed to set P3P policy, in the form of P3P:CP=\"your_compact_policy\". However, P3P did not take off, most browsers have never fully\n\t * implemented it, a lot of websites set this field with fake policy text, that was enough to fool browsers the existence of P3P policy and grant permissions for third party cookies.\n\t *\n\t * @example\n\t * p3p: CP=\"This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&answer=151657 for more info.\"\n\t * Permanent\n\t */\n\tP3P: 'p3p',\n\t/**\n\t * Implementation-specific fields that may have various effects anywhere along the request-response chain.\n\t *\n\t * @example\n\t * pragma: no-cache\n\t * Permanent\n\t */\n\tPRAGMA: 'pragma',\n\t/**\n\t * Request authentication to access the proxy.\n\t *\n\t * @example\n\t * proxy-authenticate: Basic\n\t * Permanent\n\t */\n\tPROXY_AUTHENTICATION: 'proxy-authenticate',\n\t/**\n\t * HTTP Public Key Pinning, announces hash of website's authentic TLS certificate\n\t *\n\t * @example\n\t * public-key-pins: max-age=2592000, pin-sha256=\"E9CZ9INDbd+2eRQozYqqbQ2yXLVKB9+xcprMF+44U1g=\",\n\t * Permanent\n\t */\n\tPUBLIC_KEY_PINS: 'public-key-pins',\n\t/**\n\t * If an entity is temporarily unavailable, this instructs the client to try again later. Value could be a specified period of time (in seconds) or a HTTP-date.\n\t *\n\t * @example\n\t * retry-after: 120\n\t * retry-after: Fri, 07 Nov 2014 23:59:59 GMT\n\t * Permanent\n\t */\n\tRETRY_AFTER: 'retry-after',\n\t/**\n\t * A name for the server\n\t *\n\t * @example\n\t * server: Apache/2.4.1 (Unix)\n\t * Permanent\n\t */\n\tSERVER: 'server',\n\t/**\n\t * An HTTP cookie\n\t *\n\t * @example\n\t * set-cookie: UserID=JohnDoe, Max-Age=3600, Version=1\n\t * Permanent\n\t */\n\tSET_COOKIE: 'set-cookie',\n\t/**\n\t * CGI header field specifying the status of the HTTP response. Normal HTTP responses use a separate \"Status-Line\" instead, defined by RFC 7230.\n\t *\n\t * @example\n\t * status: 200 OK\n\t */\n\tSTATUS: 'status',\n\t/**\n\t * A HSTS Policy informing the HTTP client how long to cache the HTTPS only policy and whether this applies to subdomains.\n\t *\n\t * @example\n\t * strict-transport-security: max-age=16070400, includeSubDomains\n\t * Permanent\n\t */\n\tSTRICT_TRANSPORT_SECURITY: 'strict-transport-security',\n\t/**\n\t * The Trailer general field value indicates that the given set of header fields is present in the trailer of a message encoded with chunked transfer coding.\n\t *\n\t * @example\n\t * trailer: Max-Forwards\n\t * Permanent\n\t */\n\tTRAILER: 'trailer',\n\t/**\n\t * The form of encoding used to safely transfer the entity to the user. Currently defined methods are: chunked, compress, deflate, gzip, identity.\n\t *\n\t * @example\n\t * transfer-encoding: chunked\n\t * Permanent\n\t */\n\tTRANSFER_ENCODING: 'transfer-encoding',\n\t/**\n\t * Ask the client to upgrade to another protocol.\n\t *\n\t * @example\n\t * upgrade: HTTP/2.0, SHTTP/1.3, IRC/6.9, RTA/x11\n\t * Permanent\n\t */\n\tUPGRADE: 'upgrade',\n\t/**\n\t * Tells downstream proxies how to match future request headers to decide whether the cached response can be used rather than requesting a fresh one from the origin server.\n\t *\n\t * @example\n\t * vary: *\n\t * Permanent\n\t */\n\tVARY: 'vary',\n\t/**\n\t * Informs the client of proxies through which the response was sent.\n\t *\n\t * @example\n\t * via: 1.0 fred, 1.1 example.com (Apache/1.1)\n\t * Permanent\n\t */\n\tVIA: 'via',\n\t/**\n\t * A general warning about possible problems with the entity body.\n\t *\n\t * @example\n\t * warning: 199 Miscellaneous warning\n\t * Permanent\n\t */\n\tWARNING: 'warning',\n\t/**\n\t * Indicates the authentication scheme that should be used to access the requested entity.\n\t *\n\t * @example\n\t * www-authenticate: Basic\n\t * Permanent\n\t */\n\tWWW_AUTHENTICATE: 'www-authenticate',\n\t/**\n\t * Cross-site scripting (XSS) filter\n\t *\n\t * @example\n\t * x-xss-protection: 1, mode=block\n\t */\n\tX_XSS_PROTECTION: 'x-xss-protection',\n\t/**\n\t * The HTTP Content-Security-Policy response header allows web site administrators to control resources the user agent is allowed\n\t * to load for a given page. With a few exceptions, policies mostly involve specifying server origins and script endpoints.\n\t * This helps guard against cross-site scripting attacks (Cross-site_scripting).\n\t *\n\t * @example\n\t * content-security-policy: default-src\n\t */\n\tCONTENT_SECURITY_POLICY: 'content-security-policy',\n\t/**\n\t * The only defined value, \"nosniff\", prevents Internet Explorer from MIME-sniffing a response away from the declared content-type. This also applies to Google Chrome, when downloading extensions.\n\t *\n\t * @example\n\t * x-content-type-options: nosniff\n\t */\n\tX_CONTENT_TYPE_OPTIONS: 'x-content-type-options',\n\t/**\n\t * specifies the technology (e.g. ASP.NET, PHP, JBoss) supporting the web application (version details are often in X-Runtime, X-Version, or X-AspNet-Version)\n\t *\n\t * @example\n\t * x-powered-by: PHP/5.4.0\n\t */\n\tX_POWERED_BY: 'x-powered-by'\n};\n\nexport default HttpResponseHeader;", "/**\n * A class that holds a status code and a status text\n *\n * @module ResponseStatus\n * @author D1g1talEntr0py <jason.dimeo@gmail.com>\n */\nexport default class ResponseStatus {\n\t/** @type {number} */\n\t#code;\n\t/** @type {string} */\n\t#text;\n\n\t/**\n\t *\n\t * @param {number} code The status code from the {@link Response}\n\t * @param {string} text The status text from the {@link Response}\n\t */\n\tconstructor(code, text) {\n\t\tthis.#code = code;\n\t\tthis.#text = text;\n\t}\n\n\t/**\n\t * Returns the status code from the {@link Response}\n\t *\n\t * @returns {number} The status code.\n\t */\n\tget code() {\n\t\treturn this.#code;\n\t}\n\n\t/**\n\t * Returns the status text from the {@link Response}.\n\t *\n\t * @returns {string} The status text.\n\t */\n\tget text() {\n\t\treturn this.#text;\n\t}\n\n\t/**\n\t * A String value that is used in the creation of the default string\n\t * description of an object. Called by the built-in method {@link Object.prototype.toString}.\n\t *\n\t * @override\n\t * @returns {string} The default string description of this object.\n\t */\n\tget [Symbol.toStringTag]() {\n\t\treturn 'ResponseStatus';\n\t}\n\n\t/**\n\t * tostring method for the class.\n\t *\n\t * @override\n\t * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/toString|Object.prototype.toString}\n\t * @returns {string} The status code and status text.\n\t */\n\ttoString() {\n\t\treturn `${this.#code} ${this.#text}`;\n\t}\n}", "/**\n * @typedef {Map<string, Array<*>>} ParameterMap\n * @extends Map\n */\n\n/**\n * A {@link Map} that can contain multiple, unique, values for the same key.\n *\n * @type {ParameterMap<string, Array<*>>}\n */\nexport default class ParameterMap extends Map {\n\t/**\n\t * @param {Iterable<[string, *]>|Object} parameters The initial parameters to set.\n\t * @returns {ParameterMap<string, *>} The ParameterMap with the updated key and value.\n\t */\n\tconstructor(parameters = {}) {\n\t\tsuper();\n\t\tfor (const [key, value] of ParameterMap.#entries(parameters)) {\n\t\t\tthis.append(key, value);\n\t\t}\n\t}\n\n\t/**\n\t * Adds a new element with a specified key and value to the ParameterMap.\n\t * If an element with the same key already exists, the value will be replaced in the underlying {@link Set}.\n\t *\n\t * @override\n\t * @param {string} key The key to set.\n\t * @param {*} value The value to add to the ParameterMap\n\t * @returns {ParameterMap<string, *>} The ParameterMap with the updated key and value.\n\t */\n\tset(key, value) {\n\t\tconst array = super.get(key);\n\t\tif (array?.length > 0) {\n\t\t\tarray.length = 0;\n\t\t\tarray[0] = value;\n\t\t} else {\n\t\t\tsuper.set(key, [value]);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds all key-value pairs from an iterable or object to the ParameterMap.\n\t * If a key already exists, the value will be replaced in the underlying {@link Array}.\n\t *\n\t * @param {Iterable<[string, *]>|Object} parameters The parameters to set.\n\t * @returns {ParameterMap<string, *>} The ParameterMap with the updated key and value.\n\t */\n\tsetAll(parameters) {\n\t\tfor (const [key, value] of ParameterMap.#entries(parameters)) {\n\t\t\tthis.set(key, value);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Returns the value associated to the key, or undefined if there is none.\n\t * If the key has multiple values, the first value will be returned.\n\t * If the key has no values, undefined will be returned.\n\t *\n\t * @override\n\t * @param {string} key The key to get.\n\t * @returns {*} The value associated to the key, or undefined if there is none.\n\t */\n\tget(key) {\n\t\treturn super.get(key)?.[0];\n\t}\n\n\t/**\n\t * Returns an array of all values associated to the key, or undefined if there are none.\n\t *\n\t * @param {string} key The key to get.\n\t * @returns {Array<*>} An array of all values associated to the key, or undefined if there are none.\n\t */\n\tgetAll(key) {\n\t\treturn super.get(key);\n\t}\n\n\t/**\n\t * Appends a new value to an existing key inside a ParameterMap, or adds the new key if it does not exist.\n\t *\n\t * @param {string} key The key to append.\n\t * @param {*} value The value to append.\n\t * @returns {ParameterMap<string, *>} The ParameterMap with the updated key and value to allow chaining.\n\t */\n\tappend(key, value) {\n\t\tconst array = super.get(key);\n\t\tif (array?.length > 0) {\n\t\t\tarray.push(value);\n\t\t} else {\n\t\t\tsuper.set(key, [value]);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Appends all key-value pairs from an iterable or object to the ParameterMap.\n\t * If a key already exists, the value will be appended to the underlying {@link Array}.\n\t * If a key does not exist, the key and value will be added to the ParameterMap.\n\t *\n\t * @param {Iterable<[string, *]>|Object} parameters The parameters to append.\n\t * @returns {ParameterMap<string, *>} The ParameterMap with the updated key and value.\n\t */\n\tappendAll(parameters) {\n\t\tfor (const [key, value] of ParameterMap.#entries(parameters)) {\n\t\t\tthis.append(key, value);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Checks if a specific key has a specific value.\n\t *\n\t * @param {*} value The value to check.\n\t * @returns {boolean} True if the key has the value, false otherwise.\n\t */\n\thasValue(value) {\n\t\tfor (const array of super.values()) {\n\t\t\tif (array.includes(value)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Removes a specific value from a specific key.\n\t *\n\t * @param {*} value The value to remove.\n\t * @returns {boolean} True if the value was removed, false otherwise.\n\t */\n\tdeleteValue(value) {\n\t\tfor (const array of this.values()) {\n\t\t\tif (array.includes(value)) {\n\t\t\t\treturn array.splice(array.indexOf(value), 1).length > 0;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Determines whether the ParameterMap contains anything.\n\t *\n\t * @returns {boolean} True if the ParameterMap size is greater than 0, false otherwise.\n\t */\n\tisEmpty() {\n\t\treturn this.size === 0;\n\t}\n\n\t/**\n\t * Returns an Object that can be serialized to JSON.\n\t * If a key has only one value, the value will be a single value.\n\t * If a key has multiple values, the value will be an array of values.\n\t * If a key has no values, the value will be undefined.\n\t *\n\t * @override\n\t * @returns {Object} The Object to be serialized to JSON.\n\t * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#toJSON_behavior}\n\t */\n\ttoJSON() {\n\t\tconst obj = Object.create(null);\n\n\t\tfor (const [key, values] of super.entries()) {\n\t\t\tobj[key] = values.length === 1 ? values[0] : values;\n\t\t}\n\n\t\treturn obj;\n\t}\n\n\t/**\n\t * Returns an iterator that yields all key-value pairs in the map as arrays in their insertion order.\n\t *\n\t * @override\n\t * @yields {[string, *]} An iterator for the key-value pairs in the map.\n\t */\n\t*entries() {\n\t\tfor (const [key, array] of super.entries()) {\n\t\t\tfor (const value of array) { yield [key, value] }\n\t\t}\n\t}\n\n\t/**\n\t * Returns an iterator that yields all key-value pairs in the map as arrays in their insertion order.\n\t *\n\t * @override\n\t * @yields {[string, *]} An iterator for the key-value pairs in the map.\n\t */\n\t*[Symbol.iterator]() {\n\t\tyield* this.entries();\n\t}\n\n\t/**\n\t * Returns an iterable of key, value pairs for every entry in the parameters object.\n\t *\n\t * @private\n\t * @static\n\t * @param {Iterable<[string, *]>|Object} parameters The parameters to set.\n\t * @returns {Iterable<[string, *]>} An iterable of key, value pairs for every entry in the parameters object.\n\t */\n\tstatic #entries(parameters) {\n\t\treturn parameters[Symbol.iterator] ? parameters : Object.entries(parameters);\n\t}\n\n\t/**\n\t * A String value that is used in the creation of the default string description of an object.\n\t * Called by the built-in method {@link Object.prototype.toString}.\n\t *\n\t * @override\n\t * @returns {string} The default string description of this object.\n\t */\n\tget [Symbol.toStringTag]() {\n\t\treturn 'ParameterMap';\n\t}\n}", "/** @module utils */\n\nconst whitespaceCharacters = [' ', '\\t', '\\n', '\\r'];\nconst leadingWhitespace = /^[ \\t\\n\\r]+/u;\nconst trailingWhitespace = /[ \\t\\n\\r]+$/u;\nconst httpTokenCodePoints = /^[-!#$%&'*+.^_`|~A-Za-z0-9]*$/u;\nconst httpQuotedTokenCodePoints = /^[\\t\\u0020-\\u007E\\u0080-\\u00FF]*$/u;\n\n/**\n * A function to remove any leading and trailing HTTP whitespace.\n *\n * @param {string} string The string to process.\n * @returns {string} The processed string.\n */\nconst removeLeadingAndTrailingHTTPWhitespace = (string) => string.replace(leadingWhitespace, '').replace(trailingWhitespace, '');\n\n/**\n * A function to remove any trailing HTTP whitespace.\n *\n * @param {string} string The string to process.\n * @returns {string} The processed string.\n */\nconst removeTrailingHTTPWhitespace = (string) => string.replace(trailingWhitespace, '');\n\n/**\n * Determines if the provided character is whitespace.\n *\n * @param {string} char The character to evaluate.\n * @returns {boolean} true if the character is whitespace, false otherwise.\n */\nconst isHTTPWhitespaceChar = (char) => whitespaceCharacters.includes(char);\n\n/**\n * Determines if the provided string contains only HTTP token code points.\n *\n * @param {string} string The string to evaluate.\n * @returns {boolean} true if the string contains only HTTP token code points.\n */\nconst solelyContainsHTTPTokenCodePoints = (string) => httpTokenCodePoints.test(string);\n\n/**\n * Determines if the provided string contains only quoted HTTP token code points.\n *\n * @param {string} string The string to evaluate.\n * @returns {boolean} true if the string contains only quoted HTTP token code points.\n */\nconst solelyContainsHTTPQuotedStringTokenCodePoints = (string) => httpQuotedTokenCodePoints.test(string);\n\n/**\n * A function to lower case ASCII characters.\n * This implementation iterates over each element of the string, which is treated as an iterable.\n * The elements are destructured into [char, charCode] pairs, where char represents the character,\n * and charCode is assigned the character code using char.charCodeAt(0). If the charCode is not\n * provided, it falls back to the character code obtained from char.charCodeAt(0).\n *\n * @param {string} string The string to process.\n * @returns {string} The processed string with all ASCII characters lower cased.\n */\nconst asciiLowercase = (string) => {\n\tlet result = '';\n\tfor (const [char, charCode = char.charCodeAt(0)] of string) {\n\t\tresult += charCode >= 65 && charCode <= 90 ? String.fromCharCode(charCode + 32) : char;\n\t}\n\n\treturn result;\n};\n\n/**\n * Collects all the HTTP quoted strings.\n * This variant only implements it with the extract-value flag set.\n *\n * @param {string} input The string to process.\n * @param {number} position The starting position.\n * @returns {Array<string|number>} An array that includes the resulting string and updated position.\n */\nconst collectAnHTTPQuotedString = (input, position) => {\n\tlet value = '';\n\n\tfor (let length = input.length, char; ++position < length;) {\n\t\tchar = input[position];\n\n\t\tif (char == '\\\\') {\n\t\t\tvalue += ++position < length ? input[position] : char;\n\t\t} else if (char == '\"') {\n\t\t\tbreak;\n\t\t} else {\n\t\t\tvalue += char;\n\t\t}\n\t}\n\n\treturn [value, position];\n};\n\nexport { removeLeadingAndTrailingHTTPWhitespace, removeTrailingHTTPWhitespace, isHTTPWhitespaceChar, solelyContainsHTTPTokenCodePoints, solelyContainsHTTPQuotedStringTokenCodePoints, asciiLowercase, collectAnHTTPQuotedString };\n", "import { asciiLowercase, solelyContainsHTTPQuotedStringTokenCodePoints, solelyContainsHTTPTokenCodePoints } from './utils.js';\n\n/**\n * Class representing the parameters for a media type record.\n * This class has the equivalent surface API to a JavaScript {@link Map}.\n *\n * However, {@link MediaTypeParameters} methods will always interpret their arguments\n * as appropriate for media types, so parameter names will be lowercased,\n * and attempting to set invalid characters will throw an {@link Error}.\n *\n * @example charset=utf-8\n * @see https://mimesniff.spec.whatwg.org/#mime-type-essence\n * @see https://mimesniff.spec.whatwg.org/#mime-type-essence-record\n * @see https://mimesniff.spec.whatwg.org/#mime-type-essence-record-creation\n * @see https://mimesniff.spec.whatwg.org/#mime-type-essence-record-creation-algorithm\n * @module {MediaTypeParameters} media-type-parameters\n * @author D1g1talEntr0py <jason.dimeo@gmail.com>\n */\nexport default class MediaTypeParameters {\n\t/** @type {Map<string, string>} */\n\t#map;\n\n\t/**\n\t * Create a new MediaTypeParameters instance.\n\t *\n\t * @param {Array<Array<string>>} entries An array of [name, value] tuples.\n\t */\n\tconstructor(entries) {\n\t\tthis.#map = new Map(entries);\n\t}\n\n\t/**\n\t * Gets the number of media type parameters.\n\t *\n\t * @returns {number} The number of media type parameters\n\t */\n\tget size() {\n\t\treturn this.#map.size;\n\t}\n\n\t/**\n\t * Gets the media type parameter value for the supplied name.\n\t *\n\t * @param {string} name The name of the media type parameter to retrieve.\n\t * @returns {string} The media type parameter value.\n\t */\n\tget(name) {\n\t\treturn this.#map.get(asciiLowercase(String(name)));\n\t}\n\n\t/**\n\t * Indicates whether the media type parameter with the specified name exists or not.\n\t *\n\t * @param {string} name The name of the media type parameter to check.\n\t * @returns {boolean} true if the media type parameter exists, false otherwise.\n\t */\n\thas(name) {\n\t\treturn this.#map.has(asciiLowercase(String(name)));\n\t}\n\n\t/**\n\t * Adds a new media type parameter using the specified name and value to the MediaTypeParameters.\n\t * If an parameter with the same name already exists, the parameter will be updated.\n\t *\n\t * @param {string} name The name of the media type parameter to set.\n\t * @param {string} value The media type parameter value.\n\t * @returns {MediaTypeParameters} This instance.\n\t */\n\tset(name, value) {\n\t\tname = asciiLowercase(String(name));\n\t\tvalue = String(value);\n\n\t\tif (!solelyContainsHTTPTokenCodePoints(name)) {\n\t\t\tthrow new Error(`Invalid media type parameter name \"${name}\": only HTTP token code points are valid.`);\n\t\t}\n\n\t\tif (!solelyContainsHTTPQuotedStringTokenCodePoints(value)) {\n\t\t\tthrow new Error(`Invalid media type parameter value \"${value}\": only HTTP quoted-string token code points are valid.`);\n\t\t}\n\n\t\tthis.#map.set(name, value);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Clears all the media type parameters.\n\t */\n\tclear() {\n\t\tthis.#map.clear();\n\t}\n\n\t/**\n\t * Removes the media type parameter using the specified name.\n\t *\n\t * @param {string} name The name of the media type parameter to delete.\n\t * @returns {boolean} true if the parameter existed and has been removed, or false if the parameter does not exist.\n\t */\n\tdelete(name) {\n\t\tname = asciiLowercase(String(name));\n\t\treturn this.#map.delete(name);\n\t}\n\n\t/**\n\t * Executes a provided function once per each name/value pair in the MediaTypeParameters, in insertion order.\n\t *\n\t * @param {function(string, string): void} callback The function called on each iteration.\n\t * @param {*} [thisArg] Optional object when binding 'this' to the callback.\n\t */\n\tforEach(callback, thisArg) {\n\t\tthis.#map.forEach(callback, thisArg);\n\t}\n\n\t/**\n\t * Returns an iterable of parameter names.\n\t *\n\t * @returns {IterableIterator<string>} The {@link IterableIterator} of media type parameter names.\n\t */\n\tkeys() {\n\t\treturn this.#map.keys();\n\t}\n\n\t/**\n\t * Returns an iterable of parameter values.\n\t *\n\t * @returns {IterableIterator<string>} The {@link IterableIterator} of media type parameter values.\n\t */\n\tvalues() {\n\t\treturn this.#map.values();\n\t}\n\n\t/**\n\t * Returns an iterable of name, value pairs for every parameter entry in the media type parameters.\n\t *\n\t * @returns {IterableIterator<Array<Array<string>>>} The media type parameter entries.\n\t */\n\tentries() {\n\t\treturn this.#map.entries();\n\t}\n\n\t/**\n\t * A method that returns the default iterator for the {@link MediaTypeParameters}. Called by the semantics of the for-of statement.\n\t *\n\t * @returns {Iterator<string, string, undefined>} The {@link Symbol.iterator} for the media type parameters.\n\t */\n\t[Symbol.iterator]() {\n\t\treturn this.#map[Symbol.iterator]();\n\t}\n\n\t/**\n\t * Returns a string representation of the media type parameters.\n\t * This method is called by the `String()` function.\n\t *\n\t * @example\n\t * const parameters = new MediaTypeParameters(new Map([['charset', 'utf-8']]));\n\t * String(parameters); // 'charset=utf-8'\n\t * parameters.toString(); // 'charset=utf-8'\n\t * parameters + ''; // 'charset=utf-8'\n\t * `${parameters}`; // 'charset=utf-8'\n\t * parameters[Symbol.toStringTag]; // 'MediaTypeParameters'\n\t * parameters[Symbol.toStringTag](); // 'MediaTypeParameters'\n\t * Object.prototype.toString.call(parameters); // '[object MediaTypeParameters]'\n\t * parameters + ''; // 'charset=utf-8'\n\t * @returns {string} The string representation of the media type parameters.\n\t */\n\t[Symbol.toStringTag]() {\n\t\treturn 'MediaTypeParameters';\n\t}\n}", "import {\n\tasciiLowercase,\n\tcollectAnHTTPQuotedString, isHTTPWhitespaceChar, removeLeadingAndTrailingHTTPWhitespace,\n\tremoveTrailingHTTPWhitespace, solelyContainsHTTPQuotedStringTokenCodePoints, solelyContainsHTTPTokenCodePoints\n} from './utils.js';\n\n/**\n * Function to parse a media type.\n *\n * @module parser\n * @param {string} input The media type to parse\n * @returns {{ type: string, subtype: string, parameters: Map<string, string> }} An object populated with the parsed media type properties and any parameters.\n */\nconst parse = (input) => {\n\tinput = removeLeadingAndTrailingHTTPWhitespace(input);\n\n\tlet position = 0;\n\tlet type = '';\n\twhile (position < input.length && input[position] != '/') {\n\t\ttype += input[position];\n\t\t++position;\n\t}\n\n\tif (type.length === 0 || !solelyContainsHTTPTokenCodePoints(type)) {\n\t\treturn null;\n\t}\n\n\tif (position >= input.length) {\n\t\treturn null;\n\t}\n\n\t// Skips past \"/\"\n\t++position;\n\n\tlet subtype = '';\n\twhile (position < input.length && input[position] != ';') {\n\t\tsubtype += input[position];\n\t\t++position;\n\t}\n\n\tsubtype = removeTrailingHTTPWhitespace(subtype);\n\n\tif (subtype.length === 0 || !solelyContainsHTTPTokenCodePoints(subtype)) {\n\t\treturn null;\n\t}\n\n\tconst mediaType = {\n\t\ttype: asciiLowercase(type),\n\t\tsubtype: asciiLowercase(subtype),\n\t\tparameters: new Map()\n\t};\n\n\twhile (position < input.length) {\n\t\t// Skip past \";\"\n\t\t++position;\n\n\t\twhile (isHTTPWhitespaceChar(input[position])) {\n\t\t\t++position;\n\t\t}\n\n\t\tlet parameterName = '';\n\t\twhile (position < input.length && input[position] != ';' && input[position] != '=') {\n\t\t\tparameterName += input[position];\n\t\t\t++position;\n\t\t}\n\t\tparameterName = asciiLowercase(parameterName);\n\n\t\tif (position < input.length) {\n\t\t\tif (input[position] == ';') {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Skip past \"=\"\n\t\t\t++position;\n\t\t}\n\n\t\tlet parameterValue = null;\n\t\tif (input[position] == '\"') {\n\t\t\t[parameterValue, position] = collectAnHTTPQuotedString(input, position);\n\n\t\t\twhile (position < input.length && input[position] != ';') {\n\t\t\t\t++position;\n\t\t\t}\n\t\t} else {\n\t\t\tparameterValue = '';\n\t\t\twhile (position < input.length && input[position] != ';') {\n\t\t\t\tparameterValue += input[position];\n\t\t\t\t++position;\n\t\t\t}\n\n\t\t\tparameterValue = removeTrailingHTTPWhitespace(parameterValue);\n\n\t\t\tif (parameterValue === '') {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tif (parameterName.length > 0 &&\tsolelyContainsHTTPTokenCodePoints(parameterName) &&\tsolelyContainsHTTPQuotedStringTokenCodePoints(parameterValue) && !mediaType.parameters.has(parameterName)) {\n\t\t\tmediaType.parameters.set(parameterName, parameterValue);\n\t\t}\n\t}\n\n\treturn mediaType;\n};\n\nexport default parse;", "import { solelyContainsHTTPTokenCodePoints } from './utils.js';\n\n/** @typedef { import('./media-type.js').default } MediaType */\n\n/**\n * A function that serializes the provided {@link mediaType} to a string.\n *\n * @module serializer\n * @param {MediaType} mediaType The media type to serialize.\n * @returns {string} The serialized media type.\n */\nconst serialize = (mediaType) => {\n\tlet serialization = `${mediaType.type}/${mediaType.subtype}`;\n\n\tif (mediaType.parameters.size === 0) {\n\t\treturn serialization;\n\t}\n\n\tfor (let [name, value] of mediaType.parameters) {\n\t\tserialization += `;${name}=`;\n\n\t\tif (!solelyContainsHTTPTokenCodePoints(value) || value.length === 0) {\n\t\t\tvalue = `\"${value.replace(/([\"\\\\])/ug, '\\\\$1')}\"`;\n\t\t}\n\n\t\tserialization += value;\n\t}\n\n\treturn serialization;\n};\n\nexport default serialize;", "import MediaTypeParameters from './media-type-parameters.js';\nimport parse from './parser.js';\nimport serialize from './serializer.js';\nimport { asciiLowercase, solelyContainsHTTPTokenCodePoints } from './utils.js';\n\n/**\n * Class used to parse media types.\n *\n * @module {MediaType} media-type\n * @see https://mimesniff.spec.whatwg.org/#understanding-mime-types\n */\nexport default class MediaType {\n\t/** @type {string} */\n\t#type;\n\t/** @type {string} */\n\t#subtype;\n\t/** @type {MediaTypeParameters} */\n\t#parameters;\n\n\t/**\n\t * Create a new MediaType instance from a string representation.\n\t *\n\t * @param {string} mediaType The media type to parse.\n\t * @param {Object} [parameters] Optional parameters.\n\t */\n\tconstructor(mediaType, parameters = {}) {\n\t\tconst { type, subtype, parameters: parsedParameters } = parse(mediaType);\n\t\tthis.#type = type;\n\t\tthis.#subtype = subtype;\n\t\tthis.#parameters = new MediaTypeParameters([...parsedParameters, ...Object.entries(parameters).map(([name, value]) => [asciiLowercase(name), asciiLowercase(value)])]);\n\t}\n\n\t/**\n\t * Static factory method for parsing a media type.\n\t *\n\t * @param {string} string The media type to parse.\n\t * @returns {MediaType} The parsed {@link MediaType} object or null if the string could not be parsed.\n\t */\n\tstatic parse(string) {\n\t\ttry {\n\t\t\treturn new MediaType(string);\n\t\t} catch (e) {\n\t\t\tthrow new Error(`Could not parse media type string '${string}'`);\n\t\t}\n\t}\n\n\t/**\n\t * Gets the media type essence (type/subtype).\n\t *\n\t * @returns {string} The media type without any parameters\n\t */\n\tget essence() {\n\t\treturn `${this.#type}/${this.#subtype}`;\n\t}\n\n\t/**\n\t * Gets the type.\n\t *\n\t * @returns {string} The type.\n\t */\n\tget type() {\n\t\treturn this.#type;\n\t}\n\n\t/**\n\t * Sets the type.\n\t */\n\tset type(value) {\n\t\tvalue = asciiLowercase(String(value));\n\n\t\tif (value.length === 0) {\n\t\t\tthrow new Error('Invalid type: must be a non-empty string');\n\t\t}\n\t\tif (!solelyContainsHTTPTokenCodePoints(value)) {\n\t\t\tthrow new Error(`Invalid type ${value}: must contain only HTTP token code points`);\n\t\t}\n\n\t\tthis.#type = value;\n\t}\n\n\t/**\n\t * Gets the subtype.\n\t *\n\t * @returns {string} The subtype.\n\t */\n\tget subtype() {\n\t\treturn this.#subtype;\n\t}\n\n\t/**\n\t * Sets the subtype.\n\t */\n\tset subtype(value) {\n\t\tvalue = asciiLowercase(String(value));\n\n\t\tif (value.length === 0) {\n\t\t\tthrow new Error('Invalid subtype: must be a non-empty string');\n\t\t}\n\t\tif (!solelyContainsHTTPTokenCodePoints(value)) {\n\t\t\tthrow new Error(`Invalid subtype ${value}: must contain only HTTP token code points`);\n\t\t}\n\n\t\tthis.#subtype = value;\n\t}\n\n\t/**\n\t * Gets the parameters.\n\t *\n\t * @returns {MediaTypeParameters} The media type parameters.\n\t */\n\tget parameters() {\n\t\treturn this.#parameters;\n\t}\n\n\t/**\n\t * Gets the serialized version of the media type.\n\t *\n\t * @returns {string} The serialized media type.\n\t */\n\ttoString() {\n\t\t// The serialize function works on both 'media type records' (i.e. the results of parse) and on this class, since\n\t\t// this class's interface is identical.\n\t\treturn serialize(this);\n\t}\n\n\t/**\n\t * Determines if this instance is a JavaScript media type.\n\t *\n\t * @param {Object} [options] Optional options.\n\t * @param {boolean} [options.prohibitParameters=false] The option to prohibit parameters when checking if the media type is JavaScript.\n\t * @returns {boolean} true if this instance represents a JavaScript media type, false otherwise.\n\t */\n\tisJavaScript({prohibitParameters = false} = {}) {\n\t\tswitch (this.#type) {\n\t\t\tcase 'text': {\n\t\t\t\tswitch (this.#subtype) {\n\t\t\t\t\tcase 'ecmascript':\n\t\t\t\t\tcase 'javascript':\n\t\t\t\t\tcase 'javascript1.0':\n\t\t\t\t\tcase 'javascript1.1':\n\t\t\t\t\tcase 'javascript1.2':\n\t\t\t\t\tcase 'javascript1.3':\n\t\t\t\t\tcase 'javascript1.4':\n\t\t\t\t\tcase 'javascript1.5':\n\t\t\t\t\tcase 'jscript':\n\t\t\t\t\tcase 'livescript':\n\t\t\t\t\tcase 'x-ecmascript':\n\t\t\t\t\tcase 'x-javascript': return !prohibitParameters || this.#parameters.size === 0;\n\t\t\t\t\tdefault: return false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcase 'application': {\n\t\t\t\tswitch (this.#subtype) {\n\t\t\t\t\tcase 'ecmascript':\n\t\t\t\t\tcase 'javascript':\n\t\t\t\t\tcase 'x-ecmascript':\n\t\t\t\t\tcase 'x-javascript': return !prohibitParameters || this.#parameters.size === 0;\n\t\t\t\t\tdefault: return false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tdefault: return false;\n\t\t}\n\t}\n\n\t/**\n\t * Determines if this instance is an XML media type.\n\t *\n\t * @returns {boolean} true if this instance represents an XML media type, false otherwise.\n\t */\n\tisXML() {\n\t\treturn (this.#subtype === 'xml' && (this.#type === 'text' || this.#type === 'application')) || this.#subtype.endsWith('+xml');\n\t}\n\n\t/**\n\t * Determines if this instance is an HTML media type.\n\t *\n\t * @returns {boolean} true if this instance represents an HTML media type, false otherwise.\n\t */\n\tisHTML() {\n\t\treturn this.#subtype === 'html' && this.#type === 'text';\n\t}\n\n\t/**\n\t * Gets the name of the class.\n\t *\n\t * @returns {string} The class name\n\t */\n\tget [Symbol.toStringTag]() {\n\t\treturn 'MediaType';\n\t}\n}", "import HttpRequestMethod from './http-request-methods.js';\nimport { MediaType } from '@d1g1tal/media-type';\nimport HttpMediaType from './http-media-type.js';\n\n/** @typedef {'configured'|'success'|'error'|'aborted'|'timeout'|'complete'} RequestEvent */\n\n/** @type {string} */\nconst defaultCharset = 'utf-8';\n\n/** @type {RegExp} */\nconst endsWithSlashRegEx = /\\/$/;\n\n/** @typedef {Map<string, MediaType>} MediaTypeMap A map of media types. */\n\n/** @type {MediaTypeMap} */\nconst mediaTypes = new Map([\n\t[HttpMediaType.PNG, new MediaType(HttpMediaType.PNG)],\n\t[HttpMediaType.TEXT, new MediaType(HttpMediaType.TEXT, { defaultCharset })],\n\t[HttpMediaType.JSON, new MediaType(HttpMediaType.JSON, { defaultCharset })],\n\t[HttpMediaType.HTML, new MediaType(HttpMediaType.HTML, { defaultCharset })],\n\t[HttpMediaType.JAVA_SCRIPT, new MediaType(HttpMediaType.JAVA_SCRIPT, { defaultCharset })],\n\t[HttpMediaType.CSS, new MediaType(HttpMediaType.CSS, { defaultCharset })],\n\t[HttpMediaType.XML, new MediaType(HttpMediaType.XML, { defaultCharset })],\n\t[HttpMediaType.BIN, new MediaType(HttpMediaType.BIN)]\n]);\n\n/**\n * @static\n * @constant {Object<string, RequestEvent>}\n */\nconst RequestEvents = Object.freeze({\n\tCONFIGURED: 'configured',\n\tSUCCESS: 'success',\n\tERROR: 'error',\n\tABORTED: 'aborted',\n\tTIMEOUT: 'timeout',\n\tCOMPLETE: 'complete',\n\tALL_COMPLETE: 'all-complete'\n});\n\nconst SignalEvents = Object.freeze({\n\tABORT: 'abort',\n\tTIMEOUT: 'timeout'\n});\n\nconst _abortEvent = new CustomEvent(SignalEvents.ABORT, { detail: { cause: new DOMException('The request was aborted', 'AbortError') } });\n\nconst requestBodyMethods = [ HttpRequestMethod.POST, HttpRequestMethod.PUT, HttpRequestMethod.PATCH ];\n\nexport { defaultCharset, endsWithSlashRegEx, mediaTypes, RequestEvents, SignalEvents, _abortEvent as abortEvent, requestBodyMethods };", "import { SignalEvents, abortEvent } from './constants.js';\n\nconst NativeAbortSignal = globalThis.AbortSignal;\n\n/**\n * @typedef {function(Event):void} EventListener\n * @param {Event} event The event object\n */\n\nexport default class AbortSignal extends EventTarget {\n\t/** @type {AbortController} */\n\t#abortController;\n\t/** @type {number} */\n\t#timeoutId;\n\n\t/**\n\t * @param {AbortSignal} signal The signal to listen to\n\t */\n\tconstructor(signal) {\n\t\tsuper();\n\t\tthis.#abortController = new AbortController();\n\t\tsignal?.addEventListener(SignalEvents.ABORT, (event) => this.#abort(event));\n\t}\n\n\t/**\n\t * Returns an {@link AbortSignal} instance that is already set as aborted.\n\t *\n\t * @static\n\t * @returns {AbortSignal} The abort signal\n\t */\n\tstatic abort() {\n\t\treturn NativeAbortSignal.abort();\n\t}\n\n\t/**\n\t * Returns an AbortSignal instance that will automatically abort after a specified time.\n\t *\n\t * @static\n\t * @param {number} time The time in milliseconds to wait before aborting\n\t * @returns {AbortSignal} The abort signal\n\t */\n\tstatic timeout(time) {\n\t\treturn NativeAbortSignal.timeout(time);\n\t}\n\n\t/**\n\t * The aborted property is a Boolean that indicates whether the request has been aborted (true) or not (false).\n\t *\n\t * @returns {boolean} Whether the signal was aborted or not\n\t */\n\tget aborted() {\n\t\treturn this.#abortController.signal.aborted;\n\t}\n\n\t/**\n\t * The reason property returns a DOMException object indicating the reason the operation was aborted, or null if the operation is not aborted.\n\t *\n\t * @returns {DOMException} The reason the signal was aborted\n\t */\n\tget reason() {\n\t\treturn this.#abortController.signal.reason;\n\t}\n\n\t/**\n\t * throws the signal's abort reason if the signal has been aborted; otherwise it does nothing.\n\t *\n\t * @returns {void}\n\t */\n\tthrowIfAborted() {\n\t\tthis.#abortController.signal.throwIfAborted();\n\t}\n\n\t/**\n\t * Returns an AbortSignal instance that will be aborted when the provided amount of milliseconds have passed.\n\t * A value of -1 (which is the default) means there is no timeout.\n\t * Note: You can't set this property to a value less than 0.\n\t *\n\t * @param {number} timeout The timeout in milliseconds\n\t * @returns {AbortSignal} The abort signal\n\t */\n\twithTimeout(timeout) {\n\t\tif (timeout < 0) {\n\t\t\tthrow new RangeError('The timeout cannot be negative');\n\t\t}\n\n\t\tthis.#timeoutId ??= setTimeout(() => this.#abort(AbortSignal.#generateTimeoutEvent(timeout), true), timeout);\n\n\t\treturn this.#abortController.signal;\n\t}\n\n\t/**\n\t * Clears the timeout.\n\t * Note: This does not abort the signal, dispatch the timeout event, or reset the timeout.\n\t *\n\t * @returns {void}\n\t */\n\tclearTimeout() {\n\t\tclearTimeout(this.#timeoutId);\n\t}\n\n\t/**\n\t * Adds an event listener for the specified event type.\n\t *\n\t * @override\n\t * @param {string} eventName The name of the event to listen to\n\t * @param {EventListener} listener The listener to add\n\t * @returns {void}\n\t */\n\taddEventListener(eventName, listener) {\n\t\tthis.#abortController.signal.addEventListener(eventName, listener);\n\t}\n\n\t/**\n\t * Dispatches an event to this EventTarget.\n\t *\n\t * @override\n\t * @param {Event} event The event to dispatch\n\t * @returns {boolean} Whether the event was dispatched or not\n\t */\n\tdispatchEvent(event) {\n\t\treturn this.#abortController.signal.dispatchEvent(event);\n\t}\n\n\t/**\n\t * Removes an event listener for the specified event type.\n\t *\n\t * @override\n\t * @param {string} eventName The name of the event to listen to\n\t * @param {EventListener} listener The listener to remove\n\t * @returns {void}\n\t */\n\tremoveEventListener(eventName, listener) {\n\t\tthis.#abortController.signal.removeEventListener(eventName, listener);\n\t}\n\n\t/**\n\t * Aborts the signal. This is so naughty. \u00AF\\_(\u30C4)_/\u00AF\n\t *\n\t * @param {Event} event The event to abort with\n\t * @returns {void}\n\t */\n\tabort(event) {\n\t\tthis.#abort(event);\n\t}\n\n\t/**\n\t * Aborts the signal.\n\t *\n\t * @private\n\t * @param {Event} event The event to abort with\n\t * @param {boolean} [dispatchEvent = false] Whether to dispatch the event or not\n\t * @returns {void}\n\t * @fires SignalEvents.ABORT When the signal is aborted\n\t * @fires SignalEvents.TIMEOUT When the signal times out\n\t */\n\t#abort(event = abortEvent, dispatchEvent = false) {\n\t\tclearTimeout(this.#timeoutId);\n\t\tthis.#abortController.abort(event.detail?.cause);\n\t\tif (dispatchEvent) {\n\t\t\tthis.#abortController.signal.dispatchEvent(event);\n\t\t}\n\t}\n\n\t/**\n\t * Generates a timeout event.\n\t *\n\t * @private\n\t * @static\n\t * @param {number} timeout The timeout in milliseconds\n\t * @returns {CustomEvent} The timeout event\n\t */\n\tstatic #generateTimeoutEvent(timeout) {\n\t\treturn new CustomEvent(SignalEvents.TIMEOUT, { detail: { timeout, cause: new DOMException(`The request timed-out after ${timeout / 1000} seconds`, 'TimeoutError') } });\n\t}\n}", "/** @typedef {Object.prototype.constructor} Type */\n\n/**\n * Gets the object type for the current instance.\n *\n * @param {*} object The object to check\n * @returns {Type} The object type\n */\nconst _type = (object) => object?.constructor ?? object?.prototype?.constructor ?? globalThis[Object.prototype.toString.call(object).slice(8, -1)] ?? object;\n\nexport default _type;", "import _type from './object-type.js';\n\n/**\n * Performs a deep merge of multiple objects.\n *\n * @param {...Object} objects The objects to merge\n * @returns {Object} The merged object\n */\nconst _objectMerge = (...objects) => {\n\tconst target = {};\n\tfor (const source of objects) {\n\t\tif (_type(source) != Object) return undefined;\n\n\t\tlet descriptor, sourceType;\n\t\tfor (const property of Object.getOwnPropertyNames(source)) {\n\t\t\tdescriptor = Object.getOwnPropertyDescriptor(source, property);\n\t\t\tif (descriptor.enumerable) {\n\t\t\t\tsourceType = _type(source[property]);\n\t\t\t\tif (sourceType == Object) {\n\t\t\t\t\tdescriptor.value = _type(target[property]) == Object ? _objectMerge(target[property], source[property]) : { ...source[property] };\n\t\t\t\t} else if (sourceType == Array) {\n\t\t\t\t\tdescriptor.value = Array.isArray(target[property]) ? [ ...new Set([ ...source[property], ...target[property] ]) ] : [ ...source[property] ];\n\t\t\t\t}\n\n\t\t\t\ttarget[property] = descriptor.value;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn target;\n};\n\nexport default _objectMerge;"],
|
|
5
|
-
"mappings": "2bAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,ICcA,IAAMC,EAAN,cAA0B,GAAI,CAU7B,IAAIC,EAAKC,EAAO,CACf,aAAM,IAAID,GAAM,MAAM,IAAIA,CAAG,GAAK,IAAI,KAAO,IAAIC,CAAK,CAAC,EAEhD,IACR,CASA,SAASD,EAAKC,EAAO,CACpB,IAAMC,EAAS,MAAM,IAAIF,CAAG,EAE5B,OAAOE,EAASA,EAAO,IAAID,CAAK,EAAI,EACrC,CASA,YAAYD,EAAKC,EAAO,CACvB,IAAMC,EAAS,MAAM,IAAIF,CAAG,EAC5B,OAAIE,EAAiBA,EAAO,OAAOD,CAAK,EAEjC,EACR,CAEA,IAAK,OAAO,WAAW,GAAI,CAC1B,MAAO,aACR,CACD,EAEOE,EAAQJ,ECz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rF,IAAK,eAAgB,OAAOnB,EAAWoB,GAAuB,IAAID,EAAc,OAAO,EACvF,QAAS,OAAOjC,EAAW,IAAImC,EAAenC,EAAS,OAAQA,EAAS,UAAU,EAAI,IAAImC,EAAe,IAAK,uBAAuB,CACtI,CACD,CAUAwB,GAAanC,EAAKC,EAAS,CAC1B,IAAMoC,EAAQ,IAAIT,EAAU,gDAAgD5B,CAAG,IAAKC,CAAO,EAC3F,YAAK4B,GAAS,CAAE,KAAMpB,EAAc,MAAO,KAAM4B,CAAM,CAAC,EAEjDA,CACR,CAaAR,GAAS,CAAE,KAAAoB,EAAM,MAAApC,EAAQ,IAAI,YAAYoC,CAAI,EAAG,KAAAY,EAAM,OAAAC,EAAS,EAAK,EAAI,CAAC,EAAG,CACvEA,GAAUxE,EAAWI,GAAiB,QAAQuD,EAAMpC,EAAOgD,CAAI,EACnE,KAAKpE,GAAW,QAAQwD,EAAMpC,EAAOgD,CAAI,CAC1C,CASA3B,GAAoBoB,EAAa,CAChC,IAAIxC,EACEyC,EAAYC,EAAU,MAAMF,CAAW,EAE7C,GAAIC,GACH,OAAW,CAAC9B,EAAiBsC,CAAY,IAAKzE,EAAWO,GACxD,GAAIkE,EAAa,IAAIR,EAAU,IAAI,GAAKQ,EAAa,IAAIR,EAAU,OAAO,EAAG,CAC5EzC,EAAUW,EACV,KACD,EAIF,OAAOX,CACR,CAQA,IAAK,OAAO,WAAW,GAAI,CAC1B,MAAO,YACR,CACD",
|
|
4
|
+
"sourcesContent": ["import SetMultiMap from '@d1g1tal/collections/set-multi-map.js';\nimport Subscribr from '@d1g1tal/subscribr';\nimport HttpError from './http-error.js';\nimport HttpMediaType from './http-media-type.js';\nimport HttpRequestHeader from './http-request-headers.js';\nimport HttpRequestMethod from './http-request-methods.js';\nimport HttpResponseHeader from './http-response-headers.js';\nimport ResponseStatus from './response-status.js';\nimport ParameterMap from './parameter-map.js';\nimport AbortSignal from './abort-signal.js';\nimport { MediaType } from '@d1g1tal/media-type';\nimport { _objectMerge, _objectIsEmpty, _type } from '@d1g1tal/chrysalis';\nimport { mediaTypes, endsWithSlashRegEx, RequestEvents, SignalEvents, abortEvent, requestBodyMethods } from './constants.js';\n\n/**\n * @template T extends ResponseBody\n * @typedef {function(Response): Promise<T>} ResponseHandler<T>\n */\n\n/**\n * @typedef {Object} ContextEventHandler\n * @property {*} context The context object.\n * @property {function(*): void} eventHandler The event handler.\n */\n\n/**\n * @typedef {Object} EventRegistration\n * @property {string} eventName The name of the event to subscribe to.\n * @property {ContextEventHandler} contextEventHandler The context event handler.\n */\n\n/** @typedef {Object.prototype.constructor} Type */\n/** @typedef {Object<string, (boolean|string|number|Array)>} JsonObject */\n/** @typedef {'configured'|'success'|'error'|'aborted'|'timeout'|'complete'} TransportrEvent */\n/** @typedef {Blob|ArrayBuffer|TypedArray|DataView|FormData|URLSearchParams|string|ReadableStream} RequestBody */\n/** @typedef {JsonObject|Document|DocumentFragment|Blob|ArrayBuffer|FormData|string|ReadableStream<Uint8Array>} ResponseBody */\n/** @typedef {'default'|'force-cache'|'no-cache'|'no-store'|'only-if-cached'|'reload'} RequestCache */\n/** @typedef {'include'|'omit'|'same-origin'} RequestCredentials */\n/** @typedef {Headers|Object<string, string>} RequestHeaders */\n/** @typedef {'GET'|'POST'|'PUT'|'PATCH'|'DELETE'|'HEAD'|'OPTIONS'} RequestMethod */\n/** @typedef {'cors'|'navigate'|'no-cors'|'same-origin'} RequestMode */\n/** @typedef {'error'|'follow'|'manual'} RequestRedirect */\n/** @typedef {URLSearchParams|FormData|Object<string, string>|string} SearchParameters */\n/** @typedef {''|'no-referrer'|'no-referrer-when-downgrade'|'origin'|'origin-when-cross-origin'|'same-origin'|'strict-origin'|'strict-origin-when-cross-origin'|'unsafe-url'} ReferrerPolicy */\n/** @typedef {Int8Array|Uint8Array|Uint8ClampedArray|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array|BigInt64Array|BigUint64Array} TypedArray */\n\n/**\n * The options for a {@link Request} object or the second parameter of a {@link fetch} request\n *\n * @typedef {Object} RequestOptions\n * @property {RequestBody} body A RequestInit object or null to set request's body.\n * @property {RequestCache} cache A string indicating how the request will interact with the browser's cache to set request's cache.\n * @property {RequestCredentials} credentials A string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL. Sets request's credentials.\n * @property {RequestHeaders} headers A Headers object, an object literal, or an array of two-item arrays to set request's headers.\n * @property {SearchParameters} searchParams The parameters to be added to the URL for the request.\n * @property {string} integrity A cryptographic hash of the resource to be fetched by request. Sets request's integrity.\n * @property {boolean} keepalive A boolean to set request's keepalive.\n * @property {RequestMethod} method A string to set request's method.\n * @property {RequestMode} mode A string to indicate whether the request will use CORS, or will be restricted to same-origin URLs. Sets request's mode.\n * @property {RequestRedirect} redirect A string indicating whether request follows redirects, results in an error upon encountering a redirect, or returns the redirect (in an opaque fashion). Sets request's redirect.\n * @property {string} referrer A string whose value is a same-origin URL, \"about:client\", or the empty string, to set request's referrer.\n * @property {ReferrerPolicy} referrerPolicy A referrer policy to set request's referrerPolicy.\n * @property {AbortSignal} signal An AbortSignal to set request's signal.\n * @property {number} timeout A number representing a timeout in milliseconds for request.\n * @property {boolean} global If true, it will trigger the global event handlers. Defaults to true.\n * @property {null} window Can only be null. Used to disassociate request from any Window.\n */\n\n/** @type {ResponseHandler<string>} */\nconst _handleText = async (response) => await response.text();\n\n/** @type {ResponseHandler<void>} */\nconst _handleScript = async (response) => {\n\tconst objectURL = URL.createObjectURL(await response.blob());\n\n\tdocument.head.removeChild(document.head.appendChild(Object.assign(document.createElement('script'), { src: objectURL, type: HttpMediaType.JAVA_SCRIPT, async: true })));\n\n\tURL.revokeObjectURL(objectURL);\n\n\treturn Promise.resolve();\n};\n\n/** @type {ResponseHandler<void>} */\nconst _handleCss = async (response) => {\n\tconst objectURL = URL.createObjectURL(await response.blob());\n\n\tdocument.head.appendChild(Object.assign(document.createElement('link'), { href: objectURL, type: HttpMediaType.CSS, rel: 'stylesheet' }));\n\n\tURL.revokeObjectURL(objectURL);\n\n\treturn Promise.resolve();\n};\n\n/** @type {ResponseHandler<JsonObject>} */\nconst _handleJson = async (response) => await response.json();\n\n/** @type {ResponseHandler<Blob>} */\nconst _handleBlob = async (response) => await response.blob();\n\n/** @type {ResponseHandler<string>} */\nconst _handleImage = async (response) => URL.createObjectURL(await response.blob());\n\n/** @type {ResponseHandler<ArrayBuffer>} */\nconst _handleBuffer = async (response) => await response.arrayBuffer();\n\n/** @type {ResponseHandler<ReadableStream<Uint8Array>>} */\nconst _handleReadableStream = async (response) => response.body;\n\n/** @type {ResponseHandler<Document>} */\nconst _handleXml = async (response) => new DOMParser().parseFromString(await response.text(), HttpMediaType.XML);\n\n/** @type {ResponseHandler<Document>} */\nconst _handleHtml = async (response) => new DOMParser().parseFromString(await response.text(), HttpMediaType.HTML);\n\n/** @type {ResponseHandler<DocumentFragment>} */\nconst _handleHtmlFragment = async (response) => document.createRange().createContextualFragment(await response.text());\n\n/**\n * A wrapper around the fetch API that makes it easier to make HTTP requests.\n *\n * @module {Transportr} transportr\n * @author D1g1talEntr0py <jason.dimeo@gmail.com>\n */\nexport default class Transportr {\n\t/** @type {URL} */\n\t#baseUrl;\n\t/** @type {RequestOptions} */\n\t#options;\n\t/** @type {Subscribr} */\n\t#subscribr;\n\t/** @type {Subscribr} */\n\tstatic #globalSubscribr = new Subscribr();\n\t/** @type {Set<AbortSignal>} */\n\tstatic #activeRequests = new Set();\n\t/** @type {SetMultiMap<ResponseHandler<ResponseBody>, string>} */\n\tstatic #contentTypeHandlers = new SetMultiMap([\n\t\t[_handleImage, mediaTypes.get(HttpMediaType.PNG).type],\n\t\t[_handleText, mediaTypes.get(HttpMediaType.TEXT).type],\n\t\t[_handleJson, mediaTypes.get(HttpMediaType.JSON).subtype],\n\t\t[_handleHtml, mediaTypes.get(HttpMediaType.HTML).subtype],\n\t\t[_handleScript, mediaTypes.get(HttpMediaType.JAVA_SCRIPT).subtype],\n\t\t[_handleCss, mediaTypes.get(HttpMediaType.CSS).subtype],\n\t\t[_handleXml, mediaTypes.get(HttpMediaType.XML).subtype],\n\t\t[_handleReadableStream, mediaTypes.get(HttpMediaType.BIN).subtype]\n\t]);\n\n\t/**\n\t * Create a new Transportr instance with the provided location or origin and context path.\n\t *\n\t * @param {URL|string|RequestOptions} [url=location.origin] The URL for {@link fetch} requests.\n\t * @param {RequestOptions} [options={}] The default {@link RequestOptions} for this instance.\n\t */\n\tconstructor(url = globalThis.location.origin, options = {}) {\n\t\tif (_type(url) == Object) { [ url, options ] = [ globalThis.location.origin, url ] }\n\n\t\tthis.#baseUrl = Transportr.#getBaseUrl(url);\n\t\tthis.#options = Transportr.#createOptions(options, Transportr.#defaultRequestOptions);\n\t\tthis.#subscribr = new Subscribr();\n\t}\n\n\t/**\n\t * @static\n\t * @constant {Object<string, HttpRequestMethod>}\n\t */\n\tstatic Method = Object.freeze(HttpRequestMethod);\n\n\t/**\n\t * @static\n\t * @constant {Object<string, HttpMediaType>}\n\t */\n\tstatic MediaType = Object.freeze(HttpMediaType);\n\n\t/**\n\t * @static\n\t * @see {@link HttpRequestHeader}\n\t * @constant {Object<string, HttpRequestHeader>}\n\t */\n\tstatic RequestHeader = Object.freeze(HttpRequestHeader);\n\n\t/**\n\t * @static\n\t * @constant {Object<string, HttpResponseHeader>}\n\t */\n\tstatic ResponseHeader = Object.freeze(HttpResponseHeader);\n\n\t/**\n\t * @static\n\t * @constant {Object<string, RequestCache>}\n\t */\n\tstatic CachingPolicy = Object.freeze({\n\t\tDEFAULT: 'default',\n\t\tFORCE_CACHE: 'force-cache',\n\t\tNO_CACHE: 'no-cache',\n\t\tNO_STORE: 'no-store',\n\t\tONLY_IF_CACHED: 'only-if-cached',\n\t\tRELOAD: 'reload'\n\t});\n\n\t/**\n\t * @static\n\t * @constant {Object<string, RequestCredentials>}\n\t */\n\tstatic CredentialsPolicy = Object.freeze({\n\t\tINCLUDE: 'include',\n\t\tOMIT: 'omit',\n\t\tSAME_ORIGIN: 'same-origin'\n\t});\n\n\t/**\n\t * @static\n\t * @constant {Object<string, RequestMode>}\n\t */\n\tstatic RequestMode = Object.freeze({\n\t\tCORS: 'cors',\n\t\tNAVIGATE: 'navigate',\n\t\tNO_CORS: 'no-cors',\n\t\tSAME_ORIGIN: 'same-origin'\n\t});\n\n\t/**\n\t * @static\n\t * @constant {Object<string, RequestRedirect>}\n\t */\n\tstatic RedirectPolicy = Object.freeze({\n\t\tERROR: 'error',\n\t\tFOLLOW: 'follow',\n\t\tMANUAL: 'manual'\n\t});\n\n\t/**\n\t * @static\n\t * @constant {Object<string, ReferrerPolicy>}\n\t */\n\tstatic ReferrerPolicy = Object.freeze({\n\t\tNO_REFERRER: 'no-referrer',\n\t\tNO_REFERRER_WHEN_DOWNGRADE: 'no-referrer-when-downgrade',\n\t\tORIGIN: 'origin',\n\t\tORIGIN_WHEN_CROSS_ORIGIN: 'origin-when-cross-origin',\n\t\tSAME_ORIGIN: 'same-origin',\n\t\tSTRICT_ORIGIN: 'strict-origin',\n\t\tSTRICT_ORIGIN_WHEN_CROSS_ORIGIN: 'strict-origin-when-cross-origin',\n\t\tUNSAFE_URL: 'unsafe-url'\n\t});\n\n\t/**\n\t * @static\n\t * @constant {Object<string, TransportrEvent>}\n\t */\n\tstatic Events = RequestEvents;\n\n\t/**\n\t * @private\n\t * @static\n\t * @type {RequestOptions}\n\t */\n\tstatic #defaultRequestOptions = Object.freeze({\n\t\tbody: null,\n\t\tcache: Transportr.CachingPolicy.NO_STORE,\n\t\tcredentials: Transportr.CredentialsPolicy.SAME_ORIGIN,\n\t\theaders: { [HttpRequestHeader.CONTENT_TYPE]: mediaTypes.get(HttpMediaType.JSON).toString(), [HttpRequestHeader.ACCEPT]: mediaTypes.get(HttpMediaType.JSON).toString() },\n\t\tsearchParams: {},\n\t\tintegrity: undefined,\n\t\tkeepalive: undefined,\n\t\tmethod: HttpRequestMethod.GET,\n\t\tmode: Transportr.RequestMode.CORS,\n\t\tredirect: Transportr.RedirectPolicy.FOLLOW,\n\t\treferrer: 'about:client',\n\t\treferrerPolicy: Transportr.ReferrerPolicy.STRICT_ORIGIN_WHEN_CROSS_ORIGIN,\n\t\tsignal: undefined,\n\t\ttimeout: 30000,\n\t\tglobal: true,\n\t\twindow: null\n\t});\n\n\t/**\n\t * @private\n\t * @static\n\t * @type {Map<TransportrEvent, ResponseStatus>}\n\t */\n\tstatic #eventResponseStatuses = new Map([\n\t\t[RequestEvents.ABORTED, new ResponseStatus(499, 'Aborted')],\n\t\t[RequestEvents.TIMEOUT, new ResponseStatus(504, 'Gateway Timeout')]\n\t]);\n\n\t/**\n\t * Returns a {@link AbortSignal} used for aborting requests.\n\t *\n\t * @static\n\t * @returns {AbortSignal} A new {@link AbortSignal} instance.\n\t */\n\tstatic abortSignal() {\n\t\treturn new AbortSignal();\n\t}\n\n\t/**\n\t * Returns a {@link EventRegistration} used for subscribing to global events.\n\t *\n\t * @static\n\t * @param {TransportrEvent} event The event to subscribe to.\n\t * @param {function(Event, *): void} handler The event handler.\n\t * @param {*} context The context to bind the handler to.\n\t * @returns {EventRegistration} A new {@link EventRegistration} instance.\n\t */\n\tstatic register(event, handler, context) {\n\t\treturn Transportr.#globalSubscribr.subscribe(event, handler, context);\n\t}\n\n\t/**\n\t * Removes a {@link EventRegistration} from the global event handler.\n\t *\n\t * @static\n\t * @param {EventRegistration} eventRegistration The {@link EventRegistration} to remove.\n\t * @returns {boolean} True if the {@link EventRegistration} was removed, false otherwise.\n\t */\n\tstatic unregister(eventRegistration) {\n\t\treturn Transportr.#globalSubscribr.unsubscribe(eventRegistration);\n\t}\n\n\t/**\n\t * Aborts all active requests.\n\t * This is useful for when the user navigates away from the current page.\n\t * This will also clear the {@link Transportr#activeRequests} set.\n\t *\n\t * @static\n\t * @returns {void}\n\t */\n\tstatic abortAll() {\n\t\tfor (const abortSignal of this.#activeRequests) {\n\t\t\tabortSignal.abort(abortEvent);\n\t\t}\n\n\t\t// Clear the array after aborting all requests\n\t\tthis.#activeRequests.clear();\n\t}\n\n\t/**\n\t * It returns the base {@link URL} for the API.\n\t *\n\t * @returns {URL} The baseUrl property.\n\t */\n\tget baseUrl() {\n\t\treturn this.#baseUrl;\n\t}\n\n\t/**\n\t * Registers an event handler with a {@link Transportr} instance.\n\t *\n\t * @param {TransportrEvent} event The name of the event to listen for.\n\t * @param {function(Event, *): void} handler The function to call when the event is triggered.\n\t * @param {*} [context] The context to bind to the handler.\n\t * @returns {EventRegistration} An object that can be used to remove the event handler.\n\t */\n\tregister(event, handler, context) {\n\t\treturn this.#subscribr.subscribe(event, handler, context);\n\t}\n\n\t/**\n\t * Unregisters an event handler from a {@link Transportr} instance.\n\t *\n\t * @param {EventRegistration} eventRegistration The event registration to remove.\n\t * @returns {void}\n\t */\n\tunregister(eventRegistration) {\n\t\tthis.#subscribr.unsubscribe(eventRegistration);\n\t}\n\n\t/**\n\t * This function returns a promise that resolves to the result of a request to the specified path with\n\t * the specified options, where the method is GET.\n\t *\n\t * @async\n\t * @param {string} [path] The path to the resource you want to get.\n\t * @param {RequestOptions} [options] The options for the request.\n\t * @returns {Promise<ResponseBody>} A promise that resolves to the response of the request.\n\t */\n\tasync get(path, options) {\n\t\treturn this.#get(path, options);\n\t}\n\n\t/**\n\t * This function makes a POST request to the given path with the given body and options.\n\t *\n\t * @async\n\t * @param {string} [path] The path to the endpoint you want to call.\n\t * @param {RequestBody} body The body of the request.\n\t * @param {RequestOptions} [options] The options for the request.\n\t * @returns {Promise<ResponseBody>} A promise that resolves to the response body.\n\t */\n\tasync post(path, body, options) {\n\t\treturn this.#request(path, { ...options, body }, { method: HttpRequestMethod.POST });\n\t}\n\n\t/**\n\t * This function returns a promise that resolves to the result of a request to the specified path with\n\t * the specified options, where the method is PUT.\n\t *\n\t * @async\n\t * @param {string} [path] The path to the endpoint you want to call.\n\t * @param {RequestOptions} [options] The options for the request.\n\t * @returns {Promise<ResponseBody>} The return value of the #request method.\n\t */\n\tasync put(path, options) {\n\t\treturn this.#request(path, options, { method: HttpRequestMethod.PUT });\n\t}\n\n\t/**\n\t * It takes a path and options, and returns a request with the method set to PATCH.\n\t *\n\t * @async\n\t * @param {string} [path] The path to the endpoint you want to hit.\n\t * @param {RequestOptions} [options] The options for the request.\n\t * @returns {Promise<ResponseBody>} A promise that resolves to the response of the request.\n\t */\n\tasync patch(path, options) {\n\t\treturn this.#request(path, options, { method: HttpRequestMethod.PATCH });\n\t}\n\n\t/**\n\t * It takes a path and options, and returns a request with the method set to DELETE.\n\t *\n\t * @async\n\t * @param {string} [path] The path to the resource you want to access.\n\t * @param {RequestOptions} [options] The options for the request.\n\t * @returns {Promise<ResponseBody>} The result of the request.\n\t */\n\tasync delete(path, options) {\n\t\treturn this.#request(path, options, { method: HttpRequestMethod.DELETE });\n\t}\n\n\t/**\n\t * Returns the response headers of a request to the given path.\n\t *\n\t * @async\n\t * @param {string} [path] The path to the resource you want to access.\n\t * @param {RequestOptions} [options] The options for the request.\n\t * @returns {Promise<ResponseBody>} A promise that resolves to the response object.\n\t */\n\tasync head(path, options) {\n\t\treturn this.#request(path, options, { method: HttpRequestMethod.HEAD });\n\t}\n\n\t/**\n\t * It returns a promise that resolves to the allowed request methods for the given resource path.\n\t *\n\t * @async\n\t * @param {string} [path] The path to the resource.\n\t * @param {RequestOptions} [options] The options for the request.\n\t * @returns {Promise<string[]>} A promise that resolves to an array of allowed request methods for this resource.\n\t */\n\tasync options(path, options) {\n\t\tconst response = await this.#request(path, options, { method: HttpRequestMethod.OPTIONS });\n\n\t\treturn response.headers.get('allow').split(',').map((method) => method.trim());\n\t}\n\n\t/**\n\t * It takes a path and options, and makes a request to the server.\n\t *\n\t * @async\n\t * @param {string} [path] The path to the endpoint you want to hit.\n\t * @param {RequestOptions} [userOptions] The options for the request.\n\t * @returns {Promise<ResponseBody>} The return value of the function is the return value of the function that is passed to the `then` method of the promise returned by the `fetch` method.\n\t */\n\tasync request(path, userOptions) {\n\t\treturn this.#request(path, userOptions, {}, (response) => response);\n\t}\n\n\t/**\n\t * It gets a JSON resource from the server.\n\t *\n\t * @async\n\t * @param {string} [path] The path to the resource.\n\t * @param {RequestOptions} [options] The options object to pass to the request.\n\t * @returns {Promise<JsonObject>} A promise that resolves to the response body as a JSON object.\n\t */\n\tasync getJson(path, options) {\n\t\treturn this.#get(path, options, { headers: { [HttpRequestHeader.ACCEPT]: mediaTypes.get(HttpMediaType.JSON).toString() } }, _handleJson);\n\t}\n\n\t/**\n\t * It gets the XML representation of the resource at the given path.\n\t *\n\t * @async\n\t * @param {string} [path] The path to the resource you want to get.\n\t * @param {RequestOptions} [options] The options for the request.\n\t * @returns {Promise<Document>} The result of the function call to #get.\n\t */\n\tasync getXml(path, options) {\n\t\treturn this.#get(path, options, { headers: { [HttpRequestHeader.ACCEPT]: mediaTypes.get(HttpMediaType.XML).toString() } }, _handleXml);\n\t}\n\n\t/**\n\t * Get the HTML content of the specified path.\n\t *\n\t * @todo Add way to return portion of the retrieved HTML using a selector. Like jQuery.\n\t * @async\n\t * @param {string} [path] The path to the resource.\n\t * @param {RequestOptions} [options] The options for the request.\n\t * @returns {Promise<Document>} The return value of the function is the return value of the function passed to the `then`\n\t * method of the promise returned by the `#get` method.\n\t */\n\tasync getHtml(path, options) {\n\t\treturn this.#get(path, options, { headers: { [HttpRequestHeader.ACCEPT]: mediaTypes.get(HttpMediaType.HTML).toString() } }, _handleHtml);\n\t}\n\n\t/**\n\t * It returns a promise that resolves to the HTML fragment at the given path.\n\t *\n\t * @todo Add way to return portion of the retrieved HTML using a selector. Like jQuery.\n\t * @async\n\t * @param {string} [path] The path to the resource.\n\t * @param {RequestOptions} [options] The options for the request.\n\t * @returns {Promise<DocumentFragment>} A promise that resolves to an HTML fragment.\n\t */\n\tasync getHtmlFragment(path, options) {\n\t\treturn this.#get(path, options, { headers: { [HttpRequestHeader.ACCEPT]: mediaTypes.get(HttpMediaType.HTML).toString() } }, _handleHtmlFragment);\n\t}\n\n\t/**\n\t * It gets a script from the server, and appends the script to the {@link Document} {@link HTMLHeadElement}\n\t * CORS is enabled by default.\n\t *\n\t * @async\n\t * @param {string} [path] The path to the script.\n\t * @param {RequestOptions} [options] The options for the request.\n\t * @returns {Promise<void>} A promise that has been resolved.\n\t */\n\tasync getScript(path, options) {\n\t\treturn this.#get(path, options, { headers: { [HttpRequestHeader.ACCEPT]: mediaTypes.get(HttpMediaType.JAVA_SCRIPT).toString() } }, _handleScript);\n\t}\n\n\t/**\n\t * Gets a stylesheet from the server, and adds it as a {@link Blob} {@link URL}.\n\t *\n\t * @async\n\t * @param {string} [path] The path to the stylesheet.\n\t * @param {RequestOptions} [options] The options for the request.\n\t * @returns {Promise<void>} A promise that has been resolved.\n\t */\n\tasync getStylesheet(path, options) {\n\t\treturn this.#get(path, options, { headers: { [HttpRequestHeader.ACCEPT]: mediaTypes.get(HttpMediaType.CSS).toString() } }, _handleCss);\n\t}\n\n\t/**\n\t * It returns a blob from the specified path.\n\t *\n\t * @async\n\t * @param {string} [path] The path to the resource.\n\t * @param {RequestOptions} [options] The options for the request.\n\t * @returns {Promise<Blob>} A promise that resolves to a blob.\n\t */\n\tasync getBlob(path, options) {\n\t\treturn this.#get(path, options, { headers: { [HttpRequestHeader.ACCEPT]: HttpMediaType.BIN } }, _handleBlob);\n\t}\n\n\t/**\n\t * It returns a promise that resolves to an object URL.\n\t *\n\t * @async\n\t * @param {string|RequestOptions} [path] The path to the resource.\n\t * @param {RequestOptions} [options] The options for the request.\n\t * @returns {Promise<string>} A promise that resolves to an object URL.\n\t */\n\tasync getImage(path, options) {\n\t\treturn this.#get(path, options, { headers: { [HttpRequestHeader.ACCEPT]: 'image/*' } }, _handleImage);\n\t}\n\n\t/**\n\t * It gets a buffer from the specified path\n\t *\n\t * @async\n\t * @param {string} [path] The path to the resource.\n\t * @param {RequestOptions} [options] The options for the request.\n\t * @returns {Promise<ArrayBuffer>} A promise that resolves to a buffer.\n\t */\n\tasync getBuffer(path, options) {\n\t\treturn this.#get(path, options, { headers: { [HttpRequestHeader.ACCEPT]: HttpMediaType.BIN } }, _handleBuffer);\n\t}\n\n\t/**\n\t * It returns a readable stream of the response body from the specified path.\n\t *\n\t * @async\n\t * @param {string} [path] The path to the resource.\n\t * @param {RequestOptions} [options] The options for the request.\n\t * @returns {Promise<ReadableStream<Uint8Array>>} A readable stream.\n\t */\n\tasync getStream(path, options) {\n\t\treturn this.#get(path, options, { headers: { [HttpRequestHeader.ACCEPT]: HttpMediaType.BIN } }, _handleReadableStream);\n\t}\n\n\t/**\n\t * Makes a GET request to the given path, using the given options, and then calls the\n\t * given response handler with the response.\n\t *\n\t * @private\n\t * @async\n\t * @param {string} [path] The path to the endpoint you want to call.\n\t * @param {RequestOptions} [userOptions] The options passed to the public function to use for the request.\n\t * @param {RequestOptions} [options] The options for the request.\n\t * @param {ResponseHandler<ResponseBody>} [responseHandler] A function that will be called with the response object.\n\t * @returns {Promise<ResponseBody>} The result of the #request method.\n\t */\n\tasync #get(path, userOptions, options, responseHandler) {\n\t\treturn this.#request(path, userOptions, { ...options, method: HttpRequestMethod.GET }, responseHandler);\n\t}\n\n\t/**\n\t * It takes a path, options, and a response handler, and returns a promise that resolves to the\n\t * response entity.\n\t *\n\t * @private\n\t * @async\n\t * @param {string} [path] The path to the resource you want to access.\n\t * @param {RequestOptions} [userOptions={}] The options passed to the public function to use for the request.\n\t * @param {RequestOptions} [options={}] The options to use for the request.\n\t * @param {ResponseHandler<ResponseBody>} [responseHandler] A function that will be called with the response body as a parameter. This\n\t * is useful if you want to do something with the response body before returning it.\n\t * @returns {Promise<ResponseBody>} The response from the API call.\n\t */\n\tasync #request(path, userOptions = {}, options = {}, responseHandler) {\n\t\tif (_type(path) == Object) { [ path, userOptions ] = [ undefined, path ] }\n\n\t\ttry {\n\t\t\toptions = this.#processRequestOptions(userOptions, options);\n\t\t} catch (cause) {\n\t\t\treturn Promise.reject(new HttpError('Unable to process request options', { cause }));\n\t\t}\n\n\t\tthis.#publish({ name: RequestEvents.CONFIGURED, data: options, global: options.global });\n\n\t\tconst url = Transportr.#createUrl(this.#baseUrl, path);\n\t\tif (_type(options.signal) != AbortSignal) { options.signal = new AbortSignal(options.signal) }\n\t\toptions.signal.addEventListener(SignalEvents.ABORT, (event) => this.#publish({ name: RequestEvents.ABORTED, event, global: options.global }));\n\t\toptions.signal.addEventListener(SignalEvents.TIMEOUT, (event) => this.#publish({ name: RequestEvents.TIMEOUT, event, global: options.global }));\n\n\t\tTransportr.#activeRequests.add(options.signal);\n\n\t\tlet response, result;\n\t\ttry {\n\t\t\t// Proxy the options and trap for the signal to be accessed to start the timeout timer\n\t\t\tresponse = await fetch(url, new Proxy(options, { get: Transportr.#requestOptionsProxyHandler(options.timeout) }));\n\n\t\t\tif (!responseHandler && response.status != 204 && response.headers.has(HttpResponseHeader.CONTENT_TYPE)) {\n\t\t\t\tresponseHandler = this.#getResponseHandler(response.headers.get(HttpResponseHeader.CONTENT_TYPE));\n\t\t\t}\n\n\t\t\tresult = await responseHandler?.(response) ?? response;\n\n\t\t\tif (!response.ok) {\n\t\t\t\treturn Promise.reject(this.#handleError(url, { status: Transportr.#generateResponseStatusFromError('ResponseError', response), entity: result }));\n\t\t\t}\n\t\t\tthis.#publish({ name: RequestEvents.SUCCESS, data: result, global: options.global });\n\t\t} catch (error) {\n\t\t\treturn Promise.reject(this.#handleError(url, { cause: error, status: Transportr.#generateResponseStatusFromError(error.name, response) }));\n\t\t} finally {\n\t\t\toptions.signal.clearTimeout();\n\t\t\tif (!options.signal.aborted) {\n\t\t\t\tthis.#publish({ name: RequestEvents.COMPLETE, data: response, global: options.global });\n\n\t\t\t\tTransportr.#activeRequests.delete(options.signal);\n\n\t\t\t\tif (Transportr.#activeRequests.size === 0) {\n\t\t\t\t\tthis.#publish({ name: RequestEvents.ALL_COMPLETE, global: options.global });\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Creates the options for a {@link Transportr} instance.\n\t *\n\t * @private\n\t * @static\n\t * @param {RequestOptions} userOptions The {@link RequestOptions} to convert.\n\t * @param {RequestOptions} options The default {@link RequestOptions}.\n\t * @returns {RequestOptions} The converted {@link RequestOptions}.\n\t */\n\tstatic #createOptions({ body, headers: userHeaders, searchParams: userSearchParams, ...userOptions }, { headers, searchParams, ...options }) {\n\t\treturn _objectMerge(options, userOptions, {\n\t\t\tbody: [FormData, URLSearchParams, Object].includes(_type(body)) ? new ParameterMap(body) : body,\n\t\t\theaders: Transportr.#mergeOptions(new Headers(), userHeaders, headers),\n\t\t\tsearchParams: Transportr.#mergeOptions(new URLSearchParams(), userSearchParams, searchParams)\n\t\t});\n\t}\n\n\t/**\n\t * Merge the user options and request options into the target.\n\t *\n\t * @private\n\t * @static\n\t * @param {Headers|URLSearchParams|FormData} target The target to merge the options into.\n\t * @param {Headers|URLSearchParams|FormData|Object} userOption The user options to merge into the target.\n\t * @param {Headers|URLSearchParams|FormData|Object} requestOption The request options to merge into the target.\n\t * @returns {Headers|URLSearchParams} The target.\n\t */\n\tstatic #mergeOptions(target, userOption = {}, requestOption = {}) {\n\t\tfor (const option of [userOption, requestOption]) {\n\t\t\tfor (const [name, value] of option.entries?.() ?? Object.entries(option)) {\ttarget.set(name, value) }\n\t\t}\n\n\t\treturn target;\n\t}\n\n\t/**\n\t * Merges the user options and request options with the instance options into a new object that is used for the request.\n\t *\n\t * @private\n\t * @param {RequestOptions} userOptions The user options to merge into the request options.\n\t * @param {RequestOptions} options The request options to merge into the user options.\n\t * @returns {RequestOptions} The merged options.\n\t */\n\t#processRequestOptions({ body: userBody, headers: userHeaders, searchParams: userSearchParams, ...userOptions }, { headers, searchParams, ...options }) {\n\t\tconst requestOptions = _objectMerge(this.#options, userOptions, options, {\n\t\t\theaders: Transportr.#mergeOptions(new Headers(this.#options.headers), userHeaders, headers),\n\t\t\tsearchParams: Transportr.#mergeOptions(new URLSearchParams(this.#options.searchParams), userSearchParams, searchParams)\n\t\t});\n\n\t\tif (requestBodyMethods.includes(requestOptions.method)) {\n\t\t\tif ([ParameterMap, FormData, URLSearchParams, Object].includes(_type(userBody))) {\n\t\t\t\tconst contentType = requestOptions.headers.get(HttpRequestHeader.CONTENT_TYPE);\n\t\t\t\tconst mediaType = (mediaTypes.get(contentType) ?? MediaType.parse(contentType))?.subtype;\n\t\t\t\tif (mediaType == HttpMediaType.MULTIPART_FORM_DATA) {\n\t\t\t\t\trequestOptions.body = Transportr.#mergeOptions(new FormData(requestOptions.body), userBody);\n\t\t\t\t} else if (mediaType == HttpMediaType.FORM) {\n\t\t\t\t\trequestOptions.body = Transportr.#mergeOptions(new URLSearchParams(requestOptions.body), userBody);\n\t\t\t\t} else if (mediaType.includes('json')) {\n\t\t\t\t\trequestOptions.body = JSON.stringify(Transportr.#mergeOptions(new ParameterMap(requestOptions.body), userBody));\n\t\t\t\t} else {\n\t\t\t\t\trequestOptions.body = Transportr.#mergeOptions(new ParameterMap(requestOptions.body), userBody);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\trequestOptions.body = userBody;\n\t\t\t}\n\t\t} else {\n\t\t\trequestOptions.headers.delete(HttpRequestHeader.CONTENT_TYPE);\n\t\t\tif (!requestOptions.body?.isEmpty()) {\n\t\t\t\tTransportr.#mergeOptions(requestOptions.searchParams, requestOptions.body);\n\t\t\t}\n\t\t\trequestOptions.body = undefined;\n\t\t}\n\n\t\treturn requestOptions;\n\t}\n\n\t/**\n\t * Returns a Proxy of the options object that traps for 'signal' access.\n\t * If the signal has not been aborted, then it will return a new signal with a timeout.\n\t *\n\t * @private\n\t * @static\n\t * @param {number} timeout The timeout in milliseconds before the signal is aborted.\n\t * @returns {Proxy<RequestOptions>} A proxy for the options object.\n\t */\n\tstatic #requestOptionsProxyHandler(timeout) {\n\t\treturn (target, property) => {\n\t\t\tconst value = Reflect.get(target, property);\n\t\t\treturn property == 'signal' && !value.aborted ? value.withTimeout(timeout) : value;\n\t\t};\n\t}\n\n\t/**\n\t * It takes a url or a string, and returns a {@link URL} instance.\n\t * If the url is a string and starts with a slash, then the origin of the current page is used as the base url.\n\t *\n\t * @private\n\t * @static\n\t * @param {URL|string} url The URL to convert to a {@link URL} instance.\n\t * @returns {URL} A {@link URL} instance.\n\t * @throws {TypeError} If the url is not a string or {@link URL} instance.\n\t */\n\tstatic #getBaseUrl(url) {\n\t\tswitch (_type(url)) {\n\t\t\tcase URL: return url;\n\t\t\tcase String: return new URL(url, url.startsWith('/') ? globalThis.location.origin : undefined);\n\t\t\tdefault: throw new TypeError('Invalid URL');\n\t\t}\n\t}\n\n\t/**\n\t * It takes a URL, a path, and a set of search parameters, and returns a new URL with the path and\n\t * search parameters applied.\n\t *\n\t * @private\n\t * @static\n\t * @param {URL} url The URL to use as a base.\n\t * @param {string} [path] The optional, relative path to the resource. This MUST be a relative path, otherwise, you should create a new {@link Transportr} instance.\n\t * @returns {URL} A new URL object with the pathname and origin of the url parameter, and the path parameter\n\t * appended to the end of the pathname.\n\t */\n\tstatic #createUrl(url, path) {\n\t\treturn path ? new URL(`${url.pathname.replace(endsWithSlashRegEx, '')}${path}`, url.origin) : new URL(url);\n\t}\n\n\t/**\n\t * Generates a ResponseStatus object based on the error name and the response.\n\t *\n\t * @private\n\t * @static\n\t * @param {string} errorName The name of the error.\n\t * @param {Response} response The response object returned by the fetch API.\n\t * @returns {ResponseStatus} The response status object.\n\t */\n\tstatic #generateResponseStatusFromError(errorName, response) {\n\t\tswitch (errorName) {\n\t\t\tcase 'AbortError': return Transportr.#eventResponseStatuses.get(RequestEvents.ABORTED);\n\t\t\tcase 'TimeoutError': return Transportr.#eventResponseStatuses.get(RequestEvents.TIMEOUT);\n\t\t\tdefault: return response ? new ResponseStatus(response.status, response.statusText) : new ResponseStatus(500, 'Internal Server Error');\n\t\t}\n\t}\n\n\t/**\n\t * Handles an error by logging it and throwing it.\n\t *\n\t * @private\n\t * @param {URL} url The path to the resource you want to access.\n\t * @param {import('./http-error.js').HttpErrorOptions} options The options for the HttpError.\n\t * @returns {HttpError} The HttpError.\n\t */\n\t#handleError(url, options) {\n\t\tconst error = new HttpError(`An error has occurred with your request to: '${url}'`, options);\n\t\tthis.#publish({ name: RequestEvents.ERROR, data: error });\n\n\t\treturn error;\n\t}\n\n\t/**\n\t * Publishes an event to the global and instance subscribers.\n\t *\n\t * @private\n\t * @param {Object} options The options for the event.\n\t * @param {string} options.name The name of the event.\n\t * @param {Event} [options.event] The event object.\n\t * @param {*} [options.data] The data to pass to the subscribers.\n\t * @param {boolean} [options.global=true] Whether or not to publish the event to the global subscribers.\n\t * @returns {void}\n\t */\n\t#publish({ name, event = new CustomEvent(name), data, global = true } = {}) {\n\t\tif (global) {\tTransportr.#globalSubscribr.publish(name, event, data) }\n\t\tthis.#subscribr.publish(name, event, data);\n\t}\n\n\t/**\n\t * Returns a response handler for the given content type.\n\t *\n\t * @private\n\t * @param {string} contentType The content type of the response.\n\t * @returns {ResponseHandler<ResponseBody>} The response handler.\n\t */\n\t#getResponseHandler(contentType) {\n\t\tlet handler;\n\t\tconst mediaType = MediaType.parse(contentType);\n\n\t\tif (mediaType) {\n\t\t\tfor (const [responseHandler, contentTypes] of Transportr.#contentTypeHandlers) {\n\t\t\t\tif (contentTypes.has(mediaType.type) || contentTypes.has(mediaType.subtype)) {\n\t\t\t\t\thandler = responseHandler;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn handler;\n\t}\n\n\t/**\n\t * A String value that is used in the creation of the default string\n\t * description of an object. Called by the built-in method {@link Object.prototype.toString}.\n\t *\n\t * @returns {string} The default string description of this object.\n\t */\n\tget [Symbol.toStringTag]() {\n\t\treturn 'Transportr';\n\t}\n}", "/**\n * @template K\n * @template V\n * @typedef {Map<K, Set<V>>} SetMultiMap\n * @extends Map\n */\n\n/**\n * A {@link Map} that can contain multiple, unique, values for the same key.\n *\n * @template K\n * @template V\n * @type {SetMultiMap<K, V>}\n */\nclass SetMultiMap extends Map {\n\t/**\n\t * Adds a new element with a specified key and value to the SetMultiMap.\n\t * If an element with the same key already exists, the value will be added to the underlying {@link Set}.\n\t * If the value already exists in the {@link Set}, it will not be added again.\n\t *\n\t * @param {K} key The key to set.\n\t * @param {V} value The value to add to the SetMultiMap\n\t * @returns {SetMultiMap<K, V>} The SetMultiMap with the updated key and value.\n\t */\n\tset(key, value) {\n\t\tsuper.set(key, (super.get(key) ?? new Set()).add(value));\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Checks if a specific key has a specific value.\n\t *\n\t * @param {K} key The key to check.\n\t * @param {V} value The value to check.\n\t * @returns {boolean} True if the key has the value, false otherwise.\n\t */\n\thasValue(key, value) {\n\t\tconst values = super.get(key);\n\n\t\treturn values ? values.has(value) : false;\n\t}\n\n\t/**\n\t * Removes a specific value from a specific key.\n\t *\n\t * @param {K} key The key to remove the value from.\n\t * @param {V} value The value to remove.\n\t * @returns {boolean} True if the value was removed, false otherwise.\n\t */\n\tdeleteValue(key, value) {\n\t\tconst values = super.get(key);\n\t\tif (values) { return values.delete(value) }\n\n\t\treturn false;\n\t}\n\n\tget [Symbol.toStringTag]() {\n\t\treturn 'SetMultiMap';\n\t}\n}\n\nexport default SetMultiMap;", "/**\n *\n * @typedef {Map<*, *>} SetMultiMap\n * @extends Map\n */\nexport default class SetMultiMap extends Map {\n\t/**\n\t * Adds a new element with a specified key and value to the SetMultiMap. If an element with the same key already exists, the value will be added to the underlying {@link Set}.\n\t *\n\t * @param {*} key The key to set.\n\t * @param {*} value The value to add to the SetMultiMap\n\t * @returns {SetMultiMap} The SetMultiMap with the updated key and value.\n\t */\n\tset(key, value) {\n\t\tsuper.set(key, (super.get(key) ?? new Set()).add(value));\n\n\t\treturn this;\n\t}\n\n\t[Symbol.toStringTag]() {\n\t\treturn 'SetMultiMap';\n\t}\n}", "export default class ContextEventHandler {\n\t#context;\n\t#eventHandler;\n\n\t/**\n\t * @param {*} context The context to bind to the event handler.\n\t * @param {function(*): void} eventHandler The event handler to call when the event is published.\n\t */\n\tconstructor(context, eventHandler) {\n\t\tthis.#context = context;\n\t\tthis.#eventHandler = eventHandler;\n\t}\n\n\t/**\n\t * Call the event handler for the provided event.\n\t *\n\t * @param {Event} event The event to handle\n\t * @param {*} [data] The value to be passed to the event handler as a parameter.\n\t */\n\thandle(event, data) {\n\t\tthis.#eventHandler.call(this.#context, event, data);\n\t}\n\n\tget [Symbol.toStringTag]() {\n\t\treturn 'ContextEventHandler';\n\t}\n}", "/** @typedef { import('./context-event-handler.js').default } ContextEventHandler */\n\nexport default class Subscription {\n\t#eventName;\n\t#contextEventHandler;\n\n\t/**\n\t * @param {string} eventName The event name.\n\t * @param {ContextEventHandler} contextEventHandler Then context event handler.\n\t */\n\tconstructor(eventName, contextEventHandler) {\n\t\tthis.#eventName = eventName;\n\t\tthis.#contextEventHandler = contextEventHandler;\n\t}\n\n\t/**\n\t * Gets the event name for the subscription.\n\t *\n\t * @returns {string} The event name.\n\t */\n\tget eventName() {\n\t\treturn this.#eventName;\n\t}\n\n\t/**\n\t * Gets the context event handler.\n\t *\n\t * @returns {ContextEventHandler} The context event handler\n\t */\n\tget contextEventHandler() {\n\t\treturn this.#contextEventHandler;\n\t}\n\n\tget [Symbol.toStringTag]() {\n\t\treturn 'Subscription';\n\t}\n}", "import SetMultiMap from '@d1g1tal/collections/set-multi-map.js';\nimport ContextEventHandler from './context-event-handler.js';\nimport Subscription from './subscription.js';\n\nexport default class Subscribr {\n\t/** @type {SetMultiMap<string, ContextEventHandler>} */\n\t#subscribers;\n\n\tconstructor() {\n\t\tthis.#subscribers = new SetMultiMap();\n\t}\n\n\t/**\n\t * Subscribe to an event\n\t *\n\t * @param {string} eventName The event name to subscribe to.\n\t * @param {function(Event, *): void} eventHandler The event handler to call when the event is published.\n\t * @param {*} [context] The context to bind to the event handler.\n\t * @returns {Subscription} An object used to check if the subscription still exists and to unsubscribe from the event.\n\t */\n\tsubscribe(eventName, eventHandler, context = eventHandler) {\n\t\tconst contextEventHandler = new ContextEventHandler(context, eventHandler);\n\t\tthis.#subscribers.set(eventName, contextEventHandler);\n\n\t\treturn new Subscription(eventName, contextEventHandler);\n\t}\n\n\t/**\n\t * Unsubscribe from the event\n\t *\n\t * @param {Subscription} subscription The subscription to unsubscribe.\n\t * @param {string} subscription.eventName The event name to subscribe to.\n\t * @param {ContextEventHandler} subscription.contextEventHandler The event handler to call when the event is published.\n\t * @returns {boolean} true if eventListener has been removed successfully. false if the value is not found or if the value is not an object.\n\t */\n\tunsubscribe({ eventName, contextEventHandler }) {\n\t\tconst contextEventHandlers = this.#subscribers.get(eventName);\n\t\tconst removed = contextEventHandlers?.delete(contextEventHandler);\n\n\t\tif (removed && contextEventHandlers.size == 0) {\n\t\t\tthis.#subscribers.delete(eventName);\n\t\t}\n\n\t\treturn removed;\n\t}\n\n\t/**\n\t * Publish an event\n\t *\n\t * @param {string} eventName The name of the event.\n\t * @param {Event} event The event to be handled.\n\t * @param {*} [data] The value to be passed to the event handler as a parameter.\n\t */\n\tpublish(eventName, event = new CustomEvent(eventName), data) {\n\t\tif (data == null && !(event instanceof Event)) {\n\t\t\t// Swap the event and data parameters because only data was passed without an event object\n\t\t\t[data, event] = [event, new CustomEvent(eventName)];\n\t\t}\n\t\tthis.#subscribers.get(eventName)?.forEach((contextEventHandler) => contextEventHandler.handle(event, data));\n\t}\n\n\t/**\n\t * Check if the event and handler are subscribed.\n\t *\n\t * @param {Subscription} subscription The subscription object.\n\t * @param {string} subscription.eventName The name of the event to check.\n\t * @param {ContextEventHandler} subscription.contextEventHandler The event handler to check.\n\t * @returns {boolean} true if the event name and handler are subscribed, false otherwise.\n\t */\n\tisSubscribed({ eventName, contextEventHandler }) {\n\t\treturn this.#subscribers.get(eventName)?.has(contextEventHandler);\n\t}\n\n\tget [Symbol.toStringTag]() {\n\t\treturn 'Subscribr';\n\t}\n}", "/** @typedef {import('./transportr.js').ResponseBody} ResponseBody */\n/** @typedef {import('./response-status.js').default} ResponseStatus */\n\n/**\n * @typedef {Object} HttpErrorOptions\n * @property {any} cause The cause of the error.\n * @property {ResponseStatus} status The response status.\n * @property {ResponseBody} entity The error entity from the server, if any.\n */\n\n/**\n * @module HttpError\n * @extends Error\n * @author D1g1talEntr0py <jason.dimeo@gmail.com>\n */\nexport default class HttpError extends Error {\n\t/** @type {ResponseBody} */\n\t#entity;\n\t/** @type {ResponseStatus} */\n\t#responseStatus;\n\n\t/**\n\t * @param {string} [message] The error message.\n\t * @param {HttpErrorOptions} [httpErrorOptions] The http error options.\n\t * @param {any} [httpErrorOptions.cause] The cause of the error.\n\t * @param {ResponseStatus} [httpErrorOptions.status] The response status.\n\t * @param {ResponseBody} [httpErrorOptions.entity] The error entity from the server, if any.\n\t */\n\tconstructor(message, { cause, status, entity }) {\n\t\tsuper(message, { cause });\n\t\tthis.#entity = entity;\n\t\tthis.#responseStatus = status;\n\t}\n\n\t/**\n\t * It returns the value of the private variable #entity.\n\t *\n\t * @returns {ResponseBody} The entity property of the class.\n\t */\n\tget entity() {\n\t\treturn this.#entity;\n\t}\n\n\t/**\n\t * It returns the status code of the {@link Response}.\n\t *\n\t * @returns {number} The status code of the {@link Response}.\n\t */\n\tget statusCode() {\n\t\treturn this.#responseStatus?.code;\n\t}\n\n\t/**\n\t * It returns the status text of the {@link Response}.\n\t *\n\t * @returns {string} The status code and status text of the {@link Response}.\n\t */\n\tget statusText() {\n\t\treturn this.#responseStatus?.text;\n\t}\n\n\tget name() {\n\t\treturn 'HttpError';\n\t}\n\n\t/**\n\t * A String value that is used in the creation of the default string\n\t * description of an object. Called by the built-in method {@link Object.prototype.toString}.\n\t *\n\t * @returns {string} The default string description of this object.\n\t */\n\tget [Symbol.toStringTag]() {\n\t\treturn 'HttpError';\n\t}\n}", "/**\n * A constant object that contains all the media types that are supported by the browser.\n *\n * @module HttpMediaType\n * @constant {Object<string, string>}\n */\nconst HttpMediaType = {\n\t/** Advanced Audio Coding (AAC) */\n\tAAC: 'audio/aac',\n\t/** AbiWord */\n\tABW: 'application/x-abiword',\n\t/** Archive document (multiple files embedded) */\n\tARC: 'application/x-freearc',\n\t/** AVIF image */\n\tAVIF: 'image/avif',\n\t/** Audio Video Interleave (AVI) */\n\tAVI: 'video/x-msvideo',\n\t/** Amazon Kindle eBook format */\n\tAZW: 'application/vnd.amazon.ebook',\n\t/** Binary Data */\n\tBIN: 'application/octet-stream',\n\t/** Windows OS/2 Bitmap Graphics */\n\tBMP: 'image/bmp',\n\t/** Bzip Archive */\n\tBZIP: 'application/x-bzip',\n\t/** Bzip2 Archive */\n\tBZIP2: 'application/x-bzip2',\n\t/** CD audio */\n\tCDA: 'application/x-cdf',\n\t/** C Shell Script */\n\tCSH: 'application/x-csh',\n\t/** Cascading Style Sheets (CSS) */\n\tCSS: 'text/css',\n\t/** Comma-Separated Values */\n\tCSV: 'text/csv',\n\t/** Microsoft Office Word Document */\n\tDOC: 'application/msword',\n\t/** Microsoft Office Word Document (OpenXML) */\n\tDOCX: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n\t/** Microsoft Embedded OpenType */\n\tEOT: 'application/vnd.ms-fontobject',\n\t/** Electronic Publication (EPUB) */\n\tEPUB: 'application/epub+zip',\n\t/** GZip Compressed Archive */\n\tGZIP: 'application/gzip',\n\t/** Graphics Interchange Format */\n\tGIF: 'image/gif',\n\t/** HyperText Markup Language (HTML) */\n\tHTML: 'text/html',\n\t/** Icon Format */\n\tICO: 'image/vnd.microsoft.icon',\n\t/** iCalendar Format */\n\tICS: 'text/calendar',\n\t/** Java Archive (JAR) */\n\tJAR: 'application/java-archive',\n\t/** JPEG Image */\n\tJPEG: 'image/jpeg',\n\t/** JavaScript */\n\tJAVA_SCRIPT: 'text/javascript',\n\t/** JavaScript Object Notation Format (JSON) */\n\tJSON: 'application/json',\n\t/** JavaScript Object Notation LD Format */\n\tJSON_LD: 'application/ld+json',\n\t/** JavaScript Object Notation (JSON) Merge Patch */\n\tJSON_MERGE_PATCH: 'application/merge-patch+json',\n\t/** Musical Instrument Digital Interface (MIDI) */\n\tMID: 'audio/midi',\n\t/** Musical Instrument Digital Interface (MIDI) */\n\tX_MID: 'audio/x-midi',\n\t/** MP3 Audio */\n\tMP3: 'audio/mpeg',\n\t/** MPEG-4 Audio */\n\tMP4A: 'audio/mp4',\n\t/** MPEG-4 Video */\n\tMP4: 'video/mp4',\n\t/** MPEG Video */\n\tMPEG: 'video/mpeg',\n\t/** Apple Installer Package */\n\tMPKG: 'application/vnd.apple.installer+xml',\n\t/** OpenDocument Presentation Document */\n\tODP: 'application/vnd.oasis.opendocument.presentation',\n\t/** OpenDocument Spreadsheet Document */\n\tODS: 'application/vnd.oasis.opendocument.spreadsheet',\n\t/** OpenDocument Text Document */\n\tODT: 'application/vnd.oasis.opendocument.text',\n\t/** Ogg Audio */\n\tOGA: 'audio/ogg',\n\t/** Ogg Video */\n\tOGV: 'video/ogg',\n\t/** Ogg */\n\tOGX: 'application/ogg',\n\t/** Opus audio */\n\tOPUS: 'audio/opus',\n\t/** OpenType Font File */\n\tOTF: 'font/otf',\n\t/** Portable Network Graphics (PNG) */\n\tPNG: 'image/png',\n\t/** Adobe Portable Document Format */\n\tPDF: 'application/pdf',\n\t/** Hypertext Preprocessor (Personal Home Page) */\n\tPHP: 'application/x-httpd-php',\n\t/** Microsoft PowerPoint */\n\tPPT: 'application/vnd.ms-powerpoint',\n\t/** Microsoft Office Presentation (OpenXML) */\n\tPPTX: 'application/vnd.openxmlformats-officedocument.presentationml.presentation',\n\t/** RAR Archive */\n\tRAR: 'application/vnd.rar',\n\t/** Rich Text Format */\n\tRTF: 'application/rtf',\n\t/** Bourne Shell Script */\n\tSH: 'application/x-sh',\n\t/** Scalable Vector Graphics (SVG) */\n\tSVG: 'image/svg+xml',\n\t/** Tape Archive (TAR) */\n\tTAR: 'application/x-tar',\n\t/** Tagged Image File Format (TIFF) */\n\tTIFF: 'image/tiff',\n\t/** MPEG transport stream */\n\tTRANSPORT_STREAM: 'video/mp2t',\n\t/** TrueType Font */\n\tTTF: 'font/ttf',\n\t/** Text, (generally ASCII or ISO 8859-n) */\n\tTEXT: 'text/plain',\n\t/** Microsoft Visio */\n\tVSD: 'application/vnd.visio',\n\t/** Waveform Audio Format (WAV) */\n\tWAV: 'audio/wav',\n\t/** Open Web Media Project - Audio */\n\tWEBA: 'audio/webm',\n\t/** Open Web Media Project - Video */\n\tWEBM: 'video/webm',\n\t/** WebP Image */\n\tWEBP: 'image/webp',\n\t/** Web Open Font Format */\n\tWOFF: 'font/woff',\n\t/** Web Open Font Format */\n\tWOFF2: 'font/woff2',\n\t/** Form - Encoded */\n\tFORM: 'application/x-www-form-urlencoded',\n\t/** Multipart FormData */\n\tMULTIPART_FORM_DATA: 'multipart/form-data',\n\t/** XHTML - The Extensible HyperText Markup Language */\n\tXHTML: 'application/xhtml+xml',\n\t/** Microsoft Excel Document */\n\tXLS: 'application/vnd.ms-excel',\n\t/** Microsoft Office Spreadsheet Document (OpenXML) */\n\tXLSX: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n\t/** Extensible Markup Language (XML) */\n\tXML: 'application/xml',\n\t/** XML User Interface Language (XUL) */\n\tXUL: 'application/vnd.mozilla.xul+xml',\n\t/** Zip Archive */\n\tZIP: 'application/zip',\n\t/** 3GPP audio/video container */\n\t'3GP': 'video/3gpp',\n\t/** 3GPP2 audio/video container */\n\t'3G2': 'video/3gpp2',\n\t/** 7-Zip Archive */\n\t'7Z': 'application/x-7z-compressed',\n};\n\nexport default HttpMediaType;", "/**\n * Defining a constant object with all the HTTP request headers.\n *\n * @module HttpRequestHeader\n * @constant {Object<string, string>}\n */\nconst HttpRequestHeader = {\n\t/**\n\t * Content-Types that are acceptable for the response. See Content negotiation. Permanent.\n\t *\n\t * @example\n\t * <code>Accept: text/plain</code>\n\t */\n\tACCEPT: 'accept',\n\t/**\n\t * Character sets that are acceptable. Permanent.\n\t *\n\t * @example\n\t * <code>Accept-Charset: utf-8</code>\n\t */\n\tACCEPT_CHARSET: 'accept-charset',\n\t/**\n\t * List of acceptable encodings. See HTTP compression. Permanent.\n\t *\n\t * @example\n\t * <code>Accept-Encoding: gzip, deflate</code>\n\t */\n\tACCEPT_ENCODING: 'accept-encoding',\n\t/**\n\t * List of acceptable human languages for response. See Content negotiation. Permanent.\n\t *\n\t * @example\n\t * <code>Accept-Language: en-US</code>\n\t */\n\tACCEPT_LANGUAGE: 'accept-language',\n\t/**\n\t * Authentication credentials for HTTP authentication. Permanent.\n\t *\n\t * @example\n\t * <code>Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==</code>\n\t */\n\tAUTHORIZATION: 'authorization',\n\t/**\n\t * Used to specify directives that must be obeyed by all caching mechanisms along the request-response chain.\n\t * Permanent.\n\t *\n\t * @example\n\t * <code>Cache-Control: no-cache</code>\n\t */\n\tCACHE_CONTROL: 'cache-control',\n\t/**\n\t * Control options for the current connection and list of hop-by-hop request fields. Permanent.\n\t *\n\t * @example\n\t * <code>Connection: keep-alive</code>\n\t * <code>Connection: Upgrade</code>\n\t */\n\tCONNECTION: 'connection',\n\t/**\n\t * An HTTP cookie previously sent by the server with Set-Cookie (below). Permanent: standard.\n\t *\n\t * @example\n\t * <code>Cookie: $Version=1, Skin=new,</code>\n\t */\n\tCOOKIE: 'cookie',\n\t/**\n\t * The length of the request body in octets (8-bit bytes). Permanent.\n\t *\n\t * @example\n\t * <code>Content-Length: 348</code>\n\t */\n\tCONTENT_LENGTH: 'content-length',\n\t/**\n\t * A Base64-encoded binary MD5 sum of the content of the request body. Obsolete.\n\t *\n\t * @example\n\t * <code>Content-MD5: Q2hlY2sgSW50ZWdyaXR5IQ==</code>\n\t */\n\tCONTENT_MD5: 'content-md5',\n\t/**\n\t * The MIME type of the body of the request (used with POST and PUT requests). Permanent.\n\t * <code>Content-Type: application/x-www-form-urlencoded</code>\n\t */\n\tCONTENT_TYPE: 'content-type',\n\t/**\n\t * The date and time that the message was sent (in \"HTTP-date\" format as defined by RFC 7231 Date/Time Formats).\n\t * Permanent.\n\t *\n\t * @example\n\t * <code>Date: Tue, 15 Nov 1994 08:12:31 GMT</code>\n\t */\n\tDATE: 'date',\n\t/**\n\t * Indicates that particular server behaviors are required by the client. Permanent.\n\t *\n\t * @example\n\t * <code>Expect: 100-continue</code>\n\t */\n\tEXPECT: 'expect',\n\t/**\n\t * The email address of the user making the request. Permanent.\n\t *\n\t * @example\n\t * <code>From: user@example.com</code>\n\t */\n\tFROM: 'from',\n\t/**\n\t * The domain name of the server (for virtual hosting), and the TCP port number on which the server is listening. The\n\t * port number may be omitted if the port is the standard port for the service requested. Permanent. Mandatory since\n\t * HTTP/1.1.\n\t *\n\t * @example\n\t * <code>Host: en.wikipedia.org:80</code>\n\t * <code>Host: en.wikipedia.org</code>\n\t */\n\tHOST: 'host',\n\t/**\n\t * Only perform the action if the client supplied entity matches the same entity on the server. This is mainly for\n\t * methods like PUT to only update a resource if it has not been modified since the user last updated it. Permanent.\n\t *\n\t * @example\n\t * <code>If-Match: \"737060cd8c284d8af7ad3082f209582d\"</code>\n\t */\n\tIF_MATCH: 'if-match',\n\t/**\n\t * Allows a 304 Not Modified to be returned if content is unchanged. Permanent.\n\t *\n\t * @example\n\t * <code>If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT</code>\n\t */\n\tIF_MODIFIED_SINCE: 'if-modified-since',\n\t/**\n\t * Allows a 304 Not Modified to be returned if content is unchanged, see HTTP ETag. Permanent.\n\t *\n\t * @example\n\t * <code>If-None-Match: \"737060cd8c284d8af7ad3082f209582d\"</code>\n\t */\n\tIF_NONE_MATCH: 'if-none-match',\n\t/**\n\t * If the entity is unchanged, send me the part(s) that I am missing, otherwise, send me the entire new entity.\n\t * Permanent.\n\t *\n\t * @example\n\t * <code>If-Range: \"737060cd8c284d8af7ad3082f209582d\"</code>\n\t */\n\tIF_RANGE: 'if-range',\n\t/**\n\t * Only send the response if the entity has not been modified since a specific time. Permanent.\n\t *\n\t * @example\n\t * <code>If-Unmodified-Since: Sat, 29 Oct 1994 19:43:31 GMT</code>\n\t */\n\tIF_UNMODIFIED_SINCE: 'if-unmodified-since',\n\t/**\n\t * Limit the number of times the message can be forwarded through proxies or gateways. Permanent.\n\t *\n\t * @example\n\t * <code>Max-Forwards: 10</code>\n\t */\n\tMAX_FORWARDS: 'max-forwards',\n\t/**\n\t * Initiates a request for cross-origin resource sharing (asks server for an 'Access-Control-Allow-Origin' response\n\t * field). Permanent: standard.\n\t *\n\t * @example\n\t * <code>Origin: http://www.example-social-network.com</code>\n\t */\n\tORIGIN: 'origin',\n\t/**\n\t * Implementation-specific fields that may have various effects anywhere along the request-response chain. Permanent.\n\t *\n\t * @example\n\t * <code>Pragma: no-cache</code>\n\t */\n\tPRAGMA: 'pragma',\n\t/**\n\t * Authorization credentials for connecting to a proxy. Permanent.\n\t *\n\t * @example\n\t * <code>Proxy-Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==</code>\n\t */\n\tPROXY_AUTHORIZATION: 'proxy-authorization',\n\t/**\n\t * Request only part of an entity. Bytes are numbered from 0. See Byte serving. Permanent.\n\t *\n\t * @example\n\t * <code>Range: bytes=500-999</code>\n\t */\n\tRANGE: 'range',\n\t/**\n\t * This is the address of the previous web page from which a link to the currently requested page was followed. (The\n\t * word \"referrer\" has been misspelled in the RFC as well as in most implementations to the point that it has become\n\t * standard usage and is considered correct terminology). Permanent.\n\t *\n\t * @example\n\t * <code>Referer: http://en.wikipedia.org/wiki/Main_Page</code>\n\t */\n\tREFERER: 'referer',\n\t/**\n\t * The transfer encodings the user agent is willing to accept: the same values as for the response header field\n\t * Transfer-Encoding can be used, plus the \"trailers\" value (related to the \"chunked\" transfer method) to notify the\n\t * server it expects to receive additional fields in the trailer after the last, zero-sized, chunk. Permanent.\n\t *\n\t * @example\n\t * <code>TE: trailers, deflate</code>\n\t */\n\tTE: 'te',\n\t/**\n\t * The user agent string of the user agent. Permanent.\n\t *\n\t * @example\n\t * <code>User-Agent: Mozilla/5.0 (X11, Linux x86_64, rv:12.0) Gecko/20100101 Firefox/21.0</code>\n\t */\n\tUSER_AGENT: 'user-agent',\n\t/**\n\t * Ask the server to upgrade to another protocol. Permanent.\n\t *\n\t * @example\n\t * <code>Upgrade: HTTP/2.0, SHTTP/1.3, IRC/6.9, RTA/x11</code>\n\t */\n\tUPGRADE: 'upgrade',\n\t/**\n\t * Informs the server of proxies through which the request was sent. Permanent.\n\t *\n\t * @example\n\t * <code>Via: 1.0 fred, 1.1 example.com (Apache/1.1)</code>\n\t */\n\tVIA: 'via',\n\t/**\n\t * A general warning about possible problems with the entity body. Permanent.\n\t *\n\t * @example\n\t * <code>Warning: 199 Miscellaneous warning</code>\n\t */\n\tWARNING: 'warning',\n\t/**\n\t * mainly used to identify Ajax requests. Most JavaScript frameworks send this field with value of XMLHttpRequest.\n\t *\n\t * @example\n\t * <code>X-Requested-With: XMLHttpRequest</code>\n\t */\n\tX_REQUESTED_WITH: 'x-requested-with',\n\t/**\n\t * Requests a web application to disable their tracking of a user. This is Mozilla's version of the X-Do-Not-Track\n\t * header field (since Firefox 4.0 Beta 11). Safari and IE9 also have support for this field. On March 7, 2011, a\n\t * draft proposal was submitted to IETF. The W3C Tracking Protection Working Group is producing a specification.\n\t *\n\t * @example\n\t * <code>DNT: 1 (Do Not Track Enabled)</code>\n\t * <code>DNT: 0 (Do Not Track Disabled)</code>\n\t */\n\tDNT: 'dnt',\n\t/**\n\t * A de facto standard for identifying the originating IP address of a client connecting to a web server through an\n\t * HTTP proxy or load balancer.\n\t *\n\t * @example\n\t * <code>X-Forwarded-For: client1, proxy1, proxy2</code>\n\t * <code>X-Forwarded-For: 129.78.138.66, 129.78.64.103</code>\n\t */\n\tX_FORWARDED_FOR: 'x-forwarded-for',\n\t/**\n\t * A de facto standard for identifying the original host requested by the client in the Host HTTP request header, since\n\t * the host name and/or port of the reverse proxy (load balancer) may differ from the origin server handling the\n\t * request.\n\t *\n\t * @example\n\t * <code>X-Forwarded-Host: en.wikipedia.org:80</code>\n\t * <code>X-Forwarded-Host: en.wikipedia.org</code>\n\t */\n\tX_FORWARDED_HOST: 'x-forwarded-host',\n\t/**\n\t * A de facto standard for identifying the originating protocol of an HTTP request, since a reverse proxy (load\n\t * balancer) may communicate with a web server using HTTP even if the request to the reverse proxy is HTTPS. An\n\t * alternative form of the header (X-ProxyUser-Ip) is used by Google clients talking to Google servers.\n\t *\n\t * @example\n\t * <code>X-Forwarded-Proto: https</code>\n\t */\n\tX_FORWARDED_PROTO: 'x-forwarded-proto',\n\t/**\n\t * Non-standard header field used by Microsoft applications and load-balancers.\n\t *\n\t * @example\n\t * <code>Front-End-Https: on</code>\n\t */\n\tFRONT_END_HTTPS: 'front-end-https',\n\t/**\n\t * Requests a web application override the method specified in the request (typically POST) with the method given in\n\t * the header field (typically PUT or DELETE). Can be used when a user agent or firewall prevents PUT or DELETE methods\n\t * from being sent directly (note that this either a bug in the software component, which ought to be fixed, or an\n\t * intentional configuration, in which case bypassing it may be the wrong thing to do).\n\t *\n\t * @example\n\t * <code>X-HTTP-Method-Override: DELETE</code>\n\t */\n\tX_HTTP_METHOD_OVERRIDE: 'x-http-method-override',\n\t/**\n\t * Allows easier parsing of the MakeModel/Firmware that is usually found in the User-Agent String of AT&T Devices.\n\t *\n\t * @example\n\t * <code>X-Att-Deviceid: GT-P7320/P7320XXLPG</code>\n\t */\n\tX_ATT_DEVICE_ID: 'x-att-deviceid',\n\t/**\n\t * Links to an XML file on the Internet with a full description and details about the device currently connecting. In the example to the right is an XML file for an AT&T Samsung Galaxy S2.\n\t * x-wap-profile: http://wap.samsungmobile.com/uaprof/SGH-I777.xml\n\t */\n\tX_WAP_PROFILE: 'x-wap-profile',\n};\n\nexport default HttpRequestHeader;", "/**\n * Defining a constant object with the name HttpRequestMethod.\n *\n * @module HttpRequestMethod\n * @constant {Object<string, string>}\n */\nconst HttpRequestMethod = {\n\t/**\n\t * The OPTIONS method represents a request for information about the communication options available on the\n\t * request/response chain identified by the Request-URI. This method allows the client to determine the options and/or\n\t * requirements associated with a resource, or the capabilities of a server, without implying a resource action or\n\t * initiating a resource retrieval.\n\t *\n\t * Responses to this method are not cacheable.\n\t *\n\t * If the OPTIONS request includes an entity-body (as indicated by the presence of Content-Length or\n\t * Transfer-Encoding), then the media type MUST be indicated by a Content-Type field. Although this specification does\n\t * not define any use for such a body, future extensions to HTTP might use the OPTIONS body to make more detailed\n\t * queries on the server. A server that does not support such an extension MAY discard the request body.\n\t *\n\t * If the Request-URI is an asterisk (\"*\"), the OPTIONS request is intended to apply to the server in general rather\n\t * than to a specific resource. Since a server's communication options typically depend on the resource, the \"*\"\n\t * request is only useful as a \"ping\" or \"no-op\" type of method, it does nothing beyond allowing the client to test the\n\t * capabilities of the server. For example, this can be used to test a proxy for HTTP/1.1 compliance (or lack thereof).\n\t *\n\t * If the Request-URI is not an asterisk, the OPTIONS request applies only to the options that are available when\n\t * communicating with that resource.\n\t *\n\t * A 200 response SHOULD include any header fields that indicate optional features implemented by the server and\n\t * applicable to that resource (e.g., Allow), possibly including extensions not defined by this specification. The\n\t * response body, if any, SHOULD also include information about the communication options. The format for such a body\n\t * is not defined by this specification, but might be defined by future extensions to HTTP. Content negotiation MAY be\n\t * used to select the appropriate response format. If no response body is included, the response MUST include a\n\t * Content-Length field with a field-value of \"0\".\n\t *\n\t * The Max-Forwards request-header field MAY be used to target a specific proxy in the request chain. When a proxy\n\t * receives an OPTIONS request on an absoluteURI for which request forwarding is permitted, the proxy MUST check for a\n\t * Max-Forwards field. If the Max-Forwards field-value is zero (\"0\"), the proxy MUST NOT forward the message, instead,\n\t * the proxy SHOULD respond with its own communication options. If the Max-Forwards field-value is an integer greater\n\t * than zero, the proxy MUST decrement the field-value when it forwards the request. If no Max-Forwards field is\n\t * present in the request, then the forwarded request MUST NOT include a Max-Forwards field.\n\t */\n\tOPTIONS: 'OPTIONS',\n\t/**\n\t * The GET method means retrieve whatever information (in the form of an entity) is identified by the Request-URI. If\n\t * the Request-URI refers to a data-producing process, it is the produced data which shall be returned as the entity in\n\t * the response and not the source text of the process, unless that text happens to be the output of the process.\n\t *\n\t * The semantics of the GET method change to a \"conditional GET\" if the request message includes an If-Modified-Since;\n\t * If-Unmodified-Since, If-Match, If-None-Match, or If-Range header field. A conditional GET method requests that the\n\t * entity be transferred only under the circumstances described by the conditional header field(s). The conditional GET\n\t * method is intended to reduce unnecessary network usage by allowing cached entities to be refreshed without requiring\n\t * multiple requests or transferring data already held by the client.\n\t *\n\t * The semantics of the GET method change to a \"partial GET\" if the request message includes a Range header field. A\n\t * partial GET requests that only part of the entity be transferred, as described in section 14.35. The partial GET\n\t * method is intended to reduce unnecessary network usage by allowing partially-retrieved entities to be completed\n\t * without transferring data already held by the client.\n\t *\n\t * The response to a GET request is cacheable if and only if it meets the requirements for HTTP caching described in\n\t * section 13.\n\t *\n\t * See section 15.1.3 for security considerations when used for forms.\n\t */\n\tGET: 'GET',\n\t/**\n\t * The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. The\n\t * meta information contained in the HTTP headers in response to a HEAD request SHOULD be identical to the information\n\t * sent in response to a GET request. This method can be used for obtaining meta information about the entity implied by\n\t * the request without transferring the entity-body itself. This method is often used for testing hypertext links for\n\t * validity, accessibility, and recent modification.\n\t *\n\t * The response to a HEAD request MAY be cacheable in the sense that the information contained in the response MAY be\n\t * used to update a previously cached entity from that resource. If the new field values indicate that the cached\n\t * entity differs from the current entity (as would be indicated by a change in Content-Length, Content-MD5, ETag or\n\t * Last-Modified), then the cache MUST treat the cache entry as stale.\n\t */\n\tHEAD: 'HEAD',\n\t/**\n\t * The POST method is used to request that the origin server accept the entity enclosed in the request as a new\n\t * subordinate of the resource identified by the Request-URI in the Request-Line. POST is designed to allow a uniform\n\t * method to cover the following functions:\n\t * <ul>\n\t * <li>Annotation of existing resources,</li>\n\t * <li>Posting a message to a bulletin board, newsgroup, mailing list, or similar group of articles,</li>\n\t * <li>Providing a block of data, such as the result of submitting a form, to a data-handling process,</li>\n\t * <li>Extending a database through an append operation.</li>\n\t * </ul>\n\t *\n\t * The actual function performed by the POST method is determined by the server and is usually dependent on the\n\t * Request-URI. The posted entity is subordinate to that URI in the same way that a file is subordinate to a directory\n\t * containing it, a news article is subordinate to a newsgroup to which it is posted, or a record is subordinate to a\n\t * database.\n\t *\n\t * The action performed by the POST method might not result in a resource that can be identified by a URI. In this\n\t * case, either 200 (OK) or 204 (No Content) is the appropriate response status, depending on whether or not the\n\t * response includes an entity that describes the result.\n\t *\n\t * If a resource has been created on the origin server, the response SHOULD be 201 (Created) and contain an entity\n\t * which describes the status of the request and refers to the new resource, and a Location header (see section 14.30).\n\t *\n\t * Responses to this method are not cacheable, unless the response includes appropriate Cache-Control or Expires header\n\t * fields. However, the 303 (See Other) response can be used to direct the user agent to retrieve a cacheable resource.\n\t *\n\t * POST requests MUST obey the message transmission requirements set out in section 8.2.\n\t *\n\t * See section 15.1.3 for security considerations.\n\t */\n\tPOST: 'POST',\n\t/**\n\t * The PUT method requests that the enclosed entity be stored under the supplied Request-URI. If the Request-URI refers\n\t * to an already existing resource, the enclosed entity SHOULD be considered as a modified version of the one residing\n\t * on the origin server. If the Request-URI does not point to an existing resource, and that URI is capable of being\n\t * defined as a new resource by the requesting user agent, the origin server can create the resource with that URI. If\n\t * a new resource is created, the origin server MUST inform the user agent via the 201 (Created) response. If an\n\t * existing resource is modified, either the 200 (OK) or 204 (No Content) response codes SHOULD be sent to indicate\n\t * successful completion of the request. If the resource could not be created or modified with the Request-URI, an\n\t * appropriate error response SHOULD be given that reflects the nature of the problem. The recipient of the entity MUST\n\t * \\NOT ignore any Content-* (e.g. Content-Range) headers that it does not understand or implement and MUST return a\n\t * 501 (Not Implemented) response in such cases.\n\t *\n\t * If the request passes through a cache and the Request-URI identifies one or more currently cached entities, those\n\t * entries SHOULD be treated as stale. Responses to this method are not cacheable.\n\t *\n\t * The fundamental difference between the POST and PUT requests is reflected in the different meaning of the\n\t * Request-URI. The URI in a POST request identifies the resource that will handle the enclosed entity. That resource\n\t * might be a data-accepting process, a gateway to some other protocol, or a separate entity that accepts annotations.\n\t * In contrast, the URI in a PUT request identifies the entity enclosed with the request -- the user agent knows what\n\t * URI is intended and the server MUST NOT attempt to apply the request to some other resource. If the server desires\n\t * that the request be applied to a different URI, it MUST send a 301 (Moved Permanently) response, the user agent MAY\n\t * then make its own decision regarding whether or not to redirect the request.\n\t *\n\t * A single resource MAY be identified by many different URIs. For example, an article might have a URI for identifying\n\t * \"the current version\" which is separate from the URI identifying each particular version. In this case, a PUT\n\t * request on a general URI might result in several other URIs being defined by the origin server.\n\t *\n\t * HTTP/1.1 does not define how a PUT method affects the state of an origin server.\n\t *\n\t * PUT requests MUST obey the message transmission requirements set out in section 8.2.\n\t *\n\t * Unless otherwise specified for a particular entity-header, the entity-headers in the PUT request SHOULD be applied\n\t * to the resource created or modified by the PUT.\n\t */\n\tPUT: 'PUT',\n\t/**\n\t * The DELETE method requests that the origin server delete the resource identified by the Request-URI. This method MAY\n\t * be overridden by human intervention (or other means) on the origin server. The client cannot be guaranteed that the\n\t * operation has been carried out, even if the status code returned from the origin server indicates that the action\n\t * has been completed successfully. However, the server SHOULD NOT indicate success unless, at the time the response\n\t * is given, it intends to delete the resource or move it to an inaccessible location.\n\t *\n\t * A successful response SHOULD be 200 (OK) if the response includes an entity describing the status, 202 (Accepted) if\n\t * the action has not yet been enacted, or 204 (No Content) if the action has been enacted but the response does not\n\t * include an entity.\n\t *\n\t * If the request passes through a cache and the Request-URI identifies one or more currently cached entities, those\n\t * entries SHOULD be treated as stale. Responses to this method are not cacheable.\n\t */\n\tDELETE: 'DELETE',\n\t/**\n\t * The TRACE method is used to invoke a remote, application-layer loop- back of the request message. The final\n\t * recipient of the request SHOULD reflect the message received back to the client as the entity-body of a 200 (OK)\n\t * response. The final recipient is either the origin server or the first proxy or gateway to receive a Max-Forwards\n\t * value of zero (0) in the request (see section 14.31). A TRACE request MUST NOT include an entity.\n\t *\n\t * TRACE allows the client to see what is being received at the other end of the request chain and use that data for\n\t * testing or diagnostic information. The value of the Via header field (section 14.45) is of particular interest,\n\t * since it acts as a trace of the request chain. Use of the Max-Forwards header field allows the client to limit the\n\t * length of the request chain, which is useful for testing a chain of proxies forwarding messages in an infinite loop.\n\t *\n\t * If the request is valid, the response SHOULD contain the entire request message in the entity-body, with a\n\t * Content-Type of \"message/http\". Responses to this method MUST NOT be cached.\n\t */\n\tTRACE: 'TRACE',\n\t/**\n\t * This specification reserves the method name CONNECT for use with a proxy that can dynamically switch to being a\n\t * tunnel (e.g. SSL tunneling [44]).\n\t */\n\tCONNECT: 'CONNECT',\n\t/**\n\t * The PATCH method requests that a set of changes described in the\n\t * request entity be applied to the resource identified by the Request-\n\t * URI. The set of changes is represented in a format called a \"patch\n\t * document\" identified by a media type. If the Request-URI does not\n\t * point to an existing resource, the server MAY create a new resource,\n\t * depending on the patch document type (whether it can logically modify\n\t * a null resource) and permissions, etc.\n\t *\n\t * The difference between the PUT and PATCH requests is reflected in the\n\t * way the server processes the enclosed entity to modify the resource\n\t * identified by the Request-URI. In a PUT request, the enclosed entity\n\t * is considered to be a modified version of the resource stored on the\n\t * origin server, and the client is requesting that the stored version\n\t * be replaced. With PATCH, however, the enclosed entity contains a set\n\t * of instructions describing how a resource currently residing on the\n\t * origin server should be modified to produce a new version. The PATCH\n\t * method affects the resource identified by the Request-URI, and it\n\t * also MAY have side effects on other resources; i.e., new resources\n\t * may be created, or existing ones modified, by the application of a\n\t * PATCH.\n\t *\n\t * PATCH is neither safe nor idempotent as defined by [RFC2616], Section\n\t * 9.1.\n\t *\n\t * A PATCH request can be issued in such a way as to be idempotent,\n\t * which also helps prevent bad outcomes from collisions between two\n\t * PATCH requests on the same resource in a similar time frame.\n\t * Collisions from multiple PATCH requests may be more dangerous than\n\t * PUT collisions because some patch formats need to operate from a\n\t * known base-point or else they will corrupt the resource. Clients\n\t * using this kind of patch application SHOULD use a conditional request\n\t * such that the request will fail if the resource has been updated\n\t * since the client last accessed the resource. For example, the client\n\t * can use a strong ETag [RFC2616] in an If-Match header on the PATCH\n\t * request.\n\t *\n\t * There are also cases where patch formats do not need to operate from\n\t * a known base-point (e.g., appending text lines to log files, or non-\n\t * colliding rows to database tables), in which case the same care in\n\t * client requests is not needed.\n\t *\n\t * The server MUST apply the entire set of changes atomically and never\n\t * provide (e.g., in response to a GET during this operation) a\n\t * partially modified representation. If the entire patch document\n\t * cannot be successfully applied, then the server MUST NOT apply any of\n\t * the changes. The determination of what constitutes a successful\n\t * PATCH can vary depending on the patch document and the type of\n\t * resource(s) being modified. For example, the common 'diff' utility\n\t * can generate a patch document that applies to multiple files in a\n\t * directory hierarchy. The atomicity requirement holds for all\n\t * directly affected files. See \"Error Handling\", Section 2.2, for\n\t * details on status codes and possible error conditions.\n\t *\n\t * If the request passes through a cache and the Request-URI identifies\n\t * one or more currently cached entities, those entries SHOULD be\n\t * treated as stale. A response to this method is only cacheable if it\n\t * contains explicit freshness information (such as an Expires header or\n\t * \"Cache-Control: max-age\" directive) as well as the Content-Location\n\t * header matching the Request-URI, indicating that the PATCH response\n\t * body is a resource representation. A cached PATCH response can only\n\t * be used to respond to subsequent GET and HEAD requests; it MUST NOT\n\t * be used to respond to other methods (in particular, PATCH).\n\t *\n\t * Note that entity-headers contained in the request apply only to the\n\t * contained patch document and MUST NOT be applied to the resource\n\t * being modified. Thus, a Content-Language header could be present on\n\t * the request, but it would only mean (for whatever that's worth) that\n\t * the patch document had a language. Servers SHOULD NOT store such\n\t * headers except as trace information, and SHOULD NOT use such header\n\t * values the same way they might be used on PUT requests. Therefore,\n\t * this document does not specify a way to modify a document's Content-\n\t * Type or Content-Language value through headers, though a mechanism\n\t * could well be designed to achieve this goal through a patch document.\n\t *\n\t * There is no guarantee that a resource can be modified with PATCH.\n\t * Further, it is expected that different patch document formats will be\n\t * appropriate for different types of resources and that no single\n\t * format will be appropriate for all types of resources. Therefore,\n\t * there is no single default patch document format that implementations\n\t * are required to support. Servers MUST ensure that a received patch\n\t * document is appropriate for the type of resource identified by the\n\t * Request-URI.\n\t *\n\t * Clients need to choose when to use PATCH rather than PUT. For\n\t * example, if the patch document size is larger than the size of the\n\t * new resource data that would be used in a PUT, then it might make\n\t * sense to use PUT instead of PATCH. A comparison to POST is even more\n\t * difficult, because POST is used in widely varying ways and can\n\t * encompass PUT and PATCH-like operations if the server chooses. If\n\t * the operation does not modify the resource identified by the Request-\n\t * URI in a predictable way, POST should be considered instead of PATCH\n\t * or PUT.\n\t */\n\tPATCH: 'PATCH'\n};\n\nexport default HttpRequestMethod;", "/**\n * Defining a constant object with a bunch of properties.\n *\n * @module HttpResponseHeader\n * @constant {Object<string, string>}\n */\nconst HttpResponseHeader = {\n\t/**\n\t * Implemented as a misunderstanding of the HTTP specifications. Common because of mistakes in implementations of early HTTP versions. Has exactly the same functionality as standard Connection field.\n\t *\n\t * @example\n\t * proxy-connection: keep-alive\n\t */\n\tPROXY_CONNECTION: 'proxy-connection',\n\t/**\n\t * Server-side deep packet insertion of a unique ID identifying customers of Verizon Wireless, also known as \"perma-cookie\" or \"supercookie\"\n\t *\n\t * @example\n\t * x-uidh: ...\n\t */\n\tX_UIDH: 'x-uidh',\n\t/**\n\t * Used to prevent cross-site request forgery. Alternative header names are: X-CSRFToken and X-XSRF-TOKEN\n\t *\n\t * @example\n\t * x-csrf-token: i8XNjC4b8KVok4uw5RftR38Wgp2BFwql\n\t */\n\tX_CSRF_TOKEN: 'x-csrf-token',\n\t/**\n\t * Specifying which web sites can participate in cross-origin resource sharing\n\t *\n\t * @example\n\t * access-control-allow-origin: *\n\t * Provisional\n\t */\n\tACCESS_CONTROL_ALLOW_ORIGIN: 'access-control-allow-origin',\n\t/**\n\t * Specifies which patch document formats this server supports\n\t *\n\t * @example\n\t * accept-patch: text/example,charset=utf-8\n\t * Permanent\n\t */\n\tACCEPT_PATCH: 'accept-patch',\n\t/**\n\t * What partial content range types this server supports via byte serving\n\t *\n\t * @example\n\t * accept-ranges: bytes\n\t * Permanent\n\t */\n\tACCEPT_RANGES: 'accept-ranges',\n\t/**\n\t * The age the object has been in a proxy cache in seconds\n\t *\n\t * @example\n\t * age: 12\n\t * Permanent\n\t */\n\tAGE: 'age',\n\t/**\n\t * Valid actions for a specified resource. To be used for a 405 Method not allowed\n\t *\n\t * @example\n\t * allow: GET, HEAD\n\t * Permanent\n\t */\n\tALLOW: 'allow',\n\t/**\n\t * Tells all caching mechanisms from server to client whether they may cache this object. It is measured in seconds\n\t *\n\t * @example\n\t * cache-control: max-age=3600\n\t * Permanent\n\t */\n\tCACHE_CONTROL: 'cache-control',\n\t/**\n\t * Control options for the current connection and list of hop-by-hop response fields\n\t *\n\t * @example\n\t * connection: close\n\t * Permanent\n\t */\n\tCONNECTION: 'connection',\n\t/**\n\t * An opportunity to raise a \"File Download\" dialogue box for a known MIME type with binary format or suggest a filename for dynamic content. Quotes are necessary with special characters.\n\t *\n\t * @example\n\t * content-disposition: attachment, filename=\"fname.ext\"\n\t * Permanent\n\t */\n\tCONTENT_DISPOSITION: 'content-disposition',\n\t/**\n\t * The type of encoding used on the data. See HTTP compression.\n\t *\n\t * @example\n\t * content-encoding: gzip\n\t * Permanent\n\t */\n\tCONTENT_ENCODING: 'content-encoding',\n\t/**\n\t * The natural language or languages of the intended audience for the enclosed content\n\t *\n\t * @example\n\t * content-language: da\n\t * Permanent\n\t */\n\tCONTENT_LANGUAGE: 'content-language',\n\t/**\n\t * The length of the response body in octets (8-bit bytes)\n\t *\n\t * @example\n\t * content-length: 348\n\t * Permanent\n\t */\n\tCONTENT_LENGTH: 'content-length',\n\t/**\n\t * An alternate location for the returned data\n\t *\n\t * @example\n\t * content-location: /index.htm\n\t * Permanent\n\t */\n\tCONTENT_LOCATION: 'content-location',\n\t/**\n\t * Where in a full body message this partial message belongs\n\t *\n\t * @example\n\t * content-range: bytes 21010-47021/47022\n\t * Permanent\n\t */\n\tCONTENT_RANGE: 'content-range',\n\t/**\n\t * The MIME type of this content\n\t *\n\t * @example\n\t * content-type: text/html, charset=utf-8\n\t * Permanent\n\t */\n\tCONTENT_TYPE: 'content-type',\n\t/**\n\t * The date and time that the message was sent (in \"HTTP-date\" format as defined by RFC 7231)\n\t *\n\t * @example\n\t * date: Tue, 15 Nov 1994 08:12:31 GMT\n\t * Permanent\n\t */\n\tDATE: 'date',\n\t/**\n\t * An identifier for a specific version of a resource, often a message digest\n\t *\n\t * @example\n\t * etag: \"737060cd8c284d8af7ad3082f209582d\"\n\t * Permanent\n\t */\n\tETAG: 'etag',\n\t/**\n\t * Gives the date/time after which the response is considered stale (in \"HTTP-date\" format as defined by RFC 7231)\n\t *\n\t * @example\n\t * expires: Thu, 01 Dec 1994 16:00:00 GMT\n\t * Permanent\n\t */\n\tEXPIRES: 'expires',\n\t/**\n\t * The last modified date for the requested object (in \"HTTP-date\" format as defined by RFC 7231)\n\t *\n\t * @example\n\t * last-modified: Tue, 15 Nov 1994 12:45:26 GMT\n\t * Permanent\n\t */\n\tLAST_MODIFIED: 'last-modified',\n\t/**\n\t * Used to express a typed relationship with another resource, where the relation type is defined by RFC 5988\n\t *\n\t * @example\n\t * link: </feed>, rel=\"alternate\"\n\t * Permanent\n\t */\n\tLINK: 'link',\n\t/**\n\t * Used in redirection, or when a new resource has been created.\n\t *\n\t * @example\n\t * location: http://www.w3.org/pub/WWW/People.html\n\t * Permanent\n\t */\n\tLOCATION: 'location',\n\t/**\n\t * This field is supposed to set P3P policy, in the form of P3P:CP=\"your_compact_policy\". However, P3P did not take off, most browsers have never fully\n\t * implemented it, a lot of websites set this field with fake policy text, that was enough to fool browsers the existence of P3P policy and grant permissions for third party cookies.\n\t *\n\t * @example\n\t * p3p: CP=\"This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&answer=151657 for more info.\"\n\t * Permanent\n\t */\n\tP3P: 'p3p',\n\t/**\n\t * Implementation-specific fields that may have various effects anywhere along the request-response chain.\n\t *\n\t * @example\n\t * pragma: no-cache\n\t * Permanent\n\t */\n\tPRAGMA: 'pragma',\n\t/**\n\t * Request authentication to access the proxy.\n\t *\n\t * @example\n\t * proxy-authenticate: Basic\n\t * Permanent\n\t */\n\tPROXY_AUTHENTICATION: 'proxy-authenticate',\n\t/**\n\t * HTTP Public Key Pinning, announces hash of website's authentic TLS certificate\n\t *\n\t * @example\n\t * public-key-pins: max-age=2592000, pin-sha256=\"E9CZ9INDbd+2eRQozYqqbQ2yXLVKB9+xcprMF+44U1g=\",\n\t * Permanent\n\t */\n\tPUBLIC_KEY_PINS: 'public-key-pins',\n\t/**\n\t * If an entity is temporarily unavailable, this instructs the client to try again later. Value could be a specified period of time (in seconds) or a HTTP-date.\n\t *\n\t * @example\n\t * retry-after: 120\n\t * retry-after: Fri, 07 Nov 2014 23:59:59 GMT\n\t * Permanent\n\t */\n\tRETRY_AFTER: 'retry-after',\n\t/**\n\t * A name for the server\n\t *\n\t * @example\n\t * server: Apache/2.4.1 (Unix)\n\t * Permanent\n\t */\n\tSERVER: 'server',\n\t/**\n\t * An HTTP cookie\n\t *\n\t * @example\n\t * set-cookie: UserID=JohnDoe, Max-Age=3600, Version=1\n\t * Permanent\n\t */\n\tSET_COOKIE: 'set-cookie',\n\t/**\n\t * CGI header field specifying the status of the HTTP response. Normal HTTP responses use a separate \"Status-Line\" instead, defined by RFC 7230.\n\t *\n\t * @example\n\t * status: 200 OK\n\t */\n\tSTATUS: 'status',\n\t/**\n\t * A HSTS Policy informing the HTTP client how long to cache the HTTPS only policy and whether this applies to subdomains.\n\t *\n\t * @example\n\t * strict-transport-security: max-age=16070400, includeSubDomains\n\t * Permanent\n\t */\n\tSTRICT_TRANSPORT_SECURITY: 'strict-transport-security',\n\t/**\n\t * The Trailer general field value indicates that the given set of header fields is present in the trailer of a message encoded with chunked transfer coding.\n\t *\n\t * @example\n\t * trailer: Max-Forwards\n\t * Permanent\n\t */\n\tTRAILER: 'trailer',\n\t/**\n\t * The form of encoding used to safely transfer the entity to the user. Currently defined methods are: chunked, compress, deflate, gzip, identity.\n\t *\n\t * @example\n\t * transfer-encoding: chunked\n\t * Permanent\n\t */\n\tTRANSFER_ENCODING: 'transfer-encoding',\n\t/**\n\t * Ask the client to upgrade to another protocol.\n\t *\n\t * @example\n\t * upgrade: HTTP/2.0, SHTTP/1.3, IRC/6.9, RTA/x11\n\t * Permanent\n\t */\n\tUPGRADE: 'upgrade',\n\t/**\n\t * Tells downstream proxies how to match future request headers to decide whether the cached response can be used rather than requesting a fresh one from the origin server.\n\t *\n\t * @example\n\t * vary: *\n\t * Permanent\n\t */\n\tVARY: 'vary',\n\t/**\n\t * Informs the client of proxies through which the response was sent.\n\t *\n\t * @example\n\t * via: 1.0 fred, 1.1 example.com (Apache/1.1)\n\t * Permanent\n\t */\n\tVIA: 'via',\n\t/**\n\t * A general warning about possible problems with the entity body.\n\t *\n\t * @example\n\t * warning: 199 Miscellaneous warning\n\t * Permanent\n\t */\n\tWARNING: 'warning',\n\t/**\n\t * Indicates the authentication scheme that should be used to access the requested entity.\n\t *\n\t * @example\n\t * www-authenticate: Basic\n\t * Permanent\n\t */\n\tWWW_AUTHENTICATE: 'www-authenticate',\n\t/**\n\t * Cross-site scripting (XSS) filter\n\t *\n\t * @example\n\t * x-xss-protection: 1, mode=block\n\t */\n\tX_XSS_PROTECTION: 'x-xss-protection',\n\t/**\n\t * The HTTP Content-Security-Policy response header allows web site administrators to control resources the user agent is allowed\n\t * to load for a given page. With a few exceptions, policies mostly involve specifying server origins and script endpoints.\n\t * This helps guard against cross-site scripting attacks (Cross-site_scripting).\n\t *\n\t * @example\n\t * content-security-policy: default-src\n\t */\n\tCONTENT_SECURITY_POLICY: 'content-security-policy',\n\t/**\n\t * The only defined value, \"nosniff\", prevents Internet Explorer from MIME-sniffing a response away from the declared content-type. This also applies to Google Chrome, when downloading extensions.\n\t *\n\t * @example\n\t * x-content-type-options: nosniff\n\t */\n\tX_CONTENT_TYPE_OPTIONS: 'x-content-type-options',\n\t/**\n\t * specifies the technology (e.g. ASP.NET, PHP, JBoss) supporting the web application (version details are often in X-Runtime, X-Version, or X-AspNet-Version)\n\t *\n\t * @example\n\t * x-powered-by: PHP/5.4.0\n\t */\n\tX_POWERED_BY: 'x-powered-by'\n};\n\nexport default HttpResponseHeader;", "/**\n * A class that holds a status code and a status text\n *\n * @module ResponseStatus\n * @author D1g1talEntr0py <jason.dimeo@gmail.com>\n */\nexport default class ResponseStatus {\n\t/** @type {number} */\n\t#code;\n\t/** @type {string} */\n\t#text;\n\n\t/**\n\t *\n\t * @param {number} code The status code from the {@link Response}\n\t * @param {string} text The status text from the {@link Response}\n\t */\n\tconstructor(code, text) {\n\t\tthis.#code = code;\n\t\tthis.#text = text;\n\t}\n\n\t/**\n\t * Returns the status code from the {@link Response}\n\t *\n\t * @returns {number} The status code.\n\t */\n\tget code() {\n\t\treturn this.#code;\n\t}\n\n\t/**\n\t * Returns the status text from the {@link Response}.\n\t *\n\t * @returns {string} The status text.\n\t */\n\tget text() {\n\t\treturn this.#text;\n\t}\n\n\t/**\n\t * A String value that is used in the creation of the default string\n\t * description of an object. Called by the built-in method {@link Object.prototype.toString}.\n\t *\n\t * @override\n\t * @returns {string} The default string description of this object.\n\t */\n\tget [Symbol.toStringTag]() {\n\t\treturn 'ResponseStatus';\n\t}\n\n\t/**\n\t * tostring method for the class.\n\t *\n\t * @override\n\t * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/toString|Object.prototype.toString}\n\t * @returns {string} The status code and status text.\n\t */\n\ttoString() {\n\t\treturn `${this.#code} ${this.#text}`;\n\t}\n}", "/**\n * @typedef {Map<string, Array<*>>} ParameterMap\n * @extends Map\n */\n\n/**\n * A {@link Map} that can contain multiple, unique, values for the same key.\n *\n * @type {ParameterMap<string, Array<*>>}\n */\nexport default class ParameterMap extends Map {\n\t/**\n\t * @param {Iterable<[string, *]>|Object} parameters The initial parameters to set.\n\t * @returns {ParameterMap<string, *>} The ParameterMap with the updated key and value.\n\t */\n\tconstructor(parameters = {}) {\n\t\tsuper();\n\t\tfor (const [key, value] of ParameterMap.#entries(parameters)) {\n\t\t\tthis.append(key, value);\n\t\t}\n\t}\n\n\t/**\n\t * Adds a new element with a specified key and value to the ParameterMap.\n\t * If an element with the same key already exists, the value will be replaced in the underlying {@link Set}.\n\t *\n\t * @override\n\t * @param {string} key The key to set.\n\t * @param {*} value The value to add to the ParameterMap\n\t * @returns {ParameterMap<string, *>} The ParameterMap with the updated key and value.\n\t */\n\tset(key, value) {\n\t\tconst array = super.get(key);\n\t\tif (array?.length > 0) {\n\t\t\tarray.length = 0;\n\t\t\tarray[0] = value;\n\t\t} else {\n\t\t\tsuper.set(key, [value]);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds all key-value pairs from an iterable or object to the ParameterMap.\n\t * If a key already exists, the value will be replaced in the underlying {@link Array}.\n\t *\n\t * @param {Iterable<[string, *]>|Object} parameters The parameters to set.\n\t * @returns {ParameterMap<string, *>} The ParameterMap with the updated key and value.\n\t */\n\tsetAll(parameters) {\n\t\tfor (const [key, value] of ParameterMap.#entries(parameters)) {\n\t\t\tthis.set(key, value);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Returns the value associated to the key, or undefined if there is none.\n\t * If the key has multiple values, the first value will be returned.\n\t * If the key has no values, undefined will be returned.\n\t *\n\t * @override\n\t * @param {string} key The key to get.\n\t * @returns {*} The value associated to the key, or undefined if there is none.\n\t */\n\tget(key) {\n\t\treturn super.get(key)?.[0];\n\t}\n\n\t/**\n\t * Returns an array of all values associated to the key, or undefined if there are none.\n\t *\n\t * @param {string} key The key to get.\n\t * @returns {Array<*>} An array of all values associated to the key, or undefined if there are none.\n\t */\n\tgetAll(key) {\n\t\treturn super.get(key);\n\t}\n\n\t/**\n\t * Appends a new value to an existing key inside a ParameterMap, or adds the new key if it does not exist.\n\t *\n\t * @param {string} key The key to append.\n\t * @param {*} value The value to append.\n\t * @returns {ParameterMap<string, *>} The ParameterMap with the updated key and value to allow chaining.\n\t */\n\tappend(key, value) {\n\t\tconst array = super.get(key);\n\t\tif (array?.length > 0) {\n\t\t\tarray.push(value);\n\t\t} else {\n\t\t\tsuper.set(key, [value]);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Appends all key-value pairs from an iterable or object to the ParameterMap.\n\t * If a key already exists, the value will be appended to the underlying {@link Array}.\n\t * If a key does not exist, the key and value will be added to the ParameterMap.\n\t *\n\t * @param {Iterable<[string, *]>|Object} parameters The parameters to append.\n\t * @returns {ParameterMap<string, *>} The ParameterMap with the updated key and value.\n\t */\n\tappendAll(parameters) {\n\t\tfor (const [key, value] of ParameterMap.#entries(parameters)) {\n\t\t\tthis.append(key, value);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Checks if a specific key has a specific value.\n\t *\n\t * @param {*} value The value to check.\n\t * @returns {boolean} True if the key has the value, false otherwise.\n\t */\n\thasValue(value) {\n\t\tfor (const array of super.values()) {\n\t\t\tif (array.includes(value)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Removes a specific value from a specific key.\n\t *\n\t * @param {*} value The value to remove.\n\t * @returns {boolean} True if the value was removed, false otherwise.\n\t */\n\tdeleteValue(value) {\n\t\tfor (const array of this.values()) {\n\t\t\tif (array.includes(value)) {\n\t\t\t\treturn array.splice(array.indexOf(value), 1).length > 0;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Determines whether the ParameterMap contains anything.\n\t *\n\t * @returns {boolean} True if the ParameterMap size is greater than 0, false otherwise.\n\t */\n\tisEmpty() {\n\t\treturn this.size === 0;\n\t}\n\n\t/**\n\t * Returns an Object that can be serialized to JSON.\n\t * If a key has only one value, the value will be a single value.\n\t * If a key has multiple values, the value will be an array of values.\n\t * If a key has no values, the value will be undefined.\n\t *\n\t * @override\n\t * @returns {Object} The Object to be serialized to JSON.\n\t * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#toJSON_behavior}\n\t */\n\ttoJSON() {\n\t\tconst obj = Object.create(null);\n\n\t\tfor (const [key, values] of super.entries()) {\n\t\t\tobj[key] = values.length === 1 ? values[0] : values;\n\t\t}\n\n\t\treturn obj;\n\t}\n\n\t/**\n\t * Returns an iterator that yields all key-value pairs in the map as arrays in their insertion order.\n\t *\n\t * @override\n\t * @yields {[string, *]} An iterator for the key-value pairs in the map.\n\t */\n\t*entries() {\n\t\tfor (const [key, array] of super.entries()) {\n\t\t\tfor (const value of array) { yield [key, value] }\n\t\t}\n\t}\n\n\t/**\n\t * Returns an iterator that yields all key-value pairs in the map as arrays in their insertion order.\n\t *\n\t * @override\n\t * @yields {[string, *]} An iterator for the key-value pairs in the map.\n\t */\n\t*[Symbol.iterator]() {\n\t\tyield* this.entries();\n\t}\n\n\t/**\n\t * Returns an iterable of key, value pairs for every entry in the parameters object.\n\t *\n\t * @private\n\t * @static\n\t * @param {Iterable<[string, *]>|Object} parameters The parameters to set.\n\t * @returns {Iterable<[string, *]>} An iterable of key, value pairs for every entry in the parameters object.\n\t */\n\tstatic #entries(parameters) {\n\t\treturn parameters[Symbol.iterator] ? parameters : Object.entries(parameters);\n\t}\n\n\t/**\n\t * A String value that is used in the creation of the default string description of an object.\n\t * Called by the built-in method {@link Object.prototype.toString}.\n\t *\n\t * @override\n\t * @returns {string} The default string description of this object.\n\t */\n\tget [Symbol.toStringTag]() {\n\t\treturn 'ParameterMap';\n\t}\n}", "/** @module utils */\n\nconst whitespaceCharacters = [' ', '\\t', '\\n', '\\r'];\nconst leadingWhitespace = /^[ \\t\\n\\r]+/u;\nconst trailingWhitespace = /[ \\t\\n\\r]+$/u;\nconst httpTokenCodePoints = /^[-!#$%&'*+.^_`|~A-Za-z0-9]*$/u;\nconst httpQuotedTokenCodePoints = /^[\\t\\u0020-\\u007E\\u0080-\\u00FF]*$/u;\n\n/**\n * A function to remove any leading and trailing HTTP whitespace.\n *\n * @param {string} string The string to process.\n * @returns {string} The processed string.\n */\nconst removeLeadingAndTrailingHTTPWhitespace = (string) => string.replace(leadingWhitespace, '').replace(trailingWhitespace, '');\n\n/**\n * A function to remove any trailing HTTP whitespace.\n *\n * @param {string} string The string to process.\n * @returns {string} The processed string.\n */\nconst removeTrailingHTTPWhitespace = (string) => string.replace(trailingWhitespace, '');\n\n/**\n * Determines if the provided character is whitespace.\n *\n * @param {string} char The character to evaluate.\n * @returns {boolean} true if the character is whitespace, false otherwise.\n */\nconst isHTTPWhitespaceChar = (char) => whitespaceCharacters.includes(char);\n\n/**\n * Determines if the provided string contains only HTTP token code points.\n *\n * @param {string} string The string to evaluate.\n * @returns {boolean} true if the string contains only HTTP token code points.\n */\nconst solelyContainsHTTPTokenCodePoints = (string) => httpTokenCodePoints.test(string);\n\n/**\n * Determines if the provided string contains only quoted HTTP token code points.\n *\n * @param {string} string The string to evaluate.\n * @returns {boolean} true if the string contains only quoted HTTP token code points.\n */\nconst solelyContainsHTTPQuotedStringTokenCodePoints = (string) => httpQuotedTokenCodePoints.test(string);\n\n/**\n * A function to lower case ASCII characters.\n * This implementation iterates over each element of the string, which is treated as an iterable.\n * The elements are destructured into [char, charCode] pairs, where char represents the character,\n * and charCode is assigned the character code using char.charCodeAt(0). If the charCode is not\n * provided, it falls back to the character code obtained from char.charCodeAt(0).\n *\n * @param {string} string The string to process.\n * @returns {string} The processed string with all ASCII characters lower cased.\n */\nconst asciiLowercase = (string) => {\n\tlet result = '';\n\tfor (const [char, charCode = char.charCodeAt(0)] of string) {\n\t\tresult += charCode >= 65 && charCode <= 90 ? String.fromCharCode(charCode + 32) : char;\n\t}\n\n\treturn result;\n};\n\n/**\n * Collects all the HTTP quoted strings.\n * This variant only implements it with the extract-value flag set.\n *\n * @param {string} input The string to process.\n * @param {number} position The starting position.\n * @returns {Array<string|number>} An array that includes the resulting string and updated position.\n */\nconst collectAnHTTPQuotedString = (input, position) => {\n\tlet value = '';\n\n\tfor (let length = input.length, char; ++position < length;) {\n\t\tchar = input[position];\n\n\t\tif (char == '\\\\') {\n\t\t\tvalue += ++position < length ? input[position] : char;\n\t\t} else if (char == '\"') {\n\t\t\tbreak;\n\t\t} else {\n\t\t\tvalue += char;\n\t\t}\n\t}\n\n\treturn [value, position];\n};\n\nexport { removeLeadingAndTrailingHTTPWhitespace, removeTrailingHTTPWhitespace, isHTTPWhitespaceChar, solelyContainsHTTPTokenCodePoints, solelyContainsHTTPQuotedStringTokenCodePoints, asciiLowercase, collectAnHTTPQuotedString };\n", "import { asciiLowercase, solelyContainsHTTPQuotedStringTokenCodePoints, solelyContainsHTTPTokenCodePoints } from './utils.js';\n\n/**\n * Class representing the parameters for a media type record.\n * This class has the equivalent surface API to a JavaScript {@link Map}.\n *\n * However, {@link MediaTypeParameters} methods will always interpret their arguments\n * as appropriate for media types, so parameter names will be lowercased,\n * and attempting to set invalid characters will throw an {@link Error}.\n *\n * @example charset=utf-8\n * @see https://mimesniff.spec.whatwg.org/#mime-type-essence\n * @see https://mimesniff.spec.whatwg.org/#mime-type-essence-record\n * @see https://mimesniff.spec.whatwg.org/#mime-type-essence-record-creation\n * @see https://mimesniff.spec.whatwg.org/#mime-type-essence-record-creation-algorithm\n * @module {MediaTypeParameters} media-type-parameters\n * @author D1g1talEntr0py <jason.dimeo@gmail.com>\n */\nexport default class MediaTypeParameters {\n\t/** @type {Map<string, string>} */\n\t#map;\n\n\t/**\n\t * Create a new MediaTypeParameters instance.\n\t *\n\t * @param {Array<Array<string>>} entries An array of [name, value] tuples.\n\t */\n\tconstructor(entries) {\n\t\tthis.#map = new Map(entries);\n\t}\n\n\t/**\n\t * Gets the number of media type parameters.\n\t *\n\t * @returns {number} The number of media type parameters\n\t */\n\tget size() {\n\t\treturn this.#map.size;\n\t}\n\n\t/**\n\t * Gets the media type parameter value for the supplied name.\n\t *\n\t * @param {string} name The name of the media type parameter to retrieve.\n\t * @returns {string} The media type parameter value.\n\t */\n\tget(name) {\n\t\treturn this.#map.get(asciiLowercase(String(name)));\n\t}\n\n\t/**\n\t * Indicates whether the media type parameter with the specified name exists or not.\n\t *\n\t * @param {string} name The name of the media type parameter to check.\n\t * @returns {boolean} true if the media type parameter exists, false otherwise.\n\t */\n\thas(name) {\n\t\treturn this.#map.has(asciiLowercase(String(name)));\n\t}\n\n\t/**\n\t * Adds a new media type parameter using the specified name and value to the MediaTypeParameters.\n\t * If an parameter with the same name already exists, the parameter will be updated.\n\t *\n\t * @param {string} name The name of the media type parameter to set.\n\t * @param {string} value The media type parameter value.\n\t * @returns {MediaTypeParameters} This instance.\n\t */\n\tset(name, value) {\n\t\tname = asciiLowercase(String(name));\n\t\tvalue = String(value);\n\n\t\tif (!solelyContainsHTTPTokenCodePoints(name)) {\n\t\t\tthrow new Error(`Invalid media type parameter name \"${name}\": only HTTP token code points are valid.`);\n\t\t}\n\n\t\tif (!solelyContainsHTTPQuotedStringTokenCodePoints(value)) {\n\t\t\tthrow new Error(`Invalid media type parameter value \"${value}\": only HTTP quoted-string token code points are valid.`);\n\t\t}\n\n\t\tthis.#map.set(name, value);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Clears all the media type parameters.\n\t */\n\tclear() {\n\t\tthis.#map.clear();\n\t}\n\n\t/**\n\t * Removes the media type parameter using the specified name.\n\t *\n\t * @param {string} name The name of the media type parameter to delete.\n\t * @returns {boolean} true if the parameter existed and has been removed, or false if the parameter does not exist.\n\t */\n\tdelete(name) {\n\t\tname = asciiLowercase(String(name));\n\t\treturn this.#map.delete(name);\n\t}\n\n\t/**\n\t * Executes a provided function once per each name/value pair in the MediaTypeParameters, in insertion order.\n\t *\n\t * @param {function(string, string): void} callback The function called on each iteration.\n\t * @param {*} [thisArg] Optional object when binding 'this' to the callback.\n\t */\n\tforEach(callback, thisArg) {\n\t\tthis.#map.forEach(callback, thisArg);\n\t}\n\n\t/**\n\t * Returns an iterable of parameter names.\n\t *\n\t * @returns {IterableIterator<string>} The {@link IterableIterator} of media type parameter names.\n\t */\n\tkeys() {\n\t\treturn this.#map.keys();\n\t}\n\n\t/**\n\t * Returns an iterable of parameter values.\n\t *\n\t * @returns {IterableIterator<string>} The {@link IterableIterator} of media type parameter values.\n\t */\n\tvalues() {\n\t\treturn this.#map.values();\n\t}\n\n\t/**\n\t * Returns an iterable of name, value pairs for every parameter entry in the media type parameters.\n\t *\n\t * @returns {IterableIterator<Array<Array<string>>>} The media type parameter entries.\n\t */\n\tentries() {\n\t\treturn this.#map.entries();\n\t}\n\n\t/**\n\t * A method that returns the default iterator for the {@link MediaTypeParameters}. Called by the semantics of the for-of statement.\n\t *\n\t * @returns {Iterator<string, string, undefined>} The {@link Symbol.iterator} for the media type parameters.\n\t */\n\t[Symbol.iterator]() {\n\t\treturn this.#map[Symbol.iterator]();\n\t}\n\n\t/**\n\t * Returns a string representation of the media type parameters.\n\t * This method is called by the `String()` function.\n\t *\n\t * @example\n\t * const parameters = new MediaTypeParameters(new Map([['charset', 'utf-8']]));\n\t * String(parameters); // 'charset=utf-8'\n\t * parameters.toString(); // 'charset=utf-8'\n\t * parameters + ''; // 'charset=utf-8'\n\t * `${parameters}`; // 'charset=utf-8'\n\t * parameters[Symbol.toStringTag]; // 'MediaTypeParameters'\n\t * parameters[Symbol.toStringTag](); // 'MediaTypeParameters'\n\t * Object.prototype.toString.call(parameters); // '[object MediaTypeParameters]'\n\t * parameters + ''; // 'charset=utf-8'\n\t * @returns {string} The string representation of the media type parameters.\n\t */\n\t[Symbol.toStringTag]() {\n\t\treturn 'MediaTypeParameters';\n\t}\n}", "import {\n\tasciiLowercase,\n\tcollectAnHTTPQuotedString, isHTTPWhitespaceChar, removeLeadingAndTrailingHTTPWhitespace,\n\tremoveTrailingHTTPWhitespace, solelyContainsHTTPQuotedStringTokenCodePoints, solelyContainsHTTPTokenCodePoints\n} from './utils.js';\n\n/**\n * Function to parse a media type.\n *\n * @module parser\n * @param {string} input The media type to parse\n * @returns {{ type: string, subtype: string, parameters: Map<string, string> }} An object populated with the parsed media type properties and any parameters.\n */\nconst parse = (input) => {\n\tinput = removeLeadingAndTrailingHTTPWhitespace(input);\n\n\tlet position = 0;\n\tlet type = '';\n\twhile (position < input.length && input[position] != '/') {\n\t\ttype += input[position];\n\t\t++position;\n\t}\n\n\tif (type.length === 0 || !solelyContainsHTTPTokenCodePoints(type)) {\n\t\treturn null;\n\t}\n\n\tif (position >= input.length) {\n\t\treturn null;\n\t}\n\n\t// Skips past \"/\"\n\t++position;\n\n\tlet subtype = '';\n\twhile (position < input.length && input[position] != ';') {\n\t\tsubtype += input[position];\n\t\t++position;\n\t}\n\n\tsubtype = removeTrailingHTTPWhitespace(subtype);\n\n\tif (subtype.length === 0 || !solelyContainsHTTPTokenCodePoints(subtype)) {\n\t\treturn null;\n\t}\n\n\tconst mediaType = {\n\t\ttype: asciiLowercase(type),\n\t\tsubtype: asciiLowercase(subtype),\n\t\tparameters: new Map()\n\t};\n\n\twhile (position < input.length) {\n\t\t// Skip past \";\"\n\t\t++position;\n\n\t\twhile (isHTTPWhitespaceChar(input[position])) {\n\t\t\t++position;\n\t\t}\n\n\t\tlet parameterName = '';\n\t\twhile (position < input.length && input[position] != ';' && input[position] != '=') {\n\t\t\tparameterName += input[position];\n\t\t\t++position;\n\t\t}\n\t\tparameterName = asciiLowercase(parameterName);\n\n\t\tif (position < input.length) {\n\t\t\tif (input[position] == ';') {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Skip past \"=\"\n\t\t\t++position;\n\t\t}\n\n\t\tlet parameterValue = null;\n\t\tif (input[position] == '\"') {\n\t\t\t[parameterValue, position] = collectAnHTTPQuotedString(input, position);\n\n\t\t\twhile (position < input.length && input[position] != ';') {\n\t\t\t\t++position;\n\t\t\t}\n\t\t} else {\n\t\t\tparameterValue = '';\n\t\t\twhile (position < input.length && input[position] != ';') {\n\t\t\t\tparameterValue += input[position];\n\t\t\t\t++position;\n\t\t\t}\n\n\t\t\tparameterValue = removeTrailingHTTPWhitespace(parameterValue);\n\n\t\t\tif (parameterValue === '') {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tif (parameterName.length > 0 &&\tsolelyContainsHTTPTokenCodePoints(parameterName) &&\tsolelyContainsHTTPQuotedStringTokenCodePoints(parameterValue) && !mediaType.parameters.has(parameterName)) {\n\t\t\tmediaType.parameters.set(parameterName, parameterValue);\n\t\t}\n\t}\n\n\treturn mediaType;\n};\n\nexport default parse;", "import { solelyContainsHTTPTokenCodePoints } from './utils.js';\n\n/** @typedef { import('./media-type.js').default } MediaType */\n\n/**\n * A function that serializes the provided {@link mediaType} to a string.\n *\n * @module serializer\n * @param {MediaType} mediaType The media type to serialize.\n * @returns {string} The serialized media type.\n */\nconst serialize = (mediaType) => {\n\tlet serialization = `${mediaType.type}/${mediaType.subtype}`;\n\n\tif (mediaType.parameters.size === 0) {\n\t\treturn serialization;\n\t}\n\n\tfor (let [name, value] of mediaType.parameters) {\n\t\tserialization += `;${name}=`;\n\n\t\tif (!solelyContainsHTTPTokenCodePoints(value) || value.length === 0) {\n\t\t\tvalue = `\"${value.replace(/([\"\\\\])/ug, '\\\\$1')}\"`;\n\t\t}\n\n\t\tserialization += value;\n\t}\n\n\treturn serialization;\n};\n\nexport default serialize;", "import MediaTypeParameters from './media-type-parameters.js';\nimport parse from './parser.js';\nimport serialize from './serializer.js';\nimport { asciiLowercase, solelyContainsHTTPTokenCodePoints } from './utils.js';\n\n/**\n * Class used to parse media types.\n *\n * @module {MediaType} media-type\n * @see https://mimesniff.spec.whatwg.org/#understanding-mime-types\n */\nexport default class MediaType {\n\t/** @type {string} */\n\t#type;\n\t/** @type {string} */\n\t#subtype;\n\t/** @type {MediaTypeParameters} */\n\t#parameters;\n\n\t/**\n\t * Create a new MediaType instance from a string representation.\n\t *\n\t * @param {string} mediaType The media type to parse.\n\t * @param {Object} [parameters] Optional parameters.\n\t */\n\tconstructor(mediaType, parameters = {}) {\n\t\tconst { type, subtype, parameters: parsedParameters } = parse(mediaType);\n\t\tthis.#type = type;\n\t\tthis.#subtype = subtype;\n\t\tthis.#parameters = new MediaTypeParameters([...parsedParameters, ...Object.entries(parameters).map(([name, value]) => [asciiLowercase(name), asciiLowercase(value)])]);\n\t}\n\n\t/**\n\t * Static factory method for parsing a media type.\n\t *\n\t * @param {string} string The media type to parse.\n\t * @returns {MediaType} The parsed {@link MediaType} object or null if the string could not be parsed.\n\t */\n\tstatic parse(string) {\n\t\ttry {\n\t\t\treturn new MediaType(string);\n\t\t} catch (e) {\n\t\t\tthrow new Error(`Could not parse media type string '${string}'`);\n\t\t}\n\t}\n\n\t/**\n\t * Gets the media type essence (type/subtype).\n\t *\n\t * @returns {string} The media type without any parameters\n\t */\n\tget essence() {\n\t\treturn `${this.#type}/${this.#subtype}`;\n\t}\n\n\t/**\n\t * Gets the type.\n\t *\n\t * @returns {string} The type.\n\t */\n\tget type() {\n\t\treturn this.#type;\n\t}\n\n\t/**\n\t * Sets the type.\n\t */\n\tset type(value) {\n\t\tvalue = asciiLowercase(String(value));\n\n\t\tif (value.length === 0) {\n\t\t\tthrow new Error('Invalid type: must be a non-empty string');\n\t\t}\n\t\tif (!solelyContainsHTTPTokenCodePoints(value)) {\n\t\t\tthrow new Error(`Invalid type ${value}: must contain only HTTP token code points`);\n\t\t}\n\n\t\tthis.#type = value;\n\t}\n\n\t/**\n\t * Gets the subtype.\n\t *\n\t * @returns {string} The subtype.\n\t */\n\tget subtype() {\n\t\treturn this.#subtype;\n\t}\n\n\t/**\n\t * Sets the subtype.\n\t */\n\tset subtype(value) {\n\t\tvalue = asciiLowercase(String(value));\n\n\t\tif (value.length === 0) {\n\t\t\tthrow new Error('Invalid subtype: must be a non-empty string');\n\t\t}\n\t\tif (!solelyContainsHTTPTokenCodePoints(value)) {\n\t\t\tthrow new Error(`Invalid subtype ${value}: must contain only HTTP token code points`);\n\t\t}\n\n\t\tthis.#subtype = value;\n\t}\n\n\t/**\n\t * Gets the parameters.\n\t *\n\t * @returns {MediaTypeParameters} The media type parameters.\n\t */\n\tget parameters() {\n\t\treturn this.#parameters;\n\t}\n\n\t/**\n\t * Gets the serialized version of the media type.\n\t *\n\t * @returns {string} The serialized media type.\n\t */\n\ttoString() {\n\t\t// The serialize function works on both 'media type records' (i.e. the results of parse) and on this class, since\n\t\t// this class's interface is identical.\n\t\treturn serialize(this);\n\t}\n\n\t/**\n\t * Determines if this instance is a JavaScript media type.\n\t *\n\t * @param {Object} [options] Optional options.\n\t * @param {boolean} [options.prohibitParameters=false] The option to prohibit parameters when checking if the media type is JavaScript.\n\t * @returns {boolean} true if this instance represents a JavaScript media type, false otherwise.\n\t */\n\tisJavaScript({prohibitParameters = false} = {}) {\n\t\tswitch (this.#type) {\n\t\t\tcase 'text': {\n\t\t\t\tswitch (this.#subtype) {\n\t\t\t\t\tcase 'ecmascript':\n\t\t\t\t\tcase 'javascript':\n\t\t\t\t\tcase 'javascript1.0':\n\t\t\t\t\tcase 'javascript1.1':\n\t\t\t\t\tcase 'javascript1.2':\n\t\t\t\t\tcase 'javascript1.3':\n\t\t\t\t\tcase 'javascript1.4':\n\t\t\t\t\tcase 'javascript1.5':\n\t\t\t\t\tcase 'jscript':\n\t\t\t\t\tcase 'livescript':\n\t\t\t\t\tcase 'x-ecmascript':\n\t\t\t\t\tcase 'x-javascript': return !prohibitParameters || this.#parameters.size === 0;\n\t\t\t\t\tdefault: return false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcase 'application': {\n\t\t\t\tswitch (this.#subtype) {\n\t\t\t\t\tcase 'ecmascript':\n\t\t\t\t\tcase 'javascript':\n\t\t\t\t\tcase 'x-ecmascript':\n\t\t\t\t\tcase 'x-javascript': return !prohibitParameters || this.#parameters.size === 0;\n\t\t\t\t\tdefault: return false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tdefault: return false;\n\t\t}\n\t}\n\n\t/**\n\t * Determines if this instance is an XML media type.\n\t *\n\t * @returns {boolean} true if this instance represents an XML media type, false otherwise.\n\t */\n\tisXML() {\n\t\treturn (this.#subtype === 'xml' && (this.#type === 'text' || this.#type === 'application')) || this.#subtype.endsWith('+xml');\n\t}\n\n\t/**\n\t * Determines if this instance is an HTML media type.\n\t *\n\t * @returns {boolean} true if this instance represents an HTML media type, false otherwise.\n\t */\n\tisHTML() {\n\t\treturn this.#subtype === 'html' && this.#type === 'text';\n\t}\n\n\t/**\n\t * Gets the name of the class.\n\t *\n\t * @returns {string} The class name\n\t */\n\tget [Symbol.toStringTag]() {\n\t\treturn 'MediaType';\n\t}\n}", "import HttpRequestMethod from './http-request-methods.js';\nimport { MediaType } from '@d1g1tal/media-type';\nimport HttpMediaType from './http-media-type.js';\n\n/** @typedef {'configured'|'success'|'error'|'aborted'|'timeout'|'complete'} RequestEvent */\n\n/** @type {string} */\nconst defaultCharset = 'utf-8';\n\n/** @type {RegExp} */\nconst endsWithSlashRegEx = /\\/$/;\n\n/** @typedef {Map<string, MediaType>} MediaTypeMap A map of media types. */\n\n/** @type {MediaTypeMap} */\nconst mediaTypes = new Map([\n\t[HttpMediaType.PNG, new MediaType(HttpMediaType.PNG)],\n\t[HttpMediaType.TEXT, new MediaType(HttpMediaType.TEXT, { defaultCharset })],\n\t[HttpMediaType.JSON, new MediaType(HttpMediaType.JSON, { defaultCharset })],\n\t[HttpMediaType.HTML, new MediaType(HttpMediaType.HTML, { defaultCharset })],\n\t[HttpMediaType.JAVA_SCRIPT, new MediaType(HttpMediaType.JAVA_SCRIPT, { defaultCharset })],\n\t[HttpMediaType.CSS, new MediaType(HttpMediaType.CSS, { defaultCharset })],\n\t[HttpMediaType.XML, new MediaType(HttpMediaType.XML, { defaultCharset })],\n\t[HttpMediaType.BIN, new MediaType(HttpMediaType.BIN)]\n]);\n\n/**\n * @static\n * @constant {Object<string, RequestEvent>}\n */\nconst RequestEvents = Object.freeze({\n\tCONFIGURED: 'configured',\n\tSUCCESS: 'success',\n\tERROR: 'error',\n\tABORTED: 'aborted',\n\tTIMEOUT: 'timeout',\n\tCOMPLETE: 'complete',\n\tALL_COMPLETE: 'all-complete'\n});\n\nconst SignalEvents = Object.freeze({\n\tABORT: 'abort',\n\tTIMEOUT: 'timeout'\n});\n\nconst _abortEvent = new CustomEvent(SignalEvents.ABORT, { detail: { cause: new DOMException('The request was aborted', 'AbortError') } });\n\nconst requestBodyMethods = [ HttpRequestMethod.POST, HttpRequestMethod.PUT, HttpRequestMethod.PATCH ];\n\nexport { defaultCharset, endsWithSlashRegEx, mediaTypes, RequestEvents, SignalEvents, _abortEvent as abortEvent, requestBodyMethods };", "import { SignalEvents, abortEvent } from './constants.js';\n\nconst NativeAbortSignal = globalThis.AbortSignal;\n\n/**\n * @typedef {function(Event):void} EventListener\n * @param {Event} event The event object\n */\n\nexport default class AbortSignal extends EventTarget {\n\t/** @type {AbortController} */\n\t#abortController;\n\t/** @type {number} */\n\t#timeoutId;\n\n\t/**\n\t * @param {AbortSignal} signal The signal to listen to\n\t */\n\tconstructor(signal) {\n\t\tsuper();\n\t\tthis.#abortController = new AbortController();\n\t\tsignal?.addEventListener(SignalEvents.ABORT, (event) => this.#abort(event));\n\t}\n\n\t/**\n\t * Returns an {@link AbortSignal} instance that is already set as aborted.\n\t *\n\t * @static\n\t * @returns {AbortSignal} The abort signal\n\t */\n\tstatic abort() {\n\t\treturn NativeAbortSignal.abort();\n\t}\n\n\t/**\n\t * Returns an AbortSignal instance that will automatically abort after a specified time.\n\t *\n\t * @static\n\t * @param {number} time The time in milliseconds to wait before aborting\n\t * @returns {AbortSignal} The abort signal\n\t */\n\tstatic timeout(time) {\n\t\treturn NativeAbortSignal.timeout(time);\n\t}\n\n\t/**\n\t * The aborted property is a Boolean that indicates whether the request has been aborted (true) or not (false).\n\t *\n\t * @returns {boolean} Whether the signal was aborted or not\n\t */\n\tget aborted() {\n\t\treturn this.#abortController.signal.aborted;\n\t}\n\n\t/**\n\t * The reason property returns a DOMException object indicating the reason the operation was aborted, or null if the operation is not aborted.\n\t *\n\t * @returns {DOMException} The reason the signal was aborted\n\t */\n\tget reason() {\n\t\treturn this.#abortController.signal.reason;\n\t}\n\n\t/**\n\t * throws the signal's abort reason if the signal has been aborted; otherwise it does nothing.\n\t *\n\t * @returns {void}\n\t */\n\tthrowIfAborted() {\n\t\tthis.#abortController.signal.throwIfAborted();\n\t}\n\n\t/**\n\t * Returns an AbortSignal instance that will be aborted when the provided amount of milliseconds have passed.\n\t * A value of -1 (which is the default) means there is no timeout.\n\t * Note: You can't set this property to a value less than 0.\n\t *\n\t * @param {number} timeout The timeout in milliseconds\n\t * @returns {AbortSignal} The abort signal\n\t */\n\twithTimeout(timeout) {\n\t\tif (timeout < 0) {\n\t\t\tthrow new RangeError('The timeout cannot be negative');\n\t\t}\n\n\t\tthis.#timeoutId ??= setTimeout(() => this.#abort(AbortSignal.#generateTimeoutEvent(timeout), true), timeout);\n\n\t\treturn this.#abortController.signal;\n\t}\n\n\t/**\n\t * Clears the timeout.\n\t * Note: This does not abort the signal, dispatch the timeout event, or reset the timeout.\n\t *\n\t * @returns {void}\n\t */\n\tclearTimeout() {\n\t\tclearTimeout(this.#timeoutId);\n\t}\n\n\t/**\n\t * Adds an event listener for the specified event type.\n\t *\n\t * @override\n\t * @param {string} eventName The name of the event to listen to\n\t * @param {EventListener} listener The listener to add\n\t * @returns {void}\n\t */\n\taddEventListener(eventName, listener) {\n\t\tthis.#abortController.signal.addEventListener(eventName, listener);\n\t}\n\n\t/**\n\t * Dispatches an event to this EventTarget.\n\t *\n\t * @override\n\t * @param {Event} event The event to dispatch\n\t * @returns {boolean} Whether the event was dispatched or not\n\t */\n\tdispatchEvent(event) {\n\t\treturn this.#abortController.signal.dispatchEvent(event);\n\t}\n\n\t/**\n\t * Removes an event listener for the specified event type.\n\t *\n\t * @override\n\t * @param {string} eventName The name of the event to listen to\n\t * @param {EventListener} listener The listener to remove\n\t * @returns {void}\n\t */\n\tremoveEventListener(eventName, listener) {\n\t\tthis.#abortController.signal.removeEventListener(eventName, listener);\n\t}\n\n\t/**\n\t * Aborts the signal. This is so naughty. \u00AF\\_(\u30C4)_/\u00AF\n\t *\n\t * @param {Event} event The event to abort with\n\t * @returns {void}\n\t */\n\tabort(event) {\n\t\tthis.#abort(event);\n\t}\n\n\t/**\n\t * Aborts the signal.\n\t *\n\t * @private\n\t * @param {Event} event The event to abort with\n\t * @param {boolean} [dispatchEvent = false] Whether to dispatch the event or not\n\t * @returns {void}\n\t * @fires SignalEvents.ABORT When the signal is aborted\n\t * @fires SignalEvents.TIMEOUT When the signal times out\n\t */\n\t#abort(event = abortEvent, dispatchEvent = false) {\n\t\tclearTimeout(this.#timeoutId);\n\t\tthis.#abortController.abort(event.detail?.cause);\n\t\tif (dispatchEvent) {\n\t\t\tthis.#abortController.signal.dispatchEvent(event);\n\t\t}\n\t}\n\n\t/**\n\t * Generates a timeout event.\n\t *\n\t * @private\n\t * @static\n\t * @param {number} timeout The timeout in milliseconds\n\t * @returns {CustomEvent} The timeout event\n\t */\n\tstatic #generateTimeoutEvent(timeout) {\n\t\treturn new CustomEvent(SignalEvents.TIMEOUT, { detail: { timeout, cause: new DOMException(`The request timed-out after ${timeout / 1000} seconds`, 'TimeoutError') } });\n\t}\n}", "/** @typedef {Object.prototype.constructor} Type */\n\n/**\n * Gets the object type for the current instance.\n *\n * @param {*} object The object to check\n * @returns {Type} The object type\n */\nconst _type = (object) => object?.constructor ?? object?.prototype?.constructor ?? globalThis[Object.prototype.toString.call(object).slice(8, -1)] ?? object;\n\nexport default _type;", "import _type from './object-type.js';\n\n/**\n * Performs a deep merge of multiple objects.\n *\n * @param {...Object} objects The objects to merge\n * @returns {Object} The merged object\n */\nconst _objectMerge = (...objects) => {\n\tconst target = {};\n\tfor (const source of objects) {\n\t\tif (_type(source) != Object) return undefined;\n\n\t\tlet descriptor, sourceType;\n\t\tfor (const property of Object.getOwnPropertyNames(source)) {\n\t\t\tdescriptor = Object.getOwnPropertyDescriptor(source, property);\n\t\t\tif (descriptor.enumerable) {\n\t\t\t\tsourceType = _type(source[property]);\n\t\t\t\tif (sourceType == Object) {\n\t\t\t\t\tdescriptor.value = _type(target[property]) == Object ? _objectMerge(target[property], source[property]) : { ...source[property] };\n\t\t\t\t} else if (sourceType == Array) {\n\t\t\t\t\tdescriptor.value = Array.isArray(target[property]) ? [ ...new Set([ ...source[property], ...target[property] ]) ] : [ ...source[property] ];\n\t\t\t\t}\n\n\t\t\t\ttarget[property] = descriptor.value;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn target;\n};\n\nex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AAiBsC,CAAY,IAAKzE,EAAWO,GACxD,GAAIkE,EAAa,IAAIR,EAAU,IAAI,GAAKQ,EAAa,IAAIR,EAAU,OAAO,EAAG,CAC5EzC,EAAUW,EACV,KACD,EAIF,OAAOX,CACR,CAQA,IAAK,OAAO,WAAW,GAAI,CAC1B,MAAO,YACR,CACD",
|
|
6
6
|
"names": ["transportr_exports", "__export", "Transportr", "SetMultiMap", "key", "value", "values", "set_multi_map_default", "SetMultiMap", "key", "value", "ContextEventHandler", "#context", "#eventHandler", "context", "eventHandler", "event", "data", "Subscription", "#eventName", "#contextEventHandler", "eventName", "contextEventHandler", "Subscribr", "#subscribers", "SetMultiMap", "eventName", "eventHandler", "context", "contextEventHandler", "ContextEventHandler", "Subscription", "contextEventHandlers", "removed", "event", "data", "HttpError", "#entity", "#responseStatus", "message", "cause", "status", "entity", "HttpMediaType", "http_media_type_default", "HttpRequestHeader", "http_request_headers_default", "HttpRequestMethod", "http_request_methods_default", "HttpResponseHeader", "http_response_headers_default", "ResponseStatus", "#code", "#text", "code", "text", "ParameterMap", "_ParameterMap", "parameters", "key", "value", "#entries", "array", "obj", "values", "whitespaceCharacters", "leadingWhitespace", "trailingWhitespace", "httpTokenCodePoints", "httpQuotedTokenCodePoints", "removeLeadingAndTrailingHTTPWhitespace", "string", "removeTrailingHTTPWhitespace", "isHTTPWhitespaceChar", "char", "solelyContainsHTTPTokenCodePoints", "solelyContainsHTTPQuotedStringTokenCodePoints", "asciiLowercase", "result", "charCode", "collectAnHTTPQuotedString", "input", "position", "value", "length", "MediaTypeParameters", "#map", "entries", "name", "asciiLowercase", "value", "solelyContainsHTTPTokenCodePoints", "solelyContainsHTTPQuotedStringTokenCodePoints", "callback", "thisArg", "parse", "input", "removeLeadingAndTrailingHTTPWhitespace", "position", "type", "solelyContainsHTTPTokenCodePoints", "subtype", "removeTrailingHTTPWhitespace", "mediaType", "asciiLowercase", "isHTTPWhitespaceChar", "parameterName", "parameterValue", "collectAnHTTPQuotedString", "solelyContainsHTTPQuotedStringTokenCodePoints", "parser_default", "serialize", "mediaType", "serialization", "name", "value", "solelyContainsHTTPTokenCodePoints", "serializer_default", "MediaType", "_MediaType", "#type", "#subtype", "#parameters", "mediaType", "parameters", "type", "subtype", "parsedParameters", "parser_default", "MediaTypeParameters", "name", "value", "asciiLowercase", "string", "solelyContainsHTTPTokenCodePoints", "serializer_default", "prohibitParameters", "defaultCharset", "endsWithSlashRegEx", "mediaTypes", "http_media_type_default", "MediaType", "RequestEvents", "SignalEvents", "_abortEvent", "requestBodyMethods", "http_request_methods_default", "NativeAbortSignal", "AbortSignal", "_AbortSignal", "#abortController", "#timeoutId", "signal", "SignalEvents", "event", "#abort", "time", "timeout", "#generateTimeoutEvent", "eventName", "listener", "_abortEvent", "dispatchEvent", "_type", "object", "object_type_default", "_objectMerge", "objects", "target", "source", "object_type_default", "descriptor", "sourceType", "property", "object_merge_default", "_handleText", "response", "_handleScript", "objectURL", "http_media_type_default", "_handleCss", "_handleJson", "_handleBlob", "_handleImage", "_handleBuffer", "_handleReadableStream", "_handleXml", "_handleHtml", "_handleHtmlFragment", "Transportr", "_Transportr", "#baseUrl", "#options", "#subscribr", "#globalSubscribr", "Subscribr", "#activeRequests", "#contentTypeHandlers", "set_multi_map_default", "mediaTypes", "url", "options", "object_type_default", "#getBaseUrl", "#createOptions", "#defaultRequestOptions", "http_request_methods_default", "http_request_headers_default", "http_response_headers_default", "RequestEvents", "#eventResponseStatuses", "ResponseStatus", "AbortSignal", "event", "handler", "context", "eventRegistration", "abortSignal", "_abortEvent", "path", "#get", "body", "#request", "method", "userOptions", "responseHandler", "#processRequestOptions", "cause", "HttpError", "#publish", "#createUrl", "SignalEvents", "result", "#requestOptionsProxyHandler", "#getResponseHandler", "#handleError", "#generateResponseStatusFromError", "error", "userHeaders", "userSearchParams", "headers", "searchParams", "object_merge_default", "ParameterMap", "#mergeOptions", "target", "userOption", "requestOption", "option", "name", "value", "userBody", "requestOptions", "requestBodyMethods", "contentType", "mediaType", "MediaType", "timeout", "property", "endsWithSlashRegEx", "errorName", "data", "global", "contentTypes"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@d1g1tal/transportr",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "JavaScript wrapper for the Fetch API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"esbuild": "^0.19.3",
|
|
48
48
|
"eslint": "^8.49.0",
|
|
49
49
|
"eslint-plugin-compat": "^4.2.0",
|
|
50
|
-
"eslint-plugin-jsdoc": "^46.8.
|
|
50
|
+
"eslint-plugin-jsdoc": "^46.8.2",
|
|
51
51
|
"jest": "^29.7.0",
|
|
52
52
|
"rimraf": "^5.0.1"
|
|
53
53
|
},
|