importmap-rails 1.1.5 → 1.1.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- /* ES Module Shims 1.5.9 */
1
+ /* ES Module Shims 1.7.2 */
2
2
  (function () {
3
3
 
4
4
  const hasWindow = typeof window !== 'undefined';
@@ -18,8 +18,6 @@
18
18
  let fetchHook = esmsInitOptions.fetch ? globalHook(esmsInitOptions.fetch) : fetch;
19
19
  const metaHook = esmsInitOptions.meta ? globalHook(shimMode && esmsInitOptions.meta) : noop;
20
20
 
21
- const skip = esmsInitOptions.skip ? new RegExp(esmsInitOptions.skip) : null;
22
-
23
21
  const mapOverrides = esmsInitOptions.mapOverrides;
24
22
 
25
23
  let nonce = esmsInitOptions.nonce;
@@ -52,8 +50,15 @@
52
50
  ? location.pathname.slice(0, location.pathname.lastIndexOf('/') + 1)
53
51
  : location.pathname}`;
54
52
 
55
- function createBlob (source, type = 'text/javascript') {
56
- return URL.createObjectURL(new Blob([source], { type }));
53
+ const createBlob = (source, type = 'text/javascript') => URL.createObjectURL(new Blob([source], { type }));
54
+ let { skip } = esmsInitOptions;
55
+ if (Array.isArray(skip)) {
56
+ const l = skip.map(s => new URL(s, baseUrl).href);
57
+ skip = s => l.some(i => i[i.length - 1] === '/' && s.startsWith(i) || s === i);
58
+ }
59
+ else if (typeof skip === 'string') {
60
+ const r = new RegExp(skip);
61
+ skip = s => r.test(s);
57
62
  }
58
63
 
59
64
  const eoop = err => setTimeout(() => { throw err });
@@ -103,22 +108,14 @@
103
108
  }
104
109
  }
105
110
 
106
- /*
107
- * Import maps implementation
108
- *
109
- * To make lookups fast we pre-resolve the entire import map
110
- * and then match based on backtracked hash lookups
111
- *
112
- */
113
111
  function resolveUrl (relUrl, parentUrl) {
114
112
  return resolveIfNotPlainOrUrl(relUrl, parentUrl) || (isURL(relUrl) ? relUrl : resolveIfNotPlainOrUrl('./' + relUrl, parentUrl));
115
113
  }
116
114
 
117
115
  function resolveIfNotPlainOrUrl (relUrl, parentUrl) {
118
- // strip off any trailing query params or hashes
119
- const queryHashIndex = parentUrl.indexOf('?', parentUrl.indexOf('#') === -1 ? parentUrl.indexOf('#') : parentUrl.length);
120
- if (queryHashIndex !== -1)
121
- parentUrl = parentUrl.slice(0, queryHashIndex);
116
+ const hIdx = parentUrl.indexOf('#'), qIdx = parentUrl.indexOf('?');
117
+ if (hIdx + qIdx > -2)
118
+ parentUrl = parentUrl.slice(0, hIdx === -1 ? qIdx : qIdx === -1 || qIdx > hIdx ? hIdx : qIdx);
122
119
  if (relUrl.indexOf('\\') !== -1)
123
120
  relUrl = relUrl.replace(backslashRegEx, '/');
124
121
  // protocol-relative
@@ -260,89 +257,139 @@
260
257
  }
261
258
  }
262
259
 
263
- let err;
264
- window.addEventListener('error', _err => err = _err);
265
- function dynamicImportScript (url, { errUrl = url } = {}) {
266
- err = undefined;
267
- const src = createBlob(`import*as m from'${url}';self._esmsi=m`);
268
- const s = Object.assign(document.createElement('script'), { type: 'module', src, ep: true });
260
+ let dynamicImport = !hasDocument && (0, eval)('u=>import(u)');
261
+
262
+ let supportsDynamicImport;
263
+
264
+ const dynamicImportCheck = hasDocument && new Promise(resolve => {
265
+ const s = Object.assign(document.createElement('script'), {
266
+ src: createBlob('self._d=u=>import(u)'),
267
+ ep: true
268
+ });
269
269
  s.setAttribute('nonce', nonce);
270
- s.setAttribute('noshim', '');
271
- const p = new Promise((resolve, reject) => {
272
- // Safari is unique in supporting module script error events
273
- s.addEventListener('error', cb);
274
- s.addEventListener('load', cb);
275
-
276
- function cb (_err) {
277
- document.head.removeChild(s);
278
- if (self._esmsi) {
279
- resolve(self._esmsi, baseUrl);
280
- self._esmsi = undefined;
281
- }
282
- else {
283
- reject(!(_err instanceof Event) && _err || err && err.error || new Error(`Error loading or executing the graph of ${errUrl} (check the console for ${src}).`));
270
+ s.addEventListener('load', () => {
271
+ if (!(supportsDynamicImport = !!(dynamicImport = self._d))) {
272
+ let err;
273
+ window.addEventListener('error', _err => err = _err);
274
+ dynamicImport = (url, opts) => new Promise((resolve, reject) => {
275
+ const s = Object.assign(document.createElement('script'), {
276
+ type: 'module',
277
+ src: createBlob(`import*as m from'${url}';self._esmsi=m`)
278
+ });
284
279
  err = undefined;
285
- }
280
+ s.ep = true;
281
+ if (nonce)
282
+ s.setAttribute('nonce', nonce);
283
+ // Safari is unique in supporting module script error events
284
+ s.addEventListener('error', cb);
285
+ s.addEventListener('load', cb);
286
+ function cb (_err) {
287
+ document.head.removeChild(s);
288
+ if (self._esmsi) {
289
+ resolve(self._esmsi, baseUrl);
290
+ self._esmsi = undefined;
291
+ }
292
+ else {
293
+ reject(!(_err instanceof Event) && _err || err && err.error || new Error(`Error loading ${opts && opts.errUrl || url} (${s.src}).`));
294
+ err = undefined;
295
+ }
296
+ }
297
+ document.head.appendChild(s);
298
+ });
286
299
  }
300
+ document.head.removeChild(s);
301
+ delete self._d;
302
+ resolve();
287
303
  });
288
304
  document.head.appendChild(s);
289
- return p;
290
- }
291
-
292
- let dynamicImport = dynamicImportScript;
293
-
294
- const supportsDynamicImportCheck = dynamicImportScript(createBlob('export default u=>import(u)')).then(_dynamicImport => {
295
- if (_dynamicImport)
296
- dynamicImport = _dynamicImport.default;
297
- return !!_dynamicImport;
298
- }, noop);
305
+ });
299
306
 
300
307
  // support browsers without dynamic import support (eg Firefox 6x)
301
308
  let supportsJsonAssertions = false;
302
309
  let supportsCssAssertions = false;
303
310
 
304
- let supportsImportMaps = hasDocument && HTMLScriptElement.supports ? HTMLScriptElement.supports('importmap') : false;
305
- let supportsImportMeta = supportsImportMaps;
306
- let supportsDynamicImport = false;
311
+ const supports = hasDocument && HTMLScriptElement.supports;
312
+
313
+ let supportsImportMaps = supports && supports.name === 'supports' && supports('importmap');
314
+ let supportsImportMeta = supportsDynamicImport;
315
+
316
+ const importMetaCheck = 'import.meta';
317
+ const cssModulesCheck = `import"x"assert{type:"css"}`;
318
+ const jsonModulesCheck = `import"x"assert{type:"json"}`;
307
319
 
308
- const featureDetectionPromise = Promise.resolve(supportsImportMaps || supportsDynamicImportCheck).then(_supportsDynamicImport => {
309
- if (!_supportsDynamicImport)
320
+ let featureDetectionPromise = Promise.resolve(dynamicImportCheck).then(() => {
321
+ if (!supportsDynamicImport)
310
322
  return;
311
- supportsDynamicImport = true;
312
-
313
- return Promise.all([
314
- supportsImportMaps || dynamicImport(createBlob('import.meta')).then(() => supportsImportMeta = true, noop),
315
- cssModulesEnabled && dynamicImport(createBlob(`import"${createBlob('', 'text/css')}"assert{type:"css"}`)).then(() => supportsCssAssertions = true, noop),
316
- jsonModulesEnabled && dynamicImport(createBlob(`import"${createBlob('{}', 'text/json')}"assert{type:"json"}`)).then(() => supportsJsonAssertions = true, noop),
317
- supportsImportMaps || hasDocument && (HTMLScriptElement.supports || new Promise(resolve => {
318
- const iframe = document.createElement('iframe');
319
- iframe.style.display = 'none';
320
- iframe.setAttribute('nonce', nonce);
321
- // setting src to a blob URL results in a navigation event in webviews
322
- // setting srcdoc is not supported in React native webviews on iOS
323
- // therefore, we need to first feature detect srcdoc support
324
- iframe.srcdoc = `<!doctype html><script nonce="${nonce}"><${''}/script>`;
325
- document.head.appendChild(iframe);
326
- iframe.onload = () => {
327
- self._$s = v => {
328
- document.head.removeChild(iframe);
329
- supportsImportMaps = v;
330
- delete self._$s;
331
- resolve();
332
- };
333
- const supportsSrcDoc = iframe.contentDocument.head.childNodes.length > 0;
334
- const importMapTest = `<!doctype html><script type=importmap nonce="${nonce}">{"imports":{"x":"${createBlob('')}"}<${''}/script><script nonce="${nonce}">import('x').catch(() => {}).then(v=>parent._$s(!!v))<${''}/script>`;
335
- if (supportsSrcDoc)
336
- iframe.srcdoc = importMapTest;
337
- else
338
- iframe.contentDocument.write(importMapTest);
339
- };
340
- }))
341
- ]);
323
+
324
+ if (!hasDocument)
325
+ return Promise.all([
326
+ supportsImportMaps || dynamicImport(createBlob(importMetaCheck)).then(() => supportsImportMeta = true, noop),
327
+ cssModulesEnabled && dynamicImport(createBlob(cssModulesCheck.replace('x', createBlob('', 'text/css')))).then(() => supportsCssAssertions = true, noop),
328
+ jsonModulesEnabled && dynamicImport(createBlob(jsonModulescheck.replace('x', createBlob('{}', 'text/json')))).then(() => supportsJsonAssertions = true, noop),
329
+ ]);
330
+
331
+ return new Promise(resolve => {
332
+ const iframe = document.createElement('iframe');
333
+ iframe.style.display = 'none';
334
+ iframe.setAttribute('nonce', nonce);
335
+ function cb ({ data }) {
336
+ const isFeatureDetectionMessage = Array.isArray(data) && data[0] === 'esms';
337
+ if (!isFeatureDetectionMessage) {
338
+ return;
339
+ }
340
+ supportsImportMaps = data[1];
341
+ supportsImportMeta = data[2];
342
+ supportsCssAssertions = data[3];
343
+ supportsJsonAssertions = data[4];
344
+ resolve();
345
+ document.head.removeChild(iframe);
346
+ window.removeEventListener('message', cb, false);
347
+ }
348
+ window.addEventListener('message', cb, false);
349
+
350
+ const importMapTest = `<script nonce=${nonce || ''}>b=(s,type='text/javascript')=>URL.createObjectURL(new Blob([s],{type}));document.head.appendChild(Object.assign(document.createElement('script'),{type:'importmap',nonce:"${nonce}",innerText:\`{"imports":{"x":"\${b('')}"}}\`}));Promise.all([${
351
+ supportsImportMaps ? 'true,true' : `'x',b('${importMetaCheck}')`}, ${cssModulesEnabled ? `b('${cssModulesCheck}'.replace('x',b('','text/css')))` : 'false'}, ${
352
+ jsonModulesEnabled ? `b('${jsonModulesCheck}'.replace('x',b('{}','text/json')))` : 'false'}].map(x =>typeof x==='string'?import(x).then(x =>!!x,()=>false):x)).then(a=>parent.postMessage(['esms'].concat(a),'*'))<${''}/script>`;
353
+
354
+ // Safari will call onload eagerly on head injection, but we don't want the Wechat
355
+ // path to trigger before setting srcdoc, therefore we track the timing
356
+ let readyForOnload = false, onloadCalledWhileNotReady = false;
357
+ function doOnload () {
358
+ if (!readyForOnload) {
359
+ onloadCalledWhileNotReady = true;
360
+ return;
361
+ }
362
+ // WeChat browser doesn't support setting srcdoc scripts
363
+ // But iframe sandboxes don't support contentDocument so we do this as a fallback
364
+ const doc = iframe.contentDocument;
365
+ if (doc && doc.head.childNodes.length === 0) {
366
+ const s = doc.createElement('script');
367
+ if (nonce)
368
+ s.setAttribute('nonce', nonce);
369
+ s.innerHTML = importMapTest.slice(15 + (nonce ? nonce.length : 0), -9);
370
+ doc.head.appendChild(s);
371
+ }
372
+ }
373
+
374
+ iframe.onload = doOnload;
375
+ // WeChat browser requires append before setting srcdoc
376
+ document.head.appendChild(iframe);
377
+
378
+ // setting srcdoc is not supported in React native webviews on iOS
379
+ // setting src to a blob URL results in a navigation event in webviews
380
+ // document.write gives usability warnings
381
+ readyForOnload = true;
382
+ if ('srcdoc' in iframe)
383
+ iframe.srcdoc = importMapTest;
384
+ else
385
+ iframe.contentDocument.write(importMapTest);
386
+ // retrigger onload for Safari only if necessary
387
+ if (onloadCalledWhileNotReady) doOnload();
388
+ });
342
389
  });
343
390
 
344
- /* es-module-lexer 0.10.5 */
345
- let e,a,r,s=2<<19;const i=1===new Uint8Array(new Uint16Array([1]).buffer)[0]?function(e,a){const r=e.length;let s=0;for(;s<r;)a[s]=e.charCodeAt(s++);}:function(e,a){const r=e.length;let s=0;for(;s<r;){const r=e.charCodeAt(s);a[s++]=(255&r)<<8|r>>>8;}},t="xportmportlassetafromssertvoyiedeleinstantyreturdebuggeawaithrwhileforifcatcfinallels";let c$1,f,n;function parse(k,l="@"){c$1=k,f=l;const u=2*c$1.length+(2<<18);if(u>s||!e){for(;u>s;)s*=2;a=new ArrayBuffer(s),i(t,new Uint16Array(a,16,85)),e=function(e,a,r){"use asm";var s=new e.Int8Array(r),i=new e.Int16Array(r),t=new e.Int32Array(r),c=new e.Uint8Array(r),f=new e.Uint16Array(r),n=992;function b(e){e=e|0;var a=0,r=0,c=0,b=0,u=0,w=0,v=0;v=n;n=n+11520|0;u=v+2048|0;s[763]=1;i[377]=0;i[378]=0;i[379]=0;i[380]=-1;t[57]=t[2];s[764]=0;t[56]=0;s[762]=0;t[58]=v+10496;t[59]=v+2304;t[60]=v;s[765]=0;e=(t[3]|0)+-2|0;t[61]=e;a=e+(t[54]<<1)|0;t[62]=a;e:while(1){r=e+2|0;t[61]=r;if(e>>>0>=a>>>0){b=18;break}a:do{switch(i[r>>1]|0){case 9:case 10:case 11:case 12:case 13:case 32:break;case 101:{if((((i[379]|0)==0?D(r)|0:0)?(m(e+4|0,16,10)|0)==0:0)?(k(),(s[763]|0)==0):0){b=9;break e}else b=17;break}case 105:{if(D(r)|0?(m(e+4|0,26,10)|0)==0:0){l();b=17;}else b=17;break}case 59:{b=17;break}case 47:switch(i[e+4>>1]|0){case 47:{j();break a}case 42:{y(1);break a}default:{b=16;break e}}default:{b=16;break e}}}while(0);if((b|0)==17){b=0;t[57]=t[61];}e=t[61]|0;a=t[62]|0;}if((b|0)==9){e=t[61]|0;t[57]=e;b=19;}else if((b|0)==16){s[763]=0;t[61]=e;b=19;}else if((b|0)==18)if(!(s[762]|0)){e=r;b=19;}else e=0;do{if((b|0)==19){e:while(1){a=e+2|0;t[61]=a;c=a;if(e>>>0>=(t[62]|0)>>>0){b=75;break}a:do{switch(i[a>>1]|0){case 9:case 10:case 11:case 12:case 13:case 32:break;case 101:{if(((i[379]|0)==0?D(a)|0:0)?(m(e+4|0,16,10)|0)==0:0){k();b=74;}else b=74;break}case 105:{if(D(a)|0?(m(e+4|0,26,10)|0)==0:0){l();b=74;}else b=74;break}case 99:{if((D(a)|0?(m(e+4|0,36,8)|0)==0:0)?M(i[e+12>>1]|0)|0:0){s[765]=1;b=74;}else b=74;break}case 40:{r=t[57]|0;c=t[59]|0;b=i[379]|0;i[379]=b+1<<16>>16;t[c+((b&65535)<<2)>>2]=r;b=74;break}case 41:{a=i[379]|0;if(!(a<<16>>16)){b=36;break e}a=a+-1<<16>>16;i[379]=a;r=i[378]|0;if(r<<16>>16!=0?(w=t[(t[60]|0)+((r&65535)+-1<<2)>>2]|0,(t[w+20>>2]|0)==(t[(t[59]|0)+((a&65535)<<2)>>2]|0)):0){a=w+4|0;if(!(t[a>>2]|0))t[a>>2]=c;t[w+12>>2]=e+4;i[378]=r+-1<<16>>16;b=74;}else b=74;break}case 123:{b=t[57]|0;c=t[51]|0;e=b;do{if((i[b>>1]|0)==41&(c|0)!=0?(t[c+4>>2]|0)==(b|0):0){a=t[52]|0;t[51]=a;if(!a){t[47]=0;break}else {t[a+28>>2]=0;break}}}while(0);r=i[379]|0;b=r&65535;s[u+b>>0]=s[765]|0;s[765]=0;c=t[59]|0;i[379]=r+1<<16>>16;t[c+(b<<2)>>2]=e;b=74;break}case 125:{e=i[379]|0;if(!(e<<16>>16)){b=49;break e}r=e+-1<<16>>16;i[379]=r;a=i[380]|0;if(e<<16>>16!=a<<16>>16)if(a<<16>>16!=-1&(r&65535)<(a&65535)){b=53;break e}else {b=74;break a}else {c=t[58]|0;b=(i[377]|0)+-1<<16>>16;i[377]=b;i[380]=i[c+((b&65535)<<1)>>1]|0;h();b=74;break a}}case 39:{d(39);b=74;break}case 34:{d(34);b=74;break}case 47:switch(i[e+4>>1]|0){case 47:{j();break a}case 42:{y(1);break a}default:{a=t[57]|0;r=i[a>>1]|0;r:do{if(!(U(r)|0)){switch(r<<16>>16){case 41:if(q(t[(t[59]|0)+(f[379]<<2)>>2]|0)|0){b=71;break r}else {b=68;break r}case 125:break;default:{b=68;break r}}e=f[379]|0;if(!(p(t[(t[59]|0)+(e<<2)>>2]|0)|0)?(s[u+e>>0]|0)==0:0)b=68;else b=71;}else switch(r<<16>>16){case 46:if(((i[a+-2>>1]|0)+-48&65535)<10){b=68;break r}else {b=71;break r}case 43:if((i[a+-2>>1]|0)==43){b=68;break r}else {b=71;break r}case 45:if((i[a+-2>>1]|0)==45){b=68;break r}else {b=71;break r}default:{b=71;break r}}}while(0);r:do{if((b|0)==68){b=0;if(!(o(a)|0)){switch(r<<16>>16){case 0:{b=71;break r}case 47:break;default:{e=1;break r}}if(!(s[764]|0))e=1;else b=71;}else b=71;}}while(0);if((b|0)==71){g();e=0;}s[764]=e;b=74;break a}}case 96:{h();b=74;break}default:b=74;}}while(0);if((b|0)==74){b=0;t[57]=t[61];}e=t[61]|0;}if((b|0)==36){L();e=0;break}else if((b|0)==49){L();e=0;break}else if((b|0)==53){L();e=0;break}else if((b|0)==75){e=(i[380]|0)==-1&(i[379]|0)==0&(s[762]|0)==0&(i[378]|0)==0;break}}}while(0);n=v;return e|0}function k(){var e=0,a=0,r=0,c=0,f=0,n=0;f=t[61]|0;n=f+12|0;t[61]=n;a=w(1)|0;e=t[61]|0;if(!((e|0)==(n|0)?!(I(a)|0):0))c=3;e:do{if((c|0)==3){a:do{switch(a<<16>>16){case 100:{B(e,e+14|0);break e}case 97:{t[61]=e+10;w(1)|0;e=t[61]|0;c=6;break}case 102:{c=6;break}case 99:{if((m(e+2|0,36,8)|0)==0?(r=e+10|0,$(i[r>>1]|0)|0):0){t[61]=r;f=w(1)|0;n=t[61]|0;E(f)|0;B(n,t[61]|0);t[61]=(t[61]|0)+-2;break e}e=e+4|0;t[61]=e;c=13;break}case 108:case 118:{c=13;break}case 123:{t[61]=e+2;e=w(1)|0;r=t[61]|0;while(1){if(N(e)|0){d(e);e=(t[61]|0)+2|0;t[61]=e;}else {E(e)|0;e=t[61]|0;}w(1)|0;e=C(r,e)|0;if(e<<16>>16==44){t[61]=(t[61]|0)+2;e=w(1)|0;}a=r;r=t[61]|0;if(e<<16>>16==125){c=32;break}if((r|0)==(a|0)){c=29;break}if(r>>>0>(t[62]|0)>>>0){c=31;break}}if((c|0)==29){L();break e}else if((c|0)==31){L();break e}else if((c|0)==32){t[61]=r+2;c=34;break a}break}case 42:{t[61]=e+2;w(1)|0;c=t[61]|0;C(c,c)|0;c=34;break}default:{}}}while(0);if((c|0)==6){t[61]=e+16;e=w(1)|0;if(e<<16>>16==42){t[61]=(t[61]|0)+2;e=w(1)|0;}n=t[61]|0;E(e)|0;B(n,t[61]|0);t[61]=(t[61]|0)+-2;break}else if((c|0)==13){e=e+4|0;t[61]=e;s[763]=0;a:while(1){t[61]=e+2;n=w(1)|0;e=t[61]|0;switch((E(n)|0)<<16>>16){case 91:case 123:{c=15;break a}default:{}}a=t[61]|0;if((a|0)==(e|0))break e;B(e,a);switch((w(1)|0)<<16>>16){case 61:{c=19;break a}case 44:break;default:{c=20;break a}}e=t[61]|0;}if((c|0)==15){t[61]=(t[61]|0)+-2;break}else if((c|0)==19){t[61]=(t[61]|0)+-2;break}else if((c|0)==20){t[61]=(t[61]|0)+-2;break}}else if((c|0)==34)a=w(1)|0;e=t[61]|0;if(a<<16>>16==102?(m(e+2|0,52,6)|0)==0:0){t[61]=e+8;u(f,w(1)|0);break}t[61]=e+-2;}}while(0);return}function l(){var e=0,a=0,r=0,c=0,f=0;f=t[61]|0;a=f+12|0;t[61]=a;e:do{switch((w(1)|0)<<16>>16){case 40:{e=t[61]|0;a=t[59]|0;r=i[379]|0;i[379]=r+1<<16>>16;t[a+((r&65535)<<2)>>2]=e;if((i[t[57]>>1]|0)!=46){e=t[61]|0;t[61]=e+2;r=w(1)|0;v(f,t[61]|0,0,e);e=t[51]|0;a=t[60]|0;f=i[378]|0;i[378]=f+1<<16>>16;t[a+((f&65535)<<2)>>2]=e;switch(r<<16>>16){case 39:{d(39);break}case 34:{d(34);break}default:{t[61]=(t[61]|0)+-2;break e}}e=(t[61]|0)+2|0;t[61]=e;switch((w(1)|0)<<16>>16){case 44:{t[61]=(t[61]|0)+2;w(1)|0;r=t[51]|0;t[r+4>>2]=e;f=t[61]|0;t[r+16>>2]=f;s[r+24>>0]=1;t[61]=f+-2;break e}case 41:{i[379]=(i[379]|0)+-1<<16>>16;f=t[51]|0;t[f+4>>2]=e;t[f+12>>2]=(t[61]|0)+2;s[f+24>>0]=1;i[378]=(i[378]|0)+-1<<16>>16;break e}default:{t[61]=(t[61]|0)+-2;break e}}}break}case 46:{t[61]=(t[61]|0)+2;if(((w(1)|0)<<16>>16==109?(e=t[61]|0,(m(e+2|0,44,6)|0)==0):0)?(i[t[57]>>1]|0)!=46:0)v(f,f,e+8|0,2);break}case 42:case 39:case 34:{c=16;break}case 123:{e=t[61]|0;if(i[379]|0){t[61]=e+-2;break e}while(1){if(e>>>0>=(t[62]|0)>>>0)break;e=w(1)|0;if(!(N(e)|0)){if(e<<16>>16==125){c=31;break}}else d(e);e=(t[61]|0)+2|0;t[61]=e;}if((c|0)==31)t[61]=(t[61]|0)+2;w(1)|0;e=t[61]|0;if(m(e,50,8)|0){L();break e}t[61]=e+8;e=w(1)|0;if(N(e)|0){u(f,e);break e}else {L();break e}}default:if((t[61]|0)!=(a|0))c=16;}}while(0);do{if((c|0)==16){if(i[379]|0){t[61]=(t[61]|0)+-2;break}e=t[62]|0;a=t[61]|0;while(1){if(a>>>0>=e>>>0){c=23;break}r=i[a>>1]|0;if(N(r)|0){c=21;break}c=a+2|0;t[61]=c;a=c;}if((c|0)==21){u(f,r);break}else if((c|0)==23){L();break}}}while(0);return}function u(e,a){e=e|0;a=a|0;var r=0,s=0;r=(t[61]|0)+2|0;switch(a<<16>>16){case 39:{d(39);s=5;break}case 34:{d(34);s=5;break}default:L();}do{if((s|0)==5){v(e,r,t[61]|0,1);t[61]=(t[61]|0)+2;s=(w(0)|0)<<16>>16==97;a=t[61]|0;if(s?(m(a+2|0,58,10)|0)==0:0){t[61]=a+12;if((w(1)|0)<<16>>16!=123){t[61]=a;break}e=t[61]|0;r=e;e:while(1){t[61]=r+2;r=w(1)|0;switch(r<<16>>16){case 39:{d(39);t[61]=(t[61]|0)+2;r=w(1)|0;break}case 34:{d(34);t[61]=(t[61]|0)+2;r=w(1)|0;break}default:r=E(r)|0;}if(r<<16>>16!=58){s=16;break}t[61]=(t[61]|0)+2;switch((w(1)|0)<<16>>16){case 39:{d(39);break}case 34:{d(34);break}default:{s=20;break e}}t[61]=(t[61]|0)+2;switch((w(1)|0)<<16>>16){case 125:{s=25;break e}case 44:break;default:{s=24;break e}}t[61]=(t[61]|0)+2;if((w(1)|0)<<16>>16==125){s=25;break}r=t[61]|0;}if((s|0)==16){t[61]=a;break}else if((s|0)==20){t[61]=a;break}else if((s|0)==24){t[61]=a;break}else if((s|0)==25){s=t[51]|0;t[s+16>>2]=e;t[s+12>>2]=(t[61]|0)+2;break}}t[61]=a+-2;}}while(0);return}function o(e){e=e|0;e:do{switch(i[e>>1]|0){case 100:switch(i[e+-2>>1]|0){case 105:{e=S(e+-4|0,68,2)|0;break e}case 108:{e=S(e+-4|0,72,3)|0;break e}default:{e=0;break e}}case 101:{switch(i[e+-2>>1]|0){case 115:break;case 116:{e=S(e+-4|0,78,4)|0;break e}default:{e=0;break e}}switch(i[e+-4>>1]|0){case 108:{e=O(e+-6|0,101)|0;break e}case 97:{e=O(e+-6|0,99)|0;break e}default:{e=0;break e}}}case 102:{if((i[e+-2>>1]|0)==111?(i[e+-4>>1]|0)==101:0)switch(i[e+-6>>1]|0){case 99:{e=S(e+-8|0,86,6)|0;break e}case 112:{e=S(e+-8|0,98,2)|0;break e}default:{e=0;break e}}else e=0;break}case 110:{e=e+-2|0;if(O(e,105)|0)e=1;else e=S(e,102,5)|0;break}case 111:{e=O(e+-2|0,100)|0;break}case 114:{e=S(e+-2|0,112,7)|0;break}case 116:{e=S(e+-2|0,126,4)|0;break}case 119:switch(i[e+-2>>1]|0){case 101:{e=O(e+-4|0,110)|0;break e}case 111:{e=S(e+-4|0,134,3)|0;break e}default:{e=0;break e}}default:e=0;}}while(0);return e|0}function h(){var e=0,a=0,r=0;a=t[62]|0;r=t[61]|0;e:while(1){e=r+2|0;if(r>>>0>=a>>>0){a=8;break}switch(i[e>>1]|0){case 96:{a=9;break e}case 36:{if((i[r+4>>1]|0)==123){a=6;break e}break}case 92:{e=r+4|0;break}default:{}}r=e;}if((a|0)==6){t[61]=r+4;e=i[380]|0;a=t[58]|0;r=i[377]|0;i[377]=r+1<<16>>16;i[a+((r&65535)<<1)>>1]=e;r=(i[379]|0)+1<<16>>16;i[379]=r;i[380]=r;}else if((a|0)==8){t[61]=e;L();}else if((a|0)==9)t[61]=e;return}function w(e){e=e|0;var a=0,r=0,s=0;r=t[61]|0;e:do{a=i[r>>1]|0;a:do{if(a<<16>>16!=47)if(e)if(M(a)|0)break;else break e;else if(z(a)|0)break;else break e;else switch(i[r+2>>1]|0){case 47:{j();break a}case 42:{y(e);break a}default:{a=47;break e}}}while(0);s=t[61]|0;r=s+2|0;t[61]=r;}while(s>>>0<(t[62]|0)>>>0);return a|0}function d(e){e=e|0;var a=0,r=0,s=0,c=0;c=t[62]|0;a=t[61]|0;while(1){s=a+2|0;if(a>>>0>=c>>>0){a=9;break}r=i[s>>1]|0;if(r<<16>>16==e<<16>>16){a=10;break}if(r<<16>>16==92){r=a+4|0;if((i[r>>1]|0)==13){a=a+6|0;a=(i[a>>1]|0)==10?a:r;}else a=r;}else if(T(r)|0){a=9;break}else a=s;}if((a|0)==9){t[61]=s;L();}else if((a|0)==10)t[61]=s;return}function v(e,a,r,i){e=e|0;a=a|0;r=r|0;i=i|0;var c=0,f=0;c=t[55]|0;t[55]=c+32;f=t[51]|0;t[((f|0)==0?188:f+28|0)>>2]=c;t[52]=f;t[51]=c;t[c+8>>2]=e;if(2==(i|0))e=r;else e=1==(i|0)?r+2|0:0;t[c+12>>2]=e;t[c>>2]=a;t[c+4>>2]=r;t[c+16>>2]=0;t[c+20>>2]=i;s[c+24>>0]=1==(i|0)&1;t[c+28>>2]=0;return}function A(){var e=0,a=0,r=0;r=t[62]|0;a=t[61]|0;e:while(1){e=a+2|0;if(a>>>0>=r>>>0){a=6;break}switch(i[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){t[61]=e;L();e=0;}else if((a|0)==7){t[61]=e;e=93;}return e|0}function C(e,a){e=e|0;a=a|0;var r=0,s=0;r=t[61]|0;s=i[r>>1]|0;if(s<<16>>16==97){t[61]=r+4;r=w(1)|0;e=t[61]|0;if(N(r)|0){d(r);a=(t[61]|0)+2|0;t[61]=a;}else {E(r)|0;a=t[61]|0;}s=w(1)|0;r=t[61]|0;}if((r|0)!=(e|0))B(e,a);return s|0}function g(){var e=0,a=0,r=0;e:while(1){e=t[61]|0;a=e+2|0;t[61]=a;if(e>>>0>=(t[62]|0)>>>0){r=7;break}switch(i[a>>1]|0){case 13:case 10:{r=7;break e}case 47:break e;case 91:{A()|0;break}case 92:{t[61]=e+4;break}default:{}}}if((r|0)==7)L();return}function p(e){e=e|0;switch(i[e>>1]|0){case 62:{e=(i[e+-2>>1]|0)==61;break}case 41:case 59:{e=1;break}case 104:{e=S(e+-2|0,160,4)|0;break}case 121:{e=S(e+-2|0,168,6)|0;break}case 101:{e=S(e+-2|0,180,3)|0;break}default:e=0;}return e|0}function y(e){e=e|0;var a=0,r=0,s=0,c=0,f=0;c=(t[61]|0)+2|0;t[61]=c;r=t[62]|0;while(1){a=c+2|0;if(c>>>0>=r>>>0)break;s=i[a>>1]|0;if(!e?T(s)|0:0)break;if(s<<16>>16==42?(i[c+4>>1]|0)==47:0){f=8;break}c=a;}if((f|0)==8){t[61]=a;a=c+4|0;}t[61]=a;return}function m(e,a,r){e=e|0;a=a|0;r=r|0;var i=0,t=0;e:do{if(!r)e=0;else {while(1){i=s[e>>0]|0;t=s[a>>0]|0;if(i<<24>>24!=t<<24>>24)break;r=r+-1|0;if(!r){e=0;break e}else {e=e+1|0;a=a+1|0;}}e=(i&255)-(t&255)|0;}}while(0);return e|0}function I(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 U(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 x(e){e=e|0;var a=0,r=0,s=0,c=0;r=n;n=n+16|0;s=r;t[s>>2]=0;t[54]=e;a=t[3]|0;c=a+(e<<1)|0;e=c+2|0;i[c>>1]=0;t[s>>2]=e;t[55]=e;t[47]=0;t[51]=0;t[49]=0;t[48]=0;t[53]=0;t[50]=0;n=r;return a|0}function S(e,a,r){e=e|0;a=a|0;r=r|0;var s=0,c=0;s=e+(0-r<<1)|0;c=s+2|0;e=t[3]|0;if(c>>>0>=e>>>0?(m(c,a,r<<1)|0)==0:0)if((c|0)==(e|0))e=1;else e=$(i[s>>1]|0)|0;else e=0;return e|0}function O(e,a){e=e|0;a=a|0;var r=0;r=t[3]|0;if(r>>>0<=e>>>0?(i[e>>1]|0)==a<<16>>16:0)if((r|0)==(e|0))r=1;else r=$(i[e+-2>>1]|0)|0;else r=0;return r|0}function $(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&(I(e)|0);}}while(0);return e|0}function j(){var e=0,a=0,r=0;e=t[62]|0;r=t[61]|0;e:while(1){a=r+2|0;if(r>>>0>=e>>>0)break;switch(i[a>>1]|0){case 13:case 10:break e;default:r=a;}}t[61]=a;return}function B(e,a){e=e|0;a=a|0;var r=0,s=0;r=t[55]|0;t[55]=r+12;s=t[53]|0;t[((s|0)==0?192:s+8|0)>>2]=r;t[53]=r;t[r>>2]=e;t[r+4>>2]=a;t[r+8>>2]=0;return}function E(e){e=e|0;while(1){if(M(e)|0)break;if(I(e)|0)break;e=(t[61]|0)+2|0;t[61]=e;e=i[e>>1]|0;if(!(e<<16>>16)){e=0;break}}return e|0}function P(){var e=0;e=t[(t[49]|0)+20>>2]|0;switch(e|0){case 1:{e=-1;break}case 2:{e=-2;break}default:e=e-(t[3]|0)>>1;}return e|0}function q(e){e=e|0;if(!(S(e,140,5)|0)?!(S(e,150,3)|0):0)e=S(e,156,2)|0;else e=1;return e|0}function z(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 D(e){e=e|0;if((t[3]|0)==(e|0))e=1;else e=$(i[e+-2>>1]|0)|0;return e|0}function F(){var e=0;e=t[(t[49]|0)+12>>2]|0;if(!e)e=-1;else e=e-(t[3]|0)>>1;return e|0}function G(){var e=0;e=t[(t[49]|0)+16>>2]|0;if(!e)e=-1;else e=e-(t[3]|0)>>1;return e|0}function H(){var e=0;e=t[(t[49]|0)+4>>2]|0;if(!e)e=-1;else e=e-(t[3]|0)>>1;return e|0}function J(){var e=0;e=t[49]|0;e=t[((e|0)==0?188:e+28|0)>>2]|0;t[49]=e;return (e|0)!=0|0}function K(){var e=0;e=t[50]|0;e=t[((e|0)==0?192:e+8|0)>>2]|0;t[50]=e;return (e|0)!=0|0}function L(){s[762]=1;t[56]=(t[61]|0)-(t[3]|0)>>1;t[61]=(t[62]|0)+2;return}function M(e){e=e|0;return (e|128)<<16>>16==160|(e+-9&65535)<5|0}function N(e){e=e|0;return e<<16>>16==39|e<<16>>16==34|0}function Q(){return (t[(t[49]|0)+8>>2]|0)-(t[3]|0)>>1|0}function R(){return (t[(t[50]|0)+4>>2]|0)-(t[3]|0)>>1|0}function T(e){e=e|0;return e<<16>>16==13|e<<16>>16==10|0}function V(){return (t[t[49]>>2]|0)-(t[3]|0)>>1|0}function W(){return (t[t[50]>>2]|0)-(t[3]|0)>>1|0}function X(){return c[(t[49]|0)+24>>0]|0|0}function Y(e){e=e|0;t[3]=e;return}function Z(){return (s[763]|0)!=0|0}function _(){return t[56]|0}function ee(e){e=e|0;n=e+992+15&-16;return 992}return {su:ee,ai:G,e:_,ee:R,es:W,f:Z,id:P,ie:H,ip:X,is:V,p:b,re:K,ri:J,sa:x,se:F,ses:Y,ss:Q}}("undefined"!=typeof self?self:global,{},a),r=e.su(s-(2<<17));}const h=c$1.length+1;e.ses(r),e.sa(h-1),i(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(),s=e.ai(),i=e.id(),t=e.ss(),f=e.se();let n;e.ip()&&(n=b(-1===i?a:a+1,c$1.charCodeAt(-1===i?a-1:a))),w.push({n:n,s:a,e:r,ss:t,se:f,d:i,a:s});}for(;e.re();){const a=e.es(),r=c$1.charCodeAt(a);d.push(34===r||39===r?b(a+1,r):c$1.slice(e.es(),e.ee()));}return [w,d,!!e.f()]}function b(e,a){n=e;let r="",s=n;for(;;){n>=c$1.length&&o();const e=c$1.charCodeAt(n);if(e===a)break;92===e?(r+=c$1.slice(s,n),r+=k(),s=n):(8232===e||8233===e||u(e)&&o(),++n);}return r+=c$1.slice(s,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(){let e;123===c$1.charCodeAt(n)?(++n,e=l(c$1.indexOf("}",n)-n),++n,e>1114111&&o()):e=l(4);return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}();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,s=0;for(let a=0;a<e;++a,++n){let e,i=c$1.charCodeAt(n);if(95!==i){if(i>=97)e=i-97+10;else if(i>=65)e=i-65+10;else {if(!(i>=48&&i<=57))break;e=i-48;}if(e>=16)break;s=i,r=16*r+e;}else 95!==s&&0!==a||o(),s=i;}return 95!==s&&n-a===e||o(),r}function u(e){return 13===e||10===e}function o(){throw Object.assign(Error(`Parse error ${f}:${c$1.slice(0,n).split("\n").length}:${n-c$1.lastIndexOf("\n",n-1)}`),{idx:n})}
391
+ /* es-module-lexer 1.2.1 */
392
+ 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;}},t="xportmportlassetaromsyncunctionssertvoyiedelecontininstantybreareturdebuggeawaithrwhileforifcatcfinallels";let c$1,f,n;function parse(l,k="@"){c$1=l,f=k;const u=2*c$1.length+(2<<18);if(u>i||!e){for(;u>i;)i*=2;a=new ArrayBuffer(i),s(t,new Uint16Array(a,16,105)),e=function(e,a,r){"use asm";var i=new e.Int8Array(r),s=new e.Int16Array(r),t=new e.Int32Array(r),c=new e.Uint8Array(r),f=new e.Uint16Array(r),n=1024;function b(){var e=0,a=0,r=0,c=0,b=0,u=0,w=0;w=n;n=n+10240|0;i[795]=1;s[395]=0;s[396]=0;t[67]=t[2];i[796]=0;t[66]=0;i[794]=0;t[68]=w+2048;t[69]=w;i[797]=0;e=(t[3]|0)+-2|0;t[70]=e;a=e+(t[64]<<1)|0;t[71]=a;e:while(1){r=e+2|0;t[70]=r;if(e>>>0>=a>>>0){b=18;break}a:do{switch(s[r>>1]|0){case 9:case 10:case 11:case 12:case 13:case 32:break;case 101:{if((((s[396]|0)==0?H(r)|0:0)?(m(e+4|0,16,10)|0)==0:0)?(l(),(i[795]|0)==0):0){b=9;break e}else b=17;break}case 105:{if(H(r)|0?(m(e+4|0,26,10)|0)==0:0){k();b=17;}else b=17;break}case 59:{b=17;break}case 47:switch(s[e+4>>1]|0){case 47:{P();break a}case 42:{y(1);break a}default:{b=16;break e}}default:{b=16;break e}}}while(0);if((b|0)==17){b=0;t[67]=t[70];}e=t[70]|0;a=t[71]|0;}if((b|0)==9){e=t[70]|0;t[67]=e;b=19;}else if((b|0)==16){i[795]=0;t[70]=e;b=19;}else if((b|0)==18)if(!(i[794]|0)){e=r;b=19;}else e=0;do{if((b|0)==19){e:while(1){a=e+2|0;t[70]=a;c=a;if(e>>>0>=(t[71]|0)>>>0){b=82;break}a:do{switch(s[a>>1]|0){case 9:case 10:case 11:case 12:case 13:case 32:break;case 101:{if(((s[396]|0)==0?H(a)|0:0)?(m(e+4|0,16,10)|0)==0:0){l();b=81;}else b=81;break}case 105:{if(H(a)|0?(m(e+4|0,26,10)|0)==0:0){k();b=81;}else b=81;break}case 99:{if((H(a)|0?(m(e+4|0,36,8)|0)==0:0)?V(s[e+12>>1]|0)|0:0){i[797]=1;b=81;}else b=81;break}case 40:{c=t[68]|0;a=s[396]|0;b=a&65535;t[c+(b<<3)>>2]=1;r=t[67]|0;s[396]=a+1<<16>>16;t[c+(b<<3)+4>>2]=r;b=81;break}case 41:{a=s[396]|0;if(!(a<<16>>16)){b=36;break e}a=a+-1<<16>>16;s[396]=a;r=s[395]|0;if(r<<16>>16!=0?(u=t[(t[69]|0)+((r&65535)+-1<<2)>>2]|0,(t[u+20>>2]|0)==(t[(t[68]|0)+((a&65535)<<3)+4>>2]|0)):0){a=u+4|0;if(!(t[a>>2]|0))t[a>>2]=c;t[u+12>>2]=e+4;s[395]=r+-1<<16>>16;b=81;}else b=81;break}case 123:{b=t[67]|0;c=t[61]|0;e=b;do{if((s[b>>1]|0)==41&(c|0)!=0?(t[c+4>>2]|0)==(b|0):0){a=t[62]|0;t[61]=a;if(!a){t[57]=0;break}else {t[a+28>>2]=0;break}}}while(0);c=t[68]|0;r=s[396]|0;b=r&65535;t[c+(b<<3)>>2]=(i[797]|0)==0?2:6;s[396]=r+1<<16>>16;t[c+(b<<3)+4>>2]=e;i[797]=0;b=81;break}case 125:{e=s[396]|0;if(!(e<<16>>16)){b=49;break e}c=t[68]|0;b=e+-1<<16>>16;s[396]=b;if((t[c+((b&65535)<<3)>>2]|0)==4){h();b=81;}else b=81;break}case 39:{d(39);b=81;break}case 34:{d(34);b=81;break}case 47:switch(s[e+4>>1]|0){case 47:{P();break a}case 42:{y(1);break a}default:{e=t[67]|0;c=s[e>>1]|0;r:do{if(!(U(c)|0)){switch(c<<16>>16){case 41:if(D(t[(t[68]|0)+(f[396]<<3)+4>>2]|0)|0){b=69;break r}else {b=66;break r}case 125:break;default:{b=66;break r}}a=t[68]|0;r=f[396]|0;if(!(p(t[a+(r<<3)+4>>2]|0)|0)?(t[a+(r<<3)>>2]|0)!=6:0)b=66;else b=69;}else switch(c<<16>>16){case 46:if(((s[e+-2>>1]|0)+-48&65535)<10){b=66;break r}else {b=69;break r}case 43:if((s[e+-2>>1]|0)==43){b=66;break r}else {b=69;break r}case 45:if((s[e+-2>>1]|0)==45){b=66;break r}else {b=69;break r}default:{b=69;break r}}}while(0);r:do{if((b|0)==66){b=0;if(!(o(e)|0)){switch(c<<16>>16){case 0:{b=69;break r}case 47:{if(i[796]|0){b=69;break r}break}default:{}}r=t[3]|0;a=c;do{if(e>>>0<=r>>>0)break;e=e+-2|0;t[67]=e;a=s[e>>1]|0;}while(!(E(a)|0));if(F(a)|0){do{if(e>>>0<=r>>>0)break;e=e+-2|0;t[67]=e;}while(F(s[e>>1]|0)|0);if(j(e)|0){g();i[796]=0;b=81;break a}else e=1;}else e=1;}else b=69;}}while(0);if((b|0)==69){g();e=0;}i[796]=e;b=81;break a}}case 96:{c=t[68]|0;r=s[396]|0;b=r&65535;t[c+(b<<3)+4>>2]=t[67];s[396]=r+1<<16>>16;t[c+(b<<3)>>2]=3;h();b=81;break}default:b=81;}}while(0);if((b|0)==81){b=0;t[67]=t[70];}e=t[70]|0;}if((b|0)==36){T();e=0;break}else if((b|0)==49){T();e=0;break}else if((b|0)==82){e=(i[794]|0)==0?(s[395]|s[396])<<16>>16==0:0;break}}}while(0);n=w;return e|0}function l(){var e=0,a=0,r=0,c=0,f=0,n=0,b=0,l=0,k=0,o=0,h=0,A=0,C=0,g=0;l=t[70]|0;k=t[63]|0;g=l+12|0;t[70]=g;r=w(1)|0;e=t[70]|0;if(!((e|0)==(g|0)?!(I(r)|0):0))C=3;e:do{if((C|0)==3){a:do{switch(r<<16>>16){case 123:{t[70]=e+2;e=w(1)|0;r=t[70]|0;while(1){if(W(e)|0){d(e);e=(t[70]|0)+2|0;t[70]=e;}else {q(e)|0;e=t[70]|0;}w(1)|0;e=v(r,e)|0;if(e<<16>>16==44){t[70]=(t[70]|0)+2;e=w(1)|0;}a=r;r=t[70]|0;if(e<<16>>16==125){C=15;break}if((r|0)==(a|0)){C=12;break}if(r>>>0>(t[71]|0)>>>0){C=14;break}}if((C|0)==12){T();break e}else if((C|0)==14){T();break e}else if((C|0)==15){t[70]=r+2;break a}break}case 42:{t[70]=e+2;w(1)|0;g=t[70]|0;v(g,g)|0;break}default:{i[795]=0;switch(r<<16>>16){case 100:{l=e+14|0;t[70]=l;switch((w(1)|0)<<16>>16){case 97:{a=t[70]|0;if((m(a+2|0,56,8)|0)==0?(f=a+10|0,F(s[f>>1]|0)|0):0){t[70]=f;w(0)|0;C=22;}break}case 102:{C=22;break}case 99:{a=t[70]|0;if(((m(a+2|0,36,8)|0)==0?(c=a+10|0,g=s[c>>1]|0,V(g)|0|g<<16>>16==123):0)?(t[70]=c,n=w(1)|0,n<<16>>16!=123):0){A=n;C=31;}break}default:{}}r:do{if((C|0)==22?(b=t[70]|0,(m(b+2|0,64,14)|0)==0):0){r=b+16|0;a=s[r>>1]|0;if(!(V(a)|0))switch(a<<16>>16){case 40:case 42:break;default:break r}t[70]=r;a=w(1)|0;if(a<<16>>16==42){t[70]=(t[70]|0)+2;a=w(1)|0;}if(a<<16>>16!=40){A=a;C=31;}}}while(0);if((C|0)==31?(o=t[70]|0,q(A)|0,h=t[70]|0,h>>>0>o>>>0):0){$(e,l,o,h);t[70]=(t[70]|0)+-2;break e}$(e,l,0,0);t[70]=e+12;break e}case 97:{t[70]=e+10;w(0)|0;e=t[70]|0;C=35;break}case 102:{C=35;break}case 99:{if((m(e+2|0,36,8)|0)==0?(a=e+10|0,E(s[a>>1]|0)|0):0){t[70]=a;g=w(1)|0;C=t[70]|0;q(g)|0;g=t[70]|0;$(C,g,C,g);t[70]=(t[70]|0)+-2;break e}e=e+4|0;t[70]=e;break}case 108:case 118:break;default:break e}if((C|0)==35){t[70]=e+16;e=w(1)|0;if(e<<16>>16==42){t[70]=(t[70]|0)+2;e=w(1)|0;}C=t[70]|0;q(e)|0;g=t[70]|0;$(C,g,C,g);t[70]=(t[70]|0)+-2;break e}e=e+4|0;t[70]=e;i[795]=0;r:while(1){t[70]=e+2;g=w(1)|0;e=t[70]|0;switch((q(g)|0)<<16>>16){case 91:case 123:break r;default:{}}a=t[70]|0;if((a|0)==(e|0))break e;$(e,a,e,a);if((w(1)|0)<<16>>16!=44)break;e=t[70]|0;}t[70]=(t[70]|0)+-2;break e}}}while(0);g=(w(1)|0)<<16>>16==102;e=t[70]|0;if(g?(m(e+2|0,50,6)|0)==0:0){t[70]=e+8;u(l,w(1)|0);e=(k|0)==0?232:k+16|0;while(1){e=t[e>>2]|0;if(!e)break e;t[e+12>>2]=0;t[e+8>>2]=0;e=e+16|0;}}t[70]=e+-2;}}while(0);return}function k(){var e=0,a=0,r=0,c=0,f=0,n=0;f=t[70]|0;e=f+12|0;t[70]=e;e:do{switch((w(1)|0)<<16>>16){case 40:{a=t[68]|0;n=s[396]|0;r=n&65535;t[a+(r<<3)>>2]=5;e=t[70]|0;s[396]=n+1<<16>>16;t[a+(r<<3)+4>>2]=e;if((s[t[67]>>1]|0)!=46){t[70]=e+2;n=w(1)|0;A(f,t[70]|0,0,e);a=t[61]|0;r=t[69]|0;f=s[395]|0;s[395]=f+1<<16>>16;t[r+((f&65535)<<2)>>2]=a;switch(n<<16>>16){case 39:{d(39);break}case 34:{d(34);break}default:{t[70]=(t[70]|0)+-2;break e}}e=(t[70]|0)+2|0;t[70]=e;switch((w(1)|0)<<16>>16){case 44:{t[70]=(t[70]|0)+2;w(1)|0;f=t[61]|0;t[f+4>>2]=e;n=t[70]|0;t[f+16>>2]=n;i[f+24>>0]=1;t[70]=n+-2;break e}case 41:{s[396]=(s[396]|0)+-1<<16>>16;n=t[61]|0;t[n+4>>2]=e;t[n+12>>2]=(t[70]|0)+2;i[n+24>>0]=1;s[395]=(s[395]|0)+-1<<16>>16;break e}default:{t[70]=(t[70]|0)+-2;break e}}}break}case 46:{t[70]=(t[70]|0)+2;if((w(1)|0)<<16>>16==109?(a=t[70]|0,(m(a+2|0,44,6)|0)==0):0){e=t[67]|0;if(!(G(e)|0)?(s[e>>1]|0)==46:0)break e;A(f,f,a+8|0,2);}break}case 42:case 39:case 34:{c=18;break}case 123:{e=t[70]|0;if(s[396]|0){t[70]=e+-2;break e}while(1){if(e>>>0>=(t[71]|0)>>>0)break;e=w(1)|0;if(!(W(e)|0)){if(e<<16>>16==125){c=33;break}}else d(e);e=(t[70]|0)+2|0;t[70]=e;}if((c|0)==33)t[70]=(t[70]|0)+2;n=(w(1)|0)<<16>>16==102;e=t[70]|0;if(n?m(e+2|0,50,6)|0:0){T();break e}t[70]=e+8;e=w(1)|0;if(W(e)|0){u(f,e);break e}else {T();break e}}default:if((t[70]|0)==(e|0))t[70]=f+10;else c=18;}}while(0);do{if((c|0)==18){if(s[396]|0){t[70]=(t[70]|0)+-2;break}e=t[71]|0;a=t[70]|0;while(1){if(a>>>0>=e>>>0){c=25;break}r=s[a>>1]|0;if(W(r)|0){c=23;break}n=a+2|0;t[70]=n;a=n;}if((c|0)==23){u(f,r);break}else if((c|0)==25){T();break}}}while(0);return}function u(e,a){e=e|0;a=a|0;var r=0,i=0;r=(t[70]|0)+2|0;switch(a<<16>>16){case 39:{d(39);i=5;break}case 34:{d(34);i=5;break}default:T();}do{if((i|0)==5){A(e,r,t[70]|0,1);t[70]=(t[70]|0)+2;a=w(0)|0;e=a<<16>>16==97;if(e){r=t[70]|0;if(m(r+2|0,78,10)|0)i=11;}else {r=t[70]|0;if(!(((a<<16>>16==119?(s[r+2>>1]|0)==105:0)?(s[r+4>>1]|0)==116:0)?(s[r+6>>1]|0)==104:0))i=11;}if((i|0)==11){t[70]=r+-2;break}t[70]=r+((e?6:4)<<1);if((w(1)|0)<<16>>16!=123){t[70]=r;break}e=t[70]|0;a=e;e:while(1){t[70]=a+2;a=w(1)|0;switch(a<<16>>16){case 39:{d(39);t[70]=(t[70]|0)+2;a=w(1)|0;break}case 34:{d(34);t[70]=(t[70]|0)+2;a=w(1)|0;break}default:a=q(a)|0;}if(a<<16>>16!=58){i=20;break}t[70]=(t[70]|0)+2;switch((w(1)|0)<<16>>16){case 39:{d(39);break}case 34:{d(34);break}default:{i=24;break e}}t[70]=(t[70]|0)+2;switch((w(1)|0)<<16>>16){case 125:{i=29;break e}case 44:break;default:{i=28;break e}}t[70]=(t[70]|0)+2;if((w(1)|0)<<16>>16==125){i=29;break}a=t[70]|0;}if((i|0)==20){t[70]=r;break}else if((i|0)==24){t[70]=r;break}else if((i|0)==28){t[70]=r;break}else if((i|0)==29){i=t[61]|0;t[i+16>>2]=e;t[i+12>>2]=(t[70]|0)+2;break}}}while(0);return}function o(e){e=e|0;e:do{switch(s[e>>1]|0){case 100:switch(s[e+-2>>1]|0){case 105:{e=O(e+-4|0,88,2)|0;break e}case 108:{e=O(e+-4|0,92,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=B(e+-6|0,101)|0;break e}case 97:{e=B(e+-6|0,99)|0;break e}default:{e=0;break e}}case 116:{e=O(e+-4|0,98,4)|0;break e}case 117:{e=O(e+-4|0,106,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=O(e+-8|0,118,6)|0;break e}case 112:{e=O(e+-8|0,130,2)|0;break e}default:{e=0;break e}}else e=0;break}case 107:{e=O(e+-2|0,134,4)|0;break}case 110:{e=e+-2|0;if(B(e,105)|0)e=1;else e=O(e,142,5)|0;break}case 111:{e=B(e+-2|0,100)|0;break}case 114:{e=O(e+-2|0,152,7)|0;break}case 116:{e=O(e+-2|0,166,4)|0;break}case 119:switch(s[e+-2>>1]|0){case 101:{e=B(e+-4|0,110)|0;break e}case 111:{e=O(e+-4|0,174,3)|0;break e}default:{e=0;break e}}default:e=0;}}while(0);return e|0}function h(){var e=0,a=0,r=0,i=0;a=t[71]|0;r=t[70]|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;t[70]=e;a=t[68]|0;i=s[396]|0;r=i&65535;t[a+(r<<3)>>2]=4;s[396]=i+1<<16>>16;t[a+(r<<3)+4>>2]=e;}else if((a|0)==7){t[70]=e;r=t[68]|0;i=(s[396]|0)+-1<<16>>16;s[396]=i;if((t[r+((i&65535)<<3)>>2]|0)!=3)T();}else if((a|0)==10){t[70]=e;T();}return}function w(e){e=e|0;var a=0,r=0,i=0;r=t[70]|0;e:do{a=s[r>>1]|0;a:do{if(a<<16>>16!=47)if(e)if(V(a)|0)break;else break e;else if(F(a)|0)break;else break e;else switch(s[r+2>>1]|0){case 47:{P();break a}case 42:{y(e);break a}default:{a=47;break e}}}while(0);i=t[70]|0;r=i+2|0;t[70]=r;}while(i>>>0<(t[71]|0)>>>0);return a|0}function d(e){e=e|0;var a=0,r=0,i=0,c=0;c=t[71]|0;a=t[70]|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(Z(r)|0){a=9;break}else a=i;}if((a|0)==9){t[70]=i;T();}else if((a|0)==10)t[70]=i;return}function v(e,a){e=e|0;a=a|0;var r=0,i=0,c=0,f=0;r=t[70]|0;i=s[r>>1]|0;f=(e|0)==(a|0);c=f?0:e;f=f?0:a;if(i<<16>>16==97){t[70]=r+4;r=w(1)|0;e=t[70]|0;if(W(r)|0){d(r);a=(t[70]|0)+2|0;t[70]=a;}else {q(r)|0;a=t[70]|0;}i=w(1)|0;r=t[70]|0;}if((r|0)!=(e|0))$(e,a,c,f);return i|0}function A(e,a,r,s){e=e|0;a=a|0;r=r|0;s=s|0;var c=0,f=0;c=t[65]|0;t[65]=c+32;f=t[61]|0;t[((f|0)==0?228:f+28|0)>>2]=c;t[62]=f;t[61]=c;t[c+8>>2]=e;if(2==(s|0))e=r;else e=1==(s|0)?r+2|0:0;t[c+12>>2]=e;t[c>>2]=a;t[c+4>>2]=r;t[c+16>>2]=0;t[c+20>>2]=s;i[c+24>>0]=1==(s|0)&1;t[c+28>>2]=0;return}function C(){var e=0,a=0,r=0;r=t[71]|0;a=t[70]|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){t[70]=e;T();e=0;}else if((a|0)==7){t[70]=e;e=93;}return e|0}function g(){var e=0,a=0,r=0;e:while(1){e=t[70]|0;a=e+2|0;t[70]=a;if(e>>>0>=(t[71]|0)>>>0){r=7;break}switch(s[a>>1]|0){case 13:case 10:{r=7;break e}case 47:break e;case 91:{C()|0;break}case 92:{t[70]=e+4;break}default:{}}}if((r|0)==7)T();return}function p(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=O(e+-2|0,200,4)|0;break}case 121:{e=O(e+-2|0,208,6)|0;break}case 101:{e=O(e+-2|0,220,3)|0;break}default:e=0;}return e|0}function y(e){e=e|0;var a=0,r=0,i=0,c=0,f=0;c=(t[70]|0)+2|0;t[70]=c;r=t[71]|0;while(1){a=c+2|0;if(c>>>0>=r>>>0)break;i=s[a>>1]|0;if(!e?Z(i)|0:0)break;if(i<<16>>16==42?(s[c+4>>1]|0)==47:0){f=8;break}c=a;}if((f|0)==8){t[70]=a;a=c+4|0;}t[70]=a;return}function m(e,a,r){e=e|0;a=a|0;r=r|0;var s=0,t=0;e:do{if(!r)e=0;else {while(1){s=i[e>>0]|0;t=i[a>>0]|0;if(s<<24>>24!=t<<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)-(t&255)|0;}}while(0);return e|0}function I(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 U(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 x(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(I(a)|0)return a<<16>>16!=46|(G(e)|0)|0;else a=0;}else a=1;}while(0);return a|0}function S(e){e=e|0;var a=0,r=0,i=0,c=0;r=n;n=n+16|0;i=r;t[i>>2]=0;t[64]=e;a=t[3]|0;c=a+(e<<1)|0;e=c+2|0;s[c>>1]=0;t[i>>2]=e;t[65]=e;t[57]=0;t[61]=0;t[59]=0;t[58]=0;t[63]=0;t[60]=0;n=r;return a|0}function O(e,a,r){e=e|0;a=a|0;r=r|0;var i=0,s=0;i=e+(0-r<<1)|0;s=i+2|0;e=t[3]|0;if(s>>>0>=e>>>0?(m(s,a,r<<1)|0)==0:0)if((s|0)==(e|0))e=1;else e=x(i)|0;else e=0;return e|0}function $(e,a,r,i){e=e|0;a=a|0;r=r|0;i=i|0;var s=0,c=0;s=t[65]|0;t[65]=s+20;c=t[63]|0;t[((c|0)==0?232:c+16|0)>>2]=s;t[63]=s;t[s>>2]=e;t[s+4>>2]=a;t[s+8>>2]=r;t[s+12>>2]=i;t[s+16>>2]=0;return}function j(e){e=e|0;switch(s[e>>1]|0){case 107:{e=O(e+-2|0,134,4)|0;break}case 101:{if((s[e+-2>>1]|0)==117)e=O(e+-4|0,106,6)|0;else e=0;break}default:e=0;}return e|0}function B(e,a){e=e|0;a=a|0;var r=0;r=t[3]|0;if(r>>>0<=e>>>0?(s[e>>1]|0)==a<<16>>16:0)if((r|0)==(e|0))r=1;else r=E(s[e+-2>>1]|0)|0;else r=0;return r|0}function E(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&(I(e)|0);}}while(0);return e|0}function P(){var e=0,a=0,r=0;e=t[71]|0;r=t[70]|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;}}t[70]=a;return}function q(e){e=e|0;while(1){if(V(e)|0)break;if(I(e)|0)break;e=(t[70]|0)+2|0;t[70]=e;e=s[e>>1]|0;if(!(e<<16>>16)){e=0;break}}return e|0}function z(){var e=0;e=t[(t[59]|0)+20>>2]|0;switch(e|0){case 1:{e=-1;break}case 2:{e=-2;break}default:e=e-(t[3]|0)>>1;}return e|0}function D(e){e=e|0;if(!(O(e,180,5)|0)?!(O(e,190,3)|0):0)e=O(e,196,2)|0;else e=1;return e|0}function F(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 G(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 H(e){e=e|0;if((t[3]|0)==(e|0))e=1;else e=x(e+-2|0)|0;return e|0}function J(){var e=0;e=t[(t[60]|0)+12>>2]|0;if(!e)e=-1;else e=e-(t[3]|0)>>1;return e|0}function K(){var e=0;e=t[(t[59]|0)+12>>2]|0;if(!e)e=-1;else e=e-(t[3]|0)>>1;return e|0}function L(){var e=0;e=t[(t[60]|0)+8>>2]|0;if(!e)e=-1;else e=e-(t[3]|0)>>1;return e|0}function M(){var e=0;e=t[(t[59]|0)+16>>2]|0;if(!e)e=-1;else e=e-(t[3]|0)>>1;return e|0}function N(){var e=0;e=t[(t[59]|0)+4>>2]|0;if(!e)e=-1;else e=e-(t[3]|0)>>1;return e|0}function Q(){var e=0;e=t[59]|0;e=t[((e|0)==0?228:e+28|0)>>2]|0;t[59]=e;return (e|0)!=0|0}function R(){var e=0;e=t[60]|0;e=t[((e|0)==0?232:e+16|0)>>2]|0;t[60]=e;return (e|0)!=0|0}function T(){i[794]=1;t[66]=(t[70]|0)-(t[3]|0)>>1;t[70]=(t[71]|0)+2;return}function V(e){e=e|0;return (e|128)<<16>>16==160|(e+-9&65535)<5|0}function W(e){e=e|0;return e<<16>>16==39|e<<16>>16==34|0}function X(){return (t[(t[59]|0)+8>>2]|0)-(t[3]|0)>>1|0}function Y(){return (t[(t[60]|0)+4>>2]|0)-(t[3]|0)>>1|0}function Z(e){e=e|0;return e<<16>>16==13|e<<16>>16==10|0}function _(){return (t[t[59]>>2]|0)-(t[3]|0)>>1|0}function ee(){return (t[t[60]>>2]|0)-(t[3]|0)>>1|0}function ae(){return c[(t[59]|0)+24>>0]|0|0}function re(e){e=e|0;t[3]=e;return}function ie(){return (i[795]|0)!=0|0}function se(){return t[66]|0}function te(e){e=e|0;n=e+992+15&-16;return 992}return {su:te,ai:M,e:se,ee:Y,ele:J,els:L,es:ee,f:ie,id:z,ie:N,ip:ae,is:_,p:b,re:R,ri:Q,sa:S,se:K,ses:re,ss:X}}("undefined"!=typeof self?self:global,{},a),r=e.su(i-(2<<17));}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(),t=e.ss(),f=e.se();let n;e.ip()&&(n=b(-1===s?a:a+1,c$1.charCodeAt(-1===s?a-1:a))),w.push({n:n,s:a,e:r,ss:t,se:f,d:s,a:i});}for(;e.re();){const a=e.es(),r=e.ee(),i=e.els(),s=e.ele(),t=c$1.charCodeAt(a),f=i>=0?c$1.charCodeAt(i):-1;d.push({s:a,e:r,ls:i,le:s,n:34===t||39===t?b(a+1,t):c$1.slice(a,r),ln:i<0?void 0:34===f||39===f?b(i+1,f):c$1.slice(i,s)});}return [w,d,!!e.f()]}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+=l(),i=n):(8232===e||8233===e||u(e)&&o(),++n);}return r+=c$1.slice(i,n++),r}function l(){let e=c$1.charCodeAt(++n);switch(++n,e){case 110:return "\n";case 114:return "\r";case 120:return String.fromCharCode(k(2));case 117:return function(){const e=c$1.charCodeAt(n);let a;123===e?(++n,a=k(c$1.indexOf("}",n)-n),++n,a>1114111&&o()):a=k(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 k(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 ${f}:${c$1.slice(0,n).split("\n").length}:${n-c$1.lastIndexOf("\n",n-1)}`),{idx:n})}
346
393
 
347
394
  async function _resolve (id, parentUrl) {
348
395
  const urlResolved = resolveIfNotPlainOrUrl(id, parentUrl);
@@ -375,8 +422,7 @@
375
422
  if (importHook) await importHook(id, typeof args[1] !== 'string' ? args[1] : {}, parentUrl);
376
423
  if (acceptingImportMaps || shimMode || !baselinePassthrough) {
377
424
  if (hasDocument)
378
- processImportMaps();
379
-
425
+ processScriptsAndPreloads(true);
380
426
  if (!shimMode)
381
427
  acceptingImportMaps = false;
382
428
  }
@@ -427,7 +473,7 @@
427
473
  let baselinePassthrough;
428
474
 
429
475
  const initPromise = featureDetectionPromise.then(() => {
430
- baselinePassthrough = esmsInitOptions.polyfillEnable !== true && supportsDynamicImport && supportsImportMeta && supportsImportMaps && (!jsonModulesEnabled || supportsJsonAssertions) && (!cssModulesEnabled || supportsCssAssertions) && !importMapSrcOrLazy && !false;
476
+ baselinePassthrough = esmsInitOptions.polyfillEnable !== true && supportsDynamicImport && supportsImportMeta && supportsImportMaps && (!jsonModulesEnabled || supportsJsonAssertions) && (!cssModulesEnabled || supportsCssAssertions) && !importMapSrcOrLazy;
431
477
  if (hasDocument) {
432
478
  if (!supportsImportMaps) {
433
479
  const supports = HTMLScriptElement.supports || (type => type === 'classic' || type === 'module');
@@ -440,16 +486,16 @@
440
486
  for (const node of mutation.addedNodes) {
441
487
  if (node.tagName === 'SCRIPT') {
442
488
  if (node.type === (shimMode ? 'module-shim' : 'module'))
443
- processScript(node);
489
+ processScript(node, true);
444
490
  if (node.type === (shimMode ? 'importmap-shim' : 'importmap'))
445
- processImportMap(node);
491
+ processImportMap(node, true);
446
492
  }
447
- else if (node.tagName === 'LINK' && node.rel === (shimMode ? 'modulepreload-shim' : 'modulepreload'))
493
+ else if (node.tagName === 'LINK' && node.rel === (shimMode ? 'modulepreload-shim' : 'modulepreload')) {
448
494
  processPreload(node);
495
+ }
449
496
  }
450
497
  }
451
498
  }).observe(document, {childList: true, subtree: true});
452
- processImportMaps();
453
499
  processScriptsAndPreloads();
454
500
  if (document.readyState === 'complete') {
455
501
  readyStateCompleteCheck();
@@ -457,7 +503,7 @@
457
503
  else {
458
504
  async function readyListener() {
459
505
  await initPromise;
460
- processImportMaps();
506
+ processScriptsAndPreloads();
461
507
  if (document.readyState === 'complete') {
462
508
  readyStateCompleteCheck();
463
509
  document.removeEventListener('readystatechange', readyListener);
@@ -476,6 +522,7 @@
476
522
  async function topLevelLoad (url, fetchOpts, source, nativelyLoaded, lastStaticLoadPromise) {
477
523
  if (!shimMode)
478
524
  acceptingImportMaps = false;
525
+ await initPromise;
479
526
  await importMapPromise;
480
527
  if (importHook) await importHook(url, typeof fetchOpts !== 'string' ? fetchOpts : {}, '');
481
528
  // early analysis opt-out - no need to even fetch if we have feature support
@@ -492,10 +539,10 @@
492
539
  lastLoad = undefined;
493
540
  resolveDeps(load, seen);
494
541
  await lastStaticLoadPromise;
495
- if (source && !shimMode && !load.n && !false) {
496
- const module = await dynamicImport(createBlob(source), { errUrl: source });
542
+ if (source && !shimMode && !load.n) {
543
+ if (nativelyLoaded) return;
497
544
  if (revokeBlobURLs) revokeObjectURLs(Object.keys(seen));
498
- return module;
545
+ return await dynamicImport(createBlob(source), { errUrl: source });
499
546
  }
500
547
  if (firstPolyfillLoad && !shimMode && load.n && nativelyLoaded) {
501
548
  onpolyfill();
@@ -541,7 +588,7 @@
541
588
  for (const dep of load.d)
542
589
  resolveDeps(dep, seen);
543
590
 
544
- const [imports] = load.a;
591
+ const [imports, exports] = load.a;
545
592
 
546
593
  // "execution"
547
594
  const source = load.S;
@@ -573,14 +620,15 @@
573
620
  // circular shell creation
574
621
  if (!(blobUrl = depLoad.s)) {
575
622
  blobUrl = depLoad.s = createBlob(`export function u$_(m){${
576
- depLoad.a[1].map(
577
- name => name === 'default' ? `d$_=m.default` : `${name}=m.${name}`
578
- ).join(',')
623
+ depLoad.a[1].map(({ s, e }, i) => {
624
+ const q = depLoad.S[s] === '"' || depLoad.S[s] === "'";
625
+ return `e$_${i}=m${q ? `[` : '.'}${depLoad.S.slice(s, e)}${q ? `]` : ''}`;
626
+ }).join(',')
579
627
  }}${
580
- depLoad.a[1].map(name =>
581
- name === 'default' ? `let d$_;export{d$_ as default}` : `export let ${name}`
582
- ).join(';')
583
- }\n//# sourceURL=${depLoad.r}?cycle`);
628
+ depLoad.a[1].length ? `let ${depLoad.a[1].map((_, i) => `e$_${i}`).join(',')};` : ''
629
+ }export {${
630
+ depLoad.a[1].map(({ s, e }, i) => `e$_${i} as ${depLoad.S.slice(s, e)}`).join(',')
631
+ }}\n//# sourceURL=${depLoad.r}?cycle`);
584
632
  }
585
633
  }
586
634
 
@@ -611,6 +659,10 @@
611
659
  }
612
660
  }
