@skaldapp/runtime 3.4.10 → 3.5.0
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/.vite/manifest.json +1 -1
- package/dist/assets/{ajv-CsmIXRur.js → ajv-z6WPEcWn.js} +3 -3
- package/dist/assets/compiler-sfc-CgcqGOKV.js +172 -0
- package/dist/assets/{es-module-shims-2.8.2.js → es-module-shims-2.8.4.js} +860 -858
- package/dist/assets/esprima-CCF1hlYB.js +8 -0
- package/dist/assets/{index-gY7jl2Db.js → index-mOWuSi4e.js} +15 -15
- package/dist/assets/{katex-D7TCrkvT.js → katex-BQdS-zab.js} +3 -3
- package/dist/assets/markdown-CHb7-Rn_.js +14 -0
- package/dist/assets/{ofetch-8DgWsvG6.js → ofetch-B1MYXEWL.js} +1 -1
- package/dist/assets/rolldown-runtime-C0FnF6B9.js +1 -0
- package/dist/assets/sucrase-Cr7btPmQ.js +135 -0
- package/dist/assets/unocss-Cxb1UQG6.js +424 -0
- package/dist/index.html +11 -11
- package/package.json +10 -10
- package/dist/assets/compiler-sfc-NBc-UVgb.js +0 -172
- package/dist/assets/esprima-D51ZrOTQ.js +0 -8
- package/dist/assets/markdown-BUPhMiJ2.js +0 -14
- package/dist/assets/rolldown-runtime-DAXXjFlN.js +0 -1
- package/dist/assets/sucrase-h5FT47O2.js +0 -135
- package/dist/assets/unocss-CorWKaFq.js +0 -424
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** ES Module Shims @version 2.8.
|
|
1
|
+
/** ES Module Shims @version 2.8.4 */
|
|
2
2
|
(function () {
|
|
3
3
|
|
|
4
4
|
const self_ = typeof globalThis !== 'undefined' ? globalThis : self;
|
|
@@ -180,7 +180,7 @@
|
|
|
180
180
|
const esmsInitOptions = optionsScript ? JSON.parse(optionsScript.innerHTML) : {};
|
|
181
181
|
Object.assign(esmsInitOptions, self_.esmsInitOptions || {});
|
|
182
182
|
|
|
183
|
-
const version = "2.8.
|
|
183
|
+
const version = "2.8.4";
|
|
184
184
|
|
|
185
185
|
const r$1 = esmsInitOptions.version;
|
|
186
186
|
if (self_.importShim || (r$1 && r$1 !== version)) {
|
|
@@ -521,6 +521,8 @@
|
|
|
521
521
|
const wasmBytes = [0, 97, 115, 109, 1, 0, 0, 0];
|
|
522
522
|
|
|
523
523
|
let featureDetectionPromise = (async function () {
|
|
524
|
+
// In shim mode, feature detection results are unused — skip the iframe overhead
|
|
525
|
+
if (shimMode) return;
|
|
524
526
|
if (!hasDocument)
|
|
525
527
|
return Promise.all([
|
|
526
528
|
import(createBlob(`import"${createBlob('{}', 'text/json')}"with{type:"json"}`)).then(
|
|
@@ -623,862 +625,862 @@
|
|
|
623
625
|
});
|
|
624
626
|
})();
|
|
625
627
|
|
|
626
|
-
/* es-module-lexer (minimal) 2.3.
|
|
627
|
-
let e,a,r,i=2<<19;const s=1===new Uint8Array(new Uint16Array([1]).buffer)[0]?function(e,a){const r=e.length;let i=0;for(;i<r;)a[i]=e.charCodeAt(i++);}:function(e,a){const r=e.length;let i=0;for(;i<r;){const r=e.charCodeAt(i);a[i++]=(255&r)<<8|r>>>8;}},f="etaourceeferromsyncunctionlassvoyiedelecontininstantybreareturdebuggeawaithrwhileforifcatcfinallelsxportmport";let c$1,t,n;function parse(k,l="@"){c$1=k,t=l;const u=2*c$1.length+(2<<18);if(u>i||!e){for(;u>i;)i*=2;a=new ArrayBuffer(i),s(f,new Uint16Array(a,16,109)),e=function(e,a,r){"use asm";var i=new e.Int8Array(r),s=new e.Int16Array(r),f=new e.Int32Array(r),c=new e.Uint8Array(r),t=new e.Uint16Array(r),n=1040;function b(e){e=e|0;var a=0,r=0,c=0,t=0,n=0,b=0,k=0,o=0,w=0,g=0,p=0,y=0,m=0,O=0,T=0;y=s[400]|0;a=f[72]|0;f[69]=a;p=a;o=y;b=a;g=0;e:while(1){r=f[73]|0;t=o<<16>>16==y<<16>>16;c=g&e;k=a;while(1){n=k+2|0;if(k>>>0>=r>>>0){a=0;w=98;break e}a=s[n>>1]|0;if(!(L(a)|0)){if(t){switch(a<<16>>16){case 125:case 93:case 41:case 59:case 44:{w=98;break e}default:{}}if(c?se(a)|0:0){w=98;break e}}if(!(se(a)|0))break}k=n;}f[72]=n;a:do{switch(a<<16>>16){case 101:{if((o<<16>>16==0?N(n)|0:0)?(S(k+4|0,214,10)|0)==0:0){u();w=87;}else w=87;break}case 105:{if(N(n)|0?(S(k+4|0,224,10)|0)==0:0){l();w=87;}else w=87;break}case 99:{if((N(n)|0?(S(k+4|0,68,8)|0)==0:0)?ee(s[k+12>>1]|0)|0:0){i[804]=1;w=87;}else w=87;break}case 40:{k=f[70]|0;w=o&65535;f[k+(w<<3)>>2]=1;s[400]=o+1<<16>>16;f[k+(w<<3)+4>>2]=b;w=87;break}case 91:{k=f[70]|0;w=o&65535;f[k+(w<<3)>>2]=8;s[400]=o+1<<16>>16;f[k+(w<<3)+4>>2]=b;w=87;break}case 93:if(!(o<<16>>16)){_();break a}else {s[400]=o+-1<<16>>16;w=87;break a}case 44:{r=s[399]|0;if((!(o<<16>>16==0|r<<16>>16==0)?(f[(f[70]|0)+((o&65535)+-1<<3)>>2]|0)==5:0)?(m=f[(f[71]|0)+((r&65535)+-1<<2)>>2]|0,(f[m+4>>2]|0)==0):0){f[m+4>>2]=p+2;f[72]=k+4;v(1)|0;w=f[72]|0;f[m+16>>2]=w;f[72]=w+-2;w=87;}else w=87;break}case 41:{if(!(o<<16>>16)){_();break a}w=o+-1<<16>>16;s[400]=w;r=s[399]|0;if(r<<16>>16!=0?(f[(f[70]|0)+((w&65535)<<3)>>2]|0)==5:0){c=f[(f[71]|0)+((r&65535)+-1<<2)>>2]|0;if(!(f[c+4>>2]|0))f[c+4>>2]=p+2;f[c+12>>2]=k+4;s[399]=r+-1<<16>>16;w=87;}else w=87;break}case 123:{w=f[63]|0;do{if((s[p>>1]|0)==41&(w|0)!=0?(f[w+12>>2]|0)==(p+2|0):0){r=f[64]|0;f[63]=r;if(!r){f[59]=0;break}else {f[r+32>>2]=0;break}}}while(0);k=f[70]|0;w=o&65535;f[k+(w<<3)>>2]=(i[804]|0)==0?2:6;s[400]=o+1<<16>>16;f[k+(w<<3)+4>>2]=b;i[804]=0;w=87;break}case 125:{if(!(o<<16>>16)){_();break a}k=f[70]|0;w=o+-1<<16>>16;s[400]=w;if((f[k+((w&65535)<<3)>>2]|0)==4){d();w=87;}else w=87;break}case 34:case 39:{A(a);w=87;break}case 47:switch(s[k+4>>1]|0){case 47:{F();break a}case 42:{x(1);break a}default:{c=s[p>>1]|0;r:do{if(!($(c)|0)){if(!(c<<16>>16==41?K(f[(f[70]|0)+((o&65535)<<3)+4>>2]|0)|0:0))w=60;}else switch(c<<16>>16){case 46:if(((s[p+-2>>1]|0)+-48&65535)<10){w=60;break r}else break r;case 43:if((s[p+-2>>1]|0)==43){w=60;break r}else break r;case 45:if((s[p+-2>>1]|0)==45){w=60;break r}else break r;default:break r}}while(0);r:do{if((w|0)==60){w=0;if(o<<16>>16!=0?(O=f[70]|0,T=(o&65535)+-1|0,c<<16>>16==102?(f[O+(T<<3)>>2]|0)==1:0):0){if(((s[p+-2>>1]|0)==111?C(p+-4|0)|0:0)?B(f[O+(T<<3)+4>>2]|0,178,3)|0:0)break}else w=65;if((w|0)==65?(0,c<<16>>16==125):0){t=f[70]|0;r=o&65535;if(U(f[t+(r<<3)+4>>2]|0)|0)break;if((f[t+(r<<3)>>2]|0)==6)break}if(!(h(p)|0)){switch(c<<16>>16){case 0:break r;case 47:{if(i[803]|0)break r;break}default:{}}w=f[65]|0;if((w|0?p>>>0>=(f[w>>2]|0)>>>0:0)?p>>>0<=(f[w+4>>2]|0)>>>0:0){I();i[803]=0;w=87;break a}t=f[3]|0;r=p;do{if(r>>>0<=t>>>0)break;r=r+-2|0;f[69]=r;c=s[r>>1]|0;}while(!(D(c)|0));if(L(c)|0){do{if(r>>>0<=t>>>0)break;r=r+-2|0;f[69]=r;}while(L(s[r>>1]|0)|0);if(q(r)|0){I();i[803]=0;w=87;break a}}i[803]=1;w=87;break a}}}while(0);I();i[803]=0;w=87;break a}}case 96:{k=f[70]|0;w=o&65535;f[k+(w<<3)+4>>2]=b;s[400]=o+1<<16>>16;f[k+(w<<3)>>2]=3;d();w=87;break}default:w=87;}}while(0);if((w|0)==87){w=0;f[69]=f[72];}if(i[802]|0){a=0;break}r=f[69]|0;a:do{if((r|0)==(p|0))if(g&((s[400]|0)==y<<16>>16&e)){a=s[f[72]>>1]|0;if(se(a)|0)break e;else a=1;}else a=g;else {if(a<<16>>16==47){a=(i[803]|0)==0;break}if(G(a)|0)a=1;else {switch(a<<16>>16){case 96:case 34:case 39:case 41:case 93:case 125:{a=1;break a}default:{}}a=0;}}}while(0);p=r;o=s[400]|0;b=r;g=a;a=f[72]|0;}if((w|0)==98)f[72]=n;return a|0}function k(){var e=0,a=0,r=0,c=0,t=0,b=0,k=0,o=0,w=0;w=n;n=n+10240|0;s[399]=0;s[400]=0;f[69]=f[2];i[803]=0;f[68]=0;i[802]=0;f[70]=w+2048;f[71]=w;i[804]=0;r=(f[3]|0)+-2|0;f[72]=r;e=r+(f[66]<<1)|0;f[73]=e;e:while(1){a=r+2|0;f[72]=a;if(r>>>0>=e>>>0){c=83;break}e=s[a>>1]|0;a:do{switch(e<<16>>16){case 9:case 10:case 11:case 12:case 13:case 32:break;case 101:{if(((s[400]|0)==0?N(a)|0:0)?(S(r+4|0,214,10)|0)==0:0){u();c=82;}else c=82;break}case 105:{if(N(a)|0?(S(r+4|0,224,10)|0)==0:0){l();c=82;}else c=82;break}case 99:{if((N(a)|0?(S(r+4|0,68,8)|0)==0:0)?ee(s[r+12>>1]|0)|0:0){i[804]=1;c=82;}else c=82;break}case 40:{r=f[70]|0;c=s[400]|0;f[r+((c&65535)<<3)>>2]=1;a=f[69]|0;s[400]=c+1<<16>>16;f[r+((c&65535)<<3)+4>>2]=a;c=82;break}case 91:{r=f[70]|0;c=s[400]|0;f[r+((c&65535)<<3)>>2]=8;a=f[69]|0;s[400]=c+1<<16>>16;f[r+((c&65535)<<3)+4>>2]=a;c=82;break}case 93:{e=s[400]|0;if(!(e<<16>>16)){c=19;break e}s[400]=e+-1<<16>>16;c=82;break}case 44:{e=s[399]|0;if(((e<<16>>16!=0?(t=s[400]|0,t<<16>>16!=0):0)?(f[(f[70]|0)+((t&65535)+-1<<3)>>2]|0)==5:0)?(b=f[(f[71]|0)+((e&65535)+-1<<2)>>2]|0,(f[b+4>>2]|0)==0):0){f[b+4>>2]=(f[69]|0)+2;f[72]=r+4;v(1)|0;c=f[72]|0;f[b+16>>2]=c;f[72]=c+-2;c=82;}else c=82;break}case 41:{e=s[400]|0;if(!(e<<16>>16)){c=27;break e}s[400]=e+-1<<16>>16;a=s[399]|0;if(a<<16>>16!=0?(f[(f[70]|0)+((e+-1&65535)<<3)>>2]|0)==5:0){e=f[(f[71]|0)+((a&65535)+-1<<2)>>2]|0;if(!(f[e+4>>2]|0))f[e+4>>2]=(f[69]|0)+2;f[e+12>>2]=r+4;s[399]=a+-1<<16>>16;c=82;}else c=82;break}case 123:{e=f[69]|0;c=f[63]|0;do{if((s[e>>1]|0)==41&(c|0)!=0?(f[c+12>>2]|0)==(e+2|0):0){a=f[64]|0;f[63]=a;if(!a){f[59]=0;break}else {f[a+32>>2]=0;break}}}while(0);r=f[70]|0;c=s[400]|0;f[r+((c&65535)<<3)>>2]=(i[804]|0)==0?2:6;s[400]=c+1<<16>>16;f[r+((c&65535)<<3)+4>>2]=e;i[804]=0;c=82;break}case 125:{e=s[400]|0;if(!(e<<16>>16)){c=40;break e}c=f[70]|0;s[400]=e+-1<<16>>16;if((f[c+((e+-1&65535)<<3)>>2]|0)==4){d();c=82;}else c=82;break}case 34:case 39:{A(e);c=82;break}case 47:switch(s[r+4>>1]|0){case 47:{F();break a}case 42:{x(1);break a}default:{e=f[69]|0;a=s[e>>1]|0;r:do{if(!($(a)|0))if(a<<16>>16==41){r=s[400]|0;if(!(K(f[(f[70]|0)+((r&65535)<<3)+4>>2]|0)|0))c=55;}else c=54;else switch(a<<16>>16){case 46:if(((s[e+-2>>1]|0)+-48&65535)<10){c=54;break r}else break r;case 43:if((s[e+-2>>1]|0)==43){c=54;break r}else break r;case 45:if((s[e+-2>>1]|0)==45){c=54;break r}else break r;default:break r}}while(0);if((c|0)==54){r=s[400]|0;c=55;}r:do{if((c|0)==55){c=0;if(r<<16>>16!=0?(k=f[70]|0,o=(r&65535)+-1|0,a<<16>>16==102?(f[k+(o<<3)>>2]|0)==1:0):0){if(((s[e+-2>>1]|0)==111?C(e+-4|0)|0:0)?B(f[k+(o<<3)+4>>2]|0,178,3)|0:0)break}else c=60;if((c|0)==60?(0,a<<16>>16==125):0){c=f[70]|0;r=r&65535;if(U(f[c+(r<<3)+4>>2]|0)|0)break;if((f[c+(r<<3)>>2]|0)==6)break}if(!(h(e)|0)){switch(a<<16>>16){case 0:break r;case 47:{if(i[803]|0)break r;break}default:{}}c=f[65]|0;if((c|0?e>>>0>=(f[c>>2]|0)>>>0:0)?e>>>0<=(f[c+4>>2]|0)>>>0:0){I();i[803]=0;c=82;break a}r=f[3]|0;do{if(e>>>0<=r>>>0)break;e=e+-2|0;f[69]=e;a=s[e>>1]|0;}while(!(D(a)|0));if(L(a)|0){do{if(e>>>0<=r>>>0)break;e=e+-2|0;f[69]=e;}while(L(s[e>>1]|0)|0);if(q(e)|0){I();i[803]=0;c=82;break a}}i[803]=1;c=82;break a}}}while(0);I();i[803]=0;c=82;break a}}case 96:{r=f[70]|0;c=s[400]|0;f[r+((c&65535)<<3)+4>>2]=f[69];s[400]=c+1<<16>>16;f[r+((c&65535)<<3)>>2]=3;d();c=82;break}default:c=82;}}while(0);if((c|0)==82){c=0;f[69]=f[72];}r=f[72]|0;e=f[73]|0;}if((c|0)==19){_();e=0;}else if((c|0)==27){_();e=0;}else if((c|0)==40){_();e=0;}else if((c|0)==83)e=(i[802]|0)==0?(s[399]|s[400])<<16>>16==0:0;n=w;return e|0}function l(){var e=0,a=0,r=0,c=0,t=0,n=0;n=f[72]|0;f[72]=n+12;e=v(1)|0;r=f[72]|0;e:do{if(e<<16>>16!=46){if(!(e<<16>>16==115&r>>>0>(n+12|0)>>>0)){if(!(e<<16>>16==100&r>>>0>(n+10|0)>>>0)){r=0;t=28;break}if(S(r+2|0,32,8)|0){a=r;e=100;r=0;t=60;break}if(!(ee(s[r+10>>1]|0)|0)){a=r;e=100;r=0;t=60;break}f[72]=r+10;e=v(1)|0;if(e<<16>>16==42){e=42;c=2;t=62;break}f[72]=r;r=0;t=28;break}if((S(r+2|0,22,10)|0)==0?ee(s[r+12>>1]|0)|0:0){f[72]=r+12;e=v(1)|0;a=f[72]|0;if((a|0)!=(r+12|0)){if(e<<16>>16!=102){r=1;t=28;break}if(S(a+2|0,40,6)|0){e=102;r=1;t=60;break}if(!(D(s[a+8>>1]|0)|0)){e=102;r=1;t=60;break}}f[72]=r;r=0;t=28;}else {a=r;e=115;r=0;t=60;}}else {f[72]=r+2;switch((v(1)|0)<<16>>16){case 109:{e=f[72]|0;if(S(e+2|0,16,6)|0)break e;a=f[69]|0;if(!(M(a)|0)?(s[a>>1]|0)==46:0)break e;g(n,n,e+8|0,2);break e}case 115:{e=f[72]|0;if(S(e+2|0,22,10)|0)break e;a=f[69]|0;if(!(M(a)|0)?(s[a>>1]|0)==46:0)break e;f[72]=e+12;e=v(1)|0;r=1;t=28;break e}case 100:{e=f[72]|0;if(S(e+2|0,32,8)|0)break e;a=f[69]|0;if(!(M(a)|0)?(s[a>>1]|0)==46:0)break e;f[72]=e+10;e=v(1)|0;r=2;t=28;break e}default:break e}}}while(0);e:do{if((t|0)==28){if(e<<16>>16==40){a=f[70]|0;c=s[400]|0;f[a+((c&65535)<<3)>>2]=5;e=f[72]|0;s[400]=c+1<<16>>16;f[a+((c&65535)<<3)+4>>2]=e;if((s[f[69]>>1]|0)==46)break;f[72]=e+2;a=v(1)|0;g(n,f[72]|0,0,e);if(!r)e=f[63]|0;else {e=f[63]|0;f[e+28>>2]=(r|0)==1?5:7;}c=f[71]|0;n=s[399]|0;s[399]=n+1<<16>>16;f[c+((n&65535)<<2)>>2]=e;switch(a<<16>>16){case 39:{A(39);break}case 34:{A(34);break}case 96:{if(!(y()|0))t=37;break}default:t=37;}if((t|0)==37){f[72]=(f[72]|0)+-2;break}e=(f[72]|0)+2|0;f[72]=e;switch((v(1)|0)<<16>>16){case 44:{f[72]=(f[72]|0)+2;v(1)|0;c=f[63]|0;f[c+4>>2]=e;n=f[72]|0;f[c+16>>2]=n;i[c+24>>0]=1;f[72]=n+-2;break e}case 41:{s[400]=(s[400]|0)+-1<<16>>16;n=f[63]|0;f[n+4>>2]=e;f[n+12>>2]=(f[72]|0)+2;i[n+24>>0]=1;s[399]=(s[399]|0)+-1<<16>>16;break e}default:{f[72]=(f[72]|0)+-2;break e}}}if(!((r|0)==0&e<<16>>16==123)){switch(e<<16>>16){case 42:case 39:case 34:{c=r;t=62;break e}default:{}}a=f[72]|0;t=60;break}e=f[72]|0;if(s[400]|0){f[72]=e+-2;break}while(1){if(e>>>0>=(f[73]|0)>>>0)break;e=v(1)|0;if(!(ae(e)|0)){if(e<<16>>16==125){t=50;break}}else A(e);e=(f[72]|0)+2|0;f[72]=e;}if((t|0)==50)f[72]=(f[72]|0)+2;c=(v(1)|0)<<16>>16==102;e=f[72]|0;if(c?S(e+2|0,40,6)|0:0){_();break}f[72]=e+8;e=v(1)|0;if(ae(e)|0){w(n,e,0);break}else {_();break}}}while(0);if((t|0)==60)if((a|0)==(n+12|0))f[72]=n+10;else {c=r;t=62;}do{if((t|0)==62){if(!((e<<16>>16==42|(c|0)!=2)&(s[400]|0)==0)){f[72]=(f[72]|0)+-2;break}e=f[73]|0;a=f[72]|0;while(1){if(a>>>0>=e>>>0){t=69;break}r=s[a>>1]|0;if(ae(r)|0){t=67;break}t=a+2|0;f[72]=t;a=t;}if((t|0)==67){w(n,r,c);break}else if((t|0)==69){_();break}}}while(0);return}function u(){var e=0,a=0,r=0,i=0,c=0,t=0,n=0,k=0,l=0,u=0;k=f[72]|0;l=f[65]|0;f[72]=k+12;a=v(1)|0;e=f[72]|0;if(!((e|0)==(k+12|0)?!(O(a)|0):0))u=3;e:do{if((u|0)==3){a:do{switch(a<<16>>16){case 123:{f[72]=e+2;e=v(1)|0;r=f[72]|0;while(1){if(ae(e)|0){A(e);e=(f[72]|0)+2|0;f[72]=e;}else {H(e)|0;e=f[72]|0;}v(1)|0;e=p(r,e)|0;if(e<<16>>16==44){f[72]=(f[72]|0)+2;e=v(1)|0;}a=r;r=f[72]|0;if(e<<16>>16==125){u=15;break}if((r|0)==(a|0)){u=12;break}if(r>>>0>(f[73]|0)>>>0){u=14;break}}if((u|0)==12){_();break e}else if((u|0)==14){_();break e}else if((u|0)==15){f[72]=r+2;u=49;break a}break}case 42:{f[72]=e+2;v(1)|0;u=f[72]|0;p(u,u)|0;u=49;break}case 100:{f[72]=e+14;switch((v(1)|0)<<16>>16){case 97:{a=f[72]|0;if((S(a+2|0,46,8)|0)==0?L(s[a+10>>1]|0)|0:0){f[72]=a+10;v(0)|0;u=21;}break}case 102:{u=21;break}case 99:{a=f[72]|0;if(((S(a+2|0,68,8)|0)==0?(l=s[a+10>>1]|0,ee(l)|0|l<<16>>16==123):0)?(f[72]=a+10,r=v(1)|0,r<<16>>16!=123):0){n=r;u=30;}break}default:{}}r:do{if((u|0)==21?(i=f[72]|0,(S(i+2|0,54,14)|0)==0):0){a=s[i+16>>1]|0;if(!(ee(a)|0))switch(a<<16>>16){case 40:case 42:break;default:break r}f[72]=i+16;a=v(1)|0;if(a<<16>>16==42){f[72]=(f[72]|0)+2;a=v(1)|0;}if(a<<16>>16!=40){n=a;u=30;}}}while(0);if((u|0)==30?(c=f[72]|0,H(n)|0,t=f[72]|0,t>>>0>c>>>0):0){E(e,e+14|0,c,t);f[72]=(f[72]|0)+-2;break e}E(e,e+14|0,0,0);f[72]=e+12;break e}case 97:{f[72]=e+10;v(0)|0;e=f[72]|0;u=34;break}case 102:{u=34;break}case 99:{if((S(e+2|0,68,8)|0)==0?D(s[e+10>>1]|0)|0:0){f[72]=e+10;u=v(1)|0;l=f[72]|0;H(u)|0;u=f[72]|0;E(l,u,l,u);f[72]=(f[72]|0)+-2;break e}f[72]=e+4;e=e+4|0;u=41;break}case 108:case 118:{u=41;break}default:break e}}while(0);if((u|0)==34){f[72]=e+16;e=v(1)|0;if(e<<16>>16==42){f[72]=(f[72]|0)+2;e=v(1)|0;}l=f[72]|0;H(e)|0;u=f[72]|0;E(l,u,l,u);f[72]=(f[72]|0)+-2;break}else if((u|0)==41){f[72]=e+6;while(1){a=v(1)|0;e=f[72]|0;if(e>>>0>(f[73]|0)>>>0)break;a=P(a)|0;if((f[72]|0)==(e|0))break;if(a<<16>>16==61)a=b(1)|0;e=f[72]|0;if(a<<16>>16!=44)break;f[72]=e+2;}f[72]=e+-2;break}else if((u|0)==49){u=(v(1)|0)<<16>>16==102;e=f[72]|0;if(u?(S(e+2|0,40,6)|0)==0:0){f[72]=e+8;w(k,v(1)|0,0);e=(l|0)==0?240:l+16|0;while(1){e=f[e>>2]|0;if(!e)break e;f[e+12>>2]=0;f[e+8>>2]=0;e=e+16|0;}}f[72]=e+-2;break}}}while(0);return}function o(){var e=0,a=0,r=0,i=0,c=0,t=0,n=0;e=f[72]|0;c=(s[e>>1]|0)==123;f[72]=e+2;e=v(1)|0;t=c?125:93;e:while(1){if((t|0)==(e&65535|0))break;i=f[72]|0;if(i>>>0>(f[73]|0)>>>0)break;if((e<<16>>16==46?(s[i+2>>1]|0)==46:0)?(s[i+4>>1]|0)==46:0){f[72]=i+6;e=P(v(1)|0)|0;}else n=9;a:do{if((n|0)==9){n=0;do{if(c){do{if(e<<16>>16==91){b(0)|0;f[72]=(f[72]|0)+2;a=i;}else {if(ae(e)|0){A(e);f[72]=(f[72]|0)+2;a=i;break}if((e+-48&65535)>=10){H(e)|0;a=f[72]|0;break}e=i;r:while(1){r=e+2|0;a=s[r>>1]|0;i:do{if((a+-48&65535)>=10){switch(a<<16>>16){case 67:case 68:case 70:case 97:case 65:case 99:case 100:case 102:case 46:case 66:case 69:case 79:case 88:case 95:case 98:case 101:case 110:case 111:case 120:break i;case 43:case 45:break;default:break r}switch(s[e>>1]|0){case 69:case 101:break;default:break r}}}while(0);e=r;}f[72]=r;a=i;}}while(0);e=v(1)|0;if(e<<16>>16==58){f[72]=(f[72]|0)+2;e=P(v(1)|0)|0;break}if(a>>>0>i>>>0)E(i,a,i,a);}else if(e<<16>>16==44){f[72]=i+2;e=v(1)|0;break a}else {e=P(e)|0;break}}while(0);if(e<<16>>16==61)e=b(0)|0;if(e<<16>>16!=44)break e;f[72]=(f[72]|0)+2;e=v(1)|0;}}while(0)}return}function h(e){e=e|0;e:do{switch(s[e>>1]|0){case 100:switch(s[e+-2>>1]|0){case 105:{e=B(e+-4|0,76,2)|0;break e}case 108:{e=B(e+-4|0,80,3)|0;break e}default:{e=0;break e}}case 101:switch(s[e+-2>>1]|0){case 115:switch(s[e+-4>>1]|0){case 108:{e=z(e+-6|0,101)|0;break e}case 97:{e=z(e+-6|0,99)|0;break e}default:{e=0;break e}}case 116:{e=B(e+-4|0,86,4)|0;break e}case 117:{e=B(e+-4|0,94,6)|0;break e}default:{e=0;break e}}case 102:{if((s[e+-2>>1]|0)==111?(s[e+-4>>1]|0)==101:0)switch(s[e+-6>>1]|0){case 99:{e=B(e+-8|0,106,6)|0;break e}case 112:{e=B(e+-8|0,118,2)|0;break e}default:{e=0;break e}}else e=0;break}case 107:{e=B(e+-2|0,122,4)|0;break}case 110:{if(z(e+-2|0,105)|0)e=1;else e=B(e+-2|0,130,5)|0;break}case 111:{e=z(e+-2|0,100)|0;break}case 114:{e=B(e+-2|0,140,7)|0;break}case 116:{e=B(e+-2|0,154,4)|0;break}case 119:switch(s[e+-2>>1]|0){case 101:{e=z(e+-4|0,110)|0;break e}case 111:{e=B(e+-4|0,162,3)|0;break e}default:{e=0;break e}}default:e=0;}}while(0);return e|0}function w(e,a,r){e=e|0;a=a|0;r=r|0;var i=0,c=0;i=(f[72]|0)+2|0;switch(a<<16>>16){case 39:{A(39);c=5;break}case 34:{A(34);c=5;break}default:_();}do{if((c|0)==5){g(e,i,f[72]|0,1);if((r|0)>0)f[(f[63]|0)+28>>2]=(r|0)==1?4:6;f[72]=(f[72]|0)+2;c=(v(0)|0)<<16>>16==119;a=f[72]|0;if(((c?(s[a+2>>1]|0)==105:0)?(s[a+4>>1]|0)==116:0)?(s[a+6>>1]|0)==104:0){f[72]=a+8;if((v(1)|0)<<16>>16!=123){f[72]=a;break}r=f[72]|0;i=r;e:while(1){f[72]=i+2;i=v(1)|0;switch(i<<16>>16){case 39:{A(39);f[72]=(f[72]|0)+2;i=v(1)|0;break}case 34:{A(34);f[72]=(f[72]|0)+2;i=v(1)|0;break}default:i=H(i)|0;}if(i<<16>>16!=58){c=20;break}f[72]=(f[72]|0)+2;switch((v(1)|0)<<16>>16){case 39:{A(39);break}case 34:{A(34);break}default:{c=24;break e}}f[72]=(f[72]|0)+2;switch((v(1)|0)<<16>>16){case 125:{c=28;break e}case 44:break;default:{c=26;break e}}i=(f[72]|0)+2|0;f[72]=i;}if((c|0)==20){f[72]=a;break}else if((c|0)==24){f[72]=a;break}else if((c|0)==26){f[72]=a;break}else if((c|0)==28){c=f[63]|0;f[c+16>>2]=r;f[c+12>>2]=(f[72]|0)+2;break}}f[72]=a+-2;}}while(0);return}function d(){var e=0,a=0,r=0;a=f[73]|0;r=f[72]|0;e:while(1){e=r+2|0;if(r>>>0>=a>>>0){a=10;break}switch(s[e>>1]|0){case 96:{a=7;break e}case 36:{if((s[r+4>>1]|0)==123){a=6;break e}break}case 92:{e=r+4|0;break}default:{}}r=e;}if((a|0)==6){e=r+4|0;f[72]=e;a=f[70]|0;r=s[400]|0;f[a+((r&65535)<<3)>>2]=4;s[400]=r+1<<16>>16;f[a+((r&65535)<<3)+4>>2]=e;}else if((a|0)==7){f[72]=e;a=f[70]|0;r=(s[400]|0)+-1<<16>>16;s[400]=r;if((f[a+((r&65535)<<3)>>2]|0)!=3)_();}else if((a|0)==10){f[72]=e;_();}return}function v(e){e=e|0;var a=0,r=0,i=0;r=f[72]|0;e:do{a=s[r>>1]|0;a:do{if(a<<16>>16!=47)if(e)if(ee(a)|0)break;else break e;else if(L(a)|0)break;else break e;else switch(s[r+2>>1]|0){case 47:{F();break a}case 42:{x(e);break a}default:{a=47;break e}}}while(0);i=f[72]|0;r=i+2|0;f[72]=r;}while(i>>>0<(f[73]|0)>>>0);return a|0}function A(e){e=e|0;var a=0,r=0,i=0,c=0;c=f[73]|0;a=f[72]|0;while(1){i=a+2|0;if(a>>>0>=c>>>0){a=9;break}r=s[i>>1]|0;if(r<<16>>16==e<<16>>16){a=10;break}if(r<<16>>16==92){r=a+4|0;if((s[r>>1]|0)==13){a=a+6|0;a=(s[a>>1]|0)==10?a:r;}else a=r;}else if(se(r)|0){a=9;break}else a=i;}if((a|0)==9){f[72]=i;_();}else if((a|0)==10)f[72]=i;return}function C(e){e=e|0;var a=0,r=0;a=s[e>>1]|0;if(ee(a)|0)r=3;else switch(a<<16>>16){case 41:case 125:case 93:{r=3;break}default:e=0;}e:do{if((r|0)==3){r=f[3]|0;while(1){if(e>>>0<=r>>>0)break;e=e+-2|0;if(!(ee(a)|0))break;a=s[e>>1]|0;}switch(a<<16>>16){case 41:case 125:case 93:{e=1;break e}default:{}}e=(O(a)|0)^1;}}while(0);return e|0}function g(e,a,r,s){e=e|0;a=a|0;r=r|0;s=s|0;var c=0,t=0;t=f[67]|0;f[67]=t+36;c=f[63]|0;f[((c|0)==0?236:c+32|0)>>2]=t;f[64]=c;f[63]=t;f[t+8>>2]=e;if(2==(s|0)){e=3;c=r;}else {e=1==(s|0)?1:2;c=1==(s|0)?r+2|0:0;}f[t+12>>2]=c;f[t+28>>2]=e;f[t>>2]=a;f[t+4>>2]=r;f[t+16>>2]=0;f[t+20>>2]=s;i[t+24>>0]=1==(s|0)&1;f[t+32>>2]=0;return}function p(e,a){e=e|0;a=a|0;var r=0,i=0,c=0,t=0;r=f[72]|0;i=s[r>>1]|0;c=(e|0)==(a|0)?0:e;t=(e|0)==(a|0)?0:a;if(i<<16>>16==97){f[72]=r+4;r=v(1)|0;e=f[72]|0;if(ae(r)|0){A(r);a=(f[72]|0)+2|0;f[72]=a;}else {H(r)|0;a=f[72]|0;}i=v(1)|0;r=f[72]|0;}if((r|0)!=(e|0))E(e,a,c,t);return i|0}function y(){var e=0,a=0,r=0,i=0;i=f[72]|0;r=f[73]|0;a=i;e:while(1){e=a+2|0;if(a>>>0>=r>>>0){a=7;break}switch(s[e>>1]|0){case 96:{a=8;break e}case 92:{e=a+4|0;break}case 36:{if((s[a+4>>1]|0)==123){a=7;break e}break}default:{}}a=e;}if((a|0)==7){f[72]=i;e=0;}else if((a|0)==8){f[72]=e;e=1;}return e|0}function m(){var e=0,a=0,r=0;r=f[73]|0;a=f[72]|0;e:while(1){e=a+2|0;if(a>>>0>=r>>>0){a=6;break}switch(s[e>>1]|0){case 13:case 10:{a=6;break e}case 93:{a=7;break e}case 92:{e=a+4|0;break}default:{}}a=e;}if((a|0)==6){f[72]=e;_();e=0;}else if((a|0)==7){f[72]=e;e=93;}return e|0}function I(){var e=0,a=0;e:while(1){e=f[72]|0;f[72]=e+2;if(e>>>0>=(f[73]|0)>>>0){a=7;break}switch(s[e+2>>1]|0){case 13:case 10:{a=7;break e}case 47:break e;case 91:{m()|0;break}case 92:{f[72]=e+4;break}default:{}}}if((a|0)==7)_();return}function U(e){e=e|0;switch(s[e>>1]|0){case 62:{e=(s[e+-2>>1]|0)==61;break}case 41:case 59:{e=1;break}case 104:{e=B(e+-2|0,188,4)|0;break}case 121:{e=B(e+-2|0,196,6)|0;break}case 101:{e=B(e+-2|0,208,3)|0;break}default:e=0;}return e|0}function x(e){e=e|0;var a=0,r=0,i=0,c=0,t=0;c=(f[72]|0)+2|0;f[72]=c;r=f[73]|0;while(1){a=c+2|0;if(c>>>0>=r>>>0)break;i=s[a>>1]|0;if(!e?se(i)|0:0)break;if(i<<16>>16==42?(s[c+4>>1]|0)==47:0){t=8;break}c=a;}if((t|0)==8){f[72]=a;a=c+4|0;}f[72]=a;return}function S(e,a,r){e=e|0;a=a|0;r=r|0;var s=0,f=0;e:do{if(!r)e=0;else {while(1){s=i[e>>0]|0;f=i[a>>0]|0;if(s<<24>>24!=f<<24>>24)break;r=r+-1|0;if(!r){e=0;break e}else {e=e+1|0;a=a+1|0;}}e=(s&255)-(f&255)|0;}}while(0);return e|0}function O(e){e=e|0;e:do{switch(e<<16>>16){case 38:case 37:case 33:{e=1;break}default:if((e&-8)<<16>>16==40|(e+-58&65535)<6)e=1;else {switch(e<<16>>16){case 91:case 93:case 94:{e=1;break e}default:{}}e=(e+-123&65535)<4;}}}while(0);return e|0}function $(e){e=e|0;e:do{switch(e<<16>>16){case 38:case 37:case 33:break;default:if(!((e+-58&65535)<6|(e+-40&65535)<7&e<<16>>16!=41)){switch(e<<16>>16){case 91:case 94:break e;default:{}}return e<<16>>16!=125&(e+-123&65535)<4|0}}}while(0);return 1}function T(e){e=e|0;var a=0;a=s[e>>1]|0;e:do{if((a+-9&65535)>=5){switch(a<<16>>16){case 160:case 32:{a=1;break e}default:{}}if(O(a)|0)return a<<16>>16!=46|(M(e)|0)|0;else a=0;}else a=1;}while(0);return a|0}function j(e){e=e|0;var a=0,r=0;r=n;n=n+16|0;f[r>>2]=0;f[66]=e;a=f[3]|0;s[a+(e<<1)>>1]=0;f[r>>2]=a+(e<<1)+2;f[67]=a+(e<<1)+2;f[59]=0;f[63]=0;f[61]=0;f[60]=0;f[65]=0;f[62]=0;n=r;return a|0}function B(e,a,r){e=e|0;a=a|0;r=r|0;var i=0,s=0;s=e+(0-r<<1)+2|0;i=f[3]|0;if(s>>>0>=i>>>0?(S(s,a,r<<1)|0)==0:0)if((s|0)==(i|0))i=1;else i=T(e+(0-r<<1)|0)|0;else i=0;return i|0}function E(e,a,r,i){e=e|0;a=a|0;r=r|0;i=i|0;var s=0,c=0;s=f[67]|0;f[67]=s+20;c=f[65]|0;f[((c|0)==0?240:c+16|0)>>2]=s;f[65]=s;f[s>>2]=e;f[s+4>>2]=a;f[s+8>>2]=r;f[s+12>>2]=i;f[s+16>>2]=0;return}function P(e){e=e|0;var a=0;switch(e<<16>>16){case 91:case 123:{o();f[72]=(f[72]|0)+2;break}default:{a=f[72]|0;H(e)|0;e=f[72]|0;if(e>>>0>a>>>0)E(a,e,a,e);}}return v(1)|0}function q(e){e=e|0;switch(s[e>>1]|0){case 107:{e=B(e+-2|0,122,4)|0;break}case 101:{if((s[e+-2>>1]|0)==117)e=B(e+-4|0,94,6)|0;else e=0;break}default:e=0;}return e|0}function z(e,a){e=e|0;a=a|0;var r=0;r=f[3]|0;if(r>>>0<=e>>>0?(s[e>>1]|0)==a<<16>>16:0)if((r|0)==(e|0))r=1;else r=D(s[e+-2>>1]|0)|0;else r=0;return r|0}function D(e){e=e|0;e:do{if((e+-9&65535)<5)e=1;else {switch(e<<16>>16){case 32:case 160:{e=1;break e}default:{}}e=e<<16>>16!=46&(O(e)|0);}}while(0);return e|0}function F(){var e=0,a=0,r=0;e=f[73]|0;r=f[72]|0;e:while(1){a=r+2|0;if(r>>>0>=e>>>0)break;switch(s[a>>1]|0){case 13:case 10:break e;default:r=a;}}f[72]=a;return}function G(e){e=e|0;e:do{if(((e&-33)+-65&65535)<26|(e+-48&65535)<10)e=1;else {switch(e<<16>>16){case 36:case 95:{e=1;break e}default:{}}e=(e&65535)>127;}}while(0);return e|0}function H(e){e=e|0;while(1){if(ee(e)|0)break;if(O(e)|0)break;e=(f[72]|0)+2|0;f[72]=e;e=s[e>>1]|0;if(!(e<<16>>16)){e=0;break}}return e|0}function J(){var e=0;e=f[(f[61]|0)+20>>2]|0;switch(e|0){case 1:{e=-1;break}case 2:{e=-2;break}default:e=e-(f[3]|0)>>1;}return e|0}function K(e){e=e|0;if(!(B(e,168,5)|0)?!(B(e,178,3)|0):0)e=B(e,184,2)|0;else e=1;return e|0}function L(e){e=e|0;switch(e<<16>>16){case 160:case 32:case 12:case 11:case 9:{e=1;break}default:e=0;}return e|0}function M(e){e=e|0;if((s[e>>1]|0)==46?(s[e+-2>>1]|0)==46:0)e=(s[e+-4>>1]|0)==46;else e=0;return e|0}function N(e){e=e|0;if((f[3]|0)==(e|0))e=1;else e=T(e+-2|0)|0;return e|0}function Q(){var e=0;e=f[(f[62]|0)+12>>2]|0;if(!e)e=-1;else e=e-(f[3]|0)>>1;return e|0}function R(){var e=0;e=f[(f[61]|0)+12>>2]|0;if(!e)e=-1;else e=e-(f[3]|0)>>1;return e|0}function V(){var e=0;e=f[(f[62]|0)+8>>2]|0;if(!e)e=-1;else e=e-(f[3]|0)>>1;return e|0}function W(){var e=0;e=f[(f[61]|0)+16>>2]|0;if(!e)e=-1;else e=e-(f[3]|0)>>1;return e|0}function X(){var e=0;e=f[(f[61]|0)+4>>2]|0;if(!e)e=-1;else e=e-(f[3]|0)>>1;return e|0}function Y(){var e=0;e=f[61]|0;e=f[((e|0)==0?236:e+32|0)>>2]|0;f[61]=e;return (e|0)!=0|0}function Z(){var e=0;e=f[62]|0;e=f[((e|0)==0?240:e+16|0)>>2]|0;f[62]=e;return (e|0)!=0|0}function _(){i[802]=1;f[68]=(f[72]|0)-(f[3]|0)>>1;f[72]=(f[73]|0)+2;return}function ee(e){e=e|0;return (e|128)<<16>>16==160|(e+-9&65535)<5|0}function ae(e){e=e|0;return e<<16>>16==39|e<<16>>16==34|0}function re(){return (f[(f[61]|0)+8>>2]|0)-(f[3]|0)>>1|0}function ie(){return (f[(f[62]|0)+4>>2]|0)-(f[3]|0)>>1|0}function se(e){e=e|0;return e<<16>>16==13|e<<16>>16==10|0}function fe(){return (f[f[61]>>2]|0)-(f[3]|0)>>1|0}function ce(){return (f[f[62]>>2]|0)-(f[3]|0)>>1|0}function te(){return c[(f[61]|0)+24>>0]|0|0}function ne(e){e=e|0;f[3]=e;return}function be(){return f[(f[61]|0)+28>>2]|0}function ke(){return f[68]|0}function le(e,a){e=e|0;a=a|0;n=e+a+15&-16;return a}return {su:le,ai:W,e:ke,ee:ie,ele:Q,els:V,es:ce,id:J,ie:X,ip:te,is:fe,it:be,p:k,re:Z,ri:Y,sa:j,se:R,ses:ne,ss:re}}("undefined"!=typeof globalThis?globalThis:self,{},a),r=e.su(i-(2<<17),1040);}const h=c$1.length+1;e.ses(r),e.sa(h-1),s(c$1,new Uint16Array(a,r,h)),e.p()||(n=e.e(),o());const w=[],d=[];for(;e.ri();){const a=e.is(),r=e.ie(),i=e.ai(),s=e.id(),f=e.ss(),t=e.se(),n=e.it();let k;e.ip()&&(k=b(-1===s?a:a+1,c$1.charCodeAt(-1===s?a-1:a)));let l=null;w.push({t:n,n:k,s:a,e:r,ss:f,se:t,d:s,a:i,at:l});}for(;e.re();){const a=e.es(),r=e.ee(),i=e.els(),s=e.ele(),f=i<0?void 0:v(i,s),c=v(a,r);d.push({s:a,e:r,ls:i,le:s,n:c,ln:f});}return [w,d];function v(e,a){const r=c$1.charCodeAt(e);return 34===r||39===r?b(e+1,r):c$1.slice(e,a)}}function b(e,a){n=e;let r="",i=n;for(;;){n>=c$1.length&&o();const e=c$1.charCodeAt(n);if(e===a)break;92===e?(r+=c$1.slice(i,n),r+=k(),i=n):(8232===e||8233===e||u(e)&&96!==a&&o(),++n);}return r+=c$1.slice(i,n++),r}function k(){let e=c$1.charCodeAt(++n);switch(++n,e){case 110:return "\n";case 114:return "\r";case 120:return String.fromCharCode(l(2));case 117:return function(){const e=c$1.charCodeAt(n);let a;123===e?(++n,a=l(c$1.indexOf("}",n)-n),++n,a>1114111&&o()):a=l(4);return a<=65535?String.fromCharCode(a):(a-=65536,String.fromCharCode(55296+(a>>10),56320+(1023&a)))}();case 116:return "\t";case 98:return "\b";case 118:return "\v";case 102:return "\f";case 13:10===c$1.charCodeAt(n)&&++n;case 10:return "";case 56:case 57:o();default:if(e>=48&&e<=55){let a=c$1.substr(n-1,3).match(/^[0-7]+/)[0],r=parseInt(a,8);return r>255&&(a=a.slice(0,-1),r=parseInt(a,8)),n+=a.length-1,e=c$1.charCodeAt(n),"0"===a&&56!==e&&57!==e||o(),String.fromCharCode(r)}return u(e)?"":String.fromCharCode(e)}}function l(e){const a=n;let r=0,i=0;for(let a=0;a<e;++a,++n){let e,s=c$1.charCodeAt(n);if(95!==s){if(s>=97)e=s-97+10;else if(s>=65)e=s-65+10;else {if(!(s>=48&&s<=57))break;e=s-48;}if(e>=16)break;i=s,r=16*r+e;}else 95!==i&&0!==a||o(),i=s;}return 95!==i&&n-a===e||o(),r}function u(e){return 13===e||10===e}function o(){throw Object.assign(Error(`Parse error ${t}:${c$1.slice(0,n).split("\n").length}:${n-c$1.lastIndexOf("\n",n-1)}`),{idx:n})}
|
|
628
|
-
|
|
629
|
-
const _resolve = (id, parentUrl = baseUrl) => {
|
|
630
|
-
const urlResolved = resolveIfNotPlainOrUrl(id, parentUrl) || asURL(id);
|
|
631
|
-
const firstResolved = firstImportMap && resolveImportMap(firstImportMap, urlResolved || id, parentUrl);
|
|
632
|
-
const composedResolved =
|
|
633
|
-
composedImportMap === firstImportMap ? firstResolved : (
|
|
634
|
-
resolveImportMap(composedImportMap, urlResolved || id, parentUrl)
|
|
635
|
-
);
|
|
636
|
-
const resolved = composedResolved || firstResolved || throwUnresolved(id, parentUrl);
|
|
637
|
-
// needsShim, shouldShim per load record to set on parent
|
|
638
|
-
let n = false,
|
|
639
|
-
N = false;
|
|
640
|
-
if (!supportsImportMaps) {
|
|
641
|
-
// bare specifier -> needs shim
|
|
642
|
-
if (!urlResolved) n = true;
|
|
643
|
-
// url mapping -> should shim
|
|
644
|
-
else if (urlResolved !== resolved) N = true;
|
|
645
|
-
} else if (!supportsMultipleImportMaps) {
|
|
646
|
-
// bare specifier and not resolved by first import map -> needs shim
|
|
647
|
-
if (!urlResolved && !firstResolved) n = true;
|
|
648
|
-
// resolution doesn't match first import map -> should shim
|
|
649
|
-
if (firstResolved && resolved !== firstResolved) N = true;
|
|
650
|
-
}
|
|
651
|
-
return { r: resolved, n, N };
|
|
652
|
-
};
|
|
653
|
-
|
|
654
|
-
const resolve = (id, parentUrl) => {
|
|
655
|
-
if (!resolveHook) return _resolve(id, parentUrl);
|
|
656
|
-
const result = resolveHook(id, parentUrl, defaultResolve);
|
|
657
|
-
|
|
658
|
-
return result ? { r: result, n: true, N: true } : _resolve(id, parentUrl);
|
|
659
|
-
};
|
|
660
|
-
|
|
661
|
-
// import()
|
|
662
|
-
async function importShim(id, opts, parentUrl) {
|
|
663
|
-
if (typeof opts === 'string') {
|
|
664
|
-
parentUrl = opts;
|
|
665
|
-
opts = undefined;
|
|
666
|
-
}
|
|
667
|
-
await initPromise; // needed for shim check
|
|
668
|
-
if (shimMode || !baselineSupport) {
|
|
669
|
-
if (hasDocument) processScriptsAndPreloads();
|
|
670
|
-
legacyAcceptingImportMaps = false;
|
|
671
|
-
}
|
|
672
|
-
let sourceType = undefined;
|
|
673
|
-
if (typeof opts === 'object') {
|
|
674
|
-
if (opts.lang === 'ts') sourceType = 'ts';
|
|
675
|
-
if (typeof opts.with === 'object' && typeof opts.with.type === 'string') {
|
|
676
|
-
sourceType = opts.with.type;
|
|
677
|
-
}
|
|
678
|
-
}
|
|
679
|
-
return topLevelLoad(id, parentUrl || baseUrl, defaultFetchOpts, undefined, undefined, undefined, sourceType);
|
|
680
|
-
}
|
|
681
|
-
|
|
682
|
-
// import.source()
|
|
683
|
-
// (opts not currently supported as no use cases yet)
|
|
684
|
-
if (shimMode || wasmSourcePhaseEnabled)
|
|
685
|
-
importShim.source = async (id, opts, parentUrl) => {
|
|
686
|
-
if (typeof opts === 'string') {
|
|
687
|
-
parentUrl = opts;
|
|
688
|
-
opts = undefined;
|
|
689
|
-
}
|
|
690
|
-
await initPromise; // needed for shim check
|
|
691
|
-
if (shimMode || !baselineSupport) {
|
|
692
|
-
if (hasDocument) processScriptsAndPreloads();
|
|
693
|
-
legacyAcceptingImportMaps = false;
|
|
694
|
-
}
|
|
695
|
-
await importMapPromise;
|
|
696
|
-
const url = resolve(id, parentUrl || baseUrl).r;
|
|
697
|
-
const load = getOrCreateLoad(url, defaultFetchOpts, undefined, undefined);
|
|
698
|
-
await load.f;
|
|
699
|
-
return importShim._s[load.r];
|
|
700
|
-
};
|
|
701
|
-
|
|
702
|
-
// import.defer() is just a proxy for import(), since we can't actually defer
|
|
703
|
-
if (shimMode || deferPhaseEnabled) importShim.defer = importShim;
|
|
704
|
-
|
|
705
|
-
if (hotReload) {
|
|
706
|
-
initHotReload(topLevelLoad, importShim);
|
|
707
|
-
importShim.hotReload = hotReload$1;
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
const defaultResolve = (id, parentUrl) => {
|
|
711
|
-
return (
|
|
712
|
-
resolveImportMap(composedImportMap, resolveIfNotPlainOrUrl(id, parentUrl) || id, parentUrl) ||
|
|
713
|
-
throwUnresolved(id, parentUrl)
|
|
714
|
-
);
|
|
715
|
-
};
|
|
716
|
-
|
|
717
|
-
const throwUnresolved = (id, parentUrl) => {
|
|
718
|
-
throw Error(`Unable to resolve specifier '${id}'${fromParent(parentUrl)}`);
|
|
719
|
-
};
|
|
720
|
-
|
|
721
|
-
const metaResolve = function (id, parentUrl = this.url) {
|
|
722
|
-
return resolve(id, `${parentUrl}`).r;
|
|
723
|
-
};
|
|
724
|
-
|
|
725
|
-
importShim.resolve = (id, parentUrl) => resolve(id, parentUrl).r;
|
|
726
|
-
importShim.getImportMap = () => JSON.parse(JSON.stringify(composedImportMap));
|
|
727
|
-
importShim.addImportMap = importMapIn => {
|
|
728
|
-
if (!shimMode) throw new Error('Unsupported in polyfill mode.');
|
|
729
|
-
composedImportMap = resolveAndComposeImportMap(importMapIn, baseUrl, composedImportMap);
|
|
730
|
-
};
|
|
731
|
-
importShim.version = version;
|
|
732
|
-
|
|
733
|
-
const registry = (importShim._r = {});
|
|
734
|
-
// Wasm caches
|
|
735
|
-
const sourceCache = (importShim._s = {});
|
|
736
|
-
/* const instanceCache = */ importShim._i = new WeakMap();
|
|
737
|
-
|
|
738
|
-
// Ensure this version is the only version
|
|
739
|
-
defineValue(self_, 'importShim', Object.freeze(importShim));
|
|
740
|
-
const shimModeOptions = { ...esmsInitOptions, shimMode: true };
|
|
741
|
-
if (optionsScript) optionsScript.innerText = maybeTrustedScript(JSON.stringify(shimModeOptions));
|
|
742
|
-
self_.esmsInitOptions = shimModeOptions;
|
|
743
|
-
|
|
744
|
-
const loadAll = async (load, seen) => {
|
|
745
|
-
seen[load.u] = 1;
|
|
746
|
-
await load.L;
|
|
747
|
-
await Promise.all(
|
|
748
|
-
load.d.map(({ l: dep, s: sourcePhase }) => {
|
|
749
|
-
if (dep.b || seen[dep.u]) return;
|
|
750
|
-
if (sourcePhase) return dep.f;
|
|
751
|
-
return loadAll(dep, seen);
|
|
752
|
-
})
|
|
753
|
-
);
|
|
754
|
-
};
|
|
755
|
-
|
|
756
|
-
let importMapSrc = false;
|
|
757
|
-
let multipleImportMaps = false;
|
|
758
|
-
let firstImportMap = null;
|
|
759
|
-
// To support polyfilling multiple import maps, we separately track the composed import map from the first import map
|
|
760
|
-
let composedImportMap = { imports: {}, scopes: {}, integrity: {} };
|
|
761
|
-
let baselineSupport;
|
|
762
|
-
|
|
763
|
-
const initPromise = featureDetectionPromise.then(() => {
|
|
764
|
-
baselineSupport =
|
|
765
|
-
supportsImportMaps &&
|
|
766
|
-
(!jsonModulesEnabled || supportsJsonType) &&
|
|
767
|
-
(!cssModulesEnabled || supportsCssType) &&
|
|
768
|
-
(!wasmInstancePhaseEnabled || supportsWasmInstancePhase) &&
|
|
769
|
-
(!wasmSourcePhaseEnabled || supportsWasmSourcePhase) &&
|
|
770
|
-
!deferPhaseEnabled &&
|
|
771
|
-
(!multipleImportMaps || supportsMultipleImportMaps) &&
|
|
772
|
-
!importMapSrc &&
|
|
773
|
-
!hasCustomizationHooks;
|
|
774
|
-
if (!shimMode && typeof WebAssembly !== 'undefined') {
|
|
775
|
-
if (wasmSourcePhaseEnabled && !Object.getPrototypeOf(WebAssembly.Module).name) {
|
|
776
|
-
const s = Symbol();
|
|
777
|
-
const brand = m => defineValue(m, s, 'WebAssembly.Module');
|
|
778
|
-
class AbstractModuleSource {
|
|
779
|
-
get [Symbol.toStringTag]() {
|
|
780
|
-
if (this[s]) return this[s];
|
|
781
|
-
throw new TypeError('Not an AbstractModuleSource');
|
|
782
|
-
}
|
|
783
|
-
}
|
|
784
|
-
const { Module: wasmModule, compile: wasmCompile, compileStreaming: wasmCompileStreaming } = WebAssembly;
|
|
785
|
-
WebAssembly.Module = Object.setPrototypeOf(
|
|
786
|
-
Object.assign(function Module(...args) {
|
|
787
|
-
return brand(new wasmModule(...args));
|
|
788
|
-
}, wasmModule),
|
|
789
|
-
AbstractModuleSource
|
|
790
|
-
);
|
|
791
|
-
WebAssembly.Module.prototype = Object.setPrototypeOf(wasmModule.prototype, AbstractModuleSource.prototype);
|
|
792
|
-
WebAssembly.compile = function compile(...args) {
|
|
793
|
-
return wasmCompile(...args).then(brand);
|
|
794
|
-
};
|
|
795
|
-
WebAssembly.compileStreaming = function compileStreaming(...args) {
|
|
796
|
-
return wasmCompileStreaming(...args).then(brand);
|
|
797
|
-
};
|
|
798
|
-
}
|
|
799
|
-
}
|
|
800
|
-
if (hasDocument) {
|
|
801
|
-
if (!supportsImportMaps) {
|
|
802
|
-
const supports = HTMLScriptElement.supports || (type => type === 'classic' || type === 'module');
|
|
803
|
-
HTMLScriptElement.supports = type => type === 'importmap' || supports(type);
|
|
804
|
-
}
|
|
805
|
-
if (shimMode || !baselineSupport) {
|
|
806
|
-
attachMutationObserver();
|
|
807
|
-
if (document.readyState === 'complete') {
|
|
808
|
-
readyStateCompleteCheck();
|
|
809
|
-
} else {
|
|
810
|
-
document.addEventListener('readystatechange', readyListener);
|
|
811
|
-
}
|
|
812
|
-
}
|
|
813
|
-
processScriptsAndPreloads();
|
|
814
|
-
}
|
|
815
|
-
return undefined;
|
|
816
|
-
});
|
|
817
|
-
|
|
818
|
-
const attachMutationObserver = () => {
|
|
819
|
-
const observer = new MutationObserver(mutations => {
|
|
820
|
-
for (const mutation of mutations) {
|
|
821
|
-
if (mutation.type !== 'childList') continue;
|
|
822
|
-
for (const node of mutation.addedNodes) {
|
|
823
|
-
if (node.tagName === 'SCRIPT') {
|
|
824
|
-
if (node.type === (shimMode ? 'module-shim' : 'module') && !node.ep) processScript(node, true);
|
|
825
|
-
if (node.type === (shimMode ? 'importmap-shim' : 'importmap') && !node.ep) processImportMap(node, true);
|
|
826
|
-
} else if (
|
|
827
|
-
node.tagName === 'LINK' &&
|
|
828
|
-
node.rel === (shimMode ? 'modulepreload-shim' : 'modulepreload') &&
|
|
829
|
-
!node.ep
|
|
830
|
-
) {
|
|
831
|
-
processPreload(node);
|
|
832
|
-
}
|
|
833
|
-
}
|
|
834
|
-
}
|
|
835
|
-
});
|
|
836
|
-
observer.observe(document, { childList: true });
|
|
837
|
-
observer.observe(document.head, { childList: true });
|
|
838
|
-
processScriptsAndPreloads();
|
|
839
|
-
};
|
|
840
|
-
|
|
841
|
-
let importMapPromise = initPromise;
|
|
842
|
-
let firstPolyfillLoad = true;
|
|
843
|
-
let legacyAcceptingImportMaps = true;
|
|
844
|
-
|
|
845
|
-
async function topLevelLoad(
|
|
846
|
-
url,
|
|
847
|
-
parentUrl,
|
|
848
|
-
fetchOpts,
|
|
849
|
-
source,
|
|
850
|
-
nativelyLoaded,
|
|
851
|
-
lastStaticLoadPromise,
|
|
852
|
-
sourceType
|
|
853
|
-
) {
|
|
854
|
-
await initPromise;
|
|
855
|
-
await importMapPromise;
|
|
856
|
-
url = (await resolve(url, parentUrl)).r;
|
|
857
|
-
|
|
858
|
-
// we mock import('./x.css', { with: { type: 'css' }}) support via an inline static reexport
|
|
859
|
-
// because we can't syntactically pass through to dynamic import with a second argument
|
|
860
|
-
if (sourceType === 'css' || sourceType === 'json') {
|
|
861
|
-
// Direct reexport for hot reloading skipped due to Firefox bug https://bugzilla.mozilla.org/show_bug.cgi?id=1965620
|
|
862
|
-
source = `import m from'${url}'with{type:"${sourceType}"};export default m;`;
|
|
863
|
-
url += '?entry';
|
|
864
|
-
}
|
|
865
|
-
|
|
866
|
-
if (importHook) await importHook(url, typeof fetchOpts !== 'string' ? fetchOpts : {}, parentUrl, source, sourceType);
|
|
867
|
-
// early analysis opt-out - no need to even fetch if we have feature support
|
|
868
|
-
if (!shimMode && baselineSupport && nativePassthrough && sourceType !== 'ts') {
|
|
869
|
-
// for polyfill case, only dynamic import needs a return value here, and dynamic import will never pass nativelyLoaded
|
|
870
|
-
if (nativelyLoaded) return null;
|
|
871
|
-
await lastStaticLoadPromise;
|
|
872
|
-
return dynamicImport(source ? createBlob(source) : url);
|
|
873
|
-
}
|
|
874
|
-
const load = getOrCreateLoad(url, fetchOpts, undefined, source);
|
|
875
|
-
linkLoad(load, fetchOpts);
|
|
876
|
-
const seen = {};
|
|
877
|
-
await loadAll(load, seen);
|
|
878
|
-
resolveDeps(load, seen);
|
|
879
|
-
await lastStaticLoadPromise;
|
|
880
|
-
if (!shimMode && !load.n) {
|
|
881
|
-
if (nativelyLoaded) {
|
|
882
|
-
return;
|
|
883
|
-
}
|
|
884
|
-
if (source) {
|
|
885
|
-
return await dynamicImport(createBlob(source));
|
|
886
|
-
}
|
|
887
|
-
}
|
|
888
|
-
if (firstPolyfillLoad && !shimMode && load.n && nativelyLoaded) {
|
|
889
|
-
onpolyfill();
|
|
890
|
-
firstPolyfillLoad = false;
|
|
891
|
-
}
|
|
892
|
-
const module = await (shimMode || load.n || load.N || !nativePassthrough || (!nativelyLoaded && source) ?
|
|
893
|
-
dynamicImport(load.b, load.u)
|
|
894
|
-
: import(load.u));
|
|
895
|
-
// if the top-level load is a shell, run its update function
|
|
896
|
-
if (load.s) (await dynamicImport(load.s, load.u)).u$_(module);
|
|
897
|
-
revokeObjectURLs(Object.keys(seen));
|
|
898
|
-
return module;
|
|
899
|
-
}
|
|
900
|
-
|
|
901
|
-
const revokeObjectURLs = registryKeys => {
|
|
902
|
-
let curIdx = 0;
|
|
903
|
-
const handler = self_.requestIdleCallback || self_.requestAnimationFrame || (fn => setTimeout(fn, 0));
|
|
904
|
-
handler(cleanup);
|
|
905
|
-
function cleanup() {
|
|
906
|
-
for (const key of registryKeys.slice(curIdx, (curIdx += 100))) {
|
|
907
|
-
const load = registry[key];
|
|
908
|
-
if (load && load.b && load.b !== load.u) URL.revokeObjectURL(load.b);
|
|
909
|
-
}
|
|
910
|
-
if (curIdx < registryKeys.length) handler(cleanup);
|
|
911
|
-
}
|
|
912
|
-
};
|
|
913
|
-
|
|
914
|
-
const urlJsString = url => `'${url.replace(/'/g, "\\'")}'`;
|
|
915
|
-
|
|
916
|
-
let resolvedSource, lastIndex;
|
|
917
|
-
const pushStringTo = (load, originalIndex, dynamicImportEndStack) => {
|
|
918
|
-
while (dynamicImportEndStack[dynamicImportEndStack.length - 1] < originalIndex) {
|
|
919
|
-
const dynamicImportEnd = dynamicImportEndStack.pop();
|
|
920
|
-
resolvedSource += `${load.S.slice(lastIndex, dynamicImportEnd)}, ${urlJsString(load.r)}`;
|
|
921
|
-
lastIndex = dynamicImportEnd;
|
|
922
|
-
}
|
|
923
|
-
resolvedSource += load.S.slice(lastIndex, originalIndex);
|
|
924
|
-
lastIndex = originalIndex;
|
|
925
|
-
};
|
|
926
|
-
|
|
927
|
-
const pushSourceURL = (load, commentPrefix, commentStart, dynamicImportEndStack) => {
|
|
928
|
-
const urlStart = commentStart + commentPrefix.length;
|
|
929
|
-
const commentEnd = load.S.indexOf('\n', urlStart);
|
|
930
|
-
const urlEnd = commentEnd !== -1 ? commentEnd : load.S.length;
|
|
931
|
-
let sourceUrl = load.S.slice(urlStart, urlEnd);
|
|
932
|
-
try {
|
|
933
|
-
sourceUrl = new URL(sourceUrl, load.r).href;
|
|
934
|
-
} catch (e) {}
|
|
935
|
-
pushStringTo(load, urlStart, dynamicImportEndStack);
|
|
936
|
-
resolvedSource += sourceUrl;
|
|
937
|
-
lastIndex = urlEnd;
|
|
938
|
-
};
|
|
939
|
-
|
|
940
|
-
const resolveDeps = (load, seen) => {
|
|
941
|
-
if (load.b || !seen[load.u]) return;
|
|
942
|
-
seen[load.u] = 0;
|
|
943
|
-
|
|
944
|
-
for (const { l: dep, s: sourcePhase } of load.d) {
|
|
945
|
-
if (!sourcePhase) resolveDeps(dep, seen);
|
|
946
|
-
}
|
|
947
|
-
|
|
948
|
-
if (!load.n) load.n = load.d.some(dep => dep.l.n);
|
|
949
|
-
if (!load.N) load.N = load.d.some(dep => dep.l.N);
|
|
950
|
-
|
|
951
|
-
// use native loader whenever possible (n = needs shim) via executable subgraph passthrough
|
|
952
|
-
// so long as the module doesn't use dynamic import or unsupported URL mappings (N = should shim)
|
|
953
|
-
if (nativePassthrough && !shimMode && !load.n && !load.N) {
|
|
954
|
-
load.b = load.u;
|
|
955
|
-
load.S = undefined;
|
|
956
|
-
return;
|
|
957
|
-
}
|
|
958
|
-
|
|
959
|
-
const [imports, exports] = load.a;
|
|
960
|
-
|
|
961
|
-
// "execution"
|
|
962
|
-
let source = load.S,
|
|
963
|
-
depIndex = 0,
|
|
964
|
-
dynamicImportEndStack = [];
|
|
965
|
-
|
|
966
|
-
// once all deps have loaded we can inline the dependency resolution blobs
|
|
967
|
-
// and define this blob
|
|
968
|
-
resolvedSource = '';
|
|
969
|
-
lastIndex = 0;
|
|
970
|
-
|
|
971
|
-
for (const { s: start, e: end, ss: statementStart, se: statementEnd, d: dynamicImportIndex, t, a, at } of imports) {
|
|
972
|
-
// source phase
|
|
973
|
-
if (t === 4) {
|
|
974
|
-
let { l: depLoad } = load.d[depIndex++];
|
|
975
|
-
pushStringTo(load, statementStart, dynamicImportEndStack);
|
|
976
|
-
resolvedSource += `${source.slice(statementStart, start - 1).replace('source', '')}/*${source.slice(start - 1, end + 1)}*/'${createBlob(`export default importShim._s[${urlJsString(depLoad.r)}]`)}'`;
|
|
977
|
-
lastIndex = end + 1;
|
|
978
|
-
}
|
|
979
|
-
// dependency source replacements
|
|
980
|
-
else if (dynamicImportIndex === -1) {
|
|
981
|
-
let keepAssertion = false;
|
|
982
|
-
if (a > 0 && !shimMode) {
|
|
983
|
-
// strip assertions only when unsupported in polyfill mode
|
|
984
|
-
// minimal lexer builds do not provide parsed attributes, so sniff the assertion source directly
|
|
985
|
-
const assertion = source.slice(a, statementEnd - 1);
|
|
986
|
-
keepAssertion =
|
|
987
|
-
nativePassthrough &&
|
|
988
|
-
((supportsJsonType && assertion.includes('json')) || (supportsCssType && assertion.includes('css')));
|
|
989
|
-
}
|
|
990
|
-
|
|
991
|
-
// defer phase stripping
|
|
992
|
-
if (t === 6) {
|
|
993
|
-
pushStringTo(load, statementStart, dynamicImportEndStack);
|
|
994
|
-
resolvedSource += source.slice(statementStart, start - 1).replace('defer', '');
|
|
995
|
-
lastIndex = start;
|
|
996
|
-
}
|
|
997
|
-
let { l: depLoad } = load.d[depIndex++],
|
|
998
|
-
blobUrl = depLoad.b,
|
|
999
|
-
cycleShell = !blobUrl;
|
|
1000
|
-
if (cycleShell) {
|
|
1001
|
-
// circular shell creation
|
|
1002
|
-
if (!(blobUrl = depLoad.s)) {
|
|
1003
|
-
blobUrl = depLoad.s = createBlob(
|
|
1004
|
-
`export function u$_(m){${depLoad.a[1]
|
|
1005
|
-
.map(({ s, e }, i) => {
|
|
1006
|
-
const q = depLoad.S[s] === '"' || depLoad.S[s] === "'";
|
|
1007
|
-
return `e$_${i}=m${q ? `[` : '.'}${depLoad.S.slice(s, e)}${q ? `]` : ''}`;
|
|
1008
|
-
})
|
|
1009
|
-
.join(',')}}${
|
|
1010
|
-
depLoad.a[1].length ? `let ${depLoad.a[1].map((_, i) => `e$_${i}`).join(',')};` : ''
|
|
1011
|
-
}export {${depLoad.a[1]
|
|
1012
|
-
.map(({ s, e }, i) => `e$_${i} as ${depLoad.S.slice(s, e)}`)
|
|
1013
|
-
.join(',')}}\n//# sourceURL=${depLoad.r}?cycle`
|
|
1014
|
-
);
|
|
1015
|
-
}
|
|
1016
|
-
}
|
|
1017
|
-
|
|
1018
|
-
pushStringTo(load, start - 1, dynamicImportEndStack);
|
|
1019
|
-
resolvedSource += `/*${source.slice(start - 1, end + 1)}*/'${blobUrl}'`;
|
|
1020
|
-
|
|
1021
|
-
// circular shell execution
|
|
1022
|
-
if (!cycleShell && depLoad.s) {
|
|
1023
|
-
resolvedSource += `;import*as m$_${depIndex} from'${depLoad.b}';import{u$_ as u$_${depIndex}}from'${depLoad.s}';u$_${depIndex}(m$_${depIndex})`;
|
|
1024
|
-
depLoad.s = undefined;
|
|
1025
|
-
}
|
|
1026
|
-
lastIndex = keepAssertion ? end + 1 : statementEnd;
|
|
1027
|
-
}
|
|
1028
|
-
// import.meta
|
|
1029
|
-
else if (dynamicImportIndex === -2) {
|
|
1030
|
-
load.m = { url: load.r, resolve: metaResolve };
|
|
1031
|
-
if (metaHook) metaHook(load.m, load.u);
|
|
1032
|
-
pushStringTo(load, start, dynamicImportEndStack);
|
|
1033
|
-
resolvedSource += `importShim._r[${urlJsString(load.u)}].m`;
|
|
1034
|
-
lastIndex = statementEnd;
|
|
1035
|
-
}
|
|
1036
|
-
// dynamic import
|
|
1037
|
-
else {
|
|
1038
|
-
pushStringTo(load, statementStart + 6, dynamicImportEndStack);
|
|
1039
|
-
resolvedSource += `Shim${t === 5 ? '.source' : ''}(`;
|
|
1040
|
-
dynamicImportEndStack.push(statementEnd - 1);
|
|
1041
|
-
lastIndex = start;
|
|
1042
|
-
}
|
|
1043
|
-
}
|
|
1044
|
-
|
|
1045
|
-
// support progressive cycle binding updates (try statement avoids tdz errors)
|
|
1046
|
-
if (load.s && (imports.length === 0 || imports[imports.length - 1].d === -1))
|
|
1047
|
-
resolvedSource += `\n;import{u$_}from'${load.s}';try{u$_({${exports
|
|
1048
|
-
.filter(e => e.ln)
|
|
1049
|
-
.map(({ s, e, ln }) => `${source.slice(s, e)}:${ln}`)
|
|
1050
|
-
.join(',')}})}catch(_){};\n`;
|
|
1051
|
-
|
|
1052
|
-
let sourceURLCommentStart = source.lastIndexOf(sourceURLCommentPrefix);
|
|
1053
|
-
let sourceMapURLCommentStart = source.lastIndexOf(sourceMapURLCommentPrefix);
|
|
1054
|
-
|
|
1055
|
-
// ignore sourceMap comments before already spliced code
|
|
1056
|
-
if (sourceURLCommentStart < lastIndex) sourceURLCommentStart = -1;
|
|
1057
|
-
if (sourceMapURLCommentStart < lastIndex) sourceMapURLCommentStart = -1;
|
|
1058
|
-
|
|
1059
|
-
// sourceURL first / only
|
|
1060
|
-
if (
|
|
1061
|
-
sourceURLCommentStart !== -1 &&
|
|
1062
|
-
(sourceMapURLCommentStart === -1 || sourceMapURLCommentStart > sourceURLCommentStart)
|
|
1063
|
-
) {
|
|
1064
|
-
pushSourceURL(load, sourceURLCommentPrefix, sourceURLCommentStart, dynamicImportEndStack);
|
|
1065
|
-
}
|
|
1066
|
-
// sourceMappingURL
|
|
1067
|
-
if (sourceMapURLCommentStart !== -1) {
|
|
1068
|
-
pushSourceURL(load, sourceMapURLCommentPrefix, sourceMapURLCommentStart, dynamicImportEndStack);
|
|
1069
|
-
// sourceURL last
|
|
1070
|
-
if (sourceURLCommentStart !== -1 && sourceURLCommentStart > sourceMapURLCommentStart)
|
|
1071
|
-
pushSourceURL(load, sourceURLCommentPrefix, sourceURLCommentStart, dynamicImportEndStack);
|
|
1072
|
-
}
|
|
1073
|
-
|
|
1074
|
-
pushStringTo(load, source.length, dynamicImportEndStack);
|
|
1075
|
-
|
|
1076
|
-
if (sourceURLCommentStart === -1) resolvedSource += sourceURLCommentPrefix + load.r;
|
|
1077
|
-
|
|
1078
|
-
load.b = createBlob(resolvedSource);
|
|
1079
|
-
load.S = resolvedSource = undefined;
|
|
1080
|
-
};
|
|
1081
|
-
|
|
1082
|
-
const sourceURLCommentPrefix = '\n//# sourceURL=';
|
|
1083
|
-
const sourceMapURLCommentPrefix = '\n//# sourceMappingURL=';
|
|
1084
|
-
const cssUrlRegEx = /url\(\s*(?:(["'])((?:\\.|[^\n\\"'])+)\1|((?:\\.|[^\s,"'()\\])+))\s*\)/g;
|
|
1085
|
-
|
|
1086
|
-
// restrict in-flight fetches to a pool of 100
|
|
1087
|
-
let p = [];
|
|
1088
|
-
let c = 0;
|
|
1089
|
-
const pushFetchPool = () => {
|
|
1090
|
-
if (++c > 100) return new Promise(r => p.push(r));
|
|
1091
|
-
};
|
|
1092
|
-
const popFetchPool = () => {
|
|
1093
|
-
c--;
|
|
1094
|
-
if (p.length) p.shift()();
|
|
1095
|
-
};
|
|
1096
|
-
|
|
1097
|
-
const doFetch = async (url, fetchOpts, parent) => {
|
|
1098
|
-
if (enforceIntegrity && !fetchOpts.integrity) throw Error(`No integrity for ${url}${fromParent(parent)}.`);
|
|
1099
|
-
let res,
|
|
1100
|
-
poolQueue = pushFetchPool();
|
|
1101
|
-
if (poolQueue) await poolQueue;
|
|
1102
|
-
try {
|
|
1103
|
-
res = await fetchHook(url, fetchOpts);
|
|
1104
|
-
} catch (e) {
|
|
1105
|
-
e.message = `Unable to fetch ${url}${fromParent(parent)} - see network log for details.\n` + e.message;
|
|
1106
|
-
throw e;
|
|
1107
|
-
} finally {
|
|
1108
|
-
popFetchPool();
|
|
1109
|
-
}
|
|
1110
|
-
|
|
1111
|
-
if (!res.ok) {
|
|
1112
|
-
const error = new TypeError(`${res.status} ${res.statusText} ${res.url}${fromParent(parent)}`);
|
|
1113
|
-
error.response = res;
|
|
1114
|
-
throw error;
|
|
1115
|
-
}
|
|
1116
|
-
return res;
|
|
1117
|
-
};
|
|
1118
|
-
|
|
1119
|
-
let esmsTsTransform;
|
|
1120
|
-
const initTs = async () => {
|
|
1121
|
-
const m = await import(tsTransform);
|
|
1122
|
-
if (!esmsTsTransform) esmsTsTransform = m.transform;
|
|
1123
|
-
};
|
|
1124
|
-
|
|
1125
|
-
async function defaultSourceHook(url, fetchOpts, parent) {
|
|
1126
|
-
let res = await doFetch(url, fetchOpts, parent),
|
|
1127
|
-
contentType,
|
|
1128
|
-
[, json, type, jsts] =
|
|
1129
|
-
(contentType = res.headers.get('content-type') || '').match(
|
|
1130
|
-
/^(?:[^/;]+\/(?:[^/+;]+\+)?(json)|(?:text|application)\/(?:x-)?((java|type)script|wasm|css))(?:;|$)/
|
|
1131
|
-
) || [];
|
|
1132
|
-
if (!(type = json || (jsts ? jsts[0] + 's' : type || (/\.m?ts(\?|#|$)/.test(url) && 'ts')))) {
|
|
1133
|
-
throw Error(
|
|
1134
|
-
`Unsupported Content-Type "${contentType}" loading ${url}${fromParent(parent)}. Modules must be served with a valid MIME type like application/javascript.`
|
|
1135
|
-
);
|
|
1136
|
-
}
|
|
1137
|
-
return {
|
|
1138
|
-
url: res.url,
|
|
1139
|
-
source: await (type > 'v' ? WebAssembly.compileStreaming(res) : res.text()),
|
|
1140
|
-
type
|
|
1141
|
-
};
|
|
1142
|
-
}
|
|
1143
|
-
|
|
1144
|
-
const hotPrefix = 'var h=import.meta.hot,';
|
|
1145
|
-
const fetchModule = async (reqUrl, fetchOpts, parent) => {
|
|
1146
|
-
const mapIntegrity = composedImportMap.integrity[reqUrl];
|
|
1147
|
-
fetchOpts = mapIntegrity && !fetchOpts.integrity ? { ...fetchOpts, integrity: mapIntegrity } : fetchOpts;
|
|
1148
|
-
let {
|
|
1149
|
-
url = reqUrl,
|
|
1150
|
-
source,
|
|
1151
|
-
type
|
|
1152
|
-
} = (await (sourceHook || defaultSourceHook)(reqUrl, fetchOpts, parent, defaultSourceHook)) || {};
|
|
1153
|
-
if (type === 'wasm') {
|
|
1154
|
-
const exports = WebAssembly.Module.exports((sourceCache[url] = source));
|
|
1155
|
-
const imports = WebAssembly.Module.imports(source);
|
|
1156
|
-
const rStr = urlJsString(url);
|
|
1157
|
-
source = `import*as $_ns from${rStr};`;
|
|
1158
|
-
let i = 0,
|
|
1159
|
-
obj = '';
|
|
1160
|
-
for (const { module, kind } of imports) {
|
|
1161
|
-
const specifier = urlJsString(module);
|
|
1162
|
-
source += `import*as impt${i} from${specifier};\n`;
|
|
1163
|
-
obj += `${specifier}:${kind === 'global' ? `importShim._i.get(impt${i})||impt${i++}` : `impt${i++}`},`;
|
|
1164
|
-
}
|
|
1165
|
-
source += `${hotPrefix}i=await WebAssembly.instantiate(importShim._s[${rStr}],{${obj}});importShim._i.set($_ns,i);`;
|
|
1166
|
-
obj = '';
|
|
1167
|
-
for (const { name, kind } of exports) {
|
|
1168
|
-
source += `export let ${name}=i.exports['${name}'];`;
|
|
1169
|
-
if (kind === 'global') source += `try{${name}=${name}.value}catch(_){${name}=undefined}`;
|
|
1170
|
-
obj += `${name},`;
|
|
1171
|
-
}
|
|
1172
|
-
source += `if(h)h.accept(m=>({${obj}}=m))`;
|
|
1173
|
-
} else if (type === 'json') {
|
|
1174
|
-
source = `${hotPrefix}j=JSON.parse(${JSON.stringify(source)});export{j as default};if(h)h.accept(m=>j=m.default)`;
|
|
1175
|
-
} else if (type === 'css') {
|
|
1176
|
-
source = `${hotPrefix}s=h&&h.data.s||new CSSStyleSheet();s.replaceSync(${JSON.stringify(
|
|
1177
|
-
source.replace(
|
|
1178
|
-
cssUrlRegEx,
|
|
1179
|
-
(_match, quotes = '', relUrl1, relUrl2) => `url(${quotes}${resolveUrl(relUrl1 || relUrl2, url)}${quotes})`
|
|
1180
|
-
)
|
|
1181
|
-
)});if(h){h.data.s=s;h.accept(()=>{})}export default s`;
|
|
1182
|
-
} else if (type === 'ts') {
|
|
1183
|
-
if (!esmsTsTransform) await initTs();
|
|
1184
|
-
const transformed = esmsTsTransform(source, url);
|
|
1185
|
-
// even if the TypeScript is valid JavaScript, unless it was a top-level inline source, it wasn't served with
|
|
1186
|
-
// a valid JS MIME here, so we must still polyfill it
|
|
1187
|
-
source = transformed === undefined ? source : transformed;
|
|
1188
|
-
}
|
|
1189
|
-
return { url, source, type };
|
|
1190
|
-
};
|
|
1191
|
-
|
|
1192
|
-
const getOrCreateLoad = (url, fetchOpts, parent, source) => {
|
|
1193
|
-
if (source && registry[url]) {
|
|
1194
|
-
let i = 0;
|
|
1195
|
-
while (registry[url + '#' + ++i]);
|
|
1196
|
-
url += '#' + i;
|
|
1197
|
-
}
|
|
1198
|
-
let load = registry[url];
|
|
1199
|
-
if (load) return load;
|
|
1200
|
-
registry[url] = load = {
|
|
1201
|
-
// url
|
|
1202
|
-
u: url,
|
|
1203
|
-
// response url
|
|
1204
|
-
r: source ? url : undefined,
|
|
1205
|
-
// fetchPromise
|
|
1206
|
-
f: undefined,
|
|
1207
|
-
// source
|
|
1208
|
-
S: source,
|
|
1209
|
-
// linkPromise
|
|
1210
|
-
L: undefined,
|
|
1211
|
-
// analysis
|
|
1212
|
-
a: undefined,
|
|
1213
|
-
// deps
|
|
1214
|
-
d: undefined,
|
|
1215
|
-
// blobUrl
|
|
1216
|
-
b: undefined,
|
|
1217
|
-
// shellUrl
|
|
1218
|
-
s: undefined,
|
|
1219
|
-
// needsShim: does it fail execution in the current native loader?
|
|
1220
|
-
n: false,
|
|
1221
|
-
// shouldShim: does it need to be loaded by the polyfill loader?
|
|
1222
|
-
N: false,
|
|
1223
|
-
// type
|
|
1224
|
-
t: null,
|
|
1225
|
-
// meta
|
|
1226
|
-
m: null
|
|
1227
|
-
};
|
|
1228
|
-
load.f = (async () => {
|
|
1229
|
-
if (load.S === undefined) {
|
|
1230
|
-
// preload fetch options override fetch options (race)
|
|
1231
|
-
({ url: load.r, source: load.S, type: load.t } = await (fetchCache[url] || fetchModule(url, fetchOpts, parent)));
|
|
1232
|
-
if (
|
|
1233
|
-
!load.n &&
|
|
1234
|
-
load.t !== 'js' &&
|
|
1235
|
-
!shimMode &&
|
|
1236
|
-
((load.t === 'css' && !supportsCssType) ||
|
|
1237
|
-
(load.t === 'json' && !supportsJsonType) ||
|
|
1238
|
-
(load.t === 'wasm' && !supportsWasmInstancePhase && !supportsWasmSourcePhase) ||
|
|
1239
|
-
load.t === 'ts')
|
|
1240
|
-
) {
|
|
1241
|
-
load.n = true;
|
|
1242
|
-
}
|
|
1243
|
-
}
|
|
1244
|
-
try {
|
|
1245
|
-
load.a = parse(load.S, load.u);
|
|
1246
|
-
} catch (e) {
|
|
1247
|
-
throwError(e);
|
|
1248
|
-
load.a = [[], [], false];
|
|
1249
|
-
}
|
|
1250
|
-
return load;
|
|
1251
|
-
})();
|
|
1252
|
-
return load;
|
|
1253
|
-
};
|
|
1254
|
-
|
|
1255
|
-
const featErr = feat =>
|
|
1256
|
-
Error(
|
|
1257
|
-
`${feat} feature must be enabled via <script type="esms-options">{ "polyfillEnable": ["${feat}"] }<${''}/script>`
|
|
1258
|
-
);
|
|
1259
|
-
|
|
1260
|
-
const linkLoad = (load, fetchOpts) => {
|
|
1261
|
-
if (load.L) return;
|
|
1262
|
-
load.L = load.f.then(() => {
|
|
1263
|
-
let childFetchOpts = fetchOpts;
|
|
1264
|
-
load.d = load.a[0]
|
|
1265
|
-
.map(({ n, d, t, a, se }) => {
|
|
1266
|
-
const phaseImport = t >= 4;
|
|
1267
|
-
const sourcePhase = phaseImport && t < 6;
|
|
1268
|
-
if (phaseImport) {
|
|
1269
|
-
if (!shimMode && (sourcePhase ? !wasmSourcePhaseEnabled : !deferPhaseEnabled))
|
|
1270
|
-
throw featErr(sourcePhase ? 'wasm-module-sources' : 'import-defer');
|
|
1271
|
-
if (!sourcePhase || !supportsWasmSourcePhase) load.n = true;
|
|
1272
|
-
}
|
|
1273
|
-
let source = undefined;
|
|
1274
|
-
if (a > 0 && !shimMode && nativePassthrough) {
|
|
1275
|
-
const assertion = load.S.slice(a, se - 1);
|
|
1276
|
-
// no need to fetch JSON/CSS if supported, since it's a leaf node, we'll just strip the assertion syntax
|
|
1277
|
-
if (assertion.includes('json')) {
|
|
1278
|
-
if (supportsJsonType) source = '';
|
|
1279
|
-
else load.n = true;
|
|
1280
|
-
} else if (assertion.includes('css')) {
|
|
1281
|
-
if (supportsCssType) source = '';
|
|
1282
|
-
else load.n = true;
|
|
1283
|
-
}
|
|
1284
|
-
}
|
|
1285
|
-
if (d !== -1 || !n) return;
|
|
1286
|
-
const resolved = resolve(n, load.r || load.u);
|
|
1287
|
-
if (resolved.n || hasCustomizationHooks) load.n = true;
|
|
1288
|
-
if (d >= 0 || resolved.N) load.N = true;
|
|
1289
|
-
if (d !== -1) return;
|
|
1290
|
-
if (skip && skip(resolved.r) && !sourcePhase) return { l: { b: resolved.r }, s: false };
|
|
1291
|
-
if (childFetchOpts.integrity) childFetchOpts = { ...childFetchOpts, integrity: undefined };
|
|
1292
|
-
const child = { l: getOrCreateLoad(resolved.r, childFetchOpts, load.r, source), s: sourcePhase };
|
|
1293
|
-
// assertion case -> inline the CSS / JSON URL directly
|
|
1294
|
-
if (source === '') child.l.b = child.l.u;
|
|
1295
|
-
if (!child.s) linkLoad(child.l, fetchOpts);
|
|
1296
|
-
// load, sourcePhase
|
|
1297
|
-
return child;
|
|
1298
|
-
})
|
|
1299
|
-
.filter(l => l);
|
|
1300
|
-
});
|
|
1301
|
-
};
|
|
1302
|
-
|
|
1303
|
-
const processScriptsAndPreloads = () => {
|
|
1304
|
-
for (const link of document.querySelectorAll(shimMode ? 'link[rel=modulepreload-shim]' : 'link[rel=modulepreload]')) {
|
|
1305
|
-
if (!link.ep) processPreload(link);
|
|
1306
|
-
}
|
|
1307
|
-
for (const script of document.querySelectorAll('script[type]')) {
|
|
1308
|
-
if (script.type === 'importmap' + (shimMode ? '-shim' : '')) {
|
|
1309
|
-
if (!script.ep) processImportMap(script);
|
|
1310
|
-
} else if (script.type === 'module' + (shimMode ? '-shim' : '')) {
|
|
1311
|
-
legacyAcceptingImportMaps = false;
|
|
1312
|
-
if (!script.ep) processScript(script);
|
|
1313
|
-
}
|
|
1314
|
-
}
|
|
1315
|
-
};
|
|
1316
|
-
|
|
1317
|
-
const getFetchOpts = script => {
|
|
1318
|
-
const fetchOpts = {};
|
|
1319
|
-
if (script.integrity) fetchOpts.integrity = script.integrity;
|
|
1320
|
-
if (script.referrerPolicy) fetchOpts.referrerPolicy = script.referrerPolicy;
|
|
1321
|
-
if (script.fetchPriority) fetchOpts.priority = script.fetchPriority;
|
|
1322
|
-
if (script.crossOrigin === 'use-credentials') fetchOpts.credentials = 'include';
|
|
1323
|
-
else if (script.crossOrigin === 'anonymous') fetchOpts.credentials = 'omit';
|
|
1324
|
-
else fetchOpts.credentials = 'same-origin';
|
|
1325
|
-
return fetchOpts;
|
|
1326
|
-
};
|
|
1327
|
-
|
|
1328
|
-
let lastStaticLoadPromise = Promise.resolve();
|
|
1329
|
-
|
|
1330
|
-
let domContentLoaded = false;
|
|
1331
|
-
let domContentLoadedCnt = 1;
|
|
1332
|
-
const domContentLoadedCheck = m => {
|
|
1333
|
-
if (m === undefined) {
|
|
1334
|
-
if (domContentLoaded) return;
|
|
1335
|
-
domContentLoaded = true;
|
|
1336
|
-
domContentLoadedCnt--;
|
|
1337
|
-
}
|
|
1338
|
-
if (--domContentLoadedCnt === 0 && !noLoadEventRetriggers && (shimMode || !baselineSupport)) {
|
|
1339
|
-
document.removeEventListener('DOMContentLoaded', domContentLoadedEvent);
|
|
1340
|
-
document.dispatchEvent(new Event('DOMContentLoaded'));
|
|
1341
|
-
}
|
|
1342
|
-
};
|
|
1343
|
-
let loadCnt = 1;
|
|
1344
|
-
const loadCheck = () => {
|
|
1345
|
-
if (--loadCnt === 0 && !noLoadEventRetriggers && (shimMode || !baselineSupport)) {
|
|
1346
|
-
window.removeEventListener('load', loadEvent);
|
|
1347
|
-
window.dispatchEvent(new Event('load'));
|
|
1348
|
-
}
|
|
1349
|
-
};
|
|
1350
|
-
|
|
1351
|
-
const domContentLoadedEvent = async () => {
|
|
1352
|
-
await initPromise;
|
|
1353
|
-
domContentLoadedCheck();
|
|
1354
|
-
};
|
|
1355
|
-
const loadEvent = async () => {
|
|
1356
|
-
await initPromise;
|
|
1357
|
-
domContentLoadedCheck();
|
|
1358
|
-
loadCheck();
|
|
1359
|
-
};
|
|
1360
|
-
|
|
1361
|
-
// this should always trigger because we assume es-module-shims is itself a domcontentloaded requirement
|
|
1362
|
-
if (hasDocument) {
|
|
1363
|
-
document.addEventListener('DOMContentLoaded', domContentLoadedEvent);
|
|
1364
|
-
window.addEventListener('load', loadEvent);
|
|
1365
|
-
}
|
|
1366
|
-
|
|
1367
|
-
const readyListener = async () => {
|
|
1368
|
-
await initPromise;
|
|
1369
|
-
processScriptsAndPreloads();
|
|
1370
|
-
if (document.readyState === 'complete') {
|
|
1371
|
-
readyStateCompleteCheck();
|
|
1372
|
-
}
|
|
1373
|
-
};
|
|
1374
|
-
|
|
1375
|
-
let readyStateCompleteCnt = 1;
|
|
1376
|
-
const readyStateCompleteCheck = () => {
|
|
1377
|
-
if (--readyStateCompleteCnt === 0) {
|
|
1378
|
-
domContentLoadedCheck();
|
|
1379
|
-
if (!noLoadEventRetriggers && (shimMode || !baselineSupport)) {
|
|
1380
|
-
document.removeEventListener('readystatechange', readyListener);
|
|
1381
|
-
document.dispatchEvent(new Event('readystatechange'));
|
|
1382
|
-
}
|
|
1383
|
-
}
|
|
1384
|
-
};
|
|
1385
|
-
|
|
1386
|
-
const hasNext = script => script.nextSibling || (script.parentNode && hasNext(script.parentNode));
|
|
1387
|
-
const epCheck = (script, ready) =>
|
|
1388
|
-
script.ep ||
|
|
1389
|
-
(!ready && ((!script.src && !script.innerHTML) || !hasNext(script))) ||
|
|
1390
|
-
script.getAttribute('noshim') !== null ||
|
|
1391
|
-
!(script.ep = true);
|
|
1392
|
-
|
|
1393
|
-
const processImportMap = (script, ready = readyStateCompleteCnt > 0) => {
|
|
1394
|
-
if (epCheck(script, ready)) return;
|
|
1395
|
-
// we dont currently support external import maps in polyfill mode to match native
|
|
1396
|
-
if (script.src) {
|
|
1397
|
-
if (!shimMode) return;
|
|
1398
|
-
importMapSrc = true;
|
|
1399
|
-
}
|
|
1400
|
-
importMapPromise = importMapPromise
|
|
1401
|
-
.then(async () => {
|
|
1402
|
-
composedImportMap = resolveAndComposeImportMap(
|
|
1403
|
-
script.src ? await (await doFetch(script.src, getFetchOpts(script))).json() : JSON.parse(script.innerHTML),
|
|
1404
|
-
script.src || baseUrl,
|
|
1405
|
-
composedImportMap
|
|
1406
|
-
);
|
|
1407
|
-
})
|
|
1408
|
-
.catch(e => {
|
|
1409
|
-
if (e instanceof SyntaxError)
|
|
1410
|
-
e = new Error(`Unable to parse import map ${e.message} in: ${script.src || script.innerHTML}`);
|
|
1411
|
-
throwError(e);
|
|
1412
|
-
});
|
|
1413
|
-
if (!firstImportMap && legacyAcceptingImportMaps) importMapPromise.then(() => (firstImportMap = composedImportMap));
|
|
1414
|
-
if (!legacyAcceptingImportMaps && !multipleImportMaps) {
|
|
1415
|
-
multipleImportMaps = true;
|
|
1416
|
-
if (!shimMode && baselineSupport && !supportsMultipleImportMaps) {
|
|
1417
|
-
baselineSupport = false;
|
|
1418
|
-
if (hasDocument) attachMutationObserver();
|
|
1419
|
-
}
|
|
1420
|
-
}
|
|
1421
|
-
legacyAcceptingImportMaps = false;
|
|
1422
|
-
};
|
|
1423
|
-
|
|
1424
|
-
const processScript = (script, ready = readyStateCompleteCnt > 0) => {
|
|
1425
|
-
if (epCheck(script, ready)) return;
|
|
1426
|
-
// does this load block readystate complete
|
|
1427
|
-
const isBlockingReadyScript = script.getAttribute('async') === null && readyStateCompleteCnt > 0;
|
|
1428
|
-
// does this load block DOMContentLoaded
|
|
1429
|
-
const isDomContentLoadedScript = domContentLoadedCnt > 0;
|
|
1430
|
-
const isLoadScript = loadCnt > 0;
|
|
1431
|
-
if (isLoadScript) loadCnt++;
|
|
1432
|
-
if (isBlockingReadyScript) readyStateCompleteCnt++;
|
|
1433
|
-
if (isDomContentLoadedScript) domContentLoadedCnt++;
|
|
1434
|
-
let loadPromise;
|
|
1435
|
-
const ts = script.lang === 'ts';
|
|
1436
|
-
if (ts && !script.src) {
|
|
1437
|
-
loadPromise = Promise.resolve(esmsTsTransform || initTs())
|
|
1438
|
-
.then(() => {
|
|
1439
|
-
const transformed = esmsTsTransform(script.innerHTML, baseUrl);
|
|
1440
|
-
if (transformed !== undefined) {
|
|
1441
|
-
onpolyfill();
|
|
1442
|
-
firstPolyfillLoad = false;
|
|
1443
|
-
}
|
|
1444
|
-
return topLevelLoad(
|
|
1445
|
-
script.src || baseUrl,
|
|
1446
|
-
baseUrl,
|
|
1447
|
-
getFetchOpts(script),
|
|
1448
|
-
transformed === undefined ? script.innerHTML : transformed,
|
|
1449
|
-
!shimMode && transformed === undefined,
|
|
1450
|
-
isBlockingReadyScript && lastStaticLoadPromise,
|
|
1451
|
-
'ts'
|
|
1452
|
-
);
|
|
1453
|
-
})
|
|
1454
|
-
.catch(throwError);
|
|
1455
|
-
} else {
|
|
1456
|
-
loadPromise = topLevelLoad(
|
|
1457
|
-
script.src || baseUrl,
|
|
1458
|
-
baseUrl,
|
|
1459
|
-
getFetchOpts(script),
|
|
1460
|
-
!script.src ? script.innerHTML : undefined,
|
|
1461
|
-
!shimMode,
|
|
1462
|
-
isBlockingReadyScript && lastStaticLoadPromise,
|
|
1463
|
-
ts ? 'ts' : undefined
|
|
1464
|
-
).catch(throwError);
|
|
1465
|
-
}
|
|
1466
|
-
if (!noLoadEventRetriggers) loadPromise.then(() => script.dispatchEvent(new Event('load')));
|
|
1467
|
-
if (isBlockingReadyScript && !ts) {
|
|
1468
|
-
lastStaticLoadPromise = loadPromise.then(readyStateCompleteCheck);
|
|
1469
|
-
}
|
|
1470
|
-
if (isDomContentLoadedScript) loadPromise.then(domContentLoadedCheck);
|
|
1471
|
-
if (isLoadScript) loadPromise.then(loadCheck);
|
|
1472
|
-
};
|
|
1473
|
-
|
|
1474
|
-
const fetchCache = {};
|
|
1475
|
-
const processPreload = link => {
|
|
1476
|
-
link.ep = true;
|
|
1477
|
-
initPromise.then(() => {
|
|
1478
|
-
if (baselineSupport && !shimMode) return;
|
|
1479
|
-
if (fetchCache[link.href]) return;
|
|
1480
|
-
fetchCache[link.href] = fetchModule(link.href, getFetchOpts(link));
|
|
1481
|
-
});
|
|
628
|
+
/* es-module-lexer (minimal) 2.3.1 */
|
|
629
|
+
let e,a,r,i=2<<19;const s=1===new Uint8Array(new Uint16Array([1]).buffer)[0]?function(e,a){const r=e.length;let i=0;for(;i<r;)a[i]=e.charCodeAt(i++);}:function(e,a){const r=e.length;let i=0;for(;i<r;){const r=e.charCodeAt(i);a[i++]=(255&r)<<8|r>>>8;}},f="etaourceeferromsyncunctionlassvoyiedelecontininstantybreareturdebuggeawaithrwhileforifcatcfinallelsxportport";let c$1,t,n;function parse(k,l="@"){c$1=k,t=l;const u=2*c$1.length+(2<<18);if(u>i||!e){for(;u>i;)i*=2;a=new ArrayBuffer(i),s(f,new Uint16Array(a,16,108)),e=function(e,a,r){"use asm";var i=new e.Int8Array(r),s=new e.Int16Array(r),f=new e.Int32Array(r),c=new e.Uint8Array(r),t=new e.Uint16Array(r),n=1040;function b(e){e=e|0;var a=0,r=0,c=0,t=0,n=0,b=0,k=0,o=0,w=0,g=0,p=0,y=0,m=0,O=0,T=0;y=s[398]|0;a=f[71]|0;f[68]=a;k=a;p=a;o=y;g=0;e:while(1){r=f[72]|0;t=o<<16>>16==y<<16>>16;c=g&e;b=a;while(1){n=b+2|0;if(b>>>0>=r>>>0){a=0;w=100;break e}a=s[n>>1]|0;if(!(M(a)|0)){if(t){switch(a<<16>>16){case 125:case 93:case 41:case 59:case 44:{w=100;break e}default:{}}if(c?se(a)|0:0){w=100;break e}}if(!(se(a)|0))break}b=n;}f[71]=n;a:do{switch(a<<16>>16){case 101:{if((o<<16>>16==0?Q(n)|0:0)?(S(b+4|0,214,10)|0)==0:0){u();w=89;}else w=89;break}case 105:{if(((s[b+4>>1]|0)==109?Q(n)|0:0)?(S(b+6|0,224,8)|0)==0:0){l();w=89;}else w=89;break}case 99:{if((((s[b+4>>1]|0)==108?Q(n)|0:0)?(S(b+6|0,70,6)|0)==0:0)?L(s[b+12>>1]|0)|0:0){i[800]=1;w=89;}else w=89;break}case 40:{b=f[69]|0;w=o&65535;f[b+(w<<3)>>2]=1;s[398]=o+1<<16>>16;f[b+(w<<3)+4>>2]=k;w=89;break}case 91:{b=f[69]|0;w=o&65535;f[b+(w<<3)>>2]=8;s[398]=o+1<<16>>16;f[b+(w<<3)+4>>2]=k;w=89;break}case 93:if(!(o<<16>>16)){ee();break a}else {s[398]=o+-1<<16>>16;w=89;break a}case 44:{r=s[397]|0;if((!(o<<16>>16==0|r<<16>>16==0)?(f[(f[69]|0)+((o&65535)+-1<<3)>>2]|0)==5:0)?(m=f[(f[70]|0)+((r&65535)+-1<<2)>>2]|0,(f[m+4>>2]|0)==0):0){f[m+4>>2]=p+2;f[71]=b+4;v(1)|0;w=f[71]|0;f[m+16>>2]=w;f[71]=w+-2;w=89;}else w=89;break}case 41:{if(!(o<<16>>16)){ee();break a}w=o+-1<<16>>16;s[398]=w;r=s[397]|0;if(r<<16>>16!=0?(f[(f[69]|0)+((w&65535)<<3)>>2]|0)==5:0){c=f[(f[70]|0)+((r&65535)+-1<<2)>>2]|0;if(!(f[c+4>>2]|0))f[c+4>>2]=p+2;f[c+12>>2]=b+4;s[397]=r+-1<<16>>16;w=89;}else w=89;break}case 123:{w=f[62]|0;do{if((s[p>>1]|0)==41&(w|0)!=0?(f[w+12>>2]|0)==(p+2|0):0){r=f[63]|0;f[62]=r;if(!r){f[58]=0;break}else {f[r+32>>2]=0;break}}}while(0);b=f[69]|0;w=o&65535;f[b+(w<<3)>>2]=(i[800]|0)==0?2:6;s[398]=o+1<<16>>16;f[b+(w<<3)+4>>2]=k;i[800]=0;w=89;break}case 125:{if(!(o<<16>>16)){ee();break a}k=f[69]|0;w=o+-1<<16>>16;s[398]=w;if((f[k+((w&65535)<<3)>>2]|0)==4){d();w=89;}else w=89;break}case 34:case 39:{A(a);w=89;break}case 47:switch(s[b+4>>1]|0){case 47:{F();break a}case 42:{x(1);break a}default:{c=s[p>>1]|0;r:do{if(!($(c)|0)){if(!(c<<16>>16==41?K(f[(f[69]|0)+((o&65535)<<3)+4>>2]|0)|0:0))w=62;}else switch(c<<16>>16){case 46:if(((s[p+-2>>1]|0)+-48&65535)<10){w=62;break r}else break r;case 43:if((s[p+-2>>1]|0)==43){w=62;break r}else break r;case 45:if((s[p+-2>>1]|0)==45){w=62;break r}else break r;default:break r}}while(0);r:do{if((w|0)==62){w=0;if(o<<16>>16!=0?(O=f[69]|0,T=(o&65535)+-1|0,c<<16>>16==102?(f[O+(T<<3)>>2]|0)==1:0):0){if(((s[p+-2>>1]|0)==111?C(p+-4|0)|0:0)?B(f[O+(T<<3)+4>>2]|0,178,3)|0:0)break}else w=67;if((w|0)==67?(0,c<<16>>16==125):0){t=f[69]|0;r=o&65535;if(U(f[t+(r<<3)+4>>2]|0)|0)break;if((f[t+(r<<3)>>2]|0)==6)break}if(!(h(p)|0)){switch(c<<16>>16){case 0:break r;case 47:{if(i[799]|0)break r;break}default:{}}w=f[64]|0;if((w|0?p>>>0>=(f[w>>2]|0)>>>0:0)?p>>>0<=(f[w+4>>2]|0)>>>0:0){I();i[799]=0;w=89;break a}t=f[3]|0;r=p;do{if(r>>>0<=t>>>0)break;r=r+-2|0;f[68]=r;c=s[r>>1]|0;}while(!(D(c)|0));if(M(c)|0){do{if(r>>>0<=t>>>0)break;r=r+-2|0;f[68]=r;}while(M(s[r>>1]|0)|0);if(q(r)|0){I();i[799]=0;w=89;break a}}i[799]=1;w=89;break a}}}while(0);I();i[799]=0;w=89;break a}}case 96:{b=f[69]|0;w=o&65535;f[b+(w<<3)+4>>2]=k;s[398]=o+1<<16>>16;f[b+(w<<3)>>2]=3;d();w=89;break}default:w=89;}}while(0);if((w|0)==89){w=0;f[68]=f[71];}if(i[798]|0){a=0;break}r=f[68]|0;a:do{if((r|0)==(p|0))if(g&((s[398]|0)==y<<16>>16&e)){a=s[f[71]>>1]|0;if(se(a)|0)break e;else a=1;}else a=g;else {if(a<<16>>16==47){a=(i[799]|0)==0;break}if(G(a)|0)a=1;else {switch(a<<16>>16){case 96:case 34:case 39:case 41:case 93:case 125:{a=1;break a}default:{}}a=0;}}}while(0);k=r;p=r;o=s[398]|0;g=a;a=f[71]|0;}if((w|0)==100)f[71]=n;return a|0}function k(){var e=0,a=0,r=0,c=0,t=0,b=0,k=0,o=0,w=0;w=n;n=n+10240|0;s[397]=0;s[398]=0;f[68]=f[2];i[799]=0;f[67]=0;i[798]=0;f[69]=w+2048;f[70]=w;i[800]=0;r=(f[3]|0)+-2|0;f[71]=r;e=r+(f[65]<<1)|0;f[72]=e;e:while(1){a=r+2|0;f[71]=a;if(r>>>0>=e>>>0){c=85;break}e=s[a>>1]|0;a:do{switch(e<<16>>16){case 9:case 10:case 11:case 12:case 13:case 32:break;case 101:{if(((s[398]|0)==0?Q(a)|0:0)?(S(r+4|0,214,10)|0)==0:0){u();c=84;}else c=84;break}case 105:{if(((s[r+4>>1]|0)==109?Q(a)|0:0)?(S(r+6|0,224,8)|0)==0:0){l();c=84;}else c=84;break}case 99:{if((((s[r+4>>1]|0)==108?Q(a)|0:0)?(S(r+6|0,70,6)|0)==0:0)?L(s[r+12>>1]|0)|0:0){i[800]=1;c=84;}else c=84;break}case 40:{r=f[69]|0;c=s[398]|0;f[r+((c&65535)<<3)>>2]=1;a=f[68]|0;s[398]=c+1<<16>>16;f[r+((c&65535)<<3)+4>>2]=a;c=84;break}case 91:{r=f[69]|0;c=s[398]|0;f[r+((c&65535)<<3)>>2]=8;a=f[68]|0;s[398]=c+1<<16>>16;f[r+((c&65535)<<3)+4>>2]=a;c=84;break}case 93:{e=s[398]|0;if(!(e<<16>>16)){c=21;break e}s[398]=e+-1<<16>>16;c=84;break}case 44:{e=s[397]|0;if(((e<<16>>16!=0?(t=s[398]|0,t<<16>>16!=0):0)?(f[(f[69]|0)+((t&65535)+-1<<3)>>2]|0)==5:0)?(b=f[(f[70]|0)+((e&65535)+-1<<2)>>2]|0,(f[b+4>>2]|0)==0):0){f[b+4>>2]=(f[68]|0)+2;f[71]=r+4;v(1)|0;c=f[71]|0;f[b+16>>2]=c;f[71]=c+-2;c=84;}else c=84;break}case 41:{e=s[398]|0;if(!(e<<16>>16)){c=29;break e}s[398]=e+-1<<16>>16;a=s[397]|0;if(a<<16>>16!=0?(f[(f[69]|0)+((e+-1&65535)<<3)>>2]|0)==5:0){e=f[(f[70]|0)+((a&65535)+-1<<2)>>2]|0;if(!(f[e+4>>2]|0))f[e+4>>2]=(f[68]|0)+2;f[e+12>>2]=r+4;s[397]=a+-1<<16>>16;c=84;}else c=84;break}case 123:{e=f[68]|0;c=f[62]|0;do{if((s[e>>1]|0)==41&(c|0)!=0?(f[c+12>>2]|0)==(e+2|0):0){a=f[63]|0;f[62]=a;if(!a){f[58]=0;break}else {f[a+32>>2]=0;break}}}while(0);r=f[69]|0;c=s[398]|0;f[r+((c&65535)<<3)>>2]=(i[800]|0)==0?2:6;s[398]=c+1<<16>>16;f[r+((c&65535)<<3)+4>>2]=e;i[800]=0;c=84;break}case 125:{e=s[398]|0;if(!(e<<16>>16)){c=42;break e}c=f[69]|0;s[398]=e+-1<<16>>16;if((f[c+((e+-1&65535)<<3)>>2]|0)==4){d();c=84;}else c=84;break}case 34:case 39:{A(e);c=84;break}case 47:switch(s[r+4>>1]|0){case 47:{F();break a}case 42:{x(1);break a}default:{e=f[68]|0;a=s[e>>1]|0;r:do{if(!($(a)|0))if(a<<16>>16==41){r=s[398]|0;if(!(K(f[(f[69]|0)+((r&65535)<<3)+4>>2]|0)|0))c=57;}else c=56;else switch(a<<16>>16){case 46:if(((s[e+-2>>1]|0)+-48&65535)<10){c=56;break r}else break r;case 43:if((s[e+-2>>1]|0)==43){c=56;break r}else break r;case 45:if((s[e+-2>>1]|0)==45){c=56;break r}else break r;default:break r}}while(0);if((c|0)==56){r=s[398]|0;c=57;}r:do{if((c|0)==57){c=0;if(r<<16>>16!=0?(k=f[69]|0,o=(r&65535)+-1|0,a<<16>>16==102?(f[k+(o<<3)>>2]|0)==1:0):0){if(((s[e+-2>>1]|0)==111?C(e+-4|0)|0:0)?B(f[k+(o<<3)+4>>2]|0,178,3)|0:0)break}else c=62;if((c|0)==62?(0,a<<16>>16==125):0){c=f[69]|0;r=r&65535;if(U(f[c+(r<<3)+4>>2]|0)|0)break;if((f[c+(r<<3)>>2]|0)==6)break}if(!(h(e)|0)){switch(a<<16>>16){case 0:break r;case 47:{if(i[799]|0)break r;break}default:{}}c=f[64]|0;if((c|0?e>>>0>=(f[c>>2]|0)>>>0:0)?e>>>0<=(f[c+4>>2]|0)>>>0:0){I();i[799]=0;c=84;break a}r=f[3]|0;do{if(e>>>0<=r>>>0)break;e=e+-2|0;f[68]=e;a=s[e>>1]|0;}while(!(D(a)|0));if(M(a)|0){do{if(e>>>0<=r>>>0)break;e=e+-2|0;f[68]=e;}while(M(s[e>>1]|0)|0);if(q(e)|0){I();i[799]=0;c=84;break a}}i[799]=1;c=84;break a}}}while(0);I();i[799]=0;c=84;break a}}case 96:{r=f[69]|0;c=s[398]|0;f[r+((c&65535)<<3)+4>>2]=f[68];s[398]=c+1<<16>>16;f[r+((c&65535)<<3)>>2]=3;d();c=84;break}default:c=84;}}while(0);if((c|0)==84){c=0;f[68]=f[71];}r=f[71]|0;e=f[72]|0;}if((c|0)==21){ee();e=0;}else if((c|0)==29){ee();e=0;}else if((c|0)==42){ee();e=0;}else if((c|0)==85)e=(i[798]|0)==0?(s[397]|s[398])<<16>>16==0:0;n=w;return e|0}function l(){var e=0,a=0,r=0,c=0,t=0,n=0;n=f[71]|0;f[71]=n+12;e=v(1)|0;r=f[71]|0;e:do{if(e<<16>>16!=46){if(!(e<<16>>16==115&r>>>0>(n+12|0)>>>0)){if(!(e<<16>>16==100&r>>>0>(n+10|0)>>>0)){r=0;t=28;break}if(S(r+2|0,32,8)|0){a=r;e=100;r=0;t=60;break}if(!(L(s[r+10>>1]|0)|0)){a=r;e=100;r=0;t=60;break}f[71]=r+10;e=v(1)|0;if(e<<16>>16==42){e=42;c=2;t=62;break}f[71]=r;r=0;t=28;break}if((S(r+2|0,22,10)|0)==0?L(s[r+12>>1]|0)|0:0){f[71]=r+12;e=v(1)|0;a=f[71]|0;if((a|0)!=(r+12|0)){if(e<<16>>16!=102){r=1;t=28;break}if(S(a+2|0,40,6)|0){e=102;r=1;t=60;break}if(!(D(s[a+8>>1]|0)|0)){e=102;r=1;t=60;break}}f[71]=r;r=0;t=28;}else {a=r;e=115;r=0;t=60;}}else {f[71]=r+2;switch((v(1)|0)<<16>>16){case 109:{e=f[71]|0;if(S(e+2|0,16,6)|0)break e;a=f[68]|0;if(!(N(a)|0)?(s[a>>1]|0)==46:0)break e;g(n,n,e+8|0,2);break e}case 115:{e=f[71]|0;if(S(e+2|0,22,10)|0)break e;a=f[68]|0;if(!(N(a)|0)?(s[a>>1]|0)==46:0)break e;f[71]=e+12;e=v(1)|0;r=1;t=28;break e}case 100:{e=f[71]|0;if(S(e+2|0,32,8)|0)break e;a=f[68]|0;if(!(N(a)|0)?(s[a>>1]|0)==46:0)break e;f[71]=e+10;e=v(1)|0;r=2;t=28;break e}default:break e}}}while(0);e:do{if((t|0)==28){if(e<<16>>16==40){a=f[69]|0;c=s[398]|0;f[a+((c&65535)<<3)>>2]=5;e=f[71]|0;s[398]=c+1<<16>>16;f[a+((c&65535)<<3)+4>>2]=e;if((s[f[68]>>1]|0)==46)break;f[71]=e+2;a=v(1)|0;g(n,f[71]|0,0,e);if(!r)e=f[62]|0;else {e=f[62]|0;f[e+28>>2]=(r|0)==1?5:7;}c=f[70]|0;n=s[397]|0;s[397]=n+1<<16>>16;f[c+((n&65535)<<2)>>2]=e;switch(a<<16>>16){case 39:{A(39);break}case 34:{A(34);break}case 96:{if(!(y()|0))t=37;break}default:t=37;}if((t|0)==37){f[71]=(f[71]|0)+-2;break}e=(f[71]|0)+2|0;f[71]=e;switch((v(1)|0)<<16>>16){case 44:{f[71]=(f[71]|0)+2;v(1)|0;c=f[62]|0;f[c+4>>2]=e;n=f[71]|0;f[c+16>>2]=n;i[c+24>>0]=1;f[71]=n+-2;break e}case 41:{s[398]=(s[398]|0)+-1<<16>>16;n=f[62]|0;f[n+4>>2]=e;f[n+12>>2]=(f[71]|0)+2;i[n+24>>0]=1;s[397]=(s[397]|0)+-1<<16>>16;break e}default:{f[71]=(f[71]|0)+-2;break e}}}if(!((r|0)==0&e<<16>>16==123)){switch(e<<16>>16){case 42:case 39:case 34:{c=r;t=62;break e}default:{}}a=f[71]|0;t=60;break}e=f[71]|0;if(s[398]|0){f[71]=e+-2;break}while(1){if(e>>>0>=(f[72]|0)>>>0)break;e=v(1)|0;if(!(ae(e)|0)){if(e<<16>>16==125){t=50;break}}else A(e);e=(f[71]|0)+2|0;f[71]=e;}if((t|0)==50)f[71]=(f[71]|0)+2;c=(v(1)|0)<<16>>16==102;e=f[71]|0;if(c?S(e+2|0,40,6)|0:0){ee();break}f[71]=e+8;e=v(1)|0;if(ae(e)|0){w(n,e,0);break}else {ee();break}}}while(0);if((t|0)==60)if((a|0)==(n+12|0))f[71]=n+10;else {c=r;t=62;}do{if((t|0)==62){if(!((e<<16>>16==42|(c|0)!=2)&(s[398]|0)==0)){f[71]=(f[71]|0)+-2;break}e=f[72]|0;a=f[71]|0;while(1){if(a>>>0>=e>>>0){t=69;break}r=s[a>>1]|0;if(ae(r)|0){t=67;break}t=a+2|0;f[71]=t;a=t;}if((t|0)==67){w(n,r,c);break}else if((t|0)==69){ee();break}}}while(0);return}function u(){var e=0,a=0,r=0,i=0,c=0,t=0,n=0,k=0,l=0,u=0;k=f[71]|0;l=f[64]|0;f[71]=k+12;a=v(1)|0;e=f[71]|0;if(!((e|0)==(k+12|0)?!(O(a)|0):0))u=3;e:do{if((u|0)==3){a:do{switch(a<<16>>16){case 123:{f[71]=e+2;e=v(1)|0;r=f[71]|0;while(1){if(ae(e)|0){A(e);e=(f[71]|0)+2|0;f[71]=e;}else {H(e)|0;e=f[71]|0;}v(1)|0;e=p(r,e)|0;if(e<<16>>16==44){f[71]=(f[71]|0)+2;e=v(1)|0;}a=r;r=f[71]|0;if(e<<16>>16==125){u=15;break}if((r|0)==(a|0)){u=12;break}if(r>>>0>(f[72]|0)>>>0){u=14;break}}if((u|0)==12){ee();break e}else if((u|0)==14){ee();break e}else if((u|0)==15){f[71]=r+2;u=49;break a}break}case 42:{f[71]=e+2;v(1)|0;u=f[71]|0;p(u,u)|0;u=49;break}case 100:{f[71]=e+14;switch((v(1)|0)<<16>>16){case 97:{a=f[71]|0;if((S(a+2|0,46,8)|0)==0?M(s[a+10>>1]|0)|0:0){f[71]=a+10;v(0)|0;u=21;}break}case 102:{u=21;break}case 99:{a=f[71]|0;if(((S(a+2|0,68,8)|0)==0?(l=s[a+10>>1]|0,L(l)|0|l<<16>>16==123):0)?(f[71]=a+10,r=v(1)|0,r<<16>>16!=123):0){n=r;u=30;}break}default:{}}r:do{if((u|0)==21?(i=f[71]|0,(S(i+2|0,54,14)|0)==0):0){a=s[i+16>>1]|0;if(!(L(a)|0))switch(a<<16>>16){case 40:case 42:break;default:break r}f[71]=i+16;a=v(1)|0;if(a<<16>>16==42){f[71]=(f[71]|0)+2;a=v(1)|0;}if(a<<16>>16!=40){n=a;u=30;}}}while(0);if((u|0)==30?(c=f[71]|0,H(n)|0,t=f[71]|0,t>>>0>c>>>0):0){E(e,e+14|0,c,t);f[71]=(f[71]|0)+-2;break e}E(e,e+14|0,0,0);f[71]=e+12;break e}case 97:{f[71]=e+10;v(0)|0;e=f[71]|0;u=34;break}case 102:{u=34;break}case 99:{if((S(e+2|0,68,8)|0)==0?D(s[e+10>>1]|0)|0:0){f[71]=e+10;u=v(1)|0;l=f[71]|0;H(u)|0;u=f[71]|0;E(l,u,l,u);f[71]=(f[71]|0)+-2;break e}f[71]=e+4;e=e+4|0;u=41;break}case 108:case 118:{u=41;break}default:break e}}while(0);if((u|0)==34){f[71]=e+16;e=v(1)|0;if(e<<16>>16==42){f[71]=(f[71]|0)+2;e=v(1)|0;}l=f[71]|0;H(e)|0;u=f[71]|0;E(l,u,l,u);f[71]=(f[71]|0)+-2;break}else if((u|0)==41){f[71]=e+6;while(1){a=v(1)|0;e=f[71]|0;if(e>>>0>(f[72]|0)>>>0)break;a=P(a)|0;if((f[71]|0)==(e|0))break;if(a<<16>>16==61)a=b(1)|0;e=f[71]|0;if(a<<16>>16!=44)break;f[71]=e+2;}f[71]=e+-2;break}else if((u|0)==49){u=(v(1)|0)<<16>>16==102;e=f[71]|0;if(u?(S(e+2|0,40,6)|0)==0:0){f[71]=e+8;w(k,v(1)|0,0);e=(l|0)==0?236:l+16|0;while(1){e=f[e>>2]|0;if(!e)break e;f[e+12>>2]=0;f[e+8>>2]=0;e=e+16|0;}}f[71]=e+-2;break}}}while(0);return}function o(){var e=0,a=0,r=0,i=0,c=0,t=0,n=0;e=f[71]|0;c=(s[e>>1]|0)==123;f[71]=e+2;e=v(1)|0;t=c?125:93;e:while(1){if((t|0)==(e&65535|0))break;i=f[71]|0;if(i>>>0>(f[72]|0)>>>0)break;if((e<<16>>16==46?(s[i+2>>1]|0)==46:0)?(s[i+4>>1]|0)==46:0){f[71]=i+6;e=P(v(1)|0)|0;}else n=9;a:do{if((n|0)==9){n=0;do{if(c){do{if(e<<16>>16==91){b(0)|0;f[71]=(f[71]|0)+2;a=i;}else {if(ae(e)|0){A(e);f[71]=(f[71]|0)+2;a=i;break}if((e+-48&65535)>=10){H(e)|0;a=f[71]|0;break}e=i;r:while(1){r=e+2|0;a=s[r>>1]|0;i:do{if((a+-48&65535)>=10){switch(a<<16>>16){case 67:case 68:case 70:case 97:case 65:case 99:case 100:case 102:case 46:case 66:case 69:case 79:case 88:case 95:case 98:case 101:case 110:case 111:case 120:break i;case 43:case 45:break;default:break r}switch(s[e>>1]|0){case 69:case 101:break;default:break r}}}while(0);e=r;}f[71]=r;a=i;}}while(0);e=v(1)|0;if(e<<16>>16==58){f[71]=(f[71]|0)+2;e=P(v(1)|0)|0;break}if(a>>>0>i>>>0)E(i,a,i,a);}else if(e<<16>>16==44){f[71]=i+2;e=v(1)|0;break a}else {e=P(e)|0;break}}while(0);if(e<<16>>16==61)e=b(0)|0;if(e<<16>>16!=44)break e;f[71]=(f[71]|0)+2;e=v(1)|0;}}while(0)}return}function h(e){e=e|0;e:do{switch(s[e>>1]|0){case 100:switch(s[e+-2>>1]|0){case 105:{e=B(e+-4|0,76,2)|0;break e}case 108:{e=B(e+-4|0,80,3)|0;break e}default:{e=0;break e}}case 101:switch(s[e+-2>>1]|0){case 115:switch(s[e+-4>>1]|0){case 108:{e=z(e+-6|0,101)|0;break e}case 97:{e=z(e+-6|0,99)|0;break e}default:{e=0;break e}}case 116:{e=B(e+-4|0,86,4)|0;break e}case 117:{e=B(e+-4|0,94,6)|0;break e}default:{e=0;break e}}case 102:{if((s[e+-2>>1]|0)==111?(s[e+-4>>1]|0)==101:0)switch(s[e+-6>>1]|0){case 99:{e=B(e+-8|0,106,6)|0;break e}case 112:{e=B(e+-8|0,118,2)|0;break e}default:{e=0;break e}}else e=0;break}case 107:{e=B(e+-2|0,122,4)|0;break}case 110:{if(z(e+-2|0,105)|0)e=1;else e=B(e+-2|0,130,5)|0;break}case 111:{e=z(e+-2|0,100)|0;break}case 114:{e=B(e+-2|0,140,7)|0;break}case 116:{e=B(e+-2|0,154,4)|0;break}case 119:switch(s[e+-2>>1]|0){case 101:{e=z(e+-4|0,110)|0;break e}case 111:{e=B(e+-4|0,162,3)|0;break e}default:{e=0;break e}}default:e=0;}}while(0);return e|0}function w(e,a,r){e=e|0;a=a|0;r=r|0;var i=0,c=0;i=(f[71]|0)+2|0;switch(a<<16>>16){case 39:{A(39);c=5;break}case 34:{A(34);c=5;break}default:ee();}do{if((c|0)==5){g(e,i,f[71]|0,1);if((r|0)>0)f[(f[62]|0)+28>>2]=(r|0)==1?4:6;f[71]=(f[71]|0)+2;c=(v(0)|0)<<16>>16==119;a=f[71]|0;if(((c?(s[a+2>>1]|0)==105:0)?(s[a+4>>1]|0)==116:0)?(s[a+6>>1]|0)==104:0){f[71]=a+8;if((v(1)|0)<<16>>16!=123){f[71]=a;break}r=f[71]|0;i=r;e:while(1){f[71]=i+2;i=v(1)|0;switch(i<<16>>16){case 39:{A(39);f[71]=(f[71]|0)+2;i=v(1)|0;break}case 34:{A(34);f[71]=(f[71]|0)+2;i=v(1)|0;break}default:i=H(i)|0;}if(i<<16>>16!=58){c=20;break}f[71]=(f[71]|0)+2;switch((v(1)|0)<<16>>16){case 39:{A(39);break}case 34:{A(34);break}default:{c=24;break e}}f[71]=(f[71]|0)+2;switch((v(1)|0)<<16>>16){case 125:{c=28;break e}case 44:break;default:{c=26;break e}}i=(f[71]|0)+2|0;f[71]=i;}if((c|0)==20){f[71]=a;break}else if((c|0)==24){f[71]=a;break}else if((c|0)==26){f[71]=a;break}else if((c|0)==28){c=f[62]|0;f[c+16>>2]=r;f[c+12>>2]=(f[71]|0)+2;break}}f[71]=a+-2;}}while(0);return}function d(){var e=0,a=0,r=0;a=f[72]|0;r=f[71]|0;e:while(1){e=r+2|0;if(r>>>0>=a>>>0){a=10;break}switch(s[e>>1]|0){case 96:{a=7;break e}case 36:{if((s[r+4>>1]|0)==123){a=6;break e}break}case 92:{e=r+4|0;break}default:{}}r=e;}if((a|0)==6){e=r+4|0;f[71]=e;a=f[69]|0;r=s[398]|0;f[a+((r&65535)<<3)>>2]=4;s[398]=r+1<<16>>16;f[a+((r&65535)<<3)+4>>2]=e;}else if((a|0)==7){f[71]=e;a=f[69]|0;r=(s[398]|0)+-1<<16>>16;s[398]=r;if((f[a+((r&65535)<<3)>>2]|0)!=3)ee();}else if((a|0)==10){f[71]=e;ee();}return}function v(e){e=e|0;var a=0,r=0,i=0;r=f[71]|0;e:do{a=s[r>>1]|0;a:do{if(a<<16>>16!=47)if(e)if(L(a)|0)break;else break e;else if(M(a)|0)break;else break e;else switch(s[r+2>>1]|0){case 47:{F();break a}case 42:{x(e);break a}default:{a=47;break e}}}while(0);i=f[71]|0;r=i+2|0;f[71]=r;}while(i>>>0<(f[72]|0)>>>0);return a|0}function A(e){e=e|0;var a=0,r=0,i=0,c=0;c=f[72]|0;a=f[71]|0;while(1){i=a+2|0;if(a>>>0>=c>>>0){a=9;break}r=s[i>>1]|0;if(r<<16>>16==e<<16>>16){a=10;break}if(r<<16>>16==92){r=a+4|0;if((s[r>>1]|0)==13){a=a+6|0;a=(s[a>>1]|0)==10?a:r;}else a=r;}else if(se(r)|0){a=9;break}else a=i;}if((a|0)==9){f[71]=i;ee();}else if((a|0)==10)f[71]=i;return}function C(e){e=e|0;var a=0,r=0;a=s[e>>1]|0;if(L(a)|0)r=3;else switch(a<<16>>16){case 41:case 125:case 93:{r=3;break}default:e=0;}e:do{if((r|0)==3){r=f[3]|0;while(1){if(e>>>0<=r>>>0)break;e=e+-2|0;if(!(L(a)|0))break;a=s[e>>1]|0;}switch(a<<16>>16){case 41:case 125:case 93:{e=1;break e}default:{}}e=(O(a)|0)^1;}}while(0);return e|0}function g(e,a,r,s){e=e|0;a=a|0;r=r|0;s=s|0;var c=0,t=0;t=f[66]|0;f[66]=t+36;c=f[62]|0;f[((c|0)==0?232:c+32|0)>>2]=t;f[63]=c;f[62]=t;f[t+8>>2]=e;if(2==(s|0)){e=3;c=r;}else {e=1==(s|0)?1:2;c=1==(s|0)?r+2|0:0;}f[t+12>>2]=c;f[t+28>>2]=e;f[t>>2]=a;f[t+4>>2]=r;f[t+16>>2]=0;f[t+20>>2]=s;i[t+24>>0]=1==(s|0)&1;f[t+32>>2]=0;return}function p(e,a){e=e|0;a=a|0;var r=0,i=0,c=0,t=0;r=f[71]|0;i=s[r>>1]|0;c=(e|0)==(a|0)?0:e;t=(e|0)==(a|0)?0:a;if(i<<16>>16==97){f[71]=r+4;r=v(1)|0;e=f[71]|0;if(ae(r)|0){A(r);a=(f[71]|0)+2|0;f[71]=a;}else {H(r)|0;a=f[71]|0;}i=v(1)|0;r=f[71]|0;}if((r|0)!=(e|0))E(e,a,c,t);return i|0}function y(){var e=0,a=0,r=0,i=0;i=f[71]|0;r=f[72]|0;a=i;e:while(1){e=a+2|0;if(a>>>0>=r>>>0){a=7;break}switch(s[e>>1]|0){case 96:{a=8;break e}case 92:{e=a+4|0;break}case 36:{if((s[a+4>>1]|0)==123){a=7;break e}break}default:{}}a=e;}if((a|0)==7){f[71]=i;e=0;}else if((a|0)==8){f[71]=e;e=1;}return e|0}function m(){var e=0,a=0,r=0;r=f[72]|0;a=f[71]|0;e:while(1){e=a+2|0;if(a>>>0>=r>>>0){a=6;break}switch(s[e>>1]|0){case 13:case 10:{a=6;break e}case 93:{a=7;break e}case 92:{e=a+4|0;break}default:{}}a=e;}if((a|0)==6){f[71]=e;ee();e=0;}else if((a|0)==7){f[71]=e;e=93;}return e|0}function I(){var e=0,a=0;e:while(1){e=f[71]|0;f[71]=e+2;if(e>>>0>=(f[72]|0)>>>0){a=7;break}switch(s[e+2>>1]|0){case 13:case 10:{a=7;break e}case 47:break e;case 91:{m()|0;break}case 92:{f[71]=e+4;break}default:{}}}if((a|0)==7)ee();return}function U(e){e=e|0;switch(s[e>>1]|0){case 62:{e=(s[e+-2>>1]|0)==61;break}case 41:case 59:{e=1;break}case 104:{e=B(e+-2|0,188,4)|0;break}case 121:{e=B(e+-2|0,196,6)|0;break}case 101:{e=B(e+-2|0,208,3)|0;break}default:e=0;}return e|0}function x(e){e=e|0;var a=0,r=0,i=0,c=0,t=0;c=(f[71]|0)+2|0;f[71]=c;r=f[72]|0;while(1){a=c+2|0;if(c>>>0>=r>>>0)break;i=s[a>>1]|0;if(!e?se(i)|0:0)break;if(i<<16>>16==42?(s[c+4>>1]|0)==47:0){t=8;break}c=a;}if((t|0)==8){f[71]=a;a=c+4|0;}f[71]=a;return}function S(e,a,r){e=e|0;a=a|0;r=r|0;var s=0,f=0;e:do{if(!r)e=0;else {while(1){s=i[e>>0]|0;f=i[a>>0]|0;if(s<<24>>24!=f<<24>>24)break;r=r+-1|0;if(!r){e=0;break e}else {e=e+1|0;a=a+1|0;}}e=(s&255)-(f&255)|0;}}while(0);return e|0}function O(e){e=e|0;e:do{switch(e<<16>>16){case 38:case 37:case 33:{e=1;break}default:if((e&-8)<<16>>16==40|(e+-58&65535)<6)e=1;else {switch(e<<16>>16){case 91:case 93:case 94:{e=1;break e}default:{}}e=(e+-123&65535)<4;}}}while(0);return e|0}function $(e){e=e|0;e:do{switch(e<<16>>16){case 38:case 37:case 33:break;default:if(!((e+-58&65535)<6|(e+-40&65535)<7&e<<16>>16!=41)){switch(e<<16>>16){case 91:case 94:break e;default:{}}return e<<16>>16!=125&(e+-123&65535)<4|0}}}while(0);return 1}function T(e){e=e|0;var a=0;a=s[e>>1]|0;e:do{if((a+-9&65535)>=5){switch(a<<16>>16){case 160:case 32:{a=1;break e}default:{}}if(O(a)|0)return a<<16>>16!=46|(N(e)|0)|0;else a=0;}else a=1;}while(0);return a|0}function j(e){e=e|0;var a=0,r=0;r=n;n=n+16|0;f[r>>2]=0;f[65]=e;a=f[3]|0;s[a+(e<<1)>>1]=0;f[r>>2]=a+(e<<1)+2;f[66]=a+(e<<1)+2;f[58]=0;f[62]=0;f[60]=0;f[59]=0;f[64]=0;f[61]=0;n=r;return a|0}function B(e,a,r){e=e|0;a=a|0;r=r|0;var i=0,s=0;s=e+(0-r<<1)+2|0;i=f[3]|0;if(s>>>0>=i>>>0?(S(s,a,r<<1)|0)==0:0)if((s|0)==(i|0))i=1;else i=T(e+(0-r<<1)|0)|0;else i=0;return i|0}function E(e,a,r,i){e=e|0;a=a|0;r=r|0;i=i|0;var s=0,c=0;s=f[66]|0;f[66]=s+20;c=f[64]|0;f[((c|0)==0?236:c+16|0)>>2]=s;f[64]=s;f[s>>2]=e;f[s+4>>2]=a;f[s+8>>2]=r;f[s+12>>2]=i;f[s+16>>2]=0;return}function P(e){e=e|0;var a=0;switch(e<<16>>16){case 91:case 123:{o();f[71]=(f[71]|0)+2;break}default:{a=f[71]|0;H(e)|0;e=f[71]|0;if(e>>>0>a>>>0)E(a,e,a,e);}}return v(1)|0}function q(e){e=e|0;switch(s[e>>1]|0){case 107:{e=B(e+-2|0,122,4)|0;break}case 101:{if((s[e+-2>>1]|0)==117)e=B(e+-4|0,94,6)|0;else e=0;break}default:e=0;}return e|0}function z(e,a){e=e|0;a=a|0;var r=0;r=f[3]|0;if(r>>>0<=e>>>0?(s[e>>1]|0)==a<<16>>16:0)if((r|0)==(e|0))r=1;else r=D(s[e+-2>>1]|0)|0;else r=0;return r|0}function D(e){e=e|0;e:do{if((e+-9&65535)<5)e=1;else {switch(e<<16>>16){case 32:case 160:{e=1;break e}default:{}}e=e<<16>>16!=46&(O(e)|0);}}while(0);return e|0}function F(){var e=0,a=0,r=0;e=f[72]|0;r=f[71]|0;e:while(1){a=r+2|0;if(r>>>0>=e>>>0)break;switch(s[a>>1]|0){case 13:case 10:break e;default:r=a;}}f[71]=a;return}function G(e){e=e|0;e:do{if(((e&-33)+-65&65535)<26|(e+-48&65535)<10)e=1;else {switch(e<<16>>16){case 36:case 95:{e=1;break e}default:{}}e=(e&65535)>127;}}while(0);return e|0}function H(e){e=e|0;while(1){if(L(e)|0)break;if(O(e)|0)break;e=(f[71]|0)+2|0;f[71]=e;e=s[e>>1]|0;if(!(e<<16>>16)){e=0;break}}return e|0}function J(){var e=0;e=f[(f[60]|0)+20>>2]|0;switch(e|0){case 1:{e=-1;break}case 2:{e=-2;break}default:e=e-(f[3]|0)>>1;}return e|0}function K(e){e=e|0;if(!(B(e,168,5)|0)?!(B(e,178,3)|0):0)e=B(e,184,2)|0;else e=1;return e|0}function L(e){e=e|0;switch(e<<16>>16){case 160:case 9:case 10:case 11:case 12:case 13:case 32:{e=1;break}default:e=0;}return e|0}function M(e){e=e|0;switch(e<<16>>16){case 160:case 32:case 12:case 11:case 9:{e=1;break}default:e=0;}return e|0}function N(e){e=e|0;if((s[e>>1]|0)==46?(s[e+-2>>1]|0)==46:0)e=(s[e+-4>>1]|0)==46;else e=0;return e|0}function Q(e){e=e|0;if((f[3]|0)==(e|0))e=1;else e=T(e+-2|0)|0;return e|0}function R(){var e=0;e=f[(f[61]|0)+12>>2]|0;if(!e)e=-1;else e=e-(f[3]|0)>>1;return e|0}function V(){var e=0;e=f[(f[60]|0)+12>>2]|0;if(!e)e=-1;else e=e-(f[3]|0)>>1;return e|0}function W(){var e=0;e=f[(f[61]|0)+8>>2]|0;if(!e)e=-1;else e=e-(f[3]|0)>>1;return e|0}function X(){var e=0;e=f[(f[60]|0)+16>>2]|0;if(!e)e=-1;else e=e-(f[3]|0)>>1;return e|0}function Y(){var e=0;e=f[(f[60]|0)+4>>2]|0;if(!e)e=-1;else e=e-(f[3]|0)>>1;return e|0}function Z(){var e=0;e=f[60]|0;e=f[((e|0)==0?232:e+32|0)>>2]|0;f[60]=e;return (e|0)!=0|0}function _(){var e=0;e=f[61]|0;e=f[((e|0)==0?236:e+16|0)>>2]|0;f[61]=e;return (e|0)!=0|0}function ee(){i[798]=1;f[67]=(f[71]|0)-(f[3]|0)>>1;f[71]=(f[72]|0)+2;return}function ae(e){e=e|0;return e<<16>>16==39|e<<16>>16==34|0}function re(){return (f[(f[60]|0)+8>>2]|0)-(f[3]|0)>>1|0}function ie(){return (f[(f[61]|0)+4>>2]|0)-(f[3]|0)>>1|0}function se(e){e=e|0;return e<<16>>16==13|e<<16>>16==10|0}function fe(){return (f[f[60]>>2]|0)-(f[3]|0)>>1|0}function ce(){return (f[f[61]>>2]|0)-(f[3]|0)>>1|0}function te(){return c[(f[60]|0)+24>>0]|0|0}function ne(e){e=e|0;f[3]=e;return}function be(){return f[(f[60]|0)+28>>2]|0}function ke(){return f[67]|0}function le(e,a){e=e|0;a=a|0;n=e+a+15&-16;return a}return {su:le,ai:X,e:ke,ee:ie,ele:R,els:W,es:ce,id:J,ie:Y,ip:te,is:fe,it:be,p:k,re:_,ri:Z,sa:j,se:V,ses:ne,ss:re}}("undefined"!=typeof globalThis?globalThis:self,{},a),r=e.su(i-(2<<17),1040);}const h=c$1.length+1;e.ses(r),e.sa(h-1),s(c$1,new Uint16Array(a,r,h)),e.p()||(n=e.e(),o());const w=[],d=[];for(;e.ri();){const a=e.is(),r=e.ie(),i=e.ai(),s=e.id(),f=e.ss(),t=e.se(),n=e.it();let k;e.ip()&&(k=b(-1===s?a:a+1,c$1.charCodeAt(-1===s?a-1:a)));let l=null;w.push({t:n,n:k,s:a,e:r,ss:f,se:t,d:s,a:i,at:l});}for(;e.re();){const a=e.es(),r=e.ee(),i=e.els(),s=e.ele(),f=i<0?void 0:v(i,s),c=v(a,r);d.push({s:a,e:r,ls:i,le:s,n:c,ln:f});}return [w,d];function v(e,a){const r=c$1.charCodeAt(e);return 34===r||39===r?b(e+1,r):c$1.slice(e,a)}}function b(e,a){n=e;let r="",i=n;for(;;){n>=c$1.length&&o();const e=c$1.charCodeAt(n);if(e===a)break;92===e?(r+=c$1.slice(i,n),r+=k(),i=n):(8232===e||8233===e||u(e)&&96!==a&&o(),++n);}return r+=c$1.slice(i,n++),r}function k(){let e=c$1.charCodeAt(++n);switch(++n,e){case 110:return "\n";case 114:return "\r";case 120:return String.fromCharCode(l(2));case 117:return function(){const e=c$1.charCodeAt(n);let a;123===e?(++n,a=l(c$1.indexOf("}",n)-n),++n,a>1114111&&o()):a=l(4);return a<=65535?String.fromCharCode(a):(a-=65536,String.fromCharCode(55296+(a>>10),56320+(1023&a)))}();case 116:return "\t";case 98:return "\b";case 118:return "\v";case 102:return "\f";case 13:10===c$1.charCodeAt(n)&&++n;case 10:return "";case 56:case 57:o();default:if(e>=48&&e<=55){let a=c$1.substr(n-1,3).match(/^[0-7]+/)[0],r=parseInt(a,8);return r>255&&(a=a.slice(0,-1),r=parseInt(a,8)),n+=a.length-1,e=c$1.charCodeAt(n),"0"===a&&56!==e&&57!==e||o(),String.fromCharCode(r)}return u(e)?"":String.fromCharCode(e)}}function l(e){const a=n;let r=0,i=0;for(let a=0;a<e;++a,++n){let e,s=c$1.charCodeAt(n);if(95!==s){if(s>=97)e=s-97+10;else if(s>=65)e=s-65+10;else {if(!(s>=48&&s<=57))break;e=s-48;}if(e>=16)break;i=s,r=16*r+e;}else 95!==i&&0!==a||o(),i=s;}return 95!==i&&n-a===e||o(),r}function u(e){return 13===e||10===e}function o(){throw Object.assign(Error(`Parse error ${t}:${c$1.slice(0,n).split("\n").length}:${n-c$1.lastIndexOf("\n",n-1)}`),{idx:n})}
|
|
630
|
+
|
|
631
|
+
const _resolve = (id, parentUrl = baseUrl) => {
|
|
632
|
+
const urlResolved = resolveIfNotPlainOrUrl(id, parentUrl) || asURL(id);
|
|
633
|
+
const firstResolved = firstImportMap && resolveImportMap(firstImportMap, urlResolved || id, parentUrl);
|
|
634
|
+
const composedResolved =
|
|
635
|
+
composedImportMap === firstImportMap ? firstResolved : (
|
|
636
|
+
resolveImportMap(composedImportMap, urlResolved || id, parentUrl)
|
|
637
|
+
);
|
|
638
|
+
const resolved = composedResolved || firstResolved || throwUnresolved(id, parentUrl);
|
|
639
|
+
// needsShim, shouldShim per load record to set on parent
|
|
640
|
+
let n = false,
|
|
641
|
+
N = false;
|
|
642
|
+
if (!supportsImportMaps) {
|
|
643
|
+
// bare specifier -> needs shim
|
|
644
|
+
if (!urlResolved) n = true;
|
|
645
|
+
// url mapping -> should shim
|
|
646
|
+
else if (urlResolved !== resolved) N = true;
|
|
647
|
+
} else if (!supportsMultipleImportMaps) {
|
|
648
|
+
// bare specifier and not resolved by first import map -> needs shim
|
|
649
|
+
if (!urlResolved && !firstResolved) n = true;
|
|
650
|
+
// resolution doesn't match first import map -> should shim
|
|
651
|
+
if (firstResolved && resolved !== firstResolved) N = true;
|
|
652
|
+
}
|
|
653
|
+
return { r: resolved, n, N };
|
|
654
|
+
};
|
|
655
|
+
|
|
656
|
+
const resolve = (id, parentUrl) => {
|
|
657
|
+
if (!resolveHook) return _resolve(id, parentUrl);
|
|
658
|
+
const result = resolveHook(id, parentUrl, defaultResolve);
|
|
659
|
+
|
|
660
|
+
return result ? { r: result, n: true, N: true } : _resolve(id, parentUrl);
|
|
661
|
+
};
|
|
662
|
+
|
|
663
|
+
// import()
|
|
664
|
+
async function importShim(id, opts, parentUrl) {
|
|
665
|
+
if (typeof opts === 'string') {
|
|
666
|
+
parentUrl = opts;
|
|
667
|
+
opts = undefined;
|
|
668
|
+
}
|
|
669
|
+
await initPromise; // needed for shim check
|
|
670
|
+
if (shimMode || !baselineSupport) {
|
|
671
|
+
if (hasDocument) processScriptsAndPreloads();
|
|
672
|
+
legacyAcceptingImportMaps = false;
|
|
673
|
+
}
|
|
674
|
+
let sourceType = undefined;
|
|
675
|
+
if (typeof opts === 'object') {
|
|
676
|
+
if (opts.lang === 'ts') sourceType = 'ts';
|
|
677
|
+
if (typeof opts.with === 'object' && typeof opts.with.type === 'string') {
|
|
678
|
+
sourceType = opts.with.type;
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
return topLevelLoad(id, parentUrl || baseUrl, defaultFetchOpts, undefined, undefined, undefined, sourceType);
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
// import.source()
|
|
685
|
+
// (opts not currently supported as no use cases yet)
|
|
686
|
+
if (shimMode || wasmSourcePhaseEnabled)
|
|
687
|
+
importShim.source = async (id, opts, parentUrl) => {
|
|
688
|
+
if (typeof opts === 'string') {
|
|
689
|
+
parentUrl = opts;
|
|
690
|
+
opts = undefined;
|
|
691
|
+
}
|
|
692
|
+
await initPromise; // needed for shim check
|
|
693
|
+
if (shimMode || !baselineSupport) {
|
|
694
|
+
if (hasDocument) processScriptsAndPreloads();
|
|
695
|
+
legacyAcceptingImportMaps = false;
|
|
696
|
+
}
|
|
697
|
+
await importMapPromise;
|
|
698
|
+
const url = resolve(id, parentUrl || baseUrl).r;
|
|
699
|
+
const load = getOrCreateLoad(url, defaultFetchOpts, undefined, undefined);
|
|
700
|
+
await load.f;
|
|
701
|
+
return importShim._s[load.r];
|
|
702
|
+
};
|
|
703
|
+
|
|
704
|
+
// import.defer() is just a proxy for import(), since we can't actually defer
|
|
705
|
+
if (shimMode || deferPhaseEnabled) importShim.defer = importShim;
|
|
706
|
+
|
|
707
|
+
if (hotReload) {
|
|
708
|
+
initHotReload(topLevelLoad, importShim);
|
|
709
|
+
importShim.hotReload = hotReload$1;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
const defaultResolve = (id, parentUrl) => {
|
|
713
|
+
return (
|
|
714
|
+
resolveImportMap(composedImportMap, resolveIfNotPlainOrUrl(id, parentUrl) || id, parentUrl) ||
|
|
715
|
+
throwUnresolved(id, parentUrl)
|
|
716
|
+
);
|
|
717
|
+
};
|
|
718
|
+
|
|
719
|
+
const throwUnresolved = (id, parentUrl) => {
|
|
720
|
+
throw Error(`Unable to resolve specifier '${id}'${fromParent(parentUrl)}`);
|
|
721
|
+
};
|
|
722
|
+
|
|
723
|
+
const metaResolve = function (id, parentUrl = this.url) {
|
|
724
|
+
return resolve(id, `${parentUrl}`).r;
|
|
725
|
+
};
|
|
726
|
+
|
|
727
|
+
importShim.resolve = (id, parentUrl) => resolve(id, parentUrl).r;
|
|
728
|
+
importShim.getImportMap = () => JSON.parse(JSON.stringify(composedImportMap));
|
|
729
|
+
importShim.addImportMap = importMapIn => {
|
|
730
|
+
if (!shimMode) throw new Error('Unsupported in polyfill mode.');
|
|
731
|
+
composedImportMap = resolveAndComposeImportMap(importMapIn, baseUrl, composedImportMap);
|
|
732
|
+
};
|
|
733
|
+
importShim.version = version;
|
|
734
|
+
|
|
735
|
+
const registry = (importShim._r = {});
|
|
736
|
+
// Wasm caches
|
|
737
|
+
const sourceCache = (importShim._s = {});
|
|
738
|
+
/* const instanceCache = */ importShim._i = new WeakMap();
|
|
739
|
+
|
|
740
|
+
// Ensure this version is the only version
|
|
741
|
+
defineValue(self_, 'importShim', Object.freeze(importShim));
|
|
742
|
+
const shimModeOptions = { ...esmsInitOptions, shimMode: true };
|
|
743
|
+
if (optionsScript) optionsScript.innerText = maybeTrustedScript(JSON.stringify(shimModeOptions));
|
|
744
|
+
self_.esmsInitOptions = shimModeOptions;
|
|
745
|
+
|
|
746
|
+
const loadAll = async (load, seen) => {
|
|
747
|
+
seen[load.u] = 1;
|
|
748
|
+
await load.L;
|
|
749
|
+
await Promise.all(
|
|
750
|
+
load.d.map(({ l: dep, s: sourcePhase }) => {
|
|
751
|
+
if (dep.b || seen[dep.u]) return;
|
|
752
|
+
if (sourcePhase) return dep.f;
|
|
753
|
+
return loadAll(dep, seen);
|
|
754
|
+
})
|
|
755
|
+
);
|
|
756
|
+
};
|
|
757
|
+
|
|
758
|
+
let importMapSrc = false;
|
|
759
|
+
let multipleImportMaps = false;
|
|
760
|
+
let firstImportMap = null;
|
|
761
|
+
// To support polyfilling multiple import maps, we separately track the composed import map from the first import map
|
|
762
|
+
let composedImportMap = { imports: {}, scopes: {}, integrity: {} };
|
|
763
|
+
let baselineSupport;
|
|
764
|
+
|
|
765
|
+
const initPromise = featureDetectionPromise.then(() => {
|
|
766
|
+
baselineSupport =
|
|
767
|
+
supportsImportMaps &&
|
|
768
|
+
(!jsonModulesEnabled || supportsJsonType) &&
|
|
769
|
+
(!cssModulesEnabled || supportsCssType) &&
|
|
770
|
+
(!wasmInstancePhaseEnabled || supportsWasmInstancePhase) &&
|
|
771
|
+
(!wasmSourcePhaseEnabled || supportsWasmSourcePhase) &&
|
|
772
|
+
!deferPhaseEnabled &&
|
|
773
|
+
(!multipleImportMaps || supportsMultipleImportMaps) &&
|
|
774
|
+
!importMapSrc &&
|
|
775
|
+
!hasCustomizationHooks;
|
|
776
|
+
if (!shimMode && typeof WebAssembly !== 'undefined') {
|
|
777
|
+
if (wasmSourcePhaseEnabled && !Object.getPrototypeOf(WebAssembly.Module).name) {
|
|
778
|
+
const s = Symbol();
|
|
779
|
+
const brand = m => defineValue(m, s, 'WebAssembly.Module');
|
|
780
|
+
class AbstractModuleSource {
|
|
781
|
+
get [Symbol.toStringTag]() {
|
|
782
|
+
if (this[s]) return this[s];
|
|
783
|
+
throw new TypeError('Not an AbstractModuleSource');
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
const { Module: wasmModule, compile: wasmCompile, compileStreaming: wasmCompileStreaming } = WebAssembly;
|
|
787
|
+
WebAssembly.Module = Object.setPrototypeOf(
|
|
788
|
+
Object.assign(function Module(...args) {
|
|
789
|
+
return brand(new wasmModule(...args));
|
|
790
|
+
}, wasmModule),
|
|
791
|
+
AbstractModuleSource
|
|
792
|
+
);
|
|
793
|
+
WebAssembly.Module.prototype = Object.setPrototypeOf(wasmModule.prototype, AbstractModuleSource.prototype);
|
|
794
|
+
WebAssembly.compile = function compile(...args) {
|
|
795
|
+
return wasmCompile(...args).then(brand);
|
|
796
|
+
};
|
|
797
|
+
WebAssembly.compileStreaming = function compileStreaming(...args) {
|
|
798
|
+
return wasmCompileStreaming(...args).then(brand);
|
|
799
|
+
};
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
if (hasDocument) {
|
|
803
|
+
if (!supportsImportMaps) {
|
|
804
|
+
const supports = HTMLScriptElement.supports || (type => type === 'classic' || type === 'module');
|
|
805
|
+
HTMLScriptElement.supports = type => type === 'importmap' || supports(type);
|
|
806
|
+
}
|
|
807
|
+
if (shimMode || !baselineSupport) {
|
|
808
|
+
attachMutationObserver();
|
|
809
|
+
if (document.readyState === 'complete') {
|
|
810
|
+
readyStateCompleteCheck();
|
|
811
|
+
} else {
|
|
812
|
+
document.addEventListener('readystatechange', readyListener);
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
processScriptsAndPreloads();
|
|
816
|
+
}
|
|
817
|
+
return undefined;
|
|
818
|
+
});
|
|
819
|
+
|
|
820
|
+
const attachMutationObserver = () => {
|
|
821
|
+
const observer = new MutationObserver(mutations => {
|
|
822
|
+
for (const mutation of mutations) {
|
|
823
|
+
if (mutation.type !== 'childList') continue;
|
|
824
|
+
for (const node of mutation.addedNodes) {
|
|
825
|
+
if (node.tagName === 'SCRIPT') {
|
|
826
|
+
if (node.type === (shimMode ? 'module-shim' : 'module') && !node.ep) processScript(node, true);
|
|
827
|
+
if (node.type === (shimMode ? 'importmap-shim' : 'importmap') && !node.ep) processImportMap(node, true);
|
|
828
|
+
} else if (
|
|
829
|
+
node.tagName === 'LINK' &&
|
|
830
|
+
node.rel === (shimMode ? 'modulepreload-shim' : 'modulepreload') &&
|
|
831
|
+
!node.ep
|
|
832
|
+
) {
|
|
833
|
+
processPreload(node);
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
});
|
|
838
|
+
observer.observe(document, { childList: true });
|
|
839
|
+
observer.observe(document.head, { childList: true });
|
|
840
|
+
processScriptsAndPreloads();
|
|
841
|
+
};
|
|
842
|
+
|
|
843
|
+
let importMapPromise = initPromise;
|
|
844
|
+
let firstPolyfillLoad = true;
|
|
845
|
+
let legacyAcceptingImportMaps = true;
|
|
846
|
+
|
|
847
|
+
async function topLevelLoad(
|
|
848
|
+
url,
|
|
849
|
+
parentUrl,
|
|
850
|
+
fetchOpts,
|
|
851
|
+
source,
|
|
852
|
+
nativelyLoaded,
|
|
853
|
+
lastStaticLoadPromise,
|
|
854
|
+
sourceType
|
|
855
|
+
) {
|
|
856
|
+
await initPromise;
|
|
857
|
+
await importMapPromise;
|
|
858
|
+
url = (await resolve(url, parentUrl)).r;
|
|
859
|
+
|
|
860
|
+
// we mock import('./x.css', { with: { type: 'css' }}) support via an inline static reexport
|
|
861
|
+
// because we can't syntactically pass through to dynamic import with a second argument
|
|
862
|
+
if (sourceType === 'css' || sourceType === 'json') {
|
|
863
|
+
// Direct reexport for hot reloading skipped due to Firefox bug https://bugzilla.mozilla.org/show_bug.cgi?id=1965620
|
|
864
|
+
source = `import m from'${url}'with{type:"${sourceType}"};export default m;`;
|
|
865
|
+
url += '?entry';
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
if (importHook) await importHook(url, typeof fetchOpts !== 'string' ? fetchOpts : {}, parentUrl, source, sourceType);
|
|
869
|
+
// early analysis opt-out - no need to even fetch if we have feature support
|
|
870
|
+
if (!shimMode && baselineSupport && nativePassthrough && sourceType !== 'ts') {
|
|
871
|
+
// for polyfill case, only dynamic import needs a return value here, and dynamic import will never pass nativelyLoaded
|
|
872
|
+
if (nativelyLoaded) return null;
|
|
873
|
+
await lastStaticLoadPromise;
|
|
874
|
+
return dynamicImport(source ? createBlob(source) : url);
|
|
875
|
+
}
|
|
876
|
+
const load = getOrCreateLoad(url, fetchOpts, undefined, source);
|
|
877
|
+
linkLoad(load, fetchOpts);
|
|
878
|
+
const seen = {};
|
|
879
|
+
await loadAll(load, seen);
|
|
880
|
+
resolveDeps(load, seen);
|
|
881
|
+
await lastStaticLoadPromise;
|
|
882
|
+
if (!shimMode && !load.n) {
|
|
883
|
+
if (nativelyLoaded) {
|
|
884
|
+
return;
|
|
885
|
+
}
|
|
886
|
+
if (source) {
|
|
887
|
+
return await dynamicImport(createBlob(source));
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
if (firstPolyfillLoad && !shimMode && load.n && nativelyLoaded) {
|
|
891
|
+
onpolyfill();
|
|
892
|
+
firstPolyfillLoad = false;
|
|
893
|
+
}
|
|
894
|
+
const module = await (shimMode || load.n || load.N || !nativePassthrough || (!nativelyLoaded && source) ?
|
|
895
|
+
dynamicImport(load.b, load.u)
|
|
896
|
+
: import(load.u));
|
|
897
|
+
// if the top-level load is a shell, run its update function
|
|
898
|
+
if (load.s) (await dynamicImport(load.s, load.u)).u$_(module);
|
|
899
|
+
revokeObjectURLs(Object.keys(seen));
|
|
900
|
+
return module;
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
const revokeObjectURLs = registryKeys => {
|
|
904
|
+
let curIdx = 0;
|
|
905
|
+
const handler = self_.requestIdleCallback || self_.requestAnimationFrame || (fn => setTimeout(fn, 0));
|
|
906
|
+
handler(cleanup);
|
|
907
|
+
function cleanup() {
|
|
908
|
+
for (const key of registryKeys.slice(curIdx, (curIdx += 100))) {
|
|
909
|
+
const load = registry[key];
|
|
910
|
+
if (load && load.b && load.b !== load.u) URL.revokeObjectURL(load.b);
|
|
911
|
+
}
|
|
912
|
+
if (curIdx < registryKeys.length) handler(cleanup);
|
|
913
|
+
}
|
|
914
|
+
};
|
|
915
|
+
|
|
916
|
+
const urlJsString = url => `'${url.replace(/'/g, "\\'")}'`;
|
|
917
|
+
|
|
918
|
+
let resolvedSource, lastIndex;
|
|
919
|
+
const pushStringTo = (load, originalIndex, dynamicImportEndStack) => {
|
|
920
|
+
while (dynamicImportEndStack[dynamicImportEndStack.length - 1] < originalIndex) {
|
|
921
|
+
const dynamicImportEnd = dynamicImportEndStack.pop();
|
|
922
|
+
resolvedSource += `${load.S.slice(lastIndex, dynamicImportEnd)}, ${urlJsString(load.r)}`;
|
|
923
|
+
lastIndex = dynamicImportEnd;
|
|
924
|
+
}
|
|
925
|
+
resolvedSource += load.S.slice(lastIndex, originalIndex);
|
|
926
|
+
lastIndex = originalIndex;
|
|
927
|
+
};
|
|
928
|
+
|
|
929
|
+
const pushSourceURL = (load, commentPrefix, commentStart, dynamicImportEndStack) => {
|
|
930
|
+
const urlStart = commentStart + commentPrefix.length;
|
|
931
|
+
const commentEnd = load.S.indexOf('\n', urlStart);
|
|
932
|
+
const urlEnd = commentEnd !== -1 ? commentEnd : load.S.length;
|
|
933
|
+
let sourceUrl = load.S.slice(urlStart, urlEnd);
|
|
934
|
+
try {
|
|
935
|
+
sourceUrl = new URL(sourceUrl, load.r).href;
|
|
936
|
+
} catch (e) {}
|
|
937
|
+
pushStringTo(load, urlStart, dynamicImportEndStack);
|
|
938
|
+
resolvedSource += sourceUrl;
|
|
939
|
+
lastIndex = urlEnd;
|
|
940
|
+
};
|
|
941
|
+
|
|
942
|
+
const resolveDeps = (load, seen) => {
|
|
943
|
+
if (load.b || !seen[load.u]) return;
|
|
944
|
+
seen[load.u] = 0;
|
|
945
|
+
|
|
946
|
+
for (const { l: dep, s: sourcePhase } of load.d) {
|
|
947
|
+
if (!sourcePhase) resolveDeps(dep, seen);
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
if (!load.n) load.n = load.d.some(dep => dep.l.n);
|
|
951
|
+
if (!load.N) load.N = load.d.some(dep => dep.l.N);
|
|
952
|
+
|
|
953
|
+
// use native loader whenever possible (n = needs shim) via executable subgraph passthrough
|
|
954
|
+
// so long as the module doesn't use dynamic import or unsupported URL mappings (N = should shim)
|
|
955
|
+
if (nativePassthrough && !shimMode && !load.n && !load.N) {
|
|
956
|
+
load.b = load.u;
|
|
957
|
+
load.S = undefined;
|
|
958
|
+
return;
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
const [imports, exports] = load.a;
|
|
962
|
+
|
|
963
|
+
// "execution"
|
|
964
|
+
let source = load.S,
|
|
965
|
+
depIndex = 0,
|
|
966
|
+
dynamicImportEndStack = [];
|
|
967
|
+
|
|
968
|
+
// once all deps have loaded we can inline the dependency resolution blobs
|
|
969
|
+
// and define this blob
|
|
970
|
+
resolvedSource = '';
|
|
971
|
+
lastIndex = 0;
|
|
972
|
+
|
|
973
|
+
for (const { s: start, e: end, ss: statementStart, se: statementEnd, d: dynamicImportIndex, t, a, at } of imports) {
|
|
974
|
+
// source phase
|
|
975
|
+
if (t === 4) {
|
|
976
|
+
let { l: depLoad } = load.d[depIndex++];
|
|
977
|
+
pushStringTo(load, statementStart, dynamicImportEndStack);
|
|
978
|
+
resolvedSource += `${source.slice(statementStart, start - 1).replace('source', '')}/*${source.slice(start - 1, end + 1)}*/'${createBlob(`export default importShim._s[${urlJsString(depLoad.r)}]`)}'`;
|
|
979
|
+
lastIndex = end + 1;
|
|
980
|
+
}
|
|
981
|
+
// dependency source replacements
|
|
982
|
+
else if (dynamicImportIndex === -1) {
|
|
983
|
+
let keepAssertion = false;
|
|
984
|
+
if (a > 0 && !shimMode) {
|
|
985
|
+
// strip assertions only when unsupported in polyfill mode
|
|
986
|
+
// minimal lexer builds do not provide parsed attributes, so sniff the assertion source directly
|
|
987
|
+
const assertion = source.slice(a, statementEnd - 1);
|
|
988
|
+
keepAssertion =
|
|
989
|
+
nativePassthrough &&
|
|
990
|
+
((supportsJsonType && assertion.includes('json')) || (supportsCssType && assertion.includes('css')));
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
// defer phase stripping
|
|
994
|
+
if (t === 6) {
|
|
995
|
+
pushStringTo(load, statementStart, dynamicImportEndStack);
|
|
996
|
+
resolvedSource += source.slice(statementStart, start - 1).replace('defer', '');
|
|
997
|
+
lastIndex = start;
|
|
998
|
+
}
|
|
999
|
+
let { l: depLoad } = load.d[depIndex++],
|
|
1000
|
+
blobUrl = depLoad.b,
|
|
1001
|
+
cycleShell = !blobUrl;
|
|
1002
|
+
if (cycleShell) {
|
|
1003
|
+
// circular shell creation
|
|
1004
|
+
if (!(blobUrl = depLoad.s)) {
|
|
1005
|
+
blobUrl = depLoad.s = createBlob(
|
|
1006
|
+
`export function u$_(m){${depLoad.a[1]
|
|
1007
|
+
.map(({ s, e }, i) => {
|
|
1008
|
+
const q = depLoad.S[s] === '"' || depLoad.S[s] === "'";
|
|
1009
|
+
return `e$_${i}=m${q ? `[` : '.'}${depLoad.S.slice(s, e)}${q ? `]` : ''}`;
|
|
1010
|
+
})
|
|
1011
|
+
.join(',')}}${
|
|
1012
|
+
depLoad.a[1].length ? `let ${depLoad.a[1].map((_, i) => `e$_${i}`).join(',')};` : ''
|
|
1013
|
+
}export {${depLoad.a[1]
|
|
1014
|
+
.map(({ s, e }, i) => `e$_${i} as ${depLoad.S.slice(s, e)}`)
|
|
1015
|
+
.join(',')}}\n//# sourceURL=${depLoad.r}?cycle`
|
|
1016
|
+
);
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
pushStringTo(load, start - 1, dynamicImportEndStack);
|
|
1021
|
+
resolvedSource += `/*${source.slice(start - 1, end + 1)}*/'${blobUrl}'`;
|
|
1022
|
+
|
|
1023
|
+
// circular shell execution
|
|
1024
|
+
if (!cycleShell && depLoad.s) {
|
|
1025
|
+
resolvedSource += `;import*as m$_${depIndex} from'${depLoad.b}';import{u$_ as u$_${depIndex}}from'${depLoad.s}';u$_${depIndex}(m$_${depIndex})`;
|
|
1026
|
+
depLoad.s = undefined;
|
|
1027
|
+
}
|
|
1028
|
+
lastIndex = keepAssertion ? end + 1 : statementEnd;
|
|
1029
|
+
}
|
|
1030
|
+
// import.meta
|
|
1031
|
+
else if (dynamicImportIndex === -2) {
|
|
1032
|
+
load.m = { url: load.r, resolve: metaResolve };
|
|
1033
|
+
if (metaHook) metaHook(load.m, load.u);
|
|
1034
|
+
pushStringTo(load, start, dynamicImportEndStack);
|
|
1035
|
+
resolvedSource += `importShim._r[${urlJsString(load.u)}].m`;
|
|
1036
|
+
lastIndex = statementEnd;
|
|
1037
|
+
}
|
|
1038
|
+
// dynamic import
|
|
1039
|
+
else {
|
|
1040
|
+
pushStringTo(load, statementStart + 6, dynamicImportEndStack);
|
|
1041
|
+
resolvedSource += `Shim${t === 5 ? '.source' : ''}(`;
|
|
1042
|
+
dynamicImportEndStack.push(statementEnd - 1);
|
|
1043
|
+
lastIndex = start;
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
// support progressive cycle binding updates (try statement avoids tdz errors)
|
|
1048
|
+
if (load.s && (imports.length === 0 || imports[imports.length - 1].d === -1))
|
|
1049
|
+
resolvedSource += `\n;import{u$_}from'${load.s}';try{u$_({${exports
|
|
1050
|
+
.filter(e => e.ln)
|
|
1051
|
+
.map(({ s, e, ln }) => `${source.slice(s, e)}:${ln}`)
|
|
1052
|
+
.join(',')}})}catch(_){};\n`;
|
|
1053
|
+
|
|
1054
|
+
let sourceURLCommentStart = source.lastIndexOf(sourceURLCommentPrefix);
|
|
1055
|
+
let sourceMapURLCommentStart = source.lastIndexOf(sourceMapURLCommentPrefix);
|
|
1056
|
+
|
|
1057
|
+
// ignore sourceMap comments before already spliced code
|
|
1058
|
+
if (sourceURLCommentStart < lastIndex) sourceURLCommentStart = -1;
|
|
1059
|
+
if (sourceMapURLCommentStart < lastIndex) sourceMapURLCommentStart = -1;
|
|
1060
|
+
|
|
1061
|
+
// sourceURL first / only
|
|
1062
|
+
if (
|
|
1063
|
+
sourceURLCommentStart !== -1 &&
|
|
1064
|
+
(sourceMapURLCommentStart === -1 || sourceMapURLCommentStart > sourceURLCommentStart)
|
|
1065
|
+
) {
|
|
1066
|
+
pushSourceURL(load, sourceURLCommentPrefix, sourceURLCommentStart, dynamicImportEndStack);
|
|
1067
|
+
}
|
|
1068
|
+
// sourceMappingURL
|
|
1069
|
+
if (sourceMapURLCommentStart !== -1) {
|
|
1070
|
+
pushSourceURL(load, sourceMapURLCommentPrefix, sourceMapURLCommentStart, dynamicImportEndStack);
|
|
1071
|
+
// sourceURL last
|
|
1072
|
+
if (sourceURLCommentStart !== -1 && sourceURLCommentStart > sourceMapURLCommentStart)
|
|
1073
|
+
pushSourceURL(load, sourceURLCommentPrefix, sourceURLCommentStart, dynamicImportEndStack);
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
pushStringTo(load, source.length, dynamicImportEndStack);
|
|
1077
|
+
|
|
1078
|
+
if (sourceURLCommentStart === -1) resolvedSource += sourceURLCommentPrefix + load.r;
|
|
1079
|
+
|
|
1080
|
+
load.b = createBlob(resolvedSource);
|
|
1081
|
+
load.S = resolvedSource = undefined;
|
|
1082
|
+
};
|
|
1083
|
+
|
|
1084
|
+
const sourceURLCommentPrefix = '\n//# sourceURL=';
|
|
1085
|
+
const sourceMapURLCommentPrefix = '\n//# sourceMappingURL=';
|
|
1086
|
+
const cssUrlRegEx = /url\(\s*(?:(["'])((?:\\.|[^\n\\"'])+)\1|((?:\\.|[^\s,"'()\\])+))\s*\)/g;
|
|
1087
|
+
|
|
1088
|
+
// restrict in-flight fetches to a pool of 100
|
|
1089
|
+
let p = [];
|
|
1090
|
+
let c = 0;
|
|
1091
|
+
const pushFetchPool = () => {
|
|
1092
|
+
if (++c > 100) return new Promise(r => p.push(r));
|
|
1093
|
+
};
|
|
1094
|
+
const popFetchPool = () => {
|
|
1095
|
+
c--;
|
|
1096
|
+
if (p.length) p.shift()();
|
|
1097
|
+
};
|
|
1098
|
+
|
|
1099
|
+
const doFetch = async (url, fetchOpts, parent) => {
|
|
1100
|
+
if (enforceIntegrity && !fetchOpts.integrity) throw Error(`No integrity for ${url}${fromParent(parent)}.`);
|
|
1101
|
+
let res,
|
|
1102
|
+
poolQueue = pushFetchPool();
|
|
1103
|
+
if (poolQueue) await poolQueue;
|
|
1104
|
+
try {
|
|
1105
|
+
res = await fetchHook(url, fetchOpts);
|
|
1106
|
+
} catch (e) {
|
|
1107
|
+
e.message = `Unable to fetch ${url}${fromParent(parent)} - see network log for details.\n` + e.message;
|
|
1108
|
+
throw e;
|
|
1109
|
+
} finally {
|
|
1110
|
+
popFetchPool();
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
if (!res.ok) {
|
|
1114
|
+
const error = new TypeError(`${res.status} ${res.statusText} ${res.url}${fromParent(parent)}`);
|
|
1115
|
+
error.response = res;
|
|
1116
|
+
throw error;
|
|
1117
|
+
}
|
|
1118
|
+
return res;
|
|
1119
|
+
};
|
|
1120
|
+
|
|
1121
|
+
let esmsTsTransform;
|
|
1122
|
+
const initTs = async () => {
|
|
1123
|
+
const m = await import(tsTransform);
|
|
1124
|
+
if (!esmsTsTransform) esmsTsTransform = m.transform;
|
|
1125
|
+
};
|
|
1126
|
+
|
|
1127
|
+
async function defaultSourceHook(url, fetchOpts, parent) {
|
|
1128
|
+
let res = await doFetch(url, fetchOpts, parent),
|
|
1129
|
+
contentType,
|
|
1130
|
+
[, json, type, jsts] =
|
|
1131
|
+
(contentType = res.headers.get('content-type') || '').match(
|
|
1132
|
+
/^(?:[^/;]+\/(?:[^/+;]+\+)?(json)|(?:text|application)\/(?:x-)?((java|type)script|wasm|css))(?:;|$)/
|
|
1133
|
+
) || [];
|
|
1134
|
+
if (!(type = json || (jsts ? jsts[0] + 's' : type || (/\.m?ts(\?|#|$)/.test(url) && 'ts')))) {
|
|
1135
|
+
throw Error(
|
|
1136
|
+
`Unsupported Content-Type "${contentType}" loading ${url}${fromParent(parent)}. Modules must be served with a valid MIME type like application/javascript.`
|
|
1137
|
+
);
|
|
1138
|
+
}
|
|
1139
|
+
return {
|
|
1140
|
+
url: res.url,
|
|
1141
|
+
source: await (type > 'v' ? WebAssembly.compileStreaming(res) : res.text()),
|
|
1142
|
+
type
|
|
1143
|
+
};
|
|
1144
|
+
}
|
|
1145
|
+
|
|
1146
|
+
const hotPrefix = 'var h=import.meta.hot,';
|
|
1147
|
+
const fetchModule = async (reqUrl, fetchOpts, parent) => {
|
|
1148
|
+
const mapIntegrity = composedImportMap.integrity[reqUrl];
|
|
1149
|
+
fetchOpts = mapIntegrity && !fetchOpts.integrity ? { ...fetchOpts, integrity: mapIntegrity } : fetchOpts;
|
|
1150
|
+
let {
|
|
1151
|
+
url = reqUrl,
|
|
1152
|
+
source,
|
|
1153
|
+
type
|
|
1154
|
+
} = (await (sourceHook || defaultSourceHook)(reqUrl, fetchOpts, parent, defaultSourceHook)) || {};
|
|
1155
|
+
if (type === 'wasm') {
|
|
1156
|
+
const exports = WebAssembly.Module.exports((sourceCache[url] = source));
|
|
1157
|
+
const imports = WebAssembly.Module.imports(source);
|
|
1158
|
+
const rStr = urlJsString(url);
|
|
1159
|
+
source = `import*as $_ns from${rStr};`;
|
|
1160
|
+
let i = 0,
|
|
1161
|
+
obj = '';
|
|
1162
|
+
for (const { module, kind } of imports) {
|
|
1163
|
+
const specifier = urlJsString(module);
|
|
1164
|
+
source += `import*as impt${i} from${specifier};\n`;
|
|
1165
|
+
obj += `${specifier}:${kind === 'global' ? `importShim._i.get(impt${i})||impt${i++}` : `impt${i++}`},`;
|
|
1166
|
+
}
|
|
1167
|
+
source += `${hotPrefix}i=await WebAssembly.instantiate(importShim._s[${rStr}],{${obj}});importShim._i.set($_ns,i);`;
|
|
1168
|
+
obj = '';
|
|
1169
|
+
for (const { name, kind } of exports) {
|
|
1170
|
+
source += `export let ${name}=i.exports['${name}'];`;
|
|
1171
|
+
if (kind === 'global') source += `try{${name}=${name}.value}catch(_){${name}=undefined}`;
|
|
1172
|
+
obj += `${name},`;
|
|
1173
|
+
}
|
|
1174
|
+
source += `if(h)h.accept(m=>({${obj}}=m))`;
|
|
1175
|
+
} else if (type === 'json') {
|
|
1176
|
+
source = `${hotPrefix}j=JSON.parse(${JSON.stringify(source)});export{j as default};if(h)h.accept(m=>j=m.default)`;
|
|
1177
|
+
} else if (type === 'css') {
|
|
1178
|
+
source = `${hotPrefix}s=h&&h.data.s||new CSSStyleSheet();s.replaceSync(${JSON.stringify(
|
|
1179
|
+
source.replace(
|
|
1180
|
+
cssUrlRegEx,
|
|
1181
|
+
(_match, quotes = '', relUrl1, relUrl2) => `url(${quotes}${resolveUrl(relUrl1 || relUrl2, url)}${quotes})`
|
|
1182
|
+
)
|
|
1183
|
+
)});if(h){h.data.s=s;h.accept(()=>{})}export default s`;
|
|
1184
|
+
} else if (type === 'ts') {
|
|
1185
|
+
if (!esmsTsTransform) await initTs();
|
|
1186
|
+
const transformed = esmsTsTransform(source, url);
|
|
1187
|
+
// even if the TypeScript is valid JavaScript, unless it was a top-level inline source, it wasn't served with
|
|
1188
|
+
// a valid JS MIME here, so we must still polyfill it
|
|
1189
|
+
source = transformed === undefined ? source : transformed;
|
|
1190
|
+
}
|
|
1191
|
+
return { url, source, type };
|
|
1192
|
+
};
|
|
1193
|
+
|
|
1194
|
+
const getOrCreateLoad = (url, fetchOpts, parent, source) => {
|
|
1195
|
+
if (source && registry[url]) {
|
|
1196
|
+
let i = 0;
|
|
1197
|
+
while (registry[url + '#' + ++i]);
|
|
1198
|
+
url += '#' + i;
|
|
1199
|
+
}
|
|
1200
|
+
let load = registry[url];
|
|
1201
|
+
if (load) return load;
|
|
1202
|
+
registry[url] = load = {
|
|
1203
|
+
// url
|
|
1204
|
+
u: url,
|
|
1205
|
+
// response url
|
|
1206
|
+
r: source ? url : undefined,
|
|
1207
|
+
// fetchPromise
|
|
1208
|
+
f: undefined,
|
|
1209
|
+
// source
|
|
1210
|
+
S: source,
|
|
1211
|
+
// linkPromise
|
|
1212
|
+
L: undefined,
|
|
1213
|
+
// analysis
|
|
1214
|
+
a: undefined,
|
|
1215
|
+
// deps
|
|
1216
|
+
d: undefined,
|
|
1217
|
+
// blobUrl
|
|
1218
|
+
b: undefined,
|
|
1219
|
+
// shellUrl
|
|
1220
|
+
s: undefined,
|
|
1221
|
+
// needsShim: does it fail execution in the current native loader?
|
|
1222
|
+
n: false,
|
|
1223
|
+
// shouldShim: does it need to be loaded by the polyfill loader?
|
|
1224
|
+
N: false,
|
|
1225
|
+
// type
|
|
1226
|
+
t: null,
|
|
1227
|
+
// meta
|
|
1228
|
+
m: null
|
|
1229
|
+
};
|
|
1230
|
+
load.f = (async () => {
|
|
1231
|
+
if (load.S === undefined) {
|
|
1232
|
+
// preload fetch options override fetch options (race)
|
|
1233
|
+
({ url: load.r, source: load.S, type: load.t } = await (fetchCache[url] || fetchModule(url, fetchOpts, parent)));
|
|
1234
|
+
if (
|
|
1235
|
+
!load.n &&
|
|
1236
|
+
load.t !== 'js' &&
|
|
1237
|
+
!shimMode &&
|
|
1238
|
+
((load.t === 'css' && !supportsCssType) ||
|
|
1239
|
+
(load.t === 'json' && !supportsJsonType) ||
|
|
1240
|
+
(load.t === 'wasm' && !supportsWasmInstancePhase && !supportsWasmSourcePhase) ||
|
|
1241
|
+
load.t === 'ts')
|
|
1242
|
+
) {
|
|
1243
|
+
load.n = true;
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
try {
|
|
1247
|
+
load.a = parse(load.S, load.u);
|
|
1248
|
+
} catch (e) {
|
|
1249
|
+
throwError(e);
|
|
1250
|
+
load.a = [[], [], false];
|
|
1251
|
+
}
|
|
1252
|
+
return load;
|
|
1253
|
+
})();
|
|
1254
|
+
return load;
|
|
1255
|
+
};
|
|
1256
|
+
|
|
1257
|
+
const featErr = feat =>
|
|
1258
|
+
Error(
|
|
1259
|
+
`${feat} feature must be enabled via <script type="esms-options">{ "polyfillEnable": ["${feat}"] }<${''}/script>`
|
|
1260
|
+
);
|
|
1261
|
+
|
|
1262
|
+
const linkLoad = (load, fetchOpts) => {
|
|
1263
|
+
if (load.L) return;
|
|
1264
|
+
load.L = load.f.then(() => {
|
|
1265
|
+
let childFetchOpts = fetchOpts;
|
|
1266
|
+
load.d = load.a[0]
|
|
1267
|
+
.map(({ n, d, t, a, se }) => {
|
|
1268
|
+
const phaseImport = t >= 4;
|
|
1269
|
+
const sourcePhase = phaseImport && t < 6;
|
|
1270
|
+
if (phaseImport) {
|
|
1271
|
+
if (!shimMode && (sourcePhase ? !wasmSourcePhaseEnabled : !deferPhaseEnabled))
|
|
1272
|
+
throw featErr(sourcePhase ? 'wasm-module-sources' : 'import-defer');
|
|
1273
|
+
if (!sourcePhase || !supportsWasmSourcePhase) load.n = true;
|
|
1274
|
+
}
|
|
1275
|
+
let source = undefined;
|
|
1276
|
+
if (a > 0 && !shimMode && nativePassthrough) {
|
|
1277
|
+
const assertion = load.S.slice(a, se - 1);
|
|
1278
|
+
// no need to fetch JSON/CSS if supported, since it's a leaf node, we'll just strip the assertion syntax
|
|
1279
|
+
if (assertion.includes('json')) {
|
|
1280
|
+
if (supportsJsonType) source = '';
|
|
1281
|
+
else load.n = true;
|
|
1282
|
+
} else if (assertion.includes('css')) {
|
|
1283
|
+
if (supportsCssType) source = '';
|
|
1284
|
+
else load.n = true;
|
|
1285
|
+
}
|
|
1286
|
+
}
|
|
1287
|
+
if (d !== -1 || !n) return;
|
|
1288
|
+
const resolved = resolve(n, load.r || load.u);
|
|
1289
|
+
if (resolved.n || hasCustomizationHooks) load.n = true;
|
|
1290
|
+
if (d >= 0 || resolved.N) load.N = true;
|
|
1291
|
+
if (d !== -1) return;
|
|
1292
|
+
if (skip && skip(resolved.r) && !sourcePhase) return { l: { b: resolved.r }, s: false };
|
|
1293
|
+
if (childFetchOpts.integrity) childFetchOpts = { ...childFetchOpts, integrity: undefined };
|
|
1294
|
+
const child = { l: getOrCreateLoad(resolved.r, childFetchOpts, load.r, source), s: sourcePhase };
|
|
1295
|
+
// assertion case -> inline the CSS / JSON URL directly
|
|
1296
|
+
if (source === '') child.l.b = child.l.u;
|
|
1297
|
+
if (!child.s) linkLoad(child.l, fetchOpts);
|
|
1298
|
+
// load, sourcePhase
|
|
1299
|
+
return child;
|
|
1300
|
+
})
|
|
1301
|
+
.filter(l => l);
|
|
1302
|
+
});
|
|
1303
|
+
};
|
|
1304
|
+
|
|
1305
|
+
const processScriptsAndPreloads = () => {
|
|
1306
|
+
for (const link of document.querySelectorAll(shimMode ? 'link[rel=modulepreload-shim]' : 'link[rel=modulepreload]')) {
|
|
1307
|
+
if (!link.ep) processPreload(link);
|
|
1308
|
+
}
|
|
1309
|
+
for (const script of document.querySelectorAll('script[type]')) {
|
|
1310
|
+
if (script.type === 'importmap' + (shimMode ? '-shim' : '')) {
|
|
1311
|
+
if (!script.ep) processImportMap(script);
|
|
1312
|
+
} else if (script.type === 'module' + (shimMode ? '-shim' : '')) {
|
|
1313
|
+
legacyAcceptingImportMaps = false;
|
|
1314
|
+
if (!script.ep) processScript(script);
|
|
1315
|
+
}
|
|
1316
|
+
}
|
|
1317
|
+
};
|
|
1318
|
+
|
|
1319
|
+
const getFetchOpts = script => {
|
|
1320
|
+
const fetchOpts = {};
|
|
1321
|
+
if (script.integrity) fetchOpts.integrity = script.integrity;
|
|
1322
|
+
if (script.referrerPolicy) fetchOpts.referrerPolicy = script.referrerPolicy;
|
|
1323
|
+
if (script.fetchPriority) fetchOpts.priority = script.fetchPriority;
|
|
1324
|
+
if (script.crossOrigin === 'use-credentials') fetchOpts.credentials = 'include';
|
|
1325
|
+
else if (script.crossOrigin === 'anonymous') fetchOpts.credentials = 'omit';
|
|
1326
|
+
else fetchOpts.credentials = 'same-origin';
|
|
1327
|
+
return fetchOpts;
|
|
1328
|
+
};
|
|
1329
|
+
|
|
1330
|
+
let lastStaticLoadPromise = Promise.resolve();
|
|
1331
|
+
|
|
1332
|
+
let domContentLoaded = false;
|
|
1333
|
+
let domContentLoadedCnt = 1;
|
|
1334
|
+
const domContentLoadedCheck = m => {
|
|
1335
|
+
if (m === undefined) {
|
|
1336
|
+
if (domContentLoaded) return;
|
|
1337
|
+
domContentLoaded = true;
|
|
1338
|
+
domContentLoadedCnt--;
|
|
1339
|
+
}
|
|
1340
|
+
if (--domContentLoadedCnt === 0 && !noLoadEventRetriggers && (shimMode || !baselineSupport)) {
|
|
1341
|
+
document.removeEventListener('DOMContentLoaded', domContentLoadedEvent);
|
|
1342
|
+
document.dispatchEvent(new Event('DOMContentLoaded'));
|
|
1343
|
+
}
|
|
1344
|
+
};
|
|
1345
|
+
let loadCnt = 1;
|
|
1346
|
+
const loadCheck = () => {
|
|
1347
|
+
if (--loadCnt === 0 && !noLoadEventRetriggers && (shimMode || !baselineSupport)) {
|
|
1348
|
+
window.removeEventListener('load', loadEvent);
|
|
1349
|
+
window.dispatchEvent(new Event('load'));
|
|
1350
|
+
}
|
|
1351
|
+
};
|
|
1352
|
+
|
|
1353
|
+
const domContentLoadedEvent = async () => {
|
|
1354
|
+
await initPromise;
|
|
1355
|
+
domContentLoadedCheck();
|
|
1356
|
+
};
|
|
1357
|
+
const loadEvent = async () => {
|
|
1358
|
+
await initPromise;
|
|
1359
|
+
domContentLoadedCheck();
|
|
1360
|
+
loadCheck();
|
|
1361
|
+
};
|
|
1362
|
+
|
|
1363
|
+
// this should always trigger because we assume es-module-shims is itself a domcontentloaded requirement
|
|
1364
|
+
if (hasDocument) {
|
|
1365
|
+
document.addEventListener('DOMContentLoaded', domContentLoadedEvent);
|
|
1366
|
+
window.addEventListener('load', loadEvent);
|
|
1367
|
+
}
|
|
1368
|
+
|
|
1369
|
+
const readyListener = async () => {
|
|
1370
|
+
await initPromise;
|
|
1371
|
+
processScriptsAndPreloads();
|
|
1372
|
+
if (document.readyState === 'complete') {
|
|
1373
|
+
readyStateCompleteCheck();
|
|
1374
|
+
}
|
|
1375
|
+
};
|
|
1376
|
+
|
|
1377
|
+
let readyStateCompleteCnt = 1;
|
|
1378
|
+
const readyStateCompleteCheck = () => {
|
|
1379
|
+
if (--readyStateCompleteCnt === 0) {
|
|
1380
|
+
domContentLoadedCheck();
|
|
1381
|
+
if (!noLoadEventRetriggers && (shimMode || !baselineSupport)) {
|
|
1382
|
+
document.removeEventListener('readystatechange', readyListener);
|
|
1383
|
+
document.dispatchEvent(new Event('readystatechange'));
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
};
|
|
1387
|
+
|
|
1388
|
+
const hasNext = script => script.nextSibling || (script.parentNode && hasNext(script.parentNode));
|
|
1389
|
+
const epCheck = (script, ready) =>
|
|
1390
|
+
script.ep ||
|
|
1391
|
+
(!ready && ((!script.src && !script.innerHTML) || !hasNext(script))) ||
|
|
1392
|
+
script.getAttribute('noshim') !== null ||
|
|
1393
|
+
!(script.ep = true);
|
|
1394
|
+
|
|
1395
|
+
const processImportMap = (script, ready = readyStateCompleteCnt > 0) => {
|
|
1396
|
+
if (epCheck(script, ready)) return;
|
|
1397
|
+
// we dont currently support external import maps in polyfill mode to match native
|
|
1398
|
+
if (script.src) {
|
|
1399
|
+
if (!shimMode) return;
|
|
1400
|
+
importMapSrc = true;
|
|
1401
|
+
}
|
|
1402
|
+
importMapPromise = importMapPromise
|
|
1403
|
+
.then(async () => {
|
|
1404
|
+
composedImportMap = resolveAndComposeImportMap(
|
|
1405
|
+
script.src ? await (await doFetch(script.src, getFetchOpts(script))).json() : JSON.parse(script.innerHTML),
|
|
1406
|
+
script.src || baseUrl,
|
|
1407
|
+
composedImportMap
|
|
1408
|
+
);
|
|
1409
|
+
})
|
|
1410
|
+
.catch(e => {
|
|
1411
|
+
if (e instanceof SyntaxError)
|
|
1412
|
+
e = new Error(`Unable to parse import map ${e.message} in: ${script.src || script.innerHTML}`);
|
|
1413
|
+
throwError(e);
|
|
1414
|
+
});
|
|
1415
|
+
if (!firstImportMap && legacyAcceptingImportMaps) importMapPromise.then(() => (firstImportMap = composedImportMap));
|
|
1416
|
+
if (!legacyAcceptingImportMaps && !multipleImportMaps) {
|
|
1417
|
+
multipleImportMaps = true;
|
|
1418
|
+
if (!shimMode && baselineSupport && !supportsMultipleImportMaps) {
|
|
1419
|
+
baselineSupport = false;
|
|
1420
|
+
if (hasDocument) attachMutationObserver();
|
|
1421
|
+
}
|
|
1422
|
+
}
|
|
1423
|
+
legacyAcceptingImportMaps = false;
|
|
1424
|
+
};
|
|
1425
|
+
|
|
1426
|
+
const processScript = (script, ready = readyStateCompleteCnt > 0) => {
|
|
1427
|
+
if (epCheck(script, ready)) return;
|
|
1428
|
+
// does this load block readystate complete
|
|
1429
|
+
const isBlockingReadyScript = script.getAttribute('async') === null && readyStateCompleteCnt > 0;
|
|
1430
|
+
// does this load block DOMContentLoaded
|
|
1431
|
+
const isDomContentLoadedScript = domContentLoadedCnt > 0;
|
|
1432
|
+
const isLoadScript = loadCnt > 0;
|
|
1433
|
+
if (isLoadScript) loadCnt++;
|
|
1434
|
+
if (isBlockingReadyScript) readyStateCompleteCnt++;
|
|
1435
|
+
if (isDomContentLoadedScript) domContentLoadedCnt++;
|
|
1436
|
+
let loadPromise;
|
|
1437
|
+
const ts = script.lang === 'ts';
|
|
1438
|
+
if (ts && !script.src) {
|
|
1439
|
+
loadPromise = Promise.resolve(esmsTsTransform || initTs())
|
|
1440
|
+
.then(() => {
|
|
1441
|
+
const transformed = esmsTsTransform(script.innerHTML, baseUrl);
|
|
1442
|
+
if (transformed !== undefined) {
|
|
1443
|
+
onpolyfill();
|
|
1444
|
+
firstPolyfillLoad = false;
|
|
1445
|
+
}
|
|
1446
|
+
return topLevelLoad(
|
|
1447
|
+
script.src || baseUrl,
|
|
1448
|
+
baseUrl,
|
|
1449
|
+
getFetchOpts(script),
|
|
1450
|
+
transformed === undefined ? script.innerHTML : transformed,
|
|
1451
|
+
!shimMode && transformed === undefined,
|
|
1452
|
+
isBlockingReadyScript && lastStaticLoadPromise,
|
|
1453
|
+
'ts'
|
|
1454
|
+
);
|
|
1455
|
+
})
|
|
1456
|
+
.catch(throwError);
|
|
1457
|
+
} else {
|
|
1458
|
+
loadPromise = topLevelLoad(
|
|
1459
|
+
script.src || baseUrl,
|
|
1460
|
+
baseUrl,
|
|
1461
|
+
getFetchOpts(script),
|
|
1462
|
+
!script.src ? script.innerHTML : undefined,
|
|
1463
|
+
!shimMode,
|
|
1464
|
+
isBlockingReadyScript && lastStaticLoadPromise,
|
|
1465
|
+
ts ? 'ts' : undefined
|
|
1466
|
+
).catch(throwError);
|
|
1467
|
+
}
|
|
1468
|
+
if (!noLoadEventRetriggers) loadPromise.then(() => script.dispatchEvent(new Event('load')));
|
|
1469
|
+
if (isBlockingReadyScript && !ts) {
|
|
1470
|
+
lastStaticLoadPromise = loadPromise.then(readyStateCompleteCheck);
|
|
1471
|
+
}
|
|
1472
|
+
if (isDomContentLoadedScript) loadPromise.then(domContentLoadedCheck);
|
|
1473
|
+
if (isLoadScript) loadPromise.then(loadCheck);
|
|
1474
|
+
};
|
|
1475
|
+
|
|
1476
|
+
const fetchCache = {};
|
|
1477
|
+
const processPreload = link => {
|
|
1478
|
+
link.ep = true;
|
|
1479
|
+
initPromise.then(() => {
|
|
1480
|
+
if (baselineSupport && !shimMode) return;
|
|
1481
|
+
if (fetchCache[link.href]) return;
|
|
1482
|
+
fetchCache[link.href] = fetchModule(link.href, getFetchOpts(link));
|
|
1483
|
+
});
|
|
1482
1484
|
};
|
|
1483
1485
|
|
|
1484
1486
|
})();
|