zip-peek 0.2.1 → 0.2.3-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/zip-utils.js CHANGED
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.normalizeZipUrlForSw = void 0;
4
3
  exports.isZipPackage = isZipPackage;
5
- exports.stripTParam = stripTParam;
4
+ exports.normalizeZipUrl = normalizeZipUrl;
6
5
  exports.normalizeZipEntryPath = normalizeZipEntryPath;
7
6
  exports.parseZipAssetRequest = parseZipAssetRequest;
8
7
  exports.canonicalZipAssetRequestUrl = canonicalZipAssetRequestUrl;
@@ -17,20 +16,25 @@ function isZipPackage(url) {
17
16
  }
18
17
  }
19
18
  /**
20
- * Strip only the `t` cache-buster query param; keep everything else verbatim.
19
+ * Normalize a ZIP package URL for cache keys, allow-lists, and manifests.
21
20
  * Avoids `URL` / `URLSearchParams` so SigV4 values (e.g. `%2F` in credentials)
22
21
  * are not re-encoded.
23
22
  */
24
- function stripTParam(urlString) {
23
+ function normalizeZipUrl(urlString, options = {}) {
24
+ const { stripCacheBuster = true, stripHash = true } = options;
25
+ const withoutHash = (url) => (stripHash ? url.split("#")[0] : url);
26
+ if (!stripCacheBuster) {
27
+ return withoutHash(urlString);
28
+ }
25
29
  const qIdx = urlString.indexOf("?");
26
30
  if (qIdx === -1)
27
- return urlString.split("#")[0];
31
+ return withoutHash(urlString);
28
32
  const hashIdx = urlString.indexOf("#", qIdx);
29
33
  const prefix = urlString.substring(0, qIdx);
30
34
  const querySection = hashIdx === -1
31
35
  ? urlString.substring(qIdx + 1)
32
36
  : urlString.substring(qIdx + 1, hashIdx);
33
- const hashSection = hashIdx === -1 ? "" : urlString.substring(hashIdx);
37
+ const hashSection = stripHash || hashIdx === -1 ? "" : urlString.substring(hashIdx);
34
38
  const filtered = querySection.split("&").filter((p) => {
35
39
  const eqIdx = p.indexOf("=");
36
40
  const k = eqIdx === -1 ? p : p.substring(0, eqIdx);
@@ -40,8 +44,6 @@ function stripTParam(urlString) {
40
44
  return prefix + hashSection;
41
45
  return prefix + "?" + filtered.join("&") + hashSection;
42
46
  }
43
- /** Same key the service worker uses for manifests / purge (presigned query kept). */
44
- exports.normalizeZipUrlForSw = stripTParam;
45
47
  /** Align zip entry names with URL paths under `*.zip/…`. */
46
48
  function normalizeZipEntryPath(name) {
47
49
  let s = name.replace(/\\/g, "/"); // Replace backslashes with forward slashes.
@@ -96,7 +98,7 @@ function parseZipAssetRequest(urlString) {
96
98
  internalPath: safeDecodeSegment(rawInternal),
97
99
  };
98
100
  }
99
- /** Cache key for a zip asset (decoded manifest key + zip URL without `t`). */
101
+ /** Cache key for a zip asset (decoded manifest key + normalized zip URL). */
100
102
  function canonicalZipAssetRequestUrl(zipUrl, manifestKey) {
101
103
  return zipUrl + "/" + encodeURIComponent(manifestKey);
102
104
  }
@@ -1,2 +1,2 @@
1
- (()=>{"use strict";var t={978(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.persistAllowedZipUrlsConfig=o,e.ensureAllowedZipUrlsLoaded=async function(){if(s.allowedZipUrlsLoaded)return s.allowedZipUrlsLoaded;const t=(async()=>{try{const t=await caches.open(r.CONFIG_CACHE_NAME),e=await t.match(s.CONFIG_CACHE_KEY);if(!e)return;const n=await e.json();Array.isArray(n.allowedZipUrls)?(0,s.setAllowedZipUrls)(new Set(n.allowedZipUrls.filter(t=>"string"==typeof t).map(i.stripTParam))):(0,s.setAllowedZipUrls)(null)}catch(t){(0,a.warn)("failed to load runtime config",t)}})();return(0,s.setAllowedZipUrlsLoaded)(t),t},e.applyRuntimeConfig=async function(t){if(!t)return;let e={...s.runtimeConfig},n=!1;if("string"==typeof t.zipAssetCacheName&&t.zipAssetCacheName.trim()&&(e.zipAssetCacheName=t.zipAssetCacheName,n=!0),"number"==typeof t.assetCacheTtlMs&&Number.isFinite(t.assetCacheTtlMs)&&(e.assetCacheTtlMs=t.assetCacheTtlMs,n=!0),"string"==typeof t.logPrefix&&t.logPrefix.trim()&&(e.logPrefix=t.logPrefix,n=!0),n&&(0,s.setRuntimeConfig)(e),"allowedZipUrls"in t){const e=Array.isArray(t.allowedZipUrls)?t.allowedZipUrls.map(i.stripTParam):null;(0,s.setAllowedZipUrls)(e?new Set(e):null),(0,s.setAllowedZipUrlsLoaded)(Promise.resolve()),await o(e)}},e.isZipUrlAllowed=function(t){return null===s.allowedZipUrls||s.allowedZipUrls.has((0,i.stripTParam)(t))};const i=n(183),r=n(778),s=n(6),a=n(271);async function o(t){try{const e=await caches.open(r.CONFIG_CACHE_NAME);await e.put(new Request(s.CONFIG_CACHE_KEY),new Response(JSON.stringify({allowedZipUrls:t}),{headers:{"Content-Type":"application/json"}}))}catch(t){(0,a.warn)("failed to persist runtime config",t)}}},752(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.canonicalAssetRequest=function(t,e){return new Request((0,i.canonicalZipAssetRequestUrl)(t,e),{method:"GET"})},e.assetCacheEntryExpired=l,e.clearAllZipAssets=async function(){const t=await caches.open(o.runtimeConfig.zipAssetCacheName),e=await t.keys();await Promise.all(e.map(e=>t.delete(e))),await caches.delete(r.CONFIG_CACHE_NAME),o.zipManifests.clear(),o.pendingManifestLoads.clear(),(0,o.setAllowedZipUrlsLoaded)(Promise.resolve())},e.clearZipAssetsExceptAllowed=async function(t){try{const e=new Set(t.map(i.stripTParam)),n=await caches.open(o.runtimeConfig.zipAssetCacheName),s=await n.keys();for(const t of s){const s=t.url;if(s.includes(r.MANIFEST_CACHE_KEY)){const r=(0,a.zipUrlFromManifestCacheKey)(s);r&&!e.has((0,i.stripTParam)(r))&&await n.delete(t);continue}const o=(0,i.parseZipAssetRequest)(s);o&&!e.has((0,i.stripTParam)(o.zipUrl))&&await n.delete(t)}for(const t of o.zipManifests.keys())e.has((0,i.stripTParam)(t))||o.zipManifests.delete(t)}catch(t){(0,s.warn)("clearZipAssetsExceptAllowed failed",t)}},e.putCachedFullAssetIfAbsent=async function(t,e){try{const n=await caches.open(o.runtimeConfig.zipAssetCacheName),i=await n.match(t);if(i&&!l(i))return;const s=e.type||"application/octet-stream";await n.put(t,new Response(e,{status:200,headers:{"Content-Type":s,"Content-Length":String(e.size),"Access-Control-Allow-Origin":"*",[r.ASSET_CACHED_AT_HEADER]:String(Date.now())}}))}catch(t){(0,s.warn)("asset cache put failed",t)}},e.readCachedZipAssetIfFresh=async function(t){let e=null,n="network";try{const i=await caches.open(o.runtimeConfig.zipAssetCacheName),r=await i.match(t);if(r)if(l(r))try{await i.delete(t)}catch(t){(0,s.warn)("asset cache delete expired failed",t)}else e=await r.blob(),n="cache-api"}catch(t){(0,s.warn)("asset cache read failed",t)}return{blob:e,assetSource:n}};const i=n(183),r=n(778),s=n(271),a=n(234),o=n(6);function l(t){const e=t.headers.get(r.ASSET_CACHED_AT_HEADER);if(!e)return!0;const n=parseInt(e,10);return!Number.isFinite(n)||Date.now()-n>o.runtimeConfig.assetCacheTtlMs}},778(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.MANIFEST_CACHE_KEY=e.LOCAL_FILE_HEADER_SIG=e.MIME_TYPES=e.ASSET_SOURCE_HEADER=e.ASSET_CACHED_AT_HEADER=e.ALLOWED_CACHE_NAMES=e.CONFIG_CACHE_NAME=e.DEFAULT_ASSET_CACHE_TTL_MS=e.DEFAULT_ZIP_ASSET_CACHE_NAME=void 0,e.DEFAULT_ZIP_ASSET_CACHE_NAME="zip-cache-v1",e.DEFAULT_ASSET_CACHE_TTL_MS=72e5,e.CONFIG_CACHE_NAME="zip-peek-config-v1",e.ALLOWED_CACHE_NAMES=[e.DEFAULT_ZIP_ASSET_CACHE_NAME,e.CONFIG_CACHE_NAME],e.ASSET_CACHED_AT_HEADER="X-ZipSW-Cached-At",e.ASSET_SOURCE_HEADER="X-ZipSW-Asset-Source",e.MIME_TYPES={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",json:"application/json",js:"application/javascript",css:"text/css; charset=utf-8",html:"text/html; charset=utf-8",txt:"text/plain; charset=utf-8",mp4:"video/mp4",webm:"video/webm",mp3:"audio/mpeg",wav:"audio/wav",oga:"audio/ogg",ogg:"audio/ogg",xml:"application/xml",wasm:"application/wasm"},e.LOCAL_FILE_HEADER_SIG=67324752,e.MANIFEST_CACHE_KEY="__zipsw_manifest__=1"},886(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.installFetchHandler=function(){self.addEventListener("fetch",t=>{if("GET"!==t.request.method)return;const e=(0,i.parseZipAssetRequest)(t.request.url);if(!e)return;const n=(0,i.stripTParam)(e.zipUrl),f=e.internalPath,h=(0,i.normalizeZipEntryPath)(f);t.respondWith((async()=>{if(await(0,r.ensureAllowedZipUrlsLoaded)(),!(0,r.isZipUrlAllowed)(n))return(0,o.warn)("zip URL not allowed",{requestedZipUrl:n}),(0,c.corsErrorResponse)("Zip URL not allowed",403);let e=u.zipManifests.get(n);if(e||(e=await(0,l.ensureManifestAvailable)(n)??void 0),!e){const t=Array.from(u.zipManifests.keys());return(0,o.warn)("manifest missing for zipUrl",{requestedZipUrl:n,knownZipUrls:t}),(0,c.corsErrorResponse)("Zip manifest not loaded",404)}const i=(0,l.resolveManifestEntry)(e,h);if(!i){const t=Array.from(e.keys()).slice(0,50);return(0,o.warn)("file not in manifest or ambiguous suffix match",{zipUrl:n,internalPathRaw:f,internalPathNormalized:h,manifestSize:e.size,sampleKeys:t}),(0,c.corsErrorResponse)("File not found in zip manifest",404)}const{key:p,info:d}=i;p!==h&&(0,o.log)("resolved via suffix match",{requested:h,manifestKey:p});const g=(0,s.canonicalAssetRequest)(n,p);let{blob:v,assetSource:m}=await(0,s.readCachedZipAssetIfFresh)(g);if(!v){const t=await(0,c.fetchUncompressedZipEntryFromNetwork)(n,p,d,g);if(!t.ok)return t.response;v=t.blob,m="network"}if(t.request.headers.has("range")){const e=t.request.headers.get("range").replace(/^bytes=/,"");if(e.includes(","))return new Response(null,{status:416,headers:{"Content-Range":`bytes */${v.size}`,"Access-Control-Allow-Origin":"*"}});const[n,i]=e.split("-"),r=""!==n?parseInt(n,10):NaN,s=""!==i?parseInt(i,10):v.size-1;if(isNaN(r)||isNaN(s)||r<0||s<r||r>=v.size)return new Response(null,{status:416,headers:{"Content-Range":`bytes */${v.size}`,"Access-Control-Allow-Origin":"*"}});const o=Math.min(s,v.size-1),l=v.slice(r,o+1);return new Response(l,{status:206,headers:{"Content-Type":v.type,"Content-Range":`bytes ${r}-${o}/${v.size}`,"Content-Length":l.size.toString(),"Accept-Ranges":"bytes","Access-Control-Allow-Origin":"*","Access-Control-Expose-Headers":a.ASSET_SOURCE_HEADER,[a.ASSET_SOURCE_HEADER]:m}})}return new Response(v,{status:200,headers:{"Content-Type":v.type,"Content-Length":v.size.toString(),"Access-Control-Allow-Origin":"*","Access-Control-Expose-Headers":a.ASSET_SOURCE_HEADER,[a.ASSET_SOURCE_HEADER]:m}})})())})};const i=n(183),r=n(978),s=n(752),a=n(778),o=n(271),l=n(234),u=n(6),c=n(878)},271(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.log=function(...t){console.log(i.runtimeConfig.logPrefix,...t)},e.warn=function(...t){console.warn(i.runtimeConfig.logPrefix,...t)};const i=n(6)},234(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.manifestCacheKey=o,e.persistManifest=l,e.loadPersistedManifest=u,e.parseCentralDirectoryToManifest=c,e.fetchZipManifest=f,e.ensureManifestAvailable=function(t){const e=a.zipManifests.get(t);if(e)return Promise.resolve(e);let n=a.pendingManifestLoads.get(t);return n||(n=(async()=>{const e=await u(t);if(e)return a.zipManifests.set(t,e),(0,s.log)("rehydrated manifest from cache",{zipUrl:t,entryCount:e.size}),e;const n=await f(t);return n&&(a.zipManifests.set(t,n),await l(t,n),(0,s.log)("manifest fetched and cached",{zipUrl:t,entryCount:n.size})),n})().finally(()=>{a.pendingManifestLoads.delete(t)}),a.pendingManifestLoads.set(t,n),n)},e.resolveManifestEntry=function(t,e){if(t.has(e))return{key:e,info:t.get(e)};const n=[];for(const i of t.keys())i.endsWith("/"+e)&&n.push(i);if(1===n.length){const e=n[0];return{key:e,info:t.get(e)}}return n.length>1?((0,s.warn)("ambiguous suffix match",{requested:e,picked:n[0],candidates:n.slice(0,8)}),null):null},e.zipUrlFromManifestCacheKey=function(t){const e=r.MANIFEST_CACHE_KEY;if(!t.endsWith(e))return null;let n=t.slice(0,-e.length);return(n.endsWith("?")||n.endsWith("&"))&&(n=n.slice(0,-1)),n};const i=n(183),r=n(778),s=n(271),a=n(6);function o(t){return t+(t.includes("?")?"&":"?")+r.MANIFEST_CACHE_KEY}async function l(t,e){try{const n=await caches.open(a.runtimeConfig.zipAssetCacheName),i=Array.from(e.values());await n.put(new Request(o(t)),new Response(JSON.stringify(i),{headers:{"Content-Type":"application/json"}}))}catch(t){(0,s.warn)("failed to persist manifest",t)}}async function u(t){try{const e=await caches.open(a.runtimeConfig.zipAssetCacheName),n=await e.match(o(t));if(!n)return null;const r=await n.json();if(!Array.isArray(r)||0===r.length)return null;const s=new Map;for(const t of r){const e=(0,i.normalizeZipEntryPath)(t.filename);""!==e&&s.set(e,t)}return s.size>0?s:null}catch(t){return(0,s.warn)("failed to load persisted manifest",t),null}}function c(t,e,n,r){const a=new DataView(t);let o=e;const l=[];for(;o+46<=t.byteLength&&33639248===a.getUint32(o,!0);){const e=a.getUint16(o+10,!0),n=a.getUint32(o+20,!0),r=a.getUint16(o+28,!0),s=a.getUint16(o+30,!0),u=a.getUint16(o+32,!0),c=a.getUint32(o+42,!0),f=new TextDecoder;if(o+46+r>t.byteLength)break;const h=new Uint8Array(t,o+46,r),p=f.decode(h),d=(0,i.normalizeZipEntryPath)(p);""!==d&&l.push({filename:d,offset:c,compressedSize:n,compression:e}),o+=46+r+s+u}if(0===l.length)return(0,s.warn)("no files parsed from central directory",r),null;l.sort((t,e)=>t.offset-e.offset);const u=new Map;for(let t=0;t<l.length;t++){const e=l[t],r=(0,i.normalizeZipEntryPath)(e.filename);""!==r&&(u.has(r)&&(0,s.warn)("duplicate manifest key after normalize; overwriting",r),u.set(r,{filename:e.filename,offset:e.offset,compressedSize:e.compressedSize,compression:e.compression,nextOffset:t<l.length-1?l[t+1].offset:n}))}return u.size>0?u:null}async function f(t){const e=await fetch(t,{headers:{Range:"bytes=-65536"}});if(206!==e.status)return(0,s.warn)("range requests not supported",{zipUrl:t,status:e.status}),null;const n=await e.arrayBuffer(),i=new DataView(n);let r=-1;for(let t=n.byteLength-22;t>=0;t--)if(101010256===i.getUint32(t,!0)){r=t;break}if(-1===r)return(0,s.warn)("EOCD not found in last 64KB",t),null;const a=i.getUint32(r+16,!0),o=i.getUint32(r+12,!0);let l=n,u=-1;const f=e.headers.get("Content-Range");let h=0;if(f){const t=f.match(/\/(\d+)$/);t&&(h=parseInt(t[1],10))}if(h<=0)return null;const p=h-n.byteLength;if(a>=p)u=a-p;else{const e=await fetch(t,{headers:{Range:`bytes=${a}-${a+o-1}`}});if(206!==e.status)return(0,s.warn)("failed to fetch central directory",{zipUrl:t,status:e.status}),null;l=await e.arrayBuffer(),u=0}return c(l,u,a,t)}},49(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.replyToMessage=u,e.installMessageHandler=function(){self.addEventListener("message",t=>{if(!t.data)return;const{type:e,zipUrl:n,files:c,config:f,allowedZipUrls:h}=t.data;if("ZIP_SW_CONFIG"===e){const e=(0,r.applyRuntimeConfig)(f).then(()=>u(t,{ok:!0})).catch(e=>u(t,{ok:!1,error:e instanceof Error?e.message:String(e)}));return void t.waitUntil(e)}if("ZIP_MANIFEST"===e){if(n&&c){const e=(0,i.stripTParam)(n),r=new Map;let s=!1;for(const t of c){const e=(0,i.normalizeZipEntryPath)(t.filename);""!==e?(r.has(e)&&(0,a.warn)("duplicate manifest key after normalize; overwriting",e),r.set(e,t)):s=!0}const u=l.zipManifests.get(e);if(0===r.size)return void(0,a.warn)("rejecting empty manifest; keeping existing",{zipUrl:e,existingSize:u?u.size:0,hadEmptyKey:s});if(u&&u.size>r.size)return void(0,a.warn)("rejecting smaller manifest; keeping existing",{zipUrl:e,incomingSize:r.size,existingSize:u.size});l.zipManifests.set(e,r),t.waitUntil((0,o.persistManifest)(e,r));const f=Array.from(r.keys()).slice(0,40);(0,a.log)("ZIP_MANIFEST loaded",{zipUrl:e,entryCount:r.size,sampleKeys:f,replacedExistingSize:u?u.size:0})}}else if("CLEAR_ZIP_ASSETS_EXCEPT_ALLOWED"===e&&h){const e=(0,s.clearZipAssetsExceptAllowed)(h).then(()=>u(t,{ok:!0})).catch(e=>u(t,{ok:!1,error:e instanceof Error?e.message:String(e)}));t.waitUntil(e)}else if("CLEAR_ALL_ZIP_ASSETS"===e){const e=(0,s.clearAllZipAssets)().then(()=>u(t,{ok:!0})).catch(e=>u(t,{ok:!1,error:e instanceof Error?e.message:String(e)}));t.waitUntil(e)}else if("PRELOAD_ZIP_MANIFESTS"===e&&h){const e=Promise.all(h.map(t=>(0,o.ensureManifestAvailable)((0,i.stripTParam)(t)))).then(()=>u(t,{ok:!0})).catch(e=>u(t,{ok:!1,error:e instanceof Error?e.message:String(e)}));t.waitUntil(e)}})};const i=n(183),r=n(978),s=n(752),a=n(271),o=n(234),l=n(6);function u(t,e){t.ports[0]?.postMessage(e)}},6(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.CONFIG_CACHE_KEY=e.allowedZipUrlsLoaded=e.allowedZipUrls=e.runtimeConfig=e.pendingManifestLoads=e.zipManifests=void 0,e.setRuntimeConfig=function(t){e.runtimeConfig=t},e.setAllowedZipUrls=function(t){e.allowedZipUrls=t},e.setAllowedZipUrlsLoaded=function(t){e.allowedZipUrlsLoaded=t};const i=n(778);e.zipManifests=new Map,e.pendingManifestLoads=new Map,e.runtimeConfig={zipAssetCacheName:i.DEFAULT_ZIP_ASSET_CACHE_NAME,assetCacheTtlMs:i.DEFAULT_ASSET_CACHE_TTL_MS,logPrefix:"[zipSW]"},e.allowedZipUrls=null,e.allowedZipUrlsLoaded=null,e.CONFIG_CACHE_KEY=new URL("__zip_peek_runtime_config__",self.registration.scope).href},878(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.corsErrorResponse=o,e.getMimeType=l,e.fetchUncompressedZipEntryFromNetwork=async function(t,e,n,u){const c=n.offset,f=n.nextOffset-1;(0,s.log)("fetching zip chunk from",{zipUrl:t,rangeStart:c,rangeEnd:f});const h=await fetch(t,{headers:{Range:`bytes=${c}-${f}`}});if(206!==h.status)return{ok:!1,response:o("The server did not return a 206 Partial Content response",h.status)};const p=await h.arrayBuffer(),d=new DataView(p);if(d.getUint32(0,!0)!==r.LOCAL_FILE_HEADER_SIG)return{ok:!1,response:o("Invalid Local File Header",500)};const g=30+d.getUint16(26,!0)+d.getUint16(28,!0);if(g>p.byteLength||g+n.compressedSize>p.byteLength)return{ok:!1,response:o(`Invalid data start or compressed size for file ${e}: dataStart=${g}, compressedSize=${n.compressedSize}, bufferLength=${p.byteLength}`,500)};const v=new Uint8Array(p,g,n.compressedSize);let m;if(8===n.compression)try{m=(0,i.inflateSync)(v)}catch(t){return(0,s.warn)("inflateSync failed",t),{ok:!1,response:o("Failed to inflate the compressed data",500)}}else{if(0!==n.compression)return{ok:!1,response:o(`Unsupported compression method: ${n.compression}`,500)};m=v}const y=l(e),w=new Blob([m],{type:y});return await(0,a.putCachedFullAssetIfAbsent)(u,w),{ok:!0,blob:w}};const i=n(845),r=n(778),s=n(271),a=n(752);function o(t,e){return new Response(t,{status:e,headers:{"Access-Control-Allow-Origin":"*"}})}function l(t){const e=t.split(".").pop()?.toLowerCase();return e?r.MIME_TYPES[e]??"application/octet-stream":"application/octet-stream"}},183(t,e){function n(t){const e=t.indexOf("?");if(-1===e)return t.split("#")[0];const n=t.indexOf("#",e),i=t.substring(0,e),r=-1===n?t.substring(e+1):t.substring(e+1,n),s=-1===n?"":t.substring(n),a=r.split("&").filter(t=>{const e=t.indexOf("=");return"t"!==(-1===e?t:t.substring(0,e))});return 0===a.length?i+s:i+"?"+a.join("&")+s}function i(t){try{return decodeURIComponent(t)}catch{return t}}Object.defineProperty(e,"__esModule",{value:!0}),e.normalizeZipUrlForSw=void 0,e.isZipPackage=function(t){try{return new URL(t).pathname.endsWith(".zip")}catch{return t.split("?")[0].endsWith(".zip")}},e.stripTParam=n,e.normalizeZipEntryPath=function(t){let e=t.replace(/\\/g,"/");for(;e.startsWith("/");)e=e.slice(1);return e},e.parseZipAssetRequest=function(t){const e=/\.zip([/?])/.exec(t);if(!e)return null;const n=e.index+4,r=e[1],s=t.substring(0,n);if("/"===r){const e=t.substring(n+1),r=e.indexOf("?"),a=-1===r?e:e.substring(0,r);return""===a?null:{zipUrl:s,internalPath:i(a)}}const a=t.substring(n),o=a.indexOf("/");if(-1===o)return null;const l=a.substring(0,o),u=a.substring(o+1),c=u.indexOf("?"),f=-1===c?u:u.substring(0,c);return""===f?null:{zipUrl:s+l,internalPath:i(f)}},e.canonicalZipAssetRequestUrl=function(t,e){return t+"/"+encodeURIComponent(e)},e.normalizeZipUrlForSw=n},845(t,e){var n={},i=function(t,e,i,r,s){var a=new Worker(n[e]||(n[e]=URL.createObjectURL(new Blob([t+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return a.onmessage=function(t){var e=t.data,n=e.$e$;if(n){var i=new Error(n[0]);i.code=n[1],i.stack=n[2],s(i,null)}else s(null,e)},a.postMessage(i,r),a},r=Uint8Array,s=Uint16Array,a=Int32Array,o=new r([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),l=new r([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),u=new r([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),c=function(t,e){for(var n=new s(31),i=0;i<31;++i)n[i]=e+=1<<t[i-1];var r=new a(n[30]);for(i=1;i<30;++i)for(var o=n[i];o<n[i+1];++o)r[o]=o-n[i]<<5|i;return{b:n,r}},f=c(o,2),h=f.b,p=f.r;h[28]=258,p[258]=28;for(var d=c(l,0),g=d.b,v=d.r,m=new s(32768),y=0;y<32768;++y){var w=(43690&y)>>1|(21845&y)<<1;w=(61680&(w=(52428&w)>>2|(13107&w)<<2))>>4|(3855&w)<<4,m[y]=((65280&w)>>8|(255&w)<<8)>>1}var A=function(t,e,n){for(var i=t.length,r=0,a=new s(e);r<i;++r)t[r]&&++a[t[r]-1];var o,l=new s(e);for(r=1;r<e;++r)l[r]=l[r-1]+a[r-1]<<1;if(n){o=new s(1<<e);var u=15-e;for(r=0;r<i;++r)if(t[r])for(var c=r<<4|t[r],f=e-t[r],h=l[t[r]-1]++<<f,p=h|(1<<f)-1;h<=p;++h)o[m[h]>>u]=c}else for(o=new s(i),r=0;r<i;++r)t[r]&&(o[r]=m[l[t[r]-1]++]>>15-t[r]);return o},E=new r(288);for(y=0;y<144;++y)E[y]=8;for(y=144;y<256;++y)E[y]=9;for(y=256;y<280;++y)E[y]=7;for(y=280;y<288;++y)E[y]=8;var C=new r(32);for(y=0;y<32;++y)C[y]=5;var b=A(E,9,0),z=A(E,9,1),_=A(C,5,0),S=A(C,5,1),M=function(t){for(var e=t[0],n=1;n<t.length;++n)t[n]>e&&(e=t[n]);return e},U=function(t,e,n){var i=e/8|0;return(t[i]|t[i+1]<<8)>>(7&e)&n},T=function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(7&e)},Z=function(t){return(t+7)/8|0},k=function(t,e,n){return(null==e||e<0)&&(e=0),(null==n||n>t.length)&&(n=t.length),new r(t.subarray(e,n))};e.FlateErrorCode={UnexpectedEOF:0,InvalidBlockType:1,InvalidLengthLiteral:2,InvalidDistance:3,StreamFinished:4,NoStreamHandler:5,InvalidHeader:6,NoCallback:7,InvalidUTF8:8,ExtraFieldTooLong:9,InvalidDate:10,FilenameTooLong:11,StreamFinishing:12,InvalidZipData:13,UnknownCompressionMethod:14};var L=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],x=function(t,e,n){var i=new Error(e||L[t]);if(i.code=t,Error.captureStackTrace&&Error.captureStackTrace(i,x),!n)throw i;return i},I=function(t,e,n,i){var s=t.length,a=i?i.length:0;if(!s||e.f&&!e.l)return n||new r(0);var c=!n,f=c||2!=e.i,p=e.i;c&&(n=new r(3*s));var d=function(t){var e=n.length;if(t>e){var i=new r(Math.max(2*e,t));i.set(n),n=i}},v=e.f||0,m=e.p||0,y=e.b||0,w=e.l,E=e.d,C=e.m,b=e.n,_=8*s;do{if(!w){v=U(t,m,1);var L=U(t,m+1,3);if(m+=3,!L){var I=t[($=Z(m)+4)-4]|t[$-3]<<8,R=$+I;if(R>s){p&&x(0);break}f&&d(y+I),n.set(t.subarray($,R),y),e.b=y+=I,e.p=m=8*R,e.f=v;continue}if(1==L)w=z,E=S,C=9,b=5;else if(2==L){var P=U(t,m,31)+257,O=U(t,m+10,15)+4,F=P+U(t,m+5,31)+1;m+=14;for(var N=new r(F),D=new r(19),H=0;H<O;++H)D[u[H]]=U(t,m+3*H,7);m+=3*O;var j=M(D),q=(1<<j)-1,G=A(D,j,1);for(H=0;H<F;){var $,K=G[U(t,m,q)];if(m+=15&K,($=K>>4)<16)N[H++]=$;else{var W=0,Y=0;for(16==$?(Y=3+U(t,m,3),m+=2,W=N[H-1]):17==$?(Y=3+U(t,m,7),m+=3):18==$&&(Y=11+U(t,m,127),m+=7);Y--;)N[H++]=W}}var B=N.subarray(0,P),V=N.subarray(P);C=M(B),b=M(V),w=A(B,C,1),E=A(V,b,1)}else x(1);if(m>_){p&&x(0);break}}f&&d(y+131072);for(var X=(1<<C)-1,J=(1<<b)-1,Q=m;;Q=m){var tt=(W=w[T(t,m)&X])>>4;if((m+=15&W)>_){p&&x(0);break}if(W||x(2),tt<256)n[y++]=tt;else{if(256==tt){Q=m,w=null;break}var et=tt-254;if(tt>264){var nt=o[H=tt-257];et=U(t,m,(1<<nt)-1)+h[H],m+=nt}var it=E[T(t,m)&J],rt=it>>4;if(it||x(3),m+=15&it,V=g[rt],rt>3&&(nt=l[rt],V+=T(t,m)&(1<<nt)-1,m+=nt),m>_){p&&x(0);break}f&&d(y+131072);var st=y+et;if(y<V){var at=a-V,ot=Math.min(V,st);for(at+y<0&&x(3);y<ot;++y)n[y]=i[at+y]}for(;y<st;++y)n[y]=n[y-V]}}e.l=w,e.p=Q,e.b=y,e.f=v,w&&(v=1,e.m=C,e.d=E,e.n=b)}while(!v);return y!=n.length&&c?k(n,0,y):n.subarray(0,y)},R=function(t,e,n){n<<=7&e;var i=e/8|0;t[i]|=n,t[i+1]|=n>>8},P=function(t,e,n){n<<=7&e;var i=e/8|0;t[i]|=n,t[i+1]|=n>>8,t[i+2]|=n>>16},O=function(t,e){for(var n=[],i=0;i<t.length;++i)t[i]&&n.push({s:i,f:t[i]});var a=n.length,o=n.slice();if(!a)return{t:G,l:0};if(1==a){var l=new r(n[0].s+1);return l[n[0].s]=1,{t:l,l:1}}n.sort(function(t,e){return t.f-e.f}),n.push({s:-1,f:25001});var u=n[0],c=n[1],f=0,h=1,p=2;for(n[0]={s:-1,f:u.f+c.f,l:u,r:c};h!=a-1;)u=n[n[f].f<n[p].f?f++:p++],c=n[f!=h&&n[f].f<n[p].f?f++:p++],n[h++]={s:-1,f:u.f+c.f,l:u,r:c};var d=o[0].s;for(i=1;i<a;++i)o[i].s>d&&(d=o[i].s);var g=new s(d+1),v=F(n[h-1],g,0);if(v>e){i=0;var m=0,y=v-e,w=1<<y;for(o.sort(function(t,e){return g[e.s]-g[t.s]||t.f-e.f});i<a;++i){var A=o[i].s;if(!(g[A]>e))break;m+=w-(1<<v-g[A]),g[A]=e}for(m>>=y;m>0;){var E=o[i].s;g[E]<e?m-=1<<e-g[E]++-1:++i}for(;i>=0&&m;--i){var C=o[i].s;g[C]==e&&(--g[C],++m)}v=e}return{t:new r(g),l:v}},F=function(t,e,n){return-1==t.s?Math.max(F(t.l,e,n+1),F(t.r,e,n+1)):e[t.s]=n},N=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new s(++e),i=0,r=t[0],a=1,o=function(t){n[i++]=t},l=1;l<=e;++l)if(t[l]==r&&l!=e)++a;else{if(!r&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(r),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(r);a=1,r=t[l]}return{c:n.subarray(0,i),n:e}},D=function(t,e){for(var n=0,i=0;i<e.length;++i)n+=t[i]*e[i];return n},H=function(t,e,n){var i=n.length,r=Z(e+2);t[r]=255&i,t[r+1]=i>>8,t[r+2]=255^t[r],t[r+3]=255^t[r+1];for(var s=0;s<i;++s)t[r+s+4]=n[s];return 8*(r+4+i)},j=function(t,e,n,i,r,a,c,f,h,p,d){R(e,d++,n),++r[256];for(var g=O(r,15),v=g.t,m=g.l,y=O(a,15),w=y.t,z=y.l,S=N(v),M=S.c,U=S.n,T=N(w),Z=T.c,k=T.n,L=new s(19),x=0;x<M.length;++x)++L[31&M[x]];for(x=0;x<Z.length;++x)++L[31&Z[x]];for(var I=O(L,7),F=I.t,j=I.l,q=19;q>4&&!F[u[q-1]];--q);var G,$,K,W,Y=p+5<<3,B=D(r,E)+D(a,C)+c,V=D(r,v)+D(a,w)+c+14+3*q+D(L,F)+2*L[16]+3*L[17]+7*L[18];if(h>=0&&Y<=B&&Y<=V)return H(e,d,t.subarray(h,h+p));if(R(e,d,1+(V<B)),d+=2,V<B){G=A(v,m,0),$=v,K=A(w,z,0),W=w;var X=A(F,j,0);for(R(e,d,U-257),R(e,d+5,k-1),R(e,d+10,q-4),d+=14,x=0;x<q;++x)R(e,d+3*x,F[u[x]]);d+=3*q;for(var J=[M,Z],Q=0;Q<2;++Q){var tt=J[Q];for(x=0;x<tt.length;++x){var et=31&tt[x];R(e,d,X[et]),d+=F[et],et>15&&(R(e,d,tt[x]>>5&127),d+=tt[x]>>12)}}}else G=b,$=E,K=_,W=C;for(x=0;x<f;++x){var nt=i[x];if(nt>255){P(e,d,G[257+(et=nt>>18&31)]),d+=$[et+257],et>7&&(R(e,d,nt>>23&31),d+=o[et]);var it=31&nt;P(e,d,K[it]),d+=W[it],it>3&&(P(e,d,nt>>5&8191),d+=l[it])}else P(e,d,G[nt]),d+=$[nt]}return P(e,d,G[256]),d+$[256]},q=new a([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),G=new r(0),$=function(t,e,n,i,u,c){var f=c.z||t.length,h=new r(i+f+5*(1+Math.ceil(f/7e3))+u),d=h.subarray(i,h.length-u),g=c.l,m=7&(c.r||0);if(e){m&&(d[0]=c.r>>3);for(var y=q[e-1],w=y>>13,A=8191&y,E=(1<<n)-1,C=c.p||new s(32768),b=c.h||new s(E+1),z=Math.ceil(n/3),_=2*z,S=function(e){return(t[e]^t[e+1]<<z^t[e+2]<<_)&E},M=new a(25e3),U=new s(288),T=new s(32),L=0,x=0,I=c.i||0,R=0,P=c.w||0,O=0;I+2<f;++I){var F=S(I),N=32767&I,D=b[F];if(C[N]=D,b[F]=N,P<=I){var G=f-I;if((L>7e3||R>24576)&&(G>423||!g)){m=j(t,d,0,M,U,T,x,R,O,I-O,m),R=L=x=0,O=I;for(var $=0;$<286;++$)U[$]=0;for($=0;$<30;++$)T[$]=0}var K=2,W=0,Y=A,B=N-D&32767;if(G>2&&F==S(I-B))for(var V=Math.min(w,G)-1,X=Math.min(32767,I),J=Math.min(258,G);B<=X&&--Y&&N!=D;){if(t[I+K]==t[I+K-B]){for(var Q=0;Q<J&&t[I+Q]==t[I+Q-B];++Q);if(Q>K){if(K=Q,W=B,Q>V)break;var tt=Math.min(B,Q-2),et=0;for($=0;$<tt;++$){var nt=I-B+$&32767,it=nt-C[nt]&32767;it>et&&(et=it,D=nt)}}}B+=(N=D)-(D=C[N])&32767}if(W){M[R++]=268435456|p[K]<<18|v[W];var rt=31&p[K],st=31&v[W];x+=o[rt]+l[st],++U[257+rt],++T[st],P=I+K,++L}else M[R++]=t[I],++U[t[I]]}}for(I=Math.max(I,P);I<f;++I)M[R++]=t[I],++U[t[I]];m=j(t,d,g,M,U,T,x,R,O,I-O,m),g||(c.r=7&m|d[m/8|0]<<3,m-=7,c.h=b,c.p=C,c.i=I,c.w=P)}else{for(I=c.w||0;I<f+g;I+=65535){var at=I+65535;at>=f&&(d[m/8|0]=g,at=f),m=H(d,m+1,t.subarray(I,at))}c.i=f}return k(h,0,i+Z(m)+u)},K=function(){for(var t=new Int32Array(256),e=0;e<256;++e){for(var n=e,i=9;--i;)n=(1&n&&-306674912)^n>>>1;t[e]=n}return t}(),W=function(){var t=-1;return{p:function(e){for(var n=t,i=0;i<e.length;++i)n=K[255&n^e[i]]^n>>>8;t=n},d:function(){return~t}}},Y=function(){var t=1,e=0;return{p:function(n){for(var i=t,r=e,s=0|n.length,a=0;a!=s;){for(var o=Math.min(a+2655,s);a<o;++a)r+=i+=n[a];i=(65535&i)+15*(i>>16),r=(65535&r)+15*(r>>16)}t=i,e=r},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(e%=65521))<<8|e>>8}}},B=function(t,e,n,i,s){if(!s&&(s={l:1},e.dictionary)){var a=e.dictionary.subarray(-32768),o=new r(a.length+t.length);o.set(a),o.set(t,a.length),t=o,s.w=a.length}return $(t,null==e.level?6:e.level,null==e.mem?s.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):20:12+e.mem,n,i,s)},V=function(t,e){var n={};for(var i in t)n[i]=t[i];for(var i in e)n[i]=e[i];return n},X=function(t,e,n){for(var i=t(),r=t.toString(),s=r.slice(r.indexOf("[")+1,r.lastIndexOf("]")).replace(/\s+/g,"").split(","),a=0;a<i.length;++a){var o=i[a],l=s[a];if("function"==typeof o){e+=";"+l+"=";var u=o.toString();if(o.prototype)if(-1!=u.indexOf("[native code]")){var c=u.indexOf(" ",8)+1;e+=u.slice(c,u.indexOf("(",c))}else for(var f in e+=u,o.prototype)e+=";"+l+".prototype."+f+"="+o.prototype[f].toString();else e+=u}else n[l]=o}return e},J=[],Q=function(t,e,n,r){if(!J[n]){for(var s="",a={},o=t.length-1,l=0;l<o;++l)s=X(t[l],s,a);J[n]={c:X(t[o],s,a),e:a}}var u=V({},J[n].e);return i(J[n].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",n,u,function(t){var e=[];for(var n in t)t[n].buffer&&e.push((t[n]=new t[n].constructor(t[n])).buffer);return e}(u),r)},tt=function(){return[r,s,a,o,l,u,h,g,z,S,m,L,A,M,U,T,Z,k,x,I,Tt,at,ot]},et=function(){return[r,s,a,o,l,u,p,v,b,E,_,C,m,q,G,A,R,P,O,F,N,D,H,j,Z,k,$,B,_t,at]},nt=function(){return[gt,yt,dt,W,K]},it=function(){return[vt,mt]},rt=function(){return[wt,dt,Y]},st=function(){return[At]},at=function(t){return postMessage(t,[t.buffer])},ot=function(t){return t&&{out:t.size&&new r(t.size),dictionary:t.dictionary}},lt=function(t,e,n,i,r,s){var a=Q(n,i,r,function(t,e){a.terminate(),s(t,e)});return a.postMessage([t,e],e.consume?[t.buffer]:[]),function(){a.terminate()}},ut=function(t){return t.ondata=function(t,e){return postMessage([t,e],[t.buffer])},function(e){e.data.length?(t.push(e.data[0],e.data[1]),postMessage([e.data[0].length])):t.flush()}},ct=function(t,e,n,i,r,s,a){var o,l=Q(t,i,r,function(t,n){t?(l.terminate(),e.ondata.call(e,t)):Array.isArray(n)?1==n.length?(e.queuedSize-=n[0],e.ondrain&&e.ondrain(n[0])):(n[1]&&l.terminate(),e.ondata.call(e,t,n[0],n[1])):a(n)});l.postMessage(n),e.queuedSize=0,e.push=function(t,n){e.ondata||x(5),o&&e.ondata(x(4,0,1),null,!!n),e.queuedSize+=t.length,l.postMessage([t,o=n],[t.buffer])},e.terminate=function(){l.terminate()},s&&(e.flush=function(){l.postMessage([])})},ft=function(t,e){return t[e]|t[e+1]<<8},ht=function(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0},pt=function(t,e){return ht(t,e)+4294967296*ht(t,e+4)},dt=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8},gt=function(t,e){var n=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&dt(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),n){t[3]=8;for(var i=0;i<=n.length;++i)t[i+10]=n.charCodeAt(i)}},vt=function(t){31==t[0]&&139==t[1]&&8==t[2]||x(6,"invalid gzip data");var e=t[3],n=10;4&e&&(n+=2+(t[10]|t[11]<<8));for(var i=(e>>3&1)+(e>>4&1);i>0;i-=!t[n++]);return n+(2&e)},mt=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0},yt=function(t){return 10+(t.filename?t.filename.length+1:0)},wt=function(t,e){var n=e.level,i=0==n?0:n<6?1:9==n?3:2;if(t[0]=120,t[1]=i<<6|(e.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,e.dictionary){var r=Y();r.p(e.dictionary),dt(t,2,r.d())}},At=function(t,e){return(8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31)&&x(6,"invalid zlib data"),(t[1]>>5&1)==+!e&&x(6,"invalid zlib data: "+(32&t[1]?"need":"unexpected")+" dictionary"),2+(t[1]>>3&4)};function Et(t,e){return"function"==typeof t&&(e=t,t={}),this.ondata=e,t}var Ct=function(){function t(t,e){if("function"==typeof t&&(e=t,t={}),this.ondata=e,this.o=t||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new r(98304),this.o.dictionary){var n=this.o.dictionary.subarray(-32768);this.b.set(n,32768-n.length),this.s.i=32768-n.length}}return t.prototype.p=function(t,e){this.ondata(B(t,this.o,0,0,this.s),e)},t.prototype.push=function(t,e){this.ondata||x(5),this.s.l&&x(4);var n=t.length+this.s.z;if(n>this.b.length){if(n>2*this.b.length-32768){var i=new r(-32768&n);i.set(this.b.subarray(0,this.s.z)),this.b=i}var s=this.b.length-this.s.z;this.b.set(t.subarray(0,s),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(t.subarray(s),32768),this.s.z=t.length-s+32768,this.s.i=32766,this.s.w=32768}else this.b.set(t,this.s.z),this.s.z+=t.length;this.s.l=1&e,(this.s.z>this.s.w+8191||e)&&(this.p(this.b,e||!1),this.s.w=this.s.i,this.s.i-=2)},t.prototype.flush=function(){this.ondata||x(5),this.s.l&&x(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2},t}();e.Deflate=Ct;var bt=function(){return function(t,e){ct([et,function(){return[ut,Ct]}],this,Et.call(this,t,e),function(t){var e=new Ct(t.data);onmessage=ut(e)},6,1)}}();function zt(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&x(7),lt(t,e,[et],function(t){return at(_t(t.data[0],t.data[1]))},0,n)}function _t(t,e){return B(t,e||{},0,0)}e.AsyncDeflate=bt,e.deflate=zt,e.deflateSync=_t;var St=function(){function t(t,e){"function"==typeof t&&(e=t,t={}),this.ondata=e;var n=t&&t.dictionary&&t.dictionary.subarray(-32768);this.s={i:0,b:n?n.length:0},this.o=new r(32768),this.p=new r(0),n&&this.o.set(n)}return t.prototype.e=function(t){if(this.ondata||x(5),this.d&&x(4),this.p.length){if(t.length){var e=new r(this.p.length+t.length);e.set(this.p),e.set(t,this.p.length),this.p=e}}else this.p=t},t.prototype.c=function(t){this.s.i=+(this.d=t||!1);var e=this.s.b,n=I(this.p,this.s,this.o);this.ondata(k(n,e,this.s.b),this.d),this.o=k(n,this.s.b-32768),this.s.b=this.o.length,this.p=k(this.p,this.s.p/8|0),this.s.p&=7},t.prototype.push=function(t,e){this.e(t),this.c(e)},t}();e.Inflate=St;var Mt=function(){return function(t,e){ct([tt,function(){return[ut,St]}],this,Et.call(this,t,e),function(t){var e=new St(t.data);onmessage=ut(e)},7,0)}}();function Ut(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&x(7),lt(t,e,[tt],function(t){return at(Tt(t.data[0],ot(t.data[1])))},1,n)}function Tt(t,e){return I(t,{i:2},e&&e.out,e&&e.dictionary)}e.AsyncInflate=Mt,e.inflate=Ut,e.inflateSync=Tt;var Zt=function(){function t(t,e){this.c=W(),this.l=0,this.v=1,Ct.call(this,t,e)}return t.prototype.push=function(t,e){this.c.p(t),this.l+=t.length,Ct.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){var n=B(t,this.o,this.v&&yt(this.o),e&&8,this.s);this.v&&(gt(n,this.o),this.v=0),e&&(dt(n,n.length-8,this.c.d()),dt(n,n.length-4,this.l)),this.ondata(n,e)},t.prototype.flush=function(){Ct.prototype.flush.call(this)},t}();e.Gzip=Zt,e.Compress=Zt;var kt=function(){return function(t,e){ct([et,nt,function(){return[ut,Ct,Zt]}],this,Et.call(this,t,e),function(t){var e=new Zt(t.data);onmessage=ut(e)},8,1)}}();function Lt(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&x(7),lt(t,e,[et,nt,function(){return[xt]}],function(t){return at(xt(t.data[0],t.data[1]))},2,n)}function xt(t,e){e||(e={});var n=W(),i=t.length;n.p(t);var r=B(t,e,yt(e),8),s=r.length;return gt(r,e),dt(r,s-8,n.d()),dt(r,s-4,i),r}e.AsyncGzip=kt,e.AsyncCompress=kt,e.gzip=Lt,e.compress=Lt,e.gzipSync=xt,e.compressSync=xt;var It=function(){function t(t,e){this.v=1,this.r=0,St.call(this,t,e)}return t.prototype.push=function(t,e){if(St.prototype.e.call(this,t),this.r+=t.length,this.v){var n=this.p.subarray(this.v-1),i=n.length>3?vt(n):4;if(i>n.length){if(!e)return}else this.v>1&&this.onmember&&this.onmember(this.r-n.length);this.p=n.subarray(i),this.v=0}St.prototype.c.call(this,e),!this.s.f||this.s.l||e||(this.v=Z(this.s.p)+9,this.s={i:0},this.o=new r(0),this.push(new r(0),e))},t}();e.Gunzip=It;var Rt=function(){return function(t,e){var n=this;ct([tt,it,function(){return[ut,St,It]}],this,Et.call(this,t,e),function(t){var e=new It(t.data);e.onmember=function(t){return postMessage(t)},onmessage=ut(e)},9,0,function(t){return n.onmember&&n.onmember(t)})}}();function Pt(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&x(7),lt(t,e,[tt,it,function(){return[Ot]}],function(t){return at(Ot(t.data[0],t.data[1]))},3,n)}function Ot(t,e){var n=vt(t);return n+8>t.length&&x(6,"invalid gzip data"),I(t.subarray(n,-8),{i:2},e&&e.out||new r(mt(t)),e&&e.dictionary)}e.AsyncGunzip=Rt,e.gunzip=Pt,e.gunzipSync=Ot;var Ft=function(){function t(t,e){this.c=Y(),this.v=1,Ct.call(this,t,e)}return t.prototype.push=function(t,e){this.c.p(t),Ct.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){var n=B(t,this.o,this.v&&(this.o.dictionary?6:2),e&&4,this.s);this.v&&(wt(n,this.o),this.v=0),e&&dt(n,n.length-4,this.c.d()),this.ondata(n,e)},t.prototype.flush=function(){Ct.prototype.flush.call(this)},t}();e.Zlib=Ft;var Nt=function(){return function(t,e){ct([et,rt,function(){return[ut,Ct,Ft]}],this,Et.call(this,t,e),function(t){var e=new Ft(t.data);onmessage=ut(e)},10,1)}}();function Dt(t,e){e||(e={});var n=Y();n.p(t);var i=B(t,e,e.dictionary?6:2,4);return wt(i,e),dt(i,i.length-4,n.d()),i}e.AsyncZlib=Nt,e.zlib=function(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&x(7),lt(t,e,[et,rt,function(){return[Dt]}],function(t){return at(Dt(t.data[0],t.data[1]))},4,n)},e.zlibSync=Dt;var Ht=function(){function t(t,e){St.call(this,t,e),this.v=t&&t.dictionary?2:1}return t.prototype.push=function(t,e){if(St.prototype.e.call(this,t),this.v){if(this.p.length<6&&!e)return;this.p=this.p.subarray(At(this.p,this.v-1)),this.v=0}e&&(this.p.length<4&&x(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),St.prototype.c.call(this,e)},t}();e.Unzlib=Ht;var jt=function(){return function(t,e){ct([tt,st,function(){return[ut,St,Ht]}],this,Et.call(this,t,e),function(t){var e=new Ht(t.data);onmessage=ut(e)},11,0)}}();function qt(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&x(7),lt(t,e,[tt,st,function(){return[Gt]}],function(t){return at(Gt(t.data[0],ot(t.data[1])))},5,n)}function Gt(t,e){return I(t.subarray(At(t,e&&e.dictionary),-4),{i:2},e&&e.out,e&&e.dictionary)}e.AsyncUnzlib=jt,e.unzlib=qt,e.unzlibSync=Gt;var $t=function(){function t(t,e){this.o=Et.call(this,t,e)||{},this.G=It,this.I=St,this.Z=Ht}return t.prototype.i=function(){var t=this;this.s.ondata=function(e,n){t.ondata(e,n)}},t.prototype.push=function(t,e){if(this.ondata||x(5),this.s)this.s.push(t,e);else{if(this.p&&this.p.length){var n=new r(this.p.length+t.length);n.set(this.p),n.set(t,this.p.length)}else this.p=t;this.p.length>2&&(this.s=31==this.p[0]&&139==this.p[1]&&8==this.p[2]?new this.G(this.o):8!=(15&this.p[0])||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(this.o):new this.Z(this.o),this.i(),this.s.push(this.p,e),this.p=null)}},t}();e.Decompress=$t;var Kt=function(){function t(t,e){$t.call(this,t,e),this.queuedSize=0,this.G=Rt,this.I=Mt,this.Z=jt}return t.prototype.i=function(){var t=this;this.s.ondata=function(e,n,i){t.ondata(e,n,i)},this.s.ondrain=function(e){t.queuedSize-=e,t.ondrain&&t.ondrain(e)}},t.prototype.push=function(t,e){this.queuedSize+=t.length,$t.prototype.push.call(this,t,e)},t}();e.AsyncDecompress=Kt,e.decompress=function(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&x(7),31==t[0]&&139==t[1]&&8==t[2]?Pt(t,e,n):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?Ut(t,e,n):qt(t,e,n)},e.decompressSync=function(t,e){return 31==t[0]&&139==t[1]&&8==t[2]?Ot(t,e):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?Tt(t,e):Gt(t,e)};var Wt=function(t,e,n,i){for(var s in t){var a=t[s],o=e+s,l=i;Array.isArray(a)&&(l=V(i,a[1]),a=a[0]),a instanceof r?n[o]=[a,l]:(n[o+="/"]=[new r(0),l],Wt(a,o,n,i))}},Yt="undefined"!=typeof TextEncoder&&new TextEncoder,Bt="undefined"!=typeof TextDecoder&&new TextDecoder,Vt=0;try{Bt.decode(G,{stream:!0}),Vt=1}catch(t){}var Xt=function(t){for(var e="",n=0;;){var i=t[n++],r=(i>127)+(i>223)+(i>239);if(n+r>t.length)return{s:e,r:k(t,n-1)};r?3==r?(i=((15&i)<<18|(63&t[n++])<<12|(63&t[n++])<<6|63&t[n++])-65536,e+=String.fromCharCode(55296|i>>10,56320|1023&i)):e+=1&r?String.fromCharCode((31&i)<<6|63&t[n++]):String.fromCharCode((15&i)<<12|(63&t[n++])<<6|63&t[n++]):e+=String.fromCharCode(i)}},Jt=function(){function t(t){this.ondata=t,Vt?this.t=new TextDecoder:this.p=G}return t.prototype.push=function(t,e){if(this.ondata||x(5),e=!!e,this.t)return this.ondata(this.t.decode(t,{stream:!0}),e),void(e&&(this.t.decode().length&&x(8),this.t=null));this.p||x(4);var n=new r(this.p.length+t.length);n.set(this.p),n.set(t,this.p.length);var i=Xt(n),s=i.s,a=i.r;e?(a.length&&x(8),this.p=null):this.p=a,this.ondata(s,e)},t}();e.DecodeUTF8=Jt;var Qt=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,e){this.ondata||x(5),this.d&&x(4),this.ondata(te(t),this.d=e||!1)},t}();function te(t,e){if(e){for(var n=new r(t.length),i=0;i<t.length;++i)n[i]=t.charCodeAt(i);return n}if(Yt)return Yt.encode(t);var s=t.length,a=new r(t.length+(t.length>>1)),o=0,l=function(t){a[o++]=t};for(i=0;i<s;++i){if(o+5>a.length){var u=new r(o+8+(s-i<<1));u.set(a),a=u}var c=t.charCodeAt(i);c<128||e?l(c):c<2048?(l(192|c>>6),l(128|63&c)):c>55295&&c<57344?(l(240|(c=65536+(1047552&c)|1023&t.charCodeAt(++i))>>18),l(128|c>>12&63),l(128|c>>6&63),l(128|63&c)):(l(224|c>>12),l(128|c>>6&63),l(128|63&c))}return k(a,0,o)}function ee(t,e){if(e){for(var n="",i=0;i<t.length;i+=16384)n+=String.fromCharCode.apply(null,t.subarray(i,i+16384));return n}if(Bt)return Bt.decode(t);var r=Xt(t),s=r.s;return(n=r.r).length&&x(8),s}e.EncodeUTF8=Qt,e.strToU8=te,e.strFromU8=ee;var ne=function(t){return 1==t?3:t<6?2:9==t?1:0},ie=function(t,e){return e+30+ft(t,e+26)+ft(t,e+28)},re=function(t,e,n){var i=ft(t,e+28),r=ee(t.subarray(e+46,e+46+i),!(2048&ft(t,e+8))),s=e+46+i,a=ht(t,e+20),o=n&&4294967295==a?se(t,s):[a,ht(t,e+24),ht(t,e+42)],l=o[0],u=o[1],c=o[2];return[ft(t,e+10),l,u,r,s+ft(t,e+30)+ft(t,e+32),c]},se=function(t,e){for(;1!=ft(t,e);e+=4+ft(t,e+2));return[pt(t,e+12),pt(t,e+4),pt(t,e+20)]},ae=function(t){var e=0;if(t)for(var n in t){var i=t[n].length;i>65535&&x(9),e+=i+4}return e},oe=function(t,e,n,i,r,s,a,o){var l=i.length,u=n.extra,c=o&&o.length,f=ae(u);dt(t,e,null!=a?33639248:67324752),e+=4,null!=a&&(t[e++]=20,t[e++]=n.os),t[e]=20,e+=2,t[e++]=n.flag<<1|(s<0&&8),t[e++]=r&&8,t[e++]=255&n.compression,t[e++]=n.compression>>8;var h=new Date(null==n.mtime?Date.now():n.mtime),p=h.getFullYear()-1980;if((p<0||p>119)&&x(10),dt(t,e,p<<25|h.getMonth()+1<<21|h.getDate()<<16|h.getHours()<<11|h.getMinutes()<<5|h.getSeconds()>>1),e+=4,-1!=s&&(dt(t,e,n.crc),dt(t,e+4,s<0?-s-2:s),dt(t,e+8,n.size)),dt(t,e+12,l),dt(t,e+14,f),e+=16,null!=a&&(dt(t,e,c),dt(t,e+6,n.attrs),dt(t,e+10,a),e+=14),t.set(i,e),e+=l,f)for(var d in u){var g=u[d],v=g.length;dt(t,e,+d),dt(t,e+2,v),t.set(g,e+4),e+=4+v}return c&&(t.set(o,e),e+=c),e},le=function(t,e,n,i,r){dt(t,e,101010256),dt(t,e+8,n),dt(t,e+10,n),dt(t,e+12,i),dt(t,e+16,r)},ue=function(){function t(t){this.filename=t,this.c=W(),this.size=0,this.compression=0}return t.prototype.process=function(t,e){this.ondata(null,t,e)},t.prototype.push=function(t,e){this.ondata||x(5),this.c.p(t),this.size+=t.length,e&&(this.crc=this.c.d()),this.process(t,e||!1)},t}();e.ZipPassThrough=ue;var ce=function(){function t(t,e){var n=this;e||(e={}),ue.call(this,t),this.d=new Ct(e,function(t,e){n.ondata(null,t,e)}),this.compression=8,this.flag=ne(e.level)}return t.prototype.process=function(t,e){try{this.d.push(t,e)}catch(t){this.ondata(t,null,e)}},t.prototype.push=function(t,e){ue.prototype.push.call(this,t,e)},t}();e.ZipDeflate=ce;var fe=function(){function t(t,e){var n=this;e||(e={}),ue.call(this,t),this.d=new bt(e,function(t,e,i){n.ondata(t,e,i)}),this.compression=8,this.flag=ne(e.level),this.terminate=this.d.terminate}return t.prototype.process=function(t,e){this.d.push(t,e)},t.prototype.push=function(t,e){ue.prototype.push.call(this,t,e)},t}();e.AsyncZipDeflate=fe;var he=function(){function t(t){this.ondata=t,this.u=[],this.d=1}return t.prototype.add=function(t){var e=this;if(this.ondata||x(5),2&this.d)this.ondata(x(4+8*(1&this.d),0,1),null,!1);else{var n=te(t.filename),i=n.length,s=t.comment,a=s&&te(s),o=i!=t.filename.length||a&&s.length!=a.length,l=i+ae(t.extra)+30;i>65535&&this.ondata(x(11,0,1),null,!1);var u=new r(l);oe(u,0,t,n,o,-1);var c=[u],f=function(){for(var t=0,n=c;t<n.length;t++){var i=n[t];e.ondata(null,i,!1)}c=[]},h=this.d;this.d=0;var p=this.u.length,d=V(t,{f:n,u:o,o:a,t:function(){t.terminate&&t.terminate()},r:function(){if(f(),h){var t=e.u[p+1];t?t.r():e.d=1}h=1}}),g=0;t.ondata=function(n,i,s){if(n)e.ondata(n,i,s),e.terminate();else if(g+=i.length,c.push(i),s){var a=new r(16);dt(a,0,134695760),dt(a,4,t.crc),dt(a,8,g),dt(a,12,t.size),c.push(a),d.c=g,d.b=l+g+16,d.crc=t.crc,d.size=t.size,h&&d.r(),h=1}else h&&f()},this.u.push(d)}},t.prototype.end=function(){var t=this;2&this.d?this.ondata(x(4+8*(1&this.d),0,1),null,!0):(this.d?this.e():this.u.push({r:function(){1&t.d&&(t.u.splice(-1,1),t.e())},t:function(){}}),this.d=3)},t.prototype.e=function(){for(var t=0,e=0,n=0,i=0,s=this.u;i<s.length;i++)n+=46+(u=s[i]).f.length+ae(u.extra)+(u.o?u.o.length:0);for(var a=new r(n+22),o=0,l=this.u;o<l.length;o++){var u=l[o];oe(a,t,u,u.f,u.u,-u.c-2,e,u.o),t+=46+u.f.length+ae(u.extra)+(u.o?u.o.length:0),e+=u.b}le(a,t,this.u.length,n,e),this.ondata(null,a,!0),this.d=2},t.prototype.terminate=function(){for(var t=0,e=this.u;t<e.length;t++)e[t].t();this.d=2},t}();e.Zip=he,e.zip=function(t,e,n){n||(n=e,e={}),"function"!=typeof n&&x(7);var i={};Wt(t,"",i,e);var s=Object.keys(i),a=s.length,o=0,l=0,u=a,c=new Array(a),f=[],h=function(){for(var t=0;t<f.length;++t)f[t]()},p=function(t,e){me(function(){n(t,e)})};me(function(){p=n});var d=function(){var t=new r(l+22),e=o,n=l-o;l=0;for(var i=0;i<u;++i){var s=c[i];try{var a=s.c.length;oe(t,l,s,s.f,s.u,a);var f=30+s.f.length+ae(s.extra),h=l+f;t.set(s.c,h),oe(t,o,s,s.f,s.u,a,l,s.m),o+=16+f+(s.m?s.m.length:0),l=h+a}catch(t){return p(t,null)}}le(t,o,c.length,n,e),p(null,t)};a||d();for(var g=function(t){var e=s[t],n=i[e],r=n[0],u=n[1],g=W(),v=r.length;g.p(r);var m=te(e),y=m.length,w=u.comment,A=w&&te(w),E=A&&A.length,C=ae(u.extra),b=0==u.level?0:8,z=function(n,i){if(n)h(),p(n,null);else{var r=i.length;c[t]=V(u,{size:v,crc:g.d(),c:i,f:m,m:A,u:y!=e.length||A&&w.length!=E,compression:b}),o+=30+y+C+r,l+=76+2*(y+C)+(E||0)+r,--a||d()}};if(y>65535&&z(x(11,0,1),null),b)if(v<16e4)try{z(null,_t(r,u))}catch(t){z(t,null)}else f.push(zt(r,u,z));else z(null,r)},v=0;v<u;++v)g(v);return h},e.zipSync=function(t,e){e||(e={});var n={},i=[];Wt(t,"",n,e);var s=0,a=0;for(var o in n){var l=n[o],u=l[0],c=l[1],f=0==c.level?0:8,h=(z=te(o)).length,p=c.comment,d=p&&te(p),g=d&&d.length,v=ae(c.extra);h>65535&&x(11);var m=f?_t(u,c):u,y=m.length,w=W();w.p(u),i.push(V(c,{size:u.length,crc:w.d(),c:m,f:z,m:d,u:h!=o.length||d&&p.length!=g,o:s,compression:f})),s+=30+h+v+y,a+=76+2*(h+v)+(g||0)+y}for(var A=new r(a+22),E=s,C=a-s,b=0;b<i.length;++b){var z=i[b];oe(A,z.o,z,z.f,z.u,z.c.length);var _=30+z.f.length+ae(z.extra);A.set(z.c,z.o+_),oe(A,s,z,z.f,z.u,z.c.length,z.o,z.m),s+=16+_+(z.m?z.m.length:0)}return le(A,s,i.length,C,E),A};var pe=function(){function t(){}return t.prototype.push=function(t,e){this.ondata(null,t,e)},t.compression=0,t}();e.UnzipPassThrough=pe;var de=function(){function t(){var t=this;this.i=new St(function(e,n){t.ondata(null,e,n)})}return t.prototype.push=function(t,e){try{this.i.push(t,e)}catch(t){this.ondata(t,null,e)}},t.compression=8,t}();e.UnzipInflate=de;var ge=function(){function t(t,e){var n=this;e<32e4?this.i=new St(function(t,e){n.ondata(null,t,e)}):(this.i=new Mt(function(t,e,i){n.ondata(t,e,i)}),this.terminate=this.i.terminate)}return t.prototype.push=function(t,e){this.i.terminate&&(t=k(t,0)),this.i.push(t,e)},t.compression=8,t}();e.AsyncUnzipInflate=ge;var ve=function(){function t(t){this.onfile=t,this.k=[],this.o={0:pe},this.p=G}return t.prototype.push=function(t,e){var n=this;if(this.onfile||x(5),this.p||x(4),this.c>0){var i=Math.min(this.c,t.length),s=t.subarray(0,i);if(this.c-=i,this.d?this.d.push(s,!this.c):this.k[0].push(s),(t=t.subarray(i)).length)return this.push(t,e)}else{var a=0,o=0,l=void 0,u=void 0;this.p.length?t.length?((u=new r(this.p.length+t.length)).set(this.p),u.set(t,this.p.length)):u=this.p:u=t;for(var c=u.length,f=this.c,h=f&&this.d,p=function(){var t,e=ht(u,o);if(67324752==e){a=1,l=o,d.d=null,d.c=0;var i=ft(u,o+6),r=ft(u,o+8),s=2048&i,h=8&i,p=ft(u,o+26),g=ft(u,o+28);if(c>o+30+p+g){var v=[];d.k.unshift(v),a=2;var m,y=ht(u,o+18),w=ht(u,o+22),A=ee(u.subarray(o+30,o+=30+p),!s);4294967295==y?(t=h?[-2]:se(u,o),y=t[0],w=t[1]):h&&(y=-1),o+=g,d.c=y;var E={name:A,compression:r,start:function(){if(E.ondata||x(5),y){var t=n.o[r];t||E.ondata(x(14,"unknown compression type "+r,1),null,!1),(m=y<0?new t(A):new t(A,y,w)).ondata=function(t,e,n){E.ondata(t,e,n)};for(var e=0,i=v;e<i.length;e++){var s=i[e];m.push(s,!1)}n.k[0]==v&&n.c?n.d=m:m.push(G,!0)}else E.ondata(null,G,!0)},terminate:function(){m&&m.terminate&&m.terminate()}};y>=0&&(E.size=y,E.originalSize=w),d.onfile(E)}return"break"}if(f){if(134695760==e)return l=o+=12+(-2==f&&8),a=3,d.c=0,"break";if(33639248==e)return l=o-=4,a=3,d.c=0,"break"}},d=this;o<c-4&&"break"!==p();++o);if(this.p=G,f<0){var g=a?u.subarray(0,l-12-(-2==f&&8)-(134695760==ht(u,l-16)&&4)):u.subarray(0,o);h?h.push(g,!!a):this.k[+(2==a)].push(g)}if(2&a)return this.push(u.subarray(o),e);this.p=u.subarray(o)}e&&(this.c&&x(13),this.p=null)},t.prototype.register=function(t){this.o[t.compression]=t},t}();e.Unzip=ve;var me="function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout?setTimeout:function(t){t()};e.unzip=function(t,e,n){n||(n=e,e={}),"function"!=typeof n&&x(7);var i=[],s=function(){for(var t=0;t<i.length;++t)i[t]()},a={},o=function(t,e){me(function(){n(t,e)})};me(function(){o=n});for(var l=t.length-22;101010256!=ht(t,l);--l)if(!l||t.length-l>65558)return o(x(13,0,1),null),s;var u=ft(t,l+8);if(u){var c=u,f=ht(t,l+16),h=4294967295==f||65535==c;if(h){var p=ht(t,l-12);(h=101075792==ht(t,p))&&(c=u=ht(t,p+32),f=ht(t,p+48))}for(var d=e&&e.filter,g=function(e){var n=re(t,f,h),l=n[0],c=n[1],p=n[2],g=n[3],v=n[4],m=n[5],y=ie(t,m);f=v;var w=function(t,e){t?(s(),o(t,null)):(e&&(a[g]=e),--u||o(null,a))};if(!d||d({name:g,size:c,originalSize:p,compression:l}))if(l)if(8==l){var A=t.subarray(y,y+c);if(p<524288||c>.8*p)try{w(null,Tt(A,{out:new r(p)}))}catch(t){w(t,null)}else i.push(Ut(A,{size:p},w))}else w(x(14,"unknown compression type "+l,1),null);else w(null,k(t,y,y+c));else w(null,null)},v=0;v<c;++v)g()}else o(null,{});return s},e.unzipSync=function(t,e){for(var n={},i=t.length-22;101010256!=ht(t,i);--i)(!i||t.length-i>65558)&&x(13);var s=ft(t,i+8);if(!s)return{};var a=ht(t,i+16),o=4294967295==a||65535==s;if(o){var l=ht(t,i-12);(o=101075792==ht(t,l))&&(s=ht(t,l+32),a=ht(t,l+48))}for(var u=e&&e.filter,c=0;c<s;++c){var f=re(t,a,o),h=f[0],p=f[1],d=f[2],g=f[3],v=f[4],m=f[5],y=ie(t,m);a=v,u&&!u({name:g,size:p,originalSize:d,compression:h})||(h?8==h?n[g]=Tt(t.subarray(y,y+p),{out:new r(d)}):x(14,"unknown compression type "+h):n[g]=k(t,y,y+p))}return n}}},e={};function n(i){var r=e[i];if(void 0!==r)return r.exports;var s=e[i]={exports:{}};return t[i](s,s.exports,n),s.exports}(()=>{const t=n(886),e=n(49);self.addEventListener("install",()=>{self.skipWaiting()}),self.addEventListener("activate",t=>{t.waitUntil(self.clients.claim())}),(0,e.installMessageHandler)(),(0,t.installFetchHandler)()})()})();
1
+ (()=>{"use strict";var t={978(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.persistAllowedZipUrlsConfig=o,e.ensureAllowedZipUrlsLoaded=async function(){if(s.allowedZipUrlsLoaded)return s.allowedZipUrlsLoaded;const t=(async()=>{try{const t=await caches.open(r.CONFIG_CACHE_NAME),e=await t.match(s.CONFIG_CACHE_KEY);if(!e)return;const n=await e.json();Array.isArray(n.allowedZipUrls)?(0,s.setAllowedZipUrls)(new Set(n.allowedZipUrls.filter(t=>"string"==typeof t).map(t=>(0,i.normalizeZipUrl)(t)))):(0,s.setAllowedZipUrls)(null)}catch(t){(0,a.warn)("failed to load runtime config",t)}})();return(0,s.setAllowedZipUrlsLoaded)(t),t},e.applyRuntimeConfig=async function(t){if(!t)return;let e={...s.runtimeConfig},n=!1;if("string"==typeof t.zipAssetCacheName&&t.zipAssetCacheName.trim()&&(e.zipAssetCacheName=t.zipAssetCacheName,n=!0),"number"==typeof t.assetCacheTtlMs&&Number.isFinite(t.assetCacheTtlMs)&&(e.assetCacheTtlMs=t.assetCacheTtlMs,n=!0),"string"==typeof t.logPrefix&&t.logPrefix.trim()&&(e.logPrefix=t.logPrefix,n=!0),n&&(0,s.setRuntimeConfig)(e),"allowedZipUrls"in t){const e=Array.isArray(t.allowedZipUrls)?t.allowedZipUrls.map(t=>(0,i.normalizeZipUrl)(t)):null;(0,s.setAllowedZipUrls)(e?new Set(e):null),(0,s.setAllowedZipUrlsLoaded)(Promise.resolve()),await o(e)}},e.isZipUrlAllowed=function(t){return null===s.allowedZipUrls||s.allowedZipUrls.has(t)};const i=n(183),r=n(778),s=n(6),a=n(271);async function o(t){try{const e=await caches.open(r.CONFIG_CACHE_NAME);await e.put(new Request(s.CONFIG_CACHE_KEY),new Response(JSON.stringify({allowedZipUrls:t}),{headers:{"Content-Type":"application/json"}}))}catch(t){(0,a.warn)("failed to persist runtime config",t)}}},752(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.canonicalAssetRequest=function(t,e){return new Request((0,i.canonicalZipAssetRequestUrl)(t,e),{method:"GET"})},e.assetCacheEntryExpired=l,e.clearAllZipAssets=async function(){const t=await caches.open(o.runtimeConfig.zipAssetCacheName),e=await t.keys();await Promise.all(e.map(e=>t.delete(e))),await caches.delete(r.CONFIG_CACHE_NAME),o.zipManifests.clear(),o.pendingManifestLoads.clear(),(0,o.setAllowedZipUrlsLoaded)(Promise.resolve())},e.clearZipAssetsExceptAllowed=async function(t){try{const e=new Set(t),n=await caches.open(o.runtimeConfig.zipAssetCacheName),s=await n.keys();for(const t of s){const s=t.url;if(s.includes(r.MANIFEST_CACHE_KEY)){const i=(0,a.zipUrlFromManifestCacheKey)(s);i&&!e.has(i)&&await n.delete(t);continue}const o=(0,i.parseZipAssetRequest)(s);o&&!e.has(o.zipUrl)&&await n.delete(t)}for(const t of o.zipManifests.keys())e.has(t)||o.zipManifests.delete(t)}catch(t){(0,s.warn)("clearZipAssetsExceptAllowed failed",t)}},e.putCachedFullAssetIfAbsent=async function(t,e){try{const n=await caches.open(o.runtimeConfig.zipAssetCacheName),i=await n.match(t);if(i&&!l(i))return;const s=e.type||"application/octet-stream";await n.put(t,new Response(e,{status:200,headers:{"Content-Type":s,"Content-Length":String(e.size),"Access-Control-Allow-Origin":"*",[r.ASSET_CACHED_AT_HEADER]:String(Date.now())}}))}catch(t){(0,s.warn)("asset cache put failed",t)}},e.readCachedZipAssetIfFresh=async function(t){let e=null,n="network";try{const i=await caches.open(o.runtimeConfig.zipAssetCacheName),r=await i.match(t);if(r)if(l(r))try{await i.delete(t)}catch(t){(0,s.warn)("asset cache delete expired failed",t)}else e=await r.blob(),n="cache-api"}catch(t){(0,s.warn)("asset cache read failed",t)}return{blob:e,assetSource:n}};const i=n(183),r=n(778),s=n(271),a=n(234),o=n(6);function l(t){const e=t.headers.get(r.ASSET_CACHED_AT_HEADER);if(!e)return!0;const n=parseInt(e,10);return!Number.isFinite(n)||Date.now()-n>o.runtimeConfig.assetCacheTtlMs}},546(t,e){function n(t,e){const n=t instanceof Error?t:new Error(String(t));self.clients.matchAll({type:"window",includeUncontrolled:!0}).then(t=>{const i={type:"ZIP_SW_ERROR",error:{message:n.message,stack:n.stack},info:e};for(const e of t)e.postMessage(i)})}Object.defineProperty(e,"__esModule",{value:!0}),e.reportClientError=n,e.installClientErrorReporting=function(){self.addEventListener("error",t=>{n(t.error??t.message,"zip-peek: service worker error")}),self.addEventListener("unhandledrejection",t=>{n(t.reason,"zip-peek: service worker unhandled rejection")})}},778(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.MANIFEST_CACHE_KEY=e.LOCAL_FILE_HEADER_SIG=e.MIME_TYPES=e.ASSET_SOURCE_HEADER=e.ASSET_CACHED_AT_HEADER=e.ALLOWED_CACHE_NAMES=e.CONFIG_CACHE_NAME=e.DEFAULT_ASSET_CACHE_TTL_MS=e.DEFAULT_ZIP_ASSET_CACHE_NAME=void 0,e.DEFAULT_ZIP_ASSET_CACHE_NAME="zip-cache-v1",e.DEFAULT_ASSET_CACHE_TTL_MS=72e5,e.CONFIG_CACHE_NAME="zip-peek-config-v1",e.ALLOWED_CACHE_NAMES=[e.DEFAULT_ZIP_ASSET_CACHE_NAME,e.CONFIG_CACHE_NAME],e.ASSET_CACHED_AT_HEADER="X-ZipSW-Cached-At",e.ASSET_SOURCE_HEADER="X-ZipSW-Asset-Source",e.MIME_TYPES={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",json:"application/json",js:"application/javascript",css:"text/css; charset=utf-8",html:"text/html; charset=utf-8",txt:"text/plain; charset=utf-8",mp4:"video/mp4",webm:"video/webm",mp3:"audio/mpeg",wav:"audio/wav",oga:"audio/ogg",ogg:"audio/ogg",xml:"application/xml",wasm:"application/wasm"},e.LOCAL_FILE_HEADER_SIG=67324752,e.MANIFEST_CACHE_KEY="__zipsw_manifest__=1"},886(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.installFetchHandler=function(){self.addEventListener("fetch",t=>{if("GET"!==t.request.method)return;const e=(0,i.parseZipAssetRequest)(t.request.url);if(!e)return;const n=(0,i.normalizeZipUrl)(e.zipUrl),f=e.internalPath,h=(0,i.normalizeZipEntryPath)(f);t.respondWith((async()=>{if(await(0,r.ensureAllowedZipUrlsLoaded)(),!(0,r.isZipUrlAllowed)(n))return(0,o.warn)("zip URL not allowed",{requestedZipUrl:n}),(0,c.corsErrorResponse)("Zip URL not allowed",403);let e=u.zipManifests.get(n);if(e||(e=await(0,l.ensureManifestAvailable)(n)??void 0),!e){const t=Array.from(u.zipManifests.keys());return(0,o.warn)("manifest missing for zipUrl",{requestedZipUrl:n,knownZipUrls:t}),(0,c.corsErrorResponse)("Zip manifest not loaded",404)}const i=(0,l.resolveManifestEntry)(e,h);if(!i){const t=Array.from(e.keys()).slice(0,50);return(0,o.warn)("file not in manifest or ambiguous suffix match",{zipUrl:n,internalPathRaw:f,internalPathNormalized:h,manifestSize:e.size,sampleKeys:t}),(0,c.corsErrorResponse)("File not found in zip manifest",404)}const{key:p,info:d}=i;p!==h&&(0,o.log)("resolved via suffix match",{requested:h,manifestKey:p});const g=(0,s.canonicalAssetRequest)(n,p);let{blob:v,assetSource:m}=await(0,s.readCachedZipAssetIfFresh)(g);if(!v){const t=await(0,c.fetchUncompressedZipEntryFromNetwork)(n,p,d,g);if(!t.ok)return t.response;v=t.blob,m="network"}if(t.request.headers.has("range")){const e=t.request.headers.get("range").replace(/^bytes=/,"");if(e.includes(","))return new Response(null,{status:416,headers:{"Content-Range":`bytes */${v.size}`,"Access-Control-Allow-Origin":"*"}});const[n,i]=e.split("-"),r=""!==n?parseInt(n,10):NaN,s=""!==i?parseInt(i,10):v.size-1;if(isNaN(r)||isNaN(s)||r<0||s<r||r>=v.size)return new Response(null,{status:416,headers:{"Content-Range":`bytes */${v.size}`,"Access-Control-Allow-Origin":"*"}});const o=Math.min(s,v.size-1),l=v.slice(r,o+1);return new Response(l,{status:206,headers:{"Content-Type":v.type,"Content-Range":`bytes ${r}-${o}/${v.size}`,"Content-Length":l.size.toString(),"Accept-Ranges":"bytes","Access-Control-Allow-Origin":"*","Access-Control-Expose-Headers":a.ASSET_SOURCE_HEADER,[a.ASSET_SOURCE_HEADER]:m}})}return new Response(v,{status:200,headers:{"Content-Type":v.type,"Content-Length":v.size.toString(),"Access-Control-Allow-Origin":"*","Access-Control-Expose-Headers":a.ASSET_SOURCE_HEADER,[a.ASSET_SOURCE_HEADER]:m}})})())})};const i=n(183),r=n(978),s=n(752),a=n(778),o=n(271),l=n(234),u=n(6),c=n(878)},271(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.log=function(...t){console.log(i.runtimeConfig.logPrefix,...t)},e.warn=function(...t){console.warn(i.runtimeConfig.logPrefix,...t)};const i=n(6)},234(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.manifestCacheKey=o,e.persistManifest=l,e.loadPersistedManifest=u,e.parseCentralDirectoryToManifest=c,e.fetchZipManifest=f,e.ensureManifestAvailable=function(t){const e=a.zipManifests.get(t);if(e)return Promise.resolve(e);let n=a.pendingManifestLoads.get(t);return n||(n=(async()=>{const e=await u(t);if(e)return a.zipManifests.set(t,e),(0,s.log)("rehydrated manifest from cache",{zipUrl:t,entryCount:e.size}),e;const n=await f(t);return n&&(a.zipManifests.set(t,n),await l(t,n),(0,s.log)("manifest fetched and cached",{zipUrl:t,entryCount:n.size})),n})().finally(()=>{a.pendingManifestLoads.delete(t)}),a.pendingManifestLoads.set(t,n),n)},e.resolveManifestEntry=function(t,e){if(t.has(e))return{key:e,info:t.get(e)};const n=[];for(const i of t.keys())i.endsWith("/"+e)&&n.push(i);if(1===n.length){const e=n[0];return{key:e,info:t.get(e)}}return n.length>1?((0,s.warn)("ambiguous suffix match",{requested:e,picked:n[0],candidates:n.slice(0,8)}),null):null},e.zipUrlFromManifestCacheKey=function(t){const e=r.MANIFEST_CACHE_KEY;if(!t.endsWith(e))return null;let n=t.slice(0,-e.length);return(n.endsWith("?")||n.endsWith("&"))&&(n=n.slice(0,-1)),n};const i=n(183),r=n(778),s=n(271),a=n(6);function o(t){return t+(t.includes("?")?"&":"?")+r.MANIFEST_CACHE_KEY}async function l(t,e){try{const n=await caches.open(a.runtimeConfig.zipAssetCacheName),i=Array.from(e.values());await n.put(new Request(o(t)),new Response(JSON.stringify(i),{headers:{"Content-Type":"application/json"}}))}catch(t){(0,s.warn)("failed to persist manifest",t)}}async function u(t){try{const e=await caches.open(a.runtimeConfig.zipAssetCacheName),n=await e.match(o(t));if(!n)return null;const r=await n.json();if(!Array.isArray(r)||0===r.length)return null;const s=new Map;for(const t of r){const e=(0,i.normalizeZipEntryPath)(t.filename);""!==e&&s.set(e,t)}return s.size>0?s:null}catch(t){return(0,s.warn)("failed to load persisted manifest",t),null}}function c(t,e,n,r){const a=new DataView(t);let o=e;const l=[];for(;o+46<=t.byteLength&&33639248===a.getUint32(o,!0);){const e=a.getUint16(o+10,!0),n=a.getUint32(o+20,!0),r=a.getUint16(o+28,!0),s=a.getUint16(o+30,!0),u=a.getUint16(o+32,!0),c=a.getUint32(o+42,!0),f=new TextDecoder;if(o+46+r>t.byteLength)break;const h=new Uint8Array(t,o+46,r),p=f.decode(h),d=(0,i.normalizeZipEntryPath)(p);""!==d&&l.push({filename:d,offset:c,compressedSize:n,compression:e}),o+=46+r+s+u}if(0===l.length)return(0,s.warn)("no files parsed from central directory",r),null;l.sort((t,e)=>t.offset-e.offset);const u=new Map;for(let t=0;t<l.length;t++){const e=l[t],r=(0,i.normalizeZipEntryPath)(e.filename);""!==r&&(u.has(r)&&(0,s.warn)("duplicate manifest key after normalize; overwriting",r),u.set(r,{filename:e.filename,offset:e.offset,compressedSize:e.compressedSize,compression:e.compression,nextOffset:t<l.length-1?l[t+1].offset:n}))}return u.size>0?u:null}async function f(t){const e=await fetch(t,{headers:{Range:"bytes=-65536"}});if(206!==e.status)return(0,s.warn)("range requests not supported",{zipUrl:t,status:e.status}),null;const n=await e.arrayBuffer(),i=new DataView(n);let r=-1;for(let t=n.byteLength-22;t>=0;t--)if(101010256===i.getUint32(t,!0)){r=t;break}if(-1===r)return(0,s.warn)("EOCD not found in last 64KB",t),null;const a=i.getUint32(r+16,!0),o=i.getUint32(r+12,!0);let l=n,u=-1;const f=e.headers.get("Content-Range");let h=0;if(f){const t=f.match(/\/(\d+)$/);t&&(h=parseInt(t[1],10))}if(h<=0)return null;const p=h-n.byteLength;if(a>=p)u=a-p;else{const e=await fetch(t,{headers:{Range:`bytes=${a}-${a+o-1}`}});if(206!==e.status)return(0,s.warn)("failed to fetch central directory",{zipUrl:t,status:e.status}),null;l=await e.arrayBuffer(),u=0}return c(l,u,a,t)}},49(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.replyToMessage=c,e.installMessageHandler=function(){self.addEventListener("message",t=>{if(!t.data)return;const{type:e,zipUrl:n,files:f,config:h,allowedZipUrls:p}=t.data;if("ZIP_SW_CONFIG"===e){const e=(0,r.applyRuntimeConfig)(h).then(()=>c(t,{ok:!0})).catch(e=>c(t,u(e)));return void t.waitUntil(e)}if("ZIP_MANIFEST"===e){if(n&&f){const e=(0,i.normalizeZipUrl)(n),r=new Map;let s=!1;for(const t of f){const e=(0,i.normalizeZipEntryPath)(t.filename);""!==e?(r.has(e)&&(0,a.warn)("duplicate manifest key after normalize; overwriting",e),r.set(e,t)):s=!0}const u=l.zipManifests.get(e);if(0===r.size)return void(0,a.warn)("rejecting empty manifest; keeping existing",{zipUrl:e,existingSize:u?u.size:0,hadEmptyKey:s});if(u&&u.size>r.size)return void(0,a.warn)("rejecting smaller manifest; keeping existing",{zipUrl:e,incomingSize:r.size,existingSize:u.size});l.zipManifests.set(e,r),t.waitUntil((0,o.persistManifest)(e,r));const c=Array.from(r.keys()).slice(0,40);(0,a.log)("ZIP_MANIFEST loaded",{zipUrl:e,entryCount:r.size,sampleKeys:c,replacedExistingSize:u?u.size:0})}}else if("CLEAR_ZIP_ASSETS_EXCEPT_ALLOWED"===e&&p){const e=(0,s.clearZipAssetsExceptAllowed)(p).then(()=>c(t,{ok:!0})).catch(e=>c(t,u(e)));t.waitUntil(e)}else if("CLEAR_ALL_ZIP_ASSETS"===e){const e=(0,s.clearAllZipAssets)().then(()=>c(t,{ok:!0})).catch(e=>c(t,u(e)));t.waitUntil(e)}else if("PRELOAD_ZIP_MANIFESTS"===e&&p){const e=Promise.all(p.map(t=>(0,o.ensureManifestAvailable)(t))).then(()=>c(t,{ok:!0})).catch(e=>c(t,u(e)));t.waitUntil(e)}})};const i=n(183),r=n(978),s=n(752),a=n(271),o=n(234),l=n(6);function u(t){const e=t instanceof Error?t:new Error(String(t));return{ok:!1,error:e.message,errorStack:e.stack}}function c(t,e){t.ports[0]?.postMessage(e)}},6(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.CONFIG_CACHE_KEY=e.allowedZipUrlsLoaded=e.allowedZipUrls=e.runtimeConfig=e.pendingManifestLoads=e.zipManifests=void 0,e.setRuntimeConfig=function(t){e.runtimeConfig=t},e.setAllowedZipUrls=function(t){e.allowedZipUrls=t},e.setAllowedZipUrlsLoaded=function(t){e.allowedZipUrlsLoaded=t};const i=n(778);e.zipManifests=new Map,e.pendingManifestLoads=new Map,e.runtimeConfig={zipAssetCacheName:i.DEFAULT_ZIP_ASSET_CACHE_NAME,assetCacheTtlMs:i.DEFAULT_ASSET_CACHE_TTL_MS,logPrefix:"[zipSW]"},e.allowedZipUrls=null,e.allowedZipUrlsLoaded=null,e.CONFIG_CACHE_KEY=new URL("__zip_peek_runtime_config__",self.registration.scope).href},878(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.corsErrorResponse=o,e.getMimeType=l,e.fetchUncompressedZipEntryFromNetwork=async function(t,e,n,u){const c=n.offset,f=n.nextOffset-1;(0,s.log)("fetching zip chunk from",{zipUrl:t,rangeStart:c,rangeEnd:f});const h=await fetch(t,{headers:{Range:`bytes=${c}-${f}`}});if(206!==h.status)return{ok:!1,response:o("The server did not return a 206 Partial Content response",h.status)};const p=await h.arrayBuffer(),d=new DataView(p);if(d.getUint32(0,!0)!==r.LOCAL_FILE_HEADER_SIG)return{ok:!1,response:o("Invalid Local File Header",500)};const g=30+d.getUint16(26,!0)+d.getUint16(28,!0);if(g>p.byteLength||g+n.compressedSize>p.byteLength)return{ok:!1,response:o(`Invalid data start or compressed size for file ${e}: dataStart=${g}, compressedSize=${n.compressedSize}, bufferLength=${p.byteLength}`,500)};const v=new Uint8Array(p,g,n.compressedSize);let m;if(8===n.compression)try{m=(0,i.inflateSync)(v)}catch(t){return(0,s.warn)("inflateSync failed",t),{ok:!1,response:o("Failed to inflate the compressed data",500)}}else{if(0!==n.compression)return{ok:!1,response:o(`Unsupported compression method: ${n.compression}`,500)};m=v}const y=l(e),w=new Blob([m],{type:y});return await(0,a.putCachedFullAssetIfAbsent)(u,w),{ok:!0,blob:w}};const i=n(845),r=n(778),s=n(271),a=n(752);function o(t,e){return new Response(t,{status:e,headers:{"Access-Control-Allow-Origin":"*"}})}function l(t){const e=t.split(".").pop()?.toLowerCase();return e?r.MIME_TYPES[e]??"application/octet-stream":"application/octet-stream"}},183(t,e){function n(t){try{return decodeURIComponent(t)}catch{return t}}Object.defineProperty(e,"__esModule",{value:!0}),e.isZipPackage=function(t){try{return new URL(t).pathname.endsWith(".zip")}catch{return t.split("?")[0].endsWith(".zip")}},e.normalizeZipUrl=function(t,e={}){const{stripCacheBuster:n=!0,stripHash:i=!0}=e,r=t=>i?t.split("#")[0]:t;if(!n)return r(t);const s=t.indexOf("?");if(-1===s)return r(t);const a=t.indexOf("#",s),o=t.substring(0,s),l=-1===a?t.substring(s+1):t.substring(s+1,a),u=i||-1===a?"":t.substring(a),c=l.split("&").filter(t=>{const e=t.indexOf("=");return"t"!==(-1===e?t:t.substring(0,e))});return 0===c.length?o+u:o+"?"+c.join("&")+u},e.normalizeZipEntryPath=function(t){let e=t.replace(/\\/g,"/");for(;e.startsWith("/");)e=e.slice(1);return e},e.parseZipAssetRequest=function(t){const e=/\.zip([/?])/.exec(t);if(!e)return null;const i=e.index+4,r=e[1],s=t.substring(0,i);if("/"===r){const e=t.substring(i+1),r=e.indexOf("?"),a=-1===r?e:e.substring(0,r);return""===a?null:{zipUrl:s,internalPath:n(a)}}const a=t.substring(i),o=a.indexOf("/");if(-1===o)return null;const l=a.substring(0,o),u=a.substring(o+1),c=u.indexOf("?"),f=-1===c?u:u.substring(0,c);return""===f?null:{zipUrl:s+l,internalPath:n(f)}},e.canonicalZipAssetRequestUrl=function(t,e){return t+"/"+encodeURIComponent(e)}},845(t,e){var n={},i=function(t,e,i,r,s){var a=new Worker(n[e]||(n[e]=URL.createObjectURL(new Blob([t+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return a.onmessage=function(t){var e=t.data,n=e.$e$;if(n){var i=new Error(n[0]);i.code=n[1],i.stack=n[2],s(i,null)}else s(null,e)},a.postMessage(i,r),a},r=Uint8Array,s=Uint16Array,a=Int32Array,o=new r([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),l=new r([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),u=new r([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),c=function(t,e){for(var n=new s(31),i=0;i<31;++i)n[i]=e+=1<<t[i-1];var r=new a(n[30]);for(i=1;i<30;++i)for(var o=n[i];o<n[i+1];++o)r[o]=o-n[i]<<5|i;return{b:n,r}},f=c(o,2),h=f.b,p=f.r;h[28]=258,p[258]=28;for(var d=c(l,0),g=d.b,v=d.r,m=new s(32768),y=0;y<32768;++y){var w=(43690&y)>>1|(21845&y)<<1;w=(61680&(w=(52428&w)>>2|(13107&w)<<2))>>4|(3855&w)<<4,m[y]=((65280&w)>>8|(255&w)<<8)>>1}var A=function(t,e,n){for(var i=t.length,r=0,a=new s(e);r<i;++r)t[r]&&++a[t[r]-1];var o,l=new s(e);for(r=1;r<e;++r)l[r]=l[r-1]+a[r-1]<<1;if(n){o=new s(1<<e);var u=15-e;for(r=0;r<i;++r)if(t[r])for(var c=r<<4|t[r],f=e-t[r],h=l[t[r]-1]++<<f,p=h|(1<<f)-1;h<=p;++h)o[m[h]>>u]=c}else for(o=new s(i),r=0;r<i;++r)t[r]&&(o[r]=m[l[t[r]-1]++]>>15-t[r]);return o},E=new r(288);for(y=0;y<144;++y)E[y]=8;for(y=144;y<256;++y)E[y]=9;for(y=256;y<280;++y)E[y]=7;for(y=280;y<288;++y)E[y]=8;var C=new r(32);for(y=0;y<32;++y)C[y]=5;var b=A(E,9,0),z=A(E,9,1),_=A(C,5,0),S=A(C,5,1),M=function(t){for(var e=t[0],n=1;n<t.length;++n)t[n]>e&&(e=t[n]);return e},U=function(t,e,n){var i=e/8|0;return(t[i]|t[i+1]<<8)>>(7&e)&n},T=function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(7&e)},Z=function(t){return(t+7)/8|0},k=function(t,e,n){return(null==e||e<0)&&(e=0),(null==n||n>t.length)&&(n=t.length),new r(t.subarray(e,n))};e.FlateErrorCode={UnexpectedEOF:0,InvalidBlockType:1,InvalidLengthLiteral:2,InvalidDistance:3,StreamFinished:4,NoStreamHandler:5,InvalidHeader:6,NoCallback:7,InvalidUTF8:8,ExtraFieldTooLong:9,InvalidDate:10,FilenameTooLong:11,StreamFinishing:12,InvalidZipData:13,UnknownCompressionMethod:14};var L=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],x=function(t,e,n){var i=new Error(e||L[t]);if(i.code=t,Error.captureStackTrace&&Error.captureStackTrace(i,x),!n)throw i;return i},R=function(t,e,n,i){var s=t.length,a=i?i.length:0;if(!s||e.f&&!e.l)return n||new r(0);var c=!n,f=c||2!=e.i,p=e.i;c&&(n=new r(3*s));var d=function(t){var e=n.length;if(t>e){var i=new r(Math.max(2*e,t));i.set(n),n=i}},v=e.f||0,m=e.p||0,y=e.b||0,w=e.l,E=e.d,C=e.m,b=e.n,_=8*s;do{if(!w){v=U(t,m,1);var L=U(t,m+1,3);if(m+=3,!L){var R=t[($=Z(m)+4)-4]|t[$-3]<<8,I=$+R;if(I>s){p&&x(0);break}f&&d(y+R),n.set(t.subarray($,I),y),e.b=y+=R,e.p=m=8*I,e.f=v;continue}if(1==L)w=z,E=S,C=9,b=5;else if(2==L){var O=U(t,m,31)+257,F=U(t,m+10,15)+4,N=O+U(t,m+5,31)+1;m+=14;for(var P=new r(N),D=new r(19),H=0;H<F;++H)D[u[H]]=U(t,m+3*H,7);m+=3*F;var j=M(D),q=(1<<j)-1,G=A(D,j,1);for(H=0;H<N;){var $,W=G[U(t,m,q)];if(m+=15&W,($=W>>4)<16)P[H++]=$;else{var K=0,Y=0;for(16==$?(Y=3+U(t,m,3),m+=2,K=P[H-1]):17==$?(Y=3+U(t,m,7),m+=3):18==$&&(Y=11+U(t,m,127),m+=7);Y--;)P[H++]=K}}var B=P.subarray(0,O),V=P.subarray(O);C=M(B),b=M(V),w=A(B,C,1),E=A(V,b,1)}else x(1);if(m>_){p&&x(0);break}}f&&d(y+131072);for(var X=(1<<C)-1,J=(1<<b)-1,Q=m;;Q=m){var tt=(K=w[T(t,m)&X])>>4;if((m+=15&K)>_){p&&x(0);break}if(K||x(2),tt<256)n[y++]=tt;else{if(256==tt){Q=m,w=null;break}var et=tt-254;if(tt>264){var nt=o[H=tt-257];et=U(t,m,(1<<nt)-1)+h[H],m+=nt}var it=E[T(t,m)&J],rt=it>>4;if(it||x(3),m+=15&it,V=g[rt],rt>3&&(nt=l[rt],V+=T(t,m)&(1<<nt)-1,m+=nt),m>_){p&&x(0);break}f&&d(y+131072);var st=y+et;if(y<V){var at=a-V,ot=Math.min(V,st);for(at+y<0&&x(3);y<ot;++y)n[y]=i[at+y]}for(;y<st;++y)n[y]=n[y-V]}}e.l=w,e.p=Q,e.b=y,e.f=v,w&&(v=1,e.m=C,e.d=E,e.n=b)}while(!v);return y!=n.length&&c?k(n,0,y):n.subarray(0,y)},I=function(t,e,n){n<<=7&e;var i=e/8|0;t[i]|=n,t[i+1]|=n>>8},O=function(t,e,n){n<<=7&e;var i=e/8|0;t[i]|=n,t[i+1]|=n>>8,t[i+2]|=n>>16},F=function(t,e){for(var n=[],i=0;i<t.length;++i)t[i]&&n.push({s:i,f:t[i]});var a=n.length,o=n.slice();if(!a)return{t:G,l:0};if(1==a){var l=new r(n[0].s+1);return l[n[0].s]=1,{t:l,l:1}}n.sort(function(t,e){return t.f-e.f}),n.push({s:-1,f:25001});var u=n[0],c=n[1],f=0,h=1,p=2;for(n[0]={s:-1,f:u.f+c.f,l:u,r:c};h!=a-1;)u=n[n[f].f<n[p].f?f++:p++],c=n[f!=h&&n[f].f<n[p].f?f++:p++],n[h++]={s:-1,f:u.f+c.f,l:u,r:c};var d=o[0].s;for(i=1;i<a;++i)o[i].s>d&&(d=o[i].s);var g=new s(d+1),v=N(n[h-1],g,0);if(v>e){i=0;var m=0,y=v-e,w=1<<y;for(o.sort(function(t,e){return g[e.s]-g[t.s]||t.f-e.f});i<a;++i){var A=o[i].s;if(!(g[A]>e))break;m+=w-(1<<v-g[A]),g[A]=e}for(m>>=y;m>0;){var E=o[i].s;g[E]<e?m-=1<<e-g[E]++-1:++i}for(;i>=0&&m;--i){var C=o[i].s;g[C]==e&&(--g[C],++m)}v=e}return{t:new r(g),l:v}},N=function(t,e,n){return-1==t.s?Math.max(N(t.l,e,n+1),N(t.r,e,n+1)):e[t.s]=n},P=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new s(++e),i=0,r=t[0],a=1,o=function(t){n[i++]=t},l=1;l<=e;++l)if(t[l]==r&&l!=e)++a;else{if(!r&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(r),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(r);a=1,r=t[l]}return{c:n.subarray(0,i),n:e}},D=function(t,e){for(var n=0,i=0;i<e.length;++i)n+=t[i]*e[i];return n},H=function(t,e,n){var i=n.length,r=Z(e+2);t[r]=255&i,t[r+1]=i>>8,t[r+2]=255^t[r],t[r+3]=255^t[r+1];for(var s=0;s<i;++s)t[r+s+4]=n[s];return 8*(r+4+i)},j=function(t,e,n,i,r,a,c,f,h,p,d){I(e,d++,n),++r[256];for(var g=F(r,15),v=g.t,m=g.l,y=F(a,15),w=y.t,z=y.l,S=P(v),M=S.c,U=S.n,T=P(w),Z=T.c,k=T.n,L=new s(19),x=0;x<M.length;++x)++L[31&M[x]];for(x=0;x<Z.length;++x)++L[31&Z[x]];for(var R=F(L,7),N=R.t,j=R.l,q=19;q>4&&!N[u[q-1]];--q);var G,$,W,K,Y=p+5<<3,B=D(r,E)+D(a,C)+c,V=D(r,v)+D(a,w)+c+14+3*q+D(L,N)+2*L[16]+3*L[17]+7*L[18];if(h>=0&&Y<=B&&Y<=V)return H(e,d,t.subarray(h,h+p));if(I(e,d,1+(V<B)),d+=2,V<B){G=A(v,m,0),$=v,W=A(w,z,0),K=w;var X=A(N,j,0);for(I(e,d,U-257),I(e,d+5,k-1),I(e,d+10,q-4),d+=14,x=0;x<q;++x)I(e,d+3*x,N[u[x]]);d+=3*q;for(var J=[M,Z],Q=0;Q<2;++Q){var tt=J[Q];for(x=0;x<tt.length;++x){var et=31&tt[x];I(e,d,X[et]),d+=N[et],et>15&&(I(e,d,tt[x]>>5&127),d+=tt[x]>>12)}}}else G=b,$=E,W=_,K=C;for(x=0;x<f;++x){var nt=i[x];if(nt>255){O(e,d,G[257+(et=nt>>18&31)]),d+=$[et+257],et>7&&(I(e,d,nt>>23&31),d+=o[et]);var it=31&nt;O(e,d,W[it]),d+=K[it],it>3&&(O(e,d,nt>>5&8191),d+=l[it])}else O(e,d,G[nt]),d+=$[nt]}return O(e,d,G[256]),d+$[256]},q=new a([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),G=new r(0),$=function(t,e,n,i,u,c){var f=c.z||t.length,h=new r(i+f+5*(1+Math.ceil(f/7e3))+u),d=h.subarray(i,h.length-u),g=c.l,m=7&(c.r||0);if(e){m&&(d[0]=c.r>>3);for(var y=q[e-1],w=y>>13,A=8191&y,E=(1<<n)-1,C=c.p||new s(32768),b=c.h||new s(E+1),z=Math.ceil(n/3),_=2*z,S=function(e){return(t[e]^t[e+1]<<z^t[e+2]<<_)&E},M=new a(25e3),U=new s(288),T=new s(32),L=0,x=0,R=c.i||0,I=0,O=c.w||0,F=0;R+2<f;++R){var N=S(R),P=32767&R,D=b[N];if(C[P]=D,b[N]=P,O<=R){var G=f-R;if((L>7e3||I>24576)&&(G>423||!g)){m=j(t,d,0,M,U,T,x,I,F,R-F,m),I=L=x=0,F=R;for(var $=0;$<286;++$)U[$]=0;for($=0;$<30;++$)T[$]=0}var W=2,K=0,Y=A,B=P-D&32767;if(G>2&&N==S(R-B))for(var V=Math.min(w,G)-1,X=Math.min(32767,R),J=Math.min(258,G);B<=X&&--Y&&P!=D;){if(t[R+W]==t[R+W-B]){for(var Q=0;Q<J&&t[R+Q]==t[R+Q-B];++Q);if(Q>W){if(W=Q,K=B,Q>V)break;var tt=Math.min(B,Q-2),et=0;for($=0;$<tt;++$){var nt=R-B+$&32767,it=nt-C[nt]&32767;it>et&&(et=it,D=nt)}}}B+=(P=D)-(D=C[P])&32767}if(K){M[I++]=268435456|p[W]<<18|v[K];var rt=31&p[W],st=31&v[K];x+=o[rt]+l[st],++U[257+rt],++T[st],O=R+W,++L}else M[I++]=t[R],++U[t[R]]}}for(R=Math.max(R,O);R<f;++R)M[I++]=t[R],++U[t[R]];m=j(t,d,g,M,U,T,x,I,F,R-F,m),g||(c.r=7&m|d[m/8|0]<<3,m-=7,c.h=b,c.p=C,c.i=R,c.w=O)}else{for(R=c.w||0;R<f+g;R+=65535){var at=R+65535;at>=f&&(d[m/8|0]=g,at=f),m=H(d,m+1,t.subarray(R,at))}c.i=f}return k(h,0,i+Z(m)+u)},W=function(){for(var t=new Int32Array(256),e=0;e<256;++e){for(var n=e,i=9;--i;)n=(1&n&&-306674912)^n>>>1;t[e]=n}return t}(),K=function(){var t=-1;return{p:function(e){for(var n=t,i=0;i<e.length;++i)n=W[255&n^e[i]]^n>>>8;t=n},d:function(){return~t}}},Y=function(){var t=1,e=0;return{p:function(n){for(var i=t,r=e,s=0|n.length,a=0;a!=s;){for(var o=Math.min(a+2655,s);a<o;++a)r+=i+=n[a];i=(65535&i)+15*(i>>16),r=(65535&r)+15*(r>>16)}t=i,e=r},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(e%=65521))<<8|e>>8}}},B=function(t,e,n,i,s){if(!s&&(s={l:1},e.dictionary)){var a=e.dictionary.subarray(-32768),o=new r(a.length+t.length);o.set(a),o.set(t,a.length),t=o,s.w=a.length}return $(t,null==e.level?6:e.level,null==e.mem?s.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):20:12+e.mem,n,i,s)},V=function(t,e){var n={};for(var i in t)n[i]=t[i];for(var i in e)n[i]=e[i];return n},X=function(t,e,n){for(var i=t(),r=t.toString(),s=r.slice(r.indexOf("[")+1,r.lastIndexOf("]")).replace(/\s+/g,"").split(","),a=0;a<i.length;++a){var o=i[a],l=s[a];if("function"==typeof o){e+=";"+l+"=";var u=o.toString();if(o.prototype)if(-1!=u.indexOf("[native code]")){var c=u.indexOf(" ",8)+1;e+=u.slice(c,u.indexOf("(",c))}else for(var f in e+=u,o.prototype)e+=";"+l+".prototype."+f+"="+o.prototype[f].toString();else e+=u}else n[l]=o}return e},J=[],Q=function(t,e,n,r){if(!J[n]){for(var s="",a={},o=t.length-1,l=0;l<o;++l)s=X(t[l],s,a);J[n]={c:X(t[o],s,a),e:a}}var u=V({},J[n].e);return i(J[n].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",n,u,function(t){var e=[];for(var n in t)t[n].buffer&&e.push((t[n]=new t[n].constructor(t[n])).buffer);return e}(u),r)},tt=function(){return[r,s,a,o,l,u,h,g,z,S,m,L,A,M,U,T,Z,k,x,R,Tt,at,ot]},et=function(){return[r,s,a,o,l,u,p,v,b,E,_,C,m,q,G,A,I,O,F,N,P,D,H,j,Z,k,$,B,_t,at]},nt=function(){return[gt,yt,dt,K,W]},it=function(){return[vt,mt]},rt=function(){return[wt,dt,Y]},st=function(){return[At]},at=function(t){return postMessage(t,[t.buffer])},ot=function(t){return t&&{out:t.size&&new r(t.size),dictionary:t.dictionary}},lt=function(t,e,n,i,r,s){var a=Q(n,i,r,function(t,e){a.terminate(),s(t,e)});return a.postMessage([t,e],e.consume?[t.buffer]:[]),function(){a.terminate()}},ut=function(t){return t.ondata=function(t,e){return postMessage([t,e],[t.buffer])},function(e){e.data.length?(t.push(e.data[0],e.data[1]),postMessage([e.data[0].length])):t.flush()}},ct=function(t,e,n,i,r,s,a){var o,l=Q(t,i,r,function(t,n){t?(l.terminate(),e.ondata.call(e,t)):Array.isArray(n)?1==n.length?(e.queuedSize-=n[0],e.ondrain&&e.ondrain(n[0])):(n[1]&&l.terminate(),e.ondata.call(e,t,n[0],n[1])):a(n)});l.postMessage(n),e.queuedSize=0,e.push=function(t,n){e.ondata||x(5),o&&e.ondata(x(4,0,1),null,!!n),e.queuedSize+=t.length,l.postMessage([t,o=n],[t.buffer])},e.terminate=function(){l.terminate()},s&&(e.flush=function(){l.postMessage([])})},ft=function(t,e){return t[e]|t[e+1]<<8},ht=function(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0},pt=function(t,e){return ht(t,e)+4294967296*ht(t,e+4)},dt=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8},gt=function(t,e){var n=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&dt(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),n){t[3]=8;for(var i=0;i<=n.length;++i)t[i+10]=n.charCodeAt(i)}},vt=function(t){31==t[0]&&139==t[1]&&8==t[2]||x(6,"invalid gzip data");var e=t[3],n=10;4&e&&(n+=2+(t[10]|t[11]<<8));for(var i=(e>>3&1)+(e>>4&1);i>0;i-=!t[n++]);return n+(2&e)},mt=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0},yt=function(t){return 10+(t.filename?t.filename.length+1:0)},wt=function(t,e){var n=e.level,i=0==n?0:n<6?1:9==n?3:2;if(t[0]=120,t[1]=i<<6|(e.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,e.dictionary){var r=Y();r.p(e.dictionary),dt(t,2,r.d())}},At=function(t,e){return(8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31)&&x(6,"invalid zlib data"),(t[1]>>5&1)==+!e&&x(6,"invalid zlib data: "+(32&t[1]?"need":"unexpected")+" dictionary"),2+(t[1]>>3&4)};function Et(t,e){return"function"==typeof t&&(e=t,t={}),this.ondata=e,t}var Ct=function(){function t(t,e){if("function"==typeof t&&(e=t,t={}),this.ondata=e,this.o=t||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new r(98304),this.o.dictionary){var n=this.o.dictionary.subarray(-32768);this.b.set(n,32768-n.length),this.s.i=32768-n.length}}return t.prototype.p=function(t,e){this.ondata(B(t,this.o,0,0,this.s),e)},t.prototype.push=function(t,e){this.ondata||x(5),this.s.l&&x(4);var n=t.length+this.s.z;if(n>this.b.length){if(n>2*this.b.length-32768){var i=new r(-32768&n);i.set(this.b.subarray(0,this.s.z)),this.b=i}var s=this.b.length-this.s.z;this.b.set(t.subarray(0,s),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(t.subarray(s),32768),this.s.z=t.length-s+32768,this.s.i=32766,this.s.w=32768}else this.b.set(t,this.s.z),this.s.z+=t.length;this.s.l=1&e,(this.s.z>this.s.w+8191||e)&&(this.p(this.b,e||!1),this.s.w=this.s.i,this.s.i-=2)},t.prototype.flush=function(){this.ondata||x(5),this.s.l&&x(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2},t}();e.Deflate=Ct;var bt=function(){return function(t,e){ct([et,function(){return[ut,Ct]}],this,Et.call(this,t,e),function(t){var e=new Ct(t.data);onmessage=ut(e)},6,1)}}();function zt(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&x(7),lt(t,e,[et],function(t){return at(_t(t.data[0],t.data[1]))},0,n)}function _t(t,e){return B(t,e||{},0,0)}e.AsyncDeflate=bt,e.deflate=zt,e.deflateSync=_t;var St=function(){function t(t,e){"function"==typeof t&&(e=t,t={}),this.ondata=e;var n=t&&t.dictionary&&t.dictionary.subarray(-32768);this.s={i:0,b:n?n.length:0},this.o=new r(32768),this.p=new r(0),n&&this.o.set(n)}return t.prototype.e=function(t){if(this.ondata||x(5),this.d&&x(4),this.p.length){if(t.length){var e=new r(this.p.length+t.length);e.set(this.p),e.set(t,this.p.length),this.p=e}}else this.p=t},t.prototype.c=function(t){this.s.i=+(this.d=t||!1);var e=this.s.b,n=R(this.p,this.s,this.o);this.ondata(k(n,e,this.s.b),this.d),this.o=k(n,this.s.b-32768),this.s.b=this.o.length,this.p=k(this.p,this.s.p/8|0),this.s.p&=7},t.prototype.push=function(t,e){this.e(t),this.c(e)},t}();e.Inflate=St;var Mt=function(){return function(t,e){ct([tt,function(){return[ut,St]}],this,Et.call(this,t,e),function(t){var e=new St(t.data);onmessage=ut(e)},7,0)}}();function Ut(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&x(7),lt(t,e,[tt],function(t){return at(Tt(t.data[0],ot(t.data[1])))},1,n)}function Tt(t,e){return R(t,{i:2},e&&e.out,e&&e.dictionary)}e.AsyncInflate=Mt,e.inflate=Ut,e.inflateSync=Tt;var Zt=function(){function t(t,e){this.c=K(),this.l=0,this.v=1,Ct.call(this,t,e)}return t.prototype.push=function(t,e){this.c.p(t),this.l+=t.length,Ct.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){var n=B(t,this.o,this.v&&yt(this.o),e&&8,this.s);this.v&&(gt(n,this.o),this.v=0),e&&(dt(n,n.length-8,this.c.d()),dt(n,n.length-4,this.l)),this.ondata(n,e)},t.prototype.flush=function(){Ct.prototype.flush.call(this)},t}();e.Gzip=Zt,e.Compress=Zt;var kt=function(){return function(t,e){ct([et,nt,function(){return[ut,Ct,Zt]}],this,Et.call(this,t,e),function(t){var e=new Zt(t.data);onmessage=ut(e)},8,1)}}();function Lt(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&x(7),lt(t,e,[et,nt,function(){return[xt]}],function(t){return at(xt(t.data[0],t.data[1]))},2,n)}function xt(t,e){e||(e={});var n=K(),i=t.length;n.p(t);var r=B(t,e,yt(e),8),s=r.length;return gt(r,e),dt(r,s-8,n.d()),dt(r,s-4,i),r}e.AsyncGzip=kt,e.AsyncCompress=kt,e.gzip=Lt,e.compress=Lt,e.gzipSync=xt,e.compressSync=xt;var Rt=function(){function t(t,e){this.v=1,this.r=0,St.call(this,t,e)}return t.prototype.push=function(t,e){if(St.prototype.e.call(this,t),this.r+=t.length,this.v){var n=this.p.subarray(this.v-1),i=n.length>3?vt(n):4;if(i>n.length){if(!e)return}else this.v>1&&this.onmember&&this.onmember(this.r-n.length);this.p=n.subarray(i),this.v=0}St.prototype.c.call(this,e),!this.s.f||this.s.l||e||(this.v=Z(this.s.p)+9,this.s={i:0},this.o=new r(0),this.push(new r(0),e))},t}();e.Gunzip=Rt;var It=function(){return function(t,e){var n=this;ct([tt,it,function(){return[ut,St,Rt]}],this,Et.call(this,t,e),function(t){var e=new Rt(t.data);e.onmember=function(t){return postMessage(t)},onmessage=ut(e)},9,0,function(t){return n.onmember&&n.onmember(t)})}}();function Ot(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&x(7),lt(t,e,[tt,it,function(){return[Ft]}],function(t){return at(Ft(t.data[0],t.data[1]))},3,n)}function Ft(t,e){var n=vt(t);return n+8>t.length&&x(6,"invalid gzip data"),R(t.subarray(n,-8),{i:2},e&&e.out||new r(mt(t)),e&&e.dictionary)}e.AsyncGunzip=It,e.gunzip=Ot,e.gunzipSync=Ft;var Nt=function(){function t(t,e){this.c=Y(),this.v=1,Ct.call(this,t,e)}return t.prototype.push=function(t,e){this.c.p(t),Ct.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){var n=B(t,this.o,this.v&&(this.o.dictionary?6:2),e&&4,this.s);this.v&&(wt(n,this.o),this.v=0),e&&dt(n,n.length-4,this.c.d()),this.ondata(n,e)},t.prototype.flush=function(){Ct.prototype.flush.call(this)},t}();e.Zlib=Nt;var Pt=function(){return function(t,e){ct([et,rt,function(){return[ut,Ct,Nt]}],this,Et.call(this,t,e),function(t){var e=new Nt(t.data);onmessage=ut(e)},10,1)}}();function Dt(t,e){e||(e={});var n=Y();n.p(t);var i=B(t,e,e.dictionary?6:2,4);return wt(i,e),dt(i,i.length-4,n.d()),i}e.AsyncZlib=Pt,e.zlib=function(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&x(7),lt(t,e,[et,rt,function(){return[Dt]}],function(t){return at(Dt(t.data[0],t.data[1]))},4,n)},e.zlibSync=Dt;var Ht=function(){function t(t,e){St.call(this,t,e),this.v=t&&t.dictionary?2:1}return t.prototype.push=function(t,e){if(St.prototype.e.call(this,t),this.v){if(this.p.length<6&&!e)return;this.p=this.p.subarray(At(this.p,this.v-1)),this.v=0}e&&(this.p.length<4&&x(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),St.prototype.c.call(this,e)},t}();e.Unzlib=Ht;var jt=function(){return function(t,e){ct([tt,st,function(){return[ut,St,Ht]}],this,Et.call(this,t,e),function(t){var e=new Ht(t.data);onmessage=ut(e)},11,0)}}();function qt(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&x(7),lt(t,e,[tt,st,function(){return[Gt]}],function(t){return at(Gt(t.data[0],ot(t.data[1])))},5,n)}function Gt(t,e){return R(t.subarray(At(t,e&&e.dictionary),-4),{i:2},e&&e.out,e&&e.dictionary)}e.AsyncUnzlib=jt,e.unzlib=qt,e.unzlibSync=Gt;var $t=function(){function t(t,e){this.o=Et.call(this,t,e)||{},this.G=Rt,this.I=St,this.Z=Ht}return t.prototype.i=function(){var t=this;this.s.ondata=function(e,n){t.ondata(e,n)}},t.prototype.push=function(t,e){if(this.ondata||x(5),this.s)this.s.push(t,e);else{if(this.p&&this.p.length){var n=new r(this.p.length+t.length);n.set(this.p),n.set(t,this.p.length)}else this.p=t;this.p.length>2&&(this.s=31==this.p[0]&&139==this.p[1]&&8==this.p[2]?new this.G(this.o):8!=(15&this.p[0])||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(this.o):new this.Z(this.o),this.i(),this.s.push(this.p,e),this.p=null)}},t}();e.Decompress=$t;var Wt=function(){function t(t,e){$t.call(this,t,e),this.queuedSize=0,this.G=It,this.I=Mt,this.Z=jt}return t.prototype.i=function(){var t=this;this.s.ondata=function(e,n,i){t.ondata(e,n,i)},this.s.ondrain=function(e){t.queuedSize-=e,t.ondrain&&t.ondrain(e)}},t.prototype.push=function(t,e){this.queuedSize+=t.length,$t.prototype.push.call(this,t,e)},t}();e.AsyncDecompress=Wt,e.decompress=function(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&x(7),31==t[0]&&139==t[1]&&8==t[2]?Ot(t,e,n):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?Ut(t,e,n):qt(t,e,n)},e.decompressSync=function(t,e){return 31==t[0]&&139==t[1]&&8==t[2]?Ft(t,e):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?Tt(t,e):Gt(t,e)};var Kt=function(t,e,n,i){for(var s in t){var a=t[s],o=e+s,l=i;Array.isArray(a)&&(l=V(i,a[1]),a=a[0]),a instanceof r?n[o]=[a,l]:(n[o+="/"]=[new r(0),l],Kt(a,o,n,i))}},Yt="undefined"!=typeof TextEncoder&&new TextEncoder,Bt="undefined"!=typeof TextDecoder&&new TextDecoder,Vt=0;try{Bt.decode(G,{stream:!0}),Vt=1}catch(t){}var Xt=function(t){for(var e="",n=0;;){var i=t[n++],r=(i>127)+(i>223)+(i>239);if(n+r>t.length)return{s:e,r:k(t,n-1)};r?3==r?(i=((15&i)<<18|(63&t[n++])<<12|(63&t[n++])<<6|63&t[n++])-65536,e+=String.fromCharCode(55296|i>>10,56320|1023&i)):e+=1&r?String.fromCharCode((31&i)<<6|63&t[n++]):String.fromCharCode((15&i)<<12|(63&t[n++])<<6|63&t[n++]):e+=String.fromCharCode(i)}},Jt=function(){function t(t){this.ondata=t,Vt?this.t=new TextDecoder:this.p=G}return t.prototype.push=function(t,e){if(this.ondata||x(5),e=!!e,this.t)return this.ondata(this.t.decode(t,{stream:!0}),e),void(e&&(this.t.decode().length&&x(8),this.t=null));this.p||x(4);var n=new r(this.p.length+t.length);n.set(this.p),n.set(t,this.p.length);var i=Xt(n),s=i.s,a=i.r;e?(a.length&&x(8),this.p=null):this.p=a,this.ondata(s,e)},t}();e.DecodeUTF8=Jt;var Qt=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,e){this.ondata||x(5),this.d&&x(4),this.ondata(te(t),this.d=e||!1)},t}();function te(t,e){if(e){for(var n=new r(t.length),i=0;i<t.length;++i)n[i]=t.charCodeAt(i);return n}if(Yt)return Yt.encode(t);var s=t.length,a=new r(t.length+(t.length>>1)),o=0,l=function(t){a[o++]=t};for(i=0;i<s;++i){if(o+5>a.length){var u=new r(o+8+(s-i<<1));u.set(a),a=u}var c=t.charCodeAt(i);c<128||e?l(c):c<2048?(l(192|c>>6),l(128|63&c)):c>55295&&c<57344?(l(240|(c=65536+(1047552&c)|1023&t.charCodeAt(++i))>>18),l(128|c>>12&63),l(128|c>>6&63),l(128|63&c)):(l(224|c>>12),l(128|c>>6&63),l(128|63&c))}return k(a,0,o)}function ee(t,e){if(e){for(var n="",i=0;i<t.length;i+=16384)n+=String.fromCharCode.apply(null,t.subarray(i,i+16384));return n}if(Bt)return Bt.decode(t);var r=Xt(t),s=r.s;return(n=r.r).length&&x(8),s}e.EncodeUTF8=Qt,e.strToU8=te,e.strFromU8=ee;var ne=function(t){return 1==t?3:t<6?2:9==t?1:0},ie=function(t,e){return e+30+ft(t,e+26)+ft(t,e+28)},re=function(t,e,n){var i=ft(t,e+28),r=ee(t.subarray(e+46,e+46+i),!(2048&ft(t,e+8))),s=e+46+i,a=ht(t,e+20),o=n&&4294967295==a?se(t,s):[a,ht(t,e+24),ht(t,e+42)],l=o[0],u=o[1],c=o[2];return[ft(t,e+10),l,u,r,s+ft(t,e+30)+ft(t,e+32),c]},se=function(t,e){for(;1!=ft(t,e);e+=4+ft(t,e+2));return[pt(t,e+12),pt(t,e+4),pt(t,e+20)]},ae=function(t){var e=0;if(t)for(var n in t){var i=t[n].length;i>65535&&x(9),e+=i+4}return e},oe=function(t,e,n,i,r,s,a,o){var l=i.length,u=n.extra,c=o&&o.length,f=ae(u);dt(t,e,null!=a?33639248:67324752),e+=4,null!=a&&(t[e++]=20,t[e++]=n.os),t[e]=20,e+=2,t[e++]=n.flag<<1|(s<0&&8),t[e++]=r&&8,t[e++]=255&n.compression,t[e++]=n.compression>>8;var h=new Date(null==n.mtime?Date.now():n.mtime),p=h.getFullYear()-1980;if((p<0||p>119)&&x(10),dt(t,e,p<<25|h.getMonth()+1<<21|h.getDate()<<16|h.getHours()<<11|h.getMinutes()<<5|h.getSeconds()>>1),e+=4,-1!=s&&(dt(t,e,n.crc),dt(t,e+4,s<0?-s-2:s),dt(t,e+8,n.size)),dt(t,e+12,l),dt(t,e+14,f),e+=16,null!=a&&(dt(t,e,c),dt(t,e+6,n.attrs),dt(t,e+10,a),e+=14),t.set(i,e),e+=l,f)for(var d in u){var g=u[d],v=g.length;dt(t,e,+d),dt(t,e+2,v),t.set(g,e+4),e+=4+v}return c&&(t.set(o,e),e+=c),e},le=function(t,e,n,i,r){dt(t,e,101010256),dt(t,e+8,n),dt(t,e+10,n),dt(t,e+12,i),dt(t,e+16,r)},ue=function(){function t(t){this.filename=t,this.c=K(),this.size=0,this.compression=0}return t.prototype.process=function(t,e){this.ondata(null,t,e)},t.prototype.push=function(t,e){this.ondata||x(5),this.c.p(t),this.size+=t.length,e&&(this.crc=this.c.d()),this.process(t,e||!1)},t}();e.ZipPassThrough=ue;var ce=function(){function t(t,e){var n=this;e||(e={}),ue.call(this,t),this.d=new Ct(e,function(t,e){n.ondata(null,t,e)}),this.compression=8,this.flag=ne(e.level)}return t.prototype.process=function(t,e){try{this.d.push(t,e)}catch(t){this.ondata(t,null,e)}},t.prototype.push=function(t,e){ue.prototype.push.call(this,t,e)},t}();e.ZipDeflate=ce;var fe=function(){function t(t,e){var n=this;e||(e={}),ue.call(this,t),this.d=new bt(e,function(t,e,i){n.ondata(t,e,i)}),this.compression=8,this.flag=ne(e.level),this.terminate=this.d.terminate}return t.prototype.process=function(t,e){this.d.push(t,e)},t.prototype.push=function(t,e){ue.prototype.push.call(this,t,e)},t}();e.AsyncZipDeflate=fe;var he=function(){function t(t){this.ondata=t,this.u=[],this.d=1}return t.prototype.add=function(t){var e=this;if(this.ondata||x(5),2&this.d)this.ondata(x(4+8*(1&this.d),0,1),null,!1);else{var n=te(t.filename),i=n.length,s=t.comment,a=s&&te(s),o=i!=t.filename.length||a&&s.length!=a.length,l=i+ae(t.extra)+30;i>65535&&this.ondata(x(11,0,1),null,!1);var u=new r(l);oe(u,0,t,n,o,-1);var c=[u],f=function(){for(var t=0,n=c;t<n.length;t++){var i=n[t];e.ondata(null,i,!1)}c=[]},h=this.d;this.d=0;var p=this.u.length,d=V(t,{f:n,u:o,o:a,t:function(){t.terminate&&t.terminate()},r:function(){if(f(),h){var t=e.u[p+1];t?t.r():e.d=1}h=1}}),g=0;t.ondata=function(n,i,s){if(n)e.ondata(n,i,s),e.terminate();else if(g+=i.length,c.push(i),s){var a=new r(16);dt(a,0,134695760),dt(a,4,t.crc),dt(a,8,g),dt(a,12,t.size),c.push(a),d.c=g,d.b=l+g+16,d.crc=t.crc,d.size=t.size,h&&d.r(),h=1}else h&&f()},this.u.push(d)}},t.prototype.end=function(){var t=this;2&this.d?this.ondata(x(4+8*(1&this.d),0,1),null,!0):(this.d?this.e():this.u.push({r:function(){1&t.d&&(t.u.splice(-1,1),t.e())},t:function(){}}),this.d=3)},t.prototype.e=function(){for(var t=0,e=0,n=0,i=0,s=this.u;i<s.length;i++)n+=46+(u=s[i]).f.length+ae(u.extra)+(u.o?u.o.length:0);for(var a=new r(n+22),o=0,l=this.u;o<l.length;o++){var u=l[o];oe(a,t,u,u.f,u.u,-u.c-2,e,u.o),t+=46+u.f.length+ae(u.extra)+(u.o?u.o.length:0),e+=u.b}le(a,t,this.u.length,n,e),this.ondata(null,a,!0),this.d=2},t.prototype.terminate=function(){for(var t=0,e=this.u;t<e.length;t++)e[t].t();this.d=2},t}();e.Zip=he,e.zip=function(t,e,n){n||(n=e,e={}),"function"!=typeof n&&x(7);var i={};Kt(t,"",i,e);var s=Object.keys(i),a=s.length,o=0,l=0,u=a,c=new Array(a),f=[],h=function(){for(var t=0;t<f.length;++t)f[t]()},p=function(t,e){me(function(){n(t,e)})};me(function(){p=n});var d=function(){var t=new r(l+22),e=o,n=l-o;l=0;for(var i=0;i<u;++i){var s=c[i];try{var a=s.c.length;oe(t,l,s,s.f,s.u,a);var f=30+s.f.length+ae(s.extra),h=l+f;t.set(s.c,h),oe(t,o,s,s.f,s.u,a,l,s.m),o+=16+f+(s.m?s.m.length:0),l=h+a}catch(t){return p(t,null)}}le(t,o,c.length,n,e),p(null,t)};a||d();for(var g=function(t){var e=s[t],n=i[e],r=n[0],u=n[1],g=K(),v=r.length;g.p(r);var m=te(e),y=m.length,w=u.comment,A=w&&te(w),E=A&&A.length,C=ae(u.extra),b=0==u.level?0:8,z=function(n,i){if(n)h(),p(n,null);else{var r=i.length;c[t]=V(u,{size:v,crc:g.d(),c:i,f:m,m:A,u:y!=e.length||A&&w.length!=E,compression:b}),o+=30+y+C+r,l+=76+2*(y+C)+(E||0)+r,--a||d()}};if(y>65535&&z(x(11,0,1),null),b)if(v<16e4)try{z(null,_t(r,u))}catch(t){z(t,null)}else f.push(zt(r,u,z));else z(null,r)},v=0;v<u;++v)g(v);return h},e.zipSync=function(t,e){e||(e={});var n={},i=[];Kt(t,"",n,e);var s=0,a=0;for(var o in n){var l=n[o],u=l[0],c=l[1],f=0==c.level?0:8,h=(z=te(o)).length,p=c.comment,d=p&&te(p),g=d&&d.length,v=ae(c.extra);h>65535&&x(11);var m=f?_t(u,c):u,y=m.length,w=K();w.p(u),i.push(V(c,{size:u.length,crc:w.d(),c:m,f:z,m:d,u:h!=o.length||d&&p.length!=g,o:s,compression:f})),s+=30+h+v+y,a+=76+2*(h+v)+(g||0)+y}for(var A=new r(a+22),E=s,C=a-s,b=0;b<i.length;++b){var z=i[b];oe(A,z.o,z,z.f,z.u,z.c.length);var _=30+z.f.length+ae(z.extra);A.set(z.c,z.o+_),oe(A,s,z,z.f,z.u,z.c.length,z.o,z.m),s+=16+_+(z.m?z.m.length:0)}return le(A,s,i.length,C,E),A};var pe=function(){function t(){}return t.prototype.push=function(t,e){this.ondata(null,t,e)},t.compression=0,t}();e.UnzipPassThrough=pe;var de=function(){function t(){var t=this;this.i=new St(function(e,n){t.ondata(null,e,n)})}return t.prototype.push=function(t,e){try{this.i.push(t,e)}catch(t){this.ondata(t,null,e)}},t.compression=8,t}();e.UnzipInflate=de;var ge=function(){function t(t,e){var n=this;e<32e4?this.i=new St(function(t,e){n.ondata(null,t,e)}):(this.i=new Mt(function(t,e,i){n.ondata(t,e,i)}),this.terminate=this.i.terminate)}return t.prototype.push=function(t,e){this.i.terminate&&(t=k(t,0)),this.i.push(t,e)},t.compression=8,t}();e.AsyncUnzipInflate=ge;var ve=function(){function t(t){this.onfile=t,this.k=[],this.o={0:pe},this.p=G}return t.prototype.push=function(t,e){var n=this;if(this.onfile||x(5),this.p||x(4),this.c>0){var i=Math.min(this.c,t.length),s=t.subarray(0,i);if(this.c-=i,this.d?this.d.push(s,!this.c):this.k[0].push(s),(t=t.subarray(i)).length)return this.push(t,e)}else{var a=0,o=0,l=void 0,u=void 0;this.p.length?t.length?((u=new r(this.p.length+t.length)).set(this.p),u.set(t,this.p.length)):u=this.p:u=t;for(var c=u.length,f=this.c,h=f&&this.d,p=function(){var t,e=ht(u,o);if(67324752==e){a=1,l=o,d.d=null,d.c=0;var i=ft(u,o+6),r=ft(u,o+8),s=2048&i,h=8&i,p=ft(u,o+26),g=ft(u,o+28);if(c>o+30+p+g){var v=[];d.k.unshift(v),a=2;var m,y=ht(u,o+18),w=ht(u,o+22),A=ee(u.subarray(o+30,o+=30+p),!s);4294967295==y?(t=h?[-2]:se(u,o),y=t[0],w=t[1]):h&&(y=-1),o+=g,d.c=y;var E={name:A,compression:r,start:function(){if(E.ondata||x(5),y){var t=n.o[r];t||E.ondata(x(14,"unknown compression type "+r,1),null,!1),(m=y<0?new t(A):new t(A,y,w)).ondata=function(t,e,n){E.ondata(t,e,n)};for(var e=0,i=v;e<i.length;e++){var s=i[e];m.push(s,!1)}n.k[0]==v&&n.c?n.d=m:m.push(G,!0)}else E.ondata(null,G,!0)},terminate:function(){m&&m.terminate&&m.terminate()}};y>=0&&(E.size=y,E.originalSize=w),d.onfile(E)}return"break"}if(f){if(134695760==e)return l=o+=12+(-2==f&&8),a=3,d.c=0,"break";if(33639248==e)return l=o-=4,a=3,d.c=0,"break"}},d=this;o<c-4&&"break"!==p();++o);if(this.p=G,f<0){var g=a?u.subarray(0,l-12-(-2==f&&8)-(134695760==ht(u,l-16)&&4)):u.subarray(0,o);h?h.push(g,!!a):this.k[+(2==a)].push(g)}if(2&a)return this.push(u.subarray(o),e);this.p=u.subarray(o)}e&&(this.c&&x(13),this.p=null)},t.prototype.register=function(t){this.o[t.compression]=t},t}();e.Unzip=ve;var me="function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout?setTimeout:function(t){t()};e.unzip=function(t,e,n){n||(n=e,e={}),"function"!=typeof n&&x(7);var i=[],s=function(){for(var t=0;t<i.length;++t)i[t]()},a={},o=function(t,e){me(function(){n(t,e)})};me(function(){o=n});for(var l=t.length-22;101010256!=ht(t,l);--l)if(!l||t.length-l>65558)return o(x(13,0,1),null),s;var u=ft(t,l+8);if(u){var c=u,f=ht(t,l+16),h=4294967295==f||65535==c;if(h){var p=ht(t,l-12);(h=101075792==ht(t,p))&&(c=u=ht(t,p+32),f=ht(t,p+48))}for(var d=e&&e.filter,g=function(e){var n=re(t,f,h),l=n[0],c=n[1],p=n[2],g=n[3],v=n[4],m=n[5],y=ie(t,m);f=v;var w=function(t,e){t?(s(),o(t,null)):(e&&(a[g]=e),--u||o(null,a))};if(!d||d({name:g,size:c,originalSize:p,compression:l}))if(l)if(8==l){var A=t.subarray(y,y+c);if(p<524288||c>.8*p)try{w(null,Tt(A,{out:new r(p)}))}catch(t){w(t,null)}else i.push(Ut(A,{size:p},w))}else w(x(14,"unknown compression type "+l,1),null);else w(null,k(t,y,y+c));else w(null,null)},v=0;v<c;++v)g()}else o(null,{});return s},e.unzipSync=function(t,e){for(var n={},i=t.length-22;101010256!=ht(t,i);--i)(!i||t.length-i>65558)&&x(13);var s=ft(t,i+8);if(!s)return{};var a=ht(t,i+16),o=4294967295==a||65535==s;if(o){var l=ht(t,i-12);(o=101075792==ht(t,l))&&(s=ht(t,l+32),a=ht(t,l+48))}for(var u=e&&e.filter,c=0;c<s;++c){var f=re(t,a,o),h=f[0],p=f[1],d=f[2],g=f[3],v=f[4],m=f[5],y=ie(t,m);a=v,u&&!u({name:g,size:p,originalSize:d,compression:h})||(h?8==h?n[g]=Tt(t.subarray(y,y+p),{out:new r(d)}):x(14,"unknown compression type "+h):n[g]=k(t,y,y+p))}return n}}},e={};function n(i){var r=e[i];if(void 0!==r)return r.exports;var s=e[i]={exports:{}};return t[i](s,s.exports,n),s.exports}(()=>{const t=n(546),e=n(886),i=n(49);self.addEventListener("install",()=>{self.skipWaiting()}),self.addEventListener("activate",t=>{t.waitUntil(self.clients.claim())}),(0,t.installClientErrorReporting)(),(0,i.installMessageHandler)(),(0,e.installFetchHandler)()})()})();
2
2
  //# sourceMappingURL=zipServiceWorker.js.map