importmap-rails 0.7.6 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d7218dabe6d049d329f32dcb432172a8dbfcb392e300e786001443ad8c1614fb
4
- data.tar.gz: 2411983863b5a6353677ade633a0f85878d7f4eefa82c188d493502ff6a63f21
3
+ metadata.gz: 075fd9235f4d4afa6ca584f1b7b8d14d26747142fa16a9ca2ffb0ee71aa86369
4
+ data.tar.gz: f7181a465ead045f4bb11416c682f871f2564e6b9427ad96cfc4dd6dc6f39029
5
5
  SHA512:
6
- metadata.gz: 85e0cf2e07054028ef9b7ee605b8d08bc88b011bf8afbaab3d050f2cccd667bea164d82d25c208e2a3251c1f351c0679fffee56a50d922a99a8b156bd79f0c74
7
- data.tar.gz: c6ce2f8be78e4816e3111e2666de3ec1cee55ecf40b8efc3a283e7fa5a91fb29f3e4795396b4ee9232f47fec4fd5230305343793e68db67f3d7f4a27e853304e
6
+ metadata.gz: 8ffc844d6015e192cb2f0e1daa205044e6f886fc4ae000d54e7c2fb5f457106775a032cdb06c1cbf5633d5204c4d142e396d7a4dbd2c8786156056c867e2ab1d
7
+ data.tar.gz: 901def9d9b69a619d26fab26dc6a9272ac386ec7c518f1e6fe2e066fcbe51c507d47a217403fabd4b56ee8fd8476981eba0ebcffd74caacf9436f939b74eb4d2
data/README.md CHANGED
@@ -9,7 +9,7 @@ There's [native support for import maps in Chrome/Edge 89+](https://caniuse.com/
9
9
 
10
10
  ## Installation
11
11
 
12
- Importmap for Rails is automatically included in Rails 7+ for new applications, but you can also install it manually in existing applications:
12
+ Importmap for Rails is automatically included in Rails 7+ for new applications, but you can also install it manually in existing applications:
13
13
 
14
14
  1. Add `importmap-rails` to your Gemfile with `gem 'importmap-rails'`
15
15
  2. Run `./bin/bundle install`
@@ -17,6 +17,42 @@ Importmap for Rails is automatically included in Rails 7+ for new applications,
17
17
 
18
18
  Note: In order to use JavaScript from Rails frameworks like Action Cable, Action Text, and Active Storage, you must be running Rails 7.0+. This was the first version that shipped with ESM compatible builds of these libraries.
19
19
 
20
+ ## How do importmaps work?
21
+
22
+ At their core, importmaps are essentially a string substitution for what are referred to as "bare module specifiers". A "bare module specifier" looks like this: `import React from "react"`. This is not compatible with the ES Module loader spec. Instead, to be ESM compatible, you must provide 1 of the 3 following types of specifiers:
23
+
24
+ - Absolute path:
25
+ ```js
26
+ import React from "/Users/DHH/projects/basecamp/node_modules/react"
27
+ ```
28
+
29
+ - Relative path:
30
+ ```js
31
+ import React from "./node_modules/react"
32
+ ```
33
+
34
+ - HTTP path:
35
+ ```js
36
+ import React from "https://ga.jspm.io/npm:react@17.0.1/index.js"
37
+ ```
38
+
39
+ Importmap-rails provides a clean API for mapping "bare module specifiers" like `"react"`
40
+ to 1 of the 3 viable ways of loading ES Module javascript packages.
41
+
42
+ For example:
43
+
44
+ ```rb
45
+ # config/importmaps.rb
46
+ pin "react", to: "https://ga.jspm.io/npm:react@17.0.2/index.js"
47
+ ```
48
+
49
+ means "everytime you see `import React from "react"`
50
+ change it to `import React from "https://ga.jspm.io/npm:react@17.0.2/index.js"`"
51
+
52
+ ```js
53
+ import React from "react"
54
+ // => import React from "https://ga.jspm.io/npm:react@17.0.2/index.js"
55
+ ```
20
56
 
21
57
  ## Usage
22
58
 
@@ -110,31 +146,49 @@ pin "react", to: "https://cdn.skypack.dev/react"
110
146
  ```
111
147
 
112
148
 
113
- ## What if I don't like to use a JavaScript CDN?
149
+ ## Downloading vendor files from the JavaScript CDN
114
150
 
115
- You always have the option to simply download the compiled JavaScript packages from the CDNs, and saving them locally in your application. You can put such files in app/javascript/vendor, and then reference them with local pins, like:
151
+ If you don't want to use a JavaScript CDN in production, you can also download vendored files from the CDN when you're setting up your pins:
152
+
153
+ ```bash
154
+ ./bin/importmap pin react --download
155
+ Pinning "react" to vendor/react.js via download from https://ga.jspm.io/npm:react@17.0.2/index.js
156
+ Pinning "object-assign" to vendor/object-assign.js via download from https://ga.jspm.io/npm:object-assign@4.1.1/index.js
157
+ ```
158
+
159
+ This will produce pins in your `config/importmap.rb` like so:
116
160
 
117
161
  ```ruby
118
- # config/importmap.rb
119
- pin "react", to: "vendor/react@17.0.2.js"
162
+ pin "react" # https://ga.jspm.io/npm:react@17.0.2/index.js
163
+ pin "object-assign" # https://ga.jspm.io/npm:object-assign@4.1.1/index.js
164
+ ```
165
+
166
+ The packages are downloaded to `vendor/javascript`, which you can check into your source control, and they'll be available through your application's own asset pipeline serving.
167
+
168
+ If you later wish to remove a downloaded pin, you again pass `--download`:
169
+
170
+ ```bash
171
+ ./bin/importmap unpin react --download
172
+ Unpinning and removing "react"
173
+ Unpinning and removing "object-assign"
120
174
  ```
121
175
 
122
- But using a JavaScript CDN is fast, secure, and easier to deal with. Start there.
176
+ Just like with a normal pin, you can also update a pin by running the `pin --download` command again.
123
177
 
124
178
 
125
179
  ## Preloading pinned modules
126
180
 
127
- To avoid the waterfall effect where the browser has to load one file after another before it can get to the deepest nested import, we use [modulepreload links](https://developers.google.com/web/updates/2017/12/modulepreload). Pinned modules are preloaded by default, but you can turn this off with `preload: false`.
181
+ To avoid the waterfall effect where the browser has to load one file after another before it can get to the deepest nested import, importmap-rails supports [modulepreload links](https://developers.google.com/web/updates/2017/12/modulepreload). Pinned modules can be preloaded by appending `preload: true` to the pin.
128
182
 
129
183
  Example:
130
184
 
131
185
  ```ruby
132
186
  # config/importmap.rb
133
- pin "@github/hotkey", to: "https://ga.jspm.io/npm:@github/hotkey@1.4.4/dist/index.js"
134
- pin "md5", to: "https://cdn.jsdelivr.net/npm/md5@2.3.0/md5.js", preload: false
187
+ pin "@github/hotkey", to: "https://ga.jspm.io/npm:@github/hotkey@1.4.4/dist/index.js", preload: true
188
+ pin "md5", to: "https://cdn.jsdelivr.net/npm/md5@2.3.0/md5.js"
135
189
 
136
190
  # app/views/layouts/application.html.erb
137
- <%= javascript_importmap_tags %>
191
+ <%= javascript_importmap_tags %>
138
192
 
139
193
  # will include the following link before the importmap is setup:
140
194
  <link rel="modulepreload" href="https://ga.jspm.io/npm:@github/hotkey@1.4.4/dist/index.js">
@@ -145,7 +199,7 @@ pin "md5", to: "https://cdn.jsdelivr.net/npm/md5@2.3.0/md5.js", preload: false
145
199
 
146
200
  By default, Rails loads import map definition from the application's `config/importmap.rb` to the `Importmap::Map` object available at `Rails.application.importmap`.
147
201
 
148
- You can combine multiple import maps by drawing their definitions onto the `Rails.application.importmap`. For example, appending import maps defined in Rails engines:
202
+ You can combine multiple import maps by adding paths to additional import map configs to `Rails.application.config.importmap.paths`. For example, appending import maps defined in Rails engines:
149
203
 
150
204
  ```ruby
151
205
  # my_engine/lib/my_engine/engine.rb
@@ -153,8 +207,9 @@ You can combine multiple import maps by drawing their definitions onto the `Rail
153
207
  module MyEngine
154
208
  class Engine < ::Rails::Engine
155
209
  # ...
156
- initializer "my-engine.importmap" do |app|
157
- app.config.importmap.draw(Engine.root.join("config/importmap.rb"))
210
+ initializer "my-engine.importmap", before: "importmap" do |app|
211
+ app.config.importmap.paths << Engine.root.join("config/importmap.rb")
212
+ # ...
158
213
  end
159
214
  end
160
215
  end
@@ -182,13 +237,29 @@ end
182
237
 
183
238
  ## Sweeping the cache in development and test
184
239
 
185
- Generating the import map json and modulepreloads may require resolving hundreds of assets. This can take a while, so these operations are cached, but in development and test, we watch for changes to both `config/importmap.rb` and files in `app/javascript` to clear this cache. This feature can be controlled in an environment configuration file via the boolean `config.importmap.sweep_cache`. If you're pinning local files from outside of `app/javascript`, you'll need to restart your development server upon changes to those external files.
240
+ Generating the import map json and modulepreloads may require resolving hundreds of assets. This can take a while, so these operations are cached, but in development and test, we watch for changes to both `config/importmap.rb` and files in `app/javascript` to clear this cache. This feature can be controlled in an environment configuration file via the boolean `config.importmap.sweep_cache`.
186
241
 
242
+ If you're pinning local files from outside of `app/javascript`, you'll need to add them to the cache sweeper configuration or restart your development server upon changes to those external files. For example, here's how you can do it for Rails engine:
243
+
244
+ ```ruby
245
+ # my_engine/lib/my_engine/engine.rb
246
+
247
+ module MyEngine
248
+ class Engine < ::Rails::Engine
249
+ # ...
250
+ initializer "my-engine.importmap", before: "importmap" do |app|
251
+ # ...
252
+ app.config.importmap.cache_sweepers << Engine.root.join("app/assets/javascripts")
253
+ end
254
+ end
255
+ end
256
+ ```
187
257
 