613
661
 
662
+ // support progressive cycle binding updates (try statement avoids tdz errors)
663
+ if (load.s)
664
+ resolvedSource += `\n;import{u$_}from'${load.s}';try{u$_({${exports.filter(e => e.ln).map(({ s, e, ln }) => `${source.slice(s, e)}:${ln}`).join(',')}})}catch(_){};\n`;
665
+
614
666
  pushStringTo(source.length);
615
667
  }
616
668
 
@@ -752,7 +804,8 @@
752
804
  const { r, b } = await resolve(n, load.r || load.u);
753
805
  if (b && (!supportsImportMaps || importMapSrcOrLazy))
754
806
  load.n = true;
755
- if (skip && skip.test(r)) return { b: r };
807
+ if (d !== -1) return;
808
+ if (skip && skip(r)) return { b: r };
756
809
  if (childFetchOpts.integrity)
757
810
  childFetchOpts = Object.assign({}, childFetchOpts, { integrity: undefined });
758
811
  return getOrCreateLoad(r, childFetchOpts, load.r).f;
@@ -762,27 +815,26 @@
762
815
  return load;
763
816
  }
764
817
 
765
- function processScriptsAndPreloads () {
766
- for (const script of document.querySelectorAll(shimMode ? 'script[type=module-shim]' : 'script[type=module]'))
767
- processScript(script);
768
- for (const link of document.querySelectorAll(shimMode ? 'link[rel=modulepreload-shim]' : 'link[rel=modulepreload]'))
769
- processPreload(link);
770
- }
771
-
772
- function processImportMaps () {
773
- for (const script of document.querySelectorAll(shimMode ? 'script[type="importmap-shim"]' : 'script[type="importmap"]'))
818
+ function processScriptsAndPreloads (mapsOnly = false) {
819
+ if (!mapsOnly)
820
+ for (const link of document.querySelectorAll(shimMode ? 'link[rel=modulepreload-shim]' : 'link[rel=modulepreload]'))
821
+ processPreload(link);
822
+ for (const script of document.querySelectorAll(shimMode ? 'script[type=importmap-shim]' : 'script[type=importmap]'))
774
823
  processImportMap(script);
824
+ if (!mapsOnly)
825
+ for (const script of document.querySelectorAll(shimMode ? 'script[type=module-shim]' : 'script[type=module]'))
826
+ processScript(script);
775
827
  }
776
828
 
777
829
  function getFetchOpts (script) {
778
830
  const fetchOpts = {};
779
831
  if (script.integrity)
780
832
  fetchOpts.integrity = script.integrity;
781
- if (script.referrerpolicy)
782
- fetchOpts.referrerPolicy = script.referrerpolicy;
783
- if (script.crossorigin === 'use-credentials')
833
+ if (script.referrerPolicy)
834
+ fetchOpts.referrerPolicy = script.referrerPolicy;
835
+ if (script.crossOrigin === 'use-credentials')
784
836
  fetchOpts.credentials = 'include';
785
- else if (script.crossorigin === 'anonymous')
837
+ else if (script.crossOrigin === 'anonymous')
786
838
  fetchOpts.credentials = 'omit';
787
839
  else
788
840
  fetchOpts.credentials = 'same-origin';
@@ -793,34 +845,30 @@
793
845
 
794
846
  let domContentLoadedCnt = 1;
795
847
  function domContentLoadedCheck () {
796
- if (--domContentLoadedCnt === 0 && !noLoadEventRetriggers)
848
+ if (--domContentLoadedCnt === 0 && !noLoadEventRetriggers && (shimMode || !baselinePassthrough)) {
797
849
  document.dispatchEvent(new Event('DOMContentLoaded'));
850
+ }
798
851
  }
799
852
  // this should always trigger because we assume es-module-shims is itself a domcontentloaded requirement
800
853
  if (hasDocument) {
801
854
  document.addEventListener('DOMContentLoaded', async () => {
802
855
  await initPromise;
803
856
  domContentLoadedCheck();
804
- if (shimMode || !baselinePassthrough) {
805
- processImportMaps();
806
- processScriptsAndPreloads();
807
- }
808
857
  });
809
858
  }
810
859
 
811
860
  let readyStateCompleteCnt = 1;
812
861
  function readyStateCompleteCheck () {
813
- if (--readyStateCompleteCnt === 0 && !noLoadEventRetriggers)
862
+ if (--readyStateCompleteCnt === 0 && !noLoadEventRetriggers && (shimMode || !baselinePassthrough)) {
814
863
  document.dispatchEvent(new Event('readystatechange'));
864
+ }
815
865
  }
816
866
 
817
- function processImportMap (script) {
818
- if (script.ep) // ep marker = script processed
819
- return;
820
- // empty inline scripts sometimes show before domready
821
- if (!script.src && !script.innerHTML)
822
- return;
823
- script.ep = true;
867
+ const hasNext = script => script.nextSibling || script.parentNode && hasNext(script.parentNode);
868
+ const epCheck = (script, ready) => script.ep || !ready && (!script.src && !script.innerHTML || !hasNext(script)) || script.getAttribute('noshim') !== null || !(script.ep = true);
869
+
870
+ function processImportMap (script, ready = readyStateCompleteCnt > 0) {
871
+ if (epCheck(script, ready)) return;
824
872
  // we dont currently support multiple, external or dynamic imports maps in polyfill mode to match native
825
873
  if (script.src) {
826
874
  if (!shimMode)
@@ -832,28 +880,34 @@
832
880
  .then(async () => {
833
881
  importMap = resolveAndComposeImportMap(script.src ? await (await doFetch(script.src, getFetchOpts(script))).json() : JSON.parse(script.innerHTML), script.src || baseUrl, importMap);
834
882
  })
835
- .catch(throwError);
883
+ .catch(e => {
884
+ console.log(e);
885
+ if (e instanceof SyntaxError)
886
+ e = new Error(`Unable to parse import map ${e.message} in: ${script.src || script.innerHTML}`);
887
+ throwError(e);
888
+ });
836
889
  if (!shimMode)
837
890
  acceptingImportMaps = false;
838
891
  }
839
892
  }
840
893
 
841
- function processScript (script) {
842
- if (script.ep) // ep marker = script processed
843
- return;
844
- if (script.getAttribute('noshim') !== null)
845
- return;
846
- // empty inline scripts sometimes show before domready
847
- if (!script.src && !script.innerHTML)
848
- return;
849
- script.ep = true;
894
+ function processScript (script, ready = readyStateCompleteCnt > 0) {
895
+ if (epCheck(script, ready)) return;
850
896
  // does this load block readystate complete
851
897
  const isBlockingReadyScript = script.getAttribute('async') === null && readyStateCompleteCnt > 0;
852
898
  // does this load block DOMContentLoaded
853
899
  const isDomContentLoadedScript = domContentLoadedCnt > 0;
854
900
  if (isBlockingReadyScript) readyStateCompleteCnt++;
855
901
  if (isDomContentLoadedScript) domContentLoadedCnt++;
856
- const loadPromise = topLevelLoad(script.src || baseUrl, getFetchOpts(script), !script.src && script.innerHTML, !shimMode, isBlockingReadyScript && lastStaticLoadPromise).catch(throwError);
902
+ const loadPromise = topLevelLoad(script.src || baseUrl, getFetchOpts(script), !script.src && script.innerHTML, !shimMode, isBlockingReadyScript && lastStaticLoadPromise)
903
+ .then(() => {
904
+ // if the type of the script tag "module-shim", browser does not dispatch a "load" event
905
+ // see https://github.com/guybedford/es-module-shims/issues/346
906
+ if (shimMode) {
907
+ script.dispatchEvent(new Event('load'));
908
+ }
909
+ })
910
+ .catch(throwError);
857
911
  if (isBlockingReadyScript)
858
912
  lastStaticLoadPromise = loadPromise.then(readyStateCompleteCheck);
859
913
  if (isDomContentLoadedScript)
@@ -862,8 +916,7 @@
862
916
 
863
917
  const fetchCache = {};
864
918
  function processPreload (link) {
865
- if (link.ep) // ep marker = processed
866
- return;
919
+ if (link.ep) return;
867
920
  link.ep = true;
868
921
  if (fetchCache[link.href])
869
922
  return;