UNPKG

hfs

Version:
2 lines (1 loc) 8.1 kB
!function(){"use strict";var e,t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};e||(e=1,function(){function e(e,t){return(t||"")+" (SystemJS https://github.com/systemjs/systemjs/blob/main/docs/errors.md#"+e+")"}function n(e,t){if(-1!==e.indexOf("\\")&&(e=e.replace(b,"/")),"/"===e[0]&&"/"===e[1])return t.slice(0,t.indexOf(":")+1)+e;if("."===e[0]&&("/"===e[1]||"."===e[1]&&("/"===e[2]||2===e.length&&(e+="/"))||1===e.length&&(e+="/"))||"/"===e[0]){var n,r=t.slice(0,t.indexOf(":")+1);if(n="/"===t[r.length+1]?"file:"!==r?(n=t.slice(r.length+2)).slice(n.indexOf("/")+1):t.slice(8):t.slice(r.length+("/"===t[r.length])),"/"===e[0])return t.slice(0,t.length-n.length-1)+e;for(var i=n.slice(0,n.lastIndexOf("/")+1)+e,o=[],s=-1,c=0;c<i.length;c++)-1!==s?"/"===i[c]&&(o.push(i.slice(s,c+1)),s=-1):"."===i[c]?"."!==i[c+1]||"/"!==i[c+2]&&c+2!==i.length?"/"===i[c+1]||c+1===i.length?c+=1:s=c:(o.pop(),c+=2):s=c;return-1!==s&&o.push(i.slice(s)),t.slice(0,t.length-n.length)+o.join("")}}function r(e,t){return n(e,t)||(-1!==e.indexOf(":")?e:n("./"+e,t))}function i(e,t,r,i,o){for(var s in e){var c=n(s,r)||s,a=e[s];if("string"==typeof a){var l=f(i,n(a,r)||a,o);l?t[c]=l:u("W1",s,a)}}}function o(e,t,n){var o;for(o in e.imports&&i(e.imports,n.imports,t,n,null),e.scopes||{}){var s=r(o,t);i(e.scopes[o],n.scopes[s]||(n.scopes[s]={}),t,n,s)}for(o in e.depcache||{})n.depcache[r(o,t)]=e.depcache[o];for(o in e.integrity||{})n.integrity[r(o,t)]=e.integrity[o]}function s(e,t){if(t[e])return e;var n=e.length;do{var r=e.slice(0,n+1);if(r in t)return r}while(-1!==(n=e.lastIndexOf("/",n-1)))}function c(e,t){var n=s(e,t);if(n){var r=t[n];if(null===r)return;if(!(e.length>n.length&&"/"!==r[r.length-1]))return r+e.slice(n.length);u("W2",n,r)}}function u(t,n,r){console.warn(e(t,[r,n].join(", ")))}function f(e,t,n){for(var r=e.scopes,i=n&&s(n,r);i;){var o=c(t,r[i]);if(o)return o;i=s(i.slice(0,i.lastIndexOf("/")),r)}return c(t,e.imports)||-1!==t.indexOf(":")&&t}function a(){this[P]={}}function l(t,n,r,i){var o=t[P][n];if(o)return o;var s=[],c=Object.create(null);j&&Object.defineProperty(c,j,{value:"Module"});var u=Promise.resolve().then((function(){return t.instantiate(n,r,i)})).then((function(r){if(!r)throw Error(e(2,n));var i=r[1]((function(e,t){o.h=!0;var n=!1;if("string"==typeof e)e in c&&c[e]===t||(c[e]=t,n=!0);else{for(var r in e)t=e[r],r in c&&c[r]===t||(c[r]=t,n=!0);e&&e.__esModule&&(c.__esModule=e.__esModule)}if(n)for(var i=0;i<s.length;i++){var u=s[i];u&&u(c)}return t}),2===r[1].length?{import:function(e,r){return t.import(e,n,r)},meta:t.createContext(n)}:void 0);return o.e=i.execute||function(){},[r[0],i.setters||[],r[2]||[]]}),(function(e){throw o.e=null,o.er=e,e})),f=u.then((function(e){return Promise.all(e[0].map((function(r,i){var o=e[1][i],s=e[2][i];return Promise.resolve(t.resolve(r,n)).then((function(e){var r=l(t,e,n,s);return Promise.resolve(r.I).then((function(){return o&&(r.i.push(o),!r.h&&r.I||o(r.n)),r}))}))}))).then((function(e){o.d=e}))}));return o=t[P][n]={id:n,i:s,n:c,m:i,I:u,L:f,h:!1,d:void 0,e:void 0,er:void 0,E:void 0,C:void 0,p:void 0}}function h(e,t,n,r){if(!r[t.id])return r[t.id]=!0,Promise.resolve(t.L).then((function(){return t.p&&null!==t.p.e||(t.p=n),Promise.all(t.d.map((function(t){return h(e,t,n,r)})))})).catch((function(e){if(t.er)throw e;throw t.e=null,e}))}function d(e,t){return t.C=h(e,t,t,{}).then((function(){return p(e,t,{})})).then((function(){return t.n}))}function p(e,t,n){function r(){try{var e=o.call(L);if(e)return e=e.then((function(){t.C=t.n,t.E=null}),(function(e){throw t.er=e,t.E=null,e})),t.E=e;t.C=t.n,t.L=t.I=void 0}catch(n){throw t.er=n,n}}if(!n[t.id]){if(n[t.id]=!0,!t.e){if(t.er)throw t.er;return t.E?t.E:void 0}var i,o=t.e;return t.e=null,t.d.forEach((function(r){try{var o=p(e,r,n);o&&(i=i||[]).push(o)}catch(c){throw t.er=c,c}})),i?Promise.all(i).then(r):r()}}function v(){[].forEach.call(document.querySelectorAll("script"),(function(t){if(!t.sp)if("systemjs-module"===t.type){if(t.sp=!0,!t.src)return;System.import("import:"===t.src.slice(0,7)?t.src.slice(7):r(t.src,m)).catch((function(e){if(e.message.indexOf("https://github.com/systemjs/systemjs/blob/main/docs/errors.md#3")>-1){var n=document.createEvent("Event");n.initEvent("error",!1,!1),t.dispatchEvent(n)}return Promise.reject(e)}))}else if("systemjs-importmap"===t.type){t.sp=!0;var n=t.src?(System.fetch||fetch)(t.src,{integrity:t.integrity,priority:t.fetchPriority,passThrough:!0}).then((function(e){if(!e.ok)throw Error(e.status);return e.text()})).catch((function(n){return n.message=e("W4",t.src)+"\n"+n.message,console.warn(n),"function"==typeof t.onerror&&t.onerror(),"{}"})):t.innerHTML;T=T.then((function(){return n})).then((function(n){!function(t,n,r){var i={};try{i=JSON.parse(n)}catch(c){console.warn(Error(e("W5")))}o(i,r,t)}(R,n,t.src||m)}))}}))}var m,g="undefined"!=typeof Symbol,y="undefined"!=typeof self,w="undefined"!=typeof document,E=y?self:t;if(w){var O=document.querySelector("base[href]");O&&(m=O.href)}if(!m&&"undefined"!=typeof location){var x=(m=location.href.split("#")[0].split("?")[0]).lastIndexOf("/");-1!==x&&(m=m.slice(0,x+1))}var S,b=/\\/g,j=g&&Symbol.toStringTag,P=g?Symbol():"@",I=a.prototype;I.import=function(e,t,n){var r=this;return t&&"object"==typeof t&&(n=t,t=void 0),Promise.resolve(r.prepareImport()).then((function(){return r.resolve(e,t,n)})).then((function(e){var t=l(r,e,void 0,n);return t.C||d(r,t)}))},I.createContext=function(e){var t=this;return{url:e,resolve:function(n,r){return Promise.resolve(t.resolve(n,r||e))}}},I.register=function(e,t,n){S=[e,t,n]},I.getRegister=function(){var e=S;return S=void 0,e};var L=Object.freeze(Object.create(null));E.System=new a;var C,M,T=Promise.resolve(),R={imports:{},scopes:{},depcache:{},integrity:{}},_=w;if(I.prepareImport=function(e){return(_||e)&&(v(),_=!1),T},I.getImportMap=function(){return JSON.parse(JSON.stringify(R))},w&&(v(),window.addEventListener("DOMContentLoaded",v)),I.addImportMap=function(e,t){o(e,t||m,R)},w){window.addEventListener("error",(function(e){W=e.filename,q=e.error}));var J=location.origin}I.createScript=function(e){var t=document.createElement("script");t.async=!0,e.indexOf(J+"/")&&(t.crossOrigin="anonymous");var n=R.integrity[e];return n&&(t.integrity=n),t.src=e,t};var W,q,N={},k=I.register;I.register=function(e,t){if(w&&"loading"===document.readyState&&"string"!=typeof e){var n=document.querySelectorAll("script[src]"),r=n[n.length-1];if(r){C=e;var i=this;M=setTimeout((function(){N[r.src]=[e,t],i.import(r.src)}))}}else C=void 0;return k.call(this,e,t)},I.instantiate=function(t,n){var r=N[t];if(r)return delete N[t],r;var i=this;return Promise.resolve(I.createScript(t)).then((function(r){return new Promise((function(o,s){r.addEventListener("error",(function(){s(Error(e(3,[t,n].join(", "))))})),r.addEventListener("load",(function(){if(document.head.removeChild(r),W===t)s(q);else{var e=i.getRegister(t);e&&e[0]===C&&clearTimeout(M),o(e)}})),document.head.appendChild(r)}))}))},I.shouldFetch=function(){return!1},"undefined"!=typeof fetch&&(I.fetch=fetch);var A=I.instantiate,F=/^(text|application)\/(x-)?javascript(;|$)/;I.instantiate=function(t,n,r){var i=this;return this.shouldFetch(t,n,r)?this.fetch(t,{credentials:"same-origin",integrity:R.integrity[t],meta:r}).then((function(r){if(!r.ok)throw Error(e(7,[r.status,r.statusText,t,n].join(", ")));var o=r.headers.get("content-type");if(!o||!F.test(o))throw Error(e(4,o));return r.text().then((function(e){return e.indexOf("//# sourceURL=")<0&&(e+="\n//# sourceURL="+t),(0,eval)(e),i.getRegister(t)}))})):A.apply(this,arguments)},I.resolve=function(t,r){return f(R,n(t,r=r||m)||t,r)||function(t,n){throw Error(e(8,[t,n].join(", ")))}(t,r)};var U=I.instantiate;I.instantiate=function(e,t,n){var r=R.depcache[e];if(r)for(var i=0;i<r.length;i++)l(this,this.resolve(r[i],e),e);return U.call(this,e,t,n)},y&&"function"==typeof importScripts&&(I.instantiate=function(e){var t=this;return Promise.resolve().then((function(){return importScripts(e),t.getRegister(e)}))})}())}();