188
258
  ## Expected errors from using the es-module-shim
189
259
 
190
260
  While import maps are native in Chrome and Edge, they need a shim in other browsers that'll produce a JavaScript console error like `TypeError: Module specifier, 'application' does not start with "/", "./", or "../".`. This error is normal and does not have any user-facing consequences.
191
261
 
262
+ In Firefox. when opening the browser console, the asm.js module lexer build will run in unoptimized mode due to the debugger attaching. This gives a warning message `"asm.js type error: Disabled because no suitable wasm compiler is available"` which is as expected. When the console is closed again, the asm.js optimizations are fully applied, and this can even be verified with the console open by disabling the debugger in `about:config` and reloading the page.
192
263
 
193
264
  ## Turning off the shim
194
265
 
@@ -1,4 +1,4 @@
1
- /* ES Module Shims 1.1.0 */
1
+ /* ES Module Shims 1.3.2 */
2
2
  (function () {
3
3
 
4
4
  const edge = navigator.userAgent.match(/Edge\/\d\d\.\d+$/);
@@ -129,6 +129,9 @@
129
129
  function resolveAndComposePackages (packages, outPackages, baseUrl, parentMap) {
130
130
  for (let p in packages) {
131
131
  const resolvedLhs = resolveIfNotPlainOrUrl(p, baseUrl) || p;
132
+ if (outPackages[resolvedLhs]) {
133
+ throw new Error(`Dynamic import map rejected: Overrides entry "${resolvedLhs}" from ${outPackages[resolvedLhs]} to ${packages[resolvedLhs]}.`);
134
+ }
132
135
  let target = packages[p];
133
136
  if (typeof target !== 'string')
134
137
  continue;
@@ -208,7 +211,7 @@
208
211
  if (!nonce) {
209
212
  const nonceElement = document.querySelector('script[nonce]');
210
213
  if (nonceElement)
211
- nonce = nonceElement.getAttribute('nonce');
214
+ nonce = nonceElement.nonce || nonceElement.getAttribute('nonce');
212
215
  }
213
216
 
214
217
  const onerror = globalHook(esmsInitOptions$1.onerror || noop);
@@ -216,7 +219,7 @@
216
219
 
217
220
  const { revokeBlobURLs, noLoadEventRetriggers } = esmsInitOptions$1;
218
221
 
219
- const fetchHook = esmsInitOptions$1.fetchHook ? globalHook(esmsInitOptions$1.fetchHook) : fetch;
222
+ const fetchHook = esmsInitOptions$1.fetch ? globalHook(esmsInitOptions$1.fetch) : fetch;
220
223
 
221
224
  function globalHook (name) {
222
225
  return typeof name === 'string' ? self[name] : name;
@@ -243,14 +246,14 @@
243
246
  s.addEventListener('error', cb);
244
247
  s.addEventListener('load', cb);
245
248
 
246
- function cb () {
249
+ function cb (_err) {
247
250
  document.head.removeChild(s);
248
251
  if (self._esmsi) {
249
252
  resolve(self._esmsi, baseUrl);
250
253
  self._esmsi = undefined;
251
254
  }
252
255
  else {
253
- reject(err.error || new Error(`Error loading or executing the graph of ${errUrl} (check the console for ${src}).`));
256
+ reject(!(_err instanceof Event) && _err || err && err.error || new Error(`Error loading or executing the graph of ${errUrl} (check the console for ${src}).`));
254
257
  err = undefined;
255
258
  }
256
259
  }
@@ -301,7 +304,7 @@
301
304
  ]);
302
305
  });
303
306
 
304
- let e,r,a,s=4194304;const i=1===new Uint8Array(new Uint16Array([1]).buffer)[0];let t,c$1;function parse(c,b="@"){if(t=c,t.length>s||!e){for(;t.length>s;)s*=2;r=new ArrayBuffer(4*s),e=function(e,r,a){"use asm";var s=new e.Int8Array(a),i=new e.Int16Array(a),t=new e.Int32Array(a),c=new e.Uint8Array(a),f=new e.Uint16Array(a),n=816;function u(e){e=e|0;var r=0,a=0,c=0,u=0,l=0;l=n;n=n+14336|0;u=l;s[589]=1;i[291]=0;i[292]=0;i[293]=-1;t[15]=t[2];s[590]=0;t[14]=0;s[588]=0;t[16]=l+10240;t[17]=l+2048;s[591]=0;e=(t[3]|0)+-2|0;t[18]=e;r=e+(t[12]<<1)|0;t[19]=r;e:while(1){a=e+2|0;t[18]=a;if(e>>>0>=r>>>0){c=18;break}r:do{switch(i[a>>1]|0){case 9:case 10:case 11:case 12:case 13:case 32:break;case 101:{if((((i[292]|0)==0?T(a)|0:0)?B(e+4|0,120,112,111,114,116)|0:0)?(b(),(s[589]|0)==0):0){c=9;break e}else c=17;break}case 105:{if(T(a)|0?B(e+4|0,109,112,111,114,116)|0:0){k();c=17;}else c=17;break}case 59:{c=17;break}case 47:switch(i[e+4>>1]|0){case 47:{H();break r}case 42:{p(1);break r}default:{c=16;break e}}default:{c=16;break e}}}while(0);if((c|0)==17){c=0;t[15]=t[18];}e=t[18]|0;r=t[19]|0;}if((c|0)==9){e=t[18]|0;t[15]=e;c=19;}else if((c|0)==16){s[589]=0;t[18]=e;c=19;}else if((c|0)==18)if(!(s[588]|0)){e=a;c=19;}else e=0;do{if((c|0)==19){e:while(1){r=e+2|0;t[18]=r;a=r;if(e>>>0>=(t[19]|0)>>>0){c=75;break}r:do{switch(i[r>>1]|0){case 9:case 10:case 11:case 12:case 13:case 32:break;case 101:{if(((i[292]|0)==0?T(r)|0:0)?B(e+4|0,120,112,111,114,116)|0:0){b();c=74;}else c=74;break}case 105:{if(T(r)|0?B(e+4|0,109,112,111,114,116)|0:0){k();c=74;}else c=74;break}case 99:{if((T(r)|0?D(e+4|0,108,97,115,115)|0:0)?_(i[e+12>>1]|0)|0:0){s[591]=1;c=74;}else c=74;break}case 40:{r=t[15]|0;a=t[17]|0;c=i[292]|0;i[292]=c+1<<16>>16;t[a+((c&65535)<<2)>>2]=r;c=74;break}case 41:{e=i[292]|0;if(!(e<<16>>16)){c=36;break e}c=e+-1<<16>>16;i[292]=c;e=t[11]|0;if((e|0)!=0?(t[e+20>>2]|0)==(t[(t[17]|0)+((c&65535)<<2)>>2]|0):0){r=e+4|0;if(!(t[r>>2]|0))t[r>>2]=a;t[e+12>>2]=a;t[11]=0;c=74;}else c=74;break}case 123:{c=t[15]|0;a=t[8]|0;e=c;do{if((i[c>>1]|0)==41&(a|0)!=0?(t[a+4>>2]|0)==(c|0):0){r=t[9]|0;t[8]=r;if(!r){t[4]=0;break}else {t[r+28>>2]=0;break}}}while(0);r=i[292]|0;c=r&65535;s[u+c>>0]=s[591]|0;s[591]=0;a=t[17]|0;i[292]=r+1<<16>>16;t[a+(c<<2)>>2]=e;c=74;break}case 125:{e=i[292]|0;if(!(e<<16>>16)){c=49;break e}a=e+-1<<16>>16;i[292]=a;r=i[293]|0;if(e<<16>>16!=r<<16>>16)if(r<<16>>16!=-1&(a&65535)<(r&65535)){c=53;break e}else {c=74;break r}else {a=t[16]|0;c=(i[291]|0)+-1<<16>>16;i[291]=c;i[293]=i[a+((c&65535)<<1)>>1]|0;h();c=74;break r}}case 39:{d();c=74;break}case 34:{v();c=74;break}case 47:switch(i[e+4>>1]|0){case 47:{H();break r}case 42:{p(1);break r}default:{r=t[15]|0;a=i[r>>1]|0;a:do{if(!(m(a)|0)){switch(a<<16>>16){case 41:if(M(t[(t[17]|0)+(f[292]<<2)>>2]|0)|0){c=71;break a}else {c=68;break a}case 125:break;default:{c=68;break a}}e=f[292]|0;if(!(g(t[(t[17]|0)+(e<<2)>>2]|0)|0)?(s[u+e>>0]|0)==0:0)c=68;else c=71;}else switch(a<<16>>16){case 46:if(((i[r+-2>>1]|0)+-48&65535)<10){c=68;break a}else {c=71;break a}case 43:if((i[r+-2>>1]|0)==43){c=68;break a}else {c=71;break a}case 45:if((i[r+-2>>1]|0)==45){c=68;break a}else {c=71;break a}default:{c=71;break a}}}while(0);a:do{if((c|0)==68){c=0;if(!(o(r)|0)){switch(a<<16>>16){case 0:{c=71;break a}case 47:break;default:{e=1;break a}}if(!(s[590]|0))e=1;else c=71;}else c=71;}}while(0);if((c|0)==71){I();e=0;}s[590]=e;c=74;break r}}case 96:{h();c=74;break}default:c=74;}}while(0);if((c|0)==74){c=0;t[15]=t[18];}e=t[18]|0;}if((c|0)==36){Z();e=0;break}else if((c|0)==49){Z();e=0;break}else if((c|0)==53){Z();e=0;break}else if((c|0)==75){e=(i[293]|0)==-1&(i[292]|0)==0&(s[588]|0)==0;break}}}while(0);n=l;return e|0}function b(){var e=0,r=0,a=0,c=0,f=0,n=0;f=t[18]|0;n=f+12|0;t[18]=n;r=w(1)|0;e=t[18]|0;if(!((e|0)==(n|0)?!(E(r)|0):0))c=3;e:do{if((c|0)==3){r:do{switch(r<<16>>16){case 100:{K(e,e+14|0);break e}case 97:{t[18]=e+10;w(1)|0;e=t[18]|0;c=6;break}case 102:{c=6;break}case 99:{if(D(e+2|0,108,97,115,115)|0?(a=e+10|0,G(i[a>>1]|0)|0):0){t[18]=a;f=w(1)|0;n=t[18]|0;J(f)|0;K(n,t[18]|0);t[18]=(t[18]|0)+-2;break e}e=e+4|0;t[18]=e;c=13;break}case 108:case 118:{c=13;break}case 123:{t[18]=e+2;e=w(1)|0;a=t[18]|0;while(1){J(e)|0;e=t[18]|0;w(1)|0;e=$(a,e)|0;if(e<<16>>16==44){t[18]=(t[18]|0)+2;e=w(1)|0;}r=a;a=t[18]|0;if(e<<16>>16==125){c=29;break}if((a|0)==(r|0)){c=26;break}if(a>>>0>(t[19]|0)>>>0){c=28;break}}if((c|0)==26){Z();break e}else if((c|0)==28){Z();break e}else if((c|0)==29){t[18]=a+2;c=31;break r}break}case 42:{t[18]=e+2;w(1)|0;c=t[18]|0;$(c,c)|0;c=31;break}default:{}}}while(0);if((c|0)==6){t[18]=e+16;e=w(1)|0;if(e<<16>>16==42){t[18]=(t[18]|0)+2;e=w(1)|0;}n=t[18]|0;J(e)|0;K(n,t[18]|0);t[18]=(t[18]|0)+-2;break}else if((c|0)==13){e=e+4|0;t[18]=e;s[589]=0;r:while(1){t[18]=e+2;n=w(1)|0;e=t[18]|0;switch((J(n)|0)<<16>>16){case 91:case 123:{c=15;break r}default:{}}r=t[18]|0;if((r|0)==(e|0))break e;K(e,r);switch((w(1)|0)<<16>>16){case 61:{c=19;break r}case 44:break;default:{c=20;break r}}e=t[18]|0;}if((c|0)==15){t[18]=(t[18]|0)+-2;break}else if((c|0)==19){t[18]=(t[18]|0)+-2;break}else if((c|0)==20){t[18]=(t[18]|0)+-2;break}}else if((c|0)==31)r=w(1)|0;e=t[18]|0;if(r<<16>>16==102?L(e+2|0,114,111,109)|0:0){t[18]=e+8;l(f,w(1)|0);break}t[18]=e+-2;}}while(0);return}function k(){var e=0,r=0,a=0,c=0,f=0;f=t[18]|0;r=f+12|0;t[18]=r;e:do{switch((w(1)|0)<<16>>16){case 40:{r=t[17]|0;a=i[292]|0;i[292]=a+1<<16>>16;t[r+((a&65535)<<2)>>2]=f;if((i[t[15]>>1]|0)!=46){A(f,(t[18]|0)+2|0,0,f);t[11]=t[8];t[18]=(t[18]|0)+2;switch((w(1)|0)<<16>>16){case 39:{d();break}case 34:{v();break}default:{t[18]=(t[18]|0)+-2;break e}}t[18]=(t[18]|0)+2;switch((w(1)|0)<<16>>16){case 44:{f=t[18]|0;t[(t[8]|0)+4>>2]=f;t[18]=f+2;w(1)|0;f=t[18]|0;a=t[8]|0;t[a+16>>2]=f;s[a+24>>0]=1;t[18]=f+-2;break e}case 41:{i[292]=(i[292]|0)+-1<<16>>16;a=t[18]|0;f=t[8]|0;t[f+4>>2]=a;t[f+12>>2]=a;s[f+24>>0]=1;break e}default:{t[18]=(t[18]|0)+-2;break e}}}break}case 46:{t[18]=(t[18]|0)+2;if(((w(1)|0)<<16>>16==109?(e=t[18]|0,L(e+2|0,101,116,97)|0):0)?(i[t[15]>>1]|0)!=46:0)A(f,f,e+8|0,2);break}case 42:case 123:case 39:case 34:{c=16;break}default:if((t[18]|0)!=(r|0))c=16;}}while(0);do{if((c|0)==16){if(i[292]|0){t[18]=(t[18]|0)+-2;break}e=t[19]|0;r=t[18]|0;e:while(1){if(r>>>0>=e>>>0){c=23;break}a=i[r>>1]|0;switch(a<<16>>16){case 34:case 39:{c=21;break e}default:{}}c=r+2|0;t[18]=c;r=c;}if((c|0)==21){l(f,a);break}else if((c|0)==23){Z();break}}}while(0);return}function l(e,r){e=e|0;r=r|0;var a=0,s=0;a=(t[18]|0)+2|0;switch(r<<16>>16){case 39:{d();s=5;break}case 34:{v();s=5;break}default:Z();}do{if((s|0)==5){A(e,a,t[18]|0,1);t[18]=(t[18]|0)+2;s=(w(0)|0)<<16>>16==97;r=t[18]|0;if(s?B(r+2|0,115,115,101,114,116)|0:0){t[18]=r+12;if((w(1)|0)<<16>>16!=123){t[18]=r;break}e=t[18]|0;a=e;e:while(1){t[18]=a+2;a=w(1)|0;switch(a<<16>>16){case 39:{d();t[18]=(t[18]|0)+2;a=w(1)|0;break}case 34:{v();t[18]=(t[18]|0)+2;a=w(1)|0;break}default:a=J(a)|0;}if(a<<16>>16!=58){s=16;break}t[18]=(t[18]|0)+2;switch((w(1)|0)<<16>>16){case 39:{d();break}case 34:{v();break}default:{s=20;break e}}t[18]=(t[18]|0)+2;switch((w(1)|0)<<16>>16){case 125:{s=25;break e}case 44:break;default:{s=24;break e}}t[18]=(t[18]|0)+2;if((w(1)|0)<<16>>16==125){s=25;break}a=t[18]|0;}if((s|0)==16){t[18]=r;break}else if((s|0)==20){t[18]=r;break}else if((s|0)==24){t[18]=r;break}else if((s|0)==25){s=t[8]|0;t[s+16>>2]=e;t[s+12>>2]=(t[18]|0)+2;break}}t[18]=r+-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=z(e+-4|0,118,111)|0;break e}case 108:{e=q(e+-4|0,121,105,101)|0;break e}default:{e=0;break e}}case 101:{switch(i[e+-2>>1]|0){case 115:break;case 116:{e=P(e+-4|0,100,101,108,101)|0;break e}default:{e=0;break e}}switch(i[e+-4>>1]|0){case 108:{e=F(e+-6|0,101)|0;break e}case 97:{e=F(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,105,110,115,116,97,110)|0;break e}case 112:{e=z(e+-8|0,116,121)|0;break e}default:{e=0;break e}}else e=0;break}case 110:{e=e+-2|0;if(F(e,105)|0)e=1;else e=O(e,114,101,116,117,114)|0;break}case 111:{e=F(e+-2|0,100)|0;break}case 114:{e=U(e+-2|0,100,101,98,117,103,103,101)|0;break}case 116:{e=P(e+-2|0,97,119,97,105)|0;break}case 119:switch(i[e+-2>>1]|0){case 101:{e=F(e+-4|0,110)|0;break e}case 111:{e=q(e+-4|0,116,104,114)|0;break e}default:{e=0;break e}}default:e=0;}}while(0);return e|0}function h(){var e=0,r=0,a=0;r=t[19]|0;a=t[18]|0;e:while(1){e=a+2|0;if(a>>>0>=r>>>0){r=8;break}switch(i[e>>1]|0){case 96:{r=9;break e}case 36:{if((i[a+4>>1]|0)==123){r=6;break e}break}case 92:{e=a+4|0;break}default:{}}a=e;}if((r|0)==6){t[18]=a+4;e=i[293]|0;r=t[16]|0;a=i[291]|0;i[291]=a+1<<16>>16;i[r+((a&65535)<<1)>>1]=e;a=(i[292]|0)+1<<16>>16;i[292]=a;i[293]=a;}else if((r|0)==8){t[18]=e;Z();}else if((r|0)==9)t[18]=e;return}function w(e){e=e|0;var r=0,a=0,s=0;a=t[18]|0;e:do{r=i[a>>1]|0;r:do{if(r<<16>>16!=47)if(e)if(_(r)|0)break;else break e;else if(R(r)|0)break;else break e;else switch(i[a+2>>1]|0){case 47:{H();break r}case 42:{p(e);break r}default:{r=47;break e}}}while(0);s=t[18]|0;a=s+2|0;t[18]=a;}while(s>>>0<(t[19]|0)>>>0);return r|0}function d(){var e=0,r=0,a=0,s=0;s=t[19]|0;e=t[18]|0;e:while(1){a=e+2|0;if(e>>>0>=s>>>0){e=8;break}r=i[a>>1]|0;switch(r<<16>>16){case 39:{e=9;break e}case 92:{r=e+4|0;if((i[r>>1]|0)==13){e=e+6|0;e=(i[e>>1]|0)==10?e:r;}else e=r;break}default:if(ae(r)|0){e=8;break e}else e=a;}}if((e|0)==8){t[18]=a;Z();}else if((e|0)==9)t[18]=a;return}function v(){var e=0,r=0,a=0,s=0;s=t[19]|0;e=t[18]|0;e:while(1){a=e+2|0;if(e>>>0>=s>>>0){e=8;break}r=i[a>>1]|0;switch(r<<16>>16){case 34:{e=9;break e}case 92:{r=e+4|0;if((i[r>>1]|0)==13){e=e+6|0;e=(i[e>>1]|0)==10?e:r;}else e=r;break}default:if(ae(r)|0){e=8;break e}else e=a;}}if((e|0)==8){t[18]=a;Z();}else if((e|0)==9)t[18]=a;return}function A(e,r,a,i){e=e|0;r=r|0;a=a|0;i=i|0;var c=0,f=0;c=t[13]|0;t[13]=c+32;f=t[8]|0;t[((f|0)==0?16:f+28|0)>>2]=c;t[9]=f;t[8]=c;t[c+8>>2]=e;do{if(2!=(i|0))if(1==(i|0)){t[c+12>>2]=a+2;break}else {t[c+12>>2]=t[3];break}else t[c+12>>2]=a;}while(0);t[c>>2]=r;t[c+4>>2]=a;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 y(){var e=0,r=0,a=0;a=t[19]|0;r=t[18]|0;e:while(1){e=r+2|0;if(r>>>0>=a>>>0){r=6;break}switch(i[e>>1]|0){case 13:case 10:{r=6;break e}case 93:{r=7;break e}case 92:{e=r+4|0;break}default:{}}r=e;}if((r|0)==6){t[18]=e;Z();e=0;}else if((r|0)==7){t[18]=e;e=93;}return e|0}function C(e,r,a,s,t,c,f,n){e=e|0;r=r|0;a=a|0;s=s|0;t=t|0;c=c|0;f=f|0;n=n|0;if((((((i[e+12>>1]|0)==n<<16>>16?(i[e+10>>1]|0)==f<<16>>16:0)?(i[e+8>>1]|0)==c<<16>>16:0)?(i[e+6>>1]|0)==t<<16>>16:0)?(i[e+4>>1]|0)==s<<16>>16:0)?(i[e+2>>1]|0)==a<<16>>16:0)r=(i[e>>1]|0)==r<<16>>16;else r=0;return r|0}function g(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=P(e+-2|0,99,97,116,99)|0;break}case 121:{e=S(e+-2|0,102,105,110,97,108,108)|0;break}case 101:{e=q(e+-2|0,101,108,115)|0;break}default:e=0;}return e|0}function I(){var e=0,r=0,a=0;e:while(1){e=t[18]|0;r=e+2|0;t[18]=r;if(e>>>0>=(t[19]|0)>>>0){a=7;break}switch(i[r>>1]|0){case 13:case 10:{a=7;break e}case 47:break e;case 91:{y()|0;break}case 92:{t[18]=e+4;break}default:{}}}if((a|0)==7)Z();return}function p(e){e=e|0;var r=0,a=0,s=0,c=0,f=0;c=(t[18]|0)+2|0;t[18]=c;a=t[19]|0;while(1){r=c+2|0;if(c>>>0>=a>>>0)break;s=i[r>>1]|0;if(!e?ae(s)|0:0)break;if(s<<16>>16==42?(i[c+4>>1]|0)==47:0){f=8;break}c=r;}if((f|0)==8){t[18]=r;r=c+4|0;}t[18]=r;return}function x(e,r,a,s,t,c,f){e=e|0;r=r|0;a=a|0;s=s|0;t=t|0;c=c|0;f=f|0;if(((((i[e+10>>1]|0)==f<<16>>16?(i[e+8>>1]|0)==c<<16>>16:0)?(i[e+6>>1]|0)==t<<16>>16:0)?(i[e+4>>1]|0)==s<<16>>16:0)?(i[e+2>>1]|0)==a<<16>>16:0)r=(i[e>>1]|0)==r<<16>>16;else r=0;return r|0}function U(e,r,a,s,c,f,n,u){e=e|0;r=r|0;a=a|0;s=s|0;c=c|0;f=f|0;n=n|0;u=u|0;var b=0,k=0;k=e+-12|0;b=t[3]|0;if(k>>>0>=b>>>0?C(k,r,a,s,c,f,n,u)|0:0)if((k|0)==(b|0))b=1;else b=G(i[e+-14>>1]|0)|0;else b=0;return b|0}function E(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 m(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 S(e,r,a,s,c,f,n){e=e|0;r=r|0;a=a|0;s=s|0;c=c|0;f=f|0;n=n|0;var u=0,b=0;b=e+-10|0;u=t[3]|0;if(b>>>0>=u>>>0?x(b,r,a,s,c,f,n)|0:0)if((b|0)==(u|0))u=1;else u=G(i[e+-12>>1]|0)|0;else u=0;return u|0}function O(e,r,a,s,c,f){e=e|0;r=r|0;a=a|0;s=s|0;c=c|0;f=f|0;var n=0,u=0;u=e+-8|0;n=t[3]|0;if(u>>>0>=n>>>0?B(u,r,a,s,c,f)|0:0)if((u|0)==(n|0))n=1;else n=G(i[e+-10>>1]|0)|0;else n=0;return n|0}function $(e,r){e=e|0;r=r|0;var a=0,s=0;a=t[18]|0;s=i[a>>1]|0;if(s<<16>>16==97){t[18]=a+4;r=w(1)|0;e=t[18]|0;J(r)|0;r=t[18]|0;s=w(1)|0;a=t[18]|0;}if((a|0)!=(e|0))K(e,r);return s|0}function j(e){e=e|0;var r=0,a=0,s=0,c=0;a=n;n=n+16|0;s=a;t[s>>2]=0;t[12]=e;r=t[3]|0;c=r+(e<<1)|0;e=c+2|0;i[c>>1]=0;t[s>>2]=e;t[13]=e;t[4]=0;t[8]=0;t[6]=0;t[5]=0;t[10]=0;t[7]=0;n=a;return r|0}function B(e,r,a,s,t,c){e=e|0;r=r|0;a=a|0;s=s|0;t=t|0;c=c|0;if((((i[e+8>>1]|0)==c<<16>>16?(i[e+6>>1]|0)==t<<16>>16:0)?(i[e+4>>1]|0)==s<<16>>16:0)?(i[e+2>>1]|0)==a<<16>>16:0)r=(i[e>>1]|0)==r<<16>>16;else r=0;return r|0}function P(e,r,a,s,c){e=e|0;r=r|0;a=a|0;s=s|0;c=c|0;var f=0,n=0;n=e+-6|0;f=t[3]|0;if(n>>>0>=f>>>0?D(n,r,a,s,c)|0:0)if((n|0)==(f|0))f=1;else f=G(i[e+-8>>1]|0)|0;else f=0;return f|0}function q(e,r,a,s){e=e|0;r=r|0;a=a|0;s=s|0;var c=0,f=0;f=e+-4|0;c=t[3]|0;if(f>>>0>=c>>>0?L(f,r,a,s)|0:0)if((f|0)==(c|0))c=1;else c=G(i[e+-6>>1]|0)|0;else c=0;return c|0}function z(e,r,a){e=e|0;r=r|0;a=a|0;var s=0,c=0;c=e+-2|0;s=t[3]|0;if(c>>>0>=s>>>0?Q(c,r,a)|0:0)if((c|0)==(s|0))s=1;else s=G(i[e+-4>>1]|0)|0;else s=0;return s|0}function D(e,r,a,s,t){e=e|0;r=r|0;a=a|0;s=s|0;t=t|0;if(((i[e+6>>1]|0)==t<<16>>16?(i[e+4>>1]|0)==s<<16>>16:0)?(i[e+2>>1]|0)==a<<16>>16:0)r=(i[e>>1]|0)==r<<16>>16;else r=0;return r|0}function F(e,r){e=e|0;r=r|0;var a=0;a=t[3]|0;if(a>>>0<=e>>>0?(i[e>>1]|0)==r<<16>>16:0)if((a|0)==(e|0))a=1;else a=G(i[e+-2>>1]|0)|0;else a=0;return a|0}function G(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&(E(e)|0);}}while(0);return e|0}function H(){var e=0,r=0,a=0;e=t[19]|0;a=t[18]|0;e:while(1){r=a+2|0;if(a>>>0>=e>>>0)break;switch(i[r>>1]|0){case 13:case 10:break e;default:a=r;}}t[18]=r;return}function J(e){e=e|0;while(1){if(_(e)|0)break;if(E(e)|0)break;e=(t[18]|0)+2|0;t[18]=e;e=i[e>>1]|0;if(!(e<<16>>16)){e=0;break}}return e|0}function K(e,r){e=e|0;r=r|0;var a=0,s=0;a=t[13]|0;t[13]=a+12;s=t[10]|0;t[((s|0)==0?20:s+8|0)>>2]=a;t[10]=a;t[a>>2]=e;t[a+4>>2]=r;t[a+8>>2]=0;return}function L(e,r,a,s){e=e|0;r=r|0;a=a|0;s=s|0;if((i[e+4>>1]|0)==s<<16>>16?(i[e+2>>1]|0)==a<<16>>16:0)r=(i[e>>1]|0)==r<<16>>16;else r=0;return r|0}function M(e){e=e|0;if(!(O(e,119,104,105,108,101)|0)?!(q(e,102,111,114)|0):0)e=z(e,105,102)|0;else e=1;return e|0}function N(){var e=0;e=t[(t[6]|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,r,a){e=e|0;r=r|0;a=a|0;if((i[e+2>>1]|0)==a<<16>>16)r=(i[e>>1]|0)==r<<16>>16;else r=0;return r|0}function R(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 T(e){e=e|0;if((t[3]|0)==(e|0))e=1;else e=G(i[e+-2>>1]|0)|0;return e|0}function V(){var e=0;e=t[(t[6]|0)+16>>2]|0;if(!e)e=-1;else e=e-(t[3]|0)>>1;return e|0}function W(){var e=0;e=t[6]|0;e=t[((e|0)==0?16:e+28|0)>>2]|0;t[6]=e;return (e|0)!=0|0}function X(){var e=0;e=t[7]|0;e=t[((e|0)==0?20:e+8|0)>>2]|0;t[7]=e;return (e|0)!=0|0}function Y(e){e=e|0;var r=0;r=n;n=n+e|0;n=n+15&-16;return r|0}function Z(){s[588]=1;t[14]=(t[18]|0)-(t[3]|0)>>1;t[18]=(t[19]|0)+2;return}function _(e){e=e|0;return (e|128)<<16>>16==160|(e+-9&65535)<5|0}function ee(){return (t[(t[6]|0)+12>>2]|0)-(t[3]|0)>>1|0}function re(){return (t[(t[6]|0)+8>>2]|0)-(t[3]|0)>>1|0}function ae(e){e=e|0;return e<<16>>16==13|e<<16>>16==10|0}function se(){return (t[(t[6]|0)+4>>2]|0)-(t[3]|0)>>1|0}function ie(){return (t[(t[7]|0)+4>>2]|0)-(t[3]|0)>>1|0}function te(){return (t[t[6]>>2]|0)-(t[3]|0)>>1|0}function ce(){return (t[t[7]>>2]|0)-(t[3]|0)>>1|0}function fe(){return c[(t[6]|0)+24>>0]|0|0}function ne(e){e=e|0;t[3]=e;return}function ue(){return (s[589]|0)!=0|0}function be(){return t[14]|0}return {ai:V,e:be,ee:ie,es:ce,f:ue,id:N,ie:se,ip:fe,is:te,p:u,re:X,ri:W,sa:j,se:ee,ses:ne,ss:re,sta:Y}}({Int8Array:Int8Array,Int16Array:Int16Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array},{},r),a=e.sta(2*s);}const k=t.length+1;if(e.ses(a),e.sa(k-1),(i?n:f)(t,new Uint16Array(r,a,k)),!e.p())throw Object.assign(new Error(`Parse error ${b}:${t.slice(0,e.e()).split("\n").length}:${e.e()-t.lastIndexOf("\n",e.e()-1)}`),{idx:e.e()});const l=[],o=[];for(;e.ri();){const r=e.is(),a=e.ie(),s=e.ai(),i=e.id(),c=e.ss(),f=e.se();let n;e.ip()&&(n=u(-1===i?r:r+1,t.charCodeAt(-1===i?r-1:r))),l.push({n:n,s:r,e:a,ss:c,se:f,d:i,a:s});}for(;e.re();)o.push(t.slice(e.es(),e.ee()));return [l,o,!!e.f()]}function f(e,r){const a=e.length;let s=0;for(;s<a;){const a=e.charCodeAt(s);r[s++]=(255&a)<<8|a>>>8;}}function n(e,r){const a=e.length;let s=0;for(;s<a;)r[s]=e.charCodeAt(s++);}function u(e,r){c$1=e;let a="",s=c$1;for(;;){c$1>=t.length&&syntaxError();const e=t.charCodeAt(c$1);if(e===r)break;92===e?(a+=t.slice(s,c$1),a+=b(),s=c$1):(8232===e||8233===e||l(e)&&syntaxError(),++c$1);}return a+=t.slice(s,c$1++),a}function b(){let e=t.charCodeAt(++c$1);switch(++c$1,e){case 110:return "\n";case 114:return "\r";case 120:return String.fromCharCode(k(2));case 117:return function(){let e;123===t.charCodeAt(c$1)?(++c$1,e=k(t.indexOf("}",c$1)-c$1),++c$1,e>1114111&&syntaxError()):e=k(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===t.charCodeAt(c$1)&&++c$1;case 10:return "";case 56:case 57:syntaxError();default:if(e>=48&&e<=55){let r=t.substr(c$1-1,3).match(/^[0-7]+/)[0],a=parseInt(r,8);return a>255&&(r=r.slice(0,-1),a=parseInt(r,8)),c$1+=r.length-1,e=t.charCodeAt(c$1),"0"===r&&56!==e&&57!==e||syntaxError(),String.fromCharCode(a)}return l(e)?"":String.fromCharCode(e)}}function k(e){const r=c$1;let a=0,s=0;for(let r=0;r<e;++r,++c$1){let e,i=t.charCodeAt(c$1);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,a=16*a+e;}else 95!==s&&0!==r||syntaxError(),s=i;}return 95!==s&&c$1-r===e||syntaxError(),a}function l(e){return 13===e||10===e}
307
+ let e,r,a,i=4194304;const s=1===new Uint8Array(new Uint16Array([1]).buffer)[0];let t,f,c$1;function parse(k,l="@"){if(t=k,f=l,t.length>i||!e){for(;t.length>i;)i*=2;r=new ArrayBuffer(4*i),e=function(e,r,a){"use asm";var i=new e.Int8Array(a),s=new e.Int16Array(a),t=new e.Int32Array(a),f=new e.Uint8Array(a),c=new e.Uint16Array(a),n=816;function b(e){e=e|0;var r=0,a=0,f=0,b=0,l=0;l=n;n=n+14336|0;b=l;i[589]=1;s[291]=0;s[292]=0;s[293]=-1;t[15]=t[2];i[590]=0;t[14]=0;i[588]=0;t[16]=l+10240;t[17]=l+2048;i[591]=0;e=(t[3]|0)+-2|0;t[18]=e;r=e+(t[12]<<1)|0;t[19]=r;e:while(1){a=e+2|0;t[18]=a;if(e>>>0>=r>>>0){f=18;break}r:do{switch(s[a>>1]|0){case 9:case 10:case 11:case 12:case 13:case 32:break;case 101:{if((((s[292]|0)==0?R(a)|0:0)?B(e+4|0,120,112,111,114,116)|0:0)?(u(),(i[589]|0)==0):0){f=9;break e}else f=17;break}case 105:{if(R(a)|0?B(e+4|0,109,112,111,114,116)|0:0){k();f=17;}else f=17;break}case 59:{f=17;break}case 47:switch(s[e+4>>1]|0){case 47:{G();break r}case 42:{p(1);break r}default:{f=16;break e}}default:{f=16;break e}}}while(0);if((f|0)==17){f=0;t[15]=t[18];}e=t[18]|0;r=t[19]|0;}if((f|0)==9){e=t[18]|0;t[15]=e;f=19;}else if((f|0)==16){i[589]=0;t[18]=e;f=19;}else if((f|0)==18)if(!(i[588]|0)){e=a;f=19;}else e=0;do{if((f|0)==19){e:while(1){r=e+2|0;t[18]=r;a=r;if(e>>>0>=(t[19]|0)>>>0){f=75;break}r:do{switch(s[r>>1]|0){case 9:case 10:case 11:case 12:case 13:case 32:break;case 101:{if(((s[292]|0)==0?R(r)|0:0)?B(e+4|0,120,112,111,114,116)|0:0){u();f=74;}else f=74;break}case 105:{if(R(r)|0?B(e+4|0,109,112,111,114,116)|0:0){k();f=74;}else f=74;break}case 99:{if((R(r)|0?z(e+4|0,108,97,115,115)|0:0)?Z(s[e+12>>1]|0)|0:0){i[591]=1;f=74;}else f=74;break}case 40:{r=t[15]|0;a=t[17]|0;f=s[292]|0;s[292]=f+1<<16>>16;t[a+((f&65535)<<2)>>2]=r;f=74;break}case 41:{e=s[292]|0;if(!(e<<16>>16)){f=36;break e}f=e+-1<<16>>16;s[292]=f;e=t[11]|0;if((e|0)!=0?(t[e+20>>2]|0)==(t[(t[17]|0)+((f&65535)<<2)>>2]|0):0){r=e+4|0;if(!(t[r>>2]|0))t[r>>2]=a;t[e+12>>2]=a;t[11]=0;f=74;}else f=74;break}case 123:{f=t[15]|0;a=t[8]|0;e=f;do{if((s[f>>1]|0)==41&(a|0)!=0?(t[a+4>>2]|0)==(f|0):0){r=t[9]|0;t[8]=r;if(!r){t[4]=0;break}else {t[r+28>>2]=0;break}}}while(0);r=s[292]|0;f=r&65535;i[b+f>>0]=i[591]|0;i[591]=0;a=t[17]|0;s[292]=r+1<<16>>16;t[a+(f<<2)>>2]=e;f=74;break}case 125:{e=s[292]|0;if(!(e<<16>>16)){f=49;break e}a=e+-1<<16>>16;s[292]=a;r=s[293]|0;if(e<<16>>16!=r<<16>>16)if(r<<16>>16!=-1&(a&65535)<(r&65535)){f=53;break e}else {f=74;break r}else {a=t[16]|0;f=(s[291]|0)+-1<<16>>16;s[291]=f;s[293]=s[a+((f&65535)<<1)>>1]|0;h();f=74;break r}}case 39:{d(39);f=74;break}case 34:{d(34);f=74;break}case 47:switch(s[e+4>>1]|0){case 47:{G();break r}case 42:{p(1);break r}default:{r=t[15]|0;a=s[r>>1]|0;a:do{if(!(x(a)|0)){switch(a<<16>>16){case 41:if(L(t[(t[17]|0)+(c[292]<<2)>>2]|0)|0){f=71;break a}else {f=68;break a}case 125:break;default:{f=68;break a}}e=c[292]|0;if(!(y(t[(t[17]|0)+(e<<2)>>2]|0)|0)?(i[b+e>>0]|0)==0:0)f=68;else f=71;}else switch(a<<16>>16){case 46:if(((s[r+-2>>1]|0)+-48&65535)<10){f=68;break a}else {f=71;break a}case 43:if((s[r+-2>>1]|0)==43){f=68;break a}else {f=71;break a}case 45:if((s[r+-2>>1]|0)==45){f=68;break a}else {f=71;break a}default:{f=71;break a}}}while(0);a:do{if((f|0)==68){f=0;if(!(o(r)|0)){switch(a<<16>>16){case 0:{f=71;break a}case 47:break;default:{e=1;break a}}if(!(i[590]|0))e=1;else f=71;}else f=71;}}while(0);if((f|0)==71){I();e=0;}i[590]=e;f=74;break r}}case 96:{h();f=74;break}default:f=74;}}while(0);if((f|0)==74){f=0;t[15]=t[18];}e=t[18]|0;}if((f|0)==36){Y();e=0;break}else if((f|0)==49){Y();e=0;break}else if((f|0)==53){Y();e=0;break}else if((f|0)==75){e=(s[293]|0)==-1&(s[292]|0)==0&(i[588]|0)==0;break}}}while(0);n=l;return e|0}function u(){var e=0,r=0,a=0,f=0,c=0,n=0;c=t[18]|0;n=c+12|0;t[18]=n;r=w(1)|0;e=t[18]|0;if(!((e|0)==(n|0)?!(S(r)|0):0))f=3;e:do{if((f|0)==3){r:do{switch(r<<16>>16){case 100:{J(e,e+14|0);break e}case 97:{t[18]=e+10;w(1)|0;e=t[18]|0;f=6;break}case 102:{f=6;break}case 99:{if(z(e+2|0,108,97,115,115)|0?(a=e+10|0,F(s[a>>1]|0)|0):0){t[18]=a;c=w(1)|0;n=t[18]|0;H(c)|0;J(n,t[18]|0);t[18]=(t[18]|0)+-2;break e}e=e+4|0;t[18]=e;f=13;break}case 108:case 118:{f=13;break}case 123:{t[18]=e+2;e=w(1)|0;a=t[18]|0;while(1){if(_(e)|0){d(e);e=(t[18]|0)+2|0;t[18]=e;}else {H(e)|0;e=t[18]|0;}w(1)|0;e=g(a,e)|0;if(e<<16>>16==44){t[18]=(t[18]|0)+2;e=w(1)|0;}r=a;a=t[18]|0;if(e<<16>>16==125){f=32;break}if((a|0)==(r|0)){f=29;break}if(a>>>0>(t[19]|0)>>>0){f=31;break}}if((f|0)==29){Y();break e}else if((f|0)==31){Y();break e}else if((f|0)==32){t[18]=a+2;f=34;break r}break}case 42:{t[18]=e+2;w(1)|0;f=t[18]|0;g(f,f)|0;f=34;break}default:{}}}while(0);if((f|0)==6){t[18]=e+16;e=w(1)|0;if(e<<16>>16==42){t[18]=(t[18]|0)+2;e=w(1)|0;}n=t[18]|0;H(e)|0;J(n,t[18]|0);t[18]=(t[18]|0)+-2;break}else if((f|0)==13){e=e+4|0;t[18]=e;i[589]=0;r:while(1){t[18]=e+2;n=w(1)|0;e=t[18]|0;switch((H(n)|0)<<16>>16){case 91:case 123:{f=15;break r}default:{}}r=t[18]|0;if((r|0)==(e|0))break e;J(e,r);switch((w(1)|0)<<16>>16){case 61:{f=19;break r}case 44:break;default:{f=20;break r}}e=t[18]|0;}if((f|0)==15){t[18]=(t[18]|0)+-2;break}else if((f|0)==19){t[18]=(t[18]|0)+-2;break}else if((f|0)==20){t[18]=(t[18]|0)+-2;break}}else if((f|0)==34)r=w(1)|0;e=t[18]|0;if(r<<16>>16==102?K(e+2|0,114,111,109)|0:0){t[18]=e+8;l(c,w(1)|0);break}t[18]=e+-2;}}while(0);return}function k(){var e=0,r=0,a=0,f=0,c=0;c=t[18]|0;r=c+12|0;t[18]=r;e:do{switch((w(1)|0)<<16>>16){case 40:{r=t[17]|0;a=s[292]|0;s[292]=a+1<<16>>16;t[r+((a&65535)<<2)>>2]=c;if((s[t[15]>>1]|0)!=46){v(c,(t[18]|0)+2|0,0,c);t[11]=t[8];t[18]=(t[18]|0)+2;switch((w(1)|0)<<16>>16){case 39:{d(39);break}case 34:{d(34);break}default:{t[18]=(t[18]|0)+-2;break e}}t[18]=(t[18]|0)+2;switch((w(1)|0)<<16>>16){case 44:{c=t[18]|0;t[(t[8]|0)+4>>2]=c;t[18]=c+2;w(1)|0;c=t[18]|0;a=t[8]|0;t[a+16>>2]=c;i[a+24>>0]=1;t[18]=c+-2;break e}case 41:{s[292]=(s[292]|0)+-1<<16>>16;a=t[18]|0;c=t[8]|0;t[c+4>>2]=a;t[c+12>>2]=a;i[c+24>>0]=1;break e}default:{t[18]=(t[18]|0)+-2;break e}}}break}case 46:{t[18]=(t[18]|0)+2;if(((w(1)|0)<<16>>16==109?(e=t[18]|0,K(e+2|0,101,116,97)|0):0)?(s[t[15]>>1]|0)!=46:0)v(c,c,e+8|0,2);break}case 42:case 39:case 34:{f=16;break}case 123:{e=t[18]|0;if(s[292]|0){t[18]=e+-2;break e}while(1){if(e>>>0>=(t[19]|0)>>>0)break;e=w(1)|0;if(!(_(e)|0)){if(e<<16>>16==125){f=31;break}}else d(e);e=(t[18]|0)+2|0;t[18]=e;}if((f|0)==31)t[18]=(t[18]|0)+2;w(1)|0;e=t[18]|0;if(!(z(e,102,114,111,109)|0)){Y();break e}t[18]=e+8;e=w(1)|0;if(_(e)|0){l(c,e);break e}else {Y();break e}}default:if((t[18]|0)!=(r|0))f=16;}}while(0);do{if((f|0)==16){if(s[292]|0){t[18]=(t[18]|0)+-2;break}e=t[19]|0;r=t[18]|0;while(1){if(r>>>0>=e>>>0){f=23;break}a=s[r>>1]|0;if(_(a)|0){f=21;break}f=r+2|0;t[18]=f;r=f;}if((f|0)==21){l(c,a);break}else if((f|0)==23){Y();break}}}while(0);return}function l(e,r){e=e|0;r=r|0;var a=0,i=0;a=(t[18]|0)+2|0;switch(r<<16>>16){case 39:{d(39);i=5;break}case 34:{d(34);i=5;break}default:Y();}do{if((i|0)==5){v(e,a,t[18]|0,1);t[18]=(t[18]|0)+2;i=(w(0)|0)<<16>>16==97;r=t[18]|0;if(i?B(r+2|0,115,115,101,114,116)|0:0){t[18]=r+12;if((w(1)|0)<<16>>16!=123){t[18]=r;break}e=t[18]|0;a=e;e:while(1){t[18]=a+2;a=w(1)|0;switch(a<<16>>16){case 39:{d(39);t[18]=(t[18]|0)+2;a=w(1)|0;break}case 34:{d(34);t[18]=(t[18]|0)+2;a=w(1)|0;break}default:a=H(a)|0;}if(a<<16>>16!=58){i=16;break}t[18]=(t[18]|0)+2;switch((w(1)|0)<<16>>16){case 39:{d(39);break}case 34:{d(34);break}default:{i=20;break e}}t[18]=(t[18]|0)+2;switch((w(1)|0)<<16>>16){case 125:{i=25;break e}case 44:break;default:{i=24;break e}}t[18]=(t[18]|0)+2;if((w(1)|0)<<16>>16==125){i=25;break}a=t[18]|0;}if((i|0)==16){t[18]=r;break}else if((i|0)==20){t[18]=r;break}else if((i|0)==24){t[18]=r;break}else if((i|0)==25){i=t[8]|0;t[i+16>>2]=e;t[i+12>>2]=(t[18]|0)+2;break}}t[18]=r+-2;}}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=q(e+-4|0,118,111)|0;break e}case 108:{e=P(e+-4|0,121,105,101)|0;break e}default:{e=0;break e}}case 101:{switch(s[e+-2>>1]|0){case 115:break;case 116:{e=E(e+-4|0,100,101,108,101)|0;break e}default:{e=0;break e}}switch(s[e+-4>>1]|0){case 108:{e=D(e+-6|0,101)|0;break e}case 97:{e=D(e+-6|0,99)|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,105,110,115,116,97,110)|0;break e}case 112:{e=q(e+-8|0,116,121)|0;break e}default:{e=0;break e}}else e=0;break}case 110:{e=e+-2|0;if(D(e,105)|0)e=1;else e=$(e,114,101,116,117,114)|0;break}case 111:{e=D(e+-2|0,100)|0;break}case 114:{e=m(e+-2|0,100,101,98,117,103,103,101)|0;break}case 116:{e=E(e+-2|0,97,119,97,105)|0;break}case 119:switch(s[e+-2>>1]|0){case 101:{e=D(e+-4|0,110)|0;break e}case 111:{e=P(e+-4|0,116,104,114)|0;break e}default:{e=0;break e}}default:e=0;}}while(0);return e|0}function h(){var e=0,r=0,a=0;r=t[19]|0;a=t[18]|0;e:while(1){e=a+2|0;if(a>>>0>=r>>>0){r=8;break}switch(s[e>>1]|0){case 96:{r=9;break e}case 36:{if((s[a+4>>1]|0)==123){r=6;break e}break}case 92:{e=a+4|0;break}default:{}}a=e;}if((r|0)==6){t[18]=a+4;e=s[293]|0;r=t[16]|0;a=s[291]|0;s[291]=a+1<<16>>16;s[r+((a&65535)<<1)>>1]=e;a=(s[292]|0)+1<<16>>16;s[292]=a;s[293]=a;}else if((r|0)==8){t[18]=e;Y();}else if((r|0)==9)t[18]=e;return}function w(e){e=e|0;var r=0,a=0,i=0;a=t[18]|0;e:do{r=s[a>>1]|0;r:do{if(r<<16>>16!=47)if(e)if(Z(r)|0)break;else break e;else if(Q(r)|0)break;else break e;else switch(s[a+2>>1]|0){case 47:{G();break r}case 42:{p(e);break r}default:{r=47;break e}}}while(0);i=t[18]|0;a=i+2|0;t[18]=a;}while(i>>>0<(t[19]|0)>>>0);return r|0}function d(e){e=e|0;var r=0,a=0,i=0,f=0;f=t[19]|0;r=t[18]|0;while(1){i=r+2|0;if(r>>>0>=f>>>0){r=9;break}a=s[i>>1]|0;if(a<<16>>16==e<<16>>16){r=10;break}if(a<<16>>16==92){a=r+4|0;if((s[a>>1]|0)==13){r=r+6|0;r=(s[r>>1]|0)==10?r:a;}else r=a;}else if(ae(a)|0){r=9;break}else r=i;}if((r|0)==9){t[18]=i;Y();}else if((r|0)==10)t[18]=i;return}function v(e,r,a,s){e=e|0;r=r|0;a=a|0;s=s|0;var f=0,c=0;f=t[13]|0;t[13]=f+32;c=t[8]|0;t[((c|0)==0?16:c+28|0)>>2]=f;t[9]=c;t[8]=f;t[f+8>>2]=e;do{if(2!=(s|0))if(1==(s|0)){t[f+12>>2]=a+2;break}else {t[f+12>>2]=t[3];break}else t[f+12>>2]=a;}while(0);t[f>>2]=r;t[f+4>>2]=a;t[f+16>>2]=0;t[f+20>>2]=s;i[f+24>>0]=1==(s|0)&1;t[f+28>>2]=0;return}function A(){var e=0,r=0,a=0;a=t[19]|0;r=t[18]|0;e:while(1){e=r+2|0;if(r>>>0>=a>>>0){r=6;break}switch(s[e>>1]|0){case 13:case 10:{r=6;break e}case 93:{r=7;break e}case 92:{e=r+4|0;break}default:{}}r=e;}if((r|0)==6){t[18]=e;Y();e=0;}else if((r|0)==7){t[18]=e;e=93;}return e|0}function C(e,r,a,i,t,f,c,n){e=e|0;r=r|0;a=a|0;i=i|0;t=t|0;f=f|0;c=c|0;n=n|0;if((((((s[e+12>>1]|0)==n<<16>>16?(s[e+10>>1]|0)==c<<16>>16:0)?(s[e+8>>1]|0)==f<<16>>16:0)?(s[e+6>>1]|0)==t<<16>>16:0)?(s[e+4>>1]|0)==i<<16>>16:0)?(s[e+2>>1]|0)==a<<16>>16:0)r=(s[e>>1]|0)==r<<16>>16;else r=0;return r|0}function y(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=E(e+-2|0,99,97,116,99)|0;break}case 121:{e=O(e+-2|0,102,105,110,97,108,108)|0;break}case 101:{e=P(e+-2|0,101,108,115)|0;break}default:e=0;}return e|0}function g(e,r){e=e|0;r=r|0;var a=0,i=0;a=t[18]|0;i=s[a>>1]|0;if(i<<16>>16==97){t[18]=a+4;a=w(1)|0;e=t[18]|0;if(_(a)|0){d(a);r=(t[18]|0)+2|0;t[18]=r;}else {H(a)|0;r=t[18]|0;}i=w(1)|0;a=t[18]|0;}if((a|0)!=(e|0))J(e,r);return i|0}function I(){var e=0,r=0,a=0;e:while(1){e=t[18]|0;r=e+2|0;t[18]=r;if(e>>>0>=(t[19]|0)>>>0){a=7;break}switch(s[r>>1]|0){case 13:case 10:{a=7;break e}case 47:break e;case 91:{A()|0;break}case 92:{t[18]=e+4;break}default:{}}}if((a|0)==7)Y();return}function p(e){e=e|0;var r=0,a=0,i=0,f=0,c=0;f=(t[18]|0)+2|0;t[18]=f;a=t[19]|0;while(1){r=f+2|0;if(f>>>0>=a>>>0)break;i=s[r>>1]|0;if(!e?ae(i)|0:0)break;if(i<<16>>16==42?(s[f+4>>1]|0)==47:0){c=8;break}f=r;}if((c|0)==8){t[18]=r;r=f+4|0;}t[18]=r;return}function U(e,r,a,i,t,f,c){e=e|0;r=r|0;a=a|0;i=i|0;t=t|0;f=f|0;c=c|0;if(((((s[e+10>>1]|0)==c<<16>>16?(s[e+8>>1]|0)==f<<16>>16:0)?(s[e+6>>1]|0)==t<<16>>16:0)?(s[e+4>>1]|0)==i<<16>>16:0)?(s[e+2>>1]|0)==a<<16>>16:0)r=(s[e>>1]|0)==r<<16>>16;else r=0;return r|0}function m(e,r,a,i,f,c,n,b){e=e|0;r=r|0;a=a|0;i=i|0;f=f|0;c=c|0;n=n|0;b=b|0;var u=0,k=0;k=e+-12|0;u=t[3]|0;if(k>>>0>=u>>>0?C(k,r,a,i,f,c,n,b)|0:0)if((k|0)==(u|0))u=1;else u=F(s[e+-14>>1]|0)|0;else u=0;return u|0}function S(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 x(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 O(e,r,a,i,f,c,n){e=e|0;r=r|0;a=a|0;i=i|0;f=f|0;c=c|0;n=n|0;var b=0,u=0;u=e+-10|0;b=t[3]|0;if(u>>>0>=b>>>0?U(u,r,a,i,f,c,n)|0:0)if((u|0)==(b|0))b=1;else b=F(s[e+-12>>1]|0)|0;else b=0;return b|0}function $(e,r,a,i,f,c){e=e|0;r=r|0;a=a|0;i=i|0;f=f|0;c=c|0;var n=0,b=0;b=e+-8|0;n=t[3]|0;if(b>>>0>=n>>>0?B(b,r,a,i,f,c)|0:0)if((b|0)==(n|0))n=1;else n=F(s[e+-10>>1]|0)|0;else n=0;return n|0}function j(e){e=e|0;var r=0,a=0,i=0,f=0;a=n;n=n+16|0;i=a;t[i>>2]=0;t[12]=e;r=t[3]|0;f=r+(e<<1)|0;e=f+2|0;s[f>>1]=0;t[i>>2]=e;t[13]=e;t[4]=0;t[8]=0;t[6]=0;t[5]=0;t[10]=0;t[7]=0;n=a;return r|0}function B(e,r,a,i,t,f){e=e|0;r=r|0;a=a|0;i=i|0;t=t|0;f=f|0;if((((s[e+8>>1]|0)==f<<16>>16?(s[e+6>>1]|0)==t<<16>>16:0)?(s[e+4>>1]|0)==i<<16>>16:0)?(s[e+2>>1]|0)==a<<16>>16:0)r=(s[e>>1]|0)==r<<16>>16;else r=0;return r|0}function E(e,r,a,i,f){e=e|0;r=r|0;a=a|0;i=i|0;f=f|0;var c=0,n=0;n=e+-6|0;c=t[3]|0;if(n>>>0>=c>>>0?z(n,r,a,i,f)|0:0)if((n|0)==(c|0))c=1;else c=F(s[e+-8>>1]|0)|0;else c=0;return c|0}function P(e,r,a,i){e=e|0;r=r|0;a=a|0;i=i|0;var f=0,c=0;c=e+-4|0;f=t[3]|0;if(c>>>0>=f>>>0?K(c,r,a,i)|0:0)if((c|0)==(f|0))f=1;else f=F(s[e+-6>>1]|0)|0;else f=0;return f|0}function q(e,r,a){e=e|0;r=r|0;a=a|0;var i=0,f=0;f=e+-2|0;i=t[3]|0;if(f>>>0>=i>>>0?N(f,r,a)|0:0)if((f|0)==(i|0))i=1;else i=F(s[e+-4>>1]|0)|0;else i=0;return i|0}function z(e,r,a,i,t){e=e|0;r=r|0;a=a|0;i=i|0;t=t|0;if(((s[e+6>>1]|0)==t<<16>>16?(s[e+4>>1]|0)==i<<16>>16:0)?(s[e+2>>1]|0)==a<<16>>16:0)r=(s[e>>1]|0)==r<<16>>16;else r=0;return r|0}function D(e,r){e=e|0;r=r|0;var a=0;a=t[3]|0;if(a>>>0<=e>>>0?(s[e>>1]|0)==r<<16>>16:0)if((a|0)==(e|0))a=1;else a=F(s[e+-2>>1]|0)|0;else a=0;return a|0}function F(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&(S(e)|0);}}while(0);return e|0}function G(){var e=0,r=0,a=0;e=t[19]|0;a=t[18]|0;e:while(1){r=a+2|0;if(a>>>0>=e>>>0)break;switch(s[r>>1]|0){case 13:case 10:break e;default:a=r;}}t[18]=r;return}function H(e){e=e|0;while(1){if(Z(e)|0)break;if(S(e)|0)break;e=(t[18]|0)+2|0;t[18]=e;e=s[e>>1]|0;if(!(e<<16>>16)){e=0;break}}return e|0}function J(e,r){e=e|0;r=r|0;var a=0,i=0;a=t[13]|0;t[13]=a+12;i=t[10]|0;t[((i|0)==0?20:i+8|0)>>2]=a;t[10]=a;t[a>>2]=e;t[a+4>>2]=r;t[a+8>>2]=0;return}function K(e,r,a,i){e=e|0;r=r|0;a=a|0;i=i|0;if((s[e+4>>1]|0)==i<<16>>16?(s[e+2>>1]|0)==a<<16>>16:0)r=(s[e>>1]|0)==r<<16>>16;else r=0;return r|0}function L(e){e=e|0;if(!($(e,119,104,105,108,101)|0)?!(P(e,102,111,114)|0):0)e=q(e,105,102)|0;else e=1;return e|0}function M(){var e=0;e=t[(t[6]|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 N(e,r,a){e=e|0;r=r|0;a=a|0;if((s[e+2>>1]|0)==a<<16>>16)r=(s[e>>1]|0)==r<<16>>16;else r=0;return r|0}function Q(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 R(e){e=e|0;if((t[3]|0)==(e|0))e=1;else e=F(s[e+-2>>1]|0)|0;return e|0}function T(){var e=0;e=t[(t[6]|0)+16>>2]|0;if(!e)e=-1;else e=e-(t[3]|0)>>1;return e|0}function V(){var e=0;e=t[6]|0;e=t[((e|0)==0?16:e+28|0)>>2]|0;t[6]=e;return (e|0)!=0|0}function W(){var e=0;e=t[7]|0;e=t[((e|0)==0?20:e+8|0)>>2]|0;t[7]=e;return (e|0)!=0|0}function X(e){e=e|0;var r=0;r=n;n=n+e|0;n=n+15&-16;return r|0}function Y(){i[588]=1;t[14]=(t[18]|0)-(t[3]|0)>>1;t[18]=(t[19]|0)+2;return}function Z(e){e=e|0;return (e|128)<<16>>16==160|(e+-9&65535)<5|0}function _(e){e=e|0;return e<<16>>16==39|e<<16>>16==34|0}function ee(){return (t[(t[6]|0)+12>>2]|0)-(t[3]|0)>>1|0}function re(){return (t[(t[6]|0)+8>>2]|0)-(t[3]|0)>>1|0}function ae(e){e=e|0;return e<<16>>16==13|e<<16>>16==10|0}function ie(){return (t[(t[6]|0)+4>>2]|0)-(t[3]|0)>>1|0}function se(){return (t[(t[7]|0)+4>>2]|0)-(t[3]|0)>>1|0}function te(){return (t[t[6]>>2]|0)-(t[3]|0)>>1|0}function fe(){return (t[t[7]>>2]|0)-(t[3]|0)>>1|0}function ce(){return f[(t[6]|0)+24>>0]|0|0}function ne(e){e=e|0;t[3]=e;return}function be(){return (i[589]|0)!=0|0}function ue(){return t[14]|0}return {ai:T,e:ue,ee:se,es:fe,f:be,id:M,ie:ie,ip:ce,is:te,p:b,re:W,ri:V,sa:j,se:ee,ses:ne,ss:re,sta:X}}({Int8Array:Int8Array,Int16Array:Int16Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array},{},r),a=e.sta(2*i);}const o=t.length+1;e.ses(a),e.sa(o-1),(s?b:n)(t,new Uint16Array(r,a,o)),e.p()||(c$1=e.e(),h());const w=[],d=[];for(;e.ri();){const r=e.is(),a=e.ie(),i=e.ai(),s=e.id(),f=e.ss(),c=e.se();let n;e.ip()&&(n=u(-1===s?r:r+1,t.charCodeAt(-1===s?r-1:r))),w.push({n:n,s:r,e:a,ss:f,se:c,d:s,a:i});}for(;e.re();){const r=e.es(),a=t.charCodeAt(r);d.push(34===a||39===a?u(r+1,a):t.slice(e.es(),e.ee()));}return [w,d,!!e.f()]}function n(e,r){const a=e.length;let i=0;for(;i<a;){const a=e.charCodeAt(i);r[i++]=(255&a)<<8|a>>>8;}}function b(e,r){const a=e.length;let i=0;for(;i<a;)r[i]=e.charCodeAt(i++);}function u(e,r){c$1=e;let a="",i=c$1;for(;;){c$1>=t.length&&h();const e=t.charCodeAt(c$1);if(e===r)break;92===e?(a+=t.slice(i,c$1),a+=k(),i=c$1):(8232===e||8233===e||o(e)&&h(),++c$1);}return a+=t.slice(i,c$1++),a}function k(){let e=t.charCodeAt(++c$1);switch(++c$1,e){case 110:return "\n";case 114:return "\r";case 120:return String.fromCharCode(l(2));case 117:return function(){let e;123===t.charCodeAt(c$1)?(++c$1,e=l(t.indexOf("}",c$1)-c$1),++c$1,e>1114111&&h()):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===t.charCodeAt(c$1)&&++c$1;case 10:return "";case 56:case 57:h();default:if(e>=48&&e<=55){let r=t.substr(c$1-1,3).match(/^[0-7]+/)[0],a=parseInt(r,8);return a>255&&(r=r.slice(0,-1),a=parseInt(r,8)),c$1+=r.length-1,e=t.charCodeAt(c$1),"0"===r&&56!==e&&57!==e||h(),String.fromCharCode(a)}return o(e)?"":String.fromCharCode(e)}}function l(e){const r=c$1;let a=0,i=0;for(let r=0;r<e;++r,++c$1){let e,s=t.charCodeAt(c$1);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,a=16*a+e;}else 95!==i&&0!==r||h(),i=s;}return 95!==i&&c$1-r===e||h(),a}function o(e){return 13===e||10===e}function h(){throw Object.assign(new Error(`Parse error ${f}:${t.slice(0,c$1).split("\n").length}:${c$1-t.lastIndexOf("\n",c$1-1)}`),{idx:c$1})}
305
308
 
306
309
  async function defaultResolve (id, parentUrl) {
307
310
  return resolveImportMap(importMap, resolveIfNotPlainOrUrl(id, parentUrl) || id, parentUrl);
@@ -401,7 +404,7 @@
401
404
  if (revokeBlobURLs) revokeObjectURLs(Object.keys(seen));
402
405
  return module;
403
406
  }
404
- const module = await dynamicImport(load.b, { errUrl: load.u });
407
+ const module = await dynamicImport(!shimMode && !load.n && nativelyLoaded ? load.u : load.b, { errUrl: load.u });
405
408
  // if the top-level load is a shell, run its update function
406
409
  if (load.s)
407
410
  (await dynamicImport(load.s)).u$_(module);
@@ -442,6 +445,10 @@
442
445
 
443
446
  self.importShim = importShim;
444
447
 
448
+ if (shimMode) {
449
+ importShim.getImportMap = () => JSON.parse(JSON.stringify(importMap));
450
+ }
451
+
445
452
  const meta = {};
446
453
 
447
454
  async function importMetaResolve (id, parentUrl = this.url) {
@@ -463,14 +470,6 @@
463
470
  for (const dep of load.d)
464
471
  resolveDeps(dep, seen);
465
472
 
466
- // use direct native execution when possible
467
- // load.n is therefore conservative
468
- if (!shimMode && !load.n) {
469
- load.b = lastLoad = load.u;
470
- load.S = undefined;
471
- return;
472
- }
473
-
474
473
  const [imports] = load.a;
475
474
 
476
475
  // "execution"
@@ -531,9 +530,9 @@
531
530
  resolvedSource += source.slice(lastIndex);
532
531
  }
533
532
 
534
- resolvedSource = resolvedSource.replace(/\/\/# sourceMappingURL=(.*)\s*$/, (match, url) => match.replace(url, () => new URL(url, load.r)));
533
+ resolvedSource = resolvedSource.replace(/\n\/\/# sourceMappingURL=([^\n]+)\s*$/, (match, url) => match.replace(url, () => new URL(url, load.r)));
535
534
  let hasSourceURL = false;
536
- resolvedSource = resolvedSource.replace(/\/\/# sourceURL=(.*)\s*$/, (match, url) => (hasSourceURL = true, match.replace(url, () => new URL(url, load.r))));
535
+ resolvedSource = resolvedSource.replace(/\n\/\/# sourceURL=([^\n]+)\s*$/, (match, url) => (hasSourceURL = true, match.replace(url, () => new URL(url, load.r))));
537
536
  if (!hasSourceURL)
538
537
  resolvedSource += '\n//# sourceURL=' + load.r;
539
538
 
@@ -582,7 +581,7 @@
582
581
  JSON.stringify((await res.text()).replace(cssUrlRegEx, (_match, quotes, relUrl1, relUrl2) => `url(${quotes}${resolveUrl(relUrl1 || relUrl2, url)}${quotes})`))
583
582
  });export default s;`, t: 'css' };
584
583
  else if (wasmContentType.test(contentType))
585
- throw new Error('WASM modules not yet supported');
584
+ throw new Error('WASM modules not supported');
586
585
  else
587
586
  throw new Error(`Unknown Content-Type "${contentType}"`);
588
587
  }
@@ -624,7 +623,7 @@
624
623
  ({ r: load.r, s: source, t } = await (fetchCache[url] || doFetch(url, fetchOpts)));
625
624
  if (t && !shimMode) {
626
625
  if (t === 'css' && !cssModulesEnabled || t === 'json' && !jsonModulesEnabled)
627
- throw new Error(`${t}-modules must be enabled to polyfill via: window.esmsInitOptions = { polyfillEnable: ['${t}-modules'] }`);
626
+ throw new Error(`${t}-modules require <script type="esms-options">{ "polyfillEnable": ["${t}-modules"] }<${''}/script>`);
628
627
  if (t === 'css' && !supportsCssAssertions || t === 'json' && !supportsJsonAssertions)
629
628
  load.n = true;
630
629
  }
@@ -736,9 +735,11 @@
736
735
  importMapSrcOrLazy = true;
737
736
  }
738
737
  if (acceptingImportMaps) {
739
- importMapPromise = importMapPromise.then(async () => {
740
- importMap = resolveAndComposeImportMap(script.src ? await (await fetchHook(script.src)).json() : JSON.parse(script.innerHTML), script.src || baseUrl, importMap);
741
- });
738
+ importMapPromise = importMapPromise
739
+ .then(async () => {
740
+ importMap = resolveAndComposeImportMap(script.src ? await (await fetchHook(script.src)).json() : JSON.parse(script.innerHTML), script.src || baseUrl, importMap);
741
+ })
742
+ .catch(error => setTimeout(() => { throw error }));
742
743
  if (!shimMode)
743
744
  acceptingImportMaps = false;
744
745
  }
@@ -759,11 +760,12 @@
759
760
  const isDomContentLoadedScript = domContentLoadedCnt > 0;
760
761
  if (isReadyScript) readyStateCompleteCnt++;
761
762
  if (isDomContentLoadedScript) domContentLoadedCnt++;
762
- const loadPromise = topLevelLoad(script.src || `${baseUrl}?${id++}`, getFetchOpts(script), !script.src && script.innerHTML, !shimMode, isReadyScript && lastStaticLoadPromise).catch(e => {
763
+ const blocks = script.getAttribute('async') === null && isReadyScript;
764
+ const loadPromise = topLevelLoad(script.src || `${baseUrl}?${id++}`, getFetchOpts(script), !script.src && script.innerHTML, !shimMode, blocks && lastStaticLoadPromise).catch(e => {
763
765
  setTimeout(() => { throw e });
764
766
  onerror(e);
765
767
  });
766
- if (isReadyScript)
768
+ if (blocks)
767
769
  lastStaticLoadPromise = loadPromise.then(readyStateCompleteCheck);
768
770
  if (isDomContentLoadedScript)
769
771
  loadPromise.then(domContentLoadedCheck);
@@ -783,4 +785,4 @@
783
785
  throw Error("Unable to resolve specifier '" + id + (parentUrl ? "' from " + parentUrl : "'"));
784
786
  }
785
787
 
786
- }());
788
+ })